forgebook 0.1.7 → 0.2.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/README.md +906 -23
- package/dist/bin/forgebook/agentClient.d.ts +30 -1
- package/dist/bin/forgebook/agentClient.js +155 -14
- package/dist/bin/forgebook/agentLoopCommands.d.mts +0 -1
- package/dist/bin/forgebook/agentLoopCommands.mjs +161 -40
- package/dist/bin/forgebook/agentText.d.ts +74 -3
- package/dist/bin/forgebook/agentText.js +192 -8
- package/dist/bin/forgebook/agents.md +145 -7
- package/dist/bin/forgebook/agentsText.d.ts +7 -3
- package/dist/bin/forgebook/agentsText.js +7 -3
- package/dist/bin/forgebook/builtCatalogue.d.ts +31 -0
- package/dist/bin/forgebook/builtCatalogue.js +96 -0
- package/dist/bin/forgebook/catalogueCommands.d.ts +22 -3
- package/dist/bin/forgebook/catalogueCommands.js +21 -2
- package/dist/bin/forgebook/catalogueVite.d.ts +51 -9
- package/dist/bin/forgebook/catalogueVite.js +95 -9
- package/dist/bin/forgebook/checkCodeRun.d.ts +8 -0
- package/dist/bin/forgebook/checkCodeRun.js +27 -0
- package/dist/bin/forgebook/commandServer.d.ts +11 -0
- package/dist/bin/forgebook/commandServer.js +39 -0
- package/dist/bin/forgebook/compileCache.d.ts +7 -0
- package/dist/bin/forgebook/compileCache.js +24 -0
- package/dist/bin/forgebook/devCommands.d.mts +14 -0
- package/dist/bin/forgebook/devCommands.mjs +104 -0
- package/dist/bin/forgebook/errorsRun.d.ts +0 -1
- package/dist/bin/forgebook/errorsRun.js +0 -1
- package/dist/bin/forgebook/forgebook.d.mts +0 -1
- package/dist/bin/forgebook/forgebook.mjs +18 -302
- package/dist/bin/forgebook/forgebookCommands.d.mts +1 -0
- package/dist/bin/forgebook/forgebookCommands.mjs +292 -0
- package/dist/bin/forgebook/importers/storybook.d.ts +10 -4
- package/dist/bin/forgebook/importers/storybook.js +71 -45
- package/dist/bin/forgebook/importers/storybookAngular.d.ts +15 -0
- package/dist/bin/forgebook/importers/storybookAngular.js +97 -0
- package/dist/bin/forgebook/importers/storybookFrameworks.d.ts +53 -0
- package/dist/bin/forgebook/importers/storybookFrameworks.js +180 -0
- package/dist/bin/forgebook/importers/storybookReactNative.d.ts +40 -0
- package/dist/bin/forgebook/importers/storybookReactNative.js +179 -0
- package/dist/bin/forgebook/initCommands.d.mts +0 -1
- package/dist/bin/forgebook/initCommands.mjs +23 -12
- package/dist/bin/forgebook/initConfig.d.ts +0 -1
- package/dist/bin/forgebook/initConfig.js +17 -3
- package/dist/bin/forgebook/mcpCommand.d.mts +8 -0
- package/dist/bin/forgebook/mcpCommand.mjs +99 -0
- package/dist/bin/forgebook/mcpPreview.d.ts +32 -0
- package/dist/bin/forgebook/mcpPreview.js +107 -0
- package/dist/bin/forgebook/mcpToolParts.d.ts +28 -0
- package/dist/bin/forgebook/mcpToolParts.js +24 -0
- package/dist/bin/forgebook/mcpTools.d.ts +12 -6
- package/dist/bin/forgebook/mcpTools.js +148 -27
- package/dist/bin/forgebook/newStories.d.ts +2 -3
- package/dist/bin/forgebook/newStories.js +4 -3
- package/dist/bin/forgebook/newStoriesFile.d.ts +3 -4
- package/dist/bin/forgebook/newStoriesFile.js +23 -11
- package/dist/bin/forgebook/pageTools.d.ts +8 -0
- package/dist/bin/forgebook/pageTools.js +71 -0
- package/dist/bin/forgebook/pagesCommands.d.mts +14 -0
- package/dist/bin/forgebook/pagesCommands.mjs +109 -0
- package/dist/bin/forgebook/prebundleChild.d.ts +1 -0
- package/dist/bin/forgebook/prebundleChild.js +34 -0
- package/dist/bin/forgebook/prebundleRun.d.ts +22 -0
- package/dist/bin/forgebook/prebundleRun.js +49 -0
- package/dist/bin/forgebook/prebundleStart.d.ts +44 -0
- package/dist/bin/forgebook/prebundleStart.js +82 -0
- package/dist/bin/forgebook/semanticOptions.d.ts +45 -0
- package/dist/bin/forgebook/semanticOptions.js +36 -0
- package/dist/bin/forgebook/storyCheckCommands.d.mts +13 -0
- package/dist/bin/forgebook/storyCheckCommands.mjs +69 -0
- package/dist/bin/forgebook/storyCheckRun.d.ts +40 -6
- package/dist/bin/forgebook/storyCheckRun.js +90 -16
- package/dist/bin/forgebook/tokensRun.d.ts +41 -0
- package/dist/bin/forgebook/tokensRun.js +42 -0
- package/dist/bin/forgebook/touchWindowRun.d.ts +0 -1
- package/dist/bin/forgebook/touchWindowRun.js +0 -1
- package/dist/bin/forgebook/visualCommands.d.mts +37 -0
- package/dist/bin/forgebook/visualCommands.mjs +162 -0
- package/dist/bin/forgebook/viteCache.d.ts +48 -0
- package/dist/bin/forgebook/viteCache.js +112 -0
- package/dist/bin/forgebook-docs/catalogueDocs.d.ts +1 -2
- package/dist/bin/forgebook-docs/catalogueDocs.js +8 -5
- package/dist/bin/forgebook-docs/catalogueDocs.types.d.ts +24 -3
- package/dist/bin/forgebook-docs/catalogueDocs.types.js +0 -1
- package/dist/bin/forgebook-docs/catalogueMarkdown.d.ts +0 -1
- package/dist/bin/forgebook-docs/catalogueMarkdown.js +88 -24
- package/dist/bin/forgebook-docs/catalogueOptions.d.ts +1 -2
- package/dist/bin/forgebook-docs/catalogueOptions.js +8 -2
- package/dist/bin/forgebook-docs/collectDocs.d.ts +4 -4
- package/dist/bin/forgebook-docs/collectDocs.js +128 -29
- package/dist/bin/forgebook-docs/forgebook-docs.d.mts +0 -1
- package/dist/bin/forgebook-docs/forgebook-docs.mjs +0 -1
- package/dist/bin/forgebook-docs/llmsText.d.ts +5 -1
- package/dist/bin/forgebook-docs/llmsText.js +5 -2
- package/dist/bin/forgebook-docs/moduleDocs.d.ts +0 -1
- package/dist/bin/forgebook-docs/moduleDocs.js +0 -1
- package/dist/bin/forgebook-docs/sassDocs.d.ts +0 -1
- package/dist/bin/forgebook-docs/sassDocs.js +0 -1
- package/dist/bin/forgebook-texts/forgebook-texts.d.mts +0 -1
- package/dist/bin/forgebook-texts/forgebook-texts.mjs +1 -2
- package/dist/bin/forgebook-texts/storyTextsReport.d.ts +0 -1
- package/dist/bin/forgebook-texts/storyTextsReport.js +0 -1
- package/dist/bin/forgebook-texts/storyTextsReport.types.d.ts +0 -1
- package/dist/bin/forgebook-texts/storyTextsReport.types.js +0 -1
- package/dist/bin/frameworkDocs.d.ts +0 -1
- package/dist/bin/frameworkDocs.js +0 -1
- package/dist/src/a11y.d.ts +0 -1
- package/dist/src/a11y.js +0 -1
- package/dist/src/addressArgs.d.ts +74 -0
- package/dist/src/addressArgs.js +109 -0
- package/dist/src/addressTexts.d.ts +35 -0
- package/dist/src/addressTexts.js +51 -0
- package/dist/src/argTypes.d.ts +0 -1
- package/dist/src/argTypes.js +2 -2
- package/dist/src/audiences.d.ts +17 -0
- package/dist/src/audiences.js +15 -0
- package/dist/src/backdrops.d.ts +39 -40
- package/dist/src/backdrops.js +37 -174
- package/dist/src/catalogue.d.ts +57 -21
- package/dist/src/catalogue.js +34 -15
- package/dist/src/codeLiteral.d.ts +41 -0
- package/dist/src/codeLiteral.js +51 -0
- package/dist/src/componentDocs.d.ts +86 -1
- package/dist/src/componentDocs.js +33 -3
- package/dist/src/controlKeys.d.ts +0 -1
- package/dist/src/controlKeys.js +2 -2
- package/dist/src/deviceDrawing.d.ts +114 -0
- package/dist/src/deviceDrawing.js +358 -0
- package/dist/src/deviceMenuView.d.ts +17 -0
- package/dist/src/deviceMenuView.js +22 -0
- package/dist/src/devicePicture.d.ts +57 -0
- package/dist/src/devicePicture.js +104 -0
- package/dist/src/deviceView.d.ts +172 -0
- package/dist/src/deviceView.js +111 -0
- package/dist/src/devices.d.ts +115 -0
- package/dist/src/devices.js +135 -0
- package/dist/src/docAnchors.d.ts +27 -0
- package/dist/src/docAnchors.js +33 -0
- package/dist/src/docPages.d.ts +203 -0
- package/dist/src/docPages.js +169 -0
- package/dist/src/embed.d.ts +32 -0
- package/dist/src/embed.js +24 -0
- package/dist/src/embedCode.d.ts +31 -0
- package/dist/src/embedCode.js +88 -0
- package/dist/src/frame/backdropPictures.d.ts +29 -0
- package/dist/src/frame/backdropPictures.js +187 -0
- package/dist/src/frame/checkStory.d.ts +6 -3
- package/dist/src/frame/checkStory.js +76 -5
- package/dist/src/frame/followTouch.d.ts +9 -0
- package/dist/src/frame/followTouch.js +43 -0
- package/dist/src/frame/frame.css +8 -3
- package/dist/src/frame/frameClock.d.ts +0 -1
- package/dist/src/frame/frameClock.js +0 -1
- package/dist/src/frame/frameStatus.d.ts +2 -1
- package/dist/src/frame/frameStatus.js +2 -1
- package/dist/src/frame/frameView.d.ts +0 -1
- package/dist/src/frame/frameView.js +1 -2
- package/dist/src/frame/matrixLayout.d.ts +0 -1
- package/dist/src/frame/matrixLayout.js +0 -1
- package/dist/src/frame/measureTools.d.ts +0 -1
- package/dist/src/frame/measureTools.js +0 -1
- package/dist/src/frame/mountFrame.d.ts +10 -3
- package/dist/src/frame/mountFrame.js +162 -63
- package/dist/src/frame/playStory.d.ts +0 -1
- package/dist/src/frame/playStory.js +0 -1
- package/dist/src/frame/pluginFrames.d.ts +31 -0
- package/dist/src/frame/pluginFrames.js +23 -0
- package/dist/src/frame/renderer.d.ts +50 -12
- package/dist/src/frame/renderer.js +27 -6
- package/dist/src/frame/settle.d.ts +0 -1
- package/dist/src/frame/settle.js +0 -1
- package/dist/src/frame/shellChannel.d.ts +47 -0
- package/dist/src/frame/shellChannel.js +39 -0
- package/dist/src/frame/spillOutline.d.ts +0 -1
- package/dist/src/frame/spillOutline.js +0 -1
- package/dist/src/frame/staleModule.d.ts +14 -2
- package/dist/src/frame/staleModule.js +19 -2
- package/dist/src/frame/storyCanvas.d.ts +0 -1
- package/dist/src/frame/storyCanvas.js +0 -1
- package/dist/src/frame/storyHooks.d.ts +0 -1
- package/dist/src/frame/storyHooks.js +0 -1
- package/dist/src/frame/storyModule.d.ts +13 -2
- package/dist/src/frame/storyModule.js +45 -3
- package/dist/src/frame/storyRun.d.ts +21 -4
- package/dist/src/frame/storyRun.js +100 -19
- package/dist/src/frame/touchDots.d.ts +0 -1
- package/dist/src/frame/touchDots.js +0 -1
- package/dist/src/frame/touchEvents.d.ts +0 -1
- package/dist/src/frame/touchEvents.js +0 -1
- package/dist/src/frame/touchGesture.d.ts +0 -1
- package/dist/src/frame/touchGesture.js +0 -1
- package/dist/src/frame/touchLayer.d.ts +3 -3
- package/dist/src/frame/touchLayer.js +4 -30
- package/dist/src/frame/touchScroll.d.ts +0 -1
- package/dist/src/frame/touchScroll.js +0 -1
- package/dist/src/frameOrigins.d.ts +62 -0
- package/dist/src/frameOrigins.js +49 -0
- package/dist/src/hotModules.d.ts +48 -0
- package/dist/src/hotModules.js +53 -0
- package/dist/src/jsxCode.d.ts +22 -0
- package/dist/src/jsxCode.js +36 -0
- package/dist/src/languages.d.ts +0 -1
- package/dist/src/languages.js +0 -1
- package/dist/src/liveErrors.d.ts +0 -1
- package/dist/src/liveErrors.js +0 -1
- package/dist/src/matrix.d.ts +0 -1
- package/dist/src/matrix.js +0 -1
- package/dist/src/messages.d.ts +28 -2
- package/dist/src/messages.js +24 -3
- package/dist/src/namedValues.d.ts +11 -1
- package/dist/src/namedValues.js +25 -2
- package/dist/src/namedViews.d.ts +1 -13
- package/dist/src/namedViews.js +30 -7
- package/dist/src/packedText.d.ts +21 -0
- package/dist/src/packedText.js +36 -0
- package/dist/src/pageAddress.d.ts +26 -0
- package/dist/src/pageAddress.js +39 -0
- package/dist/src/pageConfig.d.ts +3 -1
- package/dist/src/pageConfig.js +0 -1
- package/dist/src/pageTree.d.ts +79 -0
- package/dist/src/pageTree.js +108 -0
- package/dist/src/playTrace.d.ts +0 -1
- package/dist/src/playTrace.js +0 -1
- package/dist/src/plugin.d.ts +230 -0
- package/dist/src/plugin.js +12 -0
- package/dist/src/pluginReact.d.ts +23 -0
- package/dist/src/pluginReact.js +24 -0
- package/dist/src/previewRelay.d.ts +40 -0
- package/dist/src/previewRelay.js +69 -0
- package/dist/src/previewTexts.d.ts +26 -0
- package/dist/src/previewTexts.js +33 -0
- package/dist/src/previewView.d.ts +31 -0
- package/dist/src/previewView.js +264 -0
- package/dist/src/propGroups.d.ts +46 -0
- package/dist/src/propGroups.js +59 -0
- package/dist/src/realTouch.d.ts +1 -2
- package/dist/src/realTouch.js +1 -2
- package/dist/src/safeAreaParameter.d.ts +42 -0
- package/dist/src/safeAreaParameter.js +50 -0
- package/dist/src/search.d.ts +154 -0
- package/dist/src/search.js +265 -0
- package/dist/src/searchIndex.d.ts +61 -0
- package/dist/src/searchIndex.js +55 -0
- package/dist/src/searchMarks.d.ts +29 -0
- package/dist/src/searchMarks.js +165 -0
- package/dist/src/searchMatch.d.ts +58 -0
- package/dist/src/searchMatch.js +127 -0
- package/dist/src/shell/A11yTab.d.ts +0 -7
- package/dist/src/shell/A11yTab.js +4 -15
- package/dist/src/shell/AnchorScroll.d.ts +25 -0
- package/dist/src/shell/AnchorScroll.js +10 -0
- package/dist/src/shell/ApiReference.d.ts +12 -4
- package/dist/src/shell/ApiReference.js +74 -19
- package/dist/src/shell/AppearanceMenu.d.ts +1 -2
- package/dist/src/shell/AppearanceMenu.js +8 -5
- package/dist/src/shell/AudienceSections.d.ts +106 -0
- package/dist/src/shell/AudienceSections.js +154 -0
- package/dist/src/shell/AuthoredHome.d.ts +37 -0
- package/dist/src/shell/AuthoredHome.js +96 -0
- package/dist/src/shell/BoxWidth.d.ts +0 -1
- package/dist/src/shell/BoxWidth.js +0 -1
- package/dist/src/shell/ClockBar.d.ts +19 -0
- package/dist/src/shell/ClockBar.js +15 -0
- package/dist/src/shell/ClockControls.d.ts +5 -9
- package/dist/src/shell/ClockControls.js +13 -16
- package/dist/src/shell/Code.d.ts +0 -1
- package/dist/src/shell/Code.js +0 -1
- package/dist/src/shell/CodeTab.d.ts +0 -1
- package/dist/src/shell/CodeTab.js +2 -2
- package/dist/src/shell/CodeText.d.ts +0 -1
- package/dist/src/shell/CodeText.js +0 -1
- package/dist/src/shell/CompareGrid.d.ts +37 -0
- package/dist/src/shell/CompareGrid.js +24 -0
- package/dist/src/shell/ComponentPage.d.ts +45 -7
- package/dist/src/shell/ComponentPage.js +107 -49
- package/dist/src/shell/ControlKeyField.d.ts +0 -1
- package/dist/src/shell/ControlKeyField.js +3 -4
- package/dist/src/shell/ControlRow.d.ts +4 -4
- package/dist/src/shell/ControlRow.js +5 -5
- package/dist/src/shell/DeviceControl.d.ts +31 -0
- package/dist/src/shell/DeviceControl.js +33 -0
- package/dist/src/shell/DeviceSlot.d.ts +114 -0
- package/dist/src/shell/DeviceSlot.js +134 -0
- package/dist/src/shell/DocBlocks.d.ts +100 -0
- package/dist/src/shell/DocBlocks.js +206 -0
- package/dist/src/shell/DocContainers.d.ts +70 -0
- package/dist/src/shell/DocContainers.js +94 -0
- package/dist/src/shell/DocContents.d.ts +29 -0
- package/dist/src/shell/DocContents.js +88 -0
- package/dist/src/shell/DocPage.d.ts +69 -0
- package/dist/src/shell/DocPage.js +141 -0
- package/dist/src/shell/Dock.d.ts +1 -2
- package/dist/src/shell/Dock.js +1 -2
- package/dist/src/shell/DroppedArgsList.d.ts +26 -0
- package/dist/src/shell/DroppedArgsList.js +8 -0
- package/dist/src/shell/DroppedArgsNote.d.ts +14 -0
- package/dist/src/shell/DroppedArgsNote.js +10 -0
- package/dist/src/shell/EmbedButton.d.ts +19 -0
- package/dist/src/shell/EmbedButton.js +96 -0
- package/dist/src/shell/EmbedPage.d.ts +23 -0
- package/dist/src/shell/EmbedPage.js +168 -0
- package/dist/src/shell/EmbedPanel.d.ts +25 -0
- package/dist/src/shell/EmbedPanel.js +46 -0
- package/dist/src/shell/EventsTab.d.ts +0 -1
- package/dist/src/shell/EventsTab.js +2 -3
- package/dist/src/shell/Example.d.ts +20 -2
- package/dist/src/shell/Example.js +75 -22
- package/dist/src/shell/FrameView.d.ts +1 -2
- package/dist/src/shell/FrameView.js +4 -4
- package/dist/src/shell/HomePage.d.ts +78 -4
- package/dist/src/shell/HomePage.js +53 -14
- package/dist/src/shell/HomePieces.d.ts +40 -0
- package/dist/src/shell/HomePieces.js +29 -0
- package/dist/src/shell/InfoTip.d.ts +0 -1
- package/dist/src/shell/InfoTip.js +0 -1
- package/dist/src/shell/InteractionsTab.d.ts +0 -7
- package/dist/src/shell/InteractionsTab.js +3 -9
- package/dist/src/shell/LazyHost.d.ts +16 -0
- package/dist/src/shell/LazyHost.js +42 -0
- package/dist/src/shell/LazyPage.d.ts +24 -0
- package/dist/src/shell/LazyPage.js +9 -0
- package/dist/src/shell/LogicMark.d.ts +9 -0
- package/dist/src/shell/LogicMark.js +5 -0
- package/dist/src/shell/MatrixPicker.d.ts +0 -1
- package/dist/src/shell/MatrixPicker.js +0 -1
- package/dist/src/shell/NamedViews.d.ts +0 -1
- package/dist/src/shell/NamedViews.js +4 -5
- package/dist/src/shell/PackageHtml.d.ts +0 -1
- package/dist/src/shell/PackageHtml.js +0 -1
- package/dist/src/shell/PartsTab.d.ts +0 -7
- package/dist/src/shell/PartsTab.js +3 -13
- package/dist/src/shell/PinnedControl.d.ts +0 -1
- package/dist/src/shell/PinnedControl.js +2 -2
- package/dist/src/shell/PluginBlockHost.d.ts +46 -0
- package/dist/src/shell/PluginBlockHost.js +39 -0
- package/dist/src/shell/PluginTabHost.d.ts +32 -0
- package/dist/src/shell/PluginTabHost.js +25 -0
- package/dist/src/shell/PluginViewHost.d.ts +37 -0
- package/dist/src/shell/PluginViewHost.js +89 -0
- package/dist/src/shell/PropFields.d.ts +0 -1
- package/dist/src/shell/PropFields.js +0 -1
- package/dist/src/shell/PropsTab.d.ts +11 -2
- package/dist/src/shell/PropsTab.js +31 -5
- package/dist/src/shell/SearchPanel.d.ts +63 -0
- package/dist/src/shell/SearchPanel.js +209 -0
- package/dist/src/shell/Segmented.d.ts +0 -1
- package/dist/src/shell/Segmented.js +0 -1
- package/dist/src/shell/Shell.d.ts +34 -6
- package/dist/src/shell/Shell.js +292 -84
- package/dist/src/shell/Sidebar.d.ts +20 -5
- package/dist/src/shell/Sidebar.js +23 -56
- package/dist/src/shell/SidebarDocs.d.ts +38 -0
- package/dist/src/shell/SidebarDocs.js +30 -0
- package/dist/src/shell/SidebarEntries.d.ts +10 -2
- package/dist/src/shell/SidebarEntries.js +3 -3
- package/dist/src/shell/SidebarHandle.d.ts +0 -1
- package/dist/src/shell/SidebarHandle.js +0 -1
- package/dist/src/shell/SidebarSearch.d.ts +40 -0
- package/dist/src/shell/SidebarSearch.js +85 -0
- package/dist/src/shell/SignatureReference.d.ts +25 -0
- package/dist/src/shell/SignatureReference.js +25 -0
- package/dist/src/shell/Stage.d.ts +9 -4
- package/dist/src/shell/Stage.js +121 -60
- package/dist/src/shell/StageCompare.d.ts +14 -0
- package/dist/src/shell/StageCompare.js +11 -0
- package/dist/src/shell/StageTools.d.ts +0 -1
- package/dist/src/shell/StageTools.js +0 -1
- package/dist/src/shell/StageViewport.d.ts +7 -3
- package/dist/src/shell/StageViewport.js +4 -5
- package/dist/src/shell/StoryBar.d.ts +40 -0
- package/dist/src/shell/StoryBar.js +23 -0
- package/dist/src/shell/StoryCodeBlock.d.ts +1 -2
- package/dist/src/shell/StoryCodeBlock.js +0 -1
- package/dist/src/shell/StoryCoverage.d.ts +36 -0
- package/dist/src/shell/StoryCoverage.js +126 -0
- package/dist/src/shell/StoryPicker.d.ts +0 -1
- package/dist/src/shell/StoryPicker.js +0 -1
- package/dist/src/shell/Toolbar.d.ts +9 -3
- package/dist/src/shell/Toolbar.js +12 -7
- package/dist/src/shell/ToolbarControl.d.ts +6 -8
- package/dist/src/shell/ToolbarControl.js +28 -20
- package/dist/src/shell/UsedIn.d.ts +5 -6
- package/dist/src/shell/UsedIn.js +7 -20
- package/dist/src/shell/ViewMenu.d.ts +7 -7
- package/dist/src/shell/ViewMenu.js +61 -176
- package/dist/src/shell/ViewMenuPanel.d.ts +41 -0
- package/dist/src/shell/ViewMenuPanel.js +199 -0
- package/dist/src/shell/WidthField.d.ts +3 -2
- package/dist/src/shell/WidthField.js +2 -3
- package/dist/src/shell/asideStory.d.ts +34 -0
- package/dist/src/shell/asideStory.js +55 -0
- package/dist/src/shell/audienceLayout.d.ts +39 -0
- package/dist/src/shell/audienceLayout.js +33 -0
- package/dist/src/shell/audiencePage.d.ts +113 -0
- package/dist/src/shell/audiencePage.js +144 -0
- package/dist/src/shell/audienceSections.css +95 -0
- package/dist/src/shell/catalogueContext.d.ts +24 -2
- package/dist/src/shell/catalogueContext.js +12 -9
- package/dist/src/shell/codeTokens.d.ts +0 -1
- package/dist/src/shell/codeTokens.js +0 -1
- package/dist/src/shell/codeWriter.d.ts +0 -1
- package/dist/src/shell/codeWriter.js +0 -1
- package/dist/src/shell/compareVariants.d.ts +3 -3
- package/dist/src/shell/compareVariants.js +6 -5
- package/dist/src/shell/controlCycle.d.ts +0 -1
- package/dist/src/shell/controlCycle.js +13 -1
- package/dist/src/shell/controlLabel.d.ts +7 -0
- package/dist/src/shell/controlLabel.js +17 -0
- package/dist/src/shell/device/deviceFrame.css +42 -0
- package/dist/src/shell/device/deviceParts.d.ts +90 -0
- package/dist/src/shell/device/deviceParts.js +120 -0
- package/dist/src/shell/docPage.css +451 -0
- package/dist/src/shell/dockTabs.d.ts +15 -4
- package/dist/src/shell/dockTabs.js +69 -26
- package/dist/src/shell/embed.css +74 -0
- package/dist/src/shell/filesCode.d.ts +21 -0
- package/dist/src/shell/filesCode.js +37 -0
- package/dist/src/shell/forgebookMark.d.ts +15 -0
- package/dist/src/shell/forgebookMark.js +28 -0
- package/dist/src/shell/framesOrigin.d.ts +23 -0
- package/dist/src/shell/framesOrigin.js +69 -0
- package/dist/src/shell/icons.d.ts +4 -1
- package/dist/src/shell/icons.js +4 -1
- package/dist/src/shell/keyboard.d.ts +0 -1
- package/dist/src/shell/keyboard.js +0 -1
- package/dist/src/shell/laterStrings.d.ts +91 -0
- package/dist/src/shell/laterStrings.js +102 -0
- package/dist/src/shell/lazyModule.d.ts +49 -0
- package/dist/src/shell/lazyModule.js +72 -0
- package/dist/src/shell/lazyTab.d.ts +21 -0
- package/dist/src/shell/lazyTab.js +9 -0
- package/dist/src/shell/logicView.d.ts +24 -0
- package/dist/src/shell/logicView.js +39 -0
- package/dist/src/shell/mountShell.d.ts +5 -3
- package/dist/src/shell/mountShell.js +43 -12
- package/dist/src/shell/pageStrings.d.ts +24 -0
- package/dist/src/shell/pageStrings.js +26 -0
- package/dist/src/shell/pluginHosts.d.ts +9 -0
- package/dist/src/shell/pluginHosts.js +6 -0
- package/dist/src/shell/pluginHostsContext.d.ts +20 -0
- package/dist/src/shell/pluginHostsContext.js +16 -0
- package/dist/src/shell/pluginTabs.d.ts +63 -0
- package/dist/src/shell/pluginTabs.js +60 -0
- package/dist/src/shell/search.css +172 -0
- package/dist/src/shell/searchStrings.d.ts +24 -0
- package/dist/src/shell/searchStrings.js +31 -0
- package/dist/src/shell/shell.css +310 -136
- package/dist/src/shell/shellScheme.d.ts +37 -0
- package/dist/src/shell/shellScheme.js +32 -0
- package/dist/src/shell/storyTouch.d.ts +19 -6
- package/dist/src/shell/storyTouch.js +26 -4
- package/dist/src/shell/strings.d.ts +62 -80
- package/dist/src/shell/strings.js +60 -79
- package/dist/src/shell/switchView.d.ts +0 -1
- package/dist/src/shell/switchView.js +0 -1
- package/dist/src/shell/tabSummaries.d.ts +31 -0
- package/dist/src/shell/tabSummaries.js +27 -0
- package/dist/src/shell/treeSearch.d.ts +39 -3
- package/dist/src/shell/treeSearch.js +27 -1
- package/dist/src/shell/useAddressArgs.d.ts +55 -0
- package/dist/src/shell/useAddressArgs.js +62 -0
- package/dist/src/shell/useAnchorScroll.d.ts +24 -0
- package/dist/src/shell/useAnchorScroll.js +90 -0
- package/dist/src/shell/useAppearance.d.ts +7 -2
- package/dist/src/shell/useAppearance.js +14 -5
- package/dist/src/shell/useComponentDocs.d.ts +0 -1
- package/dist/src/shell/useComponentDocs.js +0 -1
- package/dist/src/shell/useControlKeys.d.ts +2 -1
- package/dist/src/shell/useControlKeys.js +2 -3
- package/dist/src/shell/useCopy.d.ts +2 -1
- package/dist/src/shell/useCopy.js +11 -6
- package/dist/src/shell/useFold.d.ts +0 -1
- package/dist/src/shell/useFold.js +0 -1
- package/dist/src/shell/useFrameMessages.d.ts +19 -4
- package/dist/src/shell/useFrameMessages.js +23 -7
- package/dist/src/shell/useFrameQueue.d.ts +7 -3
- package/dist/src/shell/useFrameQueue.js +39 -22
- package/dist/src/shell/useFullPage.d.ts +0 -1
- package/dist/src/shell/useFullPage.js +0 -1
- package/dist/src/shell/useLiveView.d.ts +0 -1
- package/dist/src/shell/useLiveView.js +0 -1
- package/dist/src/shell/useLoaded.d.ts +1 -2
- package/dist/src/shell/useLoaded.js +28 -6
- package/dist/src/shell/usePageDoc.d.ts +0 -1
- package/dist/src/shell/usePageDoc.js +0 -1
- package/dist/src/shell/usePageFrames.d.ts +46 -0
- package/dist/src/shell/usePageFrames.js +50 -0
- package/dist/src/shell/usePluginTabs.d.ts +18 -0
- package/dist/src/shell/usePluginTabs.js +45 -0
- package/dist/src/shell/usePopover.d.ts +0 -1
- package/dist/src/shell/usePopover.js +0 -1
- package/dist/src/shell/useProseLinks.d.ts +14 -0
- package/dist/src/shell/useProseLinks.js +30 -0
- package/dist/src/shell/useRecentPages.d.ts +3 -4
- package/dist/src/shell/useRecentPages.js +1 -2
- package/dist/src/shell/useScrollMemory.d.ts +9 -1
- package/dist/src/shell/useScrollMemory.js +2 -3
- package/dist/src/shell/useSearchIndex.d.ts +24 -0
- package/dist/src/shell/useSearchIndex.js +51 -0
- package/dist/src/shell/useShownView.d.ts +35 -0
- package/dist/src/shell/useShownView.js +36 -0
- package/dist/src/shell/useSidebarLayout.d.ts +0 -1
- package/dist/src/shell/useSidebarLayout.js +0 -1
- package/dist/src/shell/useStored.d.ts +13 -1
- package/dist/src/shell/useStored.js +13 -5
- package/dist/src/shell/useStoryCheck.d.ts +20 -0
- package/dist/src/shell/useStoryCheck.js +33 -0
- package/dist/src/shell/useStoryCode.d.ts +0 -1
- package/dist/src/shell/useStoryCode.js +0 -1
- package/dist/src/shell/useStoryHeights.d.ts +0 -1
- package/dist/src/shell/useStoryHeights.js +0 -1
- package/dist/src/shell/useStoryIdsElement.d.ts +0 -1
- package/dist/src/shell/useStoryIdsElement.js +0 -1
- package/dist/src/shell/useStoryKeys.d.ts +0 -1
- package/dist/src/shell/useStoryKeys.js +0 -1
- package/dist/src/shell/useSyncedTab.d.ts +8 -0
- package/dist/src/shell/useSyncedTab.js +60 -0
- package/dist/src/shell/useSystemDark.d.ts +0 -1
- package/dist/src/shell/useSystemDark.js +0 -1
- package/dist/src/shell/useToolbarLayout.d.ts +0 -1
- package/dist/src/shell/useToolbarLayout.js +0 -1
- package/dist/src/shell/useToolbarOverflow.d.ts +0 -1
- package/dist/src/shell/useToolbarOverflow.js +0 -1
- package/dist/src/shell/useWorstCase.d.ts +0 -1
- package/dist/src/shell/useWorstCase.js +2 -2
- package/dist/src/shell/worstArgs.d.ts +0 -1
- package/dist/src/shell/worstArgs.js +0 -1
- package/dist/src/shellTheme.d.ts +64 -0
- package/dist/src/shellTheme.js +274 -0
- package/dist/src/shellTheme.types.d.ts +93 -0
- package/dist/src/shellTheme.types.js +10 -0
- package/dist/src/sourceFiles.d.ts +17 -3
- package/dist/src/sourceFiles.js +27 -1
- package/dist/src/spills.d.ts +0 -1
- package/dist/src/spills.js +0 -1
- package/dist/src/storyBackground.d.ts +0 -1
- package/dist/src/storyBackground.js +0 -1
- package/dist/src/storyCheck.d.ts +88 -2
- package/dist/src/storyCheck.js +12 -2
- package/dist/src/storyClock.d.ts +0 -1
- package/dist/src/storyClock.js +0 -1
- package/dist/src/storyGlobals.d.ts +0 -1
- package/dist/src/storyGlobals.js +0 -1
- package/dist/src/storyHeights.d.ts +0 -1
- package/dist/src/storyHeights.js +0 -1
- package/dist/src/storyIds.d.ts +36 -0
- package/dist/src/storyIds.js +52 -0
- package/dist/src/storyIdsElement.d.ts +0 -1
- package/dist/src/storyIdsElement.js +0 -1
- package/dist/src/storyTexts.d.ts +11 -5
- package/dist/src/storyTexts.js +16 -5
- package/dist/src/storyTree.d.ts +88 -25
- package/dist/src/storyTree.js +219 -126
- package/dist/src/switches.d.ts +0 -1
- package/dist/src/switches.js +6 -2
- package/dist/src/toolbarLayout.d.ts +0 -1
- package/dist/src/toolbarLayout.js +0 -1
- package/dist/src/treePlaces.d.ts +60 -0
- package/dist/src/treePlaces.js +89 -0
- package/dist/src/usedIn.d.ts +28 -1
- package/dist/src/usedIn.js +93 -3
- package/dist/src/viewState.d.ts +37 -9
- package/dist/src/viewState.js +67 -9
- package/dist/src/viewWords.d.ts +0 -13
- package/dist/src/viewWords.js +41 -3
- package/dist/src/vite/adapter.d.ts +62 -1
- package/dist/src/vite/adapter.js +20 -2
- package/dist/src/vite/agent.types.d.ts +281 -7
- package/dist/src/vite/agent.types.js +11 -1
- package/dist/src/vite/agentApi.d.ts +55 -2
- package/dist/src/vite/agentApi.js +131 -8
- package/dist/src/vite/agentIds.d.ts +25 -0
- package/dist/src/vite/agentIds.js +41 -0
- package/dist/src/vite/agentIndex.d.ts +63 -0
- package/dist/src/vite/agentIndex.js +91 -0
- package/dist/src/vite/agentIndexRoute.d.ts +10 -0
- package/dist/src/vite/agentIndexRoute.js +35 -0
- package/dist/src/vite/agentRoutes.d.ts +80 -19
- package/dist/src/vite/agentRoutes.js +167 -24
- package/dist/src/vite/autoTitle.d.ts +0 -1
- package/dist/src/vite/autoTitle.js +0 -1
- package/dist/src/vite/axeScript.d.ts +20 -0
- package/dist/src/vite/axeScript.js +60 -0
- package/dist/src/vite/builtTexts.d.ts +75 -0
- package/dist/src/vite/builtTexts.js +142 -0
- package/dist/src/vite/catalogueConfig.d.ts +10 -0
- package/dist/src/vite/catalogueConfig.js +64 -0
- package/dist/src/vite/checkCode.d.ts +67 -0
- package/dist/src/vite/checkCode.js +145 -0
- package/dist/src/vite/closeWatch.d.ts +96 -0
- package/dist/src/vite/closeWatch.js +219 -0
- package/dist/src/vite/codeFence.d.ts +78 -0
- package/dist/src/vite/codeFence.js +267 -0
- package/dist/src/vite/componentImport.d.ts +8 -0
- package/dist/src/vite/componentImport.js +35 -0
- package/dist/src/vite/componentPage.d.ts +15 -2
- package/dist/src/vite/componentPage.js +55 -16
- package/dist/src/vite/config.d.ts +51 -3
- package/dist/src/vite/config.js +0 -1
- package/dist/src/vite/configFile.d.ts +65 -9
- package/dist/src/vite/configFile.js +182 -28
- package/dist/src/vite/designTokens.d.ts +75 -0
- package/dist/src/vite/designTokens.js +382 -0
- package/dist/src/vite/diskCache.d.ts +51 -0
- package/dist/src/vite/diskCache.js +211 -0
- package/dist/src/vite/docDirectives.d.ts +116 -0
- package/dist/src/vite/docDirectives.js +425 -0
- package/dist/src/vite/docMarkdown.d.ts +76 -0
- package/dist/src/vite/docMarkdown.js +150 -0
- package/dist/src/vite/docPageBlocks.d.ts +64 -0
- package/dist/src/vite/docPageBlocks.js +322 -0
- package/dist/src/vite/docPageLinks.d.ts +72 -0
- package/dist/src/vite/docPageLinks.js +135 -0
- package/dist/src/vite/docPageMarkdown.d.ts +86 -0
- package/dist/src/vite/docPageMarkdown.js +133 -0
- package/dist/src/vite/docPageRender.d.ts +27 -0
- package/dist/src/vite/docPageRender.js +199 -0
- package/dist/src/vite/docPageTokens.d.ts +91 -0
- package/dist/src/vite/docPageTokens.js +186 -0
- package/dist/src/vite/docPagesModule.d.ts +50 -0
- package/dist/src/vite/docPagesModule.js +118 -0
- package/dist/src/vite/docPagesRoute.d.ts +38 -0
- package/dist/src/vite/docPagesRoute.js +154 -0
- package/dist/src/vite/docsDependencies.d.ts +6 -0
- package/dist/src/vite/docsDependencies.js +150 -0
- package/dist/src/vite/docsExtractor.d.ts +44 -3
- package/dist/src/vite/docsExtractor.js +160 -26
- package/dist/src/vite/docsProgram.d.ts +89 -9
- package/dist/src/vite/docsProgram.js +413 -50
- package/dist/src/vite/docsWorker.d.ts +0 -1
- package/dist/src/vite/docsWorker.js +49 -15
- package/dist/src/vite/figmaLink.d.ts +26 -0
- package/dist/src/vite/figmaLink.js +92 -0
- package/dist/src/vite/findComponent.d.ts +32 -0
- package/dist/src/vite/findComponent.js +52 -0
- package/dist/src/vite/findRoute.d.ts +14 -0
- package/dist/src/vite/findRoute.js +62 -0
- package/dist/src/vite/forcedStates.d.ts +0 -1
- package/dist/src/vite/forcedStates.js +0 -1
- package/dist/src/vite/forgebookPlugin.d.ts +1 -2
- package/dist/src/vite/forgebookPlugin.js +330 -263
- package/dist/src/vite/framesConfig.d.ts +89 -0
- package/dist/src/vite/framesConfig.js +149 -0
- package/dist/src/vite/framesServer.d.ts +43 -0
- package/dist/src/vite/framesServer.js +326 -0
- package/dist/src/vite/functionComponentDocs.d.ts +26 -0
- package/dist/src/vite/functionComponentDocs.js +193 -0
- package/dist/src/vite/gitChange.d.ts +56 -0
- package/dist/src/vite/gitChange.js +86 -0
- package/dist/src/vite/heightsRoute.d.ts +24 -0
- package/dist/src/vite/heightsRoute.js +42 -0
- package/dist/src/vite/highlightCode.d.ts +0 -1
- package/dist/src/vite/highlightCode.js +8 -27
- package/dist/src/vite/hotSnippets.d.ts +86 -0
- package/dist/src/vite/hotSnippets.js +168 -0
- package/dist/src/vite/indexFields.d.ts +61 -0
- package/dist/src/vite/indexFields.js +149 -0
- package/dist/src/vite/indexStoryFile.d.ts +20 -19
- package/dist/src/vite/indexStoryFile.js +172 -201
- package/dist/src/vite/indexedParameters.d.ts +10 -0
- package/dist/src/vite/indexedParameters.js +110 -0
- package/dist/src/vite/mcpProtocol.d.ts +36 -2
- package/dist/src/vite/mcpProtocol.js +100 -15
- package/dist/src/vite/moduleSummary.d.ts +17 -0
- package/dist/src/vite/moduleSummary.js +40 -0
- package/dist/src/vite/nearestToken.d.ts +50 -0
- package/dist/src/vite/nearestToken.js +295 -0
- package/dist/src/vite/originGuard.d.ts +87 -0
- package/dist/src/vite/originGuard.js +163 -0
- package/dist/src/vite/packedModule.d.ts +40 -0
- package/dist/src/vite/packedModule.js +74 -0
- package/dist/src/vite/pages.d.ts +63 -10
- package/dist/src/vite/pages.js +264 -33
- package/dist/src/vite/parsedFiles.d.ts +18 -0
- package/dist/src/vite/parsedFiles.js +91 -0
- package/dist/src/vite/plainGrammars.d.ts +20 -0
- package/dist/src/vite/plainGrammars.js +113 -0
- package/dist/src/vite/pluginConfig.d.ts +47 -0
- package/dist/src/vite/pluginConfig.js +220 -0
- package/dist/src/vite/pluginIds.d.ts +20 -0
- package/dist/src/vite/pluginIds.js +61 -0
- package/dist/src/vite/pluginModules.d.ts +140 -0
- package/dist/src/vite/pluginModules.js +176 -0
- package/dist/src/vite/prebundled.d.ts +18 -5
- package/dist/src/vite/prebundled.js +28 -18
- package/dist/src/vite/previewPages.d.ts +14 -0
- package/dist/src/vite/previewPages.js +81 -0
- package/dist/src/vite/previewRoute.d.ts +8 -0
- package/dist/src/vite/previewRoute.js +8 -0
- package/dist/src/vite/previewRunner.d.ts +56 -0
- package/dist/src/vite/previewRunner.js +207 -0
- package/dist/src/vite/propDocs.d.ts +60 -0
- package/dist/src/vite/propDocs.js +387 -0
- package/dist/src/vite/searchModule.d.ts +40 -0
- package/dist/src/vite/searchModule.js +212 -0
- package/dist/src/vite/searchRoute.d.ts +7 -0
- package/dist/src/vite/searchRoute.js +79 -0
- package/dist/src/vite/serverConditions.d.ts +31 -0
- package/dist/src/vite/serverConditions.js +69 -0
- package/dist/src/vite/signatureDocs.d.ts +18 -0
- package/dist/src/vite/signatureDocs.js +64 -0
- package/dist/src/vite/sourceTokens.d.ts +57 -0
- package/dist/src/vite/sourceTokens.js +164 -0
- package/dist/src/vite/storyCode.d.ts +0 -1
- package/dist/src/vite/storyCode.js +2 -3
- package/dist/src/vite/storyExports.d.ts +32 -0
- package/dist/src/vite/storyExports.js +27 -0
- package/dist/src/vite/storyFilesModule.d.ts +56 -4
- package/dist/src/vite/storyFilesModule.js +122 -34
- package/dist/src/vite/storyMeta.d.ts +20 -11
- package/dist/src/vite/storyMeta.js +74 -38
- package/dist/src/vite/storyParse.d.ts +18 -0
- package/dist/src/vite/storyParse.js +20 -0
- package/dist/src/vite/storyPlay.d.ts +29 -0
- package/dist/src/vite/storyPlay.js +54 -0
- package/dist/src/vite/storyReach.d.ts +42 -0
- package/dist/src/vite/storyReach.js +43 -0
- package/dist/src/vite/storylessRoutes.d.ts +29 -0
- package/dist/src/vite/storylessRoutes.js +126 -0
- package/dist/src/vite/textModules.d.ts +63 -0
- package/dist/src/vite/textModules.js +132 -0
- package/dist/src/vite/textQueries.d.ts +20 -0
- package/dist/src/vite/textQueries.js +20 -0
- package/dist/src/vite/themeFromTokens.d.ts +35 -0
- package/dist/src/vite/themeFromTokens.js +73 -0
- package/dist/src/vite/tokenAnswers.d.ts +20 -0
- package/dist/src/vite/tokenAnswers.js +86 -0
- package/dist/src/vite/tokenClashes.d.ts +44 -0
- package/dist/src/vite/tokenClashes.js +45 -0
- package/dist/src/vite/touchMedia.d.ts +0 -1
- package/dist/src/vite/touchMedia.js +0 -1
- package/dist/src/vite/typeScriptPieces.d.ts +0 -1
- package/dist/src/vite/typeScriptPieces.js +2 -3
- package/dist/src/vite/usageGraph.d.ts +6 -1
- package/dist/src/vite/usageGraph.js +41 -7
- package/dist/src/vite/usageGuidance.d.ts +33 -0
- package/dist/src/vite/usageGuidance.js +45 -0
- package/dist/src/vite/usageModule.d.ts +0 -1
- package/dist/src/vite/usageModule.js +0 -1
- package/dist/src/vite/vitePaths.d.ts +53 -0
- package/dist/src/vite/vitePaths.js +53 -0
- package/dist/src/worstCase.d.ts +0 -1
- package/dist/src/worstCase.js +0 -1
- package/package.json +66 -3
- package/dist/bin/forgebook/agentClient.d.ts.map +0 -1
- package/dist/bin/forgebook/agentClient.js.map +0 -1
- package/dist/bin/forgebook/agentLoopCommands.d.mts.map +0 -1
- package/dist/bin/forgebook/agentLoopCommands.mjs.map +0 -1
- package/dist/bin/forgebook/agentText.d.ts.map +0 -1
- package/dist/bin/forgebook/agentText.js.map +0 -1
- package/dist/bin/forgebook/agentsText.d.ts.map +0 -1
- package/dist/bin/forgebook/agentsText.js.map +0 -1
- package/dist/bin/forgebook/catalogueCommands.d.ts.map +0 -1
- package/dist/bin/forgebook/catalogueCommands.js.map +0 -1
- package/dist/bin/forgebook/catalogueVite.d.ts.map +0 -1
- package/dist/bin/forgebook/catalogueVite.js.map +0 -1
- package/dist/bin/forgebook/errorsRun.d.ts.map +0 -1
- package/dist/bin/forgebook/errorsRun.js.map +0 -1
- package/dist/bin/forgebook/forgebook.d.mts.map +0 -1
- package/dist/bin/forgebook/forgebook.mjs.map +0 -1
- package/dist/bin/forgebook/importers/storybook.d.ts.map +0 -1
- package/dist/bin/forgebook/importers/storybook.js.map +0 -1
- package/dist/bin/forgebook/initCommands.d.mts.map +0 -1
- package/dist/bin/forgebook/initCommands.mjs.map +0 -1
- package/dist/bin/forgebook/initConfig.d.ts.map +0 -1
- package/dist/bin/forgebook/initConfig.js.map +0 -1
- package/dist/bin/forgebook/mcpTools.d.ts.map +0 -1
- package/dist/bin/forgebook/mcpTools.js.map +0 -1
- package/dist/bin/forgebook/newStories.d.ts.map +0 -1
- package/dist/bin/forgebook/newStories.js.map +0 -1
- package/dist/bin/forgebook/newStoriesFile.d.ts.map +0 -1
- package/dist/bin/forgebook/newStoriesFile.js.map +0 -1
- package/dist/bin/forgebook/storyCheckRun.d.ts.map +0 -1
- package/dist/bin/forgebook/storyCheckRun.js.map +0 -1
- package/dist/bin/forgebook/touchWindowRun.d.ts.map +0 -1
- package/dist/bin/forgebook/touchWindowRun.js.map +0 -1
- package/dist/bin/forgebook-docs/catalogueDocs.d.ts.map +0 -1
- package/dist/bin/forgebook-docs/catalogueDocs.js.map +0 -1
- package/dist/bin/forgebook-docs/catalogueDocs.types.d.ts.map +0 -1
- package/dist/bin/forgebook-docs/catalogueDocs.types.js.map +0 -1
- package/dist/bin/forgebook-docs/catalogueMarkdown.d.ts.map +0 -1
- package/dist/bin/forgebook-docs/catalogueMarkdown.js.map +0 -1
- package/dist/bin/forgebook-docs/catalogueOptions.d.ts.map +0 -1
- package/dist/bin/forgebook-docs/catalogueOptions.js.map +0 -1
- package/dist/bin/forgebook-docs/collectDocs.d.ts.map +0 -1
- package/dist/bin/forgebook-docs/collectDocs.js.map +0 -1
- package/dist/bin/forgebook-docs/forgebook-docs.d.mts.map +0 -1
- package/dist/bin/forgebook-docs/forgebook-docs.mjs.map +0 -1
- package/dist/bin/forgebook-docs/llmsText.d.ts.map +0 -1
- package/dist/bin/forgebook-docs/llmsText.js.map +0 -1
- package/dist/bin/forgebook-docs/moduleDocs.d.ts.map +0 -1
- package/dist/bin/forgebook-docs/moduleDocs.js.map +0 -1
- package/dist/bin/forgebook-docs/sassDocs.d.ts.map +0 -1
- package/dist/bin/forgebook-docs/sassDocs.js.map +0 -1
- package/dist/bin/forgebook-docs/sourceId.d.ts +0 -9
- package/dist/bin/forgebook-docs/sourceId.d.ts.map +0 -1
- package/dist/bin/forgebook-docs/sourceId.js +0 -45
- package/dist/bin/forgebook-docs/sourceId.js.map +0 -1
- package/dist/bin/forgebook-texts/forgebook-texts.d.mts.map +0 -1
- package/dist/bin/forgebook-texts/forgebook-texts.mjs.map +0 -1
- package/dist/bin/forgebook-texts/storyTextsReport.d.ts.map +0 -1
- package/dist/bin/forgebook-texts/storyTextsReport.js.map +0 -1
- package/dist/bin/forgebook-texts/storyTextsReport.types.d.ts.map +0 -1
- package/dist/bin/forgebook-texts/storyTextsReport.types.js.map +0 -1
- package/dist/bin/frameworkDocs.d.ts.map +0 -1
- package/dist/bin/frameworkDocs.js.map +0 -1
- package/dist/src/a11y.d.ts.map +0 -1
- package/dist/src/a11y.js.map +0 -1
- package/dist/src/argTypes.d.ts.map +0 -1
- package/dist/src/argTypes.js.map +0 -1
- package/dist/src/backdrops.d.ts.map +0 -1
- package/dist/src/backdrops.js.map +0 -1
- package/dist/src/catalogue.d.ts.map +0 -1
- package/dist/src/catalogue.js.map +0 -1
- package/dist/src/componentDocs.d.ts.map +0 -1
- package/dist/src/componentDocs.js.map +0 -1
- package/dist/src/controlKeys.d.ts.map +0 -1
- package/dist/src/controlKeys.js.map +0 -1
- package/dist/src/frame/checkStory.d.ts.map +0 -1
- package/dist/src/frame/checkStory.js.map +0 -1
- package/dist/src/frame/frameClock.d.ts.map +0 -1
- package/dist/src/frame/frameClock.js.map +0 -1
- package/dist/src/frame/frameStatus.d.ts.map +0 -1
- package/dist/src/frame/frameStatus.js.map +0 -1
- package/dist/src/frame/frameView.d.ts.map +0 -1
- package/dist/src/frame/frameView.js.map +0 -1
- package/dist/src/frame/matrixLayout.d.ts.map +0 -1
- package/dist/src/frame/matrixLayout.js.map +0 -1
- package/dist/src/frame/measureTools.d.ts.map +0 -1
- package/dist/src/frame/measureTools.js.map +0 -1
- package/dist/src/frame/mountFrame.d.ts.map +0 -1
- package/dist/src/frame/mountFrame.js.map +0 -1
- package/dist/src/frame/playStory.d.ts.map +0 -1
- package/dist/src/frame/playStory.js.map +0 -1
- package/dist/src/frame/renderer.d.ts.map +0 -1
- package/dist/src/frame/renderer.js.map +0 -1
- package/dist/src/frame/settle.d.ts.map +0 -1
- package/dist/src/frame/settle.js.map +0 -1
- package/dist/src/frame/spillOutline.d.ts.map +0 -1
- package/dist/src/frame/spillOutline.js.map +0 -1
- package/dist/src/frame/staleModule.d.ts.map +0 -1
- package/dist/src/frame/staleModule.js.map +0 -1
- package/dist/src/frame/storyCanvas.d.ts.map +0 -1
- package/dist/src/frame/storyCanvas.js.map +0 -1
- package/dist/src/frame/storyHooks.d.ts.map +0 -1
- package/dist/src/frame/storyHooks.js.map +0 -1
- package/dist/src/frame/storyModule.d.ts.map +0 -1
- package/dist/src/frame/storyModule.js.map +0 -1
- package/dist/src/frame/storyRun.d.ts.map +0 -1
- package/dist/src/frame/storyRun.js.map +0 -1
- package/dist/src/frame/touchDots.d.ts.map +0 -1
- package/dist/src/frame/touchDots.js.map +0 -1
- package/dist/src/frame/touchEvents.d.ts.map +0 -1
- package/dist/src/frame/touchEvents.js.map +0 -1
- package/dist/src/frame/touchGesture.d.ts.map +0 -1
- package/dist/src/frame/touchGesture.js.map +0 -1
- package/dist/src/frame/touchLayer.d.ts.map +0 -1
- package/dist/src/frame/touchLayer.js.map +0 -1
- package/dist/src/frame/touchScroll.d.ts.map +0 -1
- package/dist/src/frame/touchScroll.js.map +0 -1
- package/dist/src/languages.d.ts.map +0 -1
- package/dist/src/languages.js.map +0 -1
- package/dist/src/liveErrors.d.ts.map +0 -1
- package/dist/src/liveErrors.js.map +0 -1
- package/dist/src/matrix.d.ts.map +0 -1
- package/dist/src/matrix.js.map +0 -1
- package/dist/src/messages.d.ts.map +0 -1
- package/dist/src/messages.js.map +0 -1
- package/dist/src/namedValues.d.ts.map +0 -1
- package/dist/src/namedValues.js.map +0 -1
- package/dist/src/namedViews.d.ts.map +0 -1
- package/dist/src/namedViews.js.map +0 -1
- package/dist/src/pageConfig.d.ts.map +0 -1
- package/dist/src/pageConfig.js.map +0 -1
- package/dist/src/playTrace.d.ts.map +0 -1
- package/dist/src/playTrace.js.map +0 -1
- package/dist/src/realTouch.d.ts.map +0 -1
- package/dist/src/realTouch.js.map +0 -1
- package/dist/src/shell/A11yTab.d.ts.map +0 -1
- package/dist/src/shell/A11yTab.js.map +0 -1
- package/dist/src/shell/ApiReference.d.ts.map +0 -1
- package/dist/src/shell/ApiReference.js.map +0 -1
- package/dist/src/shell/AppearanceMenu.d.ts.map +0 -1
- package/dist/src/shell/AppearanceMenu.js.map +0 -1
- package/dist/src/shell/BoxWidth.d.ts.map +0 -1
- package/dist/src/shell/BoxWidth.js.map +0 -1
- package/dist/src/shell/ClockControls.d.ts.map +0 -1
- package/dist/src/shell/ClockControls.js.map +0 -1
- package/dist/src/shell/Code.d.ts.map +0 -1
- package/dist/src/shell/Code.js.map +0 -1
- package/dist/src/shell/CodeTab.d.ts.map +0 -1
- package/dist/src/shell/CodeTab.js.map +0 -1
- package/dist/src/shell/CodeText.d.ts.map +0 -1
- package/dist/src/shell/CodeText.js.map +0 -1
- package/dist/src/shell/ComponentPage.d.ts.map +0 -1
- package/dist/src/shell/ComponentPage.js.map +0 -1
- package/dist/src/shell/ControlKeyField.d.ts.map +0 -1
- package/dist/src/shell/ControlKeyField.js.map +0 -1
- package/dist/src/shell/ControlRow.d.ts.map +0 -1
- package/dist/src/shell/ControlRow.js.map +0 -1
- package/dist/src/shell/Dock.d.ts.map +0 -1
- package/dist/src/shell/Dock.js.map +0 -1
- package/dist/src/shell/EventsTab.d.ts.map +0 -1
- package/dist/src/shell/EventsTab.js.map +0 -1
- package/dist/src/shell/Example.d.ts.map +0 -1
- package/dist/src/shell/Example.js.map +0 -1
- package/dist/src/shell/FrameView.d.ts.map +0 -1
- package/dist/src/shell/FrameView.js.map +0 -1
- package/dist/src/shell/HomePage.d.ts.map +0 -1
- package/dist/src/shell/HomePage.js.map +0 -1
- package/dist/src/shell/InfoTip.d.ts.map +0 -1
- package/dist/src/shell/InfoTip.js.map +0 -1
- package/dist/src/shell/InteractionsTab.d.ts.map +0 -1
- package/dist/src/shell/InteractionsTab.js.map +0 -1
- package/dist/src/shell/MatrixPicker.d.ts.map +0 -1
- package/dist/src/shell/MatrixPicker.js.map +0 -1
- package/dist/src/shell/NamedViews.d.ts.map +0 -1
- package/dist/src/shell/NamedViews.js.map +0 -1
- package/dist/src/shell/PackageHtml.d.ts.map +0 -1
- package/dist/src/shell/PackageHtml.js.map +0 -1
- package/dist/src/shell/PartsTab.d.ts.map +0 -1
- package/dist/src/shell/PartsTab.js.map +0 -1
- package/dist/src/shell/PinnedControl.d.ts.map +0 -1
- package/dist/src/shell/PinnedControl.js.map +0 -1
- package/dist/src/shell/PropFields.d.ts.map +0 -1
- package/dist/src/shell/PropFields.js.map +0 -1
- package/dist/src/shell/PropsTab.d.ts.map +0 -1
- package/dist/src/shell/PropsTab.js.map +0 -1
- package/dist/src/shell/Segmented.d.ts.map +0 -1
- package/dist/src/shell/Segmented.js.map +0 -1
- package/dist/src/shell/Shell.d.ts.map +0 -1
- package/dist/src/shell/Shell.js.map +0 -1
- package/dist/src/shell/Sidebar.d.ts.map +0 -1
- package/dist/src/shell/Sidebar.js.map +0 -1
- package/dist/src/shell/SidebarEntries.d.ts.map +0 -1
- package/dist/src/shell/SidebarEntries.js.map +0 -1
- package/dist/src/shell/SidebarHandle.d.ts.map +0 -1
- package/dist/src/shell/SidebarHandle.js.map +0 -1
- package/dist/src/shell/Stage.d.ts.map +0 -1
- package/dist/src/shell/Stage.js.map +0 -1
- package/dist/src/shell/StageTools.d.ts.map +0 -1
- package/dist/src/shell/StageTools.js.map +0 -1
- package/dist/src/shell/StageViewport.d.ts.map +0 -1
- package/dist/src/shell/StageViewport.js.map +0 -1
- package/dist/src/shell/StoryCodeBlock.d.ts.map +0 -1
- package/dist/src/shell/StoryCodeBlock.js.map +0 -1
- package/dist/src/shell/StoryPicker.d.ts.map +0 -1
- package/dist/src/shell/StoryPicker.js.map +0 -1
- package/dist/src/shell/Toolbar.d.ts.map +0 -1
- package/dist/src/shell/Toolbar.js.map +0 -1
- package/dist/src/shell/ToolbarControl.d.ts.map +0 -1
- package/dist/src/shell/ToolbarControl.js.map +0 -1
- package/dist/src/shell/UsedIn.d.ts.map +0 -1
- package/dist/src/shell/UsedIn.js.map +0 -1
- package/dist/src/shell/ViewMenu.d.ts.map +0 -1
- package/dist/src/shell/ViewMenu.js.map +0 -1
- package/dist/src/shell/WidthField.d.ts.map +0 -1
- package/dist/src/shell/WidthField.js.map +0 -1
- package/dist/src/shell/catalogueContext.d.ts.map +0 -1
- package/dist/src/shell/catalogueContext.js.map +0 -1
- package/dist/src/shell/codeTokens.d.ts.map +0 -1
- package/dist/src/shell/codeTokens.js.map +0 -1
- package/dist/src/shell/codeWriter.d.ts.map +0 -1
- package/dist/src/shell/codeWriter.js.map +0 -1
- package/dist/src/shell/compareVariants.d.ts.map +0 -1
- package/dist/src/shell/compareVariants.js.map +0 -1
- package/dist/src/shell/controlCycle.d.ts.map +0 -1
- package/dist/src/shell/controlCycle.js.map +0 -1
- package/dist/src/shell/dockTabs.d.ts.map +0 -1
- package/dist/src/shell/dockTabs.js.map +0 -1
- package/dist/src/shell/icons.d.ts.map +0 -1
- package/dist/src/shell/icons.js.map +0 -1
- package/dist/src/shell/keyboard.d.ts.map +0 -1
- package/dist/src/shell/keyboard.js.map +0 -1
- package/dist/src/shell/mountShell.d.ts.map +0 -1
- package/dist/src/shell/mountShell.js.map +0 -1
- package/dist/src/shell/storyTouch.d.ts.map +0 -1
- package/dist/src/shell/storyTouch.js.map +0 -1
- package/dist/src/shell/strings.d.ts.map +0 -1
- package/dist/src/shell/strings.js.map +0 -1
- package/dist/src/shell/switchView.d.ts.map +0 -1
- package/dist/src/shell/switchView.js.map +0 -1
- package/dist/src/shell/treeSearch.d.ts.map +0 -1
- package/dist/src/shell/treeSearch.js.map +0 -1
- package/dist/src/shell/useAppearance.d.ts.map +0 -1
- package/dist/src/shell/useAppearance.js.map +0 -1
- package/dist/src/shell/useComponentDocs.d.ts.map +0 -1
- package/dist/src/shell/useComponentDocs.js.map +0 -1
- package/dist/src/shell/useControlKeys.d.ts.map +0 -1
- package/dist/src/shell/useControlKeys.js.map +0 -1
- package/dist/src/shell/useCopy.d.ts.map +0 -1
- package/dist/src/shell/useCopy.js.map +0 -1
- package/dist/src/shell/useFold.d.ts.map +0 -1
- package/dist/src/shell/useFold.js.map +0 -1
- package/dist/src/shell/useFrameMessages.d.ts.map +0 -1
- package/dist/src/shell/useFrameMessages.js.map +0 -1
- package/dist/src/shell/useFrameQueue.d.ts.map +0 -1
- package/dist/src/shell/useFrameQueue.js.map +0 -1
- package/dist/src/shell/useFullPage.d.ts.map +0 -1
- package/dist/src/shell/useFullPage.js.map +0 -1
- package/dist/src/shell/useLiveView.d.ts.map +0 -1
- package/dist/src/shell/useLiveView.js.map +0 -1
- package/dist/src/shell/useLoaded.d.ts.map +0 -1
- package/dist/src/shell/useLoaded.js.map +0 -1
- package/dist/src/shell/usePageDoc.d.ts.map +0 -1
- package/dist/src/shell/usePageDoc.js.map +0 -1
- package/dist/src/shell/usePopover.d.ts.map +0 -1
- package/dist/src/shell/usePopover.js.map +0 -1
- package/dist/src/shell/useRecentPages.d.ts.map +0 -1
- package/dist/src/shell/useRecentPages.js.map +0 -1
- package/dist/src/shell/useScrollMemory.d.ts.map +0 -1
- package/dist/src/shell/useScrollMemory.js.map +0 -1
- package/dist/src/shell/useSidebarLayout.d.ts.map +0 -1
- package/dist/src/shell/useSidebarLayout.js.map +0 -1
- package/dist/src/shell/useStored.d.ts.map +0 -1
- package/dist/src/shell/useStored.js.map +0 -1
- package/dist/src/shell/useStoryCode.d.ts.map +0 -1
- package/dist/src/shell/useStoryCode.js.map +0 -1
- package/dist/src/shell/useStoryHeights.d.ts.map +0 -1
- package/dist/src/shell/useStoryHeights.js.map +0 -1
- package/dist/src/shell/useStoryIdsElement.d.ts.map +0 -1
- package/dist/src/shell/useStoryIdsElement.js.map +0 -1
- package/dist/src/shell/useStoryKeys.d.ts.map +0 -1
- package/dist/src/shell/useStoryKeys.js.map +0 -1
- package/dist/src/shell/useSystemDark.d.ts.map +0 -1
- package/dist/src/shell/useSystemDark.js.map +0 -1
- package/dist/src/shell/useToolbarLayout.d.ts.map +0 -1
- package/dist/src/shell/useToolbarLayout.js.map +0 -1
- package/dist/src/shell/useToolbarOverflow.d.ts.map +0 -1
- package/dist/src/shell/useToolbarOverflow.js.map +0 -1
- package/dist/src/shell/useWorstCase.d.ts.map +0 -1
- package/dist/src/shell/useWorstCase.js.map +0 -1
- package/dist/src/shell/worstArgs.d.ts.map +0 -1
- package/dist/src/shell/worstArgs.js.map +0 -1
- package/dist/src/sourceFiles.d.ts.map +0 -1
- package/dist/src/sourceFiles.js.map +0 -1
- package/dist/src/spills.d.ts.map +0 -1
- package/dist/src/spills.js.map +0 -1
- package/dist/src/storyBackground.d.ts.map +0 -1
- package/dist/src/storyBackground.js.map +0 -1
- package/dist/src/storyCheck.d.ts.map +0 -1
- package/dist/src/storyCheck.js.map +0 -1
- package/dist/src/storyClock.d.ts.map +0 -1
- package/dist/src/storyClock.js.map +0 -1
- package/dist/src/storyGlobals.d.ts.map +0 -1
- package/dist/src/storyGlobals.js.map +0 -1
- package/dist/src/storyHeights.d.ts.map +0 -1
- package/dist/src/storyHeights.js.map +0 -1
- package/dist/src/storyIdsElement.d.ts.map +0 -1
- package/dist/src/storyIdsElement.js.map +0 -1
- package/dist/src/storyTexts.d.ts.map +0 -1
- package/dist/src/storyTexts.js.map +0 -1
- package/dist/src/storyTree.d.ts.map +0 -1
- package/dist/src/storyTree.js.map +0 -1
- package/dist/src/switches.d.ts.map +0 -1
- package/dist/src/switches.js.map +0 -1
- package/dist/src/toolbarLayout.d.ts.map +0 -1
- package/dist/src/toolbarLayout.js.map +0 -1
- package/dist/src/usedIn.d.ts.map +0 -1
- package/dist/src/usedIn.js.map +0 -1
- package/dist/src/viewState.d.ts.map +0 -1
- package/dist/src/viewState.js.map +0 -1
- package/dist/src/viewWords.d.ts.map +0 -1
- package/dist/src/viewWords.js.map +0 -1
- package/dist/src/vite/adapter.d.ts.map +0 -1
- package/dist/src/vite/adapter.js.map +0 -1
- package/dist/src/vite/agent.types.d.ts.map +0 -1
- package/dist/src/vite/agent.types.js.map +0 -1
- package/dist/src/vite/agentApi.d.ts.map +0 -1
- package/dist/src/vite/agentApi.js.map +0 -1
- package/dist/src/vite/agentRoutes.d.ts.map +0 -1
- package/dist/src/vite/agentRoutes.js.map +0 -1
- package/dist/src/vite/autoTitle.d.ts.map +0 -1
- package/dist/src/vite/autoTitle.js.map +0 -1
- package/dist/src/vite/componentPage.d.ts.map +0 -1
- package/dist/src/vite/componentPage.js.map +0 -1
- package/dist/src/vite/config.d.ts.map +0 -1
- package/dist/src/vite/config.js.map +0 -1
- package/dist/src/vite/configFile.d.ts.map +0 -1
- package/dist/src/vite/configFile.js.map +0 -1
- package/dist/src/vite/docsExtractor.d.ts.map +0 -1
- package/dist/src/vite/docsExtractor.js.map +0 -1
- package/dist/src/vite/docsProgram.d.ts.map +0 -1
- package/dist/src/vite/docsProgram.js.map +0 -1
- package/dist/src/vite/docsWorker.d.ts.map +0 -1
- package/dist/src/vite/docsWorker.js.map +0 -1
- package/dist/src/vite/forcedStates.d.ts.map +0 -1
- package/dist/src/vite/forcedStates.js.map +0 -1
- package/dist/src/vite/forgebookPlugin.d.ts.map +0 -1
- package/dist/src/vite/forgebookPlugin.js.map +0 -1
- package/dist/src/vite/highlightCode.d.ts.map +0 -1
- package/dist/src/vite/highlightCode.js.map +0 -1
- package/dist/src/vite/indexStoryFile.d.ts.map +0 -1
- package/dist/src/vite/indexStoryFile.js.map +0 -1
- package/dist/src/vite/mcpProtocol.d.ts.map +0 -1
- package/dist/src/vite/mcpProtocol.js.map +0 -1
- package/dist/src/vite/pages.d.ts.map +0 -1
- package/dist/src/vite/pages.js.map +0 -1
- package/dist/src/vite/prebundled.d.ts.map +0 -1
- package/dist/src/vite/prebundled.js.map +0 -1
- package/dist/src/vite/storyCode.d.ts.map +0 -1
- package/dist/src/vite/storyCode.js.map +0 -1
- package/dist/src/vite/storyFilesModule.d.ts.map +0 -1
- package/dist/src/vite/storyFilesModule.js.map +0 -1
- package/dist/src/vite/storyMeta.d.ts.map +0 -1
- package/dist/src/vite/storyMeta.js.map +0 -1
- package/dist/src/vite/touchMedia.d.ts.map +0 -1
- package/dist/src/vite/touchMedia.js.map +0 -1
- package/dist/src/vite/typeScriptPieces.d.ts.map +0 -1
- package/dist/src/vite/typeScriptPieces.js.map +0 -1
- package/dist/src/vite/usageGraph.d.ts.map +0 -1
- package/dist/src/vite/usageGraph.js.map +0 -1
- package/dist/src/vite/usageModule.d.ts.map +0 -1
- package/dist/src/vite/usageModule.js.map +0 -1
- package/dist/src/worstCase.d.ts.map +0 -1
- package/dist/src/worstCase.js.map +0 -1
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The component of a story file whose components are functions of their props (React, Preact, Solid), read from its
|
|
3
|
+
* types and TSDoc: its props with their kind (the panel's group and control), its events' signatures and its parts. The
|
|
4
|
+
* docs modules of those frameworks (`@forgebook/react/docs`, `@forgebook/preact/docs`, `@forgebook/solid/docs`) hand
|
|
5
|
+
* these readers to the plugin's worker and `forgebook-docs` (`adapter.ts`).
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* The component is the meta's `component`. Its props are the first parameter's properties declared in the package:
|
|
9
|
+
* what it passes on to the DOM (`ComponentProps<"button">`, `JSX.HTMLAttributes`) comes from `node_modules` and is left
|
|
10
|
+
* out. Events are `on*` props. Parts are the keys of the `classNames`, `styles` and `refs` maps (the
|
|
11
|
+
* reach-every-part rule).
|
|
12
|
+
*
|
|
13
|
+
* @module
|
|
14
|
+
*/
|
|
15
|
+
import { dirname } from "node:path";
|
|
16
|
+
import ts from "typescript-6";
|
|
17
|
+
import { chosenExport, programFor, summaryOf } from "./docsProgram.js";
|
|
18
|
+
import { moduleSummaryOf } from "./moduleSummary.js";
|
|
19
|
+
import { declarationOrder, declaredSymbol, isForeign, partsOf, propDocs } from "./propDocs.js";
|
|
20
|
+
import { signatureDocs } from "./signatureDocs.js";
|
|
21
|
+
import { metaComponent, metaSubcomponents } from "./storyMeta.js";
|
|
22
|
+
import { guidanceOf } from "./usageGuidance.js";
|
|
23
|
+
/**
|
|
24
|
+
* How a component is called: as a function of its props, or constructed with them into something that renders (a
|
|
25
|
+
* class component, which Preact and React still draw; another class is no component).
|
|
26
|
+
*
|
|
27
|
+
* @param type - the component's type.
|
|
28
|
+
*/
|
|
29
|
+
const componentSignatures = (type) => [
|
|
30
|
+
...type.getCallSignatures(),
|
|
31
|
+
...type
|
|
32
|
+
.getConstructSignatures()
|
|
33
|
+
.filter((signature) => signature.getReturnType().getProperty("render") !== undefined)
|
|
34
|
+
];
|
|
35
|
+
/**
|
|
36
|
+
* A component's props, read at the expression that names it.
|
|
37
|
+
*
|
|
38
|
+
* @param symbol - the component's symbol, through its import.
|
|
39
|
+
* @param expression - where the code names it.
|
|
40
|
+
* @param checker - the program's checker.
|
|
41
|
+
* @param storyFile - the story file, the folder when the component has no declaration.
|
|
42
|
+
*/
|
|
43
|
+
const componentProps = (symbol, expression, checker, storyFile) => {
|
|
44
|
+
const [signature] = componentSignatures(checker.getTypeOfSymbolAtLocation(symbol, expression));
|
|
45
|
+
const propsSymbol = signature?.parameters[0];
|
|
46
|
+
// a class's constructor takes its props as optional (`props?: P`): the props are `P`, not `P | undefined`
|
|
47
|
+
const propsType = propsSymbol === undefined
|
|
48
|
+
? undefined
|
|
49
|
+
: checker.getNonNullableType(checker.getTypeOfSymbolAtLocation(propsSymbol, expression));
|
|
50
|
+
const ownProps = declarationOrder((propsType?.getProperties() ?? []).filter((prop) => !isForeign(prop)), dirname(symbol.declarations?.[0]?.getSourceFile().fileName ?? storyFile));
|
|
51
|
+
return { propsType, ownProps };
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* The files a component's docs come from: the one declaring it and those declaring its own props.
|
|
55
|
+
*
|
|
56
|
+
* @param symbol - the component's symbol.
|
|
57
|
+
* @param ownProps - its own props.
|
|
58
|
+
* @param storyFile - the story file, when the component has no declaration.
|
|
59
|
+
*/
|
|
60
|
+
const docsSources = (symbol, ownProps, storyFile) => [
|
|
61
|
+
symbol.declarations?.[0]?.getSourceFile().fileName ?? storyFile,
|
|
62
|
+
...ownProps.flatMap((prop) => (prop.declarations ?? []).map((declaration) => declaration.getSourceFile().fileName))
|
|
63
|
+
];
|
|
64
|
+
/**
|
|
65
|
+
* The docs of the subcomponents a story file's meta names, with the files they come from.
|
|
66
|
+
*
|
|
67
|
+
* @param source - the story file, parsed.
|
|
68
|
+
* @param checker - the program's checker.
|
|
69
|
+
* @returns the docs and their files, or a message naming the subcomponent that cannot be resolved.
|
|
70
|
+
*/
|
|
71
|
+
const subcomponentsOf = (source, checker) => {
|
|
72
|
+
const docs = [];
|
|
73
|
+
const sources = [];
|
|
74
|
+
for (const subcomponent of metaSubcomponents(source, checker)) {
|
|
75
|
+
const symbol = declaredSymbol(subcomponent.symbol, checker);
|
|
76
|
+
if (symbol === undefined) {
|
|
77
|
+
return `${source.fileName}: the meta's subcomponent ${subcomponent.name} cannot be resolved`;
|
|
78
|
+
}
|
|
79
|
+
const { ownProps } = componentProps(symbol, subcomponent.expression, checker, source.fileName);
|
|
80
|
+
docs.push({
|
|
81
|
+
name: subcomponent.name,
|
|
82
|
+
description: summaryOf(symbol, checker),
|
|
83
|
+
props: ownProps.map((prop) => propDocs(prop, checker, subcomponent.expression))
|
|
84
|
+
});
|
|
85
|
+
sources.push(...docsSources(symbol, ownProps, source.fileName));
|
|
86
|
+
}
|
|
87
|
+
return { docs, sources };
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* A component's docs and the files they come from, read at the expression that names it.
|
|
91
|
+
*
|
|
92
|
+
* @param symbol - the component's declared symbol.
|
|
93
|
+
* @param expression - where the code names it (the meta's `component`, or the export's own name).
|
|
94
|
+
* @param checker - the program's checker.
|
|
95
|
+
* @param file - the file read, the folder when the component has no declaration.
|
|
96
|
+
* @param subcomponents - the subcomponents' docs and files; none outside a story file.
|
|
97
|
+
*/
|
|
98
|
+
const componentOf = (symbol, expression, checker, file, subcomponents) => {
|
|
99
|
+
const { propsType, ownProps } = componentProps(symbol, expression, checker, file);
|
|
100
|
+
const props = ownProps.map((prop) => propDocs(prop, checker, expression));
|
|
101
|
+
const parts = partsOf(propsType, checker, expression);
|
|
102
|
+
const declarationFile = symbol.declarations?.[0]?.getSourceFile();
|
|
103
|
+
const sources = docsSources(symbol, ownProps, file);
|
|
104
|
+
const signature = signatureDocs(symbol, expression, checker);
|
|
105
|
+
return {
|
|
106
|
+
docs: {
|
|
107
|
+
name: symbol.getName(),
|
|
108
|
+
description: summaryOf(symbol, checker),
|
|
109
|
+
summary: declarationFile === undefined ? "" : moduleSummaryOf(declarationFile.text),
|
|
110
|
+
props,
|
|
111
|
+
parts,
|
|
112
|
+
subcomponents: subcomponents.docs,
|
|
113
|
+
...guidanceOf(symbol, checker),
|
|
114
|
+
...(signature === undefined ? {} : { signature })
|
|
115
|
+
},
|
|
116
|
+
file: sources[0] ?? file,
|
|
117
|
+
sources: [...new Set([...sources, ...subcomponents.sources])]
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* A story file's component with the file that declares it.
|
|
122
|
+
*
|
|
123
|
+
* @param storyFile - the story file's absolute path.
|
|
124
|
+
* @returns the component, `{ docs: { name: null } }` when the meta names none, or a message saying why the file
|
|
125
|
+
* cannot be read.
|
|
126
|
+
*/
|
|
127
|
+
export const functionStoryComponent = (storyFile) => {
|
|
128
|
+
const program = programFor(storyFile);
|
|
129
|
+
if (typeof program === "string")
|
|
130
|
+
return program;
|
|
131
|
+
const { checker } = program;
|
|
132
|
+
const source = program.program.getSourceFile(storyFile);
|
|
133
|
+
if (source === undefined)
|
|
134
|
+
return `${storyFile} is not in its program`;
|
|
135
|
+
const expression = metaComponent(source);
|
|
136
|
+
if (expression === undefined)
|
|
137
|
+
return { docs: { name: null } };
|
|
138
|
+
const symbol = declaredSymbol(checker.getSymbolAtLocation(expression), checker);
|
|
139
|
+
if (symbol === undefined)
|
|
140
|
+
return `${storyFile}: the meta's component cannot be resolved`;
|
|
141
|
+
const subcomponents = subcomponentsOf(source, checker);
|
|
142
|
+
if (typeof subcomponents === "string")
|
|
143
|
+
return subcomponents;
|
|
144
|
+
return componentOf(symbol, expression, checker, storyFile, subcomponents);
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* The docs of a story file's component, without the files they come from.
|
|
148
|
+
*
|
|
149
|
+
* @param storyFile - the story file's absolute path.
|
|
150
|
+
* @returns the component's docs, `{ name: null }` when the meta names no component, or a message saying why the file
|
|
151
|
+
* cannot be read.
|
|
152
|
+
*/
|
|
153
|
+
export const functionComponentDocs = (storyFile) => {
|
|
154
|
+
const component = functionStoryComponent(storyFile);
|
|
155
|
+
return typeof component === "string" ? component : component.docs;
|
|
156
|
+
};
|
|
157
|
+
/** Whether an export is a component: a name in PascalCase whose value can be called or constructed. */
|
|
158
|
+
const isComponentExport = (symbol, checker, node) => /^[A-Z]/.test(symbol.getName()) &&
|
|
159
|
+
componentSignatures(checker.getTypeOfSymbolAtLocation(symbol, node)).length > 0;
|
|
160
|
+
/**
|
|
161
|
+
* A component a file exports, read from its types, for writing its first stories (`forgebook new`).
|
|
162
|
+
*
|
|
163
|
+
* @param file - the component's file, absolute.
|
|
164
|
+
* @param exportName - the export to read; the file's only component when none.
|
|
165
|
+
* @returns the component, or a message saying why it cannot be read (no component, several, a name not exported).
|
|
166
|
+
*/
|
|
167
|
+
export const functionFileComponent = (file, exportName) => {
|
|
168
|
+
const program = programFor(file);
|
|
169
|
+
if (typeof program === "string")
|
|
170
|
+
return program;
|
|
171
|
+
const { checker } = program;
|
|
172
|
+
const source = program.program.getSourceFile(file);
|
|
173
|
+
if (source === undefined)
|
|
174
|
+
return `${file} is not in its program`;
|
|
175
|
+
const moduleSymbol = checker.getSymbolAtLocation(source);
|
|
176
|
+
if (moduleSymbol === undefined)
|
|
177
|
+
return `${file} exports nothing`;
|
|
178
|
+
const components = checker
|
|
179
|
+
.getExportsOfModule(moduleSymbol)
|
|
180
|
+
.filter((each) => isComponentExport(declaredSymbol(each, checker) ?? each, checker, source));
|
|
181
|
+
const chosen = chosenExport(components.map((each) => each.getName()), exportName, file);
|
|
182
|
+
if (typeof chosen !== "string")
|
|
183
|
+
return chosen.problem;
|
|
184
|
+
const export_ = components.find((each) => each.getName() === chosen);
|
|
185
|
+
if (export_ === undefined)
|
|
186
|
+
return `${file} exports no component ${chosen}`;
|
|
187
|
+
const symbol = declaredSymbol(export_, checker) ?? export_;
|
|
188
|
+
const declaration = symbol.declarations?.[0];
|
|
189
|
+
const name = declaration === undefined ? undefined : ts.getNameOfDeclaration(declaration);
|
|
190
|
+
if (name === undefined || !ts.isIdentifier(name))
|
|
191
|
+
return `${file}: ${export_.getName()} has no name to read it at`;
|
|
192
|
+
return componentOf(symbol, name, checker, file, { docs: [], sources: [] });
|
|
193
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type VitePaths } from "./vitePaths.ts";
|
|
2
|
+
/** A change. */
|
|
3
|
+
export type GitChange = {
|
|
4
|
+
/** Its unified diff, with no context. */
|
|
5
|
+
readonly diff: string;
|
|
6
|
+
/** The files it deletes, relative to the repository. */
|
|
7
|
+
readonly deleted: readonly string[];
|
|
8
|
+
/** The new files git does not track yet, relative to the repository. */
|
|
9
|
+
readonly untracked: readonly string[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Runs git in a folder.
|
|
13
|
+
*
|
|
14
|
+
* @param dir - a folder of the repository.
|
|
15
|
+
* @param args - its arguments.
|
|
16
|
+
* @returns what it wrote.
|
|
17
|
+
*/
|
|
18
|
+
export declare const gitOutput: (dir: string, ...args: readonly string[]) => Promise<string>;
|
|
19
|
+
/**
|
|
20
|
+
* The commit a change starts from.
|
|
21
|
+
*
|
|
22
|
+
* @param dir - a folder of the repository.
|
|
23
|
+
* @param since - a commit, as asked.
|
|
24
|
+
* @returns its hash, or none when it names no commit.
|
|
25
|
+
*/
|
|
26
|
+
export declare const changeBase: (dir: string, since: string) => Promise<string | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* The files a change touches, tracked or new.
|
|
29
|
+
*
|
|
30
|
+
* @param dir - a folder of the repository.
|
|
31
|
+
* @param base - the commit it starts from.
|
|
32
|
+
* @returns the repository's folder, and the files relative to it.
|
|
33
|
+
*/
|
|
34
|
+
export declare const changedFiles: (dir: string, base: string) => Promise<{
|
|
35
|
+
readonly root: string;
|
|
36
|
+
readonly files: readonly string[];
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* The changed files as the catalogue's graph names them: absolute, under the catalogue's folder as configured, in Vite's
|
|
40
|
+
* form. Git names real paths (with forward slashes on Windows too), and a folder reached through a link has another.
|
|
41
|
+
*
|
|
42
|
+
* @param dir - the catalogue's folder, as configured.
|
|
43
|
+
* @param realDir - the same folder with its links followed.
|
|
44
|
+
* @param root - the repository's folder, as git names it.
|
|
45
|
+
* @param files - the files, relative to the repository.
|
|
46
|
+
* @param paths - the path functions; the running system's unless a test names another.
|
|
47
|
+
*/
|
|
48
|
+
export declare const catalogueChangedFiles: (dir: string, realDir: string, root: string, files: readonly string[], paths?: VitePaths) => string[];
|
|
49
|
+
/**
|
|
50
|
+
* Reads a change.
|
|
51
|
+
*
|
|
52
|
+
* @param dir - a folder of the repository.
|
|
53
|
+
* @param since - a commit, as asked.
|
|
54
|
+
* @returns the change, or why it cannot be read.
|
|
55
|
+
*/
|
|
56
|
+
export declare const gitChange: (dir: string, since: string) => Promise<GitChange | string>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A change, as git names it: the commit it starts from, the diff, and the files git does not track yet.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* `since` comes from a request, so it is resolved as a commit before anything else: passed on as it is, git takes
|
|
6
|
+
* `--output=…` for an option and overwrites a file. The diff asks for one fixed form whatever the user's git settings,
|
|
7
|
+
* since colours, external diff tools and other prefixes all read as an empty change, which is a check passing with
|
|
8
|
+
* nothing checked. A change starts where the branch left `since`, or what `since` gained afterwards is read as this
|
|
9
|
+
* change's.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
import { execFile } from "node:child_process";
|
|
14
|
+
import { promisify } from "node:util";
|
|
15
|
+
import { VITE_PATHS } from "./vitePaths.js";
|
|
16
|
+
/** The largest output read, in bytes: a change this size is for a person, not for this check. */
|
|
17
|
+
const MAX_OUTPUT = 64 * 1024 * 1024;
|
|
18
|
+
const run = promisify(execFile);
|
|
19
|
+
/**
|
|
20
|
+
* Runs git in a folder.
|
|
21
|
+
*
|
|
22
|
+
* @param dir - a folder of the repository.
|
|
23
|
+
* @param args - its arguments.
|
|
24
|
+
* @returns what it wrote.
|
|
25
|
+
*/
|
|
26
|
+
export const gitOutput = async (dir, ...args) => (await run("git", ["-c", "core.quotePath=false", ...args], { cwd: dir, maxBuffer: MAX_OUTPUT })).stdout;
|
|
27
|
+
/** The lines of a list git wrote. */
|
|
28
|
+
const listed = (text) => text.split("\n").filter((line) => line !== "");
|
|
29
|
+
/**
|
|
30
|
+
* The commit a change starts from.
|
|
31
|
+
*
|
|
32
|
+
* @param dir - a folder of the repository.
|
|
33
|
+
* @param since - a commit, as asked.
|
|
34
|
+
* @returns its hash, or none when it names no commit.
|
|
35
|
+
*/
|
|
36
|
+
export const changeBase = async (dir, since) => {
|
|
37
|
+
try {
|
|
38
|
+
const commit = (await gitOutput(dir, "rev-parse", "--verify", "--quiet", "--end-of-options", `${since}^{commit}`)).trim();
|
|
39
|
+
return (await gitOutput(dir, "merge-base", commit, "HEAD")).trim();
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The files a change touches, tracked or new.
|
|
47
|
+
*
|
|
48
|
+
* @param dir - a folder of the repository.
|
|
49
|
+
* @param base - the commit it starts from.
|
|
50
|
+
* @returns the repository's folder, and the files relative to it.
|
|
51
|
+
*/
|
|
52
|
+
export const changedFiles = async (dir, base) => {
|
|
53
|
+
const root = (await gitOutput(dir, "rev-parse", "--show-toplevel")).trim();
|
|
54
|
+
const tracked = listed(await gitOutput(dir, "diff", "--no-ext-diff", "--name-only", base, "--"));
|
|
55
|
+
const untracked = listed(await gitOutput(dir, "ls-files", "--others", "--exclude-standard", "--full-name"));
|
|
56
|
+
return { root, files: [...new Set([...tracked, ...untracked])] };
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* The changed files as the catalogue's graph names them: absolute, under the catalogue's folder as configured, in Vite's
|
|
60
|
+
* form. Git names real paths (with forward slashes on Windows too), and a folder reached through a link has another.
|
|
61
|
+
*
|
|
62
|
+
* @param dir - the catalogue's folder, as configured.
|
|
63
|
+
* @param realDir - the same folder with its links followed.
|
|
64
|
+
* @param root - the repository's folder, as git names it.
|
|
65
|
+
* @param files - the files, relative to the repository.
|
|
66
|
+
* @param paths - the path functions; the running system's unless a test names another.
|
|
67
|
+
*/
|
|
68
|
+
export const catalogueChangedFiles = (dir, realDir, root, files, paths = VITE_PATHS) => files.map((file) => paths.join(dir, paths.relative(realDir, paths.join(root, file))));
|
|
69
|
+
/**
|
|
70
|
+
* Reads a change.
|
|
71
|
+
*
|
|
72
|
+
* @param dir - a folder of the repository.
|
|
73
|
+
* @param since - a commit, as asked.
|
|
74
|
+
* @returns the change, or why it cannot be read.
|
|
75
|
+
*/
|
|
76
|
+
export const gitChange = async (dir, since) => {
|
|
77
|
+
const base = await changeBase(dir, since);
|
|
78
|
+
if (base === undefined)
|
|
79
|
+
return `"${since}" names no commit here`;
|
|
80
|
+
const form = ["--no-ext-diff", "--no-textconv", "--no-color", "--src-prefix=a/", "--dst-prefix=b/"];
|
|
81
|
+
return {
|
|
82
|
+
diff: await gitOutput(dir, "diff", ...form, "--unified=0", base, "--"),
|
|
83
|
+
deleted: listed(await gitOutput(dir, "diff", ...form, "--name-only", "--diff-filter=D", base, "--")),
|
|
84
|
+
untracked: listed(await gitOutput(dir, "ls-files", "--others", "--exclude-standard", "--full-name"))
|
|
85
|
+
};
|
|
86
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
/** Where the heights' file is looked for. */
|
|
3
|
+
export type HeightsFile = {
|
|
4
|
+
/** The file's address, relative to the pages (`story-heights.json`). */
|
|
5
|
+
readonly heights: string;
|
|
6
|
+
/** The pages' base path (`/`, or Vite's `base`). */
|
|
7
|
+
readonly base: string;
|
|
8
|
+
/** The public folder, or `false` when the project has none. */
|
|
9
|
+
readonly publicDir: string | false;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Whether a request asks for the heights' file while it does not exist.
|
|
13
|
+
*
|
|
14
|
+
* @param url - the request's path, with its query.
|
|
15
|
+
* @param file - where the file is.
|
|
16
|
+
* @param exists - whether a path exists; the file system's by default.
|
|
17
|
+
*/
|
|
18
|
+
export declare const isMissingHeights: (url: string, file: HeightsFile, exists?: (path: string) => boolean) => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The middleware that answers a request for the missing heights' file with no content.
|
|
21
|
+
*
|
|
22
|
+
* @param file - where the file is.
|
|
23
|
+
*/
|
|
24
|
+
export declare const missingHeightsMiddleware: (file: HeightsFile) => (request: IncomingMessage, response: ServerResponse, next: () => void) => void;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The dev server's answer for the stories' heights while they have not been measured: the configuration names the
|
|
3
|
+
* file (`heights`), `forgebook-heights` writes it into the public folder, and until then the page asks for it on
|
|
4
|
+
* every load.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* A missing file is answered "no content" (204) instead of "not found": the shell reads it as no heights and waits at
|
|
8
|
+
* a guess, as it does without the file, and the browser's console stays free of an error that asks nothing of the
|
|
9
|
+
* user. Once the file exists, Vite serves it from the public folder as any other.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
import { existsSync } from "node:fs";
|
|
14
|
+
import { join } from "node:path";
|
|
15
|
+
/**
|
|
16
|
+
* Whether a request asks for the heights' file while it does not exist.
|
|
17
|
+
*
|
|
18
|
+
* @param url - the request's path, with its query.
|
|
19
|
+
* @param file - where the file is.
|
|
20
|
+
* @param exists - whether a path exists; the file system's by default.
|
|
21
|
+
*/
|
|
22
|
+
export const isMissingHeights = (url, file, exists = existsSync) => {
|
|
23
|
+
const path = url.split("?")[0] ?? url;
|
|
24
|
+
const base = file.base.endsWith("/") ? file.base : `${file.base}/`;
|
|
25
|
+
if (path !== `${base}${file.heights}`)
|
|
26
|
+
return false;
|
|
27
|
+
return file.publicDir === false || !exists(join(file.publicDir, file.heights));
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The middleware that answers a request for the missing heights' file with no content.
|
|
31
|
+
*
|
|
32
|
+
* @param file - where the file is.
|
|
33
|
+
*/
|
|
34
|
+
export const missingHeightsMiddleware = (file) => (request, response, next) => {
|
|
35
|
+
if (!isMissingHeights(request.url ?? "/", file)) {
|
|
36
|
+
next();
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
response.statusCode = 204;
|
|
40
|
+
response.setHeader("Cache-Control", "no-store");
|
|
41
|
+
response.end();
|
|
42
|
+
};
|
|
@@ -13,4 +13,3 @@ export declare const escapeHtml: (text: string) => string;
|
|
|
13
13
|
* @param language - its language as a Markdown fence names it (`tsx`, `ts`, `scss`, `sh`); none leaves it plain.
|
|
14
14
|
*/
|
|
15
15
|
export declare const highlightCode: (code: string, language: string | undefined) => string;
|
|
16
|
-
//# sourceMappingURL=highlightCode.d.ts.map
|
|
@@ -4,31 +4,17 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @remarks
|
|
6
6
|
* The TypeScript family (TypeScript, TSX, JavaScript, JSX) is split by the TypeScript compiler
|
|
7
|
-
* (`typeScriptPieces.ts`)
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* shell's style sheet with its code palette. A language neither knows is escaped and left plain.
|
|
7
|
+
* (`typeScriptPieces.ts`), and the other languages a component's documentation writes by short grammars
|
|
8
|
+
* (`plainGrammars.ts`). Both give the same roles, written as the same classes, with the catalogue's prefix
|
|
9
|
+
* (`forgebook-hl-keyword`), coloured by the shell's style sheet with its code palette. A language neither knows is escaped
|
|
10
|
+
* and left plain.
|
|
12
11
|
*
|
|
13
12
|
* @module
|
|
14
13
|
*/
|
|
15
|
-
import
|
|
16
|
-
import bash from "highlight.js/lib/languages/bash";
|
|
17
|
-
import css from "highlight.js/lib/languages/css";
|
|
18
|
-
import json from "highlight.js/lib/languages/json";
|
|
19
|
-
import scss from "highlight.js/lib/languages/scss";
|
|
20
|
-
import xml from "highlight.js/lib/languages/xml";
|
|
14
|
+
import { grammarPieces } from "./plainGrammars.js";
|
|
21
15
|
import { isTypeScriptLanguage, typeScriptPieces } from "./typeScriptPieces.js";
|
|
22
16
|
/** The class prefix of every coloured piece. */
|
|
23
17
|
export const HIGHLIGHT_PREFIX = "forgebook-hl-";
|
|
24
|
-
/** The catalogue's own highlighter: the languages outside the TypeScript family a component's documentation writes. */
|
|
25
|
-
const highlighter = hljs.newInstance();
|
|
26
|
-
highlighter.configure({ classPrefix: HIGHLIGHT_PREFIX });
|
|
27
|
-
highlighter.registerLanguage("xml", xml);
|
|
28
|
-
highlighter.registerLanguage("css", css);
|
|
29
|
-
highlighter.registerLanguage("scss", scss);
|
|
30
|
-
highlighter.registerLanguage("json", json);
|
|
31
|
-
highlighter.registerLanguage("bash", bash);
|
|
32
18
|
/** The characters HTML gives a meaning to, as entities. */
|
|
33
19
|
const ENTITIES = {
|
|
34
20
|
"&": "&",
|
|
@@ -43,10 +29,7 @@ const ENTITIES = {
|
|
|
43
29
|
* @param text - the text.
|
|
44
30
|
*/
|
|
45
31
|
export const escapeHtml = (text) => text.replace(/[&<>"']/g, (character) => ENTITIES[character] ?? character);
|
|
46
|
-
/**
|
|
47
|
-
* The classes of each role a TypeScript piece can have: the ones highlight.js gives the same thing, so the palette
|
|
48
|
-
* colours both alike.
|
|
49
|
-
*/
|
|
32
|
+
/** The classes of each role a piece can have. */
|
|
50
33
|
const ROLE_CLASSES = {
|
|
51
34
|
keyword: `${HIGHLIGHT_PREFIX}keyword`,
|
|
52
35
|
string: `${HIGHLIGHT_PREFIX}string`,
|
|
@@ -75,8 +58,6 @@ export const highlightCode = (code, language) => {
|
|
|
75
58
|
return escapeHtml(code);
|
|
76
59
|
if (isTypeScriptLanguage(language))
|
|
77
60
|
return typeScriptPieces(code, language).map(pieceHtml).join("");
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return highlighter.highlight(code, { language, ignoreIllegals: true }).value;
|
|
61
|
+
const pieces = grammarPieces(code, language);
|
|
62
|
+
return pieces === undefined ? escapeHtml(code) : pieces.map(pieceHtml).join("");
|
|
81
63
|
};
|
|
82
|
-
//# sourceMappingURL=highlightCode.js.map
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The code the dev server adds to a story file, to its docs, code and page modules and to a pattern's files module, so
|
|
3
|
+
* an edit reaches the open pages without a reload (`hotModules.ts` reads what it sends), and the plugin's hooks that add
|
|
4
|
+
* it to a story file and reload the pages for an edit that changes a pattern's list.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Each module imports itself, as React's Fast Refresh does, to hand the page what it gave before beside what its
|
|
8
|
+
* successor gives: the page knows which value it drew, not which file it came from. Only the dev server adds them; a
|
|
9
|
+
* build has no hot updates.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
import type { Plugin } from "vite";
|
|
14
|
+
import type { CloseWatch } from "./closeWatch.ts";
|
|
15
|
+
import { type IndexedStoryFile } from "./storyFilesModule.ts";
|
|
16
|
+
/**
|
|
17
|
+
* What a story file runs to accept its edit: the frame that draws its stories cancels the event and draws them anew;
|
|
18
|
+
* when none does, the files that import it take the edit (one that re-exports its stories draws them). The exports the
|
|
19
|
+
* page drew are kept in the module's hot data, so the version after one that threw while it loaded is matched with
|
|
20
|
+
* them, not with the version that failed.
|
|
21
|
+
*
|
|
22
|
+
* @param file - the story file's path, which it imports itself by.
|
|
23
|
+
*/
|
|
24
|
+
export declare const storyFileHot: (file: string) => string;
|
|
25
|
+
/**
|
|
26
|
+
* A story file's code with its accepting code first: it runs before the file's own, so an edit that throws while the
|
|
27
|
+
* file loads still leaves the next one accepted. After the file's head and on its last line, so no line of the file
|
|
28
|
+
* moves and its source map stays true.
|
|
29
|
+
*
|
|
30
|
+
* @param code - the file's code, as the plugins before have made it.
|
|
31
|
+
* @param id - the file's path.
|
|
32
|
+
*/
|
|
33
|
+
export declare const withStoryFileHot: (code: string, id: string) => string;
|
|
34
|
+
/**
|
|
35
|
+
* What a story file's docs, code or page module runs to hand its new default export to the shell that read the old one.
|
|
36
|
+
*
|
|
37
|
+
* @param id - the module's id, which it imports itself by.
|
|
38
|
+
*/
|
|
39
|
+
export declare const renewedModuleHot: (id: string) => string;
|
|
40
|
+
/**
|
|
41
|
+
* A module as a dev server serves it: a story file's docs, code or page module hands its edit to the shell.
|
|
42
|
+
*
|
|
43
|
+
* @param id - the module's id.
|
|
44
|
+
* @param module - the module.
|
|
45
|
+
* @param queries - the queries of the modules that hand their edits on.
|
|
46
|
+
* @param isServing - whether a dev server serves it: a build has no hot updates.
|
|
47
|
+
*/
|
|
48
|
+
export declare const renewedModule: <TModule extends {
|
|
49
|
+
readonly code: string;
|
|
50
|
+
}>(id: string, module: TModule, queries: readonly string[], isServing: boolean) => TModule;
|
|
51
|
+
/**
|
|
52
|
+
* What a pattern's files module runs: it takes the edits its story files hand on, which change nothing it holds. An
|
|
53
|
+
* edit that changes its list reloads the pages from the server, and its pages keep the module they read.
|
|
54
|
+
*/
|
|
55
|
+
export declare const FILES_MODULE_HOT = "if (import.meta.hot) import.meta.hot.accept();";
|
|
56
|
+
/** The patterns' modules a dev server served, with their story files indexed as it served them. */
|
|
57
|
+
export type ServedPatterns = {
|
|
58
|
+
/**
|
|
59
|
+
* Keeps a pattern's module as it was served.
|
|
60
|
+
*
|
|
61
|
+
* @param id - the module's id.
|
|
62
|
+
* @param files - its story files, indexed.
|
|
63
|
+
*/
|
|
64
|
+
readonly keep: (id: string, files: readonly IndexedStoryFile[]) => void;
|
|
65
|
+
/**
|
|
66
|
+
* The patterns' modules an edit of a story file changed (a story added or renamed, a title), which the open pages
|
|
67
|
+
* read once: the file alone is indexed again, not the pattern's every file. One that cannot be read yet (an edit
|
|
68
|
+
* half typed) changes nothing: its module shows the error, and the next edit is read again.
|
|
69
|
+
*
|
|
70
|
+
* @param file - the edited story file.
|
|
71
|
+
*/
|
|
72
|
+
readonly changedBy: (file: string) => readonly string[];
|
|
73
|
+
};
|
|
74
|
+
/** The patterns' modules a dev server serves, kept to tell an edit that changes a list. */
|
|
75
|
+
export declare const servedPatterns: () => ServedPatterns;
|
|
76
|
+
/**
|
|
77
|
+
* The plugin's hooks for a story file's edit: the file accepts it on a dev server, and an edit that changes a pattern's
|
|
78
|
+
* list (a story added, renamed, a title) reloads the pages, which read the list once. A story file a frame loads is
|
|
79
|
+
* followed closely (`closeWatch.ts`), and the late report of an edit of any file the close watch handed on already is
|
|
80
|
+
* dropped, so an edit is drawn once.
|
|
81
|
+
*
|
|
82
|
+
* @param isServing - whether a dev server runs whose framework draws an edited story file in place.
|
|
83
|
+
* @param changedFilesModules - the patterns' modules the edit changed.
|
|
84
|
+
* @param watching - the dev server's close watch.
|
|
85
|
+
*/
|
|
86
|
+
export declare const storyFileHotHooks: (isServing: () => boolean, changedFilesModules: (file: string) => readonly string[], watching: Pick<CloseWatch, "follow" | "isLateReport">) => Pick<Plugin, "transform" | "hotUpdate">;
|