@dxos/plugin-deck 0.8.4-main.f5c0578 → 0.8.4-main.fcfe5033a5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/add-toast-3V7TYC2M.mjs +24 -0
- package/dist/lib/browser/add-toast-3V7TYC2M.mjs.map +7 -0
- package/dist/lib/browser/adjust-ZMPN7P7J.mjs +96 -0
- package/dist/lib/browser/adjust-ZMPN7P7J.mjs.map +7 -0
- package/dist/lib/browser/change-companion-F7GCREGM.mjs +34 -0
- package/dist/lib/browser/change-companion-F7GCREGM.mjs.map +7 -0
- package/dist/lib/browser/chunk-BRZAVPMC.mjs +48 -0
- package/dist/lib/browser/chunk-BRZAVPMC.mjs.map +7 -0
- package/dist/lib/browser/chunk-DF2VZ6W3.mjs +69 -0
- package/dist/lib/browser/chunk-DF2VZ6W3.mjs.map +7 -0
- package/dist/lib/browser/chunk-FUWSZ6IC.mjs +88 -0
- package/dist/lib/browser/chunk-FUWSZ6IC.mjs.map +7 -0
- package/dist/lib/browser/chunk-GN52IRQ7.mjs +216 -0
- package/dist/lib/browser/chunk-GN52IRQ7.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-KUTDCWZF.mjs +30 -0
- package/dist/lib/browser/chunk-KUTDCWZF.mjs.map +7 -0
- package/dist/lib/browser/close-N2F26CVG.mjs +44 -0
- package/dist/lib/browser/close-N2F26CVG.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +161 -134
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/open-VWO7VOOU.mjs +150 -0
- package/dist/lib/browser/open-VWO7VOOU.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +13 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/revert-workspace-LGKZZKCI.mjs +21 -0
- package/dist/lib/browser/revert-workspace-LGKZZKCI.mjs.map +7 -0
- package/dist/lib/browser/scroll-into-view-TSVSNKIH.mjs +21 -0
- package/dist/lib/browser/scroll-into-view-TSVSNKIH.mjs.map +7 -0
- package/dist/lib/browser/set-N2LGA2BY.mjs +37 -0
- package/dist/lib/browser/set-N2LGA2BY.mjs.map +7 -0
- package/dist/lib/browser/set-layout-mode-TONTQO6G.mjs +90 -0
- package/dist/lib/browser/set-layout-mode-TONTQO6G.mjs.map +7 -0
- package/dist/lib/browser/show-undo-IFXNEIQY.mjs +59 -0
- package/dist/lib/browser/show-undo-IFXNEIQY.mjs.map +7 -0
- package/dist/lib/browser/switch-workspace-ZJDC5SSR.mjs +68 -0
- package/dist/lib/browser/switch-workspace-ZJDC5SSR.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +12 -12
- package/dist/lib/browser/update-complementary-ELUOK3GD.mjs +28 -0
- package/dist/lib/browser/update-complementary-ELUOK3GD.mjs.map +7 -0
- package/dist/lib/browser/update-dialog-LMGLOTWX.mjs +29 -0
- package/dist/lib/browser/update-dialog-LMGLOTWX.mjs.map +7 -0
- package/dist/lib/browser/update-plank-size-WQAPELII.mjs +28 -0
- package/dist/lib/browser/update-plank-size-WQAPELII.mjs.map +7 -0
- package/dist/lib/browser/update-popover-P6YO6FWJ.mjs +33 -0
- package/dist/lib/browser/update-popover-P6YO6FWJ.mjs.map +7 -0
- package/dist/lib/browser/update-sidebar-NGWS6IDJ.mjs +25 -0
- package/dist/lib/browser/update-sidebar-NGWS6IDJ.mjs.map +7 -0
- package/dist/lib/node-esm/add-toast-G4OQEGOS.mjs +25 -0
- package/dist/lib/node-esm/add-toast-G4OQEGOS.mjs.map +7 -0
- package/dist/lib/node-esm/adjust-KSNI7C3B.mjs +97 -0
- package/dist/lib/node-esm/adjust-KSNI7C3B.mjs.map +7 -0
- package/dist/lib/node-esm/change-companion-LCJPT6AX.mjs +35 -0
- package/dist/lib/node-esm/change-companion-LCJPT6AX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4ED7B7OZ.mjs +217 -0
- package/dist/lib/node-esm/chunk-4ED7B7OZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7KL65RLL.mjs +89 -0
- package/dist/lib/node-esm/chunk-7KL65RLL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-IRWCUYJY.mjs +71 -0
- package/dist/lib/node-esm/chunk-IRWCUYJY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MB4SDDVY.mjs +50 -0
- package/dist/lib/node-esm/chunk-MB4SDDVY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MLVJ2ODW.mjs +32 -0
- package/dist/lib/node-esm/chunk-MLVJ2ODW.mjs.map +7 -0
- package/dist/lib/node-esm/close-YHIBVE2S.mjs +45 -0
- package/dist/lib/node-esm/close-YHIBVE2S.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +202 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/open-353DYMMN.mjs +151 -0
- package/dist/lib/node-esm/open-353DYMMN.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +14 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/revert-workspace-OS5R3PFJ.mjs +22 -0
- package/dist/lib/node-esm/revert-workspace-OS5R3PFJ.mjs.map +7 -0
- package/dist/lib/node-esm/scroll-into-view-LC2SVKCW.mjs +22 -0
- package/dist/lib/node-esm/scroll-into-view-LC2SVKCW.mjs.map +7 -0
- package/dist/lib/node-esm/set-3EZ7LJFU.mjs +38 -0
- package/dist/lib/node-esm/set-3EZ7LJFU.mjs.map +7 -0
- package/dist/lib/node-esm/set-layout-mode-3YBHGEK6.mjs +91 -0
- package/dist/lib/node-esm/set-layout-mode-3YBHGEK6.mjs.map +7 -0
- package/dist/lib/node-esm/show-undo-RAHLRPUU.mjs +60 -0
- package/dist/lib/node-esm/show-undo-RAHLRPUU.mjs.map +7 -0
- package/dist/lib/node-esm/switch-workspace-S6CXDPXZ.mjs +69 -0
- package/dist/lib/node-esm/switch-workspace-S6CXDPXZ.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +33 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/lib/node-esm/update-complementary-V5Y2RMYL.mjs +29 -0
- package/dist/lib/node-esm/update-complementary-V5Y2RMYL.mjs.map +7 -0
- package/dist/lib/node-esm/update-dialog-IMTCLAWR.mjs +30 -0
- package/dist/lib/node-esm/update-dialog-IMTCLAWR.mjs.map +7 -0
- package/dist/lib/node-esm/update-plank-size-I3DKCPHZ.mjs +29 -0
- package/dist/lib/node-esm/update-plank-size-I3DKCPHZ.mjs.map +7 -0
- package/dist/lib/node-esm/update-popover-7JX3KWYL.mjs +34 -0
- package/dist/lib/node-esm/update-popover-7JX3KWYL.mjs.map +7 -0
- package/dist/lib/node-esm/update-sidebar-B5DCSREP.mjs +26 -0
- package/dist/lib/node-esm/update-sidebar-B5DCSREP.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts +2 -1
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts +17 -2
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +196 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root.d.ts +4 -2
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +5 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +134 -44
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/tools.d.ts +4 -3
- package/dist/types/src/capabilities/tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-handler.d.ts +3 -2
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +4 -4
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts +71 -0
- package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/DeckSettings/index.d.ts +1 -1
- package/dist/types/src/components/DeckSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/Matrix/Matrix.d.ts +41 -0
- package/dist/types/src/components/Matrix/Matrix.d.ts.map +1 -0
- package/dist/types/src/components/Matrix/Matrix.stories.d.ts +17 -0
- package/dist/types/src/components/Matrix/Matrix.stories.d.ts.map +1 -0
- package/dist/types/src/components/Matrix/index.d.ts +3 -0
- package/dist/types/src/components/Matrix/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +3 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/Deck/Banner.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/Deck.d.ts +25 -0
- package/dist/types/src/containers/Deck/Deck.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/Deck.stories.d.ts +71 -0
- package/dist/types/src/containers/Deck/Deck.stories.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckContent.d.ts +7 -0
- package/dist/types/src/containers/Deck/DeckContent.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckRoot.d.ts +42 -0
- package/dist/types/src/containers/Deck/DeckRoot.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckViewport.d.ts +19 -0
- package/dist/types/src/containers/Deck/DeckViewport.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/StatusBar.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/index.d.ts +2 -0
- package/dist/types/src/containers/Deck/index.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/ActiveNode.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.d.ts +5 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts +73 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/Dialog.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/Fallback.d.ts +2 -0
- package/dist/types/src/containers/DeckLayout/Fallback.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/Popover.d.ts +5 -0
- package/dist/types/src/containers/DeckLayout/Popover.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/Toast.d.ts +10 -0
- package/dist/types/src/containers/DeckLayout/Toast.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/constants.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/index.d.ts +4 -0
- package/dist/types/src/containers/DeckLayout/index.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/Plank.d.ts +17 -0
- package/dist/types/src/containers/Plank/Plank.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/Plank.stories.d.ts +71 -0
- package/dist/types/src/containers/Plank/Plank.stories.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankComponent.d.ts +17 -0
- package/dist/types/src/containers/Plank/PlankComponent.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankContent.d.ts +10 -0
- package/dist/types/src/containers/Plank/PlankContent.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Plank/PlankControls.d.ts +5 -6
- package/dist/types/src/containers/Plank/PlankControls.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankError.d.ts +15 -0
- package/dist/types/src/containers/Plank/PlankError.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Plank/PlankHeading.d.ts +5 -4
- package/dist/types/src/containers/Plank/PlankHeading.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Plank/PlankLoading.d.ts.map +1 -1
- package/dist/types/src/containers/Plank/PlankRoot.d.ts +37 -0
- package/dist/types/src/containers/Plank/PlankRoot.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/index.d.ts +4 -0
- package/dist/types/src/containers/Plank/index.d.ts.map +1 -0
- package/dist/types/src/containers/Sidebar/ComplementarySidebar.d.ts.map +1 -0
- package/dist/types/src/containers/Sidebar/Sidebar.d.ts.map +1 -0
- package/dist/types/src/containers/Sidebar/SidebarButton.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Sidebar/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +6 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +3 -4
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckState.d.ts +17 -0
- package/dist/types/src/hooks/useDeckState.d.ts.map +1 -0
- package/dist/types/src/hooks/useHoistStatusbar.d.ts +1 -1
- package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
- package/dist/types/src/hooks/useMainSize.d.ts +2 -2
- package/dist/types/src/hooks/useNodeActionExpander.d.ts +1 -1
- package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
- package/dist/types/src/hooks/useSelectedCompanion.d.ts +13 -0
- package/dist/types/src/hooks/useSelectedCompanion.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/layout.d.ts +20 -9
- package/dist/types/src/layout.d.ts.map +1 -1
- package/dist/types/src/layout.test.d.ts +2 -0
- package/dist/types/src/layout.test.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/add-toast.d.ts +5 -0
- package/dist/types/src/operations/add-toast.d.ts.map +1 -0
- package/dist/types/src/operations/adjust.d.ts +5 -0
- package/dist/types/src/operations/adjust.d.ts.map +1 -0
- package/dist/types/src/operations/change-companion.d.ts +5 -0
- package/dist/types/src/operations/change-companion.d.ts.map +1 -0
- package/dist/types/src/operations/close.d.ts +5 -0
- package/dist/types/src/operations/close.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +18 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/helpers.d.ts +3 -0
- package/dist/types/src/operations/helpers.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/open.d.ts +5 -0
- package/dist/types/src/operations/open.d.ts.map +1 -0
- package/dist/types/src/operations/revert-workspace.d.ts +5 -0
- package/dist/types/src/operations/revert-workspace.d.ts.map +1 -0
- package/dist/types/src/operations/scroll-into-view.d.ts +5 -0
- package/dist/types/src/operations/scroll-into-view.d.ts.map +1 -0
- package/dist/types/src/operations/set-layout-mode.d.ts +9 -0
- package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -0
- package/dist/types/src/operations/set.d.ts +5 -0
- package/dist/types/src/operations/set.d.ts.map +1 -0
- package/dist/types/src/operations/show-undo.d.ts +5 -0
- package/dist/types/src/operations/show-undo.d.ts.map +1 -0
- package/dist/types/src/operations/switch-workspace.d.ts +5 -0
- package/dist/types/src/operations/switch-workspace.d.ts.map +1 -0
- package/dist/types/src/operations/update-complementary.d.ts +5 -0
- package/dist/types/src/operations/update-complementary.d.ts.map +1 -0
- package/dist/types/src/operations/update-dialog.d.ts +5 -0
- package/dist/types/src/operations/update-dialog.d.ts.map +1 -0
- package/dist/types/src/operations/update-plank-size.d.ts +5 -0
- package/dist/types/src/operations/update-plank-size.d.ts.map +1 -0
- package/dist/types/src/operations/update-popover.d.ts +5 -0
- package/dist/types/src/operations/update-popover.d.ts.map +1 -0
- package/dist/types/src/operations/update-sidebar.d.ts +5 -0
- package/dist/types/src/operations/update-sidebar.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +52 -52
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +11 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/{capabilities → types}/capabilities.d.ts +103 -96
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +7 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +68 -56
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +2 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -1
- package/dist/types/src/util/plank-url-params.d.ts +14 -0
- package/dist/types/src/util/plank-url-params.d.ts.map +1 -0
- package/dist/types/src/util/plank-url-params.test.d.ts +2 -0
- package/dist/types/src/util/plank-url-params.test.d.ts.map +1 -0
- package/dist/types/src/util/sanitize-persisted-state.d.ts +19 -0
- package/dist/types/src/util/sanitize-persisted-state.d.ts.map +1 -0
- package/dist/types/src/util/sanitize-persisted-state.test.d.ts +2 -0
- package/dist/types/src/util/sanitize-persisted-state.test.d.ts.map +1 -0
- package/dist/types/src/util/set-active.d.ts +19 -4
- package/dist/types/src/util/set-active.d.ts.map +1 -1
- package/dist/types/src/util/set-active.test.d.ts +2 -0
- package/dist/types/src/util/set-active.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +87 -49
- package/src/DeckPlugin.ts +43 -69
- package/src/capabilities/app-graph-builder.ts +112 -127
- package/src/capabilities/check-app-scheme.ts +123 -24
- package/src/capabilities/index.ts +13 -14
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-root.tsx +37 -29
- package/src/capabilities/react-surface.tsx +28 -22
- package/src/capabilities/settings.ts +30 -19
- package/src/capabilities/state.ts +74 -88
- package/src/capabilities/tools.ts +57 -50
- package/src/capabilities/url-handler.ts +221 -50
- package/src/components/DeckSettings/DeckSettings.stories.tsx +37 -0
- package/src/components/DeckSettings/DeckSettings.tsx +55 -70
- package/src/components/DeckSettings/index.ts +2 -2
- package/src/components/Matrix/Matrix.stories.tsx +216 -0
- package/src/components/Matrix/Matrix.tsx +205 -0
- package/src/components/Matrix/SPEC.md +219 -0
- package/src/components/Matrix/index.ts +6 -0
- package/src/components/index.ts +6 -3
- package/src/{components/DeckLayout → containers/Deck}/Banner.tsx +13 -11
- package/src/containers/Deck/Deck.stories.tsx +81 -0
- package/src/containers/Deck/Deck.tsx +21 -0
- package/src/containers/Deck/DeckContent.tsx +105 -0
- package/src/containers/Deck/DeckRoot.tsx +50 -0
- package/src/containers/Deck/DeckViewport.tsx +456 -0
- package/src/{components/DeckLayout → containers/Deck}/StatusBar.tsx +4 -4
- package/src/containers/Deck/index.ts +5 -0
- package/src/{components → containers}/DeckLayout/ActiveNode.tsx +8 -3
- package/src/containers/DeckLayout/DeckLayout.stories.tsx +393 -0
- package/src/containers/DeckLayout/DeckLayout.tsx +62 -0
- package/src/containers/DeckLayout/Dialog.tsx +52 -0
- package/src/containers/DeckLayout/Fallback.tsx +24 -0
- package/src/containers/DeckLayout/Popover.tsx +161 -0
- package/src/{components → containers}/DeckLayout/Toast.tsx +30 -5
- package/src/{components → containers}/DeckLayout/constants.ts +1 -0
- package/src/{components → containers}/DeckLayout/index.ts +3 -2
- package/src/containers/Plank/Plank.stories.tsx +106 -0
- package/src/containers/Plank/Plank.tsx +22 -0
- package/src/containers/Plank/PlankComponent.tsx +217 -0
- package/src/containers/Plank/PlankContent.tsx +45 -0
- package/src/{components → containers}/Plank/PlankControls.tsx +45 -38
- package/src/containers/Plank/PlankError.tsx +79 -0
- package/src/{components → containers}/Plank/PlankHeading.tsx +68 -64
- package/src/{components → containers}/Plank/PlankLoading.tsx +1 -1
- package/src/containers/Plank/PlankRoot.tsx +49 -0
- package/src/{components → containers}/Plank/index.ts +0 -2
- package/src/containers/Sidebar/ComplementarySidebar.tsx +209 -0
- package/src/containers/Sidebar/Sidebar.tsx +44 -0
- package/src/containers/Sidebar/SidebarButton.tsx +94 -0
- package/src/containers/index.ts +11 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useCompanions.ts +3 -3
- package/src/hooks/useDeckCompanions.ts +7 -10
- package/src/hooks/useDeckState.ts +73 -0
- package/src/hooks/useHoistStatusbar.ts +4 -5
- package/src/hooks/useMainSize.ts +2 -2
- package/src/hooks/useNodeActionExpander.ts +4 -4
- package/src/hooks/useSelectedCompanion.ts +32 -0
- package/src/index.ts +1 -2
- package/src/layout.test.ts +59 -0
- package/src/layout.ts +38 -40
- package/src/meta.ts +8 -5
- package/src/operations/add-toast.ts +24 -0
- package/src/operations/adjust.ts +83 -0
- package/src/operations/change-companion.ts +35 -0
- package/src/operations/close.ts +35 -0
- package/src/operations/definitions.ts +62 -0
- package/src/operations/helpers.ts +22 -0
- package/src/operations/index.ts +26 -0
- package/src/operations/open.ts +184 -0
- package/src/operations/revert-workspace.ts +22 -0
- package/src/operations/scroll-into-view.ts +24 -0
- package/src/operations/set-layout-mode.ts +84 -0
- package/src/operations/set.ts +36 -0
- package/src/operations/show-undo.ts +47 -0
- package/src/operations/switch-workspace.ts +60 -0
- package/src/operations/update-complementary.ts +33 -0
- package/src/operations/update-dialog.ts +34 -0
- package/src/operations/update-plank-size.ts +29 -0
- package/src/operations/update-popover.ts +36 -0
- package/src/operations/update-sidebar.ts +28 -0
- package/src/translations.ts +52 -52
- package/src/types/Settings.ts +17 -0
- package/src/types/capabilities.ts +35 -0
- package/src/types/events.ts +21 -0
- package/src/types/index.ts +3 -0
- package/src/types/schema.ts +52 -50
- package/src/util/index.ts +2 -1
- package/src/util/layoutAppliesTopbar.ts +2 -2
- package/src/util/plank-url-params.test.ts +85 -0
- package/src/util/plank-url-params.ts +36 -0
- package/src/util/sanitize-persisted-state.test.ts +79 -0
- package/src/util/sanitize-persisted-state.ts +52 -0
- package/src/util/set-active.test.ts +106 -0
- package/src/util/set-active.ts +50 -30
- package/src/vite-env.d.ts +5 -0
- package/dist/lib/browser/app-graph-builder-DVEKLXB4.mjs +0 -152
- package/dist/lib/browser/app-graph-builder-DVEKLXB4.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-3BQJXWEY.mjs +0 -32
- package/dist/lib/browser/check-app-scheme-3BQJXWEY.mjs.map +0 -7
- package/dist/lib/browser/chunk-6MQIYIPY.mjs +0 -1494
- package/dist/lib/browser/chunk-6MQIYIPY.mjs.map +0 -7
- package/dist/lib/browser/chunk-CNTGBCMK.mjs +0 -145
- package/dist/lib/browser/chunk-CNTGBCMK.mjs.map +0 -7
- package/dist/lib/browser/chunk-F5BQOOEG.mjs +0 -160
- package/dist/lib/browser/chunk-F5BQOOEG.mjs.map +0 -7
- package/dist/lib/browser/chunk-M57WD3V6.mjs +0 -16
- package/dist/lib/browser/chunk-M57WD3V6.mjs.map +0 -7
- package/dist/lib/browser/chunk-MX7WRVX3.mjs +0 -127
- package/dist/lib/browser/chunk-MX7WRVX3.mjs.map +0 -7
- package/dist/lib/browser/chunk-NRCPV6AV.mjs +0 -129
- package/dist/lib/browser/chunk-NRCPV6AV.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z5KITAZW.mjs +0 -13
- package/dist/lib/browser/chunk-Z5KITAZW.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-2SUIIV6N.mjs +0 -521
- package/dist/lib/browser/intent-resolver-2SUIIV6N.mjs.map +0 -7
- package/dist/lib/browser/react-root-GVZANZX7.mjs +0 -43
- package/dist/lib/browser/react-root-GVZANZX7.mjs.map +0 -7
- package/dist/lib/browser/react-surface-NXSSD2GW.mjs +0 -40
- package/dist/lib/browser/react-surface-NXSSD2GW.mjs.map +0 -7
- package/dist/lib/browser/settings-LUPQPZ27.mjs +0 -29
- package/dist/lib/browser/settings-LUPQPZ27.mjs.map +0 -7
- package/dist/lib/browser/state-CRXR7X63.mjs +0 -12
- package/dist/lib/browser/toolkit-OBKFXX23.mjs +0 -47
- package/dist/lib/browser/toolkit-OBKFXX23.mjs.map +0 -7
- package/dist/lib/browser/url-handler-LROZYQ26.mjs +0 -70
- package/dist/lib/browser/url-handler-LROZYQ26.mjs.map +0 -7
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit.d.ts +0 -5
- package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Banner.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +0 -6
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Fallback.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Popover.d.ts +0 -5
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts +0 -5
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Topbar.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/Topbar.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/constants.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/index.d.ts +0 -4
- package/dist/types/src/components/DeckLayout/index.d.ts.map +0 -1
- package/dist/types/src/components/Plank/Plank.d.ts +0 -27
- package/dist/types/src/components/Plank/Plank.d.ts.map +0 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +0 -8
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +0 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +0 -1
- package/dist/types/src/components/Plank/PlankError.d.ts +0 -13
- package/dist/types/src/components/Plank/PlankError.d.ts.map +0 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts.map +0 -1
- package/dist/types/src/components/Plank/index.d.ts +0 -6
- package/dist/types/src/components/Plank/index.d.ts.map +0 -1
- package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +0 -1
- package/dist/types/src/components/Sidebar/Sidebar.d.ts.map +0 -1
- package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +0 -1
- package/dist/types/src/components/fragments.d.ts +0 -4
- package/dist/types/src/components/fragments.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/util/overscroll.d.ts +0 -47
- package/dist/types/src/util/overscroll.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -14
- package/src/capabilities/intent-resolver.ts +0 -469
- package/src/capabilities/toolkit.ts +0 -55
- package/src/components/DeckLayout/ContentEmpty.tsx +0 -31
- package/src/components/DeckLayout/DeckLayout.tsx +0 -302
- package/src/components/DeckLayout/Dialog.tsx +0 -36
- package/src/components/DeckLayout/Fallback.tsx +0 -28
- package/src/components/DeckLayout/Popover.tsx +0 -104
- package/src/components/DeckLayout/Topbar.tsx +0 -11
- package/src/components/Plank/Plank.stories.tsx +0 -56
- package/src/components/Plank/Plank.tsx +0 -267
- package/src/components/Plank/PlankError.tsx +0 -49
- package/src/components/Sidebar/ComplementarySidebar.tsx +0 -194
- package/src/components/Sidebar/Sidebar.tsx +0 -42
- package/src/components/Sidebar/SidebarButton.tsx +0 -87
- package/src/components/fragments.ts +0 -14
- package/src/events.ts +0 -11
- package/src/util/overscroll.ts +0 -69
- /package/dist/lib/browser/{state-CRXR7X63.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/types/src/{components/DeckLayout → containers/Deck}/Banner.d.ts +0 -0
- /package/dist/types/src/{components/DeckLayout → containers/Deck}/StatusBar.d.ts +0 -0
- /package/dist/types/src/{components → containers}/DeckLayout/ActiveNode.d.ts +0 -0
- /package/dist/types/src/{components → containers}/DeckLayout/Dialog.d.ts +0 -0
- /package/dist/types/src/{components → containers}/DeckLayout/constants.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Plank/PlankLoading.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/ComplementarySidebar.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/Sidebar.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/SidebarButton.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/index.d.ts +0 -0
- /package/src/{components → containers}/Sidebar/index.ts +0 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
openSubjectsOnActiveDeck
|
|
4
|
+
} from "./chunk-IRWCUYJY.mjs";
|
|
5
|
+
import {
|
|
6
|
+
computeActiveUpdates
|
|
7
|
+
} from "./chunk-MB4SDDVY.mjs";
|
|
8
|
+
import {
|
|
9
|
+
updateActiveDeck
|
|
10
|
+
} from "./chunk-MLVJ2ODW.mjs";
|
|
11
|
+
import {
|
|
12
|
+
DeckCapabilities
|
|
13
|
+
} from "./chunk-4ED7B7OZ.mjs";
|
|
14
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
15
|
+
|
|
16
|
+
// src/operations/open.ts
|
|
17
|
+
import * as Effect from "effect/Effect";
|
|
18
|
+
import * as Option from "effect/Option";
|
|
19
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
20
|
+
import { AppCapabilities, LayoutOperation, createEdgeExistenceChecker, expandPath, validateNavigationTarget } from "@dxos/app-toolkit";
|
|
21
|
+
import { Context } from "@dxos/context";
|
|
22
|
+
import { Obj } from "@dxos/echo";
|
|
23
|
+
import { Operation } from "@dxos/operation";
|
|
24
|
+
import { AttentionCapabilities } from "@dxos/plugin-attention/types";
|
|
25
|
+
import { ClientCapabilities } from "@dxos/plugin-client/types";
|
|
26
|
+
import { Graph } from "@dxos/plugin-graph";
|
|
27
|
+
import { ObservabilityOperation } from "@dxos/plugin-observability/operations";
|
|
28
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-deck/src/operations/open.ts";
|
|
29
|
+
var handler = LayoutOperation.Open.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
|
|
30
|
+
const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
|
|
31
|
+
const attention = yield* Capability.get(AttentionCapabilities.Attention);
|
|
32
|
+
const capabilities = yield* Capability.Service;
|
|
33
|
+
const pathResolvers = capabilities.getAll(AppCapabilities.NavigationPathResolver);
|
|
34
|
+
const checkRemoteExistence = yield* Capability.get(ClientCapabilities.Client).pipe(Effect.map((client) => createEdgeExistenceChecker((spaceId, body) => client.edge.http.execQuery(new Context(void 0, {
|
|
35
|
+
F: __dxlog_file,
|
|
36
|
+
L: 40
|
|
37
|
+
}), spaceId, body))), Effect.catchAll(() => Effect.succeed(void 0)));
|
|
38
|
+
if (input.navigation === "immediate") {
|
|
39
|
+
for (const subjectId of input.subject) {
|
|
40
|
+
expandPath(graph, subjectId);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const validatedSubjects = yield* Effect.all(input.subject.map((subjectId) => input.navigation === "immediate" ? Effect.succeed(subjectId) : validateNavigationTarget({
|
|
44
|
+
graph,
|
|
45
|
+
subjectId,
|
|
46
|
+
pathResolvers,
|
|
47
|
+
checkRemoteExistence
|
|
48
|
+
})));
|
|
49
|
+
input = {
|
|
50
|
+
...input,
|
|
51
|
+
subject: validatedSubjects
|
|
52
|
+
};
|
|
53
|
+
{
|
|
54
|
+
const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
55
|
+
if (input.workspace && state.activeDeck !== input.workspace) {
|
|
56
|
+
yield* Operation.invoke(LayoutOperation.SwitchWorkspace, {
|
|
57
|
+
subject: input.workspace
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
{
|
|
62
|
+
const deck = yield* DeckCapabilities.getDeck();
|
|
63
|
+
const active = !deck.solo && deck.initialized ? deck.active : [];
|
|
64
|
+
if (active.length > 0 && input.subject.length > 0) {
|
|
65
|
+
const resolveDxn = (qualifiedPath) => Effect.reduce(pathResolvers, Option.none(), (acc, resolver) => Option.isSome(acc) ? Effect.succeed(acc) : resolver(qualifiedPath).pipe(Effect.map((opt) => Option.map(opt, (dxn) => dxn.toString())), Effect.catchAll(() => Effect.succeed(Option.none()))));
|
|
66
|
+
const deckDxnMap = /* @__PURE__ */ new Map();
|
|
67
|
+
yield* Effect.all(active.map((deckId) => resolveDxn(deckId).pipe(Effect.map((opt) => {
|
|
68
|
+
if (Option.isSome(opt)) {
|
|
69
|
+
deckDxnMap.set(opt.value, deckId);
|
|
70
|
+
}
|
|
71
|
+
}))), {
|
|
72
|
+
concurrency: "unbounded"
|
|
73
|
+
});
|
|
74
|
+
if (deckDxnMap.size > 0) {
|
|
75
|
+
const remapped = yield* Effect.all(input.subject.map((subjectId) => resolveDxn(subjectId).pipe(Effect.map((opt) => {
|
|
76
|
+
if (Option.isSome(opt)) {
|
|
77
|
+
const existing = deckDxnMap.get(opt.value);
|
|
78
|
+
if (existing && existing !== subjectId) {
|
|
79
|
+
return existing;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return subjectId;
|
|
83
|
+
}))), {
|
|
84
|
+
concurrency: "unbounded"
|
|
85
|
+
});
|
|
86
|
+
input = {
|
|
87
|
+
...input,
|
|
88
|
+
subject: remapped
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
let previouslyOpenIds;
|
|
94
|
+
{
|
|
95
|
+
const deck = yield* DeckCapabilities.getDeck();
|
|
96
|
+
previouslyOpenIds = new Set(deck.solo ? [
|
|
97
|
+
deck.solo
|
|
98
|
+
] : deck.active);
|
|
99
|
+
const next = deck.solo || !deck.initialized ? [
|
|
100
|
+
...input.subject
|
|
101
|
+
] : openSubjectsOnActiveDeck(deck.active, input.subject, {
|
|
102
|
+
pivotId: input.pivotId,
|
|
103
|
+
key: input.key
|
|
104
|
+
});
|
|
105
|
+
const { deckUpdates, toAttend: _toAttend } = computeActiveUpdates({
|
|
106
|
+
next,
|
|
107
|
+
deck,
|
|
108
|
+
attention
|
|
109
|
+
});
|
|
110
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, deckUpdates));
|
|
111
|
+
}
|
|
112
|
+
{
|
|
113
|
+
const deck = yield* DeckCapabilities.getDeck();
|
|
114
|
+
const ids = deck.solo ? [
|
|
115
|
+
deck.solo
|
|
116
|
+
] : deck.active;
|
|
117
|
+
const newlyOpen = ids.filter((i) => !previouslyOpenIds.has(i));
|
|
118
|
+
if (input.scrollIntoView !== false && (newlyOpen[0] ?? input.subject[0])) {
|
|
119
|
+
yield* Operation.schedule(LayoutOperation.ScrollIntoView, {
|
|
120
|
+
subject: newlyOpen[0] ?? input.subject[0]
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
if (newlyOpen[0] ?? input.subject[0]) {
|
|
124
|
+
yield* Operation.schedule(LayoutOperation.Expose, {
|
|
125
|
+
subject: newlyOpen[0] ?? input.subject[0]
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
for (const subjectId of newlyOpen) {
|
|
129
|
+
const typename = Option.match(Graph.getNode(graph, subjectId), {
|
|
130
|
+
onNone: () => void 0,
|
|
131
|
+
onSome: (node) => {
|
|
132
|
+
const active = node.data;
|
|
133
|
+
return Obj.isObject(active) ? Obj.getTypename(active) : void 0;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
yield* Operation.schedule(ObservabilityOperation.SendEvent, {
|
|
137
|
+
name: "navigation.activate",
|
|
138
|
+
properties: {
|
|
139
|
+
subjectId,
|
|
140
|
+
typename
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return validatedSubjects;
|
|
146
|
+
})));
|
|
147
|
+
var open_default = handler;
|
|
148
|
+
export {
|
|
149
|
+
open_default as default
|
|
150
|
+
};
|
|
151
|
+
//# sourceMappingURL=open-353DYMMN.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/open.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport {\n AppCapabilities,\n LayoutOperation,\n createEdgeExistenceChecker,\n expandPath,\n validateNavigationTarget,\n} from '@dxos/app-toolkit';\nimport { Context } from '@dxos/context';\nimport { Obj } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { AttentionCapabilities } from '@dxos/plugin-attention/types';\nimport { ClientCapabilities } from '@dxos/plugin-client/types';\nimport { Graph } from '@dxos/plugin-graph';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/operations';\n\nimport { openSubjectsOnActiveDeck } from '../layout';\nimport { DeckCapabilities } from '../types';\nimport { computeActiveUpdates } from '../util';\nimport { updateActiveDeck } from './helpers';\n\nconst handler: Operation.WithHandler<typeof LayoutOperation.Open> = LayoutOperation.Open.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const { graph } = yield* Capability.get(AppCapabilities.AppGraph);\n const attention = yield* Capability.get(AttentionCapabilities.Attention);\n\n // Validate navigation targets, redirecting to 404 if not found.\n const capabilities = yield* Capability.Service;\n const pathResolvers = capabilities.getAll(AppCapabilities.NavigationPathResolver);\n const checkRemoteExistence = yield* Capability.get(ClientCapabilities.Client).pipe(\n Effect.map((client) =>\n createEdgeExistenceChecker((spaceId, body) => client.edge.http.execQuery(new Context(), spaceId, body)),\n ),\n Effect.catchAll(() => Effect.succeed(undefined)),\n );\n\n // Immediate: skip 404 / resolver checks but still expand the path (same as validate’s first step).\n if (input.navigation === 'immediate') {\n for (const subjectId of input.subject) {\n expandPath(graph, subjectId);\n }\n }\n\n const validatedSubjects = yield* Effect.all(\n input.subject.map((subjectId) =>\n input.navigation === 'immediate'\n ? Effect.succeed(subjectId)\n : validateNavigationTarget({ graph, subjectId, pathResolvers, checkRemoteExistence }),\n ),\n );\n input = { ...input, subject: validatedSubjects };\n\n {\n const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);\n if (input.workspace && state.activeDeck !== input.workspace) {\n yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: input.workspace });\n }\n }\n\n // Dedup subjects against the active deck using DXN identity.\n // The same object can appear under different graph paths (e.g., via collections vs types).\n // Resolve each subject's DXN and, if it matches an already-open deck item, remap the\n // subject to the existing deck entry so that openEntry's exact-match check succeeds.\n // Only needed in multi (deck) mode; solo mode replaces the single visible item anyway.\n {\n const deck = yield* DeckCapabilities.getDeck();\n const active = !deck.solo && deck.initialized ? deck.active : [];\n if (active.length > 0 && input.subject.length > 0) {\n const resolveDxn = (qualifiedPath: string) =>\n Effect.reduce(pathResolvers, Option.none<string>(), (acc, resolver) =>\n Option.isSome(acc)\n ? Effect.succeed(acc)\n : resolver(qualifiedPath).pipe(\n Effect.map((opt) => Option.map(opt, (dxn) => dxn.toString())),\n Effect.catchAll(() => Effect.succeed(Option.none<string>())),\n ),\n );\n\n // Build DXN → deck item ID map for active items.\n const deckDxnMap = new Map<string, string>();\n yield* Effect.all(\n active.map((deckId) =>\n resolveDxn(deckId).pipe(\n Effect.map((opt) => {\n if (Option.isSome(opt)) {\n deckDxnMap.set(opt.value, deckId);\n }\n }),\n ),\n ),\n { concurrency: 'unbounded' },\n );\n\n // Remap subjects whose DXN matches an existing deck item.\n if (deckDxnMap.size > 0) {\n const remapped = yield* Effect.all(\n input.subject.map((subjectId) =>\n resolveDxn(subjectId).pipe(\n Effect.map((opt) => {\n if (Option.isSome(opt)) {\n const existing = deckDxnMap.get(opt.value);\n if (existing && existing !== subjectId) {\n return existing;\n }\n }\n return subjectId;\n }),\n ),\n ),\n { concurrency: 'unbounded' },\n );\n input = { ...input, subject: remapped };\n }\n }\n }\n\n // Compute the next active deck state and apply it.\n // In solo or uninitialized mode the subject list replaces the deck entirely.\n // In multi (deck) mode, subjects are merged via openSubjectsOnActiveDeck which\n // uses stack semantics (truncate after pivot, then push new entries).\n let previouslyOpenIds: Set<string>;\n {\n const deck = yield* DeckCapabilities.getDeck();\n previouslyOpenIds = new Set<string>(deck.solo ? [deck.solo] : deck.active);\n const next =\n deck.solo || !deck.initialized\n ? [...input.subject]\n : openSubjectsOnActiveDeck(deck.active, input.subject, {\n pivotId: input.pivotId,\n key: input.key,\n });\n\n const { deckUpdates, toAttend: _toAttend } = computeActiveUpdates({ next, deck, attention });\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, deckUpdates));\n }\n\n // Schedule side-effects for the newly opened items: scroll into view, expose in\n // the navigation sidebar, and emit observability events.\n // When nothing is newly opened (subject was already visible), the fallback\n // `input.subject[0]` still triggers scroll and expose so the user is taken there.\n {\n const deck = yield* DeckCapabilities.getDeck();\n const ids = deck.solo ? [deck.solo] : deck.active;\n const newlyOpen = ids.filter((i: string) => !previouslyOpenIds.has(i));\n\n if (input.scrollIntoView !== false && (newlyOpen[0] ?? input.subject[0])) {\n yield* Operation.schedule(LayoutOperation.ScrollIntoView, {\n subject: newlyOpen[0] ?? input.subject[0],\n });\n }\n\n if (newlyOpen[0] ?? input.subject[0]) {\n yield* Operation.schedule(LayoutOperation.Expose, { subject: newlyOpen[0] ?? input.subject[0] });\n }\n\n for (const subjectId of newlyOpen) {\n const typename = Option.match(Graph.getNode(graph, subjectId), {\n onNone: () => undefined,\n onSome: (node) => {\n const active = node.data;\n return Obj.isObject(active) ? Obj.getTypename(active) : undefined;\n },\n });\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'navigation.activate',\n properties: { subjectId, typename },\n });\n }\n }\n\n return validatedSubjects;\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Effect", "Option", "Capabilities", "Capability", "AppCapabilities", "LayoutOperation", "createEdgeExistenceChecker", "expandPath", "validateNavigationTarget", "Context", "Obj", "Operation", "AttentionCapabilities", "ClientCapabilities", "Graph", "ObservabilityOperation", "handler", "LayoutOperation", "Open", "pipe", "Operation", "withHandler", "fnUntraced", "input", "graph", "Capability", "get", "AppCapabilities", "AppGraph", "attention", "AttentionCapabilities", "Attention", "capabilities", "Service", "pathResolvers", "getAll", "NavigationPathResolver", "checkRemoteExistence", "ClientCapabilities", "Client", "map", "client", "createEdgeExistenceChecker", "spaceId", "body", "edge", "http", "execQuery", "Context", "catchAll", "succeed", "undefined", "navigation", "subjectId", "subject", "expandPath", "validatedSubjects", "all", "validateNavigationTarget", "state", "Capabilities", "getAtomValue", "DeckCapabilities", "State", "workspace", "activeDeck", "invoke", "SwitchWorkspace", "deck", "getDeck", "active", "solo", "initialized", "length", "resolveDxn", "qualifiedPath", "reduce", "none", "acc", "resolver", "isSome", "opt", "dxn", "toString", "deckDxnMap", "Map", "deckId", "set", "value", "concurrency", "size", "remapped", "existing", "previouslyOpenIds", "Set", "next", "openSubjectsOnActiveDeck", "pivotId", "key", "deckUpdates", "toAttend", "_toAttend", "computeActiveUpdates", "updateAtomValue", "updateActiveDeck", "ids", "newlyOpen", "filter", "i", "has", "scrollIntoView", "schedule", "ScrollIntoView", "Expose", "typename", "match", "Graph", "getNode", "onNone", "onSome", "node", "data", "Obj", "isObject", "getTypename", "ObservabilityOperation", "SendEvent", "name", "properties"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
definitions_exports
|
|
4
|
+
} from "../chunk-7KL65RLL.mjs";
|
|
5
|
+
import "../chunk-HSLMI22Q.mjs";
|
|
6
|
+
|
|
7
|
+
// src/operations/index.ts
|
|
8
|
+
import { OperationHandlerSet } from "@dxos/operation";
|
|
9
|
+
var DeckOperationHandlerSet = OperationHandlerSet.lazy(() => import("../add-toast-G4OQEGOS.mjs"), () => import("../adjust-KSNI7C3B.mjs"), () => import("../change-companion-LCJPT6AX.mjs"), () => import("../close-YHIBVE2S.mjs"), () => import("../open-353DYMMN.mjs"), () => import("../revert-workspace-OS5R3PFJ.mjs"), () => import("../scroll-into-view-LC2SVKCW.mjs"), () => import("../set-3EZ7LJFU.mjs"), () => import("../set-layout-mode-3YBHGEK6.mjs"), () => import("../show-undo-RAHLRPUU.mjs"), () => import("../switch-workspace-S6CXDPXZ.mjs"), () => import("../update-complementary-V5Y2RMYL.mjs"), () => import("../update-dialog-IMTCLAWR.mjs"), () => import("../update-plank-size-I3DKCPHZ.mjs"), () => import("../update-popover-7JX3KWYL.mjs"), () => import("../update-sidebar-B5DCSREP.mjs"));
|
|
10
|
+
export {
|
|
11
|
+
definitions_exports as DeckOperation,
|
|
12
|
+
DeckOperationHandlerSet
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/operations/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { OperationHandlerSet } from '@dxos/operation';\n\nexport * as DeckOperation from './definitions';\n\nexport const DeckOperationHandlerSet = OperationHandlerSet.lazy(\n () => import('./add-toast'),\n () => import('./adjust'),\n () => import('./change-companion'),\n () => import('./close'),\n () => import('./open'),\n () => import('./revert-workspace'),\n () => import('./scroll-into-view'),\n () => import('./set'),\n () => import('./set-layout-mode'),\n () => import('./show-undo'),\n () => import('./switch-workspace'),\n () => import('./update-complementary'),\n () => import('./update-dialog'),\n () => import('./update-plank-size'),\n () => import('./update-popover'),\n () => import('./update-sidebar'),\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAIA,SAASA,2BAA2B;AAI7B,IAAMC,0BAA0BC,oBAAoBC,KACzD,MAAM,OAAO,2BAAA,GACb,MAAM,OAAO,wBAAA,GACb,MAAM,OAAO,kCAAA,GACb,MAAM,OAAO,uBAAA,GACb,MAAM,OAAO,sBAAA,GACb,MAAM,OAAO,kCAAA,GACb,MAAM,OAAO,kCAAA,GACb,MAAM,OAAO,qBAAA,GACb,MAAM,OAAO,iCAAA,GACb,MAAM,OAAO,2BAAA,GACb,MAAM,OAAO,kCAAA,GACb,MAAM,OAAO,sCAAA,GACb,MAAM,OAAO,+BAAA,GACb,MAAM,OAAO,mCAAA,GACb,MAAM,OAAO,gCAAA,GACb,MAAM,OAAO,gCAAA,CAAA;",
|
|
6
|
+
"names": ["OperationHandlerSet", "DeckOperationHandlerSet", "OperationHandlerSet", "lazy"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
DeckCapabilities
|
|
4
|
+
} from "./chunk-4ED7B7OZ.mjs";
|
|
5
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
6
|
+
|
|
7
|
+
// src/operations/revert-workspace.ts
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import { Capabilities } from "@dxos/app-framework";
|
|
10
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
11
|
+
import { Operation } from "@dxos/operation";
|
|
12
|
+
var handler = LayoutOperation.RevertWorkspace.pipe(Operation.withHandler(Effect.fnUntraced(function* () {
|
|
13
|
+
const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
14
|
+
yield* Operation.invoke(LayoutOperation.SwitchWorkspace, {
|
|
15
|
+
subject: state.previousDeck
|
|
16
|
+
});
|
|
17
|
+
})));
|
|
18
|
+
var revert_workspace_default = handler;
|
|
19
|
+
export {
|
|
20
|
+
revert_workspace_default as default
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=revert-workspace-OS5R3PFJ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/revert-workspace.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities } from '@dxos/app-framework';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/operation';\n\nimport { DeckCapabilities } from '../types';\n\nconst handler: Operation.WithHandler<typeof LayoutOperation.RevertWorkspace> = LayoutOperation.RevertWorkspace.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* () {\n const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);\n yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: state.previousDeck });\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,oBAAoB;AAC7B,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAI1B,IAAMC,UAAyEC,gBAAgBC,gBAAgBC,KAC7GC,UAAUC,YACDC,kBAAW,aAAA;AAChB,QAAMC,QAAQ,OAAOC,aAAaC,aAAaC,iBAAiBC,KAAK;AACrE,SAAOP,UAAUQ,OAAOX,gBAAgBY,iBAAiB;IAAEC,SAASP,MAAMQ;EAAa,CAAA;AACzF,CAAA,CAAA,CAAA;AAIJ,IAAA,2BAAef;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "LayoutOperation", "Operation", "handler", "LayoutOperation", "RevertWorkspace", "pipe", "Operation", "withHandler", "fnUntraced", "state", "Capabilities", "getAtomValue", "DeckCapabilities", "State", "invoke", "SwitchWorkspace", "subject", "previousDeck"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
DeckCapabilities
|
|
4
|
+
} from "./chunk-4ED7B7OZ.mjs";
|
|
5
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
6
|
+
|
|
7
|
+
// src/operations/scroll-into-view.ts
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import { Capabilities } from "@dxos/app-framework";
|
|
10
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
11
|
+
import { Operation } from "@dxos/operation";
|
|
12
|
+
var handler = LayoutOperation.ScrollIntoView.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
|
|
13
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.EphemeralState, (state) => ({
|
|
14
|
+
...state,
|
|
15
|
+
scrollIntoView: input.subject
|
|
16
|
+
}));
|
|
17
|
+
})));
|
|
18
|
+
var scroll_into_view_default = handler;
|
|
19
|
+
export {
|
|
20
|
+
scroll_into_view_default as default
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=scroll-into-view-LC2SVKCW.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/scroll-into-view.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities } from '@dxos/app-framework';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/operation';\n\nimport { DeckCapabilities } from '../types';\n\nconst handler: Operation.WithHandler<typeof LayoutOperation.ScrollIntoView> = LayoutOperation.ScrollIntoView.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n yield* Capabilities.updateAtomValue(DeckCapabilities.EphemeralState, (state) => ({\n ...state,\n scrollIntoView: input.subject,\n }));\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,oBAAoB;AAC7B,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAI1B,IAAMC,UAAwEC,gBAAgBC,eAAeC,KAC3GC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,SAAOC,aAAaC,gBAAgBC,iBAAiBC,gBAAgB,CAACC,WAAW;IAC/E,GAAGA;IACHC,gBAAgBN,MAAMO;EACxB,EAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,2BAAed;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "LayoutOperation", "Operation", "handler", "LayoutOperation", "ScrollIntoView", "pipe", "Operation", "withHandler", "fnUntraced", "input", "Capabilities", "updateAtomValue", "DeckCapabilities", "EphemeralState", "state", "scrollIntoView", "subject"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
computeActiveUpdates
|
|
4
|
+
} from "./chunk-MB4SDDVY.mjs";
|
|
5
|
+
import {
|
|
6
|
+
updateActiveDeck
|
|
7
|
+
} from "./chunk-MLVJ2ODW.mjs";
|
|
8
|
+
import {
|
|
9
|
+
DeckCapabilities
|
|
10
|
+
} from "./chunk-4ED7B7OZ.mjs";
|
|
11
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
12
|
+
|
|
13
|
+
// src/operations/set.ts
|
|
14
|
+
import * as Effect from "effect/Effect";
|
|
15
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
16
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
17
|
+
import { Operation } from "@dxos/operation";
|
|
18
|
+
import { AttentionCapabilities } from "@dxos/plugin-attention/types";
|
|
19
|
+
var handler = LayoutOperation.Set.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
|
|
20
|
+
const deck = yield* DeckCapabilities.getDeck();
|
|
21
|
+
const attention = yield* Capability.get(AttentionCapabilities.Attention);
|
|
22
|
+
const { deckUpdates, toAttend } = computeActiveUpdates({
|
|
23
|
+
next: input.subject,
|
|
24
|
+
deck,
|
|
25
|
+
attention
|
|
26
|
+
});
|
|
27
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, deckUpdates));
|
|
28
|
+
if (toAttend) {
|
|
29
|
+
yield* Operation.schedule(LayoutOperation.ScrollIntoView, {
|
|
30
|
+
subject: toAttend
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
})));
|
|
34
|
+
var set_default = handler;
|
|
35
|
+
export {
|
|
36
|
+
set_default as default
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=set-3EZ7LJFU.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/set.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/operation';\nimport { AttentionCapabilities } from '@dxos/plugin-attention/types';\n\nimport { DeckCapabilities } from '../types';\nimport { computeActiveUpdates } from '../util';\nimport { updateActiveDeck } from './helpers';\n\nconst handler: Operation.WithHandler<typeof LayoutOperation.Set> = LayoutOperation.Set.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const deck = yield* DeckCapabilities.getDeck();\n const attention = yield* Capability.get(AttentionCapabilities.Attention);\n\n const { deckUpdates, toAttend } = computeActiveUpdates({\n next: input.subject as string[],\n deck,\n attention,\n });\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, deckUpdates));\n\n if (toAttend) {\n yield* Operation.schedule(LayoutOperation.ScrollIntoView, { subject: toAttend });\n }\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAC1B,SAASC,6BAA6B;AAMtC,IAAMC,UAA6DC,gBAAgBC,IAAIC,KACrFC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,QAAMC,OAAO,OAAOC,iBAAiBC,QAAO;AAC5C,QAAMC,YAAY,OAAOC,WAAWC,IAAIC,sBAAsBC,SAAS;AAEvE,QAAM,EAAEC,aAAaC,SAAQ,IAAKC,qBAAqB;IACrDC,MAAMZ,MAAMa;IACZZ;IACAG;EACF,CAAA;AACA,SAAOU,aAAaC,gBAAgBb,iBAAiBc,OAAO,CAACC,UAAUC,iBAAiBD,OAAOR,WAAAA,CAAAA;AAE/F,MAAIC,UAAU;AACZ,WAAOb,UAAUsB,SAASzB,gBAAgB0B,gBAAgB;MAAEP,SAASH;IAAS,CAAA;EAChF;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,cAAejB;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "Operation", "AttentionCapabilities", "handler", "LayoutOperation", "Set", "pipe", "Operation", "withHandler", "fnUntraced", "input", "deck", "DeckCapabilities", "getDeck", "attention", "Capability", "get", "AttentionCapabilities", "Attention", "deckUpdates", "toAttend", "computeActiveUpdates", "next", "subject", "Capabilities", "updateAtomValue", "State", "state", "updateActiveDeck", "schedule", "ScrollIntoView"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
updateActiveDeck
|
|
4
|
+
} from "./chunk-MLVJ2ODW.mjs";
|
|
5
|
+
import {
|
|
6
|
+
DeckCapabilities,
|
|
7
|
+
getMode,
|
|
8
|
+
isLayoutMode
|
|
9
|
+
} from "./chunk-4ED7B7OZ.mjs";
|
|
10
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
11
|
+
|
|
12
|
+
// src/operations/set-layout-mode.ts
|
|
13
|
+
import * as Effect from "effect/Effect";
|
|
14
|
+
import { Capabilities } from "@dxos/app-framework";
|
|
15
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
16
|
+
import { log } from "@dxos/log";
|
|
17
|
+
import { Operation } from "@dxos/operation";
|
|
18
|
+
import { isNonNullable } from "@dxos/util";
|
|
19
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-deck/src/operations/set-layout-mode.ts";
|
|
20
|
+
var handler = LayoutOperation.SetLayoutMode.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
|
|
21
|
+
if ("mode" in input && !isLayoutMode(input.mode)) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
25
|
+
const deck = yield* DeckCapabilities.getDeck();
|
|
26
|
+
const computeModeUpdate = (mode, subject) => {
|
|
27
|
+
const current = deck.solo ? [
|
|
28
|
+
deck.solo
|
|
29
|
+
] : deck.active;
|
|
30
|
+
const next = (mode !== "multi" ? [
|
|
31
|
+
subject ?? deck.solo ?? deck.active[0]
|
|
32
|
+
] : [
|
|
33
|
+
...deck.active,
|
|
34
|
+
deck.solo
|
|
35
|
+
]).filter(isNonNullable);
|
|
36
|
+
const removed = current.filter((id) => !next.includes(id));
|
|
37
|
+
const closed = Array.from(/* @__PURE__ */ new Set([
|
|
38
|
+
...deck.inactive.filter((id) => !next.includes(id)),
|
|
39
|
+
...removed
|
|
40
|
+
]));
|
|
41
|
+
const soloUpdate = mode !== "multi" && next[0] ? {
|
|
42
|
+
solo: next[0]
|
|
43
|
+
} : mode === "multi" && deck.solo ? {
|
|
44
|
+
solo: void 0,
|
|
45
|
+
initialized: true
|
|
46
|
+
} : {};
|
|
47
|
+
const fullscreenUpdate = mode === "solo--fullscreen" ? {
|
|
48
|
+
fullscreen: !deck.fullscreen
|
|
49
|
+
} : {};
|
|
50
|
+
return {
|
|
51
|
+
inactive: closed,
|
|
52
|
+
...soloUpdate,
|
|
53
|
+
...fullscreenUpdate
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
if ("mode" in input) {
|
|
57
|
+
const currentMode = getMode(deck);
|
|
58
|
+
const subject = "subject" in input ? input.subject : void 0;
|
|
59
|
+
const deckUpdates = computeModeUpdate(input.mode, subject);
|
|
60
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state2) => {
|
|
61
|
+
const newPreviousMode = currentMode !== input.mode ? {
|
|
62
|
+
...state2.previousMode,
|
|
63
|
+
[state2.activeDeck]: currentMode
|
|
64
|
+
} : state2.previousMode;
|
|
65
|
+
return {
|
|
66
|
+
...updateActiveDeck(state2, deckUpdates),
|
|
67
|
+
previousMode: newPreviousMode
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
if (subject) {
|
|
71
|
+
yield* Operation.schedule(LayoutOperation.Expose, {
|
|
72
|
+
subject
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
} else if ("revert" in input) {
|
|
76
|
+
const deckUpdates = computeModeUpdate(state.previousMode[state.activeDeck]);
|
|
77
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state2) => updateActiveDeck(state2, deckUpdates));
|
|
78
|
+
} else {
|
|
79
|
+
log.warn("Invalid layout mode", input, {
|
|
80
|
+
F: __dxlog_file,
|
|
81
|
+
L: 78,
|
|
82
|
+
S: this,
|
|
83
|
+
C: (f, a) => f(...a)
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
})));
|
|
87
|
+
var set_layout_mode_default = handler;
|
|
88
|
+
export {
|
|
89
|
+
set_layout_mode_default as default
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=set-layout-mode-3YBHGEK6.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/set-layout-mode.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities } from '@dxos/app-framework';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { log } from '@dxos/log';\nimport { Operation } from '@dxos/operation';\nimport { isNonNullable } from '@dxos/util';\n\nimport { DeckCapabilities, type DeckState, type LayoutMode, getMode, isLayoutMode } from '../types';\nimport { updateActiveDeck } from './helpers';\n\n/**\n * Transitions between layout modes (multi, solo, solo--fullscreen) or reverts to the previous mode.\n * Computes which planks become active/inactive and persists the previous mode for revert support.\n */\nconst handler: Operation.WithHandler<typeof LayoutOperation.SetLayoutMode> = LayoutOperation.SetLayoutMode.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n if ('mode' in input && !isLayoutMode(input.mode)) {\n return;\n }\n\n const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);\n const deck = yield* DeckCapabilities.getDeck();\n\n const computeModeUpdate = (mode: LayoutMode, subject?: string): Partial<DeckState> => {\n const current = deck.solo ? [deck.solo] : deck.active;\n const next = (mode !== 'multi' ? [subject ?? deck.solo ?? deck.active[0]] : [...deck.active, deck.solo]).filter(\n isNonNullable,\n );\n\n const removed = current.filter((id: string) => !next.includes(id));\n const closed = Array.from(new Set([...deck.inactive.filter((id: string) => !next.includes(id)), ...removed]));\n\n const soloUpdate =\n mode !== 'multi' && next[0]\n ? { solo: next[0] }\n : mode === 'multi' && deck.solo\n ? { solo: undefined, initialized: true }\n : {};\n\n const fullscreenUpdate = mode === 'solo--fullscreen' ? { fullscreen: !deck.fullscreen } : {};\n\n return {\n inactive: closed,\n ...soloUpdate,\n ...fullscreenUpdate,\n };\n };\n\n if ('mode' in input) {\n const currentMode = getMode(deck);\n const subject = 'subject' in input ? input.subject : undefined;\n const deckUpdates = computeModeUpdate(input.mode as LayoutMode, subject);\n\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => {\n const newPreviousMode =\n currentMode !== input.mode\n ? { ...state.previousMode, [state.activeDeck]: currentMode }\n : state.previousMode;\n return {\n ...updateActiveDeck(state, deckUpdates),\n previousMode: newPreviousMode,\n };\n });\n\n if (subject) {\n yield* Operation.schedule(LayoutOperation.Expose, { subject });\n }\n } else if ('revert' in input) {\n const deckUpdates = computeModeUpdate(state.previousMode[state.activeDeck]);\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, deckUpdates));\n } else {\n log.warn('Invalid layout mode', input);\n }\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,oBAAoB;AAC7B,SAASC,uBAAuB;AAChC,SAASC,WAAW;AACpB,SAASC,iBAAiB;AAC1B,SAASC,qBAAqB;;AAS9B,IAAMC,UAAuEC,gBAAgBC,cAAcC,KACzGC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,MAAI,UAAUA,SAAS,CAACC,aAAaD,MAAME,IAAI,GAAG;AAChD;EACF;AAEA,QAAMC,QAAQ,OAAOC,aAAaC,aAAaC,iBAAiBC,KAAK;AACrE,QAAMC,OAAO,OAAOF,iBAAiBG,QAAO;AAE5C,QAAMC,oBAAoB,CAACR,MAAkBS,YAAAA;AAC3C,UAAMC,UAAUJ,KAAKK,OAAO;MAACL,KAAKK;QAAQL,KAAKM;AAC/C,UAAMC,QAAQb,SAAS,UAAU;MAACS,WAAWH,KAAKK,QAAQL,KAAKM,OAAO,CAAA;QAAM;SAAIN,KAAKM;MAAQN,KAAKK;OAAOG,OACvGC,aAAAA;AAGF,UAAMC,UAAUN,QAAQI,OAAO,CAACG,OAAe,CAACJ,KAAKK,SAASD,EAAAA,CAAAA;AAC9D,UAAME,SAASC,MAAMC,KAAK,oBAAIC,IAAI;SAAIhB,KAAKiB,SAAST,OAAO,CAACG,OAAe,CAACJ,KAAKK,SAASD,EAAAA,CAAAA;SAASD;KAAQ,CAAA;AAE3G,UAAMQ,aACJxB,SAAS,WAAWa,KAAK,CAAA,IACrB;MAAEF,MAAME,KAAK,CAAA;IAAG,IAChBb,SAAS,WAAWM,KAAKK,OACvB;MAAEA,MAAMc;MAAWC,aAAa;IAAK,IACrC,CAAC;AAET,UAAMC,mBAAmB3B,SAAS,qBAAqB;MAAE4B,YAAY,CAACtB,KAAKsB;IAAW,IAAI,CAAC;AAE3F,WAAO;MACLL,UAAUJ;MACV,GAAGK;MACH,GAAGG;IACL;EACF;AAEA,MAAI,UAAU7B,OAAO;AACnB,UAAM+B,cAAcC,QAAQxB,IAAAA;AAC5B,UAAMG,UAAU,aAAaX,QAAQA,MAAMW,UAAUgB;AACrD,UAAMM,cAAcvB,kBAAkBV,MAAME,MAAoBS,OAAAA;AAEhE,WAAOP,aAAa8B,gBAAgB5B,iBAAiBC,OAAO,CAACJ,WAAAA;AAC3D,YAAMgC,kBACJJ,gBAAgB/B,MAAME,OAClB;QAAE,GAAGC,OAAMiC;QAAc,CAACjC,OAAMkC,UAAU,GAAGN;MAAY,IACzD5B,OAAMiC;AACZ,aAAO;QACL,GAAGE,iBAAiBnC,QAAO8B,WAAAA;QAC3BG,cAAcD;MAChB;IACF,CAAA;AAEA,QAAIxB,SAAS;AACX,aAAOd,UAAU0C,SAAS7C,gBAAgB8C,QAAQ;QAAE7B;MAAQ,CAAA;IAC9D;EACF,WAAW,YAAYX,OAAO;AAC5B,UAAMiC,cAAcvB,kBAAkBP,MAAMiC,aAAajC,MAAMkC,UAAU,CAAC;AAC1E,WAAOjC,aAAa8B,gBAAgB5B,iBAAiBC,OAAO,CAACJ,WAAUmC,iBAAiBnC,QAAO8B,WAAAA,CAAAA;EACjG,OAAO;AACLQ,QAAIC,KAAK,uBAAuB1C,OAAAA;;;;;;EAClC;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,0BAAeP;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "LayoutOperation", "log", "Operation", "isNonNullable", "handler", "LayoutOperation", "SetLayoutMode", "pipe", "Operation", "withHandler", "fnUntraced", "input", "isLayoutMode", "mode", "state", "Capabilities", "getAtomValue", "DeckCapabilities", "State", "deck", "getDeck", "computeModeUpdate", "subject", "current", "solo", "active", "next", "filter", "isNonNullable", "removed", "id", "includes", "closed", "Array", "from", "Set", "inactive", "soloUpdate", "undefined", "initialized", "fullscreenUpdate", "fullscreen", "currentMode", "getMode", "deckUpdates", "updateAtomValue", "newPreviousMode", "previousMode", "activeDeck", "updateActiveDeck", "schedule", "Expose", "log", "warn"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
DeckCapabilities
|
|
4
|
+
} from "./chunk-4ED7B7OZ.mjs";
|
|
5
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
6
|
+
|
|
7
|
+
// src/operations/show-undo.ts
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import { Capabilities, Capability, UndoOperation } from "@dxos/app-framework";
|
|
10
|
+
import { Operation } from "@dxos/operation";
|
|
11
|
+
import { meta } from "#meta";
|
|
12
|
+
var handler = UndoOperation.ShowUndo.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
|
|
13
|
+
const historyTracker = yield* Capability.get(Capabilities.HistoryTracker);
|
|
14
|
+
const newUndoId = `show-undo-${Date.now()}`;
|
|
15
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.EphemeralState, (state) => {
|
|
16
|
+
const filteredToasts = state.currentUndoId ? state.toasts.filter((toast2) => toast2.id !== state.currentUndoId) : state.toasts;
|
|
17
|
+
const toast = {
|
|
18
|
+
id: newUndoId,
|
|
19
|
+
title: input.message ?? [
|
|
20
|
+
"undo-available.label",
|
|
21
|
+
{
|
|
22
|
+
ns: meta.id
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
duration: 1e4,
|
|
26
|
+
actionLabel: [
|
|
27
|
+
"undo-action.label",
|
|
28
|
+
{
|
|
29
|
+
ns: meta.id
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
actionAlt: [
|
|
33
|
+
"undo-action.alt",
|
|
34
|
+
{
|
|
35
|
+
ns: meta.id
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
closeLabel: [
|
|
39
|
+
"undo-close.label",
|
|
40
|
+
{
|
|
41
|
+
ns: meta.id
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
onAction: () => historyTracker.undoPromise()
|
|
45
|
+
};
|
|
46
|
+
return {
|
|
47
|
+
...state,
|
|
48
|
+
currentUndoId: newUndoId,
|
|
49
|
+
toasts: [
|
|
50
|
+
...filteredToasts,
|
|
51
|
+
toast
|
|
52
|
+
]
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
})));
|
|
56
|
+
var show_undo_default = handler;
|
|
57
|
+
export {
|
|
58
|
+
show_undo_default as default
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=show-undo-RAHLRPUU.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/show-undo.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability, UndoOperation } from '@dxos/app-framework';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/operation';\n\nimport { meta } from '#meta';\n\nimport { DeckCapabilities } from '../types';\n\nconst handler: Operation.WithHandler<typeof UndoOperation.ShowUndo> = UndoOperation.ShowUndo.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const historyTracker = yield* Capability.get(Capabilities.HistoryTracker);\n\n const newUndoId = `show-undo-${Date.now()}`;\n // TODO(wittjosiah): Support undoing further back than the last action.\n yield* Capabilities.updateAtomValue(DeckCapabilities.EphemeralState, (state) => {\n const filteredToasts = state.currentUndoId\n ? state.toasts.filter((toast) => toast.id !== state.currentUndoId)\n : state.toasts;\n\n const toast: LayoutOperation.Toast = {\n id: newUndoId,\n title: input.message ?? ['undo-available.label', { ns: meta.id }],\n duration: 10_000,\n actionLabel: ['undo-action.label', { ns: meta.id }],\n actionAlt: ['undo-action.alt', { ns: meta.id }],\n closeLabel: ['undo-close.label', { ns: meta.id }],\n onAction: () => historyTracker.undoPromise(),\n };\n\n return {\n ...state,\n currentUndoId: newUndoId,\n toasts: [...filteredToasts, toast],\n };\n });\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,YAAYC,qBAAqB;AAExD,SAASC,iBAAiB;AAE1B,SAASC,YAAY;AAIrB,IAAMC,UAAgEC,cAAcC,SAASC,KAC3FC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,QAAMC,iBAAiB,OAAOC,WAAWC,IAAIC,aAAaC,cAAc;AAExE,QAAMC,YAAY,aAAaC,KAAKC,IAAG,CAAA;AAEvC,SAAOJ,aAAaK,gBAAgBC,iBAAiBC,gBAAgB,CAACC,UAAAA;AACpE,UAAMC,iBAAiBD,MAAME,gBACzBF,MAAMG,OAAOC,OAAO,CAACC,WAAUA,OAAMC,OAAON,MAAME,aAAa,IAC/DF,MAAMG;AAEV,UAAME,QAA+B;MACnCC,IAAIZ;MACJa,OAAOnB,MAAMoB,WAAW;QAAC;QAAwB;UAAEC,IAAIC,KAAKJ;QAAG;;MAC/DK,UAAU;MACVC,aAAa;QAAC;QAAqB;UAAEH,IAAIC,KAAKJ;QAAG;;MACjDO,WAAW;QAAC;QAAmB;UAAEJ,IAAIC,KAAKJ;QAAG;;MAC7CQ,YAAY;QAAC;QAAoB;UAAEL,IAAIC,KAAKJ;QAAG;;MAC/CS,UAAU,MAAM1B,eAAe2B,YAAW;IAC5C;AAEA,WAAO;MACL,GAAGhB;MACHE,eAAeR;MACfS,QAAQ;WAAIF;QAAgBI;;IAC9B;EACF,CAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,oBAAexB;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "UndoOperation", "Operation", "meta", "handler", "UndoOperation", "ShowUndo", "pipe", "Operation", "withHandler", "fnUntraced", "input", "historyTracker", "Capability", "get", "Capabilities", "HistoryTracker", "newUndoId", "Date", "now", "updateAtomValue", "DeckCapabilities", "EphemeralState", "state", "filteredToasts", "currentUndoId", "toasts", "filter", "toast", "id", "title", "message", "ns", "meta", "duration", "actionLabel", "actionAlt", "closeLabel", "onAction", "undoPromise"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
DeckCapabilities,
|
|
4
|
+
defaultDeck
|
|
5
|
+
} from "./chunk-4ED7B7OZ.mjs";
|
|
6
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
7
|
+
|
|
8
|
+
// src/operations/switch-workspace.ts
|
|
9
|
+
import * as Effect from "effect/Effect";
|
|
10
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
11
|
+
import { AppCapabilities, isPinnedWorkspace, LayoutOperation } from "@dxos/app-toolkit";
|
|
12
|
+
import { invariant } from "@dxos/invariant";
|
|
13
|
+
import { Operation } from "@dxos/operation";
|
|
14
|
+
import { Graph, Node } from "@dxos/plugin-graph";
|
|
15
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-deck/src/operations/switch-workspace.ts";
|
|
16
|
+
var handler = LayoutOperation.SwitchWorkspace.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
|
|
17
|
+
const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
|
|
18
|
+
{
|
|
19
|
+
const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
20
|
+
const shouldUpdatePrevious = !isPinnedWorkspace(state.activeDeck);
|
|
21
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state2) => {
|
|
22
|
+
const newDecks = state2.decks[input.subject] ? state2.decks : {
|
|
23
|
+
...state2.decks,
|
|
24
|
+
[input.subject]: {
|
|
25
|
+
...defaultDeck
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
...state2,
|
|
30
|
+
previousDeck: shouldUpdatePrevious ? state2.activeDeck : state2.previousDeck,
|
|
31
|
+
activeDeck: input.subject,
|
|
32
|
+
decks: newDecks
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
{
|
|
37
|
+
const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
38
|
+
const deck = state.decks[input.subject];
|
|
39
|
+
invariant(deck, `Deck not found: ${input.subject}`, {
|
|
40
|
+
F: __dxlog_file,
|
|
41
|
+
L: 42,
|
|
42
|
+
S: this,
|
|
43
|
+
A: [
|
|
44
|
+
"deck",
|
|
45
|
+
"`Deck not found: ${input.subject}`"
|
|
46
|
+
]
|
|
47
|
+
});
|
|
48
|
+
const first = deck.solo ? deck.solo : deck.active[0];
|
|
49
|
+
if (first) {
|
|
50
|
+
yield* Operation.schedule(LayoutOperation.ScrollIntoView, {
|
|
51
|
+
subject: first
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
const [item] = Graph.getConnections(graph, input.subject, "child").filter((node) => !Node.isActionLike(node) && !node.properties.disposition);
|
|
55
|
+
if (item) {
|
|
56
|
+
yield* Operation.schedule(LayoutOperation.Open, {
|
|
57
|
+
subject: [
|
|
58
|
+
item.id
|
|
59
|
+
]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
})));
|
|
65
|
+
var switch_workspace_default = handler;
|
|
66
|
+
export {
|
|
67
|
+
switch_workspace_default as default
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=switch-workspace-S6CXDPXZ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/switch-workspace.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities, isPinnedWorkspace, LayoutOperation } from '@dxos/app-toolkit';\nimport { invariant } from '@dxos/invariant';\nimport { Operation } from '@dxos/operation';\nimport { Graph, Node } from '@dxos/plugin-graph';\n\nimport { DeckCapabilities, defaultDeck } from '../types';\n\nconst handler: Operation.WithHandler<typeof LayoutOperation.SwitchWorkspace> = LayoutOperation.SwitchWorkspace.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const { graph } = yield* Capability.get(AppCapabilities.AppGraph);\n\n {\n const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);\n // TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.\n // Ideally this should be worked into the data model in a generic way.\n const shouldUpdatePrevious = !isPinnedWorkspace(state.activeDeck);\n\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => {\n const newDecks = state.decks[input.subject]\n ? state.decks\n : { ...state.decks, [input.subject]: { ...defaultDeck } };\n return {\n ...state,\n previousDeck: shouldUpdatePrevious ? state.activeDeck : state.previousDeck,\n activeDeck: input.subject,\n decks: newDecks,\n };\n });\n }\n\n {\n const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);\n const deck = state.decks[input.subject];\n invariant(deck, `Deck not found: ${input.subject}`);\n\n const first = deck.solo ? deck.solo : deck.active[0];\n if (first) {\n yield* Operation.schedule(LayoutOperation.ScrollIntoView, { subject: first });\n } else {\n const [item] = Graph.getConnections(graph, input.subject, 'child').filter(\n (node) => !Node.isActionLike(node) && !node.properties.disposition,\n );\n if (item) {\n yield* Operation.schedule(LayoutOperation.Open, { subject: [item.id] });\n }\n }\n }\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiBC,mBAAmBC,uBAAuB;AACpE,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,OAAOC,YAAY;;AAI5B,IAAMC,UAAyEC,gBAAgBC,gBAAgBC,KAC7GC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,QAAM,EAAEC,MAAK,IAAK,OAAOC,WAAWC,IAAIC,gBAAgBC,QAAQ;AAEhE;AACE,UAAMC,QAAQ,OAAOC,aAAaC,aAAaC,iBAAiBC,KAAK;AAGrE,UAAMC,uBAAuB,CAACC,kBAAkBN,MAAMO,UAAU;AAEhE,WAAON,aAAaO,gBAAgBL,iBAAiBC,OAAO,CAACJ,WAAAA;AAC3D,YAAMS,WAAWT,OAAMU,MAAMhB,MAAMiB,OAAO,IACtCX,OAAMU,QACN;QAAE,GAAGV,OAAMU;QAAO,CAAChB,MAAMiB,OAAO,GAAG;UAAE,GAAGC;QAAY;MAAE;AAC1D,aAAO;QACL,GAAGZ;QACHa,cAAcR,uBAAuBL,OAAMO,aAAaP,OAAMa;QAC9DN,YAAYb,MAAMiB;QAClBD,OAAOD;MACT;IACF,CAAA;EACF;AAEA;AACE,UAAMT,QAAQ,OAAOC,aAAaC,aAAaC,iBAAiBC,KAAK;AACrE,UAAMU,OAAOd,MAAMU,MAAMhB,MAAMiB,OAAO;AACtCI,cAAUD,MAAM,mBAAmBpB,MAAMiB,OAAO,IAAE;;;;;;;;;AAElD,UAAMK,QAAQF,KAAKG,OAAOH,KAAKG,OAAOH,KAAKI,OAAO,CAAA;AAClD,QAAIF,OAAO;AACT,aAAOzB,UAAU4B,SAAS/B,gBAAgBgC,gBAAgB;QAAET,SAASK;MAAM,CAAA;IAC7E,OAAO;AACL,YAAM,CAACK,IAAAA,IAAQC,MAAMC,eAAe5B,OAAOD,MAAMiB,SAAS,OAAA,EAASa,OACjE,CAACC,SAAS,CAACC,KAAKC,aAAaF,IAAAA,KAAS,CAACA,KAAKG,WAAWC,WAAW;AAEpE,UAAIR,MAAM;AACR,eAAO9B,UAAU4B,SAAS/B,gBAAgB0C,MAAM;UAAEnB,SAAS;YAACU,KAAKU;;QAAI,CAAA;MACvE;IACF;EACF;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,2BAAe5C;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "AppCapabilities", "isPinnedWorkspace", "LayoutOperation", "invariant", "Operation", "Graph", "Node", "handler", "LayoutOperation", "SwitchWorkspace", "pipe", "Operation", "withHandler", "fnUntraced", "input", "graph", "Capability", "get", "AppCapabilities", "AppGraph", "state", "Capabilities", "getAtomValue", "DeckCapabilities", "State", "shouldUpdatePrevious", "isPinnedWorkspace", "activeDeck", "updateAtomValue", "newDecks", "decks", "subject", "defaultDeck", "previousDeck", "deck", "invariant", "first", "solo", "active", "schedule", "ScrollIntoView", "item", "Graph", "getConnections", "filter", "node", "Node", "isActionLike", "properties", "disposition", "Open", "id"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
DECK_COMPANION_TYPE,
|
|
4
|
+
DeckAction,
|
|
5
|
+
DeckCapabilities,
|
|
6
|
+
DeckEvents,
|
|
7
|
+
DeckState,
|
|
8
|
+
EphemeralDeckState,
|
|
9
|
+
PLANK_COMPANION_TYPE,
|
|
10
|
+
PlankSizing,
|
|
11
|
+
Settings_exports,
|
|
12
|
+
StoredDeckState,
|
|
13
|
+
defaultDeck,
|
|
14
|
+
getMode,
|
|
15
|
+
isLayoutMode
|
|
16
|
+
} from "../chunk-4ED7B7OZ.mjs";
|
|
17
|
+
import "../chunk-HSLMI22Q.mjs";
|
|
18
|
+
export {
|
|
19
|
+
DECK_COMPANION_TYPE,
|
|
20
|
+
DeckAction,
|
|
21
|
+
DeckCapabilities,
|
|
22
|
+
DeckEvents,
|
|
23
|
+
DeckState,
|
|
24
|
+
EphemeralDeckState,
|
|
25
|
+
PLANK_COMPANION_TYPE,
|
|
26
|
+
PlankSizing,
|
|
27
|
+
Settings_exports as Settings,
|
|
28
|
+
StoredDeckState,
|
|
29
|
+
defaultDeck,
|
|
30
|
+
getMode,
|
|
31
|
+
isLayoutMode
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=index.mjs.map
|