@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,26 +2,17 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { untracked } from '@preact/signals-core';
|
|
6
5
|
import React, { Fragment, type UIEvent, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
7
6
|
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
LayoutAction,
|
|
11
|
-
createIntent,
|
|
12
|
-
useCapability,
|
|
13
|
-
useIntentDispatcher,
|
|
14
|
-
usePluginManager,
|
|
15
|
-
} from '@dxos/app-framework';
|
|
7
|
+
import { useAtomCapability, useOperationInvoker, usePluginManager } from '@dxos/app-framework/ui';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
16
9
|
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
17
|
-
import { Main, type
|
|
10
|
+
import { Main, type MainContentProps, useMediaQuery, useOnTransition } from '@dxos/react-ui';
|
|
18
11
|
import { DEFAULT_HORIZONTAL_SIZE, Stack, StackContext } from '@dxos/react-ui-stack';
|
|
19
|
-
import { mainPaddingTransitions, mx } from '@dxos/
|
|
12
|
+
import { mainPaddingTransitions, mx } from '@dxos/ui-theme';
|
|
20
13
|
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { meta } from '../../meta';
|
|
24
|
-
import { type DeckSettingsProps, getMode } from '../../types';
|
|
14
|
+
import { useBreakpoints, useDeckState, useHoistStatusbar } from '../../hooks';
|
|
15
|
+
import { DeckCapabilities, getMode } from '../../types';
|
|
25
16
|
import { calculateOverscroll, layoutAppliesTopbar } from '../../util';
|
|
26
17
|
import { fixedComplementarySidebarToggleStyles, fixedSidebarToggleStyles } from '../fragments';
|
|
27
18
|
import { Plank } from '../Plank';
|
|
@@ -32,11 +23,12 @@ import { StatusBar } from './StatusBar';
|
|
|
32
23
|
import { Topbar } from './Topbar';
|
|
33
24
|
|
|
34
25
|
export const DeckMain = () => {
|
|
35
|
-
const {
|
|
36
|
-
const settings =
|
|
37
|
-
const
|
|
38
|
-
const { sidebarState, complementarySidebarState, complementarySidebarPanel
|
|
39
|
-
const { active,
|
|
26
|
+
const { invokeSync } = useOperationInvoker();
|
|
27
|
+
const settings = useAtomCapability(DeckCapabilities.Settings);
|
|
28
|
+
const { state, deck, updateState } = useDeckState();
|
|
29
|
+
const { sidebarState, complementarySidebarState, complementarySidebarPanel } = state;
|
|
30
|
+
const { active, companionOpen, companionVariant, fullscreen, solo, plankSizing } = deck;
|
|
31
|
+
const effectiveCompanionVariant = companionOpen ? companionVariant : undefined;
|
|
40
32
|
const layoutMode = getMode(deck);
|
|
41
33
|
const breakpoint = useBreakpoints();
|
|
42
34
|
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
@@ -49,10 +41,8 @@ export const DeckMain = () => {
|
|
|
49
41
|
// Ensure the first plank is attended when the deck is first rendered.
|
|
50
42
|
useEffect(() => {
|
|
51
43
|
// NOTE: Not `useAttended` so that the layout component is not re-rendered when the attended list changes.
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
return attention.current;
|
|
55
|
-
});
|
|
44
|
+
const attention = pluginManager.capabilities.get(AttentionCapabilities.Attention);
|
|
45
|
+
const attended = attention.getCurrent();
|
|
56
46
|
const firstId = solo ?? active[0];
|
|
57
47
|
if (attended.length === 0 && firstId) {
|
|
58
48
|
// TODO(wittjosiah): Focusing the type button is a workaround.
|
|
@@ -66,31 +56,26 @@ export const DeckMain = () => {
|
|
|
66
56
|
const [isNotMobile] = useMediaQuery('md');
|
|
67
57
|
const shouldRevert = useRef(false);
|
|
68
58
|
useEffect(() => {
|
|
69
|
-
if (!isNotMobile &&
|
|
59
|
+
if (!isNotMobile && layoutMode === 'deck') {
|
|
70
60
|
// NOTE: Not `useAttended` so that the layout component is not re-rendered when the attended list changes.
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
return attention.current;
|
|
74
|
-
});
|
|
61
|
+
const attention = pluginManager.capabilities.get(AttentionCapabilities.Attention);
|
|
62
|
+
const attended = attention.getCurrent();
|
|
75
63
|
|
|
76
64
|
shouldRevert.current = true;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
);
|
|
80
|
-
} else if (isNotMobile && getMode(deck) === 'solo' && shouldRevert.current) {
|
|
81
|
-
void dispatch(createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { revert: true } }));
|
|
65
|
+
invokeSync(LayoutOperation.SetLayoutMode, { subject: attended[0], mode: 'solo' });
|
|
66
|
+
} else if (isNotMobile && layoutMode === 'solo' && shouldRevert.current) {
|
|
67
|
+
invokeSync(LayoutOperation.SetLayoutMode, { revert: true });
|
|
82
68
|
}
|
|
83
|
-
|
|
69
|
+
// NOTE: Using `layoutMode` instead of `deck` to avoid infinite loops caused by object reference changes.
|
|
70
|
+
}, [isNotMobile, layoutMode, invokeSync]);
|
|
84
71
|
|
|
85
72
|
// When deck is disabled in settings, set to solo mode if the current layout mode is deck.
|
|
86
|
-
// TODO(thure): Applying this as an effect should be avoided over emitting the
|
|
73
|
+
// TODO(thure): Applying this as an effect should be avoided over emitting the operation only when the setting changes.
|
|
87
74
|
useEffect(() => {
|
|
88
|
-
if (settings?.enableDeck && layoutMode === 'deck') {
|
|
89
|
-
|
|
90
|
-
createIntent(LayoutAction.SetLayoutMode, { part: 'mode', subject: active[0], options: { mode: 'solo' } }),
|
|
91
|
-
);
|
|
75
|
+
if (!settings?.enableDeck && layoutMode === 'deck') {
|
|
76
|
+
invokeSync(LayoutOperation.SetLayoutMode, { subject: active[0], mode: 'solo' });
|
|
92
77
|
}
|
|
93
|
-
}, [settings?.enableDeck,
|
|
78
|
+
}, [settings?.enableDeck, invokeSync, active, layoutMode]);
|
|
94
79
|
|
|
95
80
|
/**
|
|
96
81
|
* Clear scroll restoration state if the window is resized.
|
|
@@ -134,9 +119,9 @@ export const DeckMain = () => {
|
|
|
134
119
|
|
|
135
120
|
const mainPosition = useMemo(
|
|
136
121
|
() => [
|
|
137
|
-
'grid !
|
|
138
|
-
topbar && '!
|
|
139
|
-
hoistStatusbar && 'lg:
|
|
122
|
+
'grid !top-[env(safe-area-inset-top)]',
|
|
123
|
+
topbar && '!top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]',
|
|
124
|
+
hoistStatusbar && 'lg:bottom-(--dx-statusbar-size)',
|
|
140
125
|
],
|
|
141
126
|
[topbar, hoistStatusbar],
|
|
142
127
|
);
|
|
@@ -145,19 +130,33 @@ export const DeckMain = () => {
|
|
|
145
130
|
return active.reduce(
|
|
146
131
|
(acc: { order: Record<string, number>; itemsCount: number }, entryId) => {
|
|
147
132
|
acc.order[entryId] = acc.itemsCount + 1;
|
|
148
|
-
acc.itemsCount +=
|
|
133
|
+
acc.itemsCount += companionOpen ? 3 : 2;
|
|
149
134
|
return acc;
|
|
150
135
|
},
|
|
151
136
|
{ order: {}, itemsCount: 0 },
|
|
152
137
|
);
|
|
153
|
-
}, [active,
|
|
138
|
+
}, [active, companionOpen]);
|
|
139
|
+
|
|
140
|
+
const handleNavigationSidebarStateChange = useCallback(
|
|
141
|
+
(next: typeof sidebarState) => {
|
|
142
|
+
updateState((s) => ({ ...s, sidebarState: next }));
|
|
143
|
+
},
|
|
144
|
+
[updateState],
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
const handleComplementarySidebarStateChange = useCallback(
|
|
148
|
+
(next: typeof complementarySidebarState) => {
|
|
149
|
+
updateState((s) => ({ ...s, complementarySidebarState: next }));
|
|
150
|
+
},
|
|
151
|
+
[updateState],
|
|
152
|
+
);
|
|
154
153
|
|
|
155
154
|
return (
|
|
156
155
|
<Main.Root
|
|
157
|
-
navigationSidebarState={fullscreen ? 'closed' :
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
onComplementarySidebarStateChange={
|
|
156
|
+
navigationSidebarState={fullscreen ? 'closed' : sidebarState}
|
|
157
|
+
complementarySidebarState={fullscreen ? 'closed' : complementarySidebarState}
|
|
158
|
+
onNavigationSidebarStateChange={handleNavigationSidebarStateChange}
|
|
159
|
+
onComplementarySidebarStateChange={handleComplementarySidebarStateChange}
|
|
161
160
|
>
|
|
162
161
|
{/* Left sidebar. */}
|
|
163
162
|
<Sidebar />
|
|
@@ -184,26 +183,27 @@ export const DeckMain = () => {
|
|
|
184
183
|
style={
|
|
185
184
|
{
|
|
186
185
|
'--main-spacing': settings?.encapsulatedPlanks ? '0.75rem' : '0',
|
|
187
|
-
'--dx-main-
|
|
186
|
+
'--dx-main-sidebar-width':
|
|
188
187
|
sidebarState === 'expanded'
|
|
189
|
-
? 'var(--nav-sidebar-size)'
|
|
188
|
+
? 'var(--dx-nav-sidebar-size)'
|
|
190
189
|
: sidebarState === 'collapsed'
|
|
191
|
-
? 'var(--l0-size)'
|
|
190
|
+
? 'var(--dx-l0-size)'
|
|
192
191
|
: '0',
|
|
193
|
-
'--dx-main-
|
|
192
|
+
'--dx-main-complementary-width':
|
|
194
193
|
complementarySidebarState === 'expanded'
|
|
195
|
-
? 'var(--complementary-sidebar-size)'
|
|
194
|
+
? 'var(--dx-complementary-sidebar-size)'
|
|
196
195
|
: complementarySidebarState === 'collapsed'
|
|
197
|
-
? 'var(--rail-size)'
|
|
196
|
+
? 'var(--dx-rail-size)'
|
|
198
197
|
: '0',
|
|
199
|
-
'--dx-main-
|
|
200
|
-
'--dx-main-
|
|
201
|
-
} as
|
|
198
|
+
'--dx-main-content-first-width': `${plankSizing[active[0] ?? 'never'] ?? DEFAULT_HORIZONTAL_SIZE}rem`,
|
|
199
|
+
'--dx-main-content-last-width': `${plankSizing[active[(active.length ?? 1) - 1] ?? 'never'] ?? DEFAULT_HORIZONTAL_SIZE}rem`,
|
|
200
|
+
} as MainContentProps['style']
|
|
202
201
|
}
|
|
203
202
|
>
|
|
203
|
+
{/* Deck mode. */}
|
|
204
204
|
<div
|
|
205
205
|
role='none'
|
|
206
|
-
className={!solo ? 'relative bg-
|
|
206
|
+
className={!solo ? 'relative bg-deck-surface overflow-hidden' : 'sr-only'}
|
|
207
207
|
{...(solo && { inert: true })}
|
|
208
208
|
>
|
|
209
209
|
{!topbar && !fullscreen && <ToggleSidebarButton classNames={fixedSidebarToggleStyles} />}
|
|
@@ -216,7 +216,7 @@ export const DeckMain = () => {
|
|
|
216
216
|
size='contain'
|
|
217
217
|
itemsCount={itemsCount - 1}
|
|
218
218
|
classNames={[
|
|
219
|
-
'absolute inset-
|
|
219
|
+
'absolute inset-y-(--main-spacing) -inset-w-px h-[calc(100%-2*var(--main-spacing))]',
|
|
220
220
|
mainPaddingTransitions,
|
|
221
221
|
]}
|
|
222
222
|
style={padding}
|
|
@@ -227,7 +227,7 @@ export const DeckMain = () => {
|
|
|
227
227
|
<PlankSeparator order={order[entryId] - 1} encapsulate={!!settings?.enableDeck} />
|
|
228
228
|
<Plank
|
|
229
229
|
id={entryId}
|
|
230
|
-
|
|
230
|
+
companionVariant={effectiveCompanionVariant}
|
|
231
231
|
part='deck'
|
|
232
232
|
order={order[entryId]}
|
|
233
233
|
active={active}
|
|
@@ -238,9 +238,11 @@ export const DeckMain = () => {
|
|
|
238
238
|
))}
|
|
239
239
|
</Stack>
|
|
240
240
|
</div>
|
|
241
|
+
|
|
242
|
+
{/* Solo mode. */}
|
|
241
243
|
<div
|
|
242
244
|
role='none'
|
|
243
|
-
className={solo ? 'relative overflow-hidden bg-
|
|
245
|
+
className={solo ? 'relative overflow-hidden bg-deck-surface' : 'sr-only'}
|
|
244
246
|
{...(!solo && { inert: true })}
|
|
245
247
|
>
|
|
246
248
|
{!topbar && !fullscreen && <ToggleSidebarButton classNames={fixedSidebarToggleStyles} />}
|
|
@@ -256,7 +258,7 @@ export const DeckMain = () => {
|
|
|
256
258
|
>
|
|
257
259
|
<Plank
|
|
258
260
|
id={solo}
|
|
259
|
-
|
|
261
|
+
companionVariant={effectiveCompanionVariant}
|
|
260
262
|
part='solo'
|
|
261
263
|
layoutMode={layoutMode}
|
|
262
264
|
settings={settings}
|
|
@@ -279,7 +281,7 @@ const PlankSeparator = ({ order, encapsulate }: { order: number; encapsulate?: b
|
|
|
279
281
|
order > 0 ? (
|
|
280
282
|
<span
|
|
281
283
|
role='separator'
|
|
282
|
-
className={mx('row-span-2 bg-
|
|
284
|
+
className={mx('row-span-2 bg-deck-surface', encapsulate ? 'w-0' : 'w-4')}
|
|
283
285
|
style={{ gridColumn: order }}
|
|
284
286
|
/>
|
|
285
287
|
) : null;
|
|
@@ -2,33 +2,42 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface
|
|
7
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
8
8
|
import { AlertDialog, Dialog as NaturalDialog } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { useDeckState } from '../../hooks';
|
|
11
|
+
import { PlankErrorFallback } from '../Plank';
|
|
12
12
|
|
|
13
13
|
export const Dialog = () => {
|
|
14
|
-
const
|
|
15
|
-
const { dialogOpen, dialogType, dialogBlockAlign, dialogOverlayClasses, dialogOverlayStyle, dialogContent } =
|
|
14
|
+
const { state, updateEphemeral } = useDeckState();
|
|
15
|
+
const { dialogOpen, dialogType, dialogBlockAlign, dialogOverlayClasses, dialogOverlayStyle, dialogContent } = state;
|
|
16
16
|
const Root = dialogType === 'alert' ? AlertDialog.Root : NaturalDialog.Root;
|
|
17
17
|
const Overlay = dialogType === 'alert' ? AlertDialog.Overlay : NaturalDialog.Overlay;
|
|
18
18
|
|
|
19
|
+
const handleOpenChange = useCallback(
|
|
20
|
+
(nextOpen: boolean) => {
|
|
21
|
+
updateEphemeral((s) => ({ ...s, dialogOpen: nextOpen }));
|
|
22
|
+
},
|
|
23
|
+
[updateEphemeral],
|
|
24
|
+
);
|
|
25
|
+
|
|
19
26
|
// TODO(thure): End block alignment affecting `modal` and whether the surface renders in an overlay is tailored to the needs of the ambient chat dialog. As the feature matures, consider separating concerns.
|
|
20
27
|
return (
|
|
21
|
-
<Root
|
|
22
|
-
modal={dialogBlockAlign !== 'end'}
|
|
23
|
-
open={dialogOpen}
|
|
24
|
-
onOpenChange={(nextOpen) => (context.dialogOpen = nextOpen)}
|
|
25
|
-
>
|
|
28
|
+
<Root modal={dialogBlockAlign !== 'end'} open={dialogOpen} onOpenChange={handleOpenChange}>
|
|
26
29
|
{dialogBlockAlign === 'end' ? (
|
|
27
30
|
// TODO(burdon): Placeholder creates a suspense boundary; replace with defaults.
|
|
28
|
-
<Surface
|
|
31
|
+
<Surface.Surface
|
|
32
|
+
role='dialog'
|
|
33
|
+
data={dialogContent}
|
|
34
|
+
limit={1}
|
|
35
|
+
fallback={PlankErrorFallback}
|
|
36
|
+
placeholder={<div />}
|
|
37
|
+
/>
|
|
29
38
|
) : (
|
|
30
39
|
<Overlay blockAlign={dialogBlockAlign} classNames={dialogOverlayClasses} style={dialogOverlayStyle}>
|
|
31
|
-
<Surface role='dialog' data={dialogContent} limit={1} fallback={
|
|
40
|
+
<Surface.Surface role='dialog' data={dialogContent} limit={1} fallback={PlankErrorFallback} />
|
|
32
41
|
</Overlay>
|
|
33
42
|
)}
|
|
34
43
|
</Root>
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { errorText, mx } from '@dxos/react-ui-theme';
|
|
9
8
|
|
|
10
9
|
import { meta } from '../../meta';
|
|
11
10
|
|
|
@@ -13,13 +12,10 @@ export const Fallback = () => {
|
|
|
13
12
|
const { t } = useTranslation(meta.id);
|
|
14
13
|
|
|
15
14
|
return (
|
|
16
|
-
<div role='none' className='min-
|
|
15
|
+
<div role='none' className='min-h-screen w-full flex items-center justify-center p-8'>
|
|
17
16
|
<p
|
|
18
17
|
role='alert'
|
|
19
|
-
className=
|
|
20
|
-
errorText,
|
|
21
|
-
'border border-error-400/50 rounded-md flex items-center justify-center p-8 font-normal text-lg',
|
|
22
|
-
)}
|
|
18
|
+
className='flex items-center justify-center p-8 font-normal text-lg text-error-text border border-rose-fill rounded-md'
|
|
23
19
|
>
|
|
24
20
|
{t('plugin error message')}
|
|
25
21
|
</p>
|
|
@@ -3,12 +3,16 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { createContext } from '@radix-ui/react-context';
|
|
6
|
-
import React, { type PropsWithChildren, useCallback, useEffect,
|
|
6
|
+
import React, { type PropsWithChildren, useCallback, useEffect, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { Surface,
|
|
9
|
-
import {
|
|
8
|
+
import { Surface, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
9
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
10
|
+
import { useObjectNavigate } from '@dxos/app-toolkit/ui';
|
|
11
|
+
import { Popover, type PopoverContentInteractOutsideEvent, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
12
|
+
import { Card } from '@dxos/react-ui';
|
|
10
13
|
|
|
11
|
-
import {
|
|
14
|
+
import { useDeckState } from '../../hooks';
|
|
15
|
+
import { meta } from '../../meta';
|
|
12
16
|
|
|
13
17
|
export type DeckPopoverRootProps = PropsWithChildren<{}>;
|
|
14
18
|
|
|
@@ -21,43 +25,61 @@ type DeckPopoverContextValue = {
|
|
|
21
25
|
const [DeckPopoverProvider, useDeckPopoverContext] = createContext<DeckPopoverContextValue>('DeckPopover');
|
|
22
26
|
|
|
23
27
|
export const PopoverRoot = ({ children }: DeckPopoverRootProps) => {
|
|
24
|
-
const
|
|
28
|
+
const { state } = useDeckState();
|
|
25
29
|
const virtualRef = useRef<HTMLButtonElement | null>(null);
|
|
26
30
|
const [virtualIter, setVirtualIter] = useState(0);
|
|
27
31
|
const [open, setOpen] = useState(false);
|
|
28
32
|
const debounceRef = useRef<NodeJS.Timeout | null>(null);
|
|
29
33
|
|
|
30
34
|
// TODO(thure): This is a workaround for the race condition between displaying a Popover and either rendering
|
|
31
|
-
// the anchor further down the tree or measuring the virtual trigger
|
|
35
|
+
// the anchor further down the tree or measuring the virtual trigger's client rect.
|
|
32
36
|
useEffect(() => {
|
|
33
37
|
setOpen(false);
|
|
34
|
-
if (
|
|
38
|
+
if (state.popoverOpen) {
|
|
35
39
|
if (debounceRef.current) {
|
|
36
40
|
clearTimeout(debounceRef.current);
|
|
37
41
|
}
|
|
38
|
-
if (
|
|
39
|
-
virtualRef.current =
|
|
42
|
+
if (state.popoverAnchor && virtualRef.current !== state.popoverAnchor) {
|
|
43
|
+
virtualRef.current = state.popoverAnchor ?? null;
|
|
40
44
|
setVirtualIter((iter) => iter + 1);
|
|
41
45
|
}
|
|
42
46
|
debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);
|
|
43
47
|
}
|
|
44
|
-
}, [
|
|
48
|
+
}, [state.popoverOpen, state.popoverAnchorId, state.popoverAnchor, state.popoverContent]);
|
|
45
49
|
|
|
46
50
|
return (
|
|
47
51
|
<DeckPopoverProvider setOpen={setOpen}>
|
|
48
52
|
<Popover.Root modal={false} open={open}>
|
|
49
|
-
{
|
|
53
|
+
{state.popoverAnchor && <Popover.VirtualTrigger key={virtualIter} virtualRef={virtualRef} />}
|
|
50
54
|
{children}
|
|
51
55
|
</Popover.Root>
|
|
52
56
|
</DeckPopoverProvider>
|
|
53
57
|
);
|
|
54
58
|
};
|
|
55
59
|
|
|
60
|
+
// Extracts the subject from popover content if it has one, otherwise returns the content as-is.
|
|
61
|
+
const getPopoverSubject = (content: unknown): unknown =>
|
|
62
|
+
content && typeof content === 'object' && 'subject' in content ? (content as { subject: unknown }).subject : content;
|
|
63
|
+
|
|
56
64
|
export const PopoverContent = () => {
|
|
57
|
-
const
|
|
65
|
+
const { t } = useTranslation(meta.id);
|
|
66
|
+
const { state, updateEphemeral } = useDeckState();
|
|
58
67
|
const { setOpen } = useDeckPopoverContext('PopoverContent');
|
|
68
|
+
const { invokeSync } = useOperationInvoker();
|
|
69
|
+
const handleNavigate = useObjectNavigate(getPopoverSubject(state.popoverContent));
|
|
70
|
+
|
|
71
|
+
const handleClose = useCallback(() => {
|
|
72
|
+
setOpen(false);
|
|
73
|
+
updateEphemeral((state) => ({
|
|
74
|
+
...state,
|
|
75
|
+
popoverOpen: false,
|
|
76
|
+
popoverAnchor: undefined,
|
|
77
|
+
popoverAnchorId: undefined,
|
|
78
|
+
popoverSide: undefined,
|
|
79
|
+
}));
|
|
80
|
+
}, [updateEphemeral]);
|
|
59
81
|
|
|
60
|
-
const
|
|
82
|
+
const handleInteractOutside = useCallback(
|
|
61
83
|
(event: KeyboardEvent | PopoverContentInteractOutsideEvent) => {
|
|
62
84
|
if (
|
|
63
85
|
// TODO(thure): CodeMirror should not focus itself when it updates.
|
|
@@ -66,36 +88,52 @@ export const PopoverContent = () => {
|
|
|
66
88
|
) {
|
|
67
89
|
event.preventDefault();
|
|
68
90
|
} else {
|
|
69
|
-
|
|
70
|
-
layout.popoverOpen = false;
|
|
71
|
-
layout.popoverAnchor = undefined;
|
|
72
|
-
layout.popoverAnchorId = undefined;
|
|
73
|
-
layout.popoverSide = undefined;
|
|
91
|
+
handleClose();
|
|
74
92
|
}
|
|
75
93
|
},
|
|
76
|
-
[
|
|
94
|
+
[handleClose],
|
|
77
95
|
);
|
|
78
96
|
|
|
79
|
-
const collisionBoundaries: HTMLElement[] = useMemo(() => {
|
|
80
|
-
const closest = layout.popoverAnchor?.closest('[data-popover-collision-boundary]') as
|
|
81
|
-
| HTMLElement
|
|
82
|
-
| null
|
|
83
|
-
| undefined;
|
|
84
|
-
return closest ? [closest] : [];
|
|
85
|
-
}, [layout.popoverAnchor]);
|
|
86
|
-
|
|
87
97
|
return (
|
|
88
98
|
<Popover.Portal>
|
|
89
99
|
<Popover.Content
|
|
90
|
-
side={
|
|
91
|
-
onInteractOutside={handleClose}
|
|
92
|
-
onEscapeKeyDown={handleClose}
|
|
93
|
-
collisionBoundary={collisionBoundaries}
|
|
100
|
+
side={state.popoverSide}
|
|
94
101
|
sticky='always'
|
|
95
102
|
hideWhenDetached
|
|
103
|
+
onInteractOutside={handleInteractOutside}
|
|
104
|
+
onEscapeKeyDown={handleInteractOutside}
|
|
96
105
|
>
|
|
97
106
|
<Popover.Viewport>
|
|
98
|
-
|
|
107
|
+
{/* TODO(burdon): Set/disable column context. */}
|
|
108
|
+
{state.popoverKind === 'base' && <Surface.Surface role='popover' data={state.popoverContent} limit={1} />}
|
|
109
|
+
{state.popoverKind === 'card' && (
|
|
110
|
+
<Card.Root border={false} classNames='dx-card-popover'>
|
|
111
|
+
<Card.Toolbar>
|
|
112
|
+
{/* TODO(wittjosiah): Cleaner way to handle no drag handle in toolbar? */}
|
|
113
|
+
{state.popoverContentRef ? (
|
|
114
|
+
<Card.ToolbarIconButton
|
|
115
|
+
icon='ph--arrow-square-out--regular'
|
|
116
|
+
iconOnly
|
|
117
|
+
label={t('open item label')}
|
|
118
|
+
onClick={() => {
|
|
119
|
+
invokeSync(LayoutOperation.Open, {
|
|
120
|
+
subject: [state.popoverContentRef!],
|
|
121
|
+
});
|
|
122
|
+
}}
|
|
123
|
+
/>
|
|
124
|
+
) : (
|
|
125
|
+
<div />
|
|
126
|
+
)}
|
|
127
|
+
{state.popoverTitle ? (
|
|
128
|
+
<Card.Title onClick={handleNavigate}>{toLocalizedString(state.popoverTitle, t)}</Card.Title>
|
|
129
|
+
) : (
|
|
130
|
+
<span />
|
|
131
|
+
)}
|
|
132
|
+
<Card.CloseIconButton onClick={handleClose} />
|
|
133
|
+
</Card.Toolbar>
|
|
134
|
+
<Surface.Surface role='card--content' data={state.popoverContent} limit={1} />
|
|
135
|
+
</Card.Root>
|
|
136
|
+
)}
|
|
99
137
|
</Popover.Viewport>
|
|
100
138
|
<Popover.Arrow />
|
|
101
139
|
</Popover.Content>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface } from '@dxos/app-framework';
|
|
7
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
8
8
|
import { useLandmarkMover } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
10
|
export const StatusBar = ({ showHints }: { showHints?: boolean }) => {
|
|
@@ -12,11 +12,11 @@ export const StatusBar = ({ showHints }: { showHints?: boolean }) => {
|
|
|
12
12
|
return (
|
|
13
13
|
<div
|
|
14
14
|
role='contentinfo'
|
|
15
|
-
className='fixed
|
|
15
|
+
className='fixed bottom-0 inset-x-0 h-(--dx-statusbar-size) border-y border-separator z-[2] flex text-description'
|
|
16
16
|
{...mover}
|
|
17
17
|
>
|
|
18
|
-
{showHints && <Surface role='hints' limit={1} />}
|
|
19
|
-
<Surface role='status-bar' limit={1} />
|
|
18
|
+
{showHints && <Surface.Surface role='hints' limit={1} />}
|
|
19
|
+
<Surface.Surface role='status-bar' limit={1} />
|
|
20
20
|
</div>
|
|
21
21
|
);
|
|
22
22
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type LayoutOperation } from '@dxos/app-toolkit';
|
|
8
8
|
import {
|
|
9
9
|
Button,
|
|
10
10
|
Icon,
|
|
@@ -28,14 +28,14 @@ export const Toast = ({
|
|
|
28
28
|
closeLabel,
|
|
29
29
|
onAction,
|
|
30
30
|
onOpenChange,
|
|
31
|
-
}:
|
|
31
|
+
}: LayoutOperation.Toast & Pick<ToastRootProps, 'onOpenChange'>) => {
|
|
32
32
|
const { t } = useTranslation(meta.id);
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
35
|
<NaturalToast.Root data-testid={id} defaultOpen duration={duration} onOpenChange={onOpenChange}>
|
|
36
36
|
<NaturalToast.Body>
|
|
37
37
|
<NaturalToast.Title classNames='items-center'>
|
|
38
|
-
{icon && <Icon icon={icon}
|
|
38
|
+
{icon && <Icon icon={icon} classNames='inline mr-1' />}
|
|
39
39
|
{title && <span>{toLocalizedString(title, t)}</span>}
|
|
40
40
|
</NaturalToast.Title>
|
|
41
41
|
{description && (
|
|
@@ -61,7 +61,7 @@ export const Toast = ({
|
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
export type ToasterProps = {
|
|
64
|
-
toasts?:
|
|
64
|
+
toasts?: LayoutOperation.Toast[];
|
|
65
65
|
onDismissToast?: (id: string) => void;
|
|
66
66
|
};
|
|
67
67
|
|
|
@@ -72,7 +72,7 @@ export const Toaster = ({ toasts, onDismissToast }: ToasterProps) => {
|
|
|
72
72
|
<Toast
|
|
73
73
|
{...toast}
|
|
74
74
|
key={toast.id}
|
|
75
|
-
onOpenChange={(open) => {
|
|
75
|
+
onOpenChange={(open: boolean) => {
|
|
76
76
|
if (!open) {
|
|
77
77
|
onDismissToast?.(toast.id);
|
|
78
78
|
}
|
|
@@ -5,20 +5,30 @@
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Capability, Plugin } from '@dxos/app-framework';
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
10
|
+
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
11
|
+
import { corePlugins } from '@dxos/plugin-testing';
|
|
12
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
13
13
|
import { Stack } from '@dxos/react-ui-stack';
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { DeckState } from '../../capabilities';
|
|
16
|
+
import { meta as pluginMeta } from '../../meta';
|
|
16
17
|
import { translations } from '../../translations';
|
|
17
18
|
|
|
18
19
|
import { Plank } from './Plank';
|
|
19
20
|
|
|
21
|
+
const TestPlugin = Plugin.define(pluginMeta).pipe(
|
|
22
|
+
Plugin.addModule({
|
|
23
|
+
id: Capability.getModuleTag(DeckState),
|
|
24
|
+
activatesOn: AppActivationEvents.AppGraphReady,
|
|
25
|
+
activate: () => DeckState(),
|
|
26
|
+
}),
|
|
27
|
+
Plugin.make,
|
|
28
|
+
);
|
|
29
|
+
|
|
20
30
|
const meta = {
|
|
21
|
-
title: 'plugins/plugin-deck/Plank',
|
|
31
|
+
title: 'plugins/plugin-deck/components/Plank',
|
|
22
32
|
component: Plank,
|
|
23
33
|
render: (args) => {
|
|
24
34
|
return (
|
|
@@ -28,10 +38,10 @@ const meta = {
|
|
|
28
38
|
);
|
|
29
39
|
},
|
|
30
40
|
decorators: [
|
|
31
|
-
withTheme,
|
|
41
|
+
withTheme(),
|
|
42
|
+
withLayout({ layout: 'fullscreen' }),
|
|
32
43
|
withPluginManager({
|
|
33
|
-
plugins: [
|
|
34
|
-
capabilities: () => DeckStateFactory(),
|
|
44
|
+
plugins: [...corePlugins(), TestPlugin()],
|
|
35
45
|
}),
|
|
36
46
|
],
|
|
37
47
|
parameters: {
|