@dxos/plugin-deck 0.8.4-main.7ace549 → 0.8.4-main.8360d9e660
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/Banner-AJW6225V.mjs +14 -0
- package/dist/lib/browser/Banner-AJW6225V.mjs.map +7 -0
- package/dist/lib/browser/DeckSettings-HSSQKFNE.mjs +96 -0
- package/dist/lib/browser/DeckSettings-HSSQKFNE.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-MP6INIM2.mjs +123 -0
- package/dist/lib/browser/app-graph-builder-MP6INIM2.mjs.map +7 -0
- package/dist/lib/browser/check-app-scheme-AUNCD2Y6.mjs +33 -0
- package/dist/lib/browser/check-app-scheme-AUNCD2Y6.mjs.map +7 -0
- package/dist/lib/browser/chunk-3P2FJVXC.mjs +278 -0
- package/dist/lib/browser/chunk-3P2FJVXC.mjs.map +7 -0
- package/dist/lib/browser/chunk-BJDEG7YZ.mjs +74 -0
- package/dist/lib/browser/chunk-BJDEG7YZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-UXLU6CMW.mjs → chunk-L3RYMAV7.mjs} +2 -2
- package/dist/lib/browser/chunk-L3RYMAV7.mjs.map +7 -0
- package/dist/lib/browser/chunk-TAHLKBDO.mjs +187 -0
- package/dist/lib/browser/chunk-TAHLKBDO.mjs.map +7 -0
- package/dist/lib/browser/chunk-WTNYSXY5.mjs +1388 -0
- package/dist/lib/browser/chunk-WTNYSXY5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +82 -72
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-2TEGT4PG.mjs +639 -0
- package/dist/lib/browser/operation-resolver-2TEGT4PG.mjs.map +7 -0
- package/dist/lib/browser/react-root-XBFHPSCP.mjs +48 -0
- package/dist/lib/browser/react-root-XBFHPSCP.mjs.map +7 -0
- package/dist/lib/browser/react-surface-4J3BZNT2.mjs +44 -0
- package/dist/lib/browser/react-surface-4J3BZNT2.mjs.map +7 -0
- package/dist/lib/browser/settings-PTMGCSJH.mjs +40 -0
- package/dist/lib/browser/settings-PTMGCSJH.mjs.map +7 -0
- package/dist/lib/browser/state-MA4SQ7BE.mjs +106 -0
- package/dist/lib/browser/state-MA4SQ7BE.mjs.map +7 -0
- package/dist/lib/browser/toolkit-6B34QFU3.mjs +55 -0
- package/dist/lib/browser/toolkit-6B34QFU3.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +14 -8
- package/dist/lib/browser/url-handler-FEUFPQIP.mjs +98 -0
- package/dist/lib/browser/url-handler-FEUFPQIP.mjs.map +7 -0
- package/dist/lib/node-esm/Banner-XBH2IIDR.mjs +15 -0
- package/dist/lib/node-esm/Banner-XBH2IIDR.mjs.map +7 -0
- package/dist/lib/node-esm/DeckSettings-DJRFLKQS.mjs +97 -0
- package/dist/lib/node-esm/DeckSettings-DJRFLKQS.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-ACHG5HY7.mjs +124 -0
- package/dist/lib/node-esm/app-graph-builder-ACHG5HY7.mjs.map +7 -0
- package/dist/lib/node-esm/check-app-scheme-WN76GWVC.mjs +34 -0
- package/dist/lib/node-esm/check-app-scheme-WN76GWVC.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CQ3XYTNJ.mjs +1389 -0
- package/dist/lib/node-esm/chunk-CQ3XYTNJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DGTRKKWZ.mjs +76 -0
- package/dist/lib/node-esm/chunk-DGTRKKWZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-EMU4VIPH.mjs +188 -0
- package/dist/lib/node-esm/chunk-EMU4VIPH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GZJAQ5IP.mjs +279 -0
- package/dist/lib/node-esm/chunk-GZJAQ5IP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XCNF4COU.mjs +18 -0
- package/dist/lib/node-esm/chunk-XCNF4COU.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +185 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/operation-resolver-GCMCCI7A.mjs +640 -0
- package/dist/lib/node-esm/operation-resolver-GCMCCI7A.mjs.map +7 -0
- package/dist/lib/node-esm/react-root-32LZ6APH.mjs +49 -0
- package/dist/lib/node-esm/react-root-32LZ6APH.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-CO4ZDZKM.mjs +45 -0
- package/dist/lib/node-esm/react-surface-CO4ZDZKM.mjs.map +7 -0
- package/dist/lib/node-esm/settings-LPPFLXNJ.mjs +41 -0
- package/dist/lib/node-esm/settings-LPPFLXNJ.mjs.map +7 -0
- package/dist/lib/node-esm/state-KNRU3GDC.mjs +107 -0
- package/dist/lib/node-esm/state-KNRU3GDC.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-SOWYKJY3.mjs +56 -0
- package/dist/lib/node-esm/toolkit-SOWYKJY3.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +39 -0
- package/dist/lib/node-esm/url-handler-4LEB7UWF.mjs +99 -0
- package/dist/lib/node-esm/url-handler-4LEB7UWF.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts +2 -1
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts +5 -0
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts.map +1 -0
- package/dist/types/src/capabilities/check-app-scheme/index.d.ts +3 -0
- package/dist/types/src/capabilities/check-app-scheme/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +8 -13
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
- package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root/react-root.d.ts +9 -0
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +19 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +22 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/index.d.ts +172 -0
- package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/state.d.ts +175 -0
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts +3 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/{toolkit.d.ts → toolkit/toolkit.d.ts} +6 -4
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
- package/dist/types/src/capabilities/tools/index.d.ts +3 -0
- package/dist/types/src/capabilities/tools/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/tools/tools.d.ts +12 -0
- package/dist/types/src/capabilities/tools/tools.d.ts.map +1 -0
- package/dist/types/src/capabilities/url-handler/index.d.ts +3 -0
- package/dist/types/src/capabilities/url-handler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts +5 -0
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +1 -0
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts +3 -3
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.d.ts +5 -5
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +25 -6
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts +1 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankError.d.ts +6 -4
- package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts +2 -2
- package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +1 -1
- package/dist/types/src/components/fragments.d.ts +4 -1
- package/dist/types/src/components/fragments.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/Banner/Banner.d.ts +2 -0
- package/dist/types/src/containers/Banner/Banner.d.ts.map +1 -0
- package/dist/types/src/containers/Banner/index.d.ts +3 -0
- package/dist/types/src/containers/Banner/index.d.ts.map +1 -0
- package/dist/types/src/containers/DeckSettings/DeckSettings.d.ts +8 -0
- package/dist/types/src/containers/DeckSettings/DeckSettings.d.ts.map +1 -0
- package/dist/types/src/containers/DeckSettings/index.d.ts +3 -0
- package/dist/types/src/containers/DeckSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +4 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +3 -4
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckState.d.ts +17 -0
- package/dist/types/src/hooks/useDeckState.d.ts.map +1 -0
- package/dist/types/src/hooks/useHoistStatusbar.d.ts +1 -1
- package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
- package/dist/types/src/hooks/useMainSize.d.ts +2 -2
- package/dist/types/src/hooks/useNodeActionExpander.d.ts +1 -1
- package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
- package/dist/types/src/hooks/useSelectedCompanion.d.ts +13 -0
- package/dist/types/src/hooks/useSelectedCompanion.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/layout.d.ts +1 -7
- package/dist/types/src/layout.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/{capabilities → types}/capabilities.d.ts +96 -90
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +7 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +99 -38
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/util/set-active.d.ts +18 -3
- package/dist/types/src/util/set-active.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +59 -49
- package/src/DeckPlugin.ts +28 -48
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +119 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/check-app-scheme/check-app-scheme.ts +45 -0
- package/src/capabilities/check-app-scheme/index.ts +7 -0
- package/src/capabilities/index.ts +9 -14
- package/src/capabilities/operation-resolver/index.ts +10 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +558 -0
- package/src/capabilities/react-root/index.ts +7 -0
- package/src/capabilities/react-root/react-root.tsx +47 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +38 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +39 -0
- package/src/capabilities/state/index.ts +7 -0
- package/src/capabilities/state/state.ts +105 -0
- package/src/capabilities/toolkit/index.ts +7 -0
- package/src/capabilities/{toolkit.ts → toolkit/toolkit.ts} +20 -22
- package/src/capabilities/tools/index.ts +7 -0
- package/src/capabilities/tools/tools.ts +91 -0
- package/src/capabilities/url-handler/index.ts +7 -0
- package/src/capabilities/url-handler/url-handler.ts +98 -0
- package/src/components/DeckLayout/ActiveNode.tsx +3 -2
- package/src/components/DeckLayout/Banner.tsx +9 -9
- package/src/components/DeckLayout/ContentEmpty.tsx +5 -6
- package/src/components/DeckLayout/DeckLayout.stories.tsx +21 -31
- package/src/components/DeckLayout/DeckLayout.tsx +13 -11
- package/src/components/DeckLayout/DeckMain.tsx +64 -58
- package/src/components/DeckLayout/Dialog.tsx +22 -13
- package/src/components/DeckLayout/Fallback.tsx +2 -6
- package/src/components/DeckLayout/Popover.tsx +75 -22
- package/src/components/DeckLayout/StatusBar.tsx +4 -4
- package/src/components/DeckLayout/Toast.tsx +4 -4
- package/src/components/Plank/Plank.stories.tsx +19 -9
- package/src/components/Plank/Plank.tsx +46 -38
- package/src/components/Plank/PlankControls.tsx +8 -11
- package/src/components/Plank/PlankError.tsx +31 -17
- package/src/components/Plank/PlankHeading.tsx +39 -47
- package/src/components/Plank/PlankLoading.tsx +1 -1
- package/src/components/Sidebar/ComplementarySidebar.tsx +57 -51
- package/src/components/Sidebar/Sidebar.tsx +7 -7
- package/src/components/Sidebar/SidebarButton.tsx +31 -25
- package/src/components/fragments.ts +10 -5
- package/src/components/index.ts +0 -1
- package/src/containers/Banner/Banner.tsx +5 -0
- package/src/containers/Banner/index.ts +7 -0
- package/src/{components → containers}/DeckSettings/DeckSettings.tsx +41 -31
- package/src/containers/DeckSettings/index.ts +7 -0
- package/src/containers/index.ts +8 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useCompanions.ts +2 -2
- package/src/hooks/useDeckCompanions.ts +7 -11
- package/src/hooks/useDeckState.ts +82 -0
- package/src/hooks/useHoistStatusbar.ts +3 -6
- package/src/hooks/useMainSize.ts +2 -2
- package/src/hooks/useNodeActionExpander.ts +4 -4
- package/src/hooks/useSelectedCompanion.ts +32 -0
- package/src/index.ts +1 -2
- package/src/layout.ts +1 -14
- package/src/meta.ts +3 -3
- package/src/translations.ts +1 -0
- package/src/types/capabilities.ts +33 -0
- package/src/types/events.ts +21 -0
- package/src/types/index.ts +2 -0
- package/src/types/schema.ts +96 -25
- package/src/util/layoutAppliesTopbar.ts +1 -1
- package/src/util/overscroll.ts +3 -3
- package/src/util/set-active.ts +49 -29
- package/dist/lib/browser/app-graph-builder-D74NTOMK.mjs +0 -128
- package/dist/lib/browser/app-graph-builder-D74NTOMK.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-HIEVFAAX.mjs +0 -32
- package/dist/lib/browser/check-app-scheme-HIEVFAAX.mjs.map +0 -7
- package/dist/lib/browser/chunk-5KMJPIQC.mjs +0 -16
- package/dist/lib/browser/chunk-5KMJPIQC.mjs.map +0 -7
- package/dist/lib/browser/chunk-CNTGBCMK.mjs +0 -145
- package/dist/lib/browser/chunk-CNTGBCMK.mjs.map +0 -7
- package/dist/lib/browser/chunk-F3VCCHVL.mjs +0 -162
- package/dist/lib/browser/chunk-F3VCCHVL.mjs.map +0 -7
- package/dist/lib/browser/chunk-QKCGZ45E.mjs +0 -128
- package/dist/lib/browser/chunk-QKCGZ45E.mjs.map +0 -7
- package/dist/lib/browser/chunk-UXLU6CMW.mjs.map +0 -7
- package/dist/lib/browser/chunk-VBYJ664A.mjs +0 -132
- package/dist/lib/browser/chunk-VBYJ664A.mjs.map +0 -7
- package/dist/lib/browser/chunk-VUJ6UNIJ.mjs +0 -1553
- package/dist/lib/browser/chunk-VUJ6UNIJ.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-UA4YQGAC.mjs +0 -524
- package/dist/lib/browser/intent-resolver-UA4YQGAC.mjs.map +0 -7
- package/dist/lib/browser/react-root-JAMHKYWN.mjs +0 -44
- package/dist/lib/browser/react-root-JAMHKYWN.mjs.map +0 -7
- package/dist/lib/browser/react-surface-6LW337ZT.mjs +0 -40
- package/dist/lib/browser/react-surface-6LW337ZT.mjs.map +0 -7
- package/dist/lib/browser/settings-SDPTOCCM.mjs +0 -30
- package/dist/lib/browser/settings-SDPTOCCM.mjs.map +0 -7
- package/dist/lib/browser/state-7IFAGZQO.mjs +0 -12
- package/dist/lib/browser/toolkit-L5CFXJCF.mjs +0 -52
- package/dist/lib/browser/toolkit-L5CFXJCF.mjs.map +0 -7
- package/dist/lib/browser/url-handler-QEYGYE2H.mjs +0 -70
- package/dist/lib/browser/url-handler-QEYGYE2H.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts +0 -4
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root.d.ts +0 -7
- package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state.d.ts +0 -104
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
- package/dist/types/src/capabilities/tools.d.ts +0 -11
- package/dist/types/src/capabilities/tools.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler.d.ts +0 -4
- package/dist/types/src/capabilities/url-handler.d.ts.map +0 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +0 -6
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +0 -1
- package/dist/types/src/components/DeckSettings/index.d.ts +0 -2
- package/dist/types/src/components/DeckSettings/index.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -143
- package/src/capabilities/capabilities.ts +0 -14
- package/src/capabilities/check-app-scheme.ts +0 -40
- package/src/capabilities/intent-resolver.ts +0 -471
- package/src/capabilities/react-root.tsx +0 -40
- package/src/capabilities/react-surface.tsx +0 -30
- package/src/capabilities/settings.ts +0 -27
- package/src/capabilities/state.ts +0 -113
- package/src/capabilities/tools.ts +0 -84
- package/src/capabilities/url-handler.ts +0 -60
- package/src/components/DeckSettings/index.ts +0 -5
- package/src/events.ts +0 -11
- /package/dist/lib/{browser/state-7IFAGZQO.mjs.map → node-esm/types/index.mjs.map} +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
+
import { useCallback, useMemo } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities } from '@dxos/app-framework';
|
|
9
|
+
import { useCapability } from '@dxos/app-framework/ui';
|
|
10
|
+
import { invariant } from '@dxos/invariant';
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
DeckCapabilities,
|
|
14
|
+
type DeckEphemeralStateProps,
|
|
15
|
+
type DeckPluginState,
|
|
16
|
+
type DeckState,
|
|
17
|
+
type DeckStateProps,
|
|
18
|
+
} from '../types';
|
|
19
|
+
|
|
20
|
+
export type DeckStateHook = {
|
|
21
|
+
/** Combined state value (reactive). Includes both persisted and ephemeral state. */
|
|
22
|
+
state: DeckPluginState;
|
|
23
|
+
/** The active deck, computed from decks[activeDeck]. */
|
|
24
|
+
deck: DeckState;
|
|
25
|
+
/** Update persisted state. */
|
|
26
|
+
updateState: (fn: (current: DeckStateProps) => DeckStateProps) => void;
|
|
27
|
+
/** Update ephemeral state. */
|
|
28
|
+
updateEphemeral: (fn: (current: DeckEphemeralStateProps) => DeckEphemeralStateProps) => void;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Hook to access the deck plugin state reactively.
|
|
33
|
+
* Returns the combined state, the active deck, and update functions for each atom.
|
|
34
|
+
*/
|
|
35
|
+
export const useDeckState = (): DeckStateHook => {
|
|
36
|
+
const registry = useCapability(Capabilities.AtomRegistry);
|
|
37
|
+
const stateAtom = useCapability(DeckCapabilities.State);
|
|
38
|
+
const ephemeralAtom = useCapability(DeckCapabilities.EphemeralState);
|
|
39
|
+
|
|
40
|
+
const persistedState = useAtomValue(stateAtom);
|
|
41
|
+
const ephemeralState = useAtomValue(ephemeralAtom);
|
|
42
|
+
|
|
43
|
+
// Compute deck from decks[activeDeck] to ensure it's always current.
|
|
44
|
+
const deck = useMemo(() => {
|
|
45
|
+
const d = persistedState.decks[persistedState.activeDeck];
|
|
46
|
+
invariant(d, `Deck not found: ${persistedState.activeDeck}`);
|
|
47
|
+
return d;
|
|
48
|
+
}, [persistedState.decks, persistedState.activeDeck]);
|
|
49
|
+
|
|
50
|
+
// Combine persisted and ephemeral state into a unified view.
|
|
51
|
+
const state = useMemo(
|
|
52
|
+
(): DeckPluginState => ({
|
|
53
|
+
...persistedState,
|
|
54
|
+
...ephemeralState,
|
|
55
|
+
}),
|
|
56
|
+
[persistedState, ephemeralState],
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const updateState = useCallback(
|
|
60
|
+
(fn: (current: DeckStateProps) => DeckStateProps) => {
|
|
61
|
+
registry.set(stateAtom, fn(registry.get(stateAtom)));
|
|
62
|
+
},
|
|
63
|
+
[registry, stateAtom],
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const updateEphemeral = useCallback(
|
|
67
|
+
(fn: (current: DeckEphemeralStateProps) => DeckEphemeralStateProps) => {
|
|
68
|
+
registry.set(ephemeralAtom, fn(registry.get(ephemeralAtom)));
|
|
69
|
+
},
|
|
70
|
+
[registry, ephemeralAtom],
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
return useMemo(
|
|
74
|
+
() => ({
|
|
75
|
+
state,
|
|
76
|
+
deck,
|
|
77
|
+
updateState,
|
|
78
|
+
updateEphemeral,
|
|
79
|
+
}),
|
|
80
|
+
[state, deck, updateState, updateEphemeral],
|
|
81
|
+
);
|
|
82
|
+
};
|
|
@@ -4,17 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import { useCapability } from '@dxos/app-framework/react';
|
|
7
|
+
import { useAtomCapability } from '@dxos/app-framework/ui';
|
|
9
8
|
import { useThemeContext } from '@dxos/react-ui';
|
|
10
9
|
|
|
11
|
-
import {
|
|
12
|
-
import type { DeckSettingsProps, LayoutMode } from '../types';
|
|
10
|
+
import { DeckCapabilities, type LayoutMode } from '../types';
|
|
13
11
|
|
|
14
12
|
export const useHoistStatusbar = (breakpoint: string, layoutMode?: LayoutMode): boolean => {
|
|
15
13
|
const { safeAreaPadding } = useThemeContext();
|
|
16
|
-
const enableStatusbar =
|
|
17
|
-
.enableStatusbar;
|
|
14
|
+
const enableStatusbar = useAtomCapability(DeckCapabilities.Settings).enableStatusbar;
|
|
18
15
|
|
|
19
16
|
return useMemo(() => {
|
|
20
17
|
return (
|
package/src/hooks/useMainSize.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { useMainContext } from '@dxos/react-ui';
|
|
|
7
7
|
export const useMainSize = () => {
|
|
8
8
|
const { navigationSidebarState, complementarySidebarState } = useMainContext('DeckPluginPlank');
|
|
9
9
|
return {
|
|
10
|
-
'data-sidebar-
|
|
11
|
-
'data-sidebar-
|
|
10
|
+
'data-sidebar-left-state': navigationSidebarState,
|
|
11
|
+
'data-sidebar-right-state': complementarySidebarState,
|
|
12
12
|
};
|
|
13
13
|
};
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import { useEffect } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type Node
|
|
7
|
+
import { Graph, type Node } from '@dxos/plugin-graph';
|
|
8
8
|
|
|
9
|
-
export const useNodeActionExpander = (node?: Node) => {
|
|
9
|
+
export const useNodeActionExpander = (node?: Node.Node) => {
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
if (node) {
|
|
12
12
|
const frame = requestAnimationFrame(() => {
|
|
13
|
-
const graph = getGraph(node);
|
|
14
|
-
void
|
|
13
|
+
const graph = Graph.getGraph(node);
|
|
14
|
+
void Graph.expand(graph, node.id, 'action');
|
|
15
15
|
});
|
|
16
16
|
return () => cancelAnimationFrame(frame);
|
|
17
17
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { getCompanionVariant } from '@dxos/app-toolkit';
|
|
8
|
+
import { type Node } from '@dxos/plugin-graph';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Resolves which companion to show based on variant preference.
|
|
12
|
+
* Falls back to first available if preferred variant not found.
|
|
13
|
+
*/
|
|
14
|
+
export const useSelectedCompanion = (companions: Node.Node[], preferredVariant?: string) => {
|
|
15
|
+
return useMemo(() => {
|
|
16
|
+
if (companions.length === 0) {
|
|
17
|
+
return { companionId: undefined, variant: undefined };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Try to find companion matching the preferred variant.
|
|
21
|
+
if (preferredVariant) {
|
|
22
|
+
const preferred = companions.find((companion) => getCompanionVariant(companion.id) === preferredVariant);
|
|
23
|
+
if (preferred) {
|
|
24
|
+
return { companionId: preferred.id, variant: getCompanionVariant(preferred.id) };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Fallback to first companion.
|
|
29
|
+
const first = companions[0];
|
|
30
|
+
return { companionId: first.id, variant: getCompanionVariant(first.id) };
|
|
31
|
+
}, [companions, preferredVariant]);
|
|
32
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export { DeckCapabilities } from './
|
|
6
|
-
export { DeckEvents } from './events';
|
|
5
|
+
export { DeckCapabilities, DeckEvents } from './types';
|
|
7
6
|
export * from './DeckPlugin';
|
|
8
7
|
export * from './meta';
|
|
9
8
|
export { useCompanions } from './hooks';
|
package/src/layout.ts
CHANGED
|
@@ -4,29 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import { produce } from 'immer';
|
|
6
6
|
|
|
7
|
-
import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';
|
|
8
|
-
|
|
9
7
|
import { type DeckAction, type NewPlankPositioning } from './types';
|
|
10
8
|
|
|
11
|
-
export const createEntryId = (entryId: string, variant?: string) =>
|
|
12
|
-
variant ? `${entryId}${ATTENDABLE_PATH_SEPARATOR}${variant}` : entryId;
|
|
13
|
-
|
|
14
|
-
export const parseEntryId = (entryId: string) => {
|
|
15
|
-
const [id, variant] = entryId.split(ATTENDABLE_PATH_SEPARATOR);
|
|
16
|
-
return { id, variant };
|
|
17
|
-
};
|
|
18
|
-
|
|
19
9
|
type OpenLayoutEntryOptions = {
|
|
20
10
|
key?: string;
|
|
21
11
|
positioning?: NewPlankPositioning;
|
|
22
12
|
pivotId?: string;
|
|
23
|
-
variant?: string;
|
|
24
13
|
};
|
|
25
14
|
|
|
26
|
-
export const openEntry = (deck: string[],
|
|
15
|
+
export const openEntry = (deck: string[], entryId: string, options?: OpenLayoutEntryOptions): string[] => {
|
|
27
16
|
return produce(deck, (draft) => {
|
|
28
|
-
const entryId = createEntryId(_entryId, options?.variant);
|
|
29
|
-
|
|
30
17
|
// Check that the entry is not already in the part
|
|
31
18
|
if (draft.find((id) => id === entryId)) {
|
|
32
19
|
return;
|
package/src/meta.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
|
-
export const meta:
|
|
9
|
-
id: 'dxos.
|
|
8
|
+
export const meta: Plugin.Meta = {
|
|
9
|
+
id: 'org.dxos.plugin.deck',
|
|
10
10
|
name: 'Layout',
|
|
11
11
|
description: trim`
|
|
12
12
|
Flexible layout system for arranging workspace views in tabs, splits, and panels.
|
package/src/translations.ts
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Atom } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { invariant } from '@dxos/invariant';
|
|
10
|
+
|
|
11
|
+
import { meta } from '../meta';
|
|
12
|
+
import { type DeckEphemeralStateProps, type DeckSettingsProps, type DeckState, type DeckStateProps } from '../types';
|
|
13
|
+
|
|
14
|
+
export namespace DeckCapabilities {
|
|
15
|
+
export const Settings = Capability.make<Atom.Writable<DeckSettingsProps>>(`${meta.id}.capability.settings`);
|
|
16
|
+
|
|
17
|
+
/** Persisted state (stored in KVS/localStorage). */
|
|
18
|
+
export const State = Capability.make<Atom.Writable<DeckStateProps>>(`${meta.id}.capability.state`);
|
|
19
|
+
|
|
20
|
+
/** Transient/ephemeral state (not persisted). */
|
|
21
|
+
export const EphemeralState = Capability.make<Atom.Writable<DeckEphemeralStateProps>>(
|
|
22
|
+
`${meta.id}.capability.ephemeral-state`,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
/** Get the current active deck from state. */
|
|
26
|
+
export const getDeck = (): Effect.Effect<DeckState, Error, Capability.Service> =>
|
|
27
|
+
Effect.gen(function* () {
|
|
28
|
+
const state = yield* Capabilities.getAtomValue(State);
|
|
29
|
+
const deck = state.decks[state.activeDeck];
|
|
30
|
+
invariant(deck, `Deck not found: ${state.activeDeck}`);
|
|
31
|
+
return deck;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ActivationEvent } from '@dxos/app-framework';
|
|
6
|
+
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
7
|
+
|
|
8
|
+
import { meta } from '../meta';
|
|
9
|
+
|
|
10
|
+
import { DeckCapabilities } from './capabilities';
|
|
11
|
+
|
|
12
|
+
export namespace DeckEvents {
|
|
13
|
+
export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(
|
|
14
|
+
`${meta.id}.state-ready`,
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
/** Fired when DeckSettings capability is ready. */
|
|
18
|
+
export const SettingsReady: ActivationEvent.ActivationEvent = AppActivationEvents.createSettingsEvent(
|
|
19
|
+
DeckCapabilities.Settings.identifier,
|
|
20
|
+
);
|
|
21
|
+
}
|
package/src/types/index.ts
CHANGED
package/src/types/schema.ts
CHANGED
|
@@ -4,22 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Label, LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
8
10
|
import { type DeepReadonly } from '@dxos/util';
|
|
9
11
|
|
|
10
12
|
import { meta } from '../meta';
|
|
11
13
|
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
export const PLANK_COMPANION_TYPE = `${meta.id}/plank-companion`;
|
|
15
|
-
export const DECK_COMPANION_TYPE = `${meta.id}/deck-companion`;
|
|
14
|
+
export const PLANK_COMPANION_TYPE = `${meta.id}.plank-companion`;
|
|
15
|
+
export const DECK_COMPANION_TYPE = `${meta.id}.deck-companion`;
|
|
16
16
|
|
|
17
17
|
// TODO(Zan): In the future we should consider adding new planks adjacent to the attended plank.
|
|
18
18
|
export const NewPlankPositions = ['start', 'end'] as const;
|
|
19
19
|
export type NewPlankPositioning = (typeof NewPlankPositions)[number];
|
|
20
20
|
|
|
21
|
-
export const
|
|
22
|
-
export type Overscroll = (typeof
|
|
21
|
+
export const OverScrollToProps = ['none', 'centering'] as const;
|
|
22
|
+
export type Overscroll = (typeof OverScrollToProps)[number];
|
|
23
23
|
|
|
24
24
|
export type Part = 'solo' | 'deck' | 'complementary';
|
|
25
25
|
export type ResolvedPart = Part | 'solo-primary' | 'solo-companion';
|
|
@@ -30,7 +30,7 @@ export const DeckSettingsSchema = Schema.Struct({
|
|
|
30
30
|
enableStatusbar: Schema.optional(Schema.Boolean),
|
|
31
31
|
enableNativeRedirect: Schema.optional(Schema.Boolean),
|
|
32
32
|
newPlankPositioning: Schema.optional(Schema.Literal(...NewPlankPositions)),
|
|
33
|
-
overscroll: Schema.optional(Schema.Literal(...
|
|
33
|
+
overscroll: Schema.optional(Schema.Literal(...OverScrollToProps)),
|
|
34
34
|
// TODO(burdon): Rename layoutMode? (e.g., bento | encapsulated?)
|
|
35
35
|
encapsulatedPlanks: Schema.optional(Schema.Boolean),
|
|
36
36
|
}).pipe(Schema.mutable);
|
|
@@ -44,8 +44,8 @@ export const DeckState = Schema.Struct({
|
|
|
44
44
|
/** If false, the deck has not yet left solo mode and new planks should be soloed. */
|
|
45
45
|
initialized: Schema.Boolean,
|
|
46
46
|
active: Schema.mutable(Schema.Array(Schema.String)),
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
companionOpen: Schema.Boolean,
|
|
48
|
+
companionVariant: Schema.optional(Schema.String),
|
|
49
49
|
inactive: Schema.mutable(Schema.Array(Schema.String)),
|
|
50
50
|
solo: Schema.optional(Schema.String),
|
|
51
51
|
fullscreen: Schema.Boolean,
|
|
@@ -57,7 +57,8 @@ export type DeckState = Schema.Schema.Type<typeof DeckState>;
|
|
|
57
57
|
export const defaultDeck: DeckState = {
|
|
58
58
|
initialized: false,
|
|
59
59
|
active: [],
|
|
60
|
-
|
|
60
|
+
companionOpen: false,
|
|
61
|
+
companionVariant: undefined,
|
|
61
62
|
inactive: [],
|
|
62
63
|
solo: undefined,
|
|
63
64
|
fullscreen: false,
|
|
@@ -77,12 +78,21 @@ export const getMode = (deck: DeckState | DeepReadonly<DeckState>): LayoutMode =
|
|
|
77
78
|
return 'deck';
|
|
78
79
|
};
|
|
79
80
|
|
|
80
|
-
//
|
|
81
|
-
export const
|
|
81
|
+
// Persisted plugin state (stored in KVS/localStorage).
|
|
82
|
+
export const DeckStateSchema = Schema.Struct({
|
|
82
83
|
sidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),
|
|
83
84
|
complementarySidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),
|
|
84
85
|
complementarySidebarPanel: Schema.optional(Schema.String),
|
|
86
|
+
activeDeck: Schema.String,
|
|
87
|
+
previousDeck: Schema.String,
|
|
88
|
+
decks: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(DeckState) })),
|
|
89
|
+
previousMode: Schema.mutable(Schema.Record({ key: Schema.String, value: LayoutMode })),
|
|
90
|
+
}).pipe(Schema.mutable);
|
|
91
|
+
export type DeckStateProps = Schema.Schema.Type<typeof DeckStateSchema>;
|
|
85
92
|
|
|
93
|
+
// TODO(burdon): Factor out state (in common with other layouts?)
|
|
94
|
+
// Transient/ephemeral plugin state (not persisted).
|
|
95
|
+
export const DeckEphemeralStateSchema = Schema.Struct({
|
|
86
96
|
dialogOpen: Schema.Boolean,
|
|
87
97
|
dialogType: Schema.optional(Schema.Literal('default', 'alert')),
|
|
88
98
|
dialogBlockAlign: Schema.optional(Schema.Literal('start', 'center', 'end')),
|
|
@@ -95,23 +105,23 @@ export const DeckPluginState = Schema.Struct({
|
|
|
95
105
|
popoverSide: Schema.optional(Schema.Literal('top', 'right', 'bottom', 'left')),
|
|
96
106
|
popoverAnchor: Schema.optional(Schema.Any),
|
|
97
107
|
popoverAnchorId: Schema.optional(Schema.String),
|
|
108
|
+
popoverKind: Schema.optional(Schema.Literal('base', 'card')),
|
|
109
|
+
popoverTitle: Schema.optional(Label.annotations({ description: 'The title of the popover.' })),
|
|
110
|
+
/** Ref of the subject to be passed to the popover Surface. */
|
|
111
|
+
popoverContentRef: Schema.optional(Schema.String),
|
|
98
112
|
/** Data to be passed to the popover Surface. */
|
|
99
113
|
popoverContent: Schema.optional(Schema.Any),
|
|
100
114
|
|
|
101
|
-
toasts: Schema.mutable(Schema.Array(
|
|
115
|
+
toasts: Schema.mutable(Schema.Array(LayoutOperation.Toast)),
|
|
102
116
|
currentUndoId: Schema.optional(Schema.String),
|
|
103
117
|
|
|
104
|
-
activeDeck: Schema.String,
|
|
105
|
-
previousDeck: Schema.String,
|
|
106
|
-
decks: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(DeckState) })),
|
|
107
|
-
previousMode: Schema.mutable(Schema.Record({ key: Schema.String, value: LayoutMode })),
|
|
108
|
-
deck: Schema.mutable(DeckState),
|
|
109
|
-
|
|
110
118
|
/** The identifier of a component to scroll into view when it is mounted. */
|
|
111
119
|
scrollIntoView: Schema.optional(Schema.String),
|
|
112
120
|
}).pipe(Schema.mutable);
|
|
121
|
+
export type DeckEphemeralStateProps = Schema.Schema.Type<typeof DeckEphemeralStateSchema>;
|
|
113
122
|
|
|
114
|
-
|
|
123
|
+
// Combined state type (for convenience in components that need both).
|
|
124
|
+
export type DeckPluginState = DeckStateProps & DeckEphemeralStateProps;
|
|
115
125
|
|
|
116
126
|
export namespace DeckAction {
|
|
117
127
|
const PartAdjustmentSchema = Schema.Union(
|
|
@@ -127,12 +137,12 @@ export namespace DeckAction {
|
|
|
127
137
|
export type Adjustment = Schema.Schema.Type<typeof Adjustment>;
|
|
128
138
|
|
|
129
139
|
// An atomic transaction to apply to the deck, describing which element to move to which location.
|
|
130
|
-
export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}
|
|
140
|
+
export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}.action.adjust`, {
|
|
131
141
|
input: Adjustment,
|
|
132
142
|
output: Schema.Void,
|
|
133
143
|
}) {}
|
|
134
144
|
|
|
135
|
-
export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}
|
|
145
|
+
export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}.action.update-plank-size`, {
|
|
136
146
|
input: Schema.Struct({
|
|
137
147
|
id: Schema.String,
|
|
138
148
|
size: Schema.Number,
|
|
@@ -140,11 +150,72 @@ export namespace DeckAction {
|
|
|
140
150
|
output: Schema.Void,
|
|
141
151
|
}) {}
|
|
142
152
|
|
|
143
|
-
export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${meta.id}
|
|
153
|
+
export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${meta.id}.action.change-companion`, {
|
|
144
154
|
input: Schema.Struct({
|
|
145
|
-
primary: Schema.String,
|
|
146
155
|
companion: Schema.Union(Schema.String, Schema.Null),
|
|
147
156
|
}),
|
|
148
157
|
output: Schema.Void,
|
|
149
158
|
}) {}
|
|
150
159
|
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Operations for the Deck plugin.
|
|
163
|
+
*/
|
|
164
|
+
export namespace DeckOperation {
|
|
165
|
+
const PartAdjustmentSchema = Schema.Union(
|
|
166
|
+
Schema.Literal('close').annotations({ description: 'Close the plank.' }),
|
|
167
|
+
Schema.Literal('companion').annotations({ description: 'Open the companion plank.' }),
|
|
168
|
+
Schema.Literal('solo').annotations({ description: 'Solo the plank.' }),
|
|
169
|
+
Schema.Literal('solo--fullscreen').annotations({ description: 'Fullscreen the plank.' }),
|
|
170
|
+
Schema.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),
|
|
171
|
+
Schema.Literal('increment-end').annotations({ description: 'Move the plank towards the end of the deck.' }),
|
|
172
|
+
);
|
|
173
|
+
export type PartAdjustment = Schema.Schema.Type<typeof PartAdjustmentSchema>;
|
|
174
|
+
|
|
175
|
+
export const Adjust = Operation.make({
|
|
176
|
+
meta: {
|
|
177
|
+
key: `${meta.id}.operation.adjust`,
|
|
178
|
+
name: 'Adjust',
|
|
179
|
+
description: 'Adjust the layout of a plank.',
|
|
180
|
+
},
|
|
181
|
+
services: [Capability.Service],
|
|
182
|
+
schema: {
|
|
183
|
+
input: Schema.Struct({
|
|
184
|
+
id: Schema.String.annotations({ description: 'The id of the plank to adjust.' }),
|
|
185
|
+
type: PartAdjustmentSchema.annotations({ description: 'The type of adjustment to make.' }),
|
|
186
|
+
}),
|
|
187
|
+
output: Schema.Void,
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
export const UpdatePlankSize = Operation.make({
|
|
192
|
+
meta: {
|
|
193
|
+
key: `${meta.id}.operation.update-plank-size`,
|
|
194
|
+
name: 'Update Plank Size',
|
|
195
|
+
description: 'Update the size of a plank.',
|
|
196
|
+
},
|
|
197
|
+
services: [Capability.Service],
|
|
198
|
+
schema: {
|
|
199
|
+
input: Schema.Struct({
|
|
200
|
+
id: Schema.String.annotations({ description: 'The id of the plank to resize.' }),
|
|
201
|
+
size: Schema.Number.annotations({ description: 'The new size of the plank.' }),
|
|
202
|
+
}),
|
|
203
|
+
output: Schema.Void,
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
export const ChangeCompanion = Operation.make({
|
|
208
|
+
meta: {
|
|
209
|
+
key: `${meta.id}.operation.change-companion`,
|
|
210
|
+
name: 'Change Companion',
|
|
211
|
+
description: 'Change the companion plank for a primary plank.',
|
|
212
|
+
},
|
|
213
|
+
services: [Capability.Service],
|
|
214
|
+
schema: {
|
|
215
|
+
input: Schema.Struct({
|
|
216
|
+
companion: Schema.Union(Schema.String, Schema.Null),
|
|
217
|
+
}),
|
|
218
|
+
output: Schema.Void,
|
|
219
|
+
},
|
|
220
|
+
});
|
|
221
|
+
}
|
|
@@ -6,7 +6,7 @@ import { type LayoutMode } from '../types';
|
|
|
6
6
|
|
|
7
7
|
export const layoutAppliesTopbar = (breakpoint: string, layoutMode?: LayoutMode) => {
|
|
8
8
|
return (
|
|
9
|
-
document.body.getAttribute('data-platform') === '
|
|
9
|
+
document.body.getAttribute('data-platform') === 'windows' &&
|
|
10
10
|
breakpoint === 'desktop' &&
|
|
11
11
|
layoutMode !== 'solo--fullscreen'
|
|
12
12
|
);
|
package/src/util/overscroll.ts
CHANGED
|
@@ -56,14 +56,14 @@ export const calculateOverscroll = (
|
|
|
56
56
|
}
|
|
57
57
|
if (planksCount === 1) {
|
|
58
58
|
const overscrollPadding =
|
|
59
|
-
'max(0px, calc(((100dvw - var(--dx-main-
|
|
59
|
+
'max(0px, calc(((100dvw - var(--dx-main-sidebar-width) - var(--dx-main-complementary-width) - (var(--dx-main-content-first-width) + 1px)) / 2)))';
|
|
60
60
|
return { paddingInlineStart: overscrollPadding, paddingInlineEnd: overscrollPadding };
|
|
61
61
|
} else {
|
|
62
62
|
return {
|
|
63
63
|
paddingInlineStart:
|
|
64
|
-
'max(0px, calc(((100dvw - (var(--dx-main-
|
|
64
|
+
'max(0px, calc(((100dvw - (var(--dx-main-content-first-width) + 1px)) / 2) - var(--dx-main-sidebar-width)))',
|
|
65
65
|
paddingInlineEnd:
|
|
66
|
-
'max(0px, calc(((100dvw - (var(--dx-main-
|
|
66
|
+
'max(0px, calc(((100dvw - (var(--dx-main-content-last-width) + 1px)) / 2) - var(--dx-main-complementary-width)))',
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
};
|
package/src/util/set-active.ts
CHANGED
|
@@ -2,46 +2,66 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { batch } from '@preact/signals-core';
|
|
6
|
-
|
|
7
5
|
import { type AttentionManager } from '@dxos/plugin-attention';
|
|
8
6
|
|
|
9
|
-
import { type
|
|
7
|
+
import { type DeckState } from '../types';
|
|
10
8
|
|
|
11
9
|
export type SetActiveOptions = {
|
|
12
10
|
next: string[];
|
|
13
|
-
|
|
11
|
+
deck: DeckState;
|
|
14
12
|
attention?: AttentionManager;
|
|
15
13
|
};
|
|
16
14
|
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
export type SetActiveResult = {
|
|
16
|
+
/** Updates to apply to the deck. */
|
|
17
|
+
deckUpdates: {
|
|
18
|
+
inactive: string[];
|
|
19
|
+
solo: string | undefined;
|
|
20
|
+
active: string[];
|
|
21
|
+
fullscreen: boolean;
|
|
22
|
+
};
|
|
23
|
+
/** ID of the item to attend (scroll into view) if attention changed. */
|
|
24
|
+
toAttend?: string;
|
|
25
|
+
};
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Computes the new active state for the deck without mutating.
|
|
29
|
+
* Returns the updates to apply and optionally an item to attend.
|
|
30
|
+
*/
|
|
31
|
+
export const computeActiveUpdates = ({ next, deck, attention }: SetActiveOptions): SetActiveResult => {
|
|
32
|
+
const active = deck.solo ? [deck.solo] : deck.active;
|
|
33
|
+
const removed = active.filter((id) => !next.includes(id));
|
|
34
|
+
const closed = Array.from(new Set([...deck.inactive.filter((id) => !next.includes(id)), ...removed]));
|
|
24
35
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
const updates = {
|
|
37
|
+
inactive: closed,
|
|
38
|
+
solo: deck.solo,
|
|
39
|
+
active: deck.active,
|
|
40
|
+
fullscreen: deck.fullscreen,
|
|
41
|
+
};
|
|
30
42
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
if (deck.solo || !deck.initialized) {
|
|
44
|
+
updates.solo = next[0];
|
|
45
|
+
} else {
|
|
46
|
+
updates.active = next;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (deck.fullscreen && !updates.solo) {
|
|
50
|
+
updates.fullscreen = false;
|
|
51
|
+
}
|
|
34
52
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
53
|
+
let toAttend: string | undefined;
|
|
54
|
+
if (attention) {
|
|
55
|
+
const attended = attention.getCurrent();
|
|
56
|
+
const [attendedId] = Array.from(attended);
|
|
57
|
+
const isAttendedAvailable = !!attendedId && next.includes(attendedId);
|
|
58
|
+
if (!isAttendedAvailable) {
|
|
59
|
+
const attendedIndex = active.indexOf(attendedId);
|
|
60
|
+
// If outside of bounds, focus on the first/last plank, otherwise focus on the new plank in the same position.
|
|
61
|
+
const index = attendedIndex === -1 ? 0 : attendedIndex >= next.length ? next.length - 1 : attendedIndex;
|
|
62
|
+
toAttend = next[index];
|
|
45
63
|
}
|
|
46
|
-
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return { deckUpdates: updates, toAttend };
|
|
47
67
|
};
|