@dxos/plugin-deck 0.8.4-main.bc674ce → 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-J5LGTIGS.mjs.map +7 -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 +161 -126
- 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 +8 -15
- 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 +161 -126
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- 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 +8 -15
- 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.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/check-app-scheme.d.ts +19 -0
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +198 -9
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/{react-root/react-root.d.ts → react-root.d.ts} +1 -1
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +4 -3
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +11 -11
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/{tools/tools.d.ts → tools.d.ts} +2 -2
- package/dist/types/src/capabilities/tools.d.ts.map +1 -0
- package/dist/types/src/capabilities/url-handler.d.ts +5 -0
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -0
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +4 -6
- 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.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/{components → containers}/DeckLayout/Dialog.d.ts.map +1 -1
- package/dist/types/src/containers/DeckLayout/Fallback.d.ts +2 -0
- package/dist/types/src/containers/DeckLayout/Fallback.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/Popover.d.ts +5 -0
- package/dist/types/src/containers/DeckLayout/Popover.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/DeckLayout/Toast.d.ts +3 -3
- 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 +1 -1
- 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/{components → containers}/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/Sidebar/SidebarButton.d.ts.map +1 -1
- 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 +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +0 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckState.d.ts +3 -3
- package/dist/types/src/hooks/useDeckState.d.ts.map +1 -1
- package/dist/types/src/hooks/useHoistStatusbar.d.ts +1 -1
- package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
- package/dist/types/src/hooks/useMainSize.d.ts +2 -2
- 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/layout.d.ts +3 -9
- package/dist/types/src/layout.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 -54
- 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/types/capabilities.d.ts +11 -11
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +38 -94
- 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 +2 -2
- package/dist/types/src/util/set-active.d.ts.map +1 -1
- package/dist/types/src/util/set-active.test.d.ts +2 -0
- package/dist/types/src/util/set-active.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +77 -44
- package/src/DeckPlugin.ts +18 -22
- package/src/capabilities/app-graph-builder.ts +127 -0
- package/src/capabilities/check-app-scheme.ts +139 -0
- package/src/capabilities/index.ts +14 -10
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +5 -5
- package/src/capabilities/react-surface.tsx +38 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +8 -7
- package/src/capabilities/{state/state.ts → state.ts} +17 -31
- package/src/capabilities/{tools/tools.ts → tools.ts} +4 -5
- package/src/capabilities/url-handler.ts +209 -0
- package/src/components/DeckSettings/DeckSettings.stories.tsx +40 -0
- package/src/components/DeckSettings/DeckSettings.tsx +103 -93
- 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/{components/DeckLayout → containers/Deck}/Banner.tsx +10 -9
- 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 +11 -5
- package/src/containers/DeckLayout/Fallback.tsx +24 -0
- package/src/{components → containers}/DeckLayout/Popover.tsx +58 -18
- package/src/{components → containers}/DeckLayout/Toast.tsx +4 -4
- 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 +41 -34
- package/src/containers/Plank/PlankError.tsx +79 -0
- package/src/{components → containers}/Plank/PlankHeading.tsx +36 -45
- 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 +8 -8
- package/src/{components → containers}/Sidebar/SidebarButton.tsx +19 -19
- package/src/containers/index.ts +11 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useCompanions.ts +3 -3
- package/src/hooks/useDeckCompanions.ts +3 -8
- package/src/hooks/useDeckState.ts +14 -23
- package/src/hooks/useHoistStatusbar.ts +2 -2
- package/src/hooks/useMainSize.ts +2 -2
- package/src/hooks/useNodeActionExpander.ts +1 -1
- package/src/hooks/useSelectedCompanion.ts +32 -0
- package/src/layout.ts +3 -16
- package/src/meta.ts +1 -1
- 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 -54
- package/src/types/Settings.ts +26 -0
- package/src/types/capabilities.ts +9 -8
- package/src/types/events.ts +6 -5
- package/src/types/index.ts +1 -0
- package/src/types/schema.ts +35 -110
- package/src/util/index.ts +1 -0
- package/src/util/layoutAppliesTopbar.ts +1 -1
- 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 +2 -2
- package/src/vite-env.d.ts +5 -0
- package/dist/lib/browser/app-graph-builder-DTVCULQ4.mjs +0 -120
- package/dist/lib/browser/app-graph-builder-DTVCULQ4.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-JSRXXIYF.mjs +0 -32
- package/dist/lib/browser/check-app-scheme-JSRXXIYF.mjs.map +0 -7
- package/dist/lib/browser/chunk-ATFPDN6J.mjs +0 -292
- package/dist/lib/browser/chunk-ATFPDN6J.mjs.map +0 -7
- package/dist/lib/browser/chunk-NHABISX2.mjs +0 -152
- package/dist/lib/browser/chunk-NHABISX2.mjs.map +0 -7
- package/dist/lib/browser/chunk-S4A5UO4K.mjs +0 -1448
- package/dist/lib/browser/chunk-S4A5UO4K.mjs.map +0 -7
- package/dist/lib/browser/chunk-UNG4CLLP.mjs +0 -161
- package/dist/lib/browser/chunk-UNG4CLLP.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-CDYBLZJ4.mjs +0 -595
- package/dist/lib/browser/operation-resolver-CDYBLZJ4.mjs.map +0 -7
- package/dist/lib/browser/react-root-XDCMNENQ.mjs +0 -47
- package/dist/lib/browser/react-root-XDCMNENQ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-HODERLOL.mjs +0 -42
- package/dist/lib/browser/react-surface-HODERLOL.mjs.map +0 -7
- package/dist/lib/browser/settings-OMHVGZ6V.mjs +0 -37
- package/dist/lib/browser/settings-OMHVGZ6V.mjs.map +0 -7
- package/dist/lib/browser/state-OC3BSB6E.mjs +0 -103
- package/dist/lib/browser/state-OC3BSB6E.mjs.map +0 -7
- package/dist/lib/browser/toolkit-R53LD3EA.mjs +0 -53
- package/dist/lib/browser/toolkit-R53LD3EA.mjs.map +0 -7
- package/dist/lib/browser/url-handler-53TE6JZO.mjs +0 -93
- package/dist/lib/browser/url-handler-53TE6JZO.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-473BNZDJ.mjs +0 -121
- package/dist/lib/node-esm/app-graph-builder-473BNZDJ.mjs.map +0 -7
- package/dist/lib/node-esm/check-app-scheme-IVYRHKRH.mjs +0 -33
- package/dist/lib/node-esm/check-app-scheme-IVYRHKRH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ADPMWKLL.mjs +0 -154
- package/dist/lib/node-esm/chunk-ADPMWKLL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-D34L3ECT.mjs +0 -1449
- package/dist/lib/node-esm/chunk-D34L3ECT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SKEVPQ7E.mjs +0 -162
- package/dist/lib/node-esm/chunk-SKEVPQ7E.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XAKTY3EB.mjs +0 -294
- package/dist/lib/node-esm/chunk-XAKTY3EB.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-WUOE33ID.mjs +0 -596
- package/dist/lib/node-esm/operation-resolver-WUOE33ID.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-O6GZO62Z.mjs +0 -48
- package/dist/lib/node-esm/react-root-O6GZO62Z.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-IHDJDGC5.mjs +0 -43
- package/dist/lib/node-esm/react-surface-IHDJDGC5.mjs.map +0 -7
- package/dist/lib/node-esm/settings-2HB6FKIK.mjs +0 -38
- package/dist/lib/node-esm/settings-2HB6FKIK.mjs.map +0 -7
- package/dist/lib/node-esm/state-JRQ45ACJ.mjs +0 -104
- package/dist/lib/node-esm/state-JRQ45ACJ.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-JLPZNNKB.mjs +0 -54
- package/dist/lib/node-esm/toolkit-JLPZNNKB.mjs.map +0 -7
- package/dist/lib/node-esm/url-handler-QGF2R24T.mjs +0 -94
- package/dist/lib/node-esm/url-handler-QGF2R24T.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts +0 -5
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts.map +0 -1
- package/dist/types/src/capabilities/check-app-scheme/index.d.ts +0 -3
- package/dist/types/src/capabilities/check-app-scheme/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
- package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -19
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/index.d.ts +0 -172
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts +0 -3
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +0 -26
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +0 -1
- package/dist/types/src/capabilities/tools/index.d.ts +0 -3
- package/dist/types/src/capabilities/tools/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/tools/tools.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler/index.d.ts +0 -3
- package/dist/types/src/capabilities/url-handler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts +0 -5
- package/dist/types/src/capabilities/url-handler/url-handler.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.map +0 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +0 -74
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Fallback.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Popover.d.ts +0 -5
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Topbar.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/Topbar.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/constants.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/index.d.ts +0 -4
- package/dist/types/src/components/DeckLayout/index.d.ts.map +0 -1
- package/dist/types/src/components/Plank/Plank.d.ts +0 -27
- package/dist/types/src/components/Plank/Plank.d.ts.map +0 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +0 -107
- 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/fragments.d.ts +0 -4
- package/dist/types/src/components/fragments.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -118
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/check-app-scheme/check-app-scheme.ts +0 -41
- package/src/capabilities/check-app-scheme/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -10
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -555
- package/src/capabilities/react-root/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -37
- package/src/capabilities/settings/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -7
- package/src/capabilities/toolkit/index.ts +0 -7
- package/src/capabilities/toolkit/toolkit.ts +0 -63
- package/src/capabilities/tools/index.ts +0 -7
- package/src/capabilities/url-handler/index.ts +0 -7
- package/src/capabilities/url-handler/url-handler.ts +0 -95
- package/src/components/DeckLayout/ContentEmpty.tsx +0 -30
- package/src/components/DeckLayout/DeckLayout.stories.tsx +0 -51
- package/src/components/DeckLayout/DeckLayout.tsx +0 -34
- package/src/components/DeckLayout/DeckMain.tsx +0 -286
- package/src/components/DeckLayout/Fallback.tsx +0 -28
- package/src/components/DeckLayout/Topbar.tsx +0 -11
- package/src/components/Plank/Plank.stories.tsx +0 -62
- package/src/components/Plank/Plank.tsx +0 -299
- package/src/components/Plank/PlankError.tsx +0 -49
- package/src/components/Sidebar/ComplementarySidebar.tsx +0 -221
- package/src/components/fragments.ts +0 -14
- /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/DeckLayout.d.ts +0 -0
- /package/dist/types/src/{components → containers}/DeckLayout/Dialog.d.ts +0 -0
- /package/dist/types/src/{components → containers}/DeckLayout/constants.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Plank/PlankLoading.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/ComplementarySidebar.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/Sidebar.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/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/types/schema.ts
CHANGED
|
@@ -4,53 +4,39 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import { Operation } from '@dxos/operation';
|
|
7
|
+
import { Label, LayoutOperation } from '@dxos/app-toolkit';
|
|
9
8
|
import { type DeepReadonly } from '@dxos/util';
|
|
10
9
|
|
|
11
|
-
import { meta } from '
|
|
10
|
+
import { meta } from '#meta';
|
|
12
11
|
|
|
13
|
-
export
|
|
12
|
+
export * as Settings from './Settings';
|
|
14
13
|
|
|
15
|
-
export
|
|
16
|
-
export const DECK_COMPANION_TYPE = `${meta.id}/deck-companion`;
|
|
14
|
+
export { PLANK_COMPANION_TYPE, DECK_COMPANION_TYPE } from '@dxos/app-toolkit';
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
export const NewPlankPositions = ['start', 'end'] as const;
|
|
20
|
-
export type NewPlankPositioning = (typeof NewPlankPositions)[number];
|
|
21
|
-
|
|
22
|
-
export const OverscrollOptions = ['none', 'centering'] as const;
|
|
23
|
-
export type Overscroll = (typeof OverscrollOptions)[number];
|
|
24
|
-
|
|
25
|
-
export type Part = 'solo' | 'deck' | 'complementary';
|
|
16
|
+
export type Part = 'solo' | 'multi' | 'complementary';
|
|
26
17
|
export type ResolvedPart = Part | 'solo-primary' | 'solo-companion';
|
|
27
18
|
|
|
28
|
-
export const DeckSettingsSchema = Schema.Struct({
|
|
29
|
-
showHints: Schema.optional(Schema.Boolean),
|
|
30
|
-
enableDeck: Schema.optional(Schema.Boolean),
|
|
31
|
-
enableStatusbar: Schema.optional(Schema.Boolean),
|
|
32
|
-
enableNativeRedirect: Schema.optional(Schema.Boolean),
|
|
33
|
-
newPlankPositioning: Schema.optional(Schema.Literal(...NewPlankPositions)),
|
|
34
|
-
overscroll: Schema.optional(Schema.Literal(...OverscrollOptions)),
|
|
35
|
-
// TODO(burdon): Rename layoutMode? (e.g., bento | encapsulated?)
|
|
36
|
-
encapsulatedPlanks: Schema.optional(Schema.Boolean),
|
|
37
|
-
}).pipe(Schema.mutable);
|
|
38
|
-
export type DeckSettingsProps = Schema.Schema.Type<typeof DeckSettingsSchema>;
|
|
39
|
-
|
|
40
19
|
export const PlankSizing = Schema.Record({ key: Schema.String, value: Schema.Number });
|
|
41
20
|
export type PlankSizing = Schema.Schema.Type<typeof PlankSizing>;
|
|
42
21
|
|
|
43
|
-
// State of an individual deck.
|
|
44
22
|
export const DeckState = Schema.Struct({
|
|
45
23
|
/** If false, the deck has not yet left solo mode and new planks should be soloed. */
|
|
46
24
|
initialized: Schema.Boolean,
|
|
25
|
+
/** Item IDs of planks currently displayed in multi-mode. */
|
|
47
26
|
active: Schema.mutable(Schema.Array(Schema.String)),
|
|
48
|
-
|
|
49
|
-
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. */
|
|
50
28
|
inactive: Schema.mutable(Schema.Array(Schema.String)),
|
|
29
|
+
/** Item ID of the single plank displayed in solo or fullscreen mode. */
|
|
51
30
|
solo: Schema.optional(Schema.String),
|
|
31
|
+
/** Whether the solo plank is displayed in fullscreen mode (no heading or sidebars). */
|
|
52
32
|
fullscreen: Schema.Boolean,
|
|
33
|
+
/** Persisted plank widths in rem, keyed by item ID. */
|
|
53
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. */
|
|
54
40
|
companionFrameSizing: Schema.mutable(PlankSizing),
|
|
55
41
|
});
|
|
56
42
|
export type DeckState = Schema.Schema.Type<typeof DeckState>;
|
|
@@ -58,28 +44,32 @@ export type DeckState = Schema.Schema.Type<typeof DeckState>;
|
|
|
58
44
|
export const defaultDeck: DeckState = {
|
|
59
45
|
initialized: false,
|
|
60
46
|
active: [],
|
|
61
|
-
activeCompanions: {},
|
|
62
47
|
inactive: [],
|
|
63
48
|
solo: undefined,
|
|
64
49
|
fullscreen: false,
|
|
65
50
|
plankSizing: {},
|
|
51
|
+
companionOpen: false,
|
|
52
|
+
companionVariant: undefined,
|
|
66
53
|
companionFrameSizing: {},
|
|
67
54
|
};
|
|
68
55
|
|
|
69
|
-
|
|
56
|
+
//
|
|
57
|
+
// Layout
|
|
58
|
+
//
|
|
59
|
+
|
|
60
|
+
const LayoutMode = Schema.Literal('multi', 'solo', 'solo--fullscreen');
|
|
70
61
|
export type LayoutMode = Schema.Schema.Type<typeof LayoutMode>;
|
|
71
62
|
export const isLayoutMode = (value: any): value is LayoutMode => Schema.is(LayoutMode)(value);
|
|
72
|
-
|
|
73
63
|
export const getMode = (deck: DeckState | DeepReadonly<DeckState>): LayoutMode => {
|
|
74
64
|
if (deck.solo) {
|
|
75
65
|
return deck.fullscreen ? 'solo--fullscreen' : 'solo';
|
|
76
66
|
}
|
|
77
67
|
|
|
78
|
-
return '
|
|
68
|
+
return 'multi';
|
|
79
69
|
};
|
|
80
70
|
|
|
81
71
|
// Persisted plugin state (stored in KVS/localStorage).
|
|
82
|
-
export const
|
|
72
|
+
export const StoredDeckState = Schema.Struct({
|
|
83
73
|
sidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),
|
|
84
74
|
complementarySidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),
|
|
85
75
|
complementarySidebarPanel: Schema.optional(Schema.String),
|
|
@@ -88,10 +78,10 @@ export const DeckStateSchema = Schema.Struct({
|
|
|
88
78
|
decks: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(DeckState) })),
|
|
89
79
|
previousMode: Schema.mutable(Schema.Record({ key: Schema.String, value: LayoutMode })),
|
|
90
80
|
}).pipe(Schema.mutable);
|
|
91
|
-
export type
|
|
81
|
+
export type StoredDeckState = Schema.Schema.Type<typeof StoredDeckState>;
|
|
92
82
|
|
|
93
83
|
// Transient/ephemeral plugin state (not persisted).
|
|
94
|
-
export const
|
|
84
|
+
export const EphemeralDeckState = Schema.Struct({
|
|
95
85
|
dialogOpen: Schema.Boolean,
|
|
96
86
|
dialogType: Schema.optional(Schema.Literal('default', 'alert')),
|
|
97
87
|
dialogBlockAlign: Schema.optional(Schema.Literal('start', 'center', 'end')),
|
|
@@ -99,26 +89,25 @@ export const DeckEphemeralStateSchema = Schema.Struct({
|
|
|
99
89
|
dialogOverlayStyle: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),
|
|
100
90
|
/** Data to be passed to the dialog Surface. */
|
|
101
91
|
dialogContent: Schema.optional(Schema.Any),
|
|
102
|
-
|
|
103
92
|
popoverOpen: Schema.Boolean,
|
|
104
93
|
popoverSide: Schema.optional(Schema.Literal('top', 'right', 'bottom', 'left')),
|
|
105
94
|
popoverAnchor: Schema.optional(Schema.Any),
|
|
106
95
|
popoverAnchorId: Schema.optional(Schema.String),
|
|
107
96
|
popoverKind: Schema.optional(Schema.Literal('base', 'card')),
|
|
108
|
-
popoverTitle: Schema.optional(
|
|
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),
|
|
109
100
|
/** Data to be passed to the popover Surface. */
|
|
110
101
|
popoverContent: Schema.optional(Schema.Any),
|
|
111
|
-
|
|
112
|
-
toasts: Schema.mutable(Schema.Array(Common.LayoutOperation.Toast)),
|
|
102
|
+
toasts: Schema.mutable(Schema.Array(LayoutOperation.Toast)),
|
|
113
103
|
currentUndoId: Schema.optional(Schema.String),
|
|
114
|
-
|
|
115
104
|
/** The identifier of a component to scroll into view when it is mounted. */
|
|
116
105
|
scrollIntoView: Schema.optional(Schema.String),
|
|
117
106
|
}).pipe(Schema.mutable);
|
|
118
|
-
export type
|
|
107
|
+
export type EphemeralDeckState = Schema.Schema.Type<typeof EphemeralDeckState>;
|
|
119
108
|
|
|
120
109
|
// Combined state type (for convenience in components that need both).
|
|
121
|
-
export type DeckPluginState =
|
|
110
|
+
export type DeckPluginState = StoredDeckState & EphemeralDeckState;
|
|
122
111
|
|
|
123
112
|
export namespace DeckAction {
|
|
124
113
|
const PartAdjustmentSchema = Schema.Union(
|
|
@@ -134,12 +123,12 @@ export namespace DeckAction {
|
|
|
134
123
|
export type Adjustment = Schema.Schema.Type<typeof Adjustment>;
|
|
135
124
|
|
|
136
125
|
// An atomic transaction to apply to the deck, describing which element to move to which location.
|
|
137
|
-
export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}
|
|
126
|
+
export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}.action.adjust`, {
|
|
138
127
|
input: Adjustment,
|
|
139
128
|
output: Schema.Void,
|
|
140
129
|
}) {}
|
|
141
130
|
|
|
142
|
-
export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}
|
|
131
|
+
export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}.action.update-plank-size`, {
|
|
143
132
|
input: Schema.Struct({
|
|
144
133
|
id: Schema.String,
|
|
145
134
|
size: Schema.Number,
|
|
@@ -147,74 +136,10 @@ export namespace DeckAction {
|
|
|
147
136
|
output: Schema.Void,
|
|
148
137
|
}) {}
|
|
149
138
|
|
|
150
|
-
export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${meta.id}
|
|
139
|
+
export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${meta.id}.action.change-companion`, {
|
|
151
140
|
input: Schema.Struct({
|
|
152
|
-
primary: Schema.String,
|
|
153
141
|
companion: Schema.Union(Schema.String, Schema.Null),
|
|
154
142
|
}),
|
|
155
143
|
output: Schema.Void,
|
|
156
144
|
}) {}
|
|
157
145
|
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Operations for the Deck plugin.
|
|
161
|
-
*/
|
|
162
|
-
export namespace DeckOperation {
|
|
163
|
-
const PartAdjustmentSchema = Schema.Union(
|
|
164
|
-
Schema.Literal('close').annotations({ description: 'Close the plank.' }),
|
|
165
|
-
Schema.Literal('companion').annotations({ description: 'Open the companion plank.' }),
|
|
166
|
-
Schema.Literal('solo').annotations({ description: 'Solo the plank.' }),
|
|
167
|
-
Schema.Literal('solo--fullscreen').annotations({ description: 'Fullscreen the plank.' }),
|
|
168
|
-
Schema.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),
|
|
169
|
-
Schema.Literal('increment-end').annotations({ description: 'Move the plank towards the end of the deck.' }),
|
|
170
|
-
);
|
|
171
|
-
export type PartAdjustment = Schema.Schema.Type<typeof PartAdjustmentSchema>;
|
|
172
|
-
|
|
173
|
-
export const Adjust = Operation.make({
|
|
174
|
-
meta: {
|
|
175
|
-
key: `${meta.id}/operation/adjust`,
|
|
176
|
-
name: 'Adjust',
|
|
177
|
-
description: 'Adjust the layout of a plank.',
|
|
178
|
-
},
|
|
179
|
-
services: [Capability.Service],
|
|
180
|
-
schema: {
|
|
181
|
-
input: Schema.Struct({
|
|
182
|
-
id: Schema.String.annotations({ description: 'The id of the plank to adjust.' }),
|
|
183
|
-
type: PartAdjustmentSchema.annotations({ description: 'The type of adjustment to make.' }),
|
|
184
|
-
}),
|
|
185
|
-
output: Schema.Void,
|
|
186
|
-
},
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
export const UpdatePlankSize = Operation.make({
|
|
190
|
-
meta: {
|
|
191
|
-
key: `${meta.id}/operation/update-plank-size`,
|
|
192
|
-
name: 'Update Plank Size',
|
|
193
|
-
description: 'Update the size of a plank.',
|
|
194
|
-
},
|
|
195
|
-
services: [Capability.Service],
|
|
196
|
-
schema: {
|
|
197
|
-
input: Schema.Struct({
|
|
198
|
-
id: Schema.String.annotations({ description: 'The id of the plank to resize.' }),
|
|
199
|
-
size: Schema.Number.annotations({ description: 'The new size of the plank.' }),
|
|
200
|
-
}),
|
|
201
|
-
output: Schema.Void,
|
|
202
|
-
},
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
export const ChangeCompanion = Operation.make({
|
|
206
|
-
meta: {
|
|
207
|
-
key: `${meta.id}/operation/change-companion`,
|
|
208
|
-
name: 'Change Companion',
|
|
209
|
-
description: 'Change the companion plank for a primary plank.',
|
|
210
|
-
},
|
|
211
|
-
services: [Capability.Service],
|
|
212
|
-
schema: {
|
|
213
|
-
input: Schema.Struct({
|
|
214
|
-
primary: Schema.String,
|
|
215
|
-
companion: Schema.Union(Schema.String, Schema.Null),
|
|
216
|
-
}),
|
|
217
|
-
output: Schema.Void,
|
|
218
|
-
},
|
|
219
|
-
});
|
|
220
|
-
}
|
package/src/util/index.ts
CHANGED
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
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { defaultDeck, type DeckState } from '#types';
|
|
8
|
+
|
|
9
|
+
import { computeActiveUpdates } from './set-active';
|
|
10
|
+
|
|
11
|
+
const makeDeck = (overrides: Partial<DeckState> = {}): DeckState => ({
|
|
12
|
+
...defaultDeck,
|
|
13
|
+
...overrides,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
describe('computeActiveUpdates', () => {
|
|
17
|
+
describe('routing to solo vs active', () => {
|
|
18
|
+
test('routes to solo when initialized is false and solo is undefined', ({ expect }) => {
|
|
19
|
+
const deck = makeDeck({ initialized: false });
|
|
20
|
+
const { deckUpdates } = computeActiveUpdates({ next: ['item1'], deck });
|
|
21
|
+
expect(deckUpdates.solo).toBe('item1');
|
|
22
|
+
expect(deckUpdates.active).toEqual([]);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('routes to solo when solo is set (regardless of initialized)', ({ expect }) => {
|
|
26
|
+
const deck = makeDeck({ solo: 'current', initialized: true });
|
|
27
|
+
const { deckUpdates } = computeActiveUpdates({ next: ['item1'], deck });
|
|
28
|
+
expect(deckUpdates.solo).toBe('item1');
|
|
29
|
+
expect(deckUpdates.active).toEqual([]);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test('routes to active when initialized is true and solo is undefined', ({ expect }) => {
|
|
33
|
+
const deck = makeDeck({ initialized: true });
|
|
34
|
+
const { deckUpdates } = computeActiveUpdates({ next: ['item1', 'item2'], deck });
|
|
35
|
+
expect(deckUpdates.solo).toBeUndefined();
|
|
36
|
+
expect(deckUpdates.active).toEqual(['item1', 'item2']);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
describe('active preservation', () => {
|
|
41
|
+
test('preserves active unchanged when routing to solo', ({ expect }) => {
|
|
42
|
+
const deck = makeDeck({ solo: 'current', active: ['a', 'b', 'c'], initialized: true });
|
|
43
|
+
const { deckUpdates } = computeActiveUpdates({ next: ['item1'], deck });
|
|
44
|
+
expect(deckUpdates.solo).toBe('item1');
|
|
45
|
+
expect(deckUpdates.active).toEqual(['a', 'b', 'c']);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test('preserves active when initialized is false', ({ expect }) => {
|
|
49
|
+
const deck = makeDeck({ initialized: false, active: ['stale'] });
|
|
50
|
+
const { deckUpdates } = computeActiveUpdates({ next: ['item1'], deck });
|
|
51
|
+
expect(deckUpdates.solo).toBe('item1');
|
|
52
|
+
expect(deckUpdates.active).toEqual(['stale']);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
describe('inactive handling', () => {
|
|
57
|
+
test('moves removed items to inactive', ({ expect }) => {
|
|
58
|
+
const deck = makeDeck({ initialized: true, active: ['a', 'b', 'c'] });
|
|
59
|
+
const { deckUpdates } = computeActiveUpdates({ next: ['a', 'c'], deck });
|
|
60
|
+
expect(deckUpdates.active).toEqual(['a', 'c']);
|
|
61
|
+
expect(deckUpdates.inactive).toContain('b');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test('moves displaced solo item to inactive', ({ expect }) => {
|
|
65
|
+
const deck = makeDeck({ solo: 'old', initialized: true });
|
|
66
|
+
const { deckUpdates } = computeActiveUpdates({ next: ['new'], deck });
|
|
67
|
+
expect(deckUpdates.solo).toBe('new');
|
|
68
|
+
expect(deckUpdates.inactive).toContain('old');
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('does not duplicate items already in inactive', ({ expect }) => {
|
|
72
|
+
const deck = makeDeck({ solo: 'old', initialized: true, inactive: ['old'] });
|
|
73
|
+
const { deckUpdates } = computeActiveUpdates({ next: ['new'], deck });
|
|
74
|
+
const oldCount = deckUpdates.inactive.filter((id) => id === 'old').length;
|
|
75
|
+
expect(oldCount).toBe(1);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
describe('fullscreen', () => {
|
|
80
|
+
test('clears fullscreen when solo is cleared', ({ expect }) => {
|
|
81
|
+
const deck = makeDeck({ solo: 'item', fullscreen: true, initialized: true });
|
|
82
|
+
const { deckUpdates } = computeActiveUpdates({ next: [], deck });
|
|
83
|
+
expect(deckUpdates.fullscreen).toBe(false);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test('preserves fullscreen when solo is set', ({ expect }) => {
|
|
87
|
+
const deck = makeDeck({ solo: 'old', fullscreen: true, initialized: true });
|
|
88
|
+
const { deckUpdates } = computeActiveUpdates({ next: ['new'], deck });
|
|
89
|
+
expect(deckUpdates.fullscreen).toBe(true);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
describe('empty next', () => {
|
|
94
|
+
test('clears solo when next is empty and in solo mode', ({ expect }) => {
|
|
95
|
+
const deck = makeDeck({ solo: 'item', initialized: false });
|
|
96
|
+
const { deckUpdates } = computeActiveUpdates({ next: [], deck });
|
|
97
|
+
expect(deckUpdates.solo).toBeUndefined();
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
test('clears active when next is empty and in deck mode', ({ expect }) => {
|
|
101
|
+
const deck = makeDeck({ initialized: true, active: ['a', 'b'] });
|
|
102
|
+
const { deckUpdates } = computeActiveUpdates({ next: [], deck });
|
|
103
|
+
expect(deckUpdates.active).toEqual([]);
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
});
|
package/src/util/set-active.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type AttentionManager } from '@dxos/
|
|
5
|
+
import { type AttentionManager } from '@dxos/react-ui-attention';
|
|
6
6
|
|
|
7
|
-
import { type DeckState } from '
|
|
7
|
+
import { type DeckState } from '#types';
|
|
8
8
|
|
|
9
9
|
export type SetActiveOptions = {
|
|
10
10
|
next: string[];
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DeckCapabilities,
|
|
3
|
-
meta
|
|
4
|
-
} from "./chunk-ATFPDN6J.mjs";
|
|
5
|
-
|
|
6
|
-
// src/capabilities/app-graph-builder/app-graph-builder.ts
|
|
7
|
-
import * as Effect from "effect/Effect";
|
|
8
|
-
import { Capability, Common } from "@dxos/app-framework";
|
|
9
|
-
import { Operation } from "@dxos/operation";
|
|
10
|
-
import { AttentionCapabilities } from "@dxos/plugin-attention";
|
|
11
|
-
import { GraphBuilder, NodeMatcher } from "@dxos/plugin-graph";
|
|
12
|
-
var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
13
|
-
const extensions = yield* GraphBuilder.createExtension({
|
|
14
|
-
id: meta.id,
|
|
15
|
-
match: NodeMatcher.whenRoot,
|
|
16
|
-
actions: (_node, get) => Effect.gen(function* () {
|
|
17
|
-
const closeCurrent = {
|
|
18
|
-
id: `${Common.LayoutOperation.Close.meta.key}/current`,
|
|
19
|
-
data: Effect.fnUntraced(function* () {
|
|
20
|
-
const attention = yield* Capability.get(AttentionCapabilities.Attention);
|
|
21
|
-
const attended = attention.getCurrent().at(-1);
|
|
22
|
-
if (attended) {
|
|
23
|
-
yield* Operation.invoke(Common.LayoutOperation.Close, {
|
|
24
|
-
subject: [
|
|
25
|
-
attended
|
|
26
|
-
]
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
}),
|
|
30
|
-
properties: {
|
|
31
|
-
label: [
|
|
32
|
-
"close current label",
|
|
33
|
-
{
|
|
34
|
-
ns: meta.id
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
icon: "ph--x--regular"
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
const closeOthers = {
|
|
41
|
-
id: `${Common.LayoutOperation.Close.meta.key}/others`,
|
|
42
|
-
data: Effect.fnUntraced(function* () {
|
|
43
|
-
const attention = yield* Capability.get(AttentionCapabilities.Attention);
|
|
44
|
-
const deck2 = yield* DeckCapabilities.getDeck();
|
|
45
|
-
const attended = attention.getCurrent().at(-1);
|
|
46
|
-
const ids = deck2.active.filter((id) => id !== attended) ?? [];
|
|
47
|
-
yield* Operation.invoke(Common.LayoutOperation.Close, {
|
|
48
|
-
subject: ids
|
|
49
|
-
});
|
|
50
|
-
}),
|
|
51
|
-
properties: {
|
|
52
|
-
label: [
|
|
53
|
-
"close others label",
|
|
54
|
-
{
|
|
55
|
-
ns: meta.id
|
|
56
|
-
}
|
|
57
|
-
],
|
|
58
|
-
icon: "ph--x-square--regular"
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
const closeAll = {
|
|
62
|
-
id: `${Common.LayoutOperation.Close.meta.key}/all`,
|
|
63
|
-
data: Effect.fnUntraced(function* () {
|
|
64
|
-
const deck2 = yield* DeckCapabilities.getDeck();
|
|
65
|
-
yield* Operation.invoke(Common.LayoutOperation.Close, {
|
|
66
|
-
subject: deck2.active
|
|
67
|
-
});
|
|
68
|
-
}),
|
|
69
|
-
properties: {
|
|
70
|
-
label: [
|
|
71
|
-
"close all label",
|
|
72
|
-
{
|
|
73
|
-
ns: meta.id
|
|
74
|
-
}
|
|
75
|
-
],
|
|
76
|
-
icon: "ph--x-circle--regular"
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
const state = get(yield* Capability.get(DeckCapabilities.State));
|
|
80
|
-
const deck = state.decks[state.activeDeck];
|
|
81
|
-
const toggleSidebar = {
|
|
82
|
-
id: `${Common.LayoutOperation.UpdateSidebar.meta.key}/nav`,
|
|
83
|
-
data: Effect.fnUntraced(function* () {
|
|
84
|
-
yield* Common.Capability.updateAtomValue(DeckCapabilities.State, (s) => ({
|
|
85
|
-
...s,
|
|
86
|
-
sidebarState: s.sidebarState === "expanded" ? "collapsed" : "expanded"
|
|
87
|
-
}));
|
|
88
|
-
}),
|
|
89
|
-
properties: {
|
|
90
|
-
label: [
|
|
91
|
-
state.sidebarState === "expanded" ? "collapse navigation sidebar label" : "open navigation sidebar label",
|
|
92
|
-
{
|
|
93
|
-
ns: meta.id
|
|
94
|
-
}
|
|
95
|
-
],
|
|
96
|
-
icon: "ph--sidebar--regular",
|
|
97
|
-
keyBinding: {
|
|
98
|
-
macos: "meta+'"
|
|
99
|
-
},
|
|
100
|
-
disposition: "pin-end",
|
|
101
|
-
position: "hoist",
|
|
102
|
-
l0Breakpoint: "lg"
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
return !deck?.solo ? [
|
|
106
|
-
closeCurrent,
|
|
107
|
-
closeOthers,
|
|
108
|
-
closeAll,
|
|
109
|
-
toggleSidebar
|
|
110
|
-
] : [
|
|
111
|
-
toggleSidebar
|
|
112
|
-
];
|
|
113
|
-
})
|
|
114
|
-
});
|
|
115
|
-
return Capability.contributes(Common.Capability.AppGraphBuilder, extensions);
|
|
116
|
-
}));
|
|
117
|
-
export {
|
|
118
|
-
app_graph_builder_default as default
|
|
119
|
-
};
|
|
120
|
-
//# sourceMappingURL=app-graph-builder-DTVCULQ4.mjs.map
|