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

170 lines
5.6 KiB
Text
Raw Normal View History

import { {{part}} as {{baseName}}{{partUpcase}} } from '@freesewing/{{baseName}}'
function draft{{partUpcase}} ({
// 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 {{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{{partUpcase}},
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 {{baseNameUpcase}}, and this is the {{part}} part,
* we're extending {{baseNameUpcase}}'s {{part}} part here.
* It was imported at the top of this file from @freesewing/{{baseNameUpcase}}
*
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
*/
from: {{baseName}}{{partUpcase}},
/*
* 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 {{baseNameUpcase}}'s {{part}} 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 {{baseNameUpcase}}'s {{part}} 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 {{baseNameUpcase}}'s {{part}} 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
*/
],
plugins: [
/*
* plugins: Holds a list of plugins this part relies on.
*
* Add all the plugins here that you need in this part.
* You only need to add additional plugins.
* All plugins coming from {{baseNameUpcase}}'s {{part}} part are already loaded.
*
* 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
*/
]
}