1
0
Fork 0

Trying my hand at plugin-react

This commit is contained in:
Joost De Cock 2019-05-03 20:13:27 +02:00
parent ad9f559dc0
commit 16c83a507a
55 changed files with 466 additions and 90 deletions

View file

@ -16,28 +16,29 @@
"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",
"pubtest": "npm publish --registry http://localhost:6662",
"pubforce": "npm publish",
"symlink": "mkdir -p ./node_modules/@freesewing && cd ./node_modules/@freesewing && ln -s -f ../../../* . && cd -",
"storybook": "start-storybook -p 6663"
"storybook": "start-storybook -p 6663",
"watch": "BABEL_ENV=production rollup -c -w -o dist/index.js -f cjs"
},
"peerDependencies": {
"@freesewing/css-theme": "^2.0.0-alpha.17",
"@freesewing/i18n": "^2.0.0-alpha.17",
"@freesewing/mui-theme": "^2.0.0-alpha.17",
"@freesewing/pattern-info": "^2.0.0-alpha.17",
"@freesewing/utils": "^2.0.0-alpha.17",
"react": "^16.8",
"prop-types": "15.7.2",
"@freesewing/pattern-info": "^2.0.0-alpha.18",
"@freesewing/mui-theme": "^2.0.0-alpha.18",
"@freesewing/css-theme": "^2.0.0-alpha.18",
"@freesewing/plugin-react": "^2.0.0-alpha.18",
"typeface-roboto-condensed": "latest",
"@freesewing/i18n": "^2.0.0-alpha.18",
"@freesewing/utils": "^2.0.0-alpha.18",
"react-intl": "^2.8.0",
"@material-ui/core": "^3.9.3",
"@material-ui/icons": "^3.0.2",
"@material-ui/lab": "^3.0.0-alpha.30",
"prop-types": "15.7.2",
"react": "^16.8",
"react-intl": "^2.8.0",
"typeface-roboto-condensed": "latest"
"@material-ui/lab": "^3.0.0-alpha.30"
},
"files": [
"dist/*",

View file

@ -6,7 +6,7 @@ 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 reactPlugin from "@freesewing/plugin-react";
import { strings } from "@freesewing/i18n";
import { FormattedMessage } from "react-intl";
@ -16,9 +16,8 @@ const DraftPattern = props => {
.use(svgattrPlugin, { class: "freesewing draft" })
.use(i18nPlugin, { strings: strings })
.use(validatePlugin)
.use(designerPlugin, props.raiseEvent);
.use(reactPlugin);
pattern.draft();
console.dir({ pattern });
return (
<div className="fs-sa">