✨ Added pattern examples
10
packages/aaron/example/.babelrc
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"plugins": [
|
||||||
|
["prismjs", {
|
||||||
|
"languages": ["javascript", "css", "markup"],
|
||||||
|
"plugins": ["line-numbers"],
|
||||||
|
"theme": "twilight",
|
||||||
|
"css": true
|
||||||
|
}]
|
||||||
|
]
|
||||||
|
}
|
96
packages/aaron/example/README.md
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
<p align="center">
|
||||||
|
<a title="Go to freesewing.org" href="https://freesewing.org/"><img src="https://freesewing.org/img/logo/black.svg" align="center" width="150px" alt="Freesewing logo"/></a>
|
||||||
|
<br>
|
||||||
|
<a href="https://freesewing.org/">FreeSewing v2</a>
|
||||||
|
</p>
|
||||||
|
<p align="center">A JavaScript library for made-to-measure sewing patterns</p>
|
||||||
|
<p align='center'><a
|
||||||
|
href="https://twitter.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-blue.svg?logo=twitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://gitter.im/freesewing/freesewing"
|
||||||
|
title="Chat with us on Gitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Chat%20with%20us-CA0547.svg?logo=gitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Chat with us on Gitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://freesewing.org/patrons/join"
|
||||||
|
title="Become a FreeSewing Patron"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Support%20us-blueviolet.svg?logo=cash-app&logoColor=white&logoWidth=15"
|
||||||
|
alt="Become a FreeSewing Patron"/>
|
||||||
|
</a><a
|
||||||
|
href="https://instagram.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-E4405F.svg?logo=instagram&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
# aaron example
|
||||||
|
|
||||||
|
This project was bootstrapped with [Create Freesewing Pattern](https://en.freesewing.dev/create-freesewing-pattern):
|
||||||
|
|
||||||
|
```js
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
This example folder is part of the local development environment.
|
||||||
|
It is **not** part of the pattern's source code.
|
||||||
|
|
||||||
|
To run this example, follow these steps:
|
||||||
|
|
||||||
|
- In the folder above this one, run: `yarn start` (or `npm start`)
|
||||||
|
- Then, in new terminal, run the same command in this folder: `yarn start` (or `npm start`)
|
||||||
|
|
||||||
|
This will spin up the development environment, similar to [our online demo](https://aaron.freesewing.dev/).
|
||||||
|
|
||||||
|
## About FreeSewing 🤔
|
||||||
|
|
||||||
|
Where the world of makers and developers collide, that's where you'll find FreeSewing.
|
||||||
|
|
||||||
|
Our [core library](https://freesewing.dev/en/freesewing) is a *batteries-included* toolbox
|
||||||
|
for parametric design of sewing patterns. It's a modular system (check our list
|
||||||
|
of [plugins](https://freesewing.dev/en/plugins) and getting started is as simple as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
The [getting started] section on [freesewing.dev](https://freesewing.dev/) is a good
|
||||||
|
entrypoint to our documentation, but you'll find a lot more there, including
|
||||||
|
our [API documentation](https://freesewing.dev/en/freesewing/api),
|
||||||
|
as well as [examples](https://freesewing.dev/en/freesewing/examples),
|
||||||
|
and [best practices](https://freesewing.dev/en/do).
|
||||||
|
|
||||||
|
If you're a maker, checkout [freesewing.org](https://freesewing/) where you can generate
|
||||||
|
our sewing patterns adapted to your measurements.
|
||||||
|
|
||||||
|
## Support FreeSewing: Become a patron 🥰
|
||||||
|
|
||||||
|
FreeSewing is an open source project run by a community,
|
||||||
|
and financially supported by our patrons.
|
||||||
|
|
||||||
|
If you feel what we do is worthwhile, you too
|
||||||
|
should [become a patron](https://freesewing.org/patrons/join).
|
||||||
|
|
||||||
|
## Links 👩💻
|
||||||
|
|
||||||
|
- 💻 Makers website: [freesewing.org](https://freesewing.org)
|
||||||
|
- 💻 Developers website: [freesewing.dev](https://freesewing.org)
|
||||||
|
- 💬 Chat: [gitter.im/freesewing](https://gitter.im/freesewing/freesewing)
|
||||||
|
- 🐦 Twitter: [@freesewing_org](https://twitter.com/freesewing_org)
|
||||||
|
- 📷 Instagram: [@freesewing_org](https://instagram.com/freesewing_org)
|
||||||
|
|
||||||
|
## License: MIT 🤓
|
||||||
|
|
||||||
|
© [Joost De Cock](https://github.com/joostdecock).
|
||||||
|
See [the license file](https://github.com/freesewing/freesewing/blob/develop/LICENSE) for details.
|
||||||
|
|
||||||
|
## Where to get help 🤯
|
||||||
|
|
||||||
|
Our [chatroom on Gitter](https://gitter.im) is the best place to ask questions,
|
||||||
|
share your feedback, or just hang out.
|
||||||
|
|
||||||
|
If you want to report a problem, please [create an issue](https://github.com/freesewing/freesewing/issues/new).
|
||||||
|
|
49
packages/aaron/example/package.json
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
"name": "aaron-example",
|
||||||
|
"homepage": "https://freesewing.github.io/aaron",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@freesewing/components": "beta",
|
||||||
|
"@freesewing/core": "beta",
|
||||||
|
"@freesewing/css-theme": "beta",
|
||||||
|
"@freesewing/i18n": "beta",
|
||||||
|
"@freesewing/models": "beta",
|
||||||
|
"@freesewing/mui-theme": "beta",
|
||||||
|
"@freesewing/pattern-info": "beta",
|
||||||
|
"@freesewing/plugin-debug": "beta",
|
||||||
|
"@freesewing/plugin-designer": "beta",
|
||||||
|
"@freesewing/plugin-i18n": "beta",
|
||||||
|
"@freesewing/plugin-svgattr": "beta",
|
||||||
|
"@freesewing/plugin-theme": "beta",
|
||||||
|
"@freesewing/plugin-validate": "beta",
|
||||||
|
"@freesewing/utils": "beta",
|
||||||
|
"@material-ui/core": "^3.9.3",
|
||||||
|
"@material-ui/icons": "^3.0.2",
|
||||||
|
"@material-ui/lab": "^3.0.0-alpha.30",
|
||||||
|
"pattern": "link:..",
|
||||||
|
"prismjs": "1.16.0",
|
||||||
|
"react": "^16.8",
|
||||||
|
"react-dom": "^16.8",
|
||||||
|
"react-scripts": "^3.0.0",
|
||||||
|
"typeface-roboto-condensed": "latest"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"start": "react-scripts start",
|
||||||
|
"build": "react-scripts build",
|
||||||
|
"test": "react-scripts test",
|
||||||
|
"eject": "react-scripts eject"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"extends": "react-app"
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
">0.2%",
|
||||||
|
"not dead",
|
||||||
|
"not ie <= 11",
|
||||||
|
"not op_mini all"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"babel-plugin-prismjs": "1.0.2"
|
||||||
|
}
|
||||||
|
}
|
23
packages/aaron/example/public/App.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
import "./App.css";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
BIN
packages/aaron/example/public/favicon.ico
Normal file
After Width: | Height: | Size: 12 KiB |
40
packages/aaron/example/public/index.html
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<meta name="theme-color" content="#000000">
|
||||||
|
<!--
|
||||||
|
manifest.json provides metadata used when your web app is added to the
|
||||||
|
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
|
||||||
|
-->
|
||||||
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
|
||||||
|
<!--
|
||||||
|
Notice the use of %PUBLIC_URL% in the tags above.
|
||||||
|
It will be replaced with the URL of the `public` folder during the build.
|
||||||
|
Only files inside the `public` folder can be referenced from the HTML.
|
||||||
|
|
||||||
|
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||||
|
work correctly both with client-side routing and a non-root public URL.
|
||||||
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
|
-->
|
||||||
|
<title>aaron</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
You need to enable JavaScript to run this app.
|
||||||
|
</noscript>
|
||||||
|
<div id="root"></div>
|
||||||
|
<!--
|
||||||
|
This HTML file is a template.
|
||||||
|
If you open it directly in the browser, you will see an empty page.
|
||||||
|
|
||||||
|
You can add webfonts, meta tags, or analytics to this file.
|
||||||
|
The build step will place the bundled scripts into the <body> tag.
|
||||||
|
|
||||||
|
To begin the development, run `npm start` or `yarn start`.
|
||||||
|
To create a production bundle, use `npm run build` or `yarn build`.
|
||||||
|
-->
|
||||||
|
</body>
|
||||||
|
</html>
|
15
packages/aaron/example/public/manifest.json
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"short_name": "aaron",
|
||||||
|
"name": "aaron",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "favicon.ico",
|
||||||
|
"sizes": "64x64 32x32 24x24 16x16",
|
||||||
|
"type": "image/x-icon"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"start_url": ".",
|
||||||
|
"display": "standalone",
|
||||||
|
"theme_color": "#000000",
|
||||||
|
"background_color": "#ffffff"
|
||||||
|
}
|
22
packages/aaron/example/src/App.js
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
11
packages/aaron/example/src/index.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import React from "react";
|
||||||
|
import ReactDOM from "react-dom";
|
||||||
|
import App from "./App";
|
||||||
|
import * as serviceWorker from "./serviceWorker";
|
||||||
|
|
||||||
|
ReactDOM.render(<App />, document.getElementById("root"));
|
||||||
|
|
||||||
|
// If you want your app to work offline and load faster, you can change
|
||||||
|
// unregister() to register() below. Note this comes with some pitfalls.
|
||||||
|
// Learn more about service workers: http://bit.ly/CRA-PWA
|
||||||
|
serviceWorker.unregister();
|
127
packages/aaron/example/src/serviceWorker.js
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
// In production, we register a service worker to serve assets from local cache.
|
||||||
|
|
||||||
|
// This lets the app load faster on subsequent visits in production, and gives
|
||||||
|
// it offline capabilities. However, it also means that developers (and users)
|
||||||
|
// will only see deployed updates on the "N+1" visit to a page, since previously
|
||||||
|
// cached resources are updated in the background.
|
||||||
|
|
||||||
|
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
|
||||||
|
// This link also includes instructions on opting out of this behavior.
|
||||||
|
|
||||||
|
const isLocalhost = Boolean(
|
||||||
|
window.location.hostname === "localhost" ||
|
||||||
|
// [::1] is the IPv6 localhost address.
|
||||||
|
window.location.hostname === "[::1]" ||
|
||||||
|
// 127.0.0.1/8 is considered localhost for IPv4.
|
||||||
|
window.location.hostname.match(
|
||||||
|
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
export function register(config) {
|
||||||
|
if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
|
||||||
|
// The URL constructor is available in all browsers that support SW.
|
||||||
|
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
|
||||||
|
if (publicUrl.origin !== window.location.origin) {
|
||||||
|
// Our service worker won't work if PUBLIC_URL is on a different origin
|
||||||
|
// from what our page is served on. This might happen if a CDN is used to
|
||||||
|
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("load", () => {
|
||||||
|
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
||||||
|
|
||||||
|
if (isLocalhost) {
|
||||||
|
// This is running on localhost. Let's check if a service worker still exists or not.
|
||||||
|
checkValidServiceWorker(swUrl, config);
|
||||||
|
|
||||||
|
// Add some additional logging to localhost, pointing developers to the
|
||||||
|
// service worker/PWA documentation.
|
||||||
|
navigator.serviceWorker.ready.then(() => {
|
||||||
|
console.log(
|
||||||
|
"This web app is being served cache-first by a service " +
|
||||||
|
"worker. To learn more, visit https://goo.gl/SC7cgQ"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Is not local host. Just register service worker
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function registerValidSW(swUrl, config) {
|
||||||
|
navigator.serviceWorker
|
||||||
|
.register(swUrl)
|
||||||
|
.then(registration => {
|
||||||
|
registration.onupdatefound = () => {
|
||||||
|
const installingWorker = registration.installing;
|
||||||
|
installingWorker.onstatechange = () => {
|
||||||
|
if (installingWorker.state === "installed") {
|
||||||
|
if (navigator.serviceWorker.controller) {
|
||||||
|
// At this point, the old content will have been purged and
|
||||||
|
// the fresh content will have been added to the cache.
|
||||||
|
// It's the perfect time to display a "New content is
|
||||||
|
// available; please refresh." message in your web app.
|
||||||
|
console.log("New content is available; please refresh.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onUpdate) {
|
||||||
|
config.onUpdate(registration);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// At this point, everything has been precached.
|
||||||
|
// It's the perfect time to display a
|
||||||
|
// "Content is cached for offline use." message.
|
||||||
|
console.log("Content is cached for offline use.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onSuccess) {
|
||||||
|
config.onSuccess(registration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error("Error during service worker registration:", error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkValidServiceWorker(swUrl, config) {
|
||||||
|
// Check if the service worker can be found. If it can't reload the page.
|
||||||
|
fetch(swUrl)
|
||||||
|
.then(response => {
|
||||||
|
// Ensure service worker exists, and that we really are getting a JS file.
|
||||||
|
if (
|
||||||
|
response.status === 404 ||
|
||||||
|
response.headers.get("content-type").indexOf("javascript") === -1
|
||||||
|
) {
|
||||||
|
// No service worker found. Probably a different app. Reload the page.
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister().then(() => {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Service worker found. Proceed as normal.
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
console.log(
|
||||||
|
"No internet connection found. App is running in offline mode."
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function unregister() {
|
||||||
|
if ("serviceWorker" in navigator) {
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
10554
packages/aaron/example/yarn.lock
Normal file
10
packages/bent/example/.babelrc
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"plugins": [
|
||||||
|
["prismjs", {
|
||||||
|
"languages": ["javascript", "css", "markup"],
|
||||||
|
"plugins": ["line-numbers"],
|
||||||
|
"theme": "twilight",
|
||||||
|
"css": true
|
||||||
|
}]
|
||||||
|
]
|
||||||
|
}
|
96
packages/bent/example/README.md
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
<p align="center">
|
||||||
|
<a title="Go to freesewing.org" href="https://freesewing.org/"><img src="https://freesewing.org/img/logo/black.svg" align="center" width="150px" alt="Freesewing logo"/></a>
|
||||||
|
<br>
|
||||||
|
<a href="https://freesewing.org/">FreeSewing v2</a>
|
||||||
|
</p>
|
||||||
|
<p align="center">A JavaScript library for made-to-measure sewing patterns</p>
|
||||||
|
<p align='center'><a
|
||||||
|
href="https://twitter.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-blue.svg?logo=twitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://gitter.im/freesewing/freesewing"
|
||||||
|
title="Chat with us on Gitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Chat%20with%20us-CA0547.svg?logo=gitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Chat with us on Gitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://freesewing.org/patrons/join"
|
||||||
|
title="Become a FreeSewing Patron"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Support%20us-blueviolet.svg?logo=cash-app&logoColor=white&logoWidth=15"
|
||||||
|
alt="Become a FreeSewing Patron"/>
|
||||||
|
</a><a
|
||||||
|
href="https://instagram.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-E4405F.svg?logo=instagram&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
# bent example
|
||||||
|
|
||||||
|
This project was bootstrapped with [Create Freesewing Pattern](https://en.freesewing.dev/create-freesewing-pattern):
|
||||||
|
|
||||||
|
```js
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
This example folder is part of the local development environment.
|
||||||
|
It is **not** part of the pattern's source code.
|
||||||
|
|
||||||
|
To run this example, follow these steps:
|
||||||
|
|
||||||
|
- In the folder above this one, run: `yarn start` (or `npm start`)
|
||||||
|
- Then, in new terminal, run the same command in this folder: `yarn start` (or `npm start`)
|
||||||
|
|
||||||
|
This will spin up the development environment, similar to [our online demo](https://bent.freesewing.dev/).
|
||||||
|
|
||||||
|
## About FreeSewing 🤔
|
||||||
|
|
||||||
|
Where the world of makers and developers collide, that's where you'll find FreeSewing.
|
||||||
|
|
||||||
|
Our [core library](https://freesewing.dev/en/freesewing) is a *batteries-included* toolbox
|
||||||
|
for parametric design of sewing patterns. It's a modular system (check our list
|
||||||
|
of [plugins](https://freesewing.dev/en/plugins) and getting started is as simple as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
The [getting started] section on [freesewing.dev](https://freesewing.dev/) is a good
|
||||||
|
entrypoint to our documentation, but you'll find a lot more there, including
|
||||||
|
our [API documentation](https://freesewing.dev/en/freesewing/api),
|
||||||
|
as well as [examples](https://freesewing.dev/en/freesewing/examples),
|
||||||
|
and [best practices](https://freesewing.dev/en/do).
|
||||||
|
|
||||||
|
If you're a maker, checkout [freesewing.org](https://freesewing/) where you can generate
|
||||||
|
our sewing patterns adapted to your measurements.
|
||||||
|
|
||||||
|
## Support FreeSewing: Become a patron 🥰
|
||||||
|
|
||||||
|
FreeSewing is an open source project run by a community,
|
||||||
|
and financially supported by our patrons.
|
||||||
|
|
||||||
|
If you feel what we do is worthwhile, you too
|
||||||
|
should [become a patron](https://freesewing.org/patrons/join).
|
||||||
|
|
||||||
|
## Links 👩💻
|
||||||
|
|
||||||
|
- 💻 Makers website: [freesewing.org](https://freesewing.org)
|
||||||
|
- 💻 Developers website: [freesewing.dev](https://freesewing.org)
|
||||||
|
- 💬 Chat: [gitter.im/freesewing](https://gitter.im/freesewing/freesewing)
|
||||||
|
- 🐦 Twitter: [@freesewing_org](https://twitter.com/freesewing_org)
|
||||||
|
- 📷 Instagram: [@freesewing_org](https://instagram.com/freesewing_org)
|
||||||
|
|
||||||
|
## License: MIT 🤓
|
||||||
|
|
||||||
|
© [Joost De Cock](https://github.com/joostdecock).
|
||||||
|
See [the license file](https://github.com/freesewing/freesewing/blob/develop/LICENSE) for details.
|
||||||
|
|
||||||
|
## Where to get help 🤯
|
||||||
|
|
||||||
|
Our [chatroom on Gitter](https://gitter.im) is the best place to ask questions,
|
||||||
|
share your feedback, or just hang out.
|
||||||
|
|
||||||
|
If you want to report a problem, please [create an issue](https://github.com/freesewing/freesewing/issues/new).
|
||||||
|
|
49
packages/bent/example/package.json
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
"name": "bent-example",
|
||||||
|
"homepage": "https://freesewing.github.io/bent",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@freesewing/components": "beta",
|
||||||
|
"@freesewing/core": "beta",
|
||||||
|
"@freesewing/css-theme": "beta",
|
||||||
|
"@freesewing/i18n": "beta",
|
||||||
|
"@freesewing/models": "beta",
|
||||||
|
"@freesewing/mui-theme": "beta",
|
||||||
|
"@freesewing/pattern-info": "beta",
|
||||||
|
"@freesewing/plugin-debug": "beta",
|
||||||
|
"@freesewing/plugin-designer": "beta",
|
||||||
|
"@freesewing/plugin-i18n": "beta",
|
||||||
|
"@freesewing/plugin-svgattr": "beta",
|
||||||
|
"@freesewing/plugin-theme": "beta",
|
||||||
|
"@freesewing/plugin-validate": "beta",
|
||||||
|
"@freesewing/utils": "beta",
|
||||||
|
"@material-ui/core": "^3.9.3",
|
||||||
|
"@material-ui/icons": "^3.0.2",
|
||||||
|
"@material-ui/lab": "^3.0.0-alpha.30",
|
||||||
|
"pattern": "link:..",
|
||||||
|
"prismjs": "1.16.0",
|
||||||
|
"react": "^16.8",
|
||||||
|
"react-dom": "^16.8",
|
||||||
|
"react-scripts": "^3.0.0",
|
||||||
|
"typeface-roboto-condensed": "latest"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"start": "react-scripts start",
|
||||||
|
"build": "react-scripts build",
|
||||||
|
"test": "react-scripts test",
|
||||||
|
"eject": "react-scripts eject"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"extends": "react-app"
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
">0.2%",
|
||||||
|
"not dead",
|
||||||
|
"not ie <= 11",
|
||||||
|
"not op_mini all"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"babel-plugin-prismjs": "1.0.2"
|
||||||
|
}
|
||||||
|
}
|
23
packages/bent/example/public/App.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
import "./App.css";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
BIN
packages/bent/example/public/favicon.ico
Normal file
After Width: | Height: | Size: 12 KiB |
40
packages/bent/example/public/index.html
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<meta name="theme-color" content="#000000">
|
||||||
|
<!--
|
||||||
|
manifest.json provides metadata used when your web app is added to the
|
||||||
|
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
|
||||||
|
-->
|
||||||
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
|
||||||
|
<!--
|
||||||
|
Notice the use of %PUBLIC_URL% in the tags above.
|
||||||
|
It will be replaced with the URL of the `public` folder during the build.
|
||||||
|
Only files inside the `public` folder can be referenced from the HTML.
|
||||||
|
|
||||||
|
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||||
|
work correctly both with client-side routing and a non-root public URL.
|
||||||
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
|
-->
|
||||||
|
<title>bent</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
You need to enable JavaScript to run this app.
|
||||||
|
</noscript>
|
||||||
|
<div id="root"></div>
|
||||||
|
<!--
|
||||||
|
This HTML file is a template.
|
||||||
|
If you open it directly in the browser, you will see an empty page.
|
||||||
|
|
||||||
|
You can add webfonts, meta tags, or analytics to this file.
|
||||||
|
The build step will place the bundled scripts into the <body> tag.
|
||||||
|
|
||||||
|
To begin the development, run `npm start` or `yarn start`.
|
||||||
|
To create a production bundle, use `npm run build` or `yarn build`.
|
||||||
|
-->
|
||||||
|
</body>
|
||||||
|
</html>
|
15
packages/bent/example/public/manifest.json
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"short_name": "bent",
|
||||||
|
"name": "bent",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "favicon.ico",
|
||||||
|
"sizes": "64x64 32x32 24x24 16x16",
|
||||||
|
"type": "image/x-icon"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"start_url": ".",
|
||||||
|
"display": "standalone",
|
||||||
|
"theme_color": "#000000",
|
||||||
|
"background_color": "#ffffff"
|
||||||
|
}
|
22
packages/bent/example/src/App.js
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
11
packages/bent/example/src/index.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import React from "react";
|
||||||
|
import ReactDOM from "react-dom";
|
||||||
|
import App from "./App";
|
||||||
|
import * as serviceWorker from "./serviceWorker";
|
||||||
|
|
||||||
|
ReactDOM.render(<App />, document.getElementById("root"));
|
||||||
|
|
||||||
|
// If you want your app to work offline and load faster, you can change
|
||||||
|
// unregister() to register() below. Note this comes with some pitfalls.
|
||||||
|
// Learn more about service workers: http://bit.ly/CRA-PWA
|
||||||
|
serviceWorker.unregister();
|
127
packages/bent/example/src/serviceWorker.js
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
// In production, we register a service worker to serve assets from local cache.
|
||||||
|
|
||||||
|
// This lets the app load faster on subsequent visits in production, and gives
|
||||||
|
// it offline capabilities. However, it also means that developers (and users)
|
||||||
|
// will only see deployed updates on the "N+1" visit to a page, since previously
|
||||||
|
// cached resources are updated in the background.
|
||||||
|
|
||||||
|
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
|
||||||
|
// This link also includes instructions on opting out of this behavior.
|
||||||
|
|
||||||
|
const isLocalhost = Boolean(
|
||||||
|
window.location.hostname === "localhost" ||
|
||||||
|
// [::1] is the IPv6 localhost address.
|
||||||
|
window.location.hostname === "[::1]" ||
|
||||||
|
// 127.0.0.1/8 is considered localhost for IPv4.
|
||||||
|
window.location.hostname.match(
|
||||||
|
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
export function register(config) {
|
||||||
|
if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
|
||||||
|
// The URL constructor is available in all browsers that support SW.
|
||||||
|
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
|
||||||
|
if (publicUrl.origin !== window.location.origin) {
|
||||||
|
// Our service worker won't work if PUBLIC_URL is on a different origin
|
||||||
|
// from what our page is served on. This might happen if a CDN is used to
|
||||||
|
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("load", () => {
|
||||||
|
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
||||||
|
|
||||||
|
if (isLocalhost) {
|
||||||
|
// This is running on localhost. Let's check if a service worker still exists or not.
|
||||||
|
checkValidServiceWorker(swUrl, config);
|
||||||
|
|
||||||
|
// Add some additional logging to localhost, pointing developers to the
|
||||||
|
// service worker/PWA documentation.
|
||||||
|
navigator.serviceWorker.ready.then(() => {
|
||||||
|
console.log(
|
||||||
|
"This web app is being served cache-first by a service " +
|
||||||
|
"worker. To learn more, visit https://goo.gl/SC7cgQ"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Is not local host. Just register service worker
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function registerValidSW(swUrl, config) {
|
||||||
|
navigator.serviceWorker
|
||||||
|
.register(swUrl)
|
||||||
|
.then(registration => {
|
||||||
|
registration.onupdatefound = () => {
|
||||||
|
const installingWorker = registration.installing;
|
||||||
|
installingWorker.onstatechange = () => {
|
||||||
|
if (installingWorker.state === "installed") {
|
||||||
|
if (navigator.serviceWorker.controller) {
|
||||||
|
// At this point, the old content will have been purged and
|
||||||
|
// the fresh content will have been added to the cache.
|
||||||
|
// It's the perfect time to display a "New content is
|
||||||
|
// available; please refresh." message in your web app.
|
||||||
|
console.log("New content is available; please refresh.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onUpdate) {
|
||||||
|
config.onUpdate(registration);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// At this point, everything has been precached.
|
||||||
|
// It's the perfect time to display a
|
||||||
|
// "Content is cached for offline use." message.
|
||||||
|
console.log("Content is cached for offline use.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onSuccess) {
|
||||||
|
config.onSuccess(registration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error("Error during service worker registration:", error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkValidServiceWorker(swUrl, config) {
|
||||||
|
// Check if the service worker can be found. If it can't reload the page.
|
||||||
|
fetch(swUrl)
|
||||||
|
.then(response => {
|
||||||
|
// Ensure service worker exists, and that we really are getting a JS file.
|
||||||
|
if (
|
||||||
|
response.status === 404 ||
|
||||||
|
response.headers.get("content-type").indexOf("javascript") === -1
|
||||||
|
) {
|
||||||
|
// No service worker found. Probably a different app. Reload the page.
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister().then(() => {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Service worker found. Proceed as normal.
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
console.log(
|
||||||
|
"No internet connection found. App is running in offline mode."
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function unregister() {
|
||||||
|
if ("serviceWorker" in navigator) {
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
10
packages/brian/example/.babelrc
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"plugins": [
|
||||||
|
["prismjs", {
|
||||||
|
"languages": ["javascript", "css", "markup"],
|
||||||
|
"plugins": ["line-numbers"],
|
||||||
|
"theme": "twilight",
|
||||||
|
"css": true
|
||||||
|
}]
|
||||||
|
]
|
||||||
|
}
|
96
packages/brian/example/README.md
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
<p align="center">
|
||||||
|
<a title="Go to freesewing.org" href="https://freesewing.org/"><img src="https://freesewing.org/img/logo/black.svg" align="center" width="150px" alt="Freesewing logo"/></a>
|
||||||
|
<br>
|
||||||
|
<a href="https://freesewing.org/">FreeSewing v2</a>
|
||||||
|
</p>
|
||||||
|
<p align="center">A JavaScript library for made-to-measure sewing patterns</p>
|
||||||
|
<p align='center'><a
|
||||||
|
href="https://twitter.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-blue.svg?logo=twitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://gitter.im/freesewing/freesewing"
|
||||||
|
title="Chat with us on Gitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Chat%20with%20us-CA0547.svg?logo=gitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Chat with us on Gitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://freesewing.org/patrons/join"
|
||||||
|
title="Become a FreeSewing Patron"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Support%20us-blueviolet.svg?logo=cash-app&logoColor=white&logoWidth=15"
|
||||||
|
alt="Become a FreeSewing Patron"/>
|
||||||
|
</a><a
|
||||||
|
href="https://instagram.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-E4405F.svg?logo=instagram&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
# brian example
|
||||||
|
|
||||||
|
This project was bootstrapped with [Create Freesewing Pattern](https://en.freesewing.dev/create-freesewing-pattern):
|
||||||
|
|
||||||
|
```js
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
This example folder is part of the local development environment.
|
||||||
|
It is **not** part of the pattern's source code.
|
||||||
|
|
||||||
|
To run this example, follow these steps:
|
||||||
|
|
||||||
|
- In the folder above this one, run: `yarn start` (or `npm start`)
|
||||||
|
- Then, in new terminal, run the same command in this folder: `yarn start` (or `npm start`)
|
||||||
|
|
||||||
|
This will spin up the development environment, similar to [our online demo](https://brian.freesewing.dev/).
|
||||||
|
|
||||||
|
## About FreeSewing 🤔
|
||||||
|
|
||||||
|
Where the world of makers and developers collide, that's where you'll find FreeSewing.
|
||||||
|
|
||||||
|
Our [core library](https://freesewing.dev/en/freesewing) is a *batteries-included* toolbox
|
||||||
|
for parametric design of sewing patterns. It's a modular system (check our list
|
||||||
|
of [plugins](https://freesewing.dev/en/plugins) and getting started is as simple as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
The [getting started] section on [freesewing.dev](https://freesewing.dev/) is a good
|
||||||
|
entrypoint to our documentation, but you'll find a lot more there, including
|
||||||
|
our [API documentation](https://freesewing.dev/en/freesewing/api),
|
||||||
|
as well as [examples](https://freesewing.dev/en/freesewing/examples),
|
||||||
|
and [best practices](https://freesewing.dev/en/do).
|
||||||
|
|
||||||
|
If you're a maker, checkout [freesewing.org](https://freesewing/) where you can generate
|
||||||
|
our sewing patterns adapted to your measurements.
|
||||||
|
|
||||||
|
## Support FreeSewing: Become a patron 🥰
|
||||||
|
|
||||||
|
FreeSewing is an open source project run by a community,
|
||||||
|
and financially supported by our patrons.
|
||||||
|
|
||||||
|
If you feel what we do is worthwhile, you too
|
||||||
|
should [become a patron](https://freesewing.org/patrons/join).
|
||||||
|
|
||||||
|
## Links 👩💻
|
||||||
|
|
||||||
|
- 💻 Makers website: [freesewing.org](https://freesewing.org)
|
||||||
|
- 💻 Developers website: [freesewing.dev](https://freesewing.org)
|
||||||
|
- 💬 Chat: [gitter.im/freesewing](https://gitter.im/freesewing/freesewing)
|
||||||
|
- 🐦 Twitter: [@freesewing_org](https://twitter.com/freesewing_org)
|
||||||
|
- 📷 Instagram: [@freesewing_org](https://instagram.com/freesewing_org)
|
||||||
|
|
||||||
|
## License: MIT 🤓
|
||||||
|
|
||||||
|
© [Joost De Cock](https://github.com/joostdecock).
|
||||||
|
See [the license file](https://github.com/freesewing/freesewing/blob/develop/LICENSE) for details.
|
||||||
|
|
||||||
|
## Where to get help 🤯
|
||||||
|
|
||||||
|
Our [chatroom on Gitter](https://gitter.im) is the best place to ask questions,
|
||||||
|
share your feedback, or just hang out.
|
||||||
|
|
||||||
|
If you want to report a problem, please [create an issue](https://github.com/freesewing/freesewing/issues/new).
|
||||||
|
|
49
packages/brian/example/package.json
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
"name": "brian-example",
|
||||||
|
"homepage": "https://freesewing.github.io/brian",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@freesewing/components": "beta",
|
||||||
|
"@freesewing/core": "beta",
|
||||||
|
"@freesewing/css-theme": "beta",
|
||||||
|
"@freesewing/i18n": "beta",
|
||||||
|
"@freesewing/models": "beta",
|
||||||
|
"@freesewing/mui-theme": "beta",
|
||||||
|
"@freesewing/pattern-info": "beta",
|
||||||
|
"@freesewing/plugin-debug": "beta",
|
||||||
|
"@freesewing/plugin-designer": "beta",
|
||||||
|
"@freesewing/plugin-i18n": "beta",
|
||||||
|
"@freesewing/plugin-svgattr": "beta",
|
||||||
|
"@freesewing/plugin-theme": "beta",
|
||||||
|
"@freesewing/plugin-validate": "beta",
|
||||||
|
"@freesewing/utils": "beta",
|
||||||
|
"@material-ui/core": "^3.9.3",
|
||||||
|
"@material-ui/icons": "^3.0.2",
|
||||||
|
"@material-ui/lab": "^3.0.0-alpha.30",
|
||||||
|
"pattern": "link:..",
|
||||||
|
"prismjs": "1.16.0",
|
||||||
|
"react": "^16.8",
|
||||||
|
"react-dom": "^16.8",
|
||||||
|
"react-scripts": "^3.0.0",
|
||||||
|
"typeface-roboto-condensed": "latest"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"start": "react-scripts start",
|
||||||
|
"build": "react-scripts build",
|
||||||
|
"test": "react-scripts test",
|
||||||
|
"eject": "react-scripts eject"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"extends": "react-app"
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
">0.2%",
|
||||||
|
"not dead",
|
||||||
|
"not ie <= 11",
|
||||||
|
"not op_mini all"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"babel-plugin-prismjs": "1.0.2"
|
||||||
|
}
|
||||||
|
}
|
23
packages/brian/example/public/App.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
import "./App.css";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
BIN
packages/brian/example/public/favicon.ico
Normal file
After Width: | Height: | Size: 12 KiB |
40
packages/brian/example/public/index.html
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<meta name="theme-color" content="#000000">
|
||||||
|
<!--
|
||||||
|
manifest.json provides metadata used when your web app is added to the
|
||||||
|
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
|
||||||
|
-->
|
||||||
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
|
||||||
|
<!--
|
||||||
|
Notice the use of %PUBLIC_URL% in the tags above.
|
||||||
|
It will be replaced with the URL of the `public` folder during the build.
|
||||||
|
Only files inside the `public` folder can be referenced from the HTML.
|
||||||
|
|
||||||
|
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||||
|
work correctly both with client-side routing and a non-root public URL.
|
||||||
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
|
-->
|
||||||
|
<title>brian</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
You need to enable JavaScript to run this app.
|
||||||
|
</noscript>
|
||||||
|
<div id="root"></div>
|
||||||
|
<!--
|
||||||
|
This HTML file is a template.
|
||||||
|
If you open it directly in the browser, you will see an empty page.
|
||||||
|
|
||||||
|
You can add webfonts, meta tags, or analytics to this file.
|
||||||
|
The build step will place the bundled scripts into the <body> tag.
|
||||||
|
|
||||||
|
To begin the development, run `npm start` or `yarn start`.
|
||||||
|
To create a production bundle, use `npm run build` or `yarn build`.
|
||||||
|
-->
|
||||||
|
</body>
|
||||||
|
</html>
|
15
packages/brian/example/public/manifest.json
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"short_name": "brian",
|
||||||
|
"name": "brian",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "favicon.ico",
|
||||||
|
"sizes": "64x64 32x32 24x24 16x16",
|
||||||
|
"type": "image/x-icon"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"start_url": ".",
|
||||||
|
"display": "standalone",
|
||||||
|
"theme_color": "#000000",
|
||||||
|
"background_color": "#ffffff"
|
||||||
|
}
|
22
packages/brian/example/src/App.js
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
11
packages/brian/example/src/index.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import React from "react";
|
||||||
|
import ReactDOM from "react-dom";
|
||||||
|
import App from "./App";
|
||||||
|
import * as serviceWorker from "./serviceWorker";
|
||||||
|
|
||||||
|
ReactDOM.render(<App />, document.getElementById("root"));
|
||||||
|
|
||||||
|
// If you want your app to work offline and load faster, you can change
|
||||||
|
// unregister() to register() below. Note this comes with some pitfalls.
|
||||||
|
// Learn more about service workers: http://bit.ly/CRA-PWA
|
||||||
|
serviceWorker.unregister();
|
127
packages/brian/example/src/serviceWorker.js
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
// In production, we register a service worker to serve assets from local cache.
|
||||||
|
|
||||||
|
// This lets the app load faster on subsequent visits in production, and gives
|
||||||
|
// it offline capabilities. However, it also means that developers (and users)
|
||||||
|
// will only see deployed updates on the "N+1" visit to a page, since previously
|
||||||
|
// cached resources are updated in the background.
|
||||||
|
|
||||||
|
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
|
||||||
|
// This link also includes instructions on opting out of this behavior.
|
||||||
|
|
||||||
|
const isLocalhost = Boolean(
|
||||||
|
window.location.hostname === "localhost" ||
|
||||||
|
// [::1] is the IPv6 localhost address.
|
||||||
|
window.location.hostname === "[::1]" ||
|
||||||
|
// 127.0.0.1/8 is considered localhost for IPv4.
|
||||||
|
window.location.hostname.match(
|
||||||
|
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
export function register(config) {
|
||||||
|
if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
|
||||||
|
// The URL constructor is available in all browsers that support SW.
|
||||||
|
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
|
||||||
|
if (publicUrl.origin !== window.location.origin) {
|
||||||
|
// Our service worker won't work if PUBLIC_URL is on a different origin
|
||||||
|
// from what our page is served on. This might happen if a CDN is used to
|
||||||
|
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("load", () => {
|
||||||
|
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
||||||
|
|
||||||
|
if (isLocalhost) {
|
||||||
|
// This is running on localhost. Let's check if a service worker still exists or not.
|
||||||
|
checkValidServiceWorker(swUrl, config);
|
||||||
|
|
||||||
|
// Add some additional logging to localhost, pointing developers to the
|
||||||
|
// service worker/PWA documentation.
|
||||||
|
navigator.serviceWorker.ready.then(() => {
|
||||||
|
console.log(
|
||||||
|
"This web app is being served cache-first by a service " +
|
||||||
|
"worker. To learn more, visit https://goo.gl/SC7cgQ"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Is not local host. Just register service worker
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function registerValidSW(swUrl, config) {
|
||||||
|
navigator.serviceWorker
|
||||||
|
.register(swUrl)
|
||||||
|
.then(registration => {
|
||||||
|
registration.onupdatefound = () => {
|
||||||
|
const installingWorker = registration.installing;
|
||||||
|
installingWorker.onstatechange = () => {
|
||||||
|
if (installingWorker.state === "installed") {
|
||||||
|
if (navigator.serviceWorker.controller) {
|
||||||
|
// At this point, the old content will have been purged and
|
||||||
|
// the fresh content will have been added to the cache.
|
||||||
|
// It's the perfect time to display a "New content is
|
||||||
|
// available; please refresh." message in your web app.
|
||||||
|
console.log("New content is available; please refresh.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onUpdate) {
|
||||||
|
config.onUpdate(registration);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// At this point, everything has been precached.
|
||||||
|
// It's the perfect time to display a
|
||||||
|
// "Content is cached for offline use." message.
|
||||||
|
console.log("Content is cached for offline use.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onSuccess) {
|
||||||
|
config.onSuccess(registration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error("Error during service worker registration:", error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkValidServiceWorker(swUrl, config) {
|
||||||
|
// Check if the service worker can be found. If it can't reload the page.
|
||||||
|
fetch(swUrl)
|
||||||
|
.then(response => {
|
||||||
|
// Ensure service worker exists, and that we really are getting a JS file.
|
||||||
|
if (
|
||||||
|
response.status === 404 ||
|
||||||
|
response.headers.get("content-type").indexOf("javascript") === -1
|
||||||
|
) {
|
||||||
|
// No service worker found. Probably a different app. Reload the page.
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister().then(() => {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Service worker found. Proceed as normal.
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
console.log(
|
||||||
|
"No internet connection found. App is running in offline mode."
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function unregister() {
|
||||||
|
if ("serviceWorker" in navigator) {
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
10
packages/bruce/example/.babelrc
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"plugins": [
|
||||||
|
["prismjs", {
|
||||||
|
"languages": ["javascript", "css", "markup"],
|
||||||
|
"plugins": ["line-numbers"],
|
||||||
|
"theme": "twilight",
|
||||||
|
"css": true
|
||||||
|
}]
|
||||||
|
]
|
||||||
|
}
|
96
packages/bruce/example/README.md
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
<p align="center">
|
||||||
|
<a title="Go to freesewing.org" href="https://freesewing.org/"><img src="https://freesewing.org/img/logo/black.svg" align="center" width="150px" alt="Freesewing logo"/></a>
|
||||||
|
<br>
|
||||||
|
<a href="https://freesewing.org/">FreeSewing v2</a>
|
||||||
|
</p>
|
||||||
|
<p align="center">A JavaScript library for made-to-measure sewing patterns</p>
|
||||||
|
<p align='center'><a
|
||||||
|
href="https://twitter.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-blue.svg?logo=twitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://gitter.im/freesewing/freesewing"
|
||||||
|
title="Chat with us on Gitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Chat%20with%20us-CA0547.svg?logo=gitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Chat with us on Gitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://freesewing.org/patrons/join"
|
||||||
|
title="Become a FreeSewing Patron"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Support%20us-blueviolet.svg?logo=cash-app&logoColor=white&logoWidth=15"
|
||||||
|
alt="Become a FreeSewing Patron"/>
|
||||||
|
</a><a
|
||||||
|
href="https://instagram.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-E4405F.svg?logo=instagram&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
# bruce example
|
||||||
|
|
||||||
|
This project was bootstrapped with [Create Freesewing Pattern](https://en.freesewing.dev/create-freesewing-pattern):
|
||||||
|
|
||||||
|
```js
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
This example folder is part of the local development environment.
|
||||||
|
It is **not** part of the pattern's source code.
|
||||||
|
|
||||||
|
To run this example, follow these steps:
|
||||||
|
|
||||||
|
- In the folder above this one, run: `yarn start` (or `npm start`)
|
||||||
|
- Then, in new terminal, run the same command in this folder: `yarn start` (or `npm start`)
|
||||||
|
|
||||||
|
This will spin up the development environment, similar to [our online demo](https://bruce.freesewing.dev/).
|
||||||
|
|
||||||
|
## About FreeSewing 🤔
|
||||||
|
|
||||||
|
Where the world of makers and developers collide, that's where you'll find FreeSewing.
|
||||||
|
|
||||||
|
Our [core library](https://freesewing.dev/en/freesewing) is a *batteries-included* toolbox
|
||||||
|
for parametric design of sewing patterns. It's a modular system (check our list
|
||||||
|
of [plugins](https://freesewing.dev/en/plugins) and getting started is as simple as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
The [getting started] section on [freesewing.dev](https://freesewing.dev/) is a good
|
||||||
|
entrypoint to our documentation, but you'll find a lot more there, including
|
||||||
|
our [API documentation](https://freesewing.dev/en/freesewing/api),
|
||||||
|
as well as [examples](https://freesewing.dev/en/freesewing/examples),
|
||||||
|
and [best practices](https://freesewing.dev/en/do).
|
||||||
|
|
||||||
|
If you're a maker, checkout [freesewing.org](https://freesewing/) where you can generate
|
||||||
|
our sewing patterns adapted to your measurements.
|
||||||
|
|
||||||
|
## Support FreeSewing: Become a patron 🥰
|
||||||
|
|
||||||
|
FreeSewing is an open source project run by a community,
|
||||||
|
and financially supported by our patrons.
|
||||||
|
|
||||||
|
If you feel what we do is worthwhile, you too
|
||||||
|
should [become a patron](https://freesewing.org/patrons/join).
|
||||||
|
|
||||||
|
## Links 👩💻
|
||||||
|
|
||||||
|
- 💻 Makers website: [freesewing.org](https://freesewing.org)
|
||||||
|
- 💻 Developers website: [freesewing.dev](https://freesewing.org)
|
||||||
|
- 💬 Chat: [gitter.im/freesewing](https://gitter.im/freesewing/freesewing)
|
||||||
|
- 🐦 Twitter: [@freesewing_org](https://twitter.com/freesewing_org)
|
||||||
|
- 📷 Instagram: [@freesewing_org](https://instagram.com/freesewing_org)
|
||||||
|
|
||||||
|
## License: MIT 🤓
|
||||||
|
|
||||||
|
© [Joost De Cock](https://github.com/joostdecock).
|
||||||
|
See [the license file](https://github.com/freesewing/freesewing/blob/develop/LICENSE) for details.
|
||||||
|
|
||||||
|
## Where to get help 🤯
|
||||||
|
|
||||||
|
Our [chatroom on Gitter](https://gitter.im) is the best place to ask questions,
|
||||||
|
share your feedback, or just hang out.
|
||||||
|
|
||||||
|
If you want to report a problem, please [create an issue](https://github.com/freesewing/freesewing/issues/new).
|
||||||
|
|
49
packages/bruce/example/package.json
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
"name": "bruce-example",
|
||||||
|
"homepage": "https://freesewing.github.io/bruce",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@freesewing/components": "beta",
|
||||||
|
"@freesewing/core": "beta",
|
||||||
|
"@freesewing/css-theme": "beta",
|
||||||
|
"@freesewing/i18n": "beta",
|
||||||
|
"@freesewing/models": "beta",
|
||||||
|
"@freesewing/mui-theme": "beta",
|
||||||
|
"@freesewing/pattern-info": "beta",
|
||||||
|
"@freesewing/plugin-debug": "beta",
|
||||||
|
"@freesewing/plugin-designer": "beta",
|
||||||
|
"@freesewing/plugin-i18n": "beta",
|
||||||
|
"@freesewing/plugin-svgattr": "beta",
|
||||||
|
"@freesewing/plugin-theme": "beta",
|
||||||
|
"@freesewing/plugin-validate": "beta",
|
||||||
|
"@freesewing/utils": "beta",
|
||||||
|
"@material-ui/core": "^3.9.3",
|
||||||
|
"@material-ui/icons": "^3.0.2",
|
||||||
|
"@material-ui/lab": "^3.0.0-alpha.30",
|
||||||
|
"pattern": "link:..",
|
||||||
|
"prismjs": "1.16.0",
|
||||||
|
"react": "^16.8",
|
||||||
|
"react-dom": "^16.8",
|
||||||
|
"react-scripts": "^3.0.0",
|
||||||
|
"typeface-roboto-condensed": "latest"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"start": "react-scripts start",
|
||||||
|
"build": "react-scripts build",
|
||||||
|
"test": "react-scripts test",
|
||||||
|
"eject": "react-scripts eject"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"extends": "react-app"
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
">0.2%",
|
||||||
|
"not dead",
|
||||||
|
"not ie <= 11",
|
||||||
|
"not op_mini all"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"babel-plugin-prismjs": "1.0.2"
|
||||||
|
}
|
||||||
|
}
|
23
packages/bruce/example/public/App.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
import "./App.css";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
BIN
packages/bruce/example/public/favicon.ico
Normal file
After Width: | Height: | Size: 12 KiB |
40
packages/bruce/example/public/index.html
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<meta name="theme-color" content="#000000">
|
||||||
|
<!--
|
||||||
|
manifest.json provides metadata used when your web app is added to the
|
||||||
|
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
|
||||||
|
-->
|
||||||
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
|
||||||
|
<!--
|
||||||
|
Notice the use of %PUBLIC_URL% in the tags above.
|
||||||
|
It will be replaced with the URL of the `public` folder during the build.
|
||||||
|
Only files inside the `public` folder can be referenced from the HTML.
|
||||||
|
|
||||||
|
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||||
|
work correctly both with client-side routing and a non-root public URL.
|
||||||
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
|
-->
|
||||||
|
<title>bruce</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
You need to enable JavaScript to run this app.
|
||||||
|
</noscript>
|
||||||
|
<div id="root"></div>
|
||||||
|
<!--
|
||||||
|
This HTML file is a template.
|
||||||
|
If you open it directly in the browser, you will see an empty page.
|
||||||
|
|
||||||
|
You can add webfonts, meta tags, or analytics to this file.
|
||||||
|
The build step will place the bundled scripts into the <body> tag.
|
||||||
|
|
||||||
|
To begin the development, run `npm start` or `yarn start`.
|
||||||
|
To create a production bundle, use `npm run build` or `yarn build`.
|
||||||
|
-->
|
||||||
|
</body>
|
||||||
|
</html>
|
15
packages/bruce/example/public/manifest.json
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"short_name": "bruce",
|
||||||
|
"name": "bruce",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "favicon.ico",
|
||||||
|
"sizes": "64x64 32x32 24x24 16x16",
|
||||||
|
"type": "image/x-icon"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"start_url": ".",
|
||||||
|
"display": "standalone",
|
||||||
|
"theme_color": "#000000",
|
||||||
|
"background_color": "#ffffff"
|
||||||
|
}
|
22
packages/bruce/example/src/App.js
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
11
packages/bruce/example/src/index.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import React from "react";
|
||||||
|
import ReactDOM from "react-dom";
|
||||||
|
import App from "./App";
|
||||||
|
import * as serviceWorker from "./serviceWorker";
|
||||||
|
|
||||||
|
ReactDOM.render(<App />, document.getElementById("root"));
|
||||||
|
|
||||||
|
// If you want your app to work offline and load faster, you can change
|
||||||
|
// unregister() to register() below. Note this comes with some pitfalls.
|
||||||
|
// Learn more about service workers: http://bit.ly/CRA-PWA
|
||||||
|
serviceWorker.unregister();
|
127
packages/bruce/example/src/serviceWorker.js
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
// In production, we register a service worker to serve assets from local cache.
|
||||||
|
|
||||||
|
// This lets the app load faster on subsequent visits in production, and gives
|
||||||
|
// it offline capabilities. However, it also means that developers (and users)
|
||||||
|
// will only see deployed updates on the "N+1" visit to a page, since previously
|
||||||
|
// cached resources are updated in the background.
|
||||||
|
|
||||||
|
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
|
||||||
|
// This link also includes instructions on opting out of this behavior.
|
||||||
|
|
||||||
|
const isLocalhost = Boolean(
|
||||||
|
window.location.hostname === "localhost" ||
|
||||||
|
// [::1] is the IPv6 localhost address.
|
||||||
|
window.location.hostname === "[::1]" ||
|
||||||
|
// 127.0.0.1/8 is considered localhost for IPv4.
|
||||||
|
window.location.hostname.match(
|
||||||
|
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
export function register(config) {
|
||||||
|
if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
|
||||||
|
// The URL constructor is available in all browsers that support SW.
|
||||||
|
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
|
||||||
|
if (publicUrl.origin !== window.location.origin) {
|
||||||
|
// Our service worker won't work if PUBLIC_URL is on a different origin
|
||||||
|
// from what our page is served on. This might happen if a CDN is used to
|
||||||
|
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("load", () => {
|
||||||
|
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
||||||
|
|
||||||
|
if (isLocalhost) {
|
||||||
|
// This is running on localhost. Let's check if a service worker still exists or not.
|
||||||
|
checkValidServiceWorker(swUrl, config);
|
||||||
|
|
||||||
|
// Add some additional logging to localhost, pointing developers to the
|
||||||
|
// service worker/PWA documentation.
|
||||||
|
navigator.serviceWorker.ready.then(() => {
|
||||||
|
console.log(
|
||||||
|
"This web app is being served cache-first by a service " +
|
||||||
|
"worker. To learn more, visit https://goo.gl/SC7cgQ"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Is not local host. Just register service worker
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function registerValidSW(swUrl, config) {
|
||||||
|
navigator.serviceWorker
|
||||||
|
.register(swUrl)
|
||||||
|
.then(registration => {
|
||||||
|
registration.onupdatefound = () => {
|
||||||
|
const installingWorker = registration.installing;
|
||||||
|
installingWorker.onstatechange = () => {
|
||||||
|
if (installingWorker.state === "installed") {
|
||||||
|
if (navigator.serviceWorker.controller) {
|
||||||
|
// At this point, the old content will have been purged and
|
||||||
|
// the fresh content will have been added to the cache.
|
||||||
|
// It's the perfect time to display a "New content is
|
||||||
|
// available; please refresh." message in your web app.
|
||||||
|
console.log("New content is available; please refresh.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onUpdate) {
|
||||||
|
config.onUpdate(registration);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// At this point, everything has been precached.
|
||||||
|
// It's the perfect time to display a
|
||||||
|
// "Content is cached for offline use." message.
|
||||||
|
console.log("Content is cached for offline use.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onSuccess) {
|
||||||
|
config.onSuccess(registration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error("Error during service worker registration:", error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkValidServiceWorker(swUrl, config) {
|
||||||
|
// Check if the service worker can be found. If it can't reload the page.
|
||||||
|
fetch(swUrl)
|
||||||
|
.then(response => {
|
||||||
|
// Ensure service worker exists, and that we really are getting a JS file.
|
||||||
|
if (
|
||||||
|
response.status === 404 ||
|
||||||
|
response.headers.get("content-type").indexOf("javascript") === -1
|
||||||
|
) {
|
||||||
|
// No service worker found. Probably a different app. Reload the page.
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister().then(() => {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Service worker found. Proceed as normal.
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
console.log(
|
||||||
|
"No internet connection found. App is running in offline mode."
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function unregister() {
|
||||||
|
if ("serviceWorker" in navigator) {
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
10
packages/carlita/example/.babelrc
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"plugins": [
|
||||||
|
["prismjs", {
|
||||||
|
"languages": ["javascript", "css", "markup"],
|
||||||
|
"plugins": ["line-numbers"],
|
||||||
|
"theme": "twilight",
|
||||||
|
"css": true
|
||||||
|
}]
|
||||||
|
]
|
||||||
|
}
|
96
packages/carlita/example/README.md
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
<p align="center">
|
||||||
|
<a title="Go to freesewing.org" href="https://freesewing.org/"><img src="https://freesewing.org/img/logo/black.svg" align="center" width="150px" alt="Freesewing logo"/></a>
|
||||||
|
<br>
|
||||||
|
<a href="https://freesewing.org/">FreeSewing v2</a>
|
||||||
|
</p>
|
||||||
|
<p align="center">A JavaScript library for made-to-measure sewing patterns</p>
|
||||||
|
<p align='center'><a
|
||||||
|
href="https://twitter.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-blue.svg?logo=twitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://gitter.im/freesewing/freesewing"
|
||||||
|
title="Chat with us on Gitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Chat%20with%20us-CA0547.svg?logo=gitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Chat with us on Gitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://freesewing.org/patrons/join"
|
||||||
|
title="Become a FreeSewing Patron"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Support%20us-blueviolet.svg?logo=cash-app&logoColor=white&logoWidth=15"
|
||||||
|
alt="Become a FreeSewing Patron"/>
|
||||||
|
</a><a
|
||||||
|
href="https://instagram.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-E4405F.svg?logo=instagram&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
# carlita example
|
||||||
|
|
||||||
|
This project was bootstrapped with [Create Freesewing Pattern](https://en.freesewing.dev/create-freesewing-pattern):
|
||||||
|
|
||||||
|
```js
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
This example folder is part of the local development environment.
|
||||||
|
It is **not** part of the pattern's source code.
|
||||||
|
|
||||||
|
To run this example, follow these steps:
|
||||||
|
|
||||||
|
- In the folder above this one, run: `yarn start` (or `npm start`)
|
||||||
|
- Then, in new terminal, run the same command in this folder: `yarn start` (or `npm start`)
|
||||||
|
|
||||||
|
This will spin up the development environment, similar to [our online demo](https://carlita.freesewing.dev/).
|
||||||
|
|
||||||
|
## About FreeSewing 🤔
|
||||||
|
|
||||||
|
Where the world of makers and developers collide, that's where you'll find FreeSewing.
|
||||||
|
|
||||||
|
Our [core library](https://freesewing.dev/en/freesewing) is a *batteries-included* toolbox
|
||||||
|
for parametric design of sewing patterns. It's a modular system (check our list
|
||||||
|
of [plugins](https://freesewing.dev/en/plugins) and getting started is as simple as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
The [getting started] section on [freesewing.dev](https://freesewing.dev/) is a good
|
||||||
|
entrypoint to our documentation, but you'll find a lot more there, including
|
||||||
|
our [API documentation](https://freesewing.dev/en/freesewing/api),
|
||||||
|
as well as [examples](https://freesewing.dev/en/freesewing/examples),
|
||||||
|
and [best practices](https://freesewing.dev/en/do).
|
||||||
|
|
||||||
|
If you're a maker, checkout [freesewing.org](https://freesewing/) where you can generate
|
||||||
|
our sewing patterns adapted to your measurements.
|
||||||
|
|
||||||
|
## Support FreeSewing: Become a patron 🥰
|
||||||
|
|
||||||
|
FreeSewing is an open source project run by a community,
|
||||||
|
and financially supported by our patrons.
|
||||||
|
|
||||||
|
If you feel what we do is worthwhile, you too
|
||||||
|
should [become a patron](https://freesewing.org/patrons/join).
|
||||||
|
|
||||||
|
## Links 👩💻
|
||||||
|
|
||||||
|
- 💻 Makers website: [freesewing.org](https://freesewing.org)
|
||||||
|
- 💻 Developers website: [freesewing.dev](https://freesewing.org)
|
||||||
|
- 💬 Chat: [gitter.im/freesewing](https://gitter.im/freesewing/freesewing)
|
||||||
|
- 🐦 Twitter: [@freesewing_org](https://twitter.com/freesewing_org)
|
||||||
|
- 📷 Instagram: [@freesewing_org](https://instagram.com/freesewing_org)
|
||||||
|
|
||||||
|
## License: MIT 🤓
|
||||||
|
|
||||||
|
© [Joost De Cock](https://github.com/joostdecock).
|
||||||
|
See [the license file](https://github.com/freesewing/freesewing/blob/develop/LICENSE) for details.
|
||||||
|
|
||||||
|
## Where to get help 🤯
|
||||||
|
|
||||||
|
Our [chatroom on Gitter](https://gitter.im) is the best place to ask questions,
|
||||||
|
share your feedback, or just hang out.
|
||||||
|
|
||||||
|
If you want to report a problem, please [create an issue](https://github.com/freesewing/freesewing/issues/new).
|
||||||
|
|
49
packages/carlita/example/package.json
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
"name": "carlita-example",
|
||||||
|
"homepage": "https://freesewing.github.io/carlita",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@freesewing/components": "beta",
|
||||||
|
"@freesewing/core": "beta",
|
||||||
|
"@freesewing/css-theme": "beta",
|
||||||
|
"@freesewing/i18n": "beta",
|
||||||
|
"@freesewing/models": "beta",
|
||||||
|
"@freesewing/mui-theme": "beta",
|
||||||
|
"@freesewing/pattern-info": "beta",
|
||||||
|
"@freesewing/plugin-debug": "beta",
|
||||||
|
"@freesewing/plugin-designer": "beta",
|
||||||
|
"@freesewing/plugin-i18n": "beta",
|
||||||
|
"@freesewing/plugin-svgattr": "beta",
|
||||||
|
"@freesewing/plugin-theme": "beta",
|
||||||
|
"@freesewing/plugin-validate": "beta",
|
||||||
|
"@freesewing/utils": "beta",
|
||||||
|
"@material-ui/core": "^3.9.3",
|
||||||
|
"@material-ui/icons": "^3.0.2",
|
||||||
|
"@material-ui/lab": "^3.0.0-alpha.30",
|
||||||
|
"pattern": "link:..",
|
||||||
|
"prismjs": "1.16.0",
|
||||||
|
"react": "^16.8",
|
||||||
|
"react-dom": "^16.8",
|
||||||
|
"react-scripts": "^3.0.0",
|
||||||
|
"typeface-roboto-condensed": "latest"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"start": "react-scripts start",
|
||||||
|
"build": "react-scripts build",
|
||||||
|
"test": "react-scripts test",
|
||||||
|
"eject": "react-scripts eject"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"extends": "react-app"
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
">0.2%",
|
||||||
|
"not dead",
|
||||||
|
"not ie <= 11",
|
||||||
|
"not op_mini all"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"babel-plugin-prismjs": "1.0.2"
|
||||||
|
}
|
||||||
|
}
|
23
packages/carlita/example/public/App.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
import "./App.css";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
BIN
packages/carlita/example/public/favicon.ico
Normal file
After Width: | Height: | Size: 12 KiB |
40
packages/carlita/example/public/index.html
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<meta name="theme-color" content="#000000">
|
||||||
|
<!--
|
||||||
|
manifest.json provides metadata used when your web app is added to the
|
||||||
|
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
|
||||||
|
-->
|
||||||
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
|
||||||
|
<!--
|
||||||
|
Notice the use of %PUBLIC_URL% in the tags above.
|
||||||
|
It will be replaced with the URL of the `public` folder during the build.
|
||||||
|
Only files inside the `public` folder can be referenced from the HTML.
|
||||||
|
|
||||||
|
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||||
|
work correctly both with client-side routing and a non-root public URL.
|
||||||
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
|
-->
|
||||||
|
<title>carlita</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
You need to enable JavaScript to run this app.
|
||||||
|
</noscript>
|
||||||
|
<div id="root"></div>
|
||||||
|
<!--
|
||||||
|
This HTML file is a template.
|
||||||
|
If you open it directly in the browser, you will see an empty page.
|
||||||
|
|
||||||
|
You can add webfonts, meta tags, or analytics to this file.
|
||||||
|
The build step will place the bundled scripts into the <body> tag.
|
||||||
|
|
||||||
|
To begin the development, run `npm start` or `yarn start`.
|
||||||
|
To create a production bundle, use `npm run build` or `yarn build`.
|
||||||
|
-->
|
||||||
|
</body>
|
||||||
|
</html>
|
15
packages/carlita/example/public/manifest.json
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"short_name": "carlita",
|
||||||
|
"name": "carlita",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "favicon.ico",
|
||||||
|
"sizes": "64x64 32x32 24x24 16x16",
|
||||||
|
"type": "image/x-icon"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"start_url": ".",
|
||||||
|
"display": "standalone",
|
||||||
|
"theme_color": "#000000",
|
||||||
|
"background_color": "#ffffff"
|
||||||
|
}
|
22
packages/carlita/example/src/App.js
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
11
packages/carlita/example/src/index.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import React from "react";
|
||||||
|
import ReactDOM from "react-dom";
|
||||||
|
import App from "./App";
|
||||||
|
import * as serviceWorker from "./serviceWorker";
|
||||||
|
|
||||||
|
ReactDOM.render(<App />, document.getElementById("root"));
|
||||||
|
|
||||||
|
// If you want your app to work offline and load faster, you can change
|
||||||
|
// unregister() to register() below. Note this comes with some pitfalls.
|
||||||
|
// Learn more about service workers: http://bit.ly/CRA-PWA
|
||||||
|
serviceWorker.unregister();
|
127
packages/carlita/example/src/serviceWorker.js
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
// In production, we register a service worker to serve assets from local cache.
|
||||||
|
|
||||||
|
// This lets the app load faster on subsequent visits in production, and gives
|
||||||
|
// it offline capabilities. However, it also means that developers (and users)
|
||||||
|
// will only see deployed updates on the "N+1" visit to a page, since previously
|
||||||
|
// cached resources are updated in the background.
|
||||||
|
|
||||||
|
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
|
||||||
|
// This link also includes instructions on opting out of this behavior.
|
||||||
|
|
||||||
|
const isLocalhost = Boolean(
|
||||||
|
window.location.hostname === "localhost" ||
|
||||||
|
// [::1] is the IPv6 localhost address.
|
||||||
|
window.location.hostname === "[::1]" ||
|
||||||
|
// 127.0.0.1/8 is considered localhost for IPv4.
|
||||||
|
window.location.hostname.match(
|
||||||
|
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
export function register(config) {
|
||||||
|
if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
|
||||||
|
// The URL constructor is available in all browsers that support SW.
|
||||||
|
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
|
||||||
|
if (publicUrl.origin !== window.location.origin) {
|
||||||
|
// Our service worker won't work if PUBLIC_URL is on a different origin
|
||||||
|
// from what our page is served on. This might happen if a CDN is used to
|
||||||
|
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("load", () => {
|
||||||
|
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
||||||
|
|
||||||
|
if (isLocalhost) {
|
||||||
|
// This is running on localhost. Let's check if a service worker still exists or not.
|
||||||
|
checkValidServiceWorker(swUrl, config);
|
||||||
|
|
||||||
|
// Add some additional logging to localhost, pointing developers to the
|
||||||
|
// service worker/PWA documentation.
|
||||||
|
navigator.serviceWorker.ready.then(() => {
|
||||||
|
console.log(
|
||||||
|
"This web app is being served cache-first by a service " +
|
||||||
|
"worker. To learn more, visit https://goo.gl/SC7cgQ"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Is not local host. Just register service worker
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function registerValidSW(swUrl, config) {
|
||||||
|
navigator.serviceWorker
|
||||||
|
.register(swUrl)
|
||||||
|
.then(registration => {
|
||||||
|
registration.onupdatefound = () => {
|
||||||
|
const installingWorker = registration.installing;
|
||||||
|
installingWorker.onstatechange = () => {
|
||||||
|
if (installingWorker.state === "installed") {
|
||||||
|
if (navigator.serviceWorker.controller) {
|
||||||
|
// At this point, the old content will have been purged and
|
||||||
|
// the fresh content will have been added to the cache.
|
||||||
|
// It's the perfect time to display a "New content is
|
||||||
|
// available; please refresh." message in your web app.
|
||||||
|
console.log("New content is available; please refresh.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onUpdate) {
|
||||||
|
config.onUpdate(registration);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// At this point, everything has been precached.
|
||||||
|
// It's the perfect time to display a
|
||||||
|
// "Content is cached for offline use." message.
|
||||||
|
console.log("Content is cached for offline use.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onSuccess) {
|
||||||
|
config.onSuccess(registration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error("Error during service worker registration:", error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkValidServiceWorker(swUrl, config) {
|
||||||
|
// Check if the service worker can be found. If it can't reload the page.
|
||||||
|
fetch(swUrl)
|
||||||
|
.then(response => {
|
||||||
|
// Ensure service worker exists, and that we really are getting a JS file.
|
||||||
|
if (
|
||||||
|
response.status === 404 ||
|
||||||
|
response.headers.get("content-type").indexOf("javascript") === -1
|
||||||
|
) {
|
||||||
|
// No service worker found. Probably a different app. Reload the page.
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister().then(() => {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Service worker found. Proceed as normal.
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
console.log(
|
||||||
|
"No internet connection found. App is running in offline mode."
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function unregister() {
|
||||||
|
if ("serviceWorker" in navigator) {
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
10
packages/carlton/example/.babelrc
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"plugins": [
|
||||||
|
["prismjs", {
|
||||||
|
"languages": ["javascript", "css", "markup"],
|
||||||
|
"plugins": ["line-numbers"],
|
||||||
|
"theme": "twilight",
|
||||||
|
"css": true
|
||||||
|
}]
|
||||||
|
]
|
||||||
|
}
|
96
packages/carlton/example/README.md
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
<p align="center">
|
||||||
|
<a title="Go to freesewing.org" href="https://freesewing.org/"><img src="https://freesewing.org/img/logo/black.svg" align="center" width="150px" alt="Freesewing logo"/></a>
|
||||||
|
<br>
|
||||||
|
<a href="https://freesewing.org/">FreeSewing v2</a>
|
||||||
|
</p>
|
||||||
|
<p align="center">A JavaScript library for made-to-measure sewing patterns</p>
|
||||||
|
<p align='center'><a
|
||||||
|
href="https://twitter.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-blue.svg?logo=twitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://gitter.im/freesewing/freesewing"
|
||||||
|
title="Chat with us on Gitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Chat%20with%20us-CA0547.svg?logo=gitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Chat with us on Gitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://freesewing.org/patrons/join"
|
||||||
|
title="Become a FreeSewing Patron"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Support%20us-blueviolet.svg?logo=cash-app&logoColor=white&logoWidth=15"
|
||||||
|
alt="Become a FreeSewing Patron"/>
|
||||||
|
</a><a
|
||||||
|
href="https://instagram.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-E4405F.svg?logo=instagram&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
# carlton example
|
||||||
|
|
||||||
|
This project was bootstrapped with [Create Freesewing Pattern](https://en.freesewing.dev/create-freesewing-pattern):
|
||||||
|
|
||||||
|
```js
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
This example folder is part of the local development environment.
|
||||||
|
It is **not** part of the pattern's source code.
|
||||||
|
|
||||||
|
To run this example, follow these steps:
|
||||||
|
|
||||||
|
- In the folder above this one, run: `yarn start` (or `npm start`)
|
||||||
|
- Then, in new terminal, run the same command in this folder: `yarn start` (or `npm start`)
|
||||||
|
|
||||||
|
This will spin up the development environment, similar to [our online demo](https://carlton.freesewing.dev/).
|
||||||
|
|
||||||
|
## About FreeSewing 🤔
|
||||||
|
|
||||||
|
Where the world of makers and developers collide, that's where you'll find FreeSewing.
|
||||||
|
|
||||||
|
Our [core library](https://freesewing.dev/en/freesewing) is a *batteries-included* toolbox
|
||||||
|
for parametric design of sewing patterns. It's a modular system (check our list
|
||||||
|
of [plugins](https://freesewing.dev/en/plugins) and getting started is as simple as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
The [getting started] section on [freesewing.dev](https://freesewing.dev/) is a good
|
||||||
|
entrypoint to our documentation, but you'll find a lot more there, including
|
||||||
|
our [API documentation](https://freesewing.dev/en/freesewing/api),
|
||||||
|
as well as [examples](https://freesewing.dev/en/freesewing/examples),
|
||||||
|
and [best practices](https://freesewing.dev/en/do).
|
||||||
|
|
||||||
|
If you're a maker, checkout [freesewing.org](https://freesewing/) where you can generate
|
||||||
|
our sewing patterns adapted to your measurements.
|
||||||
|
|
||||||
|
## Support FreeSewing: Become a patron 🥰
|
||||||
|
|
||||||
|
FreeSewing is an open source project run by a community,
|
||||||
|
and financially supported by our patrons.
|
||||||
|
|
||||||
|
If you feel what we do is worthwhile, you too
|
||||||
|
should [become a patron](https://freesewing.org/patrons/join).
|
||||||
|
|
||||||
|
## Links 👩💻
|
||||||
|
|
||||||
|
- 💻 Makers website: [freesewing.org](https://freesewing.org)
|
||||||
|
- 💻 Developers website: [freesewing.dev](https://freesewing.org)
|
||||||
|
- 💬 Chat: [gitter.im/freesewing](https://gitter.im/freesewing/freesewing)
|
||||||
|
- 🐦 Twitter: [@freesewing_org](https://twitter.com/freesewing_org)
|
||||||
|
- 📷 Instagram: [@freesewing_org](https://instagram.com/freesewing_org)
|
||||||
|
|
||||||
|
## License: MIT 🤓
|
||||||
|
|
||||||
|
© [Joost De Cock](https://github.com/joostdecock).
|
||||||
|
See [the license file](https://github.com/freesewing/freesewing/blob/develop/LICENSE) for details.
|
||||||
|
|
||||||
|
## Where to get help 🤯
|
||||||
|
|
||||||
|
Our [chatroom on Gitter](https://gitter.im) is the best place to ask questions,
|
||||||
|
share your feedback, or just hang out.
|
||||||
|
|
||||||
|
If you want to report a problem, please [create an issue](https://github.com/freesewing/freesewing/issues/new).
|
||||||
|
|
49
packages/carlton/example/package.json
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
"name": "carlton-example",
|
||||||
|
"homepage": "https://freesewing.github.io/carlton",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@freesewing/components": "beta",
|
||||||
|
"@freesewing/core": "beta",
|
||||||
|
"@freesewing/css-theme": "beta",
|
||||||
|
"@freesewing/i18n": "beta",
|
||||||
|
"@freesewing/models": "beta",
|
||||||
|
"@freesewing/mui-theme": "beta",
|
||||||
|
"@freesewing/pattern-info": "beta",
|
||||||
|
"@freesewing/plugin-debug": "beta",
|
||||||
|
"@freesewing/plugin-designer": "beta",
|
||||||
|
"@freesewing/plugin-i18n": "beta",
|
||||||
|
"@freesewing/plugin-svgattr": "beta",
|
||||||
|
"@freesewing/plugin-theme": "beta",
|
||||||
|
"@freesewing/plugin-validate": "beta",
|
||||||
|
"@freesewing/utils": "beta",
|
||||||
|
"@material-ui/core": "^3.9.3",
|
||||||
|
"@material-ui/icons": "^3.0.2",
|
||||||
|
"@material-ui/lab": "^3.0.0-alpha.30",
|
||||||
|
"pattern": "link:..",
|
||||||
|
"prismjs": "1.16.0",
|
||||||
|
"react": "^16.8",
|
||||||
|
"react-dom": "^16.8",
|
||||||
|
"react-scripts": "^3.0.0",
|
||||||
|
"typeface-roboto-condensed": "latest"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"start": "react-scripts start",
|
||||||
|
"build": "react-scripts build",
|
||||||
|
"test": "react-scripts test",
|
||||||
|
"eject": "react-scripts eject"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"extends": "react-app"
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
">0.2%",
|
||||||
|
"not dead",
|
||||||
|
"not ie <= 11",
|
||||||
|
"not op_mini all"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"babel-plugin-prismjs": "1.0.2"
|
||||||
|
}
|
||||||
|
}
|
23
packages/carlton/example/public/App.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
import "./App.css";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
BIN
packages/carlton/example/public/favicon.ico
Normal file
After Width: | Height: | Size: 12 KiB |
40
packages/carlton/example/public/index.html
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<meta name="theme-color" content="#000000">
|
||||||
|
<!--
|
||||||
|
manifest.json provides metadata used when your web app is added to the
|
||||||
|
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
|
||||||
|
-->
|
||||||
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
|
||||||
|
<!--
|
||||||
|
Notice the use of %PUBLIC_URL% in the tags above.
|
||||||
|
It will be replaced with the URL of the `public` folder during the build.
|
||||||
|
Only files inside the `public` folder can be referenced from the HTML.
|
||||||
|
|
||||||
|
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||||
|
work correctly both with client-side routing and a non-root public URL.
|
||||||
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
|
-->
|
||||||
|
<title>carlton</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
You need to enable JavaScript to run this app.
|
||||||
|
</noscript>
|
||||||
|
<div id="root"></div>
|
||||||
|
<!--
|
||||||
|
This HTML file is a template.
|
||||||
|
If you open it directly in the browser, you will see an empty page.
|
||||||
|
|
||||||
|
You can add webfonts, meta tags, or analytics to this file.
|
||||||
|
The build step will place the bundled scripts into the <body> tag.
|
||||||
|
|
||||||
|
To begin the development, run `npm start` or `yarn start`.
|
||||||
|
To create a production bundle, use `npm run build` or `yarn build`.
|
||||||
|
-->
|
||||||
|
</body>
|
||||||
|
</html>
|
15
packages/carlton/example/public/manifest.json
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"short_name": "carlton",
|
||||||
|
"name": "carlton",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "favicon.ico",
|
||||||
|
"sizes": "64x64 32x32 24x24 16x16",
|
||||||
|
"type": "image/x-icon"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"start_url": ".",
|
||||||
|
"display": "standalone",
|
||||||
|
"theme_color": "#000000",
|
||||||
|
"background_color": "#ffffff"
|
||||||
|
}
|
22
packages/carlton/example/src/App.js
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
11
packages/carlton/example/src/index.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import React from "react";
|
||||||
|
import ReactDOM from "react-dom";
|
||||||
|
import App from "./App";
|
||||||
|
import * as serviceWorker from "./serviceWorker";
|
||||||
|
|
||||||
|
ReactDOM.render(<App />, document.getElementById("root"));
|
||||||
|
|
||||||
|
// If you want your app to work offline and load faster, you can change
|
||||||
|
// unregister() to register() below. Note this comes with some pitfalls.
|
||||||
|
// Learn more about service workers: http://bit.ly/CRA-PWA
|
||||||
|
serviceWorker.unregister();
|
127
packages/carlton/example/src/serviceWorker.js
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
// In production, we register a service worker to serve assets from local cache.
|
||||||
|
|
||||||
|
// This lets the app load faster on subsequent visits in production, and gives
|
||||||
|
// it offline capabilities. However, it also means that developers (and users)
|
||||||
|
// will only see deployed updates on the "N+1" visit to a page, since previously
|
||||||
|
// cached resources are updated in the background.
|
||||||
|
|
||||||
|
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
|
||||||
|
// This link also includes instructions on opting out of this behavior.
|
||||||
|
|
||||||
|
const isLocalhost = Boolean(
|
||||||
|
window.location.hostname === "localhost" ||
|
||||||
|
// [::1] is the IPv6 localhost address.
|
||||||
|
window.location.hostname === "[::1]" ||
|
||||||
|
// 127.0.0.1/8 is considered localhost for IPv4.
|
||||||
|
window.location.hostname.match(
|
||||||
|
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
export function register(config) {
|
||||||
|
if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
|
||||||
|
// The URL constructor is available in all browsers that support SW.
|
||||||
|
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
|
||||||
|
if (publicUrl.origin !== window.location.origin) {
|
||||||
|
// Our service worker won't work if PUBLIC_URL is on a different origin
|
||||||
|
// from what our page is served on. This might happen if a CDN is used to
|
||||||
|
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("load", () => {
|
||||||
|
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
||||||
|
|
||||||
|
if (isLocalhost) {
|
||||||
|
// This is running on localhost. Let's check if a service worker still exists or not.
|
||||||
|
checkValidServiceWorker(swUrl, config);
|
||||||
|
|
||||||
|
// Add some additional logging to localhost, pointing developers to the
|
||||||
|
// service worker/PWA documentation.
|
||||||
|
navigator.serviceWorker.ready.then(() => {
|
||||||
|
console.log(
|
||||||
|
"This web app is being served cache-first by a service " +
|
||||||
|
"worker. To learn more, visit https://goo.gl/SC7cgQ"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Is not local host. Just register service worker
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function registerValidSW(swUrl, config) {
|
||||||
|
navigator.serviceWorker
|
||||||
|
.register(swUrl)
|
||||||
|
.then(registration => {
|
||||||
|
registration.onupdatefound = () => {
|
||||||
|
const installingWorker = registration.installing;
|
||||||
|
installingWorker.onstatechange = () => {
|
||||||
|
if (installingWorker.state === "installed") {
|
||||||
|
if (navigator.serviceWorker.controller) {
|
||||||
|
// At this point, the old content will have been purged and
|
||||||
|
// the fresh content will have been added to the cache.
|
||||||
|
// It's the perfect time to display a "New content is
|
||||||
|
// available; please refresh." message in your web app.
|
||||||
|
console.log("New content is available; please refresh.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onUpdate) {
|
||||||
|
config.onUpdate(registration);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// At this point, everything has been precached.
|
||||||
|
// It's the perfect time to display a
|
||||||
|
// "Content is cached for offline use." message.
|
||||||
|
console.log("Content is cached for offline use.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onSuccess) {
|
||||||
|
config.onSuccess(registration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error("Error during service worker registration:", error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkValidServiceWorker(swUrl, config) {
|
||||||
|
// Check if the service worker can be found. If it can't reload the page.
|
||||||
|
fetch(swUrl)
|
||||||
|
.then(response => {
|
||||||
|
// Ensure service worker exists, and that we really are getting a JS file.
|
||||||
|
if (
|
||||||
|
response.status === 404 ||
|
||||||
|
response.headers.get("content-type").indexOf("javascript") === -1
|
||||||
|
) {
|
||||||
|
// No service worker found. Probably a different app. Reload the page.
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister().then(() => {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Service worker found. Proceed as normal.
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
console.log(
|
||||||
|
"No internet connection found. App is running in offline mode."
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function unregister() {
|
||||||
|
if ("serviceWorker" in navigator) {
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
10
packages/cathrin/example/.babelrc
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"plugins": [
|
||||||
|
["prismjs", {
|
||||||
|
"languages": ["javascript", "css", "markup"],
|
||||||
|
"plugins": ["line-numbers"],
|
||||||
|
"theme": "twilight",
|
||||||
|
"css": true
|
||||||
|
}]
|
||||||
|
]
|
||||||
|
}
|
96
packages/cathrin/example/README.md
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
<p align="center">
|
||||||
|
<a title="Go to freesewing.org" href="https://freesewing.org/"><img src="https://freesewing.org/img/logo/black.svg" align="center" width="150px" alt="Freesewing logo"/></a>
|
||||||
|
<br>
|
||||||
|
<a href="https://freesewing.org/">FreeSewing v2</a>
|
||||||
|
</p>
|
||||||
|
<p align="center">A JavaScript library for made-to-measure sewing patterns</p>
|
||||||
|
<p align='center'><a
|
||||||
|
href="https://twitter.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-blue.svg?logo=twitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://gitter.im/freesewing/freesewing"
|
||||||
|
title="Chat with us on Gitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Chat%20with%20us-CA0547.svg?logo=gitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Chat with us on Gitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://freesewing.org/patrons/join"
|
||||||
|
title="Become a FreeSewing Patron"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Support%20us-blueviolet.svg?logo=cash-app&logoColor=white&logoWidth=15"
|
||||||
|
alt="Become a FreeSewing Patron"/>
|
||||||
|
</a><a
|
||||||
|
href="https://instagram.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-E4405F.svg?logo=instagram&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
# cathrin example
|
||||||
|
|
||||||
|
This project was bootstrapped with [Create Freesewing Pattern](https://en.freesewing.dev/create-freesewing-pattern):
|
||||||
|
|
||||||
|
```js
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
This example folder is part of the local development environment.
|
||||||
|
It is **not** part of the pattern's source code.
|
||||||
|
|
||||||
|
To run this example, follow these steps:
|
||||||
|
|
||||||
|
- In the folder above this one, run: `yarn start` (or `npm start`)
|
||||||
|
- Then, in new terminal, run the same command in this folder: `yarn start` (or `npm start`)
|
||||||
|
|
||||||
|
This will spin up the development environment, similar to [our online demo](https://cathrin.freesewing.dev/).
|
||||||
|
|
||||||
|
## About FreeSewing 🤔
|
||||||
|
|
||||||
|
Where the world of makers and developers collide, that's where you'll find FreeSewing.
|
||||||
|
|
||||||
|
Our [core library](https://freesewing.dev/en/freesewing) is a *batteries-included* toolbox
|
||||||
|
for parametric design of sewing patterns. It's a modular system (check our list
|
||||||
|
of [plugins](https://freesewing.dev/en/plugins) and getting started is as simple as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
The [getting started] section on [freesewing.dev](https://freesewing.dev/) is a good
|
||||||
|
entrypoint to our documentation, but you'll find a lot more there, including
|
||||||
|
our [API documentation](https://freesewing.dev/en/freesewing/api),
|
||||||
|
as well as [examples](https://freesewing.dev/en/freesewing/examples),
|
||||||
|
and [best practices](https://freesewing.dev/en/do).
|
||||||
|
|
||||||
|
If you're a maker, checkout [freesewing.org](https://freesewing/) where you can generate
|
||||||
|
our sewing patterns adapted to your measurements.
|
||||||
|
|
||||||
|
## Support FreeSewing: Become a patron 🥰
|
||||||
|
|
||||||
|
FreeSewing is an open source project run by a community,
|
||||||
|
and financially supported by our patrons.
|
||||||
|
|
||||||
|
If you feel what we do is worthwhile, you too
|
||||||
|
should [become a patron](https://freesewing.org/patrons/join).
|
||||||
|
|
||||||
|
## Links 👩💻
|
||||||
|
|
||||||
|
- 💻 Makers website: [freesewing.org](https://freesewing.org)
|
||||||
|
- 💻 Developers website: [freesewing.dev](https://freesewing.org)
|
||||||
|
- 💬 Chat: [gitter.im/freesewing](https://gitter.im/freesewing/freesewing)
|
||||||
|
- 🐦 Twitter: [@freesewing_org](https://twitter.com/freesewing_org)
|
||||||
|
- 📷 Instagram: [@freesewing_org](https://instagram.com/freesewing_org)
|
||||||
|
|
||||||
|
## License: MIT 🤓
|
||||||
|
|
||||||
|
© [Joost De Cock](https://github.com/joostdecock).
|
||||||
|
See [the license file](https://github.com/freesewing/freesewing/blob/develop/LICENSE) for details.
|
||||||
|
|
||||||
|
## Where to get help 🤯
|
||||||
|
|
||||||
|
Our [chatroom on Gitter](https://gitter.im) is the best place to ask questions,
|
||||||
|
share your feedback, or just hang out.
|
||||||
|
|
||||||
|
If you want to report a problem, please [create an issue](https://github.com/freesewing/freesewing/issues/new).
|
||||||
|
|
49
packages/cathrin/example/package.json
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
"name": "cathrin-example",
|
||||||
|
"homepage": "https://freesewing.github.io/cathrin",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@freesewing/components": "beta",
|
||||||
|
"@freesewing/core": "beta",
|
||||||
|
"@freesewing/css-theme": "beta",
|
||||||
|
"@freesewing/i18n": "beta",
|
||||||
|
"@freesewing/models": "beta",
|
||||||
|
"@freesewing/mui-theme": "beta",
|
||||||
|
"@freesewing/pattern-info": "beta",
|
||||||
|
"@freesewing/plugin-debug": "beta",
|
||||||
|
"@freesewing/plugin-designer": "beta",
|
||||||
|
"@freesewing/plugin-i18n": "beta",
|
||||||
|
"@freesewing/plugin-svgattr": "beta",
|
||||||
|
"@freesewing/plugin-theme": "beta",
|
||||||
|
"@freesewing/plugin-validate": "beta",
|
||||||
|
"@freesewing/utils": "beta",
|
||||||
|
"@material-ui/core": "^3.9.3",
|
||||||
|
"@material-ui/icons": "^3.0.2",
|
||||||
|
"@material-ui/lab": "^3.0.0-alpha.30",
|
||||||
|
"pattern": "link:..",
|
||||||
|
"prismjs": "1.16.0",
|
||||||
|
"react": "^16.8",
|
||||||
|
"react-dom": "^16.8",
|
||||||
|
"react-scripts": "^3.0.0",
|
||||||
|
"typeface-roboto-condensed": "latest"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"start": "react-scripts start",
|
||||||
|
"build": "react-scripts build",
|
||||||
|
"test": "react-scripts test",
|
||||||
|
"eject": "react-scripts eject"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"extends": "react-app"
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
">0.2%",
|
||||||
|
"not dead",
|
||||||
|
"not ie <= 11",
|
||||||
|
"not op_mini all"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"babel-plugin-prismjs": "1.0.2"
|
||||||
|
}
|
||||||
|
}
|
23
packages/cathrin/example/public/App.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
import "./App.css";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
BIN
packages/cathrin/example/public/favicon.ico
Normal file
After Width: | Height: | Size: 12 KiB |
40
packages/cathrin/example/public/index.html
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<meta name="theme-color" content="#000000">
|
||||||
|
<!--
|
||||||
|
manifest.json provides metadata used when your web app is added to the
|
||||||
|
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
|
||||||
|
-->
|
||||||
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
|
||||||
|
<!--
|
||||||
|
Notice the use of %PUBLIC_URL% in the tags above.
|
||||||
|
It will be replaced with the URL of the `public` folder during the build.
|
||||||
|
Only files inside the `public` folder can be referenced from the HTML.
|
||||||
|
|
||||||
|
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||||
|
work correctly both with client-side routing and a non-root public URL.
|
||||||
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
|
-->
|
||||||
|
<title>cathrin</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
You need to enable JavaScript to run this app.
|
||||||
|
</noscript>
|
||||||
|
<div id="root"></div>
|
||||||
|
<!--
|
||||||
|
This HTML file is a template.
|
||||||
|
If you open it directly in the browser, you will see an empty page.
|
||||||
|
|
||||||
|
You can add webfonts, meta tags, or analytics to this file.
|
||||||
|
The build step will place the bundled scripts into the <body> tag.
|
||||||
|
|
||||||
|
To begin the development, run `npm start` or `yarn start`.
|
||||||
|
To create a production bundle, use `npm run build` or `yarn build`.
|
||||||
|
-->
|
||||||
|
</body>
|
||||||
|
</html>
|
15
packages/cathrin/example/public/manifest.json
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"short_name": "cathrin",
|
||||||
|
"name": "cathrin",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "favicon.ico",
|
||||||
|
"sizes": "64x64 32x32 24x24 16x16",
|
||||||
|
"type": "image/x-icon"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"start_url": ".",
|
||||||
|
"display": "standalone",
|
||||||
|
"theme_color": "#000000",
|
||||||
|
"background_color": "#ffffff"
|
||||||
|
}
|
22
packages/cathrin/example/src/App.js
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
11
packages/cathrin/example/src/index.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import React from "react";
|
||||||
|
import ReactDOM from "react-dom";
|
||||||
|
import App from "./App";
|
||||||
|
import * as serviceWorker from "./serviceWorker";
|
||||||
|
|
||||||
|
ReactDOM.render(<App />, document.getElementById("root"));
|
||||||
|
|
||||||
|
// If you want your app to work offline and load faster, you can change
|
||||||
|
// unregister() to register() below. Note this comes with some pitfalls.
|
||||||
|
// Learn more about service workers: http://bit.ly/CRA-PWA
|
||||||
|
serviceWorker.unregister();
|
127
packages/cathrin/example/src/serviceWorker.js
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
// In production, we register a service worker to serve assets from local cache.
|
||||||
|
|
||||||
|
// This lets the app load faster on subsequent visits in production, and gives
|
||||||
|
// it offline capabilities. However, it also means that developers (and users)
|
||||||
|
// will only see deployed updates on the "N+1" visit to a page, since previously
|
||||||
|
// cached resources are updated in the background.
|
||||||
|
|
||||||
|
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
|
||||||
|
// This link also includes instructions on opting out of this behavior.
|
||||||
|
|
||||||
|
const isLocalhost = Boolean(
|
||||||
|
window.location.hostname === "localhost" ||
|
||||||
|
// [::1] is the IPv6 localhost address.
|
||||||
|
window.location.hostname === "[::1]" ||
|
||||||
|
// 127.0.0.1/8 is considered localhost for IPv4.
|
||||||
|
window.location.hostname.match(
|
||||||
|
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
export function register(config) {
|
||||||
|
if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
|
||||||
|
// The URL constructor is available in all browsers that support SW.
|
||||||
|
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
|
||||||
|
if (publicUrl.origin !== window.location.origin) {
|
||||||
|
// Our service worker won't work if PUBLIC_URL is on a different origin
|
||||||
|
// from what our page is served on. This might happen if a CDN is used to
|
||||||
|
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("load", () => {
|
||||||
|
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
||||||
|
|
||||||
|
if (isLocalhost) {
|
||||||
|
// This is running on localhost. Let's check if a service worker still exists or not.
|
||||||
|
checkValidServiceWorker(swUrl, config);
|
||||||
|
|
||||||
|
// Add some additional logging to localhost, pointing developers to the
|
||||||
|
// service worker/PWA documentation.
|
||||||
|
navigator.serviceWorker.ready.then(() => {
|
||||||
|
console.log(
|
||||||
|
"This web app is being served cache-first by a service " +
|
||||||
|
"worker. To learn more, visit https://goo.gl/SC7cgQ"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Is not local host. Just register service worker
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function registerValidSW(swUrl, config) {
|
||||||
|
navigator.serviceWorker
|
||||||
|
.register(swUrl)
|
||||||
|
.then(registration => {
|
||||||
|
registration.onupdatefound = () => {
|
||||||
|
const installingWorker = registration.installing;
|
||||||
|
installingWorker.onstatechange = () => {
|
||||||
|
if (installingWorker.state === "installed") {
|
||||||
|
if (navigator.serviceWorker.controller) {
|
||||||
|
// At this point, the old content will have been purged and
|
||||||
|
// the fresh content will have been added to the cache.
|
||||||
|
// It's the perfect time to display a "New content is
|
||||||
|
// available; please refresh." message in your web app.
|
||||||
|
console.log("New content is available; please refresh.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onUpdate) {
|
||||||
|
config.onUpdate(registration);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// At this point, everything has been precached.
|
||||||
|
// It's the perfect time to display a
|
||||||
|
// "Content is cached for offline use." message.
|
||||||
|
console.log("Content is cached for offline use.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onSuccess) {
|
||||||
|
config.onSuccess(registration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error("Error during service worker registration:", error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkValidServiceWorker(swUrl, config) {
|
||||||
|
// Check if the service worker can be found. If it can't reload the page.
|
||||||
|
fetch(swUrl)
|
||||||
|
.then(response => {
|
||||||
|
// Ensure service worker exists, and that we really are getting a JS file.
|
||||||
|
if (
|
||||||
|
response.status === 404 ||
|
||||||
|
response.headers.get("content-type").indexOf("javascript") === -1
|
||||||
|
) {
|
||||||
|
// No service worker found. Probably a different app. Reload the page.
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister().then(() => {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Service worker found. Proceed as normal.
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
console.log(
|
||||||
|
"No internet connection found. App is running in offline mode."
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function unregister() {
|
||||||
|
if ("serviceWorker" in navigator) {
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,7 +15,7 @@
|
||||||
],
|
],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rimraf dist",
|
"clean": "rimraf Blockquote && rimraf Draft && rimraf DraftConfigurator && rimraf Emblem && rimraf Example && rimraf Footer && rimraf Icon && rimraf Logo && rimraf Navbar && rimraf Ogol && rimraf Robot && rimraf SampleConfigurator && rimraf withGist && rimraf withLanguage && rimraf Workbench",
|
||||||
"build": "npm run clean && rollup -c",
|
"build": "npm run clean && rollup -c",
|
||||||
"test": "echo \"components: No tests configured. Perhaps you'd like to do this?\" && exit 0",
|
"test": "echo \"components: No tests configured. Perhaps you'd like to do this?\" && exit 0",
|
||||||
"pubtest": "npm publish --registry http://localhost:6662",
|
"pubtest": "npm publish --registry http://localhost:6662",
|
||||||
|
@ -45,7 +45,21 @@
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"files": [
|
"files": [
|
||||||
"dist/*",
|
"Blockquote/*",
|
||||||
|
"Draft/*",
|
||||||
|
"DraftConfigurator/*",
|
||||||
|
"Emblem/*",
|
||||||
|
"Example/*",
|
||||||
|
"Footer/*",
|
||||||
|
"Icon/*",
|
||||||
|
"Logo/*",
|
||||||
|
"Navbar/*",
|
||||||
|
"Ogol/*",
|
||||||
|
"Robot/*",
|
||||||
|
"SampleConfigurator/*",
|
||||||
|
"withGist/*",
|
||||||
|
"withLanguage/*",
|
||||||
|
"Workbench/*",
|
||||||
"README.md",
|
"README.md",
|
||||||
"package.json"
|
"package.json"
|
||||||
],
|
],
|
||||||
|
|
|
@ -7,11 +7,10 @@ import { name, version, description, author, license } from "./package.json";
|
||||||
import components from "./src/index.js";
|
import components from "./src/index.js";
|
||||||
|
|
||||||
const createConfig = (component, module) => {
|
const createConfig = (component, module) => {
|
||||||
console.log(component);
|
|
||||||
return {
|
return {
|
||||||
input: `./src/${component}/index.js`,
|
input: `./src/${component === "index" ? "" : component + "/"}index.js`,
|
||||||
output: {
|
output: {
|
||||||
file: `dist/${component}/index` + (module ? ".mjs" : ".js"),
|
file: `./${component}/index` + (module ? ".mjs" : ".js"),
|
||||||
format: module ? "es" : "cjs",
|
format: module ? "es" : "cjs",
|
||||||
sourcemap: true
|
sourcemap: true
|
||||||
},
|
},
|
||||||
|
@ -37,5 +36,5 @@ for (let component of components) {
|
||||||
config.push(createConfig(component, false));
|
config.push(createConfig(component, false));
|
||||||
config.push(createConfig(component, true));
|
config.push(createConfig(component, true));
|
||||||
}
|
}
|
||||||
console.log(JSON.stringify(config, null, 2));
|
|
||||||
export default config;
|
export default config;
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# We'll have to come up with a cross-platform way to handle this
|
|
||||||
# (as in, make sure it works on windows), but until that time
|
|
||||||
# this shell script will do.
|
|
||||||
|
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
||||||
CUR=`pwd`
|
|
||||||
|
|
||||||
cd $DIR/../src/
|
|
||||||
rm -rf dist
|
|
||||||
for d in * ; do {
|
|
||||||
cd ..
|
|
||||||
mkdir -p dist/$d
|
|
||||||
echo "Building $d"
|
|
||||||
rollup -c ./rollup.config.js ./src/$d/index.js -m -o dist/$d/index.js -f cjs
|
|
||||||
rollup --silent -c ./rollup.config.js ./src/$d/index.js -m -o dist/$d/index.mjs -f es
|
|
||||||
cd src
|
|
||||||
}
|
|
||||||
done
|
|
||||||
cd $CUR
|
|
||||||
|
|
||||||
|
|
10
packages/examples/example/.babelrc
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"plugins": [
|
||||||
|
["prismjs", {
|
||||||
|
"languages": ["javascript", "css", "markup"],
|
||||||
|
"plugins": ["line-numbers"],
|
||||||
|
"theme": "twilight",
|
||||||
|
"css": true
|
||||||
|
}]
|
||||||
|
]
|
||||||
|
}
|
96
packages/examples/example/README.md
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
<p align="center">
|
||||||
|
<a title="Go to freesewing.org" href="https://freesewing.org/"><img src="https://freesewing.org/img/logo/black.svg" align="center" width="150px" alt="Freesewing logo"/></a>
|
||||||
|
<br>
|
||||||
|
<a href="https://freesewing.org/">FreeSewing v2</a>
|
||||||
|
</p>
|
||||||
|
<p align="center">A JavaScript library for made-to-measure sewing patterns</p>
|
||||||
|
<p align='center'><a
|
||||||
|
href="https://twitter.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-blue.svg?logo=twitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://gitter.im/freesewing/freesewing"
|
||||||
|
title="Chat with us on Gitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Chat%20with%20us-CA0547.svg?logo=gitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Chat with us on Gitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://freesewing.org/patrons/join"
|
||||||
|
title="Become a FreeSewing Patron"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Support%20us-blueviolet.svg?logo=cash-app&logoColor=white&logoWidth=15"
|
||||||
|
alt="Become a FreeSewing Patron"/>
|
||||||
|
</a><a
|
||||||
|
href="https://instagram.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-E4405F.svg?logo=instagram&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
# examples example
|
||||||
|
|
||||||
|
This project was bootstrapped with [Create Freesewing Pattern](https://en.freesewing.dev/create-freesewing-pattern):
|
||||||
|
|
||||||
|
```js
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
This example folder is part of the local development environment.
|
||||||
|
It is **not** part of the pattern's source code.
|
||||||
|
|
||||||
|
To run this example, follow these steps:
|
||||||
|
|
||||||
|
- In the folder above this one, run: `yarn start` (or `npm start`)
|
||||||
|
- Then, in new terminal, run the same command in this folder: `yarn start` (or `npm start`)
|
||||||
|
|
||||||
|
This will spin up the development environment, similar to [our online demo](https://examples.freesewing.dev/).
|
||||||
|
|
||||||
|
## About FreeSewing 🤔
|
||||||
|
|
||||||
|
Where the world of makers and developers collide, that's where you'll find FreeSewing.
|
||||||
|
|
||||||
|
Our [core library](https://freesewing.dev/en/freesewing) is a *batteries-included* toolbox
|
||||||
|
for parametric design of sewing patterns. It's a modular system (check our list
|
||||||
|
of [plugins](https://freesewing.dev/en/plugins) and getting started is as simple as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
The [getting started] section on [freesewing.dev](https://freesewing.dev/) is a good
|
||||||
|
entrypoint to our documentation, but you'll find a lot more there, including
|
||||||
|
our [API documentation](https://freesewing.dev/en/freesewing/api),
|
||||||
|
as well as [examples](https://freesewing.dev/en/freesewing/examples),
|
||||||
|
and [best practices](https://freesewing.dev/en/do).
|
||||||
|
|
||||||
|
If you're a maker, checkout [freesewing.org](https://freesewing/) where you can generate
|
||||||
|
our sewing patterns adapted to your measurements.
|
||||||
|
|
||||||
|
## Support FreeSewing: Become a patron 🥰
|
||||||
|
|
||||||
|
FreeSewing is an open source project run by a community,
|
||||||
|
and financially supported by our patrons.
|
||||||
|
|
||||||
|
If you feel what we do is worthwhile, you too
|
||||||
|
should [become a patron](https://freesewing.org/patrons/join).
|
||||||
|
|
||||||
|
## Links 👩💻
|
||||||
|
|
||||||
|
- 💻 Makers website: [freesewing.org](https://freesewing.org)
|
||||||
|
- 💻 Developers website: [freesewing.dev](https://freesewing.org)
|
||||||
|
- 💬 Chat: [gitter.im/freesewing](https://gitter.im/freesewing/freesewing)
|
||||||
|
- 🐦 Twitter: [@freesewing_org](https://twitter.com/freesewing_org)
|
||||||
|
- 📷 Instagram: [@freesewing_org](https://instagram.com/freesewing_org)
|
||||||
|
|
||||||
|
## License: MIT 🤓
|
||||||
|
|
||||||
|
© [Joost De Cock](https://github.com/joostdecock).
|
||||||
|
See [the license file](https://github.com/freesewing/freesewing/blob/develop/LICENSE) for details.
|
||||||
|
|
||||||
|
## Where to get help 🤯
|
||||||
|
|
||||||
|
Our [chatroom on Gitter](https://gitter.im) is the best place to ask questions,
|
||||||
|
share your feedback, or just hang out.
|
||||||
|
|
||||||
|
If you want to report a problem, please [create an issue](https://github.com/freesewing/freesewing/issues/new).
|
||||||
|
|
49
packages/examples/example/package.json
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
"name": "examples-example",
|
||||||
|
"homepage": "https://freesewing.github.io/examples",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@freesewing/components": "beta",
|
||||||
|
"@freesewing/core": "beta",
|
||||||
|
"@freesewing/css-theme": "beta",
|
||||||
|
"@freesewing/i18n": "beta",
|
||||||
|
"@freesewing/models": "beta",
|
||||||
|
"@freesewing/mui-theme": "beta",
|
||||||
|
"@freesewing/pattern-info": "beta",
|
||||||
|
"@freesewing/plugin-debug": "beta",
|
||||||
|
"@freesewing/plugin-designer": "beta",
|
||||||
|
"@freesewing/plugin-i18n": "beta",
|
||||||
|
"@freesewing/plugin-svgattr": "beta",
|
||||||
|
"@freesewing/plugin-theme": "beta",
|
||||||
|
"@freesewing/plugin-validate": "beta",
|
||||||
|
"@freesewing/utils": "beta",
|
||||||
|
"@material-ui/core": "^3.9.3",
|
||||||
|
"@material-ui/icons": "^3.0.2",
|
||||||
|
"@material-ui/lab": "^3.0.0-alpha.30",
|
||||||
|
"pattern": "link:..",
|
||||||
|
"prismjs": "1.16.0",
|
||||||
|
"react": "^16.8",
|
||||||
|
"react-dom": "^16.8",
|
||||||
|
"react-scripts": "^3.0.0",
|
||||||
|
"typeface-roboto-condensed": "latest"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"start": "react-scripts start",
|
||||||
|
"build": "react-scripts build",
|
||||||
|
"test": "react-scripts test",
|
||||||
|
"eject": "react-scripts eject"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"extends": "react-app"
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
">0.2%",
|
||||||
|
"not dead",
|
||||||
|
"not ie <= 11",
|
||||||
|
"not op_mini all"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"babel-plugin-prismjs": "1.0.2"
|
||||||
|
}
|
||||||
|
}
|
23
packages/examples/example/public/App.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
import "./App.css";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
BIN
packages/examples/example/public/favicon.ico
Normal file
After Width: | Height: | Size: 12 KiB |
40
packages/examples/example/public/index.html
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<meta name="theme-color" content="#000000">
|
||||||
|
<!--
|
||||||
|
manifest.json provides metadata used when your web app is added to the
|
||||||
|
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
|
||||||
|
-->
|
||||||
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
|
||||||
|
<!--
|
||||||
|
Notice the use of %PUBLIC_URL% in the tags above.
|
||||||
|
It will be replaced with the URL of the `public` folder during the build.
|
||||||
|
Only files inside the `public` folder can be referenced from the HTML.
|
||||||
|
|
||||||
|
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||||
|
work correctly both with client-side routing and a non-root public URL.
|
||||||
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
|
-->
|
||||||
|
<title>examples</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
You need to enable JavaScript to run this app.
|
||||||
|
</noscript>
|
||||||
|
<div id="root"></div>
|
||||||
|
<!--
|
||||||
|
This HTML file is a template.
|
||||||
|
If you open it directly in the browser, you will see an empty page.
|
||||||
|
|
||||||
|
You can add webfonts, meta tags, or analytics to this file.
|
||||||
|
The build step will place the bundled scripts into the <body> tag.
|
||||||
|
|
||||||
|
To begin the development, run `npm start` or `yarn start`.
|
||||||
|
To create a production bundle, use `npm run build` or `yarn build`.
|
||||||
|
-->
|
||||||
|
</body>
|
||||||
|
</html>
|
15
packages/examples/example/public/manifest.json
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"short_name": "examples",
|
||||||
|
"name": "examples",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "favicon.ico",
|
||||||
|
"sizes": "64x64 32x32 24x24 16x16",
|
||||||
|
"type": "image/x-icon"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"start_url": ".",
|
||||||
|
"display": "standalone",
|
||||||
|
"theme_color": "#000000",
|
||||||
|
"background_color": "#ffffff"
|
||||||
|
}
|
22
packages/examples/example/src/App.js
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
11
packages/examples/example/src/index.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import React from "react";
|
||||||
|
import ReactDOM from "react-dom";
|
||||||
|
import App from "./App";
|
||||||
|
import * as serviceWorker from "./serviceWorker";
|
||||||
|
|
||||||
|
ReactDOM.render(<App />, document.getElementById("root"));
|
||||||
|
|
||||||
|
// If you want your app to work offline and load faster, you can change
|
||||||
|
// unregister() to register() below. Note this comes with some pitfalls.
|
||||||
|
// Learn more about service workers: http://bit.ly/CRA-PWA
|
||||||
|
serviceWorker.unregister();
|
127
packages/examples/example/src/serviceWorker.js
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
// In production, we register a service worker to serve assets from local cache.
|
||||||
|
|
||||||
|
// This lets the app load faster on subsequent visits in production, and gives
|
||||||
|
// it offline capabilities. However, it also means that developers (and users)
|
||||||
|
// will only see deployed updates on the "N+1" visit to a page, since previously
|
||||||
|
// cached resources are updated in the background.
|
||||||
|
|
||||||
|
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
|
||||||
|
// This link also includes instructions on opting out of this behavior.
|
||||||
|
|
||||||
|
const isLocalhost = Boolean(
|
||||||
|
window.location.hostname === "localhost" ||
|
||||||
|
// [::1] is the IPv6 localhost address.
|
||||||
|
window.location.hostname === "[::1]" ||
|
||||||
|
// 127.0.0.1/8 is considered localhost for IPv4.
|
||||||
|
window.location.hostname.match(
|
||||||
|
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
export function register(config) {
|
||||||
|
if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
|
||||||
|
// The URL constructor is available in all browsers that support SW.
|
||||||
|
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
|
||||||
|
if (publicUrl.origin !== window.location.origin) {
|
||||||
|
// Our service worker won't work if PUBLIC_URL is on a different origin
|
||||||
|
// from what our page is served on. This might happen if a CDN is used to
|
||||||
|
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("load", () => {
|
||||||
|
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
||||||
|
|
||||||
|
if (isLocalhost) {
|
||||||
|
// This is running on localhost. Let's check if a service worker still exists or not.
|
||||||
|
checkValidServiceWorker(swUrl, config);
|
||||||
|
|
||||||
|
// Add some additional logging to localhost, pointing developers to the
|
||||||
|
// service worker/PWA documentation.
|
||||||
|
navigator.serviceWorker.ready.then(() => {
|
||||||
|
console.log(
|
||||||
|
"This web app is being served cache-first by a service " +
|
||||||
|
"worker. To learn more, visit https://goo.gl/SC7cgQ"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Is not local host. Just register service worker
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function registerValidSW(swUrl, config) {
|
||||||
|
navigator.serviceWorker
|
||||||
|
.register(swUrl)
|
||||||
|
.then(registration => {
|
||||||
|
registration.onupdatefound = () => {
|
||||||
|
const installingWorker = registration.installing;
|
||||||
|
installingWorker.onstatechange = () => {
|
||||||
|
if (installingWorker.state === "installed") {
|
||||||
|
if (navigator.serviceWorker.controller) {
|
||||||
|
// At this point, the old content will have been purged and
|
||||||
|
// the fresh content will have been added to the cache.
|
||||||
|
// It's the perfect time to display a "New content is
|
||||||
|
// available; please refresh." message in your web app.
|
||||||
|
console.log("New content is available; please refresh.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onUpdate) {
|
||||||
|
config.onUpdate(registration);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// At this point, everything has been precached.
|
||||||
|
// It's the perfect time to display a
|
||||||
|
// "Content is cached for offline use." message.
|
||||||
|
console.log("Content is cached for offline use.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onSuccess) {
|
||||||
|
config.onSuccess(registration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error("Error during service worker registration:", error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkValidServiceWorker(swUrl, config) {
|
||||||
|
// Check if the service worker can be found. If it can't reload the page.
|
||||||
|
fetch(swUrl)
|
||||||
|
.then(response => {
|
||||||
|
// Ensure service worker exists, and that we really are getting a JS file.
|
||||||
|
if (
|
||||||
|
response.status === 404 ||
|
||||||
|
response.headers.get("content-type").indexOf("javascript") === -1
|
||||||
|
) {
|
||||||
|
// No service worker found. Probably a different app. Reload the page.
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister().then(() => {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Service worker found. Proceed as normal.
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
console.log(
|
||||||
|
"No internet connection found. App is running in offline mode."
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function unregister() {
|
||||||
|
if ("serviceWorker" in navigator) {
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
10540
packages/examples/example/yarn.lock
Normal file
10
packages/florent/example/.babelrc
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"plugins": [
|
||||||
|
["prismjs", {
|
||||||
|
"languages": ["javascript", "css", "markup"],
|
||||||
|
"plugins": ["line-numbers"],
|
||||||
|
"theme": "twilight",
|
||||||
|
"css": true
|
||||||
|
}]
|
||||||
|
]
|
||||||
|
}
|
96
packages/florent/example/README.md
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
<p align="center">
|
||||||
|
<a title="Go to freesewing.org" href="https://freesewing.org/"><img src="https://freesewing.org/img/logo/black.svg" align="center" width="150px" alt="Freesewing logo"/></a>
|
||||||
|
<br>
|
||||||
|
<a href="https://freesewing.org/">FreeSewing v2</a>
|
||||||
|
</p>
|
||||||
|
<p align="center">A JavaScript library for made-to-measure sewing patterns</p>
|
||||||
|
<p align='center'><a
|
||||||
|
href="https://twitter.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-blue.svg?logo=twitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://gitter.im/freesewing/freesewing"
|
||||||
|
title="Chat with us on Gitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Chat%20with%20us-CA0547.svg?logo=gitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Chat with us on Gitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://freesewing.org/patrons/join"
|
||||||
|
title="Become a FreeSewing Patron"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Support%20us-blueviolet.svg?logo=cash-app&logoColor=white&logoWidth=15"
|
||||||
|
alt="Become a FreeSewing Patron"/>
|
||||||
|
</a><a
|
||||||
|
href="https://instagram.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-E4405F.svg?logo=instagram&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
# florent example
|
||||||
|
|
||||||
|
This project was bootstrapped with [Create Freesewing Pattern](https://en.freesewing.dev/create-freesewing-pattern):
|
||||||
|
|
||||||
|
```js
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
This example folder is part of the local development environment.
|
||||||
|
It is **not** part of the pattern's source code.
|
||||||
|
|
||||||
|
To run this example, follow these steps:
|
||||||
|
|
||||||
|
- In the folder above this one, run: `yarn start` (or `npm start`)
|
||||||
|
- Then, in new terminal, run the same command in this folder: `yarn start` (or `npm start`)
|
||||||
|
|
||||||
|
This will spin up the development environment, similar to [our online demo](https://florent.freesewing.dev/).
|
||||||
|
|
||||||
|
## About FreeSewing 🤔
|
||||||
|
|
||||||
|
Where the world of makers and developers collide, that's where you'll find FreeSewing.
|
||||||
|
|
||||||
|
Our [core library](https://freesewing.dev/en/freesewing) is a *batteries-included* toolbox
|
||||||
|
for parametric design of sewing patterns. It's a modular system (check our list
|
||||||
|
of [plugins](https://freesewing.dev/en/plugins) and getting started is as simple as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
The [getting started] section on [freesewing.dev](https://freesewing.dev/) is a good
|
||||||
|
entrypoint to our documentation, but you'll find a lot more there, including
|
||||||
|
our [API documentation](https://freesewing.dev/en/freesewing/api),
|
||||||
|
as well as [examples](https://freesewing.dev/en/freesewing/examples),
|
||||||
|
and [best practices](https://freesewing.dev/en/do).
|
||||||
|
|
||||||
|
If you're a maker, checkout [freesewing.org](https://freesewing/) where you can generate
|
||||||
|
our sewing patterns adapted to your measurements.
|
||||||
|
|
||||||
|
## Support FreeSewing: Become a patron 🥰
|
||||||
|
|
||||||
|
FreeSewing is an open source project run by a community,
|
||||||
|
and financially supported by our patrons.
|
||||||
|
|
||||||
|
If you feel what we do is worthwhile, you too
|
||||||
|
should [become a patron](https://freesewing.org/patrons/join).
|
||||||
|
|
||||||
|
## Links 👩💻
|
||||||
|
|
||||||
|
- 💻 Makers website: [freesewing.org](https://freesewing.org)
|
||||||
|
- 💻 Developers website: [freesewing.dev](https://freesewing.org)
|
||||||
|
- 💬 Chat: [gitter.im/freesewing](https://gitter.im/freesewing/freesewing)
|
||||||
|
- 🐦 Twitter: [@freesewing_org](https://twitter.com/freesewing_org)
|
||||||
|
- 📷 Instagram: [@freesewing_org](https://instagram.com/freesewing_org)
|
||||||
|
|
||||||
|
## License: MIT 🤓
|
||||||
|
|
||||||
|
© [Joost De Cock](https://github.com/joostdecock).
|
||||||
|
See [the license file](https://github.com/freesewing/freesewing/blob/develop/LICENSE) for details.
|
||||||
|
|
||||||
|
## Where to get help 🤯
|
||||||
|
|
||||||
|
Our [chatroom on Gitter](https://gitter.im) is the best place to ask questions,
|
||||||
|
share your feedback, or just hang out.
|
||||||
|
|
||||||
|
If you want to report a problem, please [create an issue](https://github.com/freesewing/freesewing/issues/new).
|
||||||
|
|
49
packages/florent/example/package.json
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
"name": "florent-example",
|
||||||
|
"homepage": "https://freesewing.github.io/florent",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@freesewing/components": "beta",
|
||||||
|
"@freesewing/core": "beta",
|
||||||
|
"@freesewing/css-theme": "beta",
|
||||||
|
"@freesewing/i18n": "beta",
|
||||||
|
"@freesewing/models": "beta",
|
||||||
|
"@freesewing/mui-theme": "beta",
|
||||||
|
"@freesewing/pattern-info": "beta",
|
||||||
|
"@freesewing/plugin-debug": "beta",
|
||||||
|
"@freesewing/plugin-designer": "beta",
|
||||||
|
"@freesewing/plugin-i18n": "beta",
|
||||||
|
"@freesewing/plugin-svgattr": "beta",
|
||||||
|
"@freesewing/plugin-theme": "beta",
|
||||||
|
"@freesewing/plugin-validate": "beta",
|
||||||
|
"@freesewing/utils": "beta",
|
||||||
|
"@material-ui/core": "^3.9.3",
|
||||||
|
"@material-ui/icons": "^3.0.2",
|
||||||
|
"@material-ui/lab": "^3.0.0-alpha.30",
|
||||||
|
"pattern": "link:..",
|
||||||
|
"prismjs": "1.16.0",
|
||||||
|
"react": "^16.8",
|
||||||
|
"react-dom": "^16.8",
|
||||||
|
"react-scripts": "^3.0.0",
|
||||||
|
"typeface-roboto-condensed": "latest"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"start": "react-scripts start",
|
||||||
|
"build": "react-scripts build",
|
||||||
|
"test": "react-scripts test",
|
||||||
|
"eject": "react-scripts eject"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"extends": "react-app"
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
">0.2%",
|
||||||
|
"not dead",
|
||||||
|
"not ie <= 11",
|
||||||
|
"not op_mini all"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"babel-plugin-prismjs": "1.0.2"
|
||||||
|
}
|
||||||
|
}
|
23
packages/florent/example/public/App.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
import "./App.css";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
BIN
packages/florent/example/public/favicon.ico
Normal file
After Width: | Height: | Size: 12 KiB |
40
packages/florent/example/public/index.html
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<meta name="theme-color" content="#000000">
|
||||||
|
<!--
|
||||||
|
manifest.json provides metadata used when your web app is added to the
|
||||||
|
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
|
||||||
|
-->
|
||||||
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
|
||||||
|
<!--
|
||||||
|
Notice the use of %PUBLIC_URL% in the tags above.
|
||||||
|
It will be replaced with the URL of the `public` folder during the build.
|
||||||
|
Only files inside the `public` folder can be referenced from the HTML.
|
||||||
|
|
||||||
|
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||||
|
work correctly both with client-side routing and a non-root public URL.
|
||||||
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
|
-->
|
||||||
|
<title>florent</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
You need to enable JavaScript to run this app.
|
||||||
|
</noscript>
|
||||||
|
<div id="root"></div>
|
||||||
|
<!--
|
||||||
|
This HTML file is a template.
|
||||||
|
If you open it directly in the browser, you will see an empty page.
|
||||||
|
|
||||||
|
You can add webfonts, meta tags, or analytics to this file.
|
||||||
|
The build step will place the bundled scripts into the <body> tag.
|
||||||
|
|
||||||
|
To begin the development, run `npm start` or `yarn start`.
|
||||||
|
To create a production bundle, use `npm run build` or `yarn build`.
|
||||||
|
-->
|
||||||
|
</body>
|
||||||
|
</html>
|
15
packages/florent/example/public/manifest.json
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"short_name": "florent",
|
||||||
|
"name": "florent",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "favicon.ico",
|
||||||
|
"sizes": "64x64 32x32 24x24 16x16",
|
||||||
|
"type": "image/x-icon"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"start_url": ".",
|
||||||
|
"display": "standalone",
|
||||||
|
"theme_color": "#000000",
|
||||||
|
"background_color": "#ffffff"
|
||||||
|
}
|
22
packages/florent/example/src/App.js
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
11
packages/florent/example/src/index.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import React from "react";
|
||||||
|
import ReactDOM from "react-dom";
|
||||||
|
import App from "./App";
|
||||||
|
import * as serviceWorker from "./serviceWorker";
|
||||||
|
|
||||||
|
ReactDOM.render(<App />, document.getElementById("root"));
|
||||||
|
|
||||||
|
// If you want your app to work offline and load faster, you can change
|
||||||
|
// unregister() to register() below. Note this comes with some pitfalls.
|
||||||
|
// Learn more about service workers: http://bit.ly/CRA-PWA
|
||||||
|
serviceWorker.unregister();
|
127
packages/florent/example/src/serviceWorker.js
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
// In production, we register a service worker to serve assets from local cache.
|
||||||
|
|
||||||
|
// This lets the app load faster on subsequent visits in production, and gives
|
||||||
|
// it offline capabilities. However, it also means that developers (and users)
|
||||||
|
// will only see deployed updates on the "N+1" visit to a page, since previously
|
||||||
|
// cached resources are updated in the background.
|
||||||
|
|
||||||
|
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
|
||||||
|
// This link also includes instructions on opting out of this behavior.
|
||||||
|
|
||||||
|
const isLocalhost = Boolean(
|
||||||
|
window.location.hostname === "localhost" ||
|
||||||
|
// [::1] is the IPv6 localhost address.
|
||||||
|
window.location.hostname === "[::1]" ||
|
||||||
|
// 127.0.0.1/8 is considered localhost for IPv4.
|
||||||
|
window.location.hostname.match(
|
||||||
|
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
export function register(config) {
|
||||||
|
if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
|
||||||
|
// The URL constructor is available in all browsers that support SW.
|
||||||
|
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
|
||||||
|
if (publicUrl.origin !== window.location.origin) {
|
||||||
|
// Our service worker won't work if PUBLIC_URL is on a different origin
|
||||||
|
// from what our page is served on. This might happen if a CDN is used to
|
||||||
|
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("load", () => {
|
||||||
|
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
||||||
|
|
||||||
|
if (isLocalhost) {
|
||||||
|
// This is running on localhost. Let's check if a service worker still exists or not.
|
||||||
|
checkValidServiceWorker(swUrl, config);
|
||||||
|
|
||||||
|
// Add some additional logging to localhost, pointing developers to the
|
||||||
|
// service worker/PWA documentation.
|
||||||
|
navigator.serviceWorker.ready.then(() => {
|
||||||
|
console.log(
|
||||||
|
"This web app is being served cache-first by a service " +
|
||||||
|
"worker. To learn more, visit https://goo.gl/SC7cgQ"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Is not local host. Just register service worker
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function registerValidSW(swUrl, config) {
|
||||||
|
navigator.serviceWorker
|
||||||
|
.register(swUrl)
|
||||||
|
.then(registration => {
|
||||||
|
registration.onupdatefound = () => {
|
||||||
|
const installingWorker = registration.installing;
|
||||||
|
installingWorker.onstatechange = () => {
|
||||||
|
if (installingWorker.state === "installed") {
|
||||||
|
if (navigator.serviceWorker.controller) {
|
||||||
|
// At this point, the old content will have been purged and
|
||||||
|
// the fresh content will have been added to the cache.
|
||||||
|
// It's the perfect time to display a "New content is
|
||||||
|
// available; please refresh." message in your web app.
|
||||||
|
console.log("New content is available; please refresh.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onUpdate) {
|
||||||
|
config.onUpdate(registration);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// At this point, everything has been precached.
|
||||||
|
// It's the perfect time to display a
|
||||||
|
// "Content is cached for offline use." message.
|
||||||
|
console.log("Content is cached for offline use.");
|
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config.onSuccess) {
|
||||||
|
config.onSuccess(registration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error("Error during service worker registration:", error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkValidServiceWorker(swUrl, config) {
|
||||||
|
// Check if the service worker can be found. If it can't reload the page.
|
||||||
|
fetch(swUrl)
|
||||||
|
.then(response => {
|
||||||
|
// Ensure service worker exists, and that we really are getting a JS file.
|
||||||
|
if (
|
||||||
|
response.status === 404 ||
|
||||||
|
response.headers.get("content-type").indexOf("javascript") === -1
|
||||||
|
) {
|
||||||
|
// No service worker found. Probably a different app. Reload the page.
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister().then(() => {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Service worker found. Proceed as normal.
|
||||||
|
registerValidSW(swUrl, config);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
console.log(
|
||||||
|
"No internet connection found. App is running in offline mode."
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function unregister() {
|
||||||
|
if ("serviceWorker" in navigator) {
|
||||||
|
navigator.serviceWorker.ready.then(registration => {
|
||||||
|
registration.unregister();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
10
packages/huey/example/.babelrc
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"plugins": [
|
||||||
|
["prismjs", {
|
||||||
|
"languages": ["javascript", "css", "markup"],
|
||||||
|
"plugins": ["line-numbers"],
|
||||||
|
"theme": "twilight",
|
||||||
|
"css": true
|
||||||
|
}]
|
||||||
|
]
|
||||||
|
}
|
96
packages/huey/example/README.md
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
<p align="center">
|
||||||
|
<a title="Go to freesewing.org" href="https://freesewing.org/"><img src="https://freesewing.org/img/logo/black.svg" align="center" width="150px" alt="Freesewing logo"/></a>
|
||||||
|
<br>
|
||||||
|
<a href="https://freesewing.org/">FreeSewing v2</a>
|
||||||
|
</p>
|
||||||
|
<p align="center">A JavaScript library for made-to-measure sewing patterns</p>
|
||||||
|
<p align='center'><a
|
||||||
|
href="https://twitter.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-blue.svg?logo=twitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://gitter.im/freesewing/freesewing"
|
||||||
|
title="Chat with us on Gitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Chat%20with%20us-CA0547.svg?logo=gitter&logoColor=white&logoWidth=15"
|
||||||
|
alt="Chat with us on Gitter"/>
|
||||||
|
</a><a
|
||||||
|
href="https://freesewing.org/patrons/join"
|
||||||
|
title="Become a FreeSewing Patron"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Support%20us-blueviolet.svg?logo=cash-app&logoColor=white&logoWidth=15"
|
||||||
|
alt="Become a FreeSewing Patron"/>
|
||||||
|
</a><a
|
||||||
|
href="https://instagram.com/freesewing_org"
|
||||||
|
title="Follow @freesewing_org on Twitter"
|
||||||
|
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-E4405F.svg?logo=instagram&logoColor=white&logoWidth=15"
|
||||||
|
alt="Follow @freesewing_org on Twitter"/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
# huey example
|
||||||
|
|
||||||
|
This project was bootstrapped with [Create Freesewing Pattern](https://en.freesewing.dev/create-freesewing-pattern):
|
||||||
|
|
||||||
|
```js
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
This example folder is part of the local development environment.
|
||||||
|
It is **not** part of the pattern's source code.
|
||||||
|
|
||||||
|
To run this example, follow these steps:
|
||||||
|
|
||||||
|
- In the folder above this one, run: `yarn start` (or `npm start`)
|
||||||
|
- Then, in new terminal, run the same command in this folder: `yarn start` (or `npm start`)
|
||||||
|
|
||||||
|
This will spin up the development environment, similar to [our online demo](https://huey.freesewing.dev/).
|
||||||
|
|
||||||
|
## About FreeSewing 🤔
|
||||||
|
|
||||||
|
Where the world of makers and developers collide, that's where you'll find FreeSewing.
|
||||||
|
|
||||||
|
Our [core library](https://freesewing.dev/en/freesewing) is a *batteries-included* toolbox
|
||||||
|
for parametric design of sewing patterns. It's a modular system (check our list
|
||||||
|
of [plugins](https://freesewing.dev/en/plugins) and getting started is as simple as:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm init freesewing-pattern
|
||||||
|
```
|
||||||
|
|
||||||
|
The [getting started] section on [freesewing.dev](https://freesewing.dev/) is a good
|
||||||
|
entrypoint to our documentation, but you'll find a lot more there, including
|
||||||
|
our [API documentation](https://freesewing.dev/en/freesewing/api),
|
||||||
|
as well as [examples](https://freesewing.dev/en/freesewing/examples),
|
||||||
|
and [best practices](https://freesewing.dev/en/do).
|
||||||
|
|
||||||
|
If you're a maker, checkout [freesewing.org](https://freesewing/) where you can generate
|
||||||
|
our sewing patterns adapted to your measurements.
|
||||||
|
|
||||||
|
## Support FreeSewing: Become a patron 🥰
|
||||||
|
|
||||||
|
FreeSewing is an open source project run by a community,
|
||||||
|
and financially supported by our patrons.
|
||||||
|
|
||||||
|
If you feel what we do is worthwhile, you too
|
||||||
|
should [become a patron](https://freesewing.org/patrons/join).
|
||||||
|
|
||||||
|
## Links 👩💻
|
||||||
|
|
||||||
|
- 💻 Makers website: [freesewing.org](https://freesewing.org)
|
||||||
|
- 💻 Developers website: [freesewing.dev](https://freesewing.org)
|
||||||
|
- 💬 Chat: [gitter.im/freesewing](https://gitter.im/freesewing/freesewing)
|
||||||
|
- 🐦 Twitter: [@freesewing_org](https://twitter.com/freesewing_org)
|
||||||
|
- 📷 Instagram: [@freesewing_org](https://instagram.com/freesewing_org)
|
||||||
|
|
||||||
|
## License: MIT 🤓
|
||||||
|
|
||||||
|
© [Joost De Cock](https://github.com/joostdecock).
|
||||||
|
See [the license file](https://github.com/freesewing/freesewing/blob/develop/LICENSE) for details.
|
||||||
|
|
||||||
|
## Where to get help 🤯
|
||||||
|
|
||||||
|
Our [chatroom on Gitter](https://gitter.im) is the best place to ask questions,
|
||||||
|
share your feedback, or just hang out.
|
||||||
|
|
||||||
|
If you want to report a problem, please [create an issue](https://github.com/freesewing/freesewing/issues/new).
|
||||||
|
|
49
packages/huey/example/package.json
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
"name": "huey-example",
|
||||||
|
"homepage": "https://freesewing.github.io/huey",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@freesewing/components": "beta",
|
||||||
|
"@freesewing/core": "beta",
|
||||||
|
"@freesewing/css-theme": "beta",
|
||||||
|
"@freesewing/i18n": "beta",
|
||||||
|
"@freesewing/models": "beta",
|
||||||
|
"@freesewing/mui-theme": "beta",
|
||||||
|
"@freesewing/pattern-info": "beta",
|
||||||
|
"@freesewing/plugin-debug": "beta",
|
||||||
|
"@freesewing/plugin-designer": "beta",
|
||||||
|
"@freesewing/plugin-i18n": "beta",
|
||||||
|
"@freesewing/plugin-svgattr": "beta",
|
||||||
|
"@freesewing/plugin-theme": "beta",
|
||||||
|
"@freesewing/plugin-validate": "beta",
|
||||||
|
"@freesewing/utils": "beta",
|
||||||
|
"@material-ui/core": "^3.9.3",
|
||||||
|
"@material-ui/icons": "^3.0.2",
|
||||||
|
"@material-ui/lab": "^3.0.0-alpha.30",
|
||||||
|
"pattern": "link:..",
|
||||||
|
"prismjs": "1.16.0",
|
||||||
|
"react": "^16.8",
|
||||||
|
"react-dom": "^16.8",
|
||||||
|
"react-scripts": "^3.0.0",
|
||||||
|
"typeface-roboto-condensed": "latest"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"start": "react-scripts start",
|
||||||
|
"build": "react-scripts build",
|
||||||
|
"test": "react-scripts test",
|
||||||
|
"eject": "react-scripts eject"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"extends": "react-app"
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
">0.2%",
|
||||||
|
"not dead",
|
||||||
|
"not ie <= 11",
|
||||||
|
"not op_mini all"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"babel-plugin-prismjs": "1.0.2"
|
||||||
|
}
|
||||||
|
}
|
23
packages/huey/example/public/App.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import React from "react";
|
||||||
|
import freesewing from "@freesewing/core";
|
||||||
|
import { Workbench } from "@freesewing/components";
|
||||||
|
import "typeface-roboto-condensed";
|
||||||
|
import "@freesewing/css-theme";
|
||||||
|
import "./App.css";
|
||||||
|
|
||||||
|
import Pattern from "pattern";
|
||||||
|
|
||||||
|
const App = props => {
|
||||||
|
let instance = new Pattern();
|
||||||
|
let config = instance.config;
|
||||||
|
return (
|
||||||
|
<Workbench
|
||||||
|
freesewing={freesewing}
|
||||||
|
Pattern={Pattern}
|
||||||
|
config={config}
|
||||||
|
userLanguage="en"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
BIN
packages/huey/example/public/favicon.ico
Normal file
After Width: | Height: | Size: 12 KiB |