From c89e5e95699c0358cc16a170dd63eb3b39e01286 Mon Sep 17 00:00:00 2001 From: joostdecock Date: Sun, 11 Sep 2022 14:34:00 +0200 Subject: [PATCH] chore(hortensia): Port to v3 stage 2 --- designs/hortensia/src/bottompanel.mjs | 31 +++++++-------- designs/hortensia/src/bottomsidepanel.mjs | 2 +- designs/hortensia/src/frontpanel.mjs | 31 +++++++-------- designs/hortensia/src/index.mjs | 13 ++----- designs/hortensia/src/sidepanel.mjs | 39 ++++++++++--------- .../hortensia/src/sidepanelreinforcement.mjs | 15 +++++-- designs/hortensia/src/strap.mjs | 17 ++++++-- designs/hortensia/src/zipperpanel.mjs | 15 +++++-- 8 files changed, 91 insertions(+), 72 deletions(-) diff --git a/designs/hortensia/src/bottompanel.mjs b/designs/hortensia/src/bottompanel.mjs index 99a66b7e8d6..7dfeb07d059 100644 --- a/designs/hortensia/src/bottompanel.mjs +++ b/designs/hortensia/src/bottompanel.mjs @@ -1,21 +1,20 @@ import { sidepanel } from './sidepanel.mjs' -function draftHortensiaBottompanel (part) { - let { - store, - options, - Point, - Path, - points, - paths, - Snippet, - snippets, - complete, - sa, - paperless, - macro, - } = part.shorthand() - +function draftHortensiaBottompanel({ + store, + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + complete, + sa, + paperless, + macro, + part, +}) { let w = store.get('bottomPanelLength') let h = store.get('depth') diff --git a/designs/hortensia/src/bottomsidepanel.mjs b/designs/hortensia/src/bottomsidepanel.mjs index 182e4f67ea8..afab0248ad5 100644 --- a/designs/hortensia/src/bottomsidepanel.mjs +++ b/designs/hortensia/src/bottomsidepanel.mjs @@ -1,4 +1,4 @@ -export function bottomsidepanel (points, topMiddle, w, h, sizeRatio) { +export function bottomsidepanel(points, topMiddle, w, h, sizeRatio) { const c = 0.551915024494 // circle constant const cornerCP = 20 * sizeRatio diff --git a/designs/hortensia/src/frontpanel.mjs b/designs/hortensia/src/frontpanel.mjs index c1c751bc354..bd42576aba6 100644 --- a/designs/hortensia/src/frontpanel.mjs +++ b/designs/hortensia/src/frontpanel.mjs @@ -1,21 +1,20 @@ import { sidepanel } from './sidepanel.mjs' -function draftHortensiaFrontpanel (part) { - let { - store, - options, - Point, - Path, - points, - paths, - Snippet, - snippets, - complete, - sa, - paperless, - macro, - } = part.shorthand() - +function draftHortensiaFrontpanel({ + store, + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + complete, + sa, + paperless, + macro, + part, +}) { let w = store.get('frontPanelLength') let h = store.get('depth') diff --git a/designs/hortensia/src/index.mjs b/designs/hortensia/src/index.mjs index 27efd9d0453..4f22acfea33 100644 --- a/designs/hortensia/src/index.mjs +++ b/designs/hortensia/src/index.mjs @@ -1,7 +1,7 @@ import { Design } from '@freesewing/core' import { data } from '../data.mjs' // Parts -import { sidepanel } from './sidepanel.mjs' +import { sidepanel } from './sidepanel.mjs' import { frontpanel } from './frontpanel.mjs' import { bottompanel } from './bottompanel.mjs' import { zipperpanel } from './zipperpanel.mjs' @@ -11,15 +11,8 @@ import { strap } from './strap.mjs' // Create new design const Hortensia = new Design({ data, - parts: [ - sidepanel, frontpanel, bottompanel, zipperpanel, - sidepanelreinforcement, strap, - ], + parts: [sidepanel, frontpanel, bottompanel, zipperpanel, sidepanelreinforcement, strap], }) // Named exports -export { - sidepanel, frontpanel, bottompanel, zipperpanel, - sidepanelreinforcement, strap, - Hortensia, -} +export { sidepanel, frontpanel, bottompanel, zipperpanel, sidepanelreinforcement, strap, Hortensia } diff --git a/designs/hortensia/src/sidepanel.mjs b/designs/hortensia/src/sidepanel.mjs index 48f4b2a6c7e..60531f6f5ba 100644 --- a/designs/hortensia/src/sidepanel.mjs +++ b/designs/hortensia/src/sidepanel.mjs @@ -1,22 +1,21 @@ import { pluginBundle } from '@freesewing/plugin-bundle' import { bottomsidepanel } from './bottomsidepanel.mjs' -function draftHortensiaSidepanel (part) { - let { - store, - options, - Point, - Path, - points, - paths, - Snippet, - snippets, - complete, - sa, - paperless, - macro, - } = part.shorthand() - +function draftHortensiaSidepanel({ + store, + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + complete, + sa, + paperless, + macro, + part, +}) { const c = 0.551915024494 // circle constant const phi = 1.6180339887 @@ -225,10 +224,12 @@ export const sidepanel = { width: 230, height: 330, size: { pct: 50, min: 20, max: 200, menu: 'style' }, - zipperSize: { dflt: '#5', + zipperSize: { + dflt: '#5', list: ['#3', '#4', '#4.5', '#5', '#6', '#8', '#10', 'Invisible'], - menu: 'style' }, + menu: 'style', + }, }, - plugins: [ pluginBundle ], + plugins: [pluginBundle], draft: draftHortensiaSidepanel, } diff --git a/designs/hortensia/src/sidepanelreinforcement.mjs b/designs/hortensia/src/sidepanelreinforcement.mjs index 9b813c4cfeb..4b651ce88a5 100644 --- a/designs/hortensia/src/sidepanelreinforcement.mjs +++ b/designs/hortensia/src/sidepanelreinforcement.mjs @@ -1,9 +1,18 @@ import { sidepanel } from './sidepanel.mjs' import { bottomsidepanel } from './bottomsidepanel.mjs' -function draftHortensiaSidepanelreinforcement (part) { - let { store, Point, Path, points, paths, complete, sa, paperless, macro } = part.shorthand() - +function draftHortensiaSidepanelreinforcement({ + store, + Point, + Path, + points, + paths, + complete, + sa, + paperless, + macro, + part, +}) { const w = store.get('width') const h = store.get('sidePanelReinforcementHeight') const sizeRatio = store.get('sizeRatio') diff --git a/designs/hortensia/src/strap.mjs b/designs/hortensia/src/strap.mjs index a1cc2a51d4e..bc68b2e00dc 100644 --- a/designs/hortensia/src/strap.mjs +++ b/designs/hortensia/src/strap.mjs @@ -1,9 +1,18 @@ import { sidepanel } from './sidepanel.mjs' -function draftHortensiaStrap (part) { - let { store, options, Point, Path, points, paths, complete, sa, paperless, macro } = - part.shorthand() - +function draftHortensiaStrap({ + store, + options, + Point, + Path, + points, + paths, + complete, + sa, + paperless, + macro, + part, +}) { let w = store.get('width') * options.handleWidth let h = store.get('depth') * options.strapLength if (sa > w * 0.8) { diff --git a/designs/hortensia/src/zipperpanel.mjs b/designs/hortensia/src/zipperpanel.mjs index 1e4611b93d1..31304fece19 100644 --- a/designs/hortensia/src/zipperpanel.mjs +++ b/designs/hortensia/src/zipperpanel.mjs @@ -1,8 +1,17 @@ import { sidepanel } from './sidepanel.mjs' -function draftHortensiaZipperpanel (part) { - let { store, Point, Path, points, paths, complete, sa, paperless, macro } = part.shorthand() - +function draftHortensiaZipperpanel({ + store, + Point, + Path, + points, + paths, + complete, + sa, + paperless, + macro, + part, +}) { let z = store.get('zipperWidth') let w = (store.get('zipperPanelWidth') - z) / 2 let h = store.get('depth')