@dxos/plugin-deck 0.8.4-main.937b3ca → 0.8.4-main.9be5663bfe
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-HW74YZHJ.mjs +24 -0
- package/dist/lib/browser/add-toast-HW74YZHJ.mjs.map +7 -0
- package/dist/lib/browser/adjust-OXVHZTBE.mjs +96 -0
- package/dist/lib/browser/adjust-OXVHZTBE.mjs.map +7 -0
- package/dist/lib/browser/change-companion-Z3Q2UPX4.mjs +34 -0
- package/dist/lib/browser/change-companion-Z3Q2UPX4.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-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-GFOCQS7S.mjs +216 -0
- package/dist/lib/browser/chunk-GFOCQS7S.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -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-N5FCDT7Y.mjs +44 -0
- package/dist/lib/browser/close-N5FCDT7Y.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +147 -126
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/open-J5HV42UN.mjs +150 -0
- package/dist/lib/browser/open-J5HV42UN.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-VWNN7RYF.mjs +21 -0
- package/dist/lib/browser/revert-workspace-VWNN7RYF.mjs.map +7 -0
- package/dist/lib/browser/scroll-into-view-CA7E3PSO.mjs +21 -0
- package/dist/lib/browser/scroll-into-view-CA7E3PSO.mjs.map +7 -0
- package/dist/lib/browser/set-YVWQQZLE.mjs +37 -0
- package/dist/lib/browser/set-YVWQQZLE.mjs.map +7 -0
- package/dist/lib/browser/set-layout-mode-DRNBZHE7.mjs +90 -0
- package/dist/lib/browser/set-layout-mode-DRNBZHE7.mjs.map +7 -0
- package/dist/lib/browser/show-undo-KA2XHQ6E.mjs +59 -0
- package/dist/lib/browser/show-undo-KA2XHQ6E.mjs.map +7 -0
- package/dist/lib/browser/switch-workspace-U7SPENHU.mjs +68 -0
- package/dist/lib/browser/switch-workspace-U7SPENHU.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +8 -15
- package/dist/lib/browser/update-complementary-W6UVLWLI.mjs +28 -0
- package/dist/lib/browser/update-complementary-W6UVLWLI.mjs.map +7 -0
- package/dist/lib/browser/update-dialog-VCTI7WKS.mjs +29 -0
- package/dist/lib/browser/update-dialog-VCTI7WKS.mjs.map +7 -0
- package/dist/lib/browser/update-plank-size-6TPVOYLT.mjs +28 -0
- package/dist/lib/browser/update-plank-size-6TPVOYLT.mjs.map +7 -0
- package/dist/lib/browser/update-popover-4EVVZSB6.mjs +33 -0
- package/dist/lib/browser/update-popover-4EVVZSB6.mjs.map +7 -0
- package/dist/lib/browser/update-sidebar-PAZARC4Q.mjs +25 -0
- package/dist/lib/browser/update-sidebar-PAZARC4Q.mjs.map +7 -0
- package/dist/lib/node-esm/add-toast-FA7NTWKA.mjs +25 -0
- package/dist/lib/node-esm/add-toast-FA7NTWKA.mjs.map +7 -0
- package/dist/lib/node-esm/adjust-G6FGZW6H.mjs +97 -0
- package/dist/lib/node-esm/adjust-G6FGZW6H.mjs.map +7 -0
- package/dist/lib/node-esm/change-companion-V6343HMY.mjs +35 -0
- package/dist/lib/node-esm/change-companion-V6343HMY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6BWQJDNT.mjs +217 -0
- package/dist/lib/node-esm/chunk-6BWQJDNT.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-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-AMA63RJN.mjs +45 -0
- package/dist/lib/node-esm/close-AMA63RJN.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +147 -126
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/open-KRCARMEB.mjs +151 -0
- package/dist/lib/node-esm/open-KRCARMEB.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-A2K3JQFS.mjs +22 -0
- package/dist/lib/node-esm/revert-workspace-A2K3JQFS.mjs.map +7 -0
- package/dist/lib/node-esm/scroll-into-view-B2U4RQK7.mjs +22 -0
- package/dist/lib/node-esm/scroll-into-view-B2U4RQK7.mjs.map +7 -0
- package/dist/lib/node-esm/set-HCWNW76S.mjs +38 -0
- package/dist/lib/node-esm/set-HCWNW76S.mjs.map +7 -0
- package/dist/lib/node-esm/set-layout-mode-E27AI5KE.mjs +91 -0
- package/dist/lib/node-esm/set-layout-mode-E27AI5KE.mjs.map +7 -0
- package/dist/lib/node-esm/show-undo-YTZXH422.mjs +60 -0
- package/dist/lib/node-esm/show-undo-YTZXH422.mjs.map +7 -0
- package/dist/lib/node-esm/switch-workspace-AQCNGS4Y.mjs +69 -0
- package/dist/lib/node-esm/switch-workspace-AQCNGS4Y.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +8 -15
- package/dist/lib/node-esm/update-complementary-7HIRM7OT.mjs +29 -0
- package/dist/lib/node-esm/update-complementary-7HIRM7OT.mjs.map +7 -0
- package/dist/lib/node-esm/update-dialog-F3JF7MBZ.mjs +30 -0
- package/dist/lib/node-esm/update-dialog-F3JF7MBZ.mjs.map +7 -0
- package/dist/lib/node-esm/update-plank-size-IIZKU7YR.mjs +29 -0
- package/dist/lib/node-esm/update-plank-size-IIZKU7YR.mjs.map +7 -0
- package/dist/lib/node-esm/update-popover-RO5QEH4C.mjs +34 -0
- package/dist/lib/node-esm/update-popover-RO5QEH4C.mjs.map +7 -0
- package/dist/lib/node-esm/update-sidebar-2RX6VLEK.mjs +26 -0
- package/dist/lib/node-esm/update-sidebar-2RX6VLEK.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/check-app-scheme.d.ts +19 -0
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +210 -9
- 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/react-root.d.ts → react-root.d.ts} +1 -1
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +18 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +33 -17
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/{tools/tools.d.ts → tools.d.ts} +2 -2
- package/dist/types/src/capabilities/tools.d.ts.map +1 -0
- package/dist/types/src/capabilities/url-handler.d.ts +5 -0
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -0
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +4 -6
- 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.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/{components → containers}/DeckLayout/Toast.d.ts +3 -3
- 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 +15 -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 +1 -1
- package/dist/types/src/containers/Plank/PlankHeading.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Plank/PlankLoading.d.ts.map +1 -1
- package/dist/types/src/containers/Plank/PlankRoot.d.ts +37 -0
- package/dist/types/src/containers/Plank/PlankRoot.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/index.d.ts +4 -0
- package/dist/types/src/containers/Plank/index.d.ts.map +1 -0
- package/dist/types/src/containers/Sidebar/ComplementarySidebar.d.ts.map +1 -0
- package/dist/types/src/containers/Sidebar/Sidebar.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Sidebar/SidebarButton.d.ts.map +1 -1
- 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 +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +0 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckState.d.ts +3 -3
- package/dist/types/src/hooks/useDeckState.d.ts.map +1 -1
- 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/useSelectedCompanion.d.ts +13 -0
- package/dist/types/src/hooks/useSelectedCompanion.d.ts.map +1 -0
- 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/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 -54
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +10 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +33 -21
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +48 -96
- 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 +2 -2
- 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 +76 -44
- package/src/DeckPlugin.ts +17 -21
- package/src/capabilities/app-graph-builder.ts +127 -0
- package/src/capabilities/check-app-scheme.ts +139 -0
- package/src/capabilities/index.ts +14 -10
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +5 -5
- package/src/capabilities/react-surface.tsx +37 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +8 -9
- package/src/capabilities/{state/state.ts → state.ts} +18 -31
- package/src/capabilities/{tools/tools.ts → tools.ts} +4 -5
- package/src/capabilities/url-handler.ts +226 -0
- package/src/components/DeckSettings/DeckSettings.stories.tsx +37 -0
- package/src/components/DeckSettings/DeckSettings.tsx +55 -95
- 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 +11 -9
- 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/{components → containers}/DeckLayout/Dialog.tsx +12 -5
- package/src/containers/DeckLayout/Fallback.tsx +24 -0
- package/src/{components → containers}/DeckLayout/Popover.tsx +61 -18
- package/src/{components → containers}/DeckLayout/Toast.tsx +4 -4
- 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 +180 -0
- package/src/containers/Plank/PlankContent.tsx +45 -0
- package/src/{components → containers}/Plank/PlankControls.tsx +42 -35
- package/src/containers/Plank/PlankError.tsx +79 -0
- package/src/{components → containers}/Plank/PlankHeading.tsx +46 -47
- 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 +11 -9
- package/src/{components → containers}/Sidebar/SidebarButton.tsx +19 -19
- package/src/containers/index.ts +11 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useCompanions.ts +3 -3
- package/src/hooks/useDeckCompanions.ts +3 -8
- package/src/hooks/useDeckState.ts +14 -23
- package/src/hooks/useHoistStatusbar.ts +2 -2
- package/src/hooks/useMainSize.ts +2 -2
- package/src/hooks/useNodeActionExpander.ts +1 -1
- package/src/hooks/useSelectedCompanion.ts +32 -0
- package/src/layout.test.ts +59 -0
- package/src/layout.ts +38 -40
- package/src/meta.ts +1 -1
- 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 +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 -54
- package/src/types/Settings.ts +17 -0
- package/src/types/capabilities.ts +10 -8
- package/src/types/events.ts +6 -5
- package/src/types/index.ts +1 -0
- package/src/types/schema.ts +42 -112
- package/src/util/index.ts +2 -1
- package/src/util/layoutAppliesTopbar.ts +1 -1
- 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 +2 -2
- package/src/vite-env.d.ts +5 -0
- package/dist/lib/browser/app-graph-builder-DTVCULQ4.mjs +0 -120
- package/dist/lib/browser/app-graph-builder-DTVCULQ4.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-JSRXXIYF.mjs +0 -32
- package/dist/lib/browser/check-app-scheme-JSRXXIYF.mjs.map +0 -7
- package/dist/lib/browser/chunk-ATFPDN6J.mjs +0 -292
- package/dist/lib/browser/chunk-ATFPDN6J.mjs.map +0 -7
- package/dist/lib/browser/chunk-EREEXCHO.mjs +0 -1448
- package/dist/lib/browser/chunk-EREEXCHO.mjs.map +0 -7
- package/dist/lib/browser/chunk-NHABISX2.mjs +0 -152
- package/dist/lib/browser/chunk-NHABISX2.mjs.map +0 -7
- package/dist/lib/browser/chunk-UNG4CLLP.mjs +0 -161
- package/dist/lib/browser/chunk-UNG4CLLP.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-CDYBLZJ4.mjs +0 -595
- package/dist/lib/browser/operation-resolver-CDYBLZJ4.mjs.map +0 -7
- package/dist/lib/browser/react-root-LYNEKGHM.mjs +0 -47
- package/dist/lib/browser/react-root-LYNEKGHM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-RPKD7XUR.mjs +0 -42
- package/dist/lib/browser/react-surface-RPKD7XUR.mjs.map +0 -7
- package/dist/lib/browser/settings-OMHVGZ6V.mjs +0 -37
- package/dist/lib/browser/settings-OMHVGZ6V.mjs.map +0 -7
- package/dist/lib/browser/state-OC3BSB6E.mjs +0 -103
- package/dist/lib/browser/state-OC3BSB6E.mjs.map +0 -7
- package/dist/lib/browser/toolkit-R53LD3EA.mjs +0 -53
- package/dist/lib/browser/toolkit-R53LD3EA.mjs.map +0 -7
- package/dist/lib/browser/url-handler-53TE6JZO.mjs +0 -93
- package/dist/lib/browser/url-handler-53TE6JZO.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-473BNZDJ.mjs +0 -121
- package/dist/lib/node-esm/app-graph-builder-473BNZDJ.mjs.map +0 -7
- package/dist/lib/node-esm/check-app-scheme-IVYRHKRH.mjs +0 -33
- package/dist/lib/node-esm/check-app-scheme-IVYRHKRH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ADPMWKLL.mjs +0 -154
- package/dist/lib/node-esm/chunk-ADPMWKLL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SKEVPQ7E.mjs +0 -162
- package/dist/lib/node-esm/chunk-SKEVPQ7E.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-V6VEXRD4.mjs +0 -1449
- package/dist/lib/node-esm/chunk-V6VEXRD4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XAKTY3EB.mjs +0 -294
- package/dist/lib/node-esm/chunk-XAKTY3EB.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-WUOE33ID.mjs +0 -596
- package/dist/lib/node-esm/operation-resolver-WUOE33ID.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-L7H43AS3.mjs +0 -48
- package/dist/lib/node-esm/react-root-L7H43AS3.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-77DKVMDV.mjs +0 -43
- package/dist/lib/node-esm/react-surface-77DKVMDV.mjs.map +0 -7
- package/dist/lib/node-esm/settings-2HB6FKIK.mjs +0 -38
- package/dist/lib/node-esm/settings-2HB6FKIK.mjs.map +0 -7
- package/dist/lib/node-esm/state-JRQ45ACJ.mjs +0 -104
- package/dist/lib/node-esm/state-JRQ45ACJ.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-JLPZNNKB.mjs +0 -54
- package/dist/lib/node-esm/toolkit-JLPZNNKB.mjs.map +0 -7
- package/dist/lib/node-esm/url-handler-QGF2R24T.mjs +0 -94
- package/dist/lib/node-esm/url-handler-QGF2R24T.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts +0 -5
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts.map +0 -1
- package/dist/types/src/capabilities/check-app-scheme/index.d.ts +0 -3
- package/dist/types/src/capabilities/check-app-scheme/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
- package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -19
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +0 -21
- package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/index.d.ts +0 -172
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts +0 -3
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +0 -26
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +0 -1
- package/dist/types/src/capabilities/tools/index.d.ts +0 -3
- package/dist/types/src/capabilities/tools/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/tools/tools.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler/index.d.ts +0 -3
- package/dist/types/src/capabilities/url-handler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts +0 -5
- package/dist/types/src/capabilities/url-handler/url-handler.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.map +0 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +0 -74
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/DeckMain.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.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 -107
- 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/fragments.d.ts +0 -4
- package/dist/types/src/components/fragments.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/app-graph-builder/app-graph-builder.ts +0 -118
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/check-app-scheme/check-app-scheme.ts +0 -41
- package/src/capabilities/check-app-scheme/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -10
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -555
- package/src/capabilities/react-root/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -37
- package/src/capabilities/settings/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -7
- package/src/capabilities/toolkit/index.ts +0 -7
- package/src/capabilities/toolkit/toolkit.ts +0 -63
- package/src/capabilities/tools/index.ts +0 -7
- package/src/capabilities/url-handler/index.ts +0 -7
- package/src/capabilities/url-handler/url-handler.ts +0 -95
- package/src/components/DeckLayout/ContentEmpty.tsx +0 -30
- package/src/components/DeckLayout/DeckLayout.stories.tsx +0 -51
- package/src/components/DeckLayout/DeckLayout.tsx +0 -34
- package/src/components/DeckLayout/DeckMain.tsx +0 -286
- package/src/components/DeckLayout/Fallback.tsx +0 -28
- package/src/components/DeckLayout/Topbar.tsx +0 -11
- package/src/components/Plank/Plank.stories.tsx +0 -62
- package/src/components/Plank/Plank.tsx +0 -299
- package/src/components/Plank/PlankError.tsx +0 -49
- package/src/components/Sidebar/ComplementarySidebar.tsx +0 -221
- package/src/components/fragments.ts +0 -14
- package/src/util/overscroll.ts +0 -69
- /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/DeckLayout.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,21 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { Fragment, type MouseEvent, memo, useCallback, useEffect, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
8
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
9
9
|
import { Graph, type Node, useActionRunner } from '@dxos/plugin-graph';
|
|
10
10
|
import { Icon, IconButton, Popover, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
11
|
+
import { getLinkedVariant } from '@dxos/react-ui-attention';
|
|
11
12
|
import { StackItem, type StackItemSigilAction } from '@dxos/react-ui-stack';
|
|
12
13
|
import { TextTooltip } from '@dxos/react-ui-text-tooltip';
|
|
13
|
-
import { hoverableControls, hoverableFocusedWithinControls } from '@dxos/ui-theme';
|
|
14
|
+
import { hoverableControls, hoverableFocusedWithinControls, iconSize } from '@dxos/ui-theme';
|
|
14
15
|
|
|
15
|
-
import { useBreakpoints } from '
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { soloInlinePadding } from '../fragments';
|
|
16
|
+
import { useBreakpoints } from '#hooks';
|
|
17
|
+
import { meta } from '#meta';
|
|
18
|
+
import { DeckOperation } from '#operations';
|
|
19
|
+
import { type LayoutMode, PLANK_COMPANION_TYPE, type ResolvedPart } from '#types';
|
|
20
20
|
|
|
21
21
|
import { PlankCompanionControls, PlankControls } from './PlankControls';
|
|
22
|
+
import { usePlankContext } from './PlankRoot';
|
|
22
23
|
|
|
23
24
|
const MAX_COMPANIONS = 5;
|
|
24
25
|
|
|
@@ -55,14 +56,13 @@ export const PlankHeading = memo(
|
|
|
55
56
|
actions = [],
|
|
56
57
|
}: PlankHeadingProps) => {
|
|
57
58
|
const { t } = useTranslation(meta.id);
|
|
58
|
-
const {
|
|
59
|
+
const { graph, onAdjust, onChangeCompanion } = usePlankContext('PlankHeading');
|
|
59
60
|
const runAction = useActionRunner();
|
|
60
|
-
const { graph } = useAppGraph();
|
|
61
61
|
const breakpoint = useBreakpoints();
|
|
62
62
|
const icon = node?.properties?.icon ?? 'ph--placeholder--regular';
|
|
63
63
|
const label = pending
|
|
64
|
-
? t('pending
|
|
65
|
-
: toLocalizedString(node?.properties?.label ?? ['plank
|
|
64
|
+
? t('pending.heading')
|
|
65
|
+
: toLocalizedString(node?.properties?.label ?? ['plank-heading-fallback.label', { ns: meta.id }], t);
|
|
66
66
|
|
|
67
67
|
const isCompanionNode = node?.type === PLANK_COMPANION_TYPE;
|
|
68
68
|
|
|
@@ -70,7 +70,7 @@ export const PlankHeading = memo(
|
|
|
70
70
|
const frame = requestAnimationFrame(() => {
|
|
71
71
|
// Load actions for the node.
|
|
72
72
|
if (node) {
|
|
73
|
-
void Graph.expand(graph, node.id);
|
|
73
|
+
void Graph.expand(graph, node.id, 'child');
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
|
|
@@ -81,16 +81,16 @@ export const PlankHeading = memo(
|
|
|
81
81
|
const capabilities = useMemo(
|
|
82
82
|
() => ({
|
|
83
83
|
deck: deckEnabled ?? true,
|
|
84
|
-
solo: breakpoint !== 'mobile' && (part === 'solo' || part === '
|
|
84
|
+
solo: breakpoint !== 'mobile' && (part === 'solo' || part === 'multi'),
|
|
85
85
|
incrementStart: canIncrementStart,
|
|
86
86
|
incrementEnd: canIncrementEnd,
|
|
87
87
|
fullscreen: !isCompanionNode,
|
|
88
|
-
companion: !isCompanionNode && companions && companions.length > 0,
|
|
88
|
+
companion: layoutMode !== 'multi' && !isCompanionNode && companions && companions.length > 0,
|
|
89
89
|
}),
|
|
90
|
-
[breakpoint, part, companions, canIncrementStart, canIncrementEnd, isCompanionNode, deckEnabled],
|
|
90
|
+
[breakpoint, part, companions, canIncrementStart, canIncrementEnd, isCompanionNode, deckEnabled, layoutMode],
|
|
91
91
|
);
|
|
92
92
|
|
|
93
|
-
const
|
|
93
|
+
const variant = isCompanionNode ? getLinkedVariant(id) : undefined;
|
|
94
94
|
const sigilActions = useMemo(() => {
|
|
95
95
|
if (!node) {
|
|
96
96
|
return undefined;
|
|
@@ -99,8 +99,8 @@ export const PlankHeading = memo(
|
|
|
99
99
|
} else {
|
|
100
100
|
return [
|
|
101
101
|
actions,
|
|
102
|
-
Graph.getActions(graph, node.id).filter((
|
|
103
|
-
['list-item', 'list-item-primary', 'heading-list-item'].includes(
|
|
102
|
+
Graph.getActions(graph, node.id).filter((action) =>
|
|
103
|
+
['list-item', 'list-item-primary', 'heading-list-item'].includes(action.properties.disposition),
|
|
104
104
|
),
|
|
105
105
|
].filter((a) => a.length > 0);
|
|
106
106
|
}
|
|
@@ -117,56 +117,49 @@ export const PlankHeading = memo(
|
|
|
117
117
|
|
|
118
118
|
const handlePlankAction = useCallback(
|
|
119
119
|
(eventType: DeckOperation.PartAdjustment) => {
|
|
120
|
-
|
|
121
|
-
return invokePromise(DeckOperation.Adjust, { type: eventType, id });
|
|
122
|
-
} else if (eventType === 'close') {
|
|
123
|
-
if (part === 'complementary') {
|
|
124
|
-
return invokeSync(Common.LayoutOperation.UpdateComplementary, { state: 'collapsed' });
|
|
125
|
-
} else {
|
|
126
|
-
return invokeSync(Common.LayoutOperation.Close, { subject: [id] });
|
|
127
|
-
}
|
|
128
|
-
} else {
|
|
129
|
-
return invokePromise(DeckOperation.Adjust, { type: eventType, id });
|
|
130
|
-
}
|
|
120
|
+
onAdjust?.(id, eventType);
|
|
131
121
|
},
|
|
132
|
-
[
|
|
122
|
+
[onAdjust, id],
|
|
133
123
|
);
|
|
134
124
|
|
|
135
|
-
const ActionRoot = node && popoverAnchorId ===
|
|
125
|
+
const ActionRoot = node && popoverAnchorId === `${meta.id}:${node.id}` ? Popover.Anchor : Fragment;
|
|
136
126
|
|
|
137
127
|
const handleTabClick = useCallback(
|
|
138
128
|
(event: MouseEvent) => {
|
|
139
129
|
const target = (event.target as HTMLElement).closest('[data-id]') as HTMLElement | null;
|
|
140
130
|
const tabId = target?.dataset?.id;
|
|
141
|
-
if (
|
|
142
|
-
|
|
143
|
-
primary: primaryId,
|
|
144
|
-
companion: tabId,
|
|
145
|
-
});
|
|
131
|
+
if (tabId) {
|
|
132
|
+
onChangeCompanion?.(tabId);
|
|
146
133
|
}
|
|
147
134
|
},
|
|
148
|
-
[
|
|
135
|
+
[onChangeCompanion],
|
|
149
136
|
);
|
|
150
137
|
|
|
151
138
|
return (
|
|
152
139
|
<StackItem.Heading
|
|
140
|
+
data-tauri-drag-region
|
|
141
|
+
data-plank-heading
|
|
142
|
+
style={iconSize(5)}
|
|
153
143
|
classNames={[
|
|
154
|
-
'
|
|
155
|
-
part === 'solo'
|
|
144
|
+
'py-1 items-stretch gap-1 sticky left-12 dx-app-drag min-w-0 dx-contain-layout dx-density-coarse',
|
|
145
|
+
part === 'solo'
|
|
146
|
+
? 'ps-[calc(env(safe-area-inset-left)+.25rem)] pe-[calc(env(safe-area-inset-right)+.25rem)]'
|
|
147
|
+
: 'px-1',
|
|
156
148
|
...(layoutMode === 'solo--fullscreen'
|
|
157
149
|
? [
|
|
158
150
|
hoverableControls,
|
|
159
151
|
hoverableFocusedWithinControls,
|
|
160
|
-
'*:transition-opacity *:opacity-
|
|
161
|
-
'
|
|
152
|
+
'*:transition-opacity *:opacity-(--controls-opacity) bg-transparent',
|
|
153
|
+
'border-transparent transition-[background-color,border-color]',
|
|
154
|
+
'hover-hover:hover:bg-header-surface focus-within:bg-header-surface',
|
|
155
|
+
'hover-hover:hover:border-subdued-separator focus-within:border-subdued-separator',
|
|
162
156
|
]
|
|
163
157
|
: []),
|
|
164
158
|
]}
|
|
165
|
-
data-plank-heading
|
|
166
159
|
>
|
|
167
160
|
{companions && isCompanionNode ? (
|
|
168
161
|
/* TODO(thure): IMPORTANT: This is a tablist; it should be implemented as such. */
|
|
169
|
-
<div role='none' className='flex-1 min-
|
|
162
|
+
<div data-tauri-drag-region role='none' className='flex-1 min-w-0 overflow-x-auto scrollbar-none flex gap-1'>
|
|
170
163
|
{companions.map(({ id, properties: { icon, label } }) => (
|
|
171
164
|
<IconButton
|
|
172
165
|
key={id}
|
|
@@ -187,11 +180,14 @@ export const PlankHeading = memo(
|
|
|
187
180
|
icon={icon}
|
|
188
181
|
related={part === 'complementary'}
|
|
189
182
|
attendableId={attendableId}
|
|
190
|
-
triggerLabel={t('actions
|
|
183
|
+
triggerLabel={t('actions-menu.label')}
|
|
191
184
|
actions={sigilActions}
|
|
192
185
|
onAction={handleAction}
|
|
193
186
|
>
|
|
194
|
-
<Surface
|
|
187
|
+
<Surface.Surface
|
|
188
|
+
role='menu-footer'
|
|
189
|
+
data={{ subject: node.data } satisfies AppSurface.MenuFooterData}
|
|
190
|
+
/>
|
|
195
191
|
</StackItem.Sigil>
|
|
196
192
|
) : (
|
|
197
193
|
<StackItem.SigilButton>
|
|
@@ -202,6 +198,7 @@ export const PlankHeading = memo(
|
|
|
202
198
|
</ActionRoot>
|
|
203
199
|
<TextTooltip text={label} onlyWhenTruncating>
|
|
204
200
|
<StackItem.HeadingLabel
|
|
201
|
+
data-tauri-drag-region
|
|
205
202
|
attendableId={attendableId}
|
|
206
203
|
related={part === 'complementary'}
|
|
207
204
|
{...(pending && { classNames: 'text-description' })}
|
|
@@ -211,7 +208,9 @@ export const PlankHeading = memo(
|
|
|
211
208
|
</TextTooltip>
|
|
212
209
|
</>
|
|
213
210
|
)}
|
|
214
|
-
{node && part !== 'complementary' &&
|
|
211
|
+
{node && part !== 'complementary' && (
|
|
212
|
+
<Surface.Surface role='navbar-end' data={{ subject: node.data } satisfies AppSurface.NavbarEndData} />
|
|
213
|
+
)}
|
|
215
214
|
{companioned === 'companion' ? (
|
|
216
215
|
<PlankCompanionControls primary={primaryId} />
|
|
217
216
|
) : (
|
|
@@ -6,5 +6,5 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
// TODO(burdon): Show skeleton: https://github.com/dxos/dxos/issues/8259
|
|
8
8
|
export const PlankLoading = () => {
|
|
9
|
-
return <div role='none' className='grid place-items-center attention-surface' />;
|
|
9
|
+
return <div role='none' className='grid place-items-center dx-attention-surface' />;
|
|
10
10
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { createContext } from '@radix-ui/react-context';
|
|
6
|
+
import React, { PropsWithChildren } from 'react';
|
|
7
|
+
|
|
8
|
+
import { type Graph } from '@dxos/plugin-graph';
|
|
9
|
+
|
|
10
|
+
import { type DeckOperation } from '#operations';
|
|
11
|
+
import { type LayoutMode, type PlankSizing, type ResolvedPart, type Settings } from '#types';
|
|
12
|
+
|
|
13
|
+
const PLANK_NAME = 'Plank';
|
|
14
|
+
|
|
15
|
+
export type PlankContextValue = {
|
|
16
|
+
/** The application graph. */
|
|
17
|
+
graph: Graph.ExpandableGraph;
|
|
18
|
+
/** Which part of the layout this plank occupies. */
|
|
19
|
+
part: ResolvedPart;
|
|
20
|
+
/** Current layout mode. */
|
|
21
|
+
layoutMode: LayoutMode;
|
|
22
|
+
/** Deck settings. */
|
|
23
|
+
settings?: Settings.Settings;
|
|
24
|
+
/** Popover anchor ID for heading menus. */
|
|
25
|
+
popoverAnchorId?: string;
|
|
26
|
+
/** ID of plank that should be scrolled into view. */
|
|
27
|
+
scrollIntoView?: string;
|
|
28
|
+
/** Persisted plank sizes keyed by plank ID. */
|
|
29
|
+
plankSizing?: PlankSizing;
|
|
30
|
+
/** Callback for plank adjustments (close, solo, increment, companion). */
|
|
31
|
+
onAdjust?: (id: string, type: DeckOperation.PartAdjustment) => void;
|
|
32
|
+
/** Callback for plank resize. */
|
|
33
|
+
onResize?: (id: string, size: number) => void;
|
|
34
|
+
/** Callback to clear scroll-into-view state. */
|
|
35
|
+
onScrollIntoView?: (id?: string) => void;
|
|
36
|
+
/** Callback to change the companion. */
|
|
37
|
+
onChangeCompanion?: (companion: string | null) => void;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const [PlankProvider, usePlankContext] = createContext<PlankContextValue>(PLANK_NAME);
|
|
41
|
+
|
|
42
|
+
export type PlankRootProps = PropsWithChildren<PlankContextValue>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Headless root that provides plank context.
|
|
46
|
+
*/
|
|
47
|
+
export const PlankRoot = ({ children, ...context }: PlankRootProps) => {
|
|
48
|
+
return <PlankProvider {...context}>{children}</PlankProvider>;
|
|
49
|
+
};
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type MouseEvent, useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Surface, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { IconButton, type Label, Main, Panel, toLocalizedString, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import { getLinkedVariant } from '@dxos/react-ui-attention';
|
|
11
|
+
import { Tabs } from '@dxos/react-ui-tabs';
|
|
12
|
+
import { iconSize, mx } from '@dxos/ui-theme';
|
|
13
|
+
|
|
14
|
+
import { type DeckCompanion, useBreakpoints, useDeckCompanions, useDeckState, useHoistStatusbar } from '#hooks';
|
|
15
|
+
import { meta } from '#meta';
|
|
16
|
+
import { getMode } from '#types';
|
|
17
|
+
|
|
18
|
+
import { layoutAppliesTopbar } from '../../util';
|
|
19
|
+
import { PlankErrorFallback, PlankLoading } from '../Plank';
|
|
20
|
+
import { ToggleComplementarySidebarButton } from './SidebarButton';
|
|
21
|
+
|
|
22
|
+
const label = ['complementary-sidebar.title', { ns: meta.id }] satisfies Label;
|
|
23
|
+
|
|
24
|
+
export type ComplementarySidebarProps = {
|
|
25
|
+
current?: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) => {
|
|
29
|
+
const { invokePromise } = useOperationInvoker();
|
|
30
|
+
const { t } = useTranslation(meta.id);
|
|
31
|
+
const { state, deck, updateState } = useDeckState();
|
|
32
|
+
const layoutMode = getMode(deck);
|
|
33
|
+
const breakpoint = useBreakpoints();
|
|
34
|
+
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
35
|
+
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
36
|
+
|
|
37
|
+
const companions = useDeckCompanions();
|
|
38
|
+
const activeCompanion = companions.find((companion) => getLinkedVariant(companion.id) === current);
|
|
39
|
+
const activeId = activeCompanion && getLinkedVariant(activeCompanion.id);
|
|
40
|
+
const [internalValue, setInternalValue] = useState(activeId);
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
setInternalValue(activeId);
|
|
44
|
+
}, [activeId]);
|
|
45
|
+
|
|
46
|
+
const handleTabClick = useCallback(
|
|
47
|
+
(event: MouseEvent) => {
|
|
48
|
+
const nextValue = event.currentTarget.getAttribute('data-value') as string;
|
|
49
|
+
if (nextValue === activeId) {
|
|
50
|
+
updateState((state) => ({
|
|
51
|
+
...state,
|
|
52
|
+
complementarySidebarState: state.complementarySidebarState === 'expanded' ? 'collapsed' : 'expanded',
|
|
53
|
+
}));
|
|
54
|
+
} else {
|
|
55
|
+
setInternalValue(nextValue);
|
|
56
|
+
updateState((state) => ({ ...state, complementarySidebarState: 'expanded' }));
|
|
57
|
+
void invokePromise(LayoutOperation.UpdateComplementary, { subject: nextValue });
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
[state.complementarySidebarState, activeId, invokePromise, updateState],
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
const data = useMemo(
|
|
64
|
+
() =>
|
|
65
|
+
activeCompanion && {
|
|
66
|
+
id: activeCompanion.id,
|
|
67
|
+
subject: activeCompanion.data,
|
|
68
|
+
},
|
|
69
|
+
[activeCompanion?.id, activeCompanion?.data],
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (!activeId) {
|
|
74
|
+
void invokePromise(LayoutOperation.UpdateComplementary, { state: 'collapsed' });
|
|
75
|
+
}
|
|
76
|
+
}, [activeId, invokePromise]);
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<Main.ComplementarySidebar
|
|
80
|
+
label={label}
|
|
81
|
+
classNames={[
|
|
82
|
+
topbar && 'top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]',
|
|
83
|
+
hoistStatusbar && 'bottom-(--dx-statusbar-size)',
|
|
84
|
+
]}
|
|
85
|
+
>
|
|
86
|
+
{/* R0 Tabs */}
|
|
87
|
+
<Tabs.Root orientation='vertical' value={internalValue} classNames='contents'>
|
|
88
|
+
<div
|
|
89
|
+
data-tauri-drag-region
|
|
90
|
+
role='none'
|
|
91
|
+
style={iconSize(5)}
|
|
92
|
+
className={mx(
|
|
93
|
+
'absolute z-20 inset-y-0 end-0 w-(--dx-r0-size)!',
|
|
94
|
+
'py-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)] border-s border-subdued-separator',
|
|
95
|
+
'grid grid-cols-1 grid-rows-[1fr_min-content] bg-toolbar-surface dx-contain-layout dx-app-drag',
|
|
96
|
+
)}
|
|
97
|
+
>
|
|
98
|
+
{/* TODO(burdon): ScrollArea. */}
|
|
99
|
+
<Tabs.Tablist classNames='grid grid-cols-1 auto-rows-(--dx-rail-action) overflow-y-auto'>
|
|
100
|
+
{companions.map((companion) => (
|
|
101
|
+
<Tabs.Tab key={getLinkedVariant(companion.id)} value={getLinkedVariant(companion.id)} asChild>
|
|
102
|
+
<IconButton
|
|
103
|
+
label={toLocalizedString(companion.properties.label, t)}
|
|
104
|
+
icon={companion.properties.icon}
|
|
105
|
+
iconOnly
|
|
106
|
+
tooltipSide='left'
|
|
107
|
+
data-value={getLinkedVariant(companion.id)}
|
|
108
|
+
variant={
|
|
109
|
+
activeId === getLinkedVariant(companion.id)
|
|
110
|
+
? state.complementarySidebarState === 'expanded'
|
|
111
|
+
? 'primary'
|
|
112
|
+
: 'ghost'
|
|
113
|
+
: 'ghost'
|
|
114
|
+
}
|
|
115
|
+
onClick={handleTabClick}
|
|
116
|
+
/>
|
|
117
|
+
</Tabs.Tab>
|
|
118
|
+
))}
|
|
119
|
+
</Tabs.Tablist>
|
|
120
|
+
{!hoistStatusbar && (
|
|
121
|
+
<div
|
|
122
|
+
role='none'
|
|
123
|
+
className='grid grid-cols-1 auto-rows-(--dx-rail-item) gap-0.5 overflow-y-auto'
|
|
124
|
+
style={iconSize(4)}
|
|
125
|
+
>
|
|
126
|
+
<Surface.Surface role='status-indicator' />
|
|
127
|
+
</div>
|
|
128
|
+
)}
|
|
129
|
+
<div role='none' className='hidden lg:grid grid-cols-1 auto-rows-(--dx-rail-action) p-1'>
|
|
130
|
+
<ToggleComplementarySidebarButton />
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
{/* R1 Content. */}
|
|
135
|
+
{activeId &&
|
|
136
|
+
companions.map((companion) => (
|
|
137
|
+
<Tabs.Panel
|
|
138
|
+
key={getLinkedVariant(companion.id)}
|
|
139
|
+
value={getLinkedVariant(companion.id)}
|
|
140
|
+
classNames={[
|
|
141
|
+
'absolute data-[state="inactive"]:-z-[1] overflow-hidden',
|
|
142
|
+
'inset-y-0 start-0 w-[calc(100%-var(--dx-r0-size))] lg:w-(--dx-r1-size)',
|
|
143
|
+
]}
|
|
144
|
+
{...(state.complementarySidebarState !== 'expanded' && { inert: true })}
|
|
145
|
+
>
|
|
146
|
+
<ComplementarySidebarPanel
|
|
147
|
+
companion={companion}
|
|
148
|
+
activeId={activeId}
|
|
149
|
+
data={data}
|
|
150
|
+
hoistStatusbar={hoistStatusbar}
|
|
151
|
+
/>
|
|
152
|
+
</Tabs.Panel>
|
|
153
|
+
))}
|
|
154
|
+
</Tabs.Root>
|
|
155
|
+
</Main.ComplementarySidebar>
|
|
156
|
+
);
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
type ComplementarySidebarPanelProps = {
|
|
160
|
+
companion: DeckCompanion;
|
|
161
|
+
activeId: string;
|
|
162
|
+
data?: {
|
|
163
|
+
id: string;
|
|
164
|
+
subject: any;
|
|
165
|
+
};
|
|
166
|
+
hoistStatusbar: boolean;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar }: ComplementarySidebarPanelProps) => {
|
|
170
|
+
const { t } = useTranslation(meta.id);
|
|
171
|
+
|
|
172
|
+
if (getLinkedVariant(companion.id) !== activeId && !data) {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return (
|
|
177
|
+
<Panel.Root>
|
|
178
|
+
<Panel.Toolbar asChild size='lg'>
|
|
179
|
+
<Toolbar.Root classNames='bg-modal-surface border-b border-subdued-separator'>
|
|
180
|
+
<IconButton
|
|
181
|
+
label={toLocalizedString(companion.properties.label, t)}
|
|
182
|
+
icon={companion.properties.icon}
|
|
183
|
+
iconOnly
|
|
184
|
+
tooltipSide='left'
|
|
185
|
+
data-value={getLinkedVariant(companion.id)}
|
|
186
|
+
classNames='h-10 w-10'
|
|
187
|
+
variant='default'
|
|
188
|
+
/>
|
|
189
|
+
<div role='none' className='px-1'>
|
|
190
|
+
{toLocalizedString(companion.properties.label, t)}
|
|
191
|
+
</div>
|
|
192
|
+
</Toolbar.Root>
|
|
193
|
+
</Panel.Toolbar>
|
|
194
|
+
<Panel.Content classNames='bg-base-surface'>
|
|
195
|
+
<Surface.Surface
|
|
196
|
+
role={`deck-companion--${getLinkedVariant(companion.id)}`}
|
|
197
|
+
data={data}
|
|
198
|
+
fallback={PlankErrorFallback}
|
|
199
|
+
placeholder={<PlankLoading />}
|
|
200
|
+
/>
|
|
201
|
+
</Panel.Content>
|
|
202
|
+
{!hoistStatusbar && (
|
|
203
|
+
<Panel.Statusbar size='sm'>
|
|
204
|
+
<Surface.Surface role='status-bar--r1-footer' limit={1} />
|
|
205
|
+
</Panel.Statusbar>
|
|
206
|
+
)}
|
|
207
|
+
</Panel.Root>
|
|
208
|
+
);
|
|
209
|
+
};
|
|
@@ -4,15 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface } from '@dxos/app-framework/
|
|
7
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
8
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
9
|
import { type Label, Main } from '@dxos/react-ui';
|
|
9
10
|
|
|
10
|
-
import { useBreakpoints, useDeckState, useHoistStatusbar } from '
|
|
11
|
-
import { meta } from '
|
|
12
|
-
import { getMode } from '
|
|
11
|
+
import { useBreakpoints, useDeckState, useHoistStatusbar } from '#hooks';
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
import { getMode } from '#types';
|
|
14
|
+
|
|
13
15
|
import { layoutAppliesTopbar } from '../../util';
|
|
14
16
|
|
|
15
|
-
const label = ['sidebar
|
|
17
|
+
const label = ['sidebar.title', { ns: meta.id }] satisfies Label;
|
|
16
18
|
|
|
17
19
|
export const Sidebar = () => {
|
|
18
20
|
const { state, deck } = useDeckState();
|
|
@@ -22,7 +24,7 @@ export const Sidebar = () => {
|
|
|
22
24
|
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
23
25
|
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
24
26
|
|
|
25
|
-
const navigationData = useMemo(
|
|
27
|
+
const navigationData = useMemo<AppSurface.NavigationData<{ topbar: boolean; hoistStatusbar: boolean }>>(
|
|
26
28
|
() => ({ popoverAnchorId, topbar, hoistStatusbar, current }),
|
|
27
29
|
[popoverAnchorId, topbar, hoistStatusbar, current],
|
|
28
30
|
);
|
|
@@ -32,11 +34,11 @@ export const Sidebar = () => {
|
|
|
32
34
|
label={label}
|
|
33
35
|
classNames={[
|
|
34
36
|
'grid',
|
|
35
|
-
topbar && '
|
|
36
|
-
hoistStatusbar && '
|
|
37
|
+
topbar && 'top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]',
|
|
38
|
+
hoistStatusbar && 'bottom-(--dx-statusbar-size)',
|
|
37
39
|
]}
|
|
38
40
|
>
|
|
39
|
-
<Surface role='navigation' data={navigationData} limit={1} />
|
|
41
|
+
<Surface.Surface role='navigation' data={navigationData} limit={1} />
|
|
40
42
|
</Main.NavigationSidebar>
|
|
41
43
|
);
|
|
42
44
|
};
|
|
@@ -4,24 +4,25 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
9
|
import { IconButton, type IconButtonProps, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import { getLinkedVariant } from '@dxos/react-ui-attention';
|
|
10
11
|
|
|
11
|
-
import {
|
|
12
|
-
import { meta } from '
|
|
12
|
+
import { useDeckCompanions, useDeckState } from '#hooks';
|
|
13
|
+
import { meta } from '#meta';
|
|
13
14
|
|
|
14
15
|
export const ToggleSidebarButton = ({
|
|
15
16
|
classNames,
|
|
16
17
|
variant = 'ghost',
|
|
17
18
|
}: ThemedClassName<Pick<IconButtonProps, 'variant'>>) => {
|
|
18
|
-
const {
|
|
19
|
+
const { updateState } = useDeckState();
|
|
19
20
|
const { t } = useTranslation(meta.id);
|
|
20
21
|
|
|
21
22
|
const handleClick = useCallback(() => {
|
|
22
|
-
updateState((
|
|
23
|
-
...
|
|
24
|
-
sidebarState:
|
|
23
|
+
updateState((state) => ({
|
|
24
|
+
...state,
|
|
25
|
+
sidebarState: state.sidebarState === 'expanded' ? 'collapsed' : 'expanded',
|
|
25
26
|
}));
|
|
26
27
|
}, [updateState]);
|
|
27
28
|
|
|
@@ -31,7 +32,7 @@ export const ToggleSidebarButton = ({
|
|
|
31
32
|
icon='ph--sidebar--regular'
|
|
32
33
|
iconOnly
|
|
33
34
|
size={4}
|
|
34
|
-
label={t('open
|
|
35
|
+
label={t('open-navigation-sidebar.label')}
|
|
35
36
|
onClick={handleClick}
|
|
36
37
|
classNames={classNames}
|
|
37
38
|
/>
|
|
@@ -43,7 +44,7 @@ export const CloseSidebarButton = () => {
|
|
|
43
44
|
const { t } = useTranslation(meta.id);
|
|
44
45
|
|
|
45
46
|
const handleClick = useCallback(() => {
|
|
46
|
-
updateState((
|
|
47
|
+
updateState((state) => ({ ...state, sidebarState: 'collapsed' }));
|
|
47
48
|
}, [updateState]);
|
|
48
49
|
|
|
49
50
|
return (
|
|
@@ -52,9 +53,9 @@ export const CloseSidebarButton = () => {
|
|
|
52
53
|
icon='ph--caret-line-left--regular'
|
|
53
54
|
iconOnly
|
|
54
55
|
size={4}
|
|
55
|
-
label={t('close
|
|
56
|
+
label={t('close-navigation-sidebar.button')}
|
|
56
57
|
onClick={handleClick}
|
|
57
|
-
classNames='rounded-none
|
|
58
|
+
classNames='rounded-none px-1 dx-focus-ring-inset pe-[max(.5rem,env(safe-area-inset-left))]'
|
|
58
59
|
/>
|
|
59
60
|
);
|
|
60
61
|
};
|
|
@@ -64,20 +65,20 @@ export const ToggleComplementarySidebarButton = ({
|
|
|
64
65
|
classNames,
|
|
65
66
|
current,
|
|
66
67
|
}: ThemedClassName<{ inR0?: boolean; current?: string }>) => {
|
|
67
|
-
const {
|
|
68
|
+
const { invokePromise } = useOperationInvoker();
|
|
68
69
|
const { state, updateState } = useDeckState();
|
|
69
70
|
const { t } = useTranslation(meta.id);
|
|
70
71
|
|
|
71
72
|
const companions = useDeckCompanions();
|
|
72
73
|
const handleClick = useCallback(() => {
|
|
73
74
|
const nextState = state.complementarySidebarState === 'expanded' ? 'collapsed' : 'expanded';
|
|
74
|
-
updateState((
|
|
75
|
+
updateState((state) => ({ ...state, complementarySidebarState: nextState }));
|
|
75
76
|
|
|
76
|
-
const subject = state.complementarySidebarPanel ?? (companions[0] &&
|
|
77
|
+
const subject = state.complementarySidebarPanel ?? (companions[0] && getLinkedVariant(companions[0].id));
|
|
77
78
|
if (nextState === 'expanded' && !current && subject) {
|
|
78
|
-
|
|
79
|
+
void invokePromise(LayoutOperation.UpdateComplementary, { subject });
|
|
79
80
|
}
|
|
80
|
-
}, [state, updateState, current, companions,
|
|
81
|
+
}, [state, updateState, current, companions, invokePromise]);
|
|
81
82
|
|
|
82
83
|
return (
|
|
83
84
|
<IconButton
|
|
@@ -85,8 +86,7 @@ export const ToggleComplementarySidebarButton = ({
|
|
|
85
86
|
classNames={['[&>svg]:-scale-x-100', classNames]}
|
|
86
87
|
icon='ph--sidebar-simple--regular'
|
|
87
88
|
iconOnly
|
|
88
|
-
label={t('open
|
|
89
|
-
size={inR0 ? 5 : 4}
|
|
89
|
+
label={t('open-complementary-sidebar.label')}
|
|
90
90
|
tooltipSide={inR0 ? 'left' : undefined}
|
|
91
91
|
onClick={handleClick}
|
|
92
92
|
/>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
6
|
+
|
|
7
|
+
export * from './Deck';
|
|
8
|
+
export * from './Plank';
|
|
9
|
+
export * from './Sidebar';
|
|
10
|
+
|
|
11
|
+
export const DeckLayout: ComponentType<any> = lazy(() => import('./DeckLayout'));
|
package/src/hooks/index.ts
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { useAppGraph } from '@dxos/app-
|
|
7
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
8
8
|
import { useConnections } from '@dxos/plugin-graph';
|
|
9
9
|
import { byPosition } from '@dxos/util';
|
|
10
10
|
|
|
11
|
-
import { PLANK_COMPANION_TYPE } from '
|
|
11
|
+
import { PLANK_COMPANION_TYPE } from '#types';
|
|
12
12
|
|
|
13
13
|
export const useCompanions = (id?: string) => {
|
|
14
14
|
const { graph } = useAppGraph();
|
|
15
|
-
const nodes = useConnections(graph, id);
|
|
15
|
+
const nodes = useConnections(graph, id, 'child');
|
|
16
16
|
const companions = nodes.filter((node) => node.type === PLANK_COMPANION_TYPE);
|
|
17
17
|
return useMemo(() => companions.toSorted((a, b) => byPosition(a.properties, b.properties)), [companions]);
|
|
18
18
|
};
|