sparkles: Updates for freesewing v0.23
This commit is contained in:
parent
0e726bd55b
commit
8f5747e078
14 changed files with 1949 additions and 2058 deletions
|
@ -13,6 +13,29 @@ export default {
|
||||||
"wristCircumference",
|
"wristCircumference",
|
||||||
"headCircumference",
|
"headCircumference",
|
||||||
],
|
],
|
||||||
|
parts: [ "waistband", "cuff" ],
|
||||||
|
dependencies: {
|
||||||
|
frontBase: "base",
|
||||||
|
front: "frontBase",
|
||||||
|
backBase: "base",
|
||||||
|
back: "backBase",
|
||||||
|
sleeveBase: "sleevecap",
|
||||||
|
sleeve: "sleeveBase",
|
||||||
|
pocket: "front",
|
||||||
|
pocketFacing: "pocket",
|
||||||
|
hoodCenter: "hoodSide",
|
||||||
|
},
|
||||||
|
inject: {
|
||||||
|
frontBase: "base",
|
||||||
|
front: "frontBase",
|
||||||
|
backBase: "base",
|
||||||
|
back: "backBase",
|
||||||
|
sleeveBase: "sleevecap",
|
||||||
|
sleeve: "sleeveBase",
|
||||||
|
pocket: "front",
|
||||||
|
pocketFacing: "pocket"
|
||||||
|
},
|
||||||
|
hide: [ "base", "frontBase", "backBase", "sleeveBase" ],
|
||||||
options: {
|
options: {
|
||||||
// Constants
|
// Constants
|
||||||
brianFitSleeve: false,
|
brianFitSleeve: false,
|
||||||
|
|
|
@ -18,7 +18,8 @@
|
||||||
<script type="text/javascript" src="node_modules/@freesewing/models/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 type="text/javascript" src="node_modules/@freesewing/antman/dist/browser.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var pattern = freesewing.patterns.hugo
|
var pattern = new freesewing.patterns.hugo;
|
||||||
|
pattern
|
||||||
.with(freesewing.plugins.debug)
|
.with(freesewing.plugins.debug)
|
||||||
.with(freesewing.plugins.theme)
|
.with(freesewing.plugins.theme)
|
||||||
.with(freesewing.plugins.designer)
|
.with(freesewing.plugins.designer)
|
||||||
|
|
1900
packages/hugo/package-lock.json
generated
1900
packages/hugo/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -47,9 +47,9 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@freesewing/brian": "^0.11",
|
"freesewing": "^0.23.2",
|
||||||
"@freesewing/plugin-bundle": "^0.3",
|
"@freesewing/brian": "^0.19",
|
||||||
"freesewing": "^0.17"
|
"@freesewing/plugin-bundle": "^0.5.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "7.0.0-beta.56",
|
"@babel/core": "7.0.0-beta.56",
|
||||||
|
@ -61,11 +61,11 @@
|
||||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||||
"@freesewing/antman": "0.2.0",
|
"@freesewing/antman": "0.2.0",
|
||||||
"@freesewing/models": "0.6.0",
|
"@freesewing/models": "0.6.0",
|
||||||
"@freesewing/plugin-debug": "0.1.0",
|
"@freesewing/plugin-debug": "0.5.2",
|
||||||
"@freesewing/plugin-designer": "0.7.3",
|
"@freesewing/plugin-designer": "0.10.0",
|
||||||
"@freesewing/plugin-theme": "0.13.2",
|
"@freesewing/plugin-theme": "0.18.3",
|
||||||
"@freesewing/plugin-validate": "0.2.0",
|
"@freesewing/plugin-validate": "0.4.1",
|
||||||
"@freesewing/plugin-i18n": "0.0.1",
|
"@freesewing/plugin-i18n": "0.1.2",
|
||||||
"eslint": "5.3.0",
|
"eslint": "5.3.0",
|
||||||
"eslint-config-prettier": "^2.9.0",
|
"eslint-config-prettier": "^2.9.0",
|
||||||
"eslint-plugin-prettier": "^2.6.2",
|
"eslint-plugin-prettier": "^2.6.2",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
var back = {
|
export default function(part) {
|
||||||
draft: function(part) {
|
|
||||||
// Remove clutter
|
// Remove clutter
|
||||||
let seam = part.paths.seam;
|
let seam = part.paths.seam;
|
||||||
part.paths = {};
|
part.paths = {};
|
||||||
|
@ -110,7 +109,4 @@ var back = {
|
||||||
}
|
}
|
||||||
|
|
||||||
return part;
|
return part;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default back;
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
var cuff = {
|
export default function(part) {
|
||||||
draft: function(part) {
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
let {measurements, options, sa, Point, points, Path, paths, complete, paperless, macro, units} = part.shorthand();
|
let {measurements, options, sa, Point, points, Path, paths, complete, paperless, macro, units} = part.shorthand();
|
||||||
|
|
||||||
|
@ -57,7 +56,4 @@ var cuff = {
|
||||||
}
|
}
|
||||||
|
|
||||||
return part;
|
return part;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default cuff;
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
var front = {
|
export default function(part) {
|
||||||
draft: function(part) {
|
|
||||||
// Remove clutter
|
// Remove clutter
|
||||||
let seam = part.paths.seam;
|
let seam = part.paths.seam;
|
||||||
part.paths = {};
|
part.paths = {};
|
||||||
|
@ -167,7 +166,4 @@ var front = {
|
||||||
}
|
}
|
||||||
|
|
||||||
return part;
|
return part;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default front;
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
var hoodCenter = {
|
export default function(part) {
|
||||||
draft: function(part) {
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
let {store, sa, Point, points, Path, paths, complete, paperless, macro, units} = part.shorthand();
|
let {store, sa, Point, points, Path, paths, complete, paperless, macro, units} = part.shorthand();
|
||||||
|
|
||||||
|
@ -62,7 +61,4 @@ var hoodCenter = {
|
||||||
}
|
}
|
||||||
|
|
||||||
return part;
|
return part;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default hoodCenter;
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
var hoodSide = {
|
export default function(part) {
|
||||||
draft: function(part) {
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
let {utils, store, sa, Point, points, Path, paths, Snippet, snippets, options, measurements, complete, paperless, macro, debug} = part.shorthand();
|
let {utils, store, sa, Point, points, Path, paths, Snippet, snippets, options, measurements, complete, paperless, macro, debug} = part.shorthand();
|
||||||
|
|
||||||
|
@ -146,7 +145,4 @@ var hoodSide = {
|
||||||
}
|
}
|
||||||
|
|
||||||
return part;
|
return part;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default hoodSide;
|
|
||||||
|
|
|
@ -1,147 +1,56 @@
|
||||||
import freesewing from "freesewing";
|
import freesewing from "freesewing";
|
||||||
import brian from "@freesewing/brian";
|
import Brian from "@freesewing/brian";
|
||||||
import pluginBundle from "@freesewing/plugin-bundle";
|
import pluginBundle from "@freesewing/plugin-bundle";
|
||||||
|
|
||||||
import config from "../config/config";
|
import config from "../config/config";
|
||||||
import { version } from "../package.json";
|
import { version } from "../package.json";
|
||||||
|
// Parts
|
||||||
|
import draftBack from "./back";
|
||||||
|
import draftFront from "./front";
|
||||||
|
import draftSleeve from "./sleeve";
|
||||||
|
import draftPocket from "./pocket";
|
||||||
|
import draftPocketFacing from "./pocketfacing";
|
||||||
|
import draftHoodSide from "./hoodside";
|
||||||
|
import draftHoodCenter from "./hoodcenter";
|
||||||
|
import draftWaistband from "./waistband";
|
||||||
|
import draftCuff from "./cuff";
|
||||||
|
|
||||||
import back from "./back";
|
// Constructor boilerplate
|
||||||
import front from "./front";
|
const Hugo = function(settings = false) {
|
||||||
import sleeve from "./sleeve";
|
freesewing.Pattern.call(this, { version: version, ...config });
|
||||||
import pocket from "./pocket";
|
this.with(pluginBundle);
|
||||||
import pocketFacing from "./pocketfacing";
|
if (settings !== false) this.mergeSettings(settings);
|
||||||
import hoodSide from "./hoodside";
|
|
||||||
import hoodCenter from "./hoodcenter";
|
|
||||||
import waistband from "./waistband";
|
|
||||||
import cuff from "./cuff";
|
|
||||||
|
|
||||||
var pattern = new freesewing.Pattern({ version: version, ...config }).with(
|
return this;
|
||||||
pluginBundle
|
|
||||||
);
|
|
||||||
|
|
||||||
pattern.draft = function() {
|
|
||||||
// base from Brian
|
|
||||||
this.parts.base = this.draftBase(new pattern.Part());
|
|
||||||
if (this.needs(["front", "sleeve", "pocket", "pocketFacing"])) {
|
|
||||||
this.parts.frontBase = this.draftFrontBase(
|
|
||||||
new pattern.Part().copy(this.parts.base)
|
|
||||||
);
|
|
||||||
this.parts.front = this.draftFront(
|
|
||||||
new pattern.Part().copy(this.parts.frontBase)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (this.needs(["back", "sleeve"])) {
|
|
||||||
this.parts.backBase = this.draftBackBase(
|
|
||||||
new pattern.Part().copy(this.parts.base)
|
|
||||||
);
|
|
||||||
this.parts.back = this.draftBack(
|
|
||||||
new pattern.Part().copy(this.parts.backBase)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (this.needs(["sleeve"])) {
|
|
||||||
let sleevecap = freesewing.patterns.brian.draftSleevecap(
|
|
||||||
new pattern.Part()
|
|
||||||
);
|
|
||||||
this.parts.sleeveBase = this.draftSleeveBase(
|
|
||||||
new pattern.Part().copy(sleevecap)
|
|
||||||
);
|
|
||||||
this.parts.sleeve = this.draftSleeve(
|
|
||||||
new pattern.Part().copy(this.parts.sleeveBase)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.needs(["pocket"])) {
|
|
||||||
this.parts.pocket = this.draftPocket(
|
|
||||||
new pattern.Part().copy(this.parts.front)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (this.needs(["pocketFacing"])) {
|
|
||||||
this.parts.pocketFacing = this.draftPocketFacing(
|
|
||||||
new pattern.Part().copy(this.parts.pocket)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.needs(["hoodSide", "hoodCenter"])) {
|
|
||||||
this.parts.hoodSide = this.draftHoodSide(new pattern.Part());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.needs(["hoodCenter"])) {
|
|
||||||
this.parts.hoodCenter = this.draftHoodCenter(new pattern.Part());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.needs(["waistband"])) {
|
|
||||||
this.parts.waistband = this.draftWaistband(new pattern.Part());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.needs(["cuff"])) {
|
|
||||||
this.parts.cuff = this.draftCuff(new pattern.Part());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't render these unless specifically requested
|
|
||||||
if (!this.needs("base", true)) this.parts.base.render = false;
|
|
||||||
if (!this.needs("frontBase", true)) this.parts.frontBase.render = false;
|
|
||||||
if (!this.needs("backBase", true)) this.parts.backBase.render = false;
|
|
||||||
if (!this.needs("sleeveBase", true)) this.parts.sleeveBase.render = false;
|
|
||||||
|
|
||||||
return pattern;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pattern.draftBase = function(part) {
|
// Inheritance boilerplate
|
||||||
let complete = this.settings.complete;
|
Hugo.prototype = Object.create(freesewing.Pattern.prototype);
|
||||||
let paperless = this.settings.paperless;
|
Hugo.prototype.constructor = Hugo;
|
||||||
this.settings.complete = false;
|
|
||||||
this.settings.paperless = false;
|
|
||||||
let brianBase = freesewing.patterns.brian.draftBase(part);
|
|
||||||
this.settings.complete = complete;
|
|
||||||
this.settings.paperless = paperless;
|
|
||||||
|
|
||||||
return brianBase;
|
// Attach per-part draft methods to prototype
|
||||||
};
|
Hugo.prototype.draftBase = function (part) {
|
||||||
|
return new Brian(this.settings).draftBase(part);
|
||||||
|
}
|
||||||
|
Hugo.prototype.draftFrontBase = function (part) {
|
||||||
|
return new Brian(this.settings).draftFront(part);
|
||||||
|
}
|
||||||
|
Hugo.prototype.draftBackBase = function (part) {
|
||||||
|
return new Brian(this.settings).draftBack(part);
|
||||||
|
}
|
||||||
|
Hugo.prototype.draftSleeveBase = function (part) {
|
||||||
|
return new Brian(this.settings).draftSleeve(part);
|
||||||
|
}
|
||||||
|
Hugo.prototype.draftSleevecap = function (part) {
|
||||||
|
return new Brian(this.settings).draftSleevecap(part);
|
||||||
|
}
|
||||||
|
Hugo.prototype.draftBack = draftBack;
|
||||||
|
Hugo.prototype.draftFront = draftFront;
|
||||||
|
Hugo.prototype.draftSleeve = draftSleeve;
|
||||||
|
Hugo.prototype.draftPocket = draftPocket;
|
||||||
|
Hugo.prototype.draftPocketFacing = draftPocketFacing;
|
||||||
|
Hugo.prototype.draftHoodSide = draftHoodSide;
|
||||||
|
Hugo.prototype.draftHoodCenter = draftHoodCenter;
|
||||||
|
Hugo.prototype.draftWaistband = draftWaistband;
|
||||||
|
Hugo.prototype.draftCuff = draftCuff;
|
||||||
|
|
||||||
pattern.draftFrontBase = function(part) {
|
export default Hugo;
|
||||||
let complete = this.settings.complete;
|
|
||||||
let paperless = this.settings.paperless;
|
|
||||||
this.settings.complete = false;
|
|
||||||
this.settings.paperless = false;
|
|
||||||
let brianFront = freesewing.patterns.brian.draftFront(part);
|
|
||||||
this.settings.complete = complete;
|
|
||||||
this.settings.paperless = paperless;
|
|
||||||
|
|
||||||
return brianFront;
|
|
||||||
};
|
|
||||||
|
|
||||||
pattern.draftBackBase = function(part) {
|
|
||||||
let complete = this.settings.complete;
|
|
||||||
let paperless = this.settings.paperless;
|
|
||||||
this.settings.complete = false;
|
|
||||||
this.settings.paperless = false;
|
|
||||||
let brianBack = freesewing.patterns.brian.draftBack(part);
|
|
||||||
this.settings.complete = complete;
|
|
||||||
this.settings.paperless = paperless;
|
|
||||||
|
|
||||||
return brianBack;
|
|
||||||
};
|
|
||||||
|
|
||||||
pattern.draftSleeveBase = function(part) {
|
|
||||||
let complete = this.settings.complete;
|
|
||||||
let paperless = this.settings.paperless;
|
|
||||||
this.settings.complete = false;
|
|
||||||
this.settings.paperless = false;
|
|
||||||
let brianSleeve = freesewing.patterns.brian.draftSleeve(part);
|
|
||||||
this.settings.complete = complete;
|
|
||||||
this.settings.paperless = paperless;
|
|
||||||
|
|
||||||
return brianSleeve;
|
|
||||||
};
|
|
||||||
|
|
||||||
pattern.draftFront = part => front.draft(part);
|
|
||||||
pattern.draftBack = part => back.draft(part);
|
|
||||||
pattern.draftSleeve = part => sleeve.draft(part);
|
|
||||||
pattern.draftPocket = part => pocket.draft(part);
|
|
||||||
pattern.draftPocketFacing = part => pocketFacing.draft(part);
|
|
||||||
pattern.draftHoodSide = part => hoodSide.draft(part);
|
|
||||||
pattern.draftHoodCenter = part => hoodCenter.draft(part);
|
|
||||||
pattern.draftWaistband = part => waistband.draft(part);
|
|
||||||
pattern.draftCuff = part => cuff.draft(part);
|
|
||||||
|
|
||||||
export default pattern;
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
var pocket = {
|
export default function(part) {
|
||||||
draft: function(part) {
|
|
||||||
// Remove clutter
|
// Remove clutter
|
||||||
let pocket = part.paths.pocket;
|
let pocket = part.paths.pocket;
|
||||||
part.paths = {};
|
part.paths = {};
|
||||||
|
@ -74,7 +73,4 @@ var pocket = {
|
||||||
}
|
}
|
||||||
|
|
||||||
return part;
|
return part;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default pocket;
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
var pocketFacing = {
|
export default function(part) {
|
||||||
draft: function(part) {
|
|
||||||
// Remove clutter
|
// Remove clutter
|
||||||
let facing = part.paths.facing;
|
let facing = part.paths.facing;
|
||||||
part.paths = {};
|
part.paths = {};
|
||||||
|
@ -45,7 +44,4 @@ var pocketFacing = {
|
||||||
}
|
}
|
||||||
|
|
||||||
return part;
|
return part;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default pocketFacing;
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
var sleeve = {
|
export default function(part) {
|
||||||
draft: function(part) {
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
let {utils, store, sa, Point, points, Path, paths, Snippet, snippets, options, measurements, complete, paperless, macro, debug} = part.shorthand();
|
let {utils, store, sa, Point, points, Path, paths, Snippet, snippets, options, measurements, complete, paperless, macro, debug} = part.shorthand();
|
||||||
|
|
||||||
|
@ -252,7 +251,4 @@ var sleeve = {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return part;
|
return part;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default sleeve;
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
var waistband = {
|
export default function(part) {
|
||||||
draft: function(part) {
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
let {measurements, options, sa, Point, points, Path, paths, complete, paperless, macro, units} = part.shorthand();
|
let {measurements, options, sa, Point, points, Path, paths, complete, paperless, macro, units} = part.shorthand();
|
||||||
|
|
||||||
|
@ -70,7 +69,4 @@ var waistband = {
|
||||||
}
|
}
|
||||||
|
|
||||||
return part;
|
return part;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default waistband;
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue