@dxos/plugin-deck 0.9.0 → 0.9.1-staging.ee54ba693a
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/PLUGIN.mdl +3 -1
- package/dist/lib/neutral/{DeckLayout-DEURA3KR.mjs → DeckLayout-B3RUUV5P.mjs} +36 -22
- package/dist/lib/neutral/DeckLayout-B3RUUV5P.mjs.map +7 -0
- package/dist/lib/neutral/DeckPlugin.mjs +4 -8
- package/dist/lib/neutral/DeckPlugin.mjs.map +4 -4
- package/dist/lib/neutral/DeckSettings-Z7GMB7XJ.mjs +32 -0
- package/dist/lib/neutral/DeckSettings-Z7GMB7XJ.mjs.map +7 -0
- package/dist/lib/neutral/{add-toast-TNB6DXWU.mjs → add-toast-BHNEH5UY.mjs} +2 -2
- package/dist/lib/neutral/{adjust-HNU5CCRO.mjs → adjust-MJB6UMRQ.mjs} +16 -10
- package/dist/lib/neutral/adjust-MJB6UMRQ.mjs.map +7 -0
- package/dist/lib/neutral/{app-graph-builder-HMLT627T.mjs → app-graph-builder-2F7P4IFQ.mjs} +8 -7
- package/dist/lib/neutral/app-graph-builder-2F7P4IFQ.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +8 -8
- package/dist/lib/neutral/{check-app-scheme-INSOF72J.mjs → check-app-scheme-HSAORHHX.mjs} +2 -2
- package/dist/lib/neutral/chunk-FKGYHBUB.mjs +8 -0
- package/dist/lib/neutral/{chunk-BS4EOYMK.mjs → chunk-ICOJ4GMB.mjs} +37 -19
- package/dist/lib/neutral/chunk-ICOJ4GMB.mjs.map +7 -0
- package/dist/lib/neutral/chunk-KY7LMF4D.mjs +46 -0
- package/dist/lib/neutral/chunk-KY7LMF4D.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-324PPIZB.mjs → chunk-KZFJ4PBT.mjs} +4 -4
- package/dist/lib/neutral/chunk-KZFJ4PBT.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-GBIGQKYW.mjs → chunk-PP32NEVY.mjs} +4 -4
- package/dist/lib/neutral/chunk-PP32NEVY.mjs.map +7 -0
- package/dist/lib/neutral/chunk-SONATB35.mjs +20 -0
- package/dist/lib/neutral/chunk-SONATB35.mjs.map +7 -0
- package/dist/lib/neutral/chunk-Z2B5RSVI.mjs +1096 -0
- package/dist/lib/neutral/chunk-Z2B5RSVI.mjs.map +7 -0
- package/dist/lib/neutral/{close-ASKR22A6.mjs → close-2YGB5IIP.mjs} +4 -3
- package/dist/lib/neutral/{close-ASKR22A6.mjs.map → close-2YGB5IIP.mjs.map} +1 -1
- package/dist/lib/neutral/components/index.mjs +201 -16
- package/dist/lib/neutral/components/index.mjs.map +4 -4
- package/dist/lib/neutral/containers/index.mjs +6 -11
- package/dist/lib/neutral/containers/index.mjs.map +3 -3
- package/dist/lib/neutral/hooks/index.mjs +101 -17
- package/dist/lib/neutral/hooks/index.mjs.map +4 -4
- package/dist/lib/neutral/index.mjs +18 -2
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/meta.mjs +1 -1
- package/dist/lib/neutral/{notification-tracker-P36322BH.mjs → notification-tracker-Y5CRTWJM.mjs} +12 -10
- package/dist/lib/neutral/notification-tracker-Y5CRTWJM.mjs.map +7 -0
- package/dist/lib/neutral/{open-5OYNO3RT.mjs → open-P6XQ56M7.mjs} +8 -7
- package/dist/lib/neutral/open-P6XQ56M7.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +2 -2
- package/dist/lib/neutral/{react-root-HH5DEUOG.mjs → react-root-E6TAFHX6.mjs} +2 -2
- package/dist/lib/neutral/react-root-E6TAFHX6.mjs.map +7 -0
- package/dist/lib/neutral/{react-surface-3UVVCK3O.mjs → react-surface-H63FXUK3.mjs} +5 -6
- package/dist/lib/neutral/react-surface-H63FXUK3.mjs.map +7 -0
- package/dist/lib/neutral/{revert-workspace-B2QLT2C4.mjs → revert-workspace-RXWP2TEE.mjs} +2 -2
- package/dist/lib/neutral/{scroll-into-view-B52C3PJO.mjs → scroll-into-view-HFV5EGYZ.mjs} +2 -2
- package/dist/lib/neutral/{set-PA35ONXO.mjs → set-HOOVB7E4.mjs} +4 -3
- package/dist/lib/neutral/{set-PA35ONXO.mjs.map → set-HOOVB7E4.mjs.map} +1 -1
- package/dist/lib/neutral/{set-layout-mode-RPCCPQRB.mjs → set-layout-mode-XAGSZZGB.mjs} +2 -2
- package/dist/lib/neutral/{settings-EGNYUM4T.mjs → settings-6CDQEB6B.mjs} +3 -3
- package/dist/lib/neutral/settings-6CDQEB6B.mjs.map +7 -0
- package/dist/lib/neutral/{state-IIDXMQUO.mjs → state-F4X5GPGZ.mjs} +4 -3
- package/dist/lib/neutral/state-F4X5GPGZ.mjs.map +7 -0
- package/dist/lib/neutral/{switch-workspace-LZF4KZXH.mjs → switch-workspace-PA7N6EUX.mjs} +4 -4
- package/dist/lib/neutral/switch-workspace-PA7N6EUX.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +3 -3
- package/dist/lib/neutral/translations.mjs.map +3 -3
- package/dist/lib/neutral/types/index.mjs +11 -1
- package/dist/lib/neutral/{update-companion-YUCZZVGY.mjs → update-companion-6A2SKQAI.mjs} +14 -6
- package/dist/lib/neutral/update-companion-6A2SKQAI.mjs.map +7 -0
- package/dist/lib/neutral/{update-complementary-7FZNB55J.mjs → update-complementary-K55I5EV5.mjs} +2 -2
- package/dist/lib/neutral/{update-dialog-FNQTSSAP.mjs → update-dialog-Z3GEXMVV.mjs} +2 -2
- package/dist/lib/neutral/{update-plank-size-3YW4NXEY.mjs → update-plank-size-BTESVV7N.mjs} +2 -2
- package/dist/lib/neutral/{update-popover-G2VUD7E6.mjs → update-popover-QEVDSZSH.mjs} +2 -2
- package/dist/lib/neutral/{update-sidebar-KRHPUHUB.mjs → update-sidebar-VSRCN47U.mjs} +2 -2
- package/dist/lib/neutral/{url-handler-A6HLW4RB.mjs → url-handler-ERZXXEYR.mjs} +11 -10
- package/dist/lib/neutral/url-handler-ERZXXEYR.mjs.map +7 -0
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +8 -196
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/notification-tracker.d.ts +1 -1
- package/dist/types/src/capabilities/notification-tracker.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts +1 -5
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -3
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +1 -187
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/tools.d.ts +1 -1
- package/dist/types/src/capabilities/url-handler.d.ts +1 -1
- package/dist/types/src/components/Companion/Companion.d.ts +17 -0
- package/dist/types/src/components/Companion/Companion.d.ts.map +1 -0
- package/dist/types/src/components/Companion/index.d.ts +2 -0
- package/dist/types/src/components/Companion/index.d.ts.map +1 -0
- package/dist/types/src/components/Matrix/Matrix.d.ts +1 -1
- package/dist/types/src/components/Matrix/Matrix.d.ts.map +1 -1
- package/dist/types/src/components/Matrix/Matrix.stories.d.ts +2 -2
- package/dist/types/src/components/Matrix/Matrix.stories.d.ts.map +1 -1
- package/dist/types/src/components/Matrix/index.d.ts +1 -1
- package/dist/types/src/components/Matrix/index.d.ts.map +1 -1
- package/dist/types/src/components/Pane/Pane.d.ts +45 -0
- package/dist/types/src/components/Pane/Pane.d.ts.map +1 -0
- package/dist/types/src/components/Pane/Pane.stories.d.ts +7 -0
- package/dist/types/src/components/Pane/Pane.stories.d.ts.map +1 -0
- package/dist/types/src/components/Pane/index.d.ts +2 -0
- package/dist/types/src/components/Pane/index.d.ts.map +1 -0
- package/dist/types/src/components/Plank/Plank.d.ts +74 -0
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -0
- package/dist/types/src/components/Plank/Plank.stories.d.ts +6 -0
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -0
- package/dist/types/src/components/Plank/index.d.ts +2 -0
- package/dist/types/src/components/Plank/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 -1
- package/dist/types/src/containers/Deck/Deck.d.ts +1 -1
- package/dist/types/src/containers/Deck/Deck.d.ts.map +1 -1
- package/dist/types/src/containers/Deck/Deck.stories.d.ts +2 -2
- package/dist/types/src/containers/Deck/DeckPlank.d.ts +21 -0
- package/dist/types/src/containers/Deck/DeckPlank.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckViewport.d.ts +3 -1
- package/dist/types/src/containers/Deck/DeckViewport.d.ts.map +1 -1
- package/dist/types/src/containers/{Plank → Deck}/PlankControls.d.ts +3 -10
- package/dist/types/src/containers/Deck/PlankControls.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/PlankFallback.d.ts +6 -0
- package/dist/types/src/containers/Deck/PlankFallback.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/StatusBar.d.ts.map +1 -1
- package/dist/types/src/containers/Deck/useDeckPlank.d.ts +49 -0
- package/dist/types/src/containers/Deck/useDeckPlank.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts +2 -2
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts.map +1 -1
- package/dist/types/src/containers/DeckLayout/Popover.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/DeckSettings/DeckSettings.d.ts +1 -1
- package/dist/types/src/containers/DeckSettings/DeckSettings.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/DeckSettings/DeckSettings.stories.d.ts +2 -2
- package/dist/types/src/{components → containers}/DeckSettings/DeckSettings.stories.d.ts.map +1 -1
- package/dist/types/src/containers/DeckSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/Sidebar/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +1 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- 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/useCompanionSplit.d.ts +28 -0
- package/dist/types/src/hooks/useCompanionSplit.d.ts.map +1 -0
- package/dist/types/src/hooks/useCompanions.d.ts +11 -7
- package/dist/types/src/hooks/useCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +2 -2
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckState.d.ts +1 -1
- package/dist/types/src/hooks/useDeckState.d.ts.map +1 -1
- package/dist/types/src/hooks/useSelectedCompanionVariant.d.ts +6 -0
- package/dist/types/src/hooks/useSelectedCompanionVariant.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +32 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/adjust.d.ts.map +1 -1
- package/dist/types/src/operations/open.d.ts.map +1 -1
- package/dist/types/src/operations/switch-workspace.d.ts.map +1 -1
- package/dist/types/src/operations/update-companion.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/DeckCapabilities.d.ts +4 -4
- package/dist/types/src/types/DeckCapabilities.d.ts.map +1 -1
- package/dist/types/src/types/DeckOperation.d.ts +2 -2
- package/dist/types/src/types/DeckOperation.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 +11 -9
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/surface.d.ts +12 -0
- package/dist/types/src/types/surface.d.ts.map +1 -0
- package/dist/types/src/util/companion-view-state.d.ts +16 -0
- package/dist/types/src/util/companion-view-state.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +1 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/plank-url-params.d.ts +2 -0
- package/dist/types/src/util/plank-url-params.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +35 -0
- package/package.json +50 -48
- package/src/DeckPlugin.test.ts +1 -1
- package/src/DeckPlugin.ts +2 -3
- package/src/capabilities/app-graph-builder.ts +7 -6
- package/src/capabilities/check-app-scheme.ts +3 -3
- package/src/capabilities/notification-tracker.ts +11 -9
- package/src/capabilities/react-root.tsx +1 -1
- package/src/capabilities/react-surface.tsx +4 -5
- package/src/capabilities/settings.ts +2 -2
- package/src/capabilities/state.ts +1 -1
- package/src/capabilities/url-handler.ts +7 -15
- package/src/components/Companion/Companion.tsx +91 -0
- package/src/components/Companion/index.ts +5 -0
- package/src/components/Matrix/Matrix.stories.tsx +15 -27
- package/src/components/Matrix/Matrix.tsx +3 -3
- package/src/components/Matrix/SPEC.md +1 -1
- package/src/components/Matrix/index.ts +1 -1
- package/src/components/Pane/Pane.stories.tsx +92 -0
- package/src/components/Pane/Pane.tsx +178 -0
- package/src/components/Pane/index.ts +5 -0
- package/src/components/Plank/Plank.stories.tsx +103 -0
- package/src/components/Plank/Plank.tsx +149 -0
- package/src/components/Plank/index.ts +5 -0
- package/src/components/index.ts +3 -4
- package/src/containers/Deck/Banner.tsx +5 -4
- package/src/containers/Deck/Deck.tsx +3 -3
- package/src/containers/Deck/DeckPlank.tsx +187 -0
- package/src/containers/Deck/DeckViewport.tsx +118 -246
- package/src/containers/{Plank → Deck}/PlankControls.tsx +21 -19
- package/src/containers/Deck/PlankFallback.tsx +42 -0
- package/src/containers/Deck/StatusBar.tsx +4 -2
- package/src/containers/Deck/useDeckPlank.ts +219 -0
- package/src/containers/DeckLayout/DeckLayout.stories.tsx +44 -60
- package/src/containers/DeckLayout/Dialog.tsx +1 -1
- package/src/containers/DeckLayout/Fallback.tsx +1 -1
- package/src/containers/DeckLayout/Popover.tsx +37 -20
- package/src/containers/DeckLayout/Toast.tsx +1 -1
- package/src/{components → containers}/DeckSettings/DeckSettings.stories.tsx +1 -1
- package/src/containers/DeckSettings/DeckSettings.tsx +42 -0
- package/src/containers/Sidebar/ComplementarySidebar.tsx +8 -7
- package/src/containers/Sidebar/Sidebar.tsx +1 -1
- package/src/containers/Sidebar/SidebarButton.tsx +3 -3
- package/src/containers/index.ts +1 -1
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useCompanionSplit.ts +78 -0
- package/src/hooks/useCompanions.ts +39 -7
- package/src/hooks/useDeckCompanions.ts +3 -3
- package/src/hooks/useDeckState.ts +1 -1
- package/src/hooks/useSelectedCompanionVariant.ts +14 -0
- package/src/index.ts +7 -0
- package/src/meta.ts +2 -27
- package/src/operations/adjust.ts +23 -12
- package/src/operations/open.ts +12 -10
- package/src/operations/switch-workspace.ts +2 -2
- package/src/operations/update-companion.ts +10 -6
- package/src/translations.ts +3 -3
- package/src/types/DeckCapabilities.ts +6 -4
- package/src/types/DeckEvents.ts +1 -1
- package/src/types/DeckOperation.ts +3 -2
- package/src/types/index.ts +1 -0
- package/src/types/schema.ts +21 -16
- package/src/types/surface.ts +28 -0
- package/src/util/companion-view-state.ts +28 -0
- package/src/util/index.ts +1 -0
- package/src/util/plank-url-params.test.ts +5 -0
- package/src/util/plank-url-params.ts +5 -3
- package/src/util/sanitize-persisted-state.test.ts +1 -1
- package/src/util/set-active.test.ts +1 -1
- package/dist/lib/neutral/DeckLayout-DEURA3KR.mjs.map +0 -7
- package/dist/lib/neutral/DeckSettings-W5I57OXM.mjs +0 -27
- package/dist/lib/neutral/DeckSettings-W5I57OXM.mjs.map +0 -7
- package/dist/lib/neutral/adjust-HNU5CCRO.mjs.map +0 -7
- package/dist/lib/neutral/app-graph-builder-HMLT627T.mjs.map +0 -7
- package/dist/lib/neutral/chunk-324PPIZB.mjs.map +0 -7
- package/dist/lib/neutral/chunk-BS4EOYMK.mjs.map +0 -7
- package/dist/lib/neutral/chunk-GBIGQKYW.mjs.map +0 -7
- package/dist/lib/neutral/chunk-PYEY5SEC.mjs +0 -37
- package/dist/lib/neutral/chunk-PYEY5SEC.mjs.map +0 -7
- package/dist/lib/neutral/chunk-Q4W6B4IB.mjs +0 -8
- package/dist/lib/neutral/chunk-WAXJPQJI.mjs +0 -1306
- package/dist/lib/neutral/chunk-WAXJPQJI.mjs.map +0 -7
- package/dist/lib/neutral/notification-tracker-P36322BH.mjs.map +0 -7
- package/dist/lib/neutral/open-5OYNO3RT.mjs.map +0 -7
- package/dist/lib/neutral/react-root-HH5DEUOG.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-3UVVCK3O.mjs.map +0 -7
- package/dist/lib/neutral/settings-EGNYUM4T.mjs.map +0 -7
- package/dist/lib/neutral/state-IIDXMQUO.mjs.map +0 -7
- package/dist/lib/neutral/switch-workspace-LZF4KZXH.mjs.map +0 -7
- package/dist/lib/neutral/update-companion-YUCZZVGY.mjs.map +0 -7
- package/dist/lib/neutral/url-handler-A6HLW4RB.mjs.map +0 -7
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +0 -1
- package/dist/types/src/components/DeckSettings/index.d.ts.map +0 -1
- package/dist/types/src/containers/Plank/Plank.d.ts +0 -17
- package/dist/types/src/containers/Plank/Plank.d.ts.map +0 -1
- package/dist/types/src/containers/Plank/Plank.stories.d.ts +0 -67
- package/dist/types/src/containers/Plank/Plank.stories.d.ts.map +0 -1
- package/dist/types/src/containers/Plank/PlankComponent.d.ts +0 -17
- package/dist/types/src/containers/Plank/PlankComponent.d.ts.map +0 -1
- package/dist/types/src/containers/Plank/PlankContent.d.ts +0 -10
- package/dist/types/src/containers/Plank/PlankContent.d.ts.map +0 -1
- package/dist/types/src/containers/Plank/PlankControls.d.ts.map +0 -1
- package/dist/types/src/containers/Plank/PlankError.d.ts +0 -15
- package/dist/types/src/containers/Plank/PlankError.d.ts.map +0 -1
- package/dist/types/src/containers/Plank/PlankHeading.d.ts +0 -22
- package/dist/types/src/containers/Plank/PlankHeading.d.ts.map +0 -1
- package/dist/types/src/containers/Plank/PlankLoading.d.ts +0 -3
- package/dist/types/src/containers/Plank/PlankLoading.d.ts.map +0 -1
- package/dist/types/src/containers/Plank/PlankRoot.d.ts +0 -37
- package/dist/types/src/containers/Plank/PlankRoot.d.ts.map +0 -1
- package/dist/types/src/containers/Plank/index.d.ts +0 -4
- package/dist/types/src/containers/Plank/index.d.ts.map +0 -1
- package/src/components/DeckSettings/DeckSettings.tsx +0 -34
- package/src/containers/Plank/Plank.stories.tsx +0 -108
- package/src/containers/Plank/Plank.tsx +0 -22
- package/src/containers/Plank/PlankComponent.tsx +0 -223
- package/src/containers/Plank/PlankContent.tsx +0 -45
- package/src/containers/Plank/PlankError.tsx +0 -82
- package/src/containers/Plank/PlankHeading.tsx +0 -237
- package/src/containers/Plank/PlankLoading.tsx +0 -10
- package/src/containers/Plank/PlankRoot.tsx +0 -49
- package/src/containers/Plank/index.ts +0 -7
- /package/dist/lib/neutral/{add-toast-TNB6DXWU.mjs.map → add-toast-BHNEH5UY.mjs.map} +0 -0
- /package/dist/lib/neutral/{check-app-scheme-INSOF72J.mjs.map → check-app-scheme-HSAORHHX.mjs.map} +0 -0
- /package/dist/lib/neutral/{chunk-Q4W6B4IB.mjs.map → chunk-FKGYHBUB.mjs.map} +0 -0
- /package/dist/lib/neutral/{revert-workspace-B2QLT2C4.mjs.map → revert-workspace-RXWP2TEE.mjs.map} +0 -0
- /package/dist/lib/neutral/{scroll-into-view-B52C3PJO.mjs.map → scroll-into-view-HFV5EGYZ.mjs.map} +0 -0
- /package/dist/lib/neutral/{set-layout-mode-RPCCPQRB.mjs.map → set-layout-mode-XAGSZZGB.mjs.map} +0 -0
- /package/dist/lib/neutral/{update-complementary-7FZNB55J.mjs.map → update-complementary-K55I5EV5.mjs.map} +0 -0
- /package/dist/lib/neutral/{update-dialog-FNQTSSAP.mjs.map → update-dialog-Z3GEXMVV.mjs.map} +0 -0
- /package/dist/lib/neutral/{update-plank-size-3YW4NXEY.mjs.map → update-plank-size-BTESVV7N.mjs.map} +0 -0
- /package/dist/lib/neutral/{update-popover-G2VUD7E6.mjs.map → update-popover-QEVDSZSH.mjs.map} +0 -0
- /package/dist/lib/neutral/{update-sidebar-KRHPUHUB.mjs.map → update-sidebar-VSRCN47U.mjs.map} +0 -0
- /package/dist/types/src/{components → containers}/DeckSettings/index.d.ts +0 -0
- /package/src/{components → containers}/DeckSettings/index.ts +0 -0
|
@@ -17,7 +17,7 @@ export const ToggleSidebarButton = ({
|
|
|
17
17
|
variant = 'ghost',
|
|
18
18
|
}: ThemedClassName<Pick<IconButtonProps, 'variant'>>) => {
|
|
19
19
|
const { updateState } = useDeckState();
|
|
20
|
-
const { t } = useTranslation(meta.
|
|
20
|
+
const { t } = useTranslation(meta.profile.key);
|
|
21
21
|
|
|
22
22
|
const handleClick = useCallback(() => {
|
|
23
23
|
updateState((state) => ({
|
|
@@ -41,7 +41,7 @@ export const ToggleSidebarButton = ({
|
|
|
41
41
|
|
|
42
42
|
export const CloseSidebarButton = () => {
|
|
43
43
|
const { updateState } = useDeckState();
|
|
44
|
-
const { t } = useTranslation(meta.
|
|
44
|
+
const { t } = useTranslation(meta.profile.key);
|
|
45
45
|
|
|
46
46
|
const handleClick = useCallback(() => {
|
|
47
47
|
updateState((state) => ({ ...state, sidebarState: 'collapsed' }));
|
|
@@ -67,7 +67,7 @@ export const ToggleComplementarySidebarButton = ({
|
|
|
67
67
|
}: ThemedClassName<{ inR0?: boolean; current?: string }>) => {
|
|
68
68
|
const { invokePromise } = useOperationInvoker();
|
|
69
69
|
const { state, updateState } = useDeckState();
|
|
70
|
-
const { t } = useTranslation(meta.
|
|
70
|
+
const { t } = useTranslation(meta.profile.key);
|
|
71
71
|
|
|
72
72
|
const companions = useDeckCompanions();
|
|
73
73
|
const handleClick = useCallback(() => {
|
package/src/containers/index.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type ComponentType, lazy } from 'react';
|
|
6
6
|
|
|
7
7
|
export * from './Deck';
|
|
8
|
-
export * from './Plank';
|
|
9
8
|
export * from './Sidebar';
|
|
10
9
|
|
|
11
10
|
export const DeckLayout: ComponentType<any> = lazy(() => import('./DeckLayout'));
|
|
11
|
+
export const DeckSettings: ComponentType<any> = lazy(() => import('./DeckSettings'));
|
package/src/hooks/index.ts
CHANGED
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
export * from './useBreakpoints';
|
|
6
6
|
export * from './useCompanions';
|
|
7
|
+
export * from './useCompanionSplit';
|
|
7
8
|
export * from './useDeckCompanions';
|
|
8
9
|
export * from './useDeckState';
|
|
9
10
|
export * from './useMainSize';
|
|
10
11
|
export * from './useNodeActionExpander';
|
|
11
12
|
export * from './useSelectedCompanion';
|
|
13
|
+
export * from './useSelectedCompanionVariant';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { type SplitterOrientation } from '@dxos/react-ui';
|
|
9
|
+
import { type AspectDef, defineViewState, useViewState, useViewStateActions } from '@dxos/react-ui-attention';
|
|
10
|
+
|
|
11
|
+
import { COMPANION_VIEW_STATE_CONTEXT } from '../util';
|
|
12
|
+
|
|
13
|
+
/** Companion split point (rem) used until the user resizes a given orientation. */
|
|
14
|
+
export const DEFAULT_COMPANION_SIZE = 30;
|
|
15
|
+
|
|
16
|
+
/** Trailing delay before a resize is committed to storage (drags fire continuously). */
|
|
17
|
+
const PERSIST_DELAY = 250;
|
|
18
|
+
|
|
19
|
+
const CompanionSplitSchema = Schema.Struct({
|
|
20
|
+
horizontal: Schema.optional(Schema.Number),
|
|
21
|
+
vertical: Schema.optional(Schema.Number),
|
|
22
|
+
}).pipe(Schema.mutable);
|
|
23
|
+
|
|
24
|
+
export type CompanionSplit = Schema.Schema.Type<typeof CompanionSplitSchema>;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Companion splitter sizes (rem), memoized separately for each orientation so toggling the companion
|
|
28
|
+
* between side-by-side and stacked restores that orientation's last split point. Stored in the `local`
|
|
29
|
+
* backend (localStorage, persisted across reloads) via react-ui-attention view state.
|
|
30
|
+
*/
|
|
31
|
+
export const companionSplitAspect: AspectDef<CompanionSplit> = defineViewState<CompanionSplit>({
|
|
32
|
+
key: 'deck-companion-split',
|
|
33
|
+
backend: 'local',
|
|
34
|
+
schema: CompanionSplitSchema,
|
|
35
|
+
defaultValue: () => ({}),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export type UseCompanionSplit = {
|
|
39
|
+
/** The remembered split point for the current orientation (or the default). */
|
|
40
|
+
size: number;
|
|
41
|
+
onSizeChange: (size: number) => void;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Reads and writes the global companion splitter size keyed by `orientation`. A live size keeps dragging
|
|
46
|
+
* smooth while the persisted write is debounced (and flushed on unmount) to avoid per-frame storage writes.
|
|
47
|
+
*/
|
|
48
|
+
export const useCompanionSplit = (orientation: SplitterOrientation): UseCompanionSplit => {
|
|
49
|
+
const split = useViewState(companionSplitAspect, COMPANION_VIEW_STATE_CONTEXT);
|
|
50
|
+
const { update } = useViewStateActions(companionSplitAspect, COMPANION_VIEW_STATE_CONTEXT);
|
|
51
|
+
const storedSize = split[orientation] ?? DEFAULT_COMPANION_SIZE;
|
|
52
|
+
|
|
53
|
+
// Drive the controlled Splitter from local state so a drag tracks the pointer without a storage
|
|
54
|
+
// round-trip per frame; reseed when the orientation switches (recall) or storage changes externally.
|
|
55
|
+
const [liveSize, setLiveSize] = useState(storedSize);
|
|
56
|
+
useEffect(() => setLiveSize(storedSize), [storedSize, orientation]);
|
|
57
|
+
|
|
58
|
+
// Flush the trailing write on unmount so the final size is not dropped inside the debounce window.
|
|
59
|
+
const pending = useRef<{ timer: ReturnType<typeof setTimeout>; flush: () => void } | undefined>(undefined);
|
|
60
|
+
useEffect(() => () => pending.current?.flush(), []);
|
|
61
|
+
|
|
62
|
+
const onSizeChange = useCallback(
|
|
63
|
+
(next: number) => {
|
|
64
|
+
setLiveSize(next);
|
|
65
|
+
if (pending.current) {
|
|
66
|
+
clearTimeout(pending.current.timer);
|
|
67
|
+
}
|
|
68
|
+
const flush = () => {
|
|
69
|
+
pending.current = undefined;
|
|
70
|
+
update((prev) => ({ ...prev, [orientation]: next }));
|
|
71
|
+
};
|
|
72
|
+
pending.current = { timer: setTimeout(flush, PERSIST_DELAY), flush };
|
|
73
|
+
},
|
|
74
|
+
[update, orientation],
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
return useMemo(() => ({ size: liveSize, onSizeChange }), [liveSize, onSizeChange]);
|
|
78
|
+
};
|
|
@@ -2,17 +2,49 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { RegistryContext } from '@effect-atom/atom-react';
|
|
6
|
+
import { useContext, useEffect, useState } from 'react';
|
|
6
7
|
|
|
7
8
|
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
9
|
+
import { type Node } from '@dxos/plugin-graph';
|
|
10
|
+
import { Position } from '@dxos/util';
|
|
10
11
|
|
|
11
12
|
import { PLANK_COMPANION_TYPE } from '#types';
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Companion (child) nodes for a plank.
|
|
16
|
+
*
|
|
17
|
+
* The node's child-connections atom is read in a commit-phase effect rather than during render.
|
|
18
|
+
* Subscribing to it during render (via `useConnections`/`useAtomValue`) recomputes the shared atom and
|
|
19
|
+
* synchronously notifies its other subscribers — notably navtree items rendering the same node — which
|
|
20
|
+
* surfaces as a React "cannot update a component while rendering a different component" warning. Reading
|
|
21
|
+
* it from an effect defers that notification to the commit phase where cross-component updates are allowed.
|
|
22
|
+
*/
|
|
23
|
+
export const useCompanions = (id?: string): Node.Node[] => {
|
|
14
24
|
const { graph } = useAppGraph();
|
|
15
|
-
const
|
|
16
|
-
const companions =
|
|
17
|
-
|
|
25
|
+
const registry = useContext(RegistryContext);
|
|
26
|
+
const [companions, setCompanions] = useState<Node.Node[]>([]);
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!id) {
|
|
30
|
+
setCompanions([]);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const atom = graph.connections(id, 'child');
|
|
35
|
+
const update = () => {
|
|
36
|
+
const next = registry
|
|
37
|
+
.get(atom)
|
|
38
|
+
.filter((node) => node.type === PLANK_COMPANION_TYPE)
|
|
39
|
+
.toSorted((a, b) => Position.compare(a.properties, b.properties));
|
|
40
|
+
setCompanions((prev) =>
|
|
41
|
+
prev.length === next.length && prev.every((node, index) => node === next[index]) ? prev : next,
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
update();
|
|
46
|
+
return registry.subscribe(atom, update);
|
|
47
|
+
}, [graph, registry, id]);
|
|
48
|
+
|
|
49
|
+
return companions;
|
|
18
50
|
};
|
|
@@ -6,7 +6,7 @@ import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
|
6
6
|
import { Node, type Node as NodeType } from '@dxos/plugin-graph';
|
|
7
7
|
import { useConnections } from '@dxos/plugin-graph';
|
|
8
8
|
import { type Label } from '@dxos/ui-types/translations';
|
|
9
|
-
import {
|
|
9
|
+
import { Position } from '@dxos/util';
|
|
10
10
|
|
|
11
11
|
import { DECK_COMPANION_TYPE } from '#types';
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ export type DeckCompanion = NodeType.Node<
|
|
|
18
18
|
// TODO(burdon): Scroll area should be controlled by surface.
|
|
19
19
|
/** If true, the panel will not be wrapped in a scroll area. */
|
|
20
20
|
fixed?: boolean;
|
|
21
|
-
position?: Position;
|
|
21
|
+
position?: Position.Position;
|
|
22
22
|
joyride?: string;
|
|
23
23
|
}
|
|
24
24
|
>;
|
|
@@ -27,5 +27,5 @@ export const useDeckCompanions = (): DeckCompanion[] => {
|
|
|
27
27
|
const { graph } = useAppGraph();
|
|
28
28
|
const connections = useConnections(graph, Node.RootId, 'child');
|
|
29
29
|
const companions = connections.filter((node) => node.type === DECK_COMPANION_TYPE) as DeckCompanion[];
|
|
30
|
-
return companions.toSorted((a, b) =>
|
|
30
|
+
return companions.toSorted((a, b) => Position.compare(a.properties, b.properties));
|
|
31
31
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useViewState } from '@dxos/react-ui-attention';
|
|
6
|
+
|
|
7
|
+
import { COMPANION_VIEW_STATE_CONTEXT, companionVariantAspect } from '../util';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Reads the globally-selected companion variant (persisted via view state) so reopening the companion
|
|
11
|
+
* restores the last-selected tab rather than resetting to the first.
|
|
12
|
+
*/
|
|
13
|
+
export const useSelectedCompanionVariant = (): string | undefined =>
|
|
14
|
+
useViewState(companionVariantAspect, COMPANION_VIEW_STATE_CONTEXT).variant;
|
package/src/index.ts
CHANGED
|
@@ -4,3 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
export * from './meta';
|
|
6
6
|
export * from './types';
|
|
7
|
+
// Companion selection view-state aspect — public so consumers (e.g. plugin-assistant) can read the
|
|
8
|
+
// globally-selected companion variant that used to live on `DeckState.companionVariant`.
|
|
9
|
+
export {
|
|
10
|
+
COMPANION_VIEW_STATE_CONTEXT,
|
|
11
|
+
type CompanionSelection,
|
|
12
|
+
companionVariantAspect,
|
|
13
|
+
} from './util/companion-view-state';
|
package/src/meta.ts
CHANGED
|
@@ -3,32 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Plugin } from '@dxos/app-framework';
|
|
6
|
-
import { DXN } from '@dxos/keys';
|
|
7
|
-
import { trim } from '@dxos/util';
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
key: DXN.make('org.dxos.plugin.deck'),
|
|
11
|
-
name: 'Layout',
|
|
12
|
-
author: 'DXOS',
|
|
13
|
-
spec: 'PLUGIN.mdl',
|
|
14
|
-
description: trim`
|
|
15
|
-
The Deck plugin is the core layout engine for DXOS Composer. It manages the multi-plank
|
|
16
|
-
workspace (the "deck"), sidebar panels, dialogs, popovers, and toast notifications, giving
|
|
17
|
-
users a flexible, persistent workspace they can arrange to match their workflow.
|
|
7
|
+
import config from '../dx.config';
|
|
18
8
|
|
|
19
|
-
|
|
20
|
-
navigate with stack semantics — opening from a pivot truncates planks to the right and
|
|
21
|
-
appends the new one — or switch to solo or fullscreen mode for focused, distraction-free
|
|
22
|
-
viewing.
|
|
23
|
-
|
|
24
|
-
Layout state (active planks, sidebar visibility, plank sizes, companion pane) is persisted
|
|
25
|
-
across sessions via KVS/localStorage. URL routing is handled by the plugin so that any
|
|
26
|
-
workspace configuration can be bookmarked or shared as a deep link.
|
|
27
|
-
|
|
28
|
-
All layout changes are expressed through typed LayoutOperations (Open, Close, SetLayoutMode,
|
|
29
|
-
UpdateSidebar, UpdateDialog, UpdatePopover, etc.) that any plugin in the system can dispatch,
|
|
30
|
-
keeping the layout logic centralised and easy to extend.
|
|
31
|
-
`,
|
|
32
|
-
icon: 'ph--layout--regular',
|
|
33
|
-
tags: ['system'],
|
|
34
|
-
});
|
|
9
|
+
export const meta = Plugin.getMetaFromConfig(config);
|
package/src/operations/adjust.ts
CHANGED
|
@@ -11,7 +11,6 @@ import { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
|
|
|
11
11
|
import { Operation } from '@dxos/compute';
|
|
12
12
|
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
13
13
|
import { Graph } from '@dxos/plugin-graph';
|
|
14
|
-
import { byPosition } from '@dxos/util';
|
|
15
14
|
|
|
16
15
|
import { incrementPlank } from '../layout';
|
|
17
16
|
import { DeckCapabilities, DeckOperation, PLANK_COMPANION_TYPE } from '../types';
|
|
@@ -60,19 +59,31 @@ const handler: Operation.WithHandler<typeof DeckOperation.Adjust> = DeckOperatio
|
|
|
60
59
|
yield* Operation.invoke(LayoutOperation.Open, { subject: [soloOperation.entryId] });
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
if (input.type === 'companion') {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
),
|
|
71
|
-
Option.flatMap((companions) => (companions.length > 0 ? Option.some(companions[0]) : Option.none())),
|
|
62
|
+
if (input.type === 'companion' || input.type === 'companion-vertical') {
|
|
63
|
+
const orientation = input.type === 'companion-vertical' ? 'vertical' : 'horizontal';
|
|
64
|
+
|
|
65
|
+
// Set the orientation first so an already-open companion re-orients in place (the Splitter stays
|
|
66
|
+
// mounted and only its `orientation` prop changes — panels are never unmounted).
|
|
67
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) =>
|
|
68
|
+
updateActiveDeck(state, { companionOrientation: orientation }),
|
|
72
69
|
);
|
|
73
70
|
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
// Open the companion when one is available; the selected variant lives in global view state and is
|
|
72
|
+
// resolved at render time, so opening restores the last-selected tab rather than forcing the first.
|
|
73
|
+
if (!deck.companionOpen) {
|
|
74
|
+
const hasCompanion = Function.pipe(
|
|
75
|
+
Graph.getNode(graph, input.id),
|
|
76
|
+
Option.map((node) =>
|
|
77
|
+
Graph.getConnections(graph, node.id, 'child').some((n) => n.type === PLANK_COMPANION_TYPE),
|
|
78
|
+
),
|
|
79
|
+
Option.getOrElse(() => false),
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
if (hasCompanion) {
|
|
83
|
+
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) =>
|
|
84
|
+
updateActiveDeck(state, { companionOpen: true }),
|
|
85
|
+
);
|
|
86
|
+
}
|
|
76
87
|
}
|
|
77
88
|
}
|
|
78
89
|
}),
|
package/src/operations/open.ts
CHANGED
|
@@ -6,13 +6,7 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
import * as Option from 'effect/Option';
|
|
7
7
|
|
|
8
8
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
-
import {
|
|
10
|
-
AppCapabilities,
|
|
11
|
-
LayoutOperation,
|
|
12
|
-
createEdgeExistenceChecker,
|
|
13
|
-
expandPath,
|
|
14
|
-
validateNavigationTarget,
|
|
15
|
-
} from '@dxos/app-toolkit';
|
|
9
|
+
import { AppCapabilities, LayoutOperation, NotFound } from '@dxos/app-toolkit';
|
|
16
10
|
import { Operation } from '@dxos/compute';
|
|
17
11
|
import { Context } from '@dxos/context';
|
|
18
12
|
import { Database, EID, Obj } from '@dxos/echo';
|
|
@@ -56,13 +50,15 @@ const handler: Operation.WithHandler<typeof LayoutOperation.Open> = LayoutOperat
|
|
|
56
50
|
}
|
|
57
51
|
: undefined;
|
|
58
52
|
const checkRemoteExistence = client
|
|
59
|
-
? createEdgeExistenceChecker((spaceId, body) =>
|
|
53
|
+
? NotFound.createEdgeExistenceChecker((spaceId, body) =>
|
|
54
|
+
client.edge.http.execQuery(new Context(), spaceId, body),
|
|
55
|
+
)
|
|
60
56
|
: undefined;
|
|
61
57
|
|
|
62
58
|
// Immediate: skip 404 / resolver checks but still expand the path (same as validate’s first step).
|
|
63
59
|
if (input.navigation === 'immediate') {
|
|
64
60
|
for (const subjectId of input.subject) {
|
|
65
|
-
expandPath(graph, subjectId);
|
|
61
|
+
NotFound.expandPath(graph, subjectId);
|
|
66
62
|
}
|
|
67
63
|
}
|
|
68
64
|
|
|
@@ -70,7 +66,13 @@ const handler: Operation.WithHandler<typeof LayoutOperation.Open> = LayoutOperat
|
|
|
70
66
|
input.subject.map((subjectId) =>
|
|
71
67
|
input.navigation === 'immediate'
|
|
72
68
|
? Effect.succeed(subjectId)
|
|
73
|
-
: validateNavigationTarget({
|
|
69
|
+
: NotFound.validateNavigationTarget({
|
|
70
|
+
graph,
|
|
71
|
+
subjectId,
|
|
72
|
+
pathResolvers,
|
|
73
|
+
checkLocalExistence,
|
|
74
|
+
checkRemoteExistence,
|
|
75
|
+
}),
|
|
74
76
|
),
|
|
75
77
|
);
|
|
76
78
|
input = { ...input, subject: validatedSubjects };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
-
import { AppCapabilities,
|
|
8
|
+
import { AppCapabilities, LayoutOperation, Paths } from '@dxos/app-toolkit';
|
|
9
9
|
import { Operation } from '@dxos/compute';
|
|
10
10
|
import { invariant } from '@dxos/invariant';
|
|
11
11
|
import { Graph, Node } from '@dxos/plugin-graph';
|
|
@@ -21,7 +21,7 @@ const handler: Operation.WithHandler<typeof LayoutOperation.SwitchWorkspace> = L
|
|
|
21
21
|
const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
22
22
|
// TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.
|
|
23
23
|
// Ideally this should be worked into the data model in a generic way.
|
|
24
|
-
const shouldUpdatePrevious = !isPinnedWorkspace(state.activeDeck);
|
|
24
|
+
const shouldUpdatePrevious = !Paths.isPinnedWorkspace(state.activeDeck);
|
|
25
25
|
|
|
26
26
|
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => {
|
|
27
27
|
const newDecks = state.decks[input.subject]
|
|
@@ -4,28 +4,32 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import { Capabilities } from '@dxos/app-framework';
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
8
|
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
9
|
import { Operation } from '@dxos/compute';
|
|
10
|
+
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
10
11
|
import { getLinkedVariant } from '@dxos/react-ui-attention';
|
|
11
12
|
|
|
12
13
|
import { DeckCapabilities } from '../types';
|
|
14
|
+
import { COMPANION_VIEW_STATE_CONTEXT, companionVariantAspect } from '../util';
|
|
13
15
|
import { updateActiveDeck } from './helpers';
|
|
14
16
|
|
|
15
17
|
const handler: Operation.WithHandler<typeof LayoutOperation.UpdateCompanion> = LayoutOperation.UpdateCompanion.pipe(
|
|
16
18
|
Operation.withHandler(
|
|
17
19
|
Effect.fnUntraced(function* (input) {
|
|
18
20
|
if (input.subject === null) {
|
|
21
|
+
// Leave the selected variant intact so reopening the companion restores the last tab.
|
|
19
22
|
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) =>
|
|
20
23
|
updateActiveDeck(state, { companionOpen: false }),
|
|
21
24
|
);
|
|
22
25
|
} else {
|
|
23
|
-
|
|
26
|
+
// The selected variant is global view state (shared with the split point), not deck state.
|
|
27
|
+
const viewState = yield* Capability.get(AttentionCapabilities.ViewState);
|
|
28
|
+
viewState.set(companionVariantAspect, COMPANION_VIEW_STATE_CONTEXT, {
|
|
29
|
+
variant: getLinkedVariant(input.subject),
|
|
30
|
+
});
|
|
24
31
|
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) =>
|
|
25
|
-
updateActiveDeck(state, {
|
|
26
|
-
companionOpen: true,
|
|
27
|
-
companionVariant: variant,
|
|
28
|
-
}),
|
|
32
|
+
updateActiveDeck(state, { companionOpen: true }),
|
|
29
33
|
);
|
|
30
34
|
}
|
|
31
35
|
}),
|
package/src/translations.ts
CHANGED
|
@@ -9,9 +9,8 @@ import { meta } from '#meta';
|
|
|
9
9
|
export const translations = [
|
|
10
10
|
{
|
|
11
11
|
'en-US': {
|
|
12
|
-
[meta.
|
|
12
|
+
[meta.profile.key]: {
|
|
13
13
|
'plugin.name': 'Deck',
|
|
14
|
-
'settings.title': 'Deck settings',
|
|
15
14
|
'main-header.label': 'Main header',
|
|
16
15
|
'open-navigation-sidebar.label': 'Open sidebar',
|
|
17
16
|
'collapse-navigation-sidebar.label': 'Close sidebar',
|
|
@@ -46,7 +45,8 @@ export const translations = [
|
|
|
46
45
|
'show-fullscreen-plank.label': 'Fullscreen',
|
|
47
46
|
'close.label': 'Close',
|
|
48
47
|
'minify.label': 'Minify',
|
|
49
|
-
'open-companion.label': 'Open companion',
|
|
48
|
+
'open-companion.label': 'Open companion side-by-side',
|
|
49
|
+
'open-companion-vertical.label': 'Open companion stacked',
|
|
50
50
|
'close-companion.label': 'Close companion',
|
|
51
51
|
'close-current.label': 'Close current plank',
|
|
52
52
|
'close-others.label': 'Close other planks',
|
|
@@ -12,16 +12,18 @@ import { invariant } from '@dxos/invariant';
|
|
|
12
12
|
|
|
13
13
|
import { meta } from '#meta';
|
|
14
14
|
|
|
15
|
-
import { type
|
|
15
|
+
import { type DeckState, type EphemeralDeckState, type StoredDeckState } from './schema';
|
|
16
16
|
|
|
17
|
-
export const Settings = Capability.make<Atom.Writable<import('./Settings').Settings>>(
|
|
17
|
+
export const Settings = Capability.make<Atom.Writable<import('./Settings').Settings>>(
|
|
18
|
+
`${meta.profile.key}.capability.settings`,
|
|
19
|
+
);
|
|
18
20
|
|
|
19
21
|
/** Persisted state (stored in KVS/localStorage). */
|
|
20
|
-
export const State = Capability.make<Atom.Writable<StoredDeckState>>(`${meta.
|
|
22
|
+
export const State = Capability.make<Atom.Writable<StoredDeckState>>(`${meta.profile.key}.capability.state`);
|
|
21
23
|
|
|
22
24
|
/** Transient/ephemeral state (not persisted). */
|
|
23
25
|
export const EphemeralState = Capability.make<Atom.Writable<EphemeralDeckState>>(
|
|
24
|
-
`${meta.
|
|
26
|
+
`${meta.profile.key}.capability.ephemeral-state`,
|
|
25
27
|
);
|
|
26
28
|
|
|
27
29
|
/** Get the current active deck from state. */
|
package/src/types/DeckEvents.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { meta } from '#meta';
|
|
|
12
12
|
import * as DeckCapabilities from './DeckCapabilities';
|
|
13
13
|
|
|
14
14
|
export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(
|
|
15
|
-
`${meta.
|
|
15
|
+
`${meta.profile.key}.state-ready`,
|
|
16
16
|
);
|
|
17
17
|
|
|
18
18
|
/** Fired when DeckSettings capability is ready. */
|
|
@@ -12,11 +12,12 @@ import { DXN } from '@dxos/keys';
|
|
|
12
12
|
|
|
13
13
|
import { meta } from '#meta';
|
|
14
14
|
|
|
15
|
-
const makeKey = (name: string) => DXN.make(`${meta.
|
|
15
|
+
const makeKey = (name: string) => DXN.make(`${meta.profile.key}.operation.${name}`);
|
|
16
16
|
|
|
17
17
|
const PartAdjustmentSchema = Schema.Union(
|
|
18
18
|
Schema.Literal('close').annotations({ description: 'Close the plank.' }),
|
|
19
|
-
Schema.Literal('companion').annotations({ description: 'Open the companion plank.' }),
|
|
19
|
+
Schema.Literal('companion').annotations({ description: 'Open the companion plank side-by-side.' }),
|
|
20
|
+
Schema.Literal('companion-vertical').annotations({ description: 'Open the companion plank stacked vertically.' }),
|
|
20
21
|
Schema.Literal('solo').annotations({ description: 'Solo the plank.' }),
|
|
21
22
|
Schema.Literal('solo--fullscreen').annotations({ description: 'Fullscreen the plank.' }),
|
|
22
23
|
Schema.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),
|
package/src/types/index.ts
CHANGED
package/src/types/schema.ts
CHANGED
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { AppNode, LayoutOperation, Translations } from '@dxos/app-toolkit';
|
|
8
8
|
import { type DeepReadonly } from '@dxos/util';
|
|
9
9
|
|
|
10
10
|
import { meta } from '#meta';
|
|
11
11
|
|
|
12
|
-
export
|
|
12
|
+
export const PLANK_COMPANION_TYPE = AppNode.PLANK_COMPANION_TYPE;
|
|
13
|
+
export const DECK_COMPANION_TYPE = AppNode.DECK_COMPANION_TYPE;
|
|
13
14
|
|
|
14
15
|
export type Part = 'solo' | 'multi' | 'complementary';
|
|
15
16
|
export type ResolvedPart = Part | 'solo-primary' | 'solo-companion';
|
|
@@ -32,8 +33,8 @@ export const DeckState = Schema.Struct({
|
|
|
32
33
|
plankSizing: Schema.mutable(PlankSizing),
|
|
33
34
|
/** Whether the companion pane is visible alongside the active plank(s). */
|
|
34
35
|
companionOpen: Schema.Boolean,
|
|
35
|
-
/**
|
|
36
|
-
|
|
36
|
+
/** Orientation of the companion splitter: `horizontal` (side-by-side) or `vertical` (stacked). */
|
|
37
|
+
companionOrientation: Schema.optional(Schema.Literal('horizontal', 'vertical')),
|
|
37
38
|
/** Persisted companion frame widths in rem, keyed by frame ID. */
|
|
38
39
|
companionFrameSizing: Schema.mutable(PlankSizing),
|
|
39
40
|
});
|
|
@@ -47,7 +48,7 @@ export const defaultDeck: DeckState = {
|
|
|
47
48
|
fullscreen: false,
|
|
48
49
|
plankSizing: {},
|
|
49
50
|
companionOpen: false,
|
|
50
|
-
|
|
51
|
+
companionOrientation: 'horizontal',
|
|
51
52
|
companionFrameSizing: {},
|
|
52
53
|
};
|
|
53
54
|
|
|
@@ -91,8 +92,8 @@ export const EphemeralDeckState = Schema.Struct({
|
|
|
91
92
|
popoverSide: Schema.optional(Schema.Literal('top', 'right', 'bottom', 'left')),
|
|
92
93
|
popoverAnchor: Schema.optional(Schema.Any),
|
|
93
94
|
popoverAnchorId: Schema.optional(Schema.String),
|
|
94
|
-
popoverKind: Schema.optional(Schema.Literal('base', 'card')),
|
|
95
|
-
popoverTitle: Schema.optional(Label.annotations({ description: 'The title of the popover.' })),
|
|
95
|
+
popoverKind: Schema.optional(Schema.Literal('base', 'card', 'rename')),
|
|
96
|
+
popoverTitle: Schema.optional(Translations.Label.annotations({ description: 'The title of the popover.' })),
|
|
96
97
|
/** Ref of the subject to be passed to the popover Surface. */
|
|
97
98
|
popoverContentRef: Schema.optional(Schema.String),
|
|
98
99
|
/** Data to be passed to the popover Surface. */
|
|
@@ -115,7 +116,8 @@ export type DeckPluginState = StoredDeckState & EphemeralDeckState;
|
|
|
115
116
|
export namespace DeckAction {
|
|
116
117
|
const PartAdjustmentSchema = Schema.Union(
|
|
117
118
|
Schema.Literal('close').annotations({ description: 'Close the plank.' }),
|
|
118
|
-
Schema.Literal('companion').annotations({ description: 'Open the companion plank.' }),
|
|
119
|
+
Schema.Literal('companion').annotations({ description: 'Open the companion plank side-by-side.' }),
|
|
120
|
+
Schema.Literal('companion-vertical').annotations({ description: 'Open the companion plank stacked vertically.' }),
|
|
119
121
|
Schema.Literal('solo').annotations({ description: 'Solo the plank.' }),
|
|
120
122
|
Schema.Literal('solo--fullscreen').annotations({ description: 'Fullscreen the plank.' }),
|
|
121
123
|
Schema.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),
|
|
@@ -126,16 +128,19 @@ export namespace DeckAction {
|
|
|
126
128
|
export type Adjustment = Schema.Schema.Type<typeof Adjustment>;
|
|
127
129
|
|
|
128
130
|
// An atomic transaction to apply to the deck, describing which element to move to which location.
|
|
129
|
-
export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.
|
|
131
|
+
export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.profile.key}.action.adjust`, {
|
|
130
132
|
input: Adjustment,
|
|
131
133
|
output: Schema.Void,
|
|
132
134
|
}) {}
|
|
133
135
|
|
|
134
|
-
export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
136
|
+
export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(
|
|
137
|
+
`${meta.profile.key}.action.update-plank-size`,
|
|
138
|
+
{
|
|
139
|
+
input: Schema.Struct({
|
|
140
|
+
id: Schema.String,
|
|
141
|
+
size: Schema.Number,
|
|
142
|
+
}),
|
|
143
|
+
output: Schema.Void,
|
|
144
|
+
},
|
|
145
|
+
) {}
|
|
141
146
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
6
|
+
|
|
7
|
+
/** Slot for the main status-bar container. */
|
|
8
|
+
export const StatusBar: Surface.RoleToken<Record<string, unknown>> = Surface.makeType(
|
|
9
|
+
'org.dxos.plugin.statusBar.role.statusBar',
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
/** Slot for the status-bar footer region. */
|
|
13
|
+
export const StatusBarFooter: Surface.RoleToken<Record<string, unknown>> = Surface.makeType(
|
|
14
|
+
'org.dxos.plugin.statusBar.role.footer',
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
/** Slot for the version-info widget in the banner. */
|
|
18
|
+
export const VersionInfo: Surface.RoleToken<Record<string, unknown>> = Surface.makeType(
|
|
19
|
+
'org.dxos.plugin.statusBar.role.versionInfo',
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
/** Slot for the keyboard-shortcuts hints overlay. */
|
|
23
|
+
export const Hints: Surface.RoleToken<Record<string, unknown>> = Surface.makeType('org.dxos.plugin.support.role.hints');
|
|
24
|
+
|
|
25
|
+
/** Slot for the full keyboard-shortcuts list. */
|
|
26
|
+
export const Keyshortcuts: Surface.RoleToken<Record<string, unknown>> = Surface.makeType(
|
|
27
|
+
'org.dxos.plugin.support.role.keyshortcuts',
|
|
28
|
+
);
|