1
0
Fork 0

feat: Handle absolute input on pct options

This commit is contained in:
joostdecock 2025-02-08 12:45:42 +01:00
parent 987ba5419c
commit 752dd69c50
14 changed files with 645 additions and 394 deletions

View file

@ -20,12 +20,15 @@ import { Spinner } from '@freesewing/react/components/Spinner'
*
* @param {function} Design - The Design constructor
* @param {object} settings - The settings for the pattern
* @param {array} plugins - Any (extra) plugins to load into the pattern
* @return {object} data - The drafted pattern, along with errors and failure data
*/
export function draft(Design, settings) {
export function draft(Design, settings, plugins = []) {
const pattern = new Design(settings)
for (const plugin of plugins) pattern.use(plugin)
const data = {
// The pattern
pattern: new Design(settings),
pattern,
// Any errors logged by the pattern
errors: [],
// If the pattern fails to draft, this will hold the error