diff --git a/.github/workflows/tests.bella.yml b/.github/workflows/tests.bella.yml
new file mode 100644
index 00000000000..e56f1ee5ee5
--- /dev/null
+++ b/.github/workflows/tests.bella.yml
@@ -0,0 +1,32 @@
+name: Unit tests - Bella
+
+on: [pull_request]
+
+jobs:
+ test:
+
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ node-version: [12.x]
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ - name: Setup Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+ - name: Install dependencies
+ run: cd packages/bella && npm install
+ env:
+ CI: true
+ - name: Install peer & test dependencies
+ run: "cd packages/bella && npm install @freesewing/core@^2.10.2 @freesewing/plugin-bundle@^2.10.2 @freesewing/models@2.10.2 @freesewing/pattern-info@2.10.2 mocha chai"
+ env:
+ CI: true
+ - name: Build pattern
+ run: cd packages/bella && npm run build
+ - name: Run pattern unit tests
+ run: cd packages/bella && npm run testci
diff --git a/config/descriptions.yaml b/config/descriptions.yaml
index 30a1510bd13..2248dc2d4b9 100644
--- a/config/descriptions.yaml
+++ b/config/descriptions.yaml
@@ -1,5 +1,6 @@
aaron: 'A FreeSewing pattern for a A-shirt or tank top'
albert: 'A FreeSewing pattern for an apron'
+bella: 'A FreeSewing pattern for a womenswear bodice block'
benjamin: 'A FreeSewing pattern for a bow tie'
bent: 'A FreeSewing pattern for a menswear body block with a two-part sleeve'
breanna: 'A FreeSewing pattern for a basic body block for womenswear'
diff --git a/packages/bella/CHANGELOG.md b/packages/bella/CHANGELOG.md
new file mode 100644
index 00000000000..e4dc5450fe4
--- /dev/null
+++ b/packages/bella/CHANGELOG.md
@@ -0,0 +1,9 @@
+# Change log for: @freesewing/bella
+
+
+
+This is the **initial release**, and the start of this change log.
+
+> Prior to version 2, FreeSewing was not a JavaScript project.
+> As such, that history is out of scope for this change log.
+
diff --git a/packages/bella/README.md b/packages/bella/README.md
new file mode 100644
index 00000000000..8d2a3e15c26
--- /dev/null
+++ b/packages/bella/README.md
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
+## What am I looking at? 🤔
+
+This repository is our *monorepo* holding [all our NPM packages](https://www.npmjs.com/search?q=keywords:freesewing).
+This folder holds **@freesewing/bella**
+
+A FreeSewing pattern for a womenswear bodice block
+
+
+
+## About FreeSewing 💀
+
+Where the world of makers and developers collide, that's where you'll find FreeSewing.
+
+Our [core library](https://freesewing.dev/reference/api/) is a *batteries-included* toolbox
+for parametric design of sewing patterns. It's a modular system (check our list
+of [plugins](https://freesewing.dev/reference/plugins/) and getting started is as simple as:
+
+```bash
+npm init freesewing-pattern
+```
+
+The [getting started](https://freesewing.dev/guides/getting-started/) section on [freesewing.dev](https://freesewing.dev/) is a good
+entrypoint to our documentation, but you'll find a lot more there, including
+our [API reference](https://freesewing.dev/reference/api/),
+as well as [our turorial](https://freesewing.dev/tutorials/pattern-design/),
+and [howtos](https://freesewing.dev/howtos/).
+
+If you're a maker, checkout [freesewing.org](https://freesewing/) where you can generate
+our sewing patterns adapted to your measurements.
+
+## Support FreeSewing: Become a patron 🥰
+
+FreeSewing is an open source project run by a community,
+and financially supported by our patrons.
+
+If you feel what we do is worthwhile, you too
+should [become a patron](https://freesewing.org/patrons/join).
+
+## Links 👩💻
+
+ - 💻 Makers website: [freesewing.org](https://freesewing.org)
+ - 💻 Developers website: [freesewing.dev](https://freesewing.dev)
+ - 💬 Chat: On Discord via [chat.freesewing.org](https://chat.freesewing.org/)
+ - 🐦 Twitter: [@freesewing_org](https://twitter.com/freesewing_org)
+ - 📷 Instagram: [@freesewing_org](https://instagram.com/freesewing_org)
+
+## License: MIT 🤓
+
+© [Joost De Cock](https://github.com/joostdecock).
+See [the license file](https://github.com/freesewing/freesewing/blob/develop/LICENSE) for details.
+
+## Where to get help 🤯
+
+Our [chatrooms on Discord](https://chat.freesewing.org/) are the best place to ask questions,
+share your feedback, or just hang out.
+
+If you want to report a problem, please [create an issue](https://github.com/freesewing/freesewing/issues/new).
diff --git a/packages/bella/config/index.js b/packages/bella/config/index.js
new file mode 100644
index 00000000000..c2fad0168da
--- /dev/null
+++ b/packages/bella/config/index.js
@@ -0,0 +1,82 @@
+import { version } from '../package.json'
+
+export default {
+ name: 'bella',
+ version,
+ design: 'Bella Incognito',
+ code: 'Joost De Cock',
+ department: 'womenswear',
+ type: 'block',
+ difficulty: 3,
+ tags: ['block', 'top', 'basics'],
+ optionGroups: {
+ fit: ['chestEase', 'waistEase'],
+ advanced: [
+ 'backNeckCutout',
+ 'backHemSlope',
+ 'backDartHeight',
+ 'armholeDepth',
+ 'backArmholeSlant',
+ 'backArmholeCurvature',
+ 'frontShoulderWidth',
+ 'frontArmholePitchDepth',
+ 'backArmholePitchDepth',
+ 'highBustWidth'
+ ]
+ },
+ measurements: [
+ 'highBust',
+ 'chest',
+ 'underbust',
+ 'waist',
+ 'waistBack',
+ //'waistToHips',
+ //'hips',
+ 'bustSpan',
+ 'neck',
+ 'hpsToBust',
+ 'hpsToWaistFront',
+ 'hpsToWaistBack',
+ 'shoulderToShoulder',
+ 'shoulderSlope'
+ // FIXME: Measurement from waist up to armhole (for sleeveless)
+ ],
+ dependencies: {
+ back: 'frontSideDart'
+ },
+ inject: {},
+ hide: [],
+ parts: [
+ 'back',
+ 'frontSideDart'
+ // 'frontShoulderDart'
+ ],
+ options: {
+ // Constants
+ acrossBackFactor: 0.925,
+ shoulderSlopeBack: 1.23,
+ neckWidthBack: 0.197,
+ neckWidthFront: 0.17,
+ shoulderToShoulderCorrection: 0.995,
+ backDartLocation: 0.145,
+ backCenterWaistReduction: 0.35,
+ collarFactor: 0.19,
+
+ // Percentages
+ backNeckCutout: { pct: 6, min: 3, max: 9 },
+ waistEase: { pct: 5, min: 1, max: 9 },
+ chestEase: { pct: 11, min: 5, max: 20 },
+ backDartHeight: { pct: 46, min: 38, max: 54 },
+ armholeDepth: { pct: 44, min: 38, max: 50 },
+ backHemSlope: { deg: 2.5, min: 0, max: 5 },
+ backArmholeSlant: { deg: 5, min: 2, max: 8 },
+ backArmholeCurvature: { pct: 63, min: 50, max: 85 },
+ frontArmholeCurvature: { pct: 63, min: 50, max: 85 },
+ fullChestEaseReduction: { pct: 4, min: 0, max: 8 },
+ frontShoulderWidth: { pct: 95, max: 98, min: 92 },
+ frontArmholePitchDepth: { pct: 29, max: 35, min: 24 },
+ backArmholePitchDepth: { pct: 35, max: 40, min: 30 },
+ highBustWidth: { pct: 86, max: 92, min: 80 },
+ bustDartLength: { pct: 92, min: 85, max: 98 }
+ }
+}
diff --git a/packages/bella/example/.babelrc b/packages/bella/example/.babelrc
new file mode 100644
index 00000000000..a6551f4342d
--- /dev/null
+++ b/packages/bella/example/.babelrc
@@ -0,0 +1,13 @@
+{
+ "plugins": [
+ [
+ "prismjs",
+ {
+ "languages": ["javascript", "css", "markup"],
+ "plugins": ["line-numbers"],
+ "theme": "twilight",
+ "css": true
+ }
+ ]
+ ]
+}
diff --git a/packages/bella/example/README.md b/packages/bella/example/README.md
new file mode 100644
index 00000000000..3fa4943e0a8
--- /dev/null
+++ b/packages/bella/example/README.md
@@ -0,0 +1,96 @@
+
+
+
+FreeSewing v2
+
+A JavaScript library for made-to-measure sewing patterns
+
+
+
+
+
+
+
+# bella example
+
+This project was bootstrapped with [Create Freesewing Pattern](https://en.freesewing.dev/create-freesewing-pattern):
+
+```js
+npm init freesewing-pattern
+```
+
+This example folder is part of the local development environment.
+It is **not** part of the pattern's source code.
+
+To run this example, follow these steps:
+
+ - In the folder above this one, run: `yarn start` (or `npm start`)
+ - Then, in new terminal, run the same command in this folder: `yarn start` (or `npm start`)
+
+This will spin up the development environment, similar to [our online demo](https://bella.freesewing.dev/).
+
+## About FreeSewing 🤔
+
+Where the world of makers and developers collide, that's where you'll find FreeSewing.
+
+Our [core library](https://freesewing.dev/en/freesewing) is a *batteries-included* toolbox
+for parametric design of sewing patterns. It's a modular system (check our list
+of [plugins](https://freesewing.dev/en/plugins) and getting started is as simple as:
+
+```bash
+npm init freesewing-pattern
+```
+
+The [getting started] section on [freesewing.dev](https://freesewing.dev/) is a good
+entrypoint to our documentation, but you'll find a lot more there, including
+our [API documentation](https://freesewing.dev/en/freesewing/api),
+as well as [examples](https://freesewing.dev/en/freesewing/examples),
+and [best practices](https://freesewing.dev/en/do).
+
+If you're a maker, checkout [freesewing.org](https://freesewing/) where you can generate
+our sewing patterns adapted to your measurements.
+
+## Support FreeSewing: Become a patron 🥰
+
+FreeSewing is an open source project run by a community,
+and financially supported by our patrons.
+
+If you feel what we do is worthwhile, you too
+should [become a patron](https://freesewing.org/patrons/join).
+
+## Links 👩💻
+
+ - 💻 Makers website: [freesewing.org](https://freesewing.org)
+ - 💻 Developers website: [freesewing.dev](https://freesewing.org)
+ - 💬 Chat: [gitter.im/freesewing](https://gitter.im/freesewing/freesewing)
+ - 🐦 Twitter: [@freesewing_org](https://twitter.com/freesewing_org)
+ - 📷 Instagram: [@freesewing_org](https://instagram.com/freesewing_org)
+
+## License: MIT 🤓
+
+© [Joost De Cock](https://github.com/joostdecock).
+See [the license file](https://github.com/freesewing/freesewing/blob/develop/LICENSE) for details.
+
+## Where to get help 🤯
+
+Our [chatroom on Gitter](https://gitter.im) is the best place to ask questions,
+share your feedback, or just hang out.
+
+If you want to report a problem, please [create an issue](https://github.com/freesewing/freesewing/issues/new).
+
diff --git a/packages/bella/example/netlify.toml b/packages/bella/example/netlify.toml
new file mode 100644
index 00000000000..7df6648b739
--- /dev/null
+++ b/packages/bella/example/netlify.toml
@@ -0,0 +1,9 @@
+[build]
+ base = "packages/bella/example"
+ publish = "build"
+ command = "npm run build"
+
+[[redirects]]
+ from = "/*"
+ to = "/index.html"
+ status = 200
diff --git a/packages/bella/example/package.json b/packages/bella/example/package.json
new file mode 100644
index 00000000000..85dd6ecdd5c
--- /dev/null
+++ b/packages/bella/example/package.json
@@ -0,0 +1,50 @@
+{
+ "name": "bella",
+ "homepage": "https://bella.freesewing.dev/",
+ "version": "2.10.2",
+ "private": true,
+ "dependencies": {
+ "@freesewing/components": "latest",
+ "@freesewing/core": "latest",
+ "@freesewing/css-theme": "latest",
+ "@freesewing/i18n": "latest",
+ "@freesewing/models": "latest",
+ "@freesewing/mui-theme": "latest",
+ "@freesewing/pattern-info": "latest",
+ "@freesewing/plugin-bundle": "latest",
+ "@freesewing/plugin-theme": "latest",
+ "@freesewing/plugin-i18n": "latest",
+ "@freesewing/plugin-svgattr": "latest",
+ "@freesewing/utils": "latest",
+ "@material-ui/core": "^4.11.0",
+ "@material-ui/icons": "^4.9.1",
+ "@material-ui/lab": "^v4.0.0-alpha.56",
+ "pattern": "link:..",
+ "prismjs": "1.22.0",
+ "react": "^16.13",
+ "react-dom": "^16.13",
+ "react-scripts": "^3.4.1",
+ "file-saver": "^2.0.2",
+ "react-markdown": "4.3.1",
+ "typeface-roboto-condensed": "latest",
+ "typeface-raleway": "latest"
+ },
+ "scripts": {
+ "start": "react-scripts start",
+ "build": "react-scripts build",
+ "test": "react-scripts test",
+ "eject": "react-scripts eject"
+ },
+ "eslintConfig": {
+ "extends": "react-app"
+ },
+ "browserslist": [
+ ">0.2%",
+ "not dead",
+ "not ie <= 11",
+ "not op_mini all"
+ ],
+ "devDependencies": {
+ "babel-plugin-prismjs": "2.0.1"
+ }
+}
diff --git a/packages/bella/example/public/favicon.ico b/packages/bella/example/public/favicon.ico
new file mode 100644
index 00000000000..95061a260f1
Binary files /dev/null and b/packages/bella/example/public/favicon.ico differ
diff --git a/packages/bella/example/public/index.html b/packages/bella/example/public/index.html
new file mode 100644
index 00000000000..d62cf60a401
--- /dev/null
+++ b/packages/bella/example/public/index.html
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+ bella
+
+
+
+ You need to enable JavaScript to run this app.
+
+
+
+
+
diff --git a/packages/bella/example/public/manifest.json b/packages/bella/example/public/manifest.json
new file mode 100644
index 00000000000..0f425d91dfb
--- /dev/null
+++ b/packages/bella/example/public/manifest.json
@@ -0,0 +1,15 @@
+{
+ "short_name": "bella",
+ "name": "bella",
+ "icons": [
+ {
+ "src": "favicon.ico",
+ "sizes": "64x64 32x32 24x24 16x16",
+ "type": "image/x-icon"
+ }
+ ],
+ "start_url": ".",
+ "display": "standalone",
+ "theme_color": "#000000",
+ "background_color": "#ffffff"
+}
diff --git a/packages/bella/example/src/App.js b/packages/bella/example/src/App.js
new file mode 100644
index 00000000000..562ad9dabc0
--- /dev/null
+++ b/packages/bella/example/src/App.js
@@ -0,0 +1,29 @@
+import React from 'react'
+import freesewing from '@freesewing/core'
+import Workbench from '@freesewing/components/Workbench'
+import 'typeface-roboto-condensed'
+import 'typeface-raleway'
+import '@freesewing/css-theme'
+
+import Pattern from 'pattern'
+
+const App = (props) => {
+ // You can use this to add transations
+ /*
+ let translations = {
+ JSON: 'JSON',
+ someOtherString: 'Some other string that needs translation'
+ }
+ */
+
+ return (
+
+ )
+}
+
+export default App
diff --git a/packages/bella/example/src/index.js b/packages/bella/example/src/index.js
new file mode 100644
index 00000000000..9dd7ba788d4
--- /dev/null
+++ b/packages/bella/example/src/index.js
@@ -0,0 +1,11 @@
+import React from 'react'
+import ReactDOM from 'react-dom'
+import App from './App'
+import * as serviceWorker from './serviceWorker'
+
+ReactDOM.render( , document.getElementById('root'))
+
+// If you want your app to work offline and load faster, you can change
+// unregister() to register() below. Note this comes with some pitfalls.
+// Learn more about service workers: http://bit.ly/CRA-PWA
+serviceWorker.unregister()
diff --git a/packages/bella/example/src/serviceWorker.js b/packages/bella/example/src/serviceWorker.js
new file mode 100644
index 00000000000..44e1b1b2f8c
--- /dev/null
+++ b/packages/bella/example/src/serviceWorker.js
@@ -0,0 +1,123 @@
+// In production, we register a service worker to serve assets from local cache.
+
+// This lets the app load faster on subsequent visits in production, and gives
+// it offline capabilities. However, it also means that developers (and users)
+// will only see deployed updates on the "N+1" visit to a page, since previously
+// cached resources are updated in the background.
+
+// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
+// This link also includes instructions on opting out of this behavior.
+
+const isLocalhost = Boolean(
+ window.location.hostname === 'localhost' ||
+ // [::1] is the IPv6 localhost address.
+ window.location.hostname === '[::1]' ||
+ // 127.0.0.1/8 is considered localhost for IPv4.
+ window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)
+)
+
+export function register(config) {
+ if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
+ // The URL constructor is available in all browsers that support SW.
+ const publicUrl = new URL(process.env.PUBLIC_URL, window.location)
+ if (publicUrl.origin !== window.location.origin) {
+ // Our service worker won't work if PUBLIC_URL is on a different origin
+ // from what our page is served on. This might happen if a CDN is used to
+ // serve assets; see https://github.com/facebook/create-react-app/issues/2374
+ return
+ }
+
+ window.addEventListener('load', () => {
+ const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`
+
+ if (isLocalhost) {
+ // This is running on localhost. Let's check if a service worker still exists or not.
+ checkValidServiceWorker(swUrl, config)
+
+ // Add some additional logging to localhost, pointing developers to the
+ // service worker/PWA documentation.
+ navigator.serviceWorker.ready.then(() => {
+ console.log(
+ 'This web app is being served cache-first by a service ' +
+ 'worker. To learn more, visit https://goo.gl/SC7cgQ'
+ )
+ })
+ } else {
+ // Is not local host. Just register service worker
+ registerValidSW(swUrl, config)
+ }
+ })
+ }
+}
+
+function registerValidSW(swUrl, config) {
+ navigator.serviceWorker
+ .register(swUrl)
+ .then(registration => {
+ registration.onupdatefound = () => {
+ const installingWorker = registration.installing
+ installingWorker.onstatechange = () => {
+ if (installingWorker.state === 'installed') {
+ if (navigator.serviceWorker.controller) {
+ // At this point, the old content will have been purged and
+ // the fresh content will have been added to the cache.
+ // It's the perfect time to display a "New content is
+ // available; please refresh." message in your web app.
+ console.log('New content is available; please refresh.')
+
+ // Execute callback
+ if (config.onUpdate) {
+ config.onUpdate(registration)
+ }
+ } else {
+ // At this point, everything has been precached.
+ // It's the perfect time to display a
+ // "Content is cached for offline use." message.
+ console.log('Content is cached for offline use.')
+
+ // Execute callback
+ if (config.onSuccess) {
+ config.onSuccess(registration)
+ }
+ }
+ }
+ }
+ }
+ })
+ .catch(error => {
+ console.error('Error during service worker registration:', error)
+ })
+}
+
+function checkValidServiceWorker(swUrl, config) {
+ // Check if the service worker can be found. If it can't reload the page.
+ fetch(swUrl)
+ .then(response => {
+ // Ensure service worker exists, and that we really are getting a JS file.
+ if (
+ response.status === 404 ||
+ response.headers.get('content-type').indexOf('javascript') === -1
+ ) {
+ // No service worker found. Probably a different app. Reload the page.
+ navigator.serviceWorker.ready.then(registration => {
+ registration.unregister().then(() => {
+ window.location.reload()
+ })
+ })
+ } else {
+ // Service worker found. Proceed as normal.
+ registerValidSW(swUrl, config)
+ }
+ })
+ .catch(() => {
+ console.log('No internet connection found. App is running in offline mode.')
+ })
+}
+
+export function unregister() {
+ if ('serviceWorker' in navigator) {
+ navigator.serviceWorker.ready.then(registration => {
+ registration.unregister()
+ })
+ }
+}
diff --git a/packages/bella/package.json b/packages/bella/package.json
new file mode 100644
index 00000000000..2e6e7606e82
--- /dev/null
+++ b/packages/bella/package.json
@@ -0,0 +1,94 @@
+{
+ "name": "@freesewing/bella",
+ "version": "2.10.2",
+ "description": "A FreeSewing pattern for a womenswear bodice block",
+ "author": "Joost De Cock (https://github.com/joostdecock)",
+ "homepage": "https://freesewing.org/",
+ "repository": "github:freesewing/freesewing",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/freesewing/freesewing/issues"
+ },
+ "keywords": [
+ "freesewing",
+ "design",
+ "diy",
+ "fashion",
+ "made to measure",
+ "parametric design",
+ "pattern",
+ "sewing",
+ "sewing pattern"
+ ],
+ "main": "dist/index.js",
+ "module": "dist/index.mjs",
+ "scripts": {
+ "clean": "rimraf dist",
+ "build": "rollup -c",
+ "test": "BABEL_ENV=production ../../node_modules/.bin/_mocha tests/*.test.js --require @babel/register",
+ "pubtest": "npm publish --registry http://localhost:6662",
+ "pubforce": "npm publish",
+ "symlink": "mkdir -p ./node_modules/@freesewing && cd ./node_modules/@freesewing && ln -s -f ../../../* . && cd -",
+ "start": "rollup -c -w",
+ "netlify": "echo \"Not configured yet\"",
+ "testci": "BABEL_ENV=production ./node_modules/.bin/_mocha tests/*.test.js --require @babel/register"
+ },
+ "peerDependencies": {
+ "@freesewing/core": "^2.10.2",
+ "@freesewing/plugin-bundle": "^2.10.2"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "react": "^16.13.1",
+ "react-dom": "^16.13.1",
+ "@babel/plugin-proposal-class-properties": "^7.10.4",
+ "babel-eslint": "^10.1.0",
+ "eslint": "^7.6.0",
+ "babel-jest": "^26.2.2",
+ "jest": "26.2.2",
+ "@freesewing/components": "^2.10.2",
+ "@freesewing/css-theme": "^2.10.2",
+ "@freesewing/i18n": "^2.10.2",
+ "@freesewing/mui-theme": "^2.10.2",
+ "@freesewing/plugin-bust": "^2.10.2",
+ "@freesewing/plugin-buttons": "^2.10.2",
+ "@freesewing/plugin-flip": "^2.10.2",
+ "@freesewing/utils": "^2.10.2",
+ "@svgr/rollup": "^2.4.1",
+ "cross-env": "^7.0.2",
+ "react-scripts": "^3.4.1",
+ "webpack": "^4.44.1",
+ "rollup": "^2.23.0",
+ "@rollup/plugin-babel": "^5.1.0",
+ "rollup-plugin-terser": "^6.1.0",
+ "@rollup/plugin-commonjs": "^14.0.0",
+ "@rollup/plugin-json": "^4.1.0",
+ "@rollup/plugin-node-resolve": "^8.4.0",
+ "rollup-plugin-peer-deps-external": "^2.2.3",
+ "@material-ui/core": "^4.11.0",
+ "@material-ui/icons": "4.9.1",
+ "@material-ui/lab": "^v4.0.0-alpha.56",
+ "react-intl": "^5.4.5",
+ "prop-types": "^15.7.2",
+ "mocha": "^8.1.0",
+ "chai": "^4.2.0",
+ "chai-string": "^1.5.0",
+ "@babel/register": "^7.10.5"
+ },
+ "files": [
+ "dist/*",
+ "README.md",
+ "package.json"
+ ],
+ "publishConfig": {
+ "access": "public",
+ "tag": "latest"
+ },
+ "engines": {
+ "node": ">=12.0.0",
+ "npm": ">=6"
+ },
+ "rollup": {
+ "exports": "default"
+ }
+}
diff --git a/packages/bella/rollup.config.js b/packages/bella/rollup.config.js
new file mode 100644
index 00000000000..a885f4cb4ec
--- /dev/null
+++ b/packages/bella/rollup.config.js
@@ -0,0 +1,37 @@
+import resolve from '@rollup/plugin-node-resolve'
+import commonjs from '@rollup/plugin-commonjs'
+import json from '@rollup/plugin-json'
+import { terser } from 'rollup-plugin-terser'
+import peerDepsExternal from 'rollup-plugin-peer-deps-external'
+import { name, version, description, author, license, main, module, rollup } from './package.json'
+
+const output = [
+ {
+ file: main,
+ format: 'cjs',
+ sourcemap: true,
+ exports: rollup.exports
+ }
+]
+if (typeof module !== 'undefined')
+ output.push({
+ file: module,
+ format: 'es',
+ sourcemap: true
+ })
+
+export default {
+ input: 'src/index.js',
+ output,
+ plugins: [
+ peerDepsExternal(),
+ resolve({ modulesOnly: true }),
+ commonjs(),
+ json(),
+ terser({
+ output: {
+ preamble: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
+ }
+ })
+ ]
+}
diff --git a/packages/bella/src/back.js b/packages/bella/src/back.js
new file mode 100644
index 00000000000..5827c1540d1
--- /dev/null
+++ b/packages/bella/src/back.js
@@ -0,0 +1,170 @@
+export default function (part) {
+ let {
+ store,
+ sa,
+ Point,
+ points,
+ Path,
+ paths,
+ options,
+ complete,
+ paperless,
+ macro,
+ utils,
+ units,
+ measurements,
+ Snippet,
+ snippets,
+ raise
+ } = part.shorthand()
+
+ // Add original outline
+ points.origin = new Point(0, 0)
+ snippets.base = new Snippet('bella-back', points.origin)
+
+ // Get to work
+ points.cbNeck = new Point(0, measurements.neck * options.backNeckCutout)
+ points.hps = new Point(measurements.neck * options.neckWidthBack, 0)
+ points.cbNeckCp1 = new Point(points.hps.x * 0.8, points.cbNeck.y)
+ let slope = measurements.shoulderSlope * options.shoulderSlopeBack * -1
+ points.shoulder = utils.beamsIntersect(
+ new Point((measurements.shoulderToShoulder * options.shoulderToShoulderCorrection) / 2, 0),
+ new Point((measurements.shoulderToShoulder * options.shoulderToShoulderCorrection) / 2, 100),
+ points.hps,
+ points.hps.shift(slope, 85)
+ )
+ points.armholePitch = new Point(
+ points.shoulder.x * options.acrossBackFactor,
+ measurements.hpsToWaistBack * options.backArmholePitchDepth
+ )
+
+ // Construct waist and dart
+ points.dartTip = new Point(
+ measurements.underbust * options.backDartLocation,
+ measurements.hpsToWaistBack * options.backDartHeight
+ )
+ let backWidth = (measurements.underbust / 4) * (1 + options.chestEase)
+ let waistWidth = (measurements.waistBack / 2) * (1 + options.waistEase)
+ let reduction = backWidth - waistWidth
+ points.cbWaist = new Point(0, measurements.hpsToWaistBack)
+ points.waistCenter = points.cbWaist.shift(0, reduction * options.backCenterWaistReduction)
+ points.waistSide = points.waistCenter.shift(
+ options.backHemSlope,
+ waistWidth + reduction * (1 - options.backCenterWaistReduction / 2)
+ )
+ points.dartBottomCenter = utils.beamIntersectsX(
+ points.waistCenter,
+ points.waistSide,
+ points.dartTip.x
+ )
+ points.dartBottomLeft = points.dartBottomCenter.shift(
+ 180,
+ (reduction * (1 - options.backCenterWaistReduction * 0.5)) / 2
+ )
+ points.dartBottomRight = points.dartBottomLeft.rotate(180, points.dartBottomCenter)
+ points.dartLeftCp = points.dartBottomLeft.shift(90, points.dartTip.dy(points.dartBottomLeft) / 2)
+ points.dartRightCp = new Point(points.dartBottomRight.x, points.dartLeftCp.y)
+ // Find out location of the armhole
+ let armholeDepth = measurements.hpsToWaistBack * options.armholeDepth + points.shoulder.y
+ points.cbNeckCp2 = new Point(0, armholeDepth)
+ points.dartLeftArmhole = utils.curveIntersectsY(
+ points.dartBottomLeft,
+ points.dartLeftCp,
+ points.dartTip,
+ points.dartTip,
+ armholeDepth
+ )
+ points.cbArmhole = utils.curveIntersectsY(
+ points.cbNeck,
+ points.cbNeckCp2,
+ points.waistCenter,
+ points.waistCenter,
+ armholeDepth
+ )
+ let extra = points.dartLeftArmhole.dx(points.dartTip) * 2 + points.cbArmhole.x
+ points.armhole = new Point(
+ (measurements.underbust / 4) * (1 + options.chestEase) + extra,
+ armholeDepth
+ )
+
+ // Control points for the side seam
+ points.waistSideCp2 = points.waistSide.shift(90, points.armhole.dy(points.waistSide) / 2)
+
+ // Construct armhole
+ points.armholeCp2 = points.armhole.shift(180 - options.backArmholeSlant, 40)
+ points.armholePitchCp1 = points.armholePitch.shift(-90 - options.backArmholeSlant, 40)
+ points.armholeCpTarget = utils.beamsIntersect(
+ points.armhole,
+ points.armhole.shift(180 - options.backArmholeSlant, 40),
+ points.armholePitch,
+ points.armholePitch.shift(-90 - options.backArmholeSlant, 40)
+ )
+ points.armholeCp2 = points.armhole.shiftFractionTowards(
+ points.armholeCpTarget,
+ options.backArmholeCurvature
+ )
+ points.armholePitchCp1 = points.armholePitch.shiftFractionTowards(
+ points.armholeCpTarget,
+ options.backArmholeCurvature
+ )
+ points.armholePitchCp2 = points.armholePitchCp1.rotate(180, points.armholePitch)
+
+ // Store the back width at bust level
+ points.bustSide = utils.curveIntersectsY(
+ points.waistSide,
+ points.waistSideCp2,
+ points.armhole,
+ points.armhole,
+ measurements.hpsToBust
+ )
+ if (!points.bustSide) raise.error('Could not find bust height in side seam of back part')
+ points.bustCenter = utils.curveIntersectsY(
+ points.cbNeck,
+ points.cbNeckCp2,
+ points.waistCenter,
+ points.waistCenter,
+ measurements.hpsToBust
+ )
+ if (!points.bustCenter) raise.error('Could not find bust height in center seam of back part')
+ points.bustDartLeft = utils.curveIntersectsY(
+ points.dartBottomLeft,
+ points.dartLeftCp,
+ points.dartTip,
+ points.dartTip,
+ measurements.hpsToBust
+ )
+ if (!points.bustDartLeft) raise.error('Could not find bust height in back dart')
+ points.bustDartRight = points.bustDartLeft.flipX(points.dartTip)
+ store.set(
+ 'bustWidthBack',
+ points.bustCenter.dx(points.bustDartLeft) + points.bustDartRight.dx(points.bustSide)
+ )
+
+ // Store things we'll need in the front parts
+ store.set(
+ 'sideSeamLength',
+ new Path().move(points.waistSide).curve_(points.waistSideCp2, points.armhole).length()
+ )
+ store.set(
+ 'backHemLength',
+ points.waistCenter.dist(points.dartBottomLeft) + points.dartBottomRight.dist(points.waistSide)
+ )
+ store.set('sideReduction', points.armhole.x - points.waistSide.x)
+
+ paths.saBase = new Path()
+ .move(points.cbNeck)
+ .curve_(points.cbNeckCp2, points.waistCenter)
+ .line(points.dartBottomLeft)
+ .curve_(points.dartLeftCp, points.dartTip)
+ ._curve(points.dartRightCp, points.dartBottomRight)
+ .line(points.waistSide)
+ .curve_(points.waistSideCp2, points.armhole)
+ .curve(points.armholeCp2, points.armholePitchCp1, points.armholePitch)
+ .curve_(points.armholePitchCp2, points.shoulder)
+ .line(points.hps)
+ ._curve(points.cbNeckCp1, points.cbNeck)
+ .close()
+ .attr('class', 'fabric')
+
+ return part
+}
diff --git a/packages/bella/src/bella.js b/packages/bella/src/bella.js
new file mode 100644
index 00000000000..9b445846100
--- /dev/null
+++ b/packages/bella/src/bella.js
@@ -0,0 +1,17 @@
+// Plugin that provides the base outlines
+const bella = {
+ name: 'bella',
+ version: 1,
+ hooks: {
+ preRender: function (svg) {
+ if (svg.attributes.get('freesewing:plugin-bella') === false)
+ svg.attributes.set('freesewing:plugin-bella', 1)
+ let style = 'stroke: #3bc9db; stroke-width: 1; fill: none;'
+ svg.defs += ` `
+ svg.defs += ` `
+ svg.defs += ` `
+ }
+ }
+}
+
+export default bella
diff --git a/packages/bella/src/front-shoulder-dart.js b/packages/bella/src/front-shoulder-dart.js
new file mode 100644
index 00000000000..051864659af
--- /dev/null
+++ b/packages/bella/src/front-shoulder-dart.js
@@ -0,0 +1,29 @@
+export default function (part) {
+ let {
+ store,
+ sa,
+ Point,
+ points,
+ Path,
+ paths,
+ options,
+ complete,
+ paperless,
+ macro,
+ utils,
+ units,
+ measurements,
+ Snippet,
+ snippets
+ } = part.shorthand()
+
+ points.origin = new Point(0, 0)
+ snippets.base = new Snippet('bella-front-shoulder-dart', points.origin)
+
+ points.a = new Point(0, 0)
+ points.b = new Point(280, 450)
+
+ paths.diag = new Path().move(points.a).line(points.b).attr('class', 'hidden')
+
+ return part
+}
diff --git a/packages/bella/src/front-side-dart.js b/packages/bella/src/front-side-dart.js
new file mode 100644
index 00000000000..d6b3178f9bf
--- /dev/null
+++ b/packages/bella/src/front-side-dart.js
@@ -0,0 +1,181 @@
+export default function (part) {
+ let {
+ store,
+ sa,
+ Point,
+ points,
+ Path,
+ paths,
+ options,
+ complete,
+ paperless,
+ macro,
+ utils,
+ units,
+ measurements,
+ Snippet,
+ snippets
+ } = part.shorthand()
+
+ // Add original outline
+ points.origin = new Point(0, 0)
+ snippets.base = new Snippet('bella-front-side-dart', points.origin)
+
+ // Diagonal line to make sure the original outline isn't cropped
+ points.a = new Point(0, 0)
+ points.b = new Point(290, 450)
+ paths.diag = new Path().move(points.a).line(points.b).attr('class', 'hidden')
+
+ // Get to work
+ points.cfNeck = new Point(0, measurements.neck * options.collarFactor)
+ points.hps = new Point(measurements.neck * options.neckWidthFront, 0)
+ points.cfNeckCp1 = new Point(points.hps.x * 0.8, points.cfNeck.y)
+ points.hpsCp2 = new Point(points.hps.x, points.cfNeck.y / 2)
+ let slope = measurements.shoulderSlope * (2 - options.shoulderSlopeBack) * -1
+ let xShoulder =
+ ((measurements.shoulderToShoulder * options.shoulderToShoulderCorrection) / 2) *
+ options.frontShoulderWidth
+ points.shoulder = utils.beamsIntersect(
+ new Point(xShoulder, 0),
+ new Point(xShoulder, 100),
+ points.hps,
+ points.hps.shift(slope, 85)
+ )
+ // Front is more narrow
+ points.ex = points.shoulder.shift(180, 10)
+ points.armholePitch = new Point(
+ points.shoulder.x * options.acrossBackFactor,
+ measurements.hpsToWaistBack * options.frontArmholePitchDepth
+ )
+ // Find out location of the armhole
+ let armholeDepth = measurements.hpsToWaistBack * options.armholeDepth + points.shoulder.y
+ points.armhole = new Point(
+ (measurements.highBust / 4) * (1 + options.chestEase) * options.highBustWidth,
+ armholeDepth
+ )
+
+ // Bust point
+ points.bust = new Point(measurements.bustSpan / 2, measurements.hpsToBust)
+
+ // Construct armhole
+ points.armholeCp2 = points.armhole.shift(180, 40)
+ points.armholePitchCp1 = points.armholePitch.shift(-90, 40)
+ points.armholeCpTarget = utils.beamsIntersect(
+ points.armhole,
+ points.armhole.shift(180, 40),
+ points.armholePitch,
+ points.armholePitch.shift(-90, 40)
+ )
+ points.armholeCp2 = points.armhole.shiftFractionTowards(
+ points.armholeCpTarget,
+ options.frontArmholeCurvature
+ )
+ points.armholePitchCp1 = points.armholePitch.shiftFractionTowards(
+ points.armholeCpTarget,
+ options.frontArmholeCurvature
+ )
+ points.armholePitchCp2 = points.armholePitchCp1.rotate(180, points.armholePitch)
+
+ // Draft body without breasts
+ points.cfHem = new Point(0, measurements.hpsToWaistFront)
+ points.sideHem = new Point(points.armhole.x, points.cfHem.y)
+
+ // Create room for breasts
+ // How much horizontal room do we need to add?
+ let target =
+ (measurements.chest * (1 + options.chestEase - options.fullChestEaseReduction)) / 2 -
+ store.get('bustWidthBack')
+ let rot = ['armhole', 'armholeCp2', 'armholePitchCp1', 'bustB', 'sideHem']
+ // Rotate until we've got enough room
+ points.bustA = points.bust.clone()
+ points.bustB = points.bust.clone()
+ points.bustSide = utils.beamIntersectsY(points.armhole, points.sideHem, points.bust.y)
+ let steps = 0
+ let angle = 0
+ let increment = 0.5
+ while (points.bustSide.x < target && steps < 80) {
+ for (const p of rot) points[p] = points[p].rotate(increment, points.armholePitch)
+ angle += increment
+ points.bustSide = utils.beamIntersectsY(points.armhole, points.sideHem, points.bust.y)
+ steps++
+ }
+ store.set('bustDartAngleSide', angle)
+
+ // Smooth out the armhole pitch point
+ points.pitchMax = utils.beamsIntersect(
+ points.armholePitchCp1,
+ points.armholePitchCp2,
+ points.armholePitch,
+ points.armholePitch.shift(points.armholePitchCp1.angle(points.armholePitchCp2) - 90, 30)
+ )
+ points.armholePitch = points.armholePitch.shiftFractionTowards(points.pitchMax, 0.2)
+ points.armholePitchCp1 = points.armholePitch.shiftFractionTowards(
+ points.armholePitchCp2.rotate(180, points.armholePitch),
+ 0.8
+ )
+
+ // Bust dart
+ points.bustDartTop = utils.beamsIntersect(
+ points.armhole,
+ points.sideHem,
+ points.bust,
+ points.bust.shift(0, 100)
+ )
+ points.bustDartBottom = points.bustDartTop.rotate(angle * -1, points.bust)
+ points.bustDartTip = points.bustDartTop.shiftFractionTowards(points.bust, options.bustDartLength)
+
+ // Side seam length
+ let aboveDart = points.armhole.dist(points.bustDartTop)
+ let belowDart = store.get('sideSeamLength') - aboveDart
+ points.sideHemInitial = points.bustDartBottom
+ .shift(-90, belowDart)
+ .shift(180, store.get('sideReduction'))
+ points.sideHem = points.bustDartBottom.shiftTowards(points.sideHemInitial, belowDart)
+
+ // Hem
+ let hemLen = (measurements.waist / 2) * (1 + options.waistEase) - store.get('backHemLength')
+ let reduce = points.cfHem.dist(points.sideHemInitial) - hemLen
+
+ // Waist dart
+ points.waistDartHem = new Point(points.bustDartTip.x, points.cfHem.y)
+ points.waistDartLeft = points.waistDartHem.shift(180, reduce / 2)
+ points.waistDartRight = points.waistDartHem.shift(0, reduce / 2)
+ points.waistDartTip = points.waistDartHem.shiftFractionTowards(
+ points.bustDartTip,
+ options.bustDartLength
+ )
+ points.waistDartLeftCp = points.waistDartLeft.shift(
+ 90,
+ points.waistDartHem.dist(points.bustDartTip) / 2
+ )
+ points.waistDartRightCp = points.waistDartRight.shift(
+ 90,
+ points.waistDartHem.dist(points.bustDartTip) / 2
+ )
+
+ points.f = new Point(0, 445.5)
+ points.g = new Point(95, 451)
+ points.h = new Point(144, 451)
+ points.i = new Point(258, 443)
+ points.i = new Point(0, 260)
+ points.j = new Point(274, 260)
+
+ paths.saBase = new Path()
+ .move(points.cfHem)
+ .line(points.waistDartLeft)
+ .curve_(points.waistDartLeftCp, points.waistDartTip)
+ ._curve(points.waistDartRightCp, points.waistDartRight)
+ .line(points.sideHem)
+ .line(points.bustDartBottom)
+ .line(points.bustDartTip)
+ .line(points.bustDartTop)
+ .line(points.armhole)
+ .curve(points.armholeCp2, points.armholePitchCp1, points.armholePitch)
+ .curve_(points.armholePitchCp2, points.shoulder)
+ .line(points.hps)
+ .curve(points.hpsCp2, points.cfNeckCp1, points.cfNeck)
+ .line(points.cfHem)
+ .attr('class', 'fabric')
+
+ return part
+}
diff --git a/packages/bella/src/index.js b/packages/bella/src/index.js
new file mode 100644
index 00000000000..d529fcd1f00
--- /dev/null
+++ b/packages/bella/src/index.js
@@ -0,0 +1,20 @@
+import freesewing from '@freesewing/core'
+import plugins from '@freesewing/plugin-bundle'
+import config from '../config'
+// Parts
+import draftBack from './back'
+import draftFrontSideDart from './front-side-dart'
+import draftFrontShoulderDart from './front-shoulder-dart'
+
+// Base outlines
+import bellaPlugin from './bella'
+
+// Create design
+const Pattern = new freesewing.Design(config, [plugins, bellaPlugin])
+
+// Attach draft methods to prototype
+Pattern.prototype.draftBack = (part) => draftBack(part)
+Pattern.prototype.draftFrontSideDart = (part) => draftFrontSideDart(part)
+Pattern.prototype.draftFrontShoulderDart = (part) => draftFrontShoulderDart(part)
+
+export default Pattern
diff --git a/packages/bella/tests/shared.test.js b/packages/bella/tests/shared.test.js
new file mode 100644
index 00000000000..f3eb3b7d94a
--- /dev/null
+++ b/packages/bella/tests/shared.test.js
@@ -0,0 +1,39 @@
+// This file is auto-generated.
+// Changes you make will be overwritten.
+const expect = require("chai").expect;
+const models = require("@freesewing/models")
+const patterns = require("@freesewing/pattern-info")
+
+const Bella = require('../dist')
+
+// Shared tests
+const testPatternConfig = require('../../../tests/patterns/config')
+const testPatternDrafting = require('../../../tests/patterns/drafting')
+const testPatternSampling = require('../../../tests/patterns/sampling')
+
+// Test config
+testPatternConfig(
+ 'bella',
+ new Bella(),
+ expect,
+ models,
+ patterns
+)
+
+// Test drafting
+testPatternDrafting(
+ 'bella',
+ Bella,
+ expect,
+ models,
+ patterns
+)
+
+// Test sampling
+testPatternSampling(
+ 'bella',
+ Bella,
+ expect,
+ models,
+ patterns
+)