From 02da928f04f9fe5c0d515093a6407f38b3eed064 Mon Sep 17 00:00:00 2001 From: joostdecock Date: Fri, 18 Apr 2025 19:19:20 +0200 Subject: [PATCH] feat: Added package documentation (wip) --- packages/config/src/urls.mjs | 8 +- .../docs/reference/api/utils/cbqc/readme.mdx | 18 + .../api/utils/curveintersectsx/readme.mdx | 73 +-- .../api/utils/curveintersectsy/readme.mdx | 75 +-- .../api/utils/curvesintersect/readme.mdx | 79 ++- .../api/utils/goldenratio/readme.mdx | 13 + .../api/utils/hidepresets/readme.mdx | 17 + .../reference/packages/collection/readme.mdx | 147 +++++ .../docs/reference/packages/config/readme.mdx | 160 +++++ .../docs/reference/packages/core/readme.mdx | 369 +++++++++++ .../docs/reference/packages/i18n/readme.mdx | 48 ++ .../docs/reference/packages/models/readme.mdx | 610 ++++++++++++++++-- .../reference/packages/new-design/readme.mdx | 29 - .../packages/prettier-config/readme.mdx | 32 +- .../packages/react-components/readme.mdx | 38 -- .../react/components/account/readme.mdx | 7 + .../react/components/admin/readme.mdx | 7 + .../react/components/breadcrumbs/readme.mdx | 7 + .../react/components/button/readme.mdx | 7 + .../react/components/collection/readme.mdx | 7 + .../react/components/control/readme.mdx | 7 + .../copytoclipboardbutton/readme.mdx | 7 + .../react/components/curatedset/readme.mdx | 7 + .../react/components/design/readme.mdx | 7 + .../react/components/diffviewer/readme.mdx | 7 + .../react/components/docusaurus/readme.mdx | 7 + .../react/components/echart/readme.mdx | 7 + .../react/components/editor/readme.mdx | 7 + .../react/components/heading/readme.mdx | 7 + .../react/components/highlight/readme.mdx | 7 + .../packages/react/components/icon/readme.mdx | 7 + .../react/components/input/readme.mdx | 7 + .../packages/react/components/json/readme.mdx | 7 + .../react/components/keyval/readme.mdx | 7 + .../react/components/layout/readme.mdx | 7 + .../react/components/linedrawing/readme.mdx | 7 + .../packages/react/components/link/readme.mdx | 7 + .../packages/react/components/logo/readme.mdx | 7 + .../react/components/markdown/readme.mdx | 7 + .../packages/react/components/mini/readme.mdx | 7 + .../react/components/modal/readme.mdx | 7 + .../packages/react/components/new/readme.mdx | 7 + .../react/components/newsletter/readme.mdx | 7 + .../packages/react/components/null/readme.mdx | 7 + .../react/components/number/readme.mdx | 7 + .../react/components/patrons/readme.mdx | 7 + .../react/components/pattern/readme.mdx | 7 + .../react/components/popout/readme.mdx | 7 + .../react/components/profile/readme.mdx | 7 + .../packages/react/components/readme.mdx | 74 +++ .../packages/react/components/role/readme.mdx | 7 + .../react/components/signin/readme.mdx | 7 + .../react/components/signup/readme.mdx | 7 + .../react/components/spinner/readme.mdx | 7 + .../react/components/stats/readme.mdx | 7 + .../packages/react/components/tab/readme.mdx | 7 + .../react/components/table/readme.mdx | 7 + .../packages/react/components/time/readme.mdx | 7 + .../packages/react/components/uuid/readme.mdx | 7 + .../packages/react/components/ux/readme.mdx | 7 + .../packages/react/components/xray/readme.mdx | 7 + .../packages/react/components/yaml/readme.mdx | 7 + .../react/context/loadingstatus/readme.mdx | 7 + .../packages/react/context/modal/readme.mdx | 7 + .../packages/react/context/readme.mdx | 8 + .../reference/packages/react/hooks/readme.mdx | 8 + .../react/hooks/useaccount/readme.mdx | 7 + .../react/hooks/usebackend/readme.mdx | 7 + .../react/hooks/usecontrol/readme.mdx | 7 + .../packages/react/hooks/usedesign/readme.mdx | 7 + .../hooks/usedesigntranslation/readme.mdx | 7 + .../react/hooks/useselection/readme.mdx | 7 + .../react/hooks/usestateobject/readme.mdx | 7 + .../reference/packages/react/lib/readme.mdx | 8 + .../docs/reference/packages/react/readme.mdx | 38 ++ .../rehype-highlight-lines/readme.mdx | 74 --- .../packages/rehype-jargon/readme.mdx | 76 --- .../reference/packages/snapseries/readme.mdx | 90 ++- .../docs/reference/packages/studio/readme.mdx | 40 ++ .../docs/reference/packages/utils/readme.mdx | 103 +++ sites/dev/src/components/doc-list.js | 4 +- sites/dev/src/theme/MDXComponents/index.js | 90 ++- 82 files changed, 2248 insertions(+), 466 deletions(-) create mode 100644 sites/dev/docs/reference/api/utils/cbqc/readme.mdx create mode 100644 sites/dev/docs/reference/api/utils/goldenratio/readme.mdx create mode 100644 sites/dev/docs/reference/api/utils/hidepresets/readme.mdx create mode 100644 sites/dev/docs/reference/packages/collection/readme.mdx create mode 100644 sites/dev/docs/reference/packages/config/readme.mdx create mode 100644 sites/dev/docs/reference/packages/core/readme.mdx create mode 100644 sites/dev/docs/reference/packages/i18n/readme.mdx delete mode 100644 sites/dev/docs/reference/packages/new-design/readme.mdx delete mode 100644 sites/dev/docs/reference/packages/react-components/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/account/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/admin/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/breadcrumbs/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/button/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/collection/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/control/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/copytoclipboardbutton/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/curatedset/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/design/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/diffviewer/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/docusaurus/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/echart/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/editor/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/heading/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/highlight/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/icon/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/input/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/json/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/keyval/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/layout/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/linedrawing/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/link/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/logo/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/markdown/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/mini/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/modal/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/new/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/newsletter/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/null/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/number/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/patrons/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/pattern/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/popout/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/profile/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/role/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/signin/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/signup/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/spinner/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/stats/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/tab/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/table/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/time/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/uuid/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/ux/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/xray/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/components/yaml/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/context/loadingstatus/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/context/modal/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/context/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/hooks/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/hooks/useaccount/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/hooks/usebackend/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/hooks/usecontrol/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/hooks/usedesign/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/hooks/usedesigntranslation/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/hooks/useselection/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/hooks/usestateobject/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/lib/readme.mdx create mode 100644 sites/dev/docs/reference/packages/react/readme.mdx delete mode 100644 sites/dev/docs/reference/packages/rehype-highlight-lines/readme.mdx delete mode 100644 sites/dev/docs/reference/packages/rehype-jargon/readme.mdx create mode 100644 sites/dev/docs/reference/packages/studio/readme.mdx create mode 100644 sites/dev/docs/reference/packages/utils/readme.mdx diff --git a/packages/config/src/urls.mjs b/packages/config/src/urls.mjs index c2b8e5c85d2..c051cea3092 100644 --- a/packages/config/src/urls.mjs +++ b/packages/config/src/urls.mjs @@ -7,16 +7,16 @@ export const urls = { // FreeSewing website website: 'https://freesewing.eu', // FreeSewing monorepo - monorepo: 'https://github.com/freesewing/freesewing', - // FreeSewing github organisation - github: 'https://github.com/freesewing', + monorepo: 'https://codeberg.org/freesewing/freesewing', + // FreeSewing codeberg organisation + codeberg: 'https://codeberg.org/freesewing', // Social media and other account links for FreeSewing social: { YouTube: 'https://www.youtube.com/@freesewing', Discord: 'https://discord.freesewing.org/', Instagram: 'https://instagram.com/freesewing_org', Facebook: 'https://www.facebook.com/groups/627769821272714/', - GitHub: 'https://github.com/freesewing', + Codeberg: 'https://codeberg.org/freesewing', Reddit: 'https://www.reddit.com/r/freesewing/', Mastodon: 'https://freesewing.social/@freesewing', Bluesky: 'https://bsky.app/profile/freesewing.org', diff --git a/sites/dev/docs/reference/api/utils/cbqc/readme.mdx b/sites/dev/docs/reference/api/utils/cbqc/readme.mdx new file mode 100644 index 00000000000..e62008f8899 --- /dev/null +++ b/sites/dev/docs/reference/api/utils/cbqc/readme.mdx @@ -0,0 +1,18 @@ +--- +title: utils.cbqc +--- + +The `utils.cbqc` value holds `0.55191502449351`. +This is the value to best approximate a (quarter) circle with cubic Bézier curves, +as explained in the [Approximate a circle with cubic Bézier curves +](https://spencermortensen.com/articles/bezier-circle/) article by Spencer Mortensen. + +:::tip +cbqc stands for Cubic Bezier Quarter Circle +::: + +## Signature + +```js +Number utils.cbqc +``` diff --git a/sites/dev/docs/reference/api/utils/curveintersectsx/readme.mdx b/sites/dev/docs/reference/api/utils/curveintersectsx/readme.mdx index c7d21150f68..c85f2eaee6f 100644 --- a/sites/dev/docs/reference/api/utils/curveintersectsx/readme.mdx +++ b/sites/dev/docs/reference/api/utils/curveintersectsx/readme.mdx @@ -5,15 +5,6 @@ title: utils.curveIntersectsX() The `utils.curveIntersectsX()` function finds the point(s) where a curve intersects a given X-value. -:::warning - -This function can sometimes fail to find intersections in some curves -due to a limitation in an underlying Bézier library. -Please see [Bug #3367](https://github.com/freesewing/freesewing/issues/3367) -for more information. - -::: - ## Signature ```js @@ -37,40 +28,41 @@ multiple intersections are found. ```js ({ Point, points, Path, paths, Snippet, snippets, utils, part }) => { - points.start = new Point(10, 15) - points.cp1 = new Point(80, 10) - points.cp2 = new Point(-50, 80) - points.end = new Point(110, 70) +points.start = new Point(10, 15) +points.cp1 = new Point(80, 10) +points.cp2 = new Point(-50, 80) +points.end = new Point(110, 70) - paths.curve = new Path() - .move(points.start) - .curve(points.cp1, points.cp2, points.end) +paths.curve = new Path() +.move(points.start) +.curve(points.cp1, points.cp2, points.end) - for (let x of [30, 40]) { - points["from" + x] = new Point(x, 10) - points["to" + x] = new Point(x, 80) - paths["line" + x] = new Path() - .move(points["from" + x]) - .line(points["to" + x]) - .addClass("lining dashed") - } - - snippets.i40 = new Snippet( - "notch", - utils.curveIntersectsX(points.start, points.cp1, points.cp2, points.end, 40) - ) - - for (let p of utils.curveIntersectsX( - points.start, - points.cp1, - points.cp2, - points.end, - 30 - )) - snippets[p.y] = new Snippet("notch", p) - - return part +for (let x of [30, 40]) { +points["from" + x] = new Point(x, 10) +points["to" + x] = new Point(x, 80) +paths["line" + x] = new Path() +.move(points["from" + x]) +.line(points["to" + x]) +.addClass("lining dashed") } + +snippets.i40 = new Snippet( +"notch", +utils.curveIntersectsX(points.start, points.cp1, points.cp2, points.end, 40) +) + +for (let p of utils.curveIntersectsX( +points.start, +points.cp1, +points.cp2, +points.end, +30 +)) +snippets[p.y] = new Snippet("notch", p) + +return part +} + ``` @@ -81,3 +73,4 @@ This is a low-level (and faster) variant of [`Path.intersectsX()`](/reference/api/path/intersectsx). Instead of a path, you describe a single curve by passing the four points that describes it. +``` diff --git a/sites/dev/docs/reference/api/utils/curveintersectsy/readme.mdx b/sites/dev/docs/reference/api/utils/curveintersectsy/readme.mdx index c70ffbac1f9..d842e8b8022 100644 --- a/sites/dev/docs/reference/api/utils/curveintersectsy/readme.mdx +++ b/sites/dev/docs/reference/api/utils/curveintersectsy/readme.mdx @@ -5,15 +5,6 @@ title: utils.curveIntersectsY() The `utils.curveIntersectsY()` function finds the point(s) where a curve intersects a given Y-value. -:::warning - -This function can sometimes fail to find intersections in some curves -due to a limitation in an underlying Bézier library. -Please see [Bug #3367](https://github.com/freesewing/freesewing/issues/3367) -for more information. - -::: - ## Signature ```js @@ -31,46 +22,47 @@ a single intersection is found, and an array of [Point](/reference/api/point/) objects if multiple intersections are found. - ## Example + ```js ({ Point, points, Path, paths, Snippet, snippets, utils, part }) => { - points.start = new Point(10, 45) - points.cp1 = new Point(50, 10) - points.cp2 = new Point(0, 80) - points.end = new Point(110, 70) +points.start = new Point(10, 45) +points.cp1 = new Point(50, 10) +points.cp2 = new Point(0, 80) +points.end = new Point(110, 70) - paths.curve = new Path() - .move(points.start) - .curve(points.cp1, points.cp2, points.end) +paths.curve = new Path() +.move(points.start) +.curve(points.cp1, points.cp2, points.end) - for (let y of [40, 50]) { - points["from" + y] = new Point(10, y) - points["to" + y] = new Point(110, y) - paths["line" + y] = new Path() - .move(points["from" + y]) - .line(points["to" + y]) - .addClass("lining dashed") - } - - snippets.i50 = new Snippet( - "notch", - utils.curveIntersectsY(points.start, points.cp1, points.cp2, points.end, 50) - ) - - for (let p of utils.curveIntersectsY( - points.start, - points.cp1, - points.cp2, - points.end, - 40 - )) - snippets[p.x] = new Snippet("notch", p) - - return part +for (let y of [40, 50]) { +points["from" + y] = new Point(10, y) +points["to" + y] = new Point(110, y) +paths["line" + y] = new Path() +.move(points["from" + y]) +.line(points["to" + y]) +.addClass("lining dashed") } + +snippets.i50 = new Snippet( +"notch", +utils.curveIntersectsY(points.start, points.cp1, points.cp2, points.end, 50) +) + +for (let p of utils.curveIntersectsY( +points.start, +points.cp1, +points.cp2, +points.end, +40 +)) +snippets[p.x] = new Snippet("notch", p) + +return part +} + ``` @@ -80,3 +72,4 @@ This is a low-level (and faster) variant of [`Path.intersectsY()`](/reference/api/path/intersectsy). Instead of a path, you describe a single curve by passing the four points that describes it. +``` diff --git a/sites/dev/docs/reference/api/utils/curvesintersect/readme.mdx b/sites/dev/docs/reference/api/utils/curvesintersect/readme.mdx index 0b794728747..2fb5174b1f9 100644 --- a/sites/dev/docs/reference/api/utils/curvesintersect/readme.mdx +++ b/sites/dev/docs/reference/api/utils/curvesintersect/readme.mdx @@ -5,15 +5,6 @@ title: utils.curvesIntersect() The `utils.curvesIntersect()` function finds the intersections between two curves described by 4 points each. -:::warning - -This function can sometimes fail to find intersections in some curves -due to a limitation in an underlying Bézier library. -Please see [Bug #3367](https://github.com/freesewing/freesewing/issues/3367) -for more information. - -::: - ## Signature ```js @@ -40,43 +31,45 @@ multiple intersections are found. ```js ({ Point, points, Path, paths, Snippet, snippets, utils, getId, part }) => { - points.A = new Point(10, 10) - points.Acp = new Point(310, 40) - points.B = new Point(110, 70) - points.Bcp = new Point(-210, 40) +points.A = new Point(10, 10) +points.Acp = new Point(310, 40) +points.B = new Point(110, 70) +points.Bcp = new Point(-210, 40) - points.C = new Point(20, -5) - points.Ccp = new Point(60, 300) - points.D = new Point(100, 85) - points.Dcp = new Point(70, -220) - paths.curveA = new Path() - .move(points.A) - .curve(points.Acp, points.Bcp, points.B) - paths.curveB = new Path() - .move(points.C) - .curve(points.Ccp, points.Dcp, points.D) +points.C = new Point(20, -5) +points.Ccp = new Point(60, 300) +points.D = new Point(100, 85) +points.Dcp = new Point(70, -220) +paths.curveA = new Path() +.move(points.A) +.curve(points.Acp, points.Bcp, points.B) +paths.curveB = new Path() +.move(points.C) +.curve(points.Ccp, points.Dcp, points.D) - const intersections = utils.curvesIntersect( - points.A, - points.Acp, - points.Bcp, - points.B, - points.C, - points.Ccp, - points.Dcp, - points.D - ) +const intersections = utils.curvesIntersect( +points.A, +points.Acp, +points.Bcp, +points.B, +points.C, +points.Ccp, +points.Dcp, +points.D +) - if (intersections) { - if (intersections instanceof Array) { - for (const p of intersections) - snippets[getId()] = new Snippet('notch', p) - } else { - snippets[getId()] = new Snippet('notch', intersections) - } - } - - return part +if (intersections) { +if (intersections instanceof Array) { +for (const p of intersections) +snippets[getId()] = new Snippet('notch', p) +} else { +snippets[getId()] = new Snippet('notch', intersections) } +} + +return part +} + ``` +``` diff --git a/sites/dev/docs/reference/api/utils/goldenratio/readme.mdx b/sites/dev/docs/reference/api/utils/goldenratio/readme.mdx new file mode 100644 index 00000000000..c226273a13c --- /dev/null +++ b/sites/dev/docs/reference/api/utils/goldenratio/readme.mdx @@ -0,0 +1,13 @@ +--- +title: utils.goldenRatio +--- + +The `utils.goldenRatio` value holds `1.618034`. +This value approximates **φ** which is also known +as [the golden ratio](https://en.wikipedia.org/wiki/Golden_ratio). + +## Signature + +```js +Number utils.goldenRatio +``` diff --git a/sites/dev/docs/reference/api/utils/hidepresets/readme.mdx b/sites/dev/docs/reference/api/utils/hidepresets/readme.mdx new file mode 100644 index 00000000000..f68175f6847 --- /dev/null +++ b/sites/dev/docs/reference/api/utils/hidepresets/readme.mdx @@ -0,0 +1,17 @@ +--- +title: utils.hidePresets +--- + +import { hidePresets } from '@freesewing/core' + +The `utils.hidePresets` value holds presets to hiding parts in a FreeSewing design. + +:::tip +See [Hiding parts](/reference/api/part/config/hide/#presets) for an example of how to use this. +::: + +## Signature + +```js +Object utils.hideParts +``` diff --git a/sites/dev/docs/reference/packages/collection/readme.mdx b/sites/dev/docs/reference/packages/collection/readme.mdx new file mode 100644 index 00000000000..e3ff12b3175 --- /dev/null +++ b/sites/dev/docs/reference/packages/collection/readme.mdx @@ -0,0 +1,147 @@ +--- +title: '@freesewing/collection' +--- + +import * as all from '@freesewing/collection' + +FreeSewing's **collection** package bundles all FreeSewing designs as well as +information about those designs. + +It is published on NPM as [@freesewing/collection +](https://www.npmjs.com/package/@freesewing/collection).\ +The source code for this package is available in [our monorepo on Codeberg +](https://codeberg.org/freesewing/freesewing) under [packages/collection +](https://codeberg.org/freesewing/freesewing/src/branch/develop/packages/collection). + +:::note +This package does not provide a default export. +::: + +## Installation + +```sh +npm install --save @freesewing/collection +``` + +## Named Exports + +### about + +Holds on object where the key is the design name and the value is an object +holding a bunch of information about a Design. + +```js +import { about } from '@freesewing/collection' +``` + + + +### collection + +Holds an array of design names that are included in the package. + +```js +import { collection } from '@freesewing/collection' +``` + + + +### designs + +An object holding all of our designs. The key is the design name, and the value +the design instance. + +```js +import { designs } from '@freesewing/collection' +``` + + + +### designers + +An array holding the various designers, +which we use to filter designs based on the data in the `about` export. + +```js +import { developers } from '@freesewing/collection' +``` + + + +### developers + +An array holding the various developers, +which we use to filter designs based on the data in the `about` export. + +```js +import { developers } from '@freesewing/collection' +``` + + + +### i18n + +An object holding English translations for all designs in our collection. + +```js +import { i18n } from '@freesewing/collection' +``` + + + +### measurements + +Holds an object where the key is the design name and the value is an array of +all the consolidated measurements for that design. +By consolidated, we mean the required measurements, plus the optional +measurments. + +```js +import { measurements } from '@freesewing/collection' +``` + + + +### optionalMeasurements + +Holds an object where the key is the design name and the value is an array of +all the optional measurements for that design. + +```js +import { optionalMeasurements } from '@freesewing/collection' +``` + + + +### requiredMeasurements + +Holds an object where the key is the design name and the value is an array of +all the required measurements for that design. + +```js +import { requiredMeasurements } from '@freesewing/collection' +``` + + + +### tags + +An array holding the various tags, +which we use to filter designs based on the data in the `about` export. + +```js +import { tags } from '@freesewing/collection' +``` + + + +### techniques + +An array holding the various techniques, +which we use to filter designs based on the data in the `about` export. + +```js +import { techniques } from '@freesewing/collection' +``` + + diff --git a/sites/dev/docs/reference/packages/config/readme.mdx b/sites/dev/docs/reference/packages/config/readme.mdx new file mode 100644 index 00000000000..a128565498a --- /dev/null +++ b/sites/dev/docs/reference/packages/config/readme.mdx @@ -0,0 +1,160 @@ +--- +title: '@freesewing/config' +--- + +import * as all from '@freesewing/config' + +FreeSewing's **config** package bundles configuration data for FreeSewing's websites +and infrastructure. + +It is published on NPM as [@freesewing/config +](https://www.npmjs.com/package/@freesewing/config).\ +The source code for this package is available in [our monorepo on Codeberg +](https://codeberg.org/freesewing/freesewing) under [packages/config +](https://codeberg.org/freesewing/freesewing/src/branch/develop/packages/config). + +:::note +This package does not provide a default export. +::: + +## Installation + +```sh +npm install --save @freesewing/config +``` + +## Named Exports + +### apikeyLevels + +Holds an object where the key is the permission level for an API key (a number +from 0 t0 8), and the value is a textual description of that access level. + +```js +import { apikeyLevels } from '@freesewing/config' +``` + + + +### cloudflare + +Holds an object with information about Cloudflare's image service which +FreeSewing uses for hosting images. + +```js +import { cloudflare } from '@freesewing/config' +``` + + + +### control + +Holds an object with the configuration of FreeSewing's control setting. +This setting determines which level of UX complexity hides/reveals what features +on the website. + +```js +import { control } from '@freesewing/config' +``` + + + +### controlDesc + +Holds an object with the textual description of the various control levels +used by FreeSewing. + +```js +import { controlDesc } from '@freesewing/config' +``` + + + +### degreeMeasurements + +Holds an array of measurements that measure an angle, rather than a distance. + +```js +import { degreeMeasurements } from '@freesewing/config' +``` + + + +### isDegreeMeasurement + +A helper method to determine whether a measurement is a degree measurement. +In other words, a measurement that captures an angle, rather than a distance. + + +```js import {isDegreeMeasurement} from '@freesewing/config' + +const result = isDegreeMeasurement('shoulderSlope') +// result now holds: true + +```` + +### logoPath + +Holds a string that is the SVG pathstring for the FreeSewing logo, Skully. + +```js +import { logoPath } from '@freesewing/config' +```` + + + +### measurements + +Holds an array of (the IDs of) all measurements used by FreeSewing designs. + +```js +import { measurements } from '@freesewing/config' +``` + + + +### roles + +Holds an object detailing the roles for role-based access control (RBAC) on the +FreeSewing backend. + +```js +import { roles } from '@freesewing/config' +``` + + + +### sewingTechniques + +Holds an array of (the IDs of) all the sewing techniques used by FreeSewing designs. + +```js +import { sewingTechniques } from '@freesewing/config' +``` + + + +### uiRoles + +Holds an array of all the roles used on the FreeSewing website. + +```js +import { uiRoles } from '@freesewing/config' +``` + + + +### urls + +Holds an array of all the roles used on the FreeSewing website. + +```js +import { urls } from '@freesewing/config' +``` + + diff --git a/sites/dev/docs/reference/packages/core/readme.mdx b/sites/dev/docs/reference/packages/core/readme.mdx new file mode 100644 index 00000000000..04d9bdceb3b --- /dev/null +++ b/sites/dev/docs/reference/packages/core/readme.mdx @@ -0,0 +1,369 @@ +--- +title: '@freesewing/core' +--- + +import { cbqc, hidePresets, goldenRatio, version } from '@freesewing/core' + +FreeSewing's **core** package holds the core library for parametric design +of sewing patterns. + +It is published on NPM as [@freesewing/core +](https://www.npmjs.com/package/@freesewing/core).\ +The source code for this package is available in [our monorepo on Codeberg +](https://codeberg.org/freesewing/freesewing) under [packages/core +](https://codeberg.org/freesewing/freesewing/src/branch/develop/packages/core). + +:::tip +Refer to [the core API reference documentation](/reference/api) for in-depth +info on how to use this package. +::: +:::note +This package does not provide a default export. +::: + +## Installation + +```sh +npm install --save @freesewing/core +``` + +## Named Exports + +### Attributes + +The constructor method for [Attributes](/reference/api/attributes/). + +```js +import { Attributes } from '@freesewing/core' +``` + +### beamIntersectsCircle + +The [beamIntersectsCircle](/reference/api/utils/beamintersectscircle/) function. + +```js +import { beamIntersectsCircle } from '@freesewing/core' +``` + +### beamIntersectsCurve + +The [beamIntersectsCurve](/reference/api/utils/beamintersectscurve/) function. + +```js +import { beamIntersectsCurve } from '@freesewing/core' +``` + +### beamIntersectsX + +The [beamIntersectsX](/reference/api/utils/beamintersectsx/) function. + +```js +import { beamIntersectsX } from '@freesewing/core' +``` + +### beamIntersectsY + +The [beamIntersectsY](/reference/api/utils/beamintersectsy/) function. + +```js +import { beamIntersectsY } from '@freesewing/core' +``` + +### beamsIntersect + +The [beamsIntersect](/reference/api/utils/beamsintersect/) function. + +```js +import { beamsIntersect } from '@freesewing/core' +``` + +### Bezier + +A copy of the [BezierJs](https://www.npmjs.com/package/bezier-js) library. + +```js +import { Bezier } from '@freesewing/core' +``` + +### capitalize + +The [capitalize](/reference/api/utils/capitalize/) function. + +```js +import { capitalize } from '@freesewing/core' +``` + +### cbqc + +The [cbqc](/reference/api/utils/cbqc/) number, which is the ideal value +to approximate a quarter circle with a cubic Bezier curve. + +:::tip +**cbqc** stands for Cubic Bezier Quarter Circle +::: + +```js +import { capitalize } from '@freesewing/core' +``` + + + +### circlesIntersect + +The [circlesIntersect](/reference/api/utils/circlesintersect/) function. + +```js +import { circlesIntersect } from '@freesewing/core' +``` + +### curveEdge + +The [curveEdge](/reference/api/utils/curveedge/) function. + +```js +import { curveEdge } from '@freesewing/core' +``` + +### curveIntersectsX + +The [curveIntersectsX](/reference/api/utils/curveIntersectsX/) function. + +```js +import { curveIntersectsX } from '@freesewing/core' +``` + +### curveIntersectsY + +The [curveIntersectsY](/reference/api/utils/curveintersectsy/) function. + +```js +import { curveIntersectsY } from '@freesewing/core' +``` + +### curvesIntersect + +The [curvesIntersect](/reference/api/utils/curvesintersect/) function. + +```js +import { curvesIntersect } from '@freesewing/core' +``` + +### deg2rad + +The [deg2rad](/reference/api/utils/deg2rad/) function. + +```js +import { deg2rad } from '@freesewing/core' +``` + +### Design + +The constructor method for [Design](/reference/api/design/). + +```js +import { Design } from '@freesewing/core' +``` + +### generateStackTransform + +The [generateStackTransform](/reference/api/utils/generatestacktransform/) function. + +```js +import { generateStackTransform } from '@freesewing/core' +``` + +### getTransformedBounds + +The [getTransformedBounds](/reference/api/utils/gettransformedbounds/) function. + +```js +import { getTransformedBounds } from '@freesewing/core' +``` + +### goldenRatio + +The [goldenRatio](/reference/api/utils/goldenratio/) number, which is the ideal value +to approximate a quarter circle with a cubic Bezier curve. + + + +### hidePresets + +The [hidePresets](/reference/api/utils/hidepresets) object holds presets for +hiding parts in a FreeSewing design. + +```js +import { hidePresets } from '@freesewing/core' +``` + + + +### lineIntersectsCircle + +The [lineIntersectsCircle](/reference/api/utils/lineintersectscircle/) function. + +```js +import { lineIntersectsCircle } from '@freesewing/core' +``` + +### lineIntersectsCurve + +The [lineIntersectsCurve](/reference/api/utils/lineintersectscurve/) function. + +```js +import { lineIntersectsCurve } from '@freesewing/core' +``` + +### linesIntersect + +The [linesIntersect](/reference/api/utils/linesintersect/) function. + +```js +import { linesIntersect } from '@freesewing/core' +``` + +### mergeI18n + +The [mergeI18n](/reference/api/utils/mergei18n/) function. + +```js +import { mergeI18n } from '@freesewing/core' +``` + +### mergeOptions + +The [mergeOptions](/reference/api/utils/mergeoptions/) function. + +```js +import { mergeOptions } from '@freesewing/core' +``` + +### Part + +The constructor method for [Part](/reference/api/part/). + +```js +import { Part } from '@freesewing/core' +``` + +### Path + +The constructor method for [Path](/reference/api/path/). + +```js +import { Path } from '@freesewing/core' +``` + +### Pattern + +The constructor method for [Pattern](/reference/api/pattern/). + +```js +import { Pattern } from '@freesewing/core' +``` + +### pctBasedOn + +The [pctBasedOn](/reference/api/utils/pctbasedon/) function. + +```js +import { pctBasedOn } from '@freesewing/core' +``` + +### Point + +The constructor method for [Point](/reference/api/point/). + +```js +import { Point } from '@freesewing/core' +``` + +### pointOnBeam + +The [pointOnBeam](/reference/api/utils/pointonbeam/) function. + +```js +import { pointOnBeam } from '@freesewing/core' +``` + +### pointOnCurve + +The [pointOnCurve](/reference/api/utils/pointoncurve/) function. + +```js +import { pointOnCurve } from '@freesewing/core' +``` + +### pointOnLine + +The [pointOnLine](/reference/api/utils/pointonline/) function. + +```js +import { pointOnLine } from '@freesewing/core' +``` + +### rad2deg + +The [rad2deg](/reference/api/utils/rad2deg/) function. + +```js +import { rad2deg } from '@freesewing/core' +``` + +### round + +The [round](/reference/api/utils/round/) function. + +```js +import { round } from '@freesewing/core' +``` + +### Snippet + +The constructor method for [Snippet](/reference/api/snippet/). + +```js +import { Snippet } from '@freesewing/core' +``` + +### splitCurve + +The [splitCurve](/reference/api/utils/splitcurve/) function. + +```js +import { splitCurve } from '@freesewing/core' +``` + +### Store + +The constructor method for [Store](/reference/api/store/). + +```js +import { Store } from '@freesewing/core' +``` + +### stretchToScale + +The [stretchToScale](/reference/api/utils/stretchtoscale/) function. + +```js +import { stretchToScale } from '@freesewing/core' +``` + +### units + +The [units](/reference/api/utils/units/) function. + +```js +import { units } from '@freesewing/core' +``` + +### version + +The version of the FreeSewing core library. + +```js +import { version } from '@freesewing/core' +``` + + diff --git a/sites/dev/docs/reference/packages/i18n/readme.mdx b/sites/dev/docs/reference/packages/i18n/readme.mdx new file mode 100644 index 00000000000..5c5ebd7b765 --- /dev/null +++ b/sites/dev/docs/reference/packages/i18n/readme.mdx @@ -0,0 +1,48 @@ +--- +title: '@freesewing/i18n' +--- + +import { flags, measurements } from '@freesewing/i18n' + +FreeSewing's **i18n** package bundles English translations for measurements +and flags used in FreeSewing's designs. + +It is published on NPM as [@freesewing/i18n +](https://www.npmjs.com/package/@freesewing/i18n).\ +The source code for this package is available in [our monorepo on Codeberg +](https://codeberg.org/freesewing/freesewing) under [packages/i18n +](https://codeberg.org/freesewing/freesewing/src/branch/develop/packages/i18n). + +:::note +This package does not provide a default export. +::: + +## Installation + +```sh +npm install --save @freesewing/i18n +``` + +## Named Exports + +### flags + +An object holding English translations for the flags that are used in +FreeSewing's designs to flag information to the user. + +```js +import { flags } from '@freesewing/config' +``` + + + +### measurements + +An object holding English translations for the measurements that are used in +FreeSewing's designs. + +```js +import { measurements } from '@freesewing/config' +``` + + diff --git a/sites/dev/docs/reference/packages/models/readme.mdx b/sites/dev/docs/reference/packages/models/readme.mdx index d5f5ce5a58c..416d51a1eca 100644 --- a/sites/dev/docs/reference/packages/models/readme.mdx +++ b/sites/dev/docs/reference/packages/models/readme.mdx @@ -1,92 +1,578 @@ --- -title: models +title: '@freesewing/models' --- -Published as [@freesewing/models][1], this package provides body -measurements data for a range of size models used by the FreeSewing project. +import * as all from '@freesewing/models' -## Models +FreeSewing's **models** package bundles measurements for a set of +_models_ which are used to test FreeSewing's designs. + +It is published on NPM as [@freesewing/models +](https://www.npmjs.com/package/@freesewing/models).\ +The source code for this package is available in [our monorepo on Codeberg +](https://codeberg.org/freesewing/freesewing) under [packages/models +](https://codeberg.org/freesewing/freesewing/src/branch/develop/packages/models). + +:::note +This package does not provide a default export. +::: + +## Installation + +```sh +npm install --save @freesewing/models +``` + +## About the models Models have names like `cisFemaleAdult34`, `cisMaleDoll30`, and `cisFemaleGiant150`. These names are constructed according to the 3 aspects that make up the model: + 1. Gender: `cisFemale` or `cisMale` 2. Group: `Adult`, `Doll`, or `Giant` 3. Size: a number - For Adult models, the size number is the neck circumference in millimeters, Example: `34` for 34 mm. - - For Doll and Giant models, the size number is a whole number which is the percentage to scale a base model. Examples: '30' for a 30% size reduction for a doll, and '150' for a 150% size increase for a giant. + - For Doll and Giant models, the size number is a whole number which is the percentage to scale a base model. Examples: + - `30` for a 30% size reduction for a doll + - `150` for a 150% size increase for a giant -## Available models +### Available models -Available models are: -- cisFemaleAdult sizes 28, 30, 32, 34, 36, 38, 40, 42, 44, 46 -- cisMaleAdult sizes 32, 34, 36, 38, 40, 42, 44, 46, 48, 50 -- cisFemaleDoll sizes 10, 20, 30, 40, 50, 60 -- cisMaleDoll sizes 10, 20, 30, 40, 50, 60 -- cisFemaleGiant sizes 150, 200, 250, 300 -- cisMaleGiant sizes 150, 200, 250, 300 +- cisFemaleAdult: sizes 28, 30, 32, 34, 36, 38, 40, 42, 44, and 46 +- cisMaleAdult: sizes 32, 34, 36, 38, 40, 42, 44, 46, 48, and 50 +- cisFemaleDoll: sizes 10, 20, 30, 40, 50, and 60 +- cisMaleDoll: sizes 10, 20, 30, 40, 50, and 60 +- cisFemaleGiant: sizes 150, 200, 250, and 300 +- cisMaleGiant: sizes 150, 200, 250, and 300 -## Exports +## Named Exports -models: Objects with key-value pairs, with measurement name keys and measurement value (in mm) values. +### adult -`measurements`: Array of measurement name strings. -See [Measurements](/reference/measurements) for a list of measurement names. - -`group` Array of the model group name strings (`adult`, `doll`, `giant`). - -`sizes` Object with key-value pairs, with genderGroup keys and values that are Arrays of size numbers available for each genderGroup. - -genderGroups: Each genderGroup is an object of key-value pairs, with size keys and model values. -Available genderGroups: `cisFemaleAdult`, `cisMaleAdult`, `cisFemaleDoll`, `cisMaleDoll`, `cisFemaleGiant`, `cisMaleGiant`. - -groups: Each group is an object of key-value pairs, with gender keys and genderGroup values. -Available groups: `adult`, `doll`, `giant`. - -## Installation - -```sh -npm install @freesewing/models -``` - -## Example - -In NodeJS: -```js -import { cisMaleAdult38 } from @freesewing/models - -``` - -which will give you an object with measurement: value pairs. -The example above gives you: +An object holding all adult models. ```js -{ - ankle: 235, - biceps: 350, - bustFront: 560, - bustPointToUnderbust: 60, - bustSpan: 190, - chesT: 1000, - crossSeam: 870 - crossSeamFront: 410, - crotchDepth: 340, - heel, 360, - head: 590, - ... -} +import { adults } from '@freesewing/models' ``` -## Units + -All measurements are in mm. +### cisFemaleAdult +An object holding all cisfemale adult models. + +```js +import { cisFemaleAdult } from '@freesewing/models' +``` + + + +### cisFemaleAdult28 + +An object holding the cisfemale adult size 28 model. + +```js +import { cisFemaleAdult28 } from '@freesewing/models' +``` + + + +### cisFemaleAdult30 + +An object holding the cisfemale adult size 30 model. + +```js +import { cisFemaleAdult30 } from '@freesewing/models' +``` + + + +### cisFemaleAdult32 + +An object holding the cisfemale adult size 32 model. + +```js +import { cisFemaleAdult32 } from '@freesewing/models' +``` + + + +### cisFemaleAdult34 + +An object holding the cisfemale adult size 34 model. + +```js +import { cisFemaleAdult34 } from '@freesewing/models' +``` + + + +### cisFemaleAdult36 + +An object holding the cisfemale adult size 36 model. + +```js +import { cisFemaleAdult36 } from '@freesewing/models' +``` + + + +### cisFemaleAdult38 + +An object holding the cisfemale adult size 38 model. + +```js +import { cisFemaleAdult38 } from '@freesewing/models' +``` + + + +### cisFemaleAdult40 + +An object holding the cisfemale adult size 40 model. + +```js +import { cisFemaleAdult40 } from '@freesewing/models' +``` + + + +### cisFemaleAdult42 + +An object holding the cisfemale adult size 42 model. + +```js +import { cisFemaleAdult42 } from '@freesewing/models' +``` + + + +### cisFemaleAdult44 + +An object holding the cisfemale adult size 44 model. + +```js +import { cisFemaleAdult44 } from '@freesewing/models' +``` + + + +### cisFemaleAdult46 + +An object holding the cisfemale adult size 46 model. + +```js +import { cisFemaleAdult46 } from '@freesewing/models' +``` + + + +### cisFemaleDoll + +An object holding all cisfemale doll models. + +```js +import { cisFemaleDoll } from '@freesewing/models' +``` + + + +### cisFemaleDoll10 + +An object holding the cisfemale doll size 10 model. + +```js +import { cisFemaleDoll10 } from '@freesewing/models' +``` + + + +### cisFemaleDoll20 + +An object holding the cisfemale doll size 20 model. + +```js +import { cisFemaleDoll20 } from '@freesewing/models' +``` + + + +### cisFemaleDoll30 + +An object holding the cisfemale doll size 30 model. + +```js +import { cisFemaleDoll30 } from '@freesewing/models' +``` + + + +### cisFemaleDoll40 + +An object holding the cisfemale doll size 40 model. + +```js +import { cisFemaleDoll40 } from '@freesewing/models' +``` + + + +### cisFemaleDoll50 + +An object holding the cisfemale doll size 50 model. + +```js +import { cisFemaleDoll50 } from '@freesewing/models' +``` + + + +### cisFemaleDoll60 + +An object holding the cisfemale doll size 60 model. + +```js +import { cisFemaleDoll60 } from '@freesewing/models' +``` + + + +### cisFemaleGiant + +An object holding all cisfemale giant models. + +```js +import { cisFemaleGiant } from '@freesewing/models' +``` + + + +### cisFemaleGiant150 + +An object holding the cisfemale giant size 150 model. + +```js +import { cisFemaleGiant150 } from '@freesewing/models' +``` + + + +### cisFemaleGiant200 + +An object holding the cisfemale giant size 200 model. + +```js +import { cisFemaleGiant200 } from '@freesewing/models' +``` + + + +### cisFemaleGiant250 + +An object holding the cisfemale giant size 250 model. + +```js +import { cisFemaleGiant250 } from '@freesewing/models' +``` + + + +### cisFemaleGiant300 + +An object holding the cisfemale giant size 300 model. + +```js +import { cisFemaleGiant300 } from '@freesewing/models' +``` + + + +### cisMaleAdult + +An object holding all cismale adult models. + +```js +import { cisMaleAdult } from '@freesewing/models' +``` + + + +### cisMaleAdult32 + +An object holding the cismale adult size 32 model. + +```js +import { cisMaleAdult32 } from '@freesewing/models' +``` + + + +### cisMaleAdult34 + +An object holding the cismale adult size 34 model. + +```js +import { cisMaleAdult34 } from '@freesewing/models' +``` + + + +### cisMaleAdult36 + +An object holding the cismale adult size 36 model. + +```js +import { cisMaleAdult36 } from '@freesewing/models' +``` + + + +### cisMaleAdult38 + +An object holding the cismale adult size 38 model. + +```js +import { cisMaleAdult38 } from '@freesewing/models' +``` + + + +### cisMaleAdult40 + +An object holding the cismale adult size 40 model. + +```js +import { cisMaleAdult40 } from '@freesewing/models' +``` + + + +### cisMaleAdult42 + +An object holding the cismale adult size 42 model. + +```js +import { cisMaleAdult42 } from '@freesewing/models' +``` + + + +### cisMaleAdult44 + +An object holding the cismale adult size 44 model. + +```js +import { cisMaleAdult44 } from '@freesewing/models' +``` + + + +### cisMaleAdult46 + +An object holding the cismale adult size 46 model. + +```js +import { cisMaleAdult46 } from '@freesewing/models' +``` + + + +### cisMaleAdult48 + +An object holding the cismale adult size 48 model. + +```js +import { cisMaleAdult48 } from '@freesewing/models' +``` + + + +### cisMaleAdult50 + +An object holding the cismale adult size 50 model. + +```js +import { cisMaleAdult50 } from '@freesewing/models' +``` + + + +### cisMaleDoll + +An object holding all cismale doll models. + +```js +import { cisMaleDoll } from '@freesewing/models' +``` + + + +### cisMaleDoll10 + +An object holding the cismale doll size 10 model. + +```js +import { cisMaleDoll10 } from '@freesewing/models' +``` + + + +### cisMaleDoll20 + +An object holding the cismale doll size 20 model. + +```js +import { cisMaleDoll20 } from '@freesewing/models' +``` + + + +### cisMaleDoll30 + +An object holding the cismale doll size 30 model. + +```js +import { cisMaleDoll30 } from '@freesewing/models' +``` + + + +### cisMaleDoll40 + +An object holding the cismale doll size 40 model. + +```js +import { cisMaleDoll40 } from '@freesewing/models' +``` + + + +### cisMaleDoll50 + +An object holding the cismale doll size 50 model. + +```js +import { cisMaleDoll50 } from '@freesewing/models' +``` + + + +### cisMaleDoll60 + +An object holding the cismale doll size 60 model. + +```js +import { cisMaleDoll60 } from '@freesewing/models' +``` + + + +### cisMaleGiant + +An object holding all models. + +```js +import { cisMaleGiant } from '@freesewing/models' +``` + + + +### cisMaleGiant150 + +An object holding the cismale giant size 150 model. + +```js +import { cisMaleGiant150 } from '@freesewing/models' +``` + + + +### cisMaleGiant200 + +An object holding the cismale giant size 200 model. + +```js +import { cisMaleGiant200 } from '@freesewing/models' +``` + + + +### cisMaleGiant250 + +An object holding the cismale giant size 250 model. + +```js +import { cisMaleGiant250 } from '@freesewing/models' +``` + + + +### cisMaleGiant300 + +An object holding the cismale giant size 300 model. + +```js +import { cisMaleGiant300 } from '@freesewing/models' +``` + + + +### doll + +An object holding all doll models. + +```js +import { doll } from '@freesewing/models' +``` + + + +### giant + +An object holding all giant models. + +```js +import { giant } from '@freesewing/models' +``` + + + +### groups + +An array with the different types of model groups. + +```js +import { groups } from '@freesewing/models' +``` + + + +### measurements + +Holds an array of (the IDs of) all measurements used by FreeSewing designs. + +```js +import { measurements } from '@freesewing/models' +``` + + + +### sizes + +Holds an object with the various available sizes, grouped by model type. + +```js +import { sizes } from '@freesewing/models' +``` + + ## Notes These model measurement values were arbitrarily chosen by FreeSewing. -They do __not__ correspond to any existing statistical data or +They do **not** correspond to any existing statistical data or official size charts. You should not expect that these models will produce garments that fit the same as clothing store sizes. @@ -98,5 +584,3 @@ the base values using a mathematical formula which scales and adjusts the values. The mathematical formula is designed to produce approximate measurements which are realistic enough to be useful. - -[1]: https://www.npmjs.com/package/@freesewing/models diff --git a/sites/dev/docs/reference/packages/new-design/readme.mdx b/sites/dev/docs/reference/packages/new-design/readme.mdx deleted file mode 100644 index ec059b27687..00000000000 --- a/sites/dev/docs/reference/packages/new-design/readme.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: new-design ---- - -Published as [@freesewing/new-design][1], this is an -initializer package for a new FreeSewing design. - -## Usage - -```sh -npx @freesewing/new-design -``` - -## Notes - -The package will run an interactive script and install a standalone -development environment which can be used to develop and test a new -FreeSewing design and to generate patterns from that design. - -:::note RELATED - -Please see our -[Getting Started tutorial](/tutorials/getting-started-linux/dev-setup#stand-alone-development) -for more information about how to set up and start the standalone -development environment. - -::: - -[1]: https://www.npmjs.com/package/@freesewing/new-design diff --git a/sites/dev/docs/reference/packages/prettier-config/readme.mdx b/sites/dev/docs/reference/packages/prettier-config/readme.mdx index d00d40ee611..f4e2fa5b6de 100644 --- a/sites/dev/docs/reference/packages/prettier-config/readme.mdx +++ b/sites/dev/docs/reference/packages/prettier-config/readme.mdx @@ -1,19 +1,21 @@ --- -title: prettier-config +title: '@freesewing/prettier-config' --- -Published as [@freesewing/prettier-config][1], this package is -FreeSewing's shared configuration for [Prettier](https://prettier.io/). +FreeSewing's **prettier-config** package holds FreeSewing's preferred +configuration for the [Prettier](https://prettier.io/) code formatter. -## Installation - -```sh -npm install @freesewing/prettier-config -``` +It is published on NPM as [@freesewing/prettier-config +](https://www.npmjs.com/package/@freesewing/prettier-config).\ +The source code for this package is available in [our monorepo on Codeberg +](https://codeberg.org/freesewing/freesewing) under [packages/prettier-config +](https://codeberg.org/freesewing/freesewing/src/branch/develop/packages/prettier-config). ## Usage -Edit package.json: +This package only provides a default export, which is a JSON file. + +To use it, do not install it, but instead update you `package.json` file as such: ```json { @@ -26,12 +28,12 @@ Edit package.json: The Prettier options configured by this package: -| Option | Value | -|--------|-------| -| semi | `false` | -| singleQuote | `true` | -| trailingComma | "es5" | -| printWidth | 100 | +| Option | Value | +| ------------- | ------- | +| semi | `false` | +| singleQuote | `true` | +| trailingComma | "es5" | +| printWidth | 100 | :::note RELATED diff --git a/sites/dev/docs/reference/packages/react-components/readme.mdx b/sites/dev/docs/reference/packages/react-components/readme.mdx deleted file mode 100644 index 99a57af29a2..00000000000 --- a/sites/dev/docs/reference/packages/react-components/readme.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: react-components ---- - -Published as [@freesewing/react-components][1], this package provides -various React components to render FreeSewing patterns, as well as -some utilities to facilitate frontend integration. - -## Exports - -FreeSewing uses named exports, and below is a list of all exports: - -- `Pattern`: Renders a FreeSewing pattern -- `Svg`: Renders the svg section of a FreeSewing pattern -- `Defs`: Renders the defs of a FreeSewing pattern -- `Group`: Renders an SVG group of a FreeSewing pattern -- `Stack`: Renders a stack of a FreeSewing pattern -- `Part`: Renders a part of a FreeSewing pattern -- `Point`: Renders a point of a FreeSewing pattern -- `Path`: Renders a path of a FreeSewing pattern -- `Snippet`: Renders a snippet of a FreeSewing pattern -- `Grid`: Renders the grid of a FreeSewing pattern -- `Text`: Renders text of a FreeSewing pattern -- `TextOnPath`: Renders text on path of a FreeSewing pattern -- `PatternXray`: Renders the Xray/inspector variant of a FreeSewing pattern -- `utils`: A plain object holding the following utilities: - - `getProps` - - `withinPartBounds` - - `getId` - - `translateStrings` - -## Installation - -```sh -npm install @freesewing/react-components -``` - -[1]: https://www.npmjs.com/package/@freesewing/react-components diff --git a/sites/dev/docs/reference/packages/react/components/account/readme.mdx b/sites/dev/docs/reference/packages/react/components/account/readme.mdx new file mode 100644 index 00000000000..baca49c94a1 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/account/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Account +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/admin/readme.mdx b/sites/dev/docs/reference/packages/react/components/admin/readme.mdx new file mode 100644 index 00000000000..4c333d24f6d --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/admin/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Admin +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/breadcrumbs/readme.mdx b/sites/dev/docs/reference/packages/react/components/breadcrumbs/readme.mdx new file mode 100644 index 00000000000..49b7268d22f --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/breadcrumbs/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Breadcrumbs +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/button/readme.mdx b/sites/dev/docs/reference/packages/react/components/button/readme.mdx new file mode 100644 index 00000000000..94f1901cfdb --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/button/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Button +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/collection/readme.mdx b/sites/dev/docs/reference/packages/react/components/collection/readme.mdx new file mode 100644 index 00000000000..427be26a12d --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/collection/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Collection +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/control/readme.mdx b/sites/dev/docs/reference/packages/react/components/control/readme.mdx new file mode 100644 index 00000000000..204a8b554d0 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/control/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Control +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/copytoclipboardbutton/readme.mdx b/sites/dev/docs/reference/packages/react/components/copytoclipboardbutton/readme.mdx new file mode 100644 index 00000000000..1cfa8a4f079 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/copytoclipboardbutton/readme.mdx @@ -0,0 +1,7 @@ +--- +title: CopyToClipboardButton +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/curatedset/readme.mdx b/sites/dev/docs/reference/packages/react/components/curatedset/readme.mdx new file mode 100644 index 00000000000..e0aae423597 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/curatedset/readme.mdx @@ -0,0 +1,7 @@ +--- +title: CuratedSet +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/design/readme.mdx b/sites/dev/docs/reference/packages/react/components/design/readme.mdx new file mode 100644 index 00000000000..b511c5dd866 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/design/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Design +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/diffviewer/readme.mdx b/sites/dev/docs/reference/packages/react/components/diffviewer/readme.mdx new file mode 100644 index 00000000000..e1a706ca063 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/diffviewer/readme.mdx @@ -0,0 +1,7 @@ +--- +title: DiffViewer +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/docusaurus/readme.mdx b/sites/dev/docs/reference/packages/react/components/docusaurus/readme.mdx new file mode 100644 index 00000000000..995f3c7a23e --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/docusaurus/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Docusaurus +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/echart/readme.mdx b/sites/dev/docs/reference/packages/react/components/echart/readme.mdx new file mode 100644 index 00000000000..9b5cfbc0434 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/echart/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Echart +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/editor/readme.mdx b/sites/dev/docs/reference/packages/react/components/editor/readme.mdx new file mode 100644 index 00000000000..9c54f158219 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/editor/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Editor +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/heading/readme.mdx b/sites/dev/docs/reference/packages/react/components/heading/readme.mdx new file mode 100644 index 00000000000..30b79fe345c --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/heading/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Heading +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/highlight/readme.mdx b/sites/dev/docs/reference/packages/react/components/highlight/readme.mdx new file mode 100644 index 00000000000..357cbdff35f --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/highlight/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Highlight +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/icon/readme.mdx b/sites/dev/docs/reference/packages/react/components/icon/readme.mdx new file mode 100644 index 00000000000..705a97ba855 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/icon/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Icon +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/input/readme.mdx b/sites/dev/docs/reference/packages/react/components/input/readme.mdx new file mode 100644 index 00000000000..09683ee3cb6 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/input/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Input +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/json/readme.mdx b/sites/dev/docs/reference/packages/react/components/json/readme.mdx new file mode 100644 index 00000000000..3825329369a --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/json/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Json +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/keyval/readme.mdx b/sites/dev/docs/reference/packages/react/components/keyval/readme.mdx new file mode 100644 index 00000000000..dc5539bfd95 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/keyval/readme.mdx @@ -0,0 +1,7 @@ +--- +title: KeyVal +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/layout/readme.mdx b/sites/dev/docs/reference/packages/react/components/layout/readme.mdx new file mode 100644 index 00000000000..b1bc8f46f29 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/layout/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Layout +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/linedrawing/readme.mdx b/sites/dev/docs/reference/packages/react/components/linedrawing/readme.mdx new file mode 100644 index 00000000000..f9c9d636bb8 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/linedrawing/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Linedrawing +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/link/readme.mdx b/sites/dev/docs/reference/packages/react/components/link/readme.mdx new file mode 100644 index 00000000000..1156c5aa1ef --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/link/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Link +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/logo/readme.mdx b/sites/dev/docs/reference/packages/react/components/logo/readme.mdx new file mode 100644 index 00000000000..be8d58e9078 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/logo/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Logo +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/markdown/readme.mdx b/sites/dev/docs/reference/packages/react/components/markdown/readme.mdx new file mode 100644 index 00000000000..95476bbbdd9 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/markdown/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Markdown +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/mini/readme.mdx b/sites/dev/docs/reference/packages/react/components/mini/readme.mdx new file mode 100644 index 00000000000..cf5700cc2c7 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/mini/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Mini +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/modal/readme.mdx b/sites/dev/docs/reference/packages/react/components/modal/readme.mdx new file mode 100644 index 00000000000..07559473e1e --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/modal/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Modal +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/new/readme.mdx b/sites/dev/docs/reference/packages/react/components/new/readme.mdx new file mode 100644 index 00000000000..8f14f43b017 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/new/readme.mdx @@ -0,0 +1,7 @@ +--- +title: New +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/newsletter/readme.mdx b/sites/dev/docs/reference/packages/react/components/newsletter/readme.mdx new file mode 100644 index 00000000000..0976f817462 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/newsletter/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Newsletter +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/null/readme.mdx b/sites/dev/docs/reference/packages/react/components/null/readme.mdx new file mode 100644 index 00000000000..dade947e6b9 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/null/readme.mdx @@ -0,0 +1,7 @@ +--- +title: 'Null' +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/number/readme.mdx b/sites/dev/docs/reference/packages/react/components/number/readme.mdx new file mode 100644 index 00000000000..fa7f304f082 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/number/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Number +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/patrons/readme.mdx b/sites/dev/docs/reference/packages/react/components/patrons/readme.mdx new file mode 100644 index 00000000000..e6c0a41ee61 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/patrons/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Patrons +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/pattern/readme.mdx b/sites/dev/docs/reference/packages/react/components/pattern/readme.mdx new file mode 100644 index 00000000000..7892263725f --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/pattern/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Pattern +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/popout/readme.mdx b/sites/dev/docs/reference/packages/react/components/popout/readme.mdx new file mode 100644 index 00000000000..c3a6537e1bb --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/popout/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Popout +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/profile/readme.mdx b/sites/dev/docs/reference/packages/react/components/profile/readme.mdx new file mode 100644 index 00000000000..bcd07d3d388 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/profile/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Profile +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/readme.mdx b/sites/dev/docs/reference/packages/react/components/readme.mdx new file mode 100644 index 00000000000..4d495951f5e --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/readme.mdx @@ -0,0 +1,74 @@ +--- +title: React Components +--- + +The React components provided by the +[@freesewing/react](/reference/packages/react/) package are grouped by +_component family_. + +For each family, the import structure is the same: + +```js +import { Component } from '@freesewing/react/components/Family' +``` + +Click on any component family to see which components they provide: + + + +- [components/Account](/reference/packages/react/components/account/) +- [components/Admin](/reference/packages/react/components/admin/) +- [components/Breadcrumbs](/reference/packages/react/components/breadcrumbs/) +- [components/Button](/reference/packages/react/components/button/) +- [components/Collection](/reference/packages/react/components/collection/) +- [components/Control](/reference/packages/react/components/control/) +- [components/CopyToClipboardButton](/reference/packages/react/components/copytoclipboardbutton/) +- [components/CuratedSet](/reference/packages/react/components/curatedset/) +- [components/Design](/reference/packages/react/components/design/) +- [components/DiffViewer](/reference/packages/react/components/diffviewer/) +- [components/Docusaurus](/reference/packages/react/components/docusaurus/) +- [components/Echart](/reference/packages/react/components/echart/) +- [components/Editor](/reference/packages/react/components/editor/) +- [components/Heading](/reference/packages/react/components/heading/) +- [components/Highlight](/reference/packages/react/components/highlight/) +- [components/Icon](/reference/packages/react/components/icon/) +- [components/Input](/reference/packages/react/components/input/) +- [components/Json](/reference/packages/react/components/json/) +- [components/KeyVal](/reference/packages/react/components/keyval/) +- [components/Layout](/reference/packages/react/components/layout/) +- [components/LineDrawing](/reference/packages/react/components/linedrawing/) +- [components/Link](/reference/packages/react/components/link/) +- [components/Logo](/reference/packages/react/components/logo/) +- [components/Markdown](/reference/packages/react/components/markdown/) +- [components/Mini](/reference/packages/react/components/mini/) +- [components/Modal](/reference/packages/react/components/modal/) +- [components/New](/reference/packages/react/components/new/) +- [components/Newsletter](/reference/packages/react/components/newsletter/) +- [components/Null](/reference/packages/react/components/null/) +- [components/Number](/reference/packages/react/components/number/) +- [components/Pattern](/reference/packages/react/components/pattern/) +- [components/Patrons](/reference/packages/react/components/patrons/) +- [components/Popout](/reference/packages/react/components/popout/) +- [components/Profile](/reference/packages/react/components/profile/) +- [components/Role](/reference/packages/react/components/role/) +- [components/SignIn](/reference/packages/react/components/signin/) +- [components/SignUp](/reference/packages/react/components/signup/) +- [components/Spinner](/reference/packages/react/components/spinner/) +- [components/Stats](/reference/packages/react/components/stats/) +- [components/Tab](/reference/packages/react/components/tab/) +- [components/Table](/reference/packages/react/components/table/) +- [components/Time](/reference/packages/react/components/time/) +- [components/Uuid](/reference/packages/react/components/uuid/) +- [components/Ux](/reference/packages/react/components/ux/) +- [components/Yaml](/reference/packages/react/components/yaml/) +- [components/Xray](/reference/packages/react/components/xray/) + +## Context + +- context/LoadingStatus](/reference/packages/react": "./context/LoadingStatus/index.mjs", + +## Names exports + +- linedrawings](/reference/packages/react": "./src/linedrawings/index.mjs", +- pattern](/reference/packages/react": "./src/pattern/index.mjs", +- xray](/reference/packages/react": "./src/pattern-xray/index.mjs", diff --git a/sites/dev/docs/reference/packages/react/components/role/readme.mdx b/sites/dev/docs/reference/packages/react/components/role/readme.mdx new file mode 100644 index 00000000000..1f3bd87907d --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/role/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Role +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/signin/readme.mdx b/sites/dev/docs/reference/packages/react/components/signin/readme.mdx new file mode 100644 index 00000000000..2abc9b7e542 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/signin/readme.mdx @@ -0,0 +1,7 @@ +--- +title: SignIn +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/signup/readme.mdx b/sites/dev/docs/reference/packages/react/components/signup/readme.mdx new file mode 100644 index 00000000000..fa4e3a9cd48 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/signup/readme.mdx @@ -0,0 +1,7 @@ +--- +title: SignUp +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/spinner/readme.mdx b/sites/dev/docs/reference/packages/react/components/spinner/readme.mdx new file mode 100644 index 00000000000..791076fbc18 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/spinner/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Spinner +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/stats/readme.mdx b/sites/dev/docs/reference/packages/react/components/stats/readme.mdx new file mode 100644 index 00000000000..92f35111113 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/stats/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Stats +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/tab/readme.mdx b/sites/dev/docs/reference/packages/react/components/tab/readme.mdx new file mode 100644 index 00000000000..27206fabb08 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/tab/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Tab +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/table/readme.mdx b/sites/dev/docs/reference/packages/react/components/table/readme.mdx new file mode 100644 index 00000000000..7012ab7577b --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/table/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Table +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/time/readme.mdx b/sites/dev/docs/reference/packages/react/components/time/readme.mdx new file mode 100644 index 00000000000..d8c7f67bd64 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/time/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Time +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/uuid/readme.mdx b/sites/dev/docs/reference/packages/react/components/uuid/readme.mdx new file mode 100644 index 00000000000..428ae19888f --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/uuid/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Uuid +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/ux/readme.mdx b/sites/dev/docs/reference/packages/react/components/ux/readme.mdx new file mode 100644 index 00000000000..996c0d5f03a --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/ux/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Ux +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/xray/readme.mdx b/sites/dev/docs/reference/packages/react/components/xray/readme.mdx new file mode 100644 index 00000000000..8208918f631 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/xray/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Xray +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/components/yaml/readme.mdx b/sites/dev/docs/reference/packages/react/components/yaml/readme.mdx new file mode 100644 index 00000000000..848c9e57c7e --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/yaml/readme.mdx @@ -0,0 +1,7 @@ +--- +title: Yaml +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/context/loadingstatus/readme.mdx b/sites/dev/docs/reference/packages/react/context/loadingstatus/readme.mdx new file mode 100644 index 00000000000..6026658867c --- /dev/null +++ b/sites/dev/docs/reference/packages/react/context/loadingstatus/readme.mdx @@ -0,0 +1,7 @@ +--- +title: LoadingStatusContext +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/context/modal/readme.mdx b/sites/dev/docs/reference/packages/react/context/modal/readme.mdx new file mode 100644 index 00000000000..be2896d79b6 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/context/modal/readme.mdx @@ -0,0 +1,7 @@ +--- +title: ModalContext +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/context/readme.mdx b/sites/dev/docs/reference/packages/react/context/readme.mdx new file mode 100644 index 00000000000..3e1d7ed9b17 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/context/readme.mdx @@ -0,0 +1,8 @@ +--- +title: React Context +--- + +The React context provided by the +[@freesewing/react](/reference/packages/react/) package are: + + diff --git a/sites/dev/docs/reference/packages/react/hooks/readme.mdx b/sites/dev/docs/reference/packages/react/hooks/readme.mdx new file mode 100644 index 00000000000..7a8273d2776 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/hooks/readme.mdx @@ -0,0 +1,8 @@ +--- +title: React Hooks +--- + +The React hooks provided by the +[@freesewing/react](/reference/packages/react/) package are: + + diff --git a/sites/dev/docs/reference/packages/react/hooks/useaccount/readme.mdx b/sites/dev/docs/reference/packages/react/hooks/useaccount/readme.mdx new file mode 100644 index 00000000000..64e08c85ce3 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/hooks/useaccount/readme.mdx @@ -0,0 +1,7 @@ +--- +title: useAccount +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/hooks/usebackend/readme.mdx b/sites/dev/docs/reference/packages/react/hooks/usebackend/readme.mdx new file mode 100644 index 00000000000..92c6bfb4a8d --- /dev/null +++ b/sites/dev/docs/reference/packages/react/hooks/usebackend/readme.mdx @@ -0,0 +1,7 @@ +--- +title: useBackend +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/hooks/usecontrol/readme.mdx b/sites/dev/docs/reference/packages/react/hooks/usecontrol/readme.mdx new file mode 100644 index 00000000000..4d7df39dbb6 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/hooks/usecontrol/readme.mdx @@ -0,0 +1,7 @@ +--- +title: useControl +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/hooks/usedesign/readme.mdx b/sites/dev/docs/reference/packages/react/hooks/usedesign/readme.mdx new file mode 100644 index 00000000000..ab54a6003f6 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/hooks/usedesign/readme.mdx @@ -0,0 +1,7 @@ +--- +title: useDesign +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/hooks/usedesigntranslation/readme.mdx b/sites/dev/docs/reference/packages/react/hooks/usedesigntranslation/readme.mdx new file mode 100644 index 00000000000..946dec33538 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/hooks/usedesigntranslation/readme.mdx @@ -0,0 +1,7 @@ +--- +title: useDesignTranslation +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/hooks/useselection/readme.mdx b/sites/dev/docs/reference/packages/react/hooks/useselection/readme.mdx new file mode 100644 index 00000000000..ffbf1a3fa19 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/hooks/useselection/readme.mdx @@ -0,0 +1,7 @@ +--- +title: useSelection +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/hooks/usestateobject/readme.mdx b/sites/dev/docs/reference/packages/react/hooks/usestateobject/readme.mdx new file mode 100644 index 00000000000..c6e96bb463b --- /dev/null +++ b/sites/dev/docs/reference/packages/react/hooks/usestateobject/readme.mdx @@ -0,0 +1,7 @@ +--- +title: useStateObject +--- + +:::note +This page is yet to be created +::: diff --git a/sites/dev/docs/reference/packages/react/lib/readme.mdx b/sites/dev/docs/reference/packages/react/lib/readme.mdx new file mode 100644 index 00000000000..f05696b1510 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/lib/readme.mdx @@ -0,0 +1,8 @@ +--- +title: React Library +--- + +The utility methods provided by the +[@freesewing/react](/reference/packages/react/) package are: + + diff --git a/sites/dev/docs/reference/packages/react/readme.mdx b/sites/dev/docs/reference/packages/react/readme.mdx new file mode 100644 index 00000000000..f95949ee1b1 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/readme.mdx @@ -0,0 +1,38 @@ +--- +title: '@freesewing/react' +--- + +FreeSewing's **react** package bundles React components, hooks, and context +used to build the FreeSewing frontends. + +It is published on NPM as [@freesewing/react +](https://www.npmjs.com/package/@freesewing/react).\ +The source code for this package is available in [our monorepo on Codeberg +](https://codeberg.org/freesewing/freesewing) under [packages/react +](https://codeberg.org/freesewing/freesewing/src/branch/develop/packages/react). + +:::warning INTERNAL TO FREESEWING +This package is considered internal to FreeSewing.\ +You are free to use this package, but FreeSewing does not guarantee semantic versioning +on this package. + +In other words, FreeSewing may introduce breaking changes in minor or even +patch updates of this package. +::: + +:::note +This package does not provide a default export. +::: + +## Installation + +```sh +npm install --save @freesewing/react +``` + +## Named Exports + +As this is a rather large package, documentation of the things it provides are +split up over various sections: + + diff --git a/sites/dev/docs/reference/packages/rehype-highlight-lines/readme.mdx b/sites/dev/docs/reference/packages/rehype-highlight-lines/readme.mdx deleted file mode 100644 index ab16186793e..00000000000 --- a/sites/dev/docs/reference/packages/rehype-highlight-lines/readme.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: rehype-highlight-lines ---- - -Published as [@freesewing/rehype-highlight-lines][1], this package provides -a [Rehype](https://github.com/rehypejs/rehype) -plugin to format highlighted and struck-out lines in code blocks. - -## Installation - -```sh -npm install @freesewing/rehype-highlight-lines -``` - -## Usage - -In NodeJS: -```js -import rehypeHighlightLines from @freesewing/rehype-highlight-lines - -... - rehypePlugins: [ - [ - rehypeHighlightLines, - { - highlightClass: ['highlight-lines', 'border-l-4'], - strikeoutClass: [ - 'strikeout-lines', - 'bg-orange-300', - 'bg-opacity-5', - 'border-l-4', - 'opacity-80', - 'line-through', - 'decoration-orange-500', - ], - }, - ], - ], -``` - -### Example - -```js -// These 3 lines will be highlighted: -// highlight-start -const a = 1 -const b = 2 -const c = 3 -// highlight-end -const d = 4 -// These 2 lines will be struck out: -// strikeout-start -const e = 5 -const f = 6 -// strikeout-end -``` - -## Configuration - -| Property | Type | Default | Description | -|----------|------|---------|-------| -| commentTag | String | 'span' | Tag that identifies a comment. | -| commentClass | String | 'hljs-comment' | CSS class that identifies a comment.| -| openingCommentHighlight | String | 'highlight-start' | Comment text to start formatting lines as highlighted. | -| closingCommentHighlight | String | 'highlight-end' | Comment text to stop formatting lines as highlighted. | -| openingCommentStrikeout | String | 'strikeout-start' | Comment text to start formatting lines as struck-out. | -| closingCommentStrikeout | String | 'strikeout-end' | Comment text to stop formatting lines as struck-out. | -| highlightTag | String | 'section' | Tag to apply to the block of highlighted or struck-out lines. | -| highlightClass | Array|String | 'highlight-lines' | CSS classes to apply to highlighted lines. | -| strikeoutClass | Array|String | 'strikeout-lines' | CSS classes to apply to struck-out lines. | -| swallow | Boolean | `true` | Remove extra linebreaks before the start of highlighted/struck-out lines. | - - -[1]: https://www.npmjs.com/package/@freesewing/rehype-highlight-lines diff --git a/sites/dev/docs/reference/packages/rehype-jargon/readme.mdx b/sites/dev/docs/reference/packages/rehype-jargon/readme.mdx deleted file mode 100644 index 0cd375a503a..00000000000 --- a/sites/dev/docs/reference/packages/rehype-jargon/readme.mdx +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: rehype-jargon ---- - -Published as [@freesewing/rehype-jargon][1], this package provides -a [Rehype](https://github.com/rehypejs/rehype) -plugin for adding HTML markup for jargon terms. -It allows you to use jargon in your markdown/mdx/html content and use -a centrally managed file of jargon terms and their definitions. - -## Installation - -```sh -npm install @freesewing/rehype-jargon -``` - -## Usage - -In file `jargon.mjs`: -```js -export const jargon = { - term: 'term has this description', - term2: 'A differenti description', -} -``` - -In NodeJS: -```js -import rehypeJargon from @freesewing/rehype-jargon -import { jargon } from './jargon.mjs' - -... - rehypePlugins: [ - [rehypeJargon, { jargon: jargon }], - ], -``` - -### Example - -Here is an example of _jargon_ in markdown. - - -## Configuration - -| Property | Type | Default | Description | -|----------|------|---------|-------| -| jargon | Object | | Key/Value pairs where the key is a jargon term and the value is the jargon description. The description is a string that can contain HTML tags. Required. | -| transform | Function | (see below) | Given the jargon term and description, returns a string with the final HTML to output. | - -### Default transform function - -The default `transform` function is: -```js -(term, html) => - `${term}${html}` -``` - -The default `transform` function applies these CSS classes: -- `jargon-term` is applied to jargon terms -- `jargon-info` is applied to jargon descriptions - -You can style your jargon by adding styles to these CSS classes. - -## Notes - -- Markup will be added to jargon only if the terms are _emphasized_. - -- Keys should be in all lowercase characters in the jargon file. -This is because terms are converted to lowercase before they are matched -against the jargon file. - -- How terms are capitalized does not matter, for the same reason. - -- If you use HTML in your jargon descriptions, use only inline elements such as adding bold/italic formatting and inserting links. - -[1]: https://www.npmjs.com/package/@freesewing/rehype-jargon diff --git a/sites/dev/docs/reference/packages/snapseries/readme.mdx b/sites/dev/docs/reference/packages/snapseries/readme.mdx index d969b39b808..2b65b970054 100644 --- a/sites/dev/docs/reference/packages/snapseries/readme.mdx +++ b/sites/dev/docs/reference/packages/snapseries/readme.mdx @@ -1,15 +1,33 @@ --- -title: snapseries +title: '@freesewing/snapseries' --- -Published as [@freesewing/snapseries][1], this package provides series -of common sizes for elastics and zippers and series of common intervals -to be used with snapped percentage options. +import * as all from '@freesewing/snapseries' -## Exports +FreeSewing's **snapseries** package provides data for FreeSewing's [snapped +percentage options](reference/api/part/config/options/pct/snap/). + +It is published on NPM as [@freesewing/snapseries +](https://www.npmjs.com/package/@freesewing/snapseries).\ +The source code for this package is available in [our monorepo on Codeberg +](https://codeberg.org/freesewing/freesewing) under [packages/snapseries +](https://codeberg.org/freesewing/freesewing/src/branch/develop/packages/snapseries). + +:::note +This package does not provide a default export. +::: + +## Installation + +```sh +npm install --save @freesewing/snapseries +``` + +## Notes All exports are plain objects with `metric` and `imperial` properties that can be used as the `snap` property for snapped percentage options. +All measurements are in mm. Some exports have `metric` and `imperial` properties that are arrays of numbers. @@ -26,36 +44,54 @@ These exports and properties are: - `steps`: Intervals of 5 mm or 1/8 inch - `bigSteps`: Intervals of 10 mm or 1/2 inch -## Installation +## Named Exports -```sh -npm install @freesewing/snapseries -``` +### bigSteps -## Example +Holds configuration for snapped percentage options in big steps, which is 1cm or 1/2 inch. -In NodeJS: ```js -import { elastics } from @freesewing/snapseries - -myOption: { - pct: 10, - min: 5 - max: 35, - snap: elasitcs, -} +import { bigSteps } from '@freesewing/snapseries' ``` -## Units + -All measurements are in mm. +### elastics -:::note RELATED +Holds configuration for snapped percentage options for commons sizes of elastic widths. -Please see -[Snapped percentage options](/reference/api/part/config/options/pct/snap) -to learn more about how snapped percentage options are used. +```js +import { elastics } from '@freesewing/snapseries' +``` -::: + -[1]: https://www.npmjs.com/package/@freesewing/snapseries +### smallSteps + +Holds configuration for snapped percentage options in small steps, which is 5mm or 1/8 inch. + +```js +import { smallSteps } from '@freesewing/snapseries' +``` + + + +### steps + +Holds configuration for snapped percentage options in default steps, which is 1cm or 1/2 inch. + +```js +import { bigSteps } from '@freesewing/snapseries' +``` + + + +### zippers + +Holds configuration for snapped percentage options for commons sizes of zipper widths. + +```js +import { zippers } from '@freesewing/snapseries' +``` + + diff --git a/sites/dev/docs/reference/packages/studio/readme.mdx b/sites/dev/docs/reference/packages/studio/readme.mdx new file mode 100644 index 00000000000..de875aa6dfb --- /dev/null +++ b/sites/dev/docs/reference/packages/studio/readme.mdx @@ -0,0 +1,40 @@ +--- +title: '@freesewing/studio' +--- + +FreeSewing's **studio** package provides FreeSewing's stand-alone +development environment. + +It is published on NPM as [@freesewing/studio +](https://www.npmjs.com/package/@freesewing/studio).\ +The source code for this package is available in [our monorepo on Codeberg +](https://codeberg.org/freesewing/freesewing) under [packages/studio +](https://codeberg.org/freesewing/freesewing/src/branch/develop/packages/studio). + +:::note +This is a cli/executable package that should be called through `npx`. +::: + +## Usage + +Run the following command to setup FreeSewing's stand-alone development +environment: + +```sh +npx @freesewing/studio +``` + +The package will run an interactive script and install a standalone +development environment which can be used to develop and test a new +FreeSewing design and to generate patterns from that design. + +:::tip + +Please see our +[Getting Started tutorial](/tutorials/getting-started-linux/dev-setup#stand-alone-development) +for more information about how to set up and start the standalone +development environment. + +::: + +[1]: https://www.npmjs.com/package/@freesewing/new-design diff --git a/sites/dev/docs/reference/packages/utils/readme.mdx b/sites/dev/docs/reference/packages/utils/readme.mdx new file mode 100644 index 00000000000..ccb56caca52 --- /dev/null +++ b/sites/dev/docs/reference/packages/utils/readme.mdx @@ -0,0 +1,103 @@ +--- +title: '@freesewing/utils' +--- + +FreeSewing's **utils** package provides various utility methods. + +It is published on NPM as [@freesewing/utils +](https://www.npmjs.com/package/@freesewing/utils).\ +The source code for this package is available in [our monorepo on Codeberg +](https://codeberg.org/freesewing/freesewing) under [packages/utils +](https://codeberg.org/freesewing/freesewing/src/branch/develop/packages/utils). + +:::note +This package does not provide a default export. +::: + +## Installation + +```sh +npm install --save @freesewing/utils +``` + +## Named Exports + +### capitalize + +### clone + +### cloudflareImageUrl + +### copyToClipboard + +### designOptionType + +### distanceAsMm + +### formatFraction128 + +### formatImperial + +### formatMm + +### formatNumber + +### formatPercentage + +### fractionToDecimal + +### get + +### getSearchParam + +### hasRequiredMeasurements + +### horFlexClasses + +### horFlexClassesNoSm + +### linkClasses + +### measurementAsMm + +### measurementAsUnits + +### mutateObject + +### navigate + +### notEmpty + +### optionsMenuStructure + +### optionType + +### orderBy + +### pathLength + +### patternUrlFromState + +### randomLoadingMessage + +### round + +### roundDistance + +### set + +### shortDate + +### shortUuid + +### structureMeasurementsAsDesign + +### timeAgo + +### unset + +### userAvatarUrl + +### validateEmail + +### validateTld diff --git a/sites/dev/src/components/doc-list.js b/sites/dev/src/components/doc-list.js index 841548f6a49..5589ae54f65 100644 --- a/sites/dev/src/components/doc-list.js +++ b/sites/dev/src/components/doc-list.js @@ -1,5 +1,5 @@ import React from 'react' -import Link from '@docusaurus/Link'; +import Link from '@docusaurus/Link' const DocList = ({ items }) => { const links = [] @@ -13,7 +13,7 @@ const DocList = ({ items }) => { } } - return
    {links}
+ return
    {links}
} export default DocList diff --git a/sites/dev/src/theme/MDXComponents/index.js b/sites/dev/src/theme/MDXComponents/index.js index 9ba2c3f9cd3..e5aae7270fc 100644 --- a/sites/dev/src/theme/MDXComponents/index.js +++ b/sites/dev/src/theme/MDXComponents/index.js @@ -1,21 +1,71 @@ // Ejected Docusaurus components -import React from 'react'; -import Head from '@docusaurus/Head'; -import MDXCode from '@theme/MDXComponents/Code'; -import MDXA from '@theme/MDXComponents/A'; -import MDXPre from '@theme/MDXComponents/Pre'; -import MDXDetails from '@theme/MDXComponents/Details'; -import MDXHeading from '@theme/MDXComponents/Heading'; -import MDXLi from '@theme/MDXComponents/Li'; -import MDXImg from '@theme/MDXComponents/Img'; -import Admonition from '@theme/Admonition'; -import Mermaid from '@theme/Mermaid'; +import React from 'react' +import Head from '@docusaurus/Head' +import MDXCode from '@theme/MDXComponents/Code' +import MDXA from '@theme/MDXComponents/A' +import MDXPre from '@theme/MDXComponents/Pre' +import MDXDetails from '@theme/MDXComponents/Details' +import MDXHeading from '@theme/MDXComponents/Heading' +import MDXLi from '@theme/MDXComponents/Li' +import MDXImg from '@theme/MDXComponents/Img' +import Admonition from '@theme/Admonition' +import Mermaid from '@theme/Mermaid' // Other Docusaurus components -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; +import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' // Custom FreeSewing components import { Example } from './example.mjs' import { ReadMore } from './readmore.js' +// Components +import { SearchIcon } from '@freesewing/react/components/Icon' + +export const PropsTable = ({ props, params = false, returns = false }) => ( + + + + + + + + + + + {Object.entries(props).map(([name, obj]) => ( + + ))} + + {returns ? ( + <> + + + + + + + + + + + + + + ) : null} +
{params ? 'Parameter' : 'Prop'}TypeDefaultDescription
Return TypeDescription
{returns.type}{returns.desc}
+) +export const ParamsTable = ({ params, returns }) => ( + +) + +export const PropRow = ({ name, type, dflt, desc }) => ( + + {name} + {type} + + {dflt} + + {desc} + +) const MDXComponents = { // Ejected Docusaurus components @@ -37,12 +87,24 @@ const MDXComponents = { mermaid: Mermaid, Tabs, TabItem, + PropsTable, + ParamsTable, // Custom FreeSewing components Example, ReadMore, + ConsoleButton: ({ data }) => ( + + ), // Prose styles ul: (props) =>
    {props.children}
, - ol: (props) =>
    {props.children}
, + ol: (props) => ( +
    {props.children}
+ ), } export default MDXComponents