@dxos/plugin-deck 0.8.4-main.406dc2a → 0.8.4-main.4a85c3132b
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-7I6H3N4Q.mjs → chunk-OAPMV5ZR.mjs} +145 -27
- 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 +84 -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.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +2 -1
- 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 +26 -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 +2 -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 +92 -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 +23 -34
- package/src/components/DeckLayout/DeckLayout.tsx +13 -11
- package/src/components/DeckLayout/DeckMain.tsx +67 -65
- 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 +5 -5
- package/src/components/Plank/Plank.stories.tsx +19 -9
- package/src/components/Plank/Plank.tsx +85 -66
- 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/{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 +6 -4
- package/src/hooks/useDeckState.ts +82 -0
- package/src/hooks/useHoistStatusbar.ts +3 -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 +2 -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 +91 -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-7I6H3N4Q.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-JQKOS2HB.mjs +0 -1531
- package/dist/lib/browser/chunk-JQKOS2HB.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-RJP5R7PY.mjs +0 -127
- package/dist/lib/browser/chunk-RJP5R7PY.mjs.map +0 -7
- package/dist/lib/browser/chunk-VX7MMQOW.mjs +0 -129
- package/dist/lib/browser/chunk-VX7MMQOW.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-7XNOEPVN.mjs +0 -524
- package/dist/lib/browser/intent-resolver-7XNOEPVN.mjs.map +0 -7
- package/dist/lib/browser/react-root-OJEF7YCH.mjs +0 -43
- package/dist/lib/browser/react-root-OJEF7YCH.mjs.map +0 -7
- package/dist/lib/browser/react-surface-XN2NJYHO.mjs +0 -40
- package/dist/lib/browser/react-surface-XN2NJYHO.mjs.map +0 -7
- package/dist/lib/browser/settings-M3KSKRAP.mjs +0 -30
- package/dist/lib/browser/settings-M3KSKRAP.mjs.map +0 -7
- package/dist/lib/browser/state-6ZSDTF6Q.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-EHTLXZRR.mjs +0 -70
- package/dist/lib/browser/url-handler-EHTLXZRR.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 +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 -27
- package/src/capabilities/state.ts +0 -108
- 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/index.ts +0 -5
- package/src/events.ts +0 -11
- /package/dist/lib/{browser/state-6ZSDTF6Q.mjs.map → node-esm/types/index.mjs.map} +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { useFocusFinders } from '@fluentui/react-tabster';
|
|
5
6
|
import React, {
|
|
6
7
|
type KeyboardEvent,
|
|
7
8
|
type PropsWithChildren,
|
|
@@ -12,34 +13,32 @@ import React, {
|
|
|
12
13
|
useRef,
|
|
13
14
|
} from 'react';
|
|
14
15
|
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
createIntent,
|
|
19
|
-
useAppGraph,
|
|
20
|
-
useCapability,
|
|
21
|
-
useIntentDispatcher,
|
|
22
|
-
} from '@dxos/app-framework';
|
|
16
|
+
import { Surface, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
17
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
18
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
23
19
|
import { debounce } from '@dxos/async';
|
|
24
20
|
import { type Node, useNode } from '@dxos/plugin-graph';
|
|
25
21
|
import { ATTENDABLE_PATH_SEPARATOR, useAttentionAttributes } from '@dxos/react-ui-attention';
|
|
26
22
|
import { StackItem, railGridHorizontal } from '@dxos/react-ui-stack';
|
|
27
|
-
import { mainIntrinsicSize, mx } from '@dxos/
|
|
23
|
+
import { mainIntrinsicSize, mx } from '@dxos/ui-theme';
|
|
28
24
|
|
|
29
|
-
import {
|
|
30
|
-
import { useCompanions, useMainSize } from '../../hooks';
|
|
25
|
+
import { useCompanions, useDeckState, useMainSize, useSelectedCompanion } from '../../hooks';
|
|
31
26
|
import { parseEntryId } from '../../layout';
|
|
32
|
-
import {
|
|
27
|
+
import { DeckOperation, type DeckSettingsProps, type LayoutMode, type ResolvedPart } from '../../types';
|
|
33
28
|
|
|
34
|
-
import {
|
|
29
|
+
import { PlankError, PlankErrorFallback } from './PlankError';
|
|
35
30
|
import { PlankHeading } from './PlankHeading';
|
|
36
31
|
import { PlankLoading } from './PlankLoading';
|
|
37
32
|
|
|
38
33
|
const UNKNOWN_ID = 'unknown_id';
|
|
39
34
|
|
|
35
|
+
//
|
|
36
|
+
// Plank
|
|
37
|
+
//
|
|
38
|
+
|
|
40
39
|
export type PlankProps = Pick<PlankComponentProps, 'layoutMode' | 'part' | 'path' | 'order' | 'active' | 'settings'> & {
|
|
41
40
|
id?: string;
|
|
42
|
-
|
|
41
|
+
companionVariant?: string;
|
|
43
42
|
};
|
|
44
43
|
|
|
45
44
|
// TODO(burdon): Factor out conditional rendering.
|
|
@@ -50,22 +49,24 @@ export type PlankProps = Pick<PlankComponentProps, 'layoutMode' | 'part' | 'path
|
|
|
50
49
|
// benefits. I think where we anticipate users will definitely want to quickly switch between showing and hiding entire
|
|
51
50
|
// articles, over the (again probably large) performance benefit that unmounting them would confer, we can mount and
|
|
52
51
|
// hide them, but I think that scenario in its most unambiguous form is probably rare. You could extrapolate
|
|
53
|
-
// the scenario to include all
|
|
54
|
-
// don
|
|
52
|
+
// the scenario to include all "potential" planks such as companions, which we could keep mounted and hidden, but I
|
|
53
|
+
// don't think the resulting performance would be acceptable. I think the real issue is "perceived performance" which
|
|
55
54
|
// has mitigations that are in between mounting and un-mounting since both of those have tradeoffs; we may need one or more
|
|
56
|
-
//
|
|
55
|
+
// "partially-mounted" experiences, like loading skeletons at the simple end, or screenshots of "sleeping" planks at
|
|
57
56
|
// the advanced end.
|
|
58
57
|
|
|
59
58
|
/**
|
|
60
59
|
* A Plank is the main container for surfaces within a Deck.
|
|
61
60
|
* It may be paired with a companion plank that enables the user to select one of multiple companion surfaces.
|
|
62
61
|
*/
|
|
63
|
-
export const Plank = memo(({ id = UNKNOWN_ID,
|
|
62
|
+
export const Plank = memo(({ id = UNKNOWN_ID, companionVariant, ...props }: PlankProps) => {
|
|
64
63
|
const { graph } = useAppGraph();
|
|
65
64
|
const node = useNode(graph, id);
|
|
66
65
|
const companions = useCompanions(id);
|
|
67
|
-
const
|
|
68
|
-
const
|
|
66
|
+
const { companionId } = useSelectedCompanion(companions, companionVariant);
|
|
67
|
+
const resolvedCompanionId = companionVariant ? companionId : undefined;
|
|
68
|
+
const currentCompanion = companions.find(({ id }) => id === resolvedCompanionId);
|
|
69
|
+
const hasCompanion = !!(resolvedCompanionId && currentCompanion);
|
|
69
70
|
|
|
70
71
|
return (
|
|
71
72
|
<PlankContainer
|
|
@@ -83,7 +84,7 @@ export const Plank = memo(({ id = UNKNOWN_ID, companionId, ...props }: PlankProp
|
|
|
83
84
|
/>
|
|
84
85
|
{hasCompanion && (
|
|
85
86
|
<PlankComponent
|
|
86
|
-
id={
|
|
87
|
+
id={resolvedCompanionId}
|
|
87
88
|
node={currentCompanion}
|
|
88
89
|
primary={node}
|
|
89
90
|
companions={companions}
|
|
@@ -96,12 +97,13 @@ export const Plank = memo(({ id = UNKNOWN_ID, companionId, ...props }: PlankProp
|
|
|
96
97
|
);
|
|
97
98
|
});
|
|
98
99
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
//
|
|
101
|
+
// PlankContainer
|
|
102
|
+
//
|
|
103
|
+
|
|
104
|
+
type PlankContainerProps = PropsWithChildren<{ solo: boolean; companion: boolean; encapsulate: boolean }>;
|
|
105
|
+
|
|
106
|
+
const PlankContainer = ({ children, solo, companion, encapsulate }: PlankContainerProps) => {
|
|
105
107
|
const sizeAttrs = useMainSize();
|
|
106
108
|
if (!solo) {
|
|
107
109
|
return children;
|
|
@@ -111,10 +113,11 @@ const PlankContainer = ({
|
|
|
111
113
|
return (
|
|
112
114
|
<div
|
|
113
115
|
role='none'
|
|
116
|
+
data-popover-collision-boundary={true}
|
|
114
117
|
className={mx(
|
|
115
|
-
'absolute inset-
|
|
116
|
-
encapsulate && 'border border-separator rounded overflow-hidden',
|
|
117
|
-
companion && 'grid-cols-[6fr_4fr]',
|
|
118
|
+
'absolute inset-(--main-spacing) grid',
|
|
119
|
+
encapsulate && 'border border-separator rounded-sm overflow-hidden',
|
|
120
|
+
companion && 'grid-cols-[6fr_4fr]', // TODO(burdon): Resize.
|
|
118
121
|
railGridHorizontal,
|
|
119
122
|
mainIntrinsicSize,
|
|
120
123
|
)}
|
|
@@ -125,6 +128,10 @@ const PlankContainer = ({
|
|
|
125
128
|
);
|
|
126
129
|
};
|
|
127
130
|
|
|
131
|
+
//
|
|
132
|
+
// PlankComponent
|
|
133
|
+
//
|
|
134
|
+
|
|
128
135
|
type PlankComponentProps = {
|
|
129
136
|
layoutMode: LayoutMode;
|
|
130
137
|
id: string;
|
|
@@ -132,11 +139,10 @@ type PlankComponentProps = {
|
|
|
132
139
|
path?: string[];
|
|
133
140
|
order?: number;
|
|
134
141
|
active?: string[];
|
|
135
|
-
// TODO(burdon): Change to role?
|
|
136
142
|
companioned?: 'primary' | 'companion';
|
|
137
|
-
node?: Node;
|
|
138
|
-
primary?: Node;
|
|
139
|
-
companions?: Node[];
|
|
143
|
+
node?: Node.Node;
|
|
144
|
+
primary?: Node.Node;
|
|
145
|
+
companions?: Node.Node[];
|
|
140
146
|
settings?: DeckSettingsProps;
|
|
141
147
|
};
|
|
142
148
|
|
|
@@ -154,8 +160,10 @@ const PlankComponent = memo(
|
|
|
154
160
|
companions,
|
|
155
161
|
settings,
|
|
156
162
|
}: PlankComponentProps) => {
|
|
157
|
-
const {
|
|
158
|
-
const {
|
|
163
|
+
const { invokePromise } = useOperationInvoker();
|
|
164
|
+
const { state, deck } = useDeckState();
|
|
165
|
+
const { popoverAnchorId, scrollIntoView } = state;
|
|
166
|
+
const { findFirstFocusable } = useFocusFinders();
|
|
159
167
|
const canResize = layoutMode === 'deck';
|
|
160
168
|
|
|
161
169
|
const attentionAttrs = useAttentionAttributes(primary?.id ?? id);
|
|
@@ -172,15 +180,22 @@ const PlankComponent = memo(
|
|
|
172
180
|
|
|
173
181
|
const handleSizeChange = useCallback(
|
|
174
182
|
debounce((nextSize: number) => {
|
|
175
|
-
return
|
|
183
|
+
return invokePromise(DeckOperation.UpdatePlankSize, { id: sizeKey, size: nextSize });
|
|
176
184
|
}, 200),
|
|
177
|
-
[
|
|
185
|
+
[invokePromise, sizeKey],
|
|
178
186
|
);
|
|
179
187
|
|
|
180
|
-
// TODO(thure): Tabster
|
|
188
|
+
// TODO(thure): Tabster's focus group should handle moving focus to Main, but something is blocking it.
|
|
181
189
|
const handleKeyDown = useCallback((event: KeyboardEvent) => {
|
|
182
|
-
if (event.target === event.currentTarget
|
|
183
|
-
|
|
190
|
+
if (event.target === event.currentTarget) {
|
|
191
|
+
switch (event.key) {
|
|
192
|
+
case 'Escape':
|
|
193
|
+
rootElement.current?.closest('main')?.focus();
|
|
194
|
+
break;
|
|
195
|
+
case 'Enter':
|
|
196
|
+
rootElement.current && findFirstFocusable(rootElement.current)?.focus();
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
184
199
|
}
|
|
185
200
|
}, []);
|
|
186
201
|
|
|
@@ -188,9 +203,9 @@ const PlankComponent = memo(
|
|
|
188
203
|
if (scrollIntoView === id) {
|
|
189
204
|
layoutMode === 'deck' && rootElement.current?.scrollIntoView({ behavior: 'smooth', inline: 'center' });
|
|
190
205
|
// Clear the scroll into view state once it has been actioned.
|
|
191
|
-
void
|
|
206
|
+
void invokePromise(LayoutOperation.ScrollIntoView, { subject: undefined });
|
|
192
207
|
}
|
|
193
|
-
}, [id, scrollIntoView, layoutMode]);
|
|
208
|
+
}, [id, scrollIntoView, layoutMode, invokePromise]);
|
|
194
209
|
|
|
195
210
|
const isSolo = layoutMode.startsWith('solo') && part === 'solo';
|
|
196
211
|
const isAttendable =
|
|
@@ -216,24 +231,27 @@ const PlankComponent = memo(
|
|
|
216
231
|
const placeholder = useMemo(() => <PlankLoading />, []);
|
|
217
232
|
|
|
218
233
|
const Root = part.startsWith('solo') ? 'article' : StackItem.Root;
|
|
234
|
+
const fullscreen = layoutMode === 'solo--fullscreen';
|
|
219
235
|
const className = mx(
|
|
220
|
-
'attention-surface relative dx-focus-ring-inset-over-all density-coarse',
|
|
221
|
-
isSolo && mainIntrinsicSize,
|
|
222
|
-
isSolo && railGridHorizontal,
|
|
236
|
+
'dx-attention-surface relative dx-focus-ring-inset-over-all dx-density-coarse',
|
|
223
237
|
isSolo && 'absolute inset-0',
|
|
238
|
+
isSolo && mainIntrinsicSize,
|
|
239
|
+
railGridHorizontal,
|
|
224
240
|
part.startsWith('solo') && 'grid',
|
|
225
|
-
part
|
|
226
|
-
|
|
227
|
-
part === '
|
|
241
|
+
part.startsWith('solo-') && 'grid-rows-subgrid row-span-2 min-w-0',
|
|
242
|
+
fullscreen && 'grid-rows-1',
|
|
243
|
+
part === 'deck' && (companioned === 'companion' ? 'border-separator! border-e' : 'border-separator! border-x'),
|
|
244
|
+
part === 'solo-companion' && 'border-separator! border-s',
|
|
228
245
|
settings?.encapsulatedPlanks &&
|
|
229
246
|
!part.startsWith('solo') &&
|
|
230
|
-
'
|
|
247
|
+
'mx-(--main-spacing) border-separator! border rounded-sm overflow-hidden',
|
|
231
248
|
);
|
|
232
249
|
|
|
233
250
|
return (
|
|
234
251
|
<Root
|
|
235
252
|
ref={rootElement}
|
|
236
253
|
data-testid='deck.plank'
|
|
254
|
+
data-popover-collision-boundary={true}
|
|
237
255
|
tabIndex={0}
|
|
238
256
|
{...(part.startsWith('solo')
|
|
239
257
|
? ({ ...sizeAttrs, className } as any)
|
|
@@ -250,32 +268,33 @@ const PlankComponent = memo(
|
|
|
250
268
|
>
|
|
251
269
|
{node ? (
|
|
252
270
|
<>
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
271
|
+
{!fullscreen && (
|
|
272
|
+
<PlankHeading
|
|
273
|
+
id={id}
|
|
274
|
+
part={part.startsWith('solo-') ? 'solo' : part}
|
|
275
|
+
node={node}
|
|
276
|
+
layoutMode={layoutMode}
|
|
277
|
+
deckEnabled={settings?.enableDeck}
|
|
278
|
+
canIncrementStart={canIncrementStart}
|
|
279
|
+
canIncrementEnd={canIncrementEnd}
|
|
280
|
+
popoverAnchorId={popoverAnchorId}
|
|
281
|
+
primaryId={primary?.id}
|
|
282
|
+
companioned={companioned}
|
|
283
|
+
companions={companions}
|
|
284
|
+
/>
|
|
285
|
+
)}
|
|
286
|
+
<Surface.Surface
|
|
267
287
|
key={node.id}
|
|
268
288
|
role='article'
|
|
269
289
|
data={data}
|
|
270
290
|
limit={1}
|
|
271
|
-
fallback={
|
|
291
|
+
fallback={PlankErrorFallback}
|
|
272
292
|
placeholder={placeholder}
|
|
273
293
|
/>
|
|
274
294
|
</>
|
|
275
295
|
) : (
|
|
276
296
|
<PlankError id={id} part={part} />
|
|
277
297
|
)}
|
|
278
|
-
|
|
279
298
|
{canResize && <StackItem.ResizeHandle />}
|
|
280
299
|
</Root>
|
|
281
300
|
);
|
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { forwardRef, useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import { invariant } from '@dxos/invariant';
|
|
7
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
9
8
|
import { ButtonGroup, type ButtonGroupProps, type ButtonProps, IconButton, useTranslation } from '@dxos/react-ui';
|
|
10
9
|
|
|
11
10
|
import { meta } from '../../meta';
|
|
12
|
-
import { DeckAction, type LayoutMode } from '../../types';
|
|
11
|
+
import { type DeckAction, DeckOperation, type LayoutMode } from '../../types';
|
|
13
12
|
|
|
14
13
|
export type PlankControlHandler = (event: DeckAction.PartAdjustment) => void;
|
|
15
14
|
|
|
@@ -32,10 +31,10 @@ export type PlankControlsProps = Omit<ButtonGroupProps, 'onClick'> & {
|
|
|
32
31
|
};
|
|
33
32
|
|
|
34
33
|
const PlankControl = ({ icon, label, ...props }: Omit<ButtonProps, 'children'> & { label: string; icon: string }) => {
|
|
35
|
-
return <IconButton
|
|
34
|
+
return <IconButton label={label} icon={icon} iconOnly variant='ghost' tooltipSide='bottom' {...props} />;
|
|
36
35
|
};
|
|
37
36
|
|
|
38
|
-
const plankControlSpacing = '
|
|
37
|
+
const plankControlSpacing = 'px-2';
|
|
39
38
|
|
|
40
39
|
type PlankComplimentControlsProps = {
|
|
41
40
|
primary?: string;
|
|
@@ -44,13 +43,12 @@ type PlankComplimentControlsProps = {
|
|
|
44
43
|
export const PlankCompanionControls = forwardRef<HTMLDivElement, PlankComplimentControlsProps>(
|
|
45
44
|
({ primary }, forwardedRef) => {
|
|
46
45
|
const { t } = useTranslation(meta.id);
|
|
47
|
-
const {
|
|
46
|
+
const { invokePromise } = useOperationInvoker();
|
|
48
47
|
const handleCloseCompanion = useCallback(() => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}, []);
|
|
48
|
+
return invokePromise(DeckOperation.ChangeCompanion, { companion: null });
|
|
49
|
+
}, [invokePromise]);
|
|
52
50
|
return (
|
|
53
|
-
<div ref={forwardedRef} className='contents app-no-drag'>
|
|
51
|
+
<div ref={forwardedRef} className='contents dx-app-no-drag'>
|
|
54
52
|
<PlankControl
|
|
55
53
|
label={t('close companion label')}
|
|
56
54
|
variant='ghost'
|
|
@@ -78,7 +76,7 @@ export const PlankControls = forwardRef<HTMLDivElement, PlankControlsProps>(
|
|
|
78
76
|
const layoutIsAnySolo = !!layoutMode?.startsWith('solo');
|
|
79
77
|
|
|
80
78
|
return (
|
|
81
|
-
<ButtonGroup {...props} classNames={['app-no-drag
|
|
79
|
+
<ButtonGroup {...props} classNames={['dx-app-no-drag opacity-100!', classNames]} ref={forwardedRef}>
|
|
82
80
|
{capabilities.deck ? (
|
|
83
81
|
<>
|
|
84
82
|
{capabilities.solo && (
|
|
@@ -5,26 +5,14 @@
|
|
|
5
5
|
import React, { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { type Node } from '@dxos/plugin-graph';
|
|
8
|
-
import { useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { descriptionMessage, mx } from '@dxos/
|
|
8
|
+
import { ErrorFallback, type ErrorFallbackProps, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { descriptionMessage, mx } from '@dxos/ui-theme';
|
|
10
10
|
|
|
11
11
|
import { meta } from '../../meta';
|
|
12
12
|
|
|
13
13
|
import { PlankHeading, type PlankHeadingProps } from './PlankHeading';
|
|
14
14
|
import { PlankLoading } from './PlankLoading';
|
|
15
15
|
|
|
16
|
-
export const PlankContentError = ({ error }: { error?: Error }) => {
|
|
17
|
-
const { t } = useTranslation(meta.id);
|
|
18
|
-
const errorString = error?.toString() ?? '';
|
|
19
|
-
return (
|
|
20
|
-
<div role='none' className='overflow-y-auto p-8 attention-surface grid place-items-center'>
|
|
21
|
-
<p role='alert' className={mx(descriptionMessage, 'break-all rounded-md p-4')}>
|
|
22
|
-
{error ? errorString : t('error fallback message')}
|
|
23
|
-
</p>
|
|
24
|
-
</div>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
16
|
export const PlankError = ({
|
|
29
17
|
id,
|
|
30
18
|
part,
|
|
@@ -33,17 +21,43 @@ export const PlankError = ({
|
|
|
33
21
|
}: {
|
|
34
22
|
id: string;
|
|
35
23
|
part: PlankHeadingProps['part'];
|
|
36
|
-
node?: Node;
|
|
24
|
+
node?: Node.Node;
|
|
37
25
|
error?: Error;
|
|
38
26
|
}) => {
|
|
39
27
|
const [timedOut, setTimedOut] = useState(false);
|
|
40
28
|
useEffect(() => {
|
|
41
|
-
setTimeout(() => setTimedOut(true),
|
|
29
|
+
const timer = setTimeout(() => setTimedOut(true), 5_000);
|
|
30
|
+
return () => clearTimeout(timer);
|
|
42
31
|
}, []);
|
|
32
|
+
|
|
43
33
|
return (
|
|
44
34
|
<>
|
|
45
35
|
<PlankHeading id={id} part={part} node={node} pending={!timedOut} />
|
|
46
|
-
{timedOut ? <
|
|
36
|
+
{timedOut ? <PlankErrorFallback error={error} /> : <PlankLoading />}
|
|
47
37
|
</>
|
|
48
38
|
);
|
|
49
39
|
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* User facing error fallback.
|
|
43
|
+
*/
|
|
44
|
+
export const PlankErrorFallback = ({ error }: ErrorFallbackProps) => {
|
|
45
|
+
const { t } = useTranslation(meta.id);
|
|
46
|
+
|
|
47
|
+
if (process.env.NODE_ENV === 'development') {
|
|
48
|
+
return <ErrorFallback title='Plank Error' error={error} />;
|
|
49
|
+
} else {
|
|
50
|
+
const errorString = error?.toString() ?? '';
|
|
51
|
+
return (
|
|
52
|
+
<div
|
|
53
|
+
role='alert'
|
|
54
|
+
data-testid='plank-content-error'
|
|
55
|
+
className='dx-attention-surface overflow-y-auto p-8 grid place-items-center'
|
|
56
|
+
>
|
|
57
|
+
<p className={mx(descriptionMessage, 'break-all rounded-md p-4')}>
|
|
58
|
+
{error ? errorString : t('error fallback message')}
|
|
59
|
+
</p>
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
@@ -4,17 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { Fragment, type MouseEvent, memo, useCallback, useEffect, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Surface, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
10
|
+
import { Graph, type Node, useActionRunner } from '@dxos/plugin-graph';
|
|
9
11
|
import { Icon, IconButton, Popover, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
10
12
|
import { StackItem, type StackItemSigilAction } from '@dxos/react-ui-stack';
|
|
11
13
|
import { TextTooltip } from '@dxos/react-ui-text-tooltip';
|
|
12
|
-
import { hoverableControls, hoverableFocusedWithinControls } from '@dxos/
|
|
14
|
+
import { hoverableControls, hoverableFocusedWithinControls } from '@dxos/ui-theme';
|
|
13
15
|
|
|
14
16
|
import { useBreakpoints } from '../../hooks';
|
|
15
17
|
import { parseEntryId } from '../../layout';
|
|
16
18
|
import { meta } from '../../meta';
|
|
17
|
-
import {
|
|
19
|
+
import { DeckOperation, type LayoutMode, PLANK_COMPANION_TYPE, type ResolvedPart } from '../../types';
|
|
18
20
|
import { soloInlinePadding } from '../fragments';
|
|
19
21
|
|
|
20
22
|
import { PlankCompanionControls, PlankControls } from './PlankControls';
|
|
@@ -25,7 +27,7 @@ export type PlankHeadingProps = {
|
|
|
25
27
|
id: string;
|
|
26
28
|
part: ResolvedPart;
|
|
27
29
|
layoutMode?: LayoutMode;
|
|
28
|
-
node?: Node;
|
|
30
|
+
node?: Node.Node;
|
|
29
31
|
deckEnabled?: boolean;
|
|
30
32
|
canIncrementStart?: boolean;
|
|
31
33
|
canIncrementEnd?: boolean;
|
|
@@ -33,7 +35,7 @@ export type PlankHeadingProps = {
|
|
|
33
35
|
primaryId?: string;
|
|
34
36
|
pending?: boolean;
|
|
35
37
|
companioned?: 'primary' | 'companion';
|
|
36
|
-
companions?: Node[];
|
|
38
|
+
companions?: Node.Node[];
|
|
37
39
|
actions?: StackItemSigilAction[];
|
|
38
40
|
};
|
|
39
41
|
|
|
@@ -54,7 +56,8 @@ export const PlankHeading = memo(
|
|
|
54
56
|
actions = [],
|
|
55
57
|
}: PlankHeadingProps) => {
|
|
56
58
|
const { t } = useTranslation(meta.id);
|
|
57
|
-
const {
|
|
59
|
+
const { invokePromise, invokeSync } = useOperationInvoker();
|
|
60
|
+
const runAction = useActionRunner();
|
|
58
61
|
const { graph } = useAppGraph();
|
|
59
62
|
const breakpoint = useBreakpoints();
|
|
60
63
|
const icon = node?.properties?.icon ?? 'ph--placeholder--regular';
|
|
@@ -68,7 +71,7 @@ export const PlankHeading = memo(
|
|
|
68
71
|
const frame = requestAnimationFrame(() => {
|
|
69
72
|
// Load actions for the node.
|
|
70
73
|
if (node) {
|
|
71
|
-
void
|
|
74
|
+
void Graph.expand(graph, node.id, 'child');
|
|
72
75
|
}
|
|
73
76
|
});
|
|
74
77
|
|
|
@@ -97,42 +100,37 @@ export const PlankHeading = memo(
|
|
|
97
100
|
} else {
|
|
98
101
|
return [
|
|
99
102
|
actions,
|
|
100
|
-
graph
|
|
101
|
-
.
|
|
102
|
-
|
|
103
|
+
Graph.getActions(graph, node.id).filter((a) =>
|
|
104
|
+
['list-item', 'list-item-primary', 'heading-list-item'].includes(a.properties.disposition),
|
|
105
|
+
),
|
|
103
106
|
].filter((a) => a.length > 0);
|
|
104
107
|
}
|
|
105
108
|
}, [actions, node, variant, graph]);
|
|
106
109
|
|
|
107
110
|
const handleAction = useCallback(
|
|
108
111
|
(action: StackItemSigilAction) => {
|
|
109
|
-
typeof action.data === 'function'
|
|
112
|
+
if (typeof action.data === 'function') {
|
|
113
|
+
void runAction(action as Node.Action, { parent: node, caller: meta.id });
|
|
114
|
+
}
|
|
110
115
|
},
|
|
111
|
-
[node],
|
|
116
|
+
[node, runAction],
|
|
112
117
|
);
|
|
113
118
|
|
|
114
119
|
const handlePlankAction = useCallback(
|
|
115
|
-
(eventType:
|
|
120
|
+
(eventType: DeckOperation.PartAdjustment) => {
|
|
116
121
|
if (eventType.startsWith('solo')) {
|
|
117
|
-
return
|
|
122
|
+
return invokePromise(DeckOperation.Adjust, { type: eventType, id });
|
|
118
123
|
} else if (eventType === 'close') {
|
|
119
124
|
if (part === 'complementary') {
|
|
120
|
-
return
|
|
121
|
-
createIntent(LayoutAction.UpdateComplementary, {
|
|
122
|
-
part: 'complementary',
|
|
123
|
-
options: { state: 'collapsed' },
|
|
124
|
-
}),
|
|
125
|
-
);
|
|
125
|
+
return invokeSync(LayoutOperation.UpdateComplementary, { state: 'collapsed' });
|
|
126
126
|
} else {
|
|
127
|
-
return
|
|
128
|
-
createIntent(LayoutAction.Close, { part: 'main', subject: [id], options: { state: false } }),
|
|
129
|
-
);
|
|
127
|
+
return invokeSync(LayoutOperation.Close, { subject: [id] });
|
|
130
128
|
}
|
|
131
129
|
} else {
|
|
132
|
-
return
|
|
130
|
+
return invokePromise(DeckOperation.Adjust, { type: eventType, id });
|
|
133
131
|
}
|
|
134
132
|
},
|
|
135
|
-
[
|
|
133
|
+
[invokePromise, invokeSync, id, part],
|
|
136
134
|
);
|
|
137
135
|
|
|
138
136
|
const ActionRoot = node && popoverAnchorId === `dxos.org/ui/${meta.id}/${node.id}` ? Popover.Anchor : Fragment;
|
|
@@ -141,28 +139,24 @@ export const PlankHeading = memo(
|
|
|
141
139
|
(event: MouseEvent) => {
|
|
142
140
|
const target = (event.target as HTMLElement).closest('[data-id]') as HTMLElement | null;
|
|
143
141
|
const tabId = target?.dataset?.id;
|
|
144
|
-
if (
|
|
145
|
-
void
|
|
146
|
-
createIntent(DeckAction.ChangeCompanion, {
|
|
147
|
-
primary: primaryId,
|
|
148
|
-
companion: tabId,
|
|
149
|
-
}),
|
|
150
|
-
);
|
|
142
|
+
if (tabId) {
|
|
143
|
+
void invokePromise(DeckOperation.ChangeCompanion, { companion: tabId });
|
|
151
144
|
}
|
|
152
145
|
},
|
|
153
|
-
[
|
|
146
|
+
[invokePromise],
|
|
154
147
|
);
|
|
155
148
|
|
|
156
149
|
return (
|
|
157
150
|
<StackItem.Heading
|
|
158
151
|
classNames={[
|
|
159
|
-
'
|
|
160
|
-
part === 'solo' ? soloInlinePadding : '
|
|
152
|
+
'py-1 items-stretch gap-1 sticky left-12 dx-app-drag min-w-0 dx-contain-layout dx-density-coarse',
|
|
153
|
+
part === 'solo' ? soloInlinePadding : 'px-1',
|
|
161
154
|
...(layoutMode === 'solo--fullscreen'
|
|
162
155
|
? [
|
|
163
156
|
hoverableControls,
|
|
164
157
|
hoverableFocusedWithinControls,
|
|
165
|
-
'*:transition-opacity *:opacity-
|
|
158
|
+
'*:transition-opacity *:opacity-(--controls-opacity) bg-transparent border-transparent transition-[background-color,border-color]',
|
|
159
|
+
'hover-hover:hover:bg-header-surface focus-within:bg-header-surface hover-hover:hover:border-subdued-separator focus-within:border-subdued-separator',
|
|
166
160
|
]
|
|
167
161
|
: []),
|
|
168
162
|
]}
|
|
@@ -170,7 +164,7 @@ export const PlankHeading = memo(
|
|
|
170
164
|
>
|
|
171
165
|
{companions && isCompanionNode ? (
|
|
172
166
|
/* TODO(thure): IMPORTANT: This is a tablist; it should be implemented as such. */
|
|
173
|
-
<div role='none' className='flex-1 min-
|
|
167
|
+
<div role='none' className='flex-1 min-w-0 overflow-x-auto scrollbar-none flex gap-1'>
|
|
174
168
|
{companions.map(({ id, properties: { icon, label } }) => (
|
|
175
169
|
<IconButton
|
|
176
170
|
key={id}
|
|
@@ -178,7 +172,6 @@ export const PlankHeading = memo(
|
|
|
178
172
|
icon={icon}
|
|
179
173
|
iconOnly={companions.length > MAX_COMPANIONS && node?.id !== id}
|
|
180
174
|
label={toLocalizedString(label, t)}
|
|
181
|
-
size={5}
|
|
182
175
|
variant={node?.id === id ? 'primary' : 'ghost'}
|
|
183
176
|
onClick={handleTabClick}
|
|
184
177
|
/>
|
|
@@ -196,12 +189,12 @@ export const PlankHeading = memo(
|
|
|
196
189
|
actions={sigilActions}
|
|
197
190
|
onAction={handleAction}
|
|
198
191
|
>
|
|
199
|
-
<Surface role='menu-footer' data={{ subject: node.data }} />
|
|
192
|
+
<Surface.Surface role='menu-footer' data={{ subject: node.data }} />
|
|
200
193
|
</StackItem.Sigil>
|
|
201
194
|
) : (
|
|
202
195
|
<StackItem.SigilButton>
|
|
203
196
|
<span className='sr-only'>{label}</span>
|
|
204
|
-
<Icon icon={icon}
|
|
197
|
+
<Icon icon={icon} />
|
|
205
198
|
</StackItem.SigilButton>
|
|
206
199
|
)}
|
|
207
200
|
</ActionRoot>
|
|
@@ -216,7 +209,7 @@ export const PlankHeading = memo(
|
|
|
216
209
|
</TextTooltip>
|
|
217
210
|
</>
|
|
218
211
|
)}
|
|
219
|
-
{node && part !== 'complementary' && <Surface role='navbar-end' data={{ subject: node.data }} />}
|
|
212
|
+
{node && part !== 'complementary' && <Surface.Surface role='navbar-end' data={{ subject: node.data }} />}
|
|
220
213
|
{companioned === 'companion' ? (
|
|
221
214
|
<PlankCompanionControls primary={primaryId} />
|
|
222
215
|
) : (
|
|
@@ -6,5 +6,5 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
// TODO(burdon): Show skeleton: https://github.com/dxos/dxos/issues/8259
|
|
8
8
|
export const PlankLoading = () => {
|
|
9
|
-
return <div role='none' className='grid place-items-center attention-surface' />;
|
|
9
|
+
return <div role='none' className='grid place-items-center dx-attention-surface' />;
|
|
10
10
|
};
|