1
0
Fork 0

feat [org]: Wrote Editor docs

This commit is contained in:
joostdecock 2025-06-01 17:02:46 +02:00
parent 3d01c0136c
commit 0c1d886e94
53 changed files with 1054 additions and 496 deletions

View file

@ -2,7 +2,26 @@ import React from 'react'
// Components
import { ModalWrapper } from '@freesewing/react/components/Modal'
const Iframe = (props) => <iframe {...props} style={{ height: '90vh', width: '90vh' }} />
/*
* A component to display an iframe intended for a modal window.
*
* All props are passed down to the iframe tag.
*
* @component
* @param {object} props - All component props
* @returns {JSX.Element}
*/
const Iframe = (props) => <iframe {...props} style={{ height: '90vh', width: '90vw' }} className="tw:w-full tw:mx-auto tw:max-w-4xl" />
/*
* A component to display an iframe with FreeSewing.eu docs content intended for a modal window.
*
* @component
* @param {object} props - All component props
* @param {string} props.path - The (relative) URL path of the page to load
* @returns {JSX.Element}
*/
const DocsHelp = ({ path }) => <Iframe src={`https://freesewing.eu/${path}/?docusaurus-data-fs-embed=true`} />
/*
* A component to display inline help for a design option
@ -19,7 +38,7 @@ const DesignOptionHelp = ({ design, o }) =>
design && o ? (
<Iframe
src={`https://freesewing.eu/docs/designs/${design.toLowerCase()}/options/${o.toLowerCase()}/index.html?docusaurus-data-fs-embed=true`}
title="Design Option Help"
title="Design Options Help"
/>
) : (
<p>Invalid props provided to DesignOptionHelp.</p>
@ -38,7 +57,7 @@ const DesignOptionHelp = ({ design, o }) =>
const CoreSettingHelp = ({ name }) =>
name ? (
<Iframe
src={`https://freesewing.eu/docs/about/site/draft/${name.toLowerCase()}/index.html?docusaurus-data-fs-embed=true`}
src={`https://freesewing.eu/docs/editor/menus/settings/${name.toLowerCase()}/index.html?docusaurus-data-fs-embed=true`}
title="Core Setting Help"
/>
) : (
@ -58,8 +77,8 @@ const CoreSettingHelp = ({ name }) =>
const UiPreferenceHelp = ({ name }) =>
name ? (
<Iframe
src={`https://freesewing.eu/docs/about/site/draft/${name.toLowerCase()}/index.html?docusaurus-data-fs-embed=true`}
title="UI Preference Help"
src={`https://freesewing.eu/docs/editor/menus/preferences/${name.toLowerCase()}/index.html?docusaurus-data-fs-embed=true`}
title="UI Preferences Help"
/>
) : (
<p>Invalid props provided to UiPreferenceHelp.</p>
@ -111,10 +130,17 @@ export function modalDesignOptionHelp(design, o, setModal) {
}
export function modalMeasurementHelp(m, setModal) {
console.log('in modalMeasurmentHelp', { m, setModal })
setModal(
<ModalWrapper fullWidth keepOpenOnClick>
<MeasurementHelp m={m} />
</ModalWrapper>
)
}
export function modalDocsHelp(path, setModal) {
setModal(
<ModalWrapper wide keepOpenOnClick>
<DocsHelp path={path} />
</ModalWrapper>
)
}