@dxos/plugin-deck 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae
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-DR6B7XTO.mjs +15 -0
- package/dist/lib/browser/Banner-DR6B7XTO.mjs.map +7 -0
- package/dist/lib/browser/DeckSettings-HB5TKG2F.mjs +96 -0
- package/dist/lib/browser/DeckSettings-HB5TKG2F.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-22XAL7YE.mjs +123 -0
- package/dist/lib/browser/app-graph-builder-22XAL7YE.mjs.map +7 -0
- package/dist/lib/browser/check-app-scheme-ZV3QWNNZ.mjs +33 -0
- package/dist/lib/browser/check-app-scheme-ZV3QWNNZ.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-FBL4WVYZ.mjs +16 -0
- package/dist/lib/browser/chunk-FBL4WVYZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-OAPMV5ZR.mjs +280 -0
- package/dist/lib/browser/chunk-OAPMV5ZR.mjs.map +7 -0
- package/dist/lib/browser/chunk-Q4GUCIRE.mjs +200 -0
- package/dist/lib/browser/chunk-Q4GUCIRE.mjs.map +7 -0
- package/dist/lib/browser/chunk-SKBPLX5T.mjs +81 -0
- package/dist/lib/browser/chunk-SKBPLX5T.mjs.map +7 -0
- package/dist/lib/browser/chunk-YGOOWRJE.mjs +1390 -0
- package/dist/lib/browser/chunk-YGOOWRJE.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +85 -73
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-BLZGJWLO.mjs +580 -0
- package/dist/lib/browser/operation-resolver-BLZGJWLO.mjs.map +7 -0
- package/dist/lib/browser/react-root-4ESZAM6D.mjs +49 -0
- package/dist/lib/browser/react-root-4ESZAM6D.mjs.map +7 -0
- package/dist/lib/browser/react-surface-KYQGCALN.mjs +44 -0
- package/dist/lib/browser/react-surface-KYQGCALN.mjs.map +7 -0
- package/dist/lib/browser/settings-RY2TBSGP.mjs +40 -0
- package/dist/lib/browser/settings-RY2TBSGP.mjs.map +7 -0
- package/dist/lib/browser/state-CSTTMJ43.mjs +106 -0
- package/dist/lib/browser/state-CSTTMJ43.mjs.map +7 -0
- package/dist/lib/browser/toolkit-EONRPYA5.mjs +55 -0
- package/dist/lib/browser/toolkit-EONRPYA5.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +14 -6
- package/dist/lib/browser/url-handler-EM3SYHHX.mjs +95 -0
- package/dist/lib/browser/url-handler-EM3SYHHX.mjs.map +7 -0
- package/dist/lib/node-esm/Banner-HR7DPUZU.mjs +16 -0
- package/dist/lib/node-esm/Banner-HR7DPUZU.mjs.map +7 -0
- package/dist/lib/node-esm/DeckSettings-MWTR7HU2.mjs +97 -0
- package/dist/lib/node-esm/DeckSettings-MWTR7HU2.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-GNNNCWGN.mjs +124 -0
- package/dist/lib/node-esm/app-graph-builder-GNNNCWGN.mjs.map +7 -0
- package/dist/lib/node-esm/check-app-scheme-ZNISVRFH.mjs +34 -0
- package/dist/lib/node-esm/check-app-scheme-ZNISVRFH.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-EGFOT3DE.mjs +18 -0
- package/dist/lib/node-esm/chunk-EGFOT3DE.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-IR6ODCNC.mjs +83 -0
- package/dist/lib/node-esm/chunk-IR6ODCNC.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-L2NPJPGL.mjs +281 -0
- package/dist/lib/node-esm/chunk-L2NPJPGL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-O4IOJICP.mjs +201 -0
- package/dist/lib/node-esm/chunk-O4IOJICP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-Z43MBISY.mjs +1391 -0
- package/dist/lib/node-esm/chunk-Z43MBISY.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +186 -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-5BYDNQND.mjs +581 -0
- package/dist/lib/node-esm/operation-resolver-5BYDNQND.mjs.map +7 -0
- package/dist/lib/node-esm/react-root-YO7IIC75.mjs +50 -0
- package/dist/lib/node-esm/react-root-YO7IIC75.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-G7VRKT4U.mjs +45 -0
- package/dist/lib/node-esm/react-surface-G7VRKT4U.mjs.map +7 -0
- package/dist/lib/node-esm/settings-GYLWWOBK.mjs +41 -0
- package/dist/lib/node-esm/settings-GYLWWOBK.mjs.map +7 -0
- package/dist/lib/node-esm/state-RQXTBWUX.mjs +107 -0
- package/dist/lib/node-esm/state-RQXTBWUX.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-EU3Z2R4H.mjs +56 -0
- package/dist/lib/node-esm/toolkit-EU3Z2R4H.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +41 -0
- package/dist/lib/node-esm/url-handler-VUK2LBJV.mjs +96 -0
- package/dist/lib/node-esm/url-handler-VUK2LBJV.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/toolkit.d.ts +27 -0
- 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 +2 -3
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +75 -0
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts +3 -0
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +1 -0
- 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 +7 -2
- 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 +27 -7
- 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 -3
- 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/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -1
- 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 +93 -31
- 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 +56 -48
- 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 +560 -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/toolkit.ts +64 -0
- 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 +96 -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 +53 -0
- package/src/components/DeckLayout/DeckLayout.tsx +17 -285
- package/src/components/DeckLayout/DeckMain.tsx +287 -0
- package/src/components/DeckLayout/Dialog.tsx +22 -13
- package/src/components/DeckLayout/Fallback.tsx +2 -6
- package/src/components/DeckLayout/Popover.tsx +70 -32
- package/src/components/DeckLayout/StatusBar.tsx +4 -4
- package/src/components/DeckLayout/Toast.tsx +28 -3
- package/src/components/Plank/Plank.stories.tsx +19 -9
- package/src/components/Plank/Plank.tsx +96 -59
- package/src/components/Plank/PlankControls.tsx +9 -11
- package/src/components/Plank/PlankError.tsx +31 -17
- package/src/components/Plank/PlankHeading.tsx +35 -42
- package/src/components/Plank/PlankLoading.tsx +1 -1
- package/src/components/Sidebar/ComplementarySidebar.tsx +71 -40
- package/src/components/Sidebar/Sidebar.tsx +7 -7
- package/src/components/Sidebar/SidebarButton.tsx +36 -29
- 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/containers/DeckSettings/DeckSettings.tsx +113 -0
- 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 +6 -4
- package/src/hooks/useDeckState.ts +82 -0
- package/src/hooks/useHoistStatusbar.ts +4 -5
- package/src/hooks/useMainSize.ts +2 -2
- package/src/hooks/useNodeActionExpander.ts +4 -4
- package/src/hooks/useSelectedCompanion.ts +38 -0
- package/src/index.ts +1 -2
- package/src/meta.ts +7 -2
- package/src/translations.ts +3 -1
- 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 +93 -18
- 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-YYP67JHW.mjs +0 -153
- package/dist/lib/browser/app-graph-builder-YYP67JHW.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-GCOL6YDT.mjs +0 -32
- package/dist/lib/browser/check-app-scheme-GCOL6YDT.mjs.map +0 -7
- package/dist/lib/browser/chunk-3SV2V3AN.mjs +0 -1495
- package/dist/lib/browser/chunk-3SV2V3AN.mjs.map +0 -7
- package/dist/lib/browser/chunk-A4SRCSJX.mjs +0 -160
- package/dist/lib/browser/chunk-A4SRCSJX.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-HUWUYTOI.mjs +0 -16
- package/dist/lib/browser/chunk-HUWUYTOI.mjs.map +0 -7
- package/dist/lib/browser/chunk-JH4ZCG5I.mjs +0 -129
- package/dist/lib/browser/chunk-JH4ZCG5I.mjs.map +0 -7
- package/dist/lib/browser/chunk-MHP4GPX5.mjs +0 -11
- package/dist/lib/browser/chunk-MHP4GPX5.mjs.map +0 -7
- package/dist/lib/browser/chunk-YRDCQS7E.mjs +0 -127
- package/dist/lib/browser/chunk-YRDCQS7E.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-2NFDKRFG.mjs +0 -524
- package/dist/lib/browser/intent-resolver-2NFDKRFG.mjs.map +0 -7
- package/dist/lib/browser/react-root-JTWYCDJT.mjs +0 -43
- package/dist/lib/browser/react-root-JTWYCDJT.mjs.map +0 -7
- package/dist/lib/browser/react-surface-PZKJ73JS.mjs +0 -40
- package/dist/lib/browser/react-surface-PZKJ73JS.mjs.map +0 -7
- package/dist/lib/browser/settings-JK7UIZSB.mjs +0 -29
- package/dist/lib/browser/settings-JK7UIZSB.mjs.map +0 -7
- package/dist/lib/browser/state-IFKFOBBX.mjs +0 -12
- package/dist/lib/browser/toolkit-L7C3UAEU.mjs +0 -63
- package/dist/lib/browser/toolkit-L7C3UAEU.mjs.map +0 -7
- package/dist/lib/browser/url-handler-MRYBE3HF.mjs +0 -70
- package/dist/lib/browser/url-handler-MRYBE3HF.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 -101
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit.d.ts +0 -6
- 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 -472
- package/src/capabilities/react-root.tsx +0 -39
- package/src/capabilities/react-surface.tsx +0 -30
- package/src/capabilities/settings.ts +0 -26
- package/src/capabilities/state.ts +0 -105
- package/src/capabilities/toolkit.ts +0 -57
- package/src/capabilities/tools.ts +0 -84
- package/src/capabilities/url-handler.ts +0 -60
- package/src/components/DeckSettings/DeckSettings.tsx +0 -97
- package/src/components/DeckSettings/index.ts +0 -5
- package/src/events.ts +0 -11
- /package/dist/lib/{browser/state-IFKFOBBX.mjs.map → node-esm/types/index.mjs.map} +0 -0
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { mx } from '@dxos/
|
|
5
|
+
import { mx } from '@dxos/ui-theme';
|
|
6
6
|
|
|
7
|
+
// TODO(burdon): Move to these as dx-components?
|
|
8
|
+
|
|
9
|
+
/** @private */
|
|
7
10
|
export const soloInlinePadding =
|
|
8
|
-
'
|
|
11
|
+
'ps-[calc(env(safe-area-inset-left)+.25rem)] pe-[calc(env(safe-area-inset-right)+.25rem)]';
|
|
9
12
|
|
|
10
|
-
const sidebarToggleStyles = '
|
|
13
|
+
const sidebarToggleStyles = 'h-(--dx-rail-item) w-(--dx-rail-item) absolute bottom-2 z-[1] !bg-deck-surface lg:hidden';
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
/** @private */
|
|
16
|
+
export const fixedSidebarToggleStyles = mx(sidebarToggleStyles, 'left-2');
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
/** @private */
|
|
19
|
+
export const fixedComplementarySidebarToggleStyles = mx(sidebarToggleStyles, 'right-2');
|
package/src/components/index.ts
CHANGED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Input, Select, useTranslation } from '@dxos/react-ui';
|
|
8
|
+
import { Settings } from '@dxos/react-ui-form';
|
|
9
|
+
|
|
10
|
+
import { meta } from '../../meta';
|
|
11
|
+
import {
|
|
12
|
+
type DeckSettingsProps,
|
|
13
|
+
type NewPlankPositioning,
|
|
14
|
+
NewPlankPositions,
|
|
15
|
+
OverScrollToProps,
|
|
16
|
+
type Overscroll,
|
|
17
|
+
} from '../../types';
|
|
18
|
+
|
|
19
|
+
const isSocket = !!(globalThis as any).__args;
|
|
20
|
+
|
|
21
|
+
export type DeckSettingsComponentProps = {
|
|
22
|
+
settings: DeckSettingsProps;
|
|
23
|
+
onSettingsChange: (fn: (current: DeckSettingsProps) => DeckSettingsProps) => void;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const DeckSettings = ({ settings, onSettingsChange }: DeckSettingsComponentProps) => {
|
|
27
|
+
const { t } = useTranslation(meta.id);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<Settings.Root>
|
|
31
|
+
<Settings.Section title={t('settings title', { ns: meta.id })}>
|
|
32
|
+
<Settings.Group>
|
|
33
|
+
<Settings.ItemInput title={t('settings enable deck label')}>
|
|
34
|
+
<Input.Switch
|
|
35
|
+
checked={settings.enableDeck}
|
|
36
|
+
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, enableDeck: checked }))}
|
|
37
|
+
/>
|
|
38
|
+
</Settings.ItemInput>
|
|
39
|
+
<Settings.ItemInput title={t('settings encapsulated planks label')}>
|
|
40
|
+
<Input.Switch
|
|
41
|
+
checked={settings.encapsulatedPlanks ?? false}
|
|
42
|
+
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, encapsulatedPlanks: checked }))}
|
|
43
|
+
/>
|
|
44
|
+
</Settings.ItemInput>
|
|
45
|
+
<Settings.ItemInput title={t('select new plank positioning label')}>
|
|
46
|
+
<Select.Root
|
|
47
|
+
disabled={!settings.enableDeck}
|
|
48
|
+
value={settings.newPlankPositioning ?? 'start'}
|
|
49
|
+
onValueChange={(value) =>
|
|
50
|
+
onSettingsChange((s) => ({ ...s, newPlankPositioning: value as NewPlankPositioning }))
|
|
51
|
+
}
|
|
52
|
+
>
|
|
53
|
+
<Select.TriggerButton placeholder={t('select new plank positioning placeholder')} />
|
|
54
|
+
<Select.Portal>
|
|
55
|
+
<Select.Content>
|
|
56
|
+
<Select.Viewport>
|
|
57
|
+
{NewPlankPositions.map((position) => (
|
|
58
|
+
<Select.Option key={position} value={position}>
|
|
59
|
+
{t(`settings new plank position ${position} label`)}
|
|
60
|
+
</Select.Option>
|
|
61
|
+
))}
|
|
62
|
+
</Select.Viewport>
|
|
63
|
+
<Select.Arrow />
|
|
64
|
+
</Select.Content>
|
|
65
|
+
</Select.Portal>
|
|
66
|
+
</Select.Root>
|
|
67
|
+
</Settings.ItemInput>
|
|
68
|
+
<Settings.ItemInput title={t('settings overscroll label')}>
|
|
69
|
+
<Select.Root
|
|
70
|
+
disabled={!settings.enableDeck}
|
|
71
|
+
value={settings.overscroll ?? 'none'}
|
|
72
|
+
onValueChange={(value) => onSettingsChange((s) => ({ ...s, overscroll: value as Overscroll }))}
|
|
73
|
+
>
|
|
74
|
+
<Select.TriggerButton placeholder={t('select overscroll placeholder')} />
|
|
75
|
+
<Select.Portal>
|
|
76
|
+
<Select.Content>
|
|
77
|
+
<Select.Viewport>
|
|
78
|
+
{OverScrollToProps.map((option) => (
|
|
79
|
+
<Select.Option key={option} value={option}>
|
|
80
|
+
{t(`settings overscroll ${option} label`)}
|
|
81
|
+
</Select.Option>
|
|
82
|
+
))}
|
|
83
|
+
</Select.Viewport>
|
|
84
|
+
<Select.Arrow />
|
|
85
|
+
</Select.Content>
|
|
86
|
+
</Select.Portal>
|
|
87
|
+
</Select.Root>
|
|
88
|
+
</Settings.ItemInput>
|
|
89
|
+
<Settings.ItemInput title={t('settings enable statusbar label')}>
|
|
90
|
+
<Input.Switch
|
|
91
|
+
checked={settings.enableStatusbar}
|
|
92
|
+
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, enableStatusbar: checked }))}
|
|
93
|
+
/>
|
|
94
|
+
</Settings.ItemInput>
|
|
95
|
+
<Settings.ItemInput title={t('settings show hints label')}>
|
|
96
|
+
<Input.Switch
|
|
97
|
+
checked={settings.showHints}
|
|
98
|
+
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, showHints: checked }))}
|
|
99
|
+
/>
|
|
100
|
+
</Settings.ItemInput>
|
|
101
|
+
{!isSocket && (
|
|
102
|
+
<Settings.ItemInput title={t('settings native redirect label')}>
|
|
103
|
+
<Input.Switch
|
|
104
|
+
checked={settings.enableNativeRedirect}
|
|
105
|
+
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, enableNativeRedirect: checked }))}
|
|
106
|
+
/>
|
|
107
|
+
</Settings.ItemInput>
|
|
108
|
+
)}
|
|
109
|
+
</Settings.Group>
|
|
110
|
+
</Settings.Section>
|
|
111
|
+
</Settings.Root>
|
|
112
|
+
);
|
|
113
|
+
};
|
package/src/hooks/index.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
export * from './useBreakpoints';
|
|
6
6
|
export * from './useCompanions';
|
|
7
7
|
export * from './useDeckCompanions';
|
|
8
|
+
export * from './useDeckState';
|
|
8
9
|
export * from './useHoistStatusbar';
|
|
9
10
|
export * from './useMainSize';
|
|
10
11
|
export * from './useNodeActionExpander';
|
|
12
|
+
export * from './useSelectedCompanion';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { useAppGraph } from '@dxos/app-
|
|
7
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
8
8
|
import { useConnections } from '@dxos/plugin-graph';
|
|
9
9
|
import { byPosition } from '@dxos/util';
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ import { PLANK_COMPANION_TYPE } from '../types';
|
|
|
12
12
|
|
|
13
13
|
export const useCompanions = (id?: string) => {
|
|
14
14
|
const { graph } = useAppGraph();
|
|
15
|
-
const nodes = useConnections(graph, id);
|
|
15
|
+
const nodes = useConnections(graph, id, 'child');
|
|
16
16
|
const companions = nodes.filter((node) => node.type === PLANK_COMPANION_TYPE);
|
|
17
17
|
return useMemo(() => companions.toSorted((a, b) => byPosition(a.properties, b.properties)), [companions]);
|
|
18
18
|
};
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import { type Node
|
|
5
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
6
|
+
import { Node, type Node as NodeType } from '@dxos/plugin-graph';
|
|
7
|
+
import { useConnections } from '@dxos/plugin-graph';
|
|
8
|
+
import { type Label } from '@dxos/ui-types';
|
|
7
9
|
import { type Position, byPosition } from '@dxos/util';
|
|
8
10
|
|
|
9
11
|
import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from '../types';
|
|
@@ -13,7 +15,7 @@ export const getCompanionId = (id: string) => {
|
|
|
13
15
|
return companionId ?? 'never';
|
|
14
16
|
};
|
|
15
17
|
|
|
16
|
-
export type DeckCompanion = Node<
|
|
18
|
+
export type DeckCompanion = NodeType.Node<
|
|
17
19
|
any,
|
|
18
20
|
{
|
|
19
21
|
label: Label;
|
|
@@ -27,7 +29,7 @@ export type DeckCompanion = Node<
|
|
|
27
29
|
|
|
28
30
|
export const useDeckCompanions = (): DeckCompanion[] => {
|
|
29
31
|
const { graph } = useAppGraph();
|
|
30
|
-
const connections = useConnections(graph,
|
|
32
|
+
const connections = useConnections(graph, Node.RootId, 'child');
|
|
31
33
|
const companions = connections.filter((node) => node.type === DECK_COMPANION_TYPE) as DeckCompanion[];
|
|
32
34
|
return companions.toSorted((a, b) => byPosition(a.properties, b.properties));
|
|
33
35
|
};
|
|
@@ -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,16 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { useAtomCapability } from '@dxos/app-framework/ui';
|
|
8
8
|
import { useThemeContext } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import type { DeckSettingsProps, LayoutMode } from '../types';
|
|
10
|
+
import { DeckCapabilities, type LayoutMode } from '../types';
|
|
12
11
|
|
|
13
12
|
export const useHoistStatusbar = (breakpoint: string, layoutMode?: LayoutMode): boolean => {
|
|
14
|
-
const enableStatusbar = useCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(meta.id)!.value
|
|
15
|
-
.enableStatusbar;
|
|
16
13
|
const { safeAreaPadding } = useThemeContext();
|
|
14
|
+
const enableStatusbar = useAtomCapability(DeckCapabilities.Settings).enableStatusbar;
|
|
15
|
+
|
|
17
16
|
return useMemo(() => {
|
|
18
17
|
return (
|
|
19
18
|
breakpoint === 'desktop' &&
|
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,38 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type Node } from '@dxos/plugin-graph';
|
|
8
|
+
|
|
9
|
+
import { parseEntryId } from '../layout';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Resolves which companion to show based on variant preference.
|
|
13
|
+
* Falls back to first available if preferred variant not found.
|
|
14
|
+
*/
|
|
15
|
+
export const useSelectedCompanion = (companions: Node.Node[], preferredVariant?: string) => {
|
|
16
|
+
return useMemo(() => {
|
|
17
|
+
if (companions.length === 0) {
|
|
18
|
+
return { companionId: undefined, variant: undefined };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Try to find companion matching the preferred variant.
|
|
22
|
+
if (preferredVariant) {
|
|
23
|
+
const preferred = companions.find((companion) => {
|
|
24
|
+
const { variant } = parseEntryId(companion.id);
|
|
25
|
+
return variant === preferredVariant;
|
|
26
|
+
});
|
|
27
|
+
if (preferred) {
|
|
28
|
+
const { variant } = parseEntryId(preferred.id);
|
|
29
|
+
return { companionId: preferred.id, variant };
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Fallback to first companion.
|
|
34
|
+
const first = companions[0];
|
|
35
|
+
const { variant } = parseEntryId(first.id);
|
|
36
|
+
return { companionId: first.id, variant };
|
|
37
|
+
}, [companions, preferredVariant]);
|
|
38
|
+
};
|
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/meta.ts
CHANGED
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
6
7
|
|
|
7
|
-
export const meta:
|
|
8
|
+
export const meta: Plugin.Meta = {
|
|
8
9
|
id: 'dxos.org/plugin/deck',
|
|
9
10
|
name: 'Layout',
|
|
11
|
+
description: trim`
|
|
12
|
+
Flexible layout system for arranging workspace views in tabs, splits, and panels.
|
|
13
|
+
Customize your workspace organization with drag-and-drop layout management.
|
|
14
|
+
`,
|
|
10
15
|
icon: 'ph--layout--regular',
|
|
11
16
|
};
|
package/src/translations.ts
CHANGED
|
@@ -34,7 +34,7 @@ export const translations = [
|
|
|
34
34
|
'undo action label': 'Undo',
|
|
35
35
|
'undo action alt': 'Undo previous action',
|
|
36
36
|
'undo close label': 'Dismiss',
|
|
37
|
-
'error fallback message': 'Unable to open this
|
|
37
|
+
'error fallback message': 'Unable to open this object',
|
|
38
38
|
'plank heading fallback label': 'Untitled',
|
|
39
39
|
'actions menu label': 'Options',
|
|
40
40
|
'settings deck label': 'Disable deck',
|
|
@@ -59,10 +59,12 @@ export const translations = [
|
|
|
59
59
|
'settings overscroll none label': 'None',
|
|
60
60
|
'settings enable statusbar label': 'Show status bar',
|
|
61
61
|
'settings enable deck label': 'Enable Deck',
|
|
62
|
+
'settings encapsulated planks label': 'Encapsulated planks',
|
|
62
63
|
'close current label': 'Close current plank',
|
|
63
64
|
'close others label': 'Close other planks',
|
|
64
65
|
'close all label': 'Close all planks',
|
|
65
66
|
'companion plank heading fallback label': 'Related',
|
|
67
|
+
'open item label': 'Open',
|
|
66
68
|
},
|
|
67
69
|
},
|
|
68
70
|
},
|
|
@@ -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
|
+
}
|