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

199 lines
7.3 KiB
Text

{{!
// Change the Mustache delimiter from double curly braces to double dollar signs.
// Dollar signs are allowed in EcmaScript identifier names,
// which is helpful when running unrendered Mustache templates through eslint.
//}}{{=$$ $$=}}
$$ #doesInherit $$
import { $$ part $$ as $$ baseName $$$$ Part $$ } from '@freesewing/$$ baseName $$'
$$ /doesInherit $$
$$ #pluginBundle $$
import { pluginBundle } from '@freesewing/plugin-bundle'
$$ /pluginBundle $$
function draft$$ Part $$ ({
// Uncomment below to destructure what you need
/*
* Content constructors
*/
$$ ^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
*/
$$ ^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
*/
$$ ^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
*/
$$ ^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
}) {
$$& draft $$
$$ ^draft $$// Work your magic here $$ /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
*/
$$ #doesInherit $$
from: $$ baseName $$$$ Part $$,
$$ /doesInherit $$
$$ ^doesInherit $$
from: false,
$$ /doesInherit $$
/* hide: */
hide: {
/*
* self: Set this to true to hide the 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.
*/
self: false,
/*
* from: Set this to true to hide a part's from dependency.
*
$$ #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 from dependency,
* you can remove the from key entirely.
*/
from: $$ doesInherit $$,
/*
* after: Set this to true to hide any parts specified in the after setting
*
* 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.
*/
after: false
},
options: {
/*
* options: Holds (the configuration of) options for this part
*
* Declare options used in this part here.
$$ #doesInherit $$
* You only need to add additional options.
* All options coming from $$ BaseName $$'s $$ part $$ part are already loaded.
$$ /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
*/
$$& options $$
},
measurements: [
/*
* measurements: Holds a list of measurements required by this part.
*
* Declare measurements required by this part here.
$$ #doesInherit $$
* You only need to add additional measurements.
* All measurements coming from $$ BaseName $$'s $$ part $$ part are already loaded.
$$ /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.
$$ #doesInherit $$
* You only need to add additional plugins.
* All plugins coming from $$ BaseName $$'s $$ part $$ part are already loaded.
$$ /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
*/
$$ #pluginBundle $$
pluginBundle,
$$ /pluginBundle $$
]
}