@dxos/plugin-deck 0.8.4-main.f5c0578 → 0.8.4-main.fcfe5033a5
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/add-toast-3V7TYC2M.mjs +24 -0
- package/dist/lib/browser/add-toast-3V7TYC2M.mjs.map +7 -0
- package/dist/lib/browser/adjust-ZMPN7P7J.mjs +96 -0
- package/dist/lib/browser/adjust-ZMPN7P7J.mjs.map +7 -0
- package/dist/lib/browser/change-companion-F7GCREGM.mjs +34 -0
- package/dist/lib/browser/change-companion-F7GCREGM.mjs.map +7 -0
- package/dist/lib/browser/chunk-BRZAVPMC.mjs +48 -0
- package/dist/lib/browser/chunk-BRZAVPMC.mjs.map +7 -0
- package/dist/lib/browser/chunk-DF2VZ6W3.mjs +69 -0
- package/dist/lib/browser/chunk-DF2VZ6W3.mjs.map +7 -0
- package/dist/lib/browser/chunk-FUWSZ6IC.mjs +88 -0
- package/dist/lib/browser/chunk-FUWSZ6IC.mjs.map +7 -0
- package/dist/lib/browser/chunk-GN52IRQ7.mjs +216 -0
- package/dist/lib/browser/chunk-GN52IRQ7.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-KUTDCWZF.mjs +30 -0
- package/dist/lib/browser/chunk-KUTDCWZF.mjs.map +7 -0
- package/dist/lib/browser/close-N2F26CVG.mjs +44 -0
- package/dist/lib/browser/close-N2F26CVG.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +161 -134
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/open-VWO7VOOU.mjs +150 -0
- package/dist/lib/browser/open-VWO7VOOU.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +13 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/revert-workspace-LGKZZKCI.mjs +21 -0
- package/dist/lib/browser/revert-workspace-LGKZZKCI.mjs.map +7 -0
- package/dist/lib/browser/scroll-into-view-TSVSNKIH.mjs +21 -0
- package/dist/lib/browser/scroll-into-view-TSVSNKIH.mjs.map +7 -0
- package/dist/lib/browser/set-N2LGA2BY.mjs +37 -0
- package/dist/lib/browser/set-N2LGA2BY.mjs.map +7 -0
- package/dist/lib/browser/set-layout-mode-TONTQO6G.mjs +90 -0
- package/dist/lib/browser/set-layout-mode-TONTQO6G.mjs.map +7 -0
- package/dist/lib/browser/show-undo-IFXNEIQY.mjs +59 -0
- package/dist/lib/browser/show-undo-IFXNEIQY.mjs.map +7 -0
- package/dist/lib/browser/switch-workspace-ZJDC5SSR.mjs +68 -0
- package/dist/lib/browser/switch-workspace-ZJDC5SSR.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +12 -12
- package/dist/lib/browser/update-complementary-ELUOK3GD.mjs +28 -0
- package/dist/lib/browser/update-complementary-ELUOK3GD.mjs.map +7 -0
- package/dist/lib/browser/update-dialog-LMGLOTWX.mjs +29 -0
- package/dist/lib/browser/update-dialog-LMGLOTWX.mjs.map +7 -0
- package/dist/lib/browser/update-plank-size-WQAPELII.mjs +28 -0
- package/dist/lib/browser/update-plank-size-WQAPELII.mjs.map +7 -0
- package/dist/lib/browser/update-popover-P6YO6FWJ.mjs +33 -0
- package/dist/lib/browser/update-popover-P6YO6FWJ.mjs.map +7 -0
- package/dist/lib/browser/update-sidebar-NGWS6IDJ.mjs +25 -0
- package/dist/lib/browser/update-sidebar-NGWS6IDJ.mjs.map +7 -0
- package/dist/lib/node-esm/add-toast-G4OQEGOS.mjs +25 -0
- package/dist/lib/node-esm/add-toast-G4OQEGOS.mjs.map +7 -0
- package/dist/lib/node-esm/adjust-KSNI7C3B.mjs +97 -0
- package/dist/lib/node-esm/adjust-KSNI7C3B.mjs.map +7 -0
- package/dist/lib/node-esm/change-companion-LCJPT6AX.mjs +35 -0
- package/dist/lib/node-esm/change-companion-LCJPT6AX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4ED7B7OZ.mjs +217 -0
- package/dist/lib/node-esm/chunk-4ED7B7OZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7KL65RLL.mjs +89 -0
- package/dist/lib/node-esm/chunk-7KL65RLL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-IRWCUYJY.mjs +71 -0
- package/dist/lib/node-esm/chunk-IRWCUYJY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MB4SDDVY.mjs +50 -0
- package/dist/lib/node-esm/chunk-MB4SDDVY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MLVJ2ODW.mjs +32 -0
- package/dist/lib/node-esm/chunk-MLVJ2ODW.mjs.map +7 -0
- package/dist/lib/node-esm/close-YHIBVE2S.mjs +45 -0
- package/dist/lib/node-esm/close-YHIBVE2S.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +202 -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/open-353DYMMN.mjs +151 -0
- package/dist/lib/node-esm/open-353DYMMN.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +14 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/revert-workspace-OS5R3PFJ.mjs +22 -0
- package/dist/lib/node-esm/revert-workspace-OS5R3PFJ.mjs.map +7 -0
- package/dist/lib/node-esm/scroll-into-view-LC2SVKCW.mjs +22 -0
- package/dist/lib/node-esm/scroll-into-view-LC2SVKCW.mjs.map +7 -0
- package/dist/lib/node-esm/set-3EZ7LJFU.mjs +38 -0
- package/dist/lib/node-esm/set-3EZ7LJFU.mjs.map +7 -0
- package/dist/lib/node-esm/set-layout-mode-3YBHGEK6.mjs +91 -0
- package/dist/lib/node-esm/set-layout-mode-3YBHGEK6.mjs.map +7 -0
- package/dist/lib/node-esm/show-undo-RAHLRPUU.mjs +60 -0
- package/dist/lib/node-esm/show-undo-RAHLRPUU.mjs.map +7 -0
- package/dist/lib/node-esm/switch-workspace-S6CXDPXZ.mjs +69 -0
- package/dist/lib/node-esm/switch-workspace-S6CXDPXZ.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +33 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/lib/node-esm/update-complementary-V5Y2RMYL.mjs +29 -0
- package/dist/lib/node-esm/update-complementary-V5Y2RMYL.mjs.map +7 -0
- package/dist/lib/node-esm/update-dialog-IMTCLAWR.mjs +30 -0
- package/dist/lib/node-esm/update-dialog-IMTCLAWR.mjs.map +7 -0
- package/dist/lib/node-esm/update-plank-size-I3DKCPHZ.mjs +29 -0
- package/dist/lib/node-esm/update-plank-size-I3DKCPHZ.mjs.map +7 -0
- package/dist/lib/node-esm/update-popover-7JX3KWYL.mjs +34 -0
- package/dist/lib/node-esm/update-popover-7JX3KWYL.mjs.map +7 -0
- package/dist/lib/node-esm/update-sidebar-B5DCSREP.mjs +26 -0
- package/dist/lib/node-esm/update-sidebar-B5DCSREP.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.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts +17 -2
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +196 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root.d.ts +4 -2
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +5 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +134 -44
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/tools.d.ts +4 -3
- package/dist/types/src/capabilities/tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-handler.d.ts +3 -2
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +4 -4
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts +71 -0
- package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/DeckSettings/index.d.ts +1 -1
- package/dist/types/src/components/DeckSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/Matrix/Matrix.d.ts +41 -0
- package/dist/types/src/components/Matrix/Matrix.d.ts.map +1 -0
- package/dist/types/src/components/Matrix/Matrix.stories.d.ts +17 -0
- package/dist/types/src/components/Matrix/Matrix.stories.d.ts.map +1 -0
- package/dist/types/src/components/Matrix/index.d.ts +3 -0
- package/dist/types/src/components/Matrix/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +3 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/Deck/Banner.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/Deck.d.ts +25 -0
- package/dist/types/src/containers/Deck/Deck.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/Deck.stories.d.ts +71 -0
- package/dist/types/src/containers/Deck/Deck.stories.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckContent.d.ts +7 -0
- package/dist/types/src/containers/Deck/DeckContent.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckRoot.d.ts +42 -0
- package/dist/types/src/containers/Deck/DeckRoot.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/DeckViewport.d.ts +19 -0
- package/dist/types/src/containers/Deck/DeckViewport.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/StatusBar.d.ts.map +1 -0
- package/dist/types/src/containers/Deck/index.d.ts +2 -0
- package/dist/types/src/containers/Deck/index.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/ActiveNode.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.d.ts +5 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts +73 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/Dialog.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/Fallback.d.ts +2 -0
- package/dist/types/src/containers/DeckLayout/Fallback.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/Popover.d.ts +5 -0
- package/dist/types/src/containers/DeckLayout/Popover.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/Toast.d.ts +10 -0
- package/dist/types/src/containers/DeckLayout/Toast.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/constants.d.ts.map +1 -0
- package/dist/types/src/containers/DeckLayout/index.d.ts +4 -0
- package/dist/types/src/containers/DeckLayout/index.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/Plank.d.ts +17 -0
- package/dist/types/src/containers/Plank/Plank.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/Plank.stories.d.ts +71 -0
- package/dist/types/src/containers/Plank/Plank.stories.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankComponent.d.ts +17 -0
- package/dist/types/src/containers/Plank/PlankComponent.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankContent.d.ts +10 -0
- package/dist/types/src/containers/Plank/PlankContent.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Plank/PlankControls.d.ts +5 -6
- package/dist/types/src/containers/Plank/PlankControls.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankError.d.ts +15 -0
- package/dist/types/src/containers/Plank/PlankError.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Plank/PlankHeading.d.ts +5 -4
- package/dist/types/src/containers/Plank/PlankHeading.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Plank/PlankLoading.d.ts.map +1 -1
- package/dist/types/src/containers/Plank/PlankRoot.d.ts +37 -0
- package/dist/types/src/containers/Plank/PlankRoot.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/index.d.ts +4 -0
- package/dist/types/src/containers/Plank/index.d.ts.map +1 -0
- package/dist/types/src/containers/Sidebar/ComplementarySidebar.d.ts.map +1 -0
- package/dist/types/src/containers/Sidebar/Sidebar.d.ts.map +1 -0
- package/dist/types/src/containers/Sidebar/SidebarButton.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/Sidebar/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +6 -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 +20 -9
- package/dist/types/src/layout.d.ts.map +1 -1
- package/dist/types/src/layout.test.d.ts +2 -0
- package/dist/types/src/layout.test.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/add-toast.d.ts +5 -0
- package/dist/types/src/operations/add-toast.d.ts.map +1 -0
- package/dist/types/src/operations/adjust.d.ts +5 -0
- package/dist/types/src/operations/adjust.d.ts.map +1 -0
- package/dist/types/src/operations/change-companion.d.ts +5 -0
- package/dist/types/src/operations/change-companion.d.ts.map +1 -0
- package/dist/types/src/operations/close.d.ts +5 -0
- package/dist/types/src/operations/close.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +18 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/helpers.d.ts +3 -0
- package/dist/types/src/operations/helpers.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/open.d.ts +5 -0
- package/dist/types/src/operations/open.d.ts.map +1 -0
- package/dist/types/src/operations/revert-workspace.d.ts +5 -0
- package/dist/types/src/operations/revert-workspace.d.ts.map +1 -0
- package/dist/types/src/operations/scroll-into-view.d.ts +5 -0
- package/dist/types/src/operations/scroll-into-view.d.ts.map +1 -0
- package/dist/types/src/operations/set-layout-mode.d.ts +9 -0
- package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -0
- package/dist/types/src/operations/set.d.ts +5 -0
- package/dist/types/src/operations/set.d.ts.map +1 -0
- package/dist/types/src/operations/show-undo.d.ts +5 -0
- package/dist/types/src/operations/show-undo.d.ts.map +1 -0
- package/dist/types/src/operations/switch-workspace.d.ts +5 -0
- package/dist/types/src/operations/switch-workspace.d.ts.map +1 -0
- package/dist/types/src/operations/update-complementary.d.ts +5 -0
- package/dist/types/src/operations/update-complementary.d.ts.map +1 -0
- package/dist/types/src/operations/update-dialog.d.ts +5 -0
- package/dist/types/src/operations/update-dialog.d.ts.map +1 -0
- package/dist/types/src/operations/update-plank-size.d.ts +5 -0
- package/dist/types/src/operations/update-plank-size.d.ts.map +1 -0
- package/dist/types/src/operations/update-popover.d.ts +5 -0
- package/dist/types/src/operations/update-popover.d.ts.map +1 -0
- package/dist/types/src/operations/update-sidebar.d.ts +5 -0
- package/dist/types/src/operations/update-sidebar.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +52 -52
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +11 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/{capabilities → types}/capabilities.d.ts +103 -96
- 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 +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +68 -56
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +2 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -1
- package/dist/types/src/util/plank-url-params.d.ts +14 -0
- package/dist/types/src/util/plank-url-params.d.ts.map +1 -0
- package/dist/types/src/util/plank-url-params.test.d.ts +2 -0
- package/dist/types/src/util/plank-url-params.test.d.ts.map +1 -0
- package/dist/types/src/util/sanitize-persisted-state.d.ts +19 -0
- package/dist/types/src/util/sanitize-persisted-state.d.ts.map +1 -0
- package/dist/types/src/util/sanitize-persisted-state.test.d.ts +2 -0
- package/dist/types/src/util/sanitize-persisted-state.test.d.ts.map +1 -0
- package/dist/types/src/util/set-active.d.ts +19 -4
- package/dist/types/src/util/set-active.d.ts.map +1 -1
- package/dist/types/src/util/set-active.test.d.ts +2 -0
- package/dist/types/src/util/set-active.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +87 -49
- package/src/DeckPlugin.ts +43 -69
- package/src/capabilities/app-graph-builder.ts +112 -127
- package/src/capabilities/check-app-scheme.ts +123 -24
- package/src/capabilities/index.ts +13 -14
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-root.tsx +37 -29
- package/src/capabilities/react-surface.tsx +28 -22
- package/src/capabilities/settings.ts +30 -19
- package/src/capabilities/state.ts +74 -88
- package/src/capabilities/tools.ts +57 -50
- package/src/capabilities/url-handler.ts +221 -50
- package/src/components/DeckSettings/DeckSettings.stories.tsx +37 -0
- package/src/components/DeckSettings/DeckSettings.tsx +55 -70
- package/src/components/DeckSettings/index.ts +2 -2
- package/src/components/Matrix/Matrix.stories.tsx +216 -0
- package/src/components/Matrix/Matrix.tsx +205 -0
- package/src/components/Matrix/SPEC.md +219 -0
- package/src/components/Matrix/index.ts +6 -0
- package/src/components/index.ts +6 -3
- package/src/{components/DeckLayout → containers/Deck}/Banner.tsx +13 -11
- package/src/containers/Deck/Deck.stories.tsx +81 -0
- package/src/containers/Deck/Deck.tsx +21 -0
- package/src/containers/Deck/DeckContent.tsx +105 -0
- package/src/containers/Deck/DeckRoot.tsx +50 -0
- package/src/containers/Deck/DeckViewport.tsx +456 -0
- package/src/{components/DeckLayout → containers/Deck}/StatusBar.tsx +4 -4
- package/src/containers/Deck/index.ts +5 -0
- package/src/{components → containers}/DeckLayout/ActiveNode.tsx +8 -3
- package/src/containers/DeckLayout/DeckLayout.stories.tsx +393 -0
- package/src/containers/DeckLayout/DeckLayout.tsx +62 -0
- package/src/containers/DeckLayout/Dialog.tsx +52 -0
- package/src/containers/DeckLayout/Fallback.tsx +24 -0
- package/src/containers/DeckLayout/Popover.tsx +161 -0
- package/src/{components → containers}/DeckLayout/Toast.tsx +30 -5
- package/src/{components → containers}/DeckLayout/constants.ts +1 -0
- package/src/{components → containers}/DeckLayout/index.ts +3 -2
- package/src/containers/Plank/Plank.stories.tsx +106 -0
- package/src/containers/Plank/Plank.tsx +22 -0
- package/src/containers/Plank/PlankComponent.tsx +217 -0
- package/src/containers/Plank/PlankContent.tsx +45 -0
- package/src/{components → containers}/Plank/PlankControls.tsx +45 -38
- package/src/containers/Plank/PlankError.tsx +79 -0
- package/src/{components → containers}/Plank/PlankHeading.tsx +68 -64
- package/src/{components → containers}/Plank/PlankLoading.tsx +1 -1
- package/src/containers/Plank/PlankRoot.tsx +49 -0
- package/src/{components → containers}/Plank/index.ts +0 -2
- package/src/containers/Sidebar/ComplementarySidebar.tsx +209 -0
- package/src/containers/Sidebar/Sidebar.tsx +44 -0
- package/src/containers/Sidebar/SidebarButton.tsx +94 -0
- package/src/containers/index.ts +11 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useCompanions.ts +3 -3
- package/src/hooks/useDeckCompanions.ts +7 -10
- package/src/hooks/useDeckState.ts +73 -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.test.ts +59 -0
- package/src/layout.ts +38 -40
- package/src/meta.ts +8 -5
- package/src/operations/add-toast.ts +24 -0
- package/src/operations/adjust.ts +83 -0
- package/src/operations/change-companion.ts +35 -0
- package/src/operations/close.ts +35 -0
- package/src/operations/definitions.ts +62 -0
- package/src/operations/helpers.ts +22 -0
- package/src/operations/index.ts +26 -0
- package/src/operations/open.ts +184 -0
- package/src/operations/revert-workspace.ts +22 -0
- package/src/operations/scroll-into-view.ts +24 -0
- package/src/operations/set-layout-mode.ts +84 -0
- package/src/operations/set.ts +36 -0
- package/src/operations/show-undo.ts +47 -0
- package/src/operations/switch-workspace.ts +60 -0
- package/src/operations/update-complementary.ts +33 -0
- package/src/operations/update-dialog.ts +34 -0
- package/src/operations/update-plank-size.ts +29 -0
- package/src/operations/update-popover.ts +36 -0
- package/src/operations/update-sidebar.ts +28 -0
- package/src/translations.ts +52 -52
- package/src/types/Settings.ts +17 -0
- package/src/types/capabilities.ts +35 -0
- package/src/types/events.ts +21 -0
- package/src/types/index.ts +3 -0
- package/src/types/schema.ts +52 -50
- package/src/util/index.ts +2 -1
- package/src/util/layoutAppliesTopbar.ts +2 -2
- package/src/util/plank-url-params.test.ts +85 -0
- package/src/util/plank-url-params.ts +36 -0
- package/src/util/sanitize-persisted-state.test.ts +79 -0
- package/src/util/sanitize-persisted-state.ts +52 -0
- package/src/util/set-active.test.ts +106 -0
- package/src/util/set-active.ts +50 -30
- package/src/vite-env.d.ts +5 -0
- package/dist/lib/browser/app-graph-builder-DVEKLXB4.mjs +0 -152
- package/dist/lib/browser/app-graph-builder-DVEKLXB4.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-3BQJXWEY.mjs +0 -32
- package/dist/lib/browser/check-app-scheme-3BQJXWEY.mjs.map +0 -7
- package/dist/lib/browser/chunk-6MQIYIPY.mjs +0 -1494
- package/dist/lib/browser/chunk-6MQIYIPY.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-F5BQOOEG.mjs +0 -160
- package/dist/lib/browser/chunk-F5BQOOEG.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-MX7WRVX3.mjs +0 -127
- package/dist/lib/browser/chunk-MX7WRVX3.mjs.map +0 -7
- package/dist/lib/browser/chunk-NRCPV6AV.mjs +0 -129
- package/dist/lib/browser/chunk-NRCPV6AV.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-2SUIIV6N.mjs +0 -521
- package/dist/lib/browser/intent-resolver-2SUIIV6N.mjs.map +0 -7
- package/dist/lib/browser/react-root-GVZANZX7.mjs +0 -43
- package/dist/lib/browser/react-root-GVZANZX7.mjs.map +0 -7
- package/dist/lib/browser/react-surface-NXSSD2GW.mjs +0 -40
- package/dist/lib/browser/react-surface-NXSSD2GW.mjs.map +0 -7
- package/dist/lib/browser/settings-LUPQPZ27.mjs +0 -29
- package/dist/lib/browser/settings-LUPQPZ27.mjs.map +0 -7
- package/dist/lib/browser/state-CRXR7X63.mjs +0 -12
- package/dist/lib/browser/toolkit-OBKFXX23.mjs +0 -47
- package/dist/lib/browser/toolkit-OBKFXX23.mjs.map +0 -7
- package/dist/lib/browser/url-handler-LROZYQ26.mjs +0 -70
- package/dist/lib/browser/url-handler-LROZYQ26.mjs.map +0 -7
- package/dist/types/src/capabilities/capabilities.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/toolkit.d.ts +0 -5
- package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Banner.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +0 -6
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Fallback.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Popover.d.ts +0 -5
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts +0 -5
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Topbar.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/Topbar.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/constants.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/index.d.ts +0 -4
- package/dist/types/src/components/DeckLayout/index.d.ts.map +0 -1
- package/dist/types/src/components/Plank/Plank.d.ts +0 -27
- package/dist/types/src/components/Plank/Plank.d.ts.map +0 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +0 -8
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +0 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +0 -1
- package/dist/types/src/components/Plank/PlankError.d.ts +0 -13
- package/dist/types/src/components/Plank/PlankError.d.ts.map +0 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts.map +0 -1
- package/dist/types/src/components/Plank/index.d.ts +0 -6
- package/dist/types/src/components/Plank/index.d.ts.map +0 -1
- package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +0 -1
- package/dist/types/src/components/Sidebar/Sidebar.d.ts.map +0 -1
- package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +0 -1
- package/dist/types/src/components/fragments.d.ts +0 -4
- package/dist/types/src/components/fragments.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/dist/types/src/util/overscroll.d.ts +0 -47
- package/dist/types/src/util/overscroll.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -14
- package/src/capabilities/intent-resolver.ts +0 -469
- package/src/capabilities/toolkit.ts +0 -55
- package/src/components/DeckLayout/ContentEmpty.tsx +0 -31
- package/src/components/DeckLayout/DeckLayout.tsx +0 -302
- package/src/components/DeckLayout/Dialog.tsx +0 -36
- package/src/components/DeckLayout/Fallback.tsx +0 -28
- package/src/components/DeckLayout/Popover.tsx +0 -104
- package/src/components/DeckLayout/Topbar.tsx +0 -11
- package/src/components/Plank/Plank.stories.tsx +0 -56
- package/src/components/Plank/Plank.tsx +0 -267
- package/src/components/Plank/PlankError.tsx +0 -49
- package/src/components/Sidebar/ComplementarySidebar.tsx +0 -194
- package/src/components/Sidebar/Sidebar.tsx +0 -42
- package/src/components/Sidebar/SidebarButton.tsx +0 -87
- package/src/components/fragments.ts +0 -14
- package/src/events.ts +0 -11
- package/src/util/overscroll.ts +0 -69
- /package/dist/lib/browser/{state-CRXR7X63.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/types/src/{components/DeckLayout → containers/Deck}/Banner.d.ts +0 -0
- /package/dist/types/src/{components/DeckLayout → containers/Deck}/StatusBar.d.ts +0 -0
- /package/dist/types/src/{components → containers}/DeckLayout/ActiveNode.d.ts +0 -0
- /package/dist/types/src/{components → containers}/DeckLayout/Dialog.d.ts +0 -0
- /package/dist/types/src/{components → containers}/DeckLayout/constants.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Plank/PlankLoading.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/ComplementarySidebar.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/Sidebar.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/SidebarButton.d.ts +0 -0
- /package/dist/types/src/{components → containers}/Sidebar/index.d.ts +0 -0
- /package/src/{components → containers}/Sidebar/index.ts +0 -0
|
@@ -1,1494 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getCompanionId,
|
|
3
|
-
useBreakpoints,
|
|
4
|
-
useCompanions,
|
|
5
|
-
useDeckCompanions,
|
|
6
|
-
useHoistStatusbar,
|
|
7
|
-
useMainSize,
|
|
8
|
-
useNodeActionExpander
|
|
9
|
-
} from "./chunk-MX7WRVX3.mjs";
|
|
10
|
-
import {
|
|
11
|
-
calculateOverscroll,
|
|
12
|
-
layoutAppliesTopbar,
|
|
13
|
-
parseEntryId
|
|
14
|
-
} from "./chunk-CNTGBCMK.mjs";
|
|
15
|
-
import {
|
|
16
|
-
DeckCapabilities
|
|
17
|
-
} from "./chunk-M57WD3V6.mjs";
|
|
18
|
-
import {
|
|
19
|
-
DeckAction,
|
|
20
|
-
NewPlankPositions,
|
|
21
|
-
OverscrollOptions,
|
|
22
|
-
PLANK_COMPANION_TYPE,
|
|
23
|
-
getMode
|
|
24
|
-
} from "./chunk-F5BQOOEG.mjs";
|
|
25
|
-
import {
|
|
26
|
-
DECK_PLUGIN
|
|
27
|
-
} from "./chunk-Z5KITAZW.mjs";
|
|
28
|
-
|
|
29
|
-
// src/components/DeckLayout/Banner.tsx
|
|
30
|
-
import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
|
|
31
|
-
import React9 from "react";
|
|
32
|
-
import { Surface as Surface5 } from "@dxos/app-framework";
|
|
33
|
-
import { useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
34
|
-
import { mx as mx4 } from "@dxos/react-ui-theme";
|
|
35
|
-
|
|
36
|
-
// src/components/Sidebar/ComplementarySidebar.tsx
|
|
37
|
-
import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
|
|
38
|
-
import React7, { Fragment as Fragment2, useCallback as useCallback5, useEffect as useEffect3, useMemo as useMemo3, useState as useState2 } from "react";
|
|
39
|
-
import { LayoutAction as LayoutAction4, Surface as Surface3, createIntent as createIntent5, useCapability as useCapability3, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
|
|
40
|
-
import { IconButton as IconButton4, Main, toLocalizedString as toLocalizedString2, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
41
|
-
import { Tabs } from "@dxos/react-ui-tabs";
|
|
42
|
-
|
|
43
|
-
// src/components/Plank/Plank.tsx
|
|
44
|
-
import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
|
|
45
|
-
import React5, { memo as memo2, useCallback as useCallback3, useLayoutEffect, useMemo as useMemo2, useRef } from "react";
|
|
46
|
-
import { LayoutAction as LayoutAction2, Surface as Surface2, createIntent as createIntent3, useAppGraph as useAppGraph2, useCapability, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
47
|
-
import { debounce } from "@dxos/async";
|
|
48
|
-
import { useNode } from "@dxos/plugin-graph";
|
|
49
|
-
import { ATTENDABLE_PATH_SEPARATOR, useAttentionAttributes } from "@dxos/react-ui-attention";
|
|
50
|
-
import { StackItem as StackItem2, railGridHorizontal } from "@dxos/react-ui-stack";
|
|
51
|
-
import { mainIntrinsicSize, mx as mx3 } from "@dxos/react-ui-theme";
|
|
52
|
-
|
|
53
|
-
// src/components/Plank/PlankError.tsx
|
|
54
|
-
import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
|
|
55
|
-
import React4, { useEffect as useEffect2, useState } from "react";
|
|
56
|
-
import { useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
57
|
-
import { descriptionMessage, mx as mx2 } from "@dxos/react-ui-theme";
|
|
58
|
-
|
|
59
|
-
// src/components/Plank/PlankHeading.tsx
|
|
60
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
61
|
-
import React2, { Fragment, memo, useCallback as useCallback2, useEffect, useMemo } from "react";
|
|
62
|
-
import { LayoutAction, Surface, createIntent as createIntent2, useAppGraph, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
63
|
-
import { Icon, IconButton as IconButton2, Popover, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
64
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
65
|
-
import { TextTooltip } from "@dxos/react-ui-text-tooltip";
|
|
66
|
-
import { hoverableControls, hoverableFocusedWithinControls } from "@dxos/react-ui-theme";
|
|
67
|
-
|
|
68
|
-
// src/components/fragments.ts
|
|
69
|
-
import { mx } from "@dxos/react-ui-theme";
|
|
70
|
-
var soloInlinePadding = "pis-[calc(env(safe-area-inset-left)+.25rem)] pie-[calc(env(safe-area-inset-left)+.25rem)]";
|
|
71
|
-
var sidebarToggleStyles = "bs-[--rail-item] is-[--rail-item] absolute block-end-2 z-[1] !bg-deckSurface lg:hidden";
|
|
72
|
-
var fixedSidebarToggleStyles = mx(sidebarToggleStyles, "inline-start-2");
|
|
73
|
-
var fixedComplementarySidebarToggleStyles = mx(sidebarToggleStyles, "inline-end-2");
|
|
74
|
-
|
|
75
|
-
// src/components/Plank/PlankControls.tsx
|
|
76
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
77
|
-
import React, { forwardRef, useCallback } from "react";
|
|
78
|
-
import { createIntent, useIntentDispatcher } from "@dxos/app-framework";
|
|
79
|
-
import { invariant } from "@dxos/invariant";
|
|
80
|
-
import { ButtonGroup, IconButton, useTranslation } from "@dxos/react-ui";
|
|
81
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-deck/src/components/Plank/PlankControls.tsx";
|
|
82
|
-
var PlankControl = ({ icon, label: label3, ...props }) => {
|
|
83
|
-
var _effect = _useSignals();
|
|
84
|
-
try {
|
|
85
|
-
return /* @__PURE__ */ React.createElement(IconButton, {
|
|
86
|
-
iconOnly: true,
|
|
87
|
-
label: label3,
|
|
88
|
-
icon,
|
|
89
|
-
size: 5,
|
|
90
|
-
variant: "ghost",
|
|
91
|
-
tooltipSide: "bottom",
|
|
92
|
-
...props
|
|
93
|
-
});
|
|
94
|
-
} finally {
|
|
95
|
-
_effect.f();
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
var plankControlSpacing = "pli-2";
|
|
99
|
-
var PlankCompanionControls = /* @__PURE__ */ forwardRef(({ primary }, forwardedRef) => {
|
|
100
|
-
var _effect = _useSignals();
|
|
101
|
-
try {
|
|
102
|
-
const { t } = useTranslation(DECK_PLUGIN);
|
|
103
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
104
|
-
const handleCloseCompanion = useCallback(() => {
|
|
105
|
-
invariant(primary, void 0, {
|
|
106
|
-
F: __dxlog_file,
|
|
107
|
-
L: 49,
|
|
108
|
-
S: void 0,
|
|
109
|
-
A: [
|
|
110
|
-
"primary",
|
|
111
|
-
""
|
|
112
|
-
]
|
|
113
|
-
});
|
|
114
|
-
return dispatch(createIntent(DeckAction.ChangeCompanion, {
|
|
115
|
-
primary,
|
|
116
|
-
companion: null
|
|
117
|
-
}));
|
|
118
|
-
}, []);
|
|
119
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
120
|
-
ref: forwardedRef,
|
|
121
|
-
className: "contents app-no-drag"
|
|
122
|
-
}, /* @__PURE__ */ React.createElement(PlankControl, {
|
|
123
|
-
label: t("close companion label"),
|
|
124
|
-
variant: "ghost",
|
|
125
|
-
icon: "ph--x--regular",
|
|
126
|
-
onClick: handleCloseCompanion,
|
|
127
|
-
classNames: plankControlSpacing
|
|
128
|
-
}));
|
|
129
|
-
} finally {
|
|
130
|
-
_effect.f();
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant = "default", capabilities, layoutMode, pin, close = false, onClick, ...props }, forwardedRef) => {
|
|
134
|
-
var _effect = _useSignals();
|
|
135
|
-
try {
|
|
136
|
-
const { t } = useTranslation(DECK_PLUGIN);
|
|
137
|
-
const buttonClassNames = variant === "hide-disabled" ? `disabled:hidden ${plankControlSpacing}` : plankControlSpacing;
|
|
138
|
-
const layoutIsAnySolo = !!layoutMode?.startsWith("solo");
|
|
139
|
-
return /* @__PURE__ */ React.createElement(ButtonGroup, {
|
|
140
|
-
...props,
|
|
141
|
-
classNames: [
|
|
142
|
-
"app-no-drag !opacity-100",
|
|
143
|
-
classNames
|
|
144
|
-
],
|
|
145
|
-
ref: forwardedRef
|
|
146
|
-
}, capabilities.deck ? /* @__PURE__ */ React.createElement(React.Fragment, null, capabilities.solo && /* @__PURE__ */ React.createElement(React.Fragment, null, layoutMode === "solo" && /* @__PURE__ */ React.createElement(PlankControl, {
|
|
147
|
-
label: t("show fullscreen plank label"),
|
|
148
|
-
classNames: buttonClassNames,
|
|
149
|
-
icon: "ph--corners-out--regular",
|
|
150
|
-
onClick: () => onClick?.("solo--fullscreen")
|
|
151
|
-
}), /* @__PURE__ */ React.createElement(PlankControl, {
|
|
152
|
-
label: t(layoutMode === "solo--fullscreen" ? "exit fullscreen label" : layoutIsAnySolo ? "show deck plank label" : "show solo plank label"),
|
|
153
|
-
classNames: buttonClassNames,
|
|
154
|
-
icon: layoutMode === "solo--fullscreen" ? "ph--corners-in--regular" : layoutIsAnySolo ? "ph--arrows-in-line-horizontal--regular" : "ph--arrows-out-line-horizontal--regular",
|
|
155
|
-
onClick: () => onClick?.(layoutMode === "solo--fullscreen" ? "solo--fullscreen" : "solo")
|
|
156
|
-
})), !layoutIsAnySolo && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(PlankControl, {
|
|
157
|
-
label: t("increment start label"),
|
|
158
|
-
disabled: !capabilities.incrementStart,
|
|
159
|
-
classNames: buttonClassNames,
|
|
160
|
-
icon: "ph--caret-left--regular",
|
|
161
|
-
onClick: () => onClick?.("increment-start")
|
|
162
|
-
}), /* @__PURE__ */ React.createElement(PlankControl, {
|
|
163
|
-
label: t("increment end label"),
|
|
164
|
-
disabled: !capabilities.incrementEnd,
|
|
165
|
-
classNames: buttonClassNames,
|
|
166
|
-
icon: "ph--caret-right--regular",
|
|
167
|
-
onClick: () => onClick?.("increment-end")
|
|
168
|
-
}))) : capabilities.fullscreen && /* @__PURE__ */ React.createElement(PlankControl, {
|
|
169
|
-
label: t(layoutMode === "solo--fullscreen" ? "exit fullscreen label" : "show fullscreen plank label"),
|
|
170
|
-
classNames: buttonClassNames,
|
|
171
|
-
icon: layoutMode === "solo--fullscreen" ? "ph--corners-in--regular" : "ph--corners-out--regular",
|
|
172
|
-
onClick: () => onClick?.("solo--fullscreen")
|
|
173
|
-
}), close && !layoutIsAnySolo && /* @__PURE__ */ React.createElement(PlankControl, {
|
|
174
|
-
label: t(`${typeof close === "string" ? "minify" : "close"} label`),
|
|
175
|
-
classNames: buttonClassNames,
|
|
176
|
-
"data-testid": "plankHeading.close",
|
|
177
|
-
icon: close === "minify-start" ? "ph--caret-line-left--regular" : close === "minify-end" ? "ph--caret-line-right--regular" : "ph--x--regular",
|
|
178
|
-
onClick: () => onClick?.("close")
|
|
179
|
-
}), capabilities.companion && /* @__PURE__ */ React.createElement(PlankControl, {
|
|
180
|
-
label: t("open companion label"),
|
|
181
|
-
classNames: buttonClassNames,
|
|
182
|
-
"data-testid": "plankHeading.companion",
|
|
183
|
-
icon: "ph--square-split-horizontal--regular",
|
|
184
|
-
onClick: () => onClick?.("companion")
|
|
185
|
-
}), children);
|
|
186
|
-
} finally {
|
|
187
|
-
_effect.f();
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
// src/components/Plank/PlankHeading.tsx
|
|
192
|
-
var MAX_COMPANIONS = 5;
|
|
193
|
-
var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncrementStart, canIncrementEnd, popoverAnchorId, primaryId, pending, companioned, companions, layoutMode, actions = [] }) => {
|
|
194
|
-
var _effect = _useSignals2();
|
|
195
|
-
try {
|
|
196
|
-
const { t } = useTranslation2(DECK_PLUGIN);
|
|
197
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
198
|
-
const { graph } = useAppGraph();
|
|
199
|
-
const breakpoint = useBreakpoints();
|
|
200
|
-
const icon = node?.properties?.icon ?? "ph--placeholder--regular";
|
|
201
|
-
const label3 = pending ? t("pending heading") : toLocalizedString(node?.properties?.label ?? [
|
|
202
|
-
"plank heading fallback label",
|
|
203
|
-
{
|
|
204
|
-
ns: DECK_PLUGIN
|
|
205
|
-
}
|
|
206
|
-
], t);
|
|
207
|
-
const isCompanionNode = node?.type === PLANK_COMPANION_TYPE;
|
|
208
|
-
useEffect(() => {
|
|
209
|
-
const frame = requestAnimationFrame(() => {
|
|
210
|
-
if (node) {
|
|
211
|
-
void graph.expand(node.id);
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
return () => cancelAnimationFrame(frame);
|
|
215
|
-
}, [
|
|
216
|
-
node
|
|
217
|
-
]);
|
|
218
|
-
const attendableId = primaryId ?? id;
|
|
219
|
-
const capabilities = useMemo(() => ({
|
|
220
|
-
deck: deckEnabled ?? true,
|
|
221
|
-
solo: breakpoint !== "mobile" && (part === "solo" || part === "deck"),
|
|
222
|
-
incrementStart: canIncrementStart,
|
|
223
|
-
incrementEnd: canIncrementEnd,
|
|
224
|
-
fullscreen: !isCompanionNode,
|
|
225
|
-
companion: !isCompanionNode && companions && companions.length > 0
|
|
226
|
-
}), [
|
|
227
|
-
breakpoint,
|
|
228
|
-
part,
|
|
229
|
-
companions,
|
|
230
|
-
canIncrementStart,
|
|
231
|
-
canIncrementEnd,
|
|
232
|
-
isCompanionNode,
|
|
233
|
-
deckEnabled
|
|
234
|
-
]);
|
|
235
|
-
const { variant } = parseEntryId(id);
|
|
236
|
-
const sigilActions = useMemo(() => {
|
|
237
|
-
if (!node) {
|
|
238
|
-
return void 0;
|
|
239
|
-
} else if (variant) {
|
|
240
|
-
return [];
|
|
241
|
-
} else {
|
|
242
|
-
return [
|
|
243
|
-
actions,
|
|
244
|
-
graph.getActions(node.id).filter((a) => [
|
|
245
|
-
"list-item",
|
|
246
|
-
"list-item-primary",
|
|
247
|
-
"heading-list-item"
|
|
248
|
-
].includes(a.properties.disposition))
|
|
249
|
-
].filter((a) => a.length > 0);
|
|
250
|
-
}
|
|
251
|
-
}, [
|
|
252
|
-
actions,
|
|
253
|
-
node,
|
|
254
|
-
variant,
|
|
255
|
-
graph
|
|
256
|
-
]);
|
|
257
|
-
const handleAction = useCallback2((action) => {
|
|
258
|
-
typeof action.data === "function" && void action.data?.({
|
|
259
|
-
parent: node,
|
|
260
|
-
caller: DECK_PLUGIN
|
|
261
|
-
});
|
|
262
|
-
}, [
|
|
263
|
-
node
|
|
264
|
-
]);
|
|
265
|
-
const handlePlankAction = useCallback2((eventType) => {
|
|
266
|
-
if (eventType.startsWith("solo")) {
|
|
267
|
-
return dispatch(createIntent2(DeckAction.Adjust, {
|
|
268
|
-
type: eventType,
|
|
269
|
-
id
|
|
270
|
-
}));
|
|
271
|
-
} else if (eventType === "close") {
|
|
272
|
-
if (part === "complementary") {
|
|
273
|
-
return dispatch(createIntent2(LayoutAction.UpdateComplementary, {
|
|
274
|
-
part: "complementary",
|
|
275
|
-
options: {
|
|
276
|
-
state: "collapsed"
|
|
277
|
-
}
|
|
278
|
-
}));
|
|
279
|
-
} else {
|
|
280
|
-
return dispatch(createIntent2(LayoutAction.Close, {
|
|
281
|
-
part: "main",
|
|
282
|
-
subject: [
|
|
283
|
-
id
|
|
284
|
-
],
|
|
285
|
-
options: {
|
|
286
|
-
state: false
|
|
287
|
-
}
|
|
288
|
-
}));
|
|
289
|
-
}
|
|
290
|
-
} else {
|
|
291
|
-
return dispatch(createIntent2(DeckAction.Adjust, {
|
|
292
|
-
type: eventType,
|
|
293
|
-
id
|
|
294
|
-
}));
|
|
295
|
-
}
|
|
296
|
-
}, [
|
|
297
|
-
dispatch,
|
|
298
|
-
id,
|
|
299
|
-
part
|
|
300
|
-
]);
|
|
301
|
-
const ActionRoot = node && popoverAnchorId === `dxos.org/ui/${DECK_PLUGIN}/${node.id}` ? Popover.Anchor : Fragment;
|
|
302
|
-
const handleTabClick = useCallback2((event) => {
|
|
303
|
-
const target = event.target.closest("[data-id]");
|
|
304
|
-
const tabId = target?.dataset?.id;
|
|
305
|
-
if (primaryId && tabId) {
|
|
306
|
-
void dispatch(createIntent2(DeckAction.ChangeCompanion, {
|
|
307
|
-
primary: primaryId,
|
|
308
|
-
companion: tabId
|
|
309
|
-
}));
|
|
310
|
-
}
|
|
311
|
-
}, [
|
|
312
|
-
primaryId
|
|
313
|
-
]);
|
|
314
|
-
return /* @__PURE__ */ React2.createElement(StackItem.Heading, {
|
|
315
|
-
classNames: [
|
|
316
|
-
"plb-1 items-stretch gap-1 sticky inline-start-12 app-drag min-is-0 contain-layout density-coarse",
|
|
317
|
-
part === "solo" ? soloInlinePadding : "pli-1",
|
|
318
|
-
...layoutMode === "solo--fullscreen" ? [
|
|
319
|
-
hoverableControls,
|
|
320
|
-
hoverableFocusedWithinControls,
|
|
321
|
-
"*:transition-opacity *:opacity-[--controls-opacity] bg-transparent border-transparent transition-[background-color,border-color] hover-hover:hover:bg-headerSurface focus-within:bg-headerSurface hover-hover:hover:border-subduedSeparator focus-within:border-subduedSeparator"
|
|
322
|
-
] : []
|
|
323
|
-
],
|
|
324
|
-
"data-plank-heading": true
|
|
325
|
-
}, companions && isCompanionNode ? (
|
|
326
|
-
/* TODO(thure): IMPORTANT: This is a tablist; it should be implemented as such. */
|
|
327
|
-
/* @__PURE__ */ React2.createElement("div", {
|
|
328
|
-
role: "none",
|
|
329
|
-
className: "flex-1 min-is-0 overflow-x-auto scrollbar-none flex gap-1"
|
|
330
|
-
}, companions.map(({ id: id2, properties: { icon: icon2, label: label4 } }) => /* @__PURE__ */ React2.createElement(IconButton2, {
|
|
331
|
-
key: id2,
|
|
332
|
-
"data-id": id2,
|
|
333
|
-
icon: icon2,
|
|
334
|
-
iconOnly: companions.length > MAX_COMPANIONS && node?.id !== id2,
|
|
335
|
-
label: toLocalizedString(label4, t),
|
|
336
|
-
size: 5,
|
|
337
|
-
variant: node?.id === id2 ? "primary" : "ghost",
|
|
338
|
-
onClick: handleTabClick
|
|
339
|
-
})))
|
|
340
|
-
) : /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(ActionRoot, null, node && sigilActions ? /* @__PURE__ */ React2.createElement(StackItem.Sigil, {
|
|
341
|
-
icon,
|
|
342
|
-
related: part === "complementary",
|
|
343
|
-
attendableId,
|
|
344
|
-
triggerLabel: t("actions menu label"),
|
|
345
|
-
actions: sigilActions,
|
|
346
|
-
onAction: handleAction
|
|
347
|
-
}, /* @__PURE__ */ React2.createElement(Surface, {
|
|
348
|
-
role: "menu-footer",
|
|
349
|
-
data: {
|
|
350
|
-
subject: node.data
|
|
351
|
-
}
|
|
352
|
-
})) : /* @__PURE__ */ React2.createElement(StackItem.SigilButton, null, /* @__PURE__ */ React2.createElement("span", {
|
|
353
|
-
className: "sr-only"
|
|
354
|
-
}, label3), /* @__PURE__ */ React2.createElement(Icon, {
|
|
355
|
-
icon,
|
|
356
|
-
size: 5
|
|
357
|
-
}))), /* @__PURE__ */ React2.createElement(TextTooltip, {
|
|
358
|
-
text: label3,
|
|
359
|
-
onlyWhenTruncating: true
|
|
360
|
-
}, /* @__PURE__ */ React2.createElement(StackItem.HeadingLabel, {
|
|
361
|
-
attendableId,
|
|
362
|
-
related: part === "complementary",
|
|
363
|
-
...pending && {
|
|
364
|
-
classNames: "text-description"
|
|
365
|
-
}
|
|
366
|
-
}, label3))), node && part !== "complementary" && /* @__PURE__ */ React2.createElement(Surface, {
|
|
367
|
-
role: "navbar-end",
|
|
368
|
-
data: {
|
|
369
|
-
subject: node.data
|
|
370
|
-
}
|
|
371
|
-
}), companioned === "companion" ? /* @__PURE__ */ React2.createElement(PlankCompanionControls, {
|
|
372
|
-
primary: primaryId
|
|
373
|
-
}) : /* @__PURE__ */ React2.createElement(PlankControls, {
|
|
374
|
-
capabilities,
|
|
375
|
-
layoutMode,
|
|
376
|
-
close: part === "complementary" ? "minify-end" : true,
|
|
377
|
-
onClick: handlePlankAction
|
|
378
|
-
}));
|
|
379
|
-
} finally {
|
|
380
|
-
_effect.f();
|
|
381
|
-
}
|
|
382
|
-
});
|
|
383
|
-
|
|
384
|
-
// src/components/Plank/PlankLoading.tsx
|
|
385
|
-
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
386
|
-
import React3 from "react";
|
|
387
|
-
var PlankLoading = () => {
|
|
388
|
-
var _effect = _useSignals3();
|
|
389
|
-
try {
|
|
390
|
-
return /* @__PURE__ */ React3.createElement("div", {
|
|
391
|
-
role: "none",
|
|
392
|
-
className: "grid place-items-center attention-surface"
|
|
393
|
-
});
|
|
394
|
-
} finally {
|
|
395
|
-
_effect.f();
|
|
396
|
-
}
|
|
397
|
-
};
|
|
398
|
-
|
|
399
|
-
// src/components/Plank/PlankError.tsx
|
|
400
|
-
var PlankContentError = ({ error }) => {
|
|
401
|
-
var _effect = _useSignals4();
|
|
402
|
-
try {
|
|
403
|
-
const { t } = useTranslation3(DECK_PLUGIN);
|
|
404
|
-
const errorString = error?.toString() ?? "";
|
|
405
|
-
return /* @__PURE__ */ React4.createElement("div", {
|
|
406
|
-
role: "none",
|
|
407
|
-
className: "overflow-y-auto p-8 attention-surface grid place-items-center"
|
|
408
|
-
}, /* @__PURE__ */ React4.createElement("p", {
|
|
409
|
-
role: "alert",
|
|
410
|
-
className: mx2(descriptionMessage, "break-all rounded-md p-4")
|
|
411
|
-
}, error ? errorString : t("error fallback message")));
|
|
412
|
-
} finally {
|
|
413
|
-
_effect.f();
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
|
-
var PlankError = ({ id, part, node, error }) => {
|
|
417
|
-
var _effect = _useSignals4();
|
|
418
|
-
try {
|
|
419
|
-
const [timedOut, setTimedOut] = useState(false);
|
|
420
|
-
useEffect2(() => {
|
|
421
|
-
setTimeout(() => setTimedOut(true), 5e3);
|
|
422
|
-
}, []);
|
|
423
|
-
return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(PlankHeading, {
|
|
424
|
-
id,
|
|
425
|
-
part,
|
|
426
|
-
node,
|
|
427
|
-
pending: !timedOut
|
|
428
|
-
}), timedOut ? /* @__PURE__ */ React4.createElement(PlankContentError, {
|
|
429
|
-
error
|
|
430
|
-
}) : /* @__PURE__ */ React4.createElement(PlankLoading, null));
|
|
431
|
-
} finally {
|
|
432
|
-
_effect.f();
|
|
433
|
-
}
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
// src/components/Plank/Plank.tsx
|
|
437
|
-
var UNKNOWN_ID = "unknown_id";
|
|
438
|
-
var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID, companionId, ...props }) => {
|
|
439
|
-
var _effect = _useSignals5();
|
|
440
|
-
try {
|
|
441
|
-
const { graph } = useAppGraph2();
|
|
442
|
-
const node = useNode(graph, id);
|
|
443
|
-
const companions = useCompanions(id);
|
|
444
|
-
const currentCompanion = companions.find(({ id: id2 }) => id2 === companionId);
|
|
445
|
-
const hasCompanion = !!(companionId && currentCompanion);
|
|
446
|
-
return /* @__PURE__ */ React5.createElement(PlankContainer, {
|
|
447
|
-
solo: props.part === "solo",
|
|
448
|
-
companion: hasCompanion
|
|
449
|
-
}, /* @__PURE__ */ React5.createElement(PlankComponent, {
|
|
450
|
-
id,
|
|
451
|
-
node,
|
|
452
|
-
companioned: hasCompanion ? "primary" : void 0,
|
|
453
|
-
companions: hasCompanion ? [] : companions,
|
|
454
|
-
...props,
|
|
455
|
-
...props.part === "solo" ? {
|
|
456
|
-
part: "solo-primary"
|
|
457
|
-
} : {}
|
|
458
|
-
}), hasCompanion && /* @__PURE__ */ React5.createElement(PlankComponent, {
|
|
459
|
-
id: companionId,
|
|
460
|
-
node: currentCompanion,
|
|
461
|
-
primary: node,
|
|
462
|
-
companions,
|
|
463
|
-
companioned: "companion",
|
|
464
|
-
...props,
|
|
465
|
-
...props.part === "solo" ? {
|
|
466
|
-
part: "solo-companion"
|
|
467
|
-
} : {
|
|
468
|
-
order: (props.order ?? 0) + 1
|
|
469
|
-
}
|
|
470
|
-
}));
|
|
471
|
-
} finally {
|
|
472
|
-
_effect.f();
|
|
473
|
-
}
|
|
474
|
-
});
|
|
475
|
-
var PlankContainer = ({ children, solo, companion }) => {
|
|
476
|
-
var _effect = _useSignals5();
|
|
477
|
-
try {
|
|
478
|
-
const sizeAttrs = useMainSize();
|
|
479
|
-
if (!solo) {
|
|
480
|
-
return children;
|
|
481
|
-
}
|
|
482
|
-
return /* @__PURE__ */ React5.createElement("div", {
|
|
483
|
-
role: "none",
|
|
484
|
-
className: mx3("absolute inset-0 grid", companion && "grid-cols-[1fr_1fr]", railGridHorizontal, mainIntrinsicSize),
|
|
485
|
-
...sizeAttrs
|
|
486
|
-
}, children);
|
|
487
|
-
} finally {
|
|
488
|
-
_effect.f();
|
|
489
|
-
}
|
|
490
|
-
};
|
|
491
|
-
var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order, active, companioned, node, primary, companions, settings }) => {
|
|
492
|
-
var _effect = _useSignals5();
|
|
493
|
-
try {
|
|
494
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher3();
|
|
495
|
-
const { deck, popoverAnchorId, scrollIntoView } = useCapability(DeckCapabilities.DeckState);
|
|
496
|
-
const canResize = layoutMode === "deck";
|
|
497
|
-
const attentionAttrs = useAttentionAttributes(primary?.id ?? id);
|
|
498
|
-
const index = active ? active.findIndex((entryId) => entryId === id) : 0;
|
|
499
|
-
const length = active?.length ?? 1;
|
|
500
|
-
const canIncrementStart = active && index !== void 0 && index > 0 && length !== void 0 && length > 1;
|
|
501
|
-
const canIncrementEnd = active && index !== void 0 && index < length - 1 && length !== void 0;
|
|
502
|
-
const rootElement = useRef(null);
|
|
503
|
-
const { variant } = parseEntryId(id);
|
|
504
|
-
const sizeKey = `${id.split("+")[0]}${variant ? `${ATTENDABLE_PATH_SEPARATOR}${variant}` : ""}`;
|
|
505
|
-
const size = deck.plankSizing[sizeKey];
|
|
506
|
-
const handleSizeChange = useCallback3(debounce((nextSize) => {
|
|
507
|
-
return dispatch(createIntent3(DeckAction.UpdatePlankSize, {
|
|
508
|
-
id: sizeKey,
|
|
509
|
-
size: nextSize
|
|
510
|
-
}));
|
|
511
|
-
}, 200), [
|
|
512
|
-
dispatch,
|
|
513
|
-
sizeKey
|
|
514
|
-
]);
|
|
515
|
-
const handleKeyDown = useCallback3((event) => {
|
|
516
|
-
if (event.target === event.currentTarget && event.key === "Escape") {
|
|
517
|
-
rootElement.current?.closest("main")?.focus();
|
|
518
|
-
}
|
|
519
|
-
}, []);
|
|
520
|
-
useLayoutEffect(() => {
|
|
521
|
-
if (scrollIntoView === id) {
|
|
522
|
-
const focusable = rootElement.current?.querySelector("button") || rootElement.current;
|
|
523
|
-
focusable?.focus({
|
|
524
|
-
preventScroll: true
|
|
525
|
-
});
|
|
526
|
-
layoutMode === "deck" && focusable?.scrollIntoView({
|
|
527
|
-
behavior: "smooth",
|
|
528
|
-
inline: "center"
|
|
529
|
-
});
|
|
530
|
-
void dispatch(createIntent3(LayoutAction2.ScrollIntoView, {
|
|
531
|
-
part: "current",
|
|
532
|
-
subject: void 0
|
|
533
|
-
}));
|
|
534
|
-
}
|
|
535
|
-
}, [
|
|
536
|
-
id,
|
|
537
|
-
scrollIntoView,
|
|
538
|
-
layoutMode
|
|
539
|
-
]);
|
|
540
|
-
const isSolo = layoutMode.startsWith("solo") && part === "solo";
|
|
541
|
-
const isAttendable = layoutMode.startsWith("solo") && part.startsWith("solo") || layoutMode === "deck" && part === "deck";
|
|
542
|
-
const sizeAttrs = useMainSize();
|
|
543
|
-
const data = useMemo2(() => node && {
|
|
544
|
-
subject: node.data,
|
|
545
|
-
companionTo: primary?.data,
|
|
546
|
-
variant,
|
|
547
|
-
path,
|
|
548
|
-
popoverAnchorId
|
|
549
|
-
}, [
|
|
550
|
-
node,
|
|
551
|
-
node?.data,
|
|
552
|
-
path,
|
|
553
|
-
popoverAnchorId,
|
|
554
|
-
primary?.data,
|
|
555
|
-
variant
|
|
556
|
-
]);
|
|
557
|
-
const placeholder = useMemo2(() => /* @__PURE__ */ React5.createElement(PlankLoading, null), []);
|
|
558
|
-
const Root = part.startsWith("solo") ? "article" : StackItem2.Root;
|
|
559
|
-
const className = mx3("attention-surface relative dx-focus-ring-inset-over-all density-coarse", isSolo && mainIntrinsicSize, isSolo && railGridHorizontal, isSolo && "absolute inset-0", part.startsWith("solo") && "grid", part === "deck" && (companioned === "companion" ? "!border-separator border-ie" : "!border-separator border-li"), part.startsWith("solo-") && "row-span-2 grid-rows-subgrid min-is-0", part === "solo-companion" && "!border-separator border-is");
|
|
560
|
-
return /* @__PURE__ */ React5.createElement(Root, {
|
|
561
|
-
ref: rootElement,
|
|
562
|
-
"data-testid": "deck.plank",
|
|
563
|
-
tabIndex: 0,
|
|
564
|
-
...part.startsWith("solo") ? {
|
|
565
|
-
...sizeAttrs,
|
|
566
|
-
className
|
|
567
|
-
} : {
|
|
568
|
-
item: {
|
|
569
|
-
id
|
|
570
|
-
},
|
|
571
|
-
size,
|
|
572
|
-
onSizeChange: handleSizeChange,
|
|
573
|
-
classNames: className,
|
|
574
|
-
order,
|
|
575
|
-
role: "article"
|
|
576
|
-
},
|
|
577
|
-
...isAttendable ? attentionAttrs : {},
|
|
578
|
-
onKeyDown: handleKeyDown
|
|
579
|
-
}, node ? /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(PlankHeading, {
|
|
580
|
-
id,
|
|
581
|
-
part: part.startsWith("solo-") ? "solo" : part,
|
|
582
|
-
node,
|
|
583
|
-
layoutMode,
|
|
584
|
-
deckEnabled: settings?.enableDeck,
|
|
585
|
-
canIncrementStart,
|
|
586
|
-
canIncrementEnd,
|
|
587
|
-
popoverAnchorId,
|
|
588
|
-
primaryId: primary?.id,
|
|
589
|
-
companioned,
|
|
590
|
-
companions
|
|
591
|
-
}), /* @__PURE__ */ React5.createElement(Surface2, {
|
|
592
|
-
key: node.id,
|
|
593
|
-
role: "article",
|
|
594
|
-
data,
|
|
595
|
-
limit: 1,
|
|
596
|
-
fallback: PlankContentError,
|
|
597
|
-
placeholder
|
|
598
|
-
})) : /* @__PURE__ */ React5.createElement(PlankError, {
|
|
599
|
-
id,
|
|
600
|
-
part
|
|
601
|
-
}), canResize && /* @__PURE__ */ React5.createElement(StackItem2.ResizeHandle, null));
|
|
602
|
-
} finally {
|
|
603
|
-
_effect.f();
|
|
604
|
-
}
|
|
605
|
-
});
|
|
606
|
-
|
|
607
|
-
// src/components/Sidebar/SidebarButton.tsx
|
|
608
|
-
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
609
|
-
import React6, { useCallback as useCallback4 } from "react";
|
|
610
|
-
import { LayoutAction as LayoutAction3, createIntent as createIntent4, useCapability as useCapability2, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
|
|
611
|
-
import { IconButton as IconButton3, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
612
|
-
var ToggleSidebarButton = ({ classNames, variant = "ghost" }) => {
|
|
613
|
-
var _effect = _useSignals6();
|
|
614
|
-
try {
|
|
615
|
-
const layoutContext = useCapability2(DeckCapabilities.MutableDeckState);
|
|
616
|
-
const { t } = useTranslation4(DECK_PLUGIN);
|
|
617
|
-
return /* @__PURE__ */ React6.createElement(IconButton3, {
|
|
618
|
-
variant,
|
|
619
|
-
iconOnly: true,
|
|
620
|
-
icon: "ph--sidebar--regular",
|
|
621
|
-
size: 4,
|
|
622
|
-
label: t("open navigation sidebar label"),
|
|
623
|
-
onClick: () => layoutContext.sidebarState = layoutContext.sidebarState === "expanded" ? "collapsed" : "expanded",
|
|
624
|
-
classNames
|
|
625
|
-
});
|
|
626
|
-
} finally {
|
|
627
|
-
_effect.f();
|
|
628
|
-
}
|
|
629
|
-
};
|
|
630
|
-
var CloseSidebarButton = () => {
|
|
631
|
-
var _effect = _useSignals6();
|
|
632
|
-
try {
|
|
633
|
-
const layoutContext = useCapability2(DeckCapabilities.MutableDeckState);
|
|
634
|
-
const { t } = useTranslation4(DECK_PLUGIN);
|
|
635
|
-
return /* @__PURE__ */ React6.createElement(IconButton3, {
|
|
636
|
-
variant: "ghost",
|
|
637
|
-
iconOnly: true,
|
|
638
|
-
icon: "ph--caret-line-left--regular",
|
|
639
|
-
size: 4,
|
|
640
|
-
label: t("close navigation sidebar label"),
|
|
641
|
-
onClick: () => layoutContext.sidebarState = "collapsed",
|
|
642
|
-
classNames: "rounded-none pli-1 dx-focus-ring-inset pie-[max(.5rem,env(safe-area-inset-left))]"
|
|
643
|
-
});
|
|
644
|
-
} finally {
|
|
645
|
-
_effect.f();
|
|
646
|
-
}
|
|
647
|
-
};
|
|
648
|
-
var ToggleComplementarySidebarButton = ({ inR0, classNames, current }) => {
|
|
649
|
-
var _effect = _useSignals6();
|
|
650
|
-
try {
|
|
651
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher4();
|
|
652
|
-
const layoutContext = useCapability2(DeckCapabilities.MutableDeckState);
|
|
653
|
-
const { t } = useTranslation4(DECK_PLUGIN);
|
|
654
|
-
const companions = useDeckCompanions();
|
|
655
|
-
const handleClick = useCallback4(async () => {
|
|
656
|
-
layoutContext.complementarySidebarState = layoutContext.complementarySidebarState === "expanded" ? "collapsed" : "expanded";
|
|
657
|
-
const firstCompanion = companions[0];
|
|
658
|
-
if (layoutContext.complementarySidebarState === "expanded" && !current && firstCompanion) {
|
|
659
|
-
await dispatch(createIntent4(LayoutAction3.UpdateComplementary, {
|
|
660
|
-
part: "complementary",
|
|
661
|
-
subject: getCompanionId(firstCompanion.id)
|
|
662
|
-
}));
|
|
663
|
-
}
|
|
664
|
-
}, [
|
|
665
|
-
layoutContext,
|
|
666
|
-
current,
|
|
667
|
-
companions,
|
|
668
|
-
dispatch
|
|
669
|
-
]);
|
|
670
|
-
return /* @__PURE__ */ React6.createElement(IconButton3, {
|
|
671
|
-
iconOnly: true,
|
|
672
|
-
onClick: handleClick,
|
|
673
|
-
variant: "ghost",
|
|
674
|
-
label: t("open complementary sidebar label"),
|
|
675
|
-
classNames: [
|
|
676
|
-
"[&>svg]:-scale-x-100",
|
|
677
|
-
classNames
|
|
678
|
-
],
|
|
679
|
-
icon: "ph--sidebar-simple--regular",
|
|
680
|
-
size: inR0 ? 5 : 4,
|
|
681
|
-
tooltipSide: inR0 ? "left" : void 0
|
|
682
|
-
});
|
|
683
|
-
} finally {
|
|
684
|
-
_effect.f();
|
|
685
|
-
}
|
|
686
|
-
};
|
|
687
|
-
|
|
688
|
-
// src/components/Sidebar/ComplementarySidebar.tsx
|
|
689
|
-
var label = [
|
|
690
|
-
"complementary sidebar title",
|
|
691
|
-
{
|
|
692
|
-
ns: DECK_PLUGIN
|
|
693
|
-
}
|
|
694
|
-
];
|
|
695
|
-
var ComplementarySidebar = ({ current }) => {
|
|
696
|
-
var _effect = _useSignals7();
|
|
697
|
-
try {
|
|
698
|
-
const { t } = useTranslation5(DECK_PLUGIN);
|
|
699
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher5();
|
|
700
|
-
const layout = useCapability3(DeckCapabilities.MutableDeckState);
|
|
701
|
-
const layoutMode = getMode(layout.deck);
|
|
702
|
-
const breakpoint = useBreakpoints();
|
|
703
|
-
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
704
|
-
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
705
|
-
const companions = useDeckCompanions();
|
|
706
|
-
const activeCompanion = companions.find((companion) => getCompanionId(companion.id) === current);
|
|
707
|
-
const activeId = activeCompanion && getCompanionId(activeCompanion.id);
|
|
708
|
-
const [internalValue, setInternalValue] = useState2(activeId);
|
|
709
|
-
useEffect3(() => {
|
|
710
|
-
setInternalValue(activeId);
|
|
711
|
-
}, [
|
|
712
|
-
activeId
|
|
713
|
-
]);
|
|
714
|
-
const handleTabClick = useCallback5((event) => {
|
|
715
|
-
const nextValue = event.currentTarget.getAttribute("data-value");
|
|
716
|
-
if (nextValue === activeId) {
|
|
717
|
-
layout.complementarySidebarState = layout.complementarySidebarState === "expanded" ? "collapsed" : "expanded";
|
|
718
|
-
} else {
|
|
719
|
-
setInternalValue(nextValue);
|
|
720
|
-
layout.complementarySidebarState = "expanded";
|
|
721
|
-
void dispatch(createIntent5(LayoutAction4.UpdateComplementary, {
|
|
722
|
-
part: "complementary",
|
|
723
|
-
subject: nextValue
|
|
724
|
-
}));
|
|
725
|
-
}
|
|
726
|
-
}, [
|
|
727
|
-
layout,
|
|
728
|
-
activeId,
|
|
729
|
-
dispatch
|
|
730
|
-
]);
|
|
731
|
-
const data = useMemo3(() => activeCompanion && {
|
|
732
|
-
id: activeCompanion.id,
|
|
733
|
-
subject: activeCompanion.data
|
|
734
|
-
}, [
|
|
735
|
-
activeCompanion?.id,
|
|
736
|
-
activeCompanion?.data
|
|
737
|
-
]);
|
|
738
|
-
useEffect3(() => {
|
|
739
|
-
if (!activeId) {
|
|
740
|
-
void dispatch(createIntent5(LayoutAction4.UpdateComplementary, {
|
|
741
|
-
part: "complementary",
|
|
742
|
-
options: {
|
|
743
|
-
state: "collapsed"
|
|
744
|
-
}
|
|
745
|
-
}));
|
|
746
|
-
}
|
|
747
|
-
}, [
|
|
748
|
-
activeId,
|
|
749
|
-
dispatch
|
|
750
|
-
]);
|
|
751
|
-
return /* @__PURE__ */ React7.createElement(Main.ComplementarySidebar, {
|
|
752
|
-
label,
|
|
753
|
-
classNames: [
|
|
754
|
-
topbar && "block-start-[calc(env(safe-area-inset-top)+var(--rail-size))]",
|
|
755
|
-
hoistStatusbar && "block-end-[--statusbar-size]"
|
|
756
|
-
]
|
|
757
|
-
}, /* @__PURE__ */ React7.createElement(Tabs.Root, {
|
|
758
|
-
orientation: "vertical",
|
|
759
|
-
verticalVariant: "stateless",
|
|
760
|
-
value: internalValue,
|
|
761
|
-
classNames: "contents"
|
|
762
|
-
}, /* @__PURE__ */ React7.createElement("div", {
|
|
763
|
-
role: "none",
|
|
764
|
-
className: "absolute z-[1] inset-block-0 inline-end-0 !is-[--r0-size] pbs-[env(safe-area-inset-top)] pbe-[env(safe-area-inset-bottom)] border-is border-subduedSeparator grid grid-cols-1 grid-rows-[1fr_min-content] bg-baseSurface contain-layout app-drag"
|
|
765
|
-
}, /* @__PURE__ */ React7.createElement(Tabs.Tablist, {
|
|
766
|
-
classNames: "grid grid-cols-1 auto-rows-[--rail-action] p-1 gap-1 !overflow-y-auto"
|
|
767
|
-
}, companions.map((companion) => /* @__PURE__ */ React7.createElement(Tabs.Tab, {
|
|
768
|
-
key: getCompanionId(companion.id),
|
|
769
|
-
value: getCompanionId(companion.id),
|
|
770
|
-
asChild: true
|
|
771
|
-
}, /* @__PURE__ */ React7.createElement(IconButton4, {
|
|
772
|
-
label: toLocalizedString2(companion.properties.label, t),
|
|
773
|
-
icon: companion.properties.icon,
|
|
774
|
-
size: 5,
|
|
775
|
-
iconOnly: true,
|
|
776
|
-
tooltipSide: "left",
|
|
777
|
-
"data-value": getCompanionId(companion.id),
|
|
778
|
-
variant: activeId === getCompanionId(companion.id) ? layout.complementarySidebarState === "expanded" ? "primary" : "default" : "ghost",
|
|
779
|
-
onClick: handleTabClick
|
|
780
|
-
})))), !hoistStatusbar && /* @__PURE__ */ React7.createElement("div", {
|
|
781
|
-
role: "none",
|
|
782
|
-
className: "grid grid-cols-1 auto-rows-[--rail-item] p-1 overflow-y-auto"
|
|
783
|
-
}, /* @__PURE__ */ React7.createElement(Surface3, {
|
|
784
|
-
role: "status-bar--r0-footer",
|
|
785
|
-
limit: 1
|
|
786
|
-
})), /* @__PURE__ */ React7.createElement("div", {
|
|
787
|
-
role: "none",
|
|
788
|
-
className: "hidden lg:grid grid-cols-1 auto-rows-[--rail-action] p-1"
|
|
789
|
-
}, /* @__PURE__ */ React7.createElement(ToggleComplementarySidebarButton, null))), activeId && companions.map((companion) => /* @__PURE__ */ React7.createElement(Tabs.Tabpanel, {
|
|
790
|
-
key: getCompanionId(companion.id),
|
|
791
|
-
value: getCompanionId(companion.id),
|
|
792
|
-
classNames: 'absolute data-[state="inactive"]:-z-[1] inset-block-0 inline-start-0 is-[calc(100%-var(--r0-size))] lg:is-[--r1-size] grid grid-cols-1 grid-rows-[var(--rail-size)_1fr_min-content] pbs-[env(safe-area-inset-top)]',
|
|
793
|
-
...layout.complementarySidebarState !== "expanded" && {
|
|
794
|
-
inert: "true"
|
|
795
|
-
}
|
|
796
|
-
}, /* @__PURE__ */ React7.createElement(ComplementarySidebarPanel, {
|
|
797
|
-
companion,
|
|
798
|
-
activeId,
|
|
799
|
-
data,
|
|
800
|
-
hoistStatusbar
|
|
801
|
-
})))));
|
|
802
|
-
} finally {
|
|
803
|
-
_effect.f();
|
|
804
|
-
}
|
|
805
|
-
};
|
|
806
|
-
var ScrollArea = ({ children }) => {
|
|
807
|
-
var _effect = _useSignals7();
|
|
808
|
-
try {
|
|
809
|
-
return /* @__PURE__ */ React7.createElement("div", {
|
|
810
|
-
className: "flex flex-col grow overflow-x-hidden overflow-y-auto scrollbar-thin"
|
|
811
|
-
}, children);
|
|
812
|
-
} finally {
|
|
813
|
-
_effect.f();
|
|
814
|
-
}
|
|
815
|
-
};
|
|
816
|
-
var ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar }) => {
|
|
817
|
-
var _effect = _useSignals7();
|
|
818
|
-
try {
|
|
819
|
-
const { t } = useTranslation5(DECK_PLUGIN);
|
|
820
|
-
if (getCompanionId(companion.id) !== activeId && !data) {
|
|
821
|
-
return null;
|
|
822
|
-
}
|
|
823
|
-
const Wrapper = companion.properties.fixed ? Fragment2 : ScrollArea;
|
|
824
|
-
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("h2", {
|
|
825
|
-
className: "flex items-center pli-2 border-subduedSeparator border-be font-medium"
|
|
826
|
-
}, toLocalizedString2(companion.properties.label, t)), /* @__PURE__ */ React7.createElement(Wrapper, null, /* @__PURE__ */ React7.createElement(Surface3, {
|
|
827
|
-
role: `deck-companion--${getCompanionId(companion.id)}`,
|
|
828
|
-
data,
|
|
829
|
-
fallback: PlankContentError,
|
|
830
|
-
placeholder: /* @__PURE__ */ React7.createElement(PlankLoading, null)
|
|
831
|
-
})), !hoistStatusbar && /* @__PURE__ */ React7.createElement("div", {
|
|
832
|
-
role: "contentinfo",
|
|
833
|
-
className: "flex flex-wrap justify-center items-center border-bs border-subduedSeparator pbs-1 pbe-[max(env(safe-area-inset-bottom),0.25rem)]"
|
|
834
|
-
}, /* @__PURE__ */ React7.createElement(Surface3, {
|
|
835
|
-
role: "status-bar--r1-footer",
|
|
836
|
-
limit: 1
|
|
837
|
-
})));
|
|
838
|
-
} finally {
|
|
839
|
-
_effect.f();
|
|
840
|
-
}
|
|
841
|
-
};
|
|
842
|
-
|
|
843
|
-
// src/components/Sidebar/Sidebar.tsx
|
|
844
|
-
import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
|
|
845
|
-
import React8, { useMemo as useMemo4 } from "react";
|
|
846
|
-
import { Surface as Surface4, useCapability as useCapability4 } from "@dxos/app-framework";
|
|
847
|
-
import { Main as Main2 } from "@dxos/react-ui";
|
|
848
|
-
var label2 = [
|
|
849
|
-
"sidebar title",
|
|
850
|
-
{
|
|
851
|
-
ns: DECK_PLUGIN
|
|
852
|
-
}
|
|
853
|
-
];
|
|
854
|
-
var Sidebar = () => {
|
|
855
|
-
var _effect = _useSignals8();
|
|
856
|
-
try {
|
|
857
|
-
const { popoverAnchorId, activeDeck: current, deck } = useCapability4(DeckCapabilities.DeckState);
|
|
858
|
-
const breakpoint = useBreakpoints();
|
|
859
|
-
const layoutMode = getMode(deck);
|
|
860
|
-
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
861
|
-
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
862
|
-
const navigationData = useMemo4(() => ({
|
|
863
|
-
popoverAnchorId,
|
|
864
|
-
topbar,
|
|
865
|
-
hoistStatusbar,
|
|
866
|
-
current
|
|
867
|
-
}), [
|
|
868
|
-
popoverAnchorId,
|
|
869
|
-
topbar,
|
|
870
|
-
hoistStatusbar,
|
|
871
|
-
current
|
|
872
|
-
]);
|
|
873
|
-
return /* @__PURE__ */ React8.createElement(Main2.NavigationSidebar, {
|
|
874
|
-
label: label2,
|
|
875
|
-
classNames: [
|
|
876
|
-
"grid",
|
|
877
|
-
topbar && "block-start-[calc(env(safe-area-inset-top)+var(--rail-size))]",
|
|
878
|
-
hoistStatusbar && "block-end-[--statusbar-size]"
|
|
879
|
-
]
|
|
880
|
-
}, /* @__PURE__ */ React8.createElement(Surface4, {
|
|
881
|
-
role: "navigation",
|
|
882
|
-
data: navigationData,
|
|
883
|
-
limit: 1
|
|
884
|
-
}));
|
|
885
|
-
} finally {
|
|
886
|
-
_effect.f();
|
|
887
|
-
}
|
|
888
|
-
};
|
|
889
|
-
|
|
890
|
-
// src/components/DeckLayout/Banner.tsx
|
|
891
|
-
var Banner = ({ variant, classNames }) => {
|
|
892
|
-
var _effect = _useSignals9();
|
|
893
|
-
try {
|
|
894
|
-
const { t } = useTranslation6(DECK_PLUGIN);
|
|
895
|
-
return /* @__PURE__ */ React9.createElement("header", {
|
|
896
|
-
className: mx4("flex items-stretch relative plb-1 pis-1 pie-2", variant === "topbar" && "fixed inset-inline-0 block-start-[env(safe-area-inset-top)] bs-[--rail-size] border-be border-separator", classNames)
|
|
897
|
-
}, variant === "sidebar" ? /* @__PURE__ */ React9.createElement(CloseSidebarButton, null) : /* @__PURE__ */ React9.createElement(ToggleSidebarButton, null), /* @__PURE__ */ React9.createElement("span", {
|
|
898
|
-
className: "self-center grow mis-1"
|
|
899
|
-
}, t("current app name", {
|
|
900
|
-
ns: "appkit"
|
|
901
|
-
})), variant === "topbar" && /* @__PURE__ */ React9.createElement("div", {
|
|
902
|
-
role: "none",
|
|
903
|
-
className: "absolute inset-0 pointer-events-none"
|
|
904
|
-
}, /* @__PURE__ */ React9.createElement("div", {
|
|
905
|
-
role: "none",
|
|
906
|
-
className: "grid bs-full pointer-fine:p-1 max-is-md mli-auto pointer-events-auto"
|
|
907
|
-
}, /* @__PURE__ */ React9.createElement(Surface5, {
|
|
908
|
-
role: "search-input",
|
|
909
|
-
limit: 1
|
|
910
|
-
}))), /* @__PURE__ */ React9.createElement("span", {
|
|
911
|
-
role: "none",
|
|
912
|
-
className: "grow"
|
|
913
|
-
}), /* @__PURE__ */ React9.createElement(Surface5, {
|
|
914
|
-
role: "header-end",
|
|
915
|
-
limit: 1
|
|
916
|
-
}), /* @__PURE__ */ React9.createElement(Surface5, {
|
|
917
|
-
role: "notch-start",
|
|
918
|
-
limit: 1
|
|
919
|
-
}));
|
|
920
|
-
} finally {
|
|
921
|
-
_effect.f();
|
|
922
|
-
}
|
|
923
|
-
};
|
|
924
|
-
|
|
925
|
-
// src/components/DeckLayout/DeckLayout.tsx
|
|
926
|
-
import { useSignals as _useSignals17 } from "@preact-signals/safe-react/tracking";
|
|
927
|
-
import { untracked } from "@preact/signals-core";
|
|
928
|
-
import React17, { Fragment as Fragment3, useCallback as useCallback7, useEffect as useEffect5, useMemo as useMemo6, useRef as useRef3 } from "react";
|
|
929
|
-
import { Capabilities, LayoutAction as LayoutAction5, createIntent as createIntent6, useCapability as useCapability8, useIntentDispatcher as useIntentDispatcher6, usePluginManager } from "@dxos/app-framework";
|
|
930
|
-
import { AttentionCapabilities } from "@dxos/plugin-attention";
|
|
931
|
-
import { Main as Main3, useMediaQuery, useOnTransition } from "@dxos/react-ui";
|
|
932
|
-
import { DEFAULT_HORIZONTAL_SIZE, Stack, StackContext } from "@dxos/react-ui-stack";
|
|
933
|
-
import { mainPaddingTransitions } from "@dxos/react-ui-theme";
|
|
934
|
-
|
|
935
|
-
// src/components/DeckLayout/ActiveNode.tsx
|
|
936
|
-
import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
|
|
937
|
-
import React10 from "react";
|
|
938
|
-
import { Surface as Surface6, useAppGraph as useAppGraph3 } from "@dxos/app-framework";
|
|
939
|
-
import { useNode as useNode2 } from "@dxos/plugin-graph";
|
|
940
|
-
import { useAttended } from "@dxos/react-ui-attention";
|
|
941
|
-
var ActiveNode = () => {
|
|
942
|
-
var _effect = _useSignals10();
|
|
943
|
-
try {
|
|
944
|
-
const [id] = useAttended();
|
|
945
|
-
const { graph } = useAppGraph3();
|
|
946
|
-
const activeNode = useNode2(graph, id);
|
|
947
|
-
useNodeActionExpander(activeNode);
|
|
948
|
-
return /* @__PURE__ */ React10.createElement("div", {
|
|
949
|
-
role: "none",
|
|
950
|
-
className: "sr-only"
|
|
951
|
-
}, /* @__PURE__ */ React10.createElement(Surface6, {
|
|
952
|
-
role: "document-title",
|
|
953
|
-
data: {
|
|
954
|
-
subject: activeNode
|
|
955
|
-
},
|
|
956
|
-
limit: 1
|
|
957
|
-
}));
|
|
958
|
-
} finally {
|
|
959
|
-
_effect.f();
|
|
960
|
-
}
|
|
961
|
-
};
|
|
962
|
-
|
|
963
|
-
// src/components/DeckLayout/ContentEmpty.tsx
|
|
964
|
-
import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
|
|
965
|
-
import React11 from "react";
|
|
966
|
-
import { Surface as Surface7, useCapability as useCapability5 } from "@dxos/app-framework";
|
|
967
|
-
var ContentEmpty = () => {
|
|
968
|
-
var _effect = _useSignals11();
|
|
969
|
-
try {
|
|
970
|
-
const breakpoint = useBreakpoints();
|
|
971
|
-
const { deck } = useCapability5(DeckCapabilities.MutableDeckState);
|
|
972
|
-
const layoutMode = getMode(deck);
|
|
973
|
-
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
974
|
-
return /* @__PURE__ */ React11.createElement("div", {
|
|
975
|
-
role: "none",
|
|
976
|
-
className: "grid place-items-center p-8 relative bg-deckSurface",
|
|
977
|
-
"data-testid": "layoutPlugin.firstRunMessage"
|
|
978
|
-
}, /* @__PURE__ */ React11.createElement(Surface7, {
|
|
979
|
-
role: "keyshortcuts"
|
|
980
|
-
}), !topbar && /* @__PURE__ */ React11.createElement(ToggleSidebarButton, {
|
|
981
|
-
variant: "default",
|
|
982
|
-
classNames: fixedSidebarToggleStyles
|
|
983
|
-
}));
|
|
984
|
-
} finally {
|
|
985
|
-
_effect.f();
|
|
986
|
-
}
|
|
987
|
-
};
|
|
988
|
-
|
|
989
|
-
// src/components/DeckLayout/Dialog.tsx
|
|
990
|
-
import { useSignals as _useSignals12 } from "@preact-signals/safe-react/tracking";
|
|
991
|
-
import React12 from "react";
|
|
992
|
-
import { Surface as Surface8, useCapability as useCapability6 } from "@dxos/app-framework";
|
|
993
|
-
import { AlertDialog, Dialog as NaturalDialog } from "@dxos/react-ui";
|
|
994
|
-
var Dialog = () => {
|
|
995
|
-
var _effect = _useSignals12();
|
|
996
|
-
try {
|
|
997
|
-
const context = useCapability6(DeckCapabilities.MutableDeckState);
|
|
998
|
-
const { dialogOpen, dialogType, dialogBlockAlign, dialogOverlayClasses, dialogOverlayStyle, dialogContent } = context;
|
|
999
|
-
const Root = dialogType === "alert" ? AlertDialog.Root : NaturalDialog.Root;
|
|
1000
|
-
const Overlay = dialogType === "alert" ? AlertDialog.Overlay : NaturalDialog.Overlay;
|
|
1001
|
-
return /* @__PURE__ */ React12.createElement(Root, {
|
|
1002
|
-
modal: dialogBlockAlign !== "end",
|
|
1003
|
-
open: dialogOpen,
|
|
1004
|
-
onOpenChange: (nextOpen) => context.dialogOpen = nextOpen
|
|
1005
|
-
}, dialogBlockAlign === "end" ? (
|
|
1006
|
-
// TODO(burdon): Placeholder creates a suspense boundary; replace with defaults.
|
|
1007
|
-
/* @__PURE__ */ React12.createElement(Surface8, {
|
|
1008
|
-
role: "dialog",
|
|
1009
|
-
data: dialogContent,
|
|
1010
|
-
limit: 1,
|
|
1011
|
-
fallback: PlankContentError,
|
|
1012
|
-
placeholder: /* @__PURE__ */ React12.createElement("div", null)
|
|
1013
|
-
})
|
|
1014
|
-
) : /* @__PURE__ */ React12.createElement(Overlay, {
|
|
1015
|
-
blockAlign: dialogBlockAlign,
|
|
1016
|
-
classNames: dialogOverlayClasses,
|
|
1017
|
-
style: dialogOverlayStyle
|
|
1018
|
-
}, /* @__PURE__ */ React12.createElement(Surface8, {
|
|
1019
|
-
role: "dialog",
|
|
1020
|
-
data: dialogContent,
|
|
1021
|
-
limit: 1,
|
|
1022
|
-
fallback: PlankContentError
|
|
1023
|
-
})));
|
|
1024
|
-
} finally {
|
|
1025
|
-
_effect.f();
|
|
1026
|
-
}
|
|
1027
|
-
};
|
|
1028
|
-
|
|
1029
|
-
// src/components/DeckLayout/Popover.tsx
|
|
1030
|
-
import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
|
|
1031
|
-
import { createContext } from "@radix-ui/react-context";
|
|
1032
|
-
import React13, { useCallback as useCallback6, useEffect as useEffect4, useMemo as useMemo5, useRef as useRef2, useState as useState3 } from "react";
|
|
1033
|
-
import { Surface as Surface9, useCapability as useCapability7 } from "@dxos/app-framework";
|
|
1034
|
-
import { Popover as Popover2 } from "@dxos/react-ui";
|
|
1035
|
-
var DEBOUNCE_DELAY = 40;
|
|
1036
|
-
var [DeckPopoverProvider, useDeckPopoverContext] = createContext("DeckPopover");
|
|
1037
|
-
var PopoverRoot = ({ children }) => {
|
|
1038
|
-
var _effect = _useSignals13();
|
|
1039
|
-
try {
|
|
1040
|
-
const layout = useCapability7(DeckCapabilities.MutableDeckState);
|
|
1041
|
-
const virtualRef = useRef2(null);
|
|
1042
|
-
const [virtualIter, setVirtualIter] = useState3(0);
|
|
1043
|
-
const [open, setOpen] = useState3(false);
|
|
1044
|
-
const debounceRef = useRef2(null);
|
|
1045
|
-
useEffect4(() => {
|
|
1046
|
-
setOpen(false);
|
|
1047
|
-
if (layout.popoverOpen) {
|
|
1048
|
-
if (debounceRef.current) {
|
|
1049
|
-
clearTimeout(debounceRef.current);
|
|
1050
|
-
}
|
|
1051
|
-
if (layout.popoverAnchor && virtualRef.current !== layout.popoverAnchor) {
|
|
1052
|
-
virtualRef.current = layout.popoverAnchor ?? null;
|
|
1053
|
-
setVirtualIter((iter) => iter + 1);
|
|
1054
|
-
}
|
|
1055
|
-
debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);
|
|
1056
|
-
}
|
|
1057
|
-
}, [
|
|
1058
|
-
layout.popoverOpen,
|
|
1059
|
-
layout.popoverAnchorId,
|
|
1060
|
-
layout.popoverAnchor,
|
|
1061
|
-
layout.popoverContent
|
|
1062
|
-
]);
|
|
1063
|
-
return /* @__PURE__ */ React13.createElement(DeckPopoverProvider, {
|
|
1064
|
-
setOpen
|
|
1065
|
-
}, /* @__PURE__ */ React13.createElement(Popover2.Root, {
|
|
1066
|
-
modal: false,
|
|
1067
|
-
open
|
|
1068
|
-
}, layout.popoverAnchor && /* @__PURE__ */ React13.createElement(Popover2.VirtualTrigger, {
|
|
1069
|
-
key: virtualIter,
|
|
1070
|
-
virtualRef
|
|
1071
|
-
}), children));
|
|
1072
|
-
} finally {
|
|
1073
|
-
_effect.f();
|
|
1074
|
-
}
|
|
1075
|
-
};
|
|
1076
|
-
var PopoverContent = () => {
|
|
1077
|
-
var _effect = _useSignals13();
|
|
1078
|
-
try {
|
|
1079
|
-
const layout = useCapability7(DeckCapabilities.MutableDeckState);
|
|
1080
|
-
const { setOpen } = useDeckPopoverContext("PopoverContent");
|
|
1081
|
-
const handleClose = useCallback6((event) => {
|
|
1082
|
-
if (
|
|
1083
|
-
// TODO(thure): CodeMirror should not focus itself when it updates.
|
|
1084
|
-
event.type === "dismissableLayer.focusOutside" && event.currentTarget?.classList.contains("cm-content")
|
|
1085
|
-
) {
|
|
1086
|
-
event.preventDefault();
|
|
1087
|
-
} else {
|
|
1088
|
-
setOpen(false);
|
|
1089
|
-
layout.popoverOpen = false;
|
|
1090
|
-
layout.popoverAnchor = void 0;
|
|
1091
|
-
layout.popoverAnchorId = void 0;
|
|
1092
|
-
layout.popoverSide = void 0;
|
|
1093
|
-
}
|
|
1094
|
-
}, [
|
|
1095
|
-
setOpen
|
|
1096
|
-
]);
|
|
1097
|
-
const collisionBoundaries = useMemo5(() => {
|
|
1098
|
-
const closest = layout.popoverAnchor?.closest("[data-popover-collision-boundary]");
|
|
1099
|
-
return closest ? [
|
|
1100
|
-
closest
|
|
1101
|
-
] : [];
|
|
1102
|
-
}, [
|
|
1103
|
-
layout.popoverAnchor
|
|
1104
|
-
]);
|
|
1105
|
-
return /* @__PURE__ */ React13.createElement(Popover2.Portal, null, /* @__PURE__ */ React13.createElement(Popover2.Content, {
|
|
1106
|
-
side: layout.popoverSide,
|
|
1107
|
-
onInteractOutside: handleClose,
|
|
1108
|
-
onEscapeKeyDown: handleClose,
|
|
1109
|
-
collisionBoundary: collisionBoundaries,
|
|
1110
|
-
sticky: "always",
|
|
1111
|
-
hideWhenDetached: true
|
|
1112
|
-
}, /* @__PURE__ */ React13.createElement(Popover2.Viewport, null, /* @__PURE__ */ React13.createElement(Surface9, {
|
|
1113
|
-
role: "card--popover",
|
|
1114
|
-
data: layout.popoverContent,
|
|
1115
|
-
limit: 1
|
|
1116
|
-
})), /* @__PURE__ */ React13.createElement(Popover2.Arrow, null)));
|
|
1117
|
-
} finally {
|
|
1118
|
-
_effect.f();
|
|
1119
|
-
}
|
|
1120
|
-
};
|
|
1121
|
-
|
|
1122
|
-
// src/components/DeckLayout/StatusBar.tsx
|
|
1123
|
-
import { useSignals as _useSignals14 } from "@preact-signals/safe-react/tracking";
|
|
1124
|
-
import React14 from "react";
|
|
1125
|
-
import { Surface as Surface10 } from "@dxos/app-framework";
|
|
1126
|
-
import { useLandmarkMover } from "@dxos/react-ui";
|
|
1127
|
-
var StatusBar = ({ showHints }) => {
|
|
1128
|
-
var _effect = _useSignals14();
|
|
1129
|
-
try {
|
|
1130
|
-
const mover = useLandmarkMover(void 0, "3");
|
|
1131
|
-
return /* @__PURE__ */ React14.createElement("div", {
|
|
1132
|
-
role: "contentinfo",
|
|
1133
|
-
className: "fixed block-end-0 inset-inline-0 bs-[--statusbar-size] border-bs border-separator z-[2] flex text-description",
|
|
1134
|
-
...mover
|
|
1135
|
-
}, showHints && /* @__PURE__ */ React14.createElement(Surface10, {
|
|
1136
|
-
role: "hints",
|
|
1137
|
-
limit: 1
|
|
1138
|
-
}), /* @__PURE__ */ React14.createElement(Surface10, {
|
|
1139
|
-
role: "status-bar",
|
|
1140
|
-
limit: 1
|
|
1141
|
-
}));
|
|
1142
|
-
} finally {
|
|
1143
|
-
_effect.f();
|
|
1144
|
-
}
|
|
1145
|
-
};
|
|
1146
|
-
|
|
1147
|
-
// src/components/DeckLayout/Toast.tsx
|
|
1148
|
-
import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
|
|
1149
|
-
import React15 from "react";
|
|
1150
|
-
import { Button, Icon as Icon2, Toast as NaturalToast, toLocalizedString as toLocalizedString3, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
1151
|
-
var Toast = ({ id, title, description, icon, duration, actionLabel, actionAlt, closeLabel, onAction, onOpenChange }) => {
|
|
1152
|
-
var _effect = _useSignals15();
|
|
1153
|
-
try {
|
|
1154
|
-
const { t } = useTranslation7(DECK_PLUGIN);
|
|
1155
|
-
return /* @__PURE__ */ React15.createElement(NaturalToast.Root, {
|
|
1156
|
-
"data-testid": id,
|
|
1157
|
-
defaultOpen: true,
|
|
1158
|
-
duration,
|
|
1159
|
-
onOpenChange
|
|
1160
|
-
}, /* @__PURE__ */ React15.createElement(NaturalToast.Body, null, /* @__PURE__ */ React15.createElement(NaturalToast.Title, {
|
|
1161
|
-
classNames: "items-center"
|
|
1162
|
-
}, icon && /* @__PURE__ */ React15.createElement(Icon2, {
|
|
1163
|
-
icon,
|
|
1164
|
-
size: 5,
|
|
1165
|
-
classNames: "inline mr-1"
|
|
1166
|
-
}), title && /* @__PURE__ */ React15.createElement("span", null, toLocalizedString3(title, t))), description && /* @__PURE__ */ React15.createElement(NaturalToast.Description, null, description && toLocalizedString3(description, t))), /* @__PURE__ */ React15.createElement(NaturalToast.Actions, null, onAction && actionAlt && actionLabel && /* @__PURE__ */ React15.createElement(NaturalToast.Action, {
|
|
1167
|
-
altText: toLocalizedString3(actionAlt, t),
|
|
1168
|
-
asChild: true
|
|
1169
|
-
}, /* @__PURE__ */ React15.createElement(Button, {
|
|
1170
|
-
"data-testid": "toast.action",
|
|
1171
|
-
variant: "primary",
|
|
1172
|
-
onClick: () => onAction?.()
|
|
1173
|
-
}, toLocalizedString3(actionLabel, t))), closeLabel && /* @__PURE__ */ React15.createElement(NaturalToast.Close, {
|
|
1174
|
-
asChild: true
|
|
1175
|
-
}, /* @__PURE__ */ React15.createElement(Button, {
|
|
1176
|
-
"data-testid": "toast.close"
|
|
1177
|
-
}, toLocalizedString3(closeLabel, t)))));
|
|
1178
|
-
} finally {
|
|
1179
|
-
_effect.f();
|
|
1180
|
-
}
|
|
1181
|
-
};
|
|
1182
|
-
|
|
1183
|
-
// src/components/DeckLayout/Topbar.tsx
|
|
1184
|
-
import { useSignals as _useSignals16 } from "@preact-signals/safe-react/tracking";
|
|
1185
|
-
import React16 from "react";
|
|
1186
|
-
var Topbar = () => {
|
|
1187
|
-
var _effect = _useSignals16();
|
|
1188
|
-
try {
|
|
1189
|
-
return /* @__PURE__ */ React16.createElement(Banner, {
|
|
1190
|
-
variant: "topbar"
|
|
1191
|
-
});
|
|
1192
|
-
} finally {
|
|
1193
|
-
_effect.f();
|
|
1194
|
-
}
|
|
1195
|
-
};
|
|
1196
|
-
|
|
1197
|
-
// src/components/DeckLayout/DeckLayout.tsx
|
|
1198
|
-
var PlankSeparator = ({ order }) => {
|
|
1199
|
-
var _effect = _useSignals17();
|
|
1200
|
-
try {
|
|
1201
|
-
return order > 0 ? /* @__PURE__ */ React17.createElement("span", {
|
|
1202
|
-
role: "separator",
|
|
1203
|
-
className: "row-span-2 bg-deckSurface is-4",
|
|
1204
|
-
style: {
|
|
1205
|
-
gridColumn: order
|
|
1206
|
-
}
|
|
1207
|
-
}) : null;
|
|
1208
|
-
} finally {
|
|
1209
|
-
_effect.f();
|
|
1210
|
-
}
|
|
1211
|
-
};
|
|
1212
|
-
var DeckLayout = ({ onDismissToast }) => {
|
|
1213
|
-
var _effect = _useSignals17();
|
|
1214
|
-
try {
|
|
1215
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher6();
|
|
1216
|
-
const settings = useCapability8(Capabilities.SettingsStore).getStore(DECK_PLUGIN).value;
|
|
1217
|
-
const context = useCapability8(DeckCapabilities.MutableDeckState);
|
|
1218
|
-
const { sidebarState, complementarySidebarState, complementarySidebarPanel, deck, toasts } = context;
|
|
1219
|
-
const { active, activeCompanions, fullscreen, solo, plankSizing } = deck;
|
|
1220
|
-
const breakpoint = useBreakpoints();
|
|
1221
|
-
const layoutMode = getMode(deck);
|
|
1222
|
-
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
1223
|
-
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
1224
|
-
const pluginManager = usePluginManager();
|
|
1225
|
-
const scrollLeftRef = useRef3();
|
|
1226
|
-
const deckRef = useRef3(null);
|
|
1227
|
-
useEffect5(() => {
|
|
1228
|
-
const attended = untracked(() => {
|
|
1229
|
-
const attention = pluginManager.context.getCapability(AttentionCapabilities.Attention);
|
|
1230
|
-
return attention.current;
|
|
1231
|
-
});
|
|
1232
|
-
const firstId = solo ?? active[0];
|
|
1233
|
-
if (attended.length === 0 && firstId) {
|
|
1234
|
-
document.querySelector(`article[data-attendable-id="${firstId}"] button`)?.focus();
|
|
1235
|
-
}
|
|
1236
|
-
}, []);
|
|
1237
|
-
const [isNotMobile] = useMediaQuery("md", {
|
|
1238
|
-
ssr: false
|
|
1239
|
-
});
|
|
1240
|
-
const shouldRevert = useRef3(false);
|
|
1241
|
-
useEffect5(() => {
|
|
1242
|
-
if (!isNotMobile && getMode(deck) === "deck") {
|
|
1243
|
-
const attended = untracked(() => {
|
|
1244
|
-
const attention = pluginManager.context.getCapability(AttentionCapabilities.Attention);
|
|
1245
|
-
return attention.current;
|
|
1246
|
-
});
|
|
1247
|
-
shouldRevert.current = true;
|
|
1248
|
-
void dispatch(createIntent6(LayoutAction5.SetLayoutMode, {
|
|
1249
|
-
part: "mode",
|
|
1250
|
-
subject: attended[0],
|
|
1251
|
-
options: {
|
|
1252
|
-
mode: "solo"
|
|
1253
|
-
}
|
|
1254
|
-
}));
|
|
1255
|
-
} else if (isNotMobile && getMode(deck) === "solo" && shouldRevert.current) {
|
|
1256
|
-
void dispatch(createIntent6(LayoutAction5.SetLayoutMode, {
|
|
1257
|
-
part: "mode",
|
|
1258
|
-
options: {
|
|
1259
|
-
revert: true
|
|
1260
|
-
}
|
|
1261
|
-
}));
|
|
1262
|
-
}
|
|
1263
|
-
}, [
|
|
1264
|
-
isNotMobile,
|
|
1265
|
-
deck,
|
|
1266
|
-
dispatch
|
|
1267
|
-
]);
|
|
1268
|
-
useEffect5(() => {
|
|
1269
|
-
if (!settings.enableDeck && layoutMode === "deck") {
|
|
1270
|
-
void dispatch(createIntent6(LayoutAction5.SetLayoutMode, {
|
|
1271
|
-
part: "mode",
|
|
1272
|
-
subject: active[0],
|
|
1273
|
-
options: {
|
|
1274
|
-
mode: "solo"
|
|
1275
|
-
}
|
|
1276
|
-
}));
|
|
1277
|
-
}
|
|
1278
|
-
}, [
|
|
1279
|
-
settings.enableDeck,
|
|
1280
|
-
dispatch,
|
|
1281
|
-
active,
|
|
1282
|
-
layoutMode
|
|
1283
|
-
]);
|
|
1284
|
-
const handleResize = useCallback7(() => {
|
|
1285
|
-
scrollLeftRef.current = null;
|
|
1286
|
-
}, []);
|
|
1287
|
-
useEffect5(() => {
|
|
1288
|
-
window.addEventListener("resize", handleResize);
|
|
1289
|
-
return () => window.removeEventListener("resize", handleResize);
|
|
1290
|
-
}, [
|
|
1291
|
-
handleResize
|
|
1292
|
-
]);
|
|
1293
|
-
const restoreScroll = useCallback7(() => {
|
|
1294
|
-
if (deckRef.current && scrollLeftRef.current != null) {
|
|
1295
|
-
deckRef.current.scrollLeft = scrollLeftRef.current;
|
|
1296
|
-
}
|
|
1297
|
-
}, []);
|
|
1298
|
-
useOnTransition(layoutMode, (mode) => mode !== "deck", "deck", restoreScroll);
|
|
1299
|
-
const handleScroll = useCallback7((event) => {
|
|
1300
|
-
if (!solo && event.currentTarget === event.target) {
|
|
1301
|
-
scrollLeftRef.current = event.target.scrollLeft;
|
|
1302
|
-
}
|
|
1303
|
-
}, [
|
|
1304
|
-
solo
|
|
1305
|
-
]);
|
|
1306
|
-
const isEmpty = !solo && active.length === 0;
|
|
1307
|
-
const padding = useMemo6(() => {
|
|
1308
|
-
if (!solo && settings.overscroll === "centering") {
|
|
1309
|
-
return calculateOverscroll(active.length);
|
|
1310
|
-
}
|
|
1311
|
-
return {};
|
|
1312
|
-
}, [
|
|
1313
|
-
solo,
|
|
1314
|
-
settings.overscroll,
|
|
1315
|
-
deck
|
|
1316
|
-
]);
|
|
1317
|
-
const mainPosition = useMemo6(() => [
|
|
1318
|
-
"grid !block-start-[env(safe-area-inset-top)]",
|
|
1319
|
-
topbar && "!block-start-[calc(env(safe-area-inset-top)+var(--rail-size))]",
|
|
1320
|
-
hoistStatusbar && "lg:block-end-[--statusbar-size]"
|
|
1321
|
-
], [
|
|
1322
|
-
topbar,
|
|
1323
|
-
hoistStatusbar
|
|
1324
|
-
]);
|
|
1325
|
-
const { order, itemsCount } = useMemo6(() => {
|
|
1326
|
-
return active.reduce((acc, entryId) => {
|
|
1327
|
-
acc.order[entryId] = acc.itemsCount + 1;
|
|
1328
|
-
acc.itemsCount += activeCompanions?.[entryId] ? 3 : 2;
|
|
1329
|
-
return acc;
|
|
1330
|
-
}, {
|
|
1331
|
-
order: {},
|
|
1332
|
-
itemsCount: 0
|
|
1333
|
-
});
|
|
1334
|
-
}, [
|
|
1335
|
-
active,
|
|
1336
|
-
activeCompanions
|
|
1337
|
-
]);
|
|
1338
|
-
return /* @__PURE__ */ React17.createElement(PopoverRoot, null, /* @__PURE__ */ React17.createElement(ActiveNode, null), /* @__PURE__ */ React17.createElement(Main3.Root, {
|
|
1339
|
-
navigationSidebarState: fullscreen ? "closed" : context.sidebarState,
|
|
1340
|
-
onNavigationSidebarStateChange: (next) => context.sidebarState = next,
|
|
1341
|
-
complementarySidebarState: fullscreen ? "closed" : context.complementarySidebarState,
|
|
1342
|
-
onComplementarySidebarStateChange: (next) => context.complementarySidebarState = next
|
|
1343
|
-
}, /* @__PURE__ */ React17.createElement(Sidebar, null), /* @__PURE__ */ React17.createElement(ComplementarySidebar, {
|
|
1344
|
-
current: complementarySidebarPanel
|
|
1345
|
-
}), /* @__PURE__ */ React17.createElement(Main3.Overlay, null), isEmpty && /* @__PURE__ */ React17.createElement(Main3.Content, {
|
|
1346
|
-
bounce: true,
|
|
1347
|
-
handlesFocus: true,
|
|
1348
|
-
classNames: mainPosition
|
|
1349
|
-
}, /* @__PURE__ */ React17.createElement(ContentEmpty, null)), !isEmpty && /* @__PURE__ */ React17.createElement(Main3.Content, {
|
|
1350
|
-
bounce: true,
|
|
1351
|
-
handlesFocus: true,
|
|
1352
|
-
classNames: mainPosition,
|
|
1353
|
-
style: {
|
|
1354
|
-
"--dx-main-sidebarWidth": sidebarState === "expanded" ? "var(--nav-sidebar-size)" : sidebarState === "collapsed" ? "var(--l0-size)" : "0",
|
|
1355
|
-
"--dx-main-complementaryWidth": complementarySidebarState === "expanded" ? "var(--complementary-sidebar-size)" : complementarySidebarState === "collapsed" ? "var(--rail-size)" : "0",
|
|
1356
|
-
"--dx-main-contentFirstWidth": `${plankSizing[active[0] ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`,
|
|
1357
|
-
"--dx-main-contentLastWidth": `${plankSizing[active[(active.length ?? 1) - 1] ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`
|
|
1358
|
-
}
|
|
1359
|
-
}, /* @__PURE__ */ React17.createElement("div", {
|
|
1360
|
-
role: "none",
|
|
1361
|
-
className: !solo ? "relative bg-deckSurface overflow-hidden" : "sr-only",
|
|
1362
|
-
...solo && {
|
|
1363
|
-
inert: ""
|
|
1364
|
-
}
|
|
1365
|
-
}, !topbar && !fullscreen && /* @__PURE__ */ React17.createElement(ToggleSidebarButton, {
|
|
1366
|
-
classNames: fixedSidebarToggleStyles
|
|
1367
|
-
}), !topbar && !fullscreen && /* @__PURE__ */ React17.createElement(ToggleComplementarySidebarButton, {
|
|
1368
|
-
classNames: fixedComplementarySidebarToggleStyles
|
|
1369
|
-
}), /* @__PURE__ */ React17.createElement(Stack, {
|
|
1370
|
-
ref: deckRef,
|
|
1371
|
-
orientation: "horizontal",
|
|
1372
|
-
size: "contain",
|
|
1373
|
-
classNames: [
|
|
1374
|
-
"absolute inset-block-0 -inset-inline-px",
|
|
1375
|
-
mainPaddingTransitions
|
|
1376
|
-
],
|
|
1377
|
-
itemsCount: itemsCount - 1,
|
|
1378
|
-
style: padding,
|
|
1379
|
-
onScroll: handleScroll
|
|
1380
|
-
}, active.map((entryId) => /* @__PURE__ */ React17.createElement(Fragment3, {
|
|
1381
|
-
key: entryId
|
|
1382
|
-
}, /* @__PURE__ */ React17.createElement(PlankSeparator, {
|
|
1383
|
-
order: order[entryId] - 1
|
|
1384
|
-
}), /* @__PURE__ */ React17.createElement(Plank, {
|
|
1385
|
-
id: entryId,
|
|
1386
|
-
companionId: activeCompanions?.[entryId],
|
|
1387
|
-
part: "deck",
|
|
1388
|
-
order: order[entryId],
|
|
1389
|
-
active,
|
|
1390
|
-
layoutMode,
|
|
1391
|
-
settings
|
|
1392
|
-
}))))), /* @__PURE__ */ React17.createElement("div", {
|
|
1393
|
-
role: "none",
|
|
1394
|
-
className: solo ? "relative bg-deckSurface overflow-hidden" : "sr-only",
|
|
1395
|
-
...!solo && {
|
|
1396
|
-
inert: ""
|
|
1397
|
-
}
|
|
1398
|
-
}, !topbar && !fullscreen && /* @__PURE__ */ React17.createElement(ToggleSidebarButton, {
|
|
1399
|
-
classNames: fixedSidebarToggleStyles
|
|
1400
|
-
}), !topbar && !fullscreen && /* @__PURE__ */ React17.createElement(ToggleComplementarySidebarButton, {
|
|
1401
|
-
classNames: fixedComplementarySidebarToggleStyles
|
|
1402
|
-
}), /* @__PURE__ */ React17.createElement(StackContext.Provider, {
|
|
1403
|
-
value: {
|
|
1404
|
-
size: "contain",
|
|
1405
|
-
orientation: "horizontal",
|
|
1406
|
-
rail: true
|
|
1407
|
-
}
|
|
1408
|
-
}, /* @__PURE__ */ React17.createElement(Plank, {
|
|
1409
|
-
id: solo,
|
|
1410
|
-
companionId: solo ? activeCompanions?.[solo] : void 0,
|
|
1411
|
-
part: "solo",
|
|
1412
|
-
layoutMode,
|
|
1413
|
-
settings
|
|
1414
|
-
})))), topbar && /* @__PURE__ */ React17.createElement(Topbar, null), hoistStatusbar && /* @__PURE__ */ React17.createElement(StatusBar, {
|
|
1415
|
-
showHints: settings.showHints
|
|
1416
|
-
})), /* @__PURE__ */ React17.createElement(PopoverContent, null), /* @__PURE__ */ React17.createElement(Dialog, null), toasts?.map((toast) => /* @__PURE__ */ React17.createElement(Toast, {
|
|
1417
|
-
...toast,
|
|
1418
|
-
key: toast.id,
|
|
1419
|
-
onOpenChange: (open) => {
|
|
1420
|
-
if (!open) {
|
|
1421
|
-
onDismissToast(toast.id);
|
|
1422
|
-
}
|
|
1423
|
-
return open;
|
|
1424
|
-
}
|
|
1425
|
-
})));
|
|
1426
|
-
} finally {
|
|
1427
|
-
_effect.f();
|
|
1428
|
-
}
|
|
1429
|
-
};
|
|
1430
|
-
|
|
1431
|
-
// src/components/DeckSettings/DeckSettings.tsx
|
|
1432
|
-
import { useSignals as _useSignals18 } from "@preact-signals/safe-react/tracking";
|
|
1433
|
-
import React18 from "react";
|
|
1434
|
-
import { Input, Select, useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
1435
|
-
import { DeprecatedFormContainer, DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
1436
|
-
var isSocket = !!globalThis.__args;
|
|
1437
|
-
var DeckSettings = ({ settings }) => {
|
|
1438
|
-
var _effect = _useSignals18();
|
|
1439
|
-
try {
|
|
1440
|
-
const { t } = useTranslation8(DECK_PLUGIN);
|
|
1441
|
-
return /* @__PURE__ */ React18.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React18.createElement(DeprecatedFormInput, {
|
|
1442
|
-
label: t("settings enable deck label")
|
|
1443
|
-
}, /* @__PURE__ */ React18.createElement(Input.Switch, {
|
|
1444
|
-
checked: settings.enableDeck,
|
|
1445
|
-
onCheckedChange: (checked) => settings.enableDeck = checked
|
|
1446
|
-
})), /* @__PURE__ */ React18.createElement(DeprecatedFormInput, {
|
|
1447
|
-
label: t("select new plank positioning label")
|
|
1448
|
-
}, /* @__PURE__ */ React18.createElement(Select.Root, {
|
|
1449
|
-
disabled: !settings.enableDeck,
|
|
1450
|
-
value: settings.newPlankPositioning ?? "start",
|
|
1451
|
-
onValueChange: (value) => settings.newPlankPositioning = value
|
|
1452
|
-
}, /* @__PURE__ */ React18.createElement(Select.TriggerButton, {
|
|
1453
|
-
placeholder: t("select new plank positioning placeholder")
|
|
1454
|
-
}), /* @__PURE__ */ React18.createElement(Select.Portal, null, /* @__PURE__ */ React18.createElement(Select.Content, null, /* @__PURE__ */ React18.createElement(Select.Viewport, null, NewPlankPositions.map((position) => /* @__PURE__ */ React18.createElement(Select.Option, {
|
|
1455
|
-
key: position,
|
|
1456
|
-
value: position
|
|
1457
|
-
}, t(`settings new plank position ${position} label`)))))))), /* @__PURE__ */ React18.createElement(DeprecatedFormInput, {
|
|
1458
|
-
label: t("settings overscroll label")
|
|
1459
|
-
}, /* @__PURE__ */ React18.createElement(Select.Root, {
|
|
1460
|
-
disabled: !settings.enableDeck,
|
|
1461
|
-
value: settings.overscroll ?? "none",
|
|
1462
|
-
onValueChange: (value) => settings.overscroll = value
|
|
1463
|
-
}, /* @__PURE__ */ React18.createElement(Select.TriggerButton, {
|
|
1464
|
-
placeholder: t("select overscroll placeholder")
|
|
1465
|
-
}), /* @__PURE__ */ React18.createElement(Select.Portal, null, /* @__PURE__ */ React18.createElement(Select.Content, null, /* @__PURE__ */ React18.createElement(Select.Viewport, null, OverscrollOptions.map((option) => /* @__PURE__ */ React18.createElement(Select.Option, {
|
|
1466
|
-
key: option,
|
|
1467
|
-
value: option
|
|
1468
|
-
}, t(`settings overscroll ${option} label`)))))))), /* @__PURE__ */ React18.createElement(DeprecatedFormInput, {
|
|
1469
|
-
label: t("settings enable statusbar label")
|
|
1470
|
-
}, /* @__PURE__ */ React18.createElement(Input.Switch, {
|
|
1471
|
-
checked: settings.enableStatusbar,
|
|
1472
|
-
onCheckedChange: (checked) => settings.enableStatusbar = checked
|
|
1473
|
-
})), /* @__PURE__ */ React18.createElement(DeprecatedFormInput, {
|
|
1474
|
-
label: t("settings show hints label")
|
|
1475
|
-
}, /* @__PURE__ */ React18.createElement(Input.Switch, {
|
|
1476
|
-
checked: settings.showHints,
|
|
1477
|
-
onCheckedChange: (checked) => settings.showHints = checked
|
|
1478
|
-
})), !isSocket && /* @__PURE__ */ React18.createElement(DeprecatedFormInput, {
|
|
1479
|
-
label: t("settings native redirect label")
|
|
1480
|
-
}, /* @__PURE__ */ React18.createElement(Input.Switch, {
|
|
1481
|
-
checked: settings.enableNativeRedirect,
|
|
1482
|
-
onCheckedChange: (checked) => settings.enableNativeRedirect = checked
|
|
1483
|
-
})));
|
|
1484
|
-
} finally {
|
|
1485
|
-
_effect.f();
|
|
1486
|
-
}
|
|
1487
|
-
};
|
|
1488
|
-
|
|
1489
|
-
export {
|
|
1490
|
-
Banner,
|
|
1491
|
-
DeckLayout,
|
|
1492
|
-
DeckSettings
|
|
1493
|
-
};
|
|
1494
|
-
//# sourceMappingURL=chunk-6MQIYIPY.mjs.map
|