@dxos/plugin-deck 0.8.4-main.f5c0578 → 0.8.4-main.fcfe5033a5
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/browser/add-toast-3V7TYC2M.mjs +24 -0
- package/dist/lib/browser/add-toast-3V7TYC2M.mjs.map +7 -0
- package/dist/lib/browser/adjust-ZMPN7P7J.mjs +96 -0
- package/dist/lib/browser/adjust-ZMPN7P7J.mjs.map +7 -0
- package/dist/lib/browser/change-companion-F7GCREGM.mjs +34 -0
- package/dist/lib/browser/change-companion-F7GCREGM.mjs.map +7 -0
- package/dist/lib/browser/chunk-BRZAVPMC.mjs +48 -0
- package/dist/lib/browser/chunk-BRZAVPMC.mjs.map +7 -0
- package/dist/lib/browser/chunk-DF2VZ6W3.mjs +69 -0
- package/dist/lib/browser/chunk-DF2VZ6W3.mjs.map +7 -0
- package/dist/lib/browser/chunk-FUWSZ6IC.mjs +88 -0
- package/dist/lib/browser/chunk-FUWSZ6IC.mjs.map +7 -0
- package/dist/lib/browser/chunk-GN52IRQ7.mjs +216 -0
- package/dist/lib/browser/chunk-GN52IRQ7.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-KUTDCWZF.mjs +30 -0
- package/dist/lib/browser/chunk-KUTDCWZF.mjs.map +7 -0
- package/dist/lib/browser/close-N2F26CVG.mjs +44 -0
- package/dist/lib/browser/close-N2F26CVG.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +161 -134
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/open-VWO7VOOU.mjs +150 -0
- package/dist/lib/browser/open-VWO7VOOU.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +13 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/revert-workspace-LGKZZKCI.mjs +21 -0
- package/dist/lib/browser/revert-workspace-LGKZZKCI.mjs.map +7 -0
- package/dist/lib/browser/scroll-into-view-TSVSNKIH.mjs +21 -0
- package/dist/lib/browser/scroll-into-view-TSVSNKIH.mjs.map +7 -0
- package/dist/lib/browser/set-N2LGA2BY.mjs +37 -0
- package/dist/lib/browser/set-N2LGA2BY.mjs.map +7 -0
- package/dist/lib/browser/set-layout-mode-TONTQO6G.mjs +90 -0
- package/dist/lib/browser/set-layout-mode-TONTQO6G.mjs.map +7 -0
- package/dist/lib/browser/show-undo-IFXNEIQY.mjs +59 -0
- package/dist/lib/browser/show-undo-IFXNEIQY.mjs.map +7 -0
- package/dist/lib/browser/switch-workspace-ZJDC5SSR.mjs +68 -0
- package/dist/lib/browser/switch-workspace-ZJDC5SSR.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +12 -12
- package/dist/lib/browser/update-complementary-ELUOK3GD.mjs +28 -0
- package/dist/lib/browser/update-complementary-ELUOK3GD.mjs.map +7 -0
- package/dist/lib/browser/update-dialog-LMGLOTWX.mjs +29 -0
- package/dist/lib/browser/update-dialog-LMGLOTWX.mjs.map +7 -0
- package/dist/lib/browser/update-plank-size-WQAPELII.mjs +28 -0
- package/dist/lib/browser/update-plank-size-WQAPELII.mjs.map +7 -0
- package/dist/lib/browser/update-popover-P6YO6FWJ.mjs +33 -0
- package/dist/lib/browser/update-popover-P6YO6FWJ.mjs.map +7 -0
- package/dist/lib/browser/update-sidebar-NGWS6IDJ.mjs +25 -0
- package/dist/lib/browser/update-sidebar-NGWS6IDJ.mjs.map +7 -0
- package/dist/lib/node-esm/add-toast-G4OQEGOS.mjs +25 -0
- package/dist/lib/node-esm/add-toast-G4OQEGOS.mjs.map +7 -0
- package/dist/lib/node-esm/adjust-KSNI7C3B.mjs +97 -0
- package/dist/lib/node-esm/adjust-KSNI7C3B.mjs.map +7 -0
- package/dist/lib/node-esm/change-companion-LCJPT6AX.mjs +35 -0
- package/dist/lib/node-esm/change-companion-LCJPT6AX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4ED7B7OZ.mjs +217 -0
- package/dist/lib/node-esm/chunk-4ED7B7OZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7KL65RLL.mjs +89 -0
- package/dist/lib/node-esm/chunk-7KL65RLL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-IRWCUYJY.mjs +71 -0
- package/dist/lib/node-esm/chunk-IRWCUYJY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MB4SDDVY.mjs +50 -0
- package/dist/lib/node-esm/chunk-MB4SDDVY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MLVJ2ODW.mjs +32 -0
- package/dist/lib/node-esm/chunk-MLVJ2ODW.mjs.map +7 -0
- package/dist/lib/node-esm/close-YHIBVE2S.mjs +45 -0
- package/dist/lib/node-esm/close-YHIBVE2S.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +202 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/open-353DYMMN.mjs +151 -0
- package/dist/lib/node-esm/open-353DYMMN.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +14 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/revert-workspace-OS5R3PFJ.mjs +22 -0
- package/dist/lib/node-esm/revert-workspace-OS5R3PFJ.mjs.map +7 -0
- package/dist/lib/node-esm/scroll-into-view-LC2SVKCW.mjs +22 -0
- package/dist/lib/node-esm/scroll-into-view-LC2SVKCW.mjs.map +7 -0
- package/dist/lib/node-esm/set-3EZ7LJFU.mjs +38 -0
- package/dist/lib/node-esm/set-3EZ7LJFU.mjs.map +7 -0
- package/dist/lib/node-esm/set-layout-mode-3YBHGEK6.mjs +91 -0
- package/dist/lib/node-esm/set-layout-mode-3YBHGEK6.mjs.map +7 -0
- package/dist/lib/node-esm/show-undo-RAHLRPUU.mjs +60 -0
- package/dist/lib/node-esm/show-undo-RAHLRPUU.mjs.map +7 -0
- package/dist/lib/node-esm/switch-workspace-S6CXDPXZ.mjs +69 -0
- package/dist/lib/node-esm/switch-workspace-S6CXDPXZ.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +33 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/lib/node-esm/update-complementary-V5Y2RMYL.mjs +29 -0
- package/dist/lib/node-esm/update-complementary-V5Y2RMYL.mjs.map +7 -0
- package/dist/lib/node-esm/update-dialog-IMTCLAWR.mjs +30 -0
- package/dist/lib/node-esm/update-dialog-IMTCLAWR.mjs.map +7 -0
- package/dist/lib/node-esm/update-plank-size-I3DKCPHZ.mjs +29 -0
- package/dist/lib/node-esm/update-plank-size-I3DKCPHZ.mjs.map +7 -0
- package/dist/lib/node-esm/update-popover-7JX3KWYL.mjs +34 -0
- package/dist/lib/node-esm/update-popover-7JX3KWYL.mjs.map +7 -0
- package/dist/lib/node-esm/update-sidebar-B5DCSREP.mjs +26 -0
- package/dist/lib/node-esm/update-sidebar-B5DCSREP.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts +2 -1
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts +17 -2
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +196 -12
- 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 +4 -2
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +5 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +134 -44
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/tools.d.ts +4 -3
- package/dist/types/src/capabilities/tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-handler.d.ts +3 -2
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +4 -4
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts +71 -0
- package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/DeckSettings/index.d.ts +1 -1
- package/dist/types/src/components/DeckSettings/index.d.ts.map +1 -1
- 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 -2
- package/dist/types/src/components/index.d.ts.map +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 +71 -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 +42 -0
- package/dist/types/src/containers/Deck/DeckRoot.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckViewport.d.ts +19 -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/containers/DeckLayout/ActiveNode.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.d.ts +5 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts +73 -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/containers/DeckLayout/Toast.d.ts +10 -0
- 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 +71 -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/containers/Plank/PlankError.d.ts +15 -0
- package/dist/types/src/containers/Plank/PlankError.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Plank/PlankHeading.d.ts +5 -4
- 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/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 +6 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +3 -4
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckState.d.ts +17 -0
- package/dist/types/src/hooks/useDeckState.d.ts.map +1 -0
- 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 +2 -2
- package/dist/types/src/hooks/useNodeActionExpander.d.ts +1 -1
- package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
- package/dist/types/src/hooks/useSelectedCompanion.d.ts +13 -0
- package/dist/types/src/hooks/useSelectedCompanion.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -2
- 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 +2 -3
- 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/change-companion.d.ts +5 -0
- package/dist/types/src/operations/change-companion.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/definitions.d.ts +18 -0
- package/dist/types/src/operations/definitions.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 +4 -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-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/translations.d.ts +52 -52
- package/dist/types/src/translations.d.ts.map +1 -1
- 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/{capabilities → types}/capabilities.d.ts +103 -96
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +7 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +68 -56
- 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 +19 -4
- 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 +87 -49
- package/src/DeckPlugin.ts +43 -69
- package/src/capabilities/app-graph-builder.ts +112 -127
- package/src/capabilities/check-app-scheme.ts +123 -24
- package/src/capabilities/index.ts +13 -14
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-root.tsx +37 -29
- package/src/capabilities/react-surface.tsx +28 -22
- package/src/capabilities/settings.ts +30 -19
- package/src/capabilities/state.ts +74 -88
- package/src/capabilities/tools.ts +57 -50
- package/src/capabilities/url-handler.ts +221 -50
- package/src/components/DeckSettings/DeckSettings.stories.tsx +37 -0
- package/src/components/DeckSettings/DeckSettings.tsx +55 -70
- package/src/components/DeckSettings/index.ts +2 -2
- package/src/components/Matrix/Matrix.stories.tsx +216 -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 -3
- package/src/{components/DeckLayout → containers/Deck}/Banner.tsx +13 -11
- 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 +456 -0
- package/src/{components/DeckLayout → containers/Deck}/StatusBar.tsx +4 -4
- package/src/containers/Deck/index.ts +5 -0
- package/src/{components → containers}/DeckLayout/ActiveNode.tsx +8 -3
- package/src/containers/DeckLayout/DeckLayout.stories.tsx +393 -0
- package/src/containers/DeckLayout/DeckLayout.tsx +62 -0
- package/src/containers/DeckLayout/Dialog.tsx +52 -0
- package/src/containers/DeckLayout/Fallback.tsx +24 -0
- package/src/containers/DeckLayout/Popover.tsx +161 -0
- package/src/{components → containers}/DeckLayout/Toast.tsx +30 -5
- 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 +106 -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 +45 -38
- package/src/containers/Plank/PlankError.tsx +79 -0
- package/src/{components → containers}/Plank/PlankHeading.tsx +68 -64
- 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/containers/Sidebar/ComplementarySidebar.tsx +209 -0
- package/src/containers/Sidebar/Sidebar.tsx +44 -0
- package/src/containers/Sidebar/SidebarButton.tsx +94 -0
- package/src/containers/index.ts +11 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useCompanions.ts +3 -3
- package/src/hooks/useDeckCompanions.ts +7 -10
- package/src/hooks/useDeckState.ts +73 -0
- package/src/hooks/useHoistStatusbar.ts +4 -5
- package/src/hooks/useMainSize.ts +2 -2
- package/src/hooks/useNodeActionExpander.ts +4 -4
- package/src/hooks/useSelectedCompanion.ts +32 -0
- package/src/index.ts +1 -2
- package/src/layout.test.ts +59 -0
- package/src/layout.ts +38 -40
- package/src/meta.ts +8 -5
- package/src/operations/add-toast.ts +24 -0
- package/src/operations/adjust.ts +83 -0
- package/src/operations/change-companion.ts +35 -0
- package/src/operations/close.ts +35 -0
- package/src/operations/definitions.ts +62 -0
- package/src/operations/helpers.ts +22 -0
- package/src/operations/index.ts +26 -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-complementary.ts +33 -0
- package/src/operations/update-dialog.ts +34 -0
- package/src/operations/update-plank-size.ts +29 -0
- package/src/operations/update-popover.ts +36 -0
- package/src/operations/update-sidebar.ts +28 -0
- package/src/translations.ts +52 -52
- package/src/types/Settings.ts +17 -0
- package/src/types/capabilities.ts +35 -0
- package/src/types/events.ts +21 -0
- package/src/types/index.ts +3 -0
- package/src/types/schema.ts +52 -50
- package/src/util/index.ts +2 -1
- package/src/util/layoutAppliesTopbar.ts +2 -2
- 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 +50 -30
- package/src/vite-env.d.ts +5 -0
- package/dist/lib/browser/app-graph-builder-DVEKLXB4.mjs +0 -152
- package/dist/lib/browser/app-graph-builder-DVEKLXB4.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-3BQJXWEY.mjs +0 -32
- package/dist/lib/browser/check-app-scheme-3BQJXWEY.mjs.map +0 -7
- package/dist/lib/browser/chunk-6MQIYIPY.mjs +0 -1494
- package/dist/lib/browser/chunk-6MQIYIPY.mjs.map +0 -7
- package/dist/lib/browser/chunk-CNTGBCMK.mjs +0 -145
- package/dist/lib/browser/chunk-CNTGBCMK.mjs.map +0 -7
- package/dist/lib/browser/chunk-F5BQOOEG.mjs +0 -160
- package/dist/lib/browser/chunk-F5BQOOEG.mjs.map +0 -7
- package/dist/lib/browser/chunk-M57WD3V6.mjs +0 -16
- package/dist/lib/browser/chunk-M57WD3V6.mjs.map +0 -7
- package/dist/lib/browser/chunk-MX7WRVX3.mjs +0 -127
- package/dist/lib/browser/chunk-MX7WRVX3.mjs.map +0 -7
- package/dist/lib/browser/chunk-NRCPV6AV.mjs +0 -129
- package/dist/lib/browser/chunk-NRCPV6AV.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z5KITAZW.mjs +0 -13
- package/dist/lib/browser/chunk-Z5KITAZW.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-2SUIIV6N.mjs +0 -521
- package/dist/lib/browser/intent-resolver-2SUIIV6N.mjs.map +0 -7
- package/dist/lib/browser/react-root-GVZANZX7.mjs +0 -43
- package/dist/lib/browser/react-root-GVZANZX7.mjs.map +0 -7
- package/dist/lib/browser/react-surface-NXSSD2GW.mjs +0 -40
- package/dist/lib/browser/react-surface-NXSSD2GW.mjs.map +0 -7
- package/dist/lib/browser/settings-LUPQPZ27.mjs +0 -29
- package/dist/lib/browser/settings-LUPQPZ27.mjs.map +0 -7
- package/dist/lib/browser/state-CRXR7X63.mjs +0 -12
- package/dist/lib/browser/toolkit-OBKFXX23.mjs +0 -47
- package/dist/lib/browser/toolkit-OBKFXX23.mjs.map +0 -7
- package/dist/lib/browser/url-handler-LROZYQ26.mjs +0 -70
- package/dist/lib/browser/url-handler-LROZYQ26.mjs.map +0 -7
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit.d.ts +0 -5
- package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/ActiveNode.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 +0 -6
- package/dist/types/src/components/DeckLayout/DeckLayout.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 +0 -5
- 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 -8
- 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 +0 -13
- 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 -4
- package/dist/types/src/components/fragments.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/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/capabilities.ts +0 -14
- package/src/capabilities/intent-resolver.ts +0 -469
- package/src/capabilities/toolkit.ts +0 -55
- package/src/components/DeckLayout/ContentEmpty.tsx +0 -31
- package/src/components/DeckLayout/DeckLayout.tsx +0 -302
- package/src/components/DeckLayout/Dialog.tsx +0 -36
- package/src/components/DeckLayout/Fallback.tsx +0 -28
- package/src/components/DeckLayout/Popover.tsx +0 -104
- package/src/components/DeckLayout/Topbar.tsx +0 -11
- package/src/components/Plank/Plank.stories.tsx +0 -56
- package/src/components/Plank/Plank.tsx +0 -267
- package/src/components/Plank/PlankError.tsx +0 -49
- package/src/components/Sidebar/ComplementarySidebar.tsx +0 -194
- package/src/components/Sidebar/Sidebar.tsx +0 -42
- package/src/components/Sidebar/SidebarButton.tsx +0 -87
- package/src/components/fragments.ts +0 -14
- package/src/events.ts +0 -11
- package/src/util/overscroll.ts +0 -69
- /package/dist/lib/browser/{state-CRXR7X63.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/types/src/{components/DeckLayout → containers/Deck}/Banner.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/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/SidebarButton.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/index.d.ts +0 -0
- /package/src/{components → containers}/Sidebar/index.ts +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/operation';
|
|
9
|
+
|
|
10
|
+
import { DeckCapabilities } from '../types';
|
|
11
|
+
import { UpdatePlankSize } from './definitions';
|
|
12
|
+
import { updateActiveDeck } from './helpers';
|
|
13
|
+
|
|
14
|
+
const handler: Operation.WithHandler<typeof UpdatePlankSize> = UpdatePlankSize.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fnUntraced(function* (input) {
|
|
17
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) =>
|
|
18
|
+
updateActiveDeck(state, {
|
|
19
|
+
plankSizing: {
|
|
20
|
+
...state.decks[state.activeDeck]?.plankSizing,
|
|
21
|
+
[input.id]: input.size,
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
);
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export default handler;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities } from '@dxos/app-framework';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
10
|
+
|
|
11
|
+
import { DeckCapabilities } from '../types';
|
|
12
|
+
|
|
13
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.UpdatePopover> = LayoutOperation.UpdatePopover.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fnUntraced(function* (input) {
|
|
16
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.EphemeralState, (state) => ({
|
|
17
|
+
...state,
|
|
18
|
+
popoverOpen: input.state ?? Boolean(input.subject),
|
|
19
|
+
popoverKind: input.kind ?? 'base',
|
|
20
|
+
popoverTitle: input.kind === 'card' ? input.title : undefined,
|
|
21
|
+
popoverContentRef: input.subjectRef,
|
|
22
|
+
popoverContent:
|
|
23
|
+
typeof input.subject === 'string'
|
|
24
|
+
? { component: input.subject, props: input.props }
|
|
25
|
+
: input.subject
|
|
26
|
+
? { subject: input.subject }
|
|
27
|
+
: null,
|
|
28
|
+
popoverSide: input.side,
|
|
29
|
+
popoverAnchor: input.variant === 'virtual' ? input.anchor : state.popoverAnchor,
|
|
30
|
+
popoverAnchorId: input.variant !== 'virtual' ? input.anchorId : state.popoverAnchorId,
|
|
31
|
+
}));
|
|
32
|
+
}),
|
|
33
|
+
),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export default handler;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities } from '@dxos/app-framework';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
10
|
+
|
|
11
|
+
import { DeckCapabilities } from '../types';
|
|
12
|
+
|
|
13
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.UpdateSidebar> = LayoutOperation.UpdateSidebar.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fnUntraced(function* (input) {
|
|
16
|
+
const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
17
|
+
const next = input.state ?? state.sidebarState;
|
|
18
|
+
if (next !== state.sidebarState) {
|
|
19
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => ({
|
|
20
|
+
...state,
|
|
21
|
+
sidebarState: next,
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
}),
|
|
25
|
+
),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export default handler;
|
package/src/translations.ts
CHANGED
|
@@ -4,64 +4,64 @@
|
|
|
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
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'sidebar
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'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': 'Minimize sidebar',
|
|
18
|
+
'open-complementary-sidebar.label': 'Open context sidebar',
|
|
19
|
+
'close-complementary-sidebar.label': 'Minimize 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':
|
|
24
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.',
|
|
25
|
-
'toggle
|
|
26
|
-
'settings
|
|
27
|
-
'settings
|
|
28
|
-
'settings
|
|
29
|
-
'settings
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'undo
|
|
33
|
-
'undo
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
'
|
|
45
|
-
'
|
|
46
|
-
'
|
|
47
|
-
'
|
|
48
|
-
'show
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
'
|
|
53
|
-
'
|
|
54
|
-
'
|
|
55
|
-
'settings
|
|
56
|
-
'
|
|
57
|
-
'settings
|
|
58
|
-
'settings
|
|
59
|
-
'
|
|
60
|
-
'
|
|
61
|
-
'close
|
|
62
|
-
'close
|
|
63
|
-
'
|
|
64
|
-
'companion plank heading fallback label': 'Related',
|
|
26
|
+
'toggle-fullscreen.label': 'Toggle fullscreen',
|
|
27
|
+
'settings.show-hints.label': 'Show hints',
|
|
28
|
+
'settings.show-hints.description': 'Show helpful tips and keyboard shortcut hints in the interface.',
|
|
29
|
+
'settings.native-redirect.label': 'Enable native url redirect',
|
|
30
|
+
'settings.native-redirect.description': 'Redirect supported URLs to the native desktop application.',
|
|
31
|
+
'undo-available.label': 'Click to undo previous action.',
|
|
32
|
+
'undo-action.label': 'Undo',
|
|
33
|
+
'undo-action.alt': 'Undo previous action',
|
|
34
|
+
'undo-close.label': 'Dismiss',
|
|
35
|
+
'error-fallback.message': 'Unable to open this object',
|
|
36
|
+
'plank-heading-fallback.label': 'Untitled',
|
|
37
|
+
'actions-menu.label': 'Options',
|
|
38
|
+
'settings.deck.label': 'Disable deck',
|
|
39
|
+
'pending.heading': 'Loading…',
|
|
40
|
+
'insert-plank.label': 'Open',
|
|
41
|
+
'resize.label': 'Drag to resize',
|
|
42
|
+
'pin-start.label': 'Pin to the left sidebar',
|
|
43
|
+
'pin-end.label': 'Pin to the right sidebar',
|
|
44
|
+
'increment-start.label': 'Move to the left',
|
|
45
|
+
'increment-end.label': 'Move to the right',
|
|
46
|
+
'show-deck-plank.label': 'Return to deck',
|
|
47
|
+
'show-solo-plank.label': 'Maximize',
|
|
48
|
+
'exit-fullscreen.label': 'Exit fullscreen',
|
|
49
|
+
'show-fullscreen-plank.label': 'Fullscreen',
|
|
50
|
+
'close.label': 'Close',
|
|
51
|
+
'minify.label': 'Minify',
|
|
52
|
+
'open-companion.label': 'Open companion',
|
|
53
|
+
'close-companion.label': 'Close companion',
|
|
54
|
+
'settings.enable-statusbar.label': 'Show status bar',
|
|
55
|
+
'settings.enable-statusbar.description': 'Display a status bar at the bottom of the application.',
|
|
56
|
+
'settings.enable-deck.label': 'Enable Deck',
|
|
57
|
+
'settings.enable-deck.description': 'Display multiple panels side by side instead of one at a time.',
|
|
58
|
+
'settings.encapsulated-planks.label': 'Encapsulated planks',
|
|
59
|
+
'settings.encapsulated-planks.description': 'Render each plank inside its own isolated container.',
|
|
60
|
+
'close-current.label': 'Close current plank',
|
|
61
|
+
'close-others.label': 'Close other planks',
|
|
62
|
+
'close-all.label': 'Close all planks',
|
|
63
|
+
'close-navigation-sidebar.button': 'Close',
|
|
64
|
+
'companion-plank-heading-fallback.label': 'Related',
|
|
65
65
|
},
|
|
66
66
|
},
|
|
67
67
|
},
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
showHints: Schema.optional(Schema.Boolean),
|
|
11
|
+
enableDeck: Schema.optional(Schema.Boolean),
|
|
12
|
+
enableStatusbar: Schema.optional(Schema.Boolean),
|
|
13
|
+
enableNativeRedirect: Schema.optional(Schema.Boolean),
|
|
14
|
+
// TODO(burdon): Rename layoutMode? (e.g., bento | encapsulated?)
|
|
15
|
+
encapsulatedPlanks: Schema.optional(Schema.Boolean),
|
|
16
|
+
}).pipe(Schema.mutable);
|
|
17
|
+
export interface Settings extends Schema.Schema.Type<typeof Settings> {}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Atom } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { invariant } from '@dxos/invariant';
|
|
10
|
+
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
|
|
13
|
+
import { type EphemeralDeckState, type DeckState, type StoredDeckState } from './schema';
|
|
14
|
+
import * as Settings from './Settings';
|
|
15
|
+
|
|
16
|
+
export namespace DeckCapabilities {
|
|
17
|
+
export const Settings = Capability.make<Atom.Writable<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
|
+
});
|
|
35
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ActivationEvent } from '@dxos/app-framework';
|
|
6
|
+
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
7
|
+
|
|
8
|
+
import { meta } from '#meta';
|
|
9
|
+
|
|
10
|
+
import { DeckCapabilities } from './capabilities';
|
|
11
|
+
|
|
12
|
+
export namespace DeckEvents {
|
|
13
|
+
export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(
|
|
14
|
+
`${meta.id}.state-ready`,
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
/** Fired when DeckSettings capability is ready. */
|
|
18
|
+
export const SettingsReady: ActivationEvent.ActivationEvent = AppActivationEvents.createSettingsEvent(
|
|
19
|
+
DeckCapabilities.Settings.identifier,
|
|
20
|
+
);
|
|
21
|
+
}
|
package/src/types/index.ts
CHANGED
package/src/types/schema.ts
CHANGED
|
@@ -2,52 +2,41 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Label, LayoutOperation } from '@dxos/app-toolkit';
|
|
8
8
|
import { type DeepReadonly } from '@dxos/util';
|
|
9
9
|
|
|
10
|
-
import { meta } from '
|
|
10
|
+
import { meta } from '#meta';
|
|
11
11
|
|
|
12
|
-
export
|
|
12
|
+
export * as Settings from './Settings';
|
|
13
13
|
|
|
14
|
-
export
|
|
15
|
-
export const DECK_COMPANION_TYPE = 'dxos.org/plugin/deck/deck-companion';
|
|
14
|
+
export { PLANK_COMPANION_TYPE, DECK_COMPANION_TYPE } from '@dxos/app-toolkit';
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
export const NewPlankPositions = ['start', 'end'] as const;
|
|
19
|
-
export type NewPlankPositioning = (typeof NewPlankPositions)[number];
|
|
20
|
-
|
|
21
|
-
export const OverscrollOptions = ['none', 'centering'] as const;
|
|
22
|
-
export type Overscroll = (typeof OverscrollOptions)[number];
|
|
23
|
-
|
|
24
|
-
export type Part = 'solo' | 'deck' | 'complementary';
|
|
16
|
+
export type Part = 'solo' | 'multi' | 'complementary';
|
|
25
17
|
export type ResolvedPart = Part | 'solo-primary' | 'solo-companion';
|
|
26
18
|
|
|
27
|
-
export const DeckSettingsSchema = Schema.Struct({
|
|
28
|
-
showHints: Schema.optional(Schema.Boolean),
|
|
29
|
-
enableDeck: Schema.optional(Schema.Boolean),
|
|
30
|
-
enableStatusbar: Schema.optional(Schema.Boolean),
|
|
31
|
-
enableNativeRedirect: Schema.optional(Schema.Boolean),
|
|
32
|
-
newPlankPositioning: Schema.optional(Schema.Literal(...NewPlankPositions)),
|
|
33
|
-
overscroll: Schema.optional(Schema.Literal(...OverscrollOptions)),
|
|
34
|
-
}).pipe(Schema.mutable);
|
|
35
|
-
export type DeckSettingsProps = Schema.Schema.Type<typeof DeckSettingsSchema>;
|
|
36
|
-
|
|
37
19
|
export const PlankSizing = Schema.Record({ key: Schema.String, value: Schema.Number });
|
|
38
20
|
export type PlankSizing = Schema.Schema.Type<typeof PlankSizing>;
|
|
39
21
|
|
|
40
|
-
// State of an individual deck.
|
|
41
22
|
export const DeckState = Schema.Struct({
|
|
42
23
|
/** If false, the deck has not yet left solo mode and new planks should be soloed. */
|
|
43
24
|
initialized: Schema.Boolean,
|
|
25
|
+
/** Item IDs of planks currently displayed in multi-mode. */
|
|
44
26
|
active: Schema.mutable(Schema.Array(Schema.String)),
|
|
45
|
-
|
|
46
|
-
activeCompanions: Schema.optional(Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.String }))),
|
|
27
|
+
/** Item IDs of planks that have been closed; used for state persistence and reopening. */
|
|
47
28
|
inactive: Schema.mutable(Schema.Array(Schema.String)),
|
|
29
|
+
/** Item ID of the single plank displayed in solo or fullscreen mode. */
|
|
48
30
|
solo: Schema.optional(Schema.String),
|
|
31
|
+
/** Whether the solo plank is displayed in fullscreen mode (no heading or sidebars). */
|
|
49
32
|
fullscreen: Schema.Boolean,
|
|
33
|
+
/** Persisted plank widths in rem, keyed by item ID. */
|
|
50
34
|
plankSizing: Schema.mutable(PlankSizing),
|
|
35
|
+
/** Whether the companion pane is visible alongside the active plank(s). */
|
|
36
|
+
companionOpen: Schema.Boolean,
|
|
37
|
+
/** Which companion variant to display when the companion pane is open. */
|
|
38
|
+
companionVariant: Schema.optional(Schema.String),
|
|
39
|
+
/** Persisted companion frame widths in rem, keyed by frame ID. */
|
|
51
40
|
companionFrameSizing: Schema.mutable(PlankSizing),
|
|
52
41
|
});
|
|
53
42
|
export type DeckState = Schema.Schema.Type<typeof DeckState>;
|
|
@@ -55,61 +44,75 @@ export type DeckState = Schema.Schema.Type<typeof DeckState>;
|
|
|
55
44
|
export const defaultDeck: DeckState = {
|
|
56
45
|
initialized: false,
|
|
57
46
|
active: [],
|
|
58
|
-
activeCompanions: {},
|
|
59
47
|
inactive: [],
|
|
60
48
|
solo: undefined,
|
|
61
49
|
fullscreen: false,
|
|
62
50
|
plankSizing: {},
|
|
51
|
+
companionOpen: false,
|
|
52
|
+
companionVariant: undefined,
|
|
63
53
|
companionFrameSizing: {},
|
|
64
54
|
};
|
|
65
55
|
|
|
66
|
-
|
|
56
|
+
//
|
|
57
|
+
// Layout
|
|
58
|
+
//
|
|
59
|
+
|
|
60
|
+
const LayoutMode = Schema.Literal('multi', 'solo', 'solo--fullscreen');
|
|
67
61
|
export type LayoutMode = Schema.Schema.Type<typeof LayoutMode>;
|
|
68
62
|
export const isLayoutMode = (value: any): value is LayoutMode => Schema.is(LayoutMode)(value);
|
|
69
|
-
|
|
70
63
|
export const getMode = (deck: DeckState | DeepReadonly<DeckState>): LayoutMode => {
|
|
71
64
|
if (deck.solo) {
|
|
72
65
|
return deck.fullscreen ? 'solo--fullscreen' : 'solo';
|
|
73
66
|
}
|
|
74
67
|
|
|
75
|
-
return '
|
|
68
|
+
return 'multi';
|
|
76
69
|
};
|
|
77
70
|
|
|
78
|
-
//
|
|
79
|
-
export const
|
|
71
|
+
// Persisted plugin state (stored in KVS/localStorage).
|
|
72
|
+
export const StoredDeckState = Schema.Struct({
|
|
80
73
|
sidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),
|
|
81
74
|
complementarySidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),
|
|
82
75
|
complementarySidebarPanel: Schema.optional(Schema.String),
|
|
76
|
+
activeDeck: Schema.String,
|
|
77
|
+
previousDeck: Schema.String,
|
|
78
|
+
decks: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(DeckState) })),
|
|
79
|
+
previousMode: Schema.mutable(Schema.Record({ key: Schema.String, value: LayoutMode })),
|
|
80
|
+
}).pipe(Schema.mutable);
|
|
81
|
+
export type StoredDeckState = Schema.Schema.Type<typeof StoredDeckState>;
|
|
83
82
|
|
|
83
|
+
// Transient/ephemeral plugin state (not persisted).
|
|
84
|
+
export const EphemeralDeckState = Schema.Struct({
|
|
84
85
|
dialogOpen: Schema.Boolean,
|
|
85
86
|
dialogType: Schema.optional(Schema.Literal('default', 'alert')),
|
|
86
87
|
dialogBlockAlign: Schema.optional(Schema.Literal('start', 'center', 'end')),
|
|
87
88
|
dialogOverlayClasses: Schema.optional(Schema.String),
|
|
88
89
|
dialogOverlayStyle: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),
|
|
89
90
|
/** Data to be passed to the dialog Surface. */
|
|
90
|
-
dialogContent: Schema.optional(Schema.Any),
|
|
91
|
-
|
|
91
|
+
dialogContent: Schema.NullOr(Schema.Struct({ component: Schema.String, props: Schema.optional(Schema.Any) })),
|
|
92
92
|
popoverOpen: Schema.Boolean,
|
|
93
93
|
popoverSide: Schema.optional(Schema.Literal('top', 'right', 'bottom', 'left')),
|
|
94
94
|
popoverAnchor: Schema.optional(Schema.Any),
|
|
95
95
|
popoverAnchorId: Schema.optional(Schema.String),
|
|
96
|
+
popoverKind: Schema.optional(Schema.Literal('base', 'card')),
|
|
97
|
+
popoverTitle: Schema.optional(Label.annotations({ description: 'The title of the popover.' })),
|
|
98
|
+
/** Ref of the subject to be passed to the popover Surface. */
|
|
99
|
+
popoverContentRef: Schema.optional(Schema.String),
|
|
96
100
|
/** Data to be passed to the popover Surface. */
|
|
97
|
-
popoverContent: Schema.
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
popoverContent: Schema.NullOr(
|
|
102
|
+
Schema.Union(
|
|
103
|
+
Schema.Struct({ component: Schema.String, props: Schema.optional(Schema.Any) }),
|
|
104
|
+
Schema.Struct({ subject: Schema.Any }),
|
|
105
|
+
),
|
|
106
|
+
),
|
|
107
|
+
toasts: Schema.mutable(Schema.Array(LayoutOperation.Toast)),
|
|
100
108
|
currentUndoId: Schema.optional(Schema.String),
|
|
101
|
-
|
|
102
|
-
activeDeck: Schema.String,
|
|
103
|
-
previousDeck: Schema.String,
|
|
104
|
-
decks: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(DeckState) })),
|
|
105
|
-
previousMode: Schema.mutable(Schema.Record({ key: Schema.String, value: LayoutMode })),
|
|
106
|
-
deck: Schema.mutable(DeckState),
|
|
107
|
-
|
|
108
109
|
/** The identifier of a component to scroll into view when it is mounted. */
|
|
109
110
|
scrollIntoView: Schema.optional(Schema.String),
|
|
110
111
|
}).pipe(Schema.mutable);
|
|
112
|
+
export type EphemeralDeckState = Schema.Schema.Type<typeof EphemeralDeckState>;
|
|
111
113
|
|
|
112
|
-
|
|
114
|
+
// Combined state type (for convenience in components that need both).
|
|
115
|
+
export type DeckPluginState = StoredDeckState & EphemeralDeckState;
|
|
113
116
|
|
|
114
117
|
export namespace DeckAction {
|
|
115
118
|
const PartAdjustmentSchema = Schema.Union(
|
|
@@ -125,12 +128,12 @@ export namespace DeckAction {
|
|
|
125
128
|
export type Adjustment = Schema.Schema.Type<typeof Adjustment>;
|
|
126
129
|
|
|
127
130
|
// An atomic transaction to apply to the deck, describing which element to move to which location.
|
|
128
|
-
export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}
|
|
131
|
+
export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}.action.adjust`, {
|
|
129
132
|
input: Adjustment,
|
|
130
133
|
output: Schema.Void,
|
|
131
134
|
}) {}
|
|
132
135
|
|
|
133
|
-
export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}
|
|
136
|
+
export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}.action.update-plank-size`, {
|
|
134
137
|
input: Schema.Struct({
|
|
135
138
|
id: Schema.String,
|
|
136
139
|
size: Schema.Number,
|
|
@@ -138,9 +141,8 @@ export namespace DeckAction {
|
|
|
138
141
|
output: Schema.Void,
|
|
139
142
|
}) {}
|
|
140
143
|
|
|
141
|
-
export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${meta.id}
|
|
144
|
+
export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${meta.id}.action.change-companion`, {
|
|
142
145
|
input: Schema.Struct({
|
|
143
|
-
primary: Schema.String,
|
|
144
146
|
companion: Schema.Union(Schema.String, Schema.Null),
|
|
145
147
|
}),
|
|
146
148
|
output: Schema.Void,
|
package/src/util/index.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type LayoutMode } from '
|
|
5
|
+
import { type LayoutMode } from '#types';
|
|
6
6
|
|
|
7
7
|
export const layoutAppliesTopbar = (breakpoint: string, layoutMode?: LayoutMode) => {
|
|
8
8
|
return (
|
|
9
|
-
document.body.getAttribute('data-platform') === '
|
|
9
|
+
document.body.getAttribute('data-platform') === 'windows' &&
|
|
10
10
|
breakpoint === 'desktop' &&
|
|
11
11
|
layoutMode !== 'solo--fullscreen'
|
|
12
12
|
);
|
|
@@ -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
|
+
};
|