@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
|
@@ -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
|
-
import {
|
|
12
|
-
import { DeckAction, type LayoutMode } from '../../types';
|
|
10
|
+
import { meta } from '../../meta';
|
|
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;
|
|
@@ -43,14 +42,13 @@ type PlankComplimentControlsProps = {
|
|
|
43
42
|
|
|
44
43
|
export const PlankCompanionControls = forwardRef<HTMLDivElement, PlankComplimentControlsProps>(
|
|
45
44
|
({ primary }, forwardedRef) => {
|
|
46
|
-
const { t } = useTranslation(
|
|
47
|
-
const {
|
|
45
|
+
const { t } = useTranslation(meta.id);
|
|
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'
|
|
@@ -71,14 +69,14 @@ export const PlankControls = forwardRef<HTMLDivElement, PlankControlsProps>(
|
|
|
71
69
|
{ children, classNames, variant = 'default', capabilities, layoutMode, pin, close = false, onClick, ...props },
|
|
72
70
|
forwardedRef,
|
|
73
71
|
) => {
|
|
74
|
-
const { t } = useTranslation(
|
|
72
|
+
const { t } = useTranslation(meta.id);
|
|
75
73
|
const buttonClassNames =
|
|
76
74
|
variant === 'hide-disabled' ? `disabled:hidden ${plankControlSpacing}` : plankControlSpacing;
|
|
77
75
|
|
|
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,24 +5,13 @@
|
|
|
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
|
+
|
|
11
|
+
import { meta } from '../../meta';
|
|
10
12
|
|
|
11
13
|
import { PlankHeading, type PlankHeadingProps } from './PlankHeading';
|
|
12
14
|
import { PlankLoading } from './PlankLoading';
|
|
13
|
-
import { DECK_PLUGIN } from '../../meta';
|
|
14
|
-
|
|
15
|
-
export const PlankContentError = ({ error }: { error?: Error }) => {
|
|
16
|
-
const { t } = useTranslation(DECK_PLUGIN);
|
|
17
|
-
const errorString = error?.toString() ?? '';
|
|
18
|
-
return (
|
|
19
|
-
<div role='none' className='overflow-y-auto p-8 attention-surface grid place-items-center'>
|
|
20
|
-
<p role='alert' className={mx(descriptionMessage, 'break-all rounded-md p-4')}>
|
|
21
|
-
{error ? errorString : t('error fallback message')}
|
|
22
|
-
</p>
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
15
|
|
|
27
16
|
export const PlankError = ({
|
|
28
17
|
id,
|
|
@@ -32,17 +21,43 @@ export const PlankError = ({
|
|
|
32
21
|
}: {
|
|
33
22
|
id: string;
|
|
34
23
|
part: PlankHeadingProps['part'];
|
|
35
|
-
node?: Node;
|
|
24
|
+
node?: Node.Node;
|
|
36
25
|
error?: Error;
|
|
37
26
|
}) => {
|
|
38
27
|
const [timedOut, setTimedOut] = useState(false);
|
|
39
28
|
useEffect(() => {
|
|
40
|
-
setTimeout(() => setTimedOut(true),
|
|
29
|
+
const timer = setTimeout(() => setTimedOut(true), 5_000);
|
|
30
|
+
return () => clearTimeout(timer);
|
|
41
31
|
}, []);
|
|
32
|
+
|
|
42
33
|
return (
|
|
43
34
|
<>
|
|
44
35
|
<PlankHeading id={id} part={part} node={node} pending={!timedOut} />
|
|
45
|
-
{timedOut ? <
|
|
36
|
+
{timedOut ? <PlankErrorFallback error={error} /> : <PlankLoading />}
|
|
46
37
|
</>
|
|
47
38
|
);
|
|
48
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
|
+
};
|
|
@@ -2,29 +2,32 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { Fragment, memo, useCallback, useEffect, useMemo
|
|
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
|
-
import { PlankCompanionControls, PlankControls } from './PlankControls';
|
|
15
16
|
import { useBreakpoints } from '../../hooks';
|
|
16
17
|
import { parseEntryId } from '../../layout';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
18
|
+
import { meta } from '../../meta';
|
|
19
|
+
import { DeckOperation, type LayoutMode, PLANK_COMPANION_TYPE, type ResolvedPart } from '../../types';
|
|
19
20
|
import { soloInlinePadding } from '../fragments';
|
|
20
21
|
|
|
22
|
+
import { PlankCompanionControls, PlankControls } from './PlankControls';
|
|
23
|
+
|
|
21
24
|
const MAX_COMPANIONS = 5;
|
|
22
25
|
|
|
23
26
|
export type PlankHeadingProps = {
|
|
24
27
|
id: string;
|
|
25
28
|
part: ResolvedPart;
|
|
26
29
|
layoutMode?: LayoutMode;
|
|
27
|
-
node?: Node;
|
|
30
|
+
node?: Node.Node;
|
|
28
31
|
deckEnabled?: boolean;
|
|
29
32
|
canIncrementStart?: boolean;
|
|
30
33
|
canIncrementEnd?: boolean;
|
|
@@ -32,7 +35,7 @@ export type PlankHeadingProps = {
|
|
|
32
35
|
primaryId?: string;
|
|
33
36
|
pending?: boolean;
|
|
34
37
|
companioned?: 'primary' | 'companion';
|
|
35
|
-
companions?: Node[];
|
|
38
|
+
companions?: Node.Node[];
|
|
36
39
|
actions?: StackItemSigilAction[];
|
|
37
40
|
};
|
|
38
41
|
|
|
@@ -52,14 +55,15 @@ export const PlankHeading = memo(
|
|
|
52
55
|
layoutMode,
|
|
53
56
|
actions = [],
|
|
54
57
|
}: PlankHeadingProps) => {
|
|
55
|
-
const { t } = useTranslation(
|
|
56
|
-
const {
|
|
58
|
+
const { t } = useTranslation(meta.id);
|
|
59
|
+
const { invokePromise, invokeSync } = useOperationInvoker();
|
|
60
|
+
const runAction = useActionRunner();
|
|
57
61
|
const { graph } = useAppGraph();
|
|
58
62
|
const breakpoint = useBreakpoints();
|
|
59
63
|
const icon = node?.properties?.icon ?? 'ph--placeholder--regular';
|
|
60
64
|
const label = pending
|
|
61
65
|
? t('pending heading')
|
|
62
|
-
: toLocalizedString(node?.properties?.label ?? ['plank heading fallback label', { ns:
|
|
66
|
+
: toLocalizedString(node?.properties?.label ?? ['plank heading fallback label', { ns: meta.id }], t);
|
|
63
67
|
|
|
64
68
|
const isCompanionNode = node?.type === PLANK_COMPANION_TYPE;
|
|
65
69
|
|
|
@@ -67,7 +71,7 @@ export const PlankHeading = memo(
|
|
|
67
71
|
const frame = requestAnimationFrame(() => {
|
|
68
72
|
// Load actions for the node.
|
|
69
73
|
if (node) {
|
|
70
|
-
void
|
|
74
|
+
void Graph.expand(graph, node.id, 'child');
|
|
71
75
|
}
|
|
72
76
|
});
|
|
73
77
|
|
|
@@ -96,72 +100,63 @@ export const PlankHeading = memo(
|
|
|
96
100
|
} else {
|
|
97
101
|
return [
|
|
98
102
|
actions,
|
|
99
|
-
graph
|
|
100
|
-
.
|
|
101
|
-
|
|
103
|
+
Graph.getActions(graph, node.id).filter((a) =>
|
|
104
|
+
['list-item', 'list-item-primary', 'heading-list-item'].includes(a.properties.disposition),
|
|
105
|
+
),
|
|
102
106
|
].filter((a) => a.length > 0);
|
|
103
107
|
}
|
|
104
108
|
}, [actions, node, variant, graph]);
|
|
105
109
|
|
|
106
110
|
const handleAction = useCallback(
|
|
107
111
|
(action: StackItemSigilAction) => {
|
|
108
|
-
typeof action.data === 'function'
|
|
112
|
+
if (typeof action.data === 'function') {
|
|
113
|
+
void runAction(action as Node.Action, { parent: node, caller: meta.id });
|
|
114
|
+
}
|
|
109
115
|
},
|
|
110
|
-
[node],
|
|
116
|
+
[node, runAction],
|
|
111
117
|
);
|
|
112
118
|
|
|
113
119
|
const handlePlankAction = useCallback(
|
|
114
|
-
(eventType:
|
|
120
|
+
(eventType: DeckOperation.PartAdjustment) => {
|
|
115
121
|
if (eventType.startsWith('solo')) {
|
|
116
|
-
return
|
|
122
|
+
return invokePromise(DeckOperation.Adjust, { type: eventType, id });
|
|
117
123
|
} else if (eventType === 'close') {
|
|
118
124
|
if (part === 'complementary') {
|
|
119
|
-
return
|
|
120
|
-
createIntent(LayoutAction.UpdateComplementary, {
|
|
121
|
-
part: 'complementary',
|
|
122
|
-
options: { state: 'collapsed' },
|
|
123
|
-
}),
|
|
124
|
-
);
|
|
125
|
+
return invokeSync(LayoutOperation.UpdateComplementary, { state: 'collapsed' });
|
|
125
126
|
} else {
|
|
126
|
-
return
|
|
127
|
-
createIntent(LayoutAction.Close, { part: 'main', subject: [id], options: { state: false } }),
|
|
128
|
-
);
|
|
127
|
+
return invokeSync(LayoutOperation.Close, { subject: [id] });
|
|
129
128
|
}
|
|
130
129
|
} else {
|
|
131
|
-
return
|
|
130
|
+
return invokePromise(DeckOperation.Adjust, { type: eventType, id });
|
|
132
131
|
}
|
|
133
132
|
},
|
|
134
|
-
[
|
|
133
|
+
[invokePromise, invokeSync, id, part],
|
|
135
134
|
);
|
|
136
135
|
|
|
137
|
-
const ActionRoot = node && popoverAnchorId === `dxos.org/ui/${
|
|
136
|
+
const ActionRoot = node && popoverAnchorId === `dxos.org/ui/${meta.id}/${node.id}` ? Popover.Anchor : Fragment;
|
|
138
137
|
|
|
139
138
|
const handleTabClick = useCallback(
|
|
140
139
|
(event: MouseEvent) => {
|
|
141
140
|
const target = (event.target as HTMLElement).closest('[data-id]') as HTMLElement | null;
|
|
142
141
|
const tabId = target?.dataset?.id;
|
|
143
|
-
if (
|
|
144
|
-
void
|
|
145
|
-
createIntent(DeckAction.ChangeCompanion, {
|
|
146
|
-
primary: primaryId,
|
|
147
|
-
companion: tabId,
|
|
148
|
-
}),
|
|
149
|
-
);
|
|
142
|
+
if (tabId) {
|
|
143
|
+
void invokePromise(DeckOperation.ChangeCompanion, { companion: tabId });
|
|
150
144
|
}
|
|
151
145
|
},
|
|
152
|
-
[
|
|
146
|
+
[invokePromise],
|
|
153
147
|
);
|
|
154
148
|
|
|
155
149
|
return (
|
|
156
150
|
<StackItem.Heading
|
|
157
151
|
classNames={[
|
|
158
|
-
'
|
|
159
|
-
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',
|
|
160
154
|
...(layoutMode === 'solo--fullscreen'
|
|
161
155
|
? [
|
|
162
156
|
hoverableControls,
|
|
163
157
|
hoverableFocusedWithinControls,
|
|
164
|
-
'*: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',
|
|
165
160
|
]
|
|
166
161
|
: []),
|
|
167
162
|
]}
|
|
@@ -169,7 +164,7 @@ export const PlankHeading = memo(
|
|
|
169
164
|
>
|
|
170
165
|
{companions && isCompanionNode ? (
|
|
171
166
|
/* TODO(thure): IMPORTANT: This is a tablist; it should be implemented as such. */
|
|
172
|
-
<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'>
|
|
173
168
|
{companions.map(({ id, properties: { icon, label } }) => (
|
|
174
169
|
<IconButton
|
|
175
170
|
key={id}
|
|
@@ -177,7 +172,6 @@ export const PlankHeading = memo(
|
|
|
177
172
|
icon={icon}
|
|
178
173
|
iconOnly={companions.length > MAX_COMPANIONS && node?.id !== id}
|
|
179
174
|
label={toLocalizedString(label, t)}
|
|
180
|
-
size={5}
|
|
181
175
|
variant={node?.id === id ? 'primary' : 'ghost'}
|
|
182
176
|
onClick={handleTabClick}
|
|
183
177
|
/>
|
|
@@ -195,12 +189,12 @@ export const PlankHeading = memo(
|
|
|
195
189
|
actions={sigilActions}
|
|
196
190
|
onAction={handleAction}
|
|
197
191
|
>
|
|
198
|
-
<Surface role='menu-footer' data={{ subject: node.data }} />
|
|
192
|
+
<Surface.Surface role='menu-footer' data={{ subject: node.data }} />
|
|
199
193
|
</StackItem.Sigil>
|
|
200
194
|
) : (
|
|
201
195
|
<StackItem.SigilButton>
|
|
202
196
|
<span className='sr-only'>{label}</span>
|
|
203
|
-
<Icon icon={icon}
|
|
197
|
+
<Icon icon={icon} />
|
|
204
198
|
</StackItem.SigilButton>
|
|
205
199
|
)}
|
|
206
200
|
</ActionRoot>
|
|
@@ -215,7 +209,7 @@ export const PlankHeading = memo(
|
|
|
215
209
|
</TextTooltip>
|
|
216
210
|
</>
|
|
217
211
|
)}
|
|
218
|
-
{node && part !== 'complementary' && <Surface role='navbar-end' data={{ subject: node.data }} />}
|
|
212
|
+
{node && part !== 'complementary' && <Surface.Surface role='navbar-end' data={{ subject: node.data }} />}
|
|
219
213
|
{companioned === 'companion' ? (
|
|
220
214
|
<PlankCompanionControls primary={primaryId} />
|
|
221
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
|
};
|
|
@@ -12,29 +12,38 @@ import React, {
|
|
|
12
12
|
useState,
|
|
13
13
|
} from 'react';
|
|
14
14
|
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { Surface, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
16
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
17
|
+
import { IconButton, type Label, Main, ScrollArea, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
17
18
|
import { Tabs } from '@dxos/react-ui-tabs';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
import { mx } from '@dxos/ui-theme';
|
|
20
|
+
|
|
21
|
+
import {
|
|
22
|
+
type DeckCompanion,
|
|
23
|
+
getCompanionId,
|
|
24
|
+
useBreakpoints,
|
|
25
|
+
useDeckCompanions,
|
|
26
|
+
useDeckState,
|
|
27
|
+
useHoistStatusbar,
|
|
28
|
+
} from '../../hooks';
|
|
29
|
+
import { meta } from '../../meta';
|
|
23
30
|
import { getMode } from '../../types';
|
|
24
31
|
import { layoutAppliesTopbar } from '../../util';
|
|
25
|
-
import {
|
|
32
|
+
import { PlankErrorFallback, PlankLoading } from '../Plank';
|
|
33
|
+
|
|
34
|
+
import { ToggleComplementarySidebarButton } from './SidebarButton';
|
|
26
35
|
|
|
27
|
-
const label = ['complementary sidebar title', { ns:
|
|
36
|
+
const label = ['complementary sidebar title', { ns: meta.id }] satisfies Label;
|
|
28
37
|
|
|
29
38
|
export type ComplementarySidebarProps = {
|
|
30
39
|
current?: string;
|
|
31
40
|
};
|
|
32
41
|
|
|
33
42
|
export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) => {
|
|
34
|
-
const { t } = useTranslation(
|
|
35
|
-
const {
|
|
36
|
-
const
|
|
37
|
-
const layoutMode = getMode(
|
|
43
|
+
const { t } = useTranslation(meta.id);
|
|
44
|
+
const { invokeSync } = useOperationInvoker();
|
|
45
|
+
const { state, deck, updateState } = useDeckState();
|
|
46
|
+
const layoutMode = getMode(deck);
|
|
38
47
|
const breakpoint = useBreakpoints();
|
|
39
48
|
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
40
49
|
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
@@ -52,14 +61,17 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
52
61
|
(event: MouseEvent) => {
|
|
53
62
|
const nextValue = event.currentTarget.getAttribute('data-value') as string;
|
|
54
63
|
if (nextValue === activeId) {
|
|
55
|
-
|
|
64
|
+
updateState((state) => ({
|
|
65
|
+
...state,
|
|
66
|
+
complementarySidebarState: state.complementarySidebarState === 'expanded' ? 'collapsed' : 'expanded',
|
|
67
|
+
}));
|
|
56
68
|
} else {
|
|
57
69
|
setInternalValue(nextValue);
|
|
58
|
-
|
|
59
|
-
|
|
70
|
+
updateState((state) => ({ ...state, complementarySidebarState: 'expanded' }));
|
|
71
|
+
invokeSync(LayoutOperation.UpdateComplementary, { subject: nextValue });
|
|
60
72
|
}
|
|
61
73
|
},
|
|
62
|
-
[
|
|
74
|
+
[state.complementarySidebarState, activeId, invokeSync, updateState],
|
|
63
75
|
);
|
|
64
76
|
|
|
65
77
|
const data = useMemo(
|
|
@@ -73,38 +85,39 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
73
85
|
|
|
74
86
|
useEffect(() => {
|
|
75
87
|
if (!activeId) {
|
|
76
|
-
|
|
77
|
-
createIntent(LayoutAction.UpdateComplementary, { part: 'complementary', options: { state: 'collapsed' } }),
|
|
78
|
-
);
|
|
88
|
+
invokeSync(LayoutOperation.UpdateComplementary, { state: 'collapsed' });
|
|
79
89
|
}
|
|
80
|
-
}, [activeId,
|
|
90
|
+
}, [activeId, invokeSync]);
|
|
81
91
|
|
|
82
92
|
return (
|
|
83
93
|
<Main.ComplementarySidebar
|
|
84
94
|
label={label}
|
|
85
95
|
classNames={[
|
|
86
|
-
topbar && '
|
|
87
|
-
hoistStatusbar && '
|
|
96
|
+
topbar && 'top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]',
|
|
97
|
+
hoistStatusbar && 'bottom-(--dx-statusbar-size)',
|
|
88
98
|
]}
|
|
89
99
|
>
|
|
90
100
|
<Tabs.Root orientation='vertical' verticalVariant='stateless' value={internalValue} classNames='contents'>
|
|
91
101
|
<div
|
|
92
102
|
role='none'
|
|
93
|
-
className=
|
|
103
|
+
className={mx(
|
|
104
|
+
'absolute z-[1] inset-y-0 end-0 !w-(--dx-r0-size)',
|
|
105
|
+
'py-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)] border-s border-subdued-separator',
|
|
106
|
+
'grid grid-cols-1 grid-rows-[1fr_min-content] bg-toolbar-surface dx-contain-layout dx-app-drag',
|
|
107
|
+
)}
|
|
94
108
|
>
|
|
95
|
-
<Tabs.Tablist classNames='grid grid-cols-1 auto-rows-
|
|
109
|
+
<Tabs.Tablist classNames='grid grid-cols-1 auto-rows-(--dx-rail-action) p-1 gap-1 overflow-y-auto!'>
|
|
96
110
|
{companions.map((companion) => (
|
|
97
111
|
<Tabs.Tab key={getCompanionId(companion.id)} value={getCompanionId(companion.id)} asChild>
|
|
98
112
|
<IconButton
|
|
99
113
|
label={toLocalizedString(companion.properties.label, t)}
|
|
100
114
|
icon={companion.properties.icon}
|
|
101
|
-
size={5}
|
|
102
115
|
iconOnly
|
|
103
116
|
tooltipSide='left'
|
|
104
117
|
data-value={getCompanionId(companion.id)}
|
|
105
118
|
variant={
|
|
106
119
|
activeId === getCompanionId(companion.id)
|
|
107
|
-
?
|
|
120
|
+
? state.complementarySidebarState === 'expanded'
|
|
108
121
|
? 'primary'
|
|
109
122
|
: 'default'
|
|
110
123
|
: 'ghost'
|
|
@@ -115,11 +128,11 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
115
128
|
))}
|
|
116
129
|
</Tabs.Tablist>
|
|
117
130
|
{!hoistStatusbar && (
|
|
118
|
-
<div role='none' className='grid grid-cols-1 auto-rows-
|
|
119
|
-
<Surface role='status-bar--r0-footer' limit={1} />
|
|
131
|
+
<div role='none' className='grid grid-cols-1 auto-rows-(--dx-rail-item) p-1 overflow-y-auto'>
|
|
132
|
+
<Surface.Surface role='status-bar--r0-footer' limit={1} />
|
|
120
133
|
</div>
|
|
121
134
|
)}
|
|
122
|
-
<div role='none' className='hidden lg:grid grid-cols-1 auto-rows-
|
|
135
|
+
<div role='none' className='hidden lg:grid grid-cols-1 auto-rows-(--dx-rail-action) p-1'>
|
|
123
136
|
<ToggleComplementarySidebarButton />
|
|
124
137
|
</div>
|
|
125
138
|
</div>
|
|
@@ -128,8 +141,12 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
128
141
|
<Tabs.Tabpanel
|
|
129
142
|
key={getCompanionId(companion.id)}
|
|
130
143
|
value={getCompanionId(companion.id)}
|
|
131
|
-
classNames=
|
|
132
|
-
|
|
144
|
+
classNames={[
|
|
145
|
+
'absolute data-[state="inactive"]:-z-[1] overflow-hidden',
|
|
146
|
+
'inset-y-0 start-0 w-[calc(100%-var(--dx-r0-size))] lg:w-(--dx-r1-size)',
|
|
147
|
+
'grid grid-cols-1 grid-rows-[var(--dx-rail-size)_1fr_min-content] py-[env(safe-area-inset-top)]',
|
|
148
|
+
]}
|
|
149
|
+
{...(state.complementarySidebarState !== 'expanded' && { inert: true })}
|
|
133
150
|
>
|
|
134
151
|
<ComplementarySidebarPanel
|
|
135
152
|
companion={companion}
|
|
@@ -154,40 +171,55 @@ type ComplementarySidebarPanelProps = {
|
|
|
154
171
|
hoistStatusbar: boolean;
|
|
155
172
|
};
|
|
156
173
|
|
|
157
|
-
const ScrollArea = ({ children }: PropsWithChildren) => {
|
|
158
|
-
return <div className='flex flex-col grow overflow-x-hidden overflow-y-auto scrollbar-thin'>{children}</div>;
|
|
159
|
-
};
|
|
160
|
-
|
|
161
174
|
const ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar }: ComplementarySidebarPanelProps) => {
|
|
162
|
-
const { t } = useTranslation(
|
|
175
|
+
const { t } = useTranslation(meta.id);
|
|
163
176
|
|
|
164
177
|
if (getCompanionId(companion.id) !== activeId && !data) {
|
|
165
178
|
return null;
|
|
166
179
|
}
|
|
167
180
|
|
|
168
|
-
const Wrapper = companion.properties.fixed ? Fragment :
|
|
181
|
+
const Wrapper = companion.properties.fixed ? Fragment : ScrollAreaWrapper;
|
|
169
182
|
|
|
170
183
|
return (
|
|
171
184
|
<>
|
|
172
|
-
<
|
|
173
|
-
|
|
174
|
-
|
|
185
|
+
<div role='none' className='flex items-center p-1 gap-1 border-b border-subdued-separator'>
|
|
186
|
+
<IconButton
|
|
187
|
+
label={toLocalizedString(companion.properties.label, t)}
|
|
188
|
+
icon={companion.properties.icon}
|
|
189
|
+
iconOnly
|
|
190
|
+
tooltipSide='left'
|
|
191
|
+
data-value={getCompanionId(companion.id)}
|
|
192
|
+
classNames='h-10 w-10'
|
|
193
|
+
variant='default'
|
|
194
|
+
/>
|
|
195
|
+
<div role='none' className='px-1'>
|
|
196
|
+
{toLocalizedString(companion.properties.label, t)}
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
175
199
|
<Wrapper>
|
|
176
|
-
<Surface
|
|
200
|
+
<Surface.Surface
|
|
177
201
|
role={`deck-companion--${getCompanionId(companion.id)}`}
|
|
178
202
|
data={data}
|
|
179
|
-
fallback={
|
|
203
|
+
fallback={PlankErrorFallback}
|
|
180
204
|
placeholder={<PlankLoading />}
|
|
181
205
|
/>
|
|
182
206
|
</Wrapper>
|
|
183
207
|
{!hoistStatusbar && (
|
|
184
208
|
<div
|
|
185
209
|
role='contentinfo'
|
|
186
|
-
className='flex flex-wrap justify-center items-center border-
|
|
210
|
+
className='flex flex-wrap justify-center items-center border-y border-subdued-separator pt-1 pb-[max(env(safe-area-inset-bottom),0.25rem)]'
|
|
187
211
|
>
|
|
188
|
-
<Surface role='status-bar--r1-footer' limit={1} />
|
|
212
|
+
<Surface.Surface role='status-bar--r1-footer' limit={1} />
|
|
189
213
|
</div>
|
|
190
214
|
)}
|
|
191
215
|
</>
|
|
192
216
|
);
|
|
193
217
|
};
|
|
218
|
+
|
|
219
|
+
const ScrollAreaWrapper = ({ children }: PropsWithChildren) => {
|
|
220
|
+
return (
|
|
221
|
+
<ScrollArea.Root thin orientation='vertical' classNames='grow'>
|
|
222
|
+
<ScrollArea.Viewport>{children}</ScrollArea.Viewport>
|
|
223
|
+
</ScrollArea.Root>
|
|
224
|
+
);
|
|
225
|
+
};
|
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface
|
|
7
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
8
8
|
import { type Label, Main } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { DECK_PLUGIN } from '../../meta';
|
|
10
|
+
import { useBreakpoints, useDeckState, useHoistStatusbar } from '../../hooks';
|
|
11
|
+
import { meta } from '../../meta';
|
|
13
12
|
import { getMode } from '../../types';
|
|
14
13
|
import { layoutAppliesTopbar } from '../../util';
|
|
15
14
|
|
|
16
|
-
const label = ['sidebar title', { ns:
|
|
15
|
+
const label = ['sidebar title', { ns: meta.id }] satisfies Label;
|
|
17
16
|
|
|
18
17
|
export const Sidebar = () => {
|
|
19
|
-
const {
|
|
18
|
+
const { state, deck } = useDeckState();
|
|
19
|
+
const { popoverAnchorId, activeDeck: current } = state;
|
|
20
20
|
const breakpoint = useBreakpoints();
|
|
21
21
|
const layoutMode = getMode(deck);
|
|
22
22
|
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
@@ -32,11 +32,11 @@ export const Sidebar = () => {
|
|
|
32
32
|
label={label}
|
|
33
33
|
classNames={[
|
|
34
34
|
'grid',
|
|
35
|
-
topbar && '
|
|
36
|
-
hoistStatusbar && '
|
|
35
|
+
topbar && 'top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]',
|
|
36
|
+
hoistStatusbar && 'bottom-(--dx-statusbar-size)',
|
|
37
37
|
]}
|
|
38
38
|
>
|
|
39
|
-
<Surface role='navigation' data={navigationData} limit={1} />
|
|
39
|
+
<Surface.Surface role='navigation' data={navigationData} limit={1} />
|
|
40
40
|
</Main.NavigationSidebar>
|
|
41
41
|
);
|
|
42
42
|
};
|