fix lab build errors after mjs transition
This commit is contained in:
parent
6d5d13e9b5
commit
dd4aabc557
17 changed files with 42 additions and 44 deletions
|
@ -6,7 +6,7 @@ import Head from 'next/head'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { PageWrapper } from 'site/components/wrappers/page.mjs'
|
import { PageWrapper } from 'site/components/wrappers/page.mjs'
|
||||||
import { BareLayout } from 'site/components/layouts/bare.mjs'
|
import { BareLayout } from 'site/components/layouts/bare.mjs'
|
||||||
import { PageTitle } from 'shared/components/layouts/default.mjs'
|
import { PageTitle } from 'shared/components/workbench/layout/default.mjs'
|
||||||
|
|
||||||
const DesignLinks = ({ list, prefix = '' }) => {
|
const DesignLinks = ({ list, prefix = '' }) => {
|
||||||
const { t } = useTranslation(['patterns'])
|
const { t } = useTranslation(['patterns'])
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
import PageTemplate from 'site/page-templates/design-list.js'
|
import { PatternListPageTemplate } from 'site/page-templates/design-list.mjs'
|
||||||
|
|
||||||
const Page = () => <PageTemplate section="accessories" />
|
const Page = () => <PatternListPageTemplate section="accessories" />
|
||||||
|
|
||||||
export default Page
|
export default Page
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
import PageTemplate from 'site/page-templates/design-list.js'
|
import { PatternListPageTemplate } from 'site/page-templates/design-list.mjs'
|
||||||
|
|
||||||
const Page = () => <PageTemplate section="blocks" />
|
const Page = () => <PatternListPageTemplate section="blocks" />
|
||||||
|
|
||||||
export default Page
|
export default Page
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
import PageTemplate from 'site/page-templates/design-list.js'
|
import { PatternListPageTemplate } from 'site/page-templates/design-list.mjs'
|
||||||
|
|
||||||
const Page = () => <PageTemplate section="garments" />
|
const Page = () => <PatternListPageTemplate section="garments" />
|
||||||
|
|
||||||
export default Page
|
export default Page
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
import PageTemplate from 'site/page-templates/design-list.js'
|
import { PatternListPageTemplate } from 'site/page-templates/design-list.mjs'
|
||||||
|
|
||||||
const Page = () => <PageTemplate section="utilities" />
|
const Page = () => <PatternListPageTemplate section="utilities" />
|
||||||
|
|
||||||
export default Page
|
export default Page
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { ErrorView } from 'shared/components/error/view.mjs'
|
import { ErrorView } from 'shared/components/error/view.mjs'
|
||||||
|
|
||||||
export const Error = (props) => {
|
export const DraftError = (props) => {
|
||||||
const errors = {
|
const errors = {
|
||||||
pattern: 0,
|
pattern: 0,
|
||||||
sets: 0,
|
sets: 0,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { SvgWrapper } from './svg.mjs'
|
import { SvgWrapper } from './svg.mjs'
|
||||||
import { Error } from './error.mjs'
|
import { DraftError } from './error.mjs'
|
||||||
|
|
||||||
export const LabDraft = (props) => {
|
export const LabDraft = (props) => {
|
||||||
const { app, draft, gist, updateGist, unsetGist, showInfo, feedback, hasRequiredMeasurements } =
|
const { app, draft, gist, updateGist, unsetGist, showInfo, feedback, hasRequiredMeasurements } =
|
||||||
|
@ -14,7 +14,7 @@ export const LabDraft = (props) => {
|
||||||
svg = draft.render()
|
svg = draft.render()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('Failed to render design', error)
|
console.log('Failed to render design', error)
|
||||||
return <Error error={error} {...props} />
|
return <DraftError error={error} {...props} />
|
||||||
}
|
}
|
||||||
return <div dangerouslySetInnerHTML={{ __html: svg }} />
|
return <div dangerouslySetInnerHTML={{ __html: svg }} />
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ export const LabDraft = (props) => {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('Failed to get render props for design', error)
|
console.log('Failed to get render props for design', error)
|
||||||
return (
|
return (
|
||||||
<Error
|
<DraftError
|
||||||
error={error}
|
error={error}
|
||||||
patternLogs={patternProps.store.logs}
|
patternLogs={patternProps.store.logs}
|
||||||
setLogs={patternProps.setStores[0].logs}
|
setLogs={patternProps.setStores[0].logs}
|
||||||
|
@ -44,7 +44,7 @@ export const LabDraft = (props) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{errors.length > 0 ? (
|
{errors.length > 0 ? (
|
||||||
<Error
|
<DraftError
|
||||||
{...{
|
{...{
|
||||||
draft,
|
draft,
|
||||||
patternProps,
|
patternProps,
|
||||||
|
|
|
@ -104,7 +104,7 @@ const StoreLogs = ({ logs, units }) => (
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
const Logs = (props) => {
|
export const DraftLogs = (props) => {
|
||||||
return (
|
return (
|
||||||
<Tabs
|
<Tabs
|
||||||
tabs={[
|
tabs={[
|
||||||
|
@ -121,4 +121,4 @@ const Logs = (props) => {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Logs
|
export default DraftLogs
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
import { DesignOptionPctDeg } from 'shared/components/workbench/inputs/design-option-pct-deg.mjs'
|
import { DesignOptionPctDeg } from 'shared/components/workbench/inputs/design-option-pct-deg.mjs'
|
||||||
import { CountOption } from 'shared/components/workbench/inputs/design-option-count.mjs'
|
import { DesignOptionCount } from 'shared/components/workbench/inputs/design-option-count.mjs'
|
||||||
import { ListOption } from 'shared/components/workbench/inputs/design-option-list.mjs'
|
import { DesignOptionList } from 'shared/components/workbench/inputs/design-option-list.mjs'
|
||||||
import { Popout } from 'shared/components/popout.mjs'
|
import { Popout } from 'shared/components/popout.mjs'
|
||||||
|
|
||||||
export const Tmp = () => <p>not yet</p>
|
export const Tmp = () => <p>not yet</p>
|
||||||
|
|
||||||
export const inputs = {
|
export const inputs = {
|
||||||
Pct: DesignOptionPctDeg,
|
Pct: DesignOptionPctDeg,
|
||||||
Count: CountOption,
|
Count: DesignOptionCount,
|
||||||
Deg: (props) => <DesignOptionPctDeg {...props} type="deg" />,
|
Deg: (props) => <DesignOptionPctDeg {...props} type="deg" />,
|
||||||
List: ListOption,
|
List: DesignOptionList,
|
||||||
Mm: () => (
|
Mm: () => (
|
||||||
<Popout fixme compact>
|
<Popout fixme compact>
|
||||||
Mm options are deprecated. Please report this
|
Mm options are deprecated. Please report this
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { OptionsIcon } from 'shared/components/icons.mjs'
|
import { OptionsIcon } from 'shared/components/icons.mjs'
|
||||||
import { Chevron } from 'shared/components/navigation/primary.mjs'
|
import { Chevron } from 'shared/components/navigation/primary.mjs'
|
||||||
import OptionGroup from '../design-options/option-group.mjs'
|
import { OptionGroup } from '../design-options/option-group.mjs'
|
||||||
import Option from './option.mjs'
|
import { Option } from './option.mjs'
|
||||||
import { Ul, Details, TopSummary, TopSumTitle } from 'shared/components/workbench/menu/index.mjs'
|
import { Ul, Details, TopSummary, TopSumTitle } from 'shared/components/workbench/menu/index.mjs'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
import { optionsMenuStructure } from 'shared/utils.mjs'
|
import { optionsMenuStructure } from 'shared/utils.mjs'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Li, SumButton, SumDiv } from 'shared/components/workbench/menu/index.mjs'
|
import { Li, SumButton, SumDiv } from 'shared/components/workbench/menu/index.mjs'
|
||||||
|
|
||||||
const Option = (props) => {
|
export const Option = (props) => {
|
||||||
const active = props.sampleSettings?.type === 'option' && props.active === props.option
|
const active = props.sampleSettings?.type === 'option' && props.active === props.option
|
||||||
|
|
||||||
const setSampleSettings = () => {
|
const setSampleSettings = () => {
|
||||||
|
@ -32,5 +32,3 @@ const Option = (props) => {
|
||||||
</Li>
|
</Li>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Option
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import { Chevron } from 'shared/components/navigation/primary.mjs'
|
import { Chevron } from 'shared/components/navigation/primary.mjs'
|
||||||
import { ClearIcon, FilterIcon, SearchIcon } from 'shared/components/icons.mjs'
|
import { ClearIcon, FilterIcon, SearchIcon } from 'shared/components/icons.mjs'
|
||||||
import { Ul, Li, Details, Summary, SumDiv, Deg } from 'shared/components/workbench/menu/index.mjs'
|
import { Ul, Li, Details, Summary, SumDiv, Deg } from 'shared/components/workbench/menu/index.mjs'
|
||||||
import Path from './path.mjs'
|
import { XrayPath } from './path.mjs'
|
||||||
import Point from './point.mjs'
|
import { XrayPoint } from './point.mjs'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
|
|
||||||
const types = {
|
const types = {
|
||||||
paths: Path,
|
paths: XrayPath,
|
||||||
points: Point,
|
points: XrayPoint,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const XrayList = (props) => {
|
export const XrayList = (props) => {
|
||||||
|
@ -131,7 +131,7 @@ export const XrayList = (props) => {
|
||||||
<Chevron />
|
<Chevron />
|
||||||
</Summary>
|
</Summary>
|
||||||
{type === 'paths' && (
|
{type === 'paths' && (
|
||||||
<Path
|
<XrayPath
|
||||||
pathName={id}
|
pathName={id}
|
||||||
partName={props.partName}
|
partName={props.partName}
|
||||||
draft={props.draft}
|
draft={props.draft}
|
||||||
|
@ -140,7 +140,7 @@ export const XrayList = (props) => {
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{type === 'points' && (
|
{type === 'points' && (
|
||||||
<Point
|
<XrayPoint
|
||||||
pointName={id}
|
pointName={id}
|
||||||
partName={props.partName}
|
partName={props.partName}
|
||||||
draft={props.draft}
|
draft={props.draft}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { Chevron } from 'shared/components/navigation/primary'
|
import { Chevron } from 'shared/components/navigation/primary'
|
||||||
import { Ul, Li, Details, Summary, SumDiv, NoSumDiv, Deg } from 'shared/components/workbench/menu'
|
import { Ul, Li, Details, Summary, SumDiv, NoSumDiv, Deg } from 'shared/components/workbench/menu'
|
||||||
import Point from './point'
|
import { XrayPoint } from './point'
|
||||||
|
|
||||||
const MoveLine = ({ op }) => <Point point={op.to} />
|
const MoveLine = ({ op }) => <XrayPoint point={op.to} />
|
||||||
const Curve = ({ op }) =>
|
const Curve = ({ op }) =>
|
||||||
['cp1', 'cp2', 'to'].map((pnt) => (
|
['cp1', 'cp2', 'to'].map((pnt) => (
|
||||||
<Li key={pnt}>
|
<Li key={pnt}>
|
||||||
|
@ -14,7 +14,7 @@ const Curve = ({ op }) =>
|
||||||
</SumDiv>
|
</SumDiv>
|
||||||
<Chevron />
|
<Chevron />
|
||||||
</Summary>
|
</Summary>
|
||||||
<Point point={op[pnt]} />
|
<XrayPoint point={op[pnt]} />
|
||||||
</Details>
|
</Details>
|
||||||
</Li>
|
</Li>
|
||||||
))
|
))
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Ul, Li, NoSumDiv, Deg } from 'shared/components/workbench/menu/index.mjs'
|
import { Ul, Li, NoSumDiv, Deg } from 'shared/components/workbench/menu/index.mjs'
|
||||||
import { formatMm } from 'shared/utils.mjs'
|
import { formatMm } from 'shared/utils.mjs'
|
||||||
import Attributes from './attributes.mjs'
|
import { XrayAttributes } from './attributes.mjs'
|
||||||
import Ops from './path-ops.mjs'
|
import { XrayPathOps } from './path-ops.mjs'
|
||||||
|
|
||||||
export const XrayPath = ({ pathName, partName, draft, units }) => {
|
export const XrayPath = ({ pathName, partName, draft, units }) => {
|
||||||
const path = draft?.parts?.[partName]?.paths?.[pathName]
|
const path = draft?.parts?.[partName]?.paths?.[pathName]
|
||||||
|
@ -9,7 +9,7 @@ export const XrayPath = ({ pathName, partName, draft, units }) => {
|
||||||
if (!path) return null
|
if (!path) return null
|
||||||
return (
|
return (
|
||||||
<Ul>
|
<Ul>
|
||||||
<Attributes attr={path.attributes} />
|
<XrayAttributes attr={path.attributes} />
|
||||||
<Li>
|
<Li>
|
||||||
<NoSumDiv>
|
<NoSumDiv>
|
||||||
<Deg />
|
<Deg />
|
||||||
|
@ -28,7 +28,7 @@ export const XrayPath = ({ pathName, partName, draft, units }) => {
|
||||||
/>
|
/>
|
||||||
</NoSumDiv>
|
</NoSumDiv>
|
||||||
</Li>
|
</Li>
|
||||||
<Ops ops={path.ops} />
|
<XrayPathOps ops={path.ops} />
|
||||||
</Ul>
|
</Ul>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Ul, Li, NoSumDiv, Deg } from 'shared/components/workbench/menu'
|
import { Ul, Li, NoSumDiv, Deg } from 'shared/components/workbench/menu'
|
||||||
import { round } from 'shared/utils'
|
import { round } from 'shared/utils'
|
||||||
import Attributes from './attributes'
|
import { XrayAttributes } from './attributes'
|
||||||
|
|
||||||
export const XrayPoint = ({ pointName, partName, draft, t }) => {
|
export const XrayPoint = ({ pointName, partName, draft, t }) => {
|
||||||
const point = draft?.parts?.[partName]?.points?.[pointName]
|
const point = draft?.parts?.[partName]?.points?.[pointName]
|
||||||
|
@ -16,7 +16,7 @@ export const XrayPoint = ({ pointName, partName, draft, t }) => {
|
||||||
</NoSumDiv>
|
</NoSumDiv>
|
||||||
</Li>
|
</Li>
|
||||||
))}
|
))}
|
||||||
<Attributes attr={point.attributes} t={t} />
|
<XrayAttributes attr={point.attributes} t={t} />
|
||||||
</Ul>
|
</Ul>
|
||||||
) : null
|
) : null
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
import { svgattrPlugin } from '@freesewing/plugin-svgattr'
|
import { svgattrPlugin } from '@freesewing/plugin-svgattr'
|
||||||
import { SvgWrapper } from './draft/svg.mjs'
|
import { SvgWrapper } from './draft/svg.mjs'
|
||||||
import { Error } from './draft/error.mjs'
|
import { DraftError } from './draft/error.mjs'
|
||||||
|
|
||||||
export const LabSample = ({ gist, draft, updateGist, unsetGist, showInfo, app, feedback }) => {
|
export const LabSample = ({ gist, draft, updateGist, unsetGist, showInfo, app, feedback }) => {
|
||||||
const { t } = useTranslation(['workbench'])
|
const { t } = useTranslation(['workbench'])
|
||||||
|
@ -32,7 +32,7 @@ export const LabSample = ({ gist, draft, updateGist, unsetGist, showInfo, app, f
|
||||||
<>
|
<>
|
||||||
<h2>{title}</h2>
|
<h2>{title}</h2>
|
||||||
{!patternProps || errors.length > 0 ? (
|
{!patternProps || errors.length > 0 ? (
|
||||||
<Error {...{ draft, patternProps, updateGist, errors }} />
|
<DraftError {...{ draft, patternProps, updateGist, errors }} />
|
||||||
) : null}
|
) : null}
|
||||||
<SvgWrapper
|
<SvgWrapper
|
||||||
{...{ draft, patternProps, gist, updateGist, unsetGist, showInfo, app, feedback }}
|
{...{ draft, patternProps, gist, updateGist, unsetGist, showInfo, app, feedback }}
|
||||||
|
|
|
@ -17,13 +17,13 @@ import { ExportDraft } from 'shared/components/workbench/exporting/index.mjs'
|
||||||
import { GistAsJson, GistAsYaml } from 'shared/components/workbench/gist.mjs'
|
import { GistAsJson, GistAsYaml } from 'shared/components/workbench/gist.mjs'
|
||||||
import { DraftLogs } from 'shared/components/workbench/logs.mjs'
|
import { DraftLogs } from 'shared/components/workbench/logs.mjs'
|
||||||
import { CutLayout } from 'shared/components/workbench/layout/cut/index.mjs'
|
import { CutLayout } from 'shared/components/workbench/layout/cut/index.mjs'
|
||||||
import { PrintingLayout } from 'shared/components/workbench/layout/print/index.mjs'
|
import { PrintLayout } from 'shared/components/workbench/layout/print/index.mjs'
|
||||||
|
|
||||||
const views = {
|
const views = {
|
||||||
measurements: WorkbenchMeasurements,
|
measurements: WorkbenchMeasurements,
|
||||||
draft: LabDraft,
|
draft: LabDraft,
|
||||||
test: LabSample,
|
test: LabSample,
|
||||||
printingLayout: PrintingLayout,
|
printingLayout: PrintLayout,
|
||||||
cuttingLayout: CutLayout,
|
cuttingLayout: CutLayout,
|
||||||
export: ExportDraft,
|
export: ExportDraft,
|
||||||
logs: DraftLogs,
|
logs: DraftLogs,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue