@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
|
@@ -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,18 +13,17 @@ import React, {
|
|
|
12
13
|
useState,
|
|
13
14
|
} from 'react';
|
|
14
15
|
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { IconButton, type Label, Main, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
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';
|
|
18
19
|
import { Tabs } from '@dxos/react-ui-tabs';
|
|
19
|
-
import { mx } from '@dxos/
|
|
20
|
+
import { largeIconSize, mx } from '@dxos/ui-theme';
|
|
20
21
|
|
|
21
|
-
import {
|
|
22
|
-
import { type DeckCompanion, getCompanionId, useBreakpoints, useDeckCompanions, useHoistStatusbar } from '../../hooks';
|
|
22
|
+
import { type DeckCompanion, useBreakpoints, useDeckCompanions, useDeckState, useHoistStatusbar } from '../../hooks';
|
|
23
23
|
import { meta } from '../../meta';
|
|
24
24
|
import { getMode } from '../../types';
|
|
25
25
|
import { layoutAppliesTopbar } from '../../util';
|
|
26
|
-
import {
|
|
26
|
+
import { PlankErrorFallback, PlankLoading } from '../Plank';
|
|
27
27
|
|
|
28
28
|
import { ToggleComplementarySidebarButton } from './SidebarButton';
|
|
29
29
|
|
|
@@ -35,16 +35,16 @@ export type ComplementarySidebarProps = {
|
|
|
35
35
|
|
|
36
36
|
export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) => {
|
|
37
37
|
const { t } = useTranslation(meta.id);
|
|
38
|
-
const {
|
|
39
|
-
const
|
|
40
|
-
const layoutMode = getMode(
|
|
38
|
+
const { invokeSync } = useOperationInvoker();
|
|
39
|
+
const { state, deck, updateState } = useDeckState();
|
|
40
|
+
const layoutMode = getMode(deck);
|
|
41
41
|
const breakpoint = useBreakpoints();
|
|
42
42
|
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
43
43
|
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
44
44
|
|
|
45
45
|
const companions = useDeckCompanions();
|
|
46
|
-
const activeCompanion = companions.find((companion) =>
|
|
47
|
-
const activeId = activeCompanion &&
|
|
46
|
+
const activeCompanion = companions.find((companion) => getCompanionVariant(companion.id) === current);
|
|
47
|
+
const activeId = activeCompanion && getCompanionVariant(activeCompanion.id);
|
|
48
48
|
const [internalValue, setInternalValue] = useState(activeId);
|
|
49
49
|
|
|
50
50
|
useEffect(() => {
|
|
@@ -55,14 +55,17 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
55
55
|
(event: MouseEvent) => {
|
|
56
56
|
const nextValue = event.currentTarget.getAttribute('data-value') as string;
|
|
57
57
|
if (nextValue === activeId) {
|
|
58
|
-
|
|
58
|
+
updateState((state) => ({
|
|
59
|
+
...state,
|
|
60
|
+
complementarySidebarState: state.complementarySidebarState === 'expanded' ? 'collapsed' : 'expanded',
|
|
61
|
+
}));
|
|
59
62
|
} else {
|
|
60
63
|
setInternalValue(nextValue);
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
updateState((state) => ({ ...state, complementarySidebarState: 'expanded' }));
|
|
65
|
+
invokeSync(LayoutOperation.UpdateComplementary, { subject: nextValue });
|
|
63
66
|
}
|
|
64
67
|
},
|
|
65
|
-
[
|
|
68
|
+
[state.complementarySidebarState, activeId, invokeSync, updateState],
|
|
66
69
|
);
|
|
67
70
|
|
|
68
71
|
const data = useMemo(
|
|
@@ -76,41 +79,40 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
76
79
|
|
|
77
80
|
useEffect(() => {
|
|
78
81
|
if (!activeId) {
|
|
79
|
-
|
|
80
|
-
createIntent(LayoutAction.UpdateComplementary, { part: 'complementary', options: { state: 'collapsed' } }),
|
|
81
|
-
);
|
|
82
|
+
invokeSync(LayoutOperation.UpdateComplementary, { state: 'collapsed' });
|
|
82
83
|
}
|
|
83
|
-
}, [activeId,
|
|
84
|
+
}, [activeId, invokeSync]);
|
|
84
85
|
|
|
85
86
|
return (
|
|
86
87
|
<Main.ComplementarySidebar
|
|
87
88
|
label={label}
|
|
88
89
|
classNames={[
|
|
89
|
-
topbar && '
|
|
90
|
-
hoistStatusbar && '
|
|
90
|
+
topbar && 'top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]',
|
|
91
|
+
hoistStatusbar && 'bottom-(--dx-statusbar-size)',
|
|
91
92
|
]}
|
|
92
93
|
>
|
|
93
94
|
<Tabs.Root orientation='vertical' verticalVariant='stateless' value={internalValue} classNames='contents'>
|
|
94
95
|
<div
|
|
95
96
|
role='none'
|
|
97
|
+
style={largeIconSize}
|
|
96
98
|
className={mx(
|
|
97
|
-
'absolute z-[1] inset-
|
|
98
|
-
'
|
|
99
|
-
'grid grid-cols-1 grid-rows-[1fr_min-content] bg-
|
|
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',
|
|
100
102
|
)}
|
|
101
103
|
>
|
|
102
|
-
<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!'>
|
|
103
105
|
{companions.map((companion) => (
|
|
104
|
-
<Tabs.Tab key={
|
|
106
|
+
<Tabs.Tab key={getCompanionVariant(companion.id)} value={getCompanionVariant(companion.id)} asChild>
|
|
105
107
|
<IconButton
|
|
106
108
|
label={toLocalizedString(companion.properties.label, t)}
|
|
107
109
|
icon={companion.properties.icon}
|
|
108
110
|
iconOnly
|
|
109
111
|
tooltipSide='left'
|
|
110
|
-
data-value={
|
|
112
|
+
data-value={getCompanionVariant(companion.id)}
|
|
111
113
|
variant={
|
|
112
|
-
activeId ===
|
|
113
|
-
?
|
|
114
|
+
activeId === getCompanionVariant(companion.id)
|
|
115
|
+
? state.complementarySidebarState === 'expanded'
|
|
114
116
|
? 'primary'
|
|
115
117
|
: 'default'
|
|
116
118
|
: 'ghost'
|
|
@@ -121,25 +123,25 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
121
123
|
))}
|
|
122
124
|
</Tabs.Tablist>
|
|
123
125
|
{!hoistStatusbar && (
|
|
124
|
-
<div role='none' className='grid grid-cols-1 auto-rows-
|
|
125
|
-
<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} />
|
|
126
128
|
</div>
|
|
127
129
|
)}
|
|
128
|
-
<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'>
|
|
129
131
|
<ToggleComplementarySidebarButton />
|
|
130
132
|
</div>
|
|
131
133
|
</div>
|
|
132
134
|
{activeId &&
|
|
133
135
|
companions.map((companion) => (
|
|
134
136
|
<Tabs.Tabpanel
|
|
135
|
-
key={
|
|
136
|
-
value={
|
|
137
|
+
key={getCompanionVariant(companion.id)}
|
|
138
|
+
value={getCompanionVariant(companion.id)}
|
|
137
139
|
classNames={[
|
|
138
140
|
'absolute data-[state="inactive"]:-z-[1] overflow-hidden',
|
|
139
|
-
'inset-
|
|
140
|
-
'grid grid-cols-1 grid-rows-[var(--rail-size)_1fr_min-content]
|
|
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)]',
|
|
141
143
|
]}
|
|
142
|
-
{...(
|
|
144
|
+
{...(state.complementarySidebarState !== 'expanded' && { inert: true })}
|
|
143
145
|
>
|
|
144
146
|
<ComplementarySidebarPanel
|
|
145
147
|
companion={companion}
|
|
@@ -167,48 +169,52 @@ type ComplementarySidebarPanelProps = {
|
|
|
167
169
|
const ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar }: ComplementarySidebarPanelProps) => {
|
|
168
170
|
const { t } = useTranslation(meta.id);
|
|
169
171
|
|
|
170
|
-
if (
|
|
172
|
+
if (getCompanionVariant(companion.id) !== activeId && !data) {
|
|
171
173
|
return null;
|
|
172
174
|
}
|
|
173
175
|
|
|
174
|
-
const Wrapper = companion.properties.fixed ? Fragment :
|
|
176
|
+
const Wrapper = companion.properties.fixed ? Fragment : ScrollAreaWrapper;
|
|
175
177
|
|
|
176
178
|
return (
|
|
177
179
|
<>
|
|
178
|
-
<div role='none' className='flex items-center p-1 gap-1 border-
|
|
180
|
+
<div role='none' className='flex items-center p-1 gap-1 border-b border-subdued-separator'>
|
|
179
181
|
<IconButton
|
|
180
182
|
label={toLocalizedString(companion.properties.label, t)}
|
|
181
183
|
icon={companion.properties.icon}
|
|
182
184
|
iconOnly
|
|
183
185
|
tooltipSide='left'
|
|
184
|
-
data-value={
|
|
185
|
-
classNames='
|
|
186
|
+
data-value={getCompanionVariant(companion.id)}
|
|
187
|
+
classNames='h-10 w-10'
|
|
186
188
|
variant='default'
|
|
187
189
|
/>
|
|
188
|
-
<div role='none' className='
|
|
190
|
+
<div role='none' className='px-1'>
|
|
189
191
|
{toLocalizedString(companion.properties.label, t)}
|
|
190
192
|
</div>
|
|
191
193
|
</div>
|
|
192
194
|
<Wrapper>
|
|
193
|
-
<Surface
|
|
194
|
-
role={`deck-companion--${
|
|
195
|
+
<Surface.Surface
|
|
196
|
+
role={`deck-companion--${getCompanionVariant(companion.id)}`}
|
|
195
197
|
data={data}
|
|
196
|
-
fallback={
|
|
198
|
+
fallback={PlankErrorFallback}
|
|
197
199
|
placeholder={<PlankLoading />}
|
|
198
200
|
/>
|
|
199
201
|
</Wrapper>
|
|
200
202
|
{!hoistStatusbar && (
|
|
201
203
|
<div
|
|
202
204
|
role='contentinfo'
|
|
203
|
-
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)]'
|
|
204
206
|
>
|
|
205
|
-
<Surface role='status-bar--r1-footer' limit={1} />
|
|
207
|
+
<Surface.Surface role='status-bar--r1-footer' limit={1} />
|
|
206
208
|
</div>
|
|
207
209
|
)}
|
|
208
210
|
</>
|
|
209
211
|
);
|
|
210
212
|
};
|
|
211
213
|
|
|
212
|
-
const
|
|
213
|
-
return
|
|
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
|
+
);
|
|
214
220
|
};
|
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface
|
|
7
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
8
8
|
import { type Label, Main } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import { useBreakpoints, useHoistStatusbar } from '../../hooks';
|
|
10
|
+
import { useBreakpoints, useDeckState, useHoistStatusbar } from '../../hooks';
|
|
12
11
|
import { meta } from '../../meta';
|
|
13
12
|
import { getMode } from '../../types';
|
|
14
13
|
import { layoutAppliesTopbar } from '../../util';
|
|
@@ -16,7 +15,8 @@ import { layoutAppliesTopbar } from '../../util';
|
|
|
16
15
|
const label = ['sidebar title', { ns: meta.id }] satisfies Label;
|
|
17
16
|
|
|
18
17
|
export const Sidebar = () => {
|
|
19
|
-
const {
|
|
18
|
+
const { state, deck } = useDeckState();
|
|
19
|
+
const { popoverAnchorId, activeDeck: current } = state;
|
|
20
20
|
const breakpoint = useBreakpoints();
|
|
21
21
|
const layoutMode = getMode(deck);
|
|
22
22
|
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
@@ -32,11 +32,11 @@ export const Sidebar = () => {
|
|
|
32
32
|
label={label}
|
|
33
33
|
classNames={[
|
|
34
34
|
'grid',
|
|
35
|
-
topbar && '
|
|
36
|
-
hoistStatusbar && '
|
|
35
|
+
topbar && 'top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]',
|
|
36
|
+
hoistStatusbar && 'bottom-(--dx-statusbar-size)',
|
|
37
37
|
]}
|
|
38
38
|
>
|
|
39
|
-
<Surface role='navigation' data={navigationData} limit={1} />
|
|
39
|
+
<Surface.Surface role='navigation' data={navigationData} limit={1} />
|
|
40
40
|
</Main.NavigationSidebar>
|
|
41
41
|
);
|
|
42
42
|
};
|
|
@@ -4,20 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
|
+
import { LayoutOperation, getCompanionVariant } from '@dxos/app-toolkit';
|
|
9
9
|
import { IconButton, type IconButtonProps, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
import { getCompanionId, useDeckCompanions } from '../../hooks';
|
|
11
|
+
import { useDeckCompanions, useDeckState } from '../../hooks';
|
|
13
12
|
import { meta } from '../../meta';
|
|
14
13
|
|
|
15
14
|
export const ToggleSidebarButton = ({
|
|
16
15
|
classNames,
|
|
17
16
|
variant = 'ghost',
|
|
18
17
|
}: ThemedClassName<Pick<IconButtonProps, 'variant'>>) => {
|
|
19
|
-
const
|
|
18
|
+
const { updateState } = useDeckState();
|
|
20
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
|
+
|
|
21
28
|
return (
|
|
22
29
|
<IconButton
|
|
23
30
|
variant={variant}
|
|
@@ -25,17 +32,20 @@ export const ToggleSidebarButton = ({
|
|
|
25
32
|
iconOnly
|
|
26
33
|
size={4}
|
|
27
34
|
label={t('open navigation sidebar label')}
|
|
28
|
-
onClick={
|
|
29
|
-
(layoutContext.sidebarState = layoutContext.sidebarState === 'expanded' ? 'collapsed' : 'expanded')
|
|
30
|
-
}
|
|
35
|
+
onClick={handleClick}
|
|
31
36
|
classNames={classNames}
|
|
32
37
|
/>
|
|
33
38
|
);
|
|
34
39
|
};
|
|
35
40
|
|
|
36
41
|
export const CloseSidebarButton = () => {
|
|
37
|
-
const
|
|
42
|
+
const { updateState } = useDeckState();
|
|
38
43
|
const { t } = useTranslation(meta.id);
|
|
44
|
+
|
|
45
|
+
const handleClick = useCallback(() => {
|
|
46
|
+
updateState((state) => ({ ...state, sidebarState: 'collapsed' }));
|
|
47
|
+
}, [updateState]);
|
|
48
|
+
|
|
39
49
|
return (
|
|
40
50
|
<IconButton
|
|
41
51
|
variant='ghost'
|
|
@@ -43,8 +53,8 @@ export const CloseSidebarButton = () => {
|
|
|
43
53
|
iconOnly
|
|
44
54
|
size={4}
|
|
45
55
|
label={t('close navigation sidebar label')}
|
|
46
|
-
onClick={
|
|
47
|
-
classNames='rounded-none
|
|
56
|
+
onClick={handleClick}
|
|
57
|
+
classNames='rounded-none px-1 dx-focus-ring-inset pe-[max(.5rem,env(safe-area-inset-left))]'
|
|
48
58
|
/>
|
|
49
59
|
);
|
|
50
60
|
};
|
|
@@ -54,24 +64,20 @@ export const ToggleComplementarySidebarButton = ({
|
|
|
54
64
|
classNames,
|
|
55
65
|
current,
|
|
56
66
|
}: ThemedClassName<{ inR0?: boolean; current?: string }>) => {
|
|
57
|
-
const {
|
|
58
|
-
const
|
|
67
|
+
const { invokeSync } = useOperationInvoker();
|
|
68
|
+
const { state, updateState } = useDeckState();
|
|
59
69
|
const { t } = useTranslation(meta.id);
|
|
60
70
|
|
|
61
71
|
const companions = useDeckCompanions();
|
|
62
|
-
const handleClick = useCallback(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
part: 'complementary',
|
|
70
|
-
subject: getCompanionId(firstCompanion.id),
|
|
71
|
-
}),
|
|
72
|
-
);
|
|
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 });
|
|
73
79
|
}
|
|
74
|
-
}, [
|
|
80
|
+
}, [state, updateState, current, companions, invokeSync]);
|
|
75
81
|
|
|
76
82
|
return (
|
|
77
83
|
<IconButton
|
|
@@ -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');
|
package/src/components/index.ts
CHANGED
|
@@ -5,43 +5,50 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Input, Select, useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import {
|
|
8
|
+
import { Settings } from '@dxos/react-ui-form';
|
|
9
9
|
|
|
10
10
|
import { meta } from '../../meta';
|
|
11
11
|
import {
|
|
12
12
|
type DeckSettingsProps,
|
|
13
13
|
type NewPlankPositioning,
|
|
14
14
|
NewPlankPositions,
|
|
15
|
+
OverScrollToProps,
|
|
15
16
|
type Overscroll,
|
|
16
|
-
OverscrollOptions,
|
|
17
17
|
} from '../../types';
|
|
18
18
|
|
|
19
19
|
const isSocket = !!(globalThis as any).__args;
|
|
20
20
|
|
|
21
|
-
export
|
|
21
|
+
export type DeckSettingsComponentProps = {
|
|
22
|
+
settings: DeckSettingsProps;
|
|
23
|
+
onSettingsChange: (fn: (current: DeckSettingsProps) => DeckSettingsProps) => void;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const DeckSettings = ({ settings, onSettingsChange }: DeckSettingsComponentProps) => {
|
|
22
27
|
const { t } = useTranslation(meta.id);
|
|
23
28
|
|
|
24
29
|
return (
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
<
|
|
30
|
+
<Settings.Root>
|
|
31
|
+
<Settings.Section title={t('settings title', { ns: meta.id })}>
|
|
32
|
+
<Settings.Group>
|
|
33
|
+
<Settings.ItemInput title={t('settings enable deck label')}>
|
|
29
34
|
<Input.Switch
|
|
30
35
|
checked={settings.enableDeck}
|
|
31
|
-
onCheckedChange={(checked) => (
|
|
36
|
+
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, enableDeck: checked }))}
|
|
32
37
|
/>
|
|
33
|
-
</
|
|
34
|
-
<
|
|
38
|
+
</Settings.ItemInput>
|
|
39
|
+
<Settings.ItemInput title={t('settings encapsulated planks label')}>
|
|
35
40
|
<Input.Switch
|
|
36
41
|
checked={settings.encapsulatedPlanks ?? false}
|
|
37
|
-
onCheckedChange={(checked) => (
|
|
42
|
+
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, encapsulatedPlanks: checked }))}
|
|
38
43
|
/>
|
|
39
|
-
</
|
|
40
|
-
<
|
|
44
|
+
</Settings.ItemInput>
|
|
45
|
+
<Settings.ItemInput title={t('select new plank positioning label')}>
|
|
41
46
|
<Select.Root
|
|
42
47
|
disabled={!settings.enableDeck}
|
|
43
48
|
value={settings.newPlankPositioning ?? 'start'}
|
|
44
|
-
onValueChange={(value) =>
|
|
49
|
+
onValueChange={(value) =>
|
|
50
|
+
onSettingsChange((s) => ({ ...s, newPlankPositioning: value as NewPlankPositioning }))
|
|
51
|
+
}
|
|
45
52
|
>
|
|
46
53
|
<Select.TriggerButton placeholder={t('select new plank positioning placeholder')} />
|
|
47
54
|
<Select.Portal>
|
|
@@ -57,18 +64,18 @@ export const DeckSettings = ({ settings }: { settings: DeckSettingsProps }) => {
|
|
|
57
64
|
</Select.Content>
|
|
58
65
|
</Select.Portal>
|
|
59
66
|
</Select.Root>
|
|
60
|
-
</
|
|
61
|
-
<
|
|
67
|
+
</Settings.ItemInput>
|
|
68
|
+
<Settings.ItemInput title={t('settings overscroll label')}>
|
|
62
69
|
<Select.Root
|
|
63
70
|
disabled={!settings.enableDeck}
|
|
64
71
|
value={settings.overscroll ?? 'none'}
|
|
65
|
-
onValueChange={(value) => (
|
|
72
|
+
onValueChange={(value) => onSettingsChange((s) => ({ ...s, overscroll: value as Overscroll }))}
|
|
66
73
|
>
|
|
67
74
|
<Select.TriggerButton placeholder={t('select overscroll placeholder')} />
|
|
68
75
|
<Select.Portal>
|
|
69
76
|
<Select.Content>
|
|
70
77
|
<Select.Viewport>
|
|
71
|
-
{
|
|
78
|
+
{OverScrollToProps.map((option) => (
|
|
72
79
|
<Select.Option key={option} value={option}>
|
|
73
80
|
{t(`settings overscroll ${option} label`)}
|
|
74
81
|
</Select.Option>
|
|
@@ -78,26 +85,29 @@ export const DeckSettings = ({ settings }: { settings: DeckSettingsProps }) => {
|
|
|
78
85
|
</Select.Content>
|
|
79
86
|
</Select.Portal>
|
|
80
87
|
</Select.Root>
|
|
81
|
-
</
|
|
82
|
-
<
|
|
88
|
+
</Settings.ItemInput>
|
|
89
|
+
<Settings.ItemInput title={t('settings enable statusbar label')}>
|
|
83
90
|
<Input.Switch
|
|
84
91
|
checked={settings.enableStatusbar}
|
|
85
|
-
onCheckedChange={(checked) => (
|
|
92
|
+
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, enableStatusbar: checked }))}
|
|
93
|
+
/>
|
|
94
|
+
</Settings.ItemInput>
|
|
95
|
+
<Settings.ItemInput title={t('settings show hints label')}>
|
|
96
|
+
<Input.Switch
|
|
97
|
+
checked={settings.showHints}
|
|
98
|
+
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, showHints: checked }))}
|
|
86
99
|
/>
|
|
87
|
-
</
|
|
88
|
-
<ControlItemInput title={t('settings show hints label')}>
|
|
89
|
-
<Input.Switch checked={settings.showHints} onCheckedChange={(checked) => (settings.showHints = checked)} />
|
|
90
|
-
</ControlItemInput>
|
|
100
|
+
</Settings.ItemInput>
|
|
91
101
|
{!isSocket && (
|
|
92
|
-
<
|
|
102
|
+
<Settings.ItemInput title={t('settings native redirect label')}>
|
|
93
103
|
<Input.Switch
|
|
94
104
|
checked={settings.enableNativeRedirect}
|
|
95
|
-
onCheckedChange={(checked) => (
|
|
105
|
+
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, enableNativeRedirect: checked }))}
|
|
96
106
|
/>
|
|
97
|
-
</
|
|
107
|
+
</Settings.ItemInput>
|
|
98
108
|
)}
|
|
99
|
-
</
|
|
100
|
-
</
|
|
101
|
-
</
|
|
109
|
+
</Settings.Group>
|
|
110
|
+
</Settings.Section>
|
|
111
|
+
</Settings.Root>
|
|
102
112
|
);
|
|
103
113
|
};
|
package/src/hooks/index.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
export * from './useBreakpoints';
|
|
6
6
|
export * from './useCompanions';
|
|
7
7
|
export * from './useDeckCompanions';
|
|
8
|
+
export * from './useDeckState';
|
|
8
9
|
export * from './useHoistStatusbar';
|
|
9
10
|
export * from './useMainSize';
|
|
10
11
|
export * from './useNodeActionExpander';
|
|
12
|
+
export * from './useSelectedCompanion';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { useAppGraph } from '@dxos/app-
|
|
7
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
8
8
|
import { useConnections } from '@dxos/plugin-graph';
|
|
9
9
|
import { byPosition } from '@dxos/util';
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ import { PLANK_COMPANION_TYPE } from '../types';
|
|
|
12
12
|
|
|
13
13
|
export const useCompanions = (id?: string) => {
|
|
14
14
|
const { graph } = useAppGraph();
|
|
15
|
-
const nodes = useConnections(graph, id);
|
|
15
|
+
const nodes = useConnections(graph, id, 'child');
|
|
16
16
|
const companions = nodes.filter((node) => node.type === PLANK_COMPANION_TYPE);
|
|
17
17
|
return useMemo(() => companions.toSorted((a, b) => byPosition(a.properties, b.properties)), [companions]);
|
|
18
18
|
};
|
|
@@ -2,19 +2,15 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
6
|
+
import { Node, type Node as NodeType } from '@dxos/plugin-graph';
|
|
7
|
+
import { useConnections } from '@dxos/plugin-graph';
|
|
8
|
+
import { type Label } from '@dxos/ui-types';
|
|
8
9
|
import { type Position, byPosition } from '@dxos/util';
|
|
9
10
|
|
|
10
|
-
import {
|
|
11
|
+
import { DECK_COMPANION_TYPE } from '../types';
|
|
11
12
|
|
|
12
|
-
export
|
|
13
|
-
const [_, companionId] = id.split(ATTENDABLE_PATH_SEPARATOR);
|
|
14
|
-
return companionId ?? 'never';
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type DeckCompanion = Node<
|
|
13
|
+
export type DeckCompanion = NodeType.Node<
|
|
18
14
|
any,
|
|
19
15
|
{
|
|
20
16
|
label: Label;
|
|
@@ -28,7 +24,7 @@ export type DeckCompanion = Node<
|
|
|
28
24
|
|
|
29
25
|
export const useDeckCompanions = (): DeckCompanion[] => {
|
|
30
26
|
const { graph } = useAppGraph();
|
|
31
|
-
const connections = useConnections(graph,
|
|
27
|
+
const connections = useConnections(graph, Node.RootId, 'child');
|
|
32
28
|
const companions = connections.filter((node) => node.type === DECK_COMPANION_TYPE) as DeckCompanion[];
|
|
33
29
|
return companions.toSorted((a, b) => byPosition(a.properties, b.properties));
|
|
34
30
|
};
|