@dxos/plugin-deck 0.8.4-main.72ec0f3 → 0.8.4-main.8360d9e660
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-UXLU6CMW.mjs → chunk-L3RYMAV7.mjs} +2 -2
- 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 +83 -73
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-2TEGT4PG.mjs +639 -0
- package/dist/lib/browser/operation-resolver-2TEGT4PG.mjs.map +7 -0
- package/dist/lib/browser/react-root-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.d.ts → toolkit/toolkit.d.ts} +6 -4
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
- package/dist/types/src/capabilities/tools/index.d.ts +3 -0
- package/dist/types/src/capabilities/tools/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/tools/tools.d.ts +12 -0
- package/dist/types/src/capabilities/tools/tools.d.ts.map +1 -0
- package/dist/types/src/capabilities/url-handler/index.d.ts +3 -0
- package/dist/types/src/capabilities/url-handler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts +5 -0
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +2 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts +3 -3
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.d.ts +5 -5
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +26 -7
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts +1 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankError.d.ts +6 -4
- package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts +2 -2
- package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +1 -1
- package/dist/types/src/components/fragments.d.ts +4 -1
- package/dist/types/src/components/fragments.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/Banner/Banner.d.ts +2 -0
- package/dist/types/src/containers/Banner/Banner.d.ts.map +1 -0
- package/dist/types/src/containers/Banner/index.d.ts +3 -0
- package/dist/types/src/containers/Banner/index.d.ts.map +1 -0
- package/dist/types/src/containers/DeckSettings/DeckSettings.d.ts +8 -0
- package/dist/types/src/containers/DeckSettings/DeckSettings.d.ts.map +1 -0
- package/dist/types/src/containers/DeckSettings/index.d.ts +3 -0
- package/dist/types/src/containers/DeckSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +4 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +3 -4
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckState.d.ts +17 -0
- package/dist/types/src/hooks/useDeckState.d.ts.map +1 -0
- package/dist/types/src/hooks/useHoistStatusbar.d.ts +1 -1
- package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
- package/dist/types/src/hooks/useMainSize.d.ts +2 -2
- package/dist/types/src/hooks/useNodeActionExpander.d.ts +1 -1
- package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
- package/dist/types/src/hooks/useSelectedCompanion.d.ts +13 -0
- package/dist/types/src/hooks/useSelectedCompanion.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/layout.d.ts +1 -7
- package/dist/types/src/layout.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/{capabilities → types}/capabilities.d.ts +96 -90
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +7 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +99 -38
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/util/set-active.d.ts +18 -3
- package/dist/types/src/util/set-active.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +59 -49
- package/src/DeckPlugin.ts +28 -48
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +119 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/check-app-scheme/check-app-scheme.ts +45 -0
- package/src/capabilities/check-app-scheme/index.ts +7 -0
- package/src/capabilities/index.ts +9 -14
- package/src/capabilities/operation-resolver/index.ts +10 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +558 -0
- package/src/capabilities/react-root/index.ts +7 -0
- package/src/capabilities/react-root/react-root.tsx +47 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +38 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +39 -0
- package/src/capabilities/state/index.ts +7 -0
- package/src/capabilities/state/state.ts +105 -0
- package/src/capabilities/toolkit/index.ts +7 -0
- package/src/capabilities/{toolkit.ts → toolkit/toolkit.ts} +20 -22
- package/src/capabilities/tools/index.ts +7 -0
- package/src/capabilities/tools/tools.ts +91 -0
- package/src/capabilities/url-handler/index.ts +7 -0
- package/src/capabilities/url-handler/url-handler.ts +98 -0
- package/src/components/DeckLayout/ActiveNode.tsx +3 -2
- package/src/components/DeckLayout/Banner.tsx +9 -9
- package/src/components/DeckLayout/ContentEmpty.tsx +5 -6
- package/src/components/DeckLayout/DeckLayout.stories.tsx +21 -31
- package/src/components/DeckLayout/DeckLayout.tsx +13 -11
- package/src/components/DeckLayout/DeckMain.tsx +64 -58
- package/src/components/DeckLayout/Dialog.tsx +22 -13
- package/src/components/DeckLayout/Fallback.tsx +2 -6
- package/src/components/DeckLayout/Popover.tsx +75 -22
- package/src/components/DeckLayout/StatusBar.tsx +4 -4
- package/src/components/DeckLayout/Toast.tsx +4 -4
- package/src/components/Plank/Plank.stories.tsx +19 -9
- package/src/components/Plank/Plank.tsx +46 -38
- package/src/components/Plank/PlankControls.tsx +8 -11
- package/src/components/Plank/PlankError.tsx +31 -17
- package/src/components/Plank/PlankHeading.tsx +39 -47
- package/src/components/Plank/PlankLoading.tsx +1 -1
- package/src/components/Sidebar/ComplementarySidebar.tsx +57 -51
- package/src/components/Sidebar/Sidebar.tsx +7 -7
- package/src/components/Sidebar/SidebarButton.tsx +31 -25
- package/src/components/fragments.ts +10 -5
- package/src/components/index.ts +0 -1
- package/src/containers/Banner/Banner.tsx +5 -0
- package/src/containers/Banner/index.ts +7 -0
- package/src/{components → containers}/DeckSettings/DeckSettings.tsx +41 -31
- package/src/containers/DeckSettings/index.ts +7 -0
- package/src/containers/index.ts +8 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useCompanions.ts +2 -2
- package/src/hooks/useDeckCompanions.ts +7 -11
- package/src/hooks/useDeckState.ts +82 -0
- package/src/hooks/useHoistStatusbar.ts +3 -6
- 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 +3 -3
- package/src/translations.ts +2 -1
- package/src/types/capabilities.ts +33 -0
- package/src/types/events.ts +21 -0
- package/src/types/index.ts +2 -0
- package/src/types/schema.ts +96 -25
- package/src/util/layoutAppliesTopbar.ts +1 -1
- package/src/util/overscroll.ts +3 -3
- package/src/util/set-active.ts +49 -29
- package/dist/lib/browser/app-graph-builder-D74NTOMK.mjs +0 -128
- package/dist/lib/browser/app-graph-builder-D74NTOMK.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-HIEVFAAX.mjs +0 -32
- package/dist/lib/browser/check-app-scheme-HIEVFAAX.mjs.map +0 -7
- package/dist/lib/browser/chunk-5KMJPIQC.mjs +0 -16
- package/dist/lib/browser/chunk-5KMJPIQC.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-F3VCCHVL.mjs +0 -162
- package/dist/lib/browser/chunk-F3VCCHVL.mjs.map +0 -7
- package/dist/lib/browser/chunk-OLDBLCAX.mjs +0 -128
- package/dist/lib/browser/chunk-OLDBLCAX.mjs.map +0 -7
- package/dist/lib/browser/chunk-SDIYDK47.mjs +0 -1553
- package/dist/lib/browser/chunk-SDIYDK47.mjs.map +0 -7
- package/dist/lib/browser/chunk-UXLU6CMW.mjs.map +0 -7
- package/dist/lib/browser/chunk-VBYJ664A.mjs +0 -132
- package/dist/lib/browser/chunk-VBYJ664A.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-UA4YQGAC.mjs +0 -524
- package/dist/lib/browser/intent-resolver-UA4YQGAC.mjs.map +0 -7
- package/dist/lib/browser/react-root-76RSDA6R.mjs +0 -44
- package/dist/lib/browser/react-root-76RSDA6R.mjs.map +0 -7
- package/dist/lib/browser/react-surface-2CSKDN7K.mjs +0 -40
- package/dist/lib/browser/react-surface-2CSKDN7K.mjs.map +0 -7
- package/dist/lib/browser/settings-SDPTOCCM.mjs +0 -30
- package/dist/lib/browser/settings-SDPTOCCM.mjs.map +0 -7
- package/dist/lib/browser/state-7IFAGZQO.mjs +0 -12
- package/dist/lib/browser/toolkit-L5CFXJCF.mjs +0 -52
- package/dist/lib/browser/toolkit-L5CFXJCF.mjs.map +0 -7
- package/dist/lib/browser/url-handler-QEYGYE2H.mjs +0 -70
- package/dist/lib/browser/url-handler-QEYGYE2H.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts +0 -4
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root.d.ts +0 -7
- package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state.d.ts +0 -104
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
- package/dist/types/src/capabilities/tools.d.ts +0 -11
- package/dist/types/src/capabilities/tools.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler.d.ts +0 -4
- package/dist/types/src/capabilities/url-handler.d.ts.map +0 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +0 -6
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +0 -1
- package/dist/types/src/components/DeckSettings/index.d.ts +0 -2
- package/dist/types/src/components/DeckSettings/index.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -143
- package/src/capabilities/capabilities.ts +0 -14
- package/src/capabilities/check-app-scheme.ts +0 -40
- package/src/capabilities/intent-resolver.ts +0 -471
- package/src/capabilities/react-root.tsx +0 -40
- package/src/capabilities/react-surface.tsx +0 -30
- package/src/capabilities/settings.ts +0 -27
- package/src/capabilities/state.ts +0 -113
- package/src/capabilities/tools.ts +0 -84
- package/src/capabilities/url-handler.ts +0 -60
- package/src/components/DeckSettings/index.ts +0 -5
- package/src/events.ts +0 -11
- /package/dist/lib/{browser/state-7IFAGZQO.mjs.map → node-esm/types/index.mjs.map} +0 -0
|
@@ -13,20 +13,25 @@ import React, {
|
|
|
13
13
|
useRef,
|
|
14
14
|
} from 'react';
|
|
15
15
|
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
16
|
+
import { Surface, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
17
|
+
import { LayoutOperation, getCompanionVariant } from '@dxos/app-toolkit';
|
|
18
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
18
19
|
import { debounce } from '@dxos/async';
|
|
19
20
|
import { type Node, useNode } from '@dxos/plugin-graph';
|
|
20
|
-
import {
|
|
21
|
+
import { useAttentionAttributes } from '@dxos/react-ui-attention';
|
|
21
22
|
import { StackItem, railGridHorizontal } from '@dxos/react-ui-stack';
|
|
22
|
-
import { mainIntrinsicSize, mx } from '@dxos/
|
|
23
|
+
import { mainIntrinsicSize, mx } from '@dxos/ui-theme';
|
|
23
24
|
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
import { useCompanions, useDeckState, useMainSize, useSelectedCompanion } from '../../hooks';
|
|
26
|
+
import {
|
|
27
|
+
DeckOperation,
|
|
28
|
+
type DeckSettingsProps,
|
|
29
|
+
type LayoutMode,
|
|
30
|
+
PLANK_COMPANION_TYPE,
|
|
31
|
+
type ResolvedPart,
|
|
32
|
+
} from '../../types';
|
|
28
33
|
|
|
29
|
-
import {
|
|
34
|
+
import { PlankError, PlankErrorFallback } from './PlankError';
|
|
30
35
|
import { PlankHeading } from './PlankHeading';
|
|
31
36
|
import { PlankLoading } from './PlankLoading';
|
|
32
37
|
|
|
@@ -38,7 +43,7 @@ const UNKNOWN_ID = 'unknown_id';
|
|
|
38
43
|
|
|
39
44
|
export type PlankProps = Pick<PlankComponentProps, 'layoutMode' | 'part' | 'path' | 'order' | 'active' | 'settings'> & {
|
|
40
45
|
id?: string;
|
|
41
|
-
|
|
46
|
+
companionVariant?: string;
|
|
42
47
|
};
|
|
43
48
|
|
|
44
49
|
// TODO(burdon): Factor out conditional rendering.
|
|
@@ -49,22 +54,24 @@ export type PlankProps = Pick<PlankComponentProps, 'layoutMode' | 'part' | 'path
|
|
|
49
54
|
// benefits. I think where we anticipate users will definitely want to quickly switch between showing and hiding entire
|
|
50
55
|
// articles, over the (again probably large) performance benefit that unmounting them would confer, we can mount and
|
|
51
56
|
// hide them, but I think that scenario in its most unambiguous form is probably rare. You could extrapolate
|
|
52
|
-
// the scenario to include all
|
|
53
|
-
// don
|
|
57
|
+
// the scenario to include all "potential" planks such as companions, which we could keep mounted and hidden, but I
|
|
58
|
+
// don't think the resulting performance would be acceptable. I think the real issue is "perceived performance" which
|
|
54
59
|
// has mitigations that are in between mounting and un-mounting since both of those have tradeoffs; we may need one or more
|
|
55
|
-
//
|
|
60
|
+
// "partially-mounted" experiences, like loading skeletons at the simple end, or screenshots of "sleeping" planks at
|
|
56
61
|
// the advanced end.
|
|
57
62
|
|
|
58
63
|
/**
|
|
59
64
|
* A Plank is the main container for surfaces within a Deck.
|
|
60
65
|
* It may be paired with a companion plank that enables the user to select one of multiple companion surfaces.
|
|
61
66
|
*/
|
|
62
|
-
export const Plank = memo(({ id = UNKNOWN_ID,
|
|
67
|
+
export const Plank = memo(({ id = UNKNOWN_ID, companionVariant, ...props }: PlankProps) => {
|
|
63
68
|
const { graph } = useAppGraph();
|
|
64
69
|
const node = useNode(graph, id);
|
|
65
70
|
const companions = useCompanions(id);
|
|
66
|
-
const
|
|
67
|
-
const
|
|
71
|
+
const { companionId } = useSelectedCompanion(companions, companionVariant);
|
|
72
|
+
const resolvedCompanionId = companionVariant ? companionId : undefined;
|
|
73
|
+
const currentCompanion = companions.find(({ id }) => id === resolvedCompanionId);
|
|
74
|
+
const hasCompanion = !!(resolvedCompanionId && currentCompanion);
|
|
68
75
|
|
|
69
76
|
return (
|
|
70
77
|
<PlankContainer
|
|
@@ -82,7 +89,7 @@ export const Plank = memo(({ id = UNKNOWN_ID, companionId, ...props }: PlankProp
|
|
|
82
89
|
/>
|
|
83
90
|
{hasCompanion && (
|
|
84
91
|
<PlankComponent
|
|
85
|
-
id={
|
|
92
|
+
id={resolvedCompanionId}
|
|
86
93
|
node={currentCompanion}
|
|
87
94
|
primary={node}
|
|
88
95
|
companions={companions}
|
|
@@ -113,8 +120,8 @@ const PlankContainer = ({ children, solo, companion, encapsulate }: PlankContain
|
|
|
113
120
|
role='none'
|
|
114
121
|
data-popover-collision-boundary={true}
|
|
115
122
|
className={mx(
|
|
116
|
-
'absolute inset-
|
|
117
|
-
encapsulate && 'border border-separator rounded overflow-hidden',
|
|
123
|
+
'absolute inset-(--main-spacing) grid',
|
|
124
|
+
encapsulate && 'border border-separator rounded-sm overflow-hidden',
|
|
118
125
|
companion && 'grid-cols-[6fr_4fr]', // TODO(burdon): Resize.
|
|
119
126
|
railGridHorizontal,
|
|
120
127
|
mainIntrinsicSize,
|
|
@@ -138,9 +145,9 @@ type PlankComponentProps = {
|
|
|
138
145
|
order?: number;
|
|
139
146
|
active?: string[];
|
|
140
147
|
companioned?: 'primary' | 'companion';
|
|
141
|
-
node?: Node;
|
|
142
|
-
primary?: Node;
|
|
143
|
-
companions?: Node[];
|
|
148
|
+
node?: Node.Node;
|
|
149
|
+
primary?: Node.Node;
|
|
150
|
+
companions?: Node.Node[];
|
|
144
151
|
settings?: DeckSettingsProps;
|
|
145
152
|
};
|
|
146
153
|
|
|
@@ -158,8 +165,9 @@ const PlankComponent = memo(
|
|
|
158
165
|
companions,
|
|
159
166
|
settings,
|
|
160
167
|
}: PlankComponentProps) => {
|
|
161
|
-
const {
|
|
162
|
-
const {
|
|
168
|
+
const { invokePromise } = useOperationInvoker();
|
|
169
|
+
const { state, deck } = useDeckState();
|
|
170
|
+
const { popoverAnchorId, scrollIntoView } = state;
|
|
163
171
|
const { findFirstFocusable } = useFocusFinders();
|
|
164
172
|
const canResize = layoutMode === 'deck';
|
|
165
173
|
|
|
@@ -171,18 +179,18 @@ const PlankComponent = memo(
|
|
|
171
179
|
|
|
172
180
|
const rootElement = useRef<HTMLDivElement | null>(null);
|
|
173
181
|
|
|
174
|
-
const
|
|
175
|
-
const sizeKey =
|
|
182
|
+
const variant = node?.type === PLANK_COMPANION_TYPE ? getCompanionVariant(id) : undefined;
|
|
183
|
+
const sizeKey = id.split('+')[0];
|
|
176
184
|
const size = deck.plankSizing[sizeKey] as number | undefined;
|
|
177
185
|
|
|
178
186
|
const handleSizeChange = useCallback(
|
|
179
187
|
debounce((nextSize: number) => {
|
|
180
|
-
return
|
|
188
|
+
return invokePromise(DeckOperation.UpdatePlankSize, { id: sizeKey, size: nextSize });
|
|
181
189
|
}, 200),
|
|
182
|
-
[
|
|
190
|
+
[invokePromise, sizeKey],
|
|
183
191
|
);
|
|
184
192
|
|
|
185
|
-
// TODO(thure): Tabster
|
|
193
|
+
// TODO(thure): Tabster's focus group should handle moving focus to Main, but something is blocking it.
|
|
186
194
|
const handleKeyDown = useCallback((event: KeyboardEvent) => {
|
|
187
195
|
if (event.target === event.currentTarget) {
|
|
188
196
|
switch (event.key) {
|
|
@@ -200,9 +208,9 @@ const PlankComponent = memo(
|
|
|
200
208
|
if (scrollIntoView === id) {
|
|
201
209
|
layoutMode === 'deck' && rootElement.current?.scrollIntoView({ behavior: 'smooth', inline: 'center' });
|
|
202
210
|
// Clear the scroll into view state once it has been actioned.
|
|
203
|
-
void
|
|
211
|
+
void invokePromise(LayoutOperation.ScrollIntoView, { subject: undefined });
|
|
204
212
|
}
|
|
205
|
-
}, [id, scrollIntoView, layoutMode]);
|
|
213
|
+
}, [id, scrollIntoView, layoutMode, invokePromise]);
|
|
206
214
|
|
|
207
215
|
const isSolo = layoutMode.startsWith('solo') && part === 'solo';
|
|
208
216
|
const isAttendable =
|
|
@@ -230,18 +238,18 @@ const PlankComponent = memo(
|
|
|
230
238
|
const Root = part.startsWith('solo') ? 'article' : StackItem.Root;
|
|
231
239
|
const fullscreen = layoutMode === 'solo--fullscreen';
|
|
232
240
|
const className = mx(
|
|
233
|
-
'attention-surface relative dx-focus-ring-inset-over-all density-coarse',
|
|
241
|
+
'dx-attention-surface relative dx-focus-ring-inset-over-all dx-density-coarse',
|
|
234
242
|
isSolo && 'absolute inset-0',
|
|
235
243
|
isSolo && mainIntrinsicSize,
|
|
236
244
|
railGridHorizontal,
|
|
237
245
|
part.startsWith('solo') && 'grid',
|
|
238
|
-
part.startsWith('solo-') && 'grid-rows-subgrid row-span-2 min-
|
|
246
|
+
part.startsWith('solo-') && 'grid-rows-subgrid row-span-2 min-w-0',
|
|
239
247
|
fullscreen && 'grid-rows-1',
|
|
240
|
-
part === 'deck' && (companioned === 'companion' ? '
|
|
241
|
-
part === 'solo-companion' && '
|
|
248
|
+
part === 'deck' && (companioned === 'companion' ? 'border-separator! border-e' : 'border-separator! border-x'),
|
|
249
|
+
part === 'solo-companion' && 'border-separator! border-s',
|
|
242
250
|
settings?.encapsulatedPlanks &&
|
|
243
251
|
!part.startsWith('solo') &&
|
|
244
|
-
'
|
|
252
|
+
'mx-(--main-spacing) border-separator! border rounded-sm overflow-hidden',
|
|
245
253
|
);
|
|
246
254
|
|
|
247
255
|
return (
|
|
@@ -280,12 +288,12 @@ const PlankComponent = memo(
|
|
|
280
288
|
companions={companions}
|
|
281
289
|
/>
|
|
282
290
|
)}
|
|
283
|
-
<Surface
|
|
291
|
+
<Surface.Surface
|
|
284
292
|
key={node.id}
|
|
285
293
|
role='article'
|
|
286
294
|
data={data}
|
|
287
295
|
limit={1}
|
|
288
|
-
fallback={
|
|
296
|
+
fallback={PlankErrorFallback}
|
|
289
297
|
placeholder={placeholder}
|
|
290
298
|
/>
|
|
291
299
|
</>
|
|
@@ -4,13 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { forwardRef, useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import { useIntentDispatcher } from '@dxos/app-framework/react';
|
|
9
|
-
import { invariant } from '@dxos/invariant';
|
|
7
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
10
8
|
import { ButtonGroup, type ButtonGroupProps, type ButtonProps, IconButton, useTranslation } from '@dxos/react-ui';
|
|
11
9
|
|
|
12
10
|
import { meta } from '../../meta';
|
|
13
|
-
import { DeckAction, type LayoutMode } from '../../types';
|
|
11
|
+
import { type DeckAction, DeckOperation, type LayoutMode } from '../../types';
|
|
14
12
|
|
|
15
13
|
export type PlankControlHandler = (event: DeckAction.PartAdjustment) => void;
|
|
16
14
|
|
|
@@ -36,7 +34,7 @@ const PlankControl = ({ icon, label, ...props }: Omit<ButtonProps, 'children'> &
|
|
|
36
34
|
return <IconButton label={label} icon={icon} iconOnly variant='ghost' tooltipSide='bottom' {...props} />;
|
|
37
35
|
};
|
|
38
36
|
|
|
39
|
-
const plankControlSpacing = '
|
|
37
|
+
const plankControlSpacing = 'px-2';
|
|
40
38
|
|
|
41
39
|
type PlankComplimentControlsProps = {
|
|
42
40
|
primary?: string;
|
|
@@ -45,13 +43,12 @@ type PlankComplimentControlsProps = {
|
|
|
45
43
|
export const PlankCompanionControls = forwardRef<HTMLDivElement, PlankComplimentControlsProps>(
|
|
46
44
|
({ primary }, forwardedRef) => {
|
|
47
45
|
const { t } = useTranslation(meta.id);
|
|
48
|
-
const {
|
|
46
|
+
const { invokePromise } = useOperationInvoker();
|
|
49
47
|
const handleCloseCompanion = useCallback(() => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, []);
|
|
48
|
+
return invokePromise(DeckOperation.ChangeCompanion, { companion: null });
|
|
49
|
+
}, [invokePromise]);
|
|
53
50
|
return (
|
|
54
|
-
<div ref={forwardedRef} className='contents app-no-drag'>
|
|
51
|
+
<div ref={forwardedRef} className='contents dx-app-no-drag'>
|
|
55
52
|
<PlankControl
|
|
56
53
|
label={t('close companion label')}
|
|
57
54
|
variant='ghost'
|
|
@@ -79,7 +76,7 @@ export const PlankControls = forwardRef<HTMLDivElement, PlankControlsProps>(
|
|
|
79
76
|
const layoutIsAnySolo = !!layoutMode?.startsWith('solo');
|
|
80
77
|
|
|
81
78
|
return (
|
|
82
|
-
<ButtonGroup {...props} classNames={['app-no-drag
|
|
79
|
+
<ButtonGroup {...props} classNames={['dx-app-no-drag opacity-100!', classNames]} ref={forwardedRef}>
|
|
83
80
|
{capabilities.deck ? (
|
|
84
81
|
<>
|
|
85
82
|
{capabilities.solo && (
|
|
@@ -5,26 +5,14 @@
|
|
|
5
5
|
import React, { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { type Node } from '@dxos/plugin-graph';
|
|
8
|
-
import { useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { descriptionMessage, mx } from '@dxos/
|
|
8
|
+
import { ErrorFallback, type ErrorFallbackProps, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { descriptionMessage, mx } from '@dxos/ui-theme';
|
|
10
10
|
|
|
11
11
|
import { meta } from '../../meta';
|
|
12
12
|
|
|
13
13
|
import { PlankHeading, type PlankHeadingProps } from './PlankHeading';
|
|
14
14
|
import { PlankLoading } from './PlankLoading';
|
|
15
15
|
|
|
16
|
-
export const PlankContentError = ({ error }: { error?: Error }) => {
|
|
17
|
-
const { t } = useTranslation(meta.id);
|
|
18
|
-
const errorString = error?.toString() ?? '';
|
|
19
|
-
return (
|
|
20
|
-
<div role='none' className='overflow-y-auto p-8 attention-surface grid place-items-center'>
|
|
21
|
-
<p role='alert' className={mx(descriptionMessage, 'break-all rounded-md p-4')}>
|
|
22
|
-
{error ? errorString : t('error fallback message')}
|
|
23
|
-
</p>
|
|
24
|
-
</div>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
16
|
export const PlankError = ({
|
|
29
17
|
id,
|
|
30
18
|
part,
|
|
@@ -33,17 +21,43 @@ export const PlankError = ({
|
|
|
33
21
|
}: {
|
|
34
22
|
id: string;
|
|
35
23
|
part: PlankHeadingProps['part'];
|
|
36
|
-
node?: Node;
|
|
24
|
+
node?: Node.Node;
|
|
37
25
|
error?: Error;
|
|
38
26
|
}) => {
|
|
39
27
|
const [timedOut, setTimedOut] = useState(false);
|
|
40
28
|
useEffect(() => {
|
|
41
|
-
setTimeout(() => setTimedOut(true),
|
|
29
|
+
const timer = setTimeout(() => setTimedOut(true), 5_000);
|
|
30
|
+
return () => clearTimeout(timer);
|
|
42
31
|
}, []);
|
|
32
|
+
|
|
43
33
|
return (
|
|
44
34
|
<>
|
|
45
35
|
<PlankHeading id={id} part={part} node={node} pending={!timedOut} />
|
|
46
|
-
{timedOut ? <
|
|
36
|
+
{timedOut ? <PlankErrorFallback error={error} /> : <PlankLoading />}
|
|
47
37
|
</>
|
|
48
38
|
);
|
|
49
39
|
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* User facing error fallback.
|
|
43
|
+
*/
|
|
44
|
+
export const PlankErrorFallback = ({ error }: ErrorFallbackProps) => {
|
|
45
|
+
const { t } = useTranslation(meta.id);
|
|
46
|
+
|
|
47
|
+
if (process.env.NODE_ENV === 'development') {
|
|
48
|
+
return <ErrorFallback title='Plank Error' error={error} />;
|
|
49
|
+
} else {
|
|
50
|
+
const errorString = error?.toString() ?? '';
|
|
51
|
+
return (
|
|
52
|
+
<div
|
|
53
|
+
role='alert'
|
|
54
|
+
data-testid='plank-content-error'
|
|
55
|
+
className='dx-attention-surface overflow-y-auto p-8 grid place-items-center'
|
|
56
|
+
>
|
|
57
|
+
<p className={mx(descriptionMessage, 'break-all rounded-md p-4')}>
|
|
58
|
+
{error ? errorString : t('error fallback message')}
|
|
59
|
+
</p>
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { Fragment, type MouseEvent, memo, useCallback, useEffect, useMemo } from 'react';
|
|
5
|
+
import React, { CSSProperties, Fragment, type MouseEvent, memo, useCallback, useEffect, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
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';
|
|
10
11
|
import { Icon, IconButton, Popover, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
11
12
|
import { StackItem, type StackItemSigilAction } from '@dxos/react-ui-stack';
|
|
12
13
|
import { TextTooltip } from '@dxos/react-ui-text-tooltip';
|
|
13
|
-
import { hoverableControls, hoverableFocusedWithinControls } from '@dxos/
|
|
14
|
+
import { hoverableControls, hoverableFocusedWithinControls, largeIconSize } from '@dxos/ui-theme';
|
|
14
15
|
|
|
15
16
|
import { useBreakpoints } from '../../hooks';
|
|
16
|
-
import { parseEntryId } from '../../layout';
|
|
17
17
|
import { meta } from '../../meta';
|
|
18
|
-
import {
|
|
18
|
+
import { DeckOperation, type LayoutMode, PLANK_COMPANION_TYPE, type ResolvedPart } from '../../types';
|
|
19
19
|
import { soloInlinePadding } from '../fragments';
|
|
20
20
|
|
|
21
21
|
import { PlankCompanionControls, PlankControls } from './PlankControls';
|
|
@@ -26,7 +26,7 @@ export type PlankHeadingProps = {
|
|
|
26
26
|
id: string;
|
|
27
27
|
part: ResolvedPart;
|
|
28
28
|
layoutMode?: LayoutMode;
|
|
29
|
-
node?: Node;
|
|
29
|
+
node?: Node.Node;
|
|
30
30
|
deckEnabled?: boolean;
|
|
31
31
|
canIncrementStart?: boolean;
|
|
32
32
|
canIncrementEnd?: boolean;
|
|
@@ -34,7 +34,7 @@ export type PlankHeadingProps = {
|
|
|
34
34
|
primaryId?: string;
|
|
35
35
|
pending?: boolean;
|
|
36
36
|
companioned?: 'primary' | 'companion';
|
|
37
|
-
companions?: Node[];
|
|
37
|
+
companions?: Node.Node[];
|
|
38
38
|
actions?: StackItemSigilAction[];
|
|
39
39
|
};
|
|
40
40
|
|
|
@@ -55,7 +55,8 @@ export const PlankHeading = memo(
|
|
|
55
55
|
actions = [],
|
|
56
56
|
}: PlankHeadingProps) => {
|
|
57
57
|
const { t } = useTranslation(meta.id);
|
|
58
|
-
const {
|
|
58
|
+
const { invokePromise, invokeSync } = useOperationInvoker();
|
|
59
|
+
const runAction = useActionRunner();
|
|
59
60
|
const { graph } = useAppGraph();
|
|
60
61
|
const breakpoint = useBreakpoints();
|
|
61
62
|
const icon = node?.properties?.icon ?? 'ph--placeholder--regular';
|
|
@@ -69,7 +70,7 @@ export const PlankHeading = memo(
|
|
|
69
70
|
const frame = requestAnimationFrame(() => {
|
|
70
71
|
// Load actions for the node.
|
|
71
72
|
if (node) {
|
|
72
|
-
void
|
|
73
|
+
void Graph.expand(graph, node.id, 'child');
|
|
73
74
|
}
|
|
74
75
|
});
|
|
75
76
|
|
|
@@ -89,7 +90,7 @@ export const PlankHeading = memo(
|
|
|
89
90
|
[breakpoint, part, companions, canIncrementStart, canIncrementEnd, isCompanionNode, deckEnabled],
|
|
90
91
|
);
|
|
91
92
|
|
|
92
|
-
const
|
|
93
|
+
const variant = isCompanionNode ? getCompanionVariant(id) : undefined;
|
|
93
94
|
const sigilActions = useMemo(() => {
|
|
94
95
|
if (!node) {
|
|
95
96
|
return undefined;
|
|
@@ -98,81 +99,72 @@ export const PlankHeading = memo(
|
|
|
98
99
|
} else {
|
|
99
100
|
return [
|
|
100
101
|
actions,
|
|
101
|
-
graph
|
|
102
|
-
.
|
|
103
|
-
|
|
102
|
+
Graph.getActions(graph, node.id).filter((action) =>
|
|
103
|
+
['list-item', 'list-item-primary', 'heading-list-item'].includes(action.properties.disposition),
|
|
104
|
+
),
|
|
104
105
|
].filter((a) => a.length > 0);
|
|
105
106
|
}
|
|
106
107
|
}, [actions, node, variant, graph]);
|
|
107
108
|
|
|
108
109
|
const handleAction = useCallback(
|
|
109
110
|
(action: StackItemSigilAction) => {
|
|
110
|
-
typeof action.data === 'function'
|
|
111
|
+
if (typeof action.data === 'function') {
|
|
112
|
+
void runAction(action as Node.Action, { parent: node, caller: meta.id });
|
|
113
|
+
}
|
|
111
114
|
},
|
|
112
|
-
[node],
|
|
115
|
+
[node, runAction],
|
|
113
116
|
);
|
|
114
117
|
|
|
115
118
|
const handlePlankAction = useCallback(
|
|
116
|
-
(eventType:
|
|
119
|
+
(eventType: DeckOperation.PartAdjustment) => {
|
|
117
120
|
if (eventType.startsWith('solo')) {
|
|
118
|
-
return
|
|
121
|
+
return invokePromise(DeckOperation.Adjust, { type: eventType, id });
|
|
119
122
|
} else if (eventType === 'close') {
|
|
120
123
|
if (part === 'complementary') {
|
|
121
|
-
return
|
|
122
|
-
createIntent(LayoutAction.UpdateComplementary, {
|
|
123
|
-
part: 'complementary',
|
|
124
|
-
options: { state: 'collapsed' },
|
|
125
|
-
}),
|
|
126
|
-
);
|
|
124
|
+
return invokeSync(LayoutOperation.UpdateComplementary, { state: 'collapsed' });
|
|
127
125
|
} else {
|
|
128
|
-
return
|
|
129
|
-
createIntent(LayoutAction.Close, { part: 'main', subject: [id], options: { state: false } }),
|
|
130
|
-
);
|
|
126
|
+
return invokeSync(LayoutOperation.Close, { subject: [id] });
|
|
131
127
|
}
|
|
132
128
|
} else {
|
|
133
|
-
return
|
|
129
|
+
return invokePromise(DeckOperation.Adjust, { type: eventType, id });
|
|
134
130
|
}
|
|
135
131
|
},
|
|
136
|
-
[
|
|
132
|
+
[invokePromise, invokeSync, id, part],
|
|
137
133
|
);
|
|
138
134
|
|
|
139
|
-
const ActionRoot = node && popoverAnchorId ===
|
|
135
|
+
const ActionRoot = node && popoverAnchorId === `${meta.id}:${node.id}` ? Popover.Anchor : Fragment;
|
|
140
136
|
|
|
141
137
|
const handleTabClick = useCallback(
|
|
142
138
|
(event: MouseEvent) => {
|
|
143
139
|
const target = (event.target as HTMLElement).closest('[data-id]') as HTMLElement | null;
|
|
144
140
|
const tabId = target?.dataset?.id;
|
|
145
|
-
if (
|
|
146
|
-
void
|
|
147
|
-
createIntent(DeckAction.ChangeCompanion, {
|
|
148
|
-
primary: primaryId,
|
|
149
|
-
companion: tabId,
|
|
150
|
-
}),
|
|
151
|
-
);
|
|
141
|
+
if (tabId) {
|
|
142
|
+
void invokePromise(DeckOperation.ChangeCompanion, { companion: tabId });
|
|
152
143
|
}
|
|
153
144
|
},
|
|
154
|
-
[
|
|
145
|
+
[invokePromise],
|
|
155
146
|
);
|
|
156
147
|
|
|
157
148
|
return (
|
|
158
149
|
<StackItem.Heading
|
|
150
|
+
data-plank-heading
|
|
151
|
+
style={largeIconSize}
|
|
159
152
|
classNames={[
|
|
160
|
-
'
|
|
161
|
-
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',
|
|
162
155
|
...(layoutMode === 'solo--fullscreen'
|
|
163
156
|
? [
|
|
164
157
|
hoverableControls,
|
|
165
158
|
hoverableFocusedWithinControls,
|
|
166
|
-
'*:transition-opacity *:opacity-
|
|
167
|
-
'hover-hover:hover:bg-
|
|
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',
|
|
168
161
|
]
|
|
169
162
|
: []),
|
|
170
163
|
]}
|
|
171
|
-
data-plank-heading
|
|
172
164
|
>
|
|
173
165
|
{companions && isCompanionNode ? (
|
|
174
166
|
/* TODO(thure): IMPORTANT: This is a tablist; it should be implemented as such. */
|
|
175
|
-
<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'>
|
|
176
168
|
{companions.map(({ id, properties: { icon, label } }) => (
|
|
177
169
|
<IconButton
|
|
178
170
|
key={id}
|
|
@@ -197,7 +189,7 @@ export const PlankHeading = memo(
|
|
|
197
189
|
actions={sigilActions}
|
|
198
190
|
onAction={handleAction}
|
|
199
191
|
>
|
|
200
|
-
<Surface role='menu-footer' data={{ subject: node.data }} />
|
|
192
|
+
<Surface.Surface role='menu-footer' data={{ subject: node.data }} />
|
|
201
193
|
</StackItem.Sigil>
|
|
202
194
|
) : (
|
|
203
195
|
<StackItem.SigilButton>
|
|
@@ -217,7 +209,7 @@ export const PlankHeading = memo(
|
|
|
217
209
|
</TextTooltip>
|
|
218
210
|
</>
|
|
219
211
|
)}
|
|
220
|
-
{node && part !== 'complementary' && <Surface role='navbar-end' data={{ subject: node.data }} />}
|
|
212
|
+
{node && part !== 'complementary' && <Surface.Surface role='navbar-end' data={{ subject: node.data }} />}
|
|
221
213
|
{companioned === 'companion' ? (
|
|
222
214
|
<PlankCompanionControls primary={primaryId} />
|
|
223
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
|
};
|