1
0
Fork 0
freesewing/packages/new-design/templates/shared/part.mjs.mustache

197 lines
7 KiB
Text
Raw Normal View History

2022-11-29 17:57:03 -06:00
{{#doesInherit}}
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}}
function draft{{Part}} ({
// 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
/*
* 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
/*
* 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
/*
* 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
/*
* Return value
*/
part, // Your draft method must return this
}) {
2022-11-29 17:57:03 -06:00
{{{draft}}}
{{^draft}}
// Work your magic here
2022-11-29 17:57:03 -06:00
{{/draft}}
return part
}
export const {{part}} = {
/*
* 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 }}.{{part}}',
/*
* 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: draft{{Part}},
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.
*
{{#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}}
*
{{/doesInherit}}
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
*/
2022-11-29 17:57:03 -06:00
{{#doesInherit}}
from: {{baseName}}{{Part}},
2022-11-29 17:57:03 -06:00
{{/doesInherit}}
{{^doesInherit}}
from: false,
{{/doesInherit}}
/*
* hide: Set this to true to hide a part.
*
* We've set this to false here to clarify its use.
* If 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.
*
{{#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,
* you can remove the hideDependencies key entirely.
*/
2022-11-29 17:57:03 -06:00
hideDependencies: {{doesInherit}},
/*
* 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.
* If 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.
2022-11-29 17:57:03 -06:00
{{#doesInherit}}
* You only need to add additional options.
* All options coming from {{BaseName}}'s {{part}} part are already loaded.
2022-11-29 17:57:03 -06:00
{{/doesInherit}}
*
* 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}}}
},
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}}
* You only need to add additional measurements.
* All measurements coming from {{BaseName}}'s {{part}} part are already loaded.
2022-11-29 17:57:03 -06:00
{{/doesInherit}}
*
* 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}}
* You only need to add additional plugins.
* All plugins coming from {{BaseName}}'s {{part}} part are already loaded.
2022-11-29 17:57:03 -06:00
{{/doesInherit}}
*
* 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}}
]
}