@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
|
@@ -2,39 +2,138 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { APP_SCHEME, AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
10
|
+
import { isTauri } from '@dxos/util';
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
import { DeckCapabilities } from '#types';
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
+
/** Identifier for the native redirect dialog surface (defined in welcome plugin). */
|
|
15
|
+
const NATIVE_REDIRECT_DIALOG = 'org.dxos.plugin.welcome.component.native-redirect-dialog';
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
const checkAppScheme = (url: string) => {
|
|
17
|
-
const iframe = document.createElement('iframe');
|
|
18
|
-
iframe.style.display = 'none';
|
|
19
|
-
document.body.appendChild(iframe);
|
|
17
|
+
const SCHEME_TIMEOUT_MS = 500;
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
const isSafari = (): boolean => {
|
|
20
|
+
const ua = navigator.userAgent;
|
|
21
|
+
return ua.includes('Safari') && !ua.includes('Chrome') && !ua.includes('Chromium');
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** Check if the current page URL can be converted to a valid custom scheme URL. */
|
|
25
|
+
const canRedirectToScheme = (): boolean => {
|
|
26
|
+
try {
|
|
27
|
+
const schemeUrl = APP_SCHEME + window.location.pathname.replace(/^\/+/, '') + window.location.search;
|
|
28
|
+
new URL(schemeUrl);
|
|
29
|
+
return true;
|
|
30
|
+
} catch {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Try to open the native app via custom scheme.
|
|
37
|
+
* Resolves `true` if the app opened (page lost focus), `false` if it didn't within the timeout.
|
|
38
|
+
*/
|
|
39
|
+
const tryOpenNativeApp = (): Promise<boolean> => {
|
|
40
|
+
return new Promise((resolve) => {
|
|
41
|
+
let resolved = false;
|
|
42
|
+
|
|
43
|
+
const onBlur = () => {
|
|
44
|
+
if (!resolved) {
|
|
45
|
+
resolved = true;
|
|
46
|
+
cleanup();
|
|
47
|
+
resolve(true);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const cleanup = () => {
|
|
52
|
+
window.removeEventListener('blur', onBlur);
|
|
53
|
+
document.removeEventListener('visibilitychange', onVisibilityChange);
|
|
54
|
+
};
|
|
22
55
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
56
|
+
const onVisibilityChange = () => {
|
|
57
|
+
if (document.hidden) {
|
|
58
|
+
onBlur();
|
|
59
|
+
}
|
|
60
|
+
};
|
|
26
61
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
62
|
+
window.addEventListener('blur', onBlur);
|
|
63
|
+
document.addEventListener('visibilitychange', onVisibilityChange);
|
|
64
|
+
|
|
65
|
+
// Try the scheme via hidden iframe.
|
|
66
|
+
const schemeUrl = APP_SCHEME + window.location.pathname.replace(/^\/+/, '') + window.location.search;
|
|
67
|
+
const iframe = document.createElement('iframe');
|
|
68
|
+
iframe.style.display = 'none';
|
|
69
|
+
iframe.src = schemeUrl;
|
|
70
|
+
document.body.appendChild(iframe);
|
|
71
|
+
setTimeout(() => iframe.remove(), 3000);
|
|
72
|
+
|
|
73
|
+
// If no blur within timeout, the app isn't running.
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
if (!resolved) {
|
|
76
|
+
resolved = true;
|
|
77
|
+
cleanup();
|
|
78
|
+
resolve(false);
|
|
79
|
+
}
|
|
80
|
+
}, SCHEME_TIMEOUT_MS);
|
|
30
81
|
});
|
|
31
82
|
};
|
|
32
83
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
84
|
+
/** Dispatch all NavigationHandler contributions with the current page URL. */
|
|
85
|
+
const dispatchNavigationHandlers = Effect.fn(function* () {
|
|
86
|
+
const url = new URL(window.location.href);
|
|
87
|
+
const handlers = yield* Capability.getAll(AppCapabilities.NavigationHandler);
|
|
88
|
+
yield* Effect.all(
|
|
89
|
+
handlers.map((handler) => handler(url)),
|
|
90
|
+
{ concurrency: 'unbounded' },
|
|
91
|
+
);
|
|
92
|
+
});
|
|
38
93
|
|
|
39
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Checks whether the native redirect setting is enabled and the redirect should be attempted.
|
|
96
|
+
* Exported for the URL handler to decide whether to defer NavigationHandler dispatch.
|
|
97
|
+
*/
|
|
98
|
+
export const shouldDeferNavigationHandlers = (): boolean => {
|
|
99
|
+
return !isTauri() && !isSafari() && !import.meta.env.DEV && canRedirectToScheme();
|
|
40
100
|
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* When running in a web browser (not Tauri) with native redirect enabled,
|
|
104
|
+
* tries to open the native app via custom scheme. Defers NavigationHandlers
|
|
105
|
+
* to prevent the web app from consuming one-time tokens before the native app.
|
|
106
|
+
*
|
|
107
|
+
* If the app opens: shows dialog with "Open here" callback that dispatches handlers.
|
|
108
|
+
* If the app doesn't open: dispatches handlers immediately.
|
|
109
|
+
* In Safari: universal links handle this natively, so the check is skipped.
|
|
110
|
+
*/
|
|
111
|
+
export default Capability.makeModule(
|
|
112
|
+
Effect.fnUntraced(function* () {
|
|
113
|
+
const capabilities = yield* Capability.Service;
|
|
114
|
+
const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
115
|
+
const settings = yield* Capabilities.getAtomValue(DeckCapabilities.Settings);
|
|
116
|
+
|
|
117
|
+
if (!settings?.enableNativeRedirect || !shouldDeferNavigationHandlers()) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const appOpened = yield* Effect.promise(() => tryOpenNativeApp());
|
|
122
|
+
if (appOpened) {
|
|
123
|
+
const onOpenHere = () =>
|
|
124
|
+
Effect.gen(function* () {
|
|
125
|
+
yield* dispatchNavigationHandlers();
|
|
126
|
+
yield* invoke(LayoutOperation.UpdateDialog, { state: false });
|
|
127
|
+
}).pipe(Effect.provideService(Capability.Service, capabilities), runAndForwardErrors);
|
|
128
|
+
|
|
129
|
+
yield* invoke(LayoutOperation.UpdateDialog, {
|
|
130
|
+
subject: NATIVE_REDIRECT_DIALOG,
|
|
131
|
+
type: 'alert',
|
|
132
|
+
overlayClasses: 'dark bg-neutral-950!',
|
|
133
|
+
props: { onOpenHere },
|
|
134
|
+
});
|
|
135
|
+
} else {
|
|
136
|
+
yield* dispatchNavigationHandlers();
|
|
137
|
+
}
|
|
138
|
+
}),
|
|
139
|
+
);
|
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
6
7
|
|
|
7
|
-
export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
|
|
8
|
-
export const CheckAppScheme = lazy(() => import('./check-app-scheme'));
|
|
9
|
-
export const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export const
|
|
14
|
-
|
|
15
|
-
export const
|
|
16
|
-
export const
|
|
17
|
-
|
|
18
|
-
export * from './capabilities';
|
|
19
|
-
export * from './state';
|
|
8
|
+
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
9
|
+
export const CheckAppScheme = Capability.lazy('CheckAppScheme', () => import('./check-app-scheme'));
|
|
10
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
11
|
+
'OperationHandler',
|
|
12
|
+
() => import('./operation-handler'),
|
|
13
|
+
);
|
|
14
|
+
export const ReactRoot = Capability.lazy('ReactRoot', () => import('./react-root'));
|
|
15
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
16
|
+
export const DeckSettings = Capability.lazy('DeckSettings', () => import('./settings'));
|
|
17
|
+
export const DeckState = Capability.lazy('DeckState', () => import('./state'));
|
|
18
|
+
export const UrlHandler = Capability.lazy('UrlHandler', () => import('./url-handler'));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import type { OperationHandlerSet } from '@dxos/operation';
|
|
9
|
+
|
|
10
|
+
import { DeckOperationHandlerSet } from '#operations';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
13
|
+
Effect.fnUntraced(function* () {
|
|
14
|
+
return Capability.contributes(Capabilities.OperationHandler, DeckOperationHandlerSet);
|
|
15
|
+
}),
|
|
16
|
+
);
|
|
@@ -2,38 +2,46 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
5
6
|
import React, { useCallback } from 'react';
|
|
6
7
|
|
|
7
|
-
import { Capabilities,
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
9
|
|
|
9
|
-
import { DeckLayout } from '
|
|
10
|
-
import {
|
|
10
|
+
import { DeckLayout } from '#containers';
|
|
11
|
+
import { useDeckState } from '#hooks';
|
|
12
|
+
import { meta } from '#meta';
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
export default Capability.makeModule(() =>
|
|
15
|
+
Effect.succeed(
|
|
16
|
+
Capability.contributes(Capabilities.ReactRoot, {
|
|
17
|
+
id: meta.id,
|
|
18
|
+
root: () => {
|
|
19
|
+
const { state, updateEphemeral } = useDeckState();
|
|
13
20
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
const handleDismissToast = useCallback(
|
|
22
|
+
(id: string) => {
|
|
23
|
+
const index = state.toasts.findIndex((toast) => toast.id === id);
|
|
24
|
+
if (index !== -1) {
|
|
25
|
+
// Allow time for the toast to animate out.
|
|
26
|
+
// TODO(burdon): Factor out and unregister timeout.
|
|
27
|
+
setTimeout(() => {
|
|
28
|
+
updateEphemeral((s) => {
|
|
29
|
+
const toastToRemove = s.toasts[index];
|
|
30
|
+
const newCurrentUndoId = toastToRemove?.id === s.currentUndoId ? undefined : s.currentUndoId;
|
|
31
|
+
return {
|
|
32
|
+
...s,
|
|
33
|
+
currentUndoId: newCurrentUndoId,
|
|
34
|
+
toasts: s.toasts.filter((_, i) => i !== index),
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
}, 1_000);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
[state.toasts, updateEphemeral],
|
|
41
|
+
);
|
|
19
42
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// TODO(burdon): Factor out and unregister timeout.
|
|
26
|
-
setTimeout(() => {
|
|
27
|
-
if (layout.toasts[index].id === layout.currentUndoId) {
|
|
28
|
-
layout.currentUndoId = undefined;
|
|
29
|
-
}
|
|
30
|
-
layout.toasts.splice(index, 1);
|
|
31
|
-
}, 1_000);
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
[layout.toasts],
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
return <DeckLayout onDismissToast={handleDismissToast} />;
|
|
38
|
-
},
|
|
39
|
-
});
|
|
43
|
+
return <DeckLayout onDismissToast={handleDismissToast} />;
|
|
44
|
+
},
|
|
45
|
+
}),
|
|
46
|
+
),
|
|
47
|
+
);
|
|
@@ -2,29 +2,35 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
5
6
|
import React from 'react';
|
|
6
7
|
|
|
7
|
-
import { Capabilities,
|
|
8
|
-
import {
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface, useSettingsState } from '@dxos/app-framework/ui';
|
|
10
|
+
import { NOT_FOUND_PATH } from '@dxos/app-toolkit';
|
|
11
|
+
import { AppSurface, NotFoundArticle } from '@dxos/app-toolkit/ui';
|
|
9
12
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { type
|
|
13
|
+
import { DeckSettings } from '#components';
|
|
14
|
+
import { meta } from '#meta';
|
|
15
|
+
import { type Settings } from '#types';
|
|
13
16
|
|
|
14
|
-
export default () =>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
export default Capability.makeModule(() =>
|
|
18
|
+
Effect.succeed(
|
|
19
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
20
|
+
Surface.create({
|
|
21
|
+
id: 'plugin-settings',
|
|
22
|
+
filter: AppSurface.settings(AppSurface.Article, meta.id),
|
|
23
|
+
component: ({ data: { subject } }) => {
|
|
24
|
+
const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);
|
|
25
|
+
return <DeckSettings settings={settings} onSettingsChange={updateSettings} />;
|
|
26
|
+
},
|
|
27
|
+
}),
|
|
28
|
+
Surface.create({
|
|
29
|
+
id: 'not-found',
|
|
30
|
+
role: 'article',
|
|
31
|
+
filter: (data): data is { attendableId: string } => data.attendableId === NOT_FOUND_PATH,
|
|
32
|
+
component: () => <NotFoundArticle />,
|
|
33
|
+
}),
|
|
34
|
+
]),
|
|
35
|
+
),
|
|
36
|
+
);
|
|
@@ -2,25 +2,36 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import { live } from '@dxos/live-object';
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
7
6
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
+
import { createKvsStore } from '@dxos/effect';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
showHints: false,
|
|
14
|
-
enableDeck: false,
|
|
15
|
-
enableStatusbar: false,
|
|
16
|
-
enableNativeRedirect: false,
|
|
17
|
-
newPlankPositioning: 'start',
|
|
18
|
-
overscroll: 'none',
|
|
19
|
-
});
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
import { DeckCapabilities, Settings } from '#types';
|
|
20
13
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
export default Capability.makeModule(() =>
|
|
15
|
+
Effect.sync(() => {
|
|
16
|
+
const settingsAtom = createKvsStore({
|
|
17
|
+
key: meta.id,
|
|
18
|
+
schema: Settings.Settings,
|
|
19
|
+
defaultValue: () => ({
|
|
20
|
+
showHints: false,
|
|
21
|
+
enableDeck: false,
|
|
22
|
+
enableStatusbar: false,
|
|
23
|
+
enableNativeRedirect: !import.meta.env.DEV,
|
|
24
|
+
encapsulatedPlanks: false,
|
|
25
|
+
}),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
return [
|
|
29
|
+
Capability.contributes(DeckCapabilities.Settings, settingsAtom),
|
|
30
|
+
Capability.contributes(AppCapabilities.Settings, {
|
|
31
|
+
prefix: meta.id,
|
|
32
|
+
schema: Settings.Settings,
|
|
33
|
+
atom: settingsAtom,
|
|
34
|
+
}),
|
|
35
|
+
];
|
|
36
|
+
}),
|
|
37
|
+
);
|
|
@@ -2,104 +2,90 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { live } from '@dxos/live-object';
|
|
8
|
-
import { LocalStorageStore } from '@dxos/local-storage';
|
|
9
|
-
import { type SidebarState } from '@dxos/react-ui';
|
|
10
|
-
|
|
11
|
-
import { DECK_PLUGIN } from '../meta';
|
|
12
|
-
import { type DeckPluginState, type DeckState, defaultDeck, getMode } from '../types';
|
|
5
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
13
7
|
|
|
14
|
-
import {
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
10
|
+
import { createKvsStore } from '@dxos/effect';
|
|
11
|
+
import { invariant } from '@dxos/invariant';
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
import { meta } from '#meta';
|
|
14
|
+
import { DeckCapabilities, type EphemeralDeckState, StoredDeckState, defaultDeck, getMode } from '#types';
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
import { sanitizePersistedState } from '../util';
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
/** Default persisted state. */
|
|
19
|
+
const defaultDeckState: StoredDeckState = {
|
|
20
|
+
sidebarState: 'expanded',
|
|
21
|
+
complementarySidebarState: 'collapsed',
|
|
22
|
+
complementarySidebarPanel: undefined,
|
|
23
|
+
activeDeck: 'default',
|
|
24
|
+
previousDeck: 'default',
|
|
25
|
+
decks: {
|
|
26
|
+
default: { ...defaultDeck },
|
|
27
|
+
},
|
|
28
|
+
previousMode: {},
|
|
23
29
|
};
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
/** Default ephemeral state. */
|
|
32
|
+
const defaultDeckEphemeralState: EphemeralDeckState = {
|
|
33
|
+
dialogContent: null,
|
|
34
|
+
dialogOpen: false,
|
|
35
|
+
dialogBlockAlign: undefined,
|
|
36
|
+
dialogType: undefined,
|
|
37
|
+
popoverContent: null,
|
|
38
|
+
popoverAnchor: undefined,
|
|
39
|
+
popoverAnchorId: undefined,
|
|
40
|
+
popoverOpen: false,
|
|
41
|
+
toasts: [],
|
|
42
|
+
currentUndoId: undefined,
|
|
43
|
+
scrollIntoView: undefined,
|
|
31
44
|
};
|
|
32
45
|
|
|
33
|
-
export
|
|
34
|
-
|
|
46
|
+
export default Capability.makeModule(
|
|
47
|
+
Effect.fnUntraced(function* () {
|
|
48
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
35
49
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
dialogBlockAlign: undefined,
|
|
43
|
-
dialogType: undefined,
|
|
44
|
-
popoverContent: null,
|
|
45
|
-
popoverAnchor: undefined,
|
|
46
|
-
popoverAnchorId: undefined,
|
|
47
|
-
popoverOpen: false,
|
|
48
|
-
toasts: [],
|
|
49
|
-
currentUndoId: undefined,
|
|
50
|
-
activeDeck: 'default',
|
|
51
|
-
previousDeck: 'default',
|
|
52
|
-
decks: {
|
|
53
|
-
default: { ...defaultDeck },
|
|
54
|
-
},
|
|
55
|
-
get deck() {
|
|
56
|
-
const deck = this.decks[this.activeDeck];
|
|
57
|
-
invariant(deck, `Deck not found: ${this.activeDeck}`);
|
|
58
|
-
return deck;
|
|
59
|
-
},
|
|
60
|
-
previousMode: {},
|
|
61
|
-
scrollIntoView: undefined,
|
|
62
|
-
});
|
|
50
|
+
// Persisted state using KVS store.
|
|
51
|
+
const stateAtom = createKvsStore({
|
|
52
|
+
key: `${meta.id}.state`,
|
|
53
|
+
schema: StoredDeckState,
|
|
54
|
+
defaultValue: () => ({ ...defaultDeckState }),
|
|
55
|
+
});
|
|
63
56
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
.prop({ key: 'complementarySidebarState', type: LocalStorageStore.enum<SidebarState>() })
|
|
67
|
-
.prop({ key: 'complementarySidebarPanel', type: LocalStorageStore.string({ allowUndefined: true }) })
|
|
68
|
-
.prop({ key: 'decks', type: LocalStorageStore.json<Record<string, DeckState>>() })
|
|
69
|
-
.prop({ key: 'activeDeck', type: LocalStorageStore.string() })
|
|
70
|
-
.prop({ key: 'previousDeck', type: LocalStorageStore.string() });
|
|
57
|
+
// Ephemeral state (not persisted, but kept alive to prevent GC resets).
|
|
58
|
+
const ephemeralAtom = Atom.make<EphemeralDeckState>({ ...defaultDeckEphemeralState }).pipe(Atom.keepAlive);
|
|
71
59
|
|
|
72
|
-
|
|
73
|
-
get
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
get sidebarOpen() {
|
|
80
|
-
return state.values.sidebarState === 'expanded';
|
|
81
|
-
},
|
|
82
|
-
get complementarySidebarOpen() {
|
|
83
|
-
return state.values.complementarySidebarState === 'expanded';
|
|
84
|
-
},
|
|
85
|
-
get workspace() {
|
|
86
|
-
return state.values.activeDeck;
|
|
87
|
-
},
|
|
88
|
-
get active() {
|
|
89
|
-
return state.values.deck.solo ? [state.values.deck.solo] : state.values.deck.active;
|
|
90
|
-
},
|
|
91
|
-
get inactive() {
|
|
92
|
-
return state.values.deck.inactive;
|
|
93
|
-
},
|
|
94
|
-
get scrollIntoView() {
|
|
95
|
-
return state.values.scrollIntoView;
|
|
96
|
-
},
|
|
97
|
-
});
|
|
60
|
+
// Sanitize persisted state on startup (see sanitizePersistedState for details).
|
|
61
|
+
const currentState = registry.get(stateAtom);
|
|
62
|
+
const sanitizedState = sanitizePersistedState(currentState);
|
|
63
|
+
if (sanitizedState !== currentState) {
|
|
64
|
+
registry.set(stateAtom, sanitizedState);
|
|
65
|
+
}
|
|
98
66
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
67
|
+
// Create derived layout atom (read-only) from both state atoms.
|
|
68
|
+
const layoutAtom = Atom.make((get) => {
|
|
69
|
+
const state = get(stateAtom);
|
|
70
|
+
const ephemeral = get(ephemeralAtom);
|
|
71
|
+
const deck = state.decks[state.activeDeck];
|
|
72
|
+
invariant(deck, `Deck not found: ${state.activeDeck}`);
|
|
73
|
+
return {
|
|
74
|
+
mode: getMode(deck),
|
|
75
|
+
dialogOpen: ephemeral.dialogOpen,
|
|
76
|
+
sidebarOpen: state.sidebarState === 'expanded',
|
|
77
|
+
complementarySidebarOpen: state.complementarySidebarState === 'expanded',
|
|
78
|
+
workspace: state.activeDeck,
|
|
79
|
+
active: deck.solo ? [deck.solo] : deck.active,
|
|
80
|
+
inactive: deck.inactive,
|
|
81
|
+
scrollIntoView: ephemeral.scrollIntoView,
|
|
82
|
+
} satisfies AppCapabilities.Layout;
|
|
83
|
+
}).pipe(Atom.keepAlive);
|
|
104
84
|
|
|
105
|
-
|
|
85
|
+
return [
|
|
86
|
+
Capability.contributes(DeckCapabilities.State, stateAtom),
|
|
87
|
+
Capability.contributes(DeckCapabilities.EphemeralState, ephemeralAtom),
|
|
88
|
+
Capability.contributes(AppCapabilities.Layout, layoutAtom),
|
|
89
|
+
];
|
|
90
|
+
}),
|
|
91
|
+
);
|