2022-11-29 17:57:03 -06:00
|
|
|
{{#doesInherit}}
|
2022-11-30 15:54:26 -06:00
|
|
|
import { {{part}} as {{baseName}}{{Part}} } from '@freesewing/{{baseName}}'
|
2022-11-29 17:57:03 -06:00
|
|
|
{{/doesInherit}}
|
|
|
|
{{#pluginBundle}}
|
|
|
|
import { pluginBundle } from '@freesewing/plugin-bundle'
|
|
|
|
{{/pluginBundle}}
|
2022-10-06 15:34:41 +02:00
|
|
|
|
2022-11-30 15:54:26 -06:00
|
|
|
function draft{{Part}} ({
|
2022-10-06 15:34:41 +02:00
|
|
|
// Uncomment below to destructure what you need
|
|
|
|
/*
|
|
|
|
* Content constructors
|
|
|
|
*/
|
2022-11-29 17:57:03 -06:00
|
|
|
{{^draftUses.Path}}//{{/draftUses.Path}}Path, // A Path constructor to create new paths
|
|
|
|
{{^draftUses.Point}}//{{/draftUses.Point}}Point, // A Point constructor to create new points
|
|
|
|
{{^draftUses.Snippet}}//{{/draftUses.Snippet}}Snippet, // A Snippet constructor to create new snippets
|
2022-10-06 15:34:41 +02:00
|
|
|
/*
|
|
|
|
* Content constainers
|
|
|
|
*/
|
2022-11-29 17:57:03 -06:00
|
|
|
{{^draftUses.paths}}//{{/draftUses.paths}}paths, // Add a Path to your part by adding it to this object
|
|
|
|
{{^draftUses.points}}//{{/draftUses.points}}points, // Add a Points to your part by adding it to this object
|
|
|
|
{{^draftUses.snippets}}//{{/draftUses.snippets}}snippets, // Add a Snippet to your part by adding it to this object
|
2022-10-06 15:34:41 +02:00
|
|
|
/*
|
|
|
|
* Access to settings
|
|
|
|
*/
|
2022-11-29 17:57:03 -06:00
|
|
|
{{^draftUses.absoluteOptions}}//{{/draftUses.absoluteOptions}}absoluteOptions, // Access to settings.absoluteOptions
|
|
|
|
{{^draftUses.complete}}//{{/draftUses.complete}}complete, // Access to settings.complete
|
|
|
|
{{^draftUses.measurements}}//{{/draftUses.measurements}}measurements, // Access to settings.measurements
|
|
|
|
{{^draftUses.options}}//{{/draftUses.options}}options, // Access to settings.options
|
|
|
|
{{^draftUses.paperless}}//{{/draftUses.paperless}}paperless, // Access to settings.paperless
|
|
|
|
{{^draftUses.sa}}//{{/draftUses.sa}}sa, // Access to settings.sa
|
|
|
|
{{^draftUses.scale}}//{{/draftUses.scale}}scale, // Access to settings.scale
|
2022-10-06 15:34:41 +02:00
|
|
|
/*
|
|
|
|
* Access to utilities
|
|
|
|
*/
|
2022-11-29 17:57:03 -06:00
|
|
|
{{^draftUses.getId}}//{{/draftUses.getId}}getId, //See the getId documentation
|
|
|
|
{{^draftUses.hide}}//{{/draftUses.hide}}hide, //See the hide documentation
|
|
|
|
{{^draftUses.log}}//{{/draftUses.log}}log, //See the logging documentation
|
|
|
|
{{^draftUses.macro}}//{{/draftUses.macro}}macro, //See the macros documentation
|
|
|
|
{{^draftUses.setHidden}}//{{/draftUses.setHidden}}setHidden, //See the setHidden documentation
|
|
|
|
{{^draftUses.store}}//{{/draftUses.store}}store, //See the store documentation
|
|
|
|
{{^draftUses.unhide}}//{{/draftUses.unhide}}unhide, //See the unhide documentation
|
|
|
|
{{^draftUses.units}}//{{/draftUses.units}}units, //See the units documentation
|
|
|
|
/{{^draftUses.utils}}//{{/draftUses.utils}}utils, //See the utils documentation
|
2022-10-06 15:34:41 +02:00
|
|
|
/*
|
|
|
|
* Return value
|
|
|
|
*/
|
|
|
|
part, // Your draft method must return this
|
|
|
|
}) {
|
|
|
|
|
2022-11-29 17:57:03 -06:00
|
|
|
{{{draft}}}
|
|
|
|
{{^draft}}
|
2022-10-06 15:34:41 +02:00
|
|
|
// Work your magic here
|
2022-11-29 17:57:03 -06:00
|
|
|
{{/draft}}
|
2022-10-06 15:34:41 +02:00
|
|
|
|
|
|
|
return part
|
|
|
|
}
|
|
|
|
|
2022-11-29 16:10:19 -06:00
|
|
|
export const {{part}} = {
|
2022-10-06 15:34:41 +02:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
2022-11-29 16:10:19 -06:00
|
|
|
name: '{{ name }}.{{part}}',
|
2022-10-06 15:34:41 +02:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*/
|
2022-11-30 15:54:26 -06:00
|
|
|
draft: draft{{Part}},
|
2022-10-06 15:34:41 +02:00
|
|
|
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.
|
|
|
|
*
|
2022-11-30 15:54:26 -06:00
|
|
|
{{#doesInherit}}
|
|
|
|
* Since you opted to extend {{BaseName}}, and this is the {{part}} part,
|
|
|
|
* we're extending {{BaseName}}'s {{part}} part here.
|
|
|
|
* It was imported at the top of this file from @freesewing/{{BaseName}}
|
2022-10-06 15:34:41 +02:00
|
|
|
*
|
2022-11-30 15:54:26 -06:00
|
|
|
{{/doesInherit}}
|
2022-10-06 15:34:41 +02:00
|
|
|
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
|
|
|
*/
|
2022-11-29 17:57:03 -06:00
|
|
|
{{#doesInherit}}
|
2022-11-30 15:54:26 -06:00
|
|
|
from: {{baseName}}{{Part}},
|
2022-11-29 17:57:03 -06:00
|
|
|
{{/doesInherit}}
|
|
|
|
{{^doesInherit}}
|
|
|
|
from: false,
|
|
|
|
{{/doesInherit}}
|
2022-10-06 15:34:41 +02:00
|
|
|
/*
|
|
|
|
* hide: Set this to true to hide a part.
|
|
|
|
*
|
|
|
|
* We've set this to false here to clarify its use.
|
2022-11-30 15:54:26 -06:00
|
|
|
* If you don't want to hide this part,
|
2022-10-06 15:34:41 +02:00
|
|
|
* you can remove the hide key entirely.
|
|
|
|
*/
|
|
|
|
hide: false,
|
|
|
|
/*
|
|
|
|
* hideDependecies: Set this to true to hide a part's dependencies.
|
|
|
|
*
|
2022-11-30 15:54:26 -06:00
|
|
|
{{#doesInherit}}
|
|
|
|
* We've set this to true here since you're extending {{BaseName}}'s {{part}} part.
|
|
|
|
{{/doesInherit}}
|
|
|
|
* If you don't want to hide this part's dependencies,
|
2022-10-06 15:34:41 +02:00
|
|
|
* you can remove the hideDependencies key entirely.
|
|
|
|
*/
|
2022-11-29 17:57:03 -06:00
|
|
|
hideDependencies: {{doesInherit}},
|
2022-10-06 15:34:41 +02:00
|
|
|
/*
|
|
|
|
* 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.
|
2022-11-30 15:54:26 -06:00
|
|
|
* We've included it here with a value of false.
|
|
|
|
* If you don't want to hide this a part and its dependencies,
|
2022-10-06 15:34:41 +02:00
|
|
|
* 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.
|
2022-11-29 17:57:03 -06:00
|
|
|
{{#doesInherit}}
|
2022-10-06 15:34:41 +02:00
|
|
|
* You only need to add additional options.
|
2022-11-30 15:54:26 -06:00
|
|
|
* All options coming from {{BaseName}}'s {{part}} part are already loaded.
|
2022-11-29 17:57:03 -06:00
|
|
|
{{/doesInherit}}
|
2022-10-06 15:34:41 +02:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
2022-11-29 17:57:03 -06:00
|
|
|
{{{options}}}
|
2022-10-06 15:34:41 +02:00
|
|
|
},
|
|
|
|
measurements: [
|
|
|
|
/*
|
|
|
|
* measurements: Holds a list of measurements required by this part.
|
|
|
|
*
|
|
|
|
* Declare measurements required by this part here.
|
2022-11-29 17:57:03 -06:00
|
|
|
{{#doesInherit}}
|
2022-10-06 15:34:41 +02:00
|
|
|
* You only need to add additional measurements.
|
2022-11-30 15:54:26 -06:00
|
|
|
* All measurements coming from {{BaseName}}'s {{part}} part are already loaded.
|
2022-11-29 17:57:03 -06:00
|
|
|
{{/doesInherit}}
|
2022-10-06 15:34:41 +02:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
],
|
|
|
|
plugins: [
|
|
|
|
/*
|
|
|
|
* plugins: Holds a list of plugins this part relies on.
|
|
|
|
*
|
|
|
|
* Add all the plugins here that you need in this part.
|
2022-11-29 17:57:03 -06:00
|
|
|
{{#doesInherit}}
|
2022-10-06 15:34:41 +02:00
|
|
|
* You only need to add additional plugins.
|
2022-11-30 15:54:26 -06:00
|
|
|
* All plugins coming from {{BaseName}}'s {{part}} part are already loaded.
|
2022-11-29 17:57:03 -06:00
|
|
|
{{/doesInherit}}
|
2022-10-06 15:34:41 +02:00
|
|
|
*
|
|
|
|
* If you don't have any plugins to add,
|
|
|
|
* you can remove this plugins key entirely.
|
|
|
|
*
|
|
|
|
* Documentation: https://freesewing.dev/reference/api/part/config/plugins
|
|
|
|
*/
|
2022-11-29 17:57:03 -06:00
|
|
|
{{#pluginBundle}}
|
|
|
|
pluginBundle,
|
|
|
|
{{/pluginBundle}}
|
2022-10-06 15:34:41 +02:00
|
|
|
]
|
|
|
|
}
|