@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,25 @@
|
|
|
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/add-toast.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.AddToast.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
|
|
13
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.EphemeralState, (state) => ({
|
|
14
|
+
...state,
|
|
15
|
+
toasts: [
|
|
16
|
+
...state.toasts,
|
|
17
|
+
input
|
|
18
|
+
]
|
|
19
|
+
}));
|
|
20
|
+
})));
|
|
21
|
+
var add_toast_default = handler;
|
|
22
|
+
export {
|
|
23
|
+
add_toast_default as default
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=add-toast-G4OQEGOS.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/add-toast.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.AddToast> = LayoutOperation.AddToast.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n yield* Capabilities.updateAtomValue(DeckCapabilities.EphemeralState, (state) => ({\n ...state,\n toasts: [...state.toasts, input as LayoutOperation.Toast],\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,UAAkEC,gBAAgBC,SAASC,KAC/FC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,SAAOC,aAAaC,gBAAgBC,iBAAiBC,gBAAgB,CAACC,WAAW;IAC/E,GAAGA;IACHC,QAAQ;SAAID,MAAMC;MAAQN;;EAC5B,EAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,oBAAeP;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "LayoutOperation", "Operation", "handler", "LayoutOperation", "AddToast", "pipe", "Operation", "withHandler", "fnUntraced", "input", "Capabilities", "updateAtomValue", "DeckCapabilities", "EphemeralState", "state", "toasts"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
Adjust,
|
|
4
|
+
ChangeCompanion
|
|
5
|
+
} from "./chunk-7KL65RLL.mjs";
|
|
6
|
+
import {
|
|
7
|
+
incrementPlank
|
|
8
|
+
} from "./chunk-IRWCUYJY.mjs";
|
|
9
|
+
import {
|
|
10
|
+
computeActiveUpdates
|
|
11
|
+
} from "./chunk-MB4SDDVY.mjs";
|
|
12
|
+
import {
|
|
13
|
+
updateActiveDeck
|
|
14
|
+
} from "./chunk-MLVJ2ODW.mjs";
|
|
15
|
+
import {
|
|
16
|
+
DeckCapabilities,
|
|
17
|
+
PLANK_COMPANION_TYPE
|
|
18
|
+
} from "./chunk-4ED7B7OZ.mjs";
|
|
19
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
20
|
+
|
|
21
|
+
// src/operations/adjust.ts
|
|
22
|
+
import * as Effect from "effect/Effect";
|
|
23
|
+
import * as Function from "effect/Function";
|
|
24
|
+
import * as Option from "effect/Option";
|
|
25
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
26
|
+
import { AppCapabilities, LayoutOperation } from "@dxos/app-toolkit";
|
|
27
|
+
import { Operation } from "@dxos/operation";
|
|
28
|
+
import { AttentionCapabilities } from "@dxos/plugin-attention/types";
|
|
29
|
+
import { Graph } from "@dxos/plugin-graph";
|
|
30
|
+
import { byPosition } from "@dxos/util";
|
|
31
|
+
var handler = Adjust.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
|
|
32
|
+
const _state = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
33
|
+
const deck = yield* DeckCapabilities.getDeck();
|
|
34
|
+
const attention = yield* Capability.get(AttentionCapabilities.Attention);
|
|
35
|
+
const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
|
|
36
|
+
let soloOperation;
|
|
37
|
+
if (input.type === "increment-end" || input.type === "increment-start") {
|
|
38
|
+
const next = incrementPlank(deck.active, input);
|
|
39
|
+
const { deckUpdates } = computeActiveUpdates({
|
|
40
|
+
next,
|
|
41
|
+
deck,
|
|
42
|
+
attention
|
|
43
|
+
});
|
|
44
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, deckUpdates));
|
|
45
|
+
}
|
|
46
|
+
if (input.type.startsWith("solo")) {
|
|
47
|
+
const entryId = input.id;
|
|
48
|
+
if (!deck.solo) {
|
|
49
|
+
soloOperation = {
|
|
50
|
+
type: "solo",
|
|
51
|
+
entryId,
|
|
52
|
+
mode: input.type
|
|
53
|
+
};
|
|
54
|
+
} else {
|
|
55
|
+
if (input.type === "solo--fullscreen") {
|
|
56
|
+
soloOperation = {
|
|
57
|
+
type: "solo",
|
|
58
|
+
entryId,
|
|
59
|
+
mode: "solo--fullscreen"
|
|
60
|
+
};
|
|
61
|
+
} else if (input.type === "solo") {
|
|
62
|
+
soloOperation = {
|
|
63
|
+
type: "unsolo",
|
|
64
|
+
entryId
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (soloOperation?.type === "solo") {
|
|
70
|
+
yield* Operation.invoke(LayoutOperation.SetLayoutMode, {
|
|
71
|
+
subject: soloOperation.entryId,
|
|
72
|
+
mode: soloOperation.mode
|
|
73
|
+
});
|
|
74
|
+
} else if (soloOperation?.type === "unsolo") {
|
|
75
|
+
yield* Operation.invoke(LayoutOperation.SetLayoutMode, {
|
|
76
|
+
mode: "multi"
|
|
77
|
+
});
|
|
78
|
+
yield* Operation.invoke(LayoutOperation.Open, {
|
|
79
|
+
subject: [
|
|
80
|
+
soloOperation.entryId
|
|
81
|
+
]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
if (input.type === "companion") {
|
|
85
|
+
const companion = Function.pipe(Graph.getNode(graph, input.id), Option.map((node) => Graph.getConnections(graph, node.id, "child").filter((n) => n.type === PLANK_COMPANION_TYPE).toSorted((a, b) => byPosition(a.properties, b.properties))), Option.flatMap((companions) => companions.length > 0 ? Option.some(companions[0]) : Option.none()));
|
|
86
|
+
if (Option.isSome(companion)) {
|
|
87
|
+
yield* Operation.invoke(ChangeCompanion, {
|
|
88
|
+
companion: companion.value.id
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
})));
|
|
93
|
+
var adjust_default = handler;
|
|
94
|
+
export {
|
|
95
|
+
adjust_default as default
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=adjust-KSNI7C3B.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/adjust.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\nimport * as Option from 'effect/Option';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/operation';\nimport { AttentionCapabilities } from '@dxos/plugin-attention/types';\nimport { Graph } from '@dxos/plugin-graph';\nimport { byPosition } from '@dxos/util';\n\nimport { incrementPlank } from '../layout';\nimport { DeckCapabilities, PLANK_COMPANION_TYPE } from '../types';\nimport { computeActiveUpdates } from '../util';\nimport { Adjust, ChangeCompanion } from './definitions';\nimport { updateActiveDeck } from './helpers';\n\nconst handler: Operation.WithHandler<typeof Adjust> = Adjust.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const _state = yield* Capabilities.getAtomValue(DeckCapabilities.State);\n const deck = yield* DeckCapabilities.getDeck();\n const attention = yield* Capability.get(AttentionCapabilities.Attention);\n const { graph } = yield* Capability.get(AppCapabilities.AppGraph);\n\n let soloOperation:\n | { type: 'solo'; entryId: string; mode: string }\n | { type: 'unsolo'; entryId: string }\n | undefined;\n\n if (input.type === 'increment-end' || input.type === 'increment-start') {\n const next = incrementPlank(deck.active, input);\n const { deckUpdates } = computeActiveUpdates({ next, deck, attention });\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, deckUpdates));\n }\n\n if (input.type.startsWith('solo')) {\n const entryId = input.id;\n if (!deck.solo) {\n soloOperation = { type: 'solo', entryId, mode: input.type };\n } else {\n if (input.type === 'solo--fullscreen') {\n soloOperation = { type: 'solo', entryId, mode: 'solo--fullscreen' };\n } else if (input.type === 'solo') {\n soloOperation = { type: 'unsolo', entryId };\n }\n }\n }\n\n if (soloOperation?.type === 'solo') {\n yield* Operation.invoke(LayoutOperation.SetLayoutMode, {\n subject: soloOperation.entryId,\n mode: soloOperation.mode,\n });\n } else if (soloOperation?.type === 'unsolo') {\n yield* Operation.invoke(LayoutOperation.SetLayoutMode, { mode: 'multi' });\n yield* Operation.invoke(LayoutOperation.Open, { subject: [soloOperation.entryId] });\n }\n\n if (input.type === 'companion') {\n const companion = Function.pipe(\n Graph.getNode(graph, input.id),\n Option.map((node) =>\n Graph.getConnections(graph, node.id, 'child')\n .filter((n) => n.type === PLANK_COMPANION_TYPE)\n .toSorted((a, b) => byPosition(a.properties, b.properties)),\n ),\n Option.flatMap((companions) => (companions.length > 0 ? Option.some(companions[0]) : Option.none())),\n );\n\n if (Option.isSome(companion)) {\n yield* Operation.invoke(ChangeCompanion, { companion: companion.value.id });\n }\n }\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AACxB,YAAYC,cAAc;AAC1B,YAAYC,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiBC,uBAAuB;AACjD,SAASC,iBAAiB;AAC1B,SAASC,6BAA6B;AACtC,SAASC,aAAa;AACtB,SAASC,kBAAkB;AAQ3B,IAAMC,UAAgDC,OAAOC,KAC3DC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,QAAMC,SAAS,OAAOC,aAAaC,aAAaC,iBAAiBC,KAAK;AACtE,QAAMC,OAAO,OAAOF,iBAAiBG,QAAO;AAC5C,QAAMC,YAAY,OAAOC,WAAWC,IAAIC,sBAAsBC,SAAS;AACvE,QAAM,EAAEC,MAAK,IAAK,OAAOJ,WAAWC,IAAII,gBAAgBC,QAAQ;AAEhE,MAAIC;AAKJ,MAAIhB,MAAMiB,SAAS,mBAAmBjB,MAAMiB,SAAS,mBAAmB;AACtE,UAAMC,OAAOC,eAAeb,KAAKc,QAAQpB,KAAAA;AACzC,UAAM,EAAEqB,YAAW,IAAKC,qBAAqB;MAAEJ;MAAMZ;MAAME;IAAU,CAAA;AACrE,WAAON,aAAaqB,gBAAgBnB,iBAAiBC,OAAO,CAACmB,UAAUC,iBAAiBD,OAAOH,WAAAA,CAAAA;EACjG;AAEA,MAAIrB,MAAMiB,KAAKS,WAAW,MAAA,GAAS;AACjC,UAAMC,UAAU3B,MAAM4B;AACtB,QAAI,CAACtB,KAAKuB,MAAM;AACdb,sBAAgB;QAAEC,MAAM;QAAQU;QAASG,MAAM9B,MAAMiB;MAAK;IAC5D,OAAO;AACL,UAAIjB,MAAMiB,SAAS,oBAAoB;AACrCD,wBAAgB;UAAEC,MAAM;UAAQU;UAASG,MAAM;QAAmB;MACpE,WAAW9B,MAAMiB,SAAS,QAAQ;AAChCD,wBAAgB;UAAEC,MAAM;UAAUU;QAAQ;MAC5C;IACF;EACF;AAEA,MAAIX,eAAeC,SAAS,QAAQ;AAClC,WAAOpB,UAAUkC,OAAOC,gBAAgBC,eAAe;MACrDC,SAASlB,cAAcW;MACvBG,MAAMd,cAAcc;IACtB,CAAA;EACF,WAAWd,eAAeC,SAAS,UAAU;AAC3C,WAAOpB,UAAUkC,OAAOC,gBAAgBC,eAAe;MAAEH,MAAM;IAAQ,CAAA;AACvE,WAAOjC,UAAUkC,OAAOC,gBAAgBG,MAAM;MAAED,SAAS;QAAClB,cAAcW;;IAAS,CAAA;EACnF;AAEA,MAAI3B,MAAMiB,SAAS,aAAa;AAC9B,UAAMmB,YAAqBxC,cACzByC,MAAMC,QAAQzB,OAAOb,MAAM4B,EAAE,GACtBW,WAAI,CAACC,SACVH,MAAMI,eAAe5B,OAAO2B,KAAKZ,IAAI,OAAA,EAClCc,OAAO,CAACC,MAAMA,EAAE1B,SAAS2B,oBAAAA,EACzBC,SAAS,CAACC,GAAGC,MAAMC,WAAWF,EAAEG,YAAYF,EAAEE,UAAU,CAAA,CAAA,GAEtDC,eAAQ,CAACC,eAAgBA,WAAWC,SAAS,IAAWC,YAAKF,WAAW,CAAA,CAAE,IAAWG,YAAI,CAAA,CAAA;AAGlG,QAAWC,cAAOnB,SAAAA,GAAY;AAC5B,aAAOvC,UAAUkC,OAAOyB,iBAAiB;QAAEpB,WAAWA,UAAUqB,MAAM7B;MAAG,CAAA;IAC3E;EACF;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,iBAAelC;",
|
|
6
|
+
"names": ["Effect", "Function", "Option", "Capabilities", "Capability", "AppCapabilities", "LayoutOperation", "Operation", "AttentionCapabilities", "Graph", "byPosition", "handler", "Adjust", "pipe", "Operation", "withHandler", "fnUntraced", "input", "_state", "Capabilities", "getAtomValue", "DeckCapabilities", "State", "deck", "getDeck", "attention", "Capability", "get", "AttentionCapabilities", "Attention", "graph", "AppCapabilities", "AppGraph", "soloOperation", "type", "next", "incrementPlank", "active", "deckUpdates", "computeActiveUpdates", "updateAtomValue", "state", "updateActiveDeck", "startsWith", "entryId", "id", "solo", "mode", "invoke", "LayoutOperation", "SetLayoutMode", "subject", "Open", "companion", "Graph", "getNode", "map", "node", "getConnections", "filter", "n", "PLANK_COMPANION_TYPE", "toSorted", "a", "b", "byPosition", "properties", "flatMap", "companions", "length", "some", "none", "isSome", "ChangeCompanion", "value"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
ChangeCompanion
|
|
4
|
+
} from "./chunk-7KL65RLL.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/change-companion.ts
|
|
14
|
+
import * as Effect from "effect/Effect";
|
|
15
|
+
import { Capabilities } from "@dxos/app-framework";
|
|
16
|
+
import { Operation } from "@dxos/operation";
|
|
17
|
+
import { getLinkedVariant } from "@dxos/react-ui-attention";
|
|
18
|
+
var handler = ChangeCompanion.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
|
|
19
|
+
if (input.companion === null) {
|
|
20
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, {
|
|
21
|
+
companionOpen: false
|
|
22
|
+
}));
|
|
23
|
+
} else {
|
|
24
|
+
const variant = getLinkedVariant(input.companion);
|
|
25
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, {
|
|
26
|
+
companionOpen: true,
|
|
27
|
+
companionVariant: variant
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
})));
|
|
31
|
+
var change_companion_default = handler;
|
|
32
|
+
export {
|
|
33
|
+
change_companion_default as default
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=change-companion-LCJPT6AX.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/change-companion.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities } from '@dxos/app-framework';\nimport { Operation } from '@dxos/operation';\nimport { getLinkedVariant } from '@dxos/react-ui-attention';\n\nimport { DeckCapabilities } from '../types';\nimport { ChangeCompanion } from './definitions';\nimport { updateActiveDeck } from './helpers';\n\nconst handler: Operation.WithHandler<typeof ChangeCompanion> = ChangeCompanion.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n if (input.companion === null) {\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) =>\n updateActiveDeck(state, { companionOpen: false }),\n );\n } else {\n const variant = getLinkedVariant(input.companion);\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) =>\n updateActiveDeck(state, {\n companionOpen: true,\n companionVariant: variant,\n }),\n );\n }\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,oBAAoB;AAC7B,SAASC,iBAAiB;AAC1B,SAASC,wBAAwB;AAMjC,IAAMC,UAAyDC,gBAAgBC,KAC7EC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,MAAIA,MAAMC,cAAc,MAAM;AAC5B,WAAOC,aAAaC,gBAAgBC,iBAAiBC,OAAO,CAACC,UAC3DC,iBAAiBD,OAAO;MAAEE,eAAe;IAAM,CAAA,CAAA;EAEnD,OAAO;AACL,UAAMC,UAAUC,iBAAiBV,MAAMC,SAAS;AAChD,WAAOC,aAAaC,gBAAgBC,iBAAiBC,OAAO,CAACC,UAC3DC,iBAAiBD,OAAO;MACtBE,eAAe;MACfG,kBAAkBF;IACpB,CAAA,CAAA;EAEJ;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,2BAAef;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Operation", "getLinkedVariant", "handler", "ChangeCompanion", "pipe", "Operation", "withHandler", "fnUntraced", "input", "companion", "Capabilities", "updateAtomValue", "DeckCapabilities", "State", "state", "updateActiveDeck", "companionOpen", "variant", "getLinkedVariant", "companionVariant"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
__export
|
|
4
|
+
} from "./chunk-HSLMI22Q.mjs";
|
|
5
|
+
|
|
6
|
+
// src/types/capabilities.ts
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
9
|
+
import { invariant } from "@dxos/invariant";
|
|
10
|
+
import { meta } from "#meta";
|
|
11
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-deck/src/types/capabilities.ts";
|
|
12
|
+
(function(DeckCapabilities2) {
|
|
13
|
+
DeckCapabilities2.Settings = Capability.make(`${meta.id}.capability.settings`);
|
|
14
|
+
DeckCapabilities2.State = Capability.make(`${meta.id}.capability.state`);
|
|
15
|
+
DeckCapabilities2.EphemeralState = Capability.make(`${meta.id}.capability.ephemeral-state`);
|
|
16
|
+
DeckCapabilities2.getDeck = () => Effect.gen(function* () {
|
|
17
|
+
const state = yield* Capabilities.getAtomValue(DeckCapabilities2.State);
|
|
18
|
+
const deck = state.decks[state.activeDeck];
|
|
19
|
+
invariant(deck, `Deck not found: ${state.activeDeck}`, {
|
|
20
|
+
F: __dxlog_file,
|
|
21
|
+
L: 32,
|
|
22
|
+
S: this,
|
|
23
|
+
A: [
|
|
24
|
+
"deck",
|
|
25
|
+
"`Deck not found: ${state.activeDeck}`"
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
return deck;
|
|
29
|
+
});
|
|
30
|
+
})(DeckCapabilities || (DeckCapabilities = {}));
|
|
31
|
+
var DeckCapabilities;
|
|
32
|
+
|
|
33
|
+
// src/types/events.ts
|
|
34
|
+
import { AppActivationEvents } from "@dxos/app-toolkit";
|
|
35
|
+
import { meta as meta2 } from "#meta";
|
|
36
|
+
(function(DeckEvents2) {
|
|
37
|
+
DeckEvents2.StateReady = AppActivationEvents.createStateEvent(`${meta2.id}.state-ready`);
|
|
38
|
+
DeckEvents2.SettingsReady = AppActivationEvents.createSettingsEvent(DeckCapabilities.Settings.identifier);
|
|
39
|
+
})(DeckEvents || (DeckEvents = {}));
|
|
40
|
+
var DeckEvents;
|
|
41
|
+
|
|
42
|
+
// src/types/schema.ts
|
|
43
|
+
import * as Schema2 from "effect/Schema";
|
|
44
|
+
import { Label, LayoutOperation } from "@dxos/app-toolkit";
|
|
45
|
+
import { meta as meta3 } from "#meta";
|
|
46
|
+
|
|
47
|
+
// src/types/Settings.ts
|
|
48
|
+
var Settings_exports = {};
|
|
49
|
+
__export(Settings_exports, {
|
|
50
|
+
Settings: () => Settings
|
|
51
|
+
});
|
|
52
|
+
import * as Schema from "effect/Schema";
|
|
53
|
+
var Settings = Schema.Struct({
|
|
54
|
+
showHints: Schema.optional(Schema.Boolean),
|
|
55
|
+
enableDeck: Schema.optional(Schema.Boolean),
|
|
56
|
+
enableStatusbar: Schema.optional(Schema.Boolean),
|
|
57
|
+
enableNativeRedirect: Schema.optional(Schema.Boolean),
|
|
58
|
+
// TODO(burdon): Rename layoutMode? (e.g., bento | encapsulated?)
|
|
59
|
+
encapsulatedPlanks: Schema.optional(Schema.Boolean)
|
|
60
|
+
}).pipe(Schema.mutable);
|
|
61
|
+
|
|
62
|
+
// src/types/schema.ts
|
|
63
|
+
import { PLANK_COMPANION_TYPE, DECK_COMPANION_TYPE } from "@dxos/app-toolkit";
|
|
64
|
+
var PlankSizing = Schema2.Record({
|
|
65
|
+
key: Schema2.String,
|
|
66
|
+
value: Schema2.Number
|
|
67
|
+
});
|
|
68
|
+
var DeckState = Schema2.Struct({
|
|
69
|
+
/** If false, the deck has not yet left solo mode and new planks should be soloed. */
|
|
70
|
+
initialized: Schema2.Boolean,
|
|
71
|
+
/** Item IDs of planks currently displayed in multi-mode. */
|
|
72
|
+
active: Schema2.mutable(Schema2.Array(Schema2.String)),
|
|
73
|
+
/** Item IDs of planks that have been closed; used for state persistence and reopening. */
|
|
74
|
+
inactive: Schema2.mutable(Schema2.Array(Schema2.String)),
|
|
75
|
+
/** Item ID of the single plank displayed in solo or fullscreen mode. */
|
|
76
|
+
solo: Schema2.optional(Schema2.String),
|
|
77
|
+
/** Whether the solo plank is displayed in fullscreen mode (no heading or sidebars). */
|
|
78
|
+
fullscreen: Schema2.Boolean,
|
|
79
|
+
/** Persisted plank widths in rem, keyed by item ID. */
|
|
80
|
+
plankSizing: Schema2.mutable(PlankSizing),
|
|
81
|
+
/** Whether the companion pane is visible alongside the active plank(s). */
|
|
82
|
+
companionOpen: Schema2.Boolean,
|
|
83
|
+
/** Which companion variant to display when the companion pane is open. */
|
|
84
|
+
companionVariant: Schema2.optional(Schema2.String),
|
|
85
|
+
/** Persisted companion frame widths in rem, keyed by frame ID. */
|
|
86
|
+
companionFrameSizing: Schema2.mutable(PlankSizing)
|
|
87
|
+
});
|
|
88
|
+
var defaultDeck = {
|
|
89
|
+
initialized: false,
|
|
90
|
+
active: [],
|
|
91
|
+
inactive: [],
|
|
92
|
+
solo: void 0,
|
|
93
|
+
fullscreen: false,
|
|
94
|
+
plankSizing: {},
|
|
95
|
+
companionOpen: false,
|
|
96
|
+
companionVariant: void 0,
|
|
97
|
+
companionFrameSizing: {}
|
|
98
|
+
};
|
|
99
|
+
var LayoutMode = Schema2.Literal("multi", "solo", "solo--fullscreen");
|
|
100
|
+
var isLayoutMode = (value) => Schema2.is(LayoutMode)(value);
|
|
101
|
+
var getMode = (deck) => {
|
|
102
|
+
if (deck.solo) {
|
|
103
|
+
return deck.fullscreen ? "solo--fullscreen" : "solo";
|
|
104
|
+
}
|
|
105
|
+
return "multi";
|
|
106
|
+
};
|
|
107
|
+
var StoredDeckState = Schema2.Struct({
|
|
108
|
+
sidebarState: Schema2.Literal("closed", "collapsed", "expanded"),
|
|
109
|
+
complementarySidebarState: Schema2.Literal("closed", "collapsed", "expanded"),
|
|
110
|
+
complementarySidebarPanel: Schema2.optional(Schema2.String),
|
|
111
|
+
activeDeck: Schema2.String,
|
|
112
|
+
previousDeck: Schema2.String,
|
|
113
|
+
decks: Schema2.mutable(Schema2.Record({
|
|
114
|
+
key: Schema2.String,
|
|
115
|
+
value: Schema2.mutable(DeckState)
|
|
116
|
+
})),
|
|
117
|
+
previousMode: Schema2.mutable(Schema2.Record({
|
|
118
|
+
key: Schema2.String,
|
|
119
|
+
value: LayoutMode
|
|
120
|
+
}))
|
|
121
|
+
}).pipe(Schema2.mutable);
|
|
122
|
+
var EphemeralDeckState = Schema2.Struct({
|
|
123
|
+
dialogOpen: Schema2.Boolean,
|
|
124
|
+
dialogType: Schema2.optional(Schema2.Literal("default", "alert")),
|
|
125
|
+
dialogBlockAlign: Schema2.optional(Schema2.Literal("start", "center", "end")),
|
|
126
|
+
dialogOverlayClasses: Schema2.optional(Schema2.String),
|
|
127
|
+
dialogOverlayStyle: Schema2.optional(Schema2.Record({
|
|
128
|
+
key: Schema2.String,
|
|
129
|
+
value: Schema2.Any
|
|
130
|
+
})),
|
|
131
|
+
/** Data to be passed to the dialog Surface. */
|
|
132
|
+
dialogContent: Schema2.NullOr(Schema2.Struct({
|
|
133
|
+
component: Schema2.String,
|
|
134
|
+
props: Schema2.optional(Schema2.Any)
|
|
135
|
+
})),
|
|
136
|
+
popoverOpen: Schema2.Boolean,
|
|
137
|
+
popoverSide: Schema2.optional(Schema2.Literal("top", "right", "bottom", "left")),
|
|
138
|
+
popoverAnchor: Schema2.optional(Schema2.Any),
|
|
139
|
+
popoverAnchorId: Schema2.optional(Schema2.String),
|
|
140
|
+
popoverKind: Schema2.optional(Schema2.Literal("base", "card")),
|
|
141
|
+
popoverTitle: Schema2.optional(Label.annotations({
|
|
142
|
+
description: "The title of the popover."
|
|
143
|
+
})),
|
|
144
|
+
/** Ref of the subject to be passed to the popover Surface. */
|
|
145
|
+
popoverContentRef: Schema2.optional(Schema2.String),
|
|
146
|
+
/** Data to be passed to the popover Surface. */
|
|
147
|
+
popoverContent: Schema2.NullOr(Schema2.Union(Schema2.Struct({
|
|
148
|
+
component: Schema2.String,
|
|
149
|
+
props: Schema2.optional(Schema2.Any)
|
|
150
|
+
}), Schema2.Struct({
|
|
151
|
+
subject: Schema2.Any
|
|
152
|
+
}))),
|
|
153
|
+
toasts: Schema2.mutable(Schema2.Array(LayoutOperation.Toast)),
|
|
154
|
+
currentUndoId: Schema2.optional(Schema2.String),
|
|
155
|
+
/** The identifier of a component to scroll into view when it is mounted. */
|
|
156
|
+
scrollIntoView: Schema2.optional(Schema2.String)
|
|
157
|
+
}).pipe(Schema2.mutable);
|
|
158
|
+
(function(DeckAction2) {
|
|
159
|
+
const PartAdjustmentSchema = Schema2.Union(Schema2.Literal("close").annotations({
|
|
160
|
+
description: "Close the plank."
|
|
161
|
+
}), Schema2.Literal("companion").annotations({
|
|
162
|
+
description: "Open the companion plank."
|
|
163
|
+
}), Schema2.Literal("solo").annotations({
|
|
164
|
+
description: "Solo the plank."
|
|
165
|
+
}), Schema2.Literal("solo--fullscreen").annotations({
|
|
166
|
+
description: "Fullscreen the plank."
|
|
167
|
+
}), Schema2.Literal("increment-start").annotations({
|
|
168
|
+
description: "Move the plank towards the start of the deck."
|
|
169
|
+
}), Schema2.Literal("increment-end").annotations({
|
|
170
|
+
description: "Move the plank towards the end of the deck."
|
|
171
|
+
}));
|
|
172
|
+
DeckAction2.Adjustment = Schema2.mutable(Schema2.Struct({
|
|
173
|
+
id: Schema2.String,
|
|
174
|
+
type: PartAdjustmentSchema
|
|
175
|
+
}));
|
|
176
|
+
class Adjust extends Schema2.TaggedClass()(`${meta3.id}.action.adjust`, {
|
|
177
|
+
input: DeckAction2.Adjustment,
|
|
178
|
+
output: Schema2.Void
|
|
179
|
+
}) {
|
|
180
|
+
}
|
|
181
|
+
DeckAction2.Adjust = Adjust;
|
|
182
|
+
class UpdatePlankSize extends Schema2.TaggedClass()(`${meta3.id}.action.update-plank-size`, {
|
|
183
|
+
input: Schema2.Struct({
|
|
184
|
+
id: Schema2.String,
|
|
185
|
+
size: Schema2.Number
|
|
186
|
+
}),
|
|
187
|
+
output: Schema2.Void
|
|
188
|
+
}) {
|
|
189
|
+
}
|
|
190
|
+
DeckAction2.UpdatePlankSize = UpdatePlankSize;
|
|
191
|
+
class ChangeCompanion extends Schema2.TaggedClass()(`${meta3.id}.action.change-companion`, {
|
|
192
|
+
input: Schema2.Struct({
|
|
193
|
+
companion: Schema2.Union(Schema2.String, Schema2.Null)
|
|
194
|
+
}),
|
|
195
|
+
output: Schema2.Void
|
|
196
|
+
}) {
|
|
197
|
+
}
|
|
198
|
+
DeckAction2.ChangeCompanion = ChangeCompanion;
|
|
199
|
+
})(DeckAction || (DeckAction = {}));
|
|
200
|
+
var DeckAction;
|
|
201
|
+
|
|
202
|
+
export {
|
|
203
|
+
DeckCapabilities,
|
|
204
|
+
DeckEvents,
|
|
205
|
+
Settings_exports,
|
|
206
|
+
PlankSizing,
|
|
207
|
+
DeckState,
|
|
208
|
+
defaultDeck,
|
|
209
|
+
isLayoutMode,
|
|
210
|
+
getMode,
|
|
211
|
+
StoredDeckState,
|
|
212
|
+
EphemeralDeckState,
|
|
213
|
+
DeckAction,
|
|
214
|
+
PLANK_COMPANION_TYPE,
|
|
215
|
+
DECK_COMPANION_TYPE
|
|
216
|
+
};
|
|
217
|
+
//# sourceMappingURL=chunk-4ED7B7OZ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/capabilities.ts", "../../../src/types/events.ts", "../../../src/types/schema.ts", "../../../src/types/Settings.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\n\nimport { meta } from '#meta';\n\nimport { type EphemeralDeckState, type DeckState, type StoredDeckState } from './schema';\nimport * as Settings from './Settings';\n\nexport namespace DeckCapabilities {\n export const Settings = Capability.make<Atom.Writable<Settings.Settings>>(`${meta.id}.capability.settings`);\n\n /** Persisted state (stored in KVS/localStorage). */\n export const State = Capability.make<Atom.Writable<StoredDeckState>>(`${meta.id}.capability.state`);\n\n /** Transient/ephemeral state (not persisted). */\n export const EphemeralState = Capability.make<Atom.Writable<EphemeralDeckState>>(\n `${meta.id}.capability.ephemeral-state`,\n );\n\n /** Get the current active deck from state. */\n export const getDeck = (): Effect.Effect<DeckState, Error, Capability.Service> =>\n Effect.gen(function* () {\n const state = yield* Capabilities.getAtomValue(State);\n const deck = state.decks[state.activeDeck];\n invariant(deck, `Deck not found: ${state.activeDeck}`);\n return deck;\n });\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ActivationEvent } from '@dxos/app-framework';\nimport { AppActivationEvents } from '@dxos/app-toolkit';\n\nimport { meta } from '#meta';\n\nimport { DeckCapabilities } from './capabilities';\n\nexport namespace DeckEvents {\n export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(\n `${meta.id}.state-ready`,\n );\n\n /** Fired when DeckSettings capability is ready. */\n export const SettingsReady: ActivationEvent.ActivationEvent = AppActivationEvents.createSettingsEvent(\n DeckCapabilities.Settings.identifier,\n );\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Label, LayoutOperation } from '@dxos/app-toolkit';\nimport { type DeepReadonly } from '@dxos/util';\n\nimport { meta } from '#meta';\n\nexport * as Settings from './Settings';\n\nexport { PLANK_COMPANION_TYPE, DECK_COMPANION_TYPE } from '@dxos/app-toolkit';\n\nexport type Part = 'solo' | 'multi' | 'complementary';\nexport type ResolvedPart = Part | 'solo-primary' | 'solo-companion';\n\nexport const PlankSizing = Schema.Record({ key: Schema.String, value: Schema.Number });\nexport type PlankSizing = Schema.Schema.Type<typeof PlankSizing>;\n\nexport const DeckState = Schema.Struct({\n /** If false, the deck has not yet left solo mode and new planks should be soloed. */\n initialized: Schema.Boolean,\n /** Item IDs of planks currently displayed in multi-mode. */\n active: Schema.mutable(Schema.Array(Schema.String)),\n /** Item IDs of planks that have been closed; used for state persistence and reopening. */\n inactive: Schema.mutable(Schema.Array(Schema.String)),\n /** Item ID of the single plank displayed in solo or fullscreen mode. */\n solo: Schema.optional(Schema.String),\n /** Whether the solo plank is displayed in fullscreen mode (no heading or sidebars). */\n fullscreen: Schema.Boolean,\n /** Persisted plank widths in rem, keyed by item ID. */\n plankSizing: Schema.mutable(PlankSizing),\n /** Whether the companion pane is visible alongside the active plank(s). */\n companionOpen: Schema.Boolean,\n /** Which companion variant to display when the companion pane is open. */\n companionVariant: Schema.optional(Schema.String),\n /** Persisted companion frame widths in rem, keyed by frame ID. */\n companionFrameSizing: Schema.mutable(PlankSizing),\n});\nexport type DeckState = Schema.Schema.Type<typeof DeckState>;\n\nexport const defaultDeck: DeckState = {\n initialized: false,\n active: [],\n inactive: [],\n solo: undefined,\n fullscreen: false,\n plankSizing: {},\n companionOpen: false,\n companionVariant: undefined,\n companionFrameSizing: {},\n};\n\n//\n// Layout\n//\n\nconst LayoutMode = Schema.Literal('multi', 'solo', 'solo--fullscreen');\nexport type LayoutMode = Schema.Schema.Type<typeof LayoutMode>;\nexport const isLayoutMode = (value: any): value is LayoutMode => Schema.is(LayoutMode)(value);\nexport const getMode = (deck: DeckState | DeepReadonly<DeckState>): LayoutMode => {\n if (deck.solo) {\n return deck.fullscreen ? 'solo--fullscreen' : 'solo';\n }\n\n return 'multi';\n};\n\n// Persisted plugin state (stored in KVS/localStorage).\nexport const StoredDeckState = Schema.Struct({\n sidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),\n complementarySidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),\n complementarySidebarPanel: Schema.optional(Schema.String),\n activeDeck: Schema.String,\n previousDeck: Schema.String,\n decks: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(DeckState) })),\n previousMode: Schema.mutable(Schema.Record({ key: Schema.String, value: LayoutMode })),\n}).pipe(Schema.mutable);\nexport type StoredDeckState = Schema.Schema.Type<typeof StoredDeckState>;\n\n// Transient/ephemeral plugin state (not persisted).\nexport const EphemeralDeckState = Schema.Struct({\n dialogOpen: Schema.Boolean,\n dialogType: Schema.optional(Schema.Literal('default', 'alert')),\n dialogBlockAlign: Schema.optional(Schema.Literal('start', 'center', 'end')),\n dialogOverlayClasses: Schema.optional(Schema.String),\n dialogOverlayStyle: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n /** Data to be passed to the dialog Surface. */\n dialogContent: Schema.NullOr(Schema.Struct({ component: Schema.String, props: Schema.optional(Schema.Any) })),\n popoverOpen: Schema.Boolean,\n popoverSide: Schema.optional(Schema.Literal('top', 'right', 'bottom', 'left')),\n popoverAnchor: Schema.optional(Schema.Any),\n popoverAnchorId: Schema.optional(Schema.String),\n popoverKind: Schema.optional(Schema.Literal('base', 'card')),\n popoverTitle: Schema.optional(Label.annotations({ description: 'The title of the popover.' })),\n /** Ref of the subject to be passed to the popover Surface. */\n popoverContentRef: Schema.optional(Schema.String),\n /** Data to be passed to the popover Surface. */\n popoverContent: Schema.NullOr(\n Schema.Union(\n Schema.Struct({ component: Schema.String, props: Schema.optional(Schema.Any) }),\n Schema.Struct({ subject: Schema.Any }),\n ),\n ),\n toasts: Schema.mutable(Schema.Array(LayoutOperation.Toast)),\n currentUndoId: Schema.optional(Schema.String),\n /** The identifier of a component to scroll into view when it is mounted. */\n scrollIntoView: Schema.optional(Schema.String),\n}).pipe(Schema.mutable);\nexport type EphemeralDeckState = Schema.Schema.Type<typeof EphemeralDeckState>;\n\n// Combined state type (for convenience in components that need both).\nexport type DeckPluginState = StoredDeckState & EphemeralDeckState;\n\nexport namespace DeckAction {\n const PartAdjustmentSchema = Schema.Union(\n Schema.Literal('close').annotations({ description: 'Close the plank.' }),\n Schema.Literal('companion').annotations({ description: 'Open the companion plank.' }),\n Schema.Literal('solo').annotations({ description: 'Solo the plank.' }),\n Schema.Literal('solo--fullscreen').annotations({ description: 'Fullscreen the plank.' }),\n Schema.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),\n Schema.Literal('increment-end').annotations({ description: 'Move the plank towards the end of the deck.' }),\n );\n export type PartAdjustment = Schema.Schema.Type<typeof PartAdjustmentSchema>;\n export const Adjustment = Schema.mutable(Schema.Struct({ id: Schema.String, type: PartAdjustmentSchema }));\n export type Adjustment = Schema.Schema.Type<typeof Adjustment>;\n\n // An atomic transaction to apply to the deck, describing which element to move to which location.\n export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}.action.adjust`, {\n input: Adjustment,\n output: Schema.Void,\n }) {}\n\n export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}.action.update-plank-size`, {\n input: Schema.Struct({\n id: Schema.String,\n size: Schema.Number,\n }),\n output: Schema.Void,\n }) {}\n\n export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${meta.id}.action.change-companion`, {\n input: Schema.Struct({\n companion: Schema.Union(Schema.String, Schema.Null),\n }),\n output: Schema.Void,\n }) {}\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nexport const Settings = Schema.Struct({\n showHints: Schema.optional(Schema.Boolean),\n enableDeck: Schema.optional(Schema.Boolean),\n enableStatusbar: Schema.optional(Schema.Boolean),\n enableNativeRedirect: Schema.optional(Schema.Boolean),\n // TODO(burdon): Rename layoutMode? (e.g., bento | encapsulated?)\n encapsulatedPlanks: Schema.optional(Schema.Boolean),\n}).pipe(Schema.mutable);\nexport interface Settings extends Schema.Schema.Type<typeof Settings> {}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "invariant", "meta", "DeckCapabilities", "Settings", "make", "id", "State", "EphemeralState", "getDeck", "gen", "state", "getAtomValue", "deck", "decks", "activeDeck", "AppActivationEvents", "meta", "DeckEvents", "StateReady", "AppActivationEvents", "createStateEvent", "meta", "id", "SettingsReady", "createSettingsEvent", "DeckCapabilities", "Settings", "identifier", "Schema", "Label", "LayoutOperation", "meta", "Schema", "Settings", "Struct", "showHints", "optional", "Boolean", "enableDeck", "enableStatusbar", "enableNativeRedirect", "encapsulatedPlanks", "pipe", "mutable", "PLANK_COMPANION_TYPE", "DECK_COMPANION_TYPE", "PlankSizing", "Record", "key", "String", "value", "Number", "DeckState", "Struct", "initialized", "Boolean", "active", "mutable", "Array", "inactive", "solo", "optional", "fullscreen", "plankSizing", "companionOpen", "companionVariant", "companionFrameSizing", "defaultDeck", "undefined", "LayoutMode", "Literal", "isLayoutMode", "is", "getMode", "deck", "StoredDeckState", "sidebarState", "complementarySidebarState", "complementarySidebarPanel", "activeDeck", "previousDeck", "decks", "previousMode", "pipe", "EphemeralDeckState", "dialogOpen", "dialogType", "dialogBlockAlign", "dialogOverlayClasses", "dialogOverlayStyle", "Any", "dialogContent", "NullOr", "component", "props", "popoverOpen", "popoverSide", "popoverAnchor", "popoverAnchorId", "popoverKind", "popoverTitle", "Label", "annotations", "description", "popoverContentRef", "popoverContent", "Union", "subject", "toasts", "LayoutOperation", "Toast", "currentUndoId", "scrollIntoView", "DeckAction", "PartAdjustmentSchema", "Adjustment", "id", "type", "Adjust", "TaggedClass", "meta", "input", "output", "Void", "UpdatePlankSize", "size", "ChangeCompanion", "companion", "Null"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
__export
|
|
4
|
+
} from "./chunk-HSLMI22Q.mjs";
|
|
5
|
+
|
|
6
|
+
// src/operations/definitions.ts
|
|
7
|
+
var definitions_exports = {};
|
|
8
|
+
__export(definitions_exports, {
|
|
9
|
+
Adjust: () => Adjust,
|
|
10
|
+
ChangeCompanion: () => ChangeCompanion,
|
|
11
|
+
UpdatePlankSize: () => UpdatePlankSize
|
|
12
|
+
});
|
|
13
|
+
import * as Schema from "effect/Schema";
|
|
14
|
+
import { Capability } from "@dxos/app-framework";
|
|
15
|
+
import { Operation } from "@dxos/operation";
|
|
16
|
+
import { meta } from "#meta";
|
|
17
|
+
var PartAdjustmentSchema = Schema.Union(Schema.Literal("close").annotations({
|
|
18
|
+
description: "Close the plank."
|
|
19
|
+
}), Schema.Literal("companion").annotations({
|
|
20
|
+
description: "Open the companion plank."
|
|
21
|
+
}), Schema.Literal("solo").annotations({
|
|
22
|
+
description: "Solo the plank."
|
|
23
|
+
}), Schema.Literal("solo--fullscreen").annotations({
|
|
24
|
+
description: "Fullscreen the plank."
|
|
25
|
+
}), Schema.Literal("increment-start").annotations({
|
|
26
|
+
description: "Move the plank towards the start of the deck."
|
|
27
|
+
}), Schema.Literal("increment-end").annotations({
|
|
28
|
+
description: "Move the plank towards the end of the deck."
|
|
29
|
+
}));
|
|
30
|
+
var Adjust = Operation.make({
|
|
31
|
+
meta: {
|
|
32
|
+
key: `${meta.id}.operation.adjust`,
|
|
33
|
+
name: "Adjust",
|
|
34
|
+
description: "Adjust the layout of a plank."
|
|
35
|
+
},
|
|
36
|
+
services: [
|
|
37
|
+
Capability.Service
|
|
38
|
+
],
|
|
39
|
+
input: Schema.Struct({
|
|
40
|
+
id: Schema.String.annotations({
|
|
41
|
+
description: "The id of the plank to adjust."
|
|
42
|
+
}),
|
|
43
|
+
type: PartAdjustmentSchema.annotations({
|
|
44
|
+
description: "The type of adjustment to make."
|
|
45
|
+
})
|
|
46
|
+
}),
|
|
47
|
+
output: Schema.Void
|
|
48
|
+
});
|
|
49
|
+
var UpdatePlankSize = Operation.make({
|
|
50
|
+
meta: {
|
|
51
|
+
key: `${meta.id}.operation.update-plank-size`,
|
|
52
|
+
name: "Update Plank Size",
|
|
53
|
+
description: "Update the size of a plank."
|
|
54
|
+
},
|
|
55
|
+
services: [
|
|
56
|
+
Capability.Service
|
|
57
|
+
],
|
|
58
|
+
input: Schema.Struct({
|
|
59
|
+
id: Schema.String.annotations({
|
|
60
|
+
description: "The id of the plank to resize."
|
|
61
|
+
}),
|
|
62
|
+
size: Schema.Number.annotations({
|
|
63
|
+
description: "The new size of the plank."
|
|
64
|
+
})
|
|
65
|
+
}),
|
|
66
|
+
output: Schema.Void
|
|
67
|
+
});
|
|
68
|
+
var ChangeCompanion = Operation.make({
|
|
69
|
+
meta: {
|
|
70
|
+
key: `${meta.id}.operation.change-companion`,
|
|
71
|
+
name: "Change Companion",
|
|
72
|
+
description: "Change the companion plank for a primary plank."
|
|
73
|
+
},
|
|
74
|
+
services: [
|
|
75
|
+
Capability.Service
|
|
76
|
+
],
|
|
77
|
+
input: Schema.Struct({
|
|
78
|
+
companion: Schema.Union(Schema.String, Schema.Null)
|
|
79
|
+
}),
|
|
80
|
+
output: Schema.Void
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
Adjust,
|
|
85
|
+
UpdatePlankSize,
|
|
86
|
+
ChangeCompanion,
|
|
87
|
+
definitions_exports
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=chunk-7KL65RLL.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/definitions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/operation';\n\nimport { meta } from '#meta';\n\nconst PartAdjustmentSchema = Schema.Union(\n Schema.Literal('close').annotations({ description: 'Close the plank.' }),\n Schema.Literal('companion').annotations({ description: 'Open the companion plank.' }),\n Schema.Literal('solo').annotations({ description: 'Solo the plank.' }),\n Schema.Literal('solo--fullscreen').annotations({ description: 'Fullscreen the plank.' }),\n Schema.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),\n Schema.Literal('increment-end').annotations({ description: 'Move the plank towards the end of the deck.' }),\n);\nexport type PartAdjustment = Schema.Schema.Type<typeof PartAdjustmentSchema>;\n\nexport const Adjust = Operation.make({\n meta: {\n key: `${meta.id}.operation.adjust`,\n name: 'Adjust',\n description: 'Adjust the layout of a plank.',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n id: Schema.String.annotations({ description: 'The id of the plank to adjust.' }),\n type: PartAdjustmentSchema.annotations({ description: 'The type of adjustment to make.' }),\n }),\n output: Schema.Void,\n});\n\nexport const UpdatePlankSize = Operation.make({\n meta: {\n key: `${meta.id}.operation.update-plank-size`,\n name: 'Update Plank Size',\n description: 'Update the size of a plank.',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n id: Schema.String.annotations({ description: 'The id of the plank to resize.' }),\n size: Schema.Number.annotations({ description: 'The new size of the plank.' }),\n }),\n output: Schema.Void,\n});\n\n// TODO(burdon): Rename UpdateCompanion?\nexport const ChangeCompanion = Operation.make({\n meta: {\n key: `${meta.id}.operation.change-companion`,\n name: 'Change Companion',\n description: 'Change the companion plank for a primary plank.',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n companion: Schema.Union(Schema.String, Schema.Null),\n }),\n output: Schema.Void,\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;AAAA;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAE1B,SAASC,YAAY;AAErB,IAAMC,uBAA8BC,aAC3BC,eAAQ,OAAA,EAASC,YAAY;EAAEC,aAAa;AAAmB,CAAA,GAC/DF,eAAQ,WAAA,EAAaC,YAAY;EAAEC,aAAa;AAA4B,CAAA,GAC5EF,eAAQ,MAAA,EAAQC,YAAY;EAAEC,aAAa;AAAkB,CAAA,GAC7DF,eAAQ,kBAAA,EAAoBC,YAAY;EAAEC,aAAa;AAAwB,CAAA,GAC/EF,eAAQ,iBAAA,EAAmBC,YAAY;EAAEC,aAAa;AAAgD,CAAA,GACtGF,eAAQ,eAAA,EAAiBC,YAAY;EAAEC,aAAa;AAA8C,CAAA,CAAA;AAIpG,IAAMC,SAASC,UAAUC,KAAK;EACnCC,MAAM;IACJC,KAAK,GAAGD,KAAKE,EAAE;IACfC,MAAM;IACNP,aAAa;EACf;EACAQ,UAAU;IAACC,WAAWC;;EACtBC,OAAcC,cAAO;IACnBN,IAAWO,cAAOd,YAAY;MAAEC,aAAa;IAAiC,CAAA;IAC9Ec,MAAMlB,qBAAqBG,YAAY;MAAEC,aAAa;IAAkC,CAAA;EAC1F,CAAA;EACAe,QAAeC;AACjB,CAAA;AAEO,IAAMC,kBAAkBf,UAAUC,KAAK;EAC5CC,MAAM;IACJC,KAAK,GAAGD,KAAKE,EAAE;IACfC,MAAM;IACNP,aAAa;EACf;EACAQ,UAAU;IAACC,WAAWC;;EACtBC,OAAcC,cAAO;IACnBN,IAAWO,cAAOd,YAAY;MAAEC,aAAa;IAAiC,CAAA;IAC9EkB,MAAaC,cAAOpB,YAAY;MAAEC,aAAa;IAA6B,CAAA;EAC9E,CAAA;EACAe,QAAeC;AACjB,CAAA;AAGO,IAAMI,kBAAkBlB,UAAUC,KAAK;EAC5CC,MAAM;IACJC,KAAK,GAAGD,KAAKE,EAAE;IACfC,MAAM;IACNP,aAAa;EACf;EACAQ,UAAU;IAACC,WAAWC;;EACtBC,OAAcC,cAAO;IACnBS,WAAkBxB,aAAagB,eAAeS,WAAI;EACpD,CAAA;EACAP,QAAeC;AACjB,CAAA;",
|
|
6
|
+
"names": ["Schema", "Capability", "Operation", "meta", "PartAdjustmentSchema", "Union", "Literal", "annotations", "description", "Adjust", "Operation", "make", "meta", "key", "id", "name", "services", "Capability", "Service", "input", "Struct", "String", "type", "output", "Void", "UpdatePlankSize", "size", "Number", "ChangeCompanion", "companion", "Null"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __export = (target, all) => {
|
|
4
|
+
for (var name in all)
|
|
5
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
__export
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=chunk-HSLMI22Q.mjs.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/layout.ts
|
|
4
|
+
import { produce } from "immer";
|
|
5
|
+
var openEntry = (deck, entryId, options) => {
|
|
6
|
+
return produce([
|
|
7
|
+
...deck
|
|
8
|
+
], (draft) => {
|
|
9
|
+
if (draft.find((id) => id === entryId)) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const key = options?.key;
|
|
13
|
+
if (key) {
|
|
14
|
+
const index = draft.findIndex((id) => id.split("+")[0] === key);
|
|
15
|
+
if (index !== -1) {
|
|
16
|
+
draft.splice(index, 1, entryId);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
draft.push(entryId);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
var openSubjectsOnActiveDeck = (active, subject, options) => {
|
|
24
|
+
if (subject.length > 0 && subject.every((id) => active.includes(id))) {
|
|
25
|
+
return [
|
|
26
|
+
...active
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
const { pivotId, key } = options ?? {};
|
|
30
|
+
const pivotIndex = pivotId ? active.findIndex((id) => id === pivotId) : -1;
|
|
31
|
+
const baseDeck = pivotIndex !== -1 ? active.slice(0, pivotIndex + 1) : [
|
|
32
|
+
...active
|
|
33
|
+
];
|
|
34
|
+
return subject.reduce((acc, entryId) => openEntry(acc, entryId, {
|
|
35
|
+
key
|
|
36
|
+
}), baseDeck);
|
|
37
|
+
};
|
|
38
|
+
var closeEntry = (deck, entryId) => {
|
|
39
|
+
return produce(deck, (draft) => {
|
|
40
|
+
const index = draft.findIndex((id) => id === entryId);
|
|
41
|
+
if (index !== -1) {
|
|
42
|
+
draft.splice(index, 1);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
var incrementPlank = (deck, adjustment) => {
|
|
47
|
+
return produce(deck, (draft) => {
|
|
48
|
+
const index = draft.findIndex((id) => id === adjustment.id);
|
|
49
|
+
if (index === -1 || adjustment.type === "increment-start" && index === 0 || adjustment.type === "increment-end" && index === draft.length - 1) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (adjustment.type === "increment-start") {
|
|
53
|
+
[draft[index - 1], draft[index]] = [
|
|
54
|
+
draft[index],
|
|
55
|
+
draft[index - 1]
|
|
56
|
+
];
|
|
57
|
+
} else if (adjustment.type === "increment-end") {
|
|
58
|
+
[draft[index], draft[index + 1]] = [
|
|
59
|
+
draft[index + 1],
|
|
60
|
+
draft[index]
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export {
|
|
67
|
+
openSubjectsOnActiveDeck,
|
|
68
|
+
closeEntry,
|
|
69
|
+
incrementPlank
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=chunk-IRWCUYJY.mjs.map
|