@dxos/plugin-deck 0.8.4-main.c1de068 → 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 +91 -74
- 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/Banner.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 +6 -6
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +105 -5
- 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 +3 -3
- 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 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +4 -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 +96 -34
- 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 +58 -46
- package/src/DeckPlugin.ts +46 -61
- 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 -13
- 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 +12 -12
- package/src/components/DeckLayout/ContentEmpty.tsx +6 -7
- package/src/components/DeckLayout/DeckLayout.stories.tsx +53 -0
- package/src/components/DeckLayout/DeckLayout.tsx +18 -285
- package/src/components/DeckLayout/DeckMain.tsx +287 -0
- package/src/components/DeckLayout/Dialog.tsx +22 -13
- package/src/components/DeckLayout/Fallback.tsx +4 -8
- package/src/components/DeckLayout/Popover.tsx +70 -32
- package/src/components/DeckLayout/StatusBar.tsx +4 -4
- package/src/components/DeckLayout/Toast.tsx +30 -5
- package/src/components/Plank/Plank.stories.tsx +26 -17
- package/src/components/Plank/Plank.tsx +103 -67
- package/src/components/Plank/PlankControls.tsx +12 -14
- package/src/components/Plank/PlankError.tsx +33 -18
- package/src/components/Plank/PlankHeading.tsx +42 -48
- package/src/components/Plank/PlankLoading.tsx +1 -1
- package/src/components/Sidebar/ComplementarySidebar.tsx +77 -45
- package/src/components/Sidebar/Sidebar.tsx +9 -9
- package/src/components/Sidebar/SidebarButton.tsx +40 -33
- 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 +7 -5
- 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 +8 -5
- package/src/translations.ts +4 -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 +96 -21
- 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-JTFSDT2I.mjs +0 -152
- package/dist/lib/browser/app-graph-builder-JTFSDT2I.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-57U62A3A.mjs +0 -32
- package/dist/lib/browser/check-app-scheme-57U62A3A.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-D7KTFCUV.mjs +0 -1494
- package/dist/lib/browser/chunk-D7KTFCUV.mjs.map +0 -7
- package/dist/lib/browser/chunk-F5BQOOEG.mjs +0 -160
- package/dist/lib/browser/chunk-F5BQOOEG.mjs.map +0 -7
- package/dist/lib/browser/chunk-JFTXENFN.mjs +0 -129
- package/dist/lib/browser/chunk-JFTXENFN.mjs.map +0 -7
- package/dist/lib/browser/chunk-M57WD3V6.mjs +0 -16
- package/dist/lib/browser/chunk-M57WD3V6.mjs.map +0 -7
- package/dist/lib/browser/chunk-QDZO4AJ4.mjs +0 -127
- package/dist/lib/browser/chunk-QDZO4AJ4.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z5KITAZW.mjs +0 -13
- package/dist/lib/browser/chunk-Z5KITAZW.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-P2OBK5HK.mjs +0 -521
- package/dist/lib/browser/intent-resolver-P2OBK5HK.mjs.map +0 -7
- package/dist/lib/browser/react-root-PO64J7ML.mjs +0 -43
- package/dist/lib/browser/react-root-PO64J7ML.mjs.map +0 -7
- package/dist/lib/browser/react-surface-E45YOVF5.mjs +0 -40
- package/dist/lib/browser/react-surface-E45YOVF5.mjs.map +0 -7
- package/dist/lib/browser/settings-6AJZPZPM.mjs +0 -29
- package/dist/lib/browser/settings-6AJZPZPM.mjs.map +0 -7
- package/dist/lib/browser/state-MVDYX77Y.mjs +0 -12
- package/dist/lib/browser/tools-TKQDPCHJ.mjs +0 -88
- package/dist/lib/browser/tools-TKQDPCHJ.mjs.map +0 -7
- package/dist/lib/browser/url-handler-7L7M6IKH.mjs +0 -70
- package/dist/lib/browser/url-handler-7L7M6IKH.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/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 -141
- package/src/capabilities/capabilities.ts +0 -14
- package/src/capabilities/check-app-scheme.ts +0 -40
- package/src/capabilities/intent-resolver.ts +0 -468
- package/src/capabilities/react-root.tsx +0 -38
- package/src/capabilities/react-surface.tsx +0 -30
- package/src/capabilities/settings.ts +0 -26
- package/src/capabilities/state.ts +0 -104
- package/src/capabilities/tools.ts +0 -81
- package/src/capabilities/url-handler.ts +0 -59
- package/src/components/DeckSettings/DeckSettings.tsx +0 -88
- package/src/components/DeckSettings/index.ts +0 -5
- package/src/events.ts +0 -11
- /package/dist/lib/{browser/state-MVDYX77Y.mjs.map → node-esm/types/index.mjs.map} +0 -0
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
-
import { Option, pipe } from 'effect';
|
|
7
|
-
|
|
8
|
-
import { Capabilities, contributes, createIntent, LayoutAction, type PluginContext } from '@dxos/app-framework';
|
|
9
|
-
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
10
|
-
import { createExtension, ROOT_ID, rxFromSignal } from '@dxos/plugin-graph';
|
|
11
|
-
|
|
12
|
-
import { DeckCapabilities } from './capabilities';
|
|
13
|
-
import { DECK_PLUGIN } from '../meta';
|
|
14
|
-
|
|
15
|
-
export default (context: PluginContext) =>
|
|
16
|
-
contributes(
|
|
17
|
-
Capabilities.AppGraphBuilder,
|
|
18
|
-
createExtension({
|
|
19
|
-
id: DECK_PLUGIN,
|
|
20
|
-
actions: (node) =>
|
|
21
|
-
Rx.make((get) =>
|
|
22
|
-
pipe(
|
|
23
|
-
get(node),
|
|
24
|
-
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
25
|
-
Option.map(() => {
|
|
26
|
-
const state = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
27
|
-
|
|
28
|
-
// NOTE(Zan): This is currently disabled.
|
|
29
|
-
// TODO(Zan): Fullscreen needs to know the active node and provide that to the layout part.
|
|
30
|
-
const _fullscreen = {
|
|
31
|
-
id: `${LayoutAction.UpdateLayout._tag}/fullscreen`,
|
|
32
|
-
data: async () => {
|
|
33
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
34
|
-
await dispatch(
|
|
35
|
-
createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { mode: 'fullscreen' } }),
|
|
36
|
-
);
|
|
37
|
-
},
|
|
38
|
-
properties: {
|
|
39
|
-
label: ['toggle fullscreen label', { ns: DECK_PLUGIN }],
|
|
40
|
-
icon: 'ph--arrows-out--regular',
|
|
41
|
-
keyBinding: {
|
|
42
|
-
macos: 'ctrl+meta+f',
|
|
43
|
-
windows: 'shift+ctrl+f',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const closeCurrent = {
|
|
49
|
-
id: `${LayoutAction.Close._tag}/current`,
|
|
50
|
-
data: async () => {
|
|
51
|
-
const attention = context.getCapability(AttentionCapabilities.Attention);
|
|
52
|
-
const attended = attention.current.at(-1);
|
|
53
|
-
if (attended) {
|
|
54
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
55
|
-
await dispatch(
|
|
56
|
-
createIntent(LayoutAction.Close, {
|
|
57
|
-
part: 'main',
|
|
58
|
-
subject: [attended],
|
|
59
|
-
options: { state: false },
|
|
60
|
-
}),
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
properties: {
|
|
65
|
-
label: ['close current label', { ns: DECK_PLUGIN }],
|
|
66
|
-
icon: 'ph--x--regular',
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const closeOthers = {
|
|
71
|
-
id: `${LayoutAction.Close._tag}/others`,
|
|
72
|
-
data: async () => {
|
|
73
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
74
|
-
const attention = context.getCapability(AttentionCapabilities.Attention);
|
|
75
|
-
const attended = attention.current.at(-1);
|
|
76
|
-
const ids = state.deck.active.filter((id) => id !== attended) ?? [];
|
|
77
|
-
await dispatch(
|
|
78
|
-
createIntent(LayoutAction.Close, { part: 'main', subject: ids, options: { state: false } }),
|
|
79
|
-
);
|
|
80
|
-
},
|
|
81
|
-
properties: {
|
|
82
|
-
label: ['close others label', { ns: DECK_PLUGIN }],
|
|
83
|
-
icon: 'ph--x-square--regular',
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const closeAll = {
|
|
88
|
-
id: `${LayoutAction.Close._tag}/all`,
|
|
89
|
-
data: async () => {
|
|
90
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
91
|
-
await dispatch(
|
|
92
|
-
createIntent(LayoutAction.Close, {
|
|
93
|
-
part: 'main',
|
|
94
|
-
subject: state.deck.active,
|
|
95
|
-
options: { state: false },
|
|
96
|
-
}),
|
|
97
|
-
);
|
|
98
|
-
},
|
|
99
|
-
properties: {
|
|
100
|
-
label: ['close all label', { ns: DECK_PLUGIN }],
|
|
101
|
-
icon: 'ph--x-circle--regular',
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const toggleSidebar = {
|
|
106
|
-
id: `${LayoutAction.UpdateSidebar._tag}/nav`,
|
|
107
|
-
data: async () => {
|
|
108
|
-
state.sidebarState = state.sidebarState === 'expanded' ? 'collapsed' : 'expanded';
|
|
109
|
-
},
|
|
110
|
-
properties: {
|
|
111
|
-
label: [
|
|
112
|
-
get(
|
|
113
|
-
rxFromSignal(() =>
|
|
114
|
-
state.sidebarState === 'expanded'
|
|
115
|
-
? 'collapse navigation sidebar label'
|
|
116
|
-
: 'open navigation sidebar label',
|
|
117
|
-
),
|
|
118
|
-
),
|
|
119
|
-
{ ns: DECK_PLUGIN },
|
|
120
|
-
],
|
|
121
|
-
icon: 'ph--sidebar--regular',
|
|
122
|
-
keyBinding: {
|
|
123
|
-
macos: "meta+'",
|
|
124
|
-
},
|
|
125
|
-
disposition: 'pin-end',
|
|
126
|
-
position: 'hoist',
|
|
127
|
-
l0Breakpoint: 'lg',
|
|
128
|
-
},
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
return get(
|
|
132
|
-
rxFromSignal(() =>
|
|
133
|
-
!state.deck.solo ? [closeCurrent, closeOthers, closeAll, toggleSidebar] : [toggleSidebar],
|
|
134
|
-
),
|
|
135
|
-
);
|
|
136
|
-
}),
|
|
137
|
-
Option.getOrElse(() => []),
|
|
138
|
-
),
|
|
139
|
-
),
|
|
140
|
-
}),
|
|
141
|
-
);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
-
import { type DeepReadonly } from '@dxos/util';
|
|
7
|
-
|
|
8
|
-
import { DECK_PLUGIN } from '../meta';
|
|
9
|
-
import { type DeckPluginState } from '../types';
|
|
10
|
-
|
|
11
|
-
export namespace DeckCapabilities {
|
|
12
|
-
export const DeckState = defineCapability<DeepReadonly<DeckPluginState>>(`${DECK_PLUGIN}/capability/state`);
|
|
13
|
-
export const MutableDeckState = defineCapability<DeckPluginState>(`${DECK_PLUGIN}/capability/state`);
|
|
14
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
import { DECK_PLUGIN } from '../meta';
|
|
8
|
-
import { type DeckSettingsProps } from '../types';
|
|
9
|
-
|
|
10
|
-
const isSocket = !!(globalThis as any).__args;
|
|
11
|
-
|
|
12
|
-
// TODO(mjamesderocher): Can we get this directly from Socket?
|
|
13
|
-
const appScheme = 'composer://';
|
|
14
|
-
|
|
15
|
-
// TODO(mjamesderocher): Factor out as part of NavigationPlugin.
|
|
16
|
-
const checkAppScheme = (url: string) => {
|
|
17
|
-
const iframe = document.createElement('iframe');
|
|
18
|
-
iframe.style.display = 'none';
|
|
19
|
-
document.body.appendChild(iframe);
|
|
20
|
-
|
|
21
|
-
iframe.src = url + window.location.pathname.replace(/^\/+/, '') + window.location.search;
|
|
22
|
-
|
|
23
|
-
const timer = setTimeout(() => {
|
|
24
|
-
document.body.removeChild(iframe);
|
|
25
|
-
}, 3000);
|
|
26
|
-
|
|
27
|
-
window.addEventListener('pagehide', (event) => {
|
|
28
|
-
clearTimeout(timer);
|
|
29
|
-
document.body.removeChild(iframe);
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export default async (context: PluginContext) => {
|
|
34
|
-
const settings = context.getCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(DECK_PLUGIN)?.value;
|
|
35
|
-
if (!isSocket && settings?.enableNativeRedirect) {
|
|
36
|
-
checkAppScheme(appScheme);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return contributes(Capabilities.Null, null);
|
|
40
|
-
};
|
|
@@ -1,468 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { batch } from '@preact/signals-core';
|
|
6
|
-
import { Schema, Effect, pipe, Option } from 'effect';
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
Capabilities,
|
|
10
|
-
createResolver,
|
|
11
|
-
contributes,
|
|
12
|
-
IntentAction,
|
|
13
|
-
LayoutAction,
|
|
14
|
-
type PluginContext,
|
|
15
|
-
createIntent,
|
|
16
|
-
chain,
|
|
17
|
-
} from '@dxos/app-framework';
|
|
18
|
-
import { Obj } from '@dxos/echo';
|
|
19
|
-
import { invariant } from '@dxos/invariant';
|
|
20
|
-
import { isLiveObject } from '@dxos/live-object';
|
|
21
|
-
import { log } from '@dxos/log';
|
|
22
|
-
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
23
|
-
import { isActionLike } from '@dxos/plugin-graph';
|
|
24
|
-
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
25
|
-
import { byPosition, isNonNullable } from '@dxos/util';
|
|
26
|
-
|
|
27
|
-
import { DeckCapabilities } from './capabilities';
|
|
28
|
-
import { closeEntry, createEntryId, incrementPlank, openEntry } from '../layout';
|
|
29
|
-
import { DECK_PLUGIN } from '../meta';
|
|
30
|
-
import {
|
|
31
|
-
DeckAction,
|
|
32
|
-
type LayoutMode,
|
|
33
|
-
type DeckSettingsProps,
|
|
34
|
-
isLayoutMode,
|
|
35
|
-
getMode,
|
|
36
|
-
defaultDeck,
|
|
37
|
-
PLANK_COMPANION_TYPE,
|
|
38
|
-
} from '../types';
|
|
39
|
-
import { setActive } from '../util';
|
|
40
|
-
|
|
41
|
-
export default (context: PluginContext) =>
|
|
42
|
-
contributes(Capabilities.IntentResolver, [
|
|
43
|
-
createResolver({
|
|
44
|
-
intent: IntentAction.ShowUndo,
|
|
45
|
-
resolve: (data) => {
|
|
46
|
-
const layout = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
47
|
-
const { undoPromise: undo } = context.getCapability(Capabilities.IntentDispatcher);
|
|
48
|
-
|
|
49
|
-
// TODO(wittjosiah): Support undoing further back than the last action.
|
|
50
|
-
if (layout.currentUndoId) {
|
|
51
|
-
layout.toasts = layout.toasts.filter((toast) => toast.id !== layout.currentUndoId);
|
|
52
|
-
}
|
|
53
|
-
layout.currentUndoId = `${IntentAction.ShowUndo._tag}-${Date.now()}`;
|
|
54
|
-
layout.toasts = [
|
|
55
|
-
...layout.toasts,
|
|
56
|
-
{
|
|
57
|
-
id: layout.currentUndoId,
|
|
58
|
-
title: data.message ?? ['undo available label', { ns: DECK_PLUGIN }],
|
|
59
|
-
duration: 10_000,
|
|
60
|
-
actionLabel: ['undo action label', { ns: DECK_PLUGIN }],
|
|
61
|
-
actionAlt: ['undo action alt', { ns: DECK_PLUGIN }],
|
|
62
|
-
closeLabel: ['undo close label', { ns: DECK_PLUGIN }],
|
|
63
|
-
onAction: () => undo(),
|
|
64
|
-
},
|
|
65
|
-
];
|
|
66
|
-
},
|
|
67
|
-
}),
|
|
68
|
-
createResolver({
|
|
69
|
-
intent: LayoutAction.UpdateLayout,
|
|
70
|
-
// TODO(wittjosiah): This should be able to just be `Schema.is(LayoutAction.UpdateSidebar.fields.input)`
|
|
71
|
-
// but the filter is not being applied correctly.
|
|
72
|
-
filter: (data): data is Schema.Schema.Type<typeof LayoutAction.UpdateSidebar.fields.input> =>
|
|
73
|
-
Schema.is(LayoutAction.UpdateSidebar.fields.input)(data),
|
|
74
|
-
resolve: ({ options }) => {
|
|
75
|
-
const layout = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
76
|
-
const next = options?.state ?? layout.sidebarState;
|
|
77
|
-
if (next !== layout.sidebarState) {
|
|
78
|
-
layout.sidebarState = next;
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
}),
|
|
82
|
-
createResolver({
|
|
83
|
-
intent: LayoutAction.UpdateLayout,
|
|
84
|
-
// TODO(wittjosiah): This should be able to just be `Schema.is(LayoutAction.UpdateComplementary.fields.input)`
|
|
85
|
-
// but the filter is not being applied correctly.
|
|
86
|
-
filter: (data): data is Schema.Schema.Type<typeof LayoutAction.UpdateComplementary.fields.input> =>
|
|
87
|
-
Schema.is(LayoutAction.UpdateComplementary.fields.input)(data),
|
|
88
|
-
resolve: ({ subject, options }) => {
|
|
89
|
-
const layout = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
90
|
-
|
|
91
|
-
if (layout.complementarySidebarPanel !== subject) {
|
|
92
|
-
layout.complementarySidebarPanel = subject;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const next = subject ? 'expanded' : (options?.state ?? layout.complementarySidebarState);
|
|
96
|
-
if (next !== layout.complementarySidebarState) {
|
|
97
|
-
layout.complementarySidebarState = next;
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
}),
|
|
101
|
-
createResolver({
|
|
102
|
-
intent: LayoutAction.UpdateLayout,
|
|
103
|
-
// TODO(wittjosiah): This should be able to just be `Schema.is(LayoutAction.UpdateDialog.fields.input)`
|
|
104
|
-
// but the filter is not being applied correctly.
|
|
105
|
-
filter: (data): data is Schema.Schema.Type<typeof LayoutAction.UpdateDialog.fields.input> =>
|
|
106
|
-
Schema.is(LayoutAction.UpdateDialog.fields.input)(data),
|
|
107
|
-
resolve: ({ subject, options }) => {
|
|
108
|
-
const layout = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
109
|
-
layout.dialogOpen = options.state ?? Boolean(subject);
|
|
110
|
-
layout.dialogType = options.type ?? 'default';
|
|
111
|
-
layout.dialogBlockAlign = options.blockAlign ?? 'center';
|
|
112
|
-
layout.dialogOverlayClasses = options.overlayClasses;
|
|
113
|
-
layout.dialogOverlayStyle = options.overlayStyle;
|
|
114
|
-
layout.dialogContent = subject ? { component: subject, props: options.props } : null;
|
|
115
|
-
},
|
|
116
|
-
}),
|
|
117
|
-
createResolver({
|
|
118
|
-
intent: LayoutAction.UpdateLayout,
|
|
119
|
-
// TODO(wittjosiah): This should be able to just be `Schema.is(LayoutAction.UpdatePopover.fields.input)`
|
|
120
|
-
// but the filter is not being applied correctly.
|
|
121
|
-
filter: (data): data is Schema.Schema.Type<typeof LayoutAction.UpdatePopover.fields.input> =>
|
|
122
|
-
Schema.is(LayoutAction.UpdatePopover.fields.input)(data),
|
|
123
|
-
resolve: ({ subject, options }) => {
|
|
124
|
-
const layout = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
125
|
-
layout.popoverOpen = options.state ?? Boolean(subject);
|
|
126
|
-
layout.popoverContent =
|
|
127
|
-
typeof subject === 'string' ? { component: subject, props: options.props } : subject ? { subject } : null;
|
|
128
|
-
layout.popoverSide = options.side;
|
|
129
|
-
if (options.variant === 'virtual') {
|
|
130
|
-
layout.popoverAnchor = options.anchor;
|
|
131
|
-
} else {
|
|
132
|
-
layout.popoverAnchorId = options.anchorId;
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
}),
|
|
136
|
-
createResolver({
|
|
137
|
-
intent: LayoutAction.UpdateLayout,
|
|
138
|
-
// TODO(wittjosiah): This should be able to just be `Schema.is(LayoutAction.AddToast.fields.input)`
|
|
139
|
-
// but the filter is not being applied correctly.
|
|
140
|
-
filter: (data): data is Schema.Schema.Type<typeof LayoutAction.AddToast.fields.input> =>
|
|
141
|
-
Schema.is(LayoutAction.AddToast.fields.input)(data),
|
|
142
|
-
resolve: ({ subject }) => {
|
|
143
|
-
const layout = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
144
|
-
layout.toasts.push(subject);
|
|
145
|
-
},
|
|
146
|
-
}),
|
|
147
|
-
createResolver({
|
|
148
|
-
intent: LayoutAction.UpdateLayout,
|
|
149
|
-
// TODO(wittjosiah): This should be able to just be `Schema.is(LayoutAction.SetLayoutMode.fields.input)`
|
|
150
|
-
// but the filter is not being applied correctly.
|
|
151
|
-
filter: (data): data is Schema.Schema.Type<typeof LayoutAction.SetLayoutMode.fields.input> => {
|
|
152
|
-
if (!Schema.is(LayoutAction.SetLayoutMode.fields.input)(data)) {
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
if ('mode' in data.options) {
|
|
157
|
-
return isLayoutMode(data.options.mode);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return true;
|
|
161
|
-
},
|
|
162
|
-
resolve: ({ subject, options }) => {
|
|
163
|
-
const state = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
164
|
-
|
|
165
|
-
const setMode = (mode: LayoutMode) => {
|
|
166
|
-
const deck = state.deck;
|
|
167
|
-
const current = deck.solo ? [deck.solo] : deck.active;
|
|
168
|
-
// When un-soloing, the solo entry is added to the deck.
|
|
169
|
-
const next = (
|
|
170
|
-
mode !== 'deck' ? [subject ?? deck.solo ?? deck.active[0]] : [...deck.active, deck.solo]
|
|
171
|
-
).filter(isNonNullable);
|
|
172
|
-
|
|
173
|
-
const removed = current.filter((id) => !next.includes(id));
|
|
174
|
-
const closed = Array.from(new Set([...deck.inactive.filter((id) => !next.includes(id)), ...removed]));
|
|
175
|
-
deck.inactive = closed;
|
|
176
|
-
|
|
177
|
-
if (mode !== 'deck' && next[0]) {
|
|
178
|
-
deck.solo = next[0];
|
|
179
|
-
} else if (mode === 'deck' && deck.solo) {
|
|
180
|
-
deck.solo = undefined;
|
|
181
|
-
deck.initialized = true;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
if (mode === 'solo--fullscreen') {
|
|
185
|
-
deck.fullscreen = !deck.fullscreen;
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
return batch(() => {
|
|
190
|
-
if ('mode' in options) {
|
|
191
|
-
const current = getMode(state.deck);
|
|
192
|
-
if (current !== options.mode) {
|
|
193
|
-
state.previousMode[state.activeDeck] = current;
|
|
194
|
-
}
|
|
195
|
-
setMode(options.mode as LayoutMode);
|
|
196
|
-
} else if ('revert' in options) {
|
|
197
|
-
const last = state.previousMode[state.activeDeck];
|
|
198
|
-
setMode(last ?? 'solo');
|
|
199
|
-
} else {
|
|
200
|
-
log.warn('Invalid layout mode', options);
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
},
|
|
204
|
-
}),
|
|
205
|
-
createResolver({
|
|
206
|
-
intent: LayoutAction.UpdateLayout,
|
|
207
|
-
filter: (data): data is Schema.Schema.Type<typeof LayoutAction.SwitchWorkspace.fields.input> =>
|
|
208
|
-
Schema.is(LayoutAction.SwitchWorkspace.fields.input)(data),
|
|
209
|
-
resolve: ({ subject }) => {
|
|
210
|
-
const { graph } = context.getCapability(Capabilities.AppGraph);
|
|
211
|
-
const state = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
212
|
-
batch(() => {
|
|
213
|
-
// TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.
|
|
214
|
-
// Ideally this should be worked into the data model in a generic way.
|
|
215
|
-
if (!state.activeDeck.startsWith('!')) {
|
|
216
|
-
state.previousDeck = state.activeDeck;
|
|
217
|
-
}
|
|
218
|
-
state.activeDeck = subject;
|
|
219
|
-
if (!state.decks[subject]) {
|
|
220
|
-
state.decks[subject] = { ...defaultDeck };
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
const first = state.deck.solo ? state.deck.solo : state.deck.active[0];
|
|
225
|
-
if (first) {
|
|
226
|
-
return {
|
|
227
|
-
intents: [createIntent(LayoutAction.ScrollIntoView, { part: 'current', subject: first })],
|
|
228
|
-
};
|
|
229
|
-
} else {
|
|
230
|
-
const [item] = graph
|
|
231
|
-
.getConnections(subject)
|
|
232
|
-
.filter((node) => !isActionLike(node) && !node.properties.disposition);
|
|
233
|
-
if (item) {
|
|
234
|
-
return {
|
|
235
|
-
intents: [createIntent(LayoutAction.Open, { part: 'main', subject: [item.id] })],
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
}),
|
|
241
|
-
createResolver({
|
|
242
|
-
intent: LayoutAction.UpdateLayout,
|
|
243
|
-
filter: (data): data is Schema.Schema.Type<typeof LayoutAction.RevertWorkspace.fields.input> =>
|
|
244
|
-
Schema.is(LayoutAction.RevertWorkspace.fields.input)(data),
|
|
245
|
-
resolve: () => {
|
|
246
|
-
const state = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
247
|
-
return {
|
|
248
|
-
intents: [createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: state.previousDeck })],
|
|
249
|
-
};
|
|
250
|
-
},
|
|
251
|
-
}),
|
|
252
|
-
createResolver({
|
|
253
|
-
intent: LayoutAction.UpdateLayout,
|
|
254
|
-
filter: (data): data is Schema.Schema.Type<typeof LayoutAction.Open.fields.input> =>
|
|
255
|
-
Schema.is(LayoutAction.Open.fields.input)(data),
|
|
256
|
-
resolve: ({ subject, options }) =>
|
|
257
|
-
Effect.gen(function* () {
|
|
258
|
-
const { graph } = context.getCapability(Capabilities.AppGraph);
|
|
259
|
-
const state = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
260
|
-
const attention = context.getCapability(AttentionCapabilities.Attention);
|
|
261
|
-
const settings = context
|
|
262
|
-
.getCapabilities(Capabilities.SettingsStore)[0]
|
|
263
|
-
?.getStore<DeckSettingsProps>(DECK_PLUGIN)?.value;
|
|
264
|
-
|
|
265
|
-
if (options?.workspace && state.activeDeck !== options?.workspace) {
|
|
266
|
-
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
267
|
-
yield* dispatch(
|
|
268
|
-
createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: options.workspace }),
|
|
269
|
-
);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
const previouslyOpenIds = new Set<string>(state.deck.solo ? [state.deck.solo] : state.deck.active);
|
|
273
|
-
batch(() => {
|
|
274
|
-
const next = state.deck.solo
|
|
275
|
-
? (subject as string[]).map((id) => createEntryId(id, options?.variant))
|
|
276
|
-
: subject.reduce(
|
|
277
|
-
(acc, entryId) =>
|
|
278
|
-
openEntry(acc, entryId, {
|
|
279
|
-
key: options?.key,
|
|
280
|
-
positioning: options?.positioning ?? settings?.newPlankPositioning,
|
|
281
|
-
pivotId: options?.pivotId,
|
|
282
|
-
variant: options?.variant,
|
|
283
|
-
}),
|
|
284
|
-
state.deck.active,
|
|
285
|
-
);
|
|
286
|
-
|
|
287
|
-
return setActive({ next, state, attention });
|
|
288
|
-
});
|
|
289
|
-
|
|
290
|
-
const ids = state.deck.solo ? [state.deck.solo] : state.deck.active;
|
|
291
|
-
const newlyOpen = ids.filter((i) => !previouslyOpenIds.has(i));
|
|
292
|
-
|
|
293
|
-
return {
|
|
294
|
-
intents: [
|
|
295
|
-
...(options?.scrollIntoView !== false
|
|
296
|
-
? [createIntent(LayoutAction.ScrollIntoView, { part: 'current', subject: newlyOpen[0] ?? subject[0] })]
|
|
297
|
-
: []),
|
|
298
|
-
createIntent(LayoutAction.Expose, { part: 'navigation', subject: newlyOpen[0] ?? subject[0] }),
|
|
299
|
-
...newlyOpen.map((subjectId) => {
|
|
300
|
-
const typename = Option.match(graph.getNode(subjectId), {
|
|
301
|
-
onNone: () => undefined,
|
|
302
|
-
onSome: (node) => {
|
|
303
|
-
const active = node.data;
|
|
304
|
-
return isLiveObject(active) ? Obj.getTypename(active) : undefined;
|
|
305
|
-
},
|
|
306
|
-
});
|
|
307
|
-
return createIntent(ObservabilityAction.SendEvent, {
|
|
308
|
-
name: 'navigation.activate',
|
|
309
|
-
properties: {
|
|
310
|
-
subjectId,
|
|
311
|
-
typename,
|
|
312
|
-
},
|
|
313
|
-
});
|
|
314
|
-
}),
|
|
315
|
-
],
|
|
316
|
-
};
|
|
317
|
-
}),
|
|
318
|
-
}),
|
|
319
|
-
createResolver({
|
|
320
|
-
intent: LayoutAction.UpdateLayout,
|
|
321
|
-
filter: (data): data is Schema.Schema.Type<typeof LayoutAction.Close.fields.input> =>
|
|
322
|
-
Schema.is(LayoutAction.Close.fields.input)(data),
|
|
323
|
-
resolve: ({ subject }) => {
|
|
324
|
-
const state = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
325
|
-
const attention = context.getCapability(AttentionCapabilities.Attention);
|
|
326
|
-
const active = state.deck.solo ? [state.deck.solo] : state.deck.active;
|
|
327
|
-
const next = subject.reduce((acc, id) => closeEntry(acc, id), active);
|
|
328
|
-
const toAttend = setActive({ next, state, attention });
|
|
329
|
-
|
|
330
|
-
const clearCompanionIntents = subject
|
|
331
|
-
.filter((id) => state.deck.activeCompanions && id in state.deck.activeCompanions)
|
|
332
|
-
.map((primary) => createIntent(DeckAction.ChangeCompanion, { primary, companion: null }));
|
|
333
|
-
|
|
334
|
-
return {
|
|
335
|
-
intents: [
|
|
336
|
-
...clearCompanionIntents,
|
|
337
|
-
...(toAttend ? [createIntent(LayoutAction.ScrollIntoView, { part: 'current', subject: toAttend })] : []),
|
|
338
|
-
],
|
|
339
|
-
};
|
|
340
|
-
},
|
|
341
|
-
}),
|
|
342
|
-
createResolver({
|
|
343
|
-
intent: LayoutAction.UpdateLayout,
|
|
344
|
-
filter: (data): data is Schema.Schema.Type<typeof LayoutAction.Set.fields.input> =>
|
|
345
|
-
Schema.is(LayoutAction.Set.fields.input)(data),
|
|
346
|
-
resolve: ({ subject }) => {
|
|
347
|
-
const state = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
348
|
-
const attention = context.getCapability(AttentionCapabilities.Attention);
|
|
349
|
-
const toAttend = setActive({ next: subject as string[], state, attention });
|
|
350
|
-
return {
|
|
351
|
-
intents: toAttend ? [createIntent(LayoutAction.ScrollIntoView, { part: 'current', subject: toAttend })] : [],
|
|
352
|
-
};
|
|
353
|
-
},
|
|
354
|
-
}),
|
|
355
|
-
createResolver({
|
|
356
|
-
intent: LayoutAction.UpdateLayout,
|
|
357
|
-
filter: (data): data is Schema.Schema.Type<typeof LayoutAction.ScrollIntoView.fields.input> =>
|
|
358
|
-
Schema.is(LayoutAction.ScrollIntoView.fields.input)(data),
|
|
359
|
-
resolve: ({ subject }) => {
|
|
360
|
-
const layout = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
361
|
-
layout.scrollIntoView = subject;
|
|
362
|
-
},
|
|
363
|
-
}),
|
|
364
|
-
createResolver({
|
|
365
|
-
intent: DeckAction.UpdatePlankSize,
|
|
366
|
-
resolve: (data) => {
|
|
367
|
-
const state = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
368
|
-
state.deck.plankSizing[data.id] = data.size;
|
|
369
|
-
},
|
|
370
|
-
}),
|
|
371
|
-
createResolver({
|
|
372
|
-
intent: DeckAction.ChangeCompanion,
|
|
373
|
-
resolve: (data) => {
|
|
374
|
-
const state = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
375
|
-
// TODO(thure): Reactivity only works when creating a lexically new `activeCompanions`… Are these not proxy objects?
|
|
376
|
-
if (data.companion === null) {
|
|
377
|
-
const { [data.primary]: _, ...nextActiveCompanions } = state.deck.activeCompanions ?? {};
|
|
378
|
-
state.deck.activeCompanions = nextActiveCompanions;
|
|
379
|
-
} else {
|
|
380
|
-
invariant(data.companion !== data.primary);
|
|
381
|
-
state.deck.activeCompanions = {
|
|
382
|
-
...state.deck.activeCompanions,
|
|
383
|
-
[data.primary]: data.companion,
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
},
|
|
387
|
-
}),
|
|
388
|
-
createResolver({
|
|
389
|
-
intent: DeckAction.Adjust,
|
|
390
|
-
resolve: (adjustment) => {
|
|
391
|
-
const state = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
392
|
-
const attention = context.getCapability(AttentionCapabilities.Attention);
|
|
393
|
-
const { graph } = context.getCapability(Capabilities.AppGraph);
|
|
394
|
-
|
|
395
|
-
return batch(() => {
|
|
396
|
-
if (adjustment.type === 'increment-end' || adjustment.type === 'increment-start') {
|
|
397
|
-
setActive({
|
|
398
|
-
next: incrementPlank(state.deck.active, adjustment),
|
|
399
|
-
state,
|
|
400
|
-
attention,
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
if (adjustment.type === 'companion') {
|
|
405
|
-
return pipe(
|
|
406
|
-
graph.getNode(adjustment.id),
|
|
407
|
-
Option.map((node) =>
|
|
408
|
-
graph
|
|
409
|
-
.getConnections(node.id)
|
|
410
|
-
.filter((n) => n.type === PLANK_COMPANION_TYPE)
|
|
411
|
-
.toSorted((a, b) => byPosition(a.properties, b.properties)),
|
|
412
|
-
),
|
|
413
|
-
Option.flatMap((companions) => (companions.length > 0 ? Option.some(companions[0]) : Option.none())),
|
|
414
|
-
Option.match({
|
|
415
|
-
onNone: () => ({}),
|
|
416
|
-
onSome: (companion) => ({
|
|
417
|
-
intents: [
|
|
418
|
-
// TODO(wittjosiah): This should remember the previously selected companion.
|
|
419
|
-
createIntent(DeckAction.ChangeCompanion, { primary: adjustment.id, companion: companion.id }),
|
|
420
|
-
],
|
|
421
|
-
}),
|
|
422
|
-
}),
|
|
423
|
-
);
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
if (adjustment.type.startsWith('solo')) {
|
|
427
|
-
const entryId = adjustment.id;
|
|
428
|
-
if (!state.deck.solo) {
|
|
429
|
-
// Solo the entry.
|
|
430
|
-
return {
|
|
431
|
-
intents: [
|
|
432
|
-
createIntent(LayoutAction.SetLayoutMode, {
|
|
433
|
-
part: 'mode',
|
|
434
|
-
subject: entryId,
|
|
435
|
-
options: { mode: adjustment.type },
|
|
436
|
-
}),
|
|
437
|
-
],
|
|
438
|
-
};
|
|
439
|
-
} else {
|
|
440
|
-
if (adjustment.type === 'solo--fullscreen') {
|
|
441
|
-
// Toggle fullscreen on the current entry.
|
|
442
|
-
return {
|
|
443
|
-
intents: [
|
|
444
|
-
createIntent(LayoutAction.SetLayoutMode, {
|
|
445
|
-
part: 'mode',
|
|
446
|
-
subject: entryId,
|
|
447
|
-
options: { mode: 'solo--fullscreen' },
|
|
448
|
-
}),
|
|
449
|
-
],
|
|
450
|
-
};
|
|
451
|
-
} else if (adjustment.type === 'solo') {
|
|
452
|
-
// Un-solo the current entry.
|
|
453
|
-
return {
|
|
454
|
-
intents: [
|
|
455
|
-
// NOTE: The order of these is important.
|
|
456
|
-
pipe(
|
|
457
|
-
createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { mode: 'deck' } }),
|
|
458
|
-
chain(LayoutAction.Open, { part: 'main', subject: [entryId] }),
|
|
459
|
-
),
|
|
460
|
-
],
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
});
|
|
466
|
-
},
|
|
467
|
-
}),
|
|
468
|
-
]);
|