2022-01-16 17:26:52 +01:00
|
|
|
import freesewing from '@freesewing/core'
|
|
|
|
import config from '../config'
|
|
|
|
// Plugins
|
|
|
|
import banner from '@freesewing/plugin-banner'
|
|
|
|
import bartack from '@freesewing/plugin-bartack'
|
2022-01-16 19:01:54 +01:00
|
|
|
import buttons from '@freesewing/plugin-buttons'
|
2022-01-17 18:14:05 +01:00
|
|
|
import cutonfold from '@freesewing/plugin-cutonfold'
|
2022-01-18 08:30:33 +01:00
|
|
|
import dimension from '@freesewing/plugin-dimension'
|
2022-01-18 09:03:16 +01:00
|
|
|
import flip from '@freesewing/plugin-flip'
|
2022-01-18 09:13:18 +01:00
|
|
|
import gore from '@freesewing/plugin-gore'
|
2022-01-18 10:14:50 +01:00
|
|
|
import grainline from '@freesewing/plugin-grainline'
|
2022-01-18 12:07:37 +01:00
|
|
|
import i18n from '@freesewing/plugin-i18n'
|
2022-01-16 17:26:52 +01:00
|
|
|
//import logo from '@freesewing/plugin-logo'
|
|
|
|
//import measurements from '@freesewing/plugin-measurements'
|
|
|
|
//import mirror from '@freesewing/plugin-mirror'
|
|
|
|
//import notches from '@freesewing/plugin-notches'
|
|
|
|
//import round from '@freesewing/plugin-round'
|
|
|
|
//import scalebox from '@freesewing/plugin-scalebox'
|
|
|
|
//import sprinkle from '@freesewing/plugin-sprinkle'
|
|
|
|
//import svgattr from '@freesewing/plugin-svgattr'
|
|
|
|
//import theme from '@freesewing/plugin-theme'
|
|
|
|
//import title from '@freesewing/plugin-title'
|
|
|
|
//import validate from '@freesewing/plugin-validate'
|
|
|
|
//import versionfreeSvg from '@freesewing/plugin-versionfree-svg'
|
|
|
|
// Parts
|
|
|
|
import draftBanner from './plugin-banner'
|
|
|
|
import draftBartack from './plugin-bartack'
|
2022-01-16 19:01:54 +01:00
|
|
|
import draftButtons from './plugin-buttons'
|
2022-01-17 18:14:05 +01:00
|
|
|
import draftCutonfold from './plugin-cutonfold'
|
2022-01-18 08:30:33 +01:00
|
|
|
import draftDimension from './plugin-dimension'
|
2022-01-18 09:03:16 +01:00
|
|
|
import draftFlip from './plugin-flip'
|
2022-01-18 09:13:18 +01:00
|
|
|
import draftGore from './plugin-gore'
|
2022-01-18 10:14:50 +01:00
|
|
|
import draftGrainline from './plugin-grainline'
|
2022-01-18 12:07:37 +01:00
|
|
|
import draftI18n from './plugin-i18n'
|
2022-01-16 17:26:52 +01:00
|
|
|
//import draftLogo from './plugin-logo'
|
|
|
|
//import draftMeasurements from './plugin-measurements'
|
|
|
|
//import draftMirror from './plugin-mirror'
|
|
|
|
//import draftNotches from './plugin-notches'
|
|
|
|
//import draftRound from './plugin-round'
|
|
|
|
//import draftScalebox from './plugin-scalebox'
|
|
|
|
//import draftSprinkle from './plugin-sprinkle'
|
|
|
|
//import draftSvgattr from './plugin-svgattr'
|
|
|
|
//import draftTheme from './plugin-theme'
|
|
|
|
//import draftTitle from './plugin-title'
|
|
|
|
//import draftValidate from './plugin-validate'
|
|
|
|
//import draftVersionfreeSvg from './plugin-versionfree-svg'
|
|
|
|
// Note included:
|
|
|
|
// plugin-bundle: Is just a wrapper
|
|
|
|
// plugin-export-dxf: Deprecated
|
|
|
|
|
|
|
|
|
|
|
|
const plugins = [
|
|
|
|
banner,
|
|
|
|
bartack,
|
2022-01-16 19:01:54 +01:00
|
|
|
buttons,
|
2022-01-17 18:14:05 +01:00
|
|
|
cutonfold,
|
2022-01-18 08:30:33 +01:00
|
|
|
dimension,
|
2022-01-18 09:03:16 +01:00
|
|
|
flip,
|
2022-01-18 09:13:18 +01:00
|
|
|
gore,
|
2022-01-18 10:14:50 +01:00
|
|
|
grainline,
|
2022-01-18 12:07:37 +01:00
|
|
|
// Not loading i18n because it's already loaded by Workbench
|
2022-01-16 17:26:52 +01:00
|
|
|
// logo,
|
|
|
|
// measurements,
|
|
|
|
// mirror,
|
|
|
|
// notches,
|
|
|
|
// round,
|
|
|
|
// scalebox,
|
|
|
|
// sprinkle,
|
|
|
|
// svgattr,
|
|
|
|
// theme,
|
|
|
|
// title,
|
|
|
|
// validate,
|
|
|
|
// versionfreeSvg,
|
|
|
|
]
|
|
|
|
|
|
|
|
const methods = {
|
|
|
|
draftBanner,
|
|
|
|
draftBartack,
|
2022-01-16 19:01:54 +01:00
|
|
|
draftButtons,
|
2022-01-17 18:14:05 +01:00
|
|
|
draftCutonfold,
|
2022-01-18 08:30:33 +01:00
|
|
|
draftDimension,
|
2022-01-18 09:03:16 +01:00
|
|
|
draftFlip,
|
2022-01-18 09:13:18 +01:00
|
|
|
draftGore,
|
2022-01-18 10:14:50 +01:00
|
|
|
draftGrainline,
|
2022-01-18 12:07:37 +01:00
|
|
|
draftI18n,
|
2022-01-16 17:26:52 +01:00
|
|
|
// draftLogo,
|
|
|
|
// draftMeasurements,
|
|
|
|
// draftMirror,
|
|
|
|
// draftNotches,
|
|
|
|
// draftRound,
|
|
|
|
// draftScalebox,
|
|
|
|
// draftSprinkle,
|
|
|
|
// draftSvgattr,
|
|
|
|
// draftTheme,
|
|
|
|
// draftTitle,
|
|
|
|
// draftValidate,
|
|
|
|
// draftVersionfreeSvg,
|
|
|
|
}
|
|
|
|
|
|
|
|
// Create design
|
|
|
|
const Pattern = new freesewing.Design(config, plugins)
|
|
|
|
|
|
|
|
// Attach draft methods to prototype
|
|
|
|
for (const [name, method] of Object.entries(methods)) {
|
|
|
|
Pattern.prototype[name] = part => method(part)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Pattern
|