forgebook 0.1.3 → 0.1.4
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 +74 -6
- package/dist/bin/forgebook/agentClient.d.ts +17 -0
- package/dist/bin/forgebook/agentClient.d.ts.map +1 -1
- package/dist/bin/forgebook/agentClient.js +21 -0
- package/dist/bin/forgebook/agentClient.js.map +1 -1
- package/dist/bin/forgebook/agentLoopCommands.d.mts +9 -0
- package/dist/bin/forgebook/agentLoopCommands.d.mts.map +1 -0
- package/dist/bin/forgebook/agentLoopCommands.mjs +217 -0
- package/dist/bin/forgebook/agentLoopCommands.mjs.map +1 -0
- package/dist/bin/forgebook/agentText.d.ts +37 -1
- package/dist/bin/forgebook/agentText.d.ts.map +1 -1
- package/dist/bin/forgebook/agentText.js +49 -2
- package/dist/bin/forgebook/agentText.js.map +1 -1
- package/dist/bin/forgebook/agents.md +46 -0
- package/dist/bin/forgebook/agentsText.d.ts +29 -0
- package/dist/bin/forgebook/agentsText.d.ts.map +1 -0
- package/dist/bin/forgebook/agentsText.js +48 -0
- package/dist/bin/forgebook/agentsText.js.map +1 -0
- package/dist/bin/forgebook/catalogueCommands.d.ts +51 -0
- package/dist/bin/forgebook/catalogueCommands.d.ts.map +1 -0
- package/dist/bin/forgebook/catalogueCommands.js +90 -0
- package/dist/bin/forgebook/catalogueCommands.js.map +1 -0
- package/dist/bin/forgebook/errorsRun.d.ts +27 -0
- package/dist/bin/forgebook/errorsRun.d.ts.map +1 -0
- package/dist/bin/forgebook/errorsRun.js +60 -0
- package/dist/bin/forgebook/errorsRun.js.map +1 -0
- package/dist/bin/forgebook/forgebook.mjs +109 -84
- package/dist/bin/forgebook/forgebook.mjs.map +1 -1
- package/dist/bin/forgebook/importers/storybook.d.ts +53 -0
- package/dist/bin/forgebook/importers/storybook.d.ts.map +1 -0
- package/dist/bin/forgebook/importers/storybook.js +318 -0
- package/dist/bin/forgebook/importers/storybook.js.map +1 -0
- package/dist/bin/forgebook/initCommands.d.mts +9 -0
- package/dist/bin/forgebook/initCommands.d.mts.map +1 -0
- package/dist/bin/forgebook/initCommands.mjs +86 -0
- package/dist/bin/forgebook/initCommands.mjs.map +1 -0
- package/dist/bin/forgebook/initConfig.d.ts +22 -0
- package/dist/bin/forgebook/initConfig.d.ts.map +1 -0
- package/dist/bin/forgebook/initConfig.js +51 -0
- package/dist/bin/forgebook/initConfig.js.map +1 -0
- package/dist/bin/forgebook/mcpTools.d.ts +29 -3
- package/dist/bin/forgebook/mcpTools.d.ts.map +1 -1
- package/dist/bin/forgebook/mcpTools.js +130 -7
- package/dist/bin/forgebook/mcpTools.js.map +1 -1
- package/dist/bin/forgebook/newStories.d.ts +27 -0
- package/dist/bin/forgebook/newStories.d.ts.map +1 -0
- package/dist/bin/forgebook/newStories.js +109 -0
- package/dist/bin/forgebook/newStories.js.map +1 -0
- package/dist/bin/forgebook/newStoriesFile.d.ts +18 -0
- package/dist/bin/forgebook/newStoriesFile.d.ts.map +1 -0
- package/dist/bin/forgebook/newStoriesFile.js +58 -0
- package/dist/bin/forgebook/newStoriesFile.js.map +1 -0
- package/dist/bin/forgebook/storyCheckRun.d.ts +39 -0
- package/dist/bin/forgebook/storyCheckRun.d.ts.map +1 -0
- package/dist/bin/forgebook/storyCheckRun.js +177 -0
- package/dist/bin/forgebook/storyCheckRun.js.map +1 -0
- package/dist/bin/forgebook-docs/catalogueDocs.d.ts +24 -0
- package/dist/bin/forgebook-docs/catalogueDocs.d.ts.map +1 -0
- package/dist/bin/forgebook-docs/catalogueDocs.js +71 -0
- package/dist/bin/forgebook-docs/catalogueDocs.js.map +1 -0
- package/dist/bin/forgebook-docs/catalogueDocs.types.d.ts +8 -0
- package/dist/bin/forgebook-docs/catalogueDocs.types.d.ts.map +1 -1
- package/dist/bin/forgebook-docs/catalogueMarkdown.d.ts +3 -1
- package/dist/bin/forgebook-docs/catalogueMarkdown.d.ts.map +1 -1
- package/dist/bin/forgebook-docs/catalogueMarkdown.js +62 -42
- package/dist/bin/forgebook-docs/catalogueMarkdown.js.map +1 -1
- package/dist/bin/forgebook-docs/catalogueOptions.d.ts +39 -0
- package/dist/bin/forgebook-docs/catalogueOptions.d.ts.map +1 -0
- package/dist/bin/forgebook-docs/catalogueOptions.js +76 -0
- package/dist/bin/forgebook-docs/catalogueOptions.js.map +1 -0
- package/dist/bin/forgebook-docs/collectDocs.d.ts +3 -1
- package/dist/bin/forgebook-docs/collectDocs.d.ts.map +1 -1
- package/dist/bin/forgebook-docs/collectDocs.js +37 -13
- package/dist/bin/forgebook-docs/collectDocs.js.map +1 -1
- package/dist/bin/forgebook-docs/forgebook-docs.mjs +17 -80
- package/dist/bin/forgebook-docs/forgebook-docs.mjs.map +1 -1
- package/dist/bin/forgebook-docs/llmsText.d.ts +24 -0
- package/dist/bin/forgebook-docs/llmsText.d.ts.map +1 -0
- package/dist/bin/forgebook-docs/llmsText.js +33 -0
- package/dist/bin/forgebook-docs/llmsText.js.map +1 -0
- package/dist/bin/forgebook-docs/sourceId.d.ts +9 -0
- package/dist/bin/forgebook-docs/sourceId.d.ts.map +1 -0
- package/dist/bin/forgebook-docs/sourceId.js +45 -0
- package/dist/bin/forgebook-docs/sourceId.js.map +1 -0
- package/dist/bin/frameworkDocs.d.ts +10 -0
- package/dist/bin/frameworkDocs.d.ts.map +1 -0
- package/dist/bin/frameworkDocs.js +43 -0
- package/dist/bin/frameworkDocs.js.map +1 -0
- package/dist/src/argTypes.d.ts +23 -0
- package/dist/src/argTypes.d.ts.map +1 -1
- package/dist/src/argTypes.js +27 -0
- package/dist/src/argTypes.js.map +1 -1
- package/dist/src/catalogue.d.ts +70 -3
- package/dist/src/catalogue.d.ts.map +1 -1
- package/dist/src/catalogue.js +85 -3
- package/dist/src/catalogue.js.map +1 -1
- package/dist/src/controlKeys.d.ts +85 -0
- package/dist/src/controlKeys.d.ts.map +1 -0
- package/dist/src/controlKeys.js +118 -0
- package/dist/src/controlKeys.js.map +1 -0
- package/dist/src/frame/frame.css +33 -2
- package/dist/src/frame/frameView.d.ts +2 -2
- package/dist/src/frame/frameView.d.ts.map +1 -1
- package/dist/src/frame/frameView.js +7 -3
- package/dist/src/frame/frameView.js.map +1 -1
- package/dist/src/frame/mountFrame.d.ts.map +1 -1
- package/dist/src/frame/mountFrame.js +26 -2
- package/dist/src/frame/mountFrame.js.map +1 -1
- package/dist/src/frame/spillOutline.d.ts +10 -0
- package/dist/src/frame/spillOutline.d.ts.map +1 -0
- package/dist/src/frame/spillOutline.js +80 -0
- package/dist/src/frame/spillOutline.js.map +1 -0
- package/dist/src/liveErrors.d.ts +57 -0
- package/dist/src/liveErrors.d.ts.map +1 -0
- package/dist/src/liveErrors.js +52 -0
- package/dist/src/liveErrors.js.map +1 -0
- package/dist/src/messages.d.ts +12 -0
- package/dist/src/messages.d.ts.map +1 -1
- package/dist/src/messages.js +4 -0
- package/dist/src/messages.js.map +1 -1
- package/dist/src/namedViews.d.ts +80 -0
- package/dist/src/namedViews.d.ts.map +1 -0
- package/dist/src/namedViews.js +88 -0
- package/dist/src/namedViews.js.map +1 -0
- package/dist/src/shell/AppearanceMenu.d.ts +15 -0
- package/dist/src/shell/AppearanceMenu.d.ts.map +1 -0
- package/dist/src/shell/AppearanceMenu.js +28 -0
- package/dist/src/shell/AppearanceMenu.js.map +1 -0
- package/dist/src/shell/BoxWidth.d.ts +40 -0
- package/dist/src/shell/BoxWidth.d.ts.map +1 -0
- package/dist/src/shell/BoxWidth.js +56 -0
- package/dist/src/shell/BoxWidth.js.map +1 -0
- package/dist/src/shell/ComponentPage.d.ts +17 -1
- package/dist/src/shell/ComponentPage.d.ts.map +1 -1
- package/dist/src/shell/ComponentPage.js +19 -54
- package/dist/src/shell/ComponentPage.js.map +1 -1
- package/dist/src/shell/ControlKeyField.d.ts +21 -0
- package/dist/src/shell/ControlKeyField.d.ts.map +1 -0
- package/dist/src/shell/ControlKeyField.js +46 -0
- package/dist/src/shell/ControlKeyField.js.map +1 -0
- package/dist/src/shell/ControlRow.d.ts +31 -0
- package/dist/src/shell/ControlRow.d.ts.map +1 -0
- package/dist/src/shell/ControlRow.js +27 -0
- package/dist/src/shell/ControlRow.js.map +1 -0
- package/dist/src/shell/Example.d.ts +58 -0
- package/dist/src/shell/Example.d.ts.map +1 -0
- package/dist/src/shell/Example.js +89 -0
- package/dist/src/shell/Example.js.map +1 -0
- package/dist/src/shell/NamedViews.d.ts +23 -0
- package/dist/src/shell/NamedViews.d.ts.map +1 -0
- package/dist/src/shell/NamedViews.js +49 -0
- package/dist/src/shell/NamedViews.js.map +1 -0
- package/dist/src/shell/PinnedControl.d.ts +25 -0
- package/dist/src/shell/PinnedControl.d.ts.map +1 -0
- package/dist/src/shell/PinnedControl.js +81 -0
- package/dist/src/shell/PinnedControl.js.map +1 -0
- package/dist/src/shell/PropsTab.d.ts +5 -2
- package/dist/src/shell/PropsTab.d.ts.map +1 -1
- package/dist/src/shell/PropsTab.js +12 -15
- package/dist/src/shell/PropsTab.js.map +1 -1
- package/dist/src/shell/Shell.d.ts.map +1 -1
- package/dist/src/shell/Shell.js +27 -2
- package/dist/src/shell/Shell.js.map +1 -1
- package/dist/src/shell/Sidebar.d.ts +11 -9
- package/dist/src/shell/Sidebar.d.ts.map +1 -1
- package/dist/src/shell/Sidebar.js +48 -42
- package/dist/src/shell/Sidebar.js.map +1 -1
- package/dist/src/shell/SidebarEntries.d.ts +50 -0
- package/dist/src/shell/SidebarEntries.d.ts.map +1 -0
- package/dist/src/shell/SidebarEntries.js +51 -0
- package/dist/src/shell/SidebarEntries.js.map +1 -0
- package/dist/src/shell/Stage.d.ts.map +1 -1
- package/dist/src/shell/Stage.js +19 -2
- package/dist/src/shell/Stage.js.map +1 -1
- package/dist/src/shell/Toolbar.d.ts +7 -3
- package/dist/src/shell/Toolbar.d.ts.map +1 -1
- package/dist/src/shell/Toolbar.js +38 -68
- package/dist/src/shell/Toolbar.js.map +1 -1
- package/dist/src/shell/ToolbarControl.d.ts +47 -0
- package/dist/src/shell/ToolbarControl.d.ts.map +1 -0
- package/dist/src/shell/ToolbarControl.js +150 -0
- package/dist/src/shell/ToolbarControl.js.map +1 -0
- package/dist/src/shell/UsedIn.d.ts +38 -0
- package/dist/src/shell/UsedIn.d.ts.map +1 -0
- package/dist/src/shell/UsedIn.js +77 -0
- package/dist/src/shell/UsedIn.js.map +1 -0
- package/dist/src/shell/ViewMenu.d.ts +37 -0
- package/dist/src/shell/ViewMenu.d.ts.map +1 -0
- package/dist/src/shell/ViewMenu.js +216 -0
- package/dist/src/shell/ViewMenu.js.map +1 -0
- package/dist/src/shell/controlCycle.d.ts +28 -0
- package/dist/src/shell/controlCycle.d.ts.map +1 -0
- package/dist/src/shell/controlCycle.js +51 -0
- package/dist/src/shell/controlCycle.js.map +1 -0
- package/dist/src/shell/dockTabs.d.ts +3 -0
- package/dist/src/shell/dockTabs.d.ts.map +1 -1
- package/dist/src/shell/dockTabs.js +1 -1
- package/dist/src/shell/dockTabs.js.map +1 -1
- package/dist/src/shell/icons.d.ts +6 -0
- package/dist/src/shell/icons.d.ts.map +1 -1
- package/dist/src/shell/icons.js +7 -1
- package/dist/src/shell/icons.js.map +1 -1
- package/dist/src/shell/keyboard.d.ts +2 -1
- package/dist/src/shell/keyboard.d.ts.map +1 -1
- package/dist/src/shell/keyboard.js +5 -2
- package/dist/src/shell/keyboard.js.map +1 -1
- package/dist/src/shell/shell.css +826 -243
- package/dist/src/shell/strings.d.ts +45 -0
- package/dist/src/shell/strings.d.ts.map +1 -1
- package/dist/src/shell/strings.js +45 -0
- package/dist/src/shell/strings.js.map +1 -1
- package/dist/src/shell/useAppearance.d.ts +17 -0
- package/dist/src/shell/useAppearance.d.ts.map +1 -0
- package/dist/src/shell/useAppearance.js +36 -0
- package/dist/src/shell/useAppearance.js.map +1 -0
- package/dist/src/shell/useControlKeys.d.ts +23 -0
- package/dist/src/shell/useControlKeys.d.ts.map +1 -0
- package/dist/src/shell/useControlKeys.js +44 -0
- package/dist/src/shell/useControlKeys.js.map +1 -0
- package/dist/src/shell/useFold.d.ts +27 -0
- package/dist/src/shell/useFold.d.ts.map +1 -0
- package/dist/src/shell/useFold.js +87 -0
- package/dist/src/shell/useFold.js.map +1 -0
- package/dist/src/shell/useFrameMessages.d.ts +2 -0
- package/dist/src/shell/useFrameMessages.d.ts.map +1 -1
- package/dist/src/shell/useFrameMessages.js +3 -0
- package/dist/src/shell/useFrameMessages.js.map +1 -1
- package/dist/src/shell/useFullPage.d.ts +45 -0
- package/dist/src/shell/useFullPage.d.ts.map +1 -0
- package/dist/src/shell/useFullPage.js +149 -0
- package/dist/src/shell/useFullPage.js.map +1 -0
- package/dist/src/shell/usePopover.d.ts +17 -3
- package/dist/src/shell/usePopover.d.ts.map +1 -1
- package/dist/src/shell/usePopover.js +65 -4
- package/dist/src/shell/usePopover.js.map +1 -1
- package/dist/src/shell/useStored.d.ts +13 -2
- package/dist/src/shell/useStored.d.ts.map +1 -1
- package/dist/src/shell/useStored.js +1 -1
- package/dist/src/shell/useStored.js.map +1 -1
- package/dist/src/shell/useToolbarLayout.d.ts +39 -0
- package/dist/src/shell/useToolbarLayout.d.ts.map +1 -0
- package/dist/src/shell/useToolbarLayout.js +58 -0
- package/dist/src/shell/useToolbarLayout.js.map +1 -0
- package/dist/src/shell/useToolbarOverflow.d.ts +31 -0
- package/dist/src/shell/useToolbarOverflow.d.ts.map +1 -0
- package/dist/src/shell/useToolbarOverflow.js +62 -0
- package/dist/src/shell/useToolbarOverflow.js.map +1 -0
- package/dist/src/shell/useWorstCase.d.ts +46 -0
- package/dist/src/shell/useWorstCase.d.ts.map +1 -0
- package/dist/src/shell/useWorstCase.js +42 -0
- package/dist/src/shell/useWorstCase.js.map +1 -0
- package/dist/src/shell/worstArgs.d.ts +42 -0
- package/dist/src/shell/worstArgs.d.ts.map +1 -0
- package/dist/src/shell/worstArgs.js +47 -0
- package/dist/src/shell/worstArgs.js.map +1 -0
- package/dist/src/spills.d.ts +31 -0
- package/dist/src/spills.d.ts.map +1 -0
- package/dist/src/spills.js +65 -0
- package/dist/src/spills.js.map +1 -0
- package/dist/src/storyCheck.d.ts +105 -0
- package/dist/src/storyCheck.d.ts.map +1 -0
- package/dist/src/storyCheck.js +63 -0
- package/dist/src/storyCheck.js.map +1 -0
- package/dist/src/switches.d.ts +16 -4
- package/dist/src/switches.d.ts.map +1 -1
- package/dist/src/switches.js +30 -5
- package/dist/src/switches.js.map +1 -1
- package/dist/src/toolbarLayout.d.ts +119 -0
- package/dist/src/toolbarLayout.d.ts.map +1 -0
- package/dist/src/toolbarLayout.js +155 -0
- package/dist/src/toolbarLayout.js.map +1 -0
- package/dist/src/usedIn.d.ts +60 -0
- package/dist/src/usedIn.d.ts.map +1 -0
- package/dist/src/usedIn.js +92 -0
- package/dist/src/usedIn.js.map +1 -0
- package/dist/src/viewState.d.ts +6 -10
- package/dist/src/viewState.d.ts.map +1 -1
- package/dist/src/viewState.js +20 -18
- package/dist/src/viewState.js.map +1 -1
- package/dist/src/viewWords.d.ts +26 -0
- package/dist/src/viewWords.d.ts.map +1 -0
- package/dist/src/viewWords.js +29 -0
- package/dist/src/viewWords.js.map +1 -0
- package/dist/src/vite/adapter.d.ts +13 -4
- package/dist/src/vite/adapter.d.ts.map +1 -1
- package/dist/src/vite/adapter.js +4 -2
- package/dist/src/vite/adapter.js.map +1 -1
- package/dist/src/vite/agent.types.d.ts +32 -2
- package/dist/src/vite/agent.types.d.ts.map +1 -1
- package/dist/src/vite/agentApi.d.ts +15 -3
- package/dist/src/vite/agentApi.d.ts.map +1 -1
- package/dist/src/vite/agentApi.js +63 -9
- package/dist/src/vite/agentApi.js.map +1 -1
- package/dist/src/vite/agentRoutes.d.ts +8 -3
- package/dist/src/vite/agentRoutes.d.ts.map +1 -1
- package/dist/src/vite/agentRoutes.js +84 -23
- package/dist/src/vite/agentRoutes.js.map +1 -1
- package/dist/src/vite/configFile.d.ts +2 -1
- package/dist/src/vite/configFile.d.ts.map +1 -1
- package/dist/src/vite/configFile.js +29 -11
- package/dist/src/vite/configFile.js.map +1 -1
- package/dist/src/vite/docsExtractor.d.ts +26 -2
- package/dist/src/vite/docsExtractor.d.ts.map +1 -1
- package/dist/src/vite/docsExtractor.js +12 -9
- package/dist/src/vite/docsExtractor.js.map +1 -1
- package/dist/src/vite/docsWorker.js +18 -2
- package/dist/src/vite/docsWorker.js.map +1 -1
- package/dist/src/vite/forgebookPlugin.d.ts.map +1 -1
- package/dist/src/vite/forgebookPlugin.js +109 -16
- package/dist/src/vite/forgebookPlugin.js.map +1 -1
- package/dist/src/vite/indexStoryFile.d.ts +14 -0
- package/dist/src/vite/indexStoryFile.d.ts.map +1 -1
- package/dist/src/vite/indexStoryFile.js +13 -4
- package/dist/src/vite/indexStoryFile.js.map +1 -1
- package/dist/src/vite/mcpProtocol.d.ts +9 -0
- package/dist/src/vite/mcpProtocol.d.ts.map +1 -1
- package/dist/src/vite/mcpProtocol.js +6 -3
- package/dist/src/vite/mcpProtocol.js.map +1 -1
- package/dist/src/vite/storyFilesModule.d.ts +28 -1
- package/dist/src/vite/storyFilesModule.d.ts.map +1 -1
- package/dist/src/vite/storyFilesModule.js +34 -14
- package/dist/src/vite/storyFilesModule.js.map +1 -1
- package/dist/src/vite/usageGraph.d.ts +45 -0
- package/dist/src/vite/usageGraph.d.ts.map +1 -0
- package/dist/src/vite/usageGraph.js +246 -0
- package/dist/src/vite/usageGraph.js.map +1 -0
- package/dist/src/vite/usageModule.d.ts +33 -0
- package/dist/src/vite/usageModule.d.ts.map +1 -0
- package/dist/src/vite/usageModule.js +135 -0
- package/dist/src/vite/usageModule.js.map +1 -0
- package/dist/src/worstCase.d.ts +16 -0
- package/dist/src/worstCase.d.ts.map +1 -0
- package/dist/src/worstCase.js +16 -0
- package/dist/src/worstCase.js.map +1 -0
- package/package.json +14 -2
- package/dist/src/shell/SchemeSwitches.d.ts +0 -24
- package/dist/src/shell/SchemeSwitches.d.ts.map +0 -1
- package/dist/src/shell/SchemeSwitches.js +0 -36
- package/dist/src/shell/SchemeSwitches.js.map +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A row of the View menu: a handle to move the control (dragged, or with the arrow keys, the new position announced),
|
|
3
|
+
* its name with a dot when its value is changed, its value, its key, a pin that puts it on the toolbar and a button that
|
|
4
|
+
* hides it in the menu.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
import type { PointerEvent, ReactNode } from "react";
|
|
9
|
+
import type { PlacedControl } from "../toolbarLayout.ts";
|
|
10
|
+
import { type ControlContext } from "./ToolbarControl.tsx";
|
|
11
|
+
import type { ToolbarLayout } from "./useToolbarLayout.ts";
|
|
12
|
+
/**
|
|
13
|
+
* One control's row: its handle, its name, its value, its key, its pin and its hide button.
|
|
14
|
+
*
|
|
15
|
+
* @param props - the placed control, its position, what moving and placing it do, and what every control shares.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ControlRow: ({ each, index, count, isDragged, isMoved, isChanged, layout, hintId, onGrab, onAnnounce, ...context }: ControlContext & {
|
|
18
|
+
readonly each: PlacedControl;
|
|
19
|
+
readonly index: number;
|
|
20
|
+
readonly count: number;
|
|
21
|
+
readonly isDragged: boolean;
|
|
22
|
+
/** Whether it is pinned but the bar has no room for it now. */
|
|
23
|
+
readonly isMoved: boolean;
|
|
24
|
+
/** Whether the person set a value that is not its default. */
|
|
25
|
+
readonly isChanged: boolean;
|
|
26
|
+
readonly layout: ToolbarLayout;
|
|
27
|
+
readonly hintId: string;
|
|
28
|
+
readonly onGrab: (event: PointerEvent<HTMLButtonElement>, id: string) => void;
|
|
29
|
+
readonly onAnnounce: (text: string) => void;
|
|
30
|
+
}) => ReactNode;
|
|
31
|
+
//# sourceMappingURL=ControlRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ControlRow.d.ts","sourceRoot":"","sources":["../../../src/shell/ControlRow.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIzD,OAAO,EAAE,KAAK,cAAc,EAAgC,MAAM,sBAAsB,CAAC;AACzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAK3D;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,uGAYxB,cAAc,GAAG;IAClB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,iBAAiB,CAAC,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9E,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C,KAAG,SAgEH,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ControlKeyField } from "./ControlKeyField.js";
|
|
3
|
+
import { Icon } from "./icons.js";
|
|
4
|
+
import { STRINGS } from "./strings.js";
|
|
5
|
+
import { controlLabel, ToolbarControl } from "./ToolbarControl.js";
|
|
6
|
+
/** The arrow keys that move a row, and by how much. */
|
|
7
|
+
const ARROW_STEPS = { ArrowUp: -1, ArrowDown: 1 };
|
|
8
|
+
/**
|
|
9
|
+
* One control's row: its handle, its name, its value, its key, its pin and its hide button.
|
|
10
|
+
*
|
|
11
|
+
* @param props - the placed control, its position, what moving and placing it do, and what every control shares.
|
|
12
|
+
*/
|
|
13
|
+
export const ControlRow = ({ each, index, count, isDragged, isMoved, isChanged, layout, hintId, onGrab, onAnnounce, ...context }) => {
|
|
14
|
+
const { control, isPinned } = each;
|
|
15
|
+
const label = controlLabel(control);
|
|
16
|
+
const step = (event) => {
|
|
17
|
+
const offset = ARROW_STEPS[event.key] ?? 0;
|
|
18
|
+
const target = index + offset;
|
|
19
|
+
if (offset === 0 || target < 0 || target >= count)
|
|
20
|
+
return;
|
|
21
|
+
event.preventDefault();
|
|
22
|
+
layout.move(control.id, target);
|
|
23
|
+
onAnnounce(STRINGS.controlMoved(label, target + 1, count));
|
|
24
|
+
};
|
|
25
|
+
return (_jsxs("li", { className: "forgebook-arrange", "data-control": control.id, "data-pinned": isPinned ? "" : undefined, "data-dragged": isDragged ? "" : undefined, "data-moved": isMoved ? "" : undefined, children: [_jsx("button", { type: "button", className: "forgebook-arrange__handle", "aria-label": STRINGS.moveControl(label), "aria-describedby": hintId, onPointerDown: (event) => onGrab(event, control.id), onKeyDown: step, children: _jsx(Icon, { name: "grip", size: 14 }) }), _jsxs("span", { className: "forgebook-popover__label", children: [label, isChanged ? (_jsx("span", { className: "forgebook-dot", role: "img", "aria-label": STRINGS.controlChanged(label) })) : null] }), _jsx("div", { className: "forgebook-arrange__control", children: _jsx(ToolbarControl, { control: control, form: "row", ...context }) }), _jsx(ControlKeyField, { label: label, shortcut: layout.keys[control.id], onKeyChange: (key) => layout.setKey(control.id, key) }), _jsx("button", { type: "button", className: "forgebook-icon-button", "aria-label": STRINGS.pinControl(label), title: isMoved ? STRINGS.pinnedNoRoom : STRINGS.pinControl(label), "aria-pressed": isPinned, onClick: () => layout.pin(control.id, !isPinned), children: _jsx(Icon, { name: "pin", size: 14 }) }), _jsx("button", { type: "button", className: "forgebook-icon-button", "aria-label": STRINGS.hideControl(label), title: STRINGS.hideControl(label), onClick: () => layout.hide(control.id, true), children: _jsx(Icon, { name: "eyeOff", size: 14 }) })] }));
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=ControlRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ControlRow.js","sourceRoot":"","sources":["../../../src/shell/ControlRow.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAuB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAa,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAuB,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAC;AAGzF,uDAAuD;AACvD,MAAM,WAAW,GAAqC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;AAEpF;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,IAAI,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,OAAO,EACP,SAAS,EACT,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,GAAG,OAAO,EAcX,EAAa,EAAE;IACd,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IACnC,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,CAAC,KAAuC,EAAQ,EAAE;QAC7D,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;QAC9B,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,KAAK;YAAE,OAAO;QAC1D,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,E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AAO,CAAC,EAAE,EAAE,GAAG,CAAC,GACvF,EACF,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,uBAAuB,gBACrB,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EACrC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,kBACnD,QAAQ,EACtB,OAAO,EAAE,GAAS,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,YAEtD,KAAC,IAAI,IAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAE,EAAE,GAAI,GACtB,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,uBAAuB,gBACrB,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,EACtC,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,EACjC,OAAO,EAAE,GAAS,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,YAElD,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,EAAE,GAAI,GACzB,IACN,CACN,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One example of a component's page: its title and description, its story in a frame, and a bar that shows its code,
|
|
3
|
+
* fills the page with its box (with the story's width set there) and opens its story on its own page.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import type { StoryFileCode } from "@forgebook/story-format/source";
|
|
8
|
+
import { type ReactNode } from "react";
|
|
9
|
+
import type { PanelArgs } from "../messages.ts";
|
|
10
|
+
import type { TreeComponent, TreeStory } from "../storyTree.ts";
|
|
11
|
+
import type { ViewSwitch } from "../switches.ts";
|
|
12
|
+
import { type ViewState } from "../viewState.ts";
|
|
13
|
+
import type { Loaded } from "./useLoaded.ts";
|
|
14
|
+
/** What every example of the page shares: the frames' address, view and reports, the code, how to open a story. */
|
|
15
|
+
export type ExampleContext = {
|
|
16
|
+
/** The component. */
|
|
17
|
+
readonly component: TreeComponent;
|
|
18
|
+
/** The view. */
|
|
19
|
+
readonly view: ViewState;
|
|
20
|
+
/** The frame page's address. */
|
|
21
|
+
readonly frameUrl: string;
|
|
22
|
+
/** The address of a story's page, for its link. */
|
|
23
|
+
readonly hrefOf: (story: TreeStory) => string;
|
|
24
|
+
/** Opens a story's page. */
|
|
25
|
+
readonly onOpen: (story: TreeStory) => void;
|
|
26
|
+
/** The view the frames loaded with. */
|
|
27
|
+
readonly frameView: ViewState;
|
|
28
|
+
/** The catalogue's switches, for the frames' addresses. */
|
|
29
|
+
readonly switches: readonly ViewSwitch[];
|
|
30
|
+
/** Each frame's reported height, by its address. */
|
|
31
|
+
readonly heights: ReadonlyMap<string, number>;
|
|
32
|
+
/** The addresses of the frames that finished loading. */
|
|
33
|
+
readonly settled: ReadonlySet<string>;
|
|
34
|
+
/** The story file's code. */
|
|
35
|
+
readonly code: Loaded<StoryFileCode>;
|
|
36
|
+
/** The component's name, for the JSX of a story drawn from its args. */
|
|
37
|
+
readonly componentName: string;
|
|
38
|
+
/** A story's own args, as its frame reported them; none before it loads. */
|
|
39
|
+
readonly argsOf: (storyId: string) => PanelArgs;
|
|
40
|
+
/** A story's measured height, for its box while it loads. */
|
|
41
|
+
readonly heightOf: (storyId: string) => number | undefined;
|
|
42
|
+
/** The colour the stories' page has, which each box waits on. */
|
|
43
|
+
readonly background: string | undefined;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* One example: its title and description (the demo has none: it opens the page), its story in a frame, and a bar
|
|
47
|
+
* that shows its code and opens the story on its own page.
|
|
48
|
+
*
|
|
49
|
+
* @param props - the story, whether it is the demo, whether its frame may load, where the queue watches it, and what
|
|
50
|
+
* every example shares.
|
|
51
|
+
*/
|
|
52
|
+
export declare const Example: ({ story, isDemo, isMounted, observe, ...context }: ExampleContext & {
|
|
53
|
+
readonly story: TreeStory;
|
|
54
|
+
readonly isDemo: boolean;
|
|
55
|
+
readonly isMounted: boolean;
|
|
56
|
+
readonly observe?: (element: HTMLElement | null) => void;
|
|
57
|
+
}) => ReactNode;
|
|
58
|
+
//# sourceMappingURL=Example.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Example.d.ts","sourceRoot":"","sources":["../../../src/shell/Example.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAmB,KAAK,SAAS,EAAmB,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAQ7C,mHAAmH;AACnH,MAAM,MAAM,cAAc,GAAG;IAC3B,qBAAqB;IACrB,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;IAClC,gBAAgB;IAChB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,gCAAgC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,mDAAmD;IACnD,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC;IAC9C,4BAA4B;IAC5B,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IAC5C,uCAAuC;IACvC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,CAAC;IACzC,oDAAoD;IACpD,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,6BAA6B;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;IACrC,wEAAwE;IACxE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,SAAS,CAAC;IAChD,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC3D,iEAAiE;IACjE,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC,CAAC;AAqLF;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,GAAI,mDAMrB,cAAc,GAAG;IAClB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;CAC1D,KAAG,SAyEH,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useId, useState } from "react";
|
|
3
|
+
import { frameAddress } from "../viewState.js";
|
|
4
|
+
import { BoxWidthControl, useBoxWidth } from "./BoxWidth.js";
|
|
5
|
+
import { CodeText } from "./CodeText.js";
|
|
6
|
+
import { useCodeWriter } from "./codeWriter.js";
|
|
7
|
+
import { FrameView } from "./FrameView.js";
|
|
8
|
+
import { Icon } from "./icons.js";
|
|
9
|
+
import { StageViewport } from "./StageViewport.js";
|
|
10
|
+
import { StoryCodeBlock, storyCodeText } from "./StoryCodeBlock.js";
|
|
11
|
+
import { STRINGS } from "./strings.js";
|
|
12
|
+
import { useCopy } from "./useCopy.js";
|
|
13
|
+
import { useFullPage } from "./useFullPage.js";
|
|
14
|
+
/** The height of a frame before its story reports its own, in CSS px. */
|
|
15
|
+
const FALLBACK_HEIGHT = 160;
|
|
16
|
+
/** The demo's height before its story reports its own, in CSS px: the demo is the page's first, larger frame. */
|
|
17
|
+
const DEMO_FALLBACK_HEIGHT = 280;
|
|
18
|
+
/** A link to a story's own page, opened in place unless the user asks for another tab. */
|
|
19
|
+
const StoryLink = ({ story, hrefOf, onOpen, className, label, children }) => (_jsx("a", { className: className, "aria-label": label, href: hrefOf(story), onClick: (event) => {
|
|
20
|
+
if (event.metaKey || event.ctrlKey || event.shiftKey || event.button !== 0)
|
|
21
|
+
return;
|
|
22
|
+
event.preventDefault();
|
|
23
|
+
onOpen(story);
|
|
24
|
+
}, children: children }));
|
|
25
|
+
/**
|
|
26
|
+
* The code under an example: closed until asked for, then opened in place with a button that copies it.
|
|
27
|
+
*
|
|
28
|
+
* @param props - the story's code and whether it is shown.
|
|
29
|
+
*/
|
|
30
|
+
const ExampleCode = ({ id, source, isShown }) => {
|
|
31
|
+
const { isCopied, copy } = useCopy();
|
|
32
|
+
const write = useCodeWriter();
|
|
33
|
+
return (_jsx("div", { id: id, className: "forgebook-example__code", "data-open": isShown ? "" : undefined, inert: !isShown, children: _jsxs("div", { className: "forgebook-example__code-inner", children: [_jsx("button", { type: "button", className: "forgebook-example__copy", onClick: () => copy(storyCodeText(source, write)), "aria-live": "polite", children: isCopied ? STRINGS.copied : STRINGS.copy }), _jsx(StoryCodeBlock, { ...source })] }) }));
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* The height an example's story is drawn at least at: its scene's, and over the page the room its stage has.
|
|
37
|
+
*
|
|
38
|
+
* @param story - the story.
|
|
39
|
+
* @param stageHeight - the stage's height while the box is over the page, in CSS px; none in the list.
|
|
40
|
+
*/
|
|
41
|
+
const sceneHeightOf = (story, stageHeight) => stageHeight === undefined ? story.height : Math.max(story.height ?? 0, stageHeight);
|
|
42
|
+
/**
|
|
43
|
+
* An example's title, a link to its story's page, and its description.
|
|
44
|
+
*
|
|
45
|
+
* @param props - the story and how its link opens it.
|
|
46
|
+
*/
|
|
47
|
+
const ExampleHead = ({ story, context }) => (_jsxs("header", { className: "forgebook-example__head", children: [_jsx("h4", { className: "forgebook-example__title", children: _jsx(StoryLink, { story: story, hrefOf: context.hrefOf, onOpen: context.onOpen, className: "forgebook-link", children: story.name }) }), story.description === undefined ? null : (_jsx("p", { className: "forgebook-example__description", children: _jsx(CodeText, { text: story.description }) }))] }));
|
|
48
|
+
/**
|
|
49
|
+
* What keeps an example's place while its box is over the page: a slot of its height in the list, and the shade
|
|
50
|
+
* under the box, a press on which brings it back.
|
|
51
|
+
*
|
|
52
|
+
* @param props - the box's state over the page.
|
|
53
|
+
*/
|
|
54
|
+
const FullPageSlot = ({ full }) => (_jsxs(_Fragment, { children: [_jsx("div", { ref: full.slotRef, className: "forgebook-example__slot", style: { height: full.slotHeight } }), _jsx("div", { ref: full.shadeRef, className: "forgebook-full-shade", "aria-hidden": "true", onClick: () => full.toggle() })] }));
|
|
55
|
+
/**
|
|
56
|
+
* An example's bar: its code shown or hidden, the story's width while its box fills the page, its box filling the page
|
|
57
|
+
* or back in its place, and its story opened on its own page.
|
|
58
|
+
*
|
|
59
|
+
* @param props - the story, what every example shares, its code's state and its box's state over the page.
|
|
60
|
+
*/
|
|
61
|
+
const ExampleBar = ({ story, context, hasCode, isCodeShown, onCodeShownChange, codeId, full, boxWidth }) => (_jsxs("div", { className: "forgebook-example__bar", children: [hasCode ? (_jsxs("button", { type: "button", className: "forgebook-example__toggle", "aria-expanded": isCodeShown, "aria-controls": codeId, onClick: () => onCodeShownChange(!isCodeShown), children: [_jsx(Icon, { name: "chevronRight", size: 12 }), isCodeShown ? STRINGS.hideCode : STRINGS.showCode] })) : null, _jsx(BoxWidthControl, { boxWidth: boxWidth }), _jsxs("button", { type: "button", className: "forgebook-example__full", "aria-label": full.isFull ? STRINGS.backToPlaceNamed(story.name) : STRINGS.fillPageNamed(story.name), onClick: (event) => full.toggle(event), children: [_jsx(Icon, { name: full.isFull ? "collapse" : "expand", size: 12 }), full.isFull ? STRINGS.backToPlace : STRINGS.fillPage] }), _jsxs(StoryLink, { story: story, hrefOf: context.hrefOf, onOpen: context.onOpen, className: "forgebook-example__open", label: STRINGS.openStoryNamed(story.name), children: [STRINGS.openStory, _jsx(Icon, { name: "external", size: 12 })] })] }));
|
|
62
|
+
/**
|
|
63
|
+
* One example: its title and description (the demo has none: it opens the page), its story in a frame, and a bar
|
|
64
|
+
* that shows its code and opens the story on its own page.
|
|
65
|
+
*
|
|
66
|
+
* @param props - the story, whether it is the demo, whether its frame may load, where the queue watches it, and what
|
|
67
|
+
* every example shares.
|
|
68
|
+
*/
|
|
69
|
+
export const Example = ({ story, isDemo, isMounted, observe, ...context }) => {
|
|
70
|
+
const [isCodeShown, setIsCodeShown] = useState(false);
|
|
71
|
+
const codeId = useId();
|
|
72
|
+
const full = useFullPage();
|
|
73
|
+
const boxWidth = useBoxWidth(full.isOver, context.view.width);
|
|
74
|
+
// the story's measured height when there is one; a guess otherwise, larger for the demo; never below the height its
|
|
75
|
+
// scene needs, which its frame has from the start
|
|
76
|
+
const fallbackHeight = Math.max(story.height ?? 0, context.heightOf(story.id) ?? (isDemo ? DEMO_FALLBACK_HEIGHT : FALLBACK_HEIGHT));
|
|
77
|
+
const source = context.code.status === "ready"
|
|
78
|
+
? {
|
|
79
|
+
code: context.code.value,
|
|
80
|
+
exportName: story.exportName,
|
|
81
|
+
componentName: context.componentName,
|
|
82
|
+
args: context.argsOf(story.id)
|
|
83
|
+
}
|
|
84
|
+
: undefined;
|
|
85
|
+
return (_jsxs("article", { ref: observe, className: "forgebook-example", "data-demo": isDemo ? "" : undefined, "aria-label": isDemo ? STRINGS.frameTitle(context.component.name, story.name) : story.name, children: [isDemo ? null : _jsx(ExampleHead, { story: story, context: context }), full.isOver ? _jsx(FullPageSlot, { full: full }) : null, _jsxs("div", { ref: full.boxRef, className: "forgebook-example__box", "data-full": full.isOver ? "" : undefined, ...(full.isFull ? { role: "dialog", "aria-label": story.name } : {}), children: [_jsx("div", { ref: full.stageRef, className: "forgebook-example__stage", children: _jsx(StageViewport, { width: boxWidth.width, onWidthChange: boxWidth.onWidthChange, onShownWidthChange: boxWidth.onShownWidthChange, background: context.background, children: isMounted ? (_jsx(FrameView, { title: STRINGS.frameTitle(context.component.name, story.name), address: frameAddress(context.frameUrl, story.id, context.frameView, context.switches), heights: context.heights, settled: context.settled, fallbackHeight: fallbackHeight,
|
|
86
|
+
// over the page, the story fills the room it has
|
|
87
|
+
sceneHeight: sceneHeightOf(story, full.stageHeight) })) : (_jsx("div", { className: "forgebook-frame-placeholder", style: { height: fallbackHeight } })) }) }), _jsx(ExampleBar, { story: story, context: context, hasCode: source !== undefined, isCodeShown: isCodeShown, onCodeShownChange: setIsCodeShown, codeId: codeId, full: full, boxWidth: boxWidth }), source === undefined ? null : _jsx(ExampleCode, { id: codeId, source: source, isShown: isCodeShown })] })] }));
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=Example.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Example.js","sourceRoot":"","sources":["../../../src/shell/Example.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAmC,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAKzE,OAAO,EAAE,YAAY,EAAkB,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAiB,eAAe,EAAE,WAAW,EAAE,MAAM,eAAgB,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,eA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C5F,IACE,CACX,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The named views at the top of the View menu: the catalogue's, then the reader's, each picked with a press (the one
|
|
3
|
+
* the view matches marked), the reader's removed with their own button, and the values of the moment saved under a
|
|
4
|
+
* name.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
import { type ReactNode } from "react";
|
|
9
|
+
import { type ViewState } from "../viewState.ts";
|
|
10
|
+
/**
|
|
11
|
+
* The named views.
|
|
12
|
+
*
|
|
13
|
+
* @param props - the view shown, the person's own, and the setter.
|
|
14
|
+
*/
|
|
15
|
+
export declare const NamedViews: ({ view, ownView, onViewChange }: {
|
|
16
|
+
/** The view shown, the story's fixed values in it. */
|
|
17
|
+
readonly view: ViewState;
|
|
18
|
+
/** The person's own view: what a saved view holds. */
|
|
19
|
+
readonly ownView: ViewState;
|
|
20
|
+
/** Called with the changed view. */
|
|
21
|
+
readonly onViewChange: (view: ViewState) => void;
|
|
22
|
+
}) => ReactNode;
|
|
23
|
+
//# sourceMappingURL=NamedViews.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NamedViews.d.ts","sourceRoot":"","sources":["../../../src/shell/NamedViews.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAIL,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAYf,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAM5D;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,iCAIxB;IACD,sDAAsD;IACtD,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,sDAAsD;IACtD,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,oCAAoC;IACpC,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CAClD,KAAG,SAyEH,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* The named views at the top of the View menu: the catalogue's, then the reader's, each picked with a press (the one
|
|
4
|
+
* the view matches marked), the reader's removed with their own button, and the values of the moment saved under a
|
|
5
|
+
* name.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { useMemo, useState } from "react";
|
|
10
|
+
import { isSameView, namedViewsText, readNamedViews, viewValues, withoutView, withSavedView, withViewValues } from "../namedViews.js";
|
|
11
|
+
import { parseView } from "../viewState.js";
|
|
12
|
+
import { useCatalogue } from "./catalogueContext.js";
|
|
13
|
+
import { Icon } from "./icons.js";
|
|
14
|
+
import { STRINGS } from "./strings.js";
|
|
15
|
+
import { useStored } from "./useStored.js";
|
|
16
|
+
/**
|
|
17
|
+
* The named views.
|
|
18
|
+
*
|
|
19
|
+
* @param props - the view shown, the person's own, and the setter.
|
|
20
|
+
*/
|
|
21
|
+
export const NamedViews = ({ view, ownView, onViewChange }) => {
|
|
22
|
+
const catalogue = useCatalogue();
|
|
23
|
+
const [saved, setSaved] = useStored("views", readNamedViews, namedViewsText);
|
|
24
|
+
const [isNaming, setIsNaming] = useState(false);
|
|
25
|
+
const [name, setName] = useState("");
|
|
26
|
+
const declared = useMemo(() => catalogue.views.map((each) => ({
|
|
27
|
+
name: each.name,
|
|
28
|
+
values: viewValues(parseView(each.query, catalogue))
|
|
29
|
+
})), [catalogue]);
|
|
30
|
+
const own = viewValues(ownView);
|
|
31
|
+
const save = (event) => {
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
setSaved((current) => withSavedView(current, { name, values: own }));
|
|
34
|
+
setName("");
|
|
35
|
+
setIsNaming(false);
|
|
36
|
+
};
|
|
37
|
+
const cancel = (event) => {
|
|
38
|
+
if (event.key !== "Escape")
|
|
39
|
+
return;
|
|
40
|
+
// the field's Escape: the menu stays open
|
|
41
|
+
event.stopPropagation();
|
|
42
|
+
setIsNaming(false);
|
|
43
|
+
};
|
|
44
|
+
const chip = (each, isOwn) => (_jsxs("span", { className: "forgebook-named-view", children: [_jsx("button", { type: "button", className: "forgebook-named-view__pick", "aria-pressed": isSameView(each.values, own, catalogue.switches), onClick: () => onViewChange(withViewValues(view, each.values)), children: each.name }), isOwn ? (_jsx("button", { type: "button", className: "forgebook-named-view__remove", "aria-label": STRINGS.removeView(each.name), title: STRINGS.removeView(each.name), onClick: () => setSaved((current) => withoutView(current, each.name)), children: _jsx(Icon, { name: "close", size: 10 }) })) : null] }, `${isOwn ? "own" : "catalogue"}:${each.name}`));
|
|
45
|
+
return (_jsxs("section", { className: "forgebook-named-views", "aria-label": STRINGS.namedViews, children: [declared.map((each) => chip(each, false)), saved.map((each) => chip(each, true)), isNaming ? (_jsx("form", { className: "forgebook-named-views__form", onSubmit: save, children: _jsx("input", { type: "text", "aria-label": STRINGS.viewName, placeholder: STRINGS.viewName, value: name,
|
|
46
|
+
// biome-ignore lint/a11y/noAutofocus: the field opens on the person's press, to be typed in at once
|
|
47
|
+
autoFocus: true, onKeyDown: cancel, onChange: (event) => setName(event.target.value) }) })) : (_jsx("button", { type: "button", className: "forgebook-text-button", onClick: () => setIsNaming(true), children: STRINGS.saveView }))] }));
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=NamedViews.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NamedViews.js","sourceRoot":"","sources":["../../../src/shell/NamedViews.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AACH,OAAO,EAKL,OAAO,EACP,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,UAAU,EAEV,cAAc,EACd,cAAc,EACd,UAAU,EACV,WAAW,EACX,aAAa,EACb,cAAc,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAkB,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,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O,CAAC,UAAU,aACtE,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,EACzC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EACrC,QAAQ,CAAC,CAAC,CAAC,CACV,eAAM,SAAS,EAAC,6BAA6B,EAAC,QAAQ,EAAE,IAAI,YAC1D,gBACE,IAAI,EAAC,MAAM,gBACC,OAAO,CAAC,QAAQ,EAC5B,WAAW,EAAE,OAAO,CAAC,QAAQ,EAC7B,KAAK,EAAE,IAAI;oBACX,oGAAoG;oBACpG,SAAS,EAAE,IAAI,EACf,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,KAAoC,EAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GACrF,GACG,CACR,CAAC,CAAC,CAAC,CACF,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,uBAAuB,EAAC,OAAO,EAAE,GAAS,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,YAC3F,OAAO,CAAC,QAAQ,GACV,CACV,IACO,CACX,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A control pinned on the toolbar, with its own small menu on right-click (or the keyboard's menu key): take it off
|
|
3
|
+
* the toolbar, hide it in the View menu or show it there again. The order is not changed here: it is set in the View
|
|
4
|
+
* menu.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
import { type ReactNode } from "react";
|
|
9
|
+
import type { ToolbarControl as Control } from "../toolbarLayout.ts";
|
|
10
|
+
import { type ControlContext } from "./ToolbarControl.tsx";
|
|
11
|
+
import type { ToolbarLayout } from "./useToolbarLayout.ts";
|
|
12
|
+
/**
|
|
13
|
+
* A pinned control.
|
|
14
|
+
*
|
|
15
|
+
* @param props - the control, the arrangement, and what every control shares.
|
|
16
|
+
*/
|
|
17
|
+
export declare const PinnedControl: ({ control, isHidden, isChanged, layout, ...context }: ControlContext & {
|
|
18
|
+
readonly control: Control;
|
|
19
|
+
/** Whether it takes no row in the View menu. */
|
|
20
|
+
readonly isHidden: boolean;
|
|
21
|
+
/** Whether the person set a value that is not its default: a dot marks it, as View's button marks its own. */
|
|
22
|
+
readonly isChanged: boolean;
|
|
23
|
+
readonly layout: ToolbarLayout;
|
|
24
|
+
}) => ReactNode;
|
|
25
|
+
//# sourceMappingURL=PinnedControl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PinnedControl.d.ts","sourceRoot":"","sources":["../../../src/shell/PinnedControl.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAGL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,cAAc,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAErE,OAAO,EAAE,KAAK,cAAc,EAAgC,MAAM,sBAAsB,CAAC;AACzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAgF3D;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,sDAM3B,cAAc,GAAG;IAClB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,gDAAgD;IAChD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,8GAA8G;IAC9G,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;CAChC,KAAG,SAoCH,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* A control pinned on the toolbar, with its own small menu on right-click (or the keyboard's menu key): take it off
|
|
4
|
+
* the toolbar, hide it in the View menu or show it there again. The order is not changed here: it is set in the View
|
|
5
|
+
* menu.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
10
|
+
import { STRINGS } from "./strings.js";
|
|
11
|
+
import { controlLabel, ToolbarControl } from "./ToolbarControl.js";
|
|
12
|
+
/**
|
|
13
|
+
* The control's menu: its two choices as menu items, the first focused, the arrow keys between them; closed by a
|
|
14
|
+
* choice, a press outside or Escape, the focus going back where it was.
|
|
15
|
+
*
|
|
16
|
+
* @param props - the control, where the menu opens, what its choices do, and what closing it does.
|
|
17
|
+
*/
|
|
18
|
+
const ControlMenu = ({ control, isHidden, at, layout, onClose }) => {
|
|
19
|
+
const menuRef = useRef(null);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
const before = document.activeElement;
|
|
22
|
+
menuRef.current?.querySelector("[role=menuitem]")?.focus();
|
|
23
|
+
const close = (event) => {
|
|
24
|
+
const isOutside = event instanceof PointerEvent &&
|
|
25
|
+
!(event.target instanceof Node && menuRef.current?.contains(event.target));
|
|
26
|
+
const isEscape = event instanceof KeyboardEvent && event.key === "Escape";
|
|
27
|
+
if (!isOutside && !isEscape)
|
|
28
|
+
return;
|
|
29
|
+
onClose();
|
|
30
|
+
if (isEscape && before instanceof HTMLElement)
|
|
31
|
+
before.focus();
|
|
32
|
+
};
|
|
33
|
+
document.addEventListener("pointerdown", close);
|
|
34
|
+
document.addEventListener("keydown", close);
|
|
35
|
+
return () => {
|
|
36
|
+
document.removeEventListener("pointerdown", close);
|
|
37
|
+
document.removeEventListener("keydown", close);
|
|
38
|
+
};
|
|
39
|
+
}, [onClose]);
|
|
40
|
+
const step = (event) => {
|
|
41
|
+
if (event.key !== "ArrowDown" && event.key !== "ArrowUp")
|
|
42
|
+
return;
|
|
43
|
+
event.preventDefault();
|
|
44
|
+
const items = [...(menuRef.current?.querySelectorAll("[role=menuitem]") ?? [])];
|
|
45
|
+
const focused = document.activeElement;
|
|
46
|
+
const index = focused instanceof HTMLButtonElement ? items.indexOf(focused) : -1;
|
|
47
|
+
const next = (index + (event.key === "ArrowDown" ? 1 : -1) + items.length) % items.length;
|
|
48
|
+
items[next]?.focus();
|
|
49
|
+
};
|
|
50
|
+
const unpin = () => {
|
|
51
|
+
onClose();
|
|
52
|
+
layout.pin(control.id, false);
|
|
53
|
+
};
|
|
54
|
+
const toggleHidden = () => {
|
|
55
|
+
onClose();
|
|
56
|
+
layout.hide(control.id, !isHidden);
|
|
57
|
+
};
|
|
58
|
+
return (_jsxs("div", { ref: menuRef, className: "forgebook-context-menu", role: "menu", "aria-label": STRINGS.controlMenu(controlLabel(control)), style: { left: at.x, top: at.y }, onKeyDown: step, children: [_jsx("button", { type: "button", role: "menuitem", className: "forgebook-context-menu__item", onClick: unpin, children: STRINGS.unpinControl }), _jsx("button", { type: "button", role: "menuitem", className: "forgebook-context-menu__item", onClick: toggleHidden, children: isHidden ? STRINGS.showInView : STRINGS.hideInView })] }));
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* A pinned control.
|
|
62
|
+
*
|
|
63
|
+
* @param props - the control, the arrangement, and what every control shares.
|
|
64
|
+
*/
|
|
65
|
+
export const PinnedControl = ({ control, isHidden, isChanged, layout, ...context }) => {
|
|
66
|
+
const shortcut = layout.keys[control.id];
|
|
67
|
+
const [menuAt, setMenuAt] = useState(undefined);
|
|
68
|
+
// one function for the menu's life: it focuses its first item once, when it opens
|
|
69
|
+
const close = useCallback(() => setMenuAt(undefined), []);
|
|
70
|
+
const open = (event) => {
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
// the keyboard's menu key gives no pointer: the menu opens under the control
|
|
73
|
+
const box = event.currentTarget.getBoundingClientRect();
|
|
74
|
+
const isFromKeyboard = event.clientX === 0 && event.clientY === 0;
|
|
75
|
+
setMenuAt(isFromKeyboard ? { x: box.left, y: box.bottom } : { x: event.clientX, y: event.clientY });
|
|
76
|
+
};
|
|
77
|
+
return (_jsxs("div", { className: "forgebook-toolbar__pinned", "data-control": control.id,
|
|
78
|
+
// the key that cycles it, in the tooltip of every part that has no tooltip of its own
|
|
79
|
+
title: shortcut === undefined ? undefined : STRINGS.cycleKey(controlLabel(control), shortcut.toUpperCase()), onContextMenu: open, children: [_jsx(ToolbarControl, { control: control, form: "bar", ...context }), isChanged ? (_jsx("span", { className: "forgebook-dot forgebook-toolbar__changed", role: "img", "aria-label": STRINGS.controlChanged(controlLabel(control)) })) : null, menuAt === undefined ? null : (_jsx(ControlMenu, { control: control, isHidden: isHidden, at: menuAt, layout: layout, onClose: close }))] }));
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=PinnedControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PinnedControl.js","sourceRoot":"","sources":["../../../src/shell/PinnedControl.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AACH,OAAO,EAIL,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAuB,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAC;AAMzF;;;;;GAKG;AACH,MAAM,WAAW,GAAG,CAAC,EACnB,OAAO,EACP,QAAQ,EACR,EAAE,EACF,MAAM,EACN,OAAO,EAOR,EAAa,EAAE;IACd,MAAM,OAAO,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC7C,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC;QACtC,OAAO,CAAC,OAAO,EAAE,aAAa,CAAoB,iBAAiB,CAAC,EAAE,KAAK,EAAE,CAAC;QAC9E,MAAM,KAAK,GAAG,CAAC,KAAyD,EAAQ,EAAE;YAChF,MAAM,SAAS,GACb,KAAK,YAAY,YAAY;gBAC7B,CAAC,CAAC,KAAK,CAAC,M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I,EAC3D,SAAS,CAAC,CAAC,CAAC,CACX,eACE,SAAS,EAAC,0CAA0C,EACpD,IAAI,EAAC,KAAK,gBACE,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,GACzD,CACH,CAAC,CAAC,CAAC,IAAI,EACP,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC7B,KAAC,WAAW,IAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,GAAI,CAClG,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { StoryControlsSetting } from "@forgebook/story-format/source";
|
|
11
11
|
import { type ReactNode } from "react";
|
|
12
|
-
import type
|
|
12
|
+
import { type PanelProp } from "../argTypes.ts";
|
|
13
13
|
import { type ArgValue, type PanelArgs } from "../messages.ts";
|
|
14
14
|
import type { NamedValues } from "../namedValues.ts";
|
|
15
|
+
import type { WorstCaseState } from "./worstArgs.ts";
|
|
15
16
|
/** A prop the story gives a text by its key (`storyText("key")`): the key, and whether the panel wrote over it. */
|
|
16
17
|
export type TextArgNote = {
|
|
17
18
|
/** The text's key. */
|
|
@@ -31,6 +32,8 @@ export type PropsTabProps = {
|
|
|
31
32
|
readonly onValueChange: (name: string, value: ArgValue | undefined) => void;
|
|
32
33
|
/** Removes every value the panel set. */
|
|
33
34
|
readonly onReset: () => void;
|
|
35
|
+
/** The worst case the tab's button sets, and the spills counted while it is on; none hides the button. */
|
|
36
|
+
readonly worstCase?: WorstCaseState | undefined;
|
|
34
37
|
/** The values the source offers by name for a type the panel cannot write (`IconComponent`); none by default. */
|
|
35
38
|
readonly namedValues?: NamedValues | undefined;
|
|
36
39
|
/** The props the story gives a text by its key, by name; none by default. */
|
|
@@ -41,5 +44,5 @@ export type PropsTabProps = {
|
|
|
41
44
|
*
|
|
42
45
|
* @param props - the props, the values, which props the story lets the panel set, and the setters.
|
|
43
46
|
*/
|
|
44
|
-
export declare const PropsTab: ({ props, values, controls, onValueChange, onReset, namedValues, textArgs }: PropsTabProps) => ReactNode;
|
|
47
|
+
export declare const PropsTab: ({ props, values, controls, onValueChange, onReset, worstCase, namedValues, textArgs }: PropsTabProps) => ReactNode;
|
|
45
48
|
//# sourceMappingURL=PropsTab.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropsTab.d.ts","sourceRoot":"","sources":["../../../src/shell/PropsTab.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAoB,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAEhE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"PropsTab.d.ts","sourceRoot":"","sources":["../../../src/shell/PropsTab.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAoB,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAEhE,OAAO,EAA4B,KAAK,SAAS,EAAiB,MAAM,gBAAgB,CAAC;AACzF,OAAO,EAAE,KAAK,QAAQ,EAAc,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,mHAAmH;AACnH,MAAM,MAAM,WAAW,GAAG;IACxB,sBAAsB;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,uBAAuB;AACvB,MAAM,MAAM,aAAa,GAAG;IAC1B,wFAAwF;IACxF,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IACrC,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC;IACxC,0EAA0E;IAC1E,QAAQ,CAAC,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5E,yCAAyC;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,0GAA0G;IAC1G,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAChD,iHAAiH;IACjH,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/C,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;CAC3D,CAAC;AAuOF;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAI,uFAStB,aAAa,KAAG,SAuElB,CAAC"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
|
+
import { isColorProp, isNamedProp, settableProps } from "../argTypes.js";
|
|
3
4
|
import { isNamedArg } from "../messages.js";
|
|
4
5
|
import { ChoiceControl, NumberField, textOf } from "./PropFields.js";
|
|
5
6
|
import { STRINGS } from "./strings.js";
|
|
6
|
-
/** A colour prop: named so by its `argTypes`, or by the name convention (`color`, `accentColor`). */
|
|
7
|
-
const isColorProp = (prop) => prop.control === "color" ||
|
|
8
|
-
(prop.control === undefined &&
|
|
9
|
-
prop.kind === "text" &&
|
|
10
|
-
(prop.name === "color" || prop.name.endsWith("Color")));
|
|
11
7
|
/** A CSS colour as the colour picker takes it (`#rrggbb`), or black when the value is not one. */
|
|
12
8
|
const pickerColor = (value) => typeof value === "string" && /^#[0-9a-f]{6}$/i.test(value) ? value : "#000000";
|
|
13
9
|
/** No prop named by a text key. */
|
|
@@ -50,19 +46,20 @@ const Toggle = ({ prop, value, onValueChange }) => {
|
|
|
50
46
|
const descriptionId = useId();
|
|
51
47
|
return (_jsxs("label", { className: "forgebook-toggle", title: prop.description, children: [_jsx("input", { type: "checkbox", checked: value === true, "aria-describedby": descriptionId, onChange: (event) => onValueChange(prop.name, event.target.checked) }), _jsx("code", { children: prop.label ?? prop.name }), _jsx("span", { id: descriptionId, className: "forgebook-visually-hidden", children: prop.description })] }));
|
|
52
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* The worst case's button, and once it is on, how many elements spill (the frame outlines them).
|
|
51
|
+
*
|
|
52
|
+
* @param props - the worst case.
|
|
53
|
+
*/
|
|
54
|
+
const WorstCaseControl = ({ worstCase }) => (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "forgebook-text-button", "aria-pressed": worstCase.isOn, disabled: worstCase.isOn, title: STRINGS.worstCaseHint, onClick: worstCase.onApply, children: STRINGS.worstCase }), worstCase.isOn && worstCase.spillCount !== undefined ? (_jsx("output", { className: "forgebook-tab-foot__note", "data-has-spills": worstCase.spillCount > 0, children: STRINGS.spills(worstCase.spillCount) })) : null] }));
|
|
53
55
|
/**
|
|
54
56
|
* The Props tab.
|
|
55
57
|
*
|
|
56
58
|
* @param props - the props, the values, which props the story lets the panel set, and the setters.
|
|
57
59
|
*/
|
|
58
|
-
export const PropsTab = ({ props, values, controls, onValueChange, onReset, namedValues = {}, textArgs = NO_TEXT_ARGS }) => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const isNamed = (prop) => prop.kind === "other" && prop.control === undefined && namedValues[prop.type] !== undefined;
|
|
62
|
-
const isSettable = (prop) => (prop.kind !== "other" || prop.canTakeText === true || isNamed(prop)) &&
|
|
63
|
-
prop.kind !== "event" &&
|
|
64
|
-
(controls === "all" || controls.includes(prop.name));
|
|
65
|
-
const settable = props.filter(isSettable);
|
|
60
|
+
export const PropsTab = ({ props, values, controls, onValueChange, onReset, worstCase, namedValues = {}, textArgs = NO_TEXT_ARGS }) => {
|
|
61
|
+
const isNamed = (prop) => isNamedProp(prop, namedValues);
|
|
62
|
+
const settable = settableProps(props, controls, namedValues);
|
|
66
63
|
const groups = [
|
|
67
64
|
{
|
|
68
65
|
title: STRINGS.propGroups.choice,
|
|
@@ -74,8 +71,8 @@ export const PropsTab = ({ props, values, controls, onValueChange, onReset, name
|
|
|
74
71
|
}
|
|
75
72
|
].filter((group) => group.props.length > 0);
|
|
76
73
|
const toggles = settable.filter((prop) => prop.kind === "toggle");
|
|
77
|
-
const others = props.filter((prop) => prop.kind !== "event" && !
|
|
74
|
+
const others = props.filter((prop) => prop.kind !== "event" && !settable.includes(prop));
|
|
78
75
|
const hasControls = controls === "all" || controls.length > 0;
|
|
79
|
-
return (_jsxs("div", { className: "forgebook-tab-props", children: [hasControls ? null : _jsx("p", { className: "forgebook-tab-note", children: STRINGS.fixedExamples }), groups.map((group) => (_jsxs("div", { className: "forgebook-prop-group", children: [_jsx("h3", { className: "forgebook-prop-group__title", children: group.title }), _jsx("div", { className: "forgebook-prop-grid", children: group.props.map((prop) => (_jsx(PropControl, { prop: prop, value: values[prop.name], named: isNamed(prop) ? namedValues[prop.type] : undefined, textArg: textArgs[prop.name], onValueChange: onValueChange }, prop.name))) })] }, group.title))), toggles.length === 0 ? null : (_jsxs("div", { className: "forgebook-prop-group", children: [_jsx("h3", { className: "forgebook-prop-group__title", children: STRINGS.propGroups.toggle }), _jsx("div", { className: "forgebook-toggles", children: toggles.map((prop) => (_jsx(Toggle, { prop: prop, value: values[prop.name], onValueChange: onValueChange }, prop.name))) })] })), others.length === 0 ? null : (_jsxs("div", { className: "forgebook-prop-group", children: [_jsx("h3", { className: "forgebook-prop-group__title", children: hasControls ? STRINGS.otherProps : STRINGS.allProps }), _jsx("div", { className: "forgebook-prop-grid", children: others.map((prop) => (_jsxs("div", { className: "forgebook-prop", children: [_jsx(PropHead, { prop: prop }), _jsx("p", { className: "forgebook-prop__description", children: prop.description })] }, prop.name))) })] })), hasControls ? (
|
|
76
|
+
return (_jsxs("div", { className: "forgebook-tab-props", children: [hasControls ? null : _jsx("p", { className: "forgebook-tab-note", children: STRINGS.fixedExamples }), groups.map((group) => (_jsxs("div", { className: "forgebook-prop-group", children: [_jsx("h3", { className: "forgebook-prop-group__title", children: group.title }), _jsx("div", { className: "forgebook-prop-grid", children: group.props.map((prop) => (_jsx(PropControl, { prop: prop, value: values[prop.name], named: isNamed(prop) ? namedValues[prop.type] : undefined, textArg: textArgs[prop.name], onValueChange: onValueChange }, prop.name))) })] }, group.title))), toggles.length === 0 ? null : (_jsxs("div", { className: "forgebook-prop-group", children: [_jsx("h3", { className: "forgebook-prop-group__title", children: STRINGS.propGroups.toggle }), _jsx("div", { className: "forgebook-toggles", children: toggles.map((prop) => (_jsx(Toggle, { prop: prop, value: values[prop.name], onValueChange: onValueChange }, prop.name))) })] })), others.length === 0 ? null : (_jsxs("div", { className: "forgebook-prop-group", children: [_jsx("h3", { className: "forgebook-prop-group__title", children: hasControls ? STRINGS.otherProps : STRINGS.allProps }), _jsx("div", { className: "forgebook-prop-grid", children: others.map((prop) => (_jsxs("div", { className: "forgebook-prop", children: [_jsx(PropHead, { prop: prop }), _jsx("p", { className: "forgebook-prop__description", children: prop.description })] }, prop.name))) })] })), hasControls ? (_jsxs("div", { className: "forgebook-tab-foot", children: [_jsx("button", { type: "button", className: "forgebook-text-button", onClick: onReset, children: STRINGS.resetArgs }), worstCase?.canApply === true ? _jsx(WorstCaseControl, { worstCase: worstCase }) : null] })) : null] }));
|
|
80
77
|
};
|
|
81
78
|
//# sourceMappingURL=PropsTab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropsTab.js","sourceRoot":"","sources":["../../../src/shell/PropsTab.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAoC,KAAK,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PropsTab.js","sourceRoot":"","sources":["../../../src/shell/PropsTab.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAoC,KAAK,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAkB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACzF,OAAO,EAAiB,UAAU,EAAkB,MAAM,gBAAgB,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,iBAAkB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA+BvC,kGAAkG;AAClG,MAAM,WAAW,GAAG,CAAC,KAA2B,EAAU,EAAE,CAC1D,OAAO,KAAK,KAAK,QAAQ,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAEjF,mCAAmC;AACnC,MAAM,YAAY,GAA0C,EAAE,CAAC;AAE/D,iGAAiG;AACjG,MAAM,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAgC,EAAa,EAAE,CAAC,CACtE,eAAK,SAAS,EAAC,sBAAsB,aACnC,gBAAM,SAAS,EAAC,sBAAsB,aACnC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,EACvB,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CACjB,eAAM,SAAS,EAAC,0BAA0B,EAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,kBAE3D,CACR,CAAC,CAAC,CAAC,IAAI,IACH,EACP,eAAM,SAAS,EAAC,sBAAsB,EAAC,KAAK,EAAE,IAAI,CAAC,IAAI,YACpD,IAAI,CAAC,IAAI,GACL,IACH,CACP,CAAC;AAEF,2DAA2D;AAC3D,MAA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