diff --git a/sites/shared/components/mdx/example/TextOnPath/index.js b/sites/shared/components/mdx/example/TextOnPath/index.js index 9172b844e00..be160e0f13b 100644 --- a/sites/shared/components/mdx/example/TextOnPath/index.js +++ b/sites/shared/components/mdx/example/TextOnPath/index.js @@ -3,7 +3,6 @@ import { useTranslation } from 'next-i18next' const TextOnPath = (props) => { const { t } = useTranslation(['plugin']) - const text = [] // Handle translation let translated = '' for (let string of props.path.attributes.getAsArray('data-text')) { diff --git a/sites/shared/components/mdx/prev-next.js b/sites/shared/components/mdx/prev-next.js index 55f582f0086..dc49d95b58c 100644 --- a/sites/shared/components/mdx/prev-next.js +++ b/sites/shared/components/mdx/prev-next.js @@ -76,7 +76,7 @@ const renderPrevious = node => node ? (
- + {node.__linktitle}
@@ -85,7 +85,7 @@ const renderPrevious = node => node const renderNext = node => node ? (
- + {node.__linktitle} diff --git a/sites/shared/components/modal.js b/sites/shared/components/modal.js index 58fff8eb661..2e0850deec5 100644 --- a/sites/shared/components/modal.js +++ b/sites/shared/components/modal.js @@ -1,22 +1,16 @@ -import { useState } from 'react' - -const Modal = ({ cancel, children }) => { - - - return ( -
-
- {children} -
-
- ) -} +const Modal = ({ cancel, children }) => ( +
+
+ {children} +
+
+) export default Modal diff --git a/sites/shared/components/navigation/primary.js b/sites/shared/components/navigation/primary.js index 51cf719559b..0e99c558cc6 100644 --- a/sites/shared/components/navigation/primary.js +++ b/sites/shared/components/navigation/primary.js @@ -15,13 +15,6 @@ import ShowcaseIcon from 'shared/components/icons/camera.js' // Don't show children for blog and showcase posts const keepClosed = ['blog', 'showcase', ] -// TODO: For now we force tailwind to pickup these styles -// At some point this should 'just work' though, but let's not worry about it now -const force = [ -

, -

-] - // List of icons matched to top-level slug const icons = { accessories: (className='') => , diff --git a/sites/shared/components/popout.js b/sites/shared/components/popout.js index 1c65f40dd7f..e4b6ef5b415 100644 --- a/sites/shared/components/popout.js +++ b/sites/shared/components/popout.js @@ -12,21 +12,6 @@ const colors = { none: '', } -let forceTailwind =

-forceTailwind +=

-forceTailwind +=

-forceTailwind +=

-forceTailwind +=

-forceTailwind +=

-forceTailwind +=

-forceTailwind +=

-forceTailwind +=

-forceTailwind +=

-forceTailwind +=

-forceTailwind +=

-forceTailwind +=

-forceTailwind +=

- const Popout = (props) => { const [hide, setHide] = useState(false) @@ -73,7 +58,7 @@ const Popout = (props) => { {type === 'comment' && <> by {props.by}}

- {props?.hideable && ( + {props.hideable && ( - ) : ( - - )} +const partInfo = (props) => ( +
+
Part info
+ + + + Name + {props.partName} + + + Width + {round(props.part.width,2)}mm + + + Height + {round(props.part.height,2)}mm + + + Top Left + {pointCoords(props.part.topLeft)} + + + Bottom Right + {pointCoords(props.part.bottomRight)} + + + Attributes + + + +
+
+ {props.gist?.only && props.gist.only.length > 0 + ? ( + className="btn btn-primary" + onClick={() => props.unsetGist(['only'])} + >Show all parts + ) : ( - -
+ className="btn btn-primary" + onClick={() => props.updateGist(['only'], [props.partName])} + >Show only this part + )} + + +
- ) -} + +) const XrayPart = props => { const { topLeft, bottomRight } = props.part @@ -112,7 +86,7 @@ const XrayPart = props => { } export const PartInner = props => { - const { partName, part, app, gist } = props + const { partName, part, gist } = props const grid = gist.paperless ? ( { const ops = props.path.ops const from = ops[0].to const { to, cp1, cp2 } = ops[1] - const { topLeft, bottomRight, w, h, size, bbox } = pathDimensions(from, to, cp1, cp2, props.path) + const { topLeft, w, h, size, bbox } = pathDimensions(from, to, cp1, cp2, props.path) const id = `${props.partName}_${props.pathName}_${props.i}` const cpProps = { @@ -189,7 +188,6 @@ const Curve = (props) => { } const MiniPath = props => { - const ops = props.path.ops const bbox = props.path.boundary() const id = `${props.partName}_${props.pathName}_mini}` const w = bbox.bottomRight.x - bbox.topLeft.x @@ -352,7 +350,7 @@ export const Attributes = ({ list }) => list ? ( ) : null diff --git a/sites/shared/components/workbench/draft/point/index.js b/sites/shared/components/workbench/draft/point/index.js index 1c6a5a4bf80..62423d98e50 100644 --- a/sites/shared/components/workbench/draft/point/index.js +++ b/sites/shared/components/workbench/draft/point/index.js @@ -1,6 +1,6 @@ import Text from '../text' import Circle from '../circle' -import { round, formatMm } from 'shared/utils' +import { round } from 'shared/utils' import { Tr, KeyTd, ValTd, Attributes, pointCoords } from '../path/index' const RevealPoint = props => { diff --git a/sites/shared/components/workbench/draft/text-on-path/index.js b/sites/shared/components/workbench/draft/text-on-path/index.js index 7d80cbd0375..e3e4146d0de 100644 --- a/sites/shared/components/workbench/draft/text-on-path/index.js +++ b/sites/shared/components/workbench/draft/text-on-path/index.js @@ -13,7 +13,6 @@ const XrayTextOnPath = props => ( const TextOnPath = (props) => { const { t } = useTranslation(['app']) - const text = [] // Handle translation (and spaces) let translated = '' for (let string of props.path.attributes.getAsArray('data-text')) { diff --git a/sites/shared/components/workbench/export.js b/sites/shared/components/workbench/export.js index db2d83dc8cf..a6daa2de42d 100644 --- a/sites/shared/components/workbench/export.js +++ b/sites/shared/components/workbench/export.js @@ -1,7 +1,5 @@ import { useState } from 'react' import { SizeMe } from 'react-sizeme' -import { TransformWrapper, TransformComponent } from "react-zoom-pan-pinch" -import svgattrPlugin from '@freesewing/plugin-svgattr' import { useTranslation } from 'next-i18next' import fileSaver from 'file-saver' import yaml from 'js-yaml' diff --git a/sites/shared/components/workbench/menu/core-settings/core-setting-list.js b/sites/shared/components/workbench/menu/core-settings/core-setting-list.js index 7d0d78a899e..30c4b1797bf 100644 --- a/sites/shared/components/workbench/menu/core-settings/core-setting-list.js +++ b/sites/shared/components/workbench/menu/core-settings/core-setting-list.js @@ -4,7 +4,7 @@ import { useTranslation } from 'next-i18next' const CoreSettingList = props => { const { t } = useTranslation(['settings']) - const { dflt, list } = props + const { dflt } = props const val = props.gist?.[props.setting] const [value, setValue] = useState(val) diff --git a/sites/shared/components/workbench/menu/core-settings/core-setting-nr.js b/sites/shared/components/workbench/menu/core-settings/core-setting-nr.js index 9fa8c83ce64..8524a0726fe 100644 --- a/sites/shared/components/workbench/menu/core-settings/core-setting-nr.js +++ b/sites/shared/components/workbench/menu/core-settings/core-setting-nr.js @@ -1,6 +1,5 @@ import { useState } from 'react' import ClearIcon from 'shared/components/icons/clear.js' -import EditIcon from 'shared/components/icons/edit.js' import { useTranslation } from 'next-i18next' const CoreSettingNr = props => { diff --git a/sites/shared/components/workbench/menu/core-settings/index.js b/sites/shared/components/workbench/menu/core-settings/index.js index 10a4f61ebc6..9da59f7d9b9 100644 --- a/sites/shared/components/workbench/menu/core-settings/index.js +++ b/sites/shared/components/workbench/menu/core-settings/index.js @@ -1,5 +1,5 @@ import SettingsIcon from 'shared/components/icons/settings.js' -import { linkClasses, Chevron } from 'shared/components/navigation/primary.js' +import { Chevron } from 'shared/components/navigation/primary.js' import Setting from './setting.js' import { Ul, Details, TopSummary, TopSumTitle } from '../index.js' import { useTranslation } from 'next-i18next' diff --git a/sites/shared/components/workbench/menu/core-settings/setting.js b/sites/shared/components/workbench/menu/core-settings/setting.js index d60a61c30fd..e8c00e1b496 100644 --- a/sites/shared/components/workbench/menu/core-settings/setting.js +++ b/sites/shared/components/workbench/menu/core-settings/setting.js @@ -1,5 +1,4 @@ import { Chevron } from 'shared/components/navigation/primary' -import PctDegOption from 'shared/components/workbench/inputs/design-option-pct-deg' import ListSetting from './core-setting-list' import OnlySetting from './core-setting-only' import MmSetting from './core-setting-mm' diff --git a/sites/shared/components/workbench/menu/design-options/option.js b/sites/shared/components/workbench/menu/design-options/option.js index 127db7e01ee..6e299532f03 100644 --- a/sites/shared/components/workbench/menu/design-options/option.js +++ b/sites/shared/components/workbench/menu/design-options/option.js @@ -1,6 +1,6 @@ import { Chevron } from 'shared/components/navigation/primary' import { optionType } from 'shared/utils' -import { Li, Ul, Details, Summary, SumButton, SumDiv, Deg } from 'shared/components/workbench/menu' +import { Li, Details, Summary, SumButton, SumDiv, Deg } from 'shared/components/workbench/menu' import { useTranslation } from 'next-i18next' import {values} from 'shared/components/workbench/menu/design-options/option-value' import {inputs} from 'shared/components/workbench/menu/design-options/option-input' diff --git a/sites/shared/components/workbench/menu/index.js b/sites/shared/components/workbench/menu/index.js index 0dfb2fb4fc0..5a9a4d91b53 100644 --- a/sites/shared/components/workbench/menu/index.js +++ b/sites/shared/components/workbench/menu/index.js @@ -1,4 +1,4 @@ -import { linkClasses, Chevron } from 'shared/components/navigation/primary.js' +import { linkClasses } from 'shared/components/navigation/primary.js' import ViewMenu from './view.js' import DesignOptions from './design-options' import CoreSettings from './core-settings' diff --git a/sites/shared/components/workbench/menu/xray/attributes.js b/sites/shared/components/workbench/menu/xray/attributes.js index 9503491e631..01d0e272196 100644 --- a/sites/shared/components/workbench/menu/xray/attributes.js +++ b/sites/shared/components/workbench/menu/xray/attributes.js @@ -1,6 +1,5 @@ import { Chevron } from 'shared/components/navigation/primary' import { Ul, Li, Details, Summary, SumDiv, NoSumDiv, Deg } from 'shared/components/workbench/menu' -import { round } from 'shared/utils' const XrayAttributes = ({ attr=false, t }) => { if (!attr || !attr.list || Object.keys(attr.list).length < 1) return null diff --git a/sites/shared/components/workbench/menu/xray/path-ops.js b/sites/shared/components/workbench/menu/xray/path-ops.js index 1710e3b01f4..1498decd982 100644 --- a/sites/shared/components/workbench/menu/xray/path-ops.js +++ b/sites/shared/components/workbench/menu/xray/path-ops.js @@ -1,6 +1,5 @@ import { Chevron } from 'shared/components/navigation/primary' import { Ul, Li, Details, Summary, SumDiv, NoSumDiv, Deg } from 'shared/components/workbench/menu' -import { round } from 'shared/utils' import Point from './point' const MoveLine = ({ op }) => @@ -18,9 +17,6 @@ const Curve = ({ op }) => ['cp1', 'cp2', 'to'].map(pnt => ( )) -const Close = () => ( -

Close

-) const XrayPathOp = ({ op }) => (
  • diff --git a/sites/shared/components/workbench/menu/xray/path.js b/sites/shared/components/workbench/menu/xray/path.js index dae5bddbce5..25c3720d9c8 100644 --- a/sites/shared/components/workbench/menu/xray/path.js +++ b/sites/shared/components/workbench/menu/xray/path.js @@ -1,4 +1,4 @@ -import { Ul, Li, Details, Summary, NoSumDiv, Deg } from 'shared/components/workbench/menu' +import { Ul, Li, Summary, NoSumDiv, Deg } from 'shared/components/workbench/menu' import { formatMm } from 'shared/utils' import Attributes from './attributes' import Ops from './path-ops' diff --git a/sites/shared/components/workbench/menu/xray/point.js b/sites/shared/components/workbench/menu/xray/point.js index 19c35bd2432..156e5ddc621 100644 --- a/sites/shared/components/workbench/menu/xray/point.js +++ b/sites/shared/components/workbench/menu/xray/point.js @@ -1,4 +1,4 @@ -import { Ul, Li, Details, Summary, NoSumDiv, Deg } from 'shared/components/workbench/menu' +import { Ul, Li, NoSumDiv, Deg } from 'shared/components/workbench/menu' import { round } from 'shared/utils' import Attributes from './attributes' diff --git a/sites/shared/components/workbench/sample.js b/sites/shared/components/workbench/sample.js index 61e73d8cb60..1e96a27b485 100644 --- a/sites/shared/components/workbench/sample.js +++ b/sites/shared/components/workbench/sample.js @@ -1,5 +1,3 @@ -import { SizeMe } from 'react-sizeme' -import { TransformWrapper, TransformComponent } from "react-zoom-pan-pinch" import svgattrPlugin from '@freesewing/plugin-svgattr' import { useTranslation } from 'next-i18next' diff --git a/sites/shared/components/wrappers/mdx.js b/sites/shared/components/wrappers/mdx.js index 3927f91bd4e..91432957e4d 100644 --- a/sites/shared/components/wrappers/mdx.js +++ b/sites/shared/components/wrappers/mdx.js @@ -3,7 +3,7 @@ * method (see shared/mdx/loader.js) * It is NOT for wrapping plain markdown/mdx */ -import { useState, useEffect, Fragment } from 'react' +import { useState, useEffect } from 'react' // See: https://mdxjs.com/guides/mdx-on-demand/ import { run } from '@mdx-js/mdx' diff --git a/sites/shared/config/next.mjs b/sites/shared/config/next.mjs index 722b08458a5..f9d53ae5c9e 100644 --- a/sites/shared/config/next.mjs +++ b/sites/shared/config/next.mjs @@ -1,13 +1,7 @@ import path from 'path' import { readdirSync } from 'fs' import remarkGfm from 'remark-gfm' -import { designs, plugins, packages } from '../../../config/software/index.mjs' - -const getDirectories = source => - readdirSync(source, { withFileTypes: true }) - .filter(dirent => dirent.isDirectory()) - .map(dirent => dirent.name) -const pkgs = getDirectories(path.resolve(`../`)) +import { designs, plugins } from '../../../config/software/index.mjs' /* * This mehthod will return the NextJS configuration diff --git a/sites/shared/prebuild/lab.mjs b/sites/shared/prebuild/lab.mjs index 3f54f243353..e55a803d485 100644 --- a/sites/shared/prebuild/lab.mjs +++ b/sites/shared/prebuild/lab.mjs @@ -87,7 +87,6 @@ export async function getStaticProps({ locale }) { * Main method that does what needs doing */ -const l = 'prebuild' export const prebuildLab = async (site) => { const promises = [] const availableVersions = {} @@ -96,10 +95,6 @@ export const prebuildLab = async (site) => { path.resolve('..', 'lab', 'versions.json'), 'utf-8' )) - const plugins = JSON.parse(await fs.readFile( - path.resolve('..', 'lab', 'plugins.json'), - 'utf-8' - )) for (const section in designsByType) { // Iterate over sections console.log(`Generating pages for ${section} designs`) @@ -133,7 +128,7 @@ export const prebuildLab = async (site) => { const file = path.resolve('..', 'lab', 'lib', version, `${design}.mjs`) let cached try { - const result = await fs.access(file) + await fs.access(file) cached = true } catch(err) { diff --git a/sites/shared/prebuild/strapi.mjs b/sites/shared/prebuild/strapi.mjs index dbda4a725b2..69855e85b0e 100644 --- a/sites/shared/prebuild/strapi.mjs +++ b/sites/shared/prebuild/strapi.mjs @@ -70,11 +70,6 @@ export const prebuildStrapi = async (site) => { const types = ['blog'] if (site === 'org') types.push('showcase') - // Languages - const languages = (site === 'dev') - ? [ 'en' ] - : ['en', 'es', 'de', 'fr', 'nl'] - const posts = {} const authors = {} diff --git a/sites/shared/themes/lgbtq.js b/sites/shared/themes/lgbtq.js index 1025f343b66..fda2071b031 100644 --- a/sites/shared/themes/lgbtq.js +++ b/sites/shared/themes/lgbtq.js @@ -1,5 +1,4 @@ const colors = require('tailwindcss/colors') -const light = require('./light') module.exports = { 'fontFamily': '-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif', diff --git a/sites/shared/utils.mjs b/sites/shared/utils.mjs index 9a462f01f79..22a4065eaa9 100644 --- a/sites/shared/utils.mjs +++ b/sites/shared/utils.mjs @@ -82,7 +82,7 @@ export const capitalize = string => string.charAt(0).toUpperCase() + string.slic export const strapiImage = (img, sizes=['thumbnail', 'xlarge', 'large', 'medium', 'small', 'xsmall']) => { const image = { - caption: img?.caption || '', + caption: img.caption || '', w: img.width, h: img.height, url: img.url,