@dxos/plugin-deck 0.8.4-main.b97322e → 0.8.4-main.bcb3aa67d6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/add-toast-QUWRKFDD.mjs +24 -0
- package/dist/lib/browser/add-toast-QUWRKFDD.mjs.map +7 -0
- package/dist/lib/browser/adjust-J6F24WWJ.mjs +96 -0
- package/dist/lib/browser/adjust-J6F24WWJ.mjs.map +7 -0
- package/dist/lib/browser/change-companion-EZI57WDZ.mjs +34 -0
- package/dist/lib/browser/change-companion-EZI57WDZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-2YNVGCOQ.mjs +88 -0
- package/dist/lib/browser/chunk-2YNVGCOQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-AYFQHPPP.mjs +69 -0
- package/dist/lib/browser/chunk-AYFQHPPP.mjs.map +7 -0
- package/dist/lib/browser/chunk-GCDWE37Y.mjs +220 -0
- package/dist/lib/browser/chunk-GCDWE37Y.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-KUTDCWZF.mjs +30 -0
- package/dist/lib/browser/chunk-KUTDCWZF.mjs.map +7 -0
- package/dist/lib/browser/chunk-OHKLENIG.mjs +45 -0
- package/dist/lib/browser/chunk-OHKLENIG.mjs.map +7 -0
- package/dist/lib/browser/close-6RB62DEY.mjs +44 -0
- package/dist/lib/browser/close-6RB62DEY.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +177 -130
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/open-YL3JKXGK.mjs +115 -0
- package/dist/lib/browser/open-YL3JKXGK.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +13 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/revert-workspace-JC66YMWB.mjs +21 -0
- package/dist/lib/browser/revert-workspace-JC66YMWB.mjs.map +7 -0
- package/dist/lib/browser/scroll-into-view-QSSFZ3KD.mjs +21 -0
- package/dist/lib/browser/scroll-into-view-QSSFZ3KD.mjs.map +7 -0
- package/dist/lib/browser/set-LPAGXY3F.mjs +37 -0
- package/dist/lib/browser/set-LPAGXY3F.mjs.map +7 -0
- package/dist/lib/browser/set-layout-mode-XZ4VHS2X.mjs +90 -0
- package/dist/lib/browser/set-layout-mode-XZ4VHS2X.mjs.map +7 -0
- package/dist/lib/browser/show-undo-IWX4S777.mjs +59 -0
- package/dist/lib/browser/show-undo-IWX4S777.mjs.map +7 -0
- package/dist/lib/browser/switch-workspace-5RKQ2LVK.mjs +68 -0
- package/dist/lib/browser/switch-workspace-5RKQ2LVK.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +12 -12
- package/dist/lib/browser/update-complementary-QIIZWLGY.mjs +28 -0
- package/dist/lib/browser/update-complementary-QIIZWLGY.mjs.map +7 -0
- package/dist/lib/browser/update-dialog-5IKCWFPW.mjs +29 -0
- package/dist/lib/browser/update-dialog-5IKCWFPW.mjs.map +7 -0
- package/dist/lib/browser/update-plank-size-YDM67P65.mjs +28 -0
- package/dist/lib/browser/update-plank-size-YDM67P65.mjs.map +7 -0
- package/dist/lib/browser/update-popover-AUVAWH3D.mjs +33 -0
- package/dist/lib/browser/update-popover-AUVAWH3D.mjs.map +7 -0
- package/dist/lib/browser/update-sidebar-BT3L5GJN.mjs +25 -0
- package/dist/lib/browser/update-sidebar-BT3L5GJN.mjs.map +7 -0
- package/dist/lib/node-esm/add-toast-MR53ZMTS.mjs +25 -0
- package/dist/lib/node-esm/add-toast-MR53ZMTS.mjs.map +7 -0
- package/dist/lib/node-esm/adjust-IXRBIVAO.mjs +97 -0
- package/dist/lib/node-esm/adjust-IXRBIVAO.mjs.map +7 -0
- package/dist/lib/node-esm/change-companion-RLMI5EYL.mjs +35 -0
- package/dist/lib/node-esm/change-companion-RLMI5EYL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7BNWWWAF.mjs +221 -0
- package/dist/lib/node-esm/chunk-7BNWWWAF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-C2AWKR2S.mjs +71 -0
- package/dist/lib/node-esm/chunk-C2AWKR2S.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GI5JXNBT.mjs +89 -0
- package/dist/lib/node-esm/chunk-GI5JXNBT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MLVJ2ODW.mjs +32 -0
- package/dist/lib/node-esm/chunk-MLVJ2ODW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TFFZ7NWH.mjs +47 -0
- package/dist/lib/node-esm/chunk-TFFZ7NWH.mjs.map +7 -0
- package/dist/lib/node-esm/close-UD7KBYZP.mjs +45 -0
- package/dist/lib/node-esm/close-UD7KBYZP.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +216 -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-XZ7YGVPZ.mjs +116 -0
- package/dist/lib/node-esm/open-XZ7YGVPZ.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +14 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/revert-workspace-F3FUP4ZL.mjs +22 -0
- package/dist/lib/node-esm/revert-workspace-F3FUP4ZL.mjs.map +7 -0
- package/dist/lib/node-esm/scroll-into-view-24TF2WYQ.mjs +22 -0
- package/dist/lib/node-esm/scroll-into-view-24TF2WYQ.mjs.map +7 -0
- package/dist/lib/node-esm/set-F2QWLSJR.mjs +38 -0
- package/dist/lib/node-esm/set-F2QWLSJR.mjs.map +7 -0
- package/dist/lib/node-esm/set-layout-mode-Z54OX33H.mjs +91 -0
- package/dist/lib/node-esm/set-layout-mode-Z54OX33H.mjs.map +7 -0
- package/dist/lib/node-esm/show-undo-B2XVCKGX.mjs +60 -0
- package/dist/lib/node-esm/show-undo-B2XVCKGX.mjs.map +7 -0
- package/dist/lib/node-esm/switch-workspace-PM57REEV.mjs +69 -0
- package/dist/lib/node-esm/switch-workspace-PM57REEV.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +33 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/lib/node-esm/update-complementary-26H5UYJP.mjs +29 -0
- package/dist/lib/node-esm/update-complementary-26H5UYJP.mjs.map +7 -0
- package/dist/lib/node-esm/update-dialog-EYP3QNFG.mjs +30 -0
- package/dist/lib/node-esm/update-dialog-EYP3QNFG.mjs.map +7 -0
- package/dist/lib/node-esm/update-plank-size-LLFUB57G.mjs +29 -0
- package/dist/lib/node-esm/update-plank-size-LLFUB57G.mjs.map +7 -0
- package/dist/lib/node-esm/update-popover-G55PS7T4.mjs +34 -0
- package/dist/lib/node-esm/update-popover-G55PS7T4.mjs.map +7 -0
- package/dist/lib/node-esm/update-sidebar-W4ND5MUL.mjs +26 -0
- package/dist/lib/node-esm/update-sidebar-W4ND5MUL.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts +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 +20 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +115 -41
- 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 +85 -0
- package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/DeckSettings/index.d.ts +2 -1
- package/dist/types/src/components/DeckSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/Matrix/Matrix.d.ts +49 -0
- package/dist/types/src/components/Matrix/Matrix.d.ts.map +1 -0
- package/dist/types/src/components/Matrix/Matrix.stories.d.ts +17 -0
- package/dist/types/src/components/Matrix/Matrix.stories.d.ts.map +1 -0
- package/dist/types/src/components/Matrix/index.d.ts +3 -0
- package/dist/types/src/components/Matrix/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +3 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/Deck/Banner.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/Deck.d.ts +25 -0
- package/dist/types/src/containers/Deck/Deck.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/Deck.stories.d.ts +85 -0
- package/dist/types/src/containers/Deck/Deck.stories.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckContent.d.ts +7 -0
- package/dist/types/src/containers/Deck/DeckContent.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckRoot.d.ts +42 -0
- package/dist/types/src/containers/Deck/DeckRoot.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckViewport.d.ts +19 -0
- package/dist/types/src/containers/Deck/DeckViewport.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/StatusBar.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/index.d.ts +2 -0
- package/dist/types/src/containers/Deck/index.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/ActiveNode.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.d.ts +5 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts +87 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts.map +1 -0
- package/dist/types/src/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 +21 -0
- package/dist/types/src/containers/Plank/Plank.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/Plank.stories.d.ts +84 -0
- package/dist/types/src/containers/Plank/Plank.stories.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankComponent.d.ts +15 -0
- package/dist/types/src/containers/Plank/PlankComponent.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankContent.d.ts +14 -0
- package/dist/types/src/containers/Plank/PlankContent.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Plank/PlankControls.d.ts +5 -6
- package/dist/types/src/containers/Plank/PlankControls.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankError.d.ts +15 -0
- package/dist/types/src/containers/Plank/PlankError.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Plank/PlankHeading.d.ts +3 -3
- 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 +3 -9
- package/dist/types/src/layout.d.ts.map +1 -1
- 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/testing/DeckLayoutStoryNavigation.d.ts +10 -0
- package/dist/types/src/testing/DeckLayoutStoryNavigation.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +66 -52
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +16 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/{capabilities → types}/capabilities.d.ts +96 -90
- 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 +58 -54
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -1
- package/dist/types/src/util/sanitize-persisted-state.d.ts +19 -0
- package/dist/types/src/util/sanitize-persisted-state.d.ts.map +1 -0
- package/dist/types/src/util/sanitize-persisted-state.test.d.ts +2 -0
- package/dist/types/src/util/sanitize-persisted-state.test.d.ts.map +1 -0
- package/dist/types/src/util/set-active.d.ts +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 -47
- package/src/DeckPlugin.ts +44 -64
- package/src/capabilities/app-graph-builder.ts +113 -127
- package/src/capabilities/check-app-scheme.ts +123 -24
- package/src/capabilities/index.ts +13 -13
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-root.tsx +37 -28
- package/src/capabilities/react-surface.tsx +30 -22
- package/src/capabilities/settings.ts +32 -19
- package/src/capabilities/state.ts +74 -88
- package/src/capabilities/tools.ts +64 -54
- package/src/capabilities/url-handler.ts +199 -49
- package/src/components/DeckSettings/DeckSettings.stories.tsx +40 -0
- package/src/components/DeckSettings/DeckSettings.tsx +104 -69
- package/src/components/DeckSettings/index.ts +4 -2
- package/src/components/Matrix/Matrix.stories.tsx +213 -0
- package/src/components/Matrix/Matrix.tsx +205 -0
- package/src/components/Matrix/SPEC.md +219 -0
- package/src/components/Matrix/index.ts +6 -0
- package/src/components/index.ts +6 -3
- package/src/containers/Deck/Banner.tsx +40 -0
- package/src/containers/Deck/Deck.stories.tsx +85 -0
- package/src/containers/Deck/Deck.tsx +21 -0
- package/src/containers/Deck/DeckContent.tsx +104 -0
- package/src/containers/Deck/DeckRoot.tsx +49 -0
- package/src/containers/Deck/DeckViewport.tsx +397 -0
- package/src/{components/DeckLayout → containers/Deck}/StatusBar.tsx +4 -4
- package/src/containers/Deck/index.ts +5 -0
- package/src/{components → containers}/DeckLayout/ActiveNode.tsx +4 -3
- package/src/containers/DeckLayout/DeckLayout.stories.tsx +174 -0
- package/src/containers/DeckLayout/DeckLayout.tsx +62 -0
- package/src/{components → containers}/DeckLayout/Dialog.tsx +22 -13
- package/src/containers/DeckLayout/Fallback.tsx +24 -0
- package/src/containers/DeckLayout/Popover.tsx +156 -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 +105 -0
- package/src/containers/Plank/Plank.tsx +22 -0
- package/src/containers/Plank/PlankComponent.tsx +179 -0
- package/src/containers/Plank/PlankContent.tsx +45 -0
- package/src/{components → containers}/Plank/PlankControls.tsx +44 -37
- package/src/containers/Plank/PlankError.tsx +79 -0
- package/src/{components → containers}/Plank/PlankHeading.tsx +50 -63
- package/src/{components → containers}/Plank/PlankLoading.tsx +1 -1
- package/src/containers/Plank/PlankRoot.tsx +49 -0
- package/src/{components → containers}/Plank/index.ts +0 -2
- package/src/containers/Sidebar/ComplementarySidebar.tsx +209 -0
- package/src/{components → containers}/Sidebar/Sidebar.tsx +10 -10
- 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 +8 -11
- 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.ts +3 -16
- 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 +61 -0
- package/src/operations/helpers.ts +22 -0
- package/src/operations/index.ts +26 -0
- package/src/operations/open.ts +117 -0
- package/src/operations/revert-workspace.ts +22 -0
- package/src/operations/scroll-into-view.ts +24 -0
- package/src/operations/set-layout-mode.ts +84 -0
- package/src/operations/set.ts +36 -0
- package/src/operations/show-undo.ts +46 -0
- package/src/operations/switch-workspace.ts +60 -0
- package/src/operations/update-complementary.ts +33 -0
- package/src/operations/update-dialog.ts +34 -0
- package/src/operations/update-plank-size.ts +29 -0
- package/src/operations/update-popover.ts +36 -0
- package/src/operations/update-sidebar.ts +28 -0
- package/src/testing/DeckLayoutStoryNavigation.tsx +57 -0
- package/src/testing/index.ts +5 -0
- package/src/translations.ts +67 -52
- package/src/types/Settings.ts +26 -0
- package/src/types/capabilities.ts +34 -0
- package/src/types/events.ts +21 -0
- package/src/types/index.ts +3 -0
- package/src/types/schema.ts +45 -48
- package/src/util/index.ts +1 -0
- package/src/util/layoutAppliesTopbar.ts +2 -2
- package/src/util/overscroll.ts +3 -3
- package/src/util/sanitize-persisted-state.test.ts +79 -0
- package/src/util/sanitize-persisted-state.ts +52 -0
- package/src/util/set-active.test.ts +106 -0
- package/src/util/set-active.ts +50 -30
- package/src/vite-env.d.ts +5 -0
- package/dist/lib/browser/app-graph-builder-JTFSDT2I.mjs +0 -152
- package/dist/lib/browser/app-graph-builder-JTFSDT2I.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-57U62A3A.mjs +0 -32
- package/dist/lib/browser/check-app-scheme-57U62A3A.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-D7KTFCUV.mjs +0 -1494
- package/dist/lib/browser/chunk-D7KTFCUV.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-JFTXENFN.mjs +0 -129
- package/dist/lib/browser/chunk-JFTXENFN.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-QDZO4AJ4.mjs +0 -127
- package/dist/lib/browser/chunk-QDZO4AJ4.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-P2OBK5HK.mjs +0 -521
- package/dist/lib/browser/intent-resolver-P2OBK5HK.mjs.map +0 -7
- package/dist/lib/browser/react-root-PO64J7ML.mjs +0 -43
- package/dist/lib/browser/react-root-PO64J7ML.mjs.map +0 -7
- package/dist/lib/browser/react-surface-E45YOVF5.mjs +0 -40
- package/dist/lib/browser/react-surface-E45YOVF5.mjs.map +0 -7
- package/dist/lib/browser/settings-6AJZPZPM.mjs +0 -29
- package/dist/lib/browser/settings-6AJZPZPM.mjs.map +0 -7
- package/dist/lib/browser/state-MVDYX77Y.mjs +0 -12
- package/dist/lib/browser/tools-TKQDPCHJ.mjs +0 -88
- package/dist/lib/browser/tools-TKQDPCHJ.mjs.map +0 -7
- package/dist/lib/browser/url-handler-7L7M6IKH.mjs +0 -70
- package/dist/lib/browser/url-handler-7L7M6IKH.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/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/src/capabilities/capabilities.ts +0 -14
- package/src/capabilities/intent-resolver.ts +0 -468
- package/src/components/DeckLayout/Banner.tsx +0 -39
- package/src/components/DeckLayout/ContentEmpty.tsx +0 -31
- package/src/components/DeckLayout/DeckLayout.tsx +0 -301
- 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 -55
- package/src/components/Plank/Plank.tsx +0 -266
- package/src/components/Plank/PlankError.tsx +0 -48
- package/src/components/Sidebar/ComplementarySidebar.tsx +0 -193
- package/src/components/Sidebar/SidebarButton.tsx +0 -87
- package/src/components/fragments.ts +0 -14
- package/src/events.ts +0 -11
- /package/dist/lib/browser/{state-MVDYX77Y.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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface } from '@dxos/app-framework';
|
|
7
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
8
8
|
import { useLandmarkMover } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
10
|
export const StatusBar = ({ showHints }: { showHints?: boolean }) => {
|
|
@@ -12,11 +12,11 @@ export const StatusBar = ({ showHints }: { showHints?: boolean }) => {
|
|
|
12
12
|
return (
|
|
13
13
|
<div
|
|
14
14
|
role='contentinfo'
|
|
15
|
-
className='fixed
|
|
15
|
+
className='fixed bottom-0 inset-x-0 h-(--dx-statusbar-size) border-y border-separator z-[2] flex text-description'
|
|
16
16
|
{...mover}
|
|
17
17
|
>
|
|
18
|
-
{showHints && <Surface role='hints' limit={1} />}
|
|
19
|
-
<Surface role='status-bar' limit={1} />
|
|
18
|
+
{showHints && <Surface.Surface role='hints' limit={1} />}
|
|
19
|
+
<Surface.Surface role='status-bar' limit={1} />
|
|
20
20
|
</div>
|
|
21
21
|
);
|
|
22
22
|
};
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface
|
|
7
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
8
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
8
9
|
import { useNode } from '@dxos/plugin-graph';
|
|
9
10
|
import { useAttended } from '@dxos/react-ui-attention';
|
|
10
11
|
|
|
11
|
-
import { useNodeActionExpander } from '
|
|
12
|
+
import { useNodeActionExpander } from '#hooks';
|
|
12
13
|
|
|
13
14
|
// TODO(burdon): Factor out to effect in plugin set document title.
|
|
14
15
|
export const ActiveNode = () => {
|
|
@@ -21,7 +22,7 @@ export const ActiveNode = () => {
|
|
|
21
22
|
<div role='none' className='sr-only'>
|
|
22
23
|
{/* TODO(wittjosiah): Weird that this is a surface, feel like it's not really render logic.
|
|
23
24
|
Probably this lives in React-land currently in order to access translations? */}
|
|
24
|
-
<Surface role='document-title' data={{ subject: activeNode }} limit={1} />
|
|
25
|
+
<Surface.Surface role='document-title' data={{ subject: activeNode }} limit={1} />
|
|
25
26
|
</div>
|
|
26
27
|
);
|
|
27
28
|
};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
6
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
|
|
10
|
+
import { Capabilities, Capability, Plugin } from '@dxos/app-framework';
|
|
11
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
+
import { Surface, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
13
|
+
import { AppActivationEvents, AppCapabilities, AppPlugin, LayoutOperation } from '@dxos/app-toolkit';
|
|
14
|
+
import { Node, GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';
|
|
15
|
+
import { corePlugins } from '@dxos/plugin-testing';
|
|
16
|
+
import { useAsyncEffect } from '@dxos/react-hooks';
|
|
17
|
+
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
18
|
+
import { Loading, withLayout } from '@dxos/react-ui/testing';
|
|
19
|
+
|
|
20
|
+
import { meta as pluginMeta } from '#meta';
|
|
21
|
+
import { DeckLayoutStoryNavigation } from '#testing';
|
|
22
|
+
|
|
23
|
+
import { translations } from '../../translations';
|
|
24
|
+
|
|
25
|
+
import { DeckLayout } from './DeckLayout';
|
|
26
|
+
|
|
27
|
+
import { DeckState, OperationHandler } from '#capabilities';
|
|
28
|
+
import { DeckCapabilities, type Settings } from '#types';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Same as {@link DeckSettings} but `enableDeck: true` so `DeckContent` does not force solo
|
|
32
|
+
* whenever layout is multi (see `DeckContent` when `!settings.enableDeck`).
|
|
33
|
+
*/
|
|
34
|
+
const storyDeckSettings = Capability.makeModule(() =>
|
|
35
|
+
Effect.sync(() => {
|
|
36
|
+
const settingsAtom = Atom.make<Settings.Settings>({
|
|
37
|
+
showHints: false,
|
|
38
|
+
enableDeck: true,
|
|
39
|
+
enableStatusbar: false,
|
|
40
|
+
enableNativeRedirect: false,
|
|
41
|
+
newPlankPositioning: 'start',
|
|
42
|
+
overscroll: 'none',
|
|
43
|
+
encapsulatedPlanks: false,
|
|
44
|
+
}).pipe(Atom.keepAlive);
|
|
45
|
+
|
|
46
|
+
return [Capability.contributes(DeckCapabilities.Settings, settingsAtom)];
|
|
47
|
+
}),
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const STORY_ITEM_SEGMENTS = ['story-a', 'story-b', 'story-c', 'story-d', 'story-e'];
|
|
51
|
+
const STORY_ITEMS = STORY_ITEM_SEGMENTS.map((id) => `${Node.RootId}/${id}`);
|
|
52
|
+
|
|
53
|
+
const TestPlugin = Plugin.define(pluginMeta).pipe(
|
|
54
|
+
Plugin.addModule({
|
|
55
|
+
id: 'story-deck-settings',
|
|
56
|
+
activatesOn: AppActivationEvents.SetupSettings,
|
|
57
|
+
activate: storyDeckSettings,
|
|
58
|
+
}),
|
|
59
|
+
Plugin.addModule({
|
|
60
|
+
id: Capability.getModuleTag(DeckState),
|
|
61
|
+
activatesOn: AppActivationEvents.AppGraphReady,
|
|
62
|
+
activate: () => DeckState(),
|
|
63
|
+
}),
|
|
64
|
+
AppPlugin.addOperationHandlerModule({
|
|
65
|
+
activate: OperationHandler,
|
|
66
|
+
}),
|
|
67
|
+
AppPlugin.addSurfaceModule({
|
|
68
|
+
id: 'story-surfaces',
|
|
69
|
+
activate: () =>
|
|
70
|
+
Effect.succeed(
|
|
71
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
72
|
+
Surface.create({
|
|
73
|
+
id: 'story-navigation',
|
|
74
|
+
role: 'navigation',
|
|
75
|
+
filter: (data): data is { current: string } => typeof (data as any).current === 'string',
|
|
76
|
+
component: ({ data, ref }) => <DeckLayoutStoryNavigation current={data.current} ref={ref} />,
|
|
77
|
+
}),
|
|
78
|
+
Surface.create({
|
|
79
|
+
id: 'story-article',
|
|
80
|
+
role: 'article',
|
|
81
|
+
component: ({ data }) => {
|
|
82
|
+
const subject = (data as any)?.subject;
|
|
83
|
+
if (!subject) {
|
|
84
|
+
return <Loading />;
|
|
85
|
+
}
|
|
86
|
+
return (
|
|
87
|
+
<Json.Root data={subject}>
|
|
88
|
+
<Json.Content />
|
|
89
|
+
</Json.Root>
|
|
90
|
+
);
|
|
91
|
+
},
|
|
92
|
+
}),
|
|
93
|
+
]),
|
|
94
|
+
),
|
|
95
|
+
}),
|
|
96
|
+
AppPlugin.addAppGraphModule({
|
|
97
|
+
id: 'story-graph',
|
|
98
|
+
activate: Effect.fnUntraced(function* () {
|
|
99
|
+
const extensions = yield* GraphBuilder.createExtension({
|
|
100
|
+
id: 'story-items',
|
|
101
|
+
match: NodeMatcher.whenRoot,
|
|
102
|
+
connector: () =>
|
|
103
|
+
Effect.succeed(
|
|
104
|
+
STORY_ITEM_SEGMENTS.map((id, index) => ({
|
|
105
|
+
id,
|
|
106
|
+
type: 'story-item',
|
|
107
|
+
data: { id, title: `Story Item ${index + 1}` },
|
|
108
|
+
properties: {
|
|
109
|
+
label: `Item ${index + 1}`,
|
|
110
|
+
icon: 'ph--file--regular',
|
|
111
|
+
},
|
|
112
|
+
})),
|
|
113
|
+
),
|
|
114
|
+
});
|
|
115
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
116
|
+
}),
|
|
117
|
+
}),
|
|
118
|
+
Plugin.make,
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
const meta = {
|
|
122
|
+
title: 'plugins/plugin-deck/containers/DeckLayout',
|
|
123
|
+
component: DeckLayout,
|
|
124
|
+
decorators: [
|
|
125
|
+
withLayout({ layout: 'fullscreen' }),
|
|
126
|
+
withPluginManager({
|
|
127
|
+
plugins: [...corePlugins(), TestPlugin()],
|
|
128
|
+
setupEvents: [AppActivationEvents.SetupSettings],
|
|
129
|
+
}),
|
|
130
|
+
],
|
|
131
|
+
parameters: {
|
|
132
|
+
layout: 'fullscreen',
|
|
133
|
+
translations,
|
|
134
|
+
},
|
|
135
|
+
} satisfies Meta<typeof DeckLayout>;
|
|
136
|
+
|
|
137
|
+
export default meta;
|
|
138
|
+
|
|
139
|
+
type Story = StoryObj<typeof meta>;
|
|
140
|
+
|
|
141
|
+
export const Default: Story = {};
|
|
142
|
+
|
|
143
|
+
const SoloStory = () => {
|
|
144
|
+
const { invokePromise } = useOperationInvoker();
|
|
145
|
+
|
|
146
|
+
useAsyncEffect(async () => {
|
|
147
|
+
await invokePromise(LayoutOperation.Open, { subject: [STORY_ITEMS[0]], navigation: 'immediate' });
|
|
148
|
+
await invokePromise(LayoutOperation.SetLayoutMode, { mode: 'solo', subject: STORY_ITEMS[0] });
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
return <DeckLayout />;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export const Solo: Story = {
|
|
155
|
+
render: () => <SoloStory />,
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const MultiStory = () => {
|
|
159
|
+
const { invokePromise } = useOperationInvoker();
|
|
160
|
+
|
|
161
|
+
useAsyncEffect(async () => {
|
|
162
|
+
await invokePromise(LayoutOperation.Open, { subject: [STORY_ITEMS[0]], navigation: 'immediate' });
|
|
163
|
+
await invokePromise(LayoutOperation.SetLayoutMode, { mode: 'multi' });
|
|
164
|
+
await invokePromise(LayoutOperation.Set, {
|
|
165
|
+
subject: [STORY_ITEMS[0], STORY_ITEMS[1], STORY_ITEMS[2]],
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
return <DeckLayout />;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export const Multi: Story = {
|
|
173
|
+
render: () => <MultiStory />,
|
|
174
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useCallback } from 'react';
|
|
6
|
+
|
|
7
|
+
import { useAtomCapability, useOperationInvoker, usePluginManager } from '@dxos/app-framework/ui';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { Mosaic } from '@dxos/react-ui-mosaic';
|
|
10
|
+
|
|
11
|
+
import { useDeckState } from '#hooks';
|
|
12
|
+
import { DeckCapabilities, getMode } from '#types';
|
|
13
|
+
import { Deck, type DeckLayoutChangeRequest } from '../Deck';
|
|
14
|
+
|
|
15
|
+
import { ActiveNode } from './ActiveNode';
|
|
16
|
+
import { Dialog } from './Dialog';
|
|
17
|
+
import { PopoverContent, PopoverRoot } from './Popover';
|
|
18
|
+
import { Toaster, type ToasterProps } from './Toast';
|
|
19
|
+
|
|
20
|
+
export type DeckLayoutProps = Pick<ToasterProps, 'onDismissToast'>;
|
|
21
|
+
|
|
22
|
+
export const DeckLayout = ({ onDismissToast }: DeckLayoutProps) => {
|
|
23
|
+
const settings = useAtomCapability(DeckCapabilities.Settings);
|
|
24
|
+
const pluginManager = usePluginManager();
|
|
25
|
+
const { invokePromise } = useOperationInvoker();
|
|
26
|
+
const { deck, state, updateState } = useDeckState();
|
|
27
|
+
const layoutMode = getMode(deck);
|
|
28
|
+
const { toasts } = state;
|
|
29
|
+
|
|
30
|
+
const handleLayoutChange = useCallback(
|
|
31
|
+
(request: DeckLayoutChangeRequest) => {
|
|
32
|
+
void invokePromise(LayoutOperation.SetLayoutMode, request);
|
|
33
|
+
},
|
|
34
|
+
[invokePromise],
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Mosaic.Root>
|
|
39
|
+
<PopoverRoot>
|
|
40
|
+
<ActiveNode />
|
|
41
|
+
<Deck.Root
|
|
42
|
+
settings={settings}
|
|
43
|
+
pluginManager={pluginManager}
|
|
44
|
+
layoutMode={layoutMode}
|
|
45
|
+
deck={deck}
|
|
46
|
+
state={state}
|
|
47
|
+
updateState={updateState}
|
|
48
|
+
onLayoutChange={handleLayoutChange}
|
|
49
|
+
>
|
|
50
|
+
<Deck.Content>
|
|
51
|
+
<Deck.Viewport>
|
|
52
|
+
{deck.solo ? <Deck.SoloMode /> : deck.active.length === 0 ? <Deck.ContentEmpty /> : <Deck.MultiMode />}
|
|
53
|
+
</Deck.Viewport>
|
|
54
|
+
</Deck.Content>
|
|
55
|
+
</Deck.Root>
|
|
56
|
+
<PopoverContent />
|
|
57
|
+
<Dialog />
|
|
58
|
+
<Toaster toasts={toasts} onDismissToast={onDismissToast} />
|
|
59
|
+
</PopoverRoot>
|
|
60
|
+
</Mosaic.Root>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
@@ -2,33 +2,42 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface
|
|
7
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
8
8
|
import { AlertDialog, Dialog as NaturalDialog } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { useDeckState } from '#hooks';
|
|
11
|
+
import { PlankErrorFallback } from '../Plank';
|
|
12
12
|
|
|
13
13
|
export const Dialog = () => {
|
|
14
|
-
const
|
|
15
|
-
const { dialogOpen, dialogType, dialogBlockAlign, dialogOverlayClasses, dialogOverlayStyle, dialogContent } =
|
|
14
|
+
const { state, updateEphemeral } = useDeckState();
|
|
15
|
+
const { dialogOpen, dialogType, dialogBlockAlign, dialogOverlayClasses, dialogOverlayStyle, dialogContent } = state;
|
|
16
16
|
const Root = dialogType === 'alert' ? AlertDialog.Root : NaturalDialog.Root;
|
|
17
17
|
const Overlay = dialogType === 'alert' ? AlertDialog.Overlay : NaturalDialog.Overlay;
|
|
18
18
|
|
|
19
|
+
const handleOpenChange = useCallback(
|
|
20
|
+
(nextOpen: boolean) => {
|
|
21
|
+
updateEphemeral((s) => ({ ...s, dialogOpen: nextOpen }));
|
|
22
|
+
},
|
|
23
|
+
[updateEphemeral],
|
|
24
|
+
);
|
|
25
|
+
|
|
19
26
|
// TODO(thure): End block alignment affecting `modal` and whether the surface renders in an overlay is tailored to the needs of the ambient chat dialog. As the feature matures, consider separating concerns.
|
|
20
27
|
return (
|
|
21
|
-
<Root
|
|
22
|
-
modal={dialogBlockAlign !== 'end'}
|
|
23
|
-
open={dialogOpen}
|
|
24
|
-
onOpenChange={(nextOpen) => (context.dialogOpen = nextOpen)}
|
|
25
|
-
>
|
|
28
|
+
<Root modal={dialogBlockAlign !== 'end'} open={dialogOpen} onOpenChange={handleOpenChange}>
|
|
26
29
|
{dialogBlockAlign === 'end' ? (
|
|
27
30
|
// TODO(burdon): Placeholder creates a suspense boundary; replace with defaults.
|
|
28
|
-
<Surface
|
|
31
|
+
<Surface.Surface
|
|
32
|
+
role='dialog'
|
|
33
|
+
data={dialogContent}
|
|
34
|
+
limit={1}
|
|
35
|
+
fallback={PlankErrorFallback}
|
|
36
|
+
placeholder={<div />}
|
|
37
|
+
/>
|
|
29
38
|
) : (
|
|
30
39
|
<Overlay blockAlign={dialogBlockAlign} classNames={dialogOverlayClasses} style={dialogOverlayStyle}>
|
|
31
|
-
<Surface role='dialog' data={dialogContent} limit={1} fallback={
|
|
40
|
+
<Surface.Surface role='dialog' data={dialogContent} limit={1} fallback={PlankErrorFallback} />
|
|
32
41
|
</Overlay>
|
|
33
42
|
)}
|
|
34
43
|
</Root>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
8
|
+
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
|
|
11
|
+
const Fallback = () => {
|
|
12
|
+
const { t } = useTranslation(meta.id);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div role='none' className='min-h-screen w-full flex items-center justify-center p-8'>
|
|
16
|
+
<p
|
|
17
|
+
role='alert'
|
|
18
|
+
className='flex items-center justify-center p-8 font-normal text-lg text-error-text border border-rose-fill rounded-md'
|
|
19
|
+
>
|
|
20
|
+
{t('plugin-error.message')}
|
|
21
|
+
</p>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { createContext } from '@radix-ui/react-context';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
8
|
+
import React, { type PropsWithChildren, useCallback, useEffect, useRef, useState } from 'react';
|
|
9
|
+
|
|
10
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
11
|
+
import { useObjectMenuItems } from '@dxos/app-toolkit/ui';
|
|
12
|
+
import { Annotation, Obj } from '@dxos/echo';
|
|
13
|
+
import {
|
|
14
|
+
Card,
|
|
15
|
+
Popover,
|
|
16
|
+
type PopoverContentInteractOutsideEvent,
|
|
17
|
+
toLocalizedString,
|
|
18
|
+
Toolbar,
|
|
19
|
+
useTranslation,
|
|
20
|
+
} from '@dxos/react-ui';
|
|
21
|
+
import { Menu } from '@dxos/react-ui-menu';
|
|
22
|
+
|
|
23
|
+
import { useDeckState } from '#hooks';
|
|
24
|
+
import { meta } from '#meta';
|
|
25
|
+
|
|
26
|
+
const DEBOUNCE_DELAY = 40;
|
|
27
|
+
|
|
28
|
+
type DeckPopoverContextValue = {
|
|
29
|
+
setOpen: (open: boolean) => void;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const [DeckPopoverProvider, useDeckPopoverContext] = createContext<DeckPopoverContextValue>('DeckPopover');
|
|
33
|
+
|
|
34
|
+
export type PopoverRootProps = PropsWithChildren;
|
|
35
|
+
|
|
36
|
+
export const PopoverRoot = ({ children }: PopoverRootProps) => {
|
|
37
|
+
const { state } = useDeckState();
|
|
38
|
+
const virtualRef = useRef<HTMLButtonElement | null>(null);
|
|
39
|
+
const [virtualIter, setVirtualIter] = useState(0);
|
|
40
|
+
const [open, setOpen] = useState(false);
|
|
41
|
+
const debounceRef = useRef<NodeJS.Timeout | null>(null);
|
|
42
|
+
|
|
43
|
+
// TODO(thure): This is a workaround for the race condition between displaying a Popover and either rendering
|
|
44
|
+
// the anchor further down the tree or measuring the virtual trigger's client rect.
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
setOpen(false);
|
|
47
|
+
if (state.popoverOpen) {
|
|
48
|
+
if (debounceRef.current) {
|
|
49
|
+
clearTimeout(debounceRef.current);
|
|
50
|
+
}
|
|
51
|
+
if (state.popoverAnchor && virtualRef.current !== state.popoverAnchor) {
|
|
52
|
+
virtualRef.current = state.popoverAnchor ?? null;
|
|
53
|
+
setVirtualIter((iter) => iter + 1);
|
|
54
|
+
}
|
|
55
|
+
debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);
|
|
56
|
+
}
|
|
57
|
+
}, [state.popoverOpen, state.popoverAnchorId, state.popoverAnchor, state.popoverContent]);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<DeckPopoverProvider setOpen={setOpen}>
|
|
61
|
+
<Popover.Root modal={false} open={open}>
|
|
62
|
+
{state.popoverAnchor && <Popover.VirtualTrigger key={virtualIter} virtualRef={virtualRef} />}
|
|
63
|
+
{children}
|
|
64
|
+
</Popover.Root>
|
|
65
|
+
</DeckPopoverProvider>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const PopoverContent = () => {
|
|
70
|
+
const { t } = useTranslation(meta.id);
|
|
71
|
+
const { state, updateEphemeral } = useDeckState();
|
|
72
|
+
const { setOpen } = useDeckPopoverContext('PopoverContent');
|
|
73
|
+
const popoverSubject = state.popoverContent?.subject;
|
|
74
|
+
const isObjectPopover = Obj.isObject(popoverSubject);
|
|
75
|
+
const objectMenuItems = useObjectMenuItems(popoverSubject);
|
|
76
|
+
const title = state.popoverTitle ? toLocalizedString(state.popoverTitle, t) : 'Unknown';
|
|
77
|
+
const icon = isObjectPopover
|
|
78
|
+
? Function.pipe(
|
|
79
|
+
Obj.getSchema(popoverSubject),
|
|
80
|
+
Option.fromNullable,
|
|
81
|
+
Option.flatMap(Annotation.IconAnnotation.get),
|
|
82
|
+
Option.map(({ icon }) => icon),
|
|
83
|
+
Option.getOrElse(() => 'ph--placeholder--regular'),
|
|
84
|
+
)
|
|
85
|
+
: undefined;
|
|
86
|
+
|
|
87
|
+
const handleClose = useCallback(() => {
|
|
88
|
+
setOpen(false);
|
|
89
|
+
updateEphemeral((state) => ({
|
|
90
|
+
...state,
|
|
91
|
+
popoverOpen: false,
|
|
92
|
+
popoverAnchor: undefined,
|
|
93
|
+
popoverAnchorId: undefined,
|
|
94
|
+
popoverSide: undefined,
|
|
95
|
+
}));
|
|
96
|
+
}, [updateEphemeral]);
|
|
97
|
+
|
|
98
|
+
const handleInteractOutside = useCallback(
|
|
99
|
+
(event: KeyboardEvent | PopoverContentInteractOutsideEvent) => {
|
|
100
|
+
if (
|
|
101
|
+
// TODO(thure): CodeMirror should not focus itself when it updates.
|
|
102
|
+
event.type === 'dismissableLayer.focusOutside' &&
|
|
103
|
+
(event.currentTarget as HTMLElement | undefined)?.classList.contains('cm-content')
|
|
104
|
+
) {
|
|
105
|
+
event.preventDefault();
|
|
106
|
+
} else {
|
|
107
|
+
handleClose();
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
[handleClose],
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<Popover.Portal>
|
|
115
|
+
<Popover.Content
|
|
116
|
+
side={state.popoverSide}
|
|
117
|
+
sticky='always'
|
|
118
|
+
hideWhenDetached
|
|
119
|
+
onInteractOutside={handleInteractOutside}
|
|
120
|
+
onEscapeKeyDown={handleInteractOutside}
|
|
121
|
+
>
|
|
122
|
+
<Popover.Viewport>
|
|
123
|
+
{/* Base popover */}
|
|
124
|
+
{state.popoverKind === 'base' && <Surface.Surface role='popover' data={state.popoverContent} limit={1} />}
|
|
125
|
+
|
|
126
|
+
{/* Card popover */}
|
|
127
|
+
{state.popoverKind === 'card' && (
|
|
128
|
+
<Menu.Root>
|
|
129
|
+
<Card.Root border={false} classNames='dx-card-popover'>
|
|
130
|
+
<Card.Toolbar>
|
|
131
|
+
<Card.IconBlock padding>{icon && <Card.Icon icon={icon} />}</Card.IconBlock>
|
|
132
|
+
<Card.Title>{title}</Card.Title>
|
|
133
|
+
{/* TODO(wittjosiah): Reconcile with Card.Menu. */}
|
|
134
|
+
<Card.IconBlock padding>
|
|
135
|
+
<Menu.Trigger asChild disabled={!objectMenuItems.length}>
|
|
136
|
+
<Toolbar.IconButton
|
|
137
|
+
variant='ghost'
|
|
138
|
+
icon='ph--dots-three-vertical--regular'
|
|
139
|
+
iconOnly
|
|
140
|
+
label='Actions'
|
|
141
|
+
/>
|
|
142
|
+
</Menu.Trigger>
|
|
143
|
+
<Menu.Content items={objectMenuItems} />
|
|
144
|
+
</Card.IconBlock>
|
|
145
|
+
</Card.Toolbar>
|
|
146
|
+
|
|
147
|
+
<Surface.Surface role='card--content' data={state.popoverContent} limit={1} />
|
|
148
|
+
</Card.Root>
|
|
149
|
+
</Menu.Root>
|
|
150
|
+
)}
|
|
151
|
+
</Popover.Viewport>
|
|
152
|
+
<Popover.Arrow />
|
|
153
|
+
</Popover.Content>
|
|
154
|
+
</Popover.Portal>
|
|
155
|
+
);
|
|
156
|
+
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type LayoutOperation } from '@dxos/app-toolkit';
|
|
8
8
|
import {
|
|
9
9
|
Button,
|
|
10
10
|
Icon,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
useTranslation,
|
|
15
15
|
} from '@dxos/react-ui';
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { meta } from '#meta';
|
|
18
18
|
|
|
19
19
|
// TODO(wittjosiah): Render remaining duration as a progress bar within the toast.
|
|
20
20
|
export const Toast = ({
|
|
@@ -28,14 +28,14 @@ export const Toast = ({
|
|
|
28
28
|
closeLabel,
|
|
29
29
|
onAction,
|
|
30
30
|
onOpenChange,
|
|
31
|
-
}:
|
|
32
|
-
const { t } = useTranslation(
|
|
31
|
+
}: LayoutOperation.Toast & Pick<ToastRootProps, 'onOpenChange'>) => {
|
|
32
|
+
const { t } = useTranslation(meta.id);
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
35
|
<NaturalToast.Root data-testid={id} defaultOpen duration={duration} onOpenChange={onOpenChange}>
|
|
36
36
|
<NaturalToast.Body>
|
|
37
37
|
<NaturalToast.Title classNames='items-center'>
|
|
38
|
-
{icon && <Icon icon={icon}
|
|
38
|
+
{icon && <Icon icon={icon} classNames='inline mr-1' />}
|
|
39
39
|
{title && <span>{toLocalizedString(title, t)}</span>}
|
|
40
40
|
</NaturalToast.Title>
|
|
41
41
|
{description && (
|
|
@@ -59,3 +59,28 @@ export const Toast = ({
|
|
|
59
59
|
</NaturalToast.Root>
|
|
60
60
|
);
|
|
61
61
|
};
|
|
62
|
+
|
|
63
|
+
export type ToasterProps = {
|
|
64
|
+
toasts?: LayoutOperation.Toast[];
|
|
65
|
+
onDismissToast?: (id: string) => void;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const Toaster = ({ toasts, onDismissToast }: ToasterProps) => {
|
|
69
|
+
return (
|
|
70
|
+
<>
|
|
71
|
+
{toasts?.map((toast) => (
|
|
72
|
+
<Toast
|
|
73
|
+
{...toast}
|
|
74
|
+
key={toast.id}
|
|
75
|
+
onOpenChange={(open: boolean) => {
|
|
76
|
+
if (!open) {
|
|
77
|
+
onDismissToast?.(toast.id);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return open;
|
|
81
|
+
}}
|
|
82
|
+
/>
|
|
83
|
+
))}
|
|
84
|
+
</>
|
|
85
|
+
);
|
|
86
|
+
};
|