@dxos/plugin-deck 0.8.4-main.bc674ce → 0.8.4-main.bcb3aa67d6
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-QUWRKFDD.mjs +24 -0
- package/dist/lib/browser/add-toast-QUWRKFDD.mjs.map +7 -0
- package/dist/lib/browser/adjust-J6F24WWJ.mjs +96 -0
- package/dist/lib/browser/adjust-J6F24WWJ.mjs.map +7 -0
- package/dist/lib/browser/change-companion-EZI57WDZ.mjs +34 -0
- package/dist/lib/browser/change-companion-EZI57WDZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-2YNVGCOQ.mjs +88 -0
- package/dist/lib/browser/chunk-2YNVGCOQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-AYFQHPPP.mjs +69 -0
- package/dist/lib/browser/chunk-AYFQHPPP.mjs.map +7 -0
- package/dist/lib/browser/chunk-GCDWE37Y.mjs +220 -0
- package/dist/lib/browser/chunk-GCDWE37Y.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/chunk-KUTDCWZF.mjs +30 -0
- package/dist/lib/browser/chunk-KUTDCWZF.mjs.map +7 -0
- package/dist/lib/browser/chunk-OHKLENIG.mjs +45 -0
- package/dist/lib/browser/chunk-OHKLENIG.mjs.map +7 -0
- package/dist/lib/browser/close-6RB62DEY.mjs +44 -0
- package/dist/lib/browser/close-6RB62DEY.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +161 -126
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/open-YL3JKXGK.mjs +115 -0
- package/dist/lib/browser/open-YL3JKXGK.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-JC66YMWB.mjs +21 -0
- package/dist/lib/browser/revert-workspace-JC66YMWB.mjs.map +7 -0
- package/dist/lib/browser/scroll-into-view-QSSFZ3KD.mjs +21 -0
- package/dist/lib/browser/scroll-into-view-QSSFZ3KD.mjs.map +7 -0
- package/dist/lib/browser/set-LPAGXY3F.mjs +37 -0
- package/dist/lib/browser/set-LPAGXY3F.mjs.map +7 -0
- package/dist/lib/browser/set-layout-mode-XZ4VHS2X.mjs +90 -0
- package/dist/lib/browser/set-layout-mode-XZ4VHS2X.mjs.map +7 -0
- package/dist/lib/browser/show-undo-IWX4S777.mjs +59 -0
- package/dist/lib/browser/show-undo-IWX4S777.mjs.map +7 -0
- package/dist/lib/browser/switch-workspace-5RKQ2LVK.mjs +68 -0
- package/dist/lib/browser/switch-workspace-5RKQ2LVK.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +8 -15
- package/dist/lib/browser/update-complementary-QIIZWLGY.mjs +28 -0
- package/dist/lib/browser/update-complementary-QIIZWLGY.mjs.map +7 -0
- package/dist/lib/browser/update-dialog-5IKCWFPW.mjs +29 -0
- package/dist/lib/browser/update-dialog-5IKCWFPW.mjs.map +7 -0
- package/dist/lib/browser/update-plank-size-YDM67P65.mjs +28 -0
- package/dist/lib/browser/update-plank-size-YDM67P65.mjs.map +7 -0
- package/dist/lib/browser/update-popover-AUVAWH3D.mjs +33 -0
- package/dist/lib/browser/update-popover-AUVAWH3D.mjs.map +7 -0
- package/dist/lib/browser/update-sidebar-BT3L5GJN.mjs +25 -0
- package/dist/lib/browser/update-sidebar-BT3L5GJN.mjs.map +7 -0
- package/dist/lib/node-esm/add-toast-MR53ZMTS.mjs +25 -0
- package/dist/lib/node-esm/add-toast-MR53ZMTS.mjs.map +7 -0
- package/dist/lib/node-esm/adjust-IXRBIVAO.mjs +97 -0
- package/dist/lib/node-esm/adjust-IXRBIVAO.mjs.map +7 -0
- package/dist/lib/node-esm/change-companion-RLMI5EYL.mjs +35 -0
- package/dist/lib/node-esm/change-companion-RLMI5EYL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7BNWWWAF.mjs +221 -0
- package/dist/lib/node-esm/chunk-7BNWWWAF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-C2AWKR2S.mjs +71 -0
- package/dist/lib/node-esm/chunk-C2AWKR2S.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GI5JXNBT.mjs +89 -0
- package/dist/lib/node-esm/chunk-GI5JXNBT.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-MLVJ2ODW.mjs +32 -0
- package/dist/lib/node-esm/chunk-MLVJ2ODW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TFFZ7NWH.mjs +47 -0
- package/dist/lib/node-esm/chunk-TFFZ7NWH.mjs.map +7 -0
- package/dist/lib/node-esm/close-UD7KBYZP.mjs +45 -0
- package/dist/lib/node-esm/close-UD7KBYZP.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +161 -126
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/open-XZ7YGVPZ.mjs +116 -0
- package/dist/lib/node-esm/open-XZ7YGVPZ.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-F3FUP4ZL.mjs +22 -0
- package/dist/lib/node-esm/revert-workspace-F3FUP4ZL.mjs.map +7 -0
- package/dist/lib/node-esm/scroll-into-view-24TF2WYQ.mjs +22 -0
- package/dist/lib/node-esm/scroll-into-view-24TF2WYQ.mjs.map +7 -0
- package/dist/lib/node-esm/set-F2QWLSJR.mjs +38 -0
- package/dist/lib/node-esm/set-F2QWLSJR.mjs.map +7 -0
- package/dist/lib/node-esm/set-layout-mode-Z54OX33H.mjs +91 -0
- package/dist/lib/node-esm/set-layout-mode-Z54OX33H.mjs.map +7 -0
- package/dist/lib/node-esm/show-undo-B2XVCKGX.mjs +60 -0
- package/dist/lib/node-esm/show-undo-B2XVCKGX.mjs.map +7 -0
- package/dist/lib/node-esm/switch-workspace-PM57REEV.mjs +69 -0
- package/dist/lib/node-esm/switch-workspace-PM57REEV.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +8 -15
- package/dist/lib/node-esm/update-complementary-26H5UYJP.mjs +29 -0
- package/dist/lib/node-esm/update-complementary-26H5UYJP.mjs.map +7 -0
- package/dist/lib/node-esm/update-dialog-EYP3QNFG.mjs +30 -0
- package/dist/lib/node-esm/update-dialog-EYP3QNFG.mjs.map +7 -0
- package/dist/lib/node-esm/update-plank-size-LLFUB57G.mjs +29 -0
- package/dist/lib/node-esm/update-plank-size-LLFUB57G.mjs.map +7 -0
- package/dist/lib/node-esm/update-popover-G55PS7T4.mjs +34 -0
- package/dist/lib/node-esm/update-popover-G55PS7T4.mjs.map +7 -0
- package/dist/lib/node-esm/update-sidebar-W4ND5MUL.mjs +26 -0
- package/dist/lib/node-esm/update-sidebar-W4ND5MUL.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/check-app-scheme.d.ts +19 -0
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +198 -9
- 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/react-root.d.ts → react-root.d.ts} +1 -1
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +4 -3
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +11 -11
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/{tools/tools.d.ts → tools.d.ts} +2 -2
- package/dist/types/src/capabilities/tools.d.ts.map +1 -0
- package/dist/types/src/capabilities/url-handler.d.ts +5 -0
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -0
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +4 -6
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts +85 -0
- package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/DeckSettings/index.d.ts +2 -1
- package/dist/types/src/components/DeckSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/Matrix/Matrix.d.ts +49 -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 +85 -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.map +1 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts +87 -0
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/DeckLayout/Dialog.d.ts.map +1 -1
- 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/{components → containers}/DeckLayout/Toast.d.ts +3 -3
- 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 +21 -0
- package/dist/types/src/containers/Plank/Plank.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/Plank.stories.d.ts +84 -0
- package/dist/types/src/containers/Plank/Plank.stories.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankComponent.d.ts +15 -0
- package/dist/types/src/containers/Plank/PlankComponent.d.ts.map +1 -0
- package/dist/types/src/containers/Plank/PlankContent.d.ts +14 -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 +1 -1
- 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/{components → containers}/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/Sidebar/SidebarButton.d.ts.map +1 -1
- 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 +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +0 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckState.d.ts +3 -3
- package/dist/types/src/hooks/useDeckState.d.ts.map +1 -1
- 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/useSelectedCompanion.d.ts +13 -0
- package/dist/types/src/hooks/useSelectedCompanion.d.ts.map +1 -0
- package/dist/types/src/layout.d.ts +3 -9
- package/dist/types/src/layout.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/testing/DeckLayoutStoryNavigation.d.ts +10 -0
- package/dist/types/src/testing/DeckLayoutStoryNavigation.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +66 -54
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +16 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +11 -11
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +38 -94
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -0
- 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/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 +2 -2
- 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 +77 -44
- package/src/DeckPlugin.ts +18 -22
- package/src/capabilities/app-graph-builder.ts +127 -0
- package/src/capabilities/check-app-scheme.ts +139 -0
- package/src/capabilities/index.ts +14 -10
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +5 -5
- package/src/capabilities/react-surface.tsx +38 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +8 -7
- package/src/capabilities/{state/state.ts → state.ts} +17 -31
- package/src/capabilities/{tools/tools.ts → tools.ts} +4 -5
- package/src/capabilities/url-handler.ts +209 -0
- package/src/components/DeckSettings/DeckSettings.stories.tsx +40 -0
- package/src/components/DeckSettings/DeckSettings.tsx +103 -93
- package/src/components/DeckSettings/index.ts +4 -2
- package/src/components/Matrix/Matrix.stories.tsx +213 -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 +10 -9
- package/src/containers/Deck/Deck.stories.tsx +85 -0
- package/src/containers/Deck/Deck.tsx +21 -0
- package/src/containers/Deck/DeckContent.tsx +104 -0
- package/src/containers/Deck/DeckRoot.tsx +49 -0
- package/src/containers/Deck/DeckViewport.tsx +397 -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 +4 -3
- package/src/containers/DeckLayout/DeckLayout.stories.tsx +174 -0
- package/src/containers/DeckLayout/DeckLayout.tsx +62 -0
- package/src/{components → containers}/DeckLayout/Dialog.tsx +11 -5
- package/src/containers/DeckLayout/Fallback.tsx +24 -0
- package/src/{components → containers}/DeckLayout/Popover.tsx +58 -18
- package/src/{components → containers}/DeckLayout/Toast.tsx +4 -4
- 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 +105 -0
- package/src/containers/Plank/Plank.tsx +22 -0
- package/src/containers/Plank/PlankComponent.tsx +179 -0
- package/src/containers/Plank/PlankContent.tsx +45 -0
- package/src/{components → containers}/Plank/PlankControls.tsx +41 -34
- package/src/containers/Plank/PlankError.tsx +79 -0
- package/src/{components → containers}/Plank/PlankHeading.tsx +36 -45
- 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/{components → containers}/Sidebar/Sidebar.tsx +8 -8
- package/src/{components → containers}/Sidebar/SidebarButton.tsx +19 -19
- package/src/containers/index.ts +11 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useCompanions.ts +3 -3
- package/src/hooks/useDeckCompanions.ts +3 -8
- package/src/hooks/useDeckState.ts +14 -23
- package/src/hooks/useHoistStatusbar.ts +2 -2
- package/src/hooks/useMainSize.ts +2 -2
- package/src/hooks/useNodeActionExpander.ts +1 -1
- package/src/hooks/useSelectedCompanion.ts +32 -0
- package/src/layout.ts +3 -16
- package/src/meta.ts +1 -1
- 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 +61 -0
- package/src/operations/helpers.ts +22 -0
- package/src/operations/index.ts +26 -0
- package/src/operations/open.ts +117 -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 +46 -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/testing/DeckLayoutStoryNavigation.tsx +57 -0
- package/src/testing/index.ts +5 -0
- package/src/translations.ts +67 -54
- package/src/types/Settings.ts +26 -0
- package/src/types/capabilities.ts +9 -8
- package/src/types/events.ts +6 -5
- package/src/types/index.ts +1 -0
- package/src/types/schema.ts +35 -110
- package/src/util/index.ts +1 -0
- package/src/util/layoutAppliesTopbar.ts +1 -1
- package/src/util/overscroll.ts +3 -3
- 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 +2 -2
- package/src/vite-env.d.ts +5 -0
- package/dist/lib/browser/app-graph-builder-DTVCULQ4.mjs +0 -120
- package/dist/lib/browser/app-graph-builder-DTVCULQ4.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-JSRXXIYF.mjs +0 -32
- package/dist/lib/browser/check-app-scheme-JSRXXIYF.mjs.map +0 -7
- package/dist/lib/browser/chunk-ATFPDN6J.mjs +0 -292
- package/dist/lib/browser/chunk-ATFPDN6J.mjs.map +0 -7
- package/dist/lib/browser/chunk-NHABISX2.mjs +0 -152
- package/dist/lib/browser/chunk-NHABISX2.mjs.map +0 -7
- package/dist/lib/browser/chunk-S4A5UO4K.mjs +0 -1448
- package/dist/lib/browser/chunk-S4A5UO4K.mjs.map +0 -7
- package/dist/lib/browser/chunk-UNG4CLLP.mjs +0 -161
- package/dist/lib/browser/chunk-UNG4CLLP.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-CDYBLZJ4.mjs +0 -595
- package/dist/lib/browser/operation-resolver-CDYBLZJ4.mjs.map +0 -7
- package/dist/lib/browser/react-root-XDCMNENQ.mjs +0 -47
- package/dist/lib/browser/react-root-XDCMNENQ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-HODERLOL.mjs +0 -42
- package/dist/lib/browser/react-surface-HODERLOL.mjs.map +0 -7
- package/dist/lib/browser/settings-OMHVGZ6V.mjs +0 -37
- package/dist/lib/browser/settings-OMHVGZ6V.mjs.map +0 -7
- package/dist/lib/browser/state-OC3BSB6E.mjs +0 -103
- package/dist/lib/browser/state-OC3BSB6E.mjs.map +0 -7
- package/dist/lib/browser/toolkit-R53LD3EA.mjs +0 -53
- package/dist/lib/browser/toolkit-R53LD3EA.mjs.map +0 -7
- package/dist/lib/browser/url-handler-53TE6JZO.mjs +0 -93
- package/dist/lib/browser/url-handler-53TE6JZO.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-473BNZDJ.mjs +0 -121
- package/dist/lib/node-esm/app-graph-builder-473BNZDJ.mjs.map +0 -7
- package/dist/lib/node-esm/check-app-scheme-IVYRHKRH.mjs +0 -33
- package/dist/lib/node-esm/check-app-scheme-IVYRHKRH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ADPMWKLL.mjs +0 -154
- package/dist/lib/node-esm/chunk-ADPMWKLL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-D34L3ECT.mjs +0 -1449
- package/dist/lib/node-esm/chunk-D34L3ECT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SKEVPQ7E.mjs +0 -162
- package/dist/lib/node-esm/chunk-SKEVPQ7E.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XAKTY3EB.mjs +0 -294
- package/dist/lib/node-esm/chunk-XAKTY3EB.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-WUOE33ID.mjs +0 -596
- package/dist/lib/node-esm/operation-resolver-WUOE33ID.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-O6GZO62Z.mjs +0 -48
- package/dist/lib/node-esm/react-root-O6GZO62Z.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-IHDJDGC5.mjs +0 -43
- package/dist/lib/node-esm/react-surface-IHDJDGC5.mjs.map +0 -7
- package/dist/lib/node-esm/settings-2HB6FKIK.mjs +0 -38
- package/dist/lib/node-esm/settings-2HB6FKIK.mjs.map +0 -7
- package/dist/lib/node-esm/state-JRQ45ACJ.mjs +0 -104
- package/dist/lib/node-esm/state-JRQ45ACJ.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-JLPZNNKB.mjs +0 -54
- package/dist/lib/node-esm/toolkit-JLPZNNKB.mjs.map +0 -7
- package/dist/lib/node-esm/url-handler-QGF2R24T.mjs +0 -94
- package/dist/lib/node-esm/url-handler-QGF2R24T.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts +0 -5
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts.map +0 -1
- package/dist/types/src/capabilities/check-app-scheme/index.d.ts +0 -3
- package/dist/types/src/capabilities/check-app-scheme/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
- package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -19
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/index.d.ts +0 -172
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts +0 -3
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +0 -26
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +0 -1
- package/dist/types/src/capabilities/tools/index.d.ts +0 -3
- package/dist/types/src/capabilities/tools/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/tools/tools.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler/index.d.ts +0 -3
- package/dist/types/src/capabilities/url-handler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts +0 -5
- package/dist/types/src/capabilities/url-handler/url-handler.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.map +0 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +0 -74
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/DeckMain.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.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 -107
- 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/fragments.d.ts +0 -4
- package/dist/types/src/components/fragments.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -118
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/check-app-scheme/check-app-scheme.ts +0 -41
- package/src/capabilities/check-app-scheme/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -10
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -555
- package/src/capabilities/react-root/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -37
- package/src/capabilities/settings/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -7
- package/src/capabilities/toolkit/index.ts +0 -7
- package/src/capabilities/toolkit/toolkit.ts +0 -63
- package/src/capabilities/tools/index.ts +0 -7
- package/src/capabilities/url-handler/index.ts +0 -7
- package/src/capabilities/url-handler/url-handler.ts +0 -95
- package/src/components/DeckLayout/ContentEmpty.tsx +0 -30
- package/src/components/DeckLayout/DeckLayout.stories.tsx +0 -51
- package/src/components/DeckLayout/DeckLayout.tsx +0 -34
- package/src/components/DeckLayout/DeckMain.tsx +0 -286
- package/src/components/DeckLayout/Fallback.tsx +0 -28
- package/src/components/DeckLayout/Topbar.tsx +0 -11
- package/src/components/Plank/Plank.stories.tsx +0 -62
- package/src/components/Plank/Plank.tsx +0 -299
- package/src/components/Plank/PlankError.tsx +0 -49
- package/src/components/Sidebar/ComplementarySidebar.tsx +0 -221
- package/src/components/fragments.ts +0 -14
- /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/DeckLayout.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
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface } from '@dxos/app-framework/
|
|
7
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
8
8
|
import { AlertDialog, Dialog as NaturalDialog } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
|
-
import { useDeckState } from '
|
|
11
|
-
import {
|
|
10
|
+
import { useDeckState } from '#hooks';
|
|
11
|
+
import { PlankErrorFallback } from '../Plank';
|
|
12
12
|
|
|
13
13
|
export const Dialog = () => {
|
|
14
14
|
const { state, updateEphemeral } = useDeckState();
|
|
@@ -28,10 +28,16 @@ export const Dialog = () => {
|
|
|
28
28
|
<Root modal={dialogBlockAlign !== 'end'} open={dialogOpen} onOpenChange={handleOpenChange}>
|
|
29
29
|
{dialogBlockAlign === 'end' ? (
|
|
30
30
|
// TODO(burdon): Placeholder creates a suspense boundary; replace with defaults.
|
|
31
|
-
<Surface
|
|
31
|
+
<Surface.Surface
|
|
32
|
+
role='dialog'
|
|
33
|
+
data={dialogContent}
|
|
34
|
+
limit={1}
|
|
35
|
+
fallback={PlankErrorFallback}
|
|
36
|
+
placeholder={<div />}
|
|
37
|
+
/>
|
|
32
38
|
) : (
|
|
33
39
|
<Overlay blockAlign={dialogBlockAlign} classNames={dialogOverlayClasses} style={dialogOverlayStyle}>
|
|
34
|
-
<Surface role='dialog' data={dialogContent} limit={1} fallback={
|
|
40
|
+
<Surface.Surface role='dialog' data={dialogContent} limit={1} fallback={PlankErrorFallback} />
|
|
35
41
|
</Overlay>
|
|
36
42
|
)}
|
|
37
43
|
</Root>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
8
|
+
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
|
|
11
|
+
const Fallback = () => {
|
|
12
|
+
const { t } = useTranslation(meta.id);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div role='none' className='min-h-screen w-full flex items-center justify-center p-8'>
|
|
16
|
+
<p
|
|
17
|
+
role='alert'
|
|
18
|
+
className='flex items-center justify-center p-8 font-normal text-lg text-error-text border border-rose-fill rounded-md'
|
|
19
|
+
>
|
|
20
|
+
{t('plugin-error.message')}
|
|
21
|
+
</p>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -3,16 +3,25 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { createContext } from '@radix-ui/react-context';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
6
8
|
import React, { type PropsWithChildren, useCallback, useEffect, useRef, useState } from 'react';
|
|
7
9
|
|
|
8
|
-
import { Surface } from '@dxos/app-framework/
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
10
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
11
|
+
import { useObjectMenuItems } from '@dxos/app-toolkit/ui';
|
|
12
|
+
import { Annotation, Obj } from '@dxos/echo';
|
|
13
|
+
import {
|
|
14
|
+
Card,
|
|
15
|
+
Popover,
|
|
16
|
+
type PopoverContentInteractOutsideEvent,
|
|
17
|
+
toLocalizedString,
|
|
18
|
+
Toolbar,
|
|
19
|
+
useTranslation,
|
|
20
|
+
} from '@dxos/react-ui';
|
|
21
|
+
import { Menu } from '@dxos/react-ui-menu';
|
|
11
22
|
|
|
12
|
-
import { useDeckState } from '
|
|
13
|
-
import { meta } from '
|
|
14
|
-
|
|
15
|
-
export type DeckPopoverRootProps = PropsWithChildren<{}>;
|
|
23
|
+
import { useDeckState } from '#hooks';
|
|
24
|
+
import { meta } from '#meta';
|
|
16
25
|
|
|
17
26
|
const DEBOUNCE_DELAY = 40;
|
|
18
27
|
|
|
@@ -22,7 +31,9 @@ type DeckPopoverContextValue = {
|
|
|
22
31
|
|
|
23
32
|
const [DeckPopoverProvider, useDeckPopoverContext] = createContext<DeckPopoverContextValue>('DeckPopover');
|
|
24
33
|
|
|
25
|
-
export
|
|
34
|
+
export type PopoverRootProps = PropsWithChildren;
|
|
35
|
+
|
|
36
|
+
export const PopoverRoot = ({ children }: PopoverRootProps) => {
|
|
26
37
|
const { state } = useDeckState();
|
|
27
38
|
const virtualRef = useRef<HTMLButtonElement | null>(null);
|
|
28
39
|
const [virtualIter, setVirtualIter] = useState(0);
|
|
@@ -59,6 +70,19 @@ export const PopoverContent = () => {
|
|
|
59
70
|
const { t } = useTranslation(meta.id);
|
|
60
71
|
const { state, updateEphemeral } = useDeckState();
|
|
61
72
|
const { setOpen } = useDeckPopoverContext('PopoverContent');
|
|
73
|
+
const popoverSubject = state.popoverContent?.subject;
|
|
74
|
+
const isObjectPopover = Obj.isObject(popoverSubject);
|
|
75
|
+
const objectMenuItems = useObjectMenuItems(popoverSubject);
|
|
76
|
+
const title = state.popoverTitle ? toLocalizedString(state.popoverTitle, t) : 'Unknown';
|
|
77
|
+
const icon = isObjectPopover
|
|
78
|
+
? Function.pipe(
|
|
79
|
+
Obj.getSchema(popoverSubject),
|
|
80
|
+
Option.fromNullable,
|
|
81
|
+
Option.flatMap(Annotation.IconAnnotation.get),
|
|
82
|
+
Option.map(({ icon }) => icon),
|
|
83
|
+
Option.getOrElse(() => 'ph--placeholder--regular'),
|
|
84
|
+
)
|
|
85
|
+
: undefined;
|
|
62
86
|
|
|
63
87
|
const handleClose = useCallback(() => {
|
|
64
88
|
setOpen(false);
|
|
@@ -96,18 +120,34 @@ export const PopoverContent = () => {
|
|
|
96
120
|
onEscapeKeyDown={handleInteractOutside}
|
|
97
121
|
>
|
|
98
122
|
<Popover.Viewport>
|
|
123
|
+
{/* Base popover */}
|
|
124
|
+
{state.popoverKind === 'base' && <Surface.Surface role='popover' data={state.popoverContent} limit={1} />}
|
|
125
|
+
|
|
126
|
+
{/* Card popover */}
|
|
99
127
|
{state.popoverKind === 'card' && (
|
|
100
|
-
<
|
|
101
|
-
<Card.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
128
|
+
<Menu.Root>
|
|
129
|
+
<Card.Root border={false} classNames='dx-card-popover'>
|
|
130
|
+
<Card.Toolbar>
|
|
131
|
+
<Card.IconBlock padding>{icon && <Card.Icon icon={icon} />}</Card.IconBlock>
|
|
132
|
+
<Card.Title>{title}</Card.Title>
|
|
133
|
+
{/* TODO(wittjosiah): Reconcile with Card.Menu. */}
|
|
134
|
+
<Card.IconBlock padding>
|
|
135
|
+
<Menu.Trigger asChild disabled={!objectMenuItems.length}>
|
|
136
|
+
<Toolbar.IconButton
|
|
137
|
+
variant='ghost'
|
|
138
|
+
icon='ph--dots-three-vertical--regular'
|
|
139
|
+
iconOnly
|
|
140
|
+
label='Actions'
|
|
141
|
+
/>
|
|
142
|
+
</Menu.Trigger>
|
|
143
|
+
<Menu.Content items={objectMenuItems} />
|
|
144
|
+
</Card.IconBlock>
|
|
145
|
+
</Card.Toolbar>
|
|
146
|
+
|
|
147
|
+
<Surface.Surface role='card--content' data={state.popoverContent} limit={1} />
|
|
148
|
+
</Card.Root>
|
|
149
|
+
</Menu.Root>
|
|
109
150
|
)}
|
|
110
|
-
{state.popoverKind === 'base' && <Surface role='popover' data={state.popoverContent} limit={1} />}
|
|
111
151
|
</Popover.Viewport>
|
|
112
152
|
<Popover.Arrow />
|
|
113
153
|
</Popover.Content>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type LayoutOperation } from '@dxos/app-toolkit';
|
|
8
8
|
import {
|
|
9
9
|
Button,
|
|
10
10
|
Icon,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
useTranslation,
|
|
15
15
|
} from '@dxos/react-ui';
|
|
16
16
|
|
|
17
|
-
import { meta } from '
|
|
17
|
+
import { meta } from '#meta';
|
|
18
18
|
|
|
19
19
|
// TODO(wittjosiah): Render remaining duration as a progress bar within the toast.
|
|
20
20
|
export const Toast = ({
|
|
@@ -28,7 +28,7 @@ export const Toast = ({
|
|
|
28
28
|
closeLabel,
|
|
29
29
|
onAction,
|
|
30
30
|
onOpenChange,
|
|
31
|
-
}:
|
|
31
|
+
}: LayoutOperation.Toast & Pick<ToastRootProps, 'onOpenChange'>) => {
|
|
32
32
|
const { t } = useTranslation(meta.id);
|
|
33
33
|
|
|
34
34
|
return (
|
|
@@ -61,7 +61,7 @@ export const Toast = ({
|
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
export type ToasterProps = {
|
|
64
|
-
toasts?:
|
|
64
|
+
toasts?: LayoutOperation.Toast[];
|
|
65
65
|
onDismissToast?: (id: string) => void;
|
|
66
66
|
};
|
|
67
67
|
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React, { useMemo } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability, Plugin } from '@dxos/app-framework';
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
11
|
+
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
12
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
13
|
+
import { corePlugins } from '@dxos/plugin-testing';
|
|
14
|
+
import { faker } from '@dxos/random';
|
|
15
|
+
import { Main } from '@dxos/react-ui';
|
|
16
|
+
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
17
|
+
import { Loading } from '@dxos/react-ui/testing';
|
|
18
|
+
import { StackContext } from '@dxos/react-ui-stack';
|
|
19
|
+
import { Organization } from '@dxos/types';
|
|
20
|
+
|
|
21
|
+
import { meta as pluginMeta } from '#meta';
|
|
22
|
+
|
|
23
|
+
import { translations } from '../../translations';
|
|
24
|
+
|
|
25
|
+
import { Plank } from './Plank';
|
|
26
|
+
|
|
27
|
+
import { DeckSettings, DeckState } from '#capabilities';
|
|
28
|
+
|
|
29
|
+
const TestPlugin = Plugin.define(pluginMeta).pipe(
|
|
30
|
+
Plugin.addModule({
|
|
31
|
+
activatesOn: AppActivationEvents.SetupSettings,
|
|
32
|
+
activate: DeckSettings,
|
|
33
|
+
}),
|
|
34
|
+
Plugin.addModule({
|
|
35
|
+
id: Capability.getModuleTag(DeckState),
|
|
36
|
+
activatesOn: AppActivationEvents.AppGraphReady,
|
|
37
|
+
activate: () => DeckState(),
|
|
38
|
+
}),
|
|
39
|
+
Plugin.make,
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
faker.seed(101);
|
|
43
|
+
|
|
44
|
+
const storySurfaceExtension = Capability.contributes(
|
|
45
|
+
Capabilities.ReactSurface,
|
|
46
|
+
Surface.create({
|
|
47
|
+
id: 'story-article',
|
|
48
|
+
role: 'article',
|
|
49
|
+
component: ({ data }) => {
|
|
50
|
+
const subject = (data as any)?.subject;
|
|
51
|
+
if (!subject) {
|
|
52
|
+
return <Loading />;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<Json.Root data={subject}>
|
|
57
|
+
<Json.Content />
|
|
58
|
+
</Json.Root>
|
|
59
|
+
);
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
const DefaultStory = () => {
|
|
65
|
+
const { graph } = useAppGraph();
|
|
66
|
+
const item = useMemo(() => Organization.make({ name: faker.company.name() }), []);
|
|
67
|
+
const node = useMemo(() => ({ id: item.id, data: item, type: 'test', properties: { label: item.name } }), [item]);
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<Main.Root>
|
|
71
|
+
<Main.Content bounce handlesFocus classNames='grid' style={{ '--main-spacing': '0' } as any}>
|
|
72
|
+
<div role='none' className='relative overflow-hidden bg-deck-surface'>
|
|
73
|
+
<StackContext.Provider value={{ orientation: 'horizontal', size: 'contain', rail: true }}>
|
|
74
|
+
<Plank.Root graph={graph} part='solo' layoutMode='solo'>
|
|
75
|
+
<Plank.Content solo companion={false} encapsulate={false}>
|
|
76
|
+
<Plank.Component id={item.id} part='solo-primary' node={node as any} />
|
|
77
|
+
</Plank.Content>
|
|
78
|
+
</Plank.Root>
|
|
79
|
+
</StackContext.Provider>
|
|
80
|
+
</div>
|
|
81
|
+
</Main.Content>
|
|
82
|
+
</Main.Root>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const meta = {
|
|
87
|
+
title: 'plugins/plugin-deck/containers/Plank',
|
|
88
|
+
component: DefaultStory,
|
|
89
|
+
decorators: [
|
|
90
|
+
withPluginManager({
|
|
91
|
+
plugins: [...corePlugins(), TestPlugin()],
|
|
92
|
+
capabilities: [storySurfaceExtension],
|
|
93
|
+
setupEvents: [AppActivationEvents.SetupSettings],
|
|
94
|
+
}),
|
|
95
|
+
],
|
|
96
|
+
parameters: {
|
|
97
|
+
translations,
|
|
98
|
+
},
|
|
99
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
100
|
+
|
|
101
|
+
export default meta;
|
|
102
|
+
|
|
103
|
+
type Story = StoryObj<typeof meta>;
|
|
104
|
+
|
|
105
|
+
export const Default: Story = {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { PlankRoot, PlankRootProps } from './PlankRoot';
|
|
6
|
+
import { PlankComponent, PlankComponentProps } from './PlankComponent';
|
|
7
|
+
import { PlankContent, PlankContentProps } from './PlankContent';
|
|
8
|
+
import { PlankHeading } from './PlankHeading';
|
|
9
|
+
import { PlankControls } from './PlankControls';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Radix-style composite Plank component.
|
|
13
|
+
*/
|
|
14
|
+
export const Plank = {
|
|
15
|
+
Root: PlankRoot,
|
|
16
|
+
Content: PlankContent,
|
|
17
|
+
Component: PlankComponent,
|
|
18
|
+
Heading: PlankHeading,
|
|
19
|
+
Controls: PlankControls,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type { PlankRootProps, PlankComponentProps, PlankContentProps };
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useFocusFinders } from '@fluentui/react-tabster';
|
|
6
|
+
import React, { type KeyboardEvent, memo, useCallback, useLayoutEffect, useMemo, useRef } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
9
|
+
import { getLinkedVariant } from '@dxos/react-ui-attention';
|
|
10
|
+
import { debounce } from '@dxos/async';
|
|
11
|
+
import { type Node } from '@dxos/plugin-graph';
|
|
12
|
+
import { useAttentionAttributes } from '@dxos/react-ui-attention';
|
|
13
|
+
import { StackItem, railGridHorizontal } from '@dxos/react-ui-stack';
|
|
14
|
+
import { mainIntrinsicSize, mx } from '@dxos/ui-theme';
|
|
15
|
+
|
|
16
|
+
import { useMainSize } from '#hooks';
|
|
17
|
+
import { PLANK_COMPANION_TYPE } from '#types';
|
|
18
|
+
|
|
19
|
+
import { PlankRootProps, usePlankContext } from './PlankRoot';
|
|
20
|
+
import { PlankError, PlankErrorFallback } from './PlankError';
|
|
21
|
+
import { PlankHeading } from './PlankHeading';
|
|
22
|
+
import { PlankLoading } from './PlankLoading';
|
|
23
|
+
|
|
24
|
+
export type PlankComponentProps = Pick<PlankRootProps, 'part'> & {
|
|
25
|
+
id: string;
|
|
26
|
+
path?: string[];
|
|
27
|
+
order?: number;
|
|
28
|
+
active?: string[];
|
|
29
|
+
node?: Node.Node;
|
|
30
|
+
primary?: Node.Node;
|
|
31
|
+
companions?: Node.Node[];
|
|
32
|
+
companioned?: 'primary' | 'companion';
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const PlankComponent = memo(
|
|
36
|
+
({ part, id, path, order, active, node, primary, companions, companioned }: PlankComponentProps) => {
|
|
37
|
+
const { layoutMode, settings, popoverAnchorId, scrollIntoView, plankSizing, onResize, onScrollIntoView } =
|
|
38
|
+
usePlankContext('PlankComponent');
|
|
39
|
+
|
|
40
|
+
const canResize = layoutMode === 'multi';
|
|
41
|
+
const { findFirstFocusable } = useFocusFinders();
|
|
42
|
+
const attentionAttrs = useAttentionAttributes(primary?.id ?? id);
|
|
43
|
+
const orderId = companioned === 'companion' ? primary?.id : id;
|
|
44
|
+
const index = orderId && active ? active.findIndex((entryId) => entryId === orderId) : -1;
|
|
45
|
+
const length = active?.length ?? 1;
|
|
46
|
+
const isOrdered = !!active && index >= 0;
|
|
47
|
+
const canIncrementStart = isOrdered && index > 0;
|
|
48
|
+
const canIncrementEnd = isOrdered && index < length - 1;
|
|
49
|
+
|
|
50
|
+
const rootElement = useRef<HTMLDivElement | null>(null);
|
|
51
|
+
|
|
52
|
+
const variant = node?.type === PLANK_COMPANION_TYPE ? getLinkedVariant(id) : undefined;
|
|
53
|
+
const sizeKey = id.split('+')[0];
|
|
54
|
+
const size = plankSizing?.[sizeKey] as number | undefined;
|
|
55
|
+
|
|
56
|
+
const handleSizeChange = useCallback(
|
|
57
|
+
debounce((nextSize: number) => {
|
|
58
|
+
onResize?.(sizeKey, nextSize);
|
|
59
|
+
}, 200),
|
|
60
|
+
[onResize, sizeKey],
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// TODO(thure): Tabster's focus group should handle moving focus to Main, but something is blocking it.
|
|
64
|
+
const handleKeyDown = useCallback((event: KeyboardEvent) => {
|
|
65
|
+
if (event.target === event.currentTarget) {
|
|
66
|
+
switch (event.key) {
|
|
67
|
+
case 'Escape':
|
|
68
|
+
rootElement.current?.closest('main')?.focus();
|
|
69
|
+
break;
|
|
70
|
+
case 'Enter':
|
|
71
|
+
rootElement.current && findFirstFocusable(rootElement.current)?.focus();
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}, []);
|
|
76
|
+
|
|
77
|
+
useLayoutEffect(() => {
|
|
78
|
+
if (scrollIntoView === id) {
|
|
79
|
+
layoutMode === 'multi' && rootElement.current?.scrollIntoView({ behavior: 'smooth', inline: 'center' });
|
|
80
|
+
onScrollIntoView?.(undefined);
|
|
81
|
+
}
|
|
82
|
+
}, [id, scrollIntoView, layoutMode, onScrollIntoView]);
|
|
83
|
+
|
|
84
|
+
const isSolo = layoutMode.startsWith('solo') && part === 'solo';
|
|
85
|
+
const isAttendable =
|
|
86
|
+
(layoutMode.startsWith('solo') && part.startsWith('solo')) || (layoutMode === 'multi' && part === 'multi');
|
|
87
|
+
const sizeAttrs = useMainSize();
|
|
88
|
+
|
|
89
|
+
const data = useMemo(
|
|
90
|
+
() =>
|
|
91
|
+
node && {
|
|
92
|
+
attendableId: id,
|
|
93
|
+
subject: node.data,
|
|
94
|
+
companionTo: primary?.data,
|
|
95
|
+
properties: node.properties,
|
|
96
|
+
variant,
|
|
97
|
+
path,
|
|
98
|
+
popoverAnchorId,
|
|
99
|
+
},
|
|
100
|
+
[node, node?.data, node?.properties, path, popoverAnchorId, primary?.data, variant],
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
// TODO(wittjosiah): Change prop to accept a component.
|
|
104
|
+
const placeholder = useMemo(() => <PlankLoading />, []);
|
|
105
|
+
|
|
106
|
+
const fullscreen = layoutMode === 'solo--fullscreen';
|
|
107
|
+
const className = mx(
|
|
108
|
+
'dx-attention-surface relative dx-focus-ring-inset-over-all dx-density-coarse',
|
|
109
|
+
isSolo && 'absolute inset-0',
|
|
110
|
+
isSolo && mainIntrinsicSize,
|
|
111
|
+
railGridHorizontal,
|
|
112
|
+
part.startsWith('solo') && 'grid',
|
|
113
|
+
part.startsWith('solo-') && 'grid-rows-subgrid row-span-2 min-w-0',
|
|
114
|
+
fullscreen && 'grid-rows-1',
|
|
115
|
+
part === 'multi' && (companioned === 'companion' ? 'border-separator! border-e' : 'border-separator! border-x'),
|
|
116
|
+
part === 'solo-companion' && 'border-separator! border-s',
|
|
117
|
+
settings?.encapsulatedPlanks &&
|
|
118
|
+
!part.startsWith('solo') &&
|
|
119
|
+
'mx-(--main-spacing) border-separator! border rounded-sm overflow-hidden',
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
const Root = part.startsWith('solo') ? 'article' : StackItem.Root;
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<Root
|
|
126
|
+
ref={rootElement}
|
|
127
|
+
data-testid='deck.plank'
|
|
128
|
+
data-popover-collision-boundary={true}
|
|
129
|
+
tabIndex={0}
|
|
130
|
+
{...(part.startsWith('solo')
|
|
131
|
+
? ({
|
|
132
|
+
className,
|
|
133
|
+
...sizeAttrs,
|
|
134
|
+
} as any)
|
|
135
|
+
: {
|
|
136
|
+
role: 'article',
|
|
137
|
+
classNames: className,
|
|
138
|
+
order,
|
|
139
|
+
size,
|
|
140
|
+
item: { id },
|
|
141
|
+
onSizeChange: handleSizeChange,
|
|
142
|
+
})}
|
|
143
|
+
{...(isAttendable ? attentionAttrs : {})}
|
|
144
|
+
onKeyDown={handleKeyDown}
|
|
145
|
+
>
|
|
146
|
+
{node ? (
|
|
147
|
+
<>
|
|
148
|
+
{!fullscreen && (
|
|
149
|
+
<PlankHeading
|
|
150
|
+
id={id}
|
|
151
|
+
part={part.startsWith('solo-') ? 'solo' : part}
|
|
152
|
+
node={node}
|
|
153
|
+
layoutMode={layoutMode}
|
|
154
|
+
deckEnabled={settings?.enableDeck}
|
|
155
|
+
canIncrementStart={canIncrementStart}
|
|
156
|
+
canIncrementEnd={canIncrementEnd}
|
|
157
|
+
popoverAnchorId={popoverAnchorId}
|
|
158
|
+
primaryId={primary?.id}
|
|
159
|
+
companioned={companioned}
|
|
160
|
+
companions={companions}
|
|
161
|
+
/>
|
|
162
|
+
)}
|
|
163
|
+
<Surface.Surface
|
|
164
|
+
key={node.id}
|
|
165
|
+
role='article'
|
|
166
|
+
data={data}
|
|
167
|
+
limit={1}
|
|
168
|
+
fallback={PlankErrorFallback}
|
|
169
|
+
placeholder={placeholder}
|
|
170
|
+
/>
|
|
171
|
+
</>
|
|
172
|
+
) : (
|
|
173
|
+
<PlankError id={id} part={part} />
|
|
174
|
+
)}
|
|
175
|
+
{canResize && <StackItem.ResizeHandle />}
|
|
176
|
+
</Root>
|
|
177
|
+
);
|
|
178
|
+
},
|
|
179
|
+
);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type PropsWithChildren } from 'react';
|
|
6
|
+
|
|
7
|
+
import { railGridHorizontal } from '@dxos/react-ui-stack';
|
|
8
|
+
import { composable, composableProps, mainIntrinsicSize } from '@dxos/ui-theme';
|
|
9
|
+
|
|
10
|
+
import { useMainSize } from '#hooks';
|
|
11
|
+
|
|
12
|
+
export type PlankContentProps = PropsWithChildren<{
|
|
13
|
+
solo: boolean;
|
|
14
|
+
companion: boolean;
|
|
15
|
+
encapsulate: boolean;
|
|
16
|
+
}>;
|
|
17
|
+
|
|
18
|
+
export const PlankContent = composable<HTMLDivElement, PlankContentProps>(
|
|
19
|
+
({ children, solo, companion, encapsulate, ...props }, forwardedRef) => {
|
|
20
|
+
const sizeAttrs = useMainSize();
|
|
21
|
+
if (!solo) {
|
|
22
|
+
return children;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div
|
|
27
|
+
{...sizeAttrs}
|
|
28
|
+
{...composableProps(props, {
|
|
29
|
+
role: 'none',
|
|
30
|
+
classNames: [
|
|
31
|
+
'absolute inset-(--main-spacing) grid',
|
|
32
|
+
railGridHorizontal,
|
|
33
|
+
mainIntrinsicSize,
|
|
34
|
+
companion && 'grid-cols-[6fr_4fr]', // Ration of primary to companion.
|
|
35
|
+
encapsulate && 'border border-separator rounded-sm overflow-hidden',
|
|
36
|
+
],
|
|
37
|
+
})}
|
|
38
|
+
data-popover-collision-boundary={true}
|
|
39
|
+
ref={forwardedRef}
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
},
|
|
45
|
+
);
|