@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
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
8
|
+
|
|
9
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
10
|
+
import { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
|
|
11
|
+
import { Operation } from '@dxos/operation';
|
|
12
|
+
import { AttentionCapabilities } from '@dxos/plugin-attention/types';
|
|
13
|
+
import { Graph } from '@dxos/plugin-graph';
|
|
14
|
+
import { byPosition } from '@dxos/util';
|
|
15
|
+
|
|
16
|
+
import { Adjust, ChangeCompanion } from './definitions';
|
|
17
|
+
import { updateActiveDeck } from './helpers';
|
|
18
|
+
import { incrementPlank } from '../layout';
|
|
19
|
+
import { DeckCapabilities, PLANK_COMPANION_TYPE } from '../types';
|
|
20
|
+
import { computeActiveUpdates } from '../util';
|
|
21
|
+
|
|
22
|
+
const handler: Operation.WithHandler<typeof Adjust> = Adjust.pipe(
|
|
23
|
+
Operation.withHandler(
|
|
24
|
+
Effect.fnUntraced(function* (input) {
|
|
25
|
+
const _state = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
26
|
+
const deck = yield* DeckCapabilities.getDeck();
|
|
27
|
+
const attention = yield* Capability.get(AttentionCapabilities.Attention);
|
|
28
|
+
const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
|
|
29
|
+
|
|
30
|
+
let soloOperation:
|
|
31
|
+
| { type: 'solo'; entryId: string; mode: string }
|
|
32
|
+
| { type: 'unsolo'; entryId: string }
|
|
33
|
+
| undefined;
|
|
34
|
+
|
|
35
|
+
if (input.type === 'increment-end' || input.type === 'increment-start') {
|
|
36
|
+
const next = incrementPlank(deck.active, input);
|
|
37
|
+
const { deckUpdates } = computeActiveUpdates({ next, deck, attention });
|
|
38
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, deckUpdates));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (input.type.startsWith('solo')) {
|
|
42
|
+
const entryId = input.id;
|
|
43
|
+
if (!deck.solo) {
|
|
44
|
+
soloOperation = { type: 'solo', entryId, mode: input.type };
|
|
45
|
+
} else {
|
|
46
|
+
if (input.type === 'solo--fullscreen') {
|
|
47
|
+
soloOperation = { type: 'solo', entryId, mode: 'solo--fullscreen' };
|
|
48
|
+
} else if (input.type === 'solo') {
|
|
49
|
+
soloOperation = { type: 'unsolo', entryId };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (soloOperation?.type === 'solo') {
|
|
55
|
+
yield* Operation.invoke(LayoutOperation.SetLayoutMode, {
|
|
56
|
+
subject: soloOperation.entryId,
|
|
57
|
+
mode: soloOperation.mode,
|
|
58
|
+
});
|
|
59
|
+
} else if (soloOperation?.type === 'unsolo') {
|
|
60
|
+
yield* Operation.invoke(LayoutOperation.SetLayoutMode, { mode: 'multi' });
|
|
61
|
+
yield* Operation.invoke(LayoutOperation.Open, { subject: [soloOperation.entryId] });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (input.type === 'companion') {
|
|
65
|
+
const companion = Function.pipe(
|
|
66
|
+
Graph.getNode(graph, input.id),
|
|
67
|
+
Option.map((node) =>
|
|
68
|
+
Graph.getConnections(graph, node.id, 'child')
|
|
69
|
+
.filter((n) => n.type === PLANK_COMPANION_TYPE)
|
|
70
|
+
.toSorted((a, b) => byPosition(a.properties, b.properties)),
|
|
71
|
+
),
|
|
72
|
+
Option.flatMap((companions) => (companions.length > 0 ? Option.some(companions[0]) : Option.none())),
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
if (Option.isSome(companion)) {
|
|
76
|
+
yield* Operation.invoke(ChangeCompanion, { companion: companion.value.id });
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}),
|
|
80
|
+
),
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
export default handler;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities } from '@dxos/app-framework';
|
|
8
|
+
import { getLinkedVariant } from '@dxos/react-ui-attention';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
10
|
+
|
|
11
|
+
import { ChangeCompanion } from './definitions';
|
|
12
|
+
import { updateActiveDeck } from './helpers';
|
|
13
|
+
import { DeckCapabilities } from '../types';
|
|
14
|
+
|
|
15
|
+
const handler: Operation.WithHandler<typeof ChangeCompanion> = ChangeCompanion.pipe(
|
|
16
|
+
Operation.withHandler(
|
|
17
|
+
Effect.fnUntraced(function* (input) {
|
|
18
|
+
if (input.companion === null) {
|
|
19
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) =>
|
|
20
|
+
updateActiveDeck(state, { companionOpen: false }),
|
|
21
|
+
);
|
|
22
|
+
} else {
|
|
23
|
+
const variant = getLinkedVariant(input.companion);
|
|
24
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) =>
|
|
25
|
+
updateActiveDeck(state, {
|
|
26
|
+
companionOpen: true,
|
|
27
|
+
companionVariant: variant,
|
|
28
|
+
}),
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export default handler;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
10
|
+
import { AttentionCapabilities } from '@dxos/plugin-attention/types';
|
|
11
|
+
|
|
12
|
+
import { updateActiveDeck } from './helpers';
|
|
13
|
+
import { closeEntry } from '../layout';
|
|
14
|
+
import { DeckCapabilities } from '../types';
|
|
15
|
+
import { computeActiveUpdates } from '../util';
|
|
16
|
+
|
|
17
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.Close> = LayoutOperation.Close.pipe(
|
|
18
|
+
Operation.withHandler(
|
|
19
|
+
Effect.fnUntraced(function* (input) {
|
|
20
|
+
const deck = yield* DeckCapabilities.getDeck();
|
|
21
|
+
const attention = yield* Capability.get(AttentionCapabilities.Attention);
|
|
22
|
+
|
|
23
|
+
const active = deck.solo ? [deck.solo] : deck.active;
|
|
24
|
+
const next = input.subject.reduce((acc, id) => closeEntry(acc, id), active);
|
|
25
|
+
const { deckUpdates, toAttend } = computeActiveUpdates({ next, deck, attention });
|
|
26
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, deckUpdates));
|
|
27
|
+
|
|
28
|
+
if (toAttend) {
|
|
29
|
+
yield* Operation.schedule(LayoutOperation.ScrollIntoView, { subject: toAttend });
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export default handler;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/operation';
|
|
9
|
+
|
|
10
|
+
import { meta } from '#meta';
|
|
11
|
+
|
|
12
|
+
const PartAdjustmentSchema = Schema.Union(
|
|
13
|
+
Schema.Literal('close').annotations({ description: 'Close the plank.' }),
|
|
14
|
+
Schema.Literal('companion').annotations({ description: 'Open the companion plank.' }),
|
|
15
|
+
Schema.Literal('solo').annotations({ description: 'Solo the plank.' }),
|
|
16
|
+
Schema.Literal('solo--fullscreen').annotations({ description: 'Fullscreen the plank.' }),
|
|
17
|
+
Schema.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),
|
|
18
|
+
Schema.Literal('increment-end').annotations({ description: 'Move the plank towards the end of the deck.' }),
|
|
19
|
+
);
|
|
20
|
+
export type PartAdjustment = Schema.Schema.Type<typeof PartAdjustmentSchema>;
|
|
21
|
+
|
|
22
|
+
export const Adjust = Operation.make({
|
|
23
|
+
meta: {
|
|
24
|
+
key: `${meta.id}.operation.adjust`,
|
|
25
|
+
name: 'Adjust',
|
|
26
|
+
description: 'Adjust the layout of a plank.',
|
|
27
|
+
},
|
|
28
|
+
services: [Capability.Service],
|
|
29
|
+
input: Schema.Struct({
|
|
30
|
+
id: Schema.String.annotations({ description: 'The id of the plank to adjust.' }),
|
|
31
|
+
type: PartAdjustmentSchema.annotations({ description: 'The type of adjustment to make.' }),
|
|
32
|
+
}),
|
|
33
|
+
output: Schema.Void,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const UpdatePlankSize = Operation.make({
|
|
37
|
+
meta: {
|
|
38
|
+
key: `${meta.id}.operation.update-plank-size`,
|
|
39
|
+
name: 'Update Plank Size',
|
|
40
|
+
description: 'Update the size of a plank.',
|
|
41
|
+
},
|
|
42
|
+
services: [Capability.Service],
|
|
43
|
+
input: Schema.Struct({
|
|
44
|
+
id: Schema.String.annotations({ description: 'The id of the plank to resize.' }),
|
|
45
|
+
size: Schema.Number.annotations({ description: 'The new size of the plank.' }),
|
|
46
|
+
}),
|
|
47
|
+
output: Schema.Void,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const ChangeCompanion = Operation.make({
|
|
51
|
+
meta: {
|
|
52
|
+
key: `${meta.id}.operation.change-companion`,
|
|
53
|
+
name: 'Change Companion',
|
|
54
|
+
description: 'Change the companion plank for a primary plank.',
|
|
55
|
+
},
|
|
56
|
+
services: [Capability.Service],
|
|
57
|
+
input: Schema.Struct({
|
|
58
|
+
companion: Schema.Union(Schema.String, Schema.Null),
|
|
59
|
+
}),
|
|
60
|
+
output: Schema.Void,
|
|
61
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { invariant } from '@dxos/invariant';
|
|
6
|
+
|
|
7
|
+
import { type DeckState, type StoredDeckState } from '../types';
|
|
8
|
+
|
|
9
|
+
export const updateActiveDeck = (current: StoredDeckState, deckUpdates: Partial<DeckState>): StoredDeckState => {
|
|
10
|
+
const currentDeck = current.decks[current.activeDeck];
|
|
11
|
+
invariant(currentDeck, `Deck not found: ${current.activeDeck}`);
|
|
12
|
+
return {
|
|
13
|
+
...current,
|
|
14
|
+
decks: {
|
|
15
|
+
...current.decks,
|
|
16
|
+
[current.activeDeck]: {
|
|
17
|
+
...currentDeck,
|
|
18
|
+
...deckUpdates,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
6
|
+
|
|
7
|
+
export * as DeckOperation from './definitions';
|
|
8
|
+
|
|
9
|
+
export const DeckOperationHandlerSet = OperationHandlerSet.lazy(
|
|
10
|
+
() => import('./add-toast'),
|
|
11
|
+
() => import('./adjust'),
|
|
12
|
+
() => import('./change-companion'),
|
|
13
|
+
() => import('./close'),
|
|
14
|
+
() => import('./open'),
|
|
15
|
+
() => import('./revert-workspace'),
|
|
16
|
+
() => import('./scroll-into-view'),
|
|
17
|
+
() => import('./set'),
|
|
18
|
+
() => import('./set-layout-mode'),
|
|
19
|
+
() => import('./show-undo'),
|
|
20
|
+
() => import('./switch-workspace'),
|
|
21
|
+
() => import('./update-complementary'),
|
|
22
|
+
() => import('./update-dialog'),
|
|
23
|
+
() => import('./update-plank-size'),
|
|
24
|
+
() => import('./update-popover'),
|
|
25
|
+
() => import('./update-sidebar'),
|
|
26
|
+
);
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Option from 'effect/Option';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import {
|
|
10
|
+
AppCapabilities,
|
|
11
|
+
LayoutOperation,
|
|
12
|
+
createEdgeExistenceChecker,
|
|
13
|
+
validateNavigationTarget,
|
|
14
|
+
} from '@dxos/app-toolkit';
|
|
15
|
+
import { Context } from '@dxos/context';
|
|
16
|
+
import { Obj } from '@dxos/echo';
|
|
17
|
+
import { Operation } from '@dxos/operation';
|
|
18
|
+
import { AttentionCapabilities } from '@dxos/plugin-attention/types';
|
|
19
|
+
import { ClientCapabilities } from '@dxos/plugin-client/types';
|
|
20
|
+
import { Graph } from '@dxos/plugin-graph';
|
|
21
|
+
import { ObservabilityOperation } from '@dxos/plugin-observability/operations';
|
|
22
|
+
|
|
23
|
+
import { updateActiveDeck } from './helpers';
|
|
24
|
+
import { openEntry } from '../layout';
|
|
25
|
+
import { DeckCapabilities } from '../types';
|
|
26
|
+
import { computeActiveUpdates } from '../util';
|
|
27
|
+
|
|
28
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.Open> = LayoutOperation.Open.pipe(
|
|
29
|
+
Operation.withHandler(
|
|
30
|
+
Effect.fnUntraced(function* (input) {
|
|
31
|
+
const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
|
|
32
|
+
const attention = yield* Capability.get(AttentionCapabilities.Attention);
|
|
33
|
+
const settings = yield* Capabilities.getAtomValue(DeckCapabilities.Settings);
|
|
34
|
+
|
|
35
|
+
// Validate navigation targets, redirecting to 404 if not found.
|
|
36
|
+
const capabilities = yield* Capability.Service;
|
|
37
|
+
const pathResolvers = capabilities.getAll(AppCapabilities.NavigationPathResolver);
|
|
38
|
+
const checkRemoteExistence = yield* Capability.get(ClientCapabilities.Client).pipe(
|
|
39
|
+
Effect.map((client) =>
|
|
40
|
+
createEdgeExistenceChecker((spaceId, body) => client.edge.http.execQuery(new Context(), spaceId, body)),
|
|
41
|
+
),
|
|
42
|
+
Effect.catchAll(() => Effect.succeed(undefined)),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const validatedSubjects = yield* Effect.all(
|
|
46
|
+
input.subject.map((subjectId) =>
|
|
47
|
+
input.navigation === 'immediate'
|
|
48
|
+
? Effect.succeed(subjectId)
|
|
49
|
+
: validateNavigationTarget({ graph, subjectId, pathResolvers, checkRemoteExistence }),
|
|
50
|
+
),
|
|
51
|
+
);
|
|
52
|
+
input = { ...input, subject: validatedSubjects };
|
|
53
|
+
|
|
54
|
+
{
|
|
55
|
+
const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
56
|
+
if (input.workspace && state.activeDeck !== input.workspace) {
|
|
57
|
+
yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: input.workspace });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
let previouslyOpenIds: Set<string>;
|
|
62
|
+
{
|
|
63
|
+
const deck = yield* DeckCapabilities.getDeck();
|
|
64
|
+
previouslyOpenIds = new Set<string>(deck.solo ? [deck.solo] : deck.active);
|
|
65
|
+
const next =
|
|
66
|
+
deck.solo || !deck.initialized
|
|
67
|
+
? [...input.subject]
|
|
68
|
+
: input.subject.reduce(
|
|
69
|
+
(acc, entryId) =>
|
|
70
|
+
openEntry(acc, entryId, {
|
|
71
|
+
key: input.key,
|
|
72
|
+
positioning: input.positioning ?? settings?.newPlankPositioning,
|
|
73
|
+
pivotId: input.pivotId,
|
|
74
|
+
}),
|
|
75
|
+
deck.active,
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
const { deckUpdates, toAttend: _toAttend } = computeActiveUpdates({ next, deck, attention });
|
|
79
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, deckUpdates));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
{
|
|
83
|
+
const deck = yield* DeckCapabilities.getDeck();
|
|
84
|
+
const ids = deck.solo ? [deck.solo] : deck.active;
|
|
85
|
+
const newlyOpen = ids.filter((i: string) => !previouslyOpenIds.has(i));
|
|
86
|
+
|
|
87
|
+
if (input.scrollIntoView !== false && (newlyOpen[0] ?? input.subject[0])) {
|
|
88
|
+
yield* Operation.schedule(LayoutOperation.ScrollIntoView, {
|
|
89
|
+
subject: newlyOpen[0] ?? input.subject[0],
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (newlyOpen[0] ?? input.subject[0]) {
|
|
94
|
+
yield* Operation.schedule(LayoutOperation.Expose, { subject: newlyOpen[0] ?? input.subject[0] });
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
for (const subjectId of newlyOpen) {
|
|
98
|
+
const typename = Option.match(Graph.getNode(graph, subjectId), {
|
|
99
|
+
onNone: () => undefined,
|
|
100
|
+
onSome: (node) => {
|
|
101
|
+
const active = node.data;
|
|
102
|
+
return Obj.isObject(active) ? Obj.getTypename(active) : undefined;
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
yield* Operation.schedule(ObservabilityOperation.SendEvent, {
|
|
106
|
+
name: 'navigation.activate',
|
|
107
|
+
properties: { subjectId, typename },
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return validatedSubjects;
|
|
113
|
+
}),
|
|
114
|
+
),
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
export default handler;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities } from '@dxos/app-framework';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
10
|
+
|
|
11
|
+
import { DeckCapabilities } from '../types';
|
|
12
|
+
|
|
13
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.RevertWorkspace> = LayoutOperation.RevertWorkspace.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fnUntraced(function* () {
|
|
16
|
+
const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
17
|
+
yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: state.previousDeck });
|
|
18
|
+
}),
|
|
19
|
+
),
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export default handler;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities } from '@dxos/app-framework';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
10
|
+
|
|
11
|
+
import { DeckCapabilities } from '../types';
|
|
12
|
+
|
|
13
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.ScrollIntoView> = LayoutOperation.ScrollIntoView.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fnUntraced(function* (input) {
|
|
16
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.EphemeralState, (state) => ({
|
|
17
|
+
...state,
|
|
18
|
+
scrollIntoView: input.subject,
|
|
19
|
+
}));
|
|
20
|
+
}),
|
|
21
|
+
),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export default handler;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities } from '@dxos/app-framework';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { log } from '@dxos/log';
|
|
10
|
+
import { Operation } from '@dxos/operation';
|
|
11
|
+
import { isNonNullable } from '@dxos/util';
|
|
12
|
+
|
|
13
|
+
import { updateActiveDeck } from './helpers';
|
|
14
|
+
import { DeckCapabilities, type DeckState, type LayoutMode, getMode, isLayoutMode } from '../types';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Transitions between layout modes (multi, solo, solo--fullscreen) or reverts to the previous mode.
|
|
18
|
+
* Computes which planks become active/inactive and persists the previous mode for revert support.
|
|
19
|
+
*/
|
|
20
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.SetLayoutMode> = LayoutOperation.SetLayoutMode.pipe(
|
|
21
|
+
Operation.withHandler(
|
|
22
|
+
Effect.fnUntraced(function* (input) {
|
|
23
|
+
if ('mode' in input && !isLayoutMode(input.mode)) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
28
|
+
const deck = yield* DeckCapabilities.getDeck();
|
|
29
|
+
|
|
30
|
+
const computeModeUpdate = (mode: LayoutMode, subject?: string): Partial<DeckState> => {
|
|
31
|
+
const current = deck.solo ? [deck.solo] : deck.active;
|
|
32
|
+
const next = (mode !== 'multi' ? [subject ?? deck.solo ?? deck.active[0]] : [...deck.active, deck.solo]).filter(
|
|
33
|
+
isNonNullable,
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const removed = current.filter((id: string) => !next.includes(id));
|
|
37
|
+
const closed = Array.from(new Set([...deck.inactive.filter((id: string) => !next.includes(id)), ...removed]));
|
|
38
|
+
|
|
39
|
+
const soloUpdate =
|
|
40
|
+
mode !== 'multi' && next[0]
|
|
41
|
+
? { solo: next[0] }
|
|
42
|
+
: mode === 'multi' && deck.solo
|
|
43
|
+
? { solo: undefined, initialized: true }
|
|
44
|
+
: {};
|
|
45
|
+
|
|
46
|
+
const fullscreenUpdate = mode === 'solo--fullscreen' ? { fullscreen: !deck.fullscreen } : {};
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
inactive: closed,
|
|
50
|
+
...soloUpdate,
|
|
51
|
+
...fullscreenUpdate,
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
if ('mode' in input) {
|
|
56
|
+
const currentMode = getMode(deck);
|
|
57
|
+
const subject = 'subject' in input ? input.subject : undefined;
|
|
58
|
+
const deckUpdates = computeModeUpdate(input.mode as LayoutMode, subject);
|
|
59
|
+
|
|
60
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => {
|
|
61
|
+
const newPreviousMode =
|
|
62
|
+
currentMode !== input.mode
|
|
63
|
+
? { ...state.previousMode, [state.activeDeck]: currentMode }
|
|
64
|
+
: state.previousMode;
|
|
65
|
+
return {
|
|
66
|
+
...updateActiveDeck(state, deckUpdates),
|
|
67
|
+
previousMode: newPreviousMode,
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
if (subject) {
|
|
72
|
+
yield* Operation.schedule(LayoutOperation.Expose, { subject });
|
|
73
|
+
}
|
|
74
|
+
} else if ('revert' in input) {
|
|
75
|
+
const deckUpdates = computeModeUpdate(state.previousMode[state.activeDeck]);
|
|
76
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, deckUpdates));
|
|
77
|
+
} else {
|
|
78
|
+
log.warn('Invalid layout mode', input);
|
|
79
|
+
}
|
|
80
|
+
}),
|
|
81
|
+
),
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
export default handler;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
10
|
+
import { AttentionCapabilities } from '@dxos/plugin-attention/types';
|
|
11
|
+
|
|
12
|
+
import { updateActiveDeck } from './helpers';
|
|
13
|
+
import { DeckCapabilities } from '../types';
|
|
14
|
+
import { computeActiveUpdates } from '../util';
|
|
15
|
+
|
|
16
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.Set> = LayoutOperation.Set.pipe(
|
|
17
|
+
Operation.withHandler(
|
|
18
|
+
Effect.fnUntraced(function* (input) {
|
|
19
|
+
const deck = yield* DeckCapabilities.getDeck();
|
|
20
|
+
const attention = yield* Capability.get(AttentionCapabilities.Attention);
|
|
21
|
+
|
|
22
|
+
const { deckUpdates, toAttend } = computeActiveUpdates({
|
|
23
|
+
next: input.subject as string[],
|
|
24
|
+
deck,
|
|
25
|
+
attention,
|
|
26
|
+
});
|
|
27
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, deckUpdates));
|
|
28
|
+
|
|
29
|
+
if (toAttend) {
|
|
30
|
+
yield* Operation.schedule(LayoutOperation.ScrollIntoView, { subject: toAttend });
|
|
31
|
+
}
|
|
32
|
+
}),
|
|
33
|
+
),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export default handler;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability, UndoOperation } from '@dxos/app-framework';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
10
|
+
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
import { DeckCapabilities } from '../types';
|
|
13
|
+
|
|
14
|
+
const handler: Operation.WithHandler<typeof UndoOperation.ShowUndo> = UndoOperation.ShowUndo.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fnUntraced(function* (input) {
|
|
17
|
+
const historyTracker = yield* Capability.get(Capabilities.HistoryTracker);
|
|
18
|
+
|
|
19
|
+
const newUndoId = `show-undo-${Date.now()}`;
|
|
20
|
+
// TODO(wittjosiah): Support undoing further back than the last action.
|
|
21
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.EphemeralState, (state) => {
|
|
22
|
+
const filteredToasts = state.currentUndoId
|
|
23
|
+
? state.toasts.filter((toast) => toast.id !== state.currentUndoId)
|
|
24
|
+
: state.toasts;
|
|
25
|
+
|
|
26
|
+
const toast: LayoutOperation.Toast = {
|
|
27
|
+
id: newUndoId,
|
|
28
|
+
title: input.message ?? ['undo-available.label', { ns: meta.id }],
|
|
29
|
+
duration: 10_000,
|
|
30
|
+
actionLabel: ['undo-action.label', { ns: meta.id }],
|
|
31
|
+
actionAlt: ['undo-action.alt', { ns: meta.id }],
|
|
32
|
+
closeLabel: ['undo-close.label', { ns: meta.id }],
|
|
33
|
+
onAction: () => historyTracker.undoPromise(),
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
...state,
|
|
38
|
+
currentUndoId: newUndoId,
|
|
39
|
+
toasts: [...filteredToasts, toast],
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
}),
|
|
43
|
+
),
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
export default handler;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities, isPinnedWorkspace, LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { invariant } from '@dxos/invariant';
|
|
10
|
+
import { Operation } from '@dxos/operation';
|
|
11
|
+
import { Graph, Node } from '@dxos/plugin-graph';
|
|
12
|
+
|
|
13
|
+
import { DeckCapabilities, defaultDeck } from '../types';
|
|
14
|
+
|
|
15
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.SwitchWorkspace> = LayoutOperation.SwitchWorkspace.pipe(
|
|
16
|
+
Operation.withHandler(
|
|
17
|
+
Effect.fnUntraced(function* (input) {
|
|
18
|
+
const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
|
|
19
|
+
|
|
20
|
+
{
|
|
21
|
+
const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
22
|
+
// TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.
|
|
23
|
+
// Ideally this should be worked into the data model in a generic way.
|
|
24
|
+
const shouldUpdatePrevious = !isPinnedWorkspace(state.activeDeck);
|
|
25
|
+
|
|
26
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => {
|
|
27
|
+
const newDecks = state.decks[input.subject]
|
|
28
|
+
? state.decks
|
|
29
|
+
: { ...state.decks, [input.subject]: { ...defaultDeck } };
|
|
30
|
+
return {
|
|
31
|
+
...state,
|
|
32
|
+
previousDeck: shouldUpdatePrevious ? state.activeDeck : state.previousDeck,
|
|
33
|
+
activeDeck: input.subject,
|
|
34
|
+
decks: newDecks,
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
{
|
|
40
|
+
const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
41
|
+
const deck = state.decks[input.subject];
|
|
42
|
+
invariant(deck, `Deck not found: ${input.subject}`);
|
|
43
|
+
|
|
44
|
+
const first = deck.solo ? deck.solo : deck.active[0];
|
|
45
|
+
if (first) {
|
|
46
|
+
yield* Operation.schedule(LayoutOperation.ScrollIntoView, { subject: first });
|
|
47
|
+
} else {
|
|
48
|
+
const [item] = Graph.getConnections(graph, input.subject, 'child').filter(
|
|
49
|
+
(node) => !Node.isActionLike(node) && !node.properties.disposition,
|
|
50
|
+
);
|
|
51
|
+
if (item) {
|
|
52
|
+
yield* Operation.schedule(LayoutOperation.Open, { subject: [item.id] });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}),
|
|
57
|
+
),
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
export default handler;
|