diff --git a/config/scripts.yaml b/config/scripts.yaml index 1c18c1e0b50..18b4ad724ff 100644 --- a/config/scripts.yaml +++ b/config/scripts.yaml @@ -24,6 +24,7 @@ components: # react-scripts doesn't handle .mjs files correctly modulebuild: '!' build: "npm run clean && npm run nodebuild" + watch: "BABEL_ENV=production rollup -c -w -o dist/index.js -f cjs" core: test: "BABEL_ENV=production nyc mocha tests/*.test.js" report: "BABEL_ENV=production nyc report --reporter=html mocha --compilers js:babel-core/register tests/*.test.js" diff --git a/packages/components/in b/packages/components/in new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/components/package.json b/packages/components/package.json index 2cfea0a8fbc..0fac1ef1b8f 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -16,6 +16,7 @@ "main": "dist/index.js", "scripts": { "clean": "rimraf dist", + "watch": "BABEL_ENV=production rollup -c -w -o dist/index.js -f cjs", "nodebuild": "BABEL_ENV=production rollup -c -o dist/index.js -f cjs", "build": "npm run clean && npm run nodebuild", "test": "echo \"components: No tests configured. Perhaps you'd like to do this?\" && exit 0", diff --git a/packages/components/src/Icon/index.js b/packages/components/src/Icon/index.js index 1f8ce7cdb33..b000ba51efb 100644 --- a/packages/components/src/Icon/index.js +++ b/packages/components/src/Icon/index.js @@ -23,7 +23,7 @@ const Icon = props => { Icon.propTypes = { size: PropTypes.number, viewBox: PropTypes.string, - pathString: PropTypes.string.isRequired + icon: PropTypes.string }; Icon.defaultProps = { diff --git a/packages/components/src/Workbench/DraftPattern/index.js b/packages/components/src/Workbench/DraftPattern/index.js new file mode 100644 index 00000000000..d4fed3c059d --- /dev/null +++ b/packages/components/src/Workbench/DraftPattern/index.js @@ -0,0 +1,64 @@ +import React from "react"; +import PropTypes from "prop-types"; +import { defaultGist } from "@freesewing/utils"; +import DraftConfigurator from "../../DraftConfigurator"; +import themePlugin from "@freesewing/plugin-theme"; +import svgattrPlugin from "@freesewing/plugin-svgattr"; +import i18nPlugin from "@freesewing/plugin-i18n"; +import validatePlugin from "@freesewing/plugin-validate"; +import designerPlugin from "@freesewing/plugin-designer"; +import { strings } from "@freesewing/i18n"; +import { FormattedMessage } from "react-intl"; + +const DraftPattern = props => { + let pattern = new props.Pattern(props.gist.settings) + .use(themePlugin) + .use(svgattrPlugin, { class: "freesewing draft" }) + .use(i18nPlugin, { strings: strings }) + .use(validatePlugin) + .use(designerPlugin, props.raiseEvent); + pattern.draft(); + console.dir({ pattern }); + + return ( +
{JSON.stringify(props.gist, null, 2)}+
{JSON.stringify(props.gist, null, 2)}-