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