sparkles: Updates for freesewing v0.23
This commit is contained in:
parent
8147e10a08
commit
aa16927fa5
14 changed files with 1785 additions and 2772 deletions
|
@ -7,6 +7,25 @@ export default {
|
|||
"naturalWaistToUnderbust",
|
||||
"naturalWaistToHip"
|
||||
],
|
||||
dependencies: {
|
||||
panel1: "panels",
|
||||
panel2: "panels",
|
||||
panel3: "panels",
|
||||
panel4: "panels",
|
||||
panel5: "panels",
|
||||
panel6: "panels",
|
||||
panels: "base"
|
||||
},
|
||||
inject: {
|
||||
panel1: "panels",
|
||||
panel2: "panels",
|
||||
panel3: "panels",
|
||||
panel4: "panels",
|
||||
panel5: "panels",
|
||||
panel6: "panels",
|
||||
panels: "base"
|
||||
},
|
||||
hide: [ "panels", "base" ],
|
||||
options: {
|
||||
// Lists
|
||||
panels: {
|
||||
|
|
|
@ -13,14 +13,16 @@
|
|||
<script type="text/javascript" src="node_modules/@freesewing/plugin-designer/dist/browser.js"></script>
|
||||
<script type="text/javascript" src="node_modules/@freesewing/plugin-debug/dist/browser.js"></script>
|
||||
<script type="text/javascript" src="node_modules/@freesewing/plugin-validate/dist/browser.js"></script>
|
||||
<script type="text/javascript" src="node_modules/@freesewing/plugin-i18n/dist/browser.js"></script>
|
||||
<!-- <script type="text/javascript" src="node_modules/@freesewing/plugin-i18n/dist/browser.js"></script> -->
|
||||
<script type="text/javascript" src="../../plugins/plugin-i18n/dist/browser.js"></script>
|
||||
<script type="text/javascript" src="node_modules/@freesewing/models/dist/browser.js"></script>
|
||||
<script type="text/javascript" src="node_modules/@freesewing/antman/dist/browser.js"></script>
|
||||
<script>
|
||||
var pattern = freesewing.patterns.cathrin
|
||||
var pattern = new freesewing.patterns.cathrin;
|
||||
pattern
|
||||
.with(freesewing.plugins.debug)
|
||||
.with(freesewing.plugins.theme)
|
||||
// .with(freesewing.plugins.designer)
|
||||
.with(freesewing.plugins.designer)
|
||||
.with(freesewing.plugins.validate)
|
||||
.with(freesewing.plugins.i18n)
|
||||
;
|
||||
|
@ -42,7 +44,7 @@
|
|||
models: freesewing.models.men
|
||||
}
|
||||
|
||||
pattern.options.panels = 13;
|
||||
pattern.settings.options.panels = 13;
|
||||
//pattern.settings.only = ['panels'];
|
||||
//pattern.sampleOption('panels');
|
||||
//pattern.sampleMeasurement('shoulderSlope');
|
||||
|
|
3006
packages/cathrin/package-lock.json
generated
3006
packages/cathrin/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -47,8 +47,8 @@
|
|||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"freesewing": "^0.17",
|
||||
"@freesewing/plugin-bundle": "^0.3"
|
||||
"freesewing": "^0.23.2",
|
||||
"@freesewing/plugin-bundle": "^0.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.0.0-beta.56",
|
||||
|
@ -60,11 +60,11 @@
|
|||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"@freesewing/antman": "^0.3",
|
||||
"@freesewing/models": "^0.6",
|
||||
"@freesewing/plugin-debug": "^0.1",
|
||||
"@freesewing/plugin-designer": "^0.7.2",
|
||||
"@freesewing/plugin-i18n": "^0.0.2",
|
||||
"@freesewing/plugin-theme": "^0.13.2",
|
||||
"@freesewing/plugin-validate": "^0.2",
|
||||
"@freesewing/plugin-debug": "^0.5.2",
|
||||
"@freesewing/plugin-designer": "^0.10",
|
||||
"@freesewing/plugin-i18n": "^0.1.2",
|
||||
"@freesewing/plugin-theme": "^0.18.3",
|
||||
"@freesewing/plugin-validate": "^0.4.1",
|
||||
"eslint": "5.3.0",
|
||||
"eslint-config-prettier": "^2.9.0",
|
||||
"eslint-plugin-prettier": "^2.6.2",
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
var base = {
|
||||
draft: function(part) {
|
||||
|
||||
export default function(part) {
|
||||
// prettier-ignore
|
||||
let {measurements, options, store, points, snippets, paths, Point, Snippet, Path, utils, complete, debug } = part.shorthand();
|
||||
|
||||
|
@ -10,9 +8,17 @@ var base = {
|
|||
|
||||
// Absolute values for some options
|
||||
store.set('waistReduction', measurements.naturalWaist * options.waistReduction);
|
||||
debug('Waist reduction is', utils.units(store.get('waistReduction')));
|
||||
debug({
|
||||
type: "info",
|
||||
label: '✅ Waist reduction',
|
||||
msg: utils.units(store.get('waistReduction'))
|
||||
});
|
||||
store.set('backOpening', measurements.underbust * options.backOpening);
|
||||
debug('Back opening is', utils.units(store.get('backOpening')));
|
||||
debug({
|
||||
type: "info",
|
||||
label: '✅ Back opening',
|
||||
msg: utils.units(store.get('backOpening'))
|
||||
});
|
||||
let len = measurements.naturalWaistToUnderbust + measurements.naturalWaistToHip;
|
||||
for(let option of ['backRise', 'backDrop', 'frontRise', 'frontDrop', 'hipRise'])
|
||||
store.set(option, len * options[option]);
|
||||
|
@ -101,7 +107,4 @@ var base = {
|
|||
.close();
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default base;
|
||||
|
|
|
@ -1,57 +1,38 @@
|
|||
import freesewing from "freesewing";
|
||||
import pluginBundle from "@freesewing/plugin-bundle";
|
||||
|
||||
import config from "../config/config";
|
||||
import { version } from "../package.json";
|
||||
//Parts
|
||||
import draftBase from "./base";
|
||||
import draftPanels from "./panels";
|
||||
import draftPanel1 from "./panel1";
|
||||
import draftPanel2 from "./panel2";
|
||||
import draftPanel3 from "./panel3";
|
||||
import draftPanel4 from "./panel4";
|
||||
import draftPanel5 from "./panel5";
|
||||
import draftPanel6 from "./panel6";
|
||||
|
||||
import base from "./base";
|
||||
import panels from "./panels";
|
||||
// Constructor boilerplate
|
||||
const Cathrin = function(settings = false) {
|
||||
freesewing.Pattern.call(this, { version: version, ...config });
|
||||
this.with(pluginBundle);
|
||||
if (settings !== false) this.mergeSettings(settings);
|
||||
|
||||
import panel1 from "./panel1";
|
||||
import panel2 from "./panel2";
|
||||
import panel3 from "./panel3";
|
||||
import panel4 from "./panel4";
|
||||
import panel5 from "./panel5";
|
||||
import panel6 from "./panel6";
|
||||
|
||||
var pattern = new freesewing.Pattern({ version: version, ...config })
|
||||
.with(pluginBundle);
|
||||
|
||||
pattern.draft = function() {
|
||||
this.parts.base = this.draftBase(new pattern.Part());
|
||||
if (!this.needs("base", true)) this.parts.base.render = false;
|
||||
|
||||
if(this.needs("panels")) this.parts.panels = this.draftPanels(new pattern.Part().copy(this.parts.base));
|
||||
if (!this.needs("panels", true)) this.parts.panels.render = false;
|
||||
|
||||
if (this.needs("panel1"))
|
||||
this.parts.panel1 = this.draftPanel1(new pattern.Part().copy(this.parts.panels));
|
||||
|
||||
if (this.needs("panel2"))
|
||||
this.parts.panel2 = this.draftPanel2(new pattern.Part().copy(this.parts.panels));
|
||||
|
||||
if (this.needs("panel3"))
|
||||
this.parts.panel3 = this.draftPanel3(new pattern.Part().copy(this.parts.panels));
|
||||
|
||||
if (this.needs("panel4"))
|
||||
this.parts.panel4 = this.draftPanel4(new pattern.Part().copy(this.parts.panels));
|
||||
|
||||
if (this.needs("panel5"))
|
||||
this.parts.panel5 = this.draftPanel5(new pattern.Part().copy(this.parts.panels));
|
||||
|
||||
if (this.needs("panel6"))
|
||||
this.parts.panel6 = this.draftPanel6(new pattern.Part().copy(this.parts.panels));
|
||||
|
||||
return pattern;
|
||||
return this;
|
||||
};
|
||||
|
||||
pattern.draftBase = part => base.draft(part);
|
||||
pattern.draftPanels = part => panels.draft(part);
|
||||
pattern.draftPanel1 = part => panel1.draft(part);
|
||||
pattern.draftPanel2 = part => panel2.draft(part);
|
||||
pattern.draftPanel3 = part => panel3.draft(part);
|
||||
pattern.draftPanel4 = part => panel4.draft(part);
|
||||
pattern.draftPanel5 = part => panel5.draft(part);
|
||||
pattern.draftPanel6 = part => panel6.draft(part);
|
||||
// Inheritance boilerplate
|
||||
Cathrin.prototype = Object.create(freesewing.Pattern.prototype);
|
||||
Cathrin.prototype.constructor = Cathrin;
|
||||
|
||||
export default pattern;
|
||||
// Attach per-part draft methods to prototype
|
||||
Cathrin.prototype.draftBase = draftBase;
|
||||
Cathrin.prototype.draftPanels = draftPanels;
|
||||
Cathrin.prototype.draftPanel1 = draftPanel1;
|
||||
Cathrin.prototype.draftPanel2 = draftPanel2;
|
||||
Cathrin.prototype.draftPanel3 = draftPanel3;
|
||||
Cathrin.prototype.draftPanel4 = draftPanel4;
|
||||
Cathrin.prototype.draftPanel5 = draftPanel5;
|
||||
Cathrin.prototype.draftPanel6 = draftPanel6;
|
||||
|
||||
export default Cathrin;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import panel1ab from './panel1ab';
|
||||
|
||||
var panel1 = {
|
||||
draft: function(part) {
|
||||
import draftPanel1ab from './panel1ab';
|
||||
|
||||
export default function(part) {
|
||||
// prettier-ignore
|
||||
let {macro, sa, points, paths, Point, Path, options, complete, paperless } = part.shorthand();
|
||||
|
||||
|
@ -13,7 +11,7 @@ var panel1 = {
|
|||
delete paths.panel5;
|
||||
delete paths.panel6;
|
||||
|
||||
if (options.panels === 13) return panel1ab.draft(part);
|
||||
if (options.panels === 13) return draftPanel1ab(part);
|
||||
|
||||
// Complete pattern?
|
||||
if(complete) {
|
||||
|
@ -70,7 +68,4 @@ var panel1 = {
|
|||
}
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default panel1;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
var panel1ab = {
|
||||
draft: function(part) {
|
||||
|
||||
export default function(part) {
|
||||
// prettier-ignore
|
||||
let {macro, utils, sa, points, paths, Point, Path, options, complete, paperless } = part.shorthand();
|
||||
|
||||
|
@ -145,7 +143,4 @@ var panel1ab = {
|
|||
}
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default panel1ab;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
var panel2 = {
|
||||
draft: function(part) {
|
||||
|
||||
export default function(part) {
|
||||
// prettier-ignore
|
||||
let {macro, sa, points, paths, Point, complete, paperless } = part.shorthand();
|
||||
|
||||
|
@ -73,7 +71,4 @@ var panel2 = {
|
|||
}
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default panel2;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
var panel3 = {
|
||||
draft: function(part) {
|
||||
|
||||
export default function(part) {
|
||||
// prettier-ignore
|
||||
let {macro, sa, points, paths, Point, complete, paperless } = part.shorthand();
|
||||
|
||||
|
@ -73,7 +71,4 @@ var panel3 = {
|
|||
}
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default panel3;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
var panel4 = {
|
||||
draft: function(part) {
|
||||
|
||||
export default function(part) {
|
||||
// prettier-ignore
|
||||
let {macro, sa, snippets, Snippet, points, paths, Point, complete, paperless } = part.shorthand();
|
||||
|
||||
|
@ -76,7 +74,4 @@ var panel4 = {
|
|||
}
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default panel4;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
var panel5 = {
|
||||
draft: function(part) {
|
||||
|
||||
export default function(part) {
|
||||
// prettier-ignore
|
||||
let {macro, sa, points, paths, Point, complete, paperless } = part.shorthand();
|
||||
|
||||
|
@ -73,7 +71,4 @@ var panel5 = {
|
|||
}
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default panel5;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
var panel6 = {
|
||||
draft: function(part) {
|
||||
|
||||
export default function(part) {
|
||||
// prettier-ignore
|
||||
let {macro, sa, points, paths, Point, complete, paperless } = part.shorthand();
|
||||
|
||||
|
@ -81,7 +79,4 @@ var panel6 = {
|
|||
}
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default panel6;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
var panels = {
|
||||
draft: function(part) {
|
||||
|
||||
export default function(part) {
|
||||
// prettier-ignore
|
||||
let {measurements, options, store, points, snippets, paths, Point, Snippet, Path, utils, complete, debug } = part.shorthand();
|
||||
let count = 1;
|
||||
|
@ -110,7 +108,4 @@ var panels = {
|
|||
paths.outline.render = false;
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default panels;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue