@dxos/plugin-deck 0.8.4-main.c4373fc → 0.8.4-main.d05673bc65
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-HXRXEUOZ.mjs +14 -0
- package/dist/lib/browser/Banner-HXRXEUOZ.mjs.map +7 -0
- package/dist/lib/browser/DeckSettings-HSSQKFNE.mjs +96 -0
- package/dist/lib/browser/DeckSettings-HSSQKFNE.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-MP6INIM2.mjs +123 -0
- package/dist/lib/browser/app-graph-builder-MP6INIM2.mjs.map +7 -0
- package/dist/lib/browser/check-app-scheme-AUNCD2Y6.mjs +33 -0
- package/dist/lib/browser/check-app-scheme-AUNCD2Y6.mjs.map +7 -0
- package/dist/lib/browser/chunk-3P2FJVXC.mjs +278 -0
- package/dist/lib/browser/chunk-3P2FJVXC.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-ITNJS5QX.mjs +1386 -0
- package/dist/lib/browser/chunk-ITNJS5QX.mjs.map +7 -0
- package/dist/lib/browser/chunk-L3RYMAV7.mjs +16 -0
- package/dist/lib/browser/chunk-L3RYMAV7.mjs.map +7 -0
- package/dist/lib/browser/chunk-TAHLKBDO.mjs +187 -0
- package/dist/lib/browser/chunk-TAHLKBDO.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-2TEGT4PG.mjs +639 -0
- package/dist/lib/browser/operation-resolver-2TEGT4PG.mjs.map +7 -0
- package/dist/lib/browser/react-root-AS4IOYDG.mjs +48 -0
- package/dist/lib/browser/react-root-AS4IOYDG.mjs.map +7 -0
- package/dist/lib/browser/react-surface-FH7TC6WW.mjs +44 -0
- package/dist/lib/browser/react-surface-FH7TC6WW.mjs.map +7 -0
- package/dist/lib/browser/settings-PTMGCSJH.mjs +40 -0
- package/dist/lib/browser/settings-PTMGCSJH.mjs.map +7 -0
- package/dist/lib/browser/state-MA4SQ7BE.mjs +106 -0
- package/dist/lib/browser/state-MA4SQ7BE.mjs.map +7 -0
- package/dist/lib/browser/toolkit-6B34QFU3.mjs +55 -0
- package/dist/lib/browser/toolkit-6B34QFU3.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +14 -8
- package/dist/lib/browser/url-handler-FEUFPQIP.mjs +98 -0
- package/dist/lib/browser/url-handler-FEUFPQIP.mjs.map +7 -0
- package/dist/lib/node-esm/Banner-RN7XXOXY.mjs +15 -0
- package/dist/lib/node-esm/Banner-RN7XXOXY.mjs.map +7 -0
- package/dist/lib/node-esm/DeckSettings-DJRFLKQS.mjs +97 -0
- package/dist/lib/node-esm/DeckSettings-DJRFLKQS.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-ACHG5HY7.mjs +124 -0
- package/dist/lib/node-esm/app-graph-builder-ACHG5HY7.mjs.map +7 -0
- package/dist/lib/node-esm/check-app-scheme-WN76GWVC.mjs +34 -0
- package/dist/lib/node-esm/check-app-scheme-WN76GWVC.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-EMU4VIPH.mjs +188 -0
- package/dist/lib/node-esm/chunk-EMU4VIPH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GZJAQ5IP.mjs +279 -0
- package/dist/lib/node-esm/chunk-GZJAQ5IP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MBCCNIWY.mjs +1387 -0
- package/dist/lib/node-esm/chunk-MBCCNIWY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XCNF4COU.mjs +18 -0
- package/dist/lib/node-esm/chunk-XCNF4COU.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +185 -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-GCMCCI7A.mjs +640 -0
- package/dist/lib/node-esm/operation-resolver-GCMCCI7A.mjs.map +7 -0
- package/dist/lib/node-esm/react-root-7DTDLAF4.mjs +49 -0
- package/dist/lib/node-esm/react-root-7DTDLAF4.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-U6Z2K324.mjs +45 -0
- package/dist/lib/node-esm/react-surface-U6Z2K324.mjs.map +7 -0
- package/dist/lib/node-esm/settings-LPPFLXNJ.mjs +41 -0
- package/dist/lib/node-esm/settings-LPPFLXNJ.mjs.map +7 -0
- package/dist/lib/node-esm/state-KNRU3GDC.mjs +107 -0
- package/dist/lib/node-esm/state-KNRU3GDC.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-SOWYKJY3.mjs +56 -0
- package/dist/lib/node-esm/toolkit-SOWYKJY3.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +39 -0
- package/dist/lib/node-esm/url-handler-4LEB7UWF.mjs +99 -0
- package/dist/lib/node-esm/url-handler-4LEB7UWF.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts +2 -1
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts +5 -0
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts.map +1 -0
- package/dist/types/src/capabilities/check-app-scheme/index.d.ts +3 -0
- package/dist/types/src/capabilities/check-app-scheme/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +8 -13
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
- package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root/react-root.d.ts +9 -0
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +19 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +22 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/index.d.ts +172 -0
- package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/state.d.ts +175 -0
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts +3 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +27 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
- package/dist/types/src/capabilities/tools/index.d.ts +3 -0
- package/dist/types/src/capabilities/tools/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/tools/tools.d.ts +12 -0
- package/dist/types/src/capabilities/tools/tools.d.ts.map +1 -0
- package/dist/types/src/capabilities/url-handler/index.d.ts +3 -0
- package/dist/types/src/capabilities/url-handler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts +5 -0
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +2 -3
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +75 -0
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts +3 -0
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts +7 -2
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.d.ts +5 -5
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +27 -7
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts +1 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankError.d.ts +6 -4
- package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts +2 -2
- package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +1 -1
- package/dist/types/src/components/fragments.d.ts +4 -1
- package/dist/types/src/components/fragments.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/Banner/Banner.d.ts +2 -0
- package/dist/types/src/containers/Banner/Banner.d.ts.map +1 -0
- package/dist/types/src/containers/Banner/index.d.ts +3 -0
- package/dist/types/src/containers/Banner/index.d.ts.map +1 -0
- package/dist/types/src/containers/DeckSettings/DeckSettings.d.ts +8 -0
- package/dist/types/src/containers/DeckSettings/DeckSettings.d.ts.map +1 -0
- package/dist/types/src/containers/DeckSettings/index.d.ts +3 -0
- package/dist/types/src/containers/DeckSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +4 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +3 -4
- 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/layout.d.ts +1 -7
- package/dist/types/src/layout.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/{capabilities → types}/capabilities.d.ts +96 -90
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +7 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +100 -38
- 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 +558 -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 +98 -0
- package/src/components/DeckLayout/ActiveNode.tsx +3 -2
- package/src/components/DeckLayout/Banner.tsx +9 -9
- package/src/components/DeckLayout/ContentEmpty.tsx +5 -6
- package/src/components/DeckLayout/DeckLayout.stories.tsx +53 -0
- package/src/components/DeckLayout/DeckLayout.tsx +17 -285
- package/src/components/DeckLayout/DeckMain.tsx +287 -0
- package/src/components/DeckLayout/Dialog.tsx +22 -13
- package/src/components/DeckLayout/Fallback.tsx +2 -6
- package/src/components/DeckLayout/Popover.tsx +70 -32
- package/src/components/DeckLayout/StatusBar.tsx +4 -4
- package/src/components/DeckLayout/Toast.tsx +28 -3
- package/src/components/Plank/Plank.stories.tsx +19 -9
- package/src/components/Plank/Plank.tsx +105 -63
- package/src/components/Plank/PlankControls.tsx +9 -11
- package/src/components/Plank/PlankError.tsx +31 -17
- package/src/components/Plank/PlankHeading.tsx +37 -45
- package/src/components/Plank/PlankLoading.tsx +1 -1
- package/src/components/Sidebar/ComplementarySidebar.tsx +72 -48
- package/src/components/Sidebar/Sidebar.tsx +7 -7
- package/src/components/Sidebar/SidebarButton.tsx +36 -29
- package/src/components/fragments.ts +10 -5
- package/src/components/index.ts +0 -1
- package/src/containers/Banner/Banner.tsx +5 -0
- package/src/containers/Banner/index.ts +7 -0
- package/src/containers/DeckSettings/DeckSettings.tsx +113 -0
- package/src/containers/DeckSettings/index.ts +7 -0
- package/src/containers/index.ts +8 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useCompanions.ts +2 -2
- package/src/hooks/useDeckCompanions.ts +7 -10
- 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 +32 -0
- package/src/index.ts +1 -2
- package/src/layout.ts +1 -14
- package/src/meta.ts +8 -3
- package/src/translations.ts +3 -1
- package/src/types/capabilities.ts +33 -0
- package/src/types/events.ts +21 -0
- package/src/types/index.ts +2 -0
- package/src/types/schema.ts +98 -25
- package/src/util/layoutAppliesTopbar.ts +1 -1
- package/src/util/overscroll.ts +3 -3
- package/src/util/set-active.ts +49 -29
- package/dist/lib/browser/app-graph-builder-YYP67JHW.mjs +0 -153
- package/dist/lib/browser/app-graph-builder-YYP67JHW.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-GCOL6YDT.mjs +0 -32
- package/dist/lib/browser/check-app-scheme-GCOL6YDT.mjs.map +0 -7
- package/dist/lib/browser/chunk-3SV2V3AN.mjs +0 -1495
- package/dist/lib/browser/chunk-3SV2V3AN.mjs.map +0 -7
- package/dist/lib/browser/chunk-A4SRCSJX.mjs +0 -160
- package/dist/lib/browser/chunk-A4SRCSJX.mjs.map +0 -7
- package/dist/lib/browser/chunk-CNTGBCMK.mjs +0 -145
- package/dist/lib/browser/chunk-CNTGBCMK.mjs.map +0 -7
- package/dist/lib/browser/chunk-HUWUYTOI.mjs +0 -16
- package/dist/lib/browser/chunk-HUWUYTOI.mjs.map +0 -7
- package/dist/lib/browser/chunk-JH4ZCG5I.mjs +0 -129
- package/dist/lib/browser/chunk-JH4ZCG5I.mjs.map +0 -7
- package/dist/lib/browser/chunk-MHP4GPX5.mjs +0 -11
- package/dist/lib/browser/chunk-MHP4GPX5.mjs.map +0 -7
- package/dist/lib/browser/chunk-YRDCQS7E.mjs +0 -127
- package/dist/lib/browser/chunk-YRDCQS7E.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-2NFDKRFG.mjs +0 -524
- package/dist/lib/browser/intent-resolver-2NFDKRFG.mjs.map +0 -7
- package/dist/lib/browser/react-root-JTWYCDJT.mjs +0 -43
- package/dist/lib/browser/react-root-JTWYCDJT.mjs.map +0 -7
- package/dist/lib/browser/react-surface-PZKJ73JS.mjs +0 -40
- package/dist/lib/browser/react-surface-PZKJ73JS.mjs.map +0 -7
- package/dist/lib/browser/settings-JK7UIZSB.mjs +0 -29
- package/dist/lib/browser/settings-JK7UIZSB.mjs.map +0 -7
- package/dist/lib/browser/state-IFKFOBBX.mjs +0 -12
- package/dist/lib/browser/toolkit-L7C3UAEU.mjs +0 -63
- package/dist/lib/browser/toolkit-L7C3UAEU.mjs.map +0 -7
- package/dist/lib/browser/url-handler-MRYBE3HF.mjs +0 -70
- package/dist/lib/browser/url-handler-MRYBE3HF.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts +0 -4
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root.d.ts +0 -7
- package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state.d.ts +0 -101
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit.d.ts +0 -6
- package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
- package/dist/types/src/capabilities/tools.d.ts +0 -11
- package/dist/types/src/capabilities/tools.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler.d.ts +0 -4
- package/dist/types/src/capabilities/url-handler.d.ts.map +0 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +0 -6
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +0 -1
- package/dist/types/src/components/DeckSettings/index.d.ts +0 -2
- package/dist/types/src/components/DeckSettings/index.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -143
- package/src/capabilities/capabilities.ts +0 -14
- package/src/capabilities/check-app-scheme.ts +0 -40
- package/src/capabilities/intent-resolver.ts +0 -472
- package/src/capabilities/react-root.tsx +0 -39
- package/src/capabilities/react-surface.tsx +0 -30
- package/src/capabilities/settings.ts +0 -26
- package/src/capabilities/state.ts +0 -105
- package/src/capabilities/toolkit.ts +0 -57
- package/src/capabilities/tools.ts +0 -84
- package/src/capabilities/url-handler.ts +0 -60
- package/src/components/DeckSettings/DeckSettings.tsx +0 -97
- package/src/components/DeckSettings/index.ts +0 -5
- package/src/events.ts +0 -11
- /package/dist/lib/{browser/state-IFKFOBBX.mjs.map → node-esm/types/index.mjs.map} +0 -0
|
@@ -5,26 +5,14 @@
|
|
|
5
5
|
import React, { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { type Node } from '@dxos/plugin-graph';
|
|
8
|
-
import { useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { descriptionMessage, mx } from '@dxos/
|
|
8
|
+
import { ErrorFallback, type ErrorFallbackProps, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { descriptionMessage, mx } from '@dxos/ui-theme';
|
|
10
10
|
|
|
11
11
|
import { meta } from '../../meta';
|
|
12
12
|
|
|
13
13
|
import { PlankHeading, type PlankHeadingProps } from './PlankHeading';
|
|
14
14
|
import { PlankLoading } from './PlankLoading';
|
|
15
15
|
|
|
16
|
-
export const PlankContentError = ({ error }: { error?: Error }) => {
|
|
17
|
-
const { t } = useTranslation(meta.id);
|
|
18
|
-
const errorString = error?.toString() ?? '';
|
|
19
|
-
return (
|
|
20
|
-
<div role='none' className='overflow-y-auto p-8 attention-surface grid place-items-center'>
|
|
21
|
-
<p role='alert' className={mx(descriptionMessage, 'break-all rounded-md p-4')}>
|
|
22
|
-
{error ? errorString : t('error fallback message')}
|
|
23
|
-
</p>
|
|
24
|
-
</div>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
16
|
export const PlankError = ({
|
|
29
17
|
id,
|
|
30
18
|
part,
|
|
@@ -33,17 +21,43 @@ export const PlankError = ({
|
|
|
33
21
|
}: {
|
|
34
22
|
id: string;
|
|
35
23
|
part: PlankHeadingProps['part'];
|
|
36
|
-
node?: Node;
|
|
24
|
+
node?: Node.Node;
|
|
37
25
|
error?: Error;
|
|
38
26
|
}) => {
|
|
39
27
|
const [timedOut, setTimedOut] = useState(false);
|
|
40
28
|
useEffect(() => {
|
|
41
|
-
setTimeout(() => setTimedOut(true),
|
|
29
|
+
const timer = setTimeout(() => setTimedOut(true), 5_000);
|
|
30
|
+
return () => clearTimeout(timer);
|
|
42
31
|
}, []);
|
|
32
|
+
|
|
43
33
|
return (
|
|
44
34
|
<>
|
|
45
35
|
<PlankHeading id={id} part={part} node={node} pending={!timedOut} />
|
|
46
|
-
{timedOut ? <
|
|
36
|
+
{timedOut ? <PlankErrorFallback error={error} /> : <PlankLoading />}
|
|
47
37
|
</>
|
|
48
38
|
);
|
|
49
39
|
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* User facing error fallback.
|
|
43
|
+
*/
|
|
44
|
+
export const PlankErrorFallback = ({ error }: ErrorFallbackProps) => {
|
|
45
|
+
const { t } = useTranslation(meta.id);
|
|
46
|
+
|
|
47
|
+
if (process.env.NODE_ENV === 'development') {
|
|
48
|
+
return <ErrorFallback title='Plank Error' error={error} />;
|
|
49
|
+
} else {
|
|
50
|
+
const errorString = error?.toString() ?? '';
|
|
51
|
+
return (
|
|
52
|
+
<div
|
|
53
|
+
role='alert'
|
|
54
|
+
data-testid='plank-content-error'
|
|
55
|
+
className='dx-attention-surface overflow-y-auto p-8 grid place-items-center'
|
|
56
|
+
>
|
|
57
|
+
<p className={mx(descriptionMessage, 'break-all rounded-md p-4')}>
|
|
58
|
+
{error ? errorString : t('error fallback message')}
|
|
59
|
+
</p>
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { Fragment, type MouseEvent, memo, useCallback, useEffect, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Surface, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
|
+
import { LayoutOperation, getCompanionVariant } from '@dxos/app-toolkit';
|
|
9
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
10
|
+
import { Graph, type Node, useActionRunner } from '@dxos/plugin-graph';
|
|
9
11
|
import { Icon, IconButton, Popover, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
10
12
|
import { StackItem, type StackItemSigilAction } from '@dxos/react-ui-stack';
|
|
11
13
|
import { TextTooltip } from '@dxos/react-ui-text-tooltip';
|
|
12
|
-
import { hoverableControls, hoverableFocusedWithinControls } from '@dxos/
|
|
14
|
+
import { hoverableControls, hoverableFocusedWithinControls } from '@dxos/ui-theme';
|
|
13
15
|
|
|
14
16
|
import { useBreakpoints } from '../../hooks';
|
|
15
|
-
import { parseEntryId } from '../../layout';
|
|
16
17
|
import { meta } from '../../meta';
|
|
17
|
-
import {
|
|
18
|
+
import { DeckOperation, type LayoutMode, PLANK_COMPANION_TYPE, type ResolvedPart } from '../../types';
|
|
18
19
|
import { soloInlinePadding } from '../fragments';
|
|
19
20
|
|
|
20
21
|
import { PlankCompanionControls, PlankControls } from './PlankControls';
|
|
@@ -25,7 +26,7 @@ export type PlankHeadingProps = {
|
|
|
25
26
|
id: string;
|
|
26
27
|
part: ResolvedPart;
|
|
27
28
|
layoutMode?: LayoutMode;
|
|
28
|
-
node?: Node;
|
|
29
|
+
node?: Node.Node;
|
|
29
30
|
deckEnabled?: boolean;
|
|
30
31
|
canIncrementStart?: boolean;
|
|
31
32
|
canIncrementEnd?: boolean;
|
|
@@ -33,7 +34,7 @@ export type PlankHeadingProps = {
|
|
|
33
34
|
primaryId?: string;
|
|
34
35
|
pending?: boolean;
|
|
35
36
|
companioned?: 'primary' | 'companion';
|
|
36
|
-
companions?: Node[];
|
|
37
|
+
companions?: Node.Node[];
|
|
37
38
|
actions?: StackItemSigilAction[];
|
|
38
39
|
};
|
|
39
40
|
|
|
@@ -54,7 +55,8 @@ export const PlankHeading = memo(
|
|
|
54
55
|
actions = [],
|
|
55
56
|
}: PlankHeadingProps) => {
|
|
56
57
|
const { t } = useTranslation(meta.id);
|
|
57
|
-
const {
|
|
58
|
+
const { invokePromise, invokeSync } = useOperationInvoker();
|
|
59
|
+
const runAction = useActionRunner();
|
|
58
60
|
const { graph } = useAppGraph();
|
|
59
61
|
const breakpoint = useBreakpoints();
|
|
60
62
|
const icon = node?.properties?.icon ?? 'ph--placeholder--regular';
|
|
@@ -68,7 +70,7 @@ export const PlankHeading = memo(
|
|
|
68
70
|
const frame = requestAnimationFrame(() => {
|
|
69
71
|
// Load actions for the node.
|
|
70
72
|
if (node) {
|
|
71
|
-
void
|
|
73
|
+
void Graph.expand(graph, node.id, 'child');
|
|
72
74
|
}
|
|
73
75
|
});
|
|
74
76
|
|
|
@@ -88,7 +90,7 @@ export const PlankHeading = memo(
|
|
|
88
90
|
[breakpoint, part, companions, canIncrementStart, canIncrementEnd, isCompanionNode, deckEnabled],
|
|
89
91
|
);
|
|
90
92
|
|
|
91
|
-
const
|
|
93
|
+
const variant = isCompanionNode ? getCompanionVariant(id) : undefined;
|
|
92
94
|
const sigilActions = useMemo(() => {
|
|
93
95
|
if (!node) {
|
|
94
96
|
return undefined;
|
|
@@ -97,72 +99,63 @@ export const PlankHeading = memo(
|
|
|
97
99
|
} else {
|
|
98
100
|
return [
|
|
99
101
|
actions,
|
|
100
|
-
graph
|
|
101
|
-
.
|
|
102
|
-
|
|
102
|
+
Graph.getActions(graph, node.id).filter((action) =>
|
|
103
|
+
['list-item', 'list-item-primary', 'heading-list-item'].includes(action.properties.disposition),
|
|
104
|
+
),
|
|
103
105
|
].filter((a) => a.length > 0);
|
|
104
106
|
}
|
|
105
107
|
}, [actions, node, variant, graph]);
|
|
106
108
|
|
|
107
109
|
const handleAction = useCallback(
|
|
108
110
|
(action: StackItemSigilAction) => {
|
|
109
|
-
typeof action.data === 'function'
|
|
111
|
+
if (typeof action.data === 'function') {
|
|
112
|
+
void runAction(action as Node.Action, { parent: node, caller: meta.id });
|
|
113
|
+
}
|
|
110
114
|
},
|
|
111
|
-
[node],
|
|
115
|
+
[node, runAction],
|
|
112
116
|
);
|
|
113
117
|
|
|
114
118
|
const handlePlankAction = useCallback(
|
|
115
|
-
(eventType:
|
|
119
|
+
(eventType: DeckOperation.PartAdjustment) => {
|
|
116
120
|
if (eventType.startsWith('solo')) {
|
|
117
|
-
return
|
|
121
|
+
return invokePromise(DeckOperation.Adjust, { type: eventType, id });
|
|
118
122
|
} else if (eventType === 'close') {
|
|
119
123
|
if (part === 'complementary') {
|
|
120
|
-
return
|
|
121
|
-
createIntent(LayoutAction.UpdateComplementary, {
|
|
122
|
-
part: 'complementary',
|
|
123
|
-
options: { state: 'collapsed' },
|
|
124
|
-
}),
|
|
125
|
-
);
|
|
124
|
+
return invokeSync(LayoutOperation.UpdateComplementary, { state: 'collapsed' });
|
|
126
125
|
} else {
|
|
127
|
-
return
|
|
128
|
-
createIntent(LayoutAction.Close, { part: 'main', subject: [id], options: { state: false } }),
|
|
129
|
-
);
|
|
126
|
+
return invokeSync(LayoutOperation.Close, { subject: [id] });
|
|
130
127
|
}
|
|
131
128
|
} else {
|
|
132
|
-
return
|
|
129
|
+
return invokePromise(DeckOperation.Adjust, { type: eventType, id });
|
|
133
130
|
}
|
|
134
131
|
},
|
|
135
|
-
[
|
|
132
|
+
[invokePromise, invokeSync, id, part],
|
|
136
133
|
);
|
|
137
134
|
|
|
138
|
-
const ActionRoot = node && popoverAnchorId ===
|
|
135
|
+
const ActionRoot = node && popoverAnchorId === `${meta.id}:${node.id}` ? Popover.Anchor : Fragment;
|
|
139
136
|
|
|
140
137
|
const handleTabClick = useCallback(
|
|
141
138
|
(event: MouseEvent) => {
|
|
142
139
|
const target = (event.target as HTMLElement).closest('[data-id]') as HTMLElement | null;
|
|
143
140
|
const tabId = target?.dataset?.id;
|
|
144
|
-
if (
|
|
145
|
-
void
|
|
146
|
-
createIntent(DeckAction.ChangeCompanion, {
|
|
147
|
-
primary: primaryId,
|
|
148
|
-
companion: tabId,
|
|
149
|
-
}),
|
|
150
|
-
);
|
|
141
|
+
if (tabId) {
|
|
142
|
+
void invokePromise(DeckOperation.ChangeCompanion, { companion: tabId });
|
|
151
143
|
}
|
|
152
144
|
},
|
|
153
|
-
[
|
|
145
|
+
[invokePromise],
|
|
154
146
|
);
|
|
155
147
|
|
|
156
148
|
return (
|
|
157
149
|
<StackItem.Heading
|
|
158
150
|
classNames={[
|
|
159
|
-
'
|
|
160
|
-
part === 'solo' ? soloInlinePadding : '
|
|
151
|
+
'py-1 items-stretch gap-1 sticky left-12 dx-app-drag min-w-0 dx-contain-layout dx-density-coarse',
|
|
152
|
+
part === 'solo' ? soloInlinePadding : 'px-1',
|
|
161
153
|
...(layoutMode === 'solo--fullscreen'
|
|
162
154
|
? [
|
|
163
155
|
hoverableControls,
|
|
164
156
|
hoverableFocusedWithinControls,
|
|
165
|
-
'*:transition-opacity *:opacity-
|
|
157
|
+
'*:transition-opacity *:opacity-(--controls-opacity) bg-transparent border-transparent transition-[background-color,border-color]',
|
|
158
|
+
'hover-hover:hover:bg-header-surface focus-within:bg-header-surface hover-hover:hover:border-subdued-separator focus-within:border-subdued-separator',
|
|
166
159
|
]
|
|
167
160
|
: []),
|
|
168
161
|
]}
|
|
@@ -170,7 +163,7 @@ export const PlankHeading = memo(
|
|
|
170
163
|
>
|
|
171
164
|
{companions && isCompanionNode ? (
|
|
172
165
|
/* TODO(thure): IMPORTANT: This is a tablist; it should be implemented as such. */
|
|
173
|
-
<div role='none' className='flex-1 min-
|
|
166
|
+
<div role='none' className='flex-1 min-w-0 overflow-x-auto scrollbar-none flex gap-1'>
|
|
174
167
|
{companions.map(({ id, properties: { icon, label } }) => (
|
|
175
168
|
<IconButton
|
|
176
169
|
key={id}
|
|
@@ -178,7 +171,6 @@ export const PlankHeading = memo(
|
|
|
178
171
|
icon={icon}
|
|
179
172
|
iconOnly={companions.length > MAX_COMPANIONS && node?.id !== id}
|
|
180
173
|
label={toLocalizedString(label, t)}
|
|
181
|
-
size={5}
|
|
182
174
|
variant={node?.id === id ? 'primary' : 'ghost'}
|
|
183
175
|
onClick={handleTabClick}
|
|
184
176
|
/>
|
|
@@ -196,12 +188,12 @@ export const PlankHeading = memo(
|
|
|
196
188
|
actions={sigilActions}
|
|
197
189
|
onAction={handleAction}
|
|
198
190
|
>
|
|
199
|
-
<Surface role='menu-footer' data={{ subject: node.data }} />
|
|
191
|
+
<Surface.Surface role='menu-footer' data={{ subject: node.data }} />
|
|
200
192
|
</StackItem.Sigil>
|
|
201
193
|
) : (
|
|
202
194
|
<StackItem.SigilButton>
|
|
203
195
|
<span className='sr-only'>{label}</span>
|
|
204
|
-
<Icon icon={icon}
|
|
196
|
+
<Icon icon={icon} />
|
|
205
197
|
</StackItem.SigilButton>
|
|
206
198
|
)}
|
|
207
199
|
</ActionRoot>
|
|
@@ -216,7 +208,7 @@ export const PlankHeading = memo(
|
|
|
216
208
|
</TextTooltip>
|
|
217
209
|
</>
|
|
218
210
|
)}
|
|
219
|
-
{node && part !== 'complementary' && <Surface role='navbar-end' data={{ subject: node.data }} />}
|
|
211
|
+
{node && part !== 'complementary' && <Surface.Surface role='navbar-end' data={{ subject: node.data }} />}
|
|
220
212
|
{companioned === 'companion' ? (
|
|
221
213
|
<PlankCompanionControls primary={primaryId} />
|
|
222
214
|
) : (
|
|
@@ -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,16 +12,17 @@ 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, getCompanionVariant } 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';
|
|
19
|
+
import { mx } from '@dxos/ui-theme';
|
|
18
20
|
|
|
19
|
-
import {
|
|
20
|
-
import { type DeckCompanion, getCompanionId, useBreakpoints, useDeckCompanions, useHoistStatusbar } from '../../hooks';
|
|
21
|
+
import { type DeckCompanion, useBreakpoints, useDeckCompanions, useDeckState, useHoistStatusbar } from '../../hooks';
|
|
21
22
|
import { meta } from '../../meta';
|
|
22
23
|
import { getMode } from '../../types';
|
|
23
24
|
import { layoutAppliesTopbar } from '../../util';
|
|
24
|
-
import {
|
|
25
|
+
import { PlankErrorFallback, PlankLoading } from '../Plank';
|
|
25
26
|
|
|
26
27
|
import { ToggleComplementarySidebarButton } from './SidebarButton';
|
|
27
28
|
|
|
@@ -33,16 +34,16 @@ export type ComplementarySidebarProps = {
|
|
|
33
34
|
|
|
34
35
|
export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) => {
|
|
35
36
|
const { t } = useTranslation(meta.id);
|
|
36
|
-
const {
|
|
37
|
-
const
|
|
38
|
-
const layoutMode = getMode(
|
|
37
|
+
const { invokeSync } = useOperationInvoker();
|
|
38
|
+
const { state, deck, updateState } = useDeckState();
|
|
39
|
+
const layoutMode = getMode(deck);
|
|
39
40
|
const breakpoint = useBreakpoints();
|
|
40
41
|
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
41
42
|
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
42
43
|
|
|
43
44
|
const companions = useDeckCompanions();
|
|
44
|
-
const activeCompanion = companions.find((companion) =>
|
|
45
|
-
const activeId = activeCompanion &&
|
|
45
|
+
const activeCompanion = companions.find((companion) => getCompanionVariant(companion.id) === current);
|
|
46
|
+
const activeId = activeCompanion && getCompanionVariant(activeCompanion.id);
|
|
46
47
|
const [internalValue, setInternalValue] = useState(activeId);
|
|
47
48
|
|
|
48
49
|
useEffect(() => {
|
|
@@ -53,14 +54,17 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
53
54
|
(event: MouseEvent) => {
|
|
54
55
|
const nextValue = event.currentTarget.getAttribute('data-value') as string;
|
|
55
56
|
if (nextValue === activeId) {
|
|
56
|
-
|
|
57
|
+
updateState((state) => ({
|
|
58
|
+
...state,
|
|
59
|
+
complementarySidebarState: state.complementarySidebarState === 'expanded' ? 'collapsed' : 'expanded',
|
|
60
|
+
}));
|
|
57
61
|
} else {
|
|
58
62
|
setInternalValue(nextValue);
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
updateState((state) => ({ ...state, complementarySidebarState: 'expanded' }));
|
|
64
|
+
invokeSync(LayoutOperation.UpdateComplementary, { subject: nextValue });
|
|
61
65
|
}
|
|
62
66
|
},
|
|
63
|
-
[
|
|
67
|
+
[state.complementarySidebarState, activeId, invokeSync, updateState],
|
|
64
68
|
);
|
|
65
69
|
|
|
66
70
|
const data = useMemo(
|
|
@@ -74,38 +78,39 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
74
78
|
|
|
75
79
|
useEffect(() => {
|
|
76
80
|
if (!activeId) {
|
|
77
|
-
|
|
78
|
-
createIntent(LayoutAction.UpdateComplementary, { part: 'complementary', options: { state: 'collapsed' } }),
|
|
79
|
-
);
|
|
81
|
+
invokeSync(LayoutOperation.UpdateComplementary, { state: 'collapsed' });
|
|
80
82
|
}
|
|
81
|
-
}, [activeId,
|
|
83
|
+
}, [activeId, invokeSync]);
|
|
82
84
|
|
|
83
85
|
return (
|
|
84
86
|
<Main.ComplementarySidebar
|
|
85
87
|
label={label}
|
|
86
88
|
classNames={[
|
|
87
|
-
topbar && '
|
|
88
|
-
hoistStatusbar && '
|
|
89
|
+
topbar && 'top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]',
|
|
90
|
+
hoistStatusbar && 'bottom-(--dx-statusbar-size)',
|
|
89
91
|
]}
|
|
90
92
|
>
|
|
91
93
|
<Tabs.Root orientation='vertical' verticalVariant='stateless' value={internalValue} classNames='contents'>
|
|
92
94
|
<div
|
|
93
95
|
role='none'
|
|
94
|
-
className=
|
|
96
|
+
className={mx(
|
|
97
|
+
'absolute z-[1] inset-y-0 end-0 !w-(--dx-r0-size)',
|
|
98
|
+
'py-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)] border-s border-subdued-separator',
|
|
99
|
+
'grid grid-cols-1 grid-rows-[1fr_min-content] bg-toolbar-surface dx-contain-layout dx-app-drag',
|
|
100
|
+
)}
|
|
95
101
|
>
|
|
96
|
-
<Tabs.Tablist classNames='grid grid-cols-1 auto-rows-
|
|
102
|
+
<Tabs.Tablist classNames='grid grid-cols-1 auto-rows-(--dx-rail-action) p-1 gap-1 overflow-y-auto!'>
|
|
97
103
|
{companions.map((companion) => (
|
|
98
|
-
<Tabs.Tab key={
|
|
104
|
+
<Tabs.Tab key={getCompanionVariant(companion.id)} value={getCompanionVariant(companion.id)} asChild>
|
|
99
105
|
<IconButton
|
|
100
106
|
label={toLocalizedString(companion.properties.label, t)}
|
|
101
107
|
icon={companion.properties.icon}
|
|
102
|
-
size={5}
|
|
103
108
|
iconOnly
|
|
104
109
|
tooltipSide='left'
|
|
105
|
-
data-value={
|
|
110
|
+
data-value={getCompanionVariant(companion.id)}
|
|
106
111
|
variant={
|
|
107
|
-
activeId ===
|
|
108
|
-
?
|
|
112
|
+
activeId === getCompanionVariant(companion.id)
|
|
113
|
+
? state.complementarySidebarState === 'expanded'
|
|
109
114
|
? 'primary'
|
|
110
115
|
: 'default'
|
|
111
116
|
: 'ghost'
|
|
@@ -116,21 +121,25 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
116
121
|
))}
|
|
117
122
|
</Tabs.Tablist>
|
|
118
123
|
{!hoistStatusbar && (
|
|
119
|
-
<div role='none' className='grid grid-cols-1 auto-rows-
|
|
120
|
-
<Surface role='status-bar--r0-footer' limit={1} />
|
|
124
|
+
<div role='none' className='grid grid-cols-1 auto-rows-(--dx-rail-item) p-1 overflow-y-auto'>
|
|
125
|
+
<Surface.Surface role='status-bar--r0-footer' limit={1} />
|
|
121
126
|
</div>
|
|
122
127
|
)}
|
|
123
|
-
<div role='none' className='hidden lg:grid grid-cols-1 auto-rows-
|
|
128
|
+
<div role='none' className='hidden lg:grid grid-cols-1 auto-rows-(--dx-rail-action) p-1'>
|
|
124
129
|
<ToggleComplementarySidebarButton />
|
|
125
130
|
</div>
|
|
126
131
|
</div>
|
|
127
132
|
{activeId &&
|
|
128
133
|
companions.map((companion) => (
|
|
129
134
|
<Tabs.Tabpanel
|
|
130
|
-
key={
|
|
131
|
-
value={
|
|
132
|
-
classNames=
|
|
133
|
-
|
|
135
|
+
key={getCompanionVariant(companion.id)}
|
|
136
|
+
value={getCompanionVariant(companion.id)}
|
|
137
|
+
classNames={[
|
|
138
|
+
'absolute data-[state="inactive"]:-z-[1] overflow-hidden',
|
|
139
|
+
'inset-y-0 start-0 w-[calc(100%-var(--dx-r0-size))] lg:w-(--dx-r1-size)',
|
|
140
|
+
'grid grid-cols-1 grid-rows-[var(--dx-rail-size)_1fr_min-content] py-[env(safe-area-inset-top)]',
|
|
141
|
+
]}
|
|
142
|
+
{...(state.complementarySidebarState !== 'expanded' && { inert: true })}
|
|
134
143
|
>
|
|
135
144
|
<ComplementarySidebarPanel
|
|
136
145
|
companion={companion}
|
|
@@ -155,40 +164,55 @@ type ComplementarySidebarPanelProps = {
|
|
|
155
164
|
hoistStatusbar: boolean;
|
|
156
165
|
};
|
|
157
166
|
|
|
158
|
-
const ScrollArea = ({ children }: PropsWithChildren) => {
|
|
159
|
-
return <div className='flex flex-col grow overflow-x-hidden overflow-y-auto scrollbar-thin'>{children}</div>;
|
|
160
|
-
};
|
|
161
|
-
|
|
162
167
|
const ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar }: ComplementarySidebarPanelProps) => {
|
|
163
168
|
const { t } = useTranslation(meta.id);
|
|
164
169
|
|
|
165
|
-
if (
|
|
170
|
+
if (getCompanionVariant(companion.id) !== activeId && !data) {
|
|
166
171
|
return null;
|
|
167
172
|
}
|
|
168
173
|
|
|
169
|
-
const Wrapper = companion.properties.fixed ? Fragment :
|
|
174
|
+
const Wrapper = companion.properties.fixed ? Fragment : ScrollAreaWrapper;
|
|
170
175
|
|
|
171
176
|
return (
|
|
172
177
|
<>
|
|
173
|
-
<
|
|
174
|
-
|
|
175
|
-
|
|
178
|
+
<div role='none' className='flex items-center p-1 gap-1 border-b border-subdued-separator'>
|
|
179
|
+
<IconButton
|
|
180
|
+
label={toLocalizedString(companion.properties.label, t)}
|
|
181
|
+
icon={companion.properties.icon}
|
|
182
|
+
iconOnly
|
|
183
|
+
tooltipSide='left'
|
|
184
|
+
data-value={getCompanionVariant(companion.id)}
|
|
185
|
+
classNames='h-10 w-10'
|
|
186
|
+
variant='default'
|
|
187
|
+
/>
|
|
188
|
+
<div role='none' className='px-1'>
|
|
189
|
+
{toLocalizedString(companion.properties.label, t)}
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
176
192
|
<Wrapper>
|
|
177
|
-
<Surface
|
|
178
|
-
role={`deck-companion--${
|
|
193
|
+
<Surface.Surface
|
|
194
|
+
role={`deck-companion--${getCompanionVariant(companion.id)}`}
|
|
179
195
|
data={data}
|
|
180
|
-
fallback={
|
|
196
|
+
fallback={PlankErrorFallback}
|
|
181
197
|
placeholder={<PlankLoading />}
|
|
182
198
|
/>
|
|
183
199
|
</Wrapper>
|
|
184
200
|
{!hoistStatusbar && (
|
|
185
201
|
<div
|
|
186
202
|
role='contentinfo'
|
|
187
|
-
className='flex flex-wrap justify-center items-center border-
|
|
203
|
+
className='flex flex-wrap justify-center items-center border-y border-subdued-separator pt-1 pb-[max(env(safe-area-inset-bottom),0.25rem)]'
|
|
188
204
|
>
|
|
189
|
-
<Surface role='status-bar--r1-footer' limit={1} />
|
|
205
|
+
<Surface.Surface role='status-bar--r1-footer' limit={1} />
|
|
190
206
|
</div>
|
|
191
207
|
)}
|
|
192
208
|
</>
|
|
193
209
|
);
|
|
194
210
|
};
|
|
211
|
+
|
|
212
|
+
const ScrollAreaWrapper = ({ children }: PropsWithChildren) => {
|
|
213
|
+
return (
|
|
214
|
+
<ScrollArea.Root thin orientation='vertical' classNames='grow'>
|
|
215
|
+
<ScrollArea.Viewport>{children}</ScrollArea.Viewport>
|
|
216
|
+
</ScrollArea.Root>
|
|
217
|
+
);
|
|
218
|
+
};
|
|
@@ -4,11 +4,10 @@
|
|
|
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 { useBreakpoints, useHoistStatusbar } from '../../hooks';
|
|
10
|
+
import { useBreakpoints, useDeckState, useHoistStatusbar } from '../../hooks';
|
|
12
11
|
import { meta } from '../../meta';
|
|
13
12
|
import { getMode } from '../../types';
|
|
14
13
|
import { layoutAppliesTopbar } from '../../util';
|
|
@@ -16,7 +15,8 @@ import { layoutAppliesTopbar } from '../../util';
|
|
|
16
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
|
};
|