forgebook 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +136 -2
- package/dist/bin/forgebook/catalogueVite.d.ts +16 -0
- package/dist/bin/forgebook/catalogueVite.d.ts.map +1 -0
- package/dist/bin/forgebook/catalogueVite.js +15 -0
- package/dist/bin/forgebook/catalogueVite.js.map +1 -0
- package/dist/bin/forgebook/forgebook.d.mts +3 -0
- package/dist/bin/forgebook/forgebook.d.mts.map +1 -0
- package/dist/bin/forgebook/forgebook.mjs +93 -0
- package/dist/bin/forgebook/forgebook.mjs.map +1 -0
- package/dist/bin/forgebook-docs/catalogueDocs.types.d.ts +90 -0
- package/dist/bin/forgebook-docs/catalogueDocs.types.d.ts.map +1 -0
- package/dist/bin/forgebook-docs/catalogueDocs.types.js +1 -0
- package/dist/bin/forgebook-docs/catalogueDocs.types.js.map +1 -0
- package/dist/bin/forgebook-docs/catalogueMarkdown.d.ts +9 -0
- package/dist/bin/forgebook-docs/catalogueMarkdown.d.ts.map +1 -0
- package/dist/bin/forgebook-docs/catalogueMarkdown.js +132 -0
- package/dist/bin/forgebook-docs/catalogueMarkdown.js.map +1 -0
- package/dist/bin/forgebook-docs/collectDocs.d.ts +17 -0
- package/dist/bin/forgebook-docs/collectDocs.d.ts.map +1 -0
- package/dist/bin/forgebook-docs/collectDocs.js +115 -0
- package/dist/bin/forgebook-docs/collectDocs.js.map +1 -0
- package/dist/bin/forgebook-docs/forgebook-docs.d.mts +3 -0
- package/dist/bin/forgebook-docs/forgebook-docs.d.mts.map +1 -0
- package/dist/bin/forgebook-docs/forgebook-docs.mjs +115 -0
- package/dist/bin/forgebook-docs/forgebook-docs.mjs.map +1 -0
- package/dist/bin/forgebook-docs/moduleDocs.d.ts +9 -0
- package/dist/bin/forgebook-docs/moduleDocs.d.ts.map +1 -0
- package/dist/bin/forgebook-docs/moduleDocs.js +62 -0
- package/dist/bin/forgebook-docs/moduleDocs.js.map +1 -0
- package/dist/bin/forgebook-docs/sassDocs.d.ts +20 -0
- package/dist/bin/forgebook-docs/sassDocs.d.ts.map +1 -0
- package/dist/bin/forgebook-docs/sassDocs.js +77 -0
- package/dist/bin/forgebook-docs/sassDocs.js.map +1 -0
- package/dist/bin/forgebook-texts/forgebook-texts.d.mts +3 -0
- package/dist/bin/forgebook-texts/forgebook-texts.d.mts.map +1 -0
- package/dist/bin/forgebook-texts/forgebook-texts.mjs +94 -0
- package/dist/bin/forgebook-texts/forgebook-texts.mjs.map +1 -0
- package/dist/bin/forgebook-texts/storyTextsReport.d.ts +26 -0
- package/dist/bin/forgebook-texts/storyTextsReport.d.ts.map +1 -0
- package/dist/bin/forgebook-texts/storyTextsReport.js +35 -0
- package/dist/bin/forgebook-texts/storyTextsReport.js.map +1 -0
- package/dist/bin/forgebook-texts/storyTextsReport.types.d.ts +25 -0
- package/dist/bin/forgebook-texts/storyTextsReport.types.d.ts.map +1 -0
- package/dist/bin/forgebook-texts/storyTextsReport.types.js +7 -0
- package/dist/bin/forgebook-texts/storyTextsReport.types.js.map +1 -0
- package/dist/src/a11y.d.ts +28 -0
- package/dist/src/a11y.d.ts.map +1 -0
- package/dist/src/a11y.js +29 -0
- package/dist/src/a11y.js.map +1 -0
- package/dist/src/argTypes.d.ts +114 -0
- package/dist/src/argTypes.d.ts.map +1 -0
- package/dist/src/argTypes.js +254 -0
- package/dist/src/argTypes.js.map +1 -0
- package/dist/src/backdrops.d.ts +88 -0
- package/dist/src/backdrops.d.ts.map +1 -0
- package/dist/src/backdrops.js +202 -0
- package/dist/src/backdrops.js.map +1 -0
- package/dist/src/catalogue.d.ts +120 -0
- package/dist/src/catalogue.d.ts.map +1 -0
- package/dist/src/catalogue.js +80 -0
- package/dist/src/catalogue.js.map +1 -0
- package/dist/src/componentDocs.d.ts +98 -0
- package/dist/src/componentDocs.d.ts.map +1 -0
- package/dist/src/componentDocs.js +47 -0
- package/dist/src/componentDocs.js.map +1 -0
- package/dist/src/frame/checkStory.d.ts +20 -0
- package/dist/src/frame/checkStory.d.ts.map +1 -0
- package/dist/src/frame/checkStory.js +31 -0
- package/dist/src/frame/checkStory.js.map +1 -0
- package/dist/src/frame/frame.css +51 -0
- package/dist/src/frame/frameClock.d.ts +53 -0
- package/dist/src/frame/frameClock.d.ts.map +1 -0
- package/dist/src/frame/frameClock.js +80 -0
- package/dist/src/frame/frameClock.js.map +1 -0
- package/dist/src/frame/frameStatus.d.ts +8 -0
- package/dist/src/frame/frameStatus.d.ts.map +1 -0
- package/dist/src/frame/frameStatus.js +8 -0
- package/dist/src/frame/frameStatus.js.map +1 -0
- package/dist/src/frame/frameView.d.ts +33 -0
- package/dist/src/frame/frameView.d.ts.map +1 -0
- package/dist/src/frame/frameView.js +134 -0
- package/dist/src/frame/frameView.js.map +1 -0
- package/dist/src/frame/matrixLayout.d.ts +36 -0
- package/dist/src/frame/matrixLayout.d.ts.map +1 -0
- package/dist/src/frame/matrixLayout.js +87 -0
- package/dist/src/frame/matrixLayout.js.map +1 -0
- package/dist/src/frame/measureTools.d.ts +24 -0
- package/dist/src/frame/measureTools.d.ts.map +1 -0
- package/dist/src/frame/measureTools.js +141 -0
- package/dist/src/frame/measureTools.js.map +1 -0
- package/dist/src/frame/mountFrame.d.ts +47 -0
- package/dist/src/frame/mountFrame.d.ts.map +1 -0
- package/dist/src/frame/mountFrame.js +229 -0
- package/dist/src/frame/mountFrame.js.map +1 -0
- package/dist/src/frame/playStory.d.ts +40 -0
- package/dist/src/frame/playStory.d.ts.map +1 -0
- package/dist/src/frame/playStory.js +55 -0
- package/dist/src/frame/playStory.js.map +1 -0
- package/dist/src/frame/renderer.d.ts +85 -0
- package/dist/src/frame/renderer.d.ts.map +1 -0
- package/dist/src/frame/renderer.js +18 -0
- package/dist/src/frame/renderer.js.map +1 -0
- package/dist/src/frame/settle.d.ts +24 -0
- package/dist/src/frame/settle.d.ts.map +1 -0
- package/dist/src/frame/settle.js +25 -0
- package/dist/src/frame/settle.js.map +1 -0
- package/dist/src/frame/staleModule.d.ts +40 -0
- package/dist/src/frame/staleModule.d.ts.map +1 -0
- package/dist/src/frame/staleModule.js +74 -0
- package/dist/src/frame/staleModule.js.map +1 -0
- package/dist/src/frame/storyCanvas.d.ts +21 -0
- package/dist/src/frame/storyCanvas.d.ts.map +1 -0
- package/dist/src/frame/storyCanvas.js +30 -0
- package/dist/src/frame/storyCanvas.js.map +1 -0
- package/dist/src/frame/storyHooks.d.ts +31 -0
- package/dist/src/frame/storyHooks.d.ts.map +1 -0
- package/dist/src/frame/storyHooks.js +59 -0
- package/dist/src/frame/storyHooks.js.map +1 -0
- package/dist/src/frame/storyModule.d.ts +104 -0
- package/dist/src/frame/storyModule.d.ts.map +1 -0
- package/dist/src/frame/storyModule.js +205 -0
- package/dist/src/frame/storyModule.js.map +1 -0
- package/dist/src/frame/storyRun.d.ts +96 -0
- package/dist/src/frame/storyRun.d.ts.map +1 -0
- package/dist/src/frame/storyRun.js +318 -0
- package/dist/src/frame/storyRun.js.map +1 -0
- package/dist/src/languages.d.ts +15 -0
- package/dist/src/languages.d.ts.map +1 -0
- package/dist/src/languages.js +8 -0
- package/dist/src/languages.js.map +1 -0
- package/dist/src/matrix.d.ts +56 -0
- package/dist/src/matrix.d.ts.map +1 -0
- package/dist/src/matrix.js +61 -0
- package/dist/src/matrix.js.map +1 -0
- package/dist/src/messages.d.ts +203 -0
- package/dist/src/messages.d.ts.map +1 -0
- package/dist/src/messages.js +193 -0
- package/dist/src/messages.js.map +1 -0
- package/dist/src/namedValues.d.ts +38 -0
- package/dist/src/namedValues.d.ts.map +1 -0
- package/dist/src/namedValues.js +48 -0
- package/dist/src/namedValues.js.map +1 -0
- package/dist/src/pageConfig.d.ts +23 -0
- package/dist/src/pageConfig.d.ts.map +1 -0
- package/dist/src/pageConfig.js +1 -0
- package/dist/src/pageConfig.js.map +1 -0
- package/dist/src/playTrace.d.ts +41 -0
- package/dist/src/playTrace.d.ts.map +1 -0
- package/dist/src/playTrace.js +35 -0
- package/dist/src/playTrace.js.map +1 -0
- package/dist/src/shell/A11yTab.d.ts +44 -0
- package/dist/src/shell/A11yTab.d.ts.map +1 -0
- package/dist/src/shell/A11yTab.js +30 -0
- package/dist/src/shell/A11yTab.js.map +1 -0
- package/dist/src/shell/ApiReference.d.ts +18 -0
- package/dist/src/shell/ApiReference.d.ts.map +1 -0
- package/dist/src/shell/ApiReference.js +41 -0
- package/dist/src/shell/ApiReference.js.map +1 -0
- package/dist/src/shell/ClockControls.d.ts +43 -0
- package/dist/src/shell/ClockControls.d.ts.map +1 -0
- package/dist/src/shell/ClockControls.js +53 -0
- package/dist/src/shell/ClockControls.js.map +1 -0
- package/dist/src/shell/Code.d.ts +16 -0
- package/dist/src/shell/Code.d.ts.map +1 -0
- package/dist/src/shell/Code.js +9 -0
- package/dist/src/shell/Code.js.map +1 -0
- package/dist/src/shell/CodeTab.d.ts +17 -0
- package/dist/src/shell/CodeTab.d.ts.map +1 -0
- package/dist/src/shell/CodeTab.js +17 -0
- package/dist/src/shell/CodeTab.js.map +1 -0
- package/dist/src/shell/CodeText.d.ts +16 -0
- package/dist/src/shell/CodeText.d.ts.map +1 -0
- package/dist/src/shell/CodeText.js +10 -0
- package/dist/src/shell/CodeText.js.map +1 -0
- package/dist/src/shell/ComponentPage.d.ts +38 -0
- package/dist/src/shell/ComponentPage.d.ts.map +1 -0
- package/dist/src/shell/ComponentPage.js +146 -0
- package/dist/src/shell/ComponentPage.js.map +1 -0
- package/dist/src/shell/Dock.d.ts +42 -0
- package/dist/src/shell/Dock.d.ts.map +1 -0
- package/dist/src/shell/Dock.js +90 -0
- package/dist/src/shell/Dock.js.map +1 -0
- package/dist/src/shell/EventsTab.d.ts +25 -0
- package/dist/src/shell/EventsTab.d.ts.map +1 -0
- package/dist/src/shell/EventsTab.js +26 -0
- package/dist/src/shell/EventsTab.js.map +1 -0
- package/dist/src/shell/FrameView.d.ts +49 -0
- package/dist/src/shell/FrameView.d.ts.map +1 -0
- package/dist/src/shell/FrameView.js +29 -0
- package/dist/src/shell/FrameView.js.map +1 -0
- package/dist/src/shell/HomePage.d.ts +39 -0
- package/dist/src/shell/HomePage.d.ts.map +1 -0
- package/dist/src/shell/HomePage.js +85 -0
- package/dist/src/shell/HomePage.js.map +1 -0
- package/dist/src/shell/InteractionsTab.d.ts +28 -0
- package/dist/src/shell/InteractionsTab.d.ts.map +1 -0
- package/dist/src/shell/InteractionsTab.js +17 -0
- package/dist/src/shell/InteractionsTab.js.map +1 -0
- package/dist/src/shell/MatrixPicker.d.ts +24 -0
- package/dist/src/shell/MatrixPicker.d.ts.map +1 -0
- package/dist/src/shell/MatrixPicker.js +29 -0
- package/dist/src/shell/MatrixPicker.js.map +1 -0
- package/dist/src/shell/PackageHtml.d.ts +17 -0
- package/dist/src/shell/PackageHtml.d.ts.map +1 -0
- package/dist/src/shell/PackageHtml.js +13 -0
- package/dist/src/shell/PackageHtml.js.map +1 -0
- package/dist/src/shell/PartsTab.d.ts +23 -0
- package/dist/src/shell/PartsTab.d.ts.map +1 -0
- package/dist/src/shell/PartsTab.js +23 -0
- package/dist/src/shell/PartsTab.js.map +1 -0
- package/dist/src/shell/PropFields.d.ts +31 -0
- package/dist/src/shell/PropFields.d.ts.map +1 -0
- package/dist/src/shell/PropFields.js +81 -0
- package/dist/src/shell/PropFields.js.map +1 -0
- package/dist/src/shell/PropsTab.d.ts +45 -0
- package/dist/src/shell/PropsTab.d.ts.map +1 -0
- package/dist/src/shell/PropsTab.js +81 -0
- package/dist/src/shell/PropsTab.js.map +1 -0
- package/dist/src/shell/SchemeSwitches.d.ts +24 -0
- package/dist/src/shell/SchemeSwitches.d.ts.map +1 -0
- package/dist/src/shell/SchemeSwitches.js +36 -0
- package/dist/src/shell/SchemeSwitches.js.map +1 -0
- package/dist/src/shell/Segmented.d.ts +41 -0
- package/dist/src/shell/Segmented.d.ts.map +1 -0
- package/dist/src/shell/Segmented.js +19 -0
- package/dist/src/shell/Segmented.js.map +1 -0
- package/dist/src/shell/Shell.d.ts +49 -0
- package/dist/src/shell/Shell.d.ts.map +1 -0
- package/dist/src/shell/Shell.js +279 -0
- package/dist/src/shell/Shell.js.map +1 -0
- package/dist/src/shell/Sidebar.d.ts +52 -0
- package/dist/src/shell/Sidebar.d.ts.map +1 -0
- package/dist/src/shell/Sidebar.js +132 -0
- package/dist/src/shell/Sidebar.js.map +1 -0
- package/dist/src/shell/SidebarHandle.d.ts +29 -0
- package/dist/src/shell/SidebarHandle.d.ts.map +1 -0
- package/dist/src/shell/SidebarHandle.js +46 -0
- package/dist/src/shell/SidebarHandle.js.map +1 -0
- package/dist/src/shell/Stage.d.ts +68 -0
- package/dist/src/shell/Stage.d.ts.map +1 -0
- package/dist/src/shell/Stage.js +218 -0
- package/dist/src/shell/Stage.js.map +1 -0
- package/dist/src/shell/StageTools.d.ts +27 -0
- package/dist/src/shell/StageTools.d.ts.map +1 -0
- package/dist/src/shell/StageTools.js +34 -0
- package/dist/src/shell/StageTools.js.map +1 -0
- package/dist/src/shell/StageViewport.d.ts +47 -0
- package/dist/src/shell/StageViewport.d.ts.map +1 -0
- package/dist/src/shell/StageViewport.js +174 -0
- package/dist/src/shell/StageViewport.js.map +1 -0
- package/dist/src/shell/StoryCodeBlock.d.ts +35 -0
- package/dist/src/shell/StoryCodeBlock.d.ts.map +1 -0
- package/dist/src/shell/StoryCodeBlock.js +27 -0
- package/dist/src/shell/StoryCodeBlock.js.map +1 -0
- package/dist/src/shell/StoryPicker.d.ts +26 -0
- package/dist/src/shell/StoryPicker.d.ts.map +1 -0
- package/dist/src/shell/StoryPicker.js +32 -0
- package/dist/src/shell/StoryPicker.js.map +1 -0
- package/dist/src/shell/Toolbar.d.ts +40 -0
- package/dist/src/shell/Toolbar.d.ts.map +1 -0
- package/dist/src/shell/Toolbar.js +125 -0
- package/dist/src/shell/Toolbar.js.map +1 -0
- package/dist/src/shell/WidthField.d.ts +24 -0
- package/dist/src/shell/WidthField.d.ts.map +1 -0
- package/dist/src/shell/WidthField.js +40 -0
- package/dist/src/shell/WidthField.js.map +1 -0
- package/dist/src/shell/catalogueContext.d.ts +6 -0
- package/dist/src/shell/catalogueContext.d.ts.map +1 -0
- package/dist/src/shell/catalogueContext.js +14 -0
- package/dist/src/shell/catalogueContext.js.map +1 -0
- package/dist/src/shell/codeTokens.d.ts +23 -0
- package/dist/src/shell/codeTokens.d.ts.map +1 -0
- package/dist/src/shell/codeTokens.js +48 -0
- package/dist/src/shell/codeTokens.js.map +1 -0
- package/dist/src/shell/codeWriter.d.ts +6 -0
- package/dist/src/shell/codeWriter.d.ts.map +1 -0
- package/dist/src/shell/codeWriter.js +14 -0
- package/dist/src/shell/codeWriter.js.map +1 -0
- package/dist/src/shell/compareVariants.d.ts +35 -0
- package/dist/src/shell/compareVariants.d.ts.map +1 -0
- package/dist/src/shell/compareVariants.js +68 -0
- package/dist/src/shell/compareVariants.js.map +1 -0
- package/dist/src/shell/dockTabs.d.ts +63 -0
- package/dist/src/shell/dockTabs.d.ts.map +1 -0
- package/dist/src/shell/dockTabs.js +140 -0
- package/dist/src/shell/dockTabs.js.map +1 -0
- package/dist/src/shell/icons.d.ts +47 -0
- package/dist/src/shell/icons.d.ts.map +1 -0
- package/dist/src/shell/icons.js +36 -0
- package/dist/src/shell/icons.js.map +1 -0
- package/dist/src/shell/keyboard.d.ts +35 -0
- package/dist/src/shell/keyboard.d.ts.map +1 -0
- package/dist/src/shell/keyboard.js +51 -0
- package/dist/src/shell/keyboard.js.map +1 -0
- package/dist/src/shell/mountShell.d.ts +22 -0
- package/dist/src/shell/mountShell.d.ts.map +1 -0
- package/dist/src/shell/mountShell.js +39 -0
- package/dist/src/shell/mountShell.js.map +1 -0
- package/dist/src/shell/shell.css +1831 -0
- package/dist/src/shell/strings.d.ts +184 -0
- package/dist/src/shell/strings.d.ts.map +1 -0
- package/dist/src/shell/strings.js +188 -0
- package/dist/src/shell/strings.js.map +1 -0
- package/dist/src/shell/switchView.d.ts +23 -0
- package/dist/src/shell/switchView.d.ts.map +1 -0
- package/dist/src/shell/switchView.js +19 -0
- package/dist/src/shell/switchView.js.map +1 -0
- package/dist/src/shell/treeSearch.d.ts +35 -0
- package/dist/src/shell/treeSearch.d.ts.map +1 -0
- package/dist/src/shell/treeSearch.js +60 -0
- package/dist/src/shell/treeSearch.js.map +1 -0
- package/dist/src/shell/useComponentDocs.d.ts +16 -0
- package/dist/src/shell/useComponentDocs.d.ts.map +1 -0
- package/dist/src/shell/useComponentDocs.js +25 -0
- package/dist/src/shell/useComponentDocs.js.map +1 -0
- package/dist/src/shell/useCopy.d.ts +10 -0
- package/dist/src/shell/useCopy.d.ts.map +1 -0
- package/dist/src/shell/useCopy.js +23 -0
- package/dist/src/shell/useCopy.js.map +1 -0
- package/dist/src/shell/useFrameMessages.d.ts +54 -0
- package/dist/src/shell/useFrameMessages.d.ts.map +1 -0
- package/dist/src/shell/useFrameMessages.js +90 -0
- package/dist/src/shell/useFrameMessages.js.map +1 -0
- package/dist/src/shell/useFrameQueue.d.ts +29 -0
- package/dist/src/shell/useFrameQueue.d.ts.map +1 -0
- package/dist/src/shell/useFrameQueue.js +72 -0
- package/dist/src/shell/useFrameQueue.js.map +1 -0
- package/dist/src/shell/useLiveView.d.ts +29 -0
- package/dist/src/shell/useLiveView.d.ts.map +1 -0
- package/dist/src/shell/useLiveView.js +51 -0
- package/dist/src/shell/useLiveView.js.map +1 -0
- package/dist/src/shell/useLoaded.d.ts +20 -0
- package/dist/src/shell/useLoaded.d.ts.map +1 -0
- package/dist/src/shell/useLoaded.js +40 -0
- package/dist/src/shell/useLoaded.js.map +1 -0
- package/dist/src/shell/usePageDoc.d.ts +20 -0
- package/dist/src/shell/usePageDoc.d.ts.map +1 -0
- package/dist/src/shell/usePageDoc.js +21 -0
- package/dist/src/shell/usePageDoc.js.map +1 -0
- package/dist/src/shell/usePopover.d.ts +23 -0
- package/dist/src/shell/usePopover.d.ts.map +1 -0
- package/dist/src/shell/usePopover.js +39 -0
- package/dist/src/shell/usePopover.js.map +1 -0
- package/dist/src/shell/useRecentPages.d.ts +21 -0
- package/dist/src/shell/useRecentPages.d.ts.map +1 -0
- package/dist/src/shell/useRecentPages.js +62 -0
- package/dist/src/shell/useRecentPages.js.map +1 -0
- package/dist/src/shell/useScrollMemory.d.ts +40 -0
- package/dist/src/shell/useScrollMemory.d.ts.map +1 -0
- package/dist/src/shell/useScrollMemory.js +69 -0
- package/dist/src/shell/useScrollMemory.js.map +1 -0
- package/dist/src/shell/useSidebarLayout.d.ts +14 -0
- package/dist/src/shell/useSidebarLayout.d.ts.map +1 -0
- package/dist/src/shell/useSidebarLayout.js +19 -0
- package/dist/src/shell/useSidebarLayout.js.map +1 -0
- package/dist/src/shell/useStored.d.ts +11 -0
- package/dist/src/shell/useStored.d.ts.map +1 -0
- package/dist/src/shell/useStored.js +68 -0
- package/dist/src/shell/useStored.js.map +1 -0
- package/dist/src/shell/useStoryCode.d.ts +14 -0
- package/dist/src/shell/useStoryCode.d.ts.map +1 -0
- package/dist/src/shell/useStoryCode.js +29 -0
- package/dist/src/shell/useStoryCode.js.map +1 -0
- package/dist/src/shell/useStoryHeights.d.ts +9 -0
- package/dist/src/shell/useStoryHeights.d.ts.map +1 -0
- package/dist/src/shell/useStoryHeights.js +31 -0
- package/dist/src/shell/useStoryHeights.js.map +1 -0
- package/dist/src/shell/useStoryIdsElement.d.ts +7 -0
- package/dist/src/shell/useStoryIdsElement.d.ts.map +1 -0
- package/dist/src/shell/useStoryIdsElement.js +29 -0
- package/dist/src/shell/useStoryIdsElement.js.map +1 -0
- package/dist/src/shell/useStoryKeys.d.ts +11 -0
- package/dist/src/shell/useStoryKeys.d.ts.map +1 -0
- package/dist/src/shell/useStoryKeys.js +40 -0
- package/dist/src/shell/useStoryKeys.js.map +1 -0
- package/dist/src/shell/useSystemDark.d.ts +3 -0
- package/dist/src/shell/useSystemDark.d.ts.map +1 -0
- package/dist/src/shell/useSystemDark.js +19 -0
- package/dist/src/shell/useSystemDark.js.map +1 -0
- package/dist/src/sourceFiles.d.ts +18 -0
- package/dist/src/sourceFiles.d.ts.map +1 -0
- package/dist/src/sourceFiles.js +22 -0
- package/dist/src/sourceFiles.js.map +1 -0
- package/dist/src/storyBackground.d.ts +21 -0
- package/dist/src/storyBackground.d.ts.map +1 -0
- package/dist/src/storyBackground.js +27 -0
- package/dist/src/storyBackground.js.map +1 -0
- package/dist/src/storyClock.d.ts +62 -0
- package/dist/src/storyClock.d.ts.map +1 -0
- package/dist/src/storyClock.js +51 -0
- package/dist/src/storyClock.js.map +1 -0
- package/dist/src/storyGlobals.d.ts +60 -0
- package/dist/src/storyGlobals.d.ts.map +1 -0
- package/dist/src/storyGlobals.js +117 -0
- package/dist/src/storyGlobals.js.map +1 -0
- package/dist/src/storyHeights.d.ts +37 -0
- package/dist/src/storyHeights.d.ts.map +1 -0
- package/dist/src/storyHeights.js +53 -0
- package/dist/src/storyHeights.js.map +1 -0
- package/dist/src/storyIdsElement.d.ts +9 -0
- package/dist/src/storyIdsElement.d.ts.map +1 -0
- package/dist/src/storyIdsElement.js +9 -0
- package/dist/src/storyIdsElement.js.map +1 -0
- package/dist/src/storyTexts.d.ts +43 -0
- package/dist/src/storyTexts.d.ts.map +1 -0
- package/dist/src/storyTexts.js +71 -0
- package/dist/src/storyTexts.js.map +1 -0
- package/dist/src/storyTree.d.ts +215 -0
- package/dist/src/storyTree.d.ts.map +1 -0
- package/dist/src/storyTree.js +308 -0
- package/dist/src/storyTree.js.map +1 -0
- package/dist/src/switches.d.ts +156 -0
- package/dist/src/switches.d.ts.map +1 -0
- package/dist/src/switches.js +193 -0
- package/dist/src/switches.js.map +1 -0
- package/dist/src/viewState.d.ts +194 -0
- package/dist/src/viewState.d.ts.map +1 -0
- package/dist/src/viewState.js +303 -0
- package/dist/src/viewState.js.map +1 -0
- package/dist/src/vite/adapter.d.ts +70 -0
- package/dist/src/vite/adapter.d.ts.map +1 -0
- package/dist/src/vite/adapter.js +22 -0
- package/dist/src/vite/adapter.js.map +1 -0
- package/dist/src/vite/autoTitle.d.ts +28 -0
- package/dist/src/vite/autoTitle.d.ts.map +1 -0
- package/dist/src/vite/autoTitle.js +44 -0
- package/dist/src/vite/autoTitle.js.map +1 -0
- package/dist/src/vite/componentPage.d.ts +34 -0
- package/dist/src/vite/componentPage.d.ts.map +1 -0
- package/dist/src/vite/componentPage.js +94 -0
- package/dist/src/vite/componentPage.js.map +1 -0
- package/dist/src/vite/config.d.ts +72 -0
- package/dist/src/vite/config.d.ts.map +1 -0
- package/dist/src/vite/config.js +25 -0
- package/dist/src/vite/config.js.map +1 -0
- package/dist/src/vite/configFile.d.ts +76 -0
- package/dist/src/vite/configFile.d.ts.map +1 -0
- package/dist/src/vite/configFile.js +190 -0
- package/dist/src/vite/configFile.js.map +1 -0
- package/dist/src/vite/docsExtractor.d.ts +46 -0
- package/dist/src/vite/docsExtractor.d.ts.map +1 -0
- package/dist/src/vite/docsExtractor.js +88 -0
- package/dist/src/vite/docsExtractor.js.map +1 -0
- package/dist/src/vite/docsProgram.d.ts +42 -0
- package/dist/src/vite/docsProgram.d.ts.map +1 -0
- package/dist/src/vite/docsProgram.js +144 -0
- package/dist/src/vite/docsProgram.js.map +1 -0
- package/dist/src/vite/docsWorker.d.ts +2 -0
- package/dist/src/vite/docsWorker.d.ts.map +1 -0
- package/dist/src/vite/docsWorker.js +68 -0
- package/dist/src/vite/docsWorker.js.map +1 -0
- package/dist/src/vite/forcedStates.d.ts +27 -0
- package/dist/src/vite/forcedStates.d.ts.map +1 -0
- package/dist/src/vite/forcedStates.js +60 -0
- package/dist/src/vite/forcedStates.js.map +1 -0
- package/dist/src/vite/forgebookPlugin.d.ts +28 -0
- package/dist/src/vite/forgebookPlugin.d.ts.map +1 -0
- package/dist/src/vite/forgebookPlugin.js +375 -0
- package/dist/src/vite/forgebookPlugin.js.map +1 -0
- package/dist/src/vite/highlightCode.d.ts +16 -0
- package/dist/src/vite/highlightCode.d.ts.map +1 -0
- package/dist/src/vite/highlightCode.js +82 -0
- package/dist/src/vite/highlightCode.js.map +1 -0
- package/dist/src/vite/indexStoryFile.d.ts +35 -0
- package/dist/src/vite/indexStoryFile.d.ts.map +1 -0
- package/dist/src/vite/indexStoryFile.js +458 -0
- package/dist/src/vite/indexStoryFile.js.map +1 -0
- package/dist/src/vite/pages.d.ts +49 -0
- package/dist/src/vite/pages.d.ts.map +1 -0
- package/dist/src/vite/pages.js +171 -0
- package/dist/src/vite/pages.js.map +1 -0
- package/dist/src/vite/prebundled.d.ts +30 -0
- package/dist/src/vite/prebundled.d.ts.map +1 -0
- package/dist/src/vite/prebundled.js +81 -0
- package/dist/src/vite/prebundled.js.map +1 -0
- package/dist/src/vite/storyCode.d.ts +28 -0
- package/dist/src/vite/storyCode.d.ts.map +1 -0
- package/dist/src/vite/storyCode.js +80 -0
- package/dist/src/vite/storyCode.js.map +1 -0
- package/dist/src/vite/storyFilesModule.d.ts +17 -0
- package/dist/src/vite/storyFilesModule.d.ts.map +1 -0
- package/dist/src/vite/storyFilesModule.js +64 -0
- package/dist/src/vite/storyFilesModule.js.map +1 -0
- package/dist/src/vite/storyMeta.d.ts +34 -0
- package/dist/src/vite/storyMeta.d.ts.map +1 -0
- package/dist/src/vite/storyMeta.js +74 -0
- package/dist/src/vite/storyMeta.js.map +1 -0
- package/dist/src/vite/typeScriptPieces.d.ts +23 -0
- package/dist/src/vite/typeScriptPieces.d.ts.map +1 -0
- package/dist/src/vite/typeScriptPieces.js +236 -0
- package/dist/src/vite/typeScriptPieces.js.map +1 -0
- package/package.json +202 -3
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { isChoiceList, isNamedArg } from "./messages.js";
|
|
2
|
+
/**
|
|
3
|
+
* The name of a value among the named ones, when it is one of them.
|
|
4
|
+
*
|
|
5
|
+
* @param value - a story's own arg.
|
|
6
|
+
* @param namedValues - the source's named values.
|
|
7
|
+
*/
|
|
8
|
+
export const nameOf = (value, namedValues) => {
|
|
9
|
+
for (const [of, values] of Object.entries(namedValues)) {
|
|
10
|
+
for (const [named, known] of Object.entries(values)) {
|
|
11
|
+
if (known === value)
|
|
12
|
+
return { of, named };
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A story's own args as the panel can show them: texts, numbers, booleans, `null` and lists of texts and numbers (a
|
|
19
|
+
* multiple choice's) as they are, a named value by its name; anything else is left out.
|
|
20
|
+
*
|
|
21
|
+
* @param args - the story's args.
|
|
22
|
+
* @param namedValues - the source's named values; none by default.
|
|
23
|
+
*/
|
|
24
|
+
export const panelArgsOf = (args, namedValues = {}) => Object.fromEntries(Object.entries(args).flatMap(([name, value]) => {
|
|
25
|
+
if (value === null ||
|
|
26
|
+
typeof value === "string" ||
|
|
27
|
+
typeof value === "number" ||
|
|
28
|
+
typeof value === "boolean" ||
|
|
29
|
+
isChoiceList(value)) {
|
|
30
|
+
return [[name, value]];
|
|
31
|
+
}
|
|
32
|
+
const named = nameOf(value, namedValues);
|
|
33
|
+
return named === undefined ? [] : [[name, named]];
|
|
34
|
+
}));
|
|
35
|
+
/**
|
|
36
|
+
* The panel's values as the story takes them: a name turned back into its value; a name the source no longer offers
|
|
37
|
+
* is left out, so the story keeps its own.
|
|
38
|
+
*
|
|
39
|
+
* @param args - the panel's values.
|
|
40
|
+
* @param namedValues - the source's named values; none by default.
|
|
41
|
+
*/
|
|
42
|
+
export const storyArgsOf = (args, namedValues = {}) => Object.fromEntries(Object.entries(args).flatMap(([name, value]) => {
|
|
43
|
+
if (!isNamedArg(value))
|
|
44
|
+
return [[name, value]];
|
|
45
|
+
const known = namedValues[value.of]?.[value.named];
|
|
46
|
+
return known === undefined ? [] : [[name, known]];
|
|
47
|
+
}));
|
|
48
|
+
//# sourceMappingURL=namedValues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namedValues.js","sourceRoot":"","sources":["../../src/namedValues.ts"],"names":[],"mappings":"AAYA,OAAO,EAAiB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f,cAA2B,EAAE,EACM,EAAE,CACrC,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAuB,EAAE;IAClE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnD,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;AACpD,CAAC,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the shell and the frame pages read of a catalogue's configuration (`vite/config.ts`): data, as the plugin hands
|
|
3
|
+
* it to the generated pages through `virtual:forgebook/config`.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import type { StoryLanguage } from "@forgebook/story-format/source";
|
|
8
|
+
import type { CatalogueLists } from "./catalogue.ts";
|
|
9
|
+
import type { ViewSwitch } from "./switches.ts";
|
|
10
|
+
/** What the shell and the frame pages read of a configuration: data, as the plugin hands it to them. */
|
|
11
|
+
export type PageConfig = {
|
|
12
|
+
/** The catalogue's name. */
|
|
13
|
+
readonly title: string;
|
|
14
|
+
/** The heights file's address, relative to the pages; none without one. */
|
|
15
|
+
readonly heights: string | undefined;
|
|
16
|
+
/** The switches, the presets' and the catalogue's merged. */
|
|
17
|
+
readonly switches: readonly ViewSwitch[] | undefined;
|
|
18
|
+
/** The languages, the presets' and the catalogue's merged. */
|
|
19
|
+
readonly languages: readonly StoryLanguage[];
|
|
20
|
+
/** The lists (widths, backgrounds, story groups, texts…), the presets' and the catalogue's merged. */
|
|
21
|
+
readonly lists: CatalogueLists;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=pageConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pageConfig.d.ts","sourceRoot":"","sources":["../../src/pageConfig.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,wGAAwG;AACxG,MAAM,MAAM,UAAU,GAAG;IACvB,4BAA4B;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,CAAC;IACrD,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,EAAE,SAAS,aAAa,EAAE,CAAC;IAC7C,sGAAsG;IACtG,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;CAChC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=pageConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pageConfig.js","sourceRoot":"","sources":["../../src/pageConfig.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The trace of a story's play function: whether it is running, passed or failed, how long it took, and each step the
|
|
3
|
+
* play named with `step(label, run)`, so the panel's Interactions tab shows where a play stopped.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* A play is a test: it throws when the story does not behave. The trace records the throw's message; the frame still
|
|
7
|
+
* lets it reach the page, where the generated tests record it as an error.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
/** Where a play or one of its steps is. */
|
|
12
|
+
export type PlayStatus = "running" | "passed" | "failed";
|
|
13
|
+
/** One step a play named. */
|
|
14
|
+
export type PlayStep = {
|
|
15
|
+
/** What the step does, as the play named it. */
|
|
16
|
+
readonly label: string;
|
|
17
|
+
/** Where it is. */
|
|
18
|
+
readonly status: PlayStatus;
|
|
19
|
+
/** How long it took, in ms, once over. */
|
|
20
|
+
readonly ms?: number;
|
|
21
|
+
/** Why it failed. */
|
|
22
|
+
readonly error?: string;
|
|
23
|
+
};
|
|
24
|
+
/** A play's trace. */
|
|
25
|
+
export type PlayTrace = {
|
|
26
|
+
/** Where the play is. */
|
|
27
|
+
readonly status: PlayStatus;
|
|
28
|
+
/** Its named steps, in order. */
|
|
29
|
+
readonly steps: readonly PlayStep[];
|
|
30
|
+
/** How long it took, in ms, once over. */
|
|
31
|
+
readonly ms?: number;
|
|
32
|
+
/** Why it failed. */
|
|
33
|
+
readonly error?: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Whether a value is a play's trace, as it arrives in a message.
|
|
37
|
+
*
|
|
38
|
+
* @param value - the message's trace.
|
|
39
|
+
*/
|
|
40
|
+
export declare const isPlayTrace: (value: unknown) => value is PlayTrace;
|
|
41
|
+
//# sourceMappingURL=playTrace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playTrace.d.ts","sourceRoot":"","sources":["../../src/playTrace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,2CAA2C;AAC3C,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEzD,6BAA6B;AAC7B,MAAM,MAAM,QAAQ,GAAG;IACrB,gDAAgD;IAChD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,mBAAmB;IACnB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,sBAAsB;AACtB,MAAM,MAAM,SAAS,GAAG;IACtB,yBAAyB;IACzB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,iCAAiC;IACjC,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAkBF;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,SAKrD,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The trace of a story's play function: whether it is running, passed or failed, how long it took, and each step the
|
|
3
|
+
* play named with `step(label, run)`, so the panel's Interactions tab shows where a play stopped.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* A play is a test: it throws when the story does not behave. The trace records the throw's message; the frame still
|
|
7
|
+
* lets it reach the page, where the generated tests record it as an error.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
/** Whether a value is a status. */
|
|
12
|
+
const isStatus = (value) => value === "running" || value === "passed" || value === "failed";
|
|
13
|
+
/** Whether a record's optional `ms` and `error` have their types. */
|
|
14
|
+
const hasOptionalEnd = (record) => (record["ms"] === undefined || typeof record["ms"] === "number") &&
|
|
15
|
+
(record["error"] === undefined || typeof record["error"] === "string");
|
|
16
|
+
/** Whether a value is a step, as it arrives in a message. */
|
|
17
|
+
const isStep = (value) => {
|
|
18
|
+
if (typeof value !== "object" || value === null)
|
|
19
|
+
return false;
|
|
20
|
+
const record = { ...value };
|
|
21
|
+
return typeof record["label"] === "string" && isStatus(record["status"]) && hasOptionalEnd(record);
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Whether a value is a play's trace, as it arrives in a message.
|
|
25
|
+
*
|
|
26
|
+
* @param value - the message's trace.
|
|
27
|
+
*/
|
|
28
|
+
export const isPlayTrace = (value) => {
|
|
29
|
+
if (typeof value !== "object" || value === null)
|
|
30
|
+
return false;
|
|
31
|
+
const record = { ...value };
|
|
32
|
+
const steps = record["steps"];
|
|
33
|
+
return isStatus(record["status"]) && Array.isArray(steps) && steps.every(isStep) && hasOptionalEnd(record);
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=playTrace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playTrace.js","sourceRoot":"","sources":["../../src/playTrace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA6BH,mCAAmC;AACnC,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAuB,EAAE,CACvD,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,QAAQ,CAAC;AAElE,qEAAqE;AACrE,MAAM,cAAc,GAAG,CAAC,MAAyC,EAAW,EAAE,CAC5E,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,SAAS,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC;IAChE,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,SAAS,IAAI,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;AAEzE,6DAA6D;AAC7D,MAAM,MAAM,GAAG,CAAC,KAAc,EAAqB,EAAE;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,MAAM,GAAsC,EAAE,GAAG,KAAK,EAAE,CAAC;IAC/D,OAAO,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;AACrG,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAc,EAAsB,EAAE;IAChE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,MAAM,GAAsC,EAAE,GAAG,KAAK,EAAE,CAAC;IAC/D,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9B,OAAO,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;AAC7G,CAAC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The panel's Accessibility tab: checks the story as it is now (after a click, in the dark theme) with the rules of
|
|
3
|
+
* the generated tests, and lists each rule it breaks with the elements that break it.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* A result belongs to the story and the view it was taken in: the stage clears it when either changes, so an old
|
|
7
|
+
* result never shows over a new story.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import type { ReactNode } from "react";
|
|
12
|
+
import type { Violation } from "../a11y.ts";
|
|
13
|
+
/** The check's state: not run, running, its violations, or why it could not run. */
|
|
14
|
+
export type CheckState = {
|
|
15
|
+
readonly status: "idle";
|
|
16
|
+
} | {
|
|
17
|
+
readonly status: "running";
|
|
18
|
+
} | {
|
|
19
|
+
readonly status: "done";
|
|
20
|
+
readonly violations: readonly Violation[];
|
|
21
|
+
} | {
|
|
22
|
+
readonly status: "error";
|
|
23
|
+
readonly message: string;
|
|
24
|
+
};
|
|
25
|
+
/** The tab's props. */
|
|
26
|
+
export type A11yTabProps = {
|
|
27
|
+
/** The check's state. */
|
|
28
|
+
readonly check: CheckState;
|
|
29
|
+
/** Runs the check; none when it cannot run (the compare view). */
|
|
30
|
+
readonly onCheck: (() => void) | undefined;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The tab's hint: how many rules are broken once checked.
|
|
34
|
+
*
|
|
35
|
+
* @param check - the check's state.
|
|
36
|
+
*/
|
|
37
|
+
export declare const a11yHint: (check: CheckState) => string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The Accessibility tab.
|
|
40
|
+
*
|
|
41
|
+
* @param props - the check's state and how to run it.
|
|
42
|
+
*/
|
|
43
|
+
export declare const A11yTab: ({ check, onCheck }: A11yTabProps) => ReactNode;
|
|
44
|
+
//# sourceMappingURL=A11yTab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A11yTab.d.ts","sourceRoot":"","sources":["../../../src/shell/A11yTab.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,oFAAoF;AACpF,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GAC9B;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAA;CAAE,GACtE;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,uBAAuB;AACvB,MAAM,MAAM,YAAY,GAAG;IACzB,yBAAyB;IACzB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;CAC5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,UAAU,KAAG,MAAM,GAAG,SAGrD,CAAC;AAuCF;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAI,oBAAoB,YAAY,KAAG,SAmB1D,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { STRINGS } from "./strings.js";
|
|
3
|
+
/**
|
|
4
|
+
* The tab's hint: how many rules are broken once checked.
|
|
5
|
+
*
|
|
6
|
+
* @param check - the check's state.
|
|
7
|
+
*/
|
|
8
|
+
export const a11yHint = (check) => {
|
|
9
|
+
if (check.status !== "done")
|
|
10
|
+
return undefined;
|
|
11
|
+
return check.violations.length === 0 ? STRINGS.a11yPasses : STRINGS.a11yCount(check.violations.length);
|
|
12
|
+
};
|
|
13
|
+
/** What the check found. */
|
|
14
|
+
const CheckResult = ({ check }) => {
|
|
15
|
+
if (check.status === "error") {
|
|
16
|
+
return (_jsxs("p", { className: "forgebook-problems", role: "alert", children: [STRINGS.a11yError, ": ", check.message] }));
|
|
17
|
+
}
|
|
18
|
+
if (check.status !== "done")
|
|
19
|
+
return null;
|
|
20
|
+
if (check.violations.length === 0)
|
|
21
|
+
return _jsx("p", { className: "forgebook-prop__description", children: STRINGS.a11yNone });
|
|
22
|
+
return (_jsx("ul", { className: "forgebook-violations", children: check.violations.map((violation) => (_jsxs("li", { className: "forgebook-violation", "data-impact": violation.impact, children: [_jsxs("div", { className: "forgebook-violation__head", children: [_jsx("a", { className: "forgebook-violation__rule", href: violation.helpUrl, target: "_blank", rel: "noopener", children: violation.id }), violation.impact === undefined ? null : (_jsx("span", { className: "forgebook-violation__impact", children: violation.impact }))] }), _jsx("p", { className: "forgebook-prop__description", children: violation.help }), _jsx("ul", { className: "forgebook-violation__targets", children: violation.targets.map((target) => (_jsx("li", { children: _jsx("code", { children: target }) }, target))) })] }, violation.id))) }));
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The Accessibility tab.
|
|
26
|
+
*
|
|
27
|
+
* @param props - the check's state and how to run it.
|
|
28
|
+
*/
|
|
29
|
+
export const A11yTab = ({ check, onCheck }) => (_jsxs("div", { className: "forgebook-prop-group", children: [_jsxs("div", { className: "forgebook-calls__head", children: [_jsx("button", { type: "button", className: "forgebook-button", disabled: onCheck === undefined || check.status === "running", onClick: onCheck, children: check.status === "running" ? STRINGS.a11yRunning : STRINGS.a11yCheck }), onCheck === undefined ? (_jsx("span", { className: "forgebook-popover__note", children: STRINGS.a11yNotInCompare })) : null] }), _jsx("div", { "aria-live": "polite", children: _jsx(CheckResult, { check: check }) })] }));
|
|
30
|
+
//# sourceMappingURL=A11yTab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A11yTab.js","sourceRoot":"","sources":["../../../src/shell/A11yTab.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAiBvC;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAiB,EAAsB,EAAE;IAChE,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9C,OAAO,KAAK,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AACzG,CAAC,CAAC;AAEF,4BAA4B;AAC5B,MAAM,WAAW,GAAG,CAAC,EAAE,KAAK,EAAkC,EAAa,EAAE;IAC3E,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QAC7B,OAAO,CACL,aAAG,SAAS,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AC,CACtE,eAAK,SAAS,EAAC,sBAAsB,aACnC,eAAK,SAAS,EAAC,uBAAuB,aACpC,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,kBAAkB,EAC5B,QAAQ,EAAE,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAC7D,OAAO,EAAE,OAAO,YAEf,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,GAC9D,EACR,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CACvB,eAAM,SAAS,EAAC,yBAAyB,YAAE,OAAO,CAAC,gBAAgB,GAAQ,CAC5E,CAAC,CAAC,CAAC,IAAI,IACJ,EACN,2BAAe,QAAQ,YACrB,KAAC,WAAW,IAAC,KAAK,EAAE,KAAK,GAAI,GACzB,IACF,CACP,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The API reference on a component's page: its props and its events, drawn from its types and TSDoc, as a table
|
|
3
|
+
* (prop, type, default, what it does), never written by hand, then the same for each part the meta names in
|
|
4
|
+
* `subcomponents`. The table scrolls sideways on its own when the page is narrower than it.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
import type { ReactNode } from "react";
|
|
9
|
+
import type { ComponentDocs } from "../componentDocs.ts";
|
|
10
|
+
/**
|
|
11
|
+
* The API reference.
|
|
12
|
+
*
|
|
13
|
+
* @param props - the component's docs.
|
|
14
|
+
*/
|
|
15
|
+
export declare const ApiReference: ({ docs }: {
|
|
16
|
+
readonly docs: ComponentDocs;
|
|
17
|
+
}) => ReactNode;
|
|
18
|
+
//# sourceMappingURL=ApiReference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiReference.d.ts","sourceRoot":"","sources":["../../../src/shell/ApiReference.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAA8B,MAAM,qBAAqB,CAAC;AAqHrF;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,UAAU;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAA;CAAE,KAAG,SAQzE,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Code } from "./Code.js";
|
|
3
|
+
import { CodeText } from "./CodeText.js";
|
|
4
|
+
import { STRINGS } from "./strings.js";
|
|
5
|
+
/** A prop's or an event's type as one line of TypeScript: an event's signature as an arrow. */
|
|
6
|
+
const typeText = (prop) => prop.signature === undefined
|
|
7
|
+
? prop.type
|
|
8
|
+
: `(${prop.signature.parameters.map((parameter) => `${parameter.name}: ${parameter.type}`).join(", ")}) => ${prop.signature.returns}`;
|
|
9
|
+
/**
|
|
10
|
+
* A table of props or events: the Default column only when one of them has a default.
|
|
11
|
+
*
|
|
12
|
+
* @param props - the props or the events, and which of the two they are.
|
|
13
|
+
*/
|
|
14
|
+
const PropTable = ({ props, isEvents }) => {
|
|
15
|
+
const hasDefaults = !isEvents && props.some((prop) => prop.defaultValue !== undefined);
|
|
16
|
+
return (_jsx("div", { className: "forgebook-api", children: _jsxs("table", { className: "forgebook-api__table", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", children: isEvents ? STRINGS.apiEvent : STRINGS.apiProp }), _jsx("th", { scope: "col", children: isEvents ? STRINGS.apiSignature : STRINGS.apiType }), hasDefaults ? _jsx("th", { scope: "col", children: STRINGS.apiDefault }) : null, _jsx("th", { scope: "col", children: STRINGS.apiWhat })] }) }), _jsx("tbody", { children: props.map((prop) => (_jsxs("tr", { children: [_jsxs("th", { scope: "row", children: [_jsx("code", { className: "forgebook-api__name", children: prop.name }), prop.isRequired ? (_jsx("span", { className: "forgebook-prop__required", title: STRINGS.required, children: "*" })) : null] }), _jsx("td", { className: "forgebook-api__type", children: _jsx(Code, { text: typeText(prop), names: prop.signature?.parameters.map((parameter) => parameter.name) ?? [] }) }), hasDefaults ? (_jsx("td", { children: prop.defaultValue === undefined ? null : (_jsx("code", { className: "forgebook-inline-code", children: prop.defaultValue })) })) : null, _jsx("td", { children: _jsx(CodeText, { text: prop.description }) })] }, prop.name))) })] }) }));
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A component's or a part's props, then its events under their own heading.
|
|
20
|
+
*
|
|
21
|
+
* @param props - the props, and the level of the events' heading: under the section's, or under a part's.
|
|
22
|
+
*/
|
|
23
|
+
const PropsAndEvents = ({ props, eventsLevel }) => {
|
|
24
|
+
const EventsHeading = eventsLevel === 3 ? "h3" : "h4";
|
|
25
|
+
const values = props.filter((prop) => prop.kind !== "event");
|
|
26
|
+
const events = props.filter((prop) => prop.kind === "event");
|
|
27
|
+
return (_jsxs(_Fragment, { children: [values.length === 0 ? null : _jsx(PropTable, { props: values, isEvents: false }), events.length === 0 ? null : (_jsxs(_Fragment, { children: [_jsx(EventsHeading, { children: STRINGS.events }), _jsx(PropTable, { props: events, isEvents: true })] }))] }));
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* A part's reference: its name, its summary, its props and events.
|
|
31
|
+
*
|
|
32
|
+
* @param props - the part's docs.
|
|
33
|
+
*/
|
|
34
|
+
const SubcomponentReference = ({ docs }) => (_jsxs("section", { className: "forgebook-api__subcomponent", "aria-label": docs.name, children: [_jsx("h3", { children: _jsx("code", { className: "forgebook-inline-code", children: docs.name }) }), docs.description === "" ? null : (_jsx("p", { children: _jsx(CodeText, { text: docs.description }) })), _jsx(PropsAndEvents, { props: docs.props, eventsLevel: 4 })] }));
|
|
35
|
+
/**
|
|
36
|
+
* The API reference.
|
|
37
|
+
*
|
|
38
|
+
* @param props - the component's docs.
|
|
39
|
+
*/
|
|
40
|
+
export const ApiReference = ({ docs }) => (_jsxs("section", { className: "forgebook-doc__section", "aria-labelledby": "forgebook-api", children: [_jsx("h2", { id: "forgebook-api", children: STRINGS.apiReference }), _jsx(PropsAndEvents, { props: docs.props, eventsLevel: 3 }), docs.subcomponents.map((subcomponent) => (_jsx(SubcomponentReference, { docs: subcomponent }, subcomponent.name)))] }));
|
|
41
|
+
//# sourceMappingURL=ApiReference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiReference.js","sourceRoot":"","sources":["../../../src/shell/ApiReference.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAY,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAgB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,+FAA+F;AAC/F,MAAM,QAAQ,GAAG,CAAC,IAAc,EAAU,EAAE,CAC1C,IAAI,CAAC,SAAS,KAAK,SAAS;IAC1B,CAAC,CAAC,IAAI,CAAC,IAAI;IACX,CAAC,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;AAE1I;;;;GAIG;AACH,MAAM,SAAS,GAAG,CAAC,EACjB,KAAK,EACL,QAAQ,EAIT,EAAa,EAAE;IACd,MAAM,WAAW,GAAG,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC;IACvF,OAAO,CACL,cAAK,SAAS,EAAC,eAAe,YAC5B,iBAAO,SAAS,EAAC,sBAAsB,aACrC,0BACE,yBACE,aAAI,K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AI,CAAC,CAAC,CAAC,CAChC,sBACE,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,CAAC,WAAW,GAAI,GAClC,CACL,EACD,KAAC,cAAc,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,GAAI,IAC7C,CACX,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,IAAI,EAAoC,EAAa,EAAE,CAAC,CACrF,mBAAS,SAAS,EAAC,wBAAwB,qBAAiB,eAAe,aACzE,aAAI,EAAE,EAAC,eAAe,YAAE,OAAO,CAAC,YAAY,GAAM,EAClD,KAAC,cAAc,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,GAAI,EACpD,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CACxC,KAAC,qBAAqB,IAAyB,IAAI,EAAE,YAAY,IAArC,YAAY,CAAC,IAAI,CAAwB,CACtE,CAAC,IACM,CACX,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The story clock's controls on the stage, for a Live story: pause and resume, restart, and the speed (D-504).
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* The state lives in the shell, per shown story: a new story starts running at real time, and a frame that loads
|
|
6
|
+
* again (an edit, another language) receives the state it had. The frame runs the clock (`frame/frameClock.ts`);
|
|
7
|
+
* these controls only send it what to do, so the shell never reads the story's time.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import { type ReactNode, type RefObject } from "react";
|
|
12
|
+
import { type ClockState } from "../storyClock.ts";
|
|
13
|
+
/** The clock's state for the shown story, and how to change it in its frame. */
|
|
14
|
+
export type StoryClockControls = {
|
|
15
|
+
/** Whether the clock runs, and how fast. */
|
|
16
|
+
readonly state: ClockState;
|
|
17
|
+
/** Changes part of the state, over the latest one (two presses before a render both count), in the shell and in the frame. */
|
|
18
|
+
readonly change: (patch: Partial<ClockState>) => void;
|
|
19
|
+
/** Brings the clock back to its start, the story mounted again. */
|
|
20
|
+
readonly restart: () => void;
|
|
21
|
+
/** Sends the state to a frame that just loaded. */
|
|
22
|
+
readonly sendTo: (frame: Window) => void;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The clock controls' state for the shown story, started over for each story.
|
|
26
|
+
*
|
|
27
|
+
* @param frameRef - the story's frame.
|
|
28
|
+
* @param storyId - the shown story.
|
|
29
|
+
* @returns the state and what changes it.
|
|
30
|
+
*/
|
|
31
|
+
export declare const useStoryClockControls: (frameRef: RefObject<HTMLIFrameElement | null>, storyId: string) => StoryClockControls;
|
|
32
|
+
/** The controls' props. */
|
|
33
|
+
export type ClockControlsProps = {
|
|
34
|
+
/** The clock's state and what changes it. */
|
|
35
|
+
readonly controls: StoryClockControls;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* The clock's controls: a pause or resume button, Restart, and the speed.
|
|
39
|
+
*
|
|
40
|
+
* @param props - the clock's state and what changes it.
|
|
41
|
+
*/
|
|
42
|
+
export declare const ClockControls: ({ controls }: ClockControlsProps) => ReactNode;
|
|
43
|
+
//# sourceMappingURL=ClockControls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClockControls.d.ts","sourceRoot":"","sources":["../../../src/shell/ClockControls.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAG5E,OAAO,EAA+B,KAAK,UAAU,EAAuB,MAAM,kBAAkB,CAAC;AAKrG,gFAAgF;AAChF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,4CAA4C;IAC5C,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,8HAA8H;IAC9H,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IACtD,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,mDAAmD;IACnD,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAChC,UAAU,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,EAC7C,SAAS,MAAM,KACd,kBAwBF,CAAC;AAEF,2BAA2B;AAC3B,MAAM,MAAM,kBAAkB,GAAG;IAC/B,6CAA6C;IAC7C,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;CACvC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,cAAc,kBAAkB,KAAG,SA2BhE,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* The story clock's controls on the stage, for a Live story: pause and resume, restart, and the speed (D-504).
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* The state lives in the shell, per shown story: a new story starts running at real time, and a frame that loads
|
|
7
|
+
* again (an edit, another language) receives the state it had. The frame runs the clock (`frame/frameClock.ts`);
|
|
8
|
+
* these controls only send it what to do, so the shell never reads the story's time.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
import { useEffect, useState } from "react";
|
|
13
|
+
import { CLOCK_RATES, DEFAULT_CLOCK_STATE } from "../storyClock.js";
|
|
14
|
+
import { Icon } from "./icons.js";
|
|
15
|
+
import { Segmented } from "./Segmented.js";
|
|
16
|
+
import { STRINGS } from "./strings.js";
|
|
17
|
+
/**
|
|
18
|
+
* The clock controls' state for the shown story, started over for each story.
|
|
19
|
+
*
|
|
20
|
+
* @param frameRef - the story's frame.
|
|
21
|
+
* @param storyId - the shown story.
|
|
22
|
+
* @returns the state and what changes it.
|
|
23
|
+
*/
|
|
24
|
+
export const useStoryClockControls = (frameRef, storyId) => {
|
|
25
|
+
const [state, setLocalState] = useState(DEFAULT_CLOCK_STATE);
|
|
26
|
+
const [shownId, setShownId] = useState(storyId);
|
|
27
|
+
if (shownId !== storyId) {
|
|
28
|
+
setShownId(storyId);
|
|
29
|
+
setLocalState(DEFAULT_CLOCK_STATE);
|
|
30
|
+
}
|
|
31
|
+
const send = (message) => frameRef.current?.contentWindow?.postMessage(message, window.location.origin);
|
|
32
|
+
// the frame hears every state once it is drawn, so a change builds on the latest state, never on a render's copy
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
frameRef.current?.contentWindow?.postMessage({ type: "forgebook:clock", state }, window.location.origin);
|
|
35
|
+
}, [frameRef, state]);
|
|
36
|
+
return {
|
|
37
|
+
state,
|
|
38
|
+
change: (patch) => setLocalState((current) => ({ ...current, ...patch })),
|
|
39
|
+
restart: () => send({ type: "forgebook:clock-restart" }),
|
|
40
|
+
sendTo: (frame) => frame.postMessage({ type: "forgebook:clock", state }, window.location.origin)
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The clock's controls: a pause or resume button, Restart, and the speed.
|
|
45
|
+
*
|
|
46
|
+
* @param props - the clock's state and what changes it.
|
|
47
|
+
*/
|
|
48
|
+
export const ClockControls = ({ controls }) => {
|
|
49
|
+
const { state, change, restart } = controls;
|
|
50
|
+
const toggleLabel = state.isRunning ? STRINGS.clockPause : STRINGS.clockResume;
|
|
51
|
+
return (_jsxs("fieldset", { className: "forgebook-clock", children: [_jsx("legend", { className: "forgebook-visually-hidden", children: STRINGS.clockLabel }), _jsx("button", { type: "button", className: "forgebook-button forgebook-button--icon", title: toggleLabel, "aria-label": toggleLabel, onClick: () => change({ isRunning: !state.isRunning }), children: _jsx(Icon, { name: state.isRunning ? "pause" : "play", size: 14 }) }), _jsxs("button", { type: "button", className: "forgebook-button", onClick: restart, children: [_jsx(Icon, { name: "restart", size: 14 }), STRINGS.clockRestart] }), _jsx(Segmented, { label: STRINGS.clockSpeed, options: CLOCK_RATES.map((rate) => ({ value: rate, label: STRINGS.clockRate(rate) })), value: state.rate, onValueChange: (rate) => change({ rate }) })] }));
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=ClockControls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClockControls.js","sourceRoot":"","sources":["../../../src/shell/ClockControls.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;AACH,OAAO,EAAkC,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG5E,OAAO,EAAE,WAAW,EAAmC,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACrG,OAAO,EAAE,IAAI,EAAE,MAAM,YAAa,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAiB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAcvC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,QAA6C,EAC7C,OAAe,EACK,EAAE;IACtB,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAa,mBAAmB,CAAC,CAAC;IACzE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IAChD,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACxB,UAAU,CAAC,OAAO,CAAC,CAAC;QACpB,aAAa,CAAC,mBAAmB,CAAC,CAAC;IACrC,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,OAAqB,EAAQ,EAAE,CAC3C,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAChF,iHAAiH;IACjH,SAAS,CAAC,GAAG,EAAE;QAC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AK,CAAC,SAAS,EAAE,CAAC,YAE5D,KAAC,IAAI,IAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,GAAI,GACrD,EACT,kBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,kBAAkB,EAAC,OAAO,EAAE,OAAO,aACjE,KAAC,IAAI,IAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAE,EAAE,GAAI,EAChC,OAAO,CAAC,YAAY,IACd,EACT,KAAC,SAAS,IACR,KAAK,EAAE,OAAO,CAAC,UAAU,EACzB,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EACrF,KAAK,EAAE,KAAK,CAAC,IAAI,EACjB,aAAa,EAAE,CAAC,IAAe,EAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,GAC1D,IACO,CACZ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coloured code: an event's signature and calls in the props panel, a story's code in the Code card.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactNode } from "react";
|
|
7
|
+
/**
|
|
8
|
+
* Coloured code.
|
|
9
|
+
*
|
|
10
|
+
* @param props - the text, and the names coloured as names (the event's parameters).
|
|
11
|
+
*/
|
|
12
|
+
export declare const Code: ({ text, names }: {
|
|
13
|
+
readonly text: string;
|
|
14
|
+
readonly names: readonly string[];
|
|
15
|
+
}) => ReactNode;
|
|
16
|
+
//# sourceMappingURL=Code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../../src/shell/Code.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;;;;GAIG;AACH,eAAO,MAAM,IAAI,GAAI,iBAGlB;IACD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC,KAAG,SAUH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { codeTokens } from "./codeTokens.js";
|
|
3
|
+
/**
|
|
4
|
+
* Coloured code.
|
|
5
|
+
*
|
|
6
|
+
* @param props - the text, and the names coloured as names (the event's parameters).
|
|
7
|
+
*/
|
|
8
|
+
export const Code = ({ text, names }) => (_jsx("code", { className: "forgebook-code", children: codeTokens(text, new Set(names)).map((token, index) => (_jsx("span", { className: `forgebook-code__${token.kind}`, children: token.text }, index))) }));
|
|
9
|
+
//# sourceMappingURL=Code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.js","sourceRoot":"","sources":["../../../src/shell/Code.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EACnB,IAAI,EACJ,KAAK,EAIN,EAAa,EAAE,CAAC,CACf,eAAM,SAAS,EAAC,gBAAgB,YAC7B,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAGtD,eAAkB,SAAS,EAAE,mBAAmB,KAAK,CAAC,IAAI,EAAE,YACzD,KAAK,CAAC,IAAI,IADF,KAAK,CAET,CACR,CAAC,GACG,CACR,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The panel's Code tab: the story's `render` as written in its file, or, for a story drawn from its args, the
|
|
3
|
+
* component's JSX with the values of the moment (the story's and the Props tab's), with a button that copies it.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from "react";
|
|
8
|
+
import { type StoryCodeSource } from "./StoryCodeBlock.tsx";
|
|
9
|
+
/** The tab's props: the story whose code it shows. */
|
|
10
|
+
export type CodeTabProps = StoryCodeSource;
|
|
11
|
+
/**
|
|
12
|
+
* The Code tab.
|
|
13
|
+
*
|
|
14
|
+
* @param props - the file's code, the story, the component's name and the args.
|
|
15
|
+
*/
|
|
16
|
+
export declare const CodeTab: (props: CodeTabProps) => ReactNode;
|
|
17
|
+
//# sourceMappingURL=CodeTab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeTab.d.ts","sourceRoot":"","sources":["../../../src/shell/CodeTab.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAkB,KAAK,eAAe,EAAiB,MAAM,sBAAsB,CAAC;AAI3F,sDAAsD;AACtD,MAAM,MAAM,YAAY,GAAG,eAAe,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAI,OAAO,YAAY,KAAG,SAsB7C,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCodeWriter } from "./codeWriter.js";
|
|
3
|
+
import { StoryCodeBlock, storyCodeText } from "./StoryCodeBlock.js";
|
|
4
|
+
import { STRINGS } from "./strings.js";
|
|
5
|
+
import { useCopy } from "./useCopy.js";
|
|
6
|
+
/**
|
|
7
|
+
* The Code tab.
|
|
8
|
+
*
|
|
9
|
+
* @param props - the file's code, the story, the component's name and the args.
|
|
10
|
+
*/
|
|
11
|
+
export const CodeTab = (props) => {
|
|
12
|
+
const { isCopied, copy } = useCopy();
|
|
13
|
+
const write = useCodeWriter();
|
|
14
|
+
const hasRender = props.code[props.exportName] !== undefined;
|
|
15
|
+
return (_jsxs("div", { className: "forgebook-prop-group", children: [_jsxs("div", { className: "forgebook-calls__head", children: [_jsx("h3", { className: "forgebook-prop-group__title", children: hasRender ? STRINGS.codeRender : STRINGS.codeFromArgs }), _jsx("button", { type: "button", className: "forgebook-text-button", onClick: () => copy(storyCodeText(props, write)), "aria-live": "polite", children: isCopied ? STRINGS.copied : STRINGS.copy })] }), _jsx(StoryCodeBlock, { ...props })] }));
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=CodeTab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeTab.js","sourceRoot":"","sources":["../../../src/shell/CodeTab.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAwB,aAAa,EAAE,MAAM,qBAAsB,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAKvC;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAmB,EAAa,EAAE;IACxD,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC;IACrC,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,SAAS,CAAC;IAC7D,OAAO,CACL,eAAK,SAAS,EAAC,sBAAsB,aACnC,eAAK,SAAS,EAAC,uBAAuB,aACpC,aAAI,SAAS,EAAC,6BAA6B,YACxC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,GACnD,EACL,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,uBAAuB,EACjC,OAAO,EAAE,GAAS,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,eAC5C,QAAQ,YAEjB,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,GAClC,IACL,EACN,KAAC,cAAc,OAAK,KAAK,GAAI,IACzB,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A TSDoc or Markdown sentence with its code spans shown as code: what is between backticks (as `href` is written in
|
|
3
|
+
* a TSDoc) is set in the code face, the rest stays text.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from "react";
|
|
8
|
+
/**
|
|
9
|
+
* A sentence, its backtick spans as code.
|
|
10
|
+
*
|
|
11
|
+
* @param props - the sentence.
|
|
12
|
+
*/
|
|
13
|
+
export declare const CodeText: ({ text }: {
|
|
14
|
+
readonly text: string;
|
|
15
|
+
}) => ReactNode;
|
|
16
|
+
//# sourceMappingURL=CodeText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeText.d.ts","sourceRoot":"","sources":["../../../src/shell/CodeText.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAI,UAAU;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,KAAG,SAY5D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* A sentence, its backtick spans as code.
|
|
4
|
+
*
|
|
5
|
+
* @param props - the sentence.
|
|
6
|
+
*/
|
|
7
|
+
export const CodeText = ({ text }) =>
|
|
8
|
+
// a split on the backticks alternates text and code: the odd pieces were between backticks
|
|
9
|
+
text.split("`").map((piece, index) => index % 2 === 1 ? (_jsx("code", { className: "forgebook-inline-code", children: piece }, index)) : (piece));
|
|
10
|
+
//# sourceMappingURL=CodeText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeText.js","sourceRoot":"","sources":["../../../src/shell/CodeText.tsx"],"names":[],"mappings":";AAQA;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,IAAI,EAA6B,EAAa,EAAE;AACzE,2FAA2F;AAC3F,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CACnC,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAGhB,eAAkB,SAAS,EAAC,uBAAuB,YAChD,KAAK,IADG,KAAK,CAET,CACR,CAAC,CAAC,CAAC,CACF,KAAK,CACN,CACF,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type TreeComponent, type TreeStory } from "../storyTree.ts";
|
|
3
|
+
import { type ViewState } from "../viewState.ts";
|
|
4
|
+
import { type PageScroll } from "./useScrollMemory.ts";
|
|
5
|
+
/** The component page's props. */
|
|
6
|
+
export type ComponentPageProps = {
|
|
7
|
+
/** The component. */
|
|
8
|
+
readonly component: TreeComponent;
|
|
9
|
+
/** The view. */
|
|
10
|
+
readonly view: ViewState;
|
|
11
|
+
/** The frame page's address. */
|
|
12
|
+
readonly frameUrl: string;
|
|
13
|
+
/** The address of a story's page, for its link. */
|
|
14
|
+
readonly hrefOf: (story: TreeStory) => string;
|
|
15
|
+
/** Opens a story's page. */
|
|
16
|
+
readonly onOpen: (story: TreeStory) => void;
|
|
17
|
+
/** Loads the component's docs, for its API reference; `undefined` when the source has none for the file. */
|
|
18
|
+
readonly loadDocs: (() => Promise<unknown>) | undefined;
|
|
19
|
+
/** Loads the story file's code, for the demo's code; `undefined` when the source has none. */
|
|
20
|
+
readonly loadCode: (() => Promise<unknown>) | undefined;
|
|
21
|
+
/** Loads the component's documentation file as HTML; `undefined` when the source has none. */
|
|
22
|
+
readonly loadPage: (() => Promise<unknown>) | undefined;
|
|
23
|
+
/** A story's measured height at about the width its example is drawn at, for its box while it loads. */
|
|
24
|
+
readonly heightOf: (storyId: string) => number | undefined;
|
|
25
|
+
/** The colour the stories' page has in the view (their source's), which each box waits on; none without one. */
|
|
26
|
+
readonly background: string | undefined;
|
|
27
|
+
/** What stays above the page while it scrolls: the component's header. */
|
|
28
|
+
readonly header: ReactNode;
|
|
29
|
+
/** Where its scrolling part starts: the shell's visit of the page and every page's last position. */
|
|
30
|
+
readonly scroll: PageScroll;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* A component's page.
|
|
34
|
+
*
|
|
35
|
+
* @param props - the component, the view, its loaders and how to open a story.
|
|
36
|
+
*/
|
|
37
|
+
export declare const ComponentPage: ({ component, view, frameUrl, hrefOf, onOpen, loadDocs, loadCode, loadPage, heightOf, background, header, scroll }: ComponentPageProps) => ReactNode;
|
|
38
|
+
//# sourceMappingURL=ComponentPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComponentPage.d.ts","sourceRoot":"","sources":["../../../src/shell/ComponentPage.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAmB,KAAK,SAAS,EAAoC,MAAM,OAAO,CAAC;AAK1F,OAAO,EAA6B,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEhG,OAAO,EAA0B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAkBzE,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,sBAAsB,CAAC;AASxE,kCAAkC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