@dxos/plugin-deck 0.8.4-main.f5c0578 → 0.8.4-main.fcc0d83b33
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-JWJOQNVL.mjs +24 -0
- package/dist/lib/browser/add-toast-JWJOQNVL.mjs.map +7 -0
- package/dist/lib/browser/adjust-RG6LIQLX.mjs +95 -0
- package/dist/lib/browser/adjust-RG6LIQLX.mjs.map +7 -0
- package/dist/lib/browser/chunk-GLB73Q6U.mjs +22 -0
- package/dist/lib/browser/chunk-GLB73Q6U.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-LSZ47AY3.mjs +48 -0
- package/dist/lib/browser/chunk-LSZ47AY3.mjs.map +7 -0
- package/dist/lib/browser/chunk-MARE7ZFK.mjs +215 -0
- package/dist/lib/browser/chunk-MARE7ZFK.mjs.map +7 -0
- package/dist/lib/browser/chunk-XM263CQU.mjs +72 -0
- package/dist/lib/browser/chunk-XM263CQU.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZYYOSX5I.mjs +69 -0
- package/dist/lib/browser/chunk-ZYYOSX5I.mjs.map +7 -0
- package/dist/lib/browser/close-URA766JO.mjs +44 -0
- package/dist/lib/browser/close-URA766JO.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +111 -147
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/open-OPFOOHCQ.mjs +147 -0
- package/dist/lib/browser/open-OPFOOHCQ.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-KP2Y4QLG.mjs +21 -0
- package/dist/lib/browser/revert-workspace-KP2Y4QLG.mjs.map +7 -0
- package/dist/lib/browser/scroll-into-view-S5H2FGSQ.mjs +21 -0
- package/dist/lib/browser/scroll-into-view-S5H2FGSQ.mjs.map +7 -0
- package/dist/lib/browser/set-AEKFFSIX.mjs +37 -0
- package/dist/lib/browser/set-AEKFFSIX.mjs.map +7 -0
- package/dist/lib/browser/set-layout-mode-CWIGQDFZ.mjs +85 -0
- package/dist/lib/browser/set-layout-mode-CWIGQDFZ.mjs.map +7 -0
- package/dist/lib/browser/show-undo-XFVEDKYC.mjs +59 -0
- package/dist/lib/browser/show-undo-XFVEDKYC.mjs.map +7 -0
- package/dist/lib/browser/switch-workspace-DSAAXZSI.mjs +60 -0
- package/dist/lib/browser/switch-workspace-DSAAXZSI.mjs.map +7 -0
- package/dist/lib/browser/translations.mjs +57 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +12 -12
- package/dist/lib/browser/update-companion-IDBBBHT3.mjs +32 -0
- package/dist/lib/browser/update-companion-IDBBBHT3.mjs.map +7 -0
- package/dist/lib/browser/update-complementary-55PNO5MD.mjs +28 -0
- package/dist/lib/browser/update-complementary-55PNO5MD.mjs.map +7 -0
- package/dist/lib/browser/update-dialog-VNARIANC.mjs +29 -0
- package/dist/lib/browser/update-dialog-VNARIANC.mjs.map +7 -0
- package/dist/lib/browser/update-plank-size-H63PRRXS.mjs +28 -0
- package/dist/lib/browser/update-plank-size-H63PRRXS.mjs.map +7 -0
- package/dist/lib/browser/update-popover-ODTPZ3JL.mjs +33 -0
- package/dist/lib/browser/update-popover-ODTPZ3JL.mjs.map +7 -0
- package/dist/lib/browser/update-sidebar-JDVQ36WK.mjs +25 -0
- package/dist/lib/browser/update-sidebar-JDVQ36WK.mjs.map +7 -0
- package/dist/lib/node-esm/add-toast-JUTN4GTI.mjs +25 -0
- package/dist/lib/node-esm/add-toast-JUTN4GTI.mjs.map +7 -0
- package/dist/lib/node-esm/adjust-P5QK33P4.mjs +96 -0
- package/dist/lib/node-esm/adjust-P5QK33P4.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-FO7YDJZ3.mjs +216 -0
- package/dist/lib/node-esm/chunk-FO7YDJZ3.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-KY7ZCANM.mjs +50 -0
- package/dist/lib/node-esm/chunk-KY7ZCANM.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-L7OVX7CV.mjs +73 -0
- package/dist/lib/node-esm/chunk-L7OVX7CV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SHSR2CYO.mjs +24 -0
- package/dist/lib/node-esm/chunk-SHSR2CYO.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WGBUTT5K.mjs +71 -0
- package/dist/lib/node-esm/chunk-WGBUTT5K.mjs.map +7 -0
- package/dist/lib/node-esm/close-U5VC7ERP.mjs +45 -0
- package/dist/lib/node-esm/close-U5VC7ERP.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +139 -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-4B3P5XGS.mjs +148 -0
- package/dist/lib/node-esm/open-4B3P5XGS.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-QD63M2U7.mjs +22 -0
- package/dist/lib/node-esm/revert-workspace-QD63M2U7.mjs.map +7 -0
- package/dist/lib/node-esm/scroll-into-view-G5M2EWK7.mjs +22 -0
- package/dist/lib/node-esm/scroll-into-view-G5M2EWK7.mjs.map +7 -0
- package/dist/lib/node-esm/set-ERJCXZBY.mjs +38 -0
- package/dist/lib/node-esm/set-ERJCXZBY.mjs.map +7 -0
- package/dist/lib/node-esm/set-layout-mode-BOZD7744.mjs +86 -0
- package/dist/lib/node-esm/set-layout-mode-BOZD7744.mjs.map +7 -0
- package/dist/lib/node-esm/show-undo-H5BRBYDC.mjs +60 -0
- package/dist/lib/node-esm/show-undo-H5BRBYDC.mjs.map +7 -0
- package/dist/lib/node-esm/switch-workspace-F54PXE5N.mjs +61 -0
- package/dist/lib/node-esm/switch-workspace-F54PXE5N.mjs.map +7 -0
- package/dist/lib/node-esm/translations.mjs +58 -0
- package/dist/lib/node-esm/translations.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-companion-47LMKL5R.mjs +33 -0
- package/dist/lib/node-esm/update-companion-47LMKL5R.mjs.map +7 -0
- package/dist/lib/node-esm/update-complementary-7VYYG7L2.mjs +29 -0
- package/dist/lib/node-esm/update-complementary-7VYYG7L2.mjs.map +7 -0
- package/dist/lib/node-esm/update-dialog-CABL7OWW.mjs +30 -0
- package/dist/lib/node-esm/update-dialog-CABL7OWW.mjs.map +7 -0
- package/dist/lib/node-esm/update-plank-size-WYTSMZF2.mjs +29 -0
- package/dist/lib/node-esm/update-plank-size-WYTSMZF2.mjs.map +7 -0
- package/dist/lib/node-esm/update-popover-YZDYGL7G.mjs +34 -0
- package/dist/lib/node-esm/update-popover-YZDYGL7G.mjs.map +7 -0
- package/dist/lib/node-esm/update-sidebar-HV736LUN.mjs +26 -0
- package/dist/lib/node-esm/update-sidebar-HV736LUN.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 +136 -46
- 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 +61 -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/{components/DeckLayout → containers/Deck}/Banner.d.ts +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 +61 -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 +39 -0
- package/dist/types/src/containers/Deck/DeckRoot.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckViewport.d.ts +16 -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 +63 -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 +61 -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/{components → containers}/Sidebar/SidebarButton.d.ts +1 -1
- 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/useBreakpoints.d.ts +1 -1
- package/dist/types/src/hooks/useCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +4 -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/useMainSize.d.ts.map +1 -1
- 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/close.d.ts +5 -0
- package/dist/types/src/operations/close.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +15 -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-companion.d.ts +5 -0
- package/dist/types/src/operations/update-companion.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 +42 -53
- 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 +101 -94
- 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 +66 -64
- 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 +90 -56
- package/src/DeckPlugin.ts +44 -71
- 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 +58 -51
- package/src/capabilities/url-handler.ts +221 -50
- package/src/components/DeckSettings/DeckSettings.stories.tsx +38 -0
- package/src/components/DeckSettings/DeckSettings.tsx +19 -73
- package/src/components/DeckSettings/index.ts +2 -2
- package/src/components/Matrix/Matrix.stories.tsx +220 -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 +397 -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 +108 -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 +210 -0
- package/src/containers/Sidebar/Sidebar.tsx +44 -0
- package/src/containers/Sidebar/SidebarButton.tsx +100 -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 +8 -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/close.ts +35 -0
- package/src/operations/definitions.ts +49 -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-companion.ts +35 -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 +42 -52
- package/src/types/Settings.ts +42 -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 +51 -56
- 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}/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/index.d.ts +0 -0
- /package/src/{components → containers}/Sidebar/index.ts +0 -0
|
@@ -5,80 +5,87 @@
|
|
|
5
5
|
// ISSUE(burdon): tools
|
|
6
6
|
// @ts-nocheck
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import * as Effect from 'effect/Effect';
|
|
9
|
+
import * as Schema from 'effect/Schema';
|
|
9
10
|
|
|
10
11
|
import {
|
|
11
12
|
Capabilities,
|
|
13
|
+
Capability,
|
|
12
14
|
LayoutAction,
|
|
13
15
|
type PromiseIntentDispatcher,
|
|
14
|
-
contributes,
|
|
15
16
|
createIntent,
|
|
16
17
|
} from '@dxos/app-framework';
|
|
18
|
+
import { type OperationInvoker } from '@dxos/app-framework/plugin-operation/invoker';
|
|
19
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
17
20
|
import { invariant } from '@dxos/invariant';
|
|
18
21
|
import { trim } from '@dxos/util';
|
|
19
22
|
|
|
20
|
-
import { meta } from '
|
|
21
|
-
import { DeckAction } from '../types';
|
|
23
|
+
import { meta } from '#meta';
|
|
22
24
|
|
|
23
25
|
// TODO(burdon): Factor out.
|
|
24
26
|
declare global {
|
|
25
27
|
interface ToolContextExtensions {
|
|
26
28
|
dispatch?: PromiseIntentDispatcher;
|
|
27
29
|
pivotId?: string;
|
|
28
|
-
part?: '
|
|
30
|
+
part?: 'multi' | 'dialog';
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
export default () =>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
export default Capability.makeModule(() =>
|
|
35
|
+
Effect.succeed(
|
|
36
|
+
Capability.contributes(Capabilities.Tools, [
|
|
37
|
+
createTool(meta.id, {
|
|
38
|
+
name: 'show',
|
|
39
|
+
description: trim`
|
|
37
40
|
Show an item as a companion to an existing plank.
|
|
38
41
|
When supplying IDs, they must be fully qualified like this: space-key:object-id
|
|
39
42
|
`,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
caption: 'Showing item...',
|
|
44
|
+
// TODO(wittjosiah): Refactor Layout/Navigation/Deck actions so that they can be used directly.
|
|
45
|
+
schema: Schema.Struct({
|
|
46
|
+
id: Schema.String.annotations({
|
|
47
|
+
description: 'The ID of the item to show.',
|
|
48
|
+
}),
|
|
45
49
|
}),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
execute: async ({ id }, { extensions }) => {
|
|
51
|
+
invariant(extensions);
|
|
52
|
+
const { pivotId, dispatch, invokePromise, part } = extensions as {
|
|
53
|
+
pivotId: string;
|
|
54
|
+
dispatch: PromiseIntentDispatcher;
|
|
55
|
+
invokePromise: OperationInvoker['invokePromise'];
|
|
56
|
+
part: string;
|
|
57
|
+
};
|
|
58
|
+
invariant(pivotId, 'No pivot ID');
|
|
59
|
+
invariant(invokePromise, 'No operation invoker');
|
|
52
60
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (error) {
|
|
61
|
-
return ToolResult.Error(error.message);
|
|
62
|
-
}
|
|
61
|
+
if (part === 'multi') {
|
|
62
|
+
const { error } = await invokePromise(LayoutOperation.UpdateCompanion, {
|
|
63
|
+
subject: id,
|
|
64
|
+
});
|
|
65
|
+
if (error) {
|
|
66
|
+
return ToolResult.Error(error.message);
|
|
67
|
+
}
|
|
63
68
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
69
|
+
return ToolResult.Success({});
|
|
70
|
+
} else {
|
|
71
|
+
const { data, error } = await dispatch(
|
|
72
|
+
createIntent(LayoutAction.Open, {
|
|
73
|
+
subject: [id],
|
|
74
|
+
part: 'main',
|
|
75
|
+
options: {
|
|
76
|
+
pivotId,
|
|
77
|
+
positioning: 'end',
|
|
78
|
+
},
|
|
79
|
+
}),
|
|
80
|
+
);
|
|
81
|
+
if (error) {
|
|
82
|
+
return ToolResult.Error(error.message);
|
|
83
|
+
}
|
|
79
84
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
return ToolResult.Success(data);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
}),
|
|
89
|
+
]),
|
|
90
|
+
),
|
|
91
|
+
);
|
|
@@ -2,59 +2,230 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import { scheduledEffect } from '@dxos/echo-signals/core';
|
|
7
|
-
|
|
8
|
-
import { defaultDeck } from '../types';
|
|
9
|
-
|
|
10
|
-
import { DeckCapabilities } from './capabilities';
|
|
11
|
-
|
|
12
|
-
// TODO(wittjosiah): Cleanup the url handling. May justify introducing routing capabilities.
|
|
13
|
-
export default async (context: PluginContext) => {
|
|
14
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
15
|
-
const state = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
16
|
-
|
|
17
|
-
const handleNavigation = async () => {
|
|
18
|
-
const pathname = window.location.pathname;
|
|
19
|
-
if (pathname === '/reset') {
|
|
20
|
-
state.activeDeck = 'default';
|
|
21
|
-
state.decks = {
|
|
22
|
-
default: { ...defaultDeck },
|
|
23
|
-
};
|
|
24
|
-
window.location.pathname = '/';
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
27
6
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import {
|
|
9
|
+
AppCapabilities,
|
|
10
|
+
LayoutOperation,
|
|
11
|
+
NOT_FOUND_PATH,
|
|
12
|
+
expandPath,
|
|
13
|
+
fromUrlPath,
|
|
14
|
+
getWorkspaceFromPath,
|
|
15
|
+
toUrlPath,
|
|
16
|
+
} from '@dxos/app-toolkit';
|
|
17
|
+
import { Operation } from '@dxos/compute';
|
|
18
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
19
|
+
import { invariant } from '@dxos/invariant';
|
|
20
|
+
import { log } from '@dxos/log';
|
|
21
|
+
import { Node } from '@dxos/plugin-graph';
|
|
22
|
+
import { isTauri } from '@dxos/util';
|
|
23
|
+
|
|
24
|
+
import { DeckCapabilities, type StoredDeckState, defaultDeck } from '#types';
|
|
25
|
+
|
|
26
|
+
import { updateActiveDeck } from '../operations/helpers';
|
|
27
|
+
import { deserializePlanks, serializePlanks, stripPlanks } from '../util';
|
|
28
|
+
import { shouldDeferNavigationHandlers } from './check-app-scheme';
|
|
29
|
+
|
|
30
|
+
/** Dispatch all NavigationHandler contributions with a given URL. */
|
|
31
|
+
const dispatchNavigationHandlers = Effect.fn(function* (url: URL) {
|
|
32
|
+
const handlers = yield* Capability.getAll(AppCapabilities.NavigationHandler);
|
|
33
|
+
yield* Effect.all(
|
|
34
|
+
handlers.map((handler) => handler(url)),
|
|
35
|
+
{ concurrency: 'unbounded' },
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export default Capability.makeModule(
|
|
40
|
+
Effect.fnUntraced(function* () {
|
|
41
|
+
const operationService = yield* Capability.get(Capabilities.OperationInvoker);
|
|
42
|
+
const capabilities = yield* Capability.Service;
|
|
43
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
44
|
+
const stateAtom = yield* Capability.get(DeckCapabilities.State);
|
|
45
|
+
const settingsAtom = yield* Capability.get(DeckCapabilities.Settings);
|
|
46
|
+
|
|
47
|
+
const provideServices = <A, E>(effect: Effect.Effect<A, E, Capability.Service | Operation.Service>) =>
|
|
48
|
+
effect.pipe(
|
|
49
|
+
Effect.provideService(Capability.Service, capabilities),
|
|
50
|
+
Effect.provideService(Operation.Service, operationService),
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
// Helper to get state.
|
|
54
|
+
const getState = () => registry.get(stateAtom);
|
|
55
|
+
|
|
56
|
+
// Helper to get computed deck from state.
|
|
57
|
+
const getDeck = () => {
|
|
58
|
+
const state = getState();
|
|
59
|
+
const deck = state.decks[state.activeDeck];
|
|
60
|
+
invariant(deck, `Deck not found: ${state.activeDeck}`);
|
|
61
|
+
return deck;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// Helper to update state.
|
|
65
|
+
const updateState = (fn: (current: StoredDeckState) => StoredDeckState) => {
|
|
66
|
+
registry.set(stateAtom, fn(getState()));
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const handleNavigation = Effect.fn(function* (url?: URL) {
|
|
70
|
+
const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
|
|
71
|
+
const resolvedUrl = url ?? new URL(window.location.href);
|
|
72
|
+
// When native redirect is active, check-app-scheme owns the initial dispatch
|
|
73
|
+
// to prevent one-time tokens from being consumed before the native app can use them.
|
|
74
|
+
const settings = registry.get(settingsAtom);
|
|
75
|
+
const deferHandlers = settings?.enableNativeRedirect && shouldDeferNavigationHandlers();
|
|
76
|
+
if (!deferHandlers) {
|
|
77
|
+
yield* dispatchNavigationHandlers(resolvedUrl);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const pathname = resolvedUrl.pathname;
|
|
81
|
+
const state = getState();
|
|
82
|
+
if (pathname === '/reset') {
|
|
83
|
+
updateState((s) => ({
|
|
84
|
+
...s,
|
|
85
|
+
activeDeck: 'default',
|
|
86
|
+
decks: {
|
|
87
|
+
default: { ...defaultDeck },
|
|
88
|
+
},
|
|
89
|
+
}));
|
|
90
|
+
window.location.pathname = '/';
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const qualifiedId = fromUrlPath(pathname);
|
|
95
|
+
const workspace = getWorkspaceFromPath(qualifiedId);
|
|
96
|
+
if (workspace !== Node.RootId && workspace !== state.activeDeck) {
|
|
97
|
+
yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: workspace });
|
|
98
|
+
}
|
|
32
99
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
100
|
+
const deck = getDeck();
|
|
101
|
+
const activeId = qualifiedId !== workspace ? qualifiedId : undefined;
|
|
102
|
+
if (activeId) {
|
|
103
|
+
// Ensure the object referenced by the URL is open in the deck.
|
|
104
|
+
// Open validates the target and may redirect to 404, returning the resolved IDs.
|
|
105
|
+
const resolvedIds = yield* Operation.invoke(LayoutOperation.Open, { subject: [activeId] });
|
|
106
|
+
// If not already in solo mode, switch to solo for the resolved target.
|
|
107
|
+
if (!deck.solo) {
|
|
108
|
+
yield* Operation.invoke(LayoutOperation.SetLayoutMode, {
|
|
109
|
+
subject: resolvedIds?.[0] ?? activeId,
|
|
110
|
+
mode: 'solo',
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
} else if (deck.solo && deck.solo !== NOT_FOUND_PATH) {
|
|
114
|
+
// Stay in solo mode; redirect URL to reflect the current solo item.
|
|
115
|
+
// Do not switch to deck mode here — only explicit user action should change layout mode.
|
|
116
|
+
const path = toUrlPath(deck.solo);
|
|
117
|
+
if (window.location.pathname !== path) {
|
|
118
|
+
history.replaceState(null, '', `${path}${stripPlanks(window.location.search)}`);
|
|
119
|
+
}
|
|
120
|
+
} else if (!activeId && !deck.solo) {
|
|
121
|
+
// Multi-mode: restore planks from query params.
|
|
122
|
+
const plankIds = deserializePlanks(resolvedUrl);
|
|
123
|
+
if (plankIds.length > 0) {
|
|
124
|
+
for (const plankId of plankIds) {
|
|
125
|
+
expandPath(graph, plankId);
|
|
126
|
+
}
|
|
127
|
+
updateState((state) => updateActiveDeck(state, { active: plankIds, initialized: true }));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
const onPopState = () => void runAndForwardErrors(provideServices(handleNavigation()));
|
|
133
|
+
|
|
134
|
+
// Initial navigation.
|
|
135
|
+
yield* provideServices(handleNavigation());
|
|
136
|
+
window.addEventListener('popstate', onPopState);
|
|
137
|
+
|
|
138
|
+
// Tauri deep link support.
|
|
139
|
+
let unlistenDeepLink: (() => void) | undefined;
|
|
140
|
+
if (isTauri()) {
|
|
141
|
+
yield* Effect.gen(function* () {
|
|
142
|
+
const { getCurrent, onOpenUrl } = yield* Effect.promise(() => import('@tauri-apps/plugin-deep-link'));
|
|
143
|
+
|
|
144
|
+
const launchUrls = yield* Effect.promise(() => getCurrent());
|
|
145
|
+
if (launchUrls && launchUrls.length > 0) {
|
|
146
|
+
log('app launched with deep links', { urls: launchUrls });
|
|
147
|
+
for (const urlString of launchUrls) {
|
|
148
|
+
yield* provideServices(handleDeepLink(urlString, handleNavigation));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
unlistenDeepLink = yield* Effect.promise(() =>
|
|
153
|
+
onOpenUrl((urls) => {
|
|
154
|
+
for (const urlString of urls) {
|
|
155
|
+
void runAndForwardErrors(provideServices(handleDeepLink(urlString, handleNavigation)));
|
|
156
|
+
}
|
|
157
|
+
}),
|
|
158
|
+
);
|
|
159
|
+
}).pipe(
|
|
160
|
+
Effect.catchAll((error) => Effect.sync(() => log.warn('failed to initialize deep link listener', { error }))),
|
|
36
161
|
);
|
|
37
|
-
} else if (!nextSolo && state.deck.solo) {
|
|
38
|
-
await dispatch(createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { mode: 'deck' } }));
|
|
39
162
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
163
|
+
|
|
164
|
+
// Sync URL with layout state changes.
|
|
165
|
+
let lastSolo: string | undefined;
|
|
166
|
+
let lastActiveDeck: string | undefined;
|
|
167
|
+
let lastActiveKey: string | undefined;
|
|
168
|
+
const unsubscribe = registry.subscribe(stateAtom, () => {
|
|
169
|
+
const state = getState();
|
|
170
|
+
const deck = getDeck();
|
|
171
|
+
const solo = deck.solo;
|
|
172
|
+
const activeDeck = state.activeDeck;
|
|
173
|
+
const activeKey = solo ? undefined : JSON.stringify(deck.active);
|
|
174
|
+
|
|
175
|
+
if (solo !== lastSolo || activeDeck !== lastActiveDeck || activeKey !== lastActiveKey) {
|
|
176
|
+
lastSolo = solo;
|
|
177
|
+
lastActiveDeck = activeDeck;
|
|
178
|
+
lastActiveKey = activeKey;
|
|
179
|
+
|
|
180
|
+
const path = solo && solo !== NOT_FOUND_PATH ? toUrlPath(solo) : toUrlPath(activeDeck);
|
|
181
|
+
const search = !solo
|
|
182
|
+
? serializePlanks(deck.active, window.location.search)
|
|
183
|
+
: stripPlanks(window.location.search);
|
|
184
|
+
const newUrl = `${path}${search}`;
|
|
185
|
+
|
|
186
|
+
if (`${window.location.pathname}${window.location.search}` !== newUrl) {
|
|
187
|
+
history.pushState(null, '', newUrl);
|
|
188
|
+
}
|
|
52
189
|
}
|
|
53
|
-
}
|
|
54
|
-
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
return Capability.contributes(Capabilities.Null, null, () =>
|
|
193
|
+
Effect.sync(() => {
|
|
194
|
+
window.removeEventListener('popstate', onPopState);
|
|
195
|
+
unsubscribe();
|
|
196
|
+
unlistenDeepLink?.();
|
|
197
|
+
}),
|
|
198
|
+
);
|
|
199
|
+
}),
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
/** Check if a path is a redirect path handled elsewhere (e.g., OAuth). */
|
|
203
|
+
const isRedirectPath = (pathname: string): boolean => pathname.startsWith('/redirect/');
|
|
204
|
+
|
|
205
|
+
/** Handle a deep link URL string. Merges query params into window.location and navigates. */
|
|
206
|
+
const handleDeepLink = Effect.fn(function* (urlString: string, navigate: (url?: URL) => Effect.Effect<void, any, any>) {
|
|
207
|
+
log('deep link received', { url: urlString });
|
|
208
|
+
|
|
209
|
+
const deepLinkUrl = new URL(urlString);
|
|
210
|
+
|
|
211
|
+
// For custom schemes (e.g., composer://a/b/c), new URL() treats the first segment as the
|
|
212
|
+
// hostname. Reconstruct the full path from hostname + pathname.
|
|
213
|
+
const fullPath =
|
|
214
|
+
deepLinkUrl.protocol !== 'https:' && deepLinkUrl.protocol !== 'http:' && deepLinkUrl.hostname
|
|
215
|
+
? '/' + deepLinkUrl.hostname + deepLinkUrl.pathname
|
|
216
|
+
: deepLinkUrl.pathname;
|
|
217
|
+
|
|
218
|
+
if (isRedirectPath(fullPath)) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Merge deep link query params into the current window URL so handlers can read them.
|
|
223
|
+
const current = new URL(window.location.href);
|
|
224
|
+
if (deepLinkUrl.search) {
|
|
225
|
+
deepLinkUrl.searchParams.forEach((value, key) => current.searchParams.set(key, value));
|
|
226
|
+
}
|
|
227
|
+
current.pathname = fullPath;
|
|
228
|
+
history.replaceState(null, '', current.pathname + current.search);
|
|
55
229
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
unsubscribe();
|
|
59
|
-
});
|
|
60
|
-
};
|
|
230
|
+
yield* navigate(current);
|
|
231
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
|
|
7
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
8
|
+
|
|
9
|
+
import { translations } from '#translations';
|
|
10
|
+
|
|
11
|
+
import { DeckSettings } from './DeckSettings';
|
|
12
|
+
|
|
13
|
+
const meta = {
|
|
14
|
+
title: 'plugins/plugin-deck/components/DeckSettings',
|
|
15
|
+
tags: ['settings'],
|
|
16
|
+
component: DeckSettings,
|
|
17
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
18
|
+
parameters: {
|
|
19
|
+
layout: 'fullscreen',
|
|
20
|
+
translations,
|
|
21
|
+
},
|
|
22
|
+
} satisfies Meta<typeof DeckSettings>;
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
|
+
|
|
28
|
+
export const Default: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
settings: {
|
|
31
|
+
enableDeck: true,
|
|
32
|
+
encapsulatedPlanks: false,
|
|
33
|
+
enableStatusbar: true,
|
|
34
|
+
showHints: true,
|
|
35
|
+
enableNativeRedirect: false,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -4,85 +4,31 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { Settings as SettingsForm } from '@dxos/react-ui-form';
|
|
9
10
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
type DeckSettingsProps,
|
|
13
|
-
type NewPlankPositioning,
|
|
14
|
-
NewPlankPositions,
|
|
15
|
-
type Overscroll,
|
|
16
|
-
OverscrollOptions,
|
|
17
|
-
} from '../../types';
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
import { Settings } from '#types';
|
|
18
13
|
|
|
19
14
|
const isSocket = !!(globalThis as any).__args;
|
|
20
15
|
|
|
21
|
-
export
|
|
22
|
-
|
|
16
|
+
export type DeckSettingsProps = AppSurface.SettingsArticleProps<Settings.Settings>;
|
|
17
|
+
|
|
18
|
+
export const DeckSettings = ({ settings, onSettingsChange }: DeckSettingsProps) => {
|
|
19
|
+
const { t } = useTranslation(meta.id);
|
|
23
20
|
|
|
24
21
|
return (
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
onValueChange={(value) => (settings.newPlankPositioning = value as NewPlankPositioning)}
|
|
34
|
-
>
|
|
35
|
-
<Select.TriggerButton placeholder={t('select new plank positioning placeholder')} />
|
|
36
|
-
<Select.Portal>
|
|
37
|
-
<Select.Content>
|
|
38
|
-
<Select.Viewport>
|
|
39
|
-
{NewPlankPositions.map((position) => (
|
|
40
|
-
<Select.Option key={position} value={position}>
|
|
41
|
-
{t(`settings new plank position ${position} label`)}
|
|
42
|
-
</Select.Option>
|
|
43
|
-
))}
|
|
44
|
-
</Select.Viewport>
|
|
45
|
-
</Select.Content>
|
|
46
|
-
</Select.Portal>
|
|
47
|
-
</Select.Root>
|
|
48
|
-
</DeprecatedFormInput>
|
|
49
|
-
<DeprecatedFormInput label={t('settings overscroll label')}>
|
|
50
|
-
<Select.Root
|
|
51
|
-
disabled={!settings.enableDeck}
|
|
52
|
-
value={settings.overscroll ?? 'none'}
|
|
53
|
-
onValueChange={(value) => (settings.overscroll = value as Overscroll)}
|
|
54
|
-
>
|
|
55
|
-
<Select.TriggerButton placeholder={t('select overscroll placeholder')} />
|
|
56
|
-
<Select.Portal>
|
|
57
|
-
<Select.Content>
|
|
58
|
-
<Select.Viewport>
|
|
59
|
-
{OverscrollOptions.map((option) => (
|
|
60
|
-
<Select.Option key={option} value={option}>
|
|
61
|
-
{t(`settings overscroll ${option} label`)}
|
|
62
|
-
</Select.Option>
|
|
63
|
-
))}
|
|
64
|
-
</Select.Viewport>
|
|
65
|
-
</Select.Content>
|
|
66
|
-
</Select.Portal>
|
|
67
|
-
</Select.Root>
|
|
68
|
-
</DeprecatedFormInput>
|
|
69
|
-
<DeprecatedFormInput label={t('settings enable statusbar label')}>
|
|
70
|
-
<Input.Switch
|
|
71
|
-
checked={settings.enableStatusbar}
|
|
72
|
-
onCheckedChange={(checked) => (settings.enableStatusbar = checked)}
|
|
22
|
+
<SettingsForm.Viewport>
|
|
23
|
+
<SettingsForm.Section title={t('settings.title', { ns: meta.id })}>
|
|
24
|
+
<SettingsForm.FieldSet
|
|
25
|
+
readonly={!onSettingsChange}
|
|
26
|
+
schema={Settings.Settings}
|
|
27
|
+
visible={(path) => path !== 'enableNativeRedirect' || !isSocket}
|
|
28
|
+
values={settings}
|
|
29
|
+
onValuesChanged={(values) => onSettingsChange?.(() => values)}
|
|
73
30
|
/>
|
|
74
|
-
</
|
|
75
|
-
|
|
76
|
-
<Input.Switch checked={settings.showHints} onCheckedChange={(checked) => (settings.showHints = checked)} />
|
|
77
|
-
</DeprecatedFormInput>
|
|
78
|
-
{!isSocket && (
|
|
79
|
-
<DeprecatedFormInput label={t('settings native redirect label')}>
|
|
80
|
-
<Input.Switch
|
|
81
|
-
checked={settings.enableNativeRedirect}
|
|
82
|
-
onCheckedChange={(checked) => (settings.enableNativeRedirect = checked)}
|
|
83
|
-
/>
|
|
84
|
-
</DeprecatedFormInput>
|
|
85
|
-
)}
|
|
86
|
-
</DeprecatedFormContainer>
|
|
31
|
+
</SettingsForm.Section>
|
|
32
|
+
</SettingsForm.Viewport>
|
|
87
33
|
);
|
|
88
34
|
};
|