@@ -96,9 +108,6 @@ export async function getStaticProps({ locale }) {
return {
props: {
...(await serverSideTranslations(locale)),
- }
+ },
}
}
-
-
-
diff --git a/packages/new-design/shared/pages/support.js b/packages/new-design/shared/pages/support.mjs
similarity index 77%
rename from packages/new-design/shared/pages/support.js
rename to packages/new-design/shared/pages/support.mjs
index 45a0d2ca68c..778a174c09a 100644
--- a/packages/new-design/shared/pages/support.js
+++ b/packages/new-design/shared/pages/support.mjs
@@ -32,7 +32,7 @@ const translations = {
ongoing issues, future plans, and news big and small about FreeSewing and its community.`,
nl: `Elke twee weken is er de FreeSewing contributor call (Engelstalig), waar de FreeSewing
vrijwilligers de lopende zaken bespreken. Ook de plannen voor de toekomst en groot en klein
- nieuws over FreeSewing en de gemeenschap komen aan bod.`
+ nieuws over FreeSewing en de gemeenschap komen aan bod.`,
},
docs: {
en: `Our documentation for developers hosted on ${fsd}. You can find guides and how-to's
@@ -52,67 +52,70 @@ const SupportPage = (props) => {
const { t } = useTranslation(['common', 'patrons'])
return (
-
-
-
)
}
@@ -123,9 +126,6 @@ export async function getStaticProps({ locale }) {
return {
props: {
...(await serverSideTranslations(locale)),
- }
+ },
}
}
-
-
-
diff --git a/packages/new-design/templates/from-brian/design/config.js b/packages/new-design/templates/from-brian/design/config.js
deleted file mode 100644
index 2185f7800f5..00000000000
--- a/packages/new-design/templates/from-brian/design/config.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import pkg from '../package.json' assert { type: 'json' }
-import { config as brianConfig } from '@freesewing/brian'
-
-export default {
- name: '{{name}}',
- version: pkg.version,
- optionGroups: {
- ...brianConfig.optionGroups,
- },
- measurements: [...brianConfig.measurements],
- dependencies: {
- brianSleevecap: 'brianFront',
- },
- inject: {
- brianBack: 'brianBase',
- brianFront: 'brianBack',
- brianSleeve: 'brianSleevecap',
- back: 'brianBack',
- front: 'brianFront',
- sleeve: 'brianSleeve',
- },
- hide: ['brianBase', 'brianFront', 'brianBack', 'brianSleevecap', 'brianSleeve', 'sleevecap'],
- parts: [],
- options: {
- ...brianConfig.options,
- },
-}
diff --git a/packages/new-design/templates/from-brian/design/src/back.js b/packages/new-design/templates/from-brian/design/src/back.js
deleted file mode 100644
index 2112dad247c..00000000000
--- a/packages/new-design/templates/from-brian/design/src/back.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export default (part) => {
- // Do to this part what you wish, before returning it
-
- return part
-}
diff --git a/packages/new-design/templates/from-brian/design/src/back.mjs.mustache b/packages/new-design/templates/from-brian/design/src/back.mjs.mustache
new file mode 100644
index 00000000000..463041ca123
--- /dev/null
+++ b/packages/new-design/templates/from-brian/design/src/back.mjs.mustache
@@ -0,0 +1,155 @@
+import { back as brianBack } from '@freesewing/brian'
+
+function draftBack({
+ // Uncomment below to destructure what you need
+ /*
+ * Content constructors
+ */
+ //Path, // A Path constructor to create new paths
+ //Point, // A Point constructor to create new points
+ //Snippet, // A Snippet constructor to create new snippets
+ /*
+ * Content constainers
+ */
+ //paths, // Add a Path to your part by adding it to this object
+ //points, // Add a Points to your part by adding it to this object
+ //snippets, // Add a Snippet to your part by adding it to this object
+ /*
+ * Access to settings
+ */
+ //absoluteOptions, // Access to settings.absoluteOptions
+ //complete, // Access to settings.complete
+ //measurements, // Access to settings.measurements
+ //options, // Access to settings.options
+ //paperless, // Access to settings.paperless
+ //sa, // Access to settings.sa
+ //scale, // Access to settings.scale
+ /*
+ * Access to utilities
+ */
+ //getId, //See the getId documentation
+ //hide, //See the hide documentation
+ //log, //See the logging documentation
+ //macro, //See the macros documentation
+ //setHidden, //See the setHidden documentation
+ //store, //See the store documentation
+ //unhide, //See the unhide documentation
+ //units, //See the units documentation
+ //utils, //See the utils documentation
+ /*
+ * Return value
+ */
+ part, // Your draft method must return this
+}) {
+
+ // Work your magic here
+
+ return part
+}
+
+export const back = {
+ /*
+ * name: Holds the name of this part.
+ *
+ * We STRONGLY recommend naming your parts in the format of
+ * design.part to avoid naming conflicts when people re-use
+ * parts across designs.
+ */
+ name: '{{ name }}.back',
+ /*
+ * draft: Holds the draft method for this part
+ *
+ * This should be a function that drafts and returns the part
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/draft
+ */
+ draft: draftBack,
+ after: [
+ /*
+ * after: Holds a list of parts that should be drafted prior to this part.
+ *
+ * You'll need to import these parts, just as with the from key above.
+ *
+ * If you don't have any parts to draft prior to this part,
+ * you can remove this options key entirely.
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/config/dependencies
+ */
+ ],
+ /*
+ * from: Holds the part you want to extend.
+ *
+ * Since you opted to extend brian, and this is the back part,
+ * we're extending brian's back part here.
+ * It was imported at the top of this file from @freesewing/brian
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/config/dependencies
+ */
+ from: brianBack,
+ /*
+ * hide: Set this to true to hide a part.
+ *
+ * We've set this to false here to clarify its use.
+ * I you don't want to hide this part,
+ * you can remove the hide key entirely.
+ */
+ hide: false,
+ /*
+ * hideDependecies: Set this to true to hide a part's dependencies.
+ *
+ * We've set this to true here since you're extending Brian's back part.
+ * I you don't want to hide this part's dependencies,
+ * you can remove the hideDependencies key entirely.
+ */
+ hideDependencies: true,
+ /*
+ * hideAll: Set this to true to hide both the part and its dependencies.
+ *
+ * This is a combination of the hide and hideDependencies keys in case
+ * you want to both hide this part and its dependencies.
+ * We've included it here with a value of false to its use.
+ * I you don't want to hide this a part and its dependencies,
+ * you can remove the hideAll key entirely.
+ */
+ hideAll: false,
+ options: {
+ /*
+ * options: Holds (the configuration of) options for this part
+ *
+ * Declare options used in this part here.
+ * You only need to add additional options.
+ * All options coming from Brian's back part are already loaded.
+ *
+ * If you don't have any options to add,
+ * you can remove this options key entirely.
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/config/options
+ */
+ },
+ measurements: [
+ /*
+ * measurements: Holds a list of measurements required by this part.
+ *
+ * Declare measurements required by this part here.
+ * You only need to add additional measurements.
+ * All measurements coming from Brian's back part are already loaded.
+ *
+ * If you don't have any required measurements to add,
+ * you can remove this measurements key entirely.
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/config/measurements
+ */
+ ],
+ optionalMeasurements: [
+ /*
+ * optionalMeasurements: Holds a list of measurements optional in this part.
+ *
+ * Declare measurements that are optional for this part here.
+ *
+ * If you don't have any optional measurements to add,
+ * you can remove this optionalMeasurements key entirely.
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/config/measurements
+ */
+ ],
+}
diff --git a/packages/new-design/templates/from-brian/design/src/front.js b/packages/new-design/templates/from-brian/design/src/front.js
deleted file mode 100644
index 2112dad247c..00000000000
--- a/packages/new-design/templates/from-brian/design/src/front.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export default (part) => {
- // Do to this part what you wish, before returning it
-
- return part
-}
diff --git a/packages/new-design/templates/from-brian/design/src/front.mjs.mustache b/packages/new-design/templates/from-brian/design/src/front.mjs.mustache
new file mode 100644
index 00000000000..c5a076482c6
--- /dev/null
+++ b/packages/new-design/templates/from-brian/design/src/front.mjs.mustache
@@ -0,0 +1,155 @@
+import { front as brianFront } from '@freesewing/brian'
+
+function draftFront({
+ // Uncomment below to destructure what you need
+ /*
+ * Content constructors
+ */
+ //Path, // A Path constructor to create new paths
+ //Point, // A Point constructor to create new points
+ //Snippet, // A Snippet constructor to create new snippets
+ /*
+ * Content constainers
+ */
+ //paths, // Add a Path to your part by adding it to this object
+ //points, // Add a Points to your part by adding it to this object
+ //snippets, // Add a Snippet to your part by adding it to this object
+ /*
+ * Access to settings
+ */
+ //absoluteOptions, // Access to settings.absoluteOptions
+ //complete, // Access to settings.complete
+ //measurements, // Access to settings.measurements
+ //options, // Access to settings.options
+ //paperless, // Access to settings.paperless
+ //sa, // Access to settings.sa
+ //scale, // Access to settings.scale
+ /*
+ * Access to utilities
+ */
+ //getId, //See the getId documentation
+ //hide, //See the hide documentation
+ //log, //See the logging documentation
+ //macro, //See the macros documentation
+ //setHidden, //See the setHidden documentation
+ //store, //See the store documentation
+ //unhide, //See the unhide documentation
+ //units, //See the units documentation
+ //utils, //See the utils documentation
+ /*
+ * Return value
+ */
+ part, // Your draft method must return this
+}) {
+
+ // Work your magic here
+
+ return part
+}
+
+export const front = {
+ /*
+ * name: Holds the name of this part.
+ *
+ * We STRONGLY recommend naming your parts in the format of
+ * design.part to avoid naming conflicts when people re-use
+ * parts across designs.
+ */
+ name: '{{ name }}.front',
+ /*
+ * draft: Holds the draft method for this part
+ *
+ * This should be a function that drafts and returns the part
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/draft
+ */
+ draft: draftFront,
+ after: [
+ /*
+ * after: Holds a list of parts that should be drafted prior to this part.
+ *
+ * You'll need to import these parts, just as with the from key above.
+ *
+ * If you don't have any parts to draft prior to this part,
+ * you can remove this options key entirely.
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/config/dependencies
+ */
+ ],
+ /*
+ * from: Holds the part you want to extend.
+ *
+ * Since you opted to extend brian, and this is the front part,
+ * we're extending brian's front part here.
+ * It was imported at the top of this file from @freesewing/brian
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/config/dependencies
+ */
+ from: brianFront,
+ /*
+ * hide: Set this to true to hide a part.
+ *
+ * We've set this to false here to clarify its use.
+ * I you don't want to hide this part,
+ * you can remove the hide key entirely.
+ */
+ hide: false,
+ /*
+ * hideDependecies: Set this to true to hide a part's dependencies.
+ *
+ * We've set this to true here since you're extending Brian's front part.
+ * I you don't want to hide this part's dependencies,
+ * you can remove the hideDependencies key entirely.
+ */
+ hideDependencies: true,
+ /*
+ * hideAll: Set this to true to hide both the part and its dependencies.
+ *
+ * This is a combination of the hide and hideDependencies keys in case
+ * you want to both hide this part and its dependencies.
+ * We've included it here with a value of false to its use.
+ * I you don't want to hide this a part and its dependencies,
+ * you can remove the hideAll key entirely.
+ */
+ hideAll: false,
+ options: {
+ /*
+ * options: Holds (the configuration of) options for this part
+ *
+ * Declare options used in this part here.
+ * You only need to add additional options.
+ * All options coming from Brian's front part are already loaded.
+ *
+ * If you don't have any options to add,
+ * you can remove this options key entirely.
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/config/options
+ */
+ },
+ measurements: [
+ /*
+ * measurements: Holds a list of measurements required by this part.
+ *
+ * Declare measurements required by this part here.
+ * You only need to add additional measurements.
+ * All measurements coming from Brian's front part are already loaded.
+ *
+ * If you don't have any required measurements to add,
+ * you can remove this measurements key entirely.
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/config/measurements
+ */
+ ],
+ optionalMeasurements: [
+ /*
+ * optionalMeasurements: Holds a list of measurements optional in this part.
+ *
+ * Declare measurements that are optional for this part here.
+ *
+ * If you don't have any optional measurements to add,
+ * you can remove this optionalMeasurements key entirely.
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/config/measurements
+ */
+ ],
+}
diff --git a/packages/new-design/templates/from-brian/design/src/index.js b/packages/new-design/templates/from-brian/design/src/index.js
deleted file mode 100644
index d900df8a231..00000000000
--- a/packages/new-design/templates/from-brian/design/src/index.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Import dependencies
-import freesewing from '@freesewing/core'
-import plugins from '@freesewing/plugin-bundle'
-// Import Brian so we can extend it
-import Brian from '@freesewing/brian'
-// Import configuration
-import config from '../config'
-// Import parts
-import draftFront from './front'
-import draftBack from './back'
-import draftSleeve from './sleeve'
-
-// Create the new design
-const Design = new freesewing.Design(config, plugins)
-
-// Attach Brian's draft methods to the prototype
-for (const m of ['Base', 'Front', 'Back', 'Sleevecap', 'Sleeve']) {
- Design.prototype[`draftBrian${m}`] = function (part) {
- return new Brian(this.settings)[`draft${m}`](part)
- }
-}
-
-// Attach the draft methods to the prototype
-Design.prototype.draftBack = draftBack
-Design.prototype.draftFront = draftFront
-Design.prototype.draftSleeve = draftSleeve
-
-// Export the new Design
-export default Design
diff --git a/packages/new-design/templates/from-brian/design/src/index.mjs.mustache b/packages/new-design/templates/from-brian/design/src/index.mjs.mustache
new file mode 100644
index 00000000000..2c8d60eb066
--- /dev/null
+++ b/packages/new-design/templates/from-brian/design/src/index.mjs.mustache
@@ -0,0 +1,31 @@
+// Import Design constructor
+import { Design } from '@freesewing/core'
+// Import parts
+import { back } from './back'
+import { front } from './front'
+import { sleeve } from './sleeve'
+
+// Create the new design
+const Pattern = new freesewing.Design({
+ data: {
+ /*
+ * If you like, you can add any data you want to your design.
+ * We'll add the name here as an example.
+ *
+ * If you don't use this,
+ * you can remove this data key enterely.
+ */
+ name: "{{ name }}",
+ },
+ // A list of parts is all that is required.
+ parts: [ back, front, sleeve ],
+})
+
+/*
+ * Named exports
+ *
+ * We export the design itself as well as each part individually.
+ * This allows us to re-use these parts in other designs.
+ */
+export { back, front, sleeve, Pattern }
+
diff --git a/packages/new-design/templates/from-brian/design/src/sleeve.js b/packages/new-design/templates/from-brian/design/src/sleeve.js
deleted file mode 100644
index 2112dad247c..00000000000
--- a/packages/new-design/templates/from-brian/design/src/sleeve.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export default (part) => {
- // Do to this part what you wish, before returning it
-
- return part
-}
diff --git a/packages/new-design/templates/from-brian/design/src/sleeve.mjs.mustache b/packages/new-design/templates/from-brian/design/src/sleeve.mjs.mustache
new file mode 100644
index 00000000000..c7da096bf05
--- /dev/null
+++ b/packages/new-design/templates/from-brian/design/src/sleeve.mjs.mustache
@@ -0,0 +1,155 @@
+import { sleeve as brianSleeve } from '@freesewing/brian'
+
+function draftSleeve({
+ // Uncomment below to destructure what you need
+ /*
+ * Content constructors
+ */
+ //Path, // A Path constructor to create new paths
+ //Point, // A Point constructor to create new points
+ //Snippet, // A Snippet constructor to create new snippets
+ /*
+ * Content constainers
+ */
+ //paths, // Add a Path to your part by adding it to this object
+ //points, // Add a Points to your part by adding it to this object
+ //snippets, // Add a Snippet to your part by adding it to this object
+ /*
+ * Access to settings
+ */
+ //absoluteOptions, // Access to settings.absoluteOptions
+ //complete, // Access to settings.complete
+ //measurements, // Access to settings.measurements
+ //options, // Access to settings.options
+ //paperless, // Access to settings.paperless
+ //sa, // Access to settings.sa
+ //scale, // Access to settings.scale
+ /*
+ * Access to utilities
+ */
+ //getId, //See the getId documentation
+ //hide, //See the hide documentation
+ //log, //See the logging documentation
+ //macro, //See the macros documentation
+ //setHidden, //See the setHidden documentation
+ //store, //See the store documentation
+ //unhide, //See the unhide documentation
+ //units, //See the units documentation
+ //utils, //See the utils documentation
+ /*
+ * Return value
+ */
+ part, // Your draft method must return this
+}) {
+
+ // Work your magic here
+
+ return part
+}
+
+export const sleeve = {
+ /*
+ * name: Holds the name of this part.
+ *
+ * We STRONGLY recommend naming your parts in the format of
+ * design.part to avoid naming conflicts when people re-use
+ * parts across designs.
+ */
+ name: '{{ name }}.sleeve',
+ /*
+ * draft: Holds the draft method for this part
+ *
+ * This should be a function that drafts and returns the part
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/draft
+ */
+ draft: draftSleeve,
+ after: [
+ /*
+ * after: Holds a list of parts that should be drafted prior to this part.
+ *
+ * You'll need to import these parts, just as with the from key above.
+ *
+ * If you don't have any parts to draft prior to this part,
+ * you can remove this options key entirely.
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/config/dependencies
+ */
+ ],
+ /*
+ * from: Holds the part you want to extend.
+ *
+ * Since you opted to extend brian, and this is the sleeve part,
+ * we're extending brian's sleeve part here.
+ * It was imported at the top of this file from @freesewing/brian
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/config/dependencies
+ */
+ from: brianSleeve,
+ /*
+ * hide: Set this to true to hide a part.
+ *
+ * We've set this to false here to clarify its use.
+ * I you don't want to hide this part,
+ * you can remove the hide key entirely.
+ */
+ hide: false,
+ /*
+ * hideDependecies: Set this to true to hide a part's dependencies.
+ *
+ * We've set this to true here since you're extending Brian's sleeve part.
+ * I you don't want to hide this part's dependencies,
+ * you can remove the hideDependencies key entirely.
+ */
+ hideDependencies: true,
+ /*
+ * hideAll: Set this to true to hide both the part and its dependencies.
+ *
+ * This is a combination of the hide and hideDependencies keys in case
+ * you want to both hide this part and its dependencies.
+ * We've included it here with a value of false to its use.
+ * I you don't want to hide this a part and its dependencies,
+ * you can remove the hideAll key entirely.
+ */
+ hideAll: false,
+ options: {
+ /*
+ * options: Holds (the configuration of) options for this part
+ *
+ * Declare options used in this part here.
+ * You only need to add additional options.
+ * All options coming from Brian's sleeve part are already loaded.
+ *
+ * If you don't have any options to add,
+ * you can remove this options key entirely.
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/config/options
+ */
+ },
+ measurements: [
+ /*
+ * measurements: Holds a list of measurements required by this part.
+ *
+ * Declare measurements required by this part here.
+ * You only need to add additional measurements.
+ * All measurements coming from Brian's sleeve part are already loaded.
+ *
+ * If you don't have any required measurements to add,
+ * you can remove this measurements key entirely.
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/config/measurements
+ */
+ ],
+ optionalMeasurements: [
+ /*
+ * optionalMeasurements: Holds a list of measurements optional in this part.
+ *
+ * Declare measurements that are optional for this part here.
+ *
+ * If you don't have any optional measurements to add,
+ * you can remove this optionalMeasurements key entirely.
+ *
+ * Documentation: https://freesewing.dev/reference/api/part/config/measurements
+ */
+ ],
+}
diff --git a/packages/new-design/templates/from-brian/design/src/sleevecap.js b/packages/new-design/templates/from-brian/design/src/sleevecap.js
deleted file mode 100644
index 2112dad247c..00000000000
--- a/packages/new-design/templates/from-brian/design/src/sleevecap.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export default (part) => {
- // Do to this part what you wish, before returning it
-
- return part
-}
diff --git a/packages/new-design/templates/from-brian/_package.json b/packages/new-design/templates/from-brian/package.json.mustache
similarity index 94%
rename from packages/new-design/templates/from-brian/_package.json
rename to packages/new-design/templates/from-brian/package.json.mustache
index 8a0467225f2..985a4c01a65 100644
--- a/packages/new-design/templates/from-brian/_package.json
+++ b/packages/new-design/templates/from-brian/package.json.mustache
@@ -42,6 +42,7 @@
"@freesewing/plugin-svgattr": "latest",
"@freesewing/plugin-theme": "latest",
"@freesewing/plugin-i18n": "latest",
+ "@freesewing/plugin-bust": "latest",
"@freesewing/utils": "latest",
"@freesewing/models": "latest",
"@headlessui/react": "^1.6.5",
@@ -53,7 +54,6 @@
"react-sizeme": "^3.0.2",
"react-zoom-pan-pinch": "^2.1.3",
"react-markdown": "^8.0.3",
- "roughjs": "^4.5.2",
"@tailwindcss/typography": "^0.5.2",
"d3-dispatch": "^3.0.1",
"d3-drag": "^3.0.0",
@@ -78,9 +78,11 @@
"js-yaml": "^4.1.0",
"pdfkit": "^0.13.0",
"svg-to-pdfkit": "^0.1.8",
+ "postcss-for": "^2.1.1",
"postcss": "^8.4.14",
"tailwindcss": "^3.1.3",
- "tailwindcss-open-variant": "^1.0.0"
+ "tailwindcss-open-variant": "^1.0.0",
+ "web-worker": "^1.2.0"
},
"files": [
"dist/*",
@@ -92,7 +94,7 @@
"tag": "next"
},
"engines": {
- "node": ">=14.0.0",
+ "node": ">=16.0.0",
"npm": ">=6"
}
}