@dxos/plugin-deck 0.8.4-main.4a85c3132b → 0.8.4-main.4f23b4e393
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/dist/lib/neutral/DeckLayout-6SICSSUF.mjs +278 -0
- package/dist/lib/neutral/DeckLayout-6SICSSUF.mjs.map +7 -0
- package/dist/lib/neutral/DeckPlugin.mjs +70 -0
- package/dist/lib/neutral/DeckPlugin.mjs.map +7 -0
- package/dist/lib/neutral/DeckPlugin.node.mjs +18 -0
- package/dist/lib/neutral/DeckPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/DeckSettings-W5I57OXM.mjs +27 -0
- package/dist/lib/neutral/DeckSettings-W5I57OXM.mjs.map +7 -0
- package/dist/lib/neutral/add-toast-2OMTFZ2L.mjs +24 -0
- package/dist/lib/neutral/add-toast-2OMTFZ2L.mjs.map +7 -0
- package/dist/lib/neutral/adjust-RXTF3IT3.mjs +93 -0
- package/dist/lib/neutral/adjust-RXTF3IT3.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-GZYYAN5B.mjs +129 -0
- package/dist/lib/neutral/app-graph-builder-GZYYAN5B.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +23 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/check-app-scheme-A7FZVNZO.mjs +10 -0
- package/dist/lib/neutral/chunk-4MYX2NT3.mjs +1335 -0
- package/dist/lib/neutral/chunk-4MYX2NT3.mjs.map +7 -0
- package/dist/lib/neutral/chunk-64ODQD6S.mjs +282 -0
- package/dist/lib/neutral/chunk-64ODQD6S.mjs.map +7 -0
- package/dist/lib/neutral/chunk-6MOYMDKQ.mjs +8 -0
- package/dist/lib/neutral/chunk-6MOYMDKQ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GBIGQKYW.mjs +112 -0
- package/dist/lib/neutral/chunk-GBIGQKYW.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GLB73Q6U.mjs +22 -0
- package/dist/lib/neutral/chunk-GLB73Q6U.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/{browser/chunk-FBL4WVYZ.mjs → neutral/chunk-JMYWDX4I.mjs} +6 -3
- package/dist/lib/{browser/chunk-FBL4WVYZ.mjs.map → neutral/chunk-JMYWDX4I.mjs.map} +3 -3
- package/dist/lib/neutral/chunk-VHETZ22W.mjs +101 -0
- package/dist/lib/neutral/chunk-VHETZ22W.mjs.map +7 -0
- package/dist/lib/{browser/chunk-SKBPLX5T.mjs → neutral/chunk-ZYYOSX5I.mjs} +22 -34
- package/dist/lib/neutral/chunk-ZYYOSX5I.mjs.map +7 -0
- package/dist/lib/neutral/close-DG5IVQCE.mjs +44 -0
- package/dist/lib/neutral/close-DG5IVQCE.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +126 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +32 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/{browser/chunk-Q4GUCIRE.mjs → neutral/hooks/index.mjs} +34 -56
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +38 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/open-SGYZO7RF.mjs +147 -0
- package/dist/lib/neutral/open-SGYZO7RF.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-266CVMTW.mjs +13 -0
- package/dist/lib/neutral/operation-handler-266CVMTW.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/{browser/react-root-4ESZAM6D.mjs → neutral/react-root-WZ6KH27J.mjs} +6 -14
- package/dist/lib/neutral/react-root-WZ6KH27J.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-KAAZDHV3.mjs +34 -0
- package/dist/lib/neutral/react-surface-KAAZDHV3.mjs.map +7 -0
- package/dist/lib/neutral/revert-workspace-V6D7W6CL.mjs +21 -0
- package/dist/lib/neutral/revert-workspace-V6D7W6CL.mjs.map +7 -0
- package/dist/lib/neutral/scroll-into-view-UM446Q2T.mjs +21 -0
- package/dist/lib/neutral/scroll-into-view-UM446Q2T.mjs.map +7 -0
- package/dist/lib/neutral/set-JFFKT32S.mjs +37 -0
- package/dist/lib/neutral/set-JFFKT32S.mjs.map +7 -0
- package/dist/lib/neutral/set-layout-mode-I4YV5V2Y.mjs +85 -0
- package/dist/lib/neutral/set-layout-mode-I4YV5V2Y.mjs.map +7 -0
- package/dist/lib/{browser/settings-RY2TBSGP.mjs → neutral/settings-FE7AC5VS.mjs} +7 -13
- package/dist/lib/neutral/settings-FE7AC5VS.mjs.map +7 -0
- package/dist/lib/neutral/show-undo-ZCMF4J2Q.mjs +59 -0
- package/dist/lib/neutral/show-undo-ZCMF4J2Q.mjs.map +7 -0
- package/dist/lib/{browser/state-CSTTMJ43.mjs → neutral/state-IIDXMQUO.mjs} +14 -34
- package/dist/lib/neutral/state-IIDXMQUO.mjs.map +7 -0
- package/dist/lib/neutral/switch-workspace-CVDYG5YZ.mjs +60 -0
- package/dist/lib/neutral/switch-workspace-CVDYG5YZ.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +57 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +34 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/neutral/update-companion-VPCM7FJX.mjs +32 -0
- package/dist/lib/neutral/update-companion-VPCM7FJX.mjs.map +7 -0
- package/dist/lib/neutral/update-complementary-SEQ6DDWA.mjs +28 -0
- package/dist/lib/neutral/update-complementary-SEQ6DDWA.mjs.map +7 -0
- package/dist/lib/neutral/update-dialog-VDHYE4QH.mjs +29 -0
- package/dist/lib/neutral/update-dialog-VDHYE4QH.mjs.map +7 -0
- package/dist/lib/neutral/update-plank-size-ZXOUZD7Y.mjs +26 -0
- package/dist/lib/neutral/update-plank-size-ZXOUZD7Y.mjs.map +7 -0
- package/dist/lib/neutral/update-popover-VFP32W57.mjs +33 -0
- package/dist/lib/neutral/update-popover-VFP32W57.mjs.map +7 -0
- package/dist/lib/neutral/update-sidebar-O5HBOXYH.mjs +25 -0
- package/dist/lib/neutral/update-sidebar-O5HBOXYH.mjs.map +7 -0
- package/dist/lib/neutral/url-handler-3QTKEM2K.mjs +184 -0
- package/dist/lib/neutral/url-handler-3QTKEM2K.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts +1 -0
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/DeckPlugin.node.d.ts +4 -0
- package/dist/types/src/DeckPlugin.node.d.ts.map +1 -0
- package/dist/types/src/DeckPlugin.test.d.ts +2 -0
- package/dist/types/src/DeckPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/check-app-scheme.d.ts +19 -0
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +198 -9
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +7 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +38 -22
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/{tools/tools.d.ts → tools.d.ts} +1 -1
- package/dist/types/src/capabilities/tools.d.ts.map +1 -0
- package/dist/types/src/capabilities/{url-handler/url-handler.d.ts → url-handler.d.ts} +1 -1
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -0
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +6 -0
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -0
- package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts +61 -0
- package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/DeckSettings/index.d.ts +2 -0
- package/dist/types/src/components/DeckSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/Matrix/Matrix.d.ts +41 -0
- package/dist/types/src/components/Matrix/Matrix.d.ts.map +1 -0
- package/dist/types/src/components/Matrix/Matrix.stories.d.ts +17 -0
- package/dist/types/src/components/Matrix/Matrix.stories.d.ts.map +1 -0
- package/dist/types/src/components/Matrix/index.d.ts +3 -0
- package/dist/types/src/components/Matrix/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +3 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/{components/DeckLayout → containers/Deck}/Banner.d.ts +1 -1
- package/dist/types/src/containers/Deck/Banner.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/Deck.d.ts +25 -0
- package/dist/types/src/containers/Deck/Deck.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/Deck.stories.d.ts +61 -0
- package/dist/types/src/containers/Deck/Deck.stories.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckContent.d.ts +7 -0
- package/dist/types/src/containers/Deck/DeckContent.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckRoot.d.ts +39 -0
- package/dist/types/src/containers/Deck/DeckRoot.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckViewport.d.ts +16 -0
- package/dist/types/src/containers/Deck/DeckViewport.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/StatusBar.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/index.d.ts +2 -0
- package/dist/types/src/containers/Deck/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/DeckLayout/ActiveNode.d.ts.map +1 -1
- package/dist/types/src/containers/DeckLayout/DeckLayout.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts +63 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/Dialog.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/Fallback.d.ts +2 -0
- package/dist/types/src/containers/DeckLayout/Fallback.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/Popover.d.ts +5 -0
- package/dist/types/src/containers/DeckLayout/Popover.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/DeckLayout/Toast.d.ts +1 -1
- package/dist/types/src/containers/DeckLayout/Toast.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/constants.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/index.d.ts +4 -0
- package/dist/types/src/containers/DeckLayout/index.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/Plank.d.ts +17 -0
- package/dist/types/src/containers/Plank/Plank.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/Plank.stories.d.ts +61 -0
- package/dist/types/src/containers/Plank/Plank.stories.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankComponent.d.ts +17 -0
- package/dist/types/src/containers/Plank/PlankComponent.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankContent.d.ts +10 -0
- package/dist/types/src/containers/Plank/PlankContent.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Plank/PlankControls.d.ts +5 -6
- package/dist/types/src/containers/Plank/PlankControls.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Plank/PlankError.d.ts +2 -2
- package/dist/types/src/containers/Plank/PlankError.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Plank/PlankHeading.d.ts +3 -2
- package/dist/types/src/containers/Plank/PlankHeading.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Plank/PlankLoading.d.ts.map +1 -1
- package/dist/types/src/containers/Plank/PlankRoot.d.ts +37 -0
- package/dist/types/src/containers/Plank/PlankRoot.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/index.d.ts +4 -0
- package/dist/types/src/containers/Plank/index.d.ts.map +1 -0
- package/dist/types/src/containers/Sidebar/ComplementarySidebar.d.ts.map +1 -0
- package/dist/types/src/containers/Sidebar/Sidebar.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Sidebar/SidebarButton.d.ts +1 -1
- package/dist/types/src/containers/Sidebar/SidebarButton.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Sidebar/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +4 -2
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBreakpoints.d.ts +1 -1
- package/dist/types/src/hooks/useCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +2 -2
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckState.d.ts +3 -3
- package/dist/types/src/hooks/useDeckState.d.ts.map +1 -1
- package/dist/types/src/hooks/useHoistStatusbar.d.ts +1 -1
- package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
- package/dist/types/src/hooks/useMainSize.d.ts.map +1 -1
- package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
- package/dist/types/src/hooks/useSelectedCompanion.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/layout.d.ts +20 -9
- package/dist/types/src/layout.d.ts.map +1 -1
- package/dist/types/src/layout.test.d.ts +2 -0
- package/dist/types/src/layout.test.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/add-toast.d.ts +5 -0
- package/dist/types/src/operations/add-toast.d.ts.map +1 -0
- package/dist/types/src/operations/adjust.d.ts +5 -0
- package/dist/types/src/operations/adjust.d.ts.map +1 -0
- package/dist/types/src/operations/close.d.ts +5 -0
- package/dist/types/src/operations/close.d.ts.map +1 -0
- package/dist/types/src/operations/helpers.d.ts +3 -0
- package/dist/types/src/operations/helpers.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/open.d.ts +5 -0
- package/dist/types/src/operations/open.d.ts.map +1 -0
- package/dist/types/src/operations/revert-workspace.d.ts +5 -0
- package/dist/types/src/operations/revert-workspace.d.ts.map +1 -0
- package/dist/types/src/operations/scroll-into-view.d.ts +5 -0
- package/dist/types/src/operations/scroll-into-view.d.ts.map +1 -0
- package/dist/types/src/operations/set-layout-mode.d.ts +9 -0
- package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -0
- package/dist/types/src/operations/set.d.ts +5 -0
- package/dist/types/src/operations/set.d.ts.map +1 -0
- package/dist/types/src/operations/show-undo.d.ts +5 -0
- package/dist/types/src/operations/show-undo.d.ts.map +1 -0
- package/dist/types/src/operations/switch-workspace.d.ts +5 -0
- package/dist/types/src/operations/switch-workspace.d.ts.map +1 -0
- package/dist/types/src/operations/update-companion.d.ts +5 -0
- package/dist/types/src/operations/update-companion.d.ts.map +1 -0
- package/dist/types/src/operations/update-complementary.d.ts +5 -0
- package/dist/types/src/operations/update-complementary.d.ts.map +1 -0
- package/dist/types/src/operations/update-dialog.d.ts +5 -0
- package/dist/types/src/operations/update-dialog.d.ts.map +1 -0
- package/dist/types/src/operations/update-plank-size.d.ts +5 -0
- package/dist/types/src/operations/update-plank-size.d.ts.map +1 -0
- package/dist/types/src/operations/update-popover.d.ts +5 -0
- package/dist/types/src/operations/update-popover.d.ts.map +1 -0
- package/dist/types/src/operations/update-sidebar.d.ts +5 -0
- package/dist/types/src/operations/update-sidebar.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +42 -56
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/{capabilities/state/index.d.ts → types/DeckCapabilities.d.ts} +51 -35
- package/dist/types/src/types/DeckCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/DeckEvents.d.ts +5 -0
- package/dist/types/src/types/DeckEvents.d.ts.map +1 -0
- package/dist/types/src/types/DeckOperation.d.ts +15 -0
- package/dist/types/src/types/DeckOperation.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +11 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +4 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +43 -104
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +2 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -1
- package/dist/types/src/util/plank-url-params.d.ts +14 -0
- package/dist/types/src/util/plank-url-params.d.ts.map +1 -0
- package/dist/types/src/util/plank-url-params.test.d.ts +2 -0
- package/dist/types/src/util/plank-url-params.test.d.ts.map +1 -0
- package/dist/types/src/util/sanitize-persisted-state.d.ts +19 -0
- package/dist/types/src/util/sanitize-persisted-state.d.ts.map +1 -0
- package/dist/types/src/util/sanitize-persisted-state.test.d.ts +2 -0
- package/dist/types/src/util/sanitize-persisted-state.test.d.ts.map +1 -0
- package/dist/types/src/util/set-active.d.ts +2 -2
- package/dist/types/src/util/set-active.d.ts.map +1 -1
- package/dist/types/src/util/set-active.test.d.ts +2 -0
- package/dist/types/src/util/set-active.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +108 -52
- package/src/DeckPlugin.node.ts +17 -0
- package/src/DeckPlugin.test.ts +27 -0
- package/src/DeckPlugin.ts +12 -16
- package/src/capabilities/app-graph-builder.ts +127 -0
- package/src/capabilities/check-app-scheme.ts +139 -0
- package/src/capabilities/index.ts +14 -10
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +3 -3
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +12 -14
- package/src/capabilities/{settings/settings.ts → settings.ts} +4 -6
- package/src/capabilities/{state/state.ts → state.ts} +13 -27
- package/src/capabilities/{tools/tools.ts → tools.ts} +6 -6
- package/src/capabilities/url-handler.ts +231 -0
- package/src/components/DeckSettings/DeckSettings.stories.tsx +38 -0
- package/src/components/DeckSettings/DeckSettings.tsx +34 -0
- package/src/components/DeckSettings/index.ts +5 -0
- package/src/components/Matrix/Matrix.stories.tsx +220 -0
- package/src/components/Matrix/Matrix.tsx +205 -0
- package/src/components/Matrix/SPEC.md +219 -0
- package/src/components/Matrix/index.ts +6 -0
- package/src/components/index.ts +6 -2
- package/src/{components/DeckLayout → containers/Deck}/Banner.tsx +7 -5
- package/src/containers/Deck/Deck.stories.tsx +81 -0
- package/src/containers/Deck/Deck.tsx +21 -0
- package/src/containers/Deck/DeckContent.tsx +105 -0
- package/src/containers/Deck/DeckRoot.tsx +50 -0
- package/src/containers/Deck/DeckViewport.tsx +451 -0
- package/src/containers/Deck/index.ts +5 -0
- package/src/{components → containers}/DeckLayout/ActiveNode.tsx +8 -4
- package/src/containers/DeckLayout/DeckLayout.stories.tsx +397 -0
- package/src/containers/DeckLayout/DeckLayout.tsx +62 -0
- package/src/{components → containers}/DeckLayout/Dialog.tsx +11 -4
- package/src/{components → containers}/DeckLayout/Fallback.tsx +4 -4
- package/src/{components → containers}/DeckLayout/Popover.tsx +62 -43
- package/src/{components → containers}/DeckLayout/Toast.tsx +1 -1
- package/src/{components → containers}/DeckLayout/constants.ts +1 -0
- package/src/{components → containers}/DeckLayout/index.ts +3 -2
- package/src/containers/Plank/Plank.stories.tsx +108 -0
- package/src/containers/Plank/Plank.tsx +22 -0
- package/src/containers/Plank/PlankComponent.tsx +217 -0
- package/src/containers/Plank/PlankContent.tsx +45 -0
- package/src/{components → containers}/Plank/PlankControls.tsx +37 -28
- package/src/{components → containers}/Plank/PlankError.tsx +20 -4
- package/src/{components → containers}/Plank/PlankHeading.tsx +53 -42
- package/src/{components → containers}/Plank/PlankLoading.tsx +1 -1
- package/src/containers/Plank/PlankRoot.tsx +49 -0
- package/src/{components → containers}/Plank/index.ts +0 -2
- package/src/{components → containers}/Sidebar/ComplementarySidebar.tsx +66 -83
- package/src/{components → containers}/Sidebar/Sidebar.tsx +8 -6
- package/src/{components → containers}/Sidebar/SidebarButton.tsx +16 -10
- package/src/containers/index.ts +5 -2
- package/src/hooks/useCompanions.ts +1 -1
- package/src/hooks/useDeckCompanions.ts +3 -7
- package/src/hooks/useDeckState.ts +11 -20
- package/src/hooks/useHoistStatusbar.ts +1 -1
- package/src/hooks/useSelectedCompanion.ts +4 -10
- package/src/index.ts +1 -3
- package/src/layout.test.ts +59 -0
- package/src/layout.ts +38 -40
- package/src/meta.ts +2 -1
- package/src/operations/add-toast.ts +24 -0
- package/src/operations/adjust.ts +82 -0
- package/src/operations/close.ts +35 -0
- package/src/operations/helpers.ts +22 -0
- package/src/operations/index.ts +24 -0
- package/src/operations/open.ts +184 -0
- package/src/operations/revert-workspace.ts +22 -0
- package/src/operations/scroll-into-view.ts +24 -0
- package/src/operations/set-layout-mode.ts +84 -0
- package/src/operations/set.ts +36 -0
- package/src/operations/show-undo.ts +47 -0
- package/src/operations/switch-workspace.ts +60 -0
- package/src/operations/update-companion.ts +35 -0
- package/src/operations/update-complementary.ts +33 -0
- package/src/operations/update-dialog.ts +34 -0
- package/src/operations/update-plank-size.ts +28 -0
- package/src/operations/update-popover.ts +36 -0
- package/src/operations/update-sidebar.ts +28 -0
- package/src/plugin.ts +11 -0
- package/src/translations.ts +42 -55
- package/src/types/DeckCapabilities.ts +34 -0
- package/src/types/DeckEvents.ts +21 -0
- package/src/types/DeckOperation.ts +51 -0
- package/src/types/Settings.ts +42 -0
- package/src/types/index.ts +5 -2
- package/src/types/schema.ts +35 -117
- package/src/util/index.ts +2 -1
- package/src/util/layoutAppliesTopbar.ts +1 -1
- package/src/util/plank-url-params.test.ts +85 -0
- package/src/util/plank-url-params.ts +36 -0
- package/src/util/sanitize-persisted-state.test.ts +79 -0
- package/src/util/sanitize-persisted-state.ts +52 -0
- package/src/util/set-active.test.ts +106 -0
- package/src/util/set-active.ts +2 -2
- package/src/vite-env.d.ts +5 -0
- package/dist/lib/browser/Banner-DR6B7XTO.mjs +0 -15
- package/dist/lib/browser/Banner-DR6B7XTO.mjs.map +0 -7
- package/dist/lib/browser/DeckSettings-HB5TKG2F.mjs +0 -96
- package/dist/lib/browser/DeckSettings-HB5TKG2F.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-22XAL7YE.mjs +0 -123
- package/dist/lib/browser/app-graph-builder-22XAL7YE.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-ZV3QWNNZ.mjs +0 -33
- package/dist/lib/browser/check-app-scheme-ZV3QWNNZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-BJDEG7YZ.mjs +0 -74
- package/dist/lib/browser/chunk-BJDEG7YZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-OAPMV5ZR.mjs +0 -280
- package/dist/lib/browser/chunk-OAPMV5ZR.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q4GUCIRE.mjs.map +0 -7
- package/dist/lib/browser/chunk-SKBPLX5T.mjs.map +0 -7
- package/dist/lib/browser/chunk-YGOOWRJE.mjs +0 -1390
- package/dist/lib/browser/chunk-YGOOWRJE.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -185
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-resolver-BLZGJWLO.mjs +0 -580
- package/dist/lib/browser/operation-resolver-BLZGJWLO.mjs.map +0 -7
- package/dist/lib/browser/react-root-4ESZAM6D.mjs.map +0 -7
- package/dist/lib/browser/react-surface-KYQGCALN.mjs +0 -44
- package/dist/lib/browser/react-surface-KYQGCALN.mjs.map +0 -7
- package/dist/lib/browser/settings-RY2TBSGP.mjs.map +0 -7
- package/dist/lib/browser/state-CSTTMJ43.mjs.map +0 -7
- package/dist/lib/browser/toolkit-EONRPYA5.mjs +0 -55
- package/dist/lib/browser/toolkit-EONRPYA5.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -40
- package/dist/lib/browser/url-handler-EM3SYHHX.mjs +0 -95
- package/dist/lib/browser/url-handler-EM3SYHHX.mjs.map +0 -7
- package/dist/lib/node-esm/Banner-HR7DPUZU.mjs +0 -16
- package/dist/lib/node-esm/Banner-HR7DPUZU.mjs.map +0 -7
- package/dist/lib/node-esm/DeckSettings-MWTR7HU2.mjs +0 -97
- package/dist/lib/node-esm/DeckSettings-MWTR7HU2.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-GNNNCWGN.mjs +0 -124
- package/dist/lib/node-esm/app-graph-builder-GNNNCWGN.mjs.map +0 -7
- package/dist/lib/node-esm/check-app-scheme-ZNISVRFH.mjs +0 -34
- package/dist/lib/node-esm/check-app-scheme-ZNISVRFH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DGTRKKWZ.mjs +0 -76
- package/dist/lib/node-esm/chunk-DGTRKKWZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EGFOT3DE.mjs +0 -18
- package/dist/lib/node-esm/chunk-EGFOT3DE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IR6ODCNC.mjs +0 -83
- package/dist/lib/node-esm/chunk-IR6ODCNC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-L2NPJPGL.mjs +0 -281
- package/dist/lib/node-esm/chunk-L2NPJPGL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-O4IOJICP.mjs +0 -201
- package/dist/lib/node-esm/chunk-O4IOJICP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Z43MBISY.mjs +0 -1391
- package/dist/lib/node-esm/chunk-Z43MBISY.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -186
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/operation-resolver-5BYDNQND.mjs +0 -581
- package/dist/lib/node-esm/operation-resolver-5BYDNQND.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-YO7IIC75.mjs +0 -50
- package/dist/lib/node-esm/react-root-YO7IIC75.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-G7VRKT4U.mjs +0 -45
- package/dist/lib/node-esm/react-surface-G7VRKT4U.mjs.map +0 -7
- package/dist/lib/node-esm/settings-GYLWWOBK.mjs +0 -41
- package/dist/lib/node-esm/settings-GYLWWOBK.mjs.map +0 -7
- package/dist/lib/node-esm/state-RQXTBWUX.mjs +0 -107
- package/dist/lib/node-esm/state-RQXTBWUX.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-EU3Z2R4H.mjs +0 -56
- package/dist/lib/node-esm/toolkit-EU3Z2R4H.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -41
- package/dist/lib/node-esm/url-handler-VUK2LBJV.mjs +0 -96
- package/dist/lib/node-esm/url-handler-VUK2LBJV.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts +0 -5
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts.map +0 -1
- package/dist/types/src/capabilities/check-app-scheme/index.d.ts +0 -3
- package/dist/types/src/capabilities/check-app-scheme/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
- package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -19
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +0 -22
- package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts +0 -3
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +0 -27
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +0 -1
- package/dist/types/src/capabilities/tools/index.d.ts +0 -3
- package/dist/types/src/capabilities/tools/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/tools/tools.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler/index.d.ts +0 -3
- package/dist/types/src/capabilities/url-handler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Banner.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +0 -75
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Fallback.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Popover.d.ts +0 -5
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Topbar.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/Topbar.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/constants.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/index.d.ts +0 -4
- package/dist/types/src/components/DeckLayout/index.d.ts.map +0 -1
- package/dist/types/src/components/Plank/Plank.d.ts +0 -27
- package/dist/types/src/components/Plank/Plank.d.ts.map +0 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +0 -108
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +0 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +0 -1
- package/dist/types/src/components/Plank/PlankError.d.ts.map +0 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts.map +0 -1
- package/dist/types/src/components/Plank/index.d.ts +0 -6
- package/dist/types/src/components/Plank/index.d.ts.map +0 -1
- package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +0 -1
- package/dist/types/src/components/Sidebar/Sidebar.d.ts.map +0 -1
- package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +0 -1
- package/dist/types/src/components/fragments.d.ts +0 -7
- package/dist/types/src/components/fragments.d.ts.map +0 -1
- package/dist/types/src/containers/Banner/Banner.d.ts +0 -2
- package/dist/types/src/containers/Banner/Banner.d.ts.map +0 -1
- package/dist/types/src/containers/Banner/index.d.ts +0 -3
- package/dist/types/src/containers/Banner/index.d.ts.map +0 -1
- package/dist/types/src/containers/DeckSettings/DeckSettings.d.ts +0 -8
- package/dist/types/src/containers/DeckSettings/DeckSettings.d.ts.map +0 -1
- package/dist/types/src/containers/DeckSettings/index.d.ts +0 -3
- package/dist/types/src/containers/DeckSettings/index.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -190
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -7
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/dist/types/src/util/overscroll.d.ts +0 -47
- package/dist/types/src/util/overscroll.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -119
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/check-app-scheme/check-app-scheme.ts +0 -45
- package/src/capabilities/check-app-scheme/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -10
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -560
- package/src/capabilities/react-root/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/settings/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -7
- package/src/capabilities/toolkit/index.ts +0 -7
- package/src/capabilities/toolkit/toolkit.ts +0 -64
- package/src/capabilities/tools/index.ts +0 -7
- package/src/capabilities/url-handler/index.ts +0 -7
- package/src/capabilities/url-handler/url-handler.ts +0 -96
- package/src/components/DeckLayout/ContentEmpty.tsx +0 -30
- package/src/components/DeckLayout/DeckLayout.stories.tsx +0 -53
- package/src/components/DeckLayout/DeckLayout.tsx +0 -34
- package/src/components/DeckLayout/DeckMain.tsx +0 -287
- package/src/components/DeckLayout/Topbar.tsx +0 -11
- package/src/components/Plank/Plank.stories.tsx +0 -64
- package/src/components/Plank/Plank.tsx +0 -302
- package/src/components/fragments.ts +0 -19
- package/src/containers/Banner/Banner.tsx +0 -5
- package/src/containers/Banner/index.ts +0 -7
- package/src/containers/DeckSettings/DeckSettings.tsx +0 -113
- package/src/containers/DeckSettings/index.ts +0 -7
- package/src/types/capabilities.ts +0 -33
- package/src/types/events.ts +0 -21
- package/src/util/overscroll.ts +0 -69
- /package/dist/lib/{browser/types/index.mjs.map → neutral/check-app-scheme-A7FZVNZO.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-root/react-root.d.ts → react-root.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
- /package/dist/types/src/{components/DeckLayout → containers/Deck}/StatusBar.d.ts +0 -0
- /package/dist/types/src/{components → containers}/DeckLayout/ActiveNode.d.ts +0 -0
- /package/dist/types/src/{components → containers}/DeckLayout/DeckLayout.d.ts +0 -0
- /package/dist/types/src/{components → containers}/DeckLayout/Dialog.d.ts +0 -0
- /package/dist/types/src/{components → containers}/DeckLayout/constants.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Plank/PlankLoading.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/ComplementarySidebar.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/Sidebar.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/index.d.ts +0 -0
- /package/src/{components/DeckLayout → containers/Deck}/StatusBar.tsx +0 -0
- /package/src/{components → containers}/Sidebar/index.ts +0 -0
package/src/translations.ts
CHANGED
|
@@ -4,67 +4,54 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Resource } from '@dxos/react-ui';
|
|
6
6
|
|
|
7
|
-
import { meta } from '
|
|
7
|
+
import { meta } from '#meta';
|
|
8
8
|
|
|
9
9
|
export const translations = [
|
|
10
10
|
{
|
|
11
11
|
'en-US': {
|
|
12
12
|
[meta.id]: {
|
|
13
|
-
'plugin
|
|
14
|
-
'settings
|
|
15
|
-
'main
|
|
16
|
-
'open
|
|
17
|
-
'collapse
|
|
18
|
-
'open
|
|
19
|
-
'close
|
|
20
|
-
'sidebar
|
|
21
|
-
'complementary
|
|
22
|
-
'plugin
|
|
23
|
-
'content
|
|
24
|
-
'content
|
|
13
|
+
'plugin.name': 'Deck',
|
|
14
|
+
'settings.title': 'Deck settings',
|
|
15
|
+
'main-header.label': 'Main header',
|
|
16
|
+
'open-navigation-sidebar.label': 'Open sidebar',
|
|
17
|
+
'collapse-navigation-sidebar.label': 'Close sidebar',
|
|
18
|
+
'open-complementary-sidebar.label': 'Open context sidebar',
|
|
19
|
+
'close-complementary-sidebar.label': 'Close context sidebar',
|
|
20
|
+
'sidebar.title': 'Navigation sidebar',
|
|
21
|
+
'complementary-sidebar.title': 'Context sidebar',
|
|
22
|
+
'plugin-error.message': 'Content failed to render.',
|
|
23
|
+
'content-fallback.message': 'Unsupported',
|
|
24
|
+
'content-fallback.description':
|
|
25
25
|
'No plugin had a response for the address you navigated to. Double-check the URL, and ensure you’ve enabled a plugin that supports the object.',
|
|
26
|
-
'toggle
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
'
|
|
45
|
-
'
|
|
46
|
-
'
|
|
47
|
-
'
|
|
48
|
-
'
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
'close
|
|
53
|
-
'
|
|
54
|
-
'
|
|
55
|
-
'close companion label': 'Close companion',
|
|
56
|
-
'settings overscroll label': 'Plank scrolling',
|
|
57
|
-
'select overscroll placeholder': 'Select plank scrolling behavior',
|
|
58
|
-
'settings overscroll centering label': 'Centering',
|
|
59
|
-
'settings overscroll none label': 'None',
|
|
60
|
-
'settings enable statusbar label': 'Show status bar',
|
|
61
|
-
'settings enable deck label': 'Enable Deck',
|
|
62
|
-
'settings encapsulated planks label': 'Encapsulated planks',
|
|
63
|
-
'close current label': 'Close current plank',
|
|
64
|
-
'close others label': 'Close other planks',
|
|
65
|
-
'close all label': 'Close all planks',
|
|
66
|
-
'companion plank heading fallback label': 'Related',
|
|
67
|
-
'open item label': 'Open',
|
|
26
|
+
'toggle-fullscreen.label': 'Toggle fullscreen',
|
|
27
|
+
'undo-available.label': 'Click to undo previous action.',
|
|
28
|
+
'undo-action.label': 'Undo',
|
|
29
|
+
'undo-action.alt': 'Undo previous action',
|
|
30
|
+
'undo-close.label': 'Dismiss',
|
|
31
|
+
'error-fallback.message': 'Unable to open this object',
|
|
32
|
+
'plank-heading-fallback.label': 'Untitled',
|
|
33
|
+
'actions-menu.label': 'Options',
|
|
34
|
+
'settings.deck.label': 'Disable deck',
|
|
35
|
+
'pending.heading': 'Loading…',
|
|
36
|
+
'insert-plank.label': 'Open',
|
|
37
|
+
'resize.label': 'Drag to resize',
|
|
38
|
+
'pin-start.label': 'Pin to the left sidebar',
|
|
39
|
+
'pin-end.label': 'Pin to the right sidebar',
|
|
40
|
+
'increment-start.label': 'Move to the left',
|
|
41
|
+
'increment-end.label': 'Move to the right',
|
|
42
|
+
'show-deck-plank.label': 'Return to deck',
|
|
43
|
+
'show-solo-plank.label': 'Maximize',
|
|
44
|
+
'exit-fullscreen.label': 'Exit fullscreen',
|
|
45
|
+
'show-fullscreen-plank.label': 'Fullscreen',
|
|
46
|
+
'close.label': 'Close',
|
|
47
|
+
'minify.label': 'Minify',
|
|
48
|
+
'open-companion.label': 'Open companion',
|
|
49
|
+
'close-companion.label': 'Close companion',
|
|
50
|
+
'close-current.label': 'Close current plank',
|
|
51
|
+
'close-others.label': 'Close other planks',
|
|
52
|
+
'close-all.label': 'Close all planks',
|
|
53
|
+
'close-navigation-sidebar.button': 'Close',
|
|
54
|
+
'companion-plank-heading-fallback.label': 'Related',
|
|
68
55
|
},
|
|
69
56
|
},
|
|
70
57
|
},
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import { type Atom } from '@effect-atom/atom-react';
|
|
8
|
+
import * as Effect from 'effect/Effect';
|
|
9
|
+
|
|
10
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
11
|
+
import { invariant } from '@dxos/invariant';
|
|
12
|
+
|
|
13
|
+
import { meta } from '#meta';
|
|
14
|
+
|
|
15
|
+
import { type EphemeralDeckState, type DeckState, type StoredDeckState } from './schema';
|
|
16
|
+
|
|
17
|
+
export const Settings = Capability.make<Atom.Writable<import('./Settings').Settings>>(`${meta.id}.capability.settings`);
|
|
18
|
+
|
|
19
|
+
/** Persisted state (stored in KVS/localStorage). */
|
|
20
|
+
export const State = Capability.make<Atom.Writable<StoredDeckState>>(`${meta.id}.capability.state`);
|
|
21
|
+
|
|
22
|
+
/** Transient/ephemeral state (not persisted). */
|
|
23
|
+
export const EphemeralState = Capability.make<Atom.Writable<EphemeralDeckState>>(
|
|
24
|
+
`${meta.id}.capability.ephemeral-state`,
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
/** Get the current active deck from state. */
|
|
28
|
+
export const getDeck = (): Effect.Effect<DeckState, Error, Capability.Service> =>
|
|
29
|
+
Effect.gen(function* () {
|
|
30
|
+
const state = yield* Capabilities.getAtomValue(State);
|
|
31
|
+
const deck = state.decks[state.activeDeck];
|
|
32
|
+
invariant(deck, `Deck not found: ${state.activeDeck}`);
|
|
33
|
+
return deck;
|
|
34
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import { type ActivationEvent } from '@dxos/app-framework';
|
|
8
|
+
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
9
|
+
|
|
10
|
+
import { meta } from '#meta';
|
|
11
|
+
|
|
12
|
+
import * as DeckCapabilities from './DeckCapabilities';
|
|
13
|
+
|
|
14
|
+
export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(
|
|
15
|
+
`${meta.id}.state-ready`,
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
/** Fired when DeckSettings capability is ready. */
|
|
19
|
+
export const SettingsReady: ActivationEvent.ActivationEvent = AppActivationEvents.createSettingsEvent(
|
|
20
|
+
DeckCapabilities.Settings.identifier,
|
|
21
|
+
);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import * as Schema from 'effect/Schema';
|
|
8
|
+
|
|
9
|
+
import { Capability } from '@dxos/app-framework';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
11
|
+
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
|
|
14
|
+
const PartAdjustmentSchema = Schema.Union(
|
|
15
|
+
Schema.Literal('close').annotations({ description: 'Close the plank.' }),
|
|
16
|
+
Schema.Literal('companion').annotations({ description: 'Open the companion plank.' }),
|
|
17
|
+
Schema.Literal('solo').annotations({ description: 'Solo the plank.' }),
|
|
18
|
+
Schema.Literal('solo--fullscreen').annotations({ description: 'Fullscreen the plank.' }),
|
|
19
|
+
Schema.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),
|
|
20
|
+
Schema.Literal('increment-end').annotations({ description: 'Move the plank towards the end of the deck.' }),
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export type PartAdjustment = Schema.Schema.Type<typeof PartAdjustmentSchema>;
|
|
24
|
+
|
|
25
|
+
export const Adjust = Operation.make({
|
|
26
|
+
meta: {
|
|
27
|
+
key: `${meta.id}.operation.adjust`,
|
|
28
|
+
name: 'Adjust',
|
|
29
|
+
description: 'Adjust the layout of a plank.',
|
|
30
|
+
},
|
|
31
|
+
services: [Capability.Service],
|
|
32
|
+
input: Schema.Struct({
|
|
33
|
+
id: Schema.String.annotations({ description: 'The id of the plank to adjust.' }),
|
|
34
|
+
type: PartAdjustmentSchema.annotations({ description: 'The type of adjustment to make.' }),
|
|
35
|
+
}),
|
|
36
|
+
output: Schema.Void,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const UpdatePlankSize = Operation.make({
|
|
40
|
+
meta: {
|
|
41
|
+
key: `${meta.id}.operation.update-plank-size`,
|
|
42
|
+
name: 'Update Plank Size',
|
|
43
|
+
description: 'Update the size of a plank.',
|
|
44
|
+
},
|
|
45
|
+
services: [Capability.Service],
|
|
46
|
+
input: Schema.Struct({
|
|
47
|
+
id: Schema.String.annotations({ description: 'The id of the plank to resize.' }),
|
|
48
|
+
size: Schema.Number.annotations({ description: 'The new size of the plank.' }),
|
|
49
|
+
}),
|
|
50
|
+
output: Schema.Void,
|
|
51
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import * as Schema from 'effect/Schema';
|
|
8
|
+
|
|
9
|
+
export const Settings = Schema.Struct({
|
|
10
|
+
enableDeck: Schema.optional(
|
|
11
|
+
Schema.Boolean.annotations({
|
|
12
|
+
title: 'Enable Deck',
|
|
13
|
+
description: 'Display multiple panels side by side instead of one at a time.',
|
|
14
|
+
}),
|
|
15
|
+
),
|
|
16
|
+
// TODO(burdon): Rename layoutMode? (e.g., bento | encapsulated?)
|
|
17
|
+
encapsulatedPlanks: Schema.optional(
|
|
18
|
+
Schema.Boolean.annotations({
|
|
19
|
+
title: 'Encapsulated planks',
|
|
20
|
+
description: 'Render each plank inside its own isolated container.',
|
|
21
|
+
}),
|
|
22
|
+
),
|
|
23
|
+
enableStatusbar: Schema.optional(
|
|
24
|
+
Schema.Boolean.annotations({
|
|
25
|
+
title: 'Show status bar',
|
|
26
|
+
description: 'Display a status bar at the bottom of the application.',
|
|
27
|
+
}),
|
|
28
|
+
),
|
|
29
|
+
showHints: Schema.optional(
|
|
30
|
+
Schema.Boolean.annotations({
|
|
31
|
+
title: 'Show hints',
|
|
32
|
+
description: 'Show helpful tips and keyboard shortcut hints in the interface.',
|
|
33
|
+
}),
|
|
34
|
+
),
|
|
35
|
+
enableNativeRedirect: Schema.optional(
|
|
36
|
+
Schema.Boolean.annotations({
|
|
37
|
+
title: 'Enable native url redirect',
|
|
38
|
+
description: 'Redirect supported URLs to the native desktop application.',
|
|
39
|
+
}),
|
|
40
|
+
),
|
|
41
|
+
}).pipe(Schema.mutable);
|
|
42
|
+
export interface Settings extends Schema.Schema.Type<typeof Settings> {}
|
package/src/types/index.ts
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * from './capabilities';
|
|
6
|
-
export * from './events';
|
|
7
5
|
export * from './schema';
|
|
6
|
+
|
|
7
|
+
export * as DeckCapabilities from './DeckCapabilities';
|
|
8
|
+
export * as DeckEvents from './DeckEvents';
|
|
9
|
+
export * as DeckOperation from './DeckOperation';
|
|
10
|
+
export * as Settings from './Settings';
|
package/src/types/schema.ts
CHANGED
|
@@ -4,54 +4,37 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import { Capability } from '@dxos/app-framework';
|
|
8
7
|
import { Label, LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
-
import { Operation } from '@dxos/operation';
|
|
10
8
|
import { type DeepReadonly } from '@dxos/util';
|
|
11
9
|
|
|
12
|
-
import { meta } from '
|
|
10
|
+
import { meta } from '#meta';
|
|
13
11
|
|
|
14
|
-
export {
|
|
12
|
+
export { PLANK_COMPANION_TYPE, DECK_COMPANION_TYPE } from '@dxos/app-toolkit';
|
|
15
13
|
|
|
16
|
-
export
|
|
17
|
-
export const DECK_COMPANION_TYPE = `${meta.id}/deck-companion`;
|
|
18
|
-
|
|
19
|
-
// TODO(Zan): In the future we should consider adding new planks adjacent to the attended plank.
|
|
20
|
-
export const NewPlankPositions = ['start', 'end'] as const;
|
|
21
|
-
export type NewPlankPositioning = (typeof NewPlankPositions)[number];
|
|
22
|
-
|
|
23
|
-
export const OverScrollToProps = ['none', 'centering'] as const;
|
|
24
|
-
export type Overscroll = (typeof OverScrollToProps)[number];
|
|
25
|
-
|
|
26
|
-
export type Part = 'solo' | 'deck' | 'complementary';
|
|
14
|
+
export type Part = 'solo' | 'multi' | 'complementary';
|
|
27
15
|
export type ResolvedPart = Part | 'solo-primary' | 'solo-companion';
|
|
28
16
|
|
|
29
|
-
export const DeckSettingsSchema = Schema.Struct({
|
|
30
|
-
showHints: Schema.optional(Schema.Boolean),
|
|
31
|
-
enableDeck: Schema.optional(Schema.Boolean),
|
|
32
|
-
enableStatusbar: Schema.optional(Schema.Boolean),
|
|
33
|
-
enableNativeRedirect: Schema.optional(Schema.Boolean),
|
|
34
|
-
newPlankPositioning: Schema.optional(Schema.Literal(...NewPlankPositions)),
|
|
35
|
-
overscroll: Schema.optional(Schema.Literal(...OverScrollToProps)),
|
|
36
|
-
// TODO(burdon): Rename layoutMode? (e.g., bento | encapsulated?)
|
|
37
|
-
encapsulatedPlanks: Schema.optional(Schema.Boolean),
|
|
38
|
-
}).pipe(Schema.mutable);
|
|
39
|
-
export type DeckSettingsProps = Schema.Schema.Type<typeof DeckSettingsSchema>;
|
|
40
|
-
|
|
41
17
|
export const PlankSizing = Schema.Record({ key: Schema.String, value: Schema.Number });
|
|
42
18
|
export type PlankSizing = Schema.Schema.Type<typeof PlankSizing>;
|
|
43
19
|
|
|
44
|
-
// State of an individual deck.
|
|
45
20
|
export const DeckState = Schema.Struct({
|
|
46
21
|
/** If false, the deck has not yet left solo mode and new planks should be soloed. */
|
|
47
22
|
initialized: Schema.Boolean,
|
|
23
|
+
/** Item IDs of planks currently displayed in multi-mode. */
|
|
48
24
|
active: Schema.mutable(Schema.Array(Schema.String)),
|
|
49
|
-
|
|
50
|
-
companionVariant: Schema.optional(Schema.String),
|
|
25
|
+
/** Item IDs of planks that have been closed; used for state persistence and reopening. */
|
|
51
26
|
inactive: Schema.mutable(Schema.Array(Schema.String)),
|
|
27
|
+
/** Item ID of the single plank displayed in solo or fullscreen mode. */
|
|
52
28
|
solo: Schema.optional(Schema.String),
|
|
29
|
+
/** Whether the solo plank is displayed in fullscreen mode (no heading or sidebars). */
|
|
53
30
|
fullscreen: Schema.Boolean,
|
|
31
|
+
/** Persisted plank widths in rem, keyed by item ID. */
|
|
54
32
|
plankSizing: Schema.mutable(PlankSizing),
|
|
33
|
+
/** Whether the companion pane is visible alongside the active plank(s). */
|
|
34
|
+
companionOpen: Schema.Boolean,
|
|
35
|
+
/** Which companion variant to display when the companion pane is open. */
|
|
36
|
+
companionVariant: Schema.optional(Schema.String),
|
|
37
|
+
/** Persisted companion frame widths in rem, keyed by frame ID. */
|
|
55
38
|
companionFrameSizing: Schema.mutable(PlankSizing),
|
|
56
39
|
});
|
|
57
40
|
export type DeckState = Schema.Schema.Type<typeof DeckState>;
|
|
@@ -59,29 +42,32 @@ export type DeckState = Schema.Schema.Type<typeof DeckState>;
|
|
|
59
42
|
export const defaultDeck: DeckState = {
|
|
60
43
|
initialized: false,
|
|
61
44
|
active: [],
|
|
62
|
-
companionOpen: false,
|
|
63
|
-
companionVariant: undefined,
|
|
64
45
|
inactive: [],
|
|
65
46
|
solo: undefined,
|
|
66
47
|
fullscreen: false,
|
|
67
48
|
plankSizing: {},
|
|
49
|
+
companionOpen: false,
|
|
50
|
+
companionVariant: undefined,
|
|
68
51
|
companionFrameSizing: {},
|
|
69
52
|
};
|
|
70
53
|
|
|
71
|
-
|
|
54
|
+
//
|
|
55
|
+
// Layout
|
|
56
|
+
//
|
|
57
|
+
|
|
58
|
+
const LayoutMode = Schema.Literal('multi', 'solo', 'solo--fullscreen');
|
|
72
59
|
export type LayoutMode = Schema.Schema.Type<typeof LayoutMode>;
|
|
73
60
|
export const isLayoutMode = (value: any): value is LayoutMode => Schema.is(LayoutMode)(value);
|
|
74
|
-
|
|
75
61
|
export const getMode = (deck: DeckState | DeepReadonly<DeckState>): LayoutMode => {
|
|
76
62
|
if (deck.solo) {
|
|
77
63
|
return deck.fullscreen ? 'solo--fullscreen' : 'solo';
|
|
78
64
|
}
|
|
79
65
|
|
|
80
|
-
return '
|
|
66
|
+
return 'multi';
|
|
81
67
|
};
|
|
82
68
|
|
|
83
69
|
// Persisted plugin state (stored in KVS/localStorage).
|
|
84
|
-
export const
|
|
70
|
+
export const StoredDeckState = Schema.Struct({
|
|
85
71
|
sidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),
|
|
86
72
|
complementarySidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),
|
|
87
73
|
complementarySidebarPanel: Schema.optional(Schema.String),
|
|
@@ -90,19 +76,17 @@ export const DeckStateSchema = Schema.Struct({
|
|
|
90
76
|
decks: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(DeckState) })),
|
|
91
77
|
previousMode: Schema.mutable(Schema.Record({ key: Schema.String, value: LayoutMode })),
|
|
92
78
|
}).pipe(Schema.mutable);
|
|
93
|
-
export type
|
|
79
|
+
export type StoredDeckState = Schema.Schema.Type<typeof StoredDeckState>;
|
|
94
80
|
|
|
95
|
-
// TODO(burdon): Factor out state (in common with other layouts?)
|
|
96
81
|
// Transient/ephemeral plugin state (not persisted).
|
|
97
|
-
export const
|
|
82
|
+
export const EphemeralDeckState = Schema.Struct({
|
|
98
83
|
dialogOpen: Schema.Boolean,
|
|
99
84
|
dialogType: Schema.optional(Schema.Literal('default', 'alert')),
|
|
100
85
|
dialogBlockAlign: Schema.optional(Schema.Literal('start', 'center', 'end')),
|
|
101
86
|
dialogOverlayClasses: Schema.optional(Schema.String),
|
|
102
87
|
dialogOverlayStyle: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),
|
|
103
88
|
/** Data to be passed to the dialog Surface. */
|
|
104
|
-
dialogContent: Schema.optional(Schema.Any),
|
|
105
|
-
|
|
89
|
+
dialogContent: Schema.NullOr(Schema.Struct({ component: Schema.String, props: Schema.optional(Schema.Any) })),
|
|
106
90
|
popoverOpen: Schema.Boolean,
|
|
107
91
|
popoverSide: Schema.optional(Schema.Literal('top', 'right', 'bottom', 'left')),
|
|
108
92
|
popoverAnchor: Schema.optional(Schema.Any),
|
|
@@ -112,18 +96,21 @@ export const DeckEphemeralStateSchema = Schema.Struct({
|
|
|
112
96
|
/** Ref of the subject to be passed to the popover Surface. */
|
|
113
97
|
popoverContentRef: Schema.optional(Schema.String),
|
|
114
98
|
/** Data to be passed to the popover Surface. */
|
|
115
|
-
popoverContent: Schema.
|
|
116
|
-
|
|
99
|
+
popoverContent: Schema.NullOr(
|
|
100
|
+
Schema.Union(
|
|
101
|
+
Schema.Struct({ component: Schema.String, props: Schema.optional(Schema.Any) }),
|
|
102
|
+
Schema.Struct({ subject: Schema.Any }),
|
|
103
|
+
),
|
|
104
|
+
),
|
|
117
105
|
toasts: Schema.mutable(Schema.Array(LayoutOperation.Toast)),
|
|
118
106
|
currentUndoId: Schema.optional(Schema.String),
|
|
119
|
-
|
|
120
107
|
/** The identifier of a component to scroll into view when it is mounted. */
|
|
121
108
|
scrollIntoView: Schema.optional(Schema.String),
|
|
122
109
|
}).pipe(Schema.mutable);
|
|
123
|
-
export type
|
|
110
|
+
export type EphemeralDeckState = Schema.Schema.Type<typeof EphemeralDeckState>;
|
|
124
111
|
|
|
125
112
|
// Combined state type (for convenience in components that need both).
|
|
126
|
-
export type DeckPluginState =
|
|
113
|
+
export type DeckPluginState = StoredDeckState & EphemeralDeckState;
|
|
127
114
|
|
|
128
115
|
export namespace DeckAction {
|
|
129
116
|
const PartAdjustmentSchema = Schema.Union(
|
|
@@ -139,85 +126,16 @@ export namespace DeckAction {
|
|
|
139
126
|
export type Adjustment = Schema.Schema.Type<typeof Adjustment>;
|
|
140
127
|
|
|
141
128
|
// An atomic transaction to apply to the deck, describing which element to move to which location.
|
|
142
|
-
export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}
|
|
129
|
+
export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}.action.adjust`, {
|
|
143
130
|
input: Adjustment,
|
|
144
131
|
output: Schema.Void,
|
|
145
132
|
}) {}
|
|
146
133
|
|
|
147
|
-
export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}
|
|
134
|
+
export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}.action.update-plank-size`, {
|
|
148
135
|
input: Schema.Struct({
|
|
149
136
|
id: Schema.String,
|
|
150
137
|
size: Schema.Number,
|
|
151
138
|
}),
|
|
152
139
|
output: Schema.Void,
|
|
153
140
|
}) {}
|
|
154
|
-
|
|
155
|
-
export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${meta.id}/action/change-companion`, {
|
|
156
|
-
input: Schema.Struct({
|
|
157
|
-
companion: Schema.Union(Schema.String, Schema.Null),
|
|
158
|
-
}),
|
|
159
|
-
output: Schema.Void,
|
|
160
|
-
}) {}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Operations for the Deck plugin.
|
|
165
|
-
*/
|
|
166
|
-
export namespace DeckOperation {
|
|
167
|
-
const PartAdjustmentSchema = Schema.Union(
|
|
168
|
-
Schema.Literal('close').annotations({ description: 'Close the plank.' }),
|
|
169
|
-
Schema.Literal('companion').annotations({ description: 'Open the companion plank.' }),
|
|
170
|
-
Schema.Literal('solo').annotations({ description: 'Solo the plank.' }),
|
|
171
|
-
Schema.Literal('solo--fullscreen').annotations({ description: 'Fullscreen the plank.' }),
|
|
172
|
-
Schema.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),
|
|
173
|
-
Schema.Literal('increment-end').annotations({ description: 'Move the plank towards the end of the deck.' }),
|
|
174
|
-
);
|
|
175
|
-
export type PartAdjustment = Schema.Schema.Type<typeof PartAdjustmentSchema>;
|
|
176
|
-
|
|
177
|
-
export const Adjust = Operation.make({
|
|
178
|
-
meta: {
|
|
179
|
-
key: `${meta.id}/operation/adjust`,
|
|
180
|
-
name: 'Adjust',
|
|
181
|
-
description: 'Adjust the layout of a plank.',
|
|
182
|
-
},
|
|
183
|
-
services: [Capability.Service],
|
|
184
|
-
schema: {
|
|
185
|
-
input: Schema.Struct({
|
|
186
|
-
id: Schema.String.annotations({ description: 'The id of the plank to adjust.' }),
|
|
187
|
-
type: PartAdjustmentSchema.annotations({ description: 'The type of adjustment to make.' }),
|
|
188
|
-
}),
|
|
189
|
-
output: Schema.Void,
|
|
190
|
-
},
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
export const UpdatePlankSize = Operation.make({
|
|
194
|
-
meta: {
|
|
195
|
-
key: `${meta.id}/operation/update-plank-size`,
|
|
196
|
-
name: 'Update Plank Size',
|
|
197
|
-
description: 'Update the size of a plank.',
|
|
198
|
-
},
|
|
199
|
-
services: [Capability.Service],
|
|
200
|
-
schema: {
|
|
201
|
-
input: Schema.Struct({
|
|
202
|
-
id: Schema.String.annotations({ description: 'The id of the plank to resize.' }),
|
|
203
|
-
size: Schema.Number.annotations({ description: 'The new size of the plank.' }),
|
|
204
|
-
}),
|
|
205
|
-
output: Schema.Void,
|
|
206
|
-
},
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
export const ChangeCompanion = Operation.make({
|
|
210
|
-
meta: {
|
|
211
|
-
key: `${meta.id}/operation/change-companion`,
|
|
212
|
-
name: 'Change Companion',
|
|
213
|
-
description: 'Change the companion plank for a primary plank.',
|
|
214
|
-
},
|
|
215
|
-
services: [Capability.Service],
|
|
216
|
-
schema: {
|
|
217
|
-
input: Schema.Struct({
|
|
218
|
-
companion: Schema.Union(Schema.String, Schema.Null),
|
|
219
|
-
}),
|
|
220
|
-
output: Schema.Void,
|
|
221
|
-
},
|
|
222
|
-
});
|
|
223
141
|
}
|
package/src/util/index.ts
CHANGED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { deserializePlanks, serializePlanks, stripPlanks } from './plank-url-params';
|
|
8
|
+
|
|
9
|
+
describe('serializePlanks', () => {
|
|
10
|
+
test('serializes active IDs as plank query params', ({ expect }) => {
|
|
11
|
+
const result = serializePlanks(['root/space1/types/doc/all/obj1', 'root/space1/types/doc/all/obj2'], '');
|
|
12
|
+
expect(result).toBe('?plank=%2Fspace1%2Ftypes%2Fdoc%2Fall%2Fobj1&plank=%2Fspace1%2Ftypes%2Fdoc%2Fall%2Fobj2');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('returns empty string for empty active array with no existing params', ({ expect }) => {
|
|
16
|
+
expect(serializePlanks([], '')).toBe('');
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test('preserves non-plank params', ({ expect }) => {
|
|
20
|
+
const result = serializePlanks(['root/space1/types/doc/all/obj1'], '?ref=abc');
|
|
21
|
+
expect(result).toContain('ref=abc');
|
|
22
|
+
expect(result).toContain('plank=');
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('preserves non-plank params when active array is empty', ({ expect }) => {
|
|
26
|
+
const result = serializePlanks([], '?ref=abc');
|
|
27
|
+
expect(result).toBe('?ref=abc');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('replaces existing plank params', ({ expect }) => {
|
|
31
|
+
const result = serializePlanks(['root/space1/types/doc/all/obj2'], '?plank=%2Fspace1%2Ftypes%2Fdoc%2Fall%2Fobj1');
|
|
32
|
+
expect(result).not.toContain('obj1');
|
|
33
|
+
expect(result).toContain('obj2');
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe('deserializePlanks', () => {
|
|
38
|
+
test('deserializes plank query params to qualified IDs', ({ expect }) => {
|
|
39
|
+
const url = new URL(
|
|
40
|
+
'http://localhost/?plank=%2Fspace1%2Ftypes%2Fdoc%2Fall%2Fobj1&plank=%2Fspace1%2Ftypes%2Fdoc%2Fall%2Fobj2',
|
|
41
|
+
);
|
|
42
|
+
const result = deserializePlanks(url);
|
|
43
|
+
expect(result).toEqual(['root/space1/types/doc/all/obj1', 'root/space1/types/doc/all/obj2']);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test('returns empty array when no plank params', ({ expect }) => {
|
|
47
|
+
const url = new URL('http://localhost/?ref=abc');
|
|
48
|
+
expect(deserializePlanks(url)).toEqual([]);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test('preserves order', ({ expect }) => {
|
|
52
|
+
const url = new URL('http://localhost/?plank=%2Fa&plank=%2Fb&plank=%2Fc');
|
|
53
|
+
expect(deserializePlanks(url)).toEqual(['root/a', 'root/b', 'root/c']);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe('stripPlanks', () => {
|
|
58
|
+
test('removes plank params', ({ expect }) => {
|
|
59
|
+
expect(stripPlanks('?plank=%2Fa&plank=%2Fb')).toBe('');
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('preserves non-plank params', ({ expect }) => {
|
|
63
|
+
expect(stripPlanks('?ref=abc&plank=%2Fa')).toBe('?ref=abc');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test('returns empty string when no params', ({ expect }) => {
|
|
67
|
+
expect(stripPlanks('')).toBe('');
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
describe('round-trip', () => {
|
|
72
|
+
test('serialize then deserialize returns original IDs', ({ expect }) => {
|
|
73
|
+
const ids = ['root/space1/types/doc/all/obj1', 'root/space1/types/doc/all/obj2'];
|
|
74
|
+
const search = serializePlanks(ids, '');
|
|
75
|
+
const url = new URL(`http://localhost/${search}`);
|
|
76
|
+
expect(deserializePlanks(url)).toEqual(ids);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
test('handles special characters in IDs', ({ expect }) => {
|
|
80
|
+
const ids = ['root/!dxos:settings', 'root/~personal/types/doc/all/obj1'];
|
|
81
|
+
const search = serializePlanks(ids, '');
|
|
82
|
+
const url = new URL(`http://localhost/${search}`);
|
|
83
|
+
expect(deserializePlanks(url)).toEqual(ids);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { fromUrlPath, toUrlPath } from '@dxos/app-toolkit';
|
|
6
|
+
|
|
7
|
+
const PLANK_PARAM = 'plank';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Serialize deck active qualified IDs into a URL search string.
|
|
11
|
+
* Preserves non-plank query params from the existing search string.
|
|
12
|
+
*/
|
|
13
|
+
export const serializePlanks = (active: readonly string[], existingSearch: string): string => {
|
|
14
|
+
const params = new URLSearchParams(existingSearch);
|
|
15
|
+
params.delete(PLANK_PARAM);
|
|
16
|
+
for (const id of active) {
|
|
17
|
+
params.append(PLANK_PARAM, toUrlPath(id));
|
|
18
|
+
}
|
|
19
|
+
return params.size > 0 ? `?${params.toString()}` : '';
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Deserialize plank query params from a URL back to qualified graph IDs.
|
|
24
|
+
*/
|
|
25
|
+
export const deserializePlanks = (url: URL): string[] => {
|
|
26
|
+
return url.searchParams.getAll(PLANK_PARAM).map(fromUrlPath);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Strip plank query params from a search string, preserving all others.
|
|
31
|
+
*/
|
|
32
|
+
export const stripPlanks = (existingSearch: string): string => {
|
|
33
|
+
const params = new URLSearchParams(existingSearch);
|
|
34
|
+
params.delete(PLANK_PARAM);
|
|
35
|
+
return params.size > 0 ? `?${params.toString()}` : '';
|
|
36
|
+
};
|