@dxos/plugin-deck 0.8.4-main.b97322e → 0.8.4-main.bcb3aa67d6
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-QUWRKFDD.mjs +24 -0
- package/dist/lib/browser/add-toast-QUWRKFDD.mjs.map +7 -0
- package/dist/lib/browser/adjust-J6F24WWJ.mjs +96 -0
- package/dist/lib/browser/adjust-J6F24WWJ.mjs.map +7 -0
- package/dist/lib/browser/change-companion-EZI57WDZ.mjs +34 -0
- package/dist/lib/browser/change-companion-EZI57WDZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-2YNVGCOQ.mjs +88 -0
- package/dist/lib/browser/chunk-2YNVGCOQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-AYFQHPPP.mjs +69 -0
- package/dist/lib/browser/chunk-AYFQHPPP.mjs.map +7 -0
- package/dist/lib/browser/chunk-GCDWE37Y.mjs +220 -0
- package/dist/lib/browser/chunk-GCDWE37Y.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/chunk-OHKLENIG.mjs +45 -0
- package/dist/lib/browser/chunk-OHKLENIG.mjs.map +7 -0
- package/dist/lib/browser/close-6RB62DEY.mjs +44 -0
- package/dist/lib/browser/close-6RB62DEY.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +177 -130
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/open-YL3JKXGK.mjs +115 -0
- package/dist/lib/browser/open-YL3JKXGK.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-JC66YMWB.mjs +21 -0
- package/dist/lib/browser/revert-workspace-JC66YMWB.mjs.map +7 -0
- package/dist/lib/browser/scroll-into-view-QSSFZ3KD.mjs +21 -0
- package/dist/lib/browser/scroll-into-view-QSSFZ3KD.mjs.map +7 -0
- package/dist/lib/browser/set-LPAGXY3F.mjs +37 -0
- package/dist/lib/browser/set-LPAGXY3F.mjs.map +7 -0
- package/dist/lib/browser/set-layout-mode-XZ4VHS2X.mjs +90 -0
- package/dist/lib/browser/set-layout-mode-XZ4VHS2X.mjs.map +7 -0
- package/dist/lib/browser/show-undo-IWX4S777.mjs +59 -0
- package/dist/lib/browser/show-undo-IWX4S777.mjs.map +7 -0
- package/dist/lib/browser/switch-workspace-5RKQ2LVK.mjs +68 -0
- package/dist/lib/browser/switch-workspace-5RKQ2LVK.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +12 -12
- package/dist/lib/browser/update-complementary-QIIZWLGY.mjs +28 -0
- package/dist/lib/browser/update-complementary-QIIZWLGY.mjs.map +7 -0
- package/dist/lib/browser/update-dialog-5IKCWFPW.mjs +29 -0
- package/dist/lib/browser/update-dialog-5IKCWFPW.mjs.map +7 -0
- package/dist/lib/browser/update-plank-size-YDM67P65.mjs +28 -0
- package/dist/lib/browser/update-plank-size-YDM67P65.mjs.map +7 -0
- package/dist/lib/browser/update-popover-AUVAWH3D.mjs +33 -0
- package/dist/lib/browser/update-popover-AUVAWH3D.mjs.map +7 -0
- package/dist/lib/browser/update-sidebar-BT3L5GJN.mjs +25 -0
- package/dist/lib/browser/update-sidebar-BT3L5GJN.mjs.map +7 -0
- package/dist/lib/node-esm/add-toast-MR53ZMTS.mjs +25 -0
- package/dist/lib/node-esm/add-toast-MR53ZMTS.mjs.map +7 -0
- package/dist/lib/node-esm/adjust-IXRBIVAO.mjs +97 -0
- package/dist/lib/node-esm/adjust-IXRBIVAO.mjs.map +7 -0
- package/dist/lib/node-esm/change-companion-RLMI5EYL.mjs +35 -0
- package/dist/lib/node-esm/change-companion-RLMI5EYL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7BNWWWAF.mjs +221 -0
- package/dist/lib/node-esm/chunk-7BNWWWAF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-C2AWKR2S.mjs +71 -0
- package/dist/lib/node-esm/chunk-C2AWKR2S.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GI5JXNBT.mjs +89 -0
- package/dist/lib/node-esm/chunk-GI5JXNBT.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-MLVJ2ODW.mjs +32 -0
- package/dist/lib/node-esm/chunk-MLVJ2ODW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TFFZ7NWH.mjs +47 -0
- package/dist/lib/node-esm/chunk-TFFZ7NWH.mjs.map +7 -0
- package/dist/lib/node-esm/close-UD7KBYZP.mjs +45 -0
- package/dist/lib/node-esm/close-UD7KBYZP.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +216 -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-XZ7YGVPZ.mjs +116 -0
- package/dist/lib/node-esm/open-XZ7YGVPZ.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-F3FUP4ZL.mjs +22 -0
- package/dist/lib/node-esm/revert-workspace-F3FUP4ZL.mjs.map +7 -0
- package/dist/lib/node-esm/scroll-into-view-24TF2WYQ.mjs +22 -0
- package/dist/lib/node-esm/scroll-into-view-24TF2WYQ.mjs.map +7 -0
- package/dist/lib/node-esm/set-F2QWLSJR.mjs +38 -0
- package/dist/lib/node-esm/set-F2QWLSJR.mjs.map +7 -0
- package/dist/lib/node-esm/set-layout-mode-Z54OX33H.mjs +91 -0
- package/dist/lib/node-esm/set-layout-mode-Z54OX33H.mjs.map +7 -0
- package/dist/lib/node-esm/show-undo-B2XVCKGX.mjs +60 -0
- package/dist/lib/node-esm/show-undo-B2XVCKGX.mjs.map +7 -0
- package/dist/lib/node-esm/switch-workspace-PM57REEV.mjs +69 -0
- package/dist/lib/node-esm/switch-workspace-PM57REEV.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-26H5UYJP.mjs +29 -0
- package/dist/lib/node-esm/update-complementary-26H5UYJP.mjs.map +7 -0
- package/dist/lib/node-esm/update-dialog-EYP3QNFG.mjs +30 -0
- package/dist/lib/node-esm/update-dialog-EYP3QNFG.mjs.map +7 -0
- package/dist/lib/node-esm/update-plank-size-LLFUB57G.mjs +29 -0
- package/dist/lib/node-esm/update-plank-size-LLFUB57G.mjs.map +7 -0
- package/dist/lib/node-esm/update-popover-G55PS7T4.mjs +34 -0
- package/dist/lib/node-esm/update-popover-G55PS7T4.mjs.map +7 -0
- package/dist/lib/node-esm/update-sidebar-W4ND5MUL.mjs +26 -0
- package/dist/lib/node-esm/update-sidebar-W4ND5MUL.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 +20 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +115 -41
- 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 +85 -0
- package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/DeckSettings/index.d.ts +2 -1
- package/dist/types/src/components/DeckSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/Matrix/Matrix.d.ts +49 -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 +85 -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 +87 -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 +21 -0
- package/dist/types/src/containers/Plank/Plank.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/Plank.stories.d.ts +84 -0
- package/dist/types/src/containers/Plank/Plank.stories.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankComponent.d.ts +15 -0
- package/dist/types/src/containers/Plank/PlankComponent.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankContent.d.ts +14 -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 +3 -3
- 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 +3 -9
- package/dist/types/src/layout.d.ts.map +1 -1
- 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/testing/DeckLayoutStoryNavigation.d.ts +10 -0
- package/dist/types/src/testing/DeckLayoutStoryNavigation.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +66 -52
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +16 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/{capabilities → types}/capabilities.d.ts +96 -90
- 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 +58 -54
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -0
- 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/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 +90 -47
- package/src/DeckPlugin.ts +44 -64
- package/src/capabilities/app-graph-builder.ts +113 -127
- package/src/capabilities/check-app-scheme.ts +123 -24
- package/src/capabilities/index.ts +13 -13
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-root.tsx +37 -28
- package/src/capabilities/react-surface.tsx +30 -22
- package/src/capabilities/settings.ts +32 -19
- package/src/capabilities/state.ts +74 -88
- package/src/capabilities/tools.ts +64 -54
- package/src/capabilities/url-handler.ts +199 -49
- package/src/components/DeckSettings/DeckSettings.stories.tsx +40 -0
- package/src/components/DeckSettings/DeckSettings.tsx +104 -69
- package/src/components/DeckSettings/index.ts +4 -2
- package/src/components/Matrix/Matrix.stories.tsx +213 -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/containers/Deck/Banner.tsx +40 -0
- package/src/containers/Deck/Deck.stories.tsx +85 -0
- package/src/containers/Deck/Deck.tsx +21 -0
- package/src/containers/Deck/DeckContent.tsx +104 -0
- package/src/containers/Deck/DeckRoot.tsx +49 -0
- package/src/containers/Deck/DeckViewport.tsx +397 -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 +4 -3
- package/src/containers/DeckLayout/DeckLayout.stories.tsx +174 -0
- package/src/containers/DeckLayout/DeckLayout.tsx +62 -0
- package/src/{components → containers}/DeckLayout/Dialog.tsx +22 -13
- package/src/containers/DeckLayout/Fallback.tsx +24 -0
- package/src/containers/DeckLayout/Popover.tsx +156 -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 +105 -0
- package/src/containers/Plank/Plank.tsx +22 -0
- package/src/containers/Plank/PlankComponent.tsx +179 -0
- package/src/containers/Plank/PlankContent.tsx +45 -0
- package/src/{components → containers}/Plank/PlankControls.tsx +44 -37
- package/src/containers/Plank/PlankError.tsx +79 -0
- package/src/{components → containers}/Plank/PlankHeading.tsx +50 -63
- 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/{components → containers}/Sidebar/Sidebar.tsx +10 -10
- 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 +8 -11
- 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.ts +3 -16
- 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 +61 -0
- package/src/operations/helpers.ts +22 -0
- package/src/operations/index.ts +26 -0
- package/src/operations/open.ts +117 -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 +46 -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/testing/DeckLayoutStoryNavigation.tsx +57 -0
- package/src/testing/index.ts +5 -0
- package/src/translations.ts +67 -52
- package/src/types/Settings.ts +26 -0
- package/src/types/capabilities.ts +34 -0
- package/src/types/events.ts +21 -0
- package/src/types/index.ts +3 -0
- package/src/types/schema.ts +45 -48
- package/src/util/index.ts +1 -0
- package/src/util/layoutAppliesTopbar.ts +2 -2
- package/src/util/overscroll.ts +3 -3
- 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-JTFSDT2I.mjs +0 -152
- package/dist/lib/browser/app-graph-builder-JTFSDT2I.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-57U62A3A.mjs +0 -32
- package/dist/lib/browser/check-app-scheme-57U62A3A.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-D7KTFCUV.mjs +0 -1494
- package/dist/lib/browser/chunk-D7KTFCUV.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-JFTXENFN.mjs +0 -129
- package/dist/lib/browser/chunk-JFTXENFN.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-QDZO4AJ4.mjs +0 -127
- package/dist/lib/browser/chunk-QDZO4AJ4.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-P2OBK5HK.mjs +0 -521
- package/dist/lib/browser/intent-resolver-P2OBK5HK.mjs.map +0 -7
- package/dist/lib/browser/react-root-PO64J7ML.mjs +0 -43
- package/dist/lib/browser/react-root-PO64J7ML.mjs.map +0 -7
- package/dist/lib/browser/react-surface-E45YOVF5.mjs +0 -40
- package/dist/lib/browser/react-surface-E45YOVF5.mjs.map +0 -7
- package/dist/lib/browser/settings-6AJZPZPM.mjs +0 -29
- package/dist/lib/browser/settings-6AJZPZPM.mjs.map +0 -7
- package/dist/lib/browser/state-MVDYX77Y.mjs +0 -12
- package/dist/lib/browser/tools-TKQDPCHJ.mjs +0 -88
- package/dist/lib/browser/tools-TKQDPCHJ.mjs.map +0 -7
- package/dist/lib/browser/url-handler-7L7M6IKH.mjs +0 -70
- package/dist/lib/browser/url-handler-7L7M6IKH.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/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/src/capabilities/capabilities.ts +0 -14
- package/src/capabilities/intent-resolver.ts +0 -468
- package/src/components/DeckLayout/Banner.tsx +0 -39
- package/src/components/DeckLayout/ContentEmpty.tsx +0 -31
- package/src/components/DeckLayout/DeckLayout.tsx +0 -301
- 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 -55
- package/src/components/Plank/Plank.tsx +0 -266
- package/src/components/Plank/PlankError.tsx +0 -48
- package/src/components/Sidebar/ComplementarySidebar.tsx +0 -193
- package/src/components/Sidebar/SidebarButton.tsx +0 -87
- package/src/components/fragments.ts +0 -14
- package/src/events.ts +0 -11
- /package/dist/lib/browser/{state-MVDYX77Y.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
package/src/translations.ts
CHANGED
|
@@ -4,64 +4,79 @@
|
|
|
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
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
'
|
|
45
|
-
'
|
|
46
|
-
'
|
|
47
|
-
'
|
|
48
|
-
'
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
'
|
|
53
|
-
'
|
|
54
|
-
'
|
|
55
|
-
'
|
|
56
|
-
'
|
|
57
|
-
'
|
|
58
|
-
'
|
|
59
|
-
'settings
|
|
60
|
-
'settings
|
|
61
|
-
'
|
|
62
|
-
'
|
|
63
|
-
'
|
|
64
|
-
'
|
|
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
|
+
'settings.new-plank-position.start.label': 'Start',
|
|
32
|
+
'settings.new-plank-position.end.label': 'End',
|
|
33
|
+
'select-new-plank-positioning.placeholder': 'Select new plank positioning',
|
|
34
|
+
'select-new-plank-positioning.label': 'New plank positioning',
|
|
35
|
+
'select-new-plank-positioning.description':
|
|
36
|
+
'Choose whether newly opened planks appear at the start or end of the deck.',
|
|
37
|
+
'undo-available.label': 'Click to undo previous action.',
|
|
38
|
+
'undo-action.label': 'Undo',
|
|
39
|
+
'undo-action.alt': 'Undo previous action',
|
|
40
|
+
'undo-close.label': 'Dismiss',
|
|
41
|
+
'error-fallback.message': 'Unable to open this object',
|
|
42
|
+
'plank-heading-fallback.label': 'Untitled',
|
|
43
|
+
'actions-menu.label': 'Options',
|
|
44
|
+
'settings.deck.label': 'Disable deck',
|
|
45
|
+
'pending.heading': 'Loading…',
|
|
46
|
+
'insert-plank.label': 'Open',
|
|
47
|
+
'resize.label': 'Drag to resize',
|
|
48
|
+
'pin-start.label': 'Pin to the left sidebar',
|
|
49
|
+
'pin-end.label': 'Pin to the right sidebar',
|
|
50
|
+
'increment-start.label': 'Move to the left',
|
|
51
|
+
'increment-end.label': 'Move to the right',
|
|
52
|
+
'show-deck-plank.label': 'Return to deck',
|
|
53
|
+
'show-solo-plank.label': 'Maximize',
|
|
54
|
+
'exit-fullscreen.label': 'Exit fullscreen',
|
|
55
|
+
'show-fullscreen-plank.label': 'Fullscreen',
|
|
56
|
+
'close.label': 'Close',
|
|
57
|
+
'minify.label': 'Minify',
|
|
58
|
+
'open-companion.label': 'Open companion',
|
|
59
|
+
'close-companion.label': 'Close companion',
|
|
60
|
+
'settings.overscroll.label': 'Plank scrolling',
|
|
61
|
+
'settings.overscroll.description': 'Control how planks behave when scrolled to the edge of the deck.',
|
|
62
|
+
'select-overscroll.placeholder': 'Select plank scrolling behavior',
|
|
63
|
+
'settings.overscroll.centering.label': 'Centering',
|
|
64
|
+
'settings.overscroll.none.label': 'None',
|
|
65
|
+
'settings.enable-statusbar.label': 'Show status bar',
|
|
66
|
+
'settings.enable-statusbar.description': 'Display a status bar at the bottom of the application.',
|
|
67
|
+
'settings.enable-deck.label': 'Enable Deck',
|
|
68
|
+
'settings.enable-deck.description': 'Display multiple panels side by side instead of one at a time.',
|
|
69
|
+
'settings.encapsulated-planks.label': 'Encapsulated planks',
|
|
70
|
+
'settings.encapsulated-planks.description': 'Render each plank inside its own isolated container.',
|
|
71
|
+
'close-current.label': 'Close current plank',
|
|
72
|
+
'close-others.label': 'Close other planks',
|
|
73
|
+
'close-all.label': 'Close all planks',
|
|
74
|
+
'close-navigation-sidebar.button': 'Close',
|
|
75
|
+
'companion-plank-heading-fallback.label': 'Related',
|
|
76
|
+
'settings.new-plank-position-start.label': 'Start',
|
|
77
|
+
'settings.new-plank-position-end.label': 'End',
|
|
78
|
+
'settings.overscroll-centering.label': 'Centering',
|
|
79
|
+
'settings.overscroll-none.label': 'None',
|
|
65
80
|
},
|
|
66
81
|
},
|
|
67
82
|
},
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import * as Schema from 'effect/Schema';
|
|
8
|
+
|
|
9
|
+
// TODO(Zan): In the future we should consider adding new planks adjacent to the attended plank.
|
|
10
|
+
export const NewPlankPositions = ['start', 'end'] as const;
|
|
11
|
+
export type NewPlankPositioning = (typeof NewPlankPositions)[number];
|
|
12
|
+
|
|
13
|
+
export const OverScrollToProps = ['none', 'centering'] as const;
|
|
14
|
+
export type Overscroll = (typeof OverScrollToProps)[number];
|
|
15
|
+
|
|
16
|
+
export const Settings = Schema.Struct({
|
|
17
|
+
showHints: Schema.optional(Schema.Boolean),
|
|
18
|
+
enableDeck: Schema.optional(Schema.Boolean),
|
|
19
|
+
enableStatusbar: Schema.optional(Schema.Boolean),
|
|
20
|
+
enableNativeRedirect: Schema.optional(Schema.Boolean),
|
|
21
|
+
newPlankPositioning: Schema.optional(Schema.Literal(...NewPlankPositions)),
|
|
22
|
+
overscroll: Schema.optional(Schema.Literal(...OverScrollToProps)),
|
|
23
|
+
// TODO(burdon): Rename layoutMode? (e.g., bento | encapsulated?)
|
|
24
|
+
encapsulatedPlanks: Schema.optional(Schema.Boolean),
|
|
25
|
+
}).pipe(Schema.mutable);
|
|
26
|
+
export type Settings = Schema.Schema.Type<typeof Settings>;
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
import * as Settings from './Settings';
|
|
13
|
+
import { type EphemeralDeckState, type DeckState, type StoredDeckState } from './schema';
|
|
14
|
+
|
|
15
|
+
export namespace DeckCapabilities {
|
|
16
|
+
export const Settings = Capability.make<Atom.Writable<Settings.Settings>>(`${meta.id}.capability.settings`);
|
|
17
|
+
|
|
18
|
+
/** Persisted state (stored in KVS/localStorage). */
|
|
19
|
+
export const State = Capability.make<Atom.Writable<StoredDeckState>>(`${meta.id}.capability.state`);
|
|
20
|
+
|
|
21
|
+
/** Transient/ephemeral state (not persisted). */
|
|
22
|
+
export const EphemeralState = Capability.make<Atom.Writable<EphemeralDeckState>>(
|
|
23
|
+
`${meta.id}.capability.ephemeral-state`,
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
/** Get the current active deck from state. */
|
|
27
|
+
export const getDeck = (): Effect.Effect<DeckState, Error, Capability.Service> =>
|
|
28
|
+
Effect.gen(function* () {
|
|
29
|
+
const state = yield* Capabilities.getAtomValue(State);
|
|
30
|
+
const deck = state.decks[state.activeDeck];
|
|
31
|
+
invariant(deck, `Deck not found: ${state.activeDeck}`);
|
|
32
|
+
return deck;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -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,32 +44,44 @@ 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')),
|
|
@@ -88,28 +89,25 @@ export const DeckPluginState = Schema.Struct({
|
|
|
88
89
|
dialogOverlayStyle: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),
|
|
89
90
|
/** Data to be passed to the dialog Surface. */
|
|
90
91
|
dialogContent: Schema.optional(Schema.Any),
|
|
91
|
-
|
|
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
101
|
popoverContent: Schema.optional(Schema.Any),
|
|
98
|
-
|
|
99
|
-
toasts: Schema.mutable(Schema.Array(LayoutAction.Toast)),
|
|
102
|
+
toasts: Schema.mutable(Schema.Array(LayoutOperation.Toast)),
|
|
100
103
|
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
104
|
/** The identifier of a component to scroll into view when it is mounted. */
|
|
109
105
|
scrollIntoView: Schema.optional(Schema.String),
|
|
110
106
|
}).pipe(Schema.mutable);
|
|
107
|
+
export type EphemeralDeckState = Schema.Schema.Type<typeof EphemeralDeckState>;
|
|
111
108
|
|
|
112
|
-
|
|
109
|
+
// Combined state type (for convenience in components that need both).
|
|
110
|
+
export type DeckPluginState = StoredDeckState & EphemeralDeckState;
|
|
113
111
|
|
|
114
112
|
export namespace DeckAction {
|
|
115
113
|
const PartAdjustmentSchema = Schema.Union(
|
|
@@ -125,12 +123,12 @@ export namespace DeckAction {
|
|
|
125
123
|
export type Adjustment = Schema.Schema.Type<typeof Adjustment>;
|
|
126
124
|
|
|
127
125
|
// 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}
|
|
126
|
+
export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}.action.adjust`, {
|
|
129
127
|
input: Adjustment,
|
|
130
128
|
output: Schema.Void,
|
|
131
129
|
}) {}
|
|
132
130
|
|
|
133
|
-
export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}
|
|
131
|
+
export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}.action.update-plank-size`, {
|
|
134
132
|
input: Schema.Struct({
|
|
135
133
|
id: Schema.String,
|
|
136
134
|
size: Schema.Number,
|
|
@@ -138,9 +136,8 @@ export namespace DeckAction {
|
|
|
138
136
|
output: Schema.Void,
|
|
139
137
|
}) {}
|
|
140
138
|
|
|
141
|
-
export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${meta.id}
|
|
139
|
+
export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${meta.id}.action.change-companion`, {
|
|
142
140
|
input: Schema.Struct({
|
|
143
|
-
primary: Schema.String,
|
|
144
141
|
companion: Schema.Union(Schema.String, Schema.Null),
|
|
145
142
|
}),
|
|
146
143
|
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
|
);
|
package/src/util/overscroll.ts
CHANGED
|
@@ -56,14 +56,14 @@ export const calculateOverscroll = (
|
|
|
56
56
|
}
|
|
57
57
|
if (planksCount === 1) {
|
|
58
58
|
const overscrollPadding =
|
|
59
|
-
'max(0px, calc(((100dvw - var(--
|
|
59
|
+
'max(0px, calc(((100dvw - var(--main-sidebar-width) - var(--main-complementary-width) - (var(--main-content-first-width) + 1px)) / 2)))';
|
|
60
60
|
return { paddingInlineStart: overscrollPadding, paddingInlineEnd: overscrollPadding };
|
|
61
61
|
} else {
|
|
62
62
|
return {
|
|
63
63
|
paddingInlineStart:
|
|
64
|
-
'max(0px, calc(((100dvw - (var(--
|
|
64
|
+
'max(0px, calc(((100dvw - (var(--main-content-first-width) + 1px)) / 2) - var(--main-sidebar-width)))',
|
|
65
65
|
paddingInlineEnd:
|
|
66
|
-
'max(0px, calc(((100dvw - (var(--
|
|
66
|
+
'max(0px, calc(((100dvw - (var(--main-content-last-width) + 1px)) / 2) - var(--main-complementary-width)))',
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { defaultDeck, type DeckState, type StoredDeckState } from '#types';
|
|
8
|
+
|
|
9
|
+
import { sanitizePersistedState } from './sanitize-persisted-state';
|
|
10
|
+
|
|
11
|
+
const makeState = (decks: Record<string, Partial<DeckState>>): StoredDeckState => ({
|
|
12
|
+
sidebarState: 'expanded',
|
|
13
|
+
complementarySidebarState: 'collapsed',
|
|
14
|
+
complementarySidebarPanel: undefined,
|
|
15
|
+
activeDeck: Object.keys(decks)[0] ?? 'default',
|
|
16
|
+
previousDeck: 'default',
|
|
17
|
+
decks: Object.fromEntries(Object.entries(decks).map(([id, overrides]) => [id, { ...defaultDeck, ...overrides }])),
|
|
18
|
+
previousMode: {},
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
describe('sanitizePersistedState', () => {
|
|
22
|
+
test('returns same reference when no cleanup needed', ({ expect }) => {
|
|
23
|
+
const state = makeState({ default: {} });
|
|
24
|
+
expect(sanitizePersistedState(state)).toBe(state);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('clears fullscreen on any deck', ({ expect }) => {
|
|
28
|
+
const state = makeState({ ws1: { fullscreen: true } });
|
|
29
|
+
const result = sanitizePersistedState(state);
|
|
30
|
+
expect(result.decks.ws1?.fullscreen).toBe(false);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('clears active for solo-mode decks', ({ expect }) => {
|
|
34
|
+
const state = makeState({ ws1: { solo: 'item-a', active: ['item-b', 'item-c'] } });
|
|
35
|
+
const result = sanitizePersistedState(state);
|
|
36
|
+
expect(result.decks.ws1?.active).toEqual([]);
|
|
37
|
+
expect(result.decks.ws1?.solo).toBe('item-a');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('preserves active for deck-mode decks (no solo)', ({ expect }) => {
|
|
41
|
+
const state = makeState({ ws1: { active: ['item-a', 'item-b'], initialized: true } });
|
|
42
|
+
const result = sanitizePersistedState(state);
|
|
43
|
+
expect(result).toBe(state);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test('does not clear active when it is already empty', ({ expect }) => {
|
|
47
|
+
const state = makeState({ ws1: { solo: 'item-a', active: [] } });
|
|
48
|
+
expect(sanitizePersistedState(state)).toBe(state);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test('cleans multiple decks independently', ({ expect }) => {
|
|
52
|
+
const state = makeState({
|
|
53
|
+
ws1: { solo: 'item-a', active: ['item-b'] },
|
|
54
|
+
ws2: { active: ['item-c'], initialized: true },
|
|
55
|
+
ws3: { fullscreen: true, solo: 'item-d', active: ['item-e'] },
|
|
56
|
+
});
|
|
57
|
+
const result = sanitizePersistedState(state);
|
|
58
|
+
|
|
59
|
+
// ws1: solo with active → active cleared.
|
|
60
|
+
expect(result.decks.ws1?.active).toEqual([]);
|
|
61
|
+
expect(result.decks.ws1?.solo).toBe('item-a');
|
|
62
|
+
|
|
63
|
+
// ws2: deck mode, no solo → untouched.
|
|
64
|
+
expect(result.decks.ws2?.active).toEqual(['item-c']);
|
|
65
|
+
|
|
66
|
+
// ws3: fullscreen + solo with active → both cleared.
|
|
67
|
+
expect(result.decks.ws3?.fullscreen).toBe(false);
|
|
68
|
+
expect(result.decks.ws3?.active).toEqual([]);
|
|
69
|
+
expect(result.decks.ws3?.solo).toBe('item-d');
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
test('does not mutate the original state', ({ expect }) => {
|
|
73
|
+
const state = makeState({ ws1: { solo: 'item-a', active: ['item-b'], fullscreen: true } });
|
|
74
|
+
const originalActive = [...state.decks.ws1!.active];
|
|
75
|
+
sanitizePersistedState(state);
|
|
76
|
+
expect(state.decks.ws1?.active).toEqual(originalActive);
|
|
77
|
+
expect(state.decks.ws1?.fullscreen).toBe(true);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type StoredDeckState } from '#types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Sanitizes persisted deck state on startup.
|
|
9
|
+
*
|
|
10
|
+
* Persisted state may contain values that are inappropriate to restore across sessions:
|
|
11
|
+
*
|
|
12
|
+
* - **Fullscreen**: Cleared unconditionally to prevent the user from getting stuck in fullscreen
|
|
13
|
+
* mode if the app was closed (or crashed) while fullscreen was active.
|
|
14
|
+
*
|
|
15
|
+
* - **Active planks in solo-mode decks**: When a deck is in solo mode, any items in `active`
|
|
16
|
+
* represent planks that were kept mounted (hidden) during the session for fast deck↔solo
|
|
17
|
+
* switching. After a restart these planks would need to fully remount anyway, so retaining
|
|
18
|
+
* them only adds unnecessary load. Clearing `active` for solo-mode decks avoids rendering
|
|
19
|
+
* stale planks in the background on startup.
|
|
20
|
+
*
|
|
21
|
+
* Returns a new state object if any changes were made, or the original state if clean.
|
|
22
|
+
*/
|
|
23
|
+
export const sanitizePersistedState = (state: StoredDeckState): StoredDeckState => {
|
|
24
|
+
let needsUpdate = false;
|
|
25
|
+
const cleanedDecks = { ...state.decks };
|
|
26
|
+
|
|
27
|
+
for (const [id, deck] of Object.entries(cleanedDecks)) {
|
|
28
|
+
if (!deck) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let updated = false;
|
|
33
|
+
let cleanedDeck = deck;
|
|
34
|
+
|
|
35
|
+
if (deck.fullscreen) {
|
|
36
|
+
cleanedDeck = { ...cleanedDeck, fullscreen: false };
|
|
37
|
+
updated = true;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (deck.solo && deck.active.length > 0) {
|
|
41
|
+
cleanedDeck = { ...cleanedDeck, active: [] };
|
|
42
|
+
updated = true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (updated) {
|
|
46
|
+
cleanedDecks[id] = cleanedDeck;
|
|
47
|
+
needsUpdate = true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return needsUpdate ? { ...state, decks: cleanedDecks } : state;
|
|
52
|
+
};
|