fix little errors in draft-for-curated-set flow. other cleanup
This commit is contained in:
parent
5f0b7fd9a7
commit
24b3b10bfb
11 changed files with 45 additions and 38 deletions
|
@ -48,7 +48,7 @@ carlton:
|
||||||
'@freesewing/plugin-bust': *freesewing
|
'@freesewing/plugin-bust': *freesewing
|
||||||
charlie:
|
charlie:
|
||||||
peer:
|
peer:
|
||||||
'@freesewing/plugin-bartack': *freesewing
|
'@freesewing/plugin-annotations': *freesewing
|
||||||
'@freesewing/plugin-mirror': *freesewing
|
'@freesewing/plugin-mirror': *freesewing
|
||||||
'@freesewing/titan': *freesewing
|
'@freesewing/titan': *freesewing
|
||||||
'@freesewing/snapseries': *freesewing
|
'@freesewing/snapseries': *freesewing
|
||||||
|
@ -92,8 +92,6 @@ i18n:
|
||||||
dev:
|
dev:
|
||||||
'js-yaml': &jsyaml '4.1.0'
|
'js-yaml': &jsyaml '4.1.0'
|
||||||
'recursive-readdir': '^2.2.3'
|
'recursive-readdir': '^2.2.3'
|
||||||
peer:
|
|
||||||
'@freesewing/pattern-info': *freesewing
|
|
||||||
jaeger:
|
jaeger:
|
||||||
peer:
|
peer:
|
||||||
'@freesewing/brian': *freesewing
|
'@freesewing/brian': *freesewing
|
||||||
|
@ -135,7 +133,6 @@ plugintest:
|
||||||
'@freesewing/plugin-sprinkle': *freesewing
|
'@freesewing/plugin-sprinkle': *freesewing
|
||||||
'@freesewing/plugin-svgattr': *freesewing
|
'@freesewing/plugin-svgattr': *freesewing
|
||||||
'@freesewing/plugin-theme': *freesewing
|
'@freesewing/plugin-theme': *freesewing
|
||||||
'@freesewing/plugin-validate': *freesewing
|
|
||||||
rehype-jargon:
|
rehype-jargon:
|
||||||
_:
|
_:
|
||||||
'unist-util-visit': &unist-util-visit '4.1.2'
|
'unist-util-visit': &unist-util-visit '4.1.2'
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@freesewing/core": "3.0.0-alpha.10",
|
"@freesewing/core": "3.0.0-alpha.10",
|
||||||
"@freesewing/plugin-bundle": "3.0.0-alpha.10",
|
"@freesewing/plugin-bundle": "3.0.0-alpha.10",
|
||||||
"@freesewing/plugin-bartack": "3.0.0-alpha.10",
|
"@freesewing/plugin-annotations": "3.0.0-alpha.10",
|
||||||
"@freesewing/plugin-mirror": "3.0.0-alpha.10",
|
"@freesewing/plugin-mirror": "3.0.0-alpha.10",
|
||||||
"@freesewing/titan": "3.0.0-alpha.10",
|
"@freesewing/titan": "3.0.0-alpha.10",
|
||||||
"@freesewing/snapseries": "3.0.0-alpha.10"
|
"@freesewing/snapseries": "3.0.0-alpha.10"
|
||||||
|
|
|
@ -58,8 +58,7 @@
|
||||||
"@freesewing/plugin-round": "3.0.0-alpha.10",
|
"@freesewing/plugin-round": "3.0.0-alpha.10",
|
||||||
"@freesewing/plugin-sprinkle": "3.0.0-alpha.10",
|
"@freesewing/plugin-sprinkle": "3.0.0-alpha.10",
|
||||||
"@freesewing/plugin-svgattr": "3.0.0-alpha.10",
|
"@freesewing/plugin-svgattr": "3.0.0-alpha.10",
|
||||||
"@freesewing/plugin-theme": "3.0.0-alpha.10",
|
"@freesewing/plugin-theme": "3.0.0-alpha.10"
|
||||||
"@freesewing/plugin-validate": "3.0.0-alpha.10"
|
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -43,9 +43,7 @@
|
||||||
"wbuild": "node build.mjs",
|
"wbuild": "node build.mjs",
|
||||||
"wcibuild_step7": "node build.mjs"
|
"wcibuild_step7": "node build.mjs"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {},
|
||||||
"@freesewing/pattern-info": "3.0.0-alpha.10"
|
|
||||||
},
|
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"js-yaml": "4.1.0",
|
"js-yaml": "4.1.0",
|
||||||
|
|
|
@ -8,29 +8,29 @@ export const ns = ['design', 'designs', 'tags']
|
||||||
|
|
||||||
export const Design = ({ name }) => {
|
export const Design = ({ name }) => {
|
||||||
const { t } = useTranslation(ns)
|
const { t } = useTranslation(ns)
|
||||||
console.log(name)
|
|
||||||
return (
|
return (
|
||||||
<Link
|
<div
|
||||||
href={`/new/pattern/${name}`}
|
|
||||||
className={`flex flex-col flex-nowrap items-start justify-start gap-2 pt-2 pb-4 h-auto w-96
|
className={`flex flex-col flex-nowrap items-start justify-start gap-2 pt-2 pb-4 h-auto w-96
|
||||||
btn btn-secondary btn-ghost border border-secondary
|
btn btn-secondary btn-ghost border border-secondary
|
||||||
hover:bg-opacity-20 hover:bg-secondary hover:border hover:border-secondary`}
|
hover:bg-opacity-20 hover:bg-secondary hover:border hover:border-secondary`}
|
||||||
>
|
>
|
||||||
|
<Link href={`/new/pattern/${name}`} className="static w-full h-full">
|
||||||
<h5 className="flex flex-row items-center justify-between w-full">
|
<h5 className="flex flex-row items-center justify-between w-full">
|
||||||
<span>{t(`designs:${name}.t`)}</span>
|
<span>{t(`designs:${name}.t`)}</span>
|
||||||
<div className="flex flex-col items-end">
|
<span className="flex flex-col items-end">
|
||||||
<span className="text-xs font-medium opacity-70">{t('design:difficulty')}</span>
|
<span className="text-xs font-medium opacity-70">{t('design:difficulty')}</span>
|
||||||
<Difficulty score={designs[name].difficulty} />
|
<Difficulty score={designs[name].difficulty} />
|
||||||
</div>
|
</span>
|
||||||
</h5>
|
</h5>
|
||||||
<div className={`normal-case text-base font-medium text-base-content text-left grow`}>
|
<span className={`normal-case text-base font-medium text-base-content text-left grow`}>
|
||||||
{t(`designs:${name}.d`)}
|
{t(`designs:${name}.d`)}
|
||||||
</div>
|
</span>
|
||||||
<div className="flex flex-row flex-wrap gap-1">
|
</Link>
|
||||||
|
<span className="flex flex-row flex-wrap gap-1 relative z-10">
|
||||||
{designs[name].tags.map((tag) => (
|
{designs[name].tags.map((tag) => (
|
||||||
<DesignTag key={tag} tag={tag} />
|
<DesignTag key={tag} tag={tag} />
|
||||||
))}
|
))}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,9 @@ export const Sponsors = () => {
|
||||||
return Object.keys(sponsors).map((sponsor) => {
|
return Object.keys(sponsors).map((sponsor) => {
|
||||||
const Component = sponsors[sponsor]
|
const Component = sponsors[sponsor]
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col items-center gap-4">
|
<div className="flex flex-col items-center gap-4" key={sponsor}>
|
||||||
<span className="opacity-70 text-sm">{t(sponsor.toLowerCase())}</span>
|
<span className="opacity-70 text-sm">{t(sponsor.toLowerCase())}</span>
|
||||||
<a
|
<a
|
||||||
key={sponsor}
|
|
||||||
title={t(sponsor.toLowerCase())}
|
title={t(sponsor.toLowerCase())}
|
||||||
href={`https://www.${sponsor.toLowerCase()}.com/?utm_source=freesewing&utm_campaign=oss`}
|
href={`https://www.${sponsor.toLowerCase()}.com/?utm_source=freesewing&utm_campaign=oss`}
|
||||||
>
|
>
|
||||||
|
|
|
@ -69,7 +69,7 @@ export const Workbench = ({ design, Design, set = false, DynamicDocs = false })
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate the pattern here so we can pass it down to both the view and the options menu
|
// Generate the pattern here so we can pass it down to both the view and the options menu
|
||||||
const pattern = draftViews.includes(view) ? new Design(settings) : false
|
const pattern = settings.measurements && draftViews.includes(view) ? new Design(settings) : false
|
||||||
|
|
||||||
// Return early if the pattern is not initialized yet
|
// Return early if the pattern is not initialized yet
|
||||||
if (typeof pattern.getConfig !== 'function') return null
|
if (typeof pattern.getConfig !== 'function') return null
|
||||||
|
|
|
@ -107,7 +107,11 @@ export const Setting = ({
|
||||||
const openButtons = []
|
const openButtons = []
|
||||||
if (loadDocs)
|
if (loadDocs)
|
||||||
openButtons.push(
|
openButtons.push(
|
||||||
<button className="btn btn-xs btn-ghost px-0" onClick={(evt) => loadDocs(evt, name)}>
|
<button
|
||||||
|
className="btn btn-xs btn-ghost px-0"
|
||||||
|
key="help"
|
||||||
|
onClick={(evt) => loadDocs(evt, name)}
|
||||||
|
>
|
||||||
<HelpIcon className="w-4 h-4" />
|
<HelpIcon className="w-4 h-4" />
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
|
@ -115,6 +119,7 @@ export const Setting = ({
|
||||||
buttons.push(
|
buttons.push(
|
||||||
<button
|
<button
|
||||||
className="btn btn-accent"
|
className="btn btn-accent"
|
||||||
|
key="clear"
|
||||||
onClick={(evt) => {
|
onClick={(evt) => {
|
||||||
evt.stopPropagation()
|
evt.stopPropagation()
|
||||||
update.settings([name], config.dflt)
|
update.settings([name], config.dflt)
|
||||||
|
@ -126,6 +131,7 @@ export const Setting = ({
|
||||||
openButtons.push(
|
openButtons.push(
|
||||||
<button
|
<button
|
||||||
className="btn btn-ghost btn-xs px-0"
|
className="btn btn-ghost btn-xs px-0"
|
||||||
|
key="clear"
|
||||||
onClick={(evt) => {
|
onClick={(evt) => {
|
||||||
evt.stopPropagation()
|
evt.stopPropagation()
|
||||||
update.settings([name], config.dflt)
|
update.settings([name], config.dflt)
|
||||||
|
@ -194,7 +200,11 @@ export const CoreSettings = ({
|
||||||
const openButtons = []
|
const openButtons = []
|
||||||
if (loadDocs)
|
if (loadDocs)
|
||||||
openButtons.push(
|
openButtons.push(
|
||||||
<button className="btn btn-xs btn-ghost px-0 z-10" onClick={(evt) => loadDocs(evt)}>
|
<button
|
||||||
|
className="btn btn-xs btn-ghost px-0 z-10"
|
||||||
|
key="help"
|
||||||
|
onClick={(evt) => loadDocs(evt)}
|
||||||
|
>
|
||||||
<HelpIcon className="w-4 h-4" />
|
<HelpIcon className="w-4 h-4" />
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,9 +6,9 @@ import {
|
||||||
CoreSettings,
|
CoreSettings,
|
||||||
ns as coreMenuNs,
|
ns as coreMenuNs,
|
||||||
} from 'shared/components/workbench/menus/core-settings/index.mjs'
|
} from 'shared/components/workbench/menus/core-settings/index.mjs'
|
||||||
import { XrayMenu } from 'shared/components/workbench/menus/xray/index.mjs'
|
import { XrayMenu, ns as xrayNs } from 'shared/components/workbench/menus/xray/index.mjs'
|
||||||
|
|
||||||
export const ns = [...coreMenuNs, ...designMenuNs]
|
export const ns = [...coreMenuNs, ...designMenuNs, ...xrayNs]
|
||||||
|
|
||||||
export const DraftMenu = ({
|
export const DraftMenu = ({
|
||||||
design,
|
design,
|
||||||
|
|
|
@ -56,13 +56,17 @@ export const ModalWrapper = ({
|
||||||
className={`fixed top-0 left-0 m-0 p-0 shadow w-full h-screen
|
className={`fixed top-0 left-0 m-0 p-0 shadow w-full h-screen
|
||||||
transform-all duration-150 ${animation}
|
transform-all duration-150 ${animation}
|
||||||
bg-${bg} bg-opacity-${bgOpacity} z-50 hover:cursor-pointer
|
bg-${bg} bg-opacity-${bgOpacity} z-50 hover:cursor-pointer
|
||||||
flex flex-${flex} justify-${justify} overflow-auto items-${items} lg:p-12`}
|
flex flex-${flex} justify-${justify} items-${items} lg:p-12`}
|
||||||
onClick={keepOpenOnClick ? null : close}
|
onClick={keepOpenOnClick ? null : close}
|
||||||
>
|
>
|
||||||
{bare ? (
|
{bare ? (
|
||||||
children
|
children
|
||||||
) : (
|
) : (
|
||||||
<div className={`bg-base-100 p-4 lg:px-8 lg:rounded-lg lg:shadow-lg`}>{children}</div>
|
<div
|
||||||
|
className={`bg-base-100 p-4 lg:px-8 lg:rounded-lg lg:shadow-lg max-h-100 overflow-auto`}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -49,7 +49,7 @@ export const PageWrapper = (props) => {
|
||||||
*/
|
*/
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Only update if a new page was loaded
|
// Only update if a new page was loaded
|
||||||
if (path.join('/') !== 'slug') {
|
if (path.join('/') !== slug) {
|
||||||
setNavigation({
|
setNavigation({
|
||||||
title: pageTitle,
|
title: pageTitle,
|
||||||
locale,
|
locale,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue