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,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Used in" on a component's page: the other components of its source whose stories use it, each linking to its page
|
|
3
|
+
* with the stories that use it, direct users first; a reader folds it away and their browser keeps that.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* The usage is loaded only while the block is open, so a reader who keeps it shut never makes the catalogue read its
|
|
7
|
+
* import graph. Twelve components show at first, then "and N more" shows the rest. A component used only through
|
|
8
|
+
* another (Tree renders Row, Row renders it) says so.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
import { type ReactNode } from "react";
|
|
13
|
+
import type { TreeComponent, TreeStory } from "../storyTree.ts";
|
|
14
|
+
import { type UsageIndex } from "../usedIn.ts";
|
|
15
|
+
/** What the block reads and opens. */
|
|
16
|
+
export type UsedInProps = {
|
|
17
|
+
/** The page's component's title. */
|
|
18
|
+
readonly title: string;
|
|
19
|
+
/** Loads the source's usage. */
|
|
20
|
+
readonly load: () => Promise<UsageIndex | string>;
|
|
21
|
+
/** A component of the source, by its title; none when the tree no longer has it. */
|
|
22
|
+
readonly componentOf: (title: string) => TreeComponent | undefined;
|
|
23
|
+
/** The address of a component's page. */
|
|
24
|
+
readonly componentHrefOf: (component: TreeComponent) => string;
|
|
25
|
+
/** Opens a component's page. */
|
|
26
|
+
readonly onOpenComponent: (component: TreeComponent) => void;
|
|
27
|
+
/** The address of a story's page. */
|
|
28
|
+
readonly storyHrefOf: (story: TreeStory) => string;
|
|
29
|
+
/** Opens a story's page. */
|
|
30
|
+
readonly onOpenStory: (story: TreeStory) => void;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The block.
|
|
34
|
+
*
|
|
35
|
+
* @param props - the page's component, the usage's loader and how pages open.
|
|
36
|
+
*/
|
|
37
|
+
export declare const UsedIn: ({ title, load, componentOf, ...links }: UsedInProps) => ReactNode;
|
|
38
|
+
//# sourceMappingURL=UsedIn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UsedIn.d.ts","sourceRoot":"","sources":["../../../src/shell/UsedIn.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAmB,KAAK,SAAS,EAAmB,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAA+B,KAAK,UAAU,EAAuB,MAAM,cAAc,CAAC;AAOjG,sCAAsC;AACtC,MAAM,MAAM,WAAW,GAAG;IACxB,oCAAoC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,CAAC;IAClD,oFAAoF;IACpF,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IACnE,yCAAyC;IACzC,QAAQ,CAAC,eAAe,EAAE,CAAC,SAAS,EAAE,aAAa,KAAK,MAAM,CAAC;IAC/D,gCAAgC;IAChC,QAAQ,CAAC,eAAe,EAAE,CAAC,SAAS,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7D,qCAAqC;IACrC,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC;IACnD,4BAA4B;IAC5B,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CAClD,CAAC;AAyHF;;;;GAIG;AACH,eAAO,MAAM,MAAM,GAAI,wCAAwC,WAAW,KAAG,SAyC5E,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* "Used in" on a component's page: the other components of its source whose stories use it, each linking to its page
|
|
4
|
+
* with the stories that use it, direct users first; a reader folds it away and their browser keeps that.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* The usage is loaded only while the block is open, so a reader who keeps it shut never makes the catalogue read its
|
|
8
|
+
* import graph. Twelve components show at first, then "and N more" shows the rest. A component used only through
|
|
9
|
+
* another (Tree renders Row, Row renders it) says so.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
import { useId, useState } from "react";
|
|
14
|
+
import { isUsageIndex, USED_IN_SHOWN } from "../usedIn.js";
|
|
15
|
+
import { Icon } from "./icons.js";
|
|
16
|
+
import { STRINGS } from "./strings.js";
|
|
17
|
+
import { useFold } from "./useFold.js";
|
|
18
|
+
import { useLoaded } from "./useLoaded.js";
|
|
19
|
+
import { useStored } from "./useStored.js";
|
|
20
|
+
/**
|
|
21
|
+
* The using components the tree still has, with their stories.
|
|
22
|
+
*
|
|
23
|
+
* @param users - the using components, by title.
|
|
24
|
+
* @param componentOf - a component by its title.
|
|
25
|
+
*/
|
|
26
|
+
const shownUsers = (users, componentOf) => users.flatMap((user) => {
|
|
27
|
+
const component = componentOf(user.title);
|
|
28
|
+
if (component === undefined)
|
|
29
|
+
return [];
|
|
30
|
+
const stories = user.stories.flatMap((exportName) => component.stories.filter((story) => story.exportName === exportName));
|
|
31
|
+
return [{ component, isDirect: user.isDirect, stories }];
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* A link that opens a page in place, keeping a real address for a new tab.
|
|
35
|
+
*
|
|
36
|
+
* @param props - the address, what opening does, its class and its text.
|
|
37
|
+
*/
|
|
38
|
+
const PageLink = ({ href, onOpen, className, children }) => (_jsx("a", { className: className, href: href, onClick: (event) => {
|
|
39
|
+
if (event.metaKey || event.ctrlKey || event.shiftKey || event.button !== 0)
|
|
40
|
+
return;
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
onOpen();
|
|
43
|
+
}, children: children }));
|
|
44
|
+
/**
|
|
45
|
+
* The list of using components, twelve first and the rest on request.
|
|
46
|
+
*
|
|
47
|
+
* @param props - the using components and how their pages open.
|
|
48
|
+
*/
|
|
49
|
+
const UserList = ({ users, ...links }) => {
|
|
50
|
+
const [isAll, setIsAll] = useState(false);
|
|
51
|
+
if (users.length === 0)
|
|
52
|
+
return _jsx("p", { className: "forgebook-used-in__note", children: STRINGS.usedInNone });
|
|
53
|
+
const shown = isAll ? users : users.slice(0, USED_IN_SHOWN);
|
|
54
|
+
return (_jsxs(_Fragment, { children: [_jsx("ul", { className: "forgebook-used-in__list", children: shown.map((user) => (_jsxs("li", { className: "forgebook-used-in__user", children: [_jsx(PageLink, { href: links.componentHrefOf(user.component), onOpen: () => links.onOpenComponent(user.component), className: "forgebook-link forgebook-used-in__component", children: user.component.name }), _jsx("span", { className: "forgebook-used-in__note", children: user.isDirect ? STRINGS.usedInStories(user.stories.length) : STRINGS.usedInThrough }), _jsx("span", { className: "forgebook-used-in__stories", children: user.stories.map((story) => (_jsx(PageLink, { href: links.storyHrefOf(story), onOpen: () => links.onOpenStory(story), className: "forgebook-used-in__story", children: story.name }, story.id))) })] }, user.component.title))) }), isAll || users.length <= USED_IN_SHOWN ? null : (_jsx("button", { type: "button", className: "forgebook-text-button", onClick: () => setIsAll(true), children: STRINGS.usedInMore(users.length - USED_IN_SHOWN) }))] }));
|
|
55
|
+
};
|
|
56
|
+
/** What the source's usage answered, as a state. */
|
|
57
|
+
const usageState = (value) => {
|
|
58
|
+
if (typeof value === "string")
|
|
59
|
+
return { status: "error", message: value };
|
|
60
|
+
return isUsageIndex(value)
|
|
61
|
+
? { status: "ready", value }
|
|
62
|
+
: { status: "error", message: "The usage has an unexpected shape" };
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* The block.
|
|
66
|
+
*
|
|
67
|
+
* @param props - the page's component, the usage's loader and how pages open.
|
|
68
|
+
*/
|
|
69
|
+
export const UsedIn = ({ title, load, componentOf, ...links }) => {
|
|
70
|
+
const [isOpen, setIsOpen] = useStored("used-in", (stored) => stored !== "closed", (open) => (open ? "open" : "closed"));
|
|
71
|
+
const usage = useLoaded(isOpen ? load : undefined, usageState);
|
|
72
|
+
const fold = useFold(isOpen, false);
|
|
73
|
+
const headingId = useId();
|
|
74
|
+
const bodyId = useId();
|
|
75
|
+
return (_jsxs("section", { className: "forgebook-doc__section forgebook-used-in", "aria-labelledby": headingId, children: [_jsx("h2", { id: headingId, className: "forgebook-used-in__heading", children: _jsxs("button", { type: "button", className: "forgebook-used-in__toggle", "aria-expanded": isOpen, "aria-controls": bodyId, onClick: () => setIsOpen(!isOpen), children: [_jsx("span", { className: "forgebook-tree__chevron", "data-open": isOpen ? "" : undefined, children: _jsx(Icon, { name: "chevronRight", size: 14 }) }), STRINGS.usedIn] }) }), _jsx("div", { ref: fold.ref, id: bodyId, className: "forgebook-used-in__body", children: fold.isDrawn ? (_jsxs(_Fragment, { children: [usage.status === "loading" ? (_jsx("p", { className: "forgebook-used-in__note", children: STRINGS.usedInLoading })) : null, usage.status === "error" ? _jsx("p", { className: "forgebook-used-in__note", children: usage.message }) : null, usage.status === "ready" ? (_jsx(UserList, { users: shownUsers(usage.value[title] ?? [], componentOf), ...links })) : null] })) : null })] }));
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=UsedIn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UsedIn.js","sourceRoot":"","sources":["../../../src/shell/UsedIn.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAmC,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAwC,MAAM,cAAc,CAAC;AACjG,OAAO,EAAE,IAAI,EAAE,MAAM,YAAa,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAe,SAAS,EAAE,MAA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,CAAC,CAAC,CAAC,IAAI,GACJ,IACE,CACX,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The View menu: every control the person did not hide in it, in their order, each with its value, a handle to move
|
|
3
|
+
* it, a pin that puts it on the toolbar and a button that hides it here (a pinned one stays on the toolbar); at its
|
|
4
|
+
* foot the hidden controls, the wrap choice, the values' reset and the toolbar's reset.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* The order is set here only, and the toolbar shows the pinned controls in it: nothing is dragged on the toolbar. A row
|
|
8
|
+
* follows the pointer one to one while it is dragged, and the others move out of its way animated; with the keyboard,
|
|
9
|
+
* the handle moves its row with the arrow keys and the new position is announced.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
import { type ReactNode } from "react";
|
|
14
|
+
import type { PlacedControl } from "../toolbarLayout.ts";
|
|
15
|
+
import { type ViewState } from "../viewState.ts";
|
|
16
|
+
import { type ControlContext } from "./ToolbarControl.tsx";
|
|
17
|
+
import type { ToolbarLayout } from "./useToolbarLayout.ts";
|
|
18
|
+
/**
|
|
19
|
+
* The ids of the controls whose values the View menu answers for: those not on the toolbar (in it, or hidden, whose
|
|
20
|
+
* value still applies), the stage's width aside, which is not a view setting.
|
|
21
|
+
*
|
|
22
|
+
* @param placed - the placed controls.
|
|
23
|
+
*/
|
|
24
|
+
export declare const menuControlIds: (placed: readonly PlacedControl[]) => string[];
|
|
25
|
+
/**
|
|
26
|
+
* The View menu.
|
|
27
|
+
*
|
|
28
|
+
* @param props - the arrangement, whether the person changed one of the menu's values, and what every control shares.
|
|
29
|
+
*/
|
|
30
|
+
export declare const ViewMenu: ({ layout, ownView, movedIds, ...context }: ControlContext & {
|
|
31
|
+
readonly layout: ToolbarLayout;
|
|
32
|
+
/** The pinned controls the bar has no room for now: listed here as pinned, shown here until there is room. */
|
|
33
|
+
readonly movedIds: readonly string[];
|
|
34
|
+
/** The person's own view, without what the story fixes: a value the story fixes is not a change of theirs. */
|
|
35
|
+
readonly ownView: ViewState;
|
|
36
|
+
}) => ReactNode;
|
|
37
|
+
//# sourceMappingURL=ViewMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewMenu.d.ts","sourceRoot":"","sources":["../../../src/shell/ViewMenu.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAIL,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAM/E,OAAO,EAAE,KAAK,cAAc,EAAgC,MAAM,sBAAsB,CAAC;AAEzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAW3D;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,SAAS,aAAa,EAAE,KAAG,MAAM,EAC+B,CAAC;AA4IxG;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAI,2CAKtB,cAAc,GAAG;IAClB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,8GAA8G;IAC9G,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,8GAA8G;IAC9G,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;CAC7B,KAAG,SAmMH,CAAC"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* The View menu: every control the person did not hide in it, in their order, each with its value, a handle to move
|
|
4
|
+
* it, a pin that puts it on the toolbar and a button that hides it here (a pinned one stays on the toolbar); at its
|
|
5
|
+
* foot the hidden controls, the wrap choice, the values' reset and the toolbar's reset.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* The order is set here only, and the toolbar shows the pinned controls in it: nothing is dragged on the toolbar. A row
|
|
9
|
+
* follows the pointer one to one while it is dragged, and the others move out of its way animated; with the keyboard,
|
|
10
|
+
* the handle moves its row with the arrow keys and the new position is announced.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
import { useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
15
|
+
import { DEFAULT_VIEW, hasViewChanges } from "../viewState.js";
|
|
16
|
+
import { ControlRow } from "./ControlRow.js";
|
|
17
|
+
import { useCatalogue } from "./catalogueContext.js";
|
|
18
|
+
import { Icon } from "./icons.js";
|
|
19
|
+
import { NamedViews } from "./NamedViews.js";
|
|
20
|
+
import { STRINGS } from "./strings.js";
|
|
21
|
+
import { controlLabel, ToolbarControl } from "./ToolbarControl.js";
|
|
22
|
+
import { usePopover } from "./usePopover.js";
|
|
23
|
+
/** The room the menu keeps from the window's right edge, in CSS px. */
|
|
24
|
+
const EDGE_PX = 12;
|
|
25
|
+
/** How long the rows take to move out of a dragged row's way, in ms: the shell's `$duration-quick`. */
|
|
26
|
+
const SHIFT_MS = 150;
|
|
27
|
+
/** How they move: the shell's `$ease-out`, decelerating. */
|
|
28
|
+
const SHIFT_EASING = "cubic-bezier(0.22, 1, 0.36, 1)";
|
|
29
|
+
/**
|
|
30
|
+
* The ids of the controls whose values the View menu answers for: those not on the toolbar (in it, or hidden, whose
|
|
31
|
+
* value still applies), the stage's width aside, which is not a view setting.
|
|
32
|
+
*
|
|
33
|
+
* @param placed - the placed controls.
|
|
34
|
+
*/
|
|
35
|
+
export const menuControlIds = (placed) => placed.filter((each) => !each.isPinned && each.control.id !== "width").map((each) => each.control.id);
|
|
36
|
+
/**
|
|
37
|
+
* The view with the given controls' values back at their defaults.
|
|
38
|
+
*
|
|
39
|
+
* @param view - the view.
|
|
40
|
+
* @param switches - the catalogue's switches.
|
|
41
|
+
* @param ids - the controls' ids.
|
|
42
|
+
*/
|
|
43
|
+
const withDefaults = (view, switches, ids) => ({
|
|
44
|
+
...view,
|
|
45
|
+
switches: {
|
|
46
|
+
...view.switches,
|
|
47
|
+
...Object.fromEntries(switches.filter((each) => ids.includes(each.id)).map((each) => [each.id, each.default]))
|
|
48
|
+
},
|
|
49
|
+
backdrop: ids.includes("backdrop") ? DEFAULT_VIEW.backdrop : view.backdrop,
|
|
50
|
+
sheets: ids.includes("sheets") ? DEFAULT_VIEW.sheets : view.sheets,
|
|
51
|
+
text: ids.includes("text") ? DEFAULT_VIEW.text : view.text
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Moves the rows out of the way animated when the order changes: each row starts from where it was drawn and slides
|
|
55
|
+
* to its new place (the dragged row aside, which follows the pointer); without motion they jump.
|
|
56
|
+
*
|
|
57
|
+
* @param list - the list.
|
|
58
|
+
* @param order - the rows' ids in their order.
|
|
59
|
+
* @param draggedId - the dragged row's id, if one is dragged.
|
|
60
|
+
*/
|
|
61
|
+
const useShiftedRows = (list, order, draggedId) => {
|
|
62
|
+
const tops = useRef(new Map());
|
|
63
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: the rows are measured again whenever their order changes
|
|
64
|
+
useLayoutEffect(() => {
|
|
65
|
+
const rows = [...(list.current?.querySelectorAll("[data-control]") ?? [])];
|
|
66
|
+
const isReduced = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
67
|
+
for (const row of rows) {
|
|
68
|
+
const id = row.dataset["control"] ?? "";
|
|
69
|
+
const before = tops.current.get(id);
|
|
70
|
+
tops.current.set(id, row.offsetTop);
|
|
71
|
+
if (before === undefined || id === draggedId || isReduced)
|
|
72
|
+
continue;
|
|
73
|
+
// where the row is drawn now: its last place plus what a running move still shifts it by
|
|
74
|
+
const shift = new DOMMatrixReadOnly(getComputedStyle(row).transform).m42;
|
|
75
|
+
const start = before + shift - row.offsetTop;
|
|
76
|
+
for (const running of row.getAnimations())
|
|
77
|
+
running.cancel();
|
|
78
|
+
if (start === 0)
|
|
79
|
+
continue;
|
|
80
|
+
row.animate([{ transform: `translateY(${start}px)` }, { transform: "translateY(0)" }], {
|
|
81
|
+
duration: SHIFT_MS,
|
|
82
|
+
easing: SHIFT_EASING
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}, [order]);
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* The controls hidden in the menu, at its foot: their count, which opens them as rows like the others, each one usable
|
|
89
|
+
* while it stays hidden, with its pin (a hidden control may still sit on the toolbar) and a button that shows it
|
|
90
|
+
* again in its place.
|
|
91
|
+
*
|
|
92
|
+
* @param props - the hidden controls, the arrangement, and what every control shares.
|
|
93
|
+
*/
|
|
94
|
+
const HiddenControls = ({ hidden, layout, ...context }) => {
|
|
95
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
96
|
+
const listId = useId();
|
|
97
|
+
if (hidden.length === 0)
|
|
98
|
+
return null;
|
|
99
|
+
return (_jsxs("div", { className: "forgebook-hidden-controls", children: [_jsxs("button", { type: "button", className: "forgebook-text-button", "aria-expanded": isOpen, "aria-controls": listId, onClick: () => setIsOpen(!isOpen), children: [STRINGS.hiddenControls(hidden.length), _jsx(Icon, { name: isOpen ? "chevronDown" : "chevronRight", size: 12 })] }), isOpen ? (_jsx("ul", { id: listId, className: "forgebook-arrange-list", children: hidden.map(({ control, isPinned }) => {
|
|
100
|
+
const label = controlLabel(control);
|
|
101
|
+
return (_jsxs("li", { className: "forgebook-arrange", "data-control": control.id, "data-hidden": "", children: [_jsx("span", { className: "forgebook-arrange__no-handle" }), _jsx("span", { className: "forgebook-popover__label", children: label }), _jsx("div", { className: "forgebook-arrange__control", children: _jsx(ToolbarControl, { control: control, form: "row", ...context }) }), _jsx("button", { type: "button", className: "forgebook-icon-button", "aria-label": STRINGS.pinControl(label), title: 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.showControl(label), title: STRINGS.showControl(label), onClick: () => layout.hide(control.id, false), children: _jsx(Icon, { name: "eye", size: 14 }) })] }, control.id));
|
|
102
|
+
}) })) : null] }));
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* The View menu.
|
|
106
|
+
*
|
|
107
|
+
* @param props - the arrangement, whether the person changed one of the menu's values, and what every control shares.
|
|
108
|
+
*/
|
|
109
|
+
export const ViewMenu = ({ layout, ownView, movedIds, ...context }) => {
|
|
110
|
+
const { isOpen, isDrawn, setIsOpen, buttonRef, panelRef, panelId } = usePopover();
|
|
111
|
+
const { switches } = useCatalogue();
|
|
112
|
+
const listRef = useRef(null);
|
|
113
|
+
const drag = useRef(undefined);
|
|
114
|
+
const [draggedId, setDraggedId] = useState(undefined);
|
|
115
|
+
const [announced, setAnnounced] = useState("");
|
|
116
|
+
const hintId = useId();
|
|
117
|
+
const shown = layout.placed.filter((each) => !each.isHidden);
|
|
118
|
+
const hidden = layout.placed.filter((each) => each.isHidden);
|
|
119
|
+
const ids = menuControlIds(layout.placed);
|
|
120
|
+
const order = shown.map((each) => each.control.id).join(",");
|
|
121
|
+
useShiftedRows(listRef, order, draggedId);
|
|
122
|
+
// the menu never runs past the window's edge: a narrow window keeps it inside, its widest values then scroll
|
|
123
|
+
useLayoutEffect(() => {
|
|
124
|
+
const panel = panelRef.current;
|
|
125
|
+
if (!isDrawn || panel === null)
|
|
126
|
+
return;
|
|
127
|
+
const keepInside = () => {
|
|
128
|
+
panel.style.maxWidth = `${window.innerWidth - panel.getBoundingClientRect().left - EDGE_PX}px`;
|
|
129
|
+
};
|
|
130
|
+
keepInside();
|
|
131
|
+
window.addEventListener("resize", keepInside);
|
|
132
|
+
return () => window.removeEventListener("resize", keepInside);
|
|
133
|
+
}, [isDrawn, panelRef]);
|
|
134
|
+
/** Keeps the dragged row under the pointer, from where its row is drawn now. */
|
|
135
|
+
const follow = () => {
|
|
136
|
+
const current = drag.current;
|
|
137
|
+
const row = listRef.current?.querySelector(`[data-control="${current?.id}"]`);
|
|
138
|
+
if (current === undefined || row === null || row === undefined)
|
|
139
|
+
return;
|
|
140
|
+
const offset = current.pointerY - current.startY - (row.offsetTop - current.startTop);
|
|
141
|
+
row.style.transform = `translateY(${offset}px)`;
|
|
142
|
+
};
|
|
143
|
+
// after a move, the dragged row is drawn at its new place: it stays under the pointer
|
|
144
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: follows each new order while a row is dragged
|
|
145
|
+
useLayoutEffect(follow, [order]);
|
|
146
|
+
/** The list's rows as they are drawn now. */
|
|
147
|
+
const rowsNow = () => [
|
|
148
|
+
...(listRef.current?.querySelectorAll("[data-control]") ?? [])
|
|
149
|
+
];
|
|
150
|
+
/**
|
|
151
|
+
* Where the dragged row goes: past every other row whose middle its own middle passed, both read from the layout
|
|
152
|
+
* (never from how a running move draws them, which would move the target under the pointer and back).
|
|
153
|
+
*
|
|
154
|
+
* @param id - the dragged row's id.
|
|
155
|
+
* @param current - the drag.
|
|
156
|
+
*/
|
|
157
|
+
const targetIndex = (id, current) => {
|
|
158
|
+
const rows = rowsNow();
|
|
159
|
+
const row = rows.find((each) => each.dataset["control"] === id);
|
|
160
|
+
if (row === undefined)
|
|
161
|
+
return 0;
|
|
162
|
+
const center = current.startTop + (current.pointerY - current.startY) + row.offsetHeight / 2;
|
|
163
|
+
return rows.filter((each) => each !== row && center > each.offsetTop + each.offsetHeight / 2).length;
|
|
164
|
+
};
|
|
165
|
+
// a menu closed while a row is dragged ends the drag
|
|
166
|
+
const stopDrag = useRef(undefined);
|
|
167
|
+
useEffect(() => () => stopDrag.current?.(), []);
|
|
168
|
+
const grab = (event, id) => {
|
|
169
|
+
const row = event.currentTarget.closest("[data-control]");
|
|
170
|
+
if (row === null || event.button !== 0)
|
|
171
|
+
return;
|
|
172
|
+
// no text selection while dragging; the handle still takes the focus, so the arrow keys move its row next
|
|
173
|
+
event.preventDefault();
|
|
174
|
+
event.currentTarget.focus();
|
|
175
|
+
window.getSelection()?.removeAllRanges();
|
|
176
|
+
drag.current = { id, startY: event.clientY, startTop: row.offsetTop, pointerY: event.clientY };
|
|
177
|
+
setDraggedId(id);
|
|
178
|
+
// the window, not the handle, follows the pointer: moving the row in the page takes the handle's pointer capture
|
|
179
|
+
// away, and the release would never arrive
|
|
180
|
+
const moveTo = (moved) => {
|
|
181
|
+
const current = drag.current;
|
|
182
|
+
if (current === undefined)
|
|
183
|
+
return;
|
|
184
|
+
current.pointerY = moved.clientY;
|
|
185
|
+
follow();
|
|
186
|
+
const index = targetIndex(id, current);
|
|
187
|
+
if (index !== rowsNow().findIndex((each) => each.dataset["control"] === id))
|
|
188
|
+
layout.move(id, index);
|
|
189
|
+
};
|
|
190
|
+
const drop = () => {
|
|
191
|
+
window.removeEventListener("pointermove", moveTo);
|
|
192
|
+
window.removeEventListener("pointerup", drop);
|
|
193
|
+
window.removeEventListener("pointercancel", drop);
|
|
194
|
+
stopDrag.current = undefined;
|
|
195
|
+
drag.current = undefined;
|
|
196
|
+
setDraggedId(undefined);
|
|
197
|
+
// the row settles into its place from where the pointer left it
|
|
198
|
+
const dropped = rowsNow().find((each) => each.dataset["control"] === id);
|
|
199
|
+
if (dropped === undefined)
|
|
200
|
+
return;
|
|
201
|
+
const from = dropped.style.transform;
|
|
202
|
+
dropped.style.transform = "";
|
|
203
|
+
if (from !== "" && !window.matchMedia("(prefers-reduced-motion: reduce)").matches)
|
|
204
|
+
dropped.animate([{ transform: from }, { transform: "translateY(0)" }], {
|
|
205
|
+
duration: SHIFT_MS,
|
|
206
|
+
easing: SHIFT_EASING
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
stopDrag.current = drop;
|
|
210
|
+
window.addEventListener("pointermove", moveTo);
|
|
211
|
+
window.addEventListener("pointerup", drop);
|
|
212
|
+
window.addEventListener("pointercancel", drop);
|
|
213
|
+
};
|
|
214
|
+
return (_jsxs("div", { className: "forgebook-view-menu", children: [_jsxs("button", { ref: buttonRef, type: "button", className: "forgebook-button", "aria-expanded": isOpen, "aria-controls": panelId, onClick: (event) => setIsOpen(!isOpen, event), children: [_jsx(Icon, { name: "sliders", size: 14 }), STRINGS.view, hasViewChanges(ownView, switches, ids) ? (_jsx("span", { className: "forgebook-dot", role: "img", "aria-label": STRINGS.viewChanged })) : null, _jsx(Icon, { name: "chevronDown", size: 12 })] }), isDrawn ? (_jsxs("div", { ref: panelRef, id: panelId, className: "forgebook-popover forgebook-popover--arrange", role: "dialog", "aria-label": STRINGS.view, children: [_jsx(NamedViews, { view: context.view, ownView: ownView, onViewChange: context.onViewChange }), _jsx("ol", { ref: listRef, className: "forgebook-arrange-list", "data-dragging": draggedId === undefined ? undefined : "", children: shown.map((each, index) => (_jsx(ControlRow, { each: each, index: index, count: shown.length, isDragged: each.control.id === draggedId, isMoved: movedIds.includes(each.control.id), isChanged: hasViewChanges(ownView, switches, [each.control.id]), layout: layout, hintId: hintId, onGrab: grab, onAnnounce: setAnnounced, ...context }, each.control.id))) }), _jsx("span", { id: hintId, className: "forgebook-visually-hidden", children: STRINGS.moveControlHint }), _jsx("span", { className: "forgebook-visually-hidden", "aria-live": "polite", children: announced }), _jsx(HiddenControls, { hidden: hidden, layout: layout, ...context }), _jsxs("label", { className: "forgebook-wrap-choice", children: [_jsx("input", { type: "checkbox", role: "switch", "aria-checked": layout.isWrapped, className: "forgebook-switch", checked: layout.isWrapped, onChange: (event) => layout.setIsWrapped(event.currentTarget.checked) }), STRINGS.wrapToolbar] }), _jsxs("div", { className: "forgebook-popover__foot", children: [_jsx("button", { type: "button", className: "forgebook-text-button", onClick: () => context.onViewChange(withDefaults(context.view, switches, ids)), children: STRINGS.resetView }), _jsx("button", { type: "button", className: "forgebook-text-button", title: STRINGS.toolbarInBrowser, disabled: !layout.isArranged, onClick: layout.reset, children: STRINGS.resetToolbar }), _jsx("span", { className: "forgebook-popover__note", children: STRINGS.viewInAddress })] })] })) : null] }));
|
|
215
|
+
};
|
|
216
|
+
//# sourceMappingURL=ViewMenu.js.map
|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,MAAM,CAAC,KAAK,YAEpB,OAAO,CAAC,YAAY,GACd,EACT,eAAM,SAAS,EAAC,yBAAyB,YAAE,OAAO,CAAC,aAAa,GAAQ,IACpE,IACF,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A control's next value, for its key: the view with one control moved on by a step through its values, as its
|
|
3
|
+
* toolbar control would set it.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Pure. A control its toolbar control leaves disabled is left as it is here too: a switch or a background the story
|
|
7
|
+
* fixes (or a width), and a control the compare view draws side by side.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import type { CatalogueSettings } from "../catalogue.ts";
|
|
12
|
+
import type { FixedView } from "../storyGlobals.ts";
|
|
13
|
+
import { type ViewState } from "../viewState.ts";
|
|
14
|
+
/** What a cycle reads of the catalogue: its controls' values. */
|
|
15
|
+
type CycledCatalogue = Pick<CatalogueSettings, "switches" | "backdrops" | "textSizes" | "widths">;
|
|
16
|
+
/**
|
|
17
|
+
* The view with a control moved on by a step, or none when the control cannot be set now.
|
|
18
|
+
*
|
|
19
|
+
* @param view - the view shown.
|
|
20
|
+
* @param id - the control's id.
|
|
21
|
+
* @param step - 1 forward, -1 back.
|
|
22
|
+
* @param catalogue - the controls' values.
|
|
23
|
+
* @param fixed - what the shown story fixes of the view.
|
|
24
|
+
* @param isStoryPage - whether a story's page is shown (the compare view draws there).
|
|
25
|
+
*/
|
|
26
|
+
export declare const cycledView: (view: ViewState, id: string, step: 1 | -1, catalogue: CycledCatalogue, fixed: FixedView, isStoryPage: boolean) => ViewState | undefined;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=controlCycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controlCycle.d.ts","sourceRoot":"","sources":["../../../src/shell/controlCycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAmD,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGlG,iEAAiE;AACjE,KAAK,eAAe,GAAG,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC,CAAC;AA2BlG;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GACrB,MAAM,SAAS,EACf,IAAI,MAAM,EACV,MAAM,CAAC,GAAG,CAAC,CAAC,EACZ,WAAW,eAAe,EAC1B,OAAO,SAAS,EAChB,aAAa,OAAO,KACnB,SAAS,GAAG,SAYd,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { cycledValue, switchValues } from "../controlKeys.js";
|
|
2
|
+
import { PLAIN_BACKDROP, SHEETS_CHOICES } from "../viewState.js";
|
|
3
|
+
import { withSwitch } from "./switchView.js";
|
|
4
|
+
/**
|
|
5
|
+
* The view with one of Forgebook's own controls moved on.
|
|
6
|
+
*
|
|
7
|
+
* @param view - the view.
|
|
8
|
+
* @param id - the control's id.
|
|
9
|
+
* @param step - 1 forward, -1 back.
|
|
10
|
+
* @param catalogue - the controls' values.
|
|
11
|
+
*/
|
|
12
|
+
const cycledOwn = (view, id, step, catalogue) => {
|
|
13
|
+
if (id === "backdrop") {
|
|
14
|
+
const backdrops = [PLAIN_BACKDROP, ...catalogue.backdrops.map((backdrop) => backdrop.id)];
|
|
15
|
+
return { ...view, backdrop: cycledValue(backdrops, view.backdrop, step) };
|
|
16
|
+
}
|
|
17
|
+
if (id === "sheets")
|
|
18
|
+
return { ...view, sheets: cycledValue(SHEETS_CHOICES, view.sheets, step) };
|
|
19
|
+
if (id === "text")
|
|
20
|
+
return { ...view, text: cycledValue(catalogue.textSizes, view.text, step) };
|
|
21
|
+
if (id !== "width")
|
|
22
|
+
return undefined;
|
|
23
|
+
const widths = ["fill", ...catalogue.widths.map((preset) => preset.width)];
|
|
24
|
+
return { ...view, width: cycledValue(widths, view.width, step) };
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* The view with a control moved on by a step, or none when the control cannot be set now.
|
|
28
|
+
*
|
|
29
|
+
* @param view - the view shown.
|
|
30
|
+
* @param id - the control's id.
|
|
31
|
+
* @param step - 1 forward, -1 back.
|
|
32
|
+
* @param catalogue - the controls' values.
|
|
33
|
+
* @param fixed - what the shown story fixes of the view.
|
|
34
|
+
* @param isStoryPage - whether a story's page is shown (the compare view draws there).
|
|
35
|
+
*/
|
|
36
|
+
export const cycledView = (view, id, step, catalogue, fixed, isStoryPage) => {
|
|
37
|
+
if (isStoryPage && view.compare.includes(id))
|
|
38
|
+
return undefined;
|
|
39
|
+
const each = catalogue.switches.find((candidate) => candidate.id === id);
|
|
40
|
+
if (each !== undefined) {
|
|
41
|
+
if (fixed.switches[id] !== undefined)
|
|
42
|
+
return undefined;
|
|
43
|
+
const current = view.switches[id] ?? each.default;
|
|
44
|
+
return withSwitch(view, each, cycledValue(switchValues(each), current, step));
|
|
45
|
+
}
|
|
46
|
+
const isFixed = (id === "backdrop" && fixed.backdrop !== undefined) || (id === "width" && fixed.width !== undefined);
|
|
47
|
+
if (isFixed)
|
|
48
|
+
return undefined;
|
|
49
|
+
return cycledOwn(view, id, step, catalogue);
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=controlCycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controlCycle.js","sourceRoot":"","sources":["../../../src/shell/controlCycle.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAmC,MAAM,iBAAiB,CAAC;AAClG,OAAO,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EAC1B,KAAgB,EAChB,WAAoB,EACG,EAAE;IACzB,IAAI,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAAE,OAAO,SAAS,CAAC;IAC/D,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACzE,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QACvD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC;QAClD,OAAO,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAChF,CAAC;IACD,MAAM,OAAO,GACX,CAAC,EAAE,KAAK,UAAU,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,IAAI,CAAC,EAAE,KAAK,OAAO,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;IACvG,IAAI,OAAO;QAAE,OAAO,SAAS,CAAC;IAC9B,OAAO,SAAS,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;AAC9C,CAAC,CAAC"}
|
|
@@ -15,6 +15,7 @@ import type { DockTab } from "./Dock.tsx";
|
|
|
15
15
|
import { type TextArgNote } from "./PropsTab.tsx";
|
|
16
16
|
import type { EventCall } from "./useFrameMessages.ts";
|
|
17
17
|
import type { Loaded } from "./useLoaded.ts";
|
|
18
|
+
import type { WorstCaseState } from "./worstArgs.ts";
|
|
18
19
|
/** What the tabs are built from. */
|
|
19
20
|
export type DockTabsInput = {
|
|
20
21
|
/** The component's docs, as loaded. */
|
|
@@ -37,6 +38,8 @@ export type DockTabsInput = {
|
|
|
37
38
|
readonly onValueChange: (name: string, value: ArgValue | undefined) => void;
|
|
38
39
|
/** Removes every value the panel set. */
|
|
39
40
|
readonly onReset: () => void;
|
|
41
|
+
/** The worst case: whether it can be set, whether it is on, and the spills the frame counts. */
|
|
42
|
+
readonly worstCase: WorstCaseState;
|
|
40
43
|
/** The values the source names for types the panel cannot write. */
|
|
41
44
|
readonly namedValues: NamedValues | undefined;
|
|
42
45
|
/** The props the story gives a text by its key, by name. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dockTabs.d.ts","sourceRoot":"","sources":["../../../src/shell/dockTabs.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG1F,OAAO,EAAE,KAAK,aAAa,EAA8B,MAAM,gBAAgB,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAY,MAAM,qBAAqB,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAEnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAI1C,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"dockTabs.d.ts","sourceRoot":"","sources":["../../../src/shell/dockTabs.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,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AQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,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,gGAAgG;IAChG,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,oEAAoE;IACpE,QAAQ,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IAC9C,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IACzD,uCAAuC;IACvC,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IACrC,wBAAwB;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC;IAClC,qFAAqF;IACrF,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;IACtC,2BAA2B;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC;IACjC,+BAA+B;IAC/B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,wCAAwC;IACxC,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;CAC5C,CAAC;AAqJF;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,KAAG,OAAO,EAStD,CAAC"}
|
|
@@ -20,7 +20,7 @@ const propsTab = (input, props) => props.some((prop) => prop.kind !== "event")
|
|
|
20
20
|
{
|
|
21
21
|
id: "props",
|
|
22
22
|
label: STRINGS.tabs.props,
|
|
23
|
-
content: (_jsx(PropsTab, { props: props, values: input.values, controls: input.controls, onValueChange: input.onValueChange, onReset: input.onReset, namedValues: input.namedValues, textArgs: input.textArgs }))
|
|
23
|
+
content: (_jsx(PropsTab, { props: props, values: input.values, controls: input.controls, onValueChange: input.onValueChange, onReset: input.onReset, worstCase: input.worstCase, namedValues: input.namedValues, textArgs: input.textArgs }))
|
|
24
24
|
}
|
|
25
25
|
]
|
|
26
26
|
: [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dockTabs.js","sourceRoot":"","sources":["../../../src/shell/dockTabs.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAsC,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAKhF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAmB,MAAM,cAAe,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAuB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,eAAgB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAoB,MAAM,eAAgB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"dockTabs.js","sourceRoot":"","sources":["../../../src/shell/dockTabs.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAsC,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAKhF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAmB,MAAM,cAAe,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAuB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,eAAgB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAoB,MAAM,eAAgB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM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v4M6.5 13.5h-4v-4M13.5 2.5 9 7M2.5 13.5 7 9";
|
|
35
|
+
readonly collapse: "M13.5 6.5h-4v-4M2.5 9.5h4v4M9.5 6.5 14 2M6.5 9.5 2 14";
|
|
36
|
+
readonly grip: "M6 4h0M10 4h0M6 8h0M10 8h0M6 12h0M10 12h0";
|
|
37
|
+
readonly pin: "M6 2.5h4M7 2.5V6.5L4.5 9.5h7L9 6.5V2.5M8 9.5v4";
|
|
38
|
+
readonly eye: "M2 8s2.2-4 6-4 6 4 6 4-2.2 4-6 4-6-4-6-4ZM8 6.5a1.5 1.5 0 1 0 0 3a1.5 1.5 0 0 0 0-3Z";
|
|
39
|
+
readonly eyeOff: "M2 8s2.2-4 6-4 6 4 6 4-2.2 4-6 4-6-4-6-4ZM8 6.5a1.5 1.5 0 1 0 0 3a1.5 1.5 0 0 0 0-3ZM3 13 13 3";
|
|
34
40
|
};
|
|
35
41
|
/** An icon's name. */
|
|
36
42
|
export type IconName = keyof typeof PATHS;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/shell/icons.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,0BAA0B;AAC1B,QAAA,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/shell/icons.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,0BAA0B;AAC1B,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCD,CAAC;AAEX,sBAAsB;AACtB,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,KAAK,CAAC;AAE1C;;;;GAIG;AACH,eAAO,MAAM,IAAI,GAAI,gBAAqB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,KAAG,SAc/F,CAAC"}
|
package/dist/src/shell/icons.js
CHANGED
|
@@ -25,7 +25,13 @@ const PATHS = {
|
|
|
25
25
|
plus: "M8 3.5v9M3.5 8h9",
|
|
26
26
|
minus: "M3.5 8h9",
|
|
27
27
|
hash: "M6 2.5 5 13.5M11 2.5l-1 11M3 6h10.5M2.5 10H13",
|
|
28
|
-
check: "m3.5 8.5 3 3 6-7"
|
|
28
|
+
check: "m3.5 8.5 3 3 6-7",
|
|
29
|
+
expand: "M9.5 2.5h4v4M6.5 13.5h-4v-4M13.5 2.5 9 7M2.5 13.5 7 9",
|
|
30
|
+
collapse: "M13.5 6.5h-4v-4M2.5 9.5h4v4M9.5 6.5 14 2M6.5 9.5 2 14",
|
|
31
|
+
grip: "M6 4h0M10 4h0M6 8h0M10 8h0M6 12h0M10 12h0",
|
|
32
|
+
pin: "M6 2.5h4M7 2.5V6.5L4.5 9.5h7L9 6.5V2.5M8 9.5v4",
|
|
33
|
+
eye: "M2 8s2.2-4 6-4 6 4 6 4-2.2 4-6 4-6-4-6-4ZM8 6.5a1.5 1.5 0 1 0 0 3a1.5 1.5 0 0 0 0-3Z",
|
|
34
|
+
eyeOff: "M2 8s2.2-4 6-4 6 4 6 4-2.2 4-6 4-6-4-6-4ZM8 6.5a1.5 1.5 0 1 0 0 3a1.5 1.5 0 0 0 0-3ZM3 13 13 3"
|
|
29
35
|
};
|
|
30
36
|
/**
|
|
31
37
|
* One icon, 16 px by default, in the current colour.
|