@dxos/plugin-deck 0.8.4-main.c1de068 → 0.8.4-main.c351d160a8
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-AJW6225V.mjs +14 -0
- package/dist/lib/browser/Banner-AJW6225V.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-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/chunk-WTNYSXY5.mjs +1388 -0
- package/dist/lib/browser/chunk-WTNYSXY5.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-XBFHPSCP.mjs +48 -0
- package/dist/lib/browser/react-root-XBFHPSCP.mjs.map +7 -0
- package/dist/lib/browser/react-surface-4J3BZNT2.mjs +44 -0
- package/dist/lib/browser/react-surface-4J3BZNT2.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-XBH2IIDR.mjs +15 -0
- package/dist/lib/node-esm/Banner-XBH2IIDR.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-CQ3XYTNJ.mjs +1389 -0
- package/dist/lib/node-esm/chunk-CQ3XYTNJ.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-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-32LZ6APH.mjs +49 -0
- package/dist/lib/node-esm/react-root-32LZ6APH.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-CO4ZDZKM.mjs +45 -0
- package/dist/lib/node-esm/react-surface-CO4ZDZKM.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 +61 -47
- 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 +76 -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 +45 -51
- package/src/components/Plank/PlankLoading.tsx +1 -1
- package/src/components/Sidebar/ComplementarySidebar.tsx +80 -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, { CSSProperties, 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, largeIconSize } 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,80 +99,72 @@ 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
|
|
150
|
+
data-plank-heading
|
|
151
|
+
style={largeIconSize}
|
|
157
152
|
classNames={[
|
|
158
|
-
'
|
|
159
|
-
part === 'solo' ? soloInlinePadding : '
|
|
153
|
+
'py-1 items-stretch gap-1 sticky left-12 dx-app-drag min-w-0 dx-contain-layout dx-density-coarse',
|
|
154
|
+
part === 'solo' ? soloInlinePadding : 'px-1',
|
|
160
155
|
...(layoutMode === 'solo--fullscreen'
|
|
161
156
|
? [
|
|
162
157
|
hoverableControls,
|
|
163
158
|
hoverableFocusedWithinControls,
|
|
164
|
-
'*:transition-opacity *:opacity-
|
|
159
|
+
'*:transition-opacity *:opacity-(--controls-opacity) bg-transparent border-transparent transition-[background-color,border-color]',
|
|
160
|
+
'hover-hover:hover:bg-header-surface focus-within:bg-header-surface hover-hover:hover:border-subdued-separator focus-within:border-subdued-separator',
|
|
165
161
|
]
|
|
166
162
|
: []),
|
|
167
163
|
]}
|
|
168
|
-
data-plank-heading
|
|
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
|
};
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import React, {
|
|
6
|
+
CSSProperties,
|
|
6
7
|
Fragment,
|
|
7
8
|
type MouseEvent,
|
|
8
9
|
type PropsWithChildren,
|
|
@@ -12,36 +13,38 @@ import React, {
|
|
|
12
13
|
useState,
|
|
13
14
|
} from 'react';
|
|
14
15
|
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
16
|
+
import { Surface, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
17
|
+
import { LayoutOperation, getCompanionVariant } from '@dxos/app-toolkit';
|
|
18
|
+
import { IconButton, type Label, Main, ScrollArea, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
17
19
|
import { Tabs } from '@dxos/react-ui-tabs';
|
|
20
|
+
import { largeIconSize, mx } from '@dxos/ui-theme';
|
|
18
21
|
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { type DeckCompanion, getCompanionId, useDeckCompanions, useBreakpoints, useHoistStatusbar } from '../../hooks';
|
|
22
|
-
import { DECK_PLUGIN } from '../../meta';
|
|
22
|
+
import { type DeckCompanion, useBreakpoints, useDeckCompanions, useDeckState, useHoistStatusbar } from '../../hooks';
|
|
23
|
+
import { meta } from '../../meta';
|
|
23
24
|
import { getMode } from '../../types';
|
|
24
25
|
import { layoutAppliesTopbar } from '../../util';
|
|
25
|
-
import {
|
|
26
|
+
import { PlankErrorFallback, PlankLoading } from '../Plank';
|
|
27
|
+
|
|
28
|
+
import { ToggleComplementarySidebarButton } from './SidebarButton';
|
|
26
29
|
|
|
27
|
-
const label = ['complementary sidebar title', { ns:
|
|
30
|
+
const label = ['complementary sidebar title', { ns: meta.id }] satisfies Label;
|
|
28
31
|
|
|
29
32
|
export type ComplementarySidebarProps = {
|
|
30
33
|
current?: string;
|
|
31
34
|
};
|
|
32
35
|
|
|
33
36
|
export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) => {
|
|
34
|
-
const { t } = useTranslation(
|
|
35
|
-
const {
|
|
36
|
-
const
|
|
37
|
-
const layoutMode = getMode(
|
|
37
|
+
const { t } = useTranslation(meta.id);
|
|
38
|
+
const { invokeSync } = useOperationInvoker();
|
|
39
|
+
const { state, deck, updateState } = useDeckState();
|
|
40
|
+
const layoutMode = getMode(deck);
|
|
38
41
|
const breakpoint = useBreakpoints();
|
|
39
42
|
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
40
43
|
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
41
44
|
|
|
42
45
|
const companions = useDeckCompanions();
|
|
43
|
-
const activeCompanion = companions.find((companion) =>
|
|
44
|
-
const activeId = activeCompanion &&
|
|
46
|
+
const activeCompanion = companions.find((companion) => getCompanionVariant(companion.id) === current);
|
|
47
|
+
const activeId = activeCompanion && getCompanionVariant(activeCompanion.id);
|
|
45
48
|
const [internalValue, setInternalValue] = useState(activeId);
|
|
46
49
|
|
|
47
50
|
useEffect(() => {
|
|
@@ -52,14 +55,17 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
52
55
|
(event: MouseEvent) => {
|
|
53
56
|
const nextValue = event.currentTarget.getAttribute('data-value') as string;
|
|
54
57
|
if (nextValue === activeId) {
|
|
55
|
-
|
|
58
|
+
updateState((state) => ({
|
|
59
|
+
...state,
|
|
60
|
+
complementarySidebarState: state.complementarySidebarState === 'expanded' ? 'collapsed' : 'expanded',
|
|
61
|
+
}));
|
|
56
62
|
} else {
|
|
57
63
|
setInternalValue(nextValue);
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
updateState((state) => ({ ...state, complementarySidebarState: 'expanded' }));
|
|
65
|
+
invokeSync(LayoutOperation.UpdateComplementary, { subject: nextValue });
|
|
60
66
|
}
|
|
61
67
|
},
|
|
62
|
-
[
|
|
68
|
+
[state.complementarySidebarState, activeId, invokeSync, updateState],
|
|
63
69
|
);
|
|
64
70
|
|
|
65
71
|
const data = useMemo(
|
|
@@ -73,38 +79,40 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
73
79
|
|
|
74
80
|
useEffect(() => {
|
|
75
81
|
if (!activeId) {
|
|
76
|
-
|
|
77
|
-
createIntent(LayoutAction.UpdateComplementary, { part: 'complementary', options: { state: 'collapsed' } }),
|
|
78
|
-
);
|
|
82
|
+
invokeSync(LayoutOperation.UpdateComplementary, { state: 'collapsed' });
|
|
79
83
|
}
|
|
80
|
-
}, [activeId,
|
|
84
|
+
}, [activeId, invokeSync]);
|
|
81
85
|
|
|
82
86
|
return (
|
|
83
87
|
<Main.ComplementarySidebar
|
|
84
88
|
label={label}
|
|
85
89
|
classNames={[
|
|
86
|
-
topbar && '
|
|
87
|
-
hoistStatusbar && '
|
|
90
|
+
topbar && 'top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]',
|
|
91
|
+
hoistStatusbar && 'bottom-(--dx-statusbar-size)',
|
|
88
92
|
]}
|
|
89
93
|
>
|
|
90
94
|
<Tabs.Root orientation='vertical' verticalVariant='stateless' value={internalValue} classNames='contents'>
|
|
91
95
|
<div
|
|
92
96
|
role='none'
|
|
93
|
-
|
|
97
|
+
style={largeIconSize}
|
|
98
|
+
className={mx(
|
|
99
|
+
'absolute z-[1] inset-y-0 end-0 !w-(--dx-r0-size)',
|
|
100
|
+
'py-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)] border-s border-subdued-separator',
|
|
101
|
+
'grid grid-cols-1 grid-rows-[1fr_min-content] bg-toolbar-surface dx-contain-layout dx-app-drag',
|
|
102
|
+
)}
|
|
94
103
|
>
|
|
95
|
-
<Tabs.Tablist classNames='grid grid-cols-1 auto-rows-
|
|
104
|
+
<Tabs.Tablist classNames='grid grid-cols-1 auto-rows-(--dx-rail-action) p-1 gap-1 overflow-y-auto!'>
|
|
96
105
|
{companions.map((companion) => (
|
|
97
|
-
<Tabs.Tab key={
|
|
106
|
+
<Tabs.Tab key={getCompanionVariant(companion.id)} value={getCompanionVariant(companion.id)} asChild>
|
|
98
107
|
<IconButton
|
|
99
108
|
label={toLocalizedString(companion.properties.label, t)}
|
|
100
109
|
icon={companion.properties.icon}
|
|
101
|
-
size={5}
|
|
102
110
|
iconOnly
|
|
103
111
|
tooltipSide='left'
|
|
104
|
-
data-value={
|
|
112
|
+
data-value={getCompanionVariant(companion.id)}
|
|
105
113
|
variant={
|
|
106
|
-
activeId ===
|
|
107
|
-
?
|
|
114
|
+
activeId === getCompanionVariant(companion.id)
|
|
115
|
+
? state.complementarySidebarState === 'expanded'
|
|
108
116
|
? 'primary'
|
|
109
117
|
: 'default'
|
|
110
118
|
: 'ghost'
|
|
@@ -115,21 +123,25 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
115
123
|
))}
|
|
116
124
|
</Tabs.Tablist>
|
|
117
125
|
{!hoistStatusbar && (
|
|
118
|
-
<div role='none' className='grid grid-cols-1 auto-rows-
|
|
119
|
-
<Surface role='status-bar--r0-footer' limit={1} />
|
|
126
|
+
<div role='none' className='grid grid-cols-1 auto-rows-(--dx-rail-item) p-1 overflow-y-auto'>
|
|
127
|
+
<Surface.Surface role='status-bar--r0-footer' limit={1} />
|
|
120
128
|
</div>
|
|
121
129
|
)}
|
|
122
|
-
<div role='none' className='hidden lg:grid grid-cols-1 auto-rows-
|
|
130
|
+
<div role='none' className='hidden lg:grid grid-cols-1 auto-rows-(--dx-rail-action) p-1'>
|
|
123
131
|
<ToggleComplementarySidebarButton />
|
|
124
132
|
</div>
|
|
125
133
|
</div>
|
|
126
134
|
{activeId &&
|
|
127
135
|
companions.map((companion) => (
|
|
128
136
|
<Tabs.Tabpanel
|
|
129
|
-
key={
|
|
130
|
-
value={
|
|
131
|
-
classNames=
|
|
132
|
-
|
|
137
|
+
key={getCompanionVariant(companion.id)}
|
|
138
|
+
value={getCompanionVariant(companion.id)}
|
|
139
|
+
classNames={[
|
|
140
|
+
'absolute data-[state="inactive"]:-z-[1] overflow-hidden',
|
|
141
|
+
'inset-y-0 start-0 w-[calc(100%-var(--dx-r0-size))] lg:w-(--dx-r1-size)',
|
|
142
|
+
'grid grid-cols-1 grid-rows-[var(--dx-rail-size)_1fr_min-content] py-[env(safe-area-inset-top)]',
|
|
143
|
+
]}
|
|
144
|
+
{...(state.complementarySidebarState !== 'expanded' && { inert: true })}
|
|
133
145
|
>
|
|
134
146
|
<ComplementarySidebarPanel
|
|
135
147
|
companion={companion}
|
|
@@ -154,40 +166,55 @@ type ComplementarySidebarPanelProps = {
|
|
|
154
166
|
hoistStatusbar: boolean;
|
|
155
167
|
};
|
|
156
168
|
|
|
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
169
|
const ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar }: ComplementarySidebarPanelProps) => {
|
|
162
|
-
const { t } = useTranslation(
|
|
170
|
+
const { t } = useTranslation(meta.id);
|
|
163
171
|
|
|
164
|
-
if (
|
|
172
|
+
if (getCompanionVariant(companion.id) !== activeId && !data) {
|
|
165
173
|
return null;
|
|
166
174
|
}
|
|
167
175
|
|
|
168
|
-
const Wrapper = companion.properties.fixed ? Fragment :
|
|
176
|
+
const Wrapper = companion.properties.fixed ? Fragment : ScrollAreaWrapper;
|
|
169
177
|
|
|
170
178
|
return (
|
|
171
179
|
<>
|
|
172
|
-
<
|
|
173
|
-
|
|
174
|
-
|
|
180
|
+
<div role='none' className='flex items-center p-1 gap-1 border-b border-subdued-separator'>
|
|
181
|
+
<IconButton
|
|
182
|
+
label={toLocalizedString(companion.properties.label, t)}
|
|
183
|
+
icon={companion.properties.icon}
|
|
184
|
+
iconOnly
|
|
185
|
+
tooltipSide='left'
|
|
186
|
+
data-value={getCompanionVariant(companion.id)}
|
|
187
|
+
classNames='h-10 w-10'
|
|
188
|
+
variant='default'
|
|
189
|
+
/>
|
|
190
|
+
<div role='none' className='px-1'>
|
|
191
|
+
{toLocalizedString(companion.properties.label, t)}
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
175
194
|
<Wrapper>
|
|
176
|
-
<Surface
|
|
177
|
-
role={`deck-companion--${
|
|
195
|
+
<Surface.Surface
|
|
196
|
+
role={`deck-companion--${getCompanionVariant(companion.id)}`}
|
|
178
197
|
data={data}
|
|
179
|
-
fallback={
|
|
198
|
+
fallback={PlankErrorFallback}
|
|
180
199
|
placeholder={<PlankLoading />}
|
|
181
200
|
/>
|
|
182
201
|
</Wrapper>
|
|
183
202
|
{!hoistStatusbar && (
|
|
184
203
|
<div
|
|
185
204
|
role='contentinfo'
|
|
186
|
-
className='flex flex-wrap justify-center items-center border-
|
|
205
|
+
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
206
|
>
|
|
188
|
-
<Surface role='status-bar--r1-footer' limit={1} />
|
|
207
|
+
<Surface.Surface role='status-bar--r1-footer' limit={1} />
|
|
189
208
|
</div>
|
|
190
209
|
)}
|
|
191
210
|
</>
|
|
192
211
|
);
|
|
193
212
|
};
|
|
213
|
+
|
|
214
|
+
const ScrollAreaWrapper = ({ children }: PropsWithChildren) => {
|
|
215
|
+
return (
|
|
216
|
+
<ScrollArea.Root thin orientation='vertical' classNames='grow'>
|
|
217
|
+
<ScrollArea.Viewport>{children}</ScrollArea.Viewport>
|
|
218
|
+
</ScrollArea.Root>
|
|
219
|
+
);
|
|
220
|
+
};
|
|
@@ -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
|
};
|