1
0
Fork 0
freesewing/designs/simone/config/index.js
joostdecock a0d2e9a2e0 fix(simone): Don't mutate the simon config
The changes that were added recently for the `bustAlignedButtons` option
were causing problems when both simon and simone are loaded.

That's because the simone config adds the option to (an object of) the
simon config. Because the reference to this object is the same in both
configs, that means the option also appears on Simon, which causes
issues.

I've (for now) merely duplicated this part of the config to side-step
the issue. For now, because we'll handle this differently/better in v3.
2022-08-22 15:00:49 +02:00

97 lines
2.3 KiB
JavaScript

import { version } from '../package.json'
import { config as simonConfig } from '@freesewing/simon'
import Brian from '@freesewing/brian'
const config = {
version,
...simonConfig,
name: 'simone',
optionGroups: {
...simonConfig.optionGroups,
style: [
...Brian.config.optionGroups.style,
'contour',
'hemStyle',
'hemCurve',
'boxPleat',
'backDarts',
'frontDarts',
'splitYoke',
'yokeHeight',
{
closure: [
'extraTopButton',
'buttons',
'seperateButtonPlacket',
'buttonPlacketStyle',
'seperateButtonholePlacket',
'buttonholePlacketStyle',
'buttonPlacketWidth',
'buttonholePlacketWidth',
'buttonholePlacketFoldWidth',
'buttonFreeLength',
'bustAlignedButtons',
],
},
{
cuffs: [
'cuffStyle',
'barrelCuffNarrowButton',
'cuffButtonRows',
'sleevePlacketWidth',
'sleevePlacketLength',
'cuffDrape',
'cuffLength',
],
},
{
collar: [
'collarAngle',
'collarStandBend',
'collarStandCurve',
'collarFlare',
'collarStandWidth',
'collarBend',
'collarGap',
'collarRoll',
],
},
],
advanced: [
...simonConfig.optionGroups.advanced,
'bustDartAngle',
'bustDartLength',
'frontDartLength',
],
},
measurements: [...simonConfig.measurements, 'bustSpan', 'highBust', 'hpsToBust'],
inject: {
...simonConfig.inject,
fbaFront: 'front',
frontRight: 'fbaFront',
frontLeft: 'fbaFront',
buttonPlacket: 'fbaFront',
buttonholePlacket: 'fbaFront',
sleeveBase: 'fbaFront',
},
hide: [...simonConfig.hide, 'fbaFront'],
options: {
...simonConfig.options,
// Constants
minimalDartShaping: 5,
// Simone specific
bustDartAngle: { deg: 10, min: 0, max: 20 },
bustDartLength: { pct: 80, min: 50, max: 90 },
frontDarts: { bool: false },
frontDartLength: { pct: 45, min: 30, max: 60 },
contour: { pct: 50, min: 30, max: 75 },
bustAlignedButtons: {
dflt: 'disabled',
list: ['even', 'split', 'disabled'],
},
}
}
export default config