@dxos/plugin-deck 0.8.4-main.f5c0578 → 0.8.4-main.fcfe5033a5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/add-toast-3V7TYC2M.mjs +24 -0
- package/dist/lib/browser/add-toast-3V7TYC2M.mjs.map +7 -0
- package/dist/lib/browser/adjust-ZMPN7P7J.mjs +96 -0
- package/dist/lib/browser/adjust-ZMPN7P7J.mjs.map +7 -0
- package/dist/lib/browser/change-companion-F7GCREGM.mjs +34 -0
- package/dist/lib/browser/change-companion-F7GCREGM.mjs.map +7 -0
- package/dist/lib/browser/chunk-BRZAVPMC.mjs +48 -0
- package/dist/lib/browser/chunk-BRZAVPMC.mjs.map +7 -0
- package/dist/lib/browser/chunk-DF2VZ6W3.mjs +69 -0
- package/dist/lib/browser/chunk-DF2VZ6W3.mjs.map +7 -0
- package/dist/lib/browser/chunk-FUWSZ6IC.mjs +88 -0
- package/dist/lib/browser/chunk-FUWSZ6IC.mjs.map +7 -0
- package/dist/lib/browser/chunk-GN52IRQ7.mjs +216 -0
- package/dist/lib/browser/chunk-GN52IRQ7.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-KUTDCWZF.mjs +30 -0
- package/dist/lib/browser/chunk-KUTDCWZF.mjs.map +7 -0
- package/dist/lib/browser/close-N2F26CVG.mjs +44 -0
- package/dist/lib/browser/close-N2F26CVG.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +161 -134
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/open-VWO7VOOU.mjs +150 -0
- package/dist/lib/browser/open-VWO7VOOU.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +13 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/revert-workspace-LGKZZKCI.mjs +21 -0
- package/dist/lib/browser/revert-workspace-LGKZZKCI.mjs.map +7 -0
- package/dist/lib/browser/scroll-into-view-TSVSNKIH.mjs +21 -0
- package/dist/lib/browser/scroll-into-view-TSVSNKIH.mjs.map +7 -0
- package/dist/lib/browser/set-N2LGA2BY.mjs +37 -0
- package/dist/lib/browser/set-N2LGA2BY.mjs.map +7 -0
- package/dist/lib/browser/set-layout-mode-TONTQO6G.mjs +90 -0
- package/dist/lib/browser/set-layout-mode-TONTQO6G.mjs.map +7 -0
- package/dist/lib/browser/show-undo-IFXNEIQY.mjs +59 -0
- package/dist/lib/browser/show-undo-IFXNEIQY.mjs.map +7 -0
- package/dist/lib/browser/switch-workspace-ZJDC5SSR.mjs +68 -0
- package/dist/lib/browser/switch-workspace-ZJDC5SSR.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +12 -12
- package/dist/lib/browser/update-complementary-ELUOK3GD.mjs +28 -0
- package/dist/lib/browser/update-complementary-ELUOK3GD.mjs.map +7 -0
- package/dist/lib/browser/update-dialog-LMGLOTWX.mjs +29 -0
- package/dist/lib/browser/update-dialog-LMGLOTWX.mjs.map +7 -0
- package/dist/lib/browser/update-plank-size-WQAPELII.mjs +28 -0
- package/dist/lib/browser/update-plank-size-WQAPELII.mjs.map +7 -0
- package/dist/lib/browser/update-popover-P6YO6FWJ.mjs +33 -0
- package/dist/lib/browser/update-popover-P6YO6FWJ.mjs.map +7 -0
- package/dist/lib/browser/update-sidebar-NGWS6IDJ.mjs +25 -0
- package/dist/lib/browser/update-sidebar-NGWS6IDJ.mjs.map +7 -0
- package/dist/lib/node-esm/add-toast-G4OQEGOS.mjs +25 -0
- package/dist/lib/node-esm/add-toast-G4OQEGOS.mjs.map +7 -0
- package/dist/lib/node-esm/adjust-KSNI7C3B.mjs +97 -0
- package/dist/lib/node-esm/adjust-KSNI7C3B.mjs.map +7 -0
- package/dist/lib/node-esm/change-companion-LCJPT6AX.mjs +35 -0
- package/dist/lib/node-esm/change-companion-LCJPT6AX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4ED7B7OZ.mjs +217 -0
- package/dist/lib/node-esm/chunk-4ED7B7OZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7KL65RLL.mjs +89 -0
- package/dist/lib/node-esm/chunk-7KL65RLL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-IRWCUYJY.mjs +71 -0
- package/dist/lib/node-esm/chunk-IRWCUYJY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MB4SDDVY.mjs +50 -0
- package/dist/lib/node-esm/chunk-MB4SDDVY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MLVJ2ODW.mjs +32 -0
- package/dist/lib/node-esm/chunk-MLVJ2ODW.mjs.map +7 -0
- package/dist/lib/node-esm/close-YHIBVE2S.mjs +45 -0
- package/dist/lib/node-esm/close-YHIBVE2S.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +202 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/open-353DYMMN.mjs +151 -0
- package/dist/lib/node-esm/open-353DYMMN.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +14 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/revert-workspace-OS5R3PFJ.mjs +22 -0
- package/dist/lib/node-esm/revert-workspace-OS5R3PFJ.mjs.map +7 -0
- package/dist/lib/node-esm/scroll-into-view-LC2SVKCW.mjs +22 -0
- package/dist/lib/node-esm/scroll-into-view-LC2SVKCW.mjs.map +7 -0
- package/dist/lib/node-esm/set-3EZ7LJFU.mjs +38 -0
- package/dist/lib/node-esm/set-3EZ7LJFU.mjs.map +7 -0
- package/dist/lib/node-esm/set-layout-mode-3YBHGEK6.mjs +91 -0
- package/dist/lib/node-esm/set-layout-mode-3YBHGEK6.mjs.map +7 -0
- package/dist/lib/node-esm/show-undo-RAHLRPUU.mjs +60 -0
- package/dist/lib/node-esm/show-undo-RAHLRPUU.mjs.map +7 -0
- package/dist/lib/node-esm/switch-workspace-S6CXDPXZ.mjs +69 -0
- package/dist/lib/node-esm/switch-workspace-S6CXDPXZ.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +33 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/lib/node-esm/update-complementary-V5Y2RMYL.mjs +29 -0
- package/dist/lib/node-esm/update-complementary-V5Y2RMYL.mjs.map +7 -0
- package/dist/lib/node-esm/update-dialog-IMTCLAWR.mjs +30 -0
- package/dist/lib/node-esm/update-dialog-IMTCLAWR.mjs.map +7 -0
- package/dist/lib/node-esm/update-plank-size-I3DKCPHZ.mjs +29 -0
- package/dist/lib/node-esm/update-plank-size-I3DKCPHZ.mjs.map +7 -0
- package/dist/lib/node-esm/update-popover-7JX3KWYL.mjs +34 -0
- package/dist/lib/node-esm/update-popover-7JX3KWYL.mjs.map +7 -0
- package/dist/lib/node-esm/update-sidebar-B5DCSREP.mjs +26 -0
- package/dist/lib/node-esm/update-sidebar-B5DCSREP.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts +2 -1
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts +17 -2
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +196 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root.d.ts +4 -2
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +5 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +134 -44
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/tools.d.ts +4 -3
- package/dist/types/src/capabilities/tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-handler.d.ts +3 -2
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +4 -4
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts +71 -0
- package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/DeckSettings/index.d.ts +1 -1
- package/dist/types/src/components/DeckSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/Matrix/Matrix.d.ts +41 -0
- package/dist/types/src/components/Matrix/Matrix.d.ts.map +1 -0
- package/dist/types/src/components/Matrix/Matrix.stories.d.ts +17 -0
- package/dist/types/src/components/Matrix/Matrix.stories.d.ts.map +1 -0
- package/dist/types/src/components/Matrix/index.d.ts +3 -0
- package/dist/types/src/components/Matrix/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +3 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/Deck/Banner.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/Deck.d.ts +25 -0
- package/dist/types/src/containers/Deck/Deck.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/Deck.stories.d.ts +71 -0
- package/dist/types/src/containers/Deck/Deck.stories.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckContent.d.ts +7 -0
- package/dist/types/src/containers/Deck/DeckContent.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckRoot.d.ts +42 -0
- package/dist/types/src/containers/Deck/DeckRoot.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckViewport.d.ts +19 -0
- package/dist/types/src/containers/Deck/DeckViewport.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/StatusBar.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/index.d.ts +2 -0
- package/dist/types/src/containers/Deck/index.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/ActiveNode.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.d.ts +5 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts +73 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/Dialog.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/Fallback.d.ts +2 -0
- package/dist/types/src/containers/DeckLayout/Fallback.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/Popover.d.ts +5 -0
- package/dist/types/src/containers/DeckLayout/Popover.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/Toast.d.ts +10 -0
- package/dist/types/src/containers/DeckLayout/Toast.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/constants.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/index.d.ts +4 -0
- package/dist/types/src/containers/DeckLayout/index.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/Plank.d.ts +17 -0
- package/dist/types/src/containers/Plank/Plank.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/Plank.stories.d.ts +71 -0
- package/dist/types/src/containers/Plank/Plank.stories.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankComponent.d.ts +17 -0
- package/dist/types/src/containers/Plank/PlankComponent.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankContent.d.ts +10 -0
- package/dist/types/src/containers/Plank/PlankContent.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Plank/PlankControls.d.ts +5 -6
- package/dist/types/src/containers/Plank/PlankControls.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankError.d.ts +15 -0
- package/dist/types/src/containers/Plank/PlankError.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Plank/PlankHeading.d.ts +5 -4
- package/dist/types/src/containers/Plank/PlankHeading.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Plank/PlankLoading.d.ts.map +1 -1
- package/dist/types/src/containers/Plank/PlankRoot.d.ts +37 -0
- package/dist/types/src/containers/Plank/PlankRoot.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/index.d.ts +4 -0
- package/dist/types/src/containers/Plank/index.d.ts.map +1 -0
- package/dist/types/src/containers/Sidebar/ComplementarySidebar.d.ts.map +1 -0
- package/dist/types/src/containers/Sidebar/Sidebar.d.ts.map +1 -0
- package/dist/types/src/containers/Sidebar/SidebarButton.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Sidebar/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +6 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +3 -4
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckState.d.ts +17 -0
- package/dist/types/src/hooks/useDeckState.d.ts.map +1 -0
- package/dist/types/src/hooks/useHoistStatusbar.d.ts +1 -1
- package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
- package/dist/types/src/hooks/useMainSize.d.ts +2 -2
- package/dist/types/src/hooks/useNodeActionExpander.d.ts +1 -1
- package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
- package/dist/types/src/hooks/useSelectedCompanion.d.ts +13 -0
- package/dist/types/src/hooks/useSelectedCompanion.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/layout.d.ts +20 -9
- package/dist/types/src/layout.d.ts.map +1 -1
- package/dist/types/src/layout.test.d.ts +2 -0
- package/dist/types/src/layout.test.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/add-toast.d.ts +5 -0
- package/dist/types/src/operations/add-toast.d.ts.map +1 -0
- package/dist/types/src/operations/adjust.d.ts +5 -0
- package/dist/types/src/operations/adjust.d.ts.map +1 -0
- package/dist/types/src/operations/change-companion.d.ts +5 -0
- package/dist/types/src/operations/change-companion.d.ts.map +1 -0
- package/dist/types/src/operations/close.d.ts +5 -0
- package/dist/types/src/operations/close.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +18 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/helpers.d.ts +3 -0
- package/dist/types/src/operations/helpers.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/open.d.ts +5 -0
- package/dist/types/src/operations/open.d.ts.map +1 -0
- package/dist/types/src/operations/revert-workspace.d.ts +5 -0
- package/dist/types/src/operations/revert-workspace.d.ts.map +1 -0
- package/dist/types/src/operations/scroll-into-view.d.ts +5 -0
- package/dist/types/src/operations/scroll-into-view.d.ts.map +1 -0
- package/dist/types/src/operations/set-layout-mode.d.ts +9 -0
- package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -0
- package/dist/types/src/operations/set.d.ts +5 -0
- package/dist/types/src/operations/set.d.ts.map +1 -0
- package/dist/types/src/operations/show-undo.d.ts +5 -0
- package/dist/types/src/operations/show-undo.d.ts.map +1 -0
- package/dist/types/src/operations/switch-workspace.d.ts +5 -0
- package/dist/types/src/operations/switch-workspace.d.ts.map +1 -0
- package/dist/types/src/operations/update-complementary.d.ts +5 -0
- package/dist/types/src/operations/update-complementary.d.ts.map +1 -0
- package/dist/types/src/operations/update-dialog.d.ts +5 -0
- package/dist/types/src/operations/update-dialog.d.ts.map +1 -0
- package/dist/types/src/operations/update-plank-size.d.ts +5 -0
- package/dist/types/src/operations/update-plank-size.d.ts.map +1 -0
- package/dist/types/src/operations/update-popover.d.ts +5 -0
- package/dist/types/src/operations/update-popover.d.ts.map +1 -0
- package/dist/types/src/operations/update-sidebar.d.ts +5 -0
- package/dist/types/src/operations/update-sidebar.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +52 -52
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +11 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/{capabilities → types}/capabilities.d.ts +103 -96
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +7 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +68 -56
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +2 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -1
- package/dist/types/src/util/plank-url-params.d.ts +14 -0
- package/dist/types/src/util/plank-url-params.d.ts.map +1 -0
- package/dist/types/src/util/plank-url-params.test.d.ts +2 -0
- package/dist/types/src/util/plank-url-params.test.d.ts.map +1 -0
- package/dist/types/src/util/sanitize-persisted-state.d.ts +19 -0
- package/dist/types/src/util/sanitize-persisted-state.d.ts.map +1 -0
- package/dist/types/src/util/sanitize-persisted-state.test.d.ts +2 -0
- package/dist/types/src/util/sanitize-persisted-state.test.d.ts.map +1 -0
- package/dist/types/src/util/set-active.d.ts +19 -4
- package/dist/types/src/util/set-active.d.ts.map +1 -1
- package/dist/types/src/util/set-active.test.d.ts +2 -0
- package/dist/types/src/util/set-active.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +87 -49
- package/src/DeckPlugin.ts +43 -69
- package/src/capabilities/app-graph-builder.ts +112 -127
- package/src/capabilities/check-app-scheme.ts +123 -24
- package/src/capabilities/index.ts +13 -14
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-root.tsx +37 -29
- package/src/capabilities/react-surface.tsx +28 -22
- package/src/capabilities/settings.ts +30 -19
- package/src/capabilities/state.ts +74 -88
- package/src/capabilities/tools.ts +57 -50
- package/src/capabilities/url-handler.ts +221 -50
- package/src/components/DeckSettings/DeckSettings.stories.tsx +37 -0
- package/src/components/DeckSettings/DeckSettings.tsx +55 -70
- package/src/components/DeckSettings/index.ts +2 -2
- package/src/components/Matrix/Matrix.stories.tsx +216 -0
- package/src/components/Matrix/Matrix.tsx +205 -0
- package/src/components/Matrix/SPEC.md +219 -0
- package/src/components/Matrix/index.ts +6 -0
- package/src/components/index.ts +6 -3
- package/src/{components/DeckLayout → containers/Deck}/Banner.tsx +13 -11
- package/src/containers/Deck/Deck.stories.tsx +81 -0
- package/src/containers/Deck/Deck.tsx +21 -0
- package/src/containers/Deck/DeckContent.tsx +105 -0
- package/src/containers/Deck/DeckRoot.tsx +50 -0
- package/src/containers/Deck/DeckViewport.tsx +456 -0
- package/src/{components/DeckLayout → containers/Deck}/StatusBar.tsx +4 -4
- package/src/containers/Deck/index.ts +5 -0
- package/src/{components → containers}/DeckLayout/ActiveNode.tsx +8 -3
- package/src/containers/DeckLayout/DeckLayout.stories.tsx +393 -0
- package/src/containers/DeckLayout/DeckLayout.tsx +62 -0
- package/src/containers/DeckLayout/Dialog.tsx +52 -0
- package/src/containers/DeckLayout/Fallback.tsx +24 -0
- package/src/containers/DeckLayout/Popover.tsx +161 -0
- package/src/{components → containers}/DeckLayout/Toast.tsx +30 -5
- package/src/{components → containers}/DeckLayout/constants.ts +1 -0
- package/src/{components → containers}/DeckLayout/index.ts +3 -2
- package/src/containers/Plank/Plank.stories.tsx +106 -0
- package/src/containers/Plank/Plank.tsx +22 -0
- package/src/containers/Plank/PlankComponent.tsx +217 -0
- package/src/containers/Plank/PlankContent.tsx +45 -0
- package/src/{components → containers}/Plank/PlankControls.tsx +45 -38
- package/src/containers/Plank/PlankError.tsx +79 -0
- package/src/{components → containers}/Plank/PlankHeading.tsx +68 -64
- package/src/{components → containers}/Plank/PlankLoading.tsx +1 -1
- package/src/containers/Plank/PlankRoot.tsx +49 -0
- package/src/{components → containers}/Plank/index.ts +0 -2
- package/src/containers/Sidebar/ComplementarySidebar.tsx +209 -0
- package/src/containers/Sidebar/Sidebar.tsx +44 -0
- package/src/containers/Sidebar/SidebarButton.tsx +94 -0
- package/src/containers/index.ts +11 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useCompanions.ts +3 -3
- package/src/hooks/useDeckCompanions.ts +7 -10
- package/src/hooks/useDeckState.ts +73 -0
- package/src/hooks/useHoistStatusbar.ts +4 -5
- package/src/hooks/useMainSize.ts +2 -2
- package/src/hooks/useNodeActionExpander.ts +4 -4
- package/src/hooks/useSelectedCompanion.ts +32 -0
- package/src/index.ts +1 -2
- package/src/layout.test.ts +59 -0
- package/src/layout.ts +38 -40
- package/src/meta.ts +8 -5
- package/src/operations/add-toast.ts +24 -0
- package/src/operations/adjust.ts +83 -0
- package/src/operations/change-companion.ts +35 -0
- package/src/operations/close.ts +35 -0
- package/src/operations/definitions.ts +62 -0
- package/src/operations/helpers.ts +22 -0
- package/src/operations/index.ts +26 -0
- package/src/operations/open.ts +184 -0
- package/src/operations/revert-workspace.ts +22 -0
- package/src/operations/scroll-into-view.ts +24 -0
- package/src/operations/set-layout-mode.ts +84 -0
- package/src/operations/set.ts +36 -0
- package/src/operations/show-undo.ts +47 -0
- package/src/operations/switch-workspace.ts +60 -0
- package/src/operations/update-complementary.ts +33 -0
- package/src/operations/update-dialog.ts +34 -0
- package/src/operations/update-plank-size.ts +29 -0
- package/src/operations/update-popover.ts +36 -0
- package/src/operations/update-sidebar.ts +28 -0
- package/src/translations.ts +52 -52
- package/src/types/Settings.ts +17 -0
- package/src/types/capabilities.ts +35 -0
- package/src/types/events.ts +21 -0
- package/src/types/index.ts +3 -0
- package/src/types/schema.ts +52 -50
- package/src/util/index.ts +2 -1
- package/src/util/layoutAppliesTopbar.ts +2 -2
- package/src/util/plank-url-params.test.ts +85 -0
- package/src/util/plank-url-params.ts +36 -0
- package/src/util/sanitize-persisted-state.test.ts +79 -0
- package/src/util/sanitize-persisted-state.ts +52 -0
- package/src/util/set-active.test.ts +106 -0
- package/src/util/set-active.ts +50 -30
- package/src/vite-env.d.ts +5 -0
- package/dist/lib/browser/app-graph-builder-DVEKLXB4.mjs +0 -152
- package/dist/lib/browser/app-graph-builder-DVEKLXB4.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-3BQJXWEY.mjs +0 -32
- package/dist/lib/browser/check-app-scheme-3BQJXWEY.mjs.map +0 -7
- package/dist/lib/browser/chunk-6MQIYIPY.mjs +0 -1494
- package/dist/lib/browser/chunk-6MQIYIPY.mjs.map +0 -7
- package/dist/lib/browser/chunk-CNTGBCMK.mjs +0 -145
- package/dist/lib/browser/chunk-CNTGBCMK.mjs.map +0 -7
- package/dist/lib/browser/chunk-F5BQOOEG.mjs +0 -160
- package/dist/lib/browser/chunk-F5BQOOEG.mjs.map +0 -7
- package/dist/lib/browser/chunk-M57WD3V6.mjs +0 -16
- package/dist/lib/browser/chunk-M57WD3V6.mjs.map +0 -7
- package/dist/lib/browser/chunk-MX7WRVX3.mjs +0 -127
- package/dist/lib/browser/chunk-MX7WRVX3.mjs.map +0 -7
- package/dist/lib/browser/chunk-NRCPV6AV.mjs +0 -129
- package/dist/lib/browser/chunk-NRCPV6AV.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z5KITAZW.mjs +0 -13
- package/dist/lib/browser/chunk-Z5KITAZW.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-2SUIIV6N.mjs +0 -521
- package/dist/lib/browser/intent-resolver-2SUIIV6N.mjs.map +0 -7
- package/dist/lib/browser/react-root-GVZANZX7.mjs +0 -43
- package/dist/lib/browser/react-root-GVZANZX7.mjs.map +0 -7
- package/dist/lib/browser/react-surface-NXSSD2GW.mjs +0 -40
- package/dist/lib/browser/react-surface-NXSSD2GW.mjs.map +0 -7
- package/dist/lib/browser/settings-LUPQPZ27.mjs +0 -29
- package/dist/lib/browser/settings-LUPQPZ27.mjs.map +0 -7
- package/dist/lib/browser/state-CRXR7X63.mjs +0 -12
- package/dist/lib/browser/toolkit-OBKFXX23.mjs +0 -47
- package/dist/lib/browser/toolkit-OBKFXX23.mjs.map +0 -7
- package/dist/lib/browser/url-handler-LROZYQ26.mjs +0 -70
- package/dist/lib/browser/url-handler-LROZYQ26.mjs.map +0 -7
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit.d.ts +0 -5
- package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Banner.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +0 -6
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Fallback.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Popover.d.ts +0 -5
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts +0 -5
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Topbar.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/Topbar.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/constants.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/index.d.ts +0 -4
- package/dist/types/src/components/DeckLayout/index.d.ts.map +0 -1
- package/dist/types/src/components/Plank/Plank.d.ts +0 -27
- package/dist/types/src/components/Plank/Plank.d.ts.map +0 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +0 -8
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +0 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +0 -1
- package/dist/types/src/components/Plank/PlankError.d.ts +0 -13
- package/dist/types/src/components/Plank/PlankError.d.ts.map +0 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts.map +0 -1
- package/dist/types/src/components/Plank/index.d.ts +0 -6
- package/dist/types/src/components/Plank/index.d.ts.map +0 -1
- package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +0 -1
- package/dist/types/src/components/Sidebar/Sidebar.d.ts.map +0 -1
- package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +0 -1
- package/dist/types/src/components/fragments.d.ts +0 -4
- package/dist/types/src/components/fragments.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/util/overscroll.d.ts +0 -47
- package/dist/types/src/util/overscroll.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -14
- package/src/capabilities/intent-resolver.ts +0 -469
- package/src/capabilities/toolkit.ts +0 -55
- package/src/components/DeckLayout/ContentEmpty.tsx +0 -31
- package/src/components/DeckLayout/DeckLayout.tsx +0 -302
- package/src/components/DeckLayout/Dialog.tsx +0 -36
- package/src/components/DeckLayout/Fallback.tsx +0 -28
- package/src/components/DeckLayout/Popover.tsx +0 -104
- package/src/components/DeckLayout/Topbar.tsx +0 -11
- package/src/components/Plank/Plank.stories.tsx +0 -56
- package/src/components/Plank/Plank.tsx +0 -267
- package/src/components/Plank/PlankError.tsx +0 -49
- package/src/components/Sidebar/ComplementarySidebar.tsx +0 -194
- package/src/components/Sidebar/Sidebar.tsx +0 -42
- package/src/components/Sidebar/SidebarButton.tsx +0 -87
- package/src/components/fragments.ts +0 -14
- package/src/events.ts +0 -11
- package/src/util/overscroll.ts +0 -69
- /package/dist/lib/browser/{state-CRXR7X63.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/types/src/{components/DeckLayout → containers/Deck}/Banner.d.ts +0 -0
- /package/dist/types/src/{components/DeckLayout → containers/Deck}/StatusBar.d.ts +0 -0
- /package/dist/types/src/{components → containers}/DeckLayout/ActiveNode.d.ts +0 -0
- /package/dist/types/src/{components → containers}/DeckLayout/Dialog.d.ts +0 -0
- /package/dist/types/src/{components → containers}/DeckLayout/constants.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Plank/PlankLoading.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/ComplementarySidebar.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/Sidebar.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/SidebarButton.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/index.d.ts +0 -0
- /package/src/{components → containers}/Sidebar/index.ts +0 -0
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { untracked } from '@preact/signals-core';
|
|
6
|
-
import React, { Fragment, type UIEvent, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
Capabilities,
|
|
10
|
-
LayoutAction,
|
|
11
|
-
createIntent,
|
|
12
|
-
useCapability,
|
|
13
|
-
useIntentDispatcher,
|
|
14
|
-
usePluginManager,
|
|
15
|
-
} from '@dxos/app-framework';
|
|
16
|
-
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
17
|
-
import { Main, type MainProps, useMediaQuery, useOnTransition } from '@dxos/react-ui';
|
|
18
|
-
import { DEFAULT_HORIZONTAL_SIZE, Stack, StackContext } from '@dxos/react-ui-stack';
|
|
19
|
-
import { mainPaddingTransitions } from '@dxos/react-ui-theme';
|
|
20
|
-
|
|
21
|
-
import { DeckCapabilities } from '../../capabilities';
|
|
22
|
-
import { useBreakpoints, useHoistStatusbar } from '../../hooks';
|
|
23
|
-
import { DECK_PLUGIN } from '../../meta';
|
|
24
|
-
import { type DeckSettingsProps, getMode } from '../../types';
|
|
25
|
-
import { calculateOverscroll, layoutAppliesTopbar } from '../../util';
|
|
26
|
-
import { fixedComplementarySidebarToggleStyles, fixedSidebarToggleStyles } from '../fragments';
|
|
27
|
-
import { Plank } from '../Plank';
|
|
28
|
-
import { ComplementarySidebar, Sidebar, ToggleComplementarySidebarButton, ToggleSidebarButton } from '../Sidebar';
|
|
29
|
-
|
|
30
|
-
import { ActiveNode } from './ActiveNode';
|
|
31
|
-
import { ContentEmpty } from './ContentEmpty';
|
|
32
|
-
import { Dialog } from './Dialog';
|
|
33
|
-
import { PopoverContent, PopoverRoot } from './Popover';
|
|
34
|
-
import { StatusBar } from './StatusBar';
|
|
35
|
-
import { Toast } from './Toast';
|
|
36
|
-
import { Topbar } from './Topbar';
|
|
37
|
-
|
|
38
|
-
export type DeckLayoutProps = {
|
|
39
|
-
onDismissToast: (id: string) => void;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const PlankSeparator = ({ order }: { order: number }) =>
|
|
43
|
-
order > 0 ? <span role='separator' className='row-span-2 bg-deckSurface is-4' style={{ gridColumn: order }} /> : null;
|
|
44
|
-
|
|
45
|
-
export const DeckLayout = ({ onDismissToast }: DeckLayoutProps) => {
|
|
46
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
47
|
-
const settings = useCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(DECK_PLUGIN)!.value;
|
|
48
|
-
const context = useCapability(DeckCapabilities.MutableDeckState);
|
|
49
|
-
const { sidebarState, complementarySidebarState, complementarySidebarPanel, deck, toasts } = context;
|
|
50
|
-
const { active, activeCompanions, fullscreen, solo, plankSizing } = deck;
|
|
51
|
-
const breakpoint = useBreakpoints();
|
|
52
|
-
const layoutMode = getMode(deck);
|
|
53
|
-
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
54
|
-
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
55
|
-
const pluginManager = usePluginManager();
|
|
56
|
-
|
|
57
|
-
const scrollLeftRef = useRef<number | null>();
|
|
58
|
-
const deckRef = useRef<HTMLDivElement>(null);
|
|
59
|
-
|
|
60
|
-
// Ensure the first plank is attended when the deck is first rendered.
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
// NOTE: Not `useAttended` so that the layout component is not re-rendered when the attended list changes.
|
|
63
|
-
const attended = untracked(() => {
|
|
64
|
-
const attention = pluginManager.context.getCapability(AttentionCapabilities.Attention);
|
|
65
|
-
return attention.current;
|
|
66
|
-
});
|
|
67
|
-
const firstId = solo ?? active[0];
|
|
68
|
-
if (attended.length === 0 && firstId) {
|
|
69
|
-
// TODO(wittjosiah): Focusing the type button is a workaround.
|
|
70
|
-
// If the plank is directly focused on first load the focus ring appears.
|
|
71
|
-
document.querySelector<HTMLElement>(`article[data-attendable-id="${firstId}"] button`)?.focus();
|
|
72
|
-
}
|
|
73
|
-
}, []);
|
|
74
|
-
|
|
75
|
-
// Not using `breakpoint` to avoid firing when breakpoint changes between tablet and desktop.
|
|
76
|
-
// `ssr: false` to avoid using fallback values and flashing into solo mode on startup.
|
|
77
|
-
const [isNotMobile] = useMediaQuery('md', { ssr: false });
|
|
78
|
-
const shouldRevert = useRef(false);
|
|
79
|
-
useEffect(() => {
|
|
80
|
-
if (!isNotMobile && getMode(deck) === 'deck') {
|
|
81
|
-
// NOTE: Not `useAttended` so that the layout component is not re-rendered when the attended list changes.
|
|
82
|
-
const attended = untracked(() => {
|
|
83
|
-
const attention = pluginManager.context.getCapability(AttentionCapabilities.Attention);
|
|
84
|
-
return attention.current;
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
shouldRevert.current = true;
|
|
88
|
-
void dispatch(
|
|
89
|
-
createIntent(LayoutAction.SetLayoutMode, { part: 'mode', subject: attended[0], options: { mode: 'solo' } }),
|
|
90
|
-
);
|
|
91
|
-
} else if (isNotMobile && getMode(deck) === 'solo' && shouldRevert.current) {
|
|
92
|
-
void dispatch(createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { revert: true } }));
|
|
93
|
-
}
|
|
94
|
-
}, [isNotMobile, deck, dispatch]);
|
|
95
|
-
|
|
96
|
-
// When deck is disabled in settings, set to solo mode if the current layout mode is deck.
|
|
97
|
-
// TODO(thure): Applying this as an effect should be avoided over emitting the intent only when the setting changes.
|
|
98
|
-
useEffect(() => {
|
|
99
|
-
if (!settings.enableDeck && layoutMode === 'deck') {
|
|
100
|
-
void dispatch(
|
|
101
|
-
createIntent(LayoutAction.SetLayoutMode, { part: 'mode', subject: active[0], options: { mode: 'solo' } }),
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
}, [settings.enableDeck, dispatch, active, layoutMode]);
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Clear scroll restoration state if the window is resized
|
|
108
|
-
*/
|
|
109
|
-
const handleResize = useCallback(() => {
|
|
110
|
-
scrollLeftRef.current = null;
|
|
111
|
-
}, []);
|
|
112
|
-
|
|
113
|
-
useEffect(() => {
|
|
114
|
-
window.addEventListener('resize', handleResize);
|
|
115
|
-
return () => window.removeEventListener('resize', handleResize);
|
|
116
|
-
}, [handleResize]);
|
|
117
|
-
|
|
118
|
-
const restoreScroll = useCallback(() => {
|
|
119
|
-
if (deckRef.current && scrollLeftRef.current != null) {
|
|
120
|
-
deckRef.current.scrollLeft = scrollLeftRef.current;
|
|
121
|
-
}
|
|
122
|
-
}, []);
|
|
123
|
-
useOnTransition(layoutMode, (mode) => mode !== 'deck', 'deck', restoreScroll);
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Save scroll position as the user scrolls
|
|
127
|
-
*/
|
|
128
|
-
const handleScroll = useCallback(
|
|
129
|
-
(event: UIEvent) => {
|
|
130
|
-
if (!solo && event.currentTarget === event.target) {
|
|
131
|
-
scrollLeftRef.current = (event.target as HTMLDivElement).scrollLeft;
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
[solo],
|
|
135
|
-
);
|
|
136
|
-
|
|
137
|
-
const isEmpty = !solo && active.length === 0;
|
|
138
|
-
|
|
139
|
-
const padding = useMemo(() => {
|
|
140
|
-
if (!solo && settings.overscroll === 'centering') {
|
|
141
|
-
return calculateOverscroll(active.length);
|
|
142
|
-
}
|
|
143
|
-
return {};
|
|
144
|
-
}, [solo, settings.overscroll, deck]);
|
|
145
|
-
|
|
146
|
-
const mainPosition = useMemo(
|
|
147
|
-
() => [
|
|
148
|
-
'grid !block-start-[env(safe-area-inset-top)]',
|
|
149
|
-
topbar && '!block-start-[calc(env(safe-area-inset-top)+var(--rail-size))]',
|
|
150
|
-
hoistStatusbar && 'lg:block-end-[--statusbar-size]',
|
|
151
|
-
],
|
|
152
|
-
[topbar, hoistStatusbar],
|
|
153
|
-
);
|
|
154
|
-
|
|
155
|
-
const { order, itemsCount }: { order: Record<string, number>; itemsCount: number } = useMemo(() => {
|
|
156
|
-
return active.reduce(
|
|
157
|
-
(acc: { order: Record<string, number>; itemsCount: number }, entryId) => {
|
|
158
|
-
acc.order[entryId] = acc.itemsCount + 1;
|
|
159
|
-
acc.itemsCount += activeCompanions?.[entryId] ? 3 : 2;
|
|
160
|
-
return acc;
|
|
161
|
-
},
|
|
162
|
-
{ order: {}, itemsCount: 0 },
|
|
163
|
-
);
|
|
164
|
-
}, [active, activeCompanions]);
|
|
165
|
-
|
|
166
|
-
return (
|
|
167
|
-
<PopoverRoot>
|
|
168
|
-
<ActiveNode />
|
|
169
|
-
|
|
170
|
-
<Main.Root
|
|
171
|
-
navigationSidebarState={fullscreen ? 'closed' : context.sidebarState}
|
|
172
|
-
onNavigationSidebarStateChange={(next) => (context.sidebarState = next)}
|
|
173
|
-
complementarySidebarState={fullscreen ? 'closed' : context.complementarySidebarState}
|
|
174
|
-
onComplementarySidebarStateChange={(next) => (context.complementarySidebarState = next)}
|
|
175
|
-
>
|
|
176
|
-
{/* Left sidebar. */}
|
|
177
|
-
<Sidebar />
|
|
178
|
-
|
|
179
|
-
{/* Right sidebar. */}
|
|
180
|
-
<ComplementarySidebar current={complementarySidebarPanel} />
|
|
181
|
-
|
|
182
|
-
{/* Dialog overlay to dismiss dialogs. */}
|
|
183
|
-
<Main.Overlay />
|
|
184
|
-
|
|
185
|
-
{/* No content. */}
|
|
186
|
-
{isEmpty && (
|
|
187
|
-
<Main.Content bounce handlesFocus classNames={mainPosition}>
|
|
188
|
-
<ContentEmpty />
|
|
189
|
-
</Main.Content>
|
|
190
|
-
)}
|
|
191
|
-
|
|
192
|
-
{/* Solo/deck mode. */}
|
|
193
|
-
{!isEmpty && (
|
|
194
|
-
<Main.Content
|
|
195
|
-
bounce
|
|
196
|
-
handlesFocus
|
|
197
|
-
classNames={mainPosition}
|
|
198
|
-
style={
|
|
199
|
-
{
|
|
200
|
-
'--dx-main-sidebarWidth':
|
|
201
|
-
sidebarState === 'expanded'
|
|
202
|
-
? 'var(--nav-sidebar-size)'
|
|
203
|
-
: sidebarState === 'collapsed'
|
|
204
|
-
? 'var(--l0-size)'
|
|
205
|
-
: '0',
|
|
206
|
-
'--dx-main-complementaryWidth':
|
|
207
|
-
complementarySidebarState === 'expanded'
|
|
208
|
-
? 'var(--complementary-sidebar-size)'
|
|
209
|
-
: complementarySidebarState === 'collapsed'
|
|
210
|
-
? 'var(--rail-size)'
|
|
211
|
-
: '0',
|
|
212
|
-
'--dx-main-contentFirstWidth': `${plankSizing[active[0] ?? 'never'] ?? DEFAULT_HORIZONTAL_SIZE}rem`,
|
|
213
|
-
'--dx-main-contentLastWidth': `${plankSizing[active[(active.length ?? 1) - 1] ?? 'never'] ?? DEFAULT_HORIZONTAL_SIZE}rem`,
|
|
214
|
-
} as MainProps['style']
|
|
215
|
-
}
|
|
216
|
-
>
|
|
217
|
-
<div
|
|
218
|
-
role='none'
|
|
219
|
-
className={!solo ? 'relative bg-deckSurface overflow-hidden' : 'sr-only'}
|
|
220
|
-
{...(solo && { inert: '' })}
|
|
221
|
-
>
|
|
222
|
-
{!topbar && !fullscreen && <ToggleSidebarButton classNames={fixedSidebarToggleStyles} />}
|
|
223
|
-
{!topbar && !fullscreen && (
|
|
224
|
-
<ToggleComplementarySidebarButton classNames={fixedComplementarySidebarToggleStyles} />
|
|
225
|
-
)}
|
|
226
|
-
<Stack
|
|
227
|
-
ref={deckRef}
|
|
228
|
-
orientation='horizontal'
|
|
229
|
-
size='contain'
|
|
230
|
-
classNames={['absolute inset-block-0 -inset-inline-px', mainPaddingTransitions]}
|
|
231
|
-
itemsCount={itemsCount - 1}
|
|
232
|
-
style={padding}
|
|
233
|
-
onScroll={handleScroll}
|
|
234
|
-
>
|
|
235
|
-
{active.map((entryId) => (
|
|
236
|
-
<Fragment key={entryId}>
|
|
237
|
-
<PlankSeparator order={order[entryId] - 1} />
|
|
238
|
-
<Plank
|
|
239
|
-
id={entryId}
|
|
240
|
-
companionId={activeCompanions?.[entryId]}
|
|
241
|
-
part='deck'
|
|
242
|
-
order={order[entryId]}
|
|
243
|
-
active={active}
|
|
244
|
-
layoutMode={layoutMode}
|
|
245
|
-
settings={settings}
|
|
246
|
-
/>
|
|
247
|
-
</Fragment>
|
|
248
|
-
))}
|
|
249
|
-
</Stack>
|
|
250
|
-
</div>
|
|
251
|
-
<div
|
|
252
|
-
role='none'
|
|
253
|
-
className={solo ? 'relative bg-deckSurface overflow-hidden' : 'sr-only'}
|
|
254
|
-
{...(!solo && { inert: '' })}
|
|
255
|
-
>
|
|
256
|
-
{!topbar && !fullscreen && <ToggleSidebarButton classNames={fixedSidebarToggleStyles} />}
|
|
257
|
-
{!topbar && !fullscreen && (
|
|
258
|
-
<ToggleComplementarySidebarButton classNames={fixedComplementarySidebarToggleStyles} />
|
|
259
|
-
)}
|
|
260
|
-
<StackContext.Provider value={{ size: 'contain', orientation: 'horizontal', rail: true }}>
|
|
261
|
-
<Plank
|
|
262
|
-
id={solo}
|
|
263
|
-
companionId={solo ? activeCompanions?.[solo] : undefined}
|
|
264
|
-
part='solo'
|
|
265
|
-
layoutMode={layoutMode}
|
|
266
|
-
settings={settings}
|
|
267
|
-
/>
|
|
268
|
-
</StackContext.Provider>
|
|
269
|
-
</div>
|
|
270
|
-
</Main.Content>
|
|
271
|
-
)}
|
|
272
|
-
|
|
273
|
-
{/* Topbar. */}
|
|
274
|
-
{topbar && <Topbar />}
|
|
275
|
-
|
|
276
|
-
{/* Status bar. */}
|
|
277
|
-
{hoistStatusbar && <StatusBar showHints={settings.showHints} />}
|
|
278
|
-
</Main.Root>
|
|
279
|
-
|
|
280
|
-
{/* Global popovers. */}
|
|
281
|
-
<PopoverContent />
|
|
282
|
-
|
|
283
|
-
{/* Global dialog. */}
|
|
284
|
-
<Dialog />
|
|
285
|
-
|
|
286
|
-
{/* Global toasts. */}
|
|
287
|
-
{toasts?.map((toast) => (
|
|
288
|
-
<Toast
|
|
289
|
-
{...toast}
|
|
290
|
-
key={toast.id}
|
|
291
|
-
onOpenChange={(open) => {
|
|
292
|
-
if (!open) {
|
|
293
|
-
onDismissToast(toast.id);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
return open;
|
|
297
|
-
}}
|
|
298
|
-
/>
|
|
299
|
-
))}
|
|
300
|
-
</PopoverRoot>
|
|
301
|
-
);
|
|
302
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Surface, useCapability } from '@dxos/app-framework';
|
|
8
|
-
import { AlertDialog, Dialog as NaturalDialog } from '@dxos/react-ui';
|
|
9
|
-
|
|
10
|
-
import { DeckCapabilities } from '../../capabilities';
|
|
11
|
-
import { PlankContentError } from '../Plank';
|
|
12
|
-
|
|
13
|
-
export const Dialog = () => {
|
|
14
|
-
const context = useCapability(DeckCapabilities.MutableDeckState);
|
|
15
|
-
const { dialogOpen, dialogType, dialogBlockAlign, dialogOverlayClasses, dialogOverlayStyle, dialogContent } = context;
|
|
16
|
-
const Root = dialogType === 'alert' ? AlertDialog.Root : NaturalDialog.Root;
|
|
17
|
-
const Overlay = dialogType === 'alert' ? AlertDialog.Overlay : NaturalDialog.Overlay;
|
|
18
|
-
|
|
19
|
-
// 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
|
-
return (
|
|
21
|
-
<Root
|
|
22
|
-
modal={dialogBlockAlign !== 'end'}
|
|
23
|
-
open={dialogOpen}
|
|
24
|
-
onOpenChange={(nextOpen) => (context.dialogOpen = nextOpen)}
|
|
25
|
-
>
|
|
26
|
-
{dialogBlockAlign === 'end' ? (
|
|
27
|
-
// TODO(burdon): Placeholder creates a suspense boundary; replace with defaults.
|
|
28
|
-
<Surface role='dialog' data={dialogContent} limit={1} fallback={PlankContentError} placeholder={<div />} />
|
|
29
|
-
) : (
|
|
30
|
-
<Overlay blockAlign={dialogBlockAlign} classNames={dialogOverlayClasses} style={dialogOverlayStyle}>
|
|
31
|
-
<Surface role='dialog' data={dialogContent} limit={1} fallback={PlankContentError} />
|
|
32
|
-
</Overlay>
|
|
33
|
-
)}
|
|
34
|
-
</Root>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { errorText, mx } from '@dxos/react-ui-theme';
|
|
9
|
-
|
|
10
|
-
import { DECK_PLUGIN } from '../../meta';
|
|
11
|
-
|
|
12
|
-
export const Fallback = () => {
|
|
13
|
-
const { t } = useTranslation(DECK_PLUGIN);
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<div role='none' className='min-bs-screen is-full flex items-center justify-center p-8'>
|
|
17
|
-
<p
|
|
18
|
-
role='alert'
|
|
19
|
-
className={mx(
|
|
20
|
-
errorText,
|
|
21
|
-
'border border-error-400/50 rounded-md flex items-center justify-center p-8 font-normal text-lg',
|
|
22
|
-
)}
|
|
23
|
-
>
|
|
24
|
-
{t('plugin error message')}
|
|
25
|
-
</p>
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
28
|
-
};
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { createContext } from '@radix-ui/react-context';
|
|
6
|
-
import React, { type PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
7
|
-
|
|
8
|
-
import { Surface, useCapability } from '@dxos/app-framework';
|
|
9
|
-
import { Popover, type PopoverContentInteractOutsideEvent } from '@dxos/react-ui';
|
|
10
|
-
|
|
11
|
-
import { DeckCapabilities } from '../../capabilities';
|
|
12
|
-
|
|
13
|
-
export type DeckPopoverRootProps = PropsWithChildren<{}>;
|
|
14
|
-
|
|
15
|
-
const DEBOUNCE_DELAY = 40;
|
|
16
|
-
|
|
17
|
-
type DeckPopoverContextValue = {
|
|
18
|
-
setOpen: (open: boolean) => void;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const [DeckPopoverProvider, useDeckPopoverContext] = createContext<DeckPopoverContextValue>('DeckPopover');
|
|
22
|
-
|
|
23
|
-
export const PopoverRoot = ({ children }: DeckPopoverRootProps) => {
|
|
24
|
-
const layout = useCapability(DeckCapabilities.MutableDeckState);
|
|
25
|
-
const virtualRef = useRef<HTMLButtonElement | null>(null);
|
|
26
|
-
const [virtualIter, setVirtualIter] = useState(0);
|
|
27
|
-
const [open, setOpen] = useState(false);
|
|
28
|
-
const debounceRef = useRef<NodeJS.Timeout | null>(null);
|
|
29
|
-
|
|
30
|
-
// TODO(thure): This is a workaround for the race condition between displaying a Popover and either rendering
|
|
31
|
-
// the anchor further down the tree or measuring the virtual trigger’s client rect.
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
setOpen(false);
|
|
34
|
-
if (layout.popoverOpen) {
|
|
35
|
-
if (debounceRef.current) {
|
|
36
|
-
clearTimeout(debounceRef.current);
|
|
37
|
-
}
|
|
38
|
-
if (layout.popoverAnchor && virtualRef.current !== layout.popoverAnchor) {
|
|
39
|
-
virtualRef.current = layout.popoverAnchor ?? null;
|
|
40
|
-
setVirtualIter((iter) => iter + 1);
|
|
41
|
-
}
|
|
42
|
-
debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);
|
|
43
|
-
}
|
|
44
|
-
}, [layout.popoverOpen, layout.popoverAnchorId, layout.popoverAnchor, layout.popoverContent]);
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<DeckPopoverProvider setOpen={setOpen}>
|
|
48
|
-
<Popover.Root modal={false} open={open}>
|
|
49
|
-
{layout.popoverAnchor && <Popover.VirtualTrigger key={virtualIter} virtualRef={virtualRef} />}
|
|
50
|
-
{children}
|
|
51
|
-
</Popover.Root>
|
|
52
|
-
</DeckPopoverProvider>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const PopoverContent = () => {
|
|
57
|
-
const layout = useCapability(DeckCapabilities.MutableDeckState);
|
|
58
|
-
const { setOpen } = useDeckPopoverContext('PopoverContent');
|
|
59
|
-
|
|
60
|
-
const handleClose = useCallback(
|
|
61
|
-
(event: KeyboardEvent | PopoverContentInteractOutsideEvent) => {
|
|
62
|
-
if (
|
|
63
|
-
// TODO(thure): CodeMirror should not focus itself when it updates.
|
|
64
|
-
event.type === 'dismissableLayer.focusOutside' &&
|
|
65
|
-
(event.currentTarget as HTMLElement | undefined)?.classList.contains('cm-content')
|
|
66
|
-
) {
|
|
67
|
-
event.preventDefault();
|
|
68
|
-
} else {
|
|
69
|
-
setOpen(false);
|
|
70
|
-
layout.popoverOpen = false;
|
|
71
|
-
layout.popoverAnchor = undefined;
|
|
72
|
-
layout.popoverAnchorId = undefined;
|
|
73
|
-
layout.popoverSide = undefined;
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
[setOpen],
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
const collisionBoundaries: HTMLElement[] = useMemo(() => {
|
|
80
|
-
const closest = layout.popoverAnchor?.closest('[data-popover-collision-boundary]') as
|
|
81
|
-
| HTMLElement
|
|
82
|
-
| null
|
|
83
|
-
| undefined;
|
|
84
|
-
return closest ? [closest] : [];
|
|
85
|
-
}, [layout.popoverAnchor]);
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<Popover.Portal>
|
|
89
|
-
<Popover.Content
|
|
90
|
-
side={layout.popoverSide}
|
|
91
|
-
onInteractOutside={handleClose}
|
|
92
|
-
onEscapeKeyDown={handleClose}
|
|
93
|
-
collisionBoundary={collisionBoundaries}
|
|
94
|
-
sticky='always'
|
|
95
|
-
hideWhenDetached
|
|
96
|
-
>
|
|
97
|
-
<Popover.Viewport>
|
|
98
|
-
<Surface role='card--popover' data={layout.popoverContent} limit={1} />
|
|
99
|
-
</Popover.Viewport>
|
|
100
|
-
<Popover.Arrow />
|
|
101
|
-
</Popover.Content>
|
|
102
|
-
</Popover.Portal>
|
|
103
|
-
);
|
|
104
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
|
-
import React from 'react';
|
|
9
|
-
|
|
10
|
-
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
11
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
-
import { AttentionPlugin } from '@dxos/plugin-attention';
|
|
13
|
-
import { GraphPlugin } from '@dxos/plugin-graph';
|
|
14
|
-
import { Stack } from '@dxos/react-ui-stack';
|
|
15
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
16
|
-
|
|
17
|
-
import { DeckStateFactory } from '../../capabilities';
|
|
18
|
-
import { translations } from '../../translations';
|
|
19
|
-
|
|
20
|
-
import { Plank, type PlankProps } from './Plank';
|
|
21
|
-
|
|
22
|
-
const meta: Meta<PlankProps> = {
|
|
23
|
-
title: 'plugins/plugin-deck/Plank',
|
|
24
|
-
component: Plank,
|
|
25
|
-
render: (args) => {
|
|
26
|
-
return (
|
|
27
|
-
<Stack orientation='horizontal'>
|
|
28
|
-
<Plank {...args} />
|
|
29
|
-
</Stack>
|
|
30
|
-
);
|
|
31
|
-
},
|
|
32
|
-
decorators: [
|
|
33
|
-
withPluginManager({
|
|
34
|
-
plugins: [AttentionPlugin(), SettingsPlugin(), IntentPlugin(), GraphPlugin()],
|
|
35
|
-
capabilities: () => DeckStateFactory(),
|
|
36
|
-
}),
|
|
37
|
-
withTheme,
|
|
38
|
-
withLayout({ fullscreen: true }),
|
|
39
|
-
],
|
|
40
|
-
parameters: {
|
|
41
|
-
translations,
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export default meta;
|
|
46
|
-
|
|
47
|
-
type Story = StoryObj<PlankProps>;
|
|
48
|
-
|
|
49
|
-
// TODO(burdon): Need to define surface provider?
|
|
50
|
-
export const Default: Story = {
|
|
51
|
-
args: {
|
|
52
|
-
id: 'plank-1',
|
|
53
|
-
part: 'solo',
|
|
54
|
-
layoutMode: 'deck',
|
|
55
|
-
},
|
|
56
|
-
};
|