@dxos/plugin-deck 0.8.4-main.422d1c7879 → 0.8.4-main.51f1e5ca51
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-EUN62IUE.mjs → add-toast-JWJOQNVL.mjs} +3 -3
- package/dist/lib/browser/{add-toast-EUN62IUE.mjs.map → add-toast-JWJOQNVL.mjs.map} +1 -1
- package/dist/lib/browser/{adjust-XWB6ZZ6U.mjs → adjust-RG6LIQLX.mjs} +7 -7
- package/dist/lib/browser/{adjust-XWB6ZZ6U.mjs.map → adjust-RG6LIQLX.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-KUTDCWZF.mjs → chunk-GLB73Q6U.mjs} +2 -10
- package/dist/lib/browser/{chunk-KUTDCWZF.mjs.map → chunk-GLB73Q6U.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-BRZAVPMC.mjs → chunk-LSZ47AY3.mjs} +1 -1
- package/dist/lib/browser/{chunk-5LM6A3EC.mjs → chunk-MARE7ZFK.mjs} +22 -15
- package/dist/lib/browser/{chunk-5LM6A3EC.mjs.map → chunk-MARE7ZFK.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-FRVCL5NO.mjs → chunk-XM263CQU.mjs} +2 -2
- package/dist/lib/browser/chunk-XM263CQU.mjs.map +7 -0
- package/dist/lib/browser/{chunk-DF2VZ6W3.mjs → chunk-ZYYOSX5I.mjs} +1 -1
- package/dist/lib/browser/{chunk-DF2VZ6W3.mjs.map → chunk-ZYYOSX5I.mjs.map} +2 -2
- package/dist/lib/browser/{close-JXK73YIM.mjs → close-URA766JO.mjs} +6 -6
- package/dist/lib/browser/{close-JXK73YIM.mjs.map → close-URA766JO.mjs.map} +1 -1
- package/dist/lib/browser/index.mjs +7 -70
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{open-K2JOEW2E.mjs → open-OPFOOHCQ.mjs} +7 -10
- package/dist/lib/browser/open-OPFOOHCQ.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +3 -3
- package/dist/lib/browser/operations/index.mjs.map +3 -3
- package/dist/lib/browser/{revert-workspace-BNIR5U64.mjs → revert-workspace-KP2Y4QLG.mjs} +3 -3
- package/dist/lib/browser/{revert-workspace-BNIR5U64.mjs.map → revert-workspace-KP2Y4QLG.mjs.map} +1 -1
- package/dist/lib/browser/{scroll-into-view-4GSKC3GA.mjs → scroll-into-view-S5H2FGSQ.mjs} +3 -3
- package/dist/lib/browser/{scroll-into-view-4GSKC3GA.mjs.map → scroll-into-view-S5H2FGSQ.mjs.map} +1 -1
- package/dist/lib/browser/{set-XCG6NIAO.mjs → set-AEKFFSIX.mjs} +5 -5
- package/dist/lib/browser/{set-XCG6NIAO.mjs.map → set-AEKFFSIX.mjs.map} +1 -1
- package/dist/lib/browser/{set-layout-mode-BEVNGOY2.mjs → set-layout-mode-CWIGQDFZ.mjs} +5 -10
- package/dist/lib/browser/set-layout-mode-CWIGQDFZ.mjs.map +7 -0
- package/dist/lib/browser/{show-undo-5RQNREEB.mjs → show-undo-XFVEDKYC.mjs} +3 -3
- package/dist/lib/browser/{show-undo-5RQNREEB.mjs.map → show-undo-XFVEDKYC.mjs.map} +1 -1
- package/dist/lib/browser/{switch-workspace-ICJJWNFT.mjs → switch-workspace-DSAAXZSI.mjs} +4 -12
- package/dist/lib/browser/switch-workspace-DSAAXZSI.mjs.map +7 -0
- package/dist/lib/browser/translations.mjs +57 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/browser/{update-companion-VPCBH3YT.mjs → update-companion-IDBBBHT3.mjs} +4 -4
- package/dist/lib/browser/{update-companion-VPCBH3YT.mjs.map → update-companion-IDBBBHT3.mjs.map} +1 -1
- package/dist/lib/browser/{update-complementary-74DEQY6T.mjs → update-complementary-55PNO5MD.mjs} +3 -3
- package/dist/lib/browser/{update-complementary-74DEQY6T.mjs.map → update-complementary-55PNO5MD.mjs.map} +1 -1
- package/dist/lib/browser/{update-dialog-6TDUYI5R.mjs → update-dialog-VNARIANC.mjs} +3 -3
- package/dist/lib/browser/{update-dialog-6TDUYI5R.mjs.map → update-dialog-VNARIANC.mjs.map} +1 -1
- package/dist/lib/browser/{update-plank-size-5VHZOTHE.mjs → update-plank-size-H63PRRXS.mjs} +5 -5
- package/dist/lib/browser/{update-plank-size-5VHZOTHE.mjs.map → update-plank-size-H63PRRXS.mjs.map} +1 -1
- package/dist/lib/browser/{update-popover-W7E2Z5T6.mjs → update-popover-ODTPZ3JL.mjs} +3 -3
- package/dist/lib/browser/{update-popover-W7E2Z5T6.mjs.map → update-popover-ODTPZ3JL.mjs.map} +1 -1
- package/dist/lib/browser/{update-sidebar-H3A6ZFRU.mjs → update-sidebar-JDVQ36WK.mjs} +3 -3
- package/dist/lib/browser/{update-sidebar-H3A6ZFRU.mjs.map → update-sidebar-JDVQ36WK.mjs.map} +1 -1
- package/dist/lib/node-esm/{add-toast-AZM7NFNM.mjs → add-toast-JUTN4GTI.mjs} +3 -3
- package/dist/lib/node-esm/{add-toast-AZM7NFNM.mjs.map → add-toast-JUTN4GTI.mjs.map} +1 -1
- package/dist/lib/node-esm/{adjust-ICALXQ6F.mjs → adjust-P5QK33P4.mjs} +7 -7
- package/dist/lib/node-esm/{adjust-ICALXQ6F.mjs.map → adjust-P5QK33P4.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-B7WZXRW4.mjs → chunk-FO7YDJZ3.mjs} +22 -15
- package/dist/lib/node-esm/{chunk-B7WZXRW4.mjs.map → chunk-FO7YDJZ3.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-MB4SDDVY.mjs → chunk-KY7ZCANM.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-A63Q53TW.mjs → chunk-L7OVX7CV.mjs} +2 -2
- package/dist/lib/node-esm/chunk-L7OVX7CV.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-MLVJ2ODW.mjs → chunk-SHSR2CYO.mjs} +2 -10
- package/dist/lib/node-esm/{chunk-MLVJ2ODW.mjs.map → chunk-SHSR2CYO.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-IRWCUYJY.mjs → chunk-WGBUTT5K.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-IRWCUYJY.mjs.map → chunk-WGBUTT5K.mjs.map} +2 -2
- package/dist/lib/node-esm/{close-GC5V3GD5.mjs → close-U5VC7ERP.mjs} +6 -6
- package/dist/lib/node-esm/{close-GC5V3GD5.mjs.map → close-U5VC7ERP.mjs.map} +1 -1
- package/dist/lib/node-esm/index.mjs +7 -70
- 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-XXEHIR6G.mjs → open-4B3P5XGS.mjs} +7 -10
- package/dist/lib/node-esm/open-4B3P5XGS.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +3 -3
- package/dist/lib/node-esm/operations/index.mjs.map +3 -3
- package/dist/lib/node-esm/{revert-workspace-WCXAL5C6.mjs → revert-workspace-QD63M2U7.mjs} +3 -3
- package/dist/lib/node-esm/{revert-workspace-WCXAL5C6.mjs.map → revert-workspace-QD63M2U7.mjs.map} +1 -1
- package/dist/lib/node-esm/{scroll-into-view-2ZNU44ZO.mjs → scroll-into-view-G5M2EWK7.mjs} +3 -3
- package/dist/lib/node-esm/{scroll-into-view-2ZNU44ZO.mjs.map → scroll-into-view-G5M2EWK7.mjs.map} +1 -1
- package/dist/lib/node-esm/{set-5MO2JCUQ.mjs → set-ERJCXZBY.mjs} +5 -5
- package/dist/lib/node-esm/{set-5MO2JCUQ.mjs.map → set-ERJCXZBY.mjs.map} +1 -1
- package/dist/lib/node-esm/{set-layout-mode-3RK4HIG7.mjs → set-layout-mode-BOZD7744.mjs} +5 -10
- package/dist/lib/node-esm/set-layout-mode-BOZD7744.mjs.map +7 -0
- package/dist/lib/node-esm/{show-undo-WV7SAYGJ.mjs → show-undo-H5BRBYDC.mjs} +3 -3
- package/dist/lib/node-esm/{show-undo-WV7SAYGJ.mjs.map → show-undo-H5BRBYDC.mjs.map} +1 -1
- package/dist/lib/node-esm/{switch-workspace-VNM75H66.mjs → switch-workspace-F54PXE5N.mjs} +4 -12
- package/dist/lib/node-esm/switch-workspace-F54PXE5N.mjs.map +7 -0
- package/dist/lib/node-esm/translations.mjs +58 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/lib/node-esm/{update-companion-SIB3GWH7.mjs → update-companion-47LMKL5R.mjs} +4 -4
- package/dist/lib/node-esm/{update-companion-SIB3GWH7.mjs.map → update-companion-47LMKL5R.mjs.map} +1 -1
- package/dist/lib/node-esm/{update-complementary-CZTIVIXU.mjs → update-complementary-7VYYG7L2.mjs} +3 -3
- package/dist/lib/node-esm/{update-complementary-CZTIVIXU.mjs.map → update-complementary-7VYYG7L2.mjs.map} +1 -1
- package/dist/lib/node-esm/{update-dialog-HEDV5XBB.mjs → update-dialog-CABL7OWW.mjs} +3 -3
- package/dist/lib/node-esm/{update-dialog-HEDV5XBB.mjs.map → update-dialog-CABL7OWW.mjs.map} +1 -1
- package/dist/lib/node-esm/{update-plank-size-JJLU7VE3.mjs → update-plank-size-WYTSMZF2.mjs} +5 -5
- package/dist/lib/node-esm/{update-plank-size-JJLU7VE3.mjs.map → update-plank-size-WYTSMZF2.mjs.map} +1 -1
- package/dist/lib/node-esm/{update-popover-HI5TU2VT.mjs → update-popover-YZDYGL7G.mjs} +3 -3
- package/dist/lib/node-esm/{update-popover-HI5TU2VT.mjs.map → update-popover-YZDYGL7G.mjs.map} +1 -1
- package/dist/lib/node-esm/{update-sidebar-QB5BA655.mjs → update-sidebar-HV736LUN.mjs} +3 -3
- package/dist/lib/node-esm/{update-sidebar-QB5BA655.mjs.map → update-sidebar-HV736LUN.mjs.map} +1 -1
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +17 -17
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +16 -16
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts +42 -52
- package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts.map +1 -1
- package/dist/types/src/components/Matrix/Matrix.d.ts +2 -2
- package/dist/types/src/components/Matrix/Matrix.d.ts.map +1 -1
- package/dist/types/src/components/Matrix/Matrix.stories.d.ts.map +1 -1
- package/dist/types/src/containers/Deck/Banner.d.ts +1 -1
- package/dist/types/src/containers/Deck/Banner.d.ts.map +1 -1
- package/dist/types/src/containers/Deck/Deck.d.ts.map +1 -1
- package/dist/types/src/containers/Deck/Deck.stories.d.ts +42 -52
- package/dist/types/src/containers/Deck/Deck.stories.d.ts.map +1 -1
- package/dist/types/src/containers/Deck/DeckContent.d.ts +4 -4
- package/dist/types/src/containers/Deck/DeckContent.d.ts.map +1 -1
- package/dist/types/src/containers/Deck/DeckRoot.d.ts +5 -8
- package/dist/types/src/containers/Deck/DeckRoot.d.ts.map +1 -1
- package/dist/types/src/containers/Deck/DeckViewport.d.ts +4 -7
- package/dist/types/src/containers/Deck/DeckViewport.d.ts.map +1 -1
- package/dist/types/src/containers/Deck/StatusBar.d.ts.map +1 -1
- package/dist/types/src/containers/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts +42 -52
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts.map +1 -1
- package/dist/types/src/containers/DeckLayout/Popover.d.ts.map +1 -1
- package/dist/types/src/containers/DeckLayout/Toast.d.ts +1 -1
- package/dist/types/src/containers/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/containers/DeckLayout/index.d.ts.map +1 -1
- package/dist/types/src/containers/Plank/Plank.d.ts +1 -1
- package/dist/types/src/containers/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/containers/Plank/Plank.stories.d.ts +42 -52
- package/dist/types/src/containers/Plank/Plank.stories.d.ts.map +1 -1
- package/dist/types/src/containers/Plank/PlankContent.d.ts +1 -1
- package/dist/types/src/containers/Plank/PlankError.d.ts +1 -1
- package/dist/types/src/containers/Plank/PlankError.d.ts.map +1 -1
- package/dist/types/src/containers/Plank/PlankRoot.d.ts.map +1 -1
- package/dist/types/src/containers/Sidebar/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/containers/Sidebar/SidebarButton.d.ts +1 -1
- package/dist/types/src/containers/Sidebar/SidebarButton.d.ts.map +1 -1
- package/dist/types/src/hooks/useBreakpoints.d.ts +1 -1
- package/dist/types/src/hooks/useCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
- package/dist/types/src/hooks/useMainSize.d.ts.map +1 -1
- package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
- package/dist/types/src/hooks/useSelectedCompanion.d.ts.map +1 -1
- package/dist/types/src/layout.d.ts.map +1 -1
- package/dist/types/src/operations/add-toast.d.ts +1 -1
- package/dist/types/src/operations/add-toast.d.ts.map +1 -1
- package/dist/types/src/operations/adjust.d.ts +1 -1
- package/dist/types/src/operations/adjust.d.ts.map +1 -1
- package/dist/types/src/operations/close.d.ts +1 -1
- package/dist/types/src/operations/close.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +2 -2
- package/dist/types/src/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/operations/helpers.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/open.d.ts +1 -1
- package/dist/types/src/operations/open.d.ts.map +1 -1
- package/dist/types/src/operations/revert-workspace.d.ts +1 -1
- package/dist/types/src/operations/revert-workspace.d.ts.map +1 -1
- package/dist/types/src/operations/scroll-into-view.d.ts +1 -1
- package/dist/types/src/operations/scroll-into-view.d.ts.map +1 -1
- package/dist/types/src/operations/set-layout-mode.d.ts +1 -1
- package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -1
- package/dist/types/src/operations/set.d.ts +1 -1
- package/dist/types/src/operations/set.d.ts.map +1 -1
- package/dist/types/src/operations/show-undo.d.ts +1 -1
- package/dist/types/src/operations/show-undo.d.ts.map +1 -1
- package/dist/types/src/operations/switch-workspace.d.ts +1 -1
- package/dist/types/src/operations/switch-workspace.d.ts.map +1 -1
- package/dist/types/src/operations/update-companion.d.ts +1 -1
- package/dist/types/src/operations/update-companion.d.ts.map +1 -1
- package/dist/types/src/operations/update-complementary.d.ts +1 -1
- package/dist/types/src/operations/update-complementary.d.ts.map +1 -1
- package/dist/types/src/operations/update-dialog.d.ts +1 -1
- package/dist/types/src/operations/update-dialog.d.ts.map +1 -1
- package/dist/types/src/operations/update-plank-size.d.ts +1 -1
- package/dist/types/src/operations/update-plank-size.d.ts.map +1 -1
- package/dist/types/src/operations/update-popover.d.ts +1 -1
- package/dist/types/src/operations/update-popover.d.ts.map +1 -1
- package/dist/types/src/operations/update-sidebar.d.ts +1 -1
- package/dist/types/src/operations/update-sidebar.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +42 -53
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +5 -5
- package/dist/types/src/types/Settings.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +16 -16
- 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/schema.d.ts.map +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -1
- package/dist/types/src/util/plank-url-params.d.ts.map +1 -1
- package/dist/types/src/util/sanitize-persisted-state.d.ts.map +1 -1
- package/dist/types/src/util/set-active.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +51 -45
- package/src/DeckPlugin.ts +2 -3
- package/src/capabilities/app-graph-builder.ts +2 -2
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/settings.ts +1 -1
- package/src/capabilities/url-handler.ts +1 -1
- package/src/components/DeckSettings/DeckSettings.stories.tsx +2 -1
- package/src/components/DeckSettings/DeckSettings.tsx +8 -47
- package/src/components/Matrix/Matrix.stories.tsx +1 -1
- package/src/containers/Deck/Deck.stories.tsx +1 -1
- package/src/containers/DeckLayout/DeckLayout.stories.tsx +1 -1
- package/src/containers/Plank/Plank.stories.tsx +1 -1
- package/src/containers/Sidebar/SidebarButton.tsx +7 -1
- package/src/hooks/useDeckCompanions.ts +1 -1
- package/src/operations/add-toast.ts +1 -1
- package/src/operations/adjust.ts +1 -1
- package/src/operations/close.ts +1 -1
- package/src/operations/definitions.ts +1 -1
- package/src/operations/index.ts +1 -1
- package/src/operations/open.ts +1 -1
- package/src/operations/revert-workspace.ts +1 -1
- package/src/operations/scroll-into-view.ts +1 -1
- package/src/operations/set-layout-mode.ts +1 -1
- package/src/operations/set.ts +1 -1
- package/src/operations/show-undo.ts +1 -1
- package/src/operations/switch-workspace.ts +1 -1
- package/src/operations/update-companion.ts +1 -1
- package/src/operations/update-complementary.ts +1 -1
- package/src/operations/update-dialog.ts +1 -1
- package/src/operations/update-plank-size.ts +1 -1
- package/src/operations/update-popover.ts +1 -1
- package/src/operations/update-sidebar.ts +1 -1
- package/src/translations.ts +2 -12
- package/src/types/Settings.ts +30 -5
- package/dist/lib/browser/chunk-FRVCL5NO.mjs.map +0 -7
- package/dist/lib/browser/open-K2JOEW2E.mjs.map +0 -7
- package/dist/lib/browser/set-layout-mode-BEVNGOY2.mjs.map +0 -7
- package/dist/lib/browser/switch-workspace-ICJJWNFT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-A63Q53TW.mjs.map +0 -7
- package/dist/lib/node-esm/open-XXEHIR6G.mjs.map +0 -7
- package/dist/lib/node-esm/set-layout-mode-3RK4HIG7.mjs.map +0 -7
- package/dist/lib/node-esm/switch-workspace-VNM75H66.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-BRZAVPMC.mjs.map → chunk-LSZ47AY3.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-MB4SDDVY.mjs.map → chunk-KY7ZCANM.mjs.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/operations/add-toast.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities } from '@dxos/app-framework';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities } from '@dxos/app-framework';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\n\nimport { DeckCapabilities } from '../types';\n\nconst handler: Operation.WithHandler<typeof LayoutOperation.AddToast> = LayoutOperation.AddToast.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n yield* Capabilities.updateAtomValue(DeckCapabilities.EphemeralState, (state) => ({\n ...state,\n toasts: [...state.toasts, input as LayoutOperation.Toast],\n }));\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
5
|
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,oBAAoB;AAC7B,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAI1B,IAAMC,UAAkEC,gBAAgBC,SAASC,KAC/FC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,SAAOC,aAAaC,gBAAgBC,iBAAiBC,gBAAgB,CAACC,WAAW;IAC/E,GAAGA;IACHC,QAAQ;SAAID,MAAMC;MAAQN;;EAC5B,EAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,oBAAeP;",
|
|
6
6
|
"names": ["Effect", "Capabilities", "LayoutOperation", "Operation", "handler", "LayoutOperation", "AddToast", "pipe", "Operation", "withHandler", "fnUntraced", "input", "Capabilities", "updateAtomValue", "DeckCapabilities", "EphemeralState", "state", "toasts"]
|
|
7
7
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
Adjust
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-L7OVX7CV.mjs";
|
|
5
5
|
import {
|
|
6
6
|
incrementPlank
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WGBUTT5K.mjs";
|
|
8
8
|
import {
|
|
9
9
|
computeActiveUpdates
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KY7ZCANM.mjs";
|
|
11
11
|
import {
|
|
12
12
|
updateActiveDeck
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SHSR2CYO.mjs";
|
|
14
14
|
import {
|
|
15
15
|
DeckCapabilities,
|
|
16
16
|
PLANK_COMPANION_TYPE
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-FO7YDJZ3.mjs";
|
|
18
18
|
import "./chunk-HSLMI22Q.mjs";
|
|
19
19
|
|
|
20
20
|
// src/operations/adjust.ts
|
|
@@ -23,7 +23,7 @@ import * as Function from "effect/Function";
|
|
|
23
23
|
import * as Option from "effect/Option";
|
|
24
24
|
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
25
25
|
import { AppCapabilities, LayoutOperation } from "@dxos/app-toolkit";
|
|
26
|
-
import { Operation } from "@dxos/
|
|
26
|
+
import { Operation } from "@dxos/compute";
|
|
27
27
|
import { AttentionCapabilities } from "@dxos/plugin-attention/types";
|
|
28
28
|
import { Graph } from "@dxos/plugin-graph";
|
|
29
29
|
import { byPosition } from "@dxos/util";
|
|
@@ -93,4 +93,4 @@ var adjust_default = handler;
|
|
|
93
93
|
export {
|
|
94
94
|
adjust_default as default
|
|
95
95
|
};
|
|
96
|
-
//# sourceMappingURL=adjust-
|
|
96
|
+
//# sourceMappingURL=adjust-P5QK33P4.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/operations/adjust.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\nimport * as Option from 'effect/Option';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\nimport * as Option from 'effect/Option';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { AttentionCapabilities } from '@dxos/plugin-attention/types';\nimport { Graph } from '@dxos/plugin-graph';\nimport { byPosition } from '@dxos/util';\n\nimport { incrementPlank } from '../layout';\nimport { DeckCapabilities, PLANK_COMPANION_TYPE } from '../types';\nimport { computeActiveUpdates } from '../util';\nimport { Adjust } from './definitions';\nimport { updateActiveDeck } from './helpers';\n\nconst handler: Operation.WithHandler<typeof Adjust> = Adjust.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const _state = yield* Capabilities.getAtomValue(DeckCapabilities.State);\n const deck = yield* DeckCapabilities.getDeck();\n const attention = yield* Capability.get(AttentionCapabilities.Attention);\n const { graph } = yield* Capability.get(AppCapabilities.AppGraph);\n\n let soloOperation:\n | { type: 'solo'; entryId: string; mode: string }\n | { type: 'unsolo'; entryId: string }\n | undefined;\n\n if (input.type === 'increment-end' || input.type === 'increment-start') {\n const next = incrementPlank(deck.active, input);\n const { deckUpdates } = computeActiveUpdates({ next, deck, attention });\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, deckUpdates));\n }\n\n if (input.type.startsWith('solo')) {\n const entryId = input.id;\n if (!deck.solo) {\n soloOperation = { type: 'solo', entryId, mode: input.type };\n } else {\n if (input.type === 'solo--fullscreen') {\n soloOperation = { type: 'solo', entryId, mode: 'solo--fullscreen' };\n } else if (input.type === 'solo') {\n soloOperation = { type: 'unsolo', entryId };\n }\n }\n }\n\n if (soloOperation?.type === 'solo') {\n yield* Operation.invoke(LayoutOperation.SetLayoutMode, {\n subject: soloOperation.entryId,\n mode: soloOperation.mode,\n });\n } else if (soloOperation?.type === 'unsolo') {\n yield* Operation.invoke(LayoutOperation.SetLayoutMode, { mode: 'multi' });\n yield* Operation.invoke(LayoutOperation.Open, { subject: [soloOperation.entryId] });\n }\n\n if (input.type === 'companion') {\n const companion = Function.pipe(\n Graph.getNode(graph, input.id),\n Option.map((node) =>\n Graph.getConnections(graph, node.id, 'child')\n .filter((n) => n.type === PLANK_COMPANION_TYPE)\n .toSorted((a, b) => byPosition(a.properties, b.properties)),\n ),\n Option.flatMap((companions) => (companions.length > 0 ? Option.some(companions[0]) : Option.none())),\n );\n\n if (Option.isSome(companion)) {\n yield* Operation.invoke(LayoutOperation.UpdateCompanion, { subject: companion.value.id });\n }\n }\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AACxB,YAAYC,cAAc;AAC1B,YAAYC,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiBC,uBAAuB;AACjD,SAASC,iBAAiB;AAC1B,SAASC,6BAA6B;AACtC,SAASC,aAAa;AACtB,SAASC,kBAAkB;AAQ3B,IAAMC,UAAgDC,OAAOC,KAC3DC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,QAAMC,SAAS,OAAOC,aAAaC,aAAaC,iBAAiBC,KAAK;AACtE,QAAMC,OAAO,OAAOF,iBAAiBG,QAAO;AAC5C,QAAMC,YAAY,OAAOC,WAAWC,IAAIC,sBAAsBC,SAAS;AACvE,QAAM,EAAEC,MAAK,IAAK,OAAOJ,WAAWC,IAAII,gBAAgBC,QAAQ;AAEhE,MAAIC;AAKJ,MAAIhB,MAAMiB,SAAS,mBAAmBjB,MAAMiB,SAAS,mBAAmB;AACtE,UAAMC,OAAOC,eAAeb,KAAKc,QAAQpB,KAAAA;AACzC,UAAM,EAAEqB,YAAW,IAAKC,qBAAqB;MAAEJ;MAAMZ;MAAME;IAAU,CAAA;AACrE,WAAON,aAAaqB,gBAAgBnB,iBAAiBC,OAAO,CAACmB,UAAUC,iBAAiBD,OAAOH,WAAAA,CAAAA;EACjG;AAEA,MAAIrB,MAAMiB,KAAKS,WAAW,MAAA,GAAS;AACjC,UAAMC,UAAU3B,MAAM4B;AACtB,QAAI,CAACtB,KAAKuB,MAAM;AACdb,sBAAgB;QAAEC,MAAM;QAAQU;QAASG,MAAM9B,MAAMiB;MAAK;IAC5D,OAAO;AACL,UAAIjB,MAAMiB,SAAS,oBAAoB;AACrCD,wBAAgB;UAAEC,MAAM;UAAQU;UAASG,MAAM;QAAmB;MACpE,WAAW9B,MAAMiB,SAAS,QAAQ;AAChCD,wBAAgB;UAAEC,MAAM;UAAUU;QAAQ;MAC5C;IACF;EACF;AAEA,MAAIX,eAAeC,SAAS,QAAQ;AAClC,WAAOpB,UAAUkC,OAAOC,gBAAgBC,eAAe;MACrDC,SAASlB,cAAcW;MACvBG,MAAMd,cAAcc;IACtB,CAAA;EACF,WAAWd,eAAeC,SAAS,UAAU;AAC3C,WAAOpB,UAAUkC,OAAOC,gBAAgBC,eAAe;MAAEH,MAAM;IAAQ,CAAA;AACvE,WAAOjC,UAAUkC,OAAOC,gBAAgBG,MAAM;MAAED,SAAS;QAAClB,cAAcW;;IAAS,CAAA;EACnF;AAEA,MAAI3B,MAAMiB,SAAS,aAAa;AAC9B,UAAMmB,YAAqBxC,cACzByC,MAAMC,QAAQzB,OAAOb,MAAM4B,EAAE,GACtBW,WAAI,CAACC,SACVH,MAAMI,eAAe5B,OAAO2B,KAAKZ,IAAI,OAAA,EAClCc,OAAO,CAACC,MAAMA,EAAE1B,SAAS2B,oBAAAA,EACzBC,SAAS,CAACC,GAAGC,MAAMC,WAAWF,EAAEG,YAAYF,EAAEE,UAAU,CAAA,CAAA,GAEtDC,eAAQ,CAACC,eAAgBA,WAAWC,SAAS,IAAWC,YAAKF,WAAW,CAAA,CAAE,IAAWG,YAAI,CAAA,CAAA;AAGlG,QAAWC,cAAOnB,SAAAA,GAAY;AAC5B,aAAOvC,UAAUkC,OAAOC,gBAAgBwB,iBAAiB;QAAEtB,SAASE,UAAUqB,MAAM7B;MAAG,CAAA;IACzF;EACF;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,iBAAelC;",
|
|
6
6
|
"names": ["Effect", "Function", "Option", "Capabilities", "Capability", "AppCapabilities", "LayoutOperation", "Operation", "AttentionCapabilities", "Graph", "byPosition", "handler", "Adjust", "pipe", "Operation", "withHandler", "fnUntraced", "input", "_state", "Capabilities", "getAtomValue", "DeckCapabilities", "State", "deck", "getDeck", "attention", "Capability", "get", "AttentionCapabilities", "Attention", "graph", "AppCapabilities", "AppGraph", "soloOperation", "type", "next", "incrementPlank", "active", "deckUpdates", "computeActiveUpdates", "updateAtomValue", "state", "updateActiveDeck", "startsWith", "entryId", "id", "solo", "mode", "invoke", "LayoutOperation", "SetLayoutMode", "subject", "Open", "companion", "Graph", "getNode", "map", "node", "getConnections", "filter", "n", "PLANK_COMPANION_TYPE", "toSorted", "a", "b", "byPosition", "properties", "flatMap", "companions", "length", "some", "none", "isSome", "UpdateCompanion", "value"]
|
|
7
7
|
}
|
|
@@ -16,15 +16,7 @@ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-deck/src/types/capabi
|
|
|
16
16
|
DeckCapabilities2.getDeck = () => Effect.gen(function* () {
|
|
17
17
|
const state = yield* Capabilities.getAtomValue(DeckCapabilities2.State);
|
|
18
18
|
const deck = state.decks[state.activeDeck];
|
|
19
|
-
invariant(deck, `Deck not found: ${state.activeDeck}`, {
|
|
20
|
-
F: __dxlog_file,
|
|
21
|
-
L: 32,
|
|
22
|
-
S: this,
|
|
23
|
-
A: [
|
|
24
|
-
"deck",
|
|
25
|
-
"`Deck not found: ${state.activeDeck}`"
|
|
26
|
-
]
|
|
27
|
-
});
|
|
19
|
+
invariant(deck, `Deck not found: ${state.activeDeck}`, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 15, S: this, A: ["deck", "`Deck not found: ${state.activeDeck}`"] });
|
|
28
20
|
return deck;
|
|
29
21
|
});
|
|
30
22
|
})(DeckCapabilities || (DeckCapabilities = {}));
|
|
@@ -51,12 +43,27 @@ __export(Settings_exports, {
|
|
|
51
43
|
});
|
|
52
44
|
import * as Schema from "effect/Schema";
|
|
53
45
|
var Settings = Schema.Struct({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
46
|
+
enableDeck: Schema.optional(Schema.Boolean.annotations({
|
|
47
|
+
title: "Enable Deck",
|
|
48
|
+
description: "Display multiple panels side by side instead of one at a time."
|
|
49
|
+
})),
|
|
58
50
|
// TODO(burdon): Rename layoutMode? (e.g., bento | encapsulated?)
|
|
59
|
-
encapsulatedPlanks: Schema.optional(Schema.Boolean
|
|
51
|
+
encapsulatedPlanks: Schema.optional(Schema.Boolean.annotations({
|
|
52
|
+
title: "Encapsulated planks",
|
|
53
|
+
description: "Render each plank inside its own isolated container."
|
|
54
|
+
})),
|
|
55
|
+
enableStatusbar: Schema.optional(Schema.Boolean.annotations({
|
|
56
|
+
title: "Show status bar",
|
|
57
|
+
description: "Display a status bar at the bottom of the application."
|
|
58
|
+
})),
|
|
59
|
+
showHints: Schema.optional(Schema.Boolean.annotations({
|
|
60
|
+
title: "Show hints",
|
|
61
|
+
description: "Show helpful tips and keyboard shortcut hints in the interface."
|
|
62
|
+
})),
|
|
63
|
+
enableNativeRedirect: Schema.optional(Schema.Boolean.annotations({
|
|
64
|
+
title: "Enable native url redirect",
|
|
65
|
+
description: "Redirect supported URLs to the native desktop application."
|
|
66
|
+
}))
|
|
60
67
|
}).pipe(Schema.mutable);
|
|
61
68
|
|
|
62
69
|
// src/types/schema.ts
|
|
@@ -206,4 +213,4 @@ export {
|
|
|
206
213
|
PLANK_COMPANION_TYPE,
|
|
207
214
|
DECK_COMPANION_TYPE
|
|
208
215
|
};
|
|
209
|
-
//# sourceMappingURL=chunk-
|
|
216
|
+
//# sourceMappingURL=chunk-FO7YDJZ3.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/types/capabilities.ts", "../../../src/types/events.ts", "../../../src/types/schema.ts", "../../../src/types/Settings.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\n\nimport { meta } from '#meta';\n\nimport { type EphemeralDeckState, type DeckState, type StoredDeckState } from './schema';\nimport * as Settings from './Settings';\n\nexport namespace DeckCapabilities {\n export const Settings = Capability.make<Atom.Writable<Settings.Settings>>(`${meta.id}.capability.settings`);\n\n /** Persisted state (stored in KVS/localStorage). */\n export const State = Capability.make<Atom.Writable<StoredDeckState>>(`${meta.id}.capability.state`);\n\n /** Transient/ephemeral state (not persisted). */\n export const EphemeralState = Capability.make<Atom.Writable<EphemeralDeckState>>(\n `${meta.id}.capability.ephemeral-state`,\n );\n\n /** Get the current active deck from state. */\n export const getDeck = (): Effect.Effect<DeckState, Error, Capability.Service> =>\n Effect.gen(function* () {\n const state = yield* Capabilities.getAtomValue(State);\n const deck = state.decks[state.activeDeck];\n invariant(deck, `Deck not found: ${state.activeDeck}`);\n return deck;\n });\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ActivationEvent } from '@dxos/app-framework';\nimport { AppActivationEvents } from '@dxos/app-toolkit';\n\nimport { meta } from '#meta';\n\nimport { DeckCapabilities } from './capabilities';\n\nexport namespace DeckEvents {\n export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(\n `${meta.id}.state-ready`,\n );\n\n /** Fired when DeckSettings capability is ready. */\n export const SettingsReady: ActivationEvent.ActivationEvent = AppActivationEvents.createSettingsEvent(\n DeckCapabilities.Settings.identifier,\n );\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Label, LayoutOperation } from '@dxos/app-toolkit';\nimport { type DeepReadonly } from '@dxos/util';\n\nimport { meta } from '#meta';\n\nexport * as Settings from './Settings';\n\nexport { PLANK_COMPANION_TYPE, DECK_COMPANION_TYPE } from '@dxos/app-toolkit';\n\nexport type Part = 'solo' | 'multi' | 'complementary';\nexport type ResolvedPart = Part | 'solo-primary' | 'solo-companion';\n\nexport const PlankSizing = Schema.Record({ key: Schema.String, value: Schema.Number });\nexport type PlankSizing = Schema.Schema.Type<typeof PlankSizing>;\n\nexport const DeckState = Schema.Struct({\n /** If false, the deck has not yet left solo mode and new planks should be soloed. */\n initialized: Schema.Boolean,\n /** Item IDs of planks currently displayed in multi-mode. */\n active: Schema.mutable(Schema.Array(Schema.String)),\n /** Item IDs of planks that have been closed; used for state persistence and reopening. */\n inactive: Schema.mutable(Schema.Array(Schema.String)),\n /** Item ID of the single plank displayed in solo or fullscreen mode. */\n solo: Schema.optional(Schema.String),\n /** Whether the solo plank is displayed in fullscreen mode (no heading or sidebars). */\n fullscreen: Schema.Boolean,\n /** Persisted plank widths in rem, keyed by item ID. */\n plankSizing: Schema.mutable(PlankSizing),\n /** Whether the companion pane is visible alongside the active plank(s). */\n companionOpen: Schema.Boolean,\n /** Which companion variant to display when the companion pane is open. */\n companionVariant: Schema.optional(Schema.String),\n /** Persisted companion frame widths in rem, keyed by frame ID. */\n companionFrameSizing: Schema.mutable(PlankSizing),\n});\nexport type DeckState = Schema.Schema.Type<typeof DeckState>;\n\nexport const defaultDeck: DeckState = {\n initialized: false,\n active: [],\n inactive: [],\n solo: undefined,\n fullscreen: false,\n plankSizing: {},\n companionOpen: false,\n companionVariant: undefined,\n companionFrameSizing: {},\n};\n\n//\n// Layout\n//\n\nconst LayoutMode = Schema.Literal('multi', 'solo', 'solo--fullscreen');\nexport type LayoutMode = Schema.Schema.Type<typeof LayoutMode>;\nexport const isLayoutMode = (value: any): value is LayoutMode => Schema.is(LayoutMode)(value);\nexport const getMode = (deck: DeckState | DeepReadonly<DeckState>): LayoutMode => {\n if (deck.solo) {\n return deck.fullscreen ? 'solo--fullscreen' : 'solo';\n }\n\n return 'multi';\n};\n\n// Persisted plugin state (stored in KVS/localStorage).\nexport const StoredDeckState = Schema.Struct({\n sidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),\n complementarySidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),\n complementarySidebarPanel: Schema.optional(Schema.String),\n activeDeck: Schema.String,\n previousDeck: Schema.String,\n decks: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(DeckState) })),\n previousMode: Schema.mutable(Schema.Record({ key: Schema.String, value: LayoutMode })),\n}).pipe(Schema.mutable);\nexport type StoredDeckState = Schema.Schema.Type<typeof StoredDeckState>;\n\n// Transient/ephemeral plugin state (not persisted).\nexport const EphemeralDeckState = Schema.Struct({\n dialogOpen: Schema.Boolean,\n dialogType: Schema.optional(Schema.Literal('default', 'alert')),\n dialogBlockAlign: Schema.optional(Schema.Literal('start', 'center', 'end')),\n dialogOverlayClasses: Schema.optional(Schema.String),\n dialogOverlayStyle: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n /** Data to be passed to the dialog Surface. */\n dialogContent: Schema.NullOr(Schema.Struct({ component: Schema.String, props: Schema.optional(Schema.Any) })),\n popoverOpen: Schema.Boolean,\n popoverSide: Schema.optional(Schema.Literal('top', 'right', 'bottom', 'left')),\n popoverAnchor: Schema.optional(Schema.Any),\n popoverAnchorId: Schema.optional(Schema.String),\n popoverKind: Schema.optional(Schema.Literal('base', 'card')),\n popoverTitle: Schema.optional(Label.annotations({ description: 'The title of the popover.' })),\n /** Ref of the subject to be passed to the popover Surface. */\n popoverContentRef: Schema.optional(Schema.String),\n /** Data to be passed to the popover Surface. */\n popoverContent: Schema.NullOr(\n Schema.Union(\n Schema.Struct({ component: Schema.String, props: Schema.optional(Schema.Any) }),\n Schema.Struct({ subject: Schema.Any }),\n ),\n ),\n toasts: Schema.mutable(Schema.Array(LayoutOperation.Toast)),\n currentUndoId: Schema.optional(Schema.String),\n /** The identifier of a component to scroll into view when it is mounted. */\n scrollIntoView: Schema.optional(Schema.String),\n}).pipe(Schema.mutable);\nexport type EphemeralDeckState = Schema.Schema.Type<typeof EphemeralDeckState>;\n\n// Combined state type (for convenience in components that need both).\nexport type DeckPluginState = StoredDeckState & EphemeralDeckState;\n\nexport namespace DeckAction {\n const PartAdjustmentSchema = Schema.Union(\n Schema.Literal('close').annotations({ description: 'Close the plank.' }),\n Schema.Literal('companion').annotations({ description: 'Open the companion plank.' }),\n Schema.Literal('solo').annotations({ description: 'Solo the plank.' }),\n Schema.Literal('solo--fullscreen').annotations({ description: 'Fullscreen the plank.' }),\n Schema.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),\n Schema.Literal('increment-end').annotations({ description: 'Move the plank towards the end of the deck.' }),\n );\n export type PartAdjustment = Schema.Schema.Type<typeof PartAdjustmentSchema>;\n export const Adjustment = Schema.mutable(Schema.Struct({ id: Schema.String, type: PartAdjustmentSchema }));\n export type Adjustment = Schema.Schema.Type<typeof Adjustment>;\n\n // An atomic transaction to apply to the deck, describing which element to move to which location.\n export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}.action.adjust`, {\n input: Adjustment,\n output: Schema.Void,\n }) {}\n\n export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}.action.update-plank-size`, {\n input: Schema.Struct({\n id: Schema.String,\n size: Schema.Number,\n }),\n output: Schema.Void,\n }) {}\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nexport const Settings = Schema.Struct({\n
|
|
5
|
-
"mappings": ";;;;;;AAKA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiB;AAE1B,SAASC,YAAY
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "invariant", "meta", "DeckCapabilities", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\n\nimport { meta } from '#meta';\n\nimport { type EphemeralDeckState, type DeckState, type StoredDeckState } from './schema';\nimport * as Settings from './Settings';\n\nexport namespace DeckCapabilities {\n export const Settings = Capability.make<Atom.Writable<Settings.Settings>>(`${meta.id}.capability.settings`);\n\n /** Persisted state (stored in KVS/localStorage). */\n export const State = Capability.make<Atom.Writable<StoredDeckState>>(`${meta.id}.capability.state`);\n\n /** Transient/ephemeral state (not persisted). */\n export const EphemeralState = Capability.make<Atom.Writable<EphemeralDeckState>>(\n `${meta.id}.capability.ephemeral-state`,\n );\n\n /** Get the current active deck from state. */\n export const getDeck = (): Effect.Effect<DeckState, Error, Capability.Service> =>\n Effect.gen(function* () {\n const state = yield* Capabilities.getAtomValue(State);\n const deck = state.decks[state.activeDeck];\n invariant(deck, `Deck not found: ${state.activeDeck}`);\n return deck;\n });\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ActivationEvent } from '@dxos/app-framework';\nimport { AppActivationEvents } from '@dxos/app-toolkit';\n\nimport { meta } from '#meta';\n\nimport { DeckCapabilities } from './capabilities';\n\nexport namespace DeckEvents {\n export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(\n `${meta.id}.state-ready`,\n );\n\n /** Fired when DeckSettings capability is ready. */\n export const SettingsReady: ActivationEvent.ActivationEvent = AppActivationEvents.createSettingsEvent(\n DeckCapabilities.Settings.identifier,\n );\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Label, LayoutOperation } from '@dxos/app-toolkit';\nimport { type DeepReadonly } from '@dxos/util';\n\nimport { meta } from '#meta';\n\nexport * as Settings from './Settings';\n\nexport { PLANK_COMPANION_TYPE, DECK_COMPANION_TYPE } from '@dxos/app-toolkit';\n\nexport type Part = 'solo' | 'multi' | 'complementary';\nexport type ResolvedPart = Part | 'solo-primary' | 'solo-companion';\n\nexport const PlankSizing = Schema.Record({ key: Schema.String, value: Schema.Number });\nexport type PlankSizing = Schema.Schema.Type<typeof PlankSizing>;\n\nexport const DeckState = Schema.Struct({\n /** If false, the deck has not yet left solo mode and new planks should be soloed. */\n initialized: Schema.Boolean,\n /** Item IDs of planks currently displayed in multi-mode. */\n active: Schema.mutable(Schema.Array(Schema.String)),\n /** Item IDs of planks that have been closed; used for state persistence and reopening. */\n inactive: Schema.mutable(Schema.Array(Schema.String)),\n /** Item ID of the single plank displayed in solo or fullscreen mode. */\n solo: Schema.optional(Schema.String),\n /** Whether the solo plank is displayed in fullscreen mode (no heading or sidebars). */\n fullscreen: Schema.Boolean,\n /** Persisted plank widths in rem, keyed by item ID. */\n plankSizing: Schema.mutable(PlankSizing),\n /** Whether the companion pane is visible alongside the active plank(s). */\n companionOpen: Schema.Boolean,\n /** Which companion variant to display when the companion pane is open. */\n companionVariant: Schema.optional(Schema.String),\n /** Persisted companion frame widths in rem, keyed by frame ID. */\n companionFrameSizing: Schema.mutable(PlankSizing),\n});\nexport type DeckState = Schema.Schema.Type<typeof DeckState>;\n\nexport const defaultDeck: DeckState = {\n initialized: false,\n active: [],\n inactive: [],\n solo: undefined,\n fullscreen: false,\n plankSizing: {},\n companionOpen: false,\n companionVariant: undefined,\n companionFrameSizing: {},\n};\n\n//\n// Layout\n//\n\nconst LayoutMode = Schema.Literal('multi', 'solo', 'solo--fullscreen');\nexport type LayoutMode = Schema.Schema.Type<typeof LayoutMode>;\nexport const isLayoutMode = (value: any): value is LayoutMode => Schema.is(LayoutMode)(value);\nexport const getMode = (deck: DeckState | DeepReadonly<DeckState>): LayoutMode => {\n if (deck.solo) {\n return deck.fullscreen ? 'solo--fullscreen' : 'solo';\n }\n\n return 'multi';\n};\n\n// Persisted plugin state (stored in KVS/localStorage).\nexport const StoredDeckState = Schema.Struct({\n sidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),\n complementarySidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),\n complementarySidebarPanel: Schema.optional(Schema.String),\n activeDeck: Schema.String,\n previousDeck: Schema.String,\n decks: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(DeckState) })),\n previousMode: Schema.mutable(Schema.Record({ key: Schema.String, value: LayoutMode })),\n}).pipe(Schema.mutable);\nexport type StoredDeckState = Schema.Schema.Type<typeof StoredDeckState>;\n\n// Transient/ephemeral plugin state (not persisted).\nexport const EphemeralDeckState = Schema.Struct({\n dialogOpen: Schema.Boolean,\n dialogType: Schema.optional(Schema.Literal('default', 'alert')),\n dialogBlockAlign: Schema.optional(Schema.Literal('start', 'center', 'end')),\n dialogOverlayClasses: Schema.optional(Schema.String),\n dialogOverlayStyle: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n /** Data to be passed to the dialog Surface. */\n dialogContent: Schema.NullOr(Schema.Struct({ component: Schema.String, props: Schema.optional(Schema.Any) })),\n popoverOpen: Schema.Boolean,\n popoverSide: Schema.optional(Schema.Literal('top', 'right', 'bottom', 'left')),\n popoverAnchor: Schema.optional(Schema.Any),\n popoverAnchorId: Schema.optional(Schema.String),\n popoverKind: Schema.optional(Schema.Literal('base', 'card')),\n popoverTitle: Schema.optional(Label.annotations({ description: 'The title of the popover.' })),\n /** Ref of the subject to be passed to the popover Surface. */\n popoverContentRef: Schema.optional(Schema.String),\n /** Data to be passed to the popover Surface. */\n popoverContent: Schema.NullOr(\n Schema.Union(\n Schema.Struct({ component: Schema.String, props: Schema.optional(Schema.Any) }),\n Schema.Struct({ subject: Schema.Any }),\n ),\n ),\n toasts: Schema.mutable(Schema.Array(LayoutOperation.Toast)),\n currentUndoId: Schema.optional(Schema.String),\n /** The identifier of a component to scroll into view when it is mounted. */\n scrollIntoView: Schema.optional(Schema.String),\n}).pipe(Schema.mutable);\nexport type EphemeralDeckState = Schema.Schema.Type<typeof EphemeralDeckState>;\n\n// Combined state type (for convenience in components that need both).\nexport type DeckPluginState = StoredDeckState & EphemeralDeckState;\n\nexport namespace DeckAction {\n const PartAdjustmentSchema = Schema.Union(\n Schema.Literal('close').annotations({ description: 'Close the plank.' }),\n Schema.Literal('companion').annotations({ description: 'Open the companion plank.' }),\n Schema.Literal('solo').annotations({ description: 'Solo the plank.' }),\n Schema.Literal('solo--fullscreen').annotations({ description: 'Fullscreen the plank.' }),\n Schema.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),\n Schema.Literal('increment-end').annotations({ description: 'Move the plank towards the end of the deck.' }),\n );\n export type PartAdjustment = Schema.Schema.Type<typeof PartAdjustmentSchema>;\n export const Adjustment = Schema.mutable(Schema.Struct({ id: Schema.String, type: PartAdjustmentSchema }));\n export type Adjustment = Schema.Schema.Type<typeof Adjustment>;\n\n // An atomic transaction to apply to the deck, describing which element to move to which location.\n export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}.action.adjust`, {\n input: Adjustment,\n output: Schema.Void,\n }) {}\n\n export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}.action.update-plank-size`, {\n input: Schema.Struct({\n id: Schema.String,\n size: Schema.Number,\n }),\n output: Schema.Void,\n }) {}\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nexport const Settings = Schema.Struct({\n enableDeck: Schema.optional(\n Schema.Boolean.annotations({\n title: 'Enable Deck',\n description: 'Display multiple panels side by side instead of one at a time.',\n }),\n ),\n // TODO(burdon): Rename layoutMode? (e.g., bento | encapsulated?)\n encapsulatedPlanks: Schema.optional(\n Schema.Boolean.annotations({\n title: 'Encapsulated planks',\n description: 'Render each plank inside its own isolated container.',\n }),\n ),\n enableStatusbar: Schema.optional(\n Schema.Boolean.annotations({\n title: 'Show status bar',\n description: 'Display a status bar at the bottom of the application.',\n }),\n ),\n showHints: Schema.optional(\n Schema.Boolean.annotations({\n title: 'Show hints',\n description: 'Show helpful tips and keyboard shortcut hints in the interface.',\n }),\n ),\n enableNativeRedirect: Schema.optional(\n Schema.Boolean.annotations({\n title: 'Enable native url redirect',\n description: 'Redirect supported URLs to the native desktop application.',\n }),\n ),\n}).pipe(Schema.mutable);\nexport interface Settings extends Schema.Schema.Type<typeof Settings> {}\n"],
|
|
5
|
+
"mappings": ";;;;;;AAKA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiB;AAE1B,SAASC,YAAY;mBAKJC;6BAIFC;oBAGAC,WAAAA,WAAiBL,KAAAA,GAAWM,KACvC,EAAGJ,sBAAQ;oBAIAK,QAAAA,WACXT,KAAU,GAAC,KAAA,EAAA,mBAAA;oBACHU,iBAAeT,WAAaU,KAAAA,GAAAA,KAAY,EAAA,6BAACL;oBACzCM,UAAaC,MAAMH,WAAMI,aAAW;AAC1CX,UAAAA,QAAUS,OAAO,aAAgB,aAAQE,kBAAY,KAAA;AACrD,UAAA,OAAOF,MAAAA,MAAAA,MAAAA,UAAAA;AACT,cAAA,MAAA,mBAAA,MAAA,UAAA,IAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,QAAA,uCAAA,EAAA,CAAA;AAlBaP,WAAAA;;;;;;ACVjB,SAASU,2BAA2B;AAEpC,SAASC,QAAAA,aAAY;UAIJC,aAAAA;cACFC,aAA8CC,oBAAoBC,iBAC7E,GAAGC,MAAKC,EAAE,cAAc;cAIbC,gBAAiDJ,oBAAoBK,oBAChFC,iBAAiBC,SAASC,UAAU;AAExC,GATiBV,eAAAA,aAAAA,CAAAA,EAAAA;;;;ACPjB,YAAYW,aAAY;AAExB,SAASC,OAAOC,uBAAuB;AAGvC,SAASC,QAAAA,aAAY;;;ACTrB;;;;AAMA,YAAYC,YAAY;AAEjB,IAAMC,WAAkBC,cAAO;EACpCC,YAAmBC,gBACVC,eAAQC,YAAY;IACzBC,OAAO;IACPC,aAAa;EACf,CAAA,CAAA;;EAGFC,oBAA2BL,gBAClBC,eAAQC,YAAY;IACzBC,OAAO;IACPC,aAAa;EACf,CAAA,CAAA;EAEFE,iBAAwBN,gBACfC,eAAQC,YAAY;IACzBC,OAAO;IACPC,aAAa;EACf,CAAA,CAAA;EAEFG,WAAkBP,gBACTC,eAAQC,YAAY;IACzBC,OAAO;IACPC,aAAa;EACf,CAAA,CAAA;EAEFI,sBAA6BR,gBACpBC,eAAQC,YAAY;IACzBC,OAAO;IACPC,aAAa;EACf,CAAA,CAAA;AAEJ,CAAA,EAAGK,KAAYC,cAAO;;;AD3BtB,SAASC,sBAAsBC,2BAA2B;AAKnD,IAAMC,cAAqBC,eAAO;EAAEC,KAAYC;EAAQC,OAAcC;AAAO,CAAA;AAG7E,IAAMC,YAAmBC,eAAO;;EAErCC,aAAoBC;;EAEpBC,QAAeC,gBAAeC,cAAaT,cAAM,CAAA;;EAEjDU,UAAiBF,gBAAeC,cAAaT,cAAM,CAAA;;EAEnDW,MAAaC,iBAAgBZ,cAAM;;EAEnCa,YAAmBP;;EAEnBQ,aAAoBN,gBAAQX,WAAAA;;EAE5BkB,eAAsBT;;EAEtBU,kBAAyBJ,iBAAgBZ,cAAM;;EAE/CiB,sBAA6BT,gBAAQX,WAAAA;AACvC,CAAA;AAGO,IAAMqB,cAAyB;EACpCb,aAAa;EACbE,QAAQ,CAAA;EACRG,UAAU,CAAA;EACVC,MAAMQ;EACNN,YAAY;EACZC,aAAa,CAAC;EACdC,eAAe;EACfC,kBAAkBG;EAClBF,sBAAsB,CAAC;AACzB;AAMA,IAAMG,aAAoBC,gBAAQ,SAAS,QAAQ,kBAAA;AAE5C,IAAMC,eAAe,CAACrB,UAA2CsB,WAAGH,UAAAA,EAAYnB,KAAAA;AAChF,IAAMuB,UAAU,CAACC,SAAAA;AACtB,MAAIA,KAAKd,MAAM;AACb,WAAOc,KAAKZ,aAAa,qBAAqB;EAChD;AAEA,SAAO;AACT;AAGO,IAAMa,kBAAyBtB,eAAO;EAC3CuB,cAAqBN,gBAAQ,UAAU,aAAa,UAAA;EACpDO,2BAAkCP,gBAAQ,UAAU,aAAa,UAAA;EACjEQ,2BAAkCjB,iBAAgBZ,cAAM;EACxD8B,YAAmB9B;EACnB+B,cAAqB/B;EACrBgC,OAAcxB,gBAAeV,eAAO;IAAEC,KAAYC;IAAQC,OAAcO,gBAAQL,SAAAA;EAAW,CAAA,CAAA;EAC3F8B,cAAqBzB,gBAAeV,eAAO;IAAEC,KAAYC;IAAQC,OAAOmB;EAAW,CAAA,CAAA;AACrF,CAAA,EAAGc,KAAY1B,eAAO;AAIf,IAAM2B,qBAA4B/B,eAAO;EAC9CgC,YAAmB9B;EACnB+B,YAAmBzB,iBAAgBS,gBAAQ,WAAW,OAAA,CAAA;EACtDiB,kBAAyB1B,iBAAgBS,gBAAQ,SAAS,UAAU,KAAA,CAAA;EACpEkB,sBAA6B3B,iBAAgBZ,cAAM;EACnDwC,oBAA2B5B,iBAAgBd,eAAO;IAAEC,KAAYC;IAAQC,OAAcwC;EAAI,CAAA,CAAA;;EAE1FC,eAAsBC,eAAcvC,eAAO;IAAEwC,WAAkB5C;IAAQ6C,OAAcjC,iBAAgB6B,WAAG;EAAE,CAAA,CAAA;EAC1GK,aAAoBxC;EACpByC,aAAoBnC,iBAAgBS,gBAAQ,OAAO,SAAS,UAAU,MAAA,CAAA;EACtE2B,eAAsBpC,iBAAgB6B,WAAG;EACzCQ,iBAAwBrC,iBAAgBZ,cAAM;EAC9CkD,aAAoBtC,iBAAgBS,gBAAQ,QAAQ,MAAA,CAAA;EACpD8B,cAAqBvC,iBAASwC,MAAMC,YAAY;IAAEC,aAAa;EAA4B,CAAA,CAAA;;EAE3FC,mBAA0B3C,iBAAgBZ,cAAM;;EAEhDwD,gBAAuBb,eACdc,cACErD,eAAO;IAAEwC,WAAkB5C;IAAQ6C,OAAcjC,iBAAgB6B,WAAG;EAAE,CAAA,GACtErC,eAAO;IAAEsD,SAAgBjB;EAAI,CAAA,CAAA,CAAA;EAGxCkB,QAAenD,gBAAeC,cAAMmD,gBAAgBC,KAAK,CAAA;EACzDC,eAAsBlD,iBAAgBZ,cAAM;;EAE5C+D,gBAAuBnD,iBAAgBZ,cAAM;AAC/C,CAAA,EAAGkC,KAAY1B,eAAO;UAMLwD,aAAAA;AACf,QAAMC,uBAA8BR,cAC3BpC,gBAAQ,OAAA,EAASgC,YAAY;IAAEC,aAAa;EAAmB,CAAA,GAC/DjC,gBAAQ,WAAA,EAAagC,YAAY;IAAEC,aAAa;EAA4B,CAAA,GAC5EjC,gBAAQ,MAAA,EAAQgC,YAAY;IAAEC,aAAa;EAAkB,CAAA,GAC7DjC,gBAAQ,kBAAA,EAAoBgC,YAAY;IAAEC,aAAa;EAAwB,CAAA,GAC/EjC,gBAAQ,iBAAA,EAAmBgC,YAAY;IAAEC,aAAa;EAAgD,CAAA,GACtGjC,gBAAQ,eAAA,EAAiBgC,YAAY;IAAEC,aAAa;EAA8C,CAAA,CAAA;cAG9FY,aAAoB1D,gBAAeJ,eAAO;IAAE+D,IAAWnE;IAAQoE,MAAMH;EAAqB,CAAA,CAAA;EAIhG,MAAMI,eAAsBC,oBAAW,EAAW,GAAGC,MAAKJ,EAAE,kBAAkB;IACnFK,OAAKR,YAAEE;IACPO,QAAeC;EACjB,CAAA,EAAA;EAAI;cAHSL,SAAAA;EAKN,MAAMM,wBAA+BL,oBAAW,EAAoB,GAAGC,MAAKJ,EAAE,6BAA6B;IAChHK,OAAcpE,eAAO;MACnB+D,IAAWnE;MACX4E,MAAa1E;IACf,CAAA;IACAuE,QAAeC;EACjB,CAAA,EAAA;EAAI;cANSC,kBAAAA;AAOf,GA1BiBX,eAAAA,aAAAA,CAAAA,EAAAA;;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "invariant", "meta", "DeckCapabilities", "State", "EphemeralState", "make", "getDeck", "state", "getAtomValue", "deck", "decks", "activeDeck", "AppActivationEvents", "meta", "DeckEvents", "StateReady", "AppActivationEvents", "createStateEvent", "meta", "id", "SettingsReady", "createSettingsEvent", "DeckCapabilities", "Settings", "identifier", "Schema", "Label", "LayoutOperation", "meta", "Schema", "Settings", "Struct", "enableDeck", "optional", "Boolean", "annotations", "title", "description", "encapsulatedPlanks", "enableStatusbar", "showHints", "enableNativeRedirect", "pipe", "mutable", "PLANK_COMPANION_TYPE", "DECK_COMPANION_TYPE", "PlankSizing", "Record", "key", "String", "value", "Number", "DeckState", "Struct", "initialized", "Boolean", "active", "mutable", "Array", "inactive", "solo", "optional", "fullscreen", "plankSizing", "companionOpen", "companionVariant", "companionFrameSizing", "defaultDeck", "undefined", "LayoutMode", "Literal", "isLayoutMode", "is", "getMode", "deck", "StoredDeckState", "sidebarState", "complementarySidebarState", "complementarySidebarPanel", "activeDeck", "previousDeck", "decks", "previousMode", "pipe", "EphemeralDeckState", "dialogOpen", "dialogType", "dialogBlockAlign", "dialogOverlayClasses", "dialogOverlayStyle", "Any", "dialogContent", "NullOr", "component", "props", "popoverOpen", "popoverSide", "popoverAnchor", "popoverAnchorId", "popoverKind", "popoverTitle", "Label", "annotations", "description", "popoverContentRef", "popoverContent", "Union", "subject", "toasts", "LayoutOperation", "Toast", "currentUndoId", "scrollIntoView", "DeckAction", "PartAdjustmentSchema", "Adjustment", "id", "type", "Adjust", "TaggedClass", "meta", "input", "output", "Void", "UpdatePlankSize", "size"]
|
|
7
7
|
}
|
|
@@ -11,7 +11,7 @@ __export(definitions_exports, {
|
|
|
11
11
|
});
|
|
12
12
|
import * as Schema from "effect/Schema";
|
|
13
13
|
import { Capability } from "@dxos/app-framework";
|
|
14
|
-
import { Operation } from "@dxos/
|
|
14
|
+
import { Operation } from "@dxos/compute";
|
|
15
15
|
import { meta } from "#meta";
|
|
16
16
|
var PartAdjustment = Schema.Union(Schema.Literal("close").annotations({
|
|
17
17
|
description: "Close the plank."
|
|
@@ -70,4 +70,4 @@ export {
|
|
|
70
70
|
UpdatePlankSize,
|
|
71
71
|
definitions_exports
|
|
72
72
|
};
|
|
73
|
-
//# sourceMappingURL=chunk-
|
|
73
|
+
//# sourceMappingURL=chunk-L7OVX7CV.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/definitions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\n\nimport { meta } from '#meta';\n\nconst PartAdjustment = Schema.Union(\n Schema.Literal('close').annotations({ description: 'Close the plank.' }),\n Schema.Literal('companion').annotations({ description: 'Open the companion plank.' }),\n Schema.Literal('solo').annotations({ description: 'Solo the plank.' }),\n Schema.Literal('solo--fullscreen').annotations({ description: 'Fullscreen the plank.' }),\n Schema.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),\n Schema.Literal('increment-end').annotations({ description: 'Move the plank towards the end of the deck.' }),\n);\n\nexport type PartAdjustment = Schema.Schema.Type<typeof PartAdjustment>;\n\nexport const Adjust = Operation.make({\n meta: {\n key: `${meta.id}.operation.adjust`,\n name: 'Adjust',\n description: 'Adjust the layout of a plank.',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n id: Schema.String.annotations({ description: 'The id of the plank to adjust.' }),\n type: PartAdjustment.annotations({ description: 'The type of adjustment to make.' }),\n }),\n output: Schema.Void,\n});\n\nexport const UpdatePlankSize = Operation.make({\n meta: {\n key: `${meta.id}.operation.update-plank-size`,\n name: 'Update Plank Size',\n description: 'Update the size of a plank.',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n id: Schema.String.annotations({ description: 'The id of the plank to resize.' }),\n size: Schema.Number.annotations({ description: 'The new size of the plank.' }),\n }),\n output: Schema.Void,\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;AAAA;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAE1B,SAASC,YAAY;AAErB,IAAMC,iBAAwBC,aACrBC,eAAQ,OAAA,EAASC,YAAY;EAAEC,aAAa;AAAmB,CAAA,GAC/DF,eAAQ,WAAA,EAAaC,YAAY;EAAEC,aAAa;AAA4B,CAAA,GAC5EF,eAAQ,MAAA,EAAQC,YAAY;EAAEC,aAAa;AAAkB,CAAA,GAC7DF,eAAQ,kBAAA,EAAoBC,YAAY;EAAEC,aAAa;AAAwB,CAAA,GAC/EF,eAAQ,iBAAA,EAAmBC,YAAY;EAAEC,aAAa;AAAgD,CAAA,GACtGF,eAAQ,eAAA,EAAiBC,YAAY;EAAEC,aAAa;AAA8C,CAAA,CAAA;AAKpG,IAAMC,SAASP,UAAUQ,KAAK;EACnCP,MAAM;IACJQ,KAAK,GAAGR,KAAKS,EAAE;IACfC,MAAM;IACNL,aAAa;EACf;EACAM,UAAU;IAACb,WAAWc;;EACtBC,OAAcC,cAAO;IACnBL,IAAWM,cAAOX,YAAY;MAAEC,aAAa;IAAiC,CAAA;IAC9EW,MAAMf,eAAeG,YAAY;MAAEC,aAAa;IAAkC,CAAA;EACpF,CAAA;EACAY,QAAeC;AACjB,CAAA;AAEO,IAAMC,kBAAkBpB,UAAUQ,KAAK;EAC5CP,MAAM;IACJQ,KAAK,GAAGR,KAAKS,EAAE;IACfC,MAAM;IACNL,aAAa;EACf;EACAM,UAAU;IAACb,WAAWc;;EACtBC,OAAcC,cAAO;IACnBL,IAAWM,cAAOX,YAAY;MAAEC,aAAa;IAAiC,CAAA;IAC9Ee,MAAaC,cAAOjB,YAAY;MAAEC,aAAa;IAA6B,CAAA;EAC9E,CAAA;EACAY,QAAeC;AACjB,CAAA;",
|
|
6
|
+
"names": ["Schema", "Capability", "Operation", "meta", "PartAdjustment", "Union", "Literal", "annotations", "description", "Adjust", "make", "key", "id", "name", "services", "Service", "input", "Struct", "String", "type", "output", "Void", "UpdatePlankSize", "size", "Number"]
|
|
7
|
+
}
|
|
@@ -5,15 +5,7 @@ import { invariant } from "@dxos/invariant";
|
|
|
5
5
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-deck/src/operations/helpers.ts";
|
|
6
6
|
var updateActiveDeck = (current, deckUpdates) => {
|
|
7
7
|
const currentDeck = current.decks[current.activeDeck];
|
|
8
|
-
invariant(currentDeck, `Deck not found: ${current.activeDeck}`, {
|
|
9
|
-
F: __dxlog_file,
|
|
10
|
-
L: 11,
|
|
11
|
-
S: void 0,
|
|
12
|
-
A: [
|
|
13
|
-
"currentDeck",
|
|
14
|
-
"`Deck not found: ${current.activeDeck}`"
|
|
15
|
-
]
|
|
16
|
-
});
|
|
8
|
+
invariant(currentDeck, `Deck not found: ${current.activeDeck}`, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 7, S: void 0, A: ["currentDeck", "`Deck not found: ${current.activeDeck}`"] });
|
|
17
9
|
return {
|
|
18
10
|
...current,
|
|
19
11
|
decks: {
|
|
@@ -29,4 +21,4 @@ var updateActiveDeck = (current, deckUpdates) => {
|
|
|
29
21
|
export {
|
|
30
22
|
updateActiveDeck
|
|
31
23
|
};
|
|
32
|
-
//# sourceMappingURL=chunk-
|
|
24
|
+
//# sourceMappingURL=chunk-SHSR2CYO.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/operations/helpers.ts"],
|
|
4
4
|
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { invariant } from '@dxos/invariant';\n\nimport { type DeckState, type StoredDeckState } from '../types';\n\nexport const updateActiveDeck = (current: StoredDeckState, deckUpdates: Partial<DeckState>): StoredDeckState => {\n const currentDeck = current.decks[current.activeDeck];\n invariant(currentDeck, `Deck not found: ${current.activeDeck}`);\n return {\n ...current,\n decks: {\n ...current.decks,\n [current.activeDeck]: {\n ...currentDeck,\n ...deckUpdates,\n },\n },\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,iBAAiB
|
|
6
|
-
"names": ["invariant", "updateActiveDeck", "
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,iBAAiB;AAI1B,IAAA,eAAaC;AAEXD,IAAAA,mBAAwB,CAAA,SAAA,gBAA0BE;AAClD,QAAA,cAAO,QAAA,MAAA,QAAA,UAAA;YACFC,aAAO,mBAAA,QAAA,UAAA,IAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,GAAA,GAAA,QAAA,GAAA,CAAA,eAAA,yCAAA,EAAA,CAAA;SACVC;;WAEGD;iBACIE;eACAC,UAAW,GAAA;QAChB,GAAA;QACF,GAAA;MACF;IACA;;;",
|
|
6
|
+
"names": ["invariant", "updateActiveDeck", "activeDeck", "current", "decks", "currentDeck", "deckUpdates"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/layout.ts"],
|
|
4
4
|
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { produce } from 'immer';\n\nimport { type DeckAction } from '#types';\n\ntype OpenLayoutEntryOptions = {\n key?: string;\n};\n\n/**\n * Mutates a deck list using stack semantics: new items open to the right (`push`).\n * Callers that open from a pivot must truncate the deck first (see deck `open` operation).\n */\nexport const openEntry = (deck: readonly string[], entryId: string, options?: OpenLayoutEntryOptions): string[] => {\n return produce([...deck], (draft) => {\n if (draft.find((id) => id === entryId)) {\n return;\n }\n\n const key = options?.key;\n if (key) {\n const index = draft.findIndex((id) => id.split('+')[0] === key);\n if (index !== -1) {\n draft.splice(index, 1, entryId);\n return;\n }\n }\n\n draft.push(entryId);\n });\n};\n\nexport type OpenSubjectsOnActiveDeckOptions = {\n pivotId?: string;\n key?: string;\n};\n\n/**\n * Computes the next multi-mode `active` list for {@link LayoutOperation.Open}.\n * If `pivotId` is present and found, truncates the deck after that id.\n * Applies each subject with {@link openEntry}.\n * If the pivot is missing, appends onto the full `active` list.\n *\n * When all subjects are already present in the active deck, the deck is returned\n * unchanged so that pivot truncation does not discard open planks when navigating\n * to something that is already visible.\n */\nexport const openSubjectsOnActiveDeck = (\n active: readonly string[],\n subject: readonly string[],\n options?: OpenSubjectsOnActiveDeckOptions,\n): string[] => {\n if (subject.length > 0 && subject.every((id) => active.includes(id))) {\n return [...active];\n }\n\n const { pivotId, key } = options ?? {};\n const pivotIndex = pivotId ? active.findIndex((id) => id === pivotId) : -1;\n const baseDeck = pivotIndex !== -1 ? active.slice(0, pivotIndex + 1) : [...active];\n return subject.reduce((acc, entryId) => openEntry(acc, entryId, { key }), baseDeck);\n};\n\nexport const closeEntry = (deck: string[], entryId: string): string[] => {\n return produce(deck, (draft) => {\n const index = draft.findIndex((id) => id === entryId);\n if (index !== -1) {\n draft.splice(index, 1);\n }\n });\n};\n\nexport const incrementPlank = (deck: string[], adjustment: DeckAction.Adjustment): string[] => {\n return produce(deck, (draft) => {\n const index = draft.findIndex((id) => id === adjustment.id);\n if (\n index === -1 ||\n (adjustment.type === 'increment-start' && index === 0) ||\n (adjustment.type === 'increment-end' && index === draft.length - 1)\n ) {\n return;\n }\n\n if (adjustment.type === 'increment-start') {\n // Swap the current item with the previous item.\n [draft[index - 1], draft[index]] = [draft[index], draft[index - 1]];\n } else if (adjustment.type === 'increment-end') {\n // Swap the current item with the next item.\n [draft[index], draft[index + 1]] = [draft[index + 1], draft[index]];\n }\n });\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,eAAe;AAYjB,IAAMC,YAAY,CAACC,MAAyBC,SAAiBC,YAAAA;AAClE,
|
|
6
|
-
"names": ["produce", "openEntry", "deck", "entryId", "options", "
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,eAAe;AAYjB,IAAMC,YAAY,CAACC,MAAyBC,SAAiBC,YAAAA;AAClE,SAAOJ,QAAQ;OAAIE;KAAO,CAACG,UAAAA;AACzB,QAAIA,MAAMC,KAAK,CAACC,OAAOA,OAAOJ,OAAAA,GAAU;AACtC;IACF;AAEA,UAAMK,MAAMJ,SAASI;AACrB,QAAIA,KAAK;AACP,YAAMC,QAAQJ,MAAMK,UAAU,CAACH,OAAOA,GAAGI,MAAM,GAAA,EAAK,CAAA,MAAOH,GAAAA;AAC3D,UAAIC,UAAU,IAAI;AAChBJ,cAAMO,OAAOH,OAAO,GAAGN,OAAAA;AACvB;MACF;IACF;AAEAE,UAAMQ,KAAKV,OAAAA;EACb,CAAA;AACF;AAiBO,IAAMW,2BAA2B,CACtCC,QACAC,SACAZ,YAAAA;AAEA,MAAIY,QAAQC,SAAS,KAAKD,QAAQE,MAAM,CAACX,OAAOQ,OAAOI,SAASZ,EAAAA,CAAAA,GAAM;AACpE,WAAO;SAAIQ;;EACb;AAEA,QAAM,EAAEK,SAASZ,IAAG,IAAKJ,WAAW,CAAC;AACrC,QAAMiB,aAAaD,UAAUL,OAAOL,UAAU,CAACH,OAAOA,OAAOa,OAAAA,IAAW;AACxE,QAAME,WAAWD,eAAe,KAAKN,OAAOQ,MAAM,GAAGF,aAAa,CAAA,IAAK;OAAIN;;AAC3E,SAAOC,QAAQQ,OAAO,CAACC,KAAKtB,YAAYF,UAAUwB,KAAKtB,SAAS;IAAEK;EAAI,CAAA,GAAIc,QAAAA;AAC5E;AAEO,IAAMI,aAAa,CAACxB,MAAgBC,YAAAA;AACzC,SAAOH,QAAQE,MAAM,CAACG,UAAAA;AACpB,UAAMI,QAAQJ,MAAMK,UAAU,CAACH,OAAOA,OAAOJ,OAAAA;AAC7C,QAAIM,UAAU,IAAI;AAChBJ,YAAMO,OAAOH,OAAO,CAAA;IACtB;EACF,CAAA;AACF;AAEO,IAAMkB,iBAAiB,CAACzB,MAAgB0B,eAAAA;AAC7C,SAAO5B,QAAQE,MAAM,CAACG,UAAAA;AACpB,UAAMI,QAAQJ,MAAMK,UAAU,CAACH,OAAOA,OAAOqB,WAAWrB,EAAE;AAC1D,QACEE,UAAU,MACTmB,WAAWC,SAAS,qBAAqBpB,UAAU,KACnDmB,WAAWC,SAAS,mBAAmBpB,UAAUJ,MAAMY,SAAS,GACjE;AACA;IACF;AAEA,QAAIW,WAAWC,SAAS,mBAAmB;AAEzC,OAACxB,MAAMI,QAAQ,CAAA,GAAIJ,MAAMI,KAAAA,CAAM,IAAI;QAACJ,MAAMI,KAAAA;QAAQJ,MAAMI,QAAQ,CAAA;;IAClE,WAAWmB,WAAWC,SAAS,iBAAiB;AAE9C,OAACxB,MAAMI,KAAAA,GAAQJ,MAAMI,QAAQ,CAAA,CAAE,IAAI;QAACJ,MAAMI,QAAQ,CAAA;QAAIJ,MAAMI,KAAAA;;IAC9D;EACF,CAAA;AACF;",
|
|
6
|
+
"names": ["produce", "openEntry", "deck", "entryId", "options", "draft", "find", "id", "key", "index", "findIndex", "split", "splice", "push", "openSubjectsOnActiveDeck", "active", "subject", "length", "every", "includes", "pivotId", "pivotIndex", "baseDeck", "slice", "reduce", "acc", "closeEntry", "incrementPlank", "adjustment", "type"]
|
|
7
7
|
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
closeEntry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WGBUTT5K.mjs";
|
|
5
5
|
import {
|
|
6
6
|
computeActiveUpdates
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KY7ZCANM.mjs";
|
|
8
8
|
import {
|
|
9
9
|
updateActiveDeck
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SHSR2CYO.mjs";
|
|
11
11
|
import {
|
|
12
12
|
DeckCapabilities
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-FO7YDJZ3.mjs";
|
|
14
14
|
import "./chunk-HSLMI22Q.mjs";
|
|
15
15
|
|
|
16
16
|
// src/operations/close.ts
|
|
17
17
|
import * as Effect from "effect/Effect";
|
|
18
18
|
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
19
19
|
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
20
|
-
import { Operation } from "@dxos/
|
|
20
|
+
import { Operation } from "@dxos/compute";
|
|
21
21
|
import { AttentionCapabilities } from "@dxos/plugin-attention/types";
|
|
22
22
|
var handler = LayoutOperation.Close.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
|
|
23
23
|
const deck = yield* DeckCapabilities.getDeck();
|
|
@@ -42,4 +42,4 @@ var close_default = handler;
|
|
|
42
42
|
export {
|
|
43
43
|
close_default as default
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=close-
|
|
45
|
+
//# sourceMappingURL=close-U5VC7ERP.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/operations/close.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { AttentionCapabilities } from '@dxos/plugin-attention/types';\n\nimport { closeEntry } from '../layout';\nimport { DeckCapabilities } from '../types';\nimport { computeActiveUpdates } from '../util';\nimport { updateActiveDeck } from './helpers';\n\nconst handler: Operation.WithHandler<typeof LayoutOperation.Close> = LayoutOperation.Close.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const deck = yield* DeckCapabilities.getDeck();\n const attention = yield* Capability.get(AttentionCapabilities.Attention);\n\n const active = deck.solo ? [deck.solo] : deck.active;\n const next = input.subject.reduce((acc, id) => closeEntry(acc, id), active);\n const { deckUpdates, toAttend } = computeActiveUpdates({ next, deck, attention });\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, deckUpdates));\n\n if (toAttend) {\n yield* Operation.schedule(LayoutOperation.ScrollIntoView, { subject: toAttend });\n }\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAC1B,SAASC,6BAA6B;AAOtC,IAAMC,UAA+DC,gBAAgBC,MAAMC,KACzFC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,QAAMC,OAAO,OAAOC,iBAAiBC,QAAO;AAC5C,QAAMC,YAAY,OAAOC,WAAWC,IAAIC,sBAAsBC,SAAS;AAEvE,QAAMC,SAASR,KAAKS,OAAO;IAACT,KAAKS;MAAQT,KAAKQ;AAC9C,QAAME,OAAOX,MAAMY,QAAQC,OAAO,CAACC,KAAKC,OAAOC,WAAWF,KAAKC,EAAAA,GAAKN,MAAAA;AACpE,QAAM,EAAEQ,aAAaC,SAAQ,IAAKC,qBAAqB;IAAER;IAAMV;IAAMG;EAAU,CAAA;AAC/E,SAAOgB,aAAaC,gBAAgBnB,iBAAiBoB,OAAO,CAACC,UAAUC,iBAAiBD,OAAON,WAAAA,CAAAA;AAE/F,MAAIC,UAAU;AACZ,WAAOrB,UAAU4B,SAAS/B,gBAAgBgC,gBAAgB;MAAEd,SAASM;IAAS,CAAA;EAChF;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,gBAAezB;",
|
|
6
6
|
"names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "Operation", "AttentionCapabilities", "handler", "LayoutOperation", "Close", "pipe", "Operation", "withHandler", "fnUntraced", "input", "deck", "DeckCapabilities", "getDeck", "attention", "Capability", "get", "AttentionCapabilities", "Attention", "active", "solo", "next", "subject", "reduce", "acc", "id", "closeEntry", "deckUpdates", "toAttend", "computeActiveUpdates", "Capabilities", "updateAtomValue", "State", "state", "updateActiveDeck", "schedule", "ScrollIntoView"]
|
|
7
7
|
}
|
|
@@ -2,83 +2,20 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import {
|
|
3
3
|
DeckCapabilities,
|
|
4
4
|
DeckEvents
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FO7YDJZ3.mjs";
|
|
6
6
|
import "./chunk-HSLMI22Q.mjs";
|
|
7
7
|
|
|
8
8
|
// src/DeckPlugin.ts
|
|
9
9
|
import { setAutoFreeze } from "immer";
|
|
10
10
|
import { ActivationEvent, ActivationEvents, Plugin } from "@dxos/app-framework";
|
|
11
11
|
import { AppActivationEvents, AppPlugin } from "@dxos/app-toolkit";
|
|
12
|
-
import { translations as stackTranslations } from "@dxos/react-ui-stack";
|
|
12
|
+
import { translations as stackTranslations } from "@dxos/react-ui-stack/translations";
|
|
13
13
|
import { AppGraphBuilder, CheckAppScheme, DeckSettings, DeckState, OperationHandler, ReactRoot, ReactSurface, UrlHandler } from "#capabilities";
|
|
14
|
-
import { meta as meta2 } from "#meta";
|
|
15
|
-
import { DeckEvents as DeckEvents2 } from "#types";
|
|
16
|
-
|
|
17
|
-
// src/translations.ts
|
|
18
14
|
import { meta } from "#meta";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"en-US": {
|
|
22
|
-
[meta.id]: {
|
|
23
|
-
"plugin.name": "Deck",
|
|
24
|
-
"settings.title": "Deck settings",
|
|
25
|
-
"main-header.label": "Main header",
|
|
26
|
-
"open-navigation-sidebar.label": "Open sidebar",
|
|
27
|
-
"collapse-navigation-sidebar.label": "Minimize sidebar",
|
|
28
|
-
"open-complementary-sidebar.label": "Open context sidebar",
|
|
29
|
-
"close-complementary-sidebar.label": "Minimize context sidebar",
|
|
30
|
-
"sidebar.title": "Navigation sidebar",
|
|
31
|
-
"complementary-sidebar.title": "Context sidebar",
|
|
32
|
-
"plugin-error.message": "Content failed to render.",
|
|
33
|
-
"content-fallback.message": "Unsupported",
|
|
34
|
-
"content-fallback.description": "No plugin had a response for the address you navigated\xA0to. Double-check the URL, and ensure you\u2019ve enabled a plugin that supports the\xA0object.",
|
|
35
|
-
"toggle-fullscreen.label": "Toggle fullscreen",
|
|
36
|
-
"settings.show-hints.label": "Show hints",
|
|
37
|
-
"settings.show-hints.description": "Show helpful tips and keyboard shortcut hints in the interface.",
|
|
38
|
-
"settings.native-redirect.label": "Enable native url redirect",
|
|
39
|
-
"settings.native-redirect.description": "Redirect supported URLs to the native desktop application.",
|
|
40
|
-
"undo-available.label": "Click to undo previous action.",
|
|
41
|
-
"undo-action.label": "Undo",
|
|
42
|
-
"undo-action.alt": "Undo previous action",
|
|
43
|
-
"undo-close.label": "Dismiss",
|
|
44
|
-
"error-fallback.message": "Unable to open this object",
|
|
45
|
-
"plank-heading-fallback.label": "Untitled",
|
|
46
|
-
"actions-menu.label": "Options",
|
|
47
|
-
"settings.deck.label": "Disable deck",
|
|
48
|
-
"pending.heading": "Loading\u2026",
|
|
49
|
-
"insert-plank.label": "Open",
|
|
50
|
-
"resize.label": "Drag to resize",
|
|
51
|
-
"pin-start.label": "Pin to the left sidebar",
|
|
52
|
-
"pin-end.label": "Pin to the right sidebar",
|
|
53
|
-
"increment-start.label": "Move to the left",
|
|
54
|
-
"increment-end.label": "Move to the right",
|
|
55
|
-
"show-deck-plank.label": "Return to deck",
|
|
56
|
-
"show-solo-plank.label": "Maximize",
|
|
57
|
-
"exit-fullscreen.label": "Exit fullscreen",
|
|
58
|
-
"show-fullscreen-plank.label": "Fullscreen",
|
|
59
|
-
"close.label": "Close",
|
|
60
|
-
"minify.label": "Minify",
|
|
61
|
-
"open-companion.label": "Open companion",
|
|
62
|
-
"close-companion.label": "Close companion",
|
|
63
|
-
"settings.enable-statusbar.label": "Show status bar",
|
|
64
|
-
"settings.enable-statusbar.description": "Display a status bar at the bottom of the application.",
|
|
65
|
-
"settings.enable-deck.label": "Enable Deck",
|
|
66
|
-
"settings.enable-deck.description": "Display multiple panels side by side instead of one at a time.",
|
|
67
|
-
"settings.encapsulated-planks.label": "Encapsulated planks",
|
|
68
|
-
"settings.encapsulated-planks.description": "Render each plank inside its own isolated container.",
|
|
69
|
-
"close-current.label": "Close current plank",
|
|
70
|
-
"close-others.label": "Close other planks",
|
|
71
|
-
"close-all.label": "Close all planks",
|
|
72
|
-
"close-navigation-sidebar.button": "Close",
|
|
73
|
-
"companion-plank-heading-fallback.label": "Related"
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
];
|
|
78
|
-
|
|
79
|
-
// src/DeckPlugin.ts
|
|
15
|
+
import { translations } from "#translations";
|
|
16
|
+
import { DeckEvents as DeckEvents2 } from "#types";
|
|
80
17
|
setAutoFreeze(false);
|
|
81
|
-
var DeckPlugin = Plugin.define(
|
|
18
|
+
var DeckPlugin = Plugin.define(meta).pipe(
|
|
82
19
|
AppPlugin.addAppGraphModule({
|
|
83
20
|
activate: AppGraphBuilder
|
|
84
21
|
}),
|
|
@@ -133,7 +70,7 @@ var DeckPlugin = Plugin.define(meta2).pipe(
|
|
|
133
70
|
|
|
134
71
|
// src/meta.ts
|
|
135
72
|
import { trim } from "@dxos/util";
|
|
136
|
-
var
|
|
73
|
+
var meta2 = {
|
|
137
74
|
id: "org.dxos.plugin.deck",
|
|
138
75
|
name: "Layout",
|
|
139
76
|
description: trim`
|
|
@@ -196,7 +133,7 @@ export {
|
|
|
196
133
|
DeckCapabilities,
|
|
197
134
|
DeckEvents,
|
|
198
135
|
DeckPlugin,
|
|
199
|
-
|
|
136
|
+
meta2 as meta,
|
|
200
137
|
useCompanions
|
|
201
138
|
};
|
|
202
139
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/DeckPlugin.ts", "../../../src/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { setAutoFreeze } from 'immer';\n\nimport { ActivationEvent, ActivationEvents, Plugin } from '@dxos/app-framework';\nimport { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';\nimport { translations as stackTranslations } from '@dxos/react-ui-stack';\n\nimport {\n AppGraphBuilder,\n CheckAppScheme,\n DeckSettings,\n DeckState,\n OperationHandler,\n ReactRoot,\n ReactSurface,\n UrlHandler,\n} from '#capabilities';\nimport { meta } from '#meta';\nimport { DeckEvents } from '#types';\n\nimport { translations } from './translations';\n\n// NOTE(Zan): When producing values with immer, we shouldn't auto-freeze them because\n// our signal implementation needs to add some hidden properties to the produced values.\n// TODO(Zan): Move this to a more global location if we use immer more broadly.\nsetAutoFreeze(false);\n\nexport const DeckPlugin = Plugin.define(meta).pipe(\n AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations: [...translations, ...stackTranslations] }),\n Plugin.addModule({\n activatesOn: AppActivationEvents.SetupSettings,\n firesAfterActivation: [DeckEvents.SettingsReady],\n activate: DeckSettings,\n }),\n Plugin.addModule({\n activatesOn: ActivationEvent.allOf(DeckEvents.SettingsReady, ActivationEvents.OperationInvokerReady),\n activate: CheckAppScheme,\n }),\n Plugin.addModule({\n // TODO(wittjosiah): Does not integrate with settings store.\n // Should this be a different event?\n // Should settings store be renamed to be more generic?\n activatesOn: ActivationEvent.oneOf(AppActivationEvents.SetupSettings, AppActivationEvents.SetupAppGraph),\n firesAfterActivation: [AppActivationEvents.LayoutReady, DeckEvents.StateReady],\n activate: DeckState,\n }),\n Plugin.addModule({\n activatesOn: ActivationEvents.Startup,\n activate: ReactRoot,\n }),\n // Plugin.addModule({\n // activatesOn: Events.SetupArtifactDefinition,\n // activate: Tools,\n // }),\n Plugin.addModule({\n activatesOn: ActivationEvent.allOf(ActivationEvents.OperationInvokerReady, DeckEvents.StateReady),\n activate: UrlHandler,\n }),\n Plugin.make,\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from '#meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'plugin.name': 'Deck',\n 'settings.title': 'Deck settings',\n 'main-header.label': 'Main header',\n 'open-navigation-sidebar.label': 'Open sidebar',\n 'collapse-navigation-sidebar.label': 'Minimize sidebar',\n 'open-complementary-sidebar.label': 'Open context sidebar',\n 'close-complementary-sidebar.label': 'Minimize context sidebar',\n 'sidebar.title': 'Navigation sidebar',\n 'complementary-sidebar.title': 'Context sidebar',\n 'plugin-error.message': 'Content failed to render.',\n 'content-fallback.message': 'Unsupported',\n 'content-fallback.description':\n 'No plugin had a response for the address you navigated to. Double-check the URL, and ensure you’ve enabled a plugin that supports the object.',\n 'toggle-fullscreen.label': 'Toggle fullscreen',\n 'settings.show-hints.label': 'Show hints',\n 'settings.show-hints.description': 'Show helpful tips and keyboard shortcut hints in the interface.',\n 'settings.native-redirect.label': 'Enable native url redirect',\n 'settings.native-redirect.description': 'Redirect supported URLs to the native desktop application.',\n 'undo-available.label': 'Click to undo previous action.',\n 'undo-action.label': 'Undo',\n 'undo-action.alt': 'Undo previous action',\n 'undo-close.label': 'Dismiss',\n 'error-fallback.message': 'Unable to open this object',\n 'plank-heading-fallback.label': 'Untitled',\n 'actions-menu.label': 'Options',\n 'settings.deck.label': 'Disable deck',\n 'pending.heading': 'Loading…',\n 'insert-plank.label': 'Open',\n 'resize.label': 'Drag to resize',\n 'pin-start.label': 'Pin to the left sidebar',\n 'pin-end.label': 'Pin to the right sidebar',\n 'increment-start.label': 'Move to the left',\n 'increment-end.label': 'Move to the right',\n 'show-deck-plank.label': 'Return to deck',\n 'show-solo-plank.label': 'Maximize',\n 'exit-fullscreen.label': 'Exit fullscreen',\n 'show-fullscreen-plank.label': 'Fullscreen',\n 'close.label': 'Close',\n 'minify.label': 'Minify',\n 'open-companion.label': 'Open companion',\n 'close-companion.label': 'Close companion',\n 'settings.enable-statusbar.label': 'Show status bar',\n 'settings.enable-statusbar.description': 'Display a status bar at the bottom of the application.',\n 'settings.enable-deck.label': 'Enable Deck',\n 'settings.enable-deck.description': 'Display multiple panels side by side instead of one at a time.',\n 'settings.encapsulated-planks.label': 'Encapsulated planks',\n 'settings.encapsulated-planks.description': 'Render each plank inside its own isolated container.',\n 'close-current.label': 'Close current plank',\n 'close-others.label': 'Close other planks',\n 'close-all.label': 'Close all planks',\n 'close-navigation-sidebar.button': 'Close',\n 'companion-plank-heading-fallback.label': 'Related',\n },\n },\n },\n] as const satisfies Resource[];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.deck',\n name: 'Layout',\n description: trim`\n Flexible layout system for arranging workspace views in tabs, splits, and panels.\n Customize your workspace organization with drag-and-drop layout management.\n `,\n icon: 'ph--layout--regular',\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMediaQuery } from '@dxos/react-ui';\n\nexport const useBreakpoints = () => {\n const [isNotMobile] = useMediaQuery('md');\n const [isDesktop] = useMediaQuery('lg');\n return isDesktop ? 'desktop' : isNotMobile ? 'tablet' : 'mobile';\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { useAppGraph } from '@dxos/app-toolkit/ui';\nimport { useConnections } from '@dxos/plugin-graph';\nimport { byPosition } from '@dxos/util';\n\nimport { PLANK_COMPANION_TYPE } from '#types';\n\nexport const useCompanions = (id?: string) => {\n const { graph } = useAppGraph();\n const nodes = useConnections(graph, id, 'child');\n const companions = nodes.filter((node) => node.type === PLANK_COMPANION_TYPE);\n return useMemo(() => companions.toSorted((a, b) => byPosition(a.properties, b.properties)), [companions]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useAppGraph } from '@dxos/app-toolkit/ui';\nimport { Node, type Node as NodeType } from '@dxos/plugin-graph';\nimport { useConnections } from '@dxos/plugin-graph';\nimport { type Label } from '@dxos/ui-types';\nimport { type Position, byPosition } from '@dxos/util';\n\nimport { DECK_COMPANION_TYPE } from '#types';\n\nexport type DeckCompanion = NodeType.Node<\n any,\n {\n label: Label;\n icon: string;\n // TODO(burdon): Scroll area should be controlled by surface.\n /** If true, the panel will not be wrapped in a scroll area. */\n fixed?: boolean;\n position?: Position;\n joyride?: string;\n }\n>;\n\nexport const useDeckCompanions = (): DeckCompanion[] => {\n const { graph } = useAppGraph();\n const connections = useConnections(graph, Node.RootId, 'child');\n const companions = connections.filter((node) => node.type === DECK_COMPANION_TYPE) as DeckCompanion[];\n return companions.toSorted((a, b) => byPosition(a.properties, b.properties));\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport { useCallback, useMemo } from 'react';\n\nimport { Capabilities } from '@dxos/app-framework';\nimport { useCapability } from '@dxos/app-framework/ui';\nimport { invariant } from '@dxos/invariant';\n\nimport {\n DeckCapabilities,\n type EphemeralDeckState,\n type DeckPluginState,\n type DeckState,\n type StoredDeckState,\n} from '#types';\n\nexport type DeckStateHook = {\n /** Combined state value (reactive). Includes both persisted and ephemeral state. */\n state: DeckPluginState;\n /** The active deck, computed from decks[activeDeck]. */\n deck: DeckState;\n /** Update persisted state. */\n updateState: (fn: (current: StoredDeckState) => StoredDeckState) => void;\n /** Update ephemeral state. */\n updateEphemeral: (fn: (current: EphemeralDeckState) => EphemeralDeckState) => void;\n};\n\n/**\n * Hook to access the deck plugin state reactively.\n * Returns the combined state, the active deck, and update functions for each atom.\n */\nexport const useDeckState = (): DeckStateHook => {\n const registry = useCapability(Capabilities.AtomRegistry);\n const stateAtom = useCapability(DeckCapabilities.State);\n const ephemeralAtom = useCapability(DeckCapabilities.EphemeralState);\n const persistedState = useAtomValue(stateAtom);\n const ephemeralState = useAtomValue(ephemeralAtom);\n\n // Compute deck from decks[activeDeck] to ensure it's always current.\n const deck = useMemo(() => {\n const deck = persistedState.decks[persistedState.activeDeck];\n invariant(deck, `Deck not found: ${persistedState.activeDeck}`);\n return deck;\n }, [persistedState.decks, persistedState.activeDeck]);\n\n // Combine persisted and ephemeral state into a unified view.\n const state = useMemo(\n (): DeckPluginState => ({\n ...persistedState,\n ...ephemeralState,\n }),\n [persistedState, ephemeralState],\n );\n\n const updateState = useCallback(\n (fn: (current: StoredDeckState) => StoredDeckState) => {\n registry.set(stateAtom, fn(registry.get(stateAtom)));\n },\n [registry, stateAtom],\n );\n\n const updateEphemeral = useCallback(\n (fn: (current: EphemeralDeckState) => EphemeralDeckState) => {\n registry.set(ephemeralAtom, fn(registry.get(ephemeralAtom)));\n },\n [registry, ephemeralAtom],\n );\n\n return useMemo(() => ({ state, deck, updateState, updateEphemeral }), [state, deck, updateState, updateEphemeral]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { useAtomCapability } from '@dxos/app-framework/ui';\nimport { useThemeContext } from '@dxos/react-ui';\n\nimport { DeckCapabilities, type LayoutMode } from '#types';\n\nexport const useHoistStatusbar = (breakpoint: string, layoutMode?: LayoutMode): boolean => {\n const { safeAreaPadding } = useThemeContext();\n const enableStatusbar = useAtomCapability(DeckCapabilities.Settings).enableStatusbar;\n\n return useMemo(() => {\n return (\n breakpoint === 'desktop' &&\n layoutMode !== 'solo--fullscreen' &&\n !!enableStatusbar &&\n safeAreaPadding?.bottom === 0\n );\n }, [enableStatusbar, breakpoint, safeAreaPadding?.bottom, layoutMode]);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useMainContext } from '@dxos/react-ui';\n\nexport const useMainSize = () => {\n const { navigationSidebarState, complementarySidebarState } = useMainContext('DeckPluginPlank');\n return {\n 'data-sidebar-left-state': navigationSidebarState,\n 'data-sidebar-right-state': complementarySidebarState,\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useEffect } from 'react';\n\nimport { Graph, type Node } from '@dxos/plugin-graph';\n\nexport const useNodeActionExpander = (node?: Node.Node) => {\n useEffect(() => {\n if (node) {\n const frame = requestAnimationFrame(() => {\n const graph = Graph.getGraph(node);\n void Graph.expand(graph, node.id, 'action');\n });\n return () => cancelAnimationFrame(frame);\n }\n }, [node]);\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { type Node } from '@dxos/plugin-graph';\nimport { getLinkedVariant } from '@dxos/react-ui-attention';\n\n/**\n * Resolves which companion to show based on variant preference.\n * Falls back to first available if preferred variant not found.\n */\nexport const useSelectedCompanion = (companions: Node.Node[], preferredVariant?: string) => {\n return useMemo(() => {\n if (companions.length === 0) {\n return { companionId: undefined, variant: undefined };\n }\n\n // Try to find companion matching the preferred variant.\n if (preferredVariant) {\n const preferred = companions.find((companion) => getLinkedVariant(companion.id) === preferredVariant);\n if (preferred) {\n return { companionId: preferred.id, variant: getLinkedVariant(preferred.id) };\n }\n }\n\n // Fallback to first companion.\n const first = companions[0];\n return { companionId: first.id, variant: getLinkedVariant(first.id) };\n }, [companions, preferredVariant]);\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,SAASA,qBAAqB;AAE9B,SAASC,iBAAiBC,kBAAkBC,cAAc;AAC1D,SAASC,qBAAqBC,iBAAiB;AAC/C,SAASC,gBAAgBC,yBAAyB;AAElD,SACEC,iBACAC,gBACAC,cACAC,WACAC,kBACAC,WACAC,cACAC,kBACK;AACP,SAASC,
|
|
6
|
-
"names": ["setAutoFreeze", "ActivationEvent", "ActivationEvents", "Plugin", "AppActivationEvents", "AppPlugin", "translations", "stackTranslations", "AppGraphBuilder", "CheckAppScheme", "DeckSettings", "DeckState", "OperationHandler", "ReactRoot", "ReactSurface", "UrlHandler", "meta", "DeckEvents", "
|
|
3
|
+
"sources": ["../../../src/DeckPlugin.ts", "../../../src/meta.ts", "../../../src/hooks/useBreakpoints.ts", "../../../src/hooks/useCompanions.ts", "../../../src/hooks/useDeckCompanions.ts", "../../../src/hooks/useDeckState.ts", "../../../src/hooks/useHoistStatusbar.ts", "../../../src/hooks/useMainSize.ts", "../../../src/hooks/useNodeActionExpander.ts", "../../../src/hooks/useSelectedCompanion.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { setAutoFreeze } from 'immer';\n\nimport { ActivationEvent, ActivationEvents, Plugin } from '@dxos/app-framework';\nimport { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';\nimport { translations as stackTranslations } from '@dxos/react-ui-stack/translations';\n\nimport {\n AppGraphBuilder,\n CheckAppScheme,\n DeckSettings,\n DeckState,\n OperationHandler,\n ReactRoot,\n ReactSurface,\n UrlHandler,\n} from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { DeckEvents } from '#types';\n\n// NOTE(Zan): When producing values with immer, we shouldn't auto-freeze them because\n// our signal implementation needs to add some hidden properties to the produced values.\n// TODO(Zan): Move this to a more global location if we use immer more broadly.\nsetAutoFreeze(false);\n\nexport const DeckPlugin = Plugin.define(meta).pipe(\n AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations: [...translations, ...stackTranslations] }),\n Plugin.addModule({\n activatesOn: AppActivationEvents.SetupSettings,\n firesAfterActivation: [DeckEvents.SettingsReady],\n activate: DeckSettings,\n }),\n Plugin.addModule({\n activatesOn: ActivationEvent.allOf(DeckEvents.SettingsReady, ActivationEvents.OperationInvokerReady),\n activate: CheckAppScheme,\n }),\n Plugin.addModule({\n // TODO(wittjosiah): Does not integrate with settings store.\n // Should this be a different event?\n // Should settings store be renamed to be more generic?\n activatesOn: ActivationEvent.oneOf(AppActivationEvents.SetupSettings, AppActivationEvents.SetupAppGraph),\n firesAfterActivation: [AppActivationEvents.LayoutReady, DeckEvents.StateReady],\n activate: DeckState,\n }),\n Plugin.addModule({\n activatesOn: ActivationEvents.Startup,\n activate: ReactRoot,\n }),\n // Plugin.addModule({\n // activatesOn: Events.SetupArtifactDefinition,\n // activate: Tools,\n // }),\n Plugin.addModule({\n activatesOn: ActivationEvent.allOf(ActivationEvents.OperationInvokerReady, DeckEvents.StateReady),\n activate: UrlHandler,\n }),\n Plugin.make,\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.deck',\n name: 'Layout',\n description: trim`\n Flexible layout system for arranging workspace views in tabs, splits, and panels.\n Customize your workspace organization with drag-and-drop layout management.\n `,\n icon: 'ph--layout--regular',\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMediaQuery } from '@dxos/react-ui';\n\nexport const useBreakpoints = () => {\n const [isNotMobile] = useMediaQuery('md');\n const [isDesktop] = useMediaQuery('lg');\n return isDesktop ? 'desktop' : isNotMobile ? 'tablet' : 'mobile';\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { useAppGraph } from '@dxos/app-toolkit/ui';\nimport { useConnections } from '@dxos/plugin-graph';\nimport { byPosition } from '@dxos/util';\n\nimport { PLANK_COMPANION_TYPE } from '#types';\n\nexport const useCompanions = (id?: string) => {\n const { graph } = useAppGraph();\n const nodes = useConnections(graph, id, 'child');\n const companions = nodes.filter((node) => node.type === PLANK_COMPANION_TYPE);\n return useMemo(() => companions.toSorted((a, b) => byPosition(a.properties, b.properties)), [companions]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useAppGraph } from '@dxos/app-toolkit/ui';\nimport { Node, type Node as NodeType } from '@dxos/plugin-graph';\nimport { useConnections } from '@dxos/plugin-graph';\nimport { type Label } from '@dxos/ui-types/translations';\nimport { type Position, byPosition } from '@dxos/util';\n\nimport { DECK_COMPANION_TYPE } from '#types';\n\nexport type DeckCompanion = NodeType.Node<\n any,\n {\n label: Label;\n icon: string;\n // TODO(burdon): Scroll area should be controlled by surface.\n /** If true, the panel will not be wrapped in a scroll area. */\n fixed?: boolean;\n position?: Position;\n joyride?: string;\n }\n>;\n\nexport const useDeckCompanions = (): DeckCompanion[] => {\n const { graph } = useAppGraph();\n const connections = useConnections(graph, Node.RootId, 'child');\n const companions = connections.filter((node) => node.type === DECK_COMPANION_TYPE) as DeckCompanion[];\n return companions.toSorted((a, b) => byPosition(a.properties, b.properties));\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport { useCallback, useMemo } from 'react';\n\nimport { Capabilities } from '@dxos/app-framework';\nimport { useCapability } from '@dxos/app-framework/ui';\nimport { invariant } from '@dxos/invariant';\n\nimport {\n DeckCapabilities,\n type EphemeralDeckState,\n type DeckPluginState,\n type DeckState,\n type StoredDeckState,\n} from '#types';\n\nexport type DeckStateHook = {\n /** Combined state value (reactive). Includes both persisted and ephemeral state. */\n state: DeckPluginState;\n /** The active deck, computed from decks[activeDeck]. */\n deck: DeckState;\n /** Update persisted state. */\n updateState: (fn: (current: StoredDeckState) => StoredDeckState) => void;\n /** Update ephemeral state. */\n updateEphemeral: (fn: (current: EphemeralDeckState) => EphemeralDeckState) => void;\n};\n\n/**\n * Hook to access the deck plugin state reactively.\n * Returns the combined state, the active deck, and update functions for each atom.\n */\nexport const useDeckState = (): DeckStateHook => {\n const registry = useCapability(Capabilities.AtomRegistry);\n const stateAtom = useCapability(DeckCapabilities.State);\n const ephemeralAtom = useCapability(DeckCapabilities.EphemeralState);\n const persistedState = useAtomValue(stateAtom);\n const ephemeralState = useAtomValue(ephemeralAtom);\n\n // Compute deck from decks[activeDeck] to ensure it's always current.\n const deck = useMemo(() => {\n const deck = persistedState.decks[persistedState.activeDeck];\n invariant(deck, `Deck not found: ${persistedState.activeDeck}`);\n return deck;\n }, [persistedState.decks, persistedState.activeDeck]);\n\n // Combine persisted and ephemeral state into a unified view.\n const state = useMemo(\n (): DeckPluginState => ({\n ...persistedState,\n ...ephemeralState,\n }),\n [persistedState, ephemeralState],\n );\n\n const updateState = useCallback(\n (fn: (current: StoredDeckState) => StoredDeckState) => {\n registry.set(stateAtom, fn(registry.get(stateAtom)));\n },\n [registry, stateAtom],\n );\n\n const updateEphemeral = useCallback(\n (fn: (current: EphemeralDeckState) => EphemeralDeckState) => {\n registry.set(ephemeralAtom, fn(registry.get(ephemeralAtom)));\n },\n [registry, ephemeralAtom],\n );\n\n return useMemo(() => ({ state, deck, updateState, updateEphemeral }), [state, deck, updateState, updateEphemeral]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { useAtomCapability } from '@dxos/app-framework/ui';\nimport { useThemeContext } from '@dxos/react-ui';\n\nimport { DeckCapabilities, type LayoutMode } from '#types';\n\nexport const useHoistStatusbar = (breakpoint: string, layoutMode?: LayoutMode): boolean => {\n const { safeAreaPadding } = useThemeContext();\n const enableStatusbar = useAtomCapability(DeckCapabilities.Settings).enableStatusbar;\n\n return useMemo(() => {\n return (\n breakpoint === 'desktop' &&\n layoutMode !== 'solo--fullscreen' &&\n !!enableStatusbar &&\n safeAreaPadding?.bottom === 0\n );\n }, [enableStatusbar, breakpoint, safeAreaPadding?.bottom, layoutMode]);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useMainContext } from '@dxos/react-ui';\n\nexport const useMainSize = () => {\n const { navigationSidebarState, complementarySidebarState } = useMainContext('DeckPluginPlank');\n return {\n 'data-sidebar-left-state': navigationSidebarState,\n 'data-sidebar-right-state': complementarySidebarState,\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useEffect } from 'react';\n\nimport { Graph, type Node } from '@dxos/plugin-graph';\n\nexport const useNodeActionExpander = (node?: Node.Node) => {\n useEffect(() => {\n if (node) {\n const frame = requestAnimationFrame(() => {\n const graph = Graph.getGraph(node);\n void Graph.expand(graph, node.id, 'action');\n });\n return () => cancelAnimationFrame(frame);\n }\n }, [node]);\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { type Node } from '@dxos/plugin-graph';\nimport { getLinkedVariant } from '@dxos/react-ui-attention';\n\n/**\n * Resolves which companion to show based on variant preference.\n * Falls back to first available if preferred variant not found.\n */\nexport const useSelectedCompanion = (companions: Node.Node[], preferredVariant?: string) => {\n return useMemo(() => {\n if (companions.length === 0) {\n return { companionId: undefined, variant: undefined };\n }\n\n // Try to find companion matching the preferred variant.\n if (preferredVariant) {\n const preferred = companions.find((companion) => getLinkedVariant(companion.id) === preferredVariant);\n if (preferred) {\n return { companionId: preferred.id, variant: getLinkedVariant(preferred.id) };\n }\n }\n\n // Fallback to first companion.\n const first = companions[0];\n return { companionId: first.id, variant: getLinkedVariant(first.id) };\n }, [companions, preferredVariant]);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,SAASA,qBAAqB;AAE9B,SAASC,iBAAiBC,kBAAkBC,cAAc;AAC1D,SAASC,qBAAqBC,iBAAiB;AAC/C,SAASC,gBAAgBC,yBAAyB;AAElD,SACEC,iBACAC,gBACAC,cACAC,WACAC,kBACAC,WACAC,cACAC,kBACK;AACP,SAASC,YAAY;AACrB,SAASV,oBAAoB;AAC7B,SAASW,cAAAA,mBAAkB;AAK3BjB,cAAc,KAAA;AAEP,IAAMkB,aAAaf,OAAOgB,OAAOH,IAAAA,EAAMI;EAC5Cf,UAAUgB,kBAAkB;IAAEC,UAAUd;EAAgB,CAAA;EACxDH,UAAUkB,0BAA0B;IAAED,UAAUV;EAAiB,CAAA;EACjEP,UAAUmB,iBAAiB;IAAEF,UAAUR;EAAa,CAAA;EACpDT,UAAUoB,sBAAsB;IAAEnB,cAAc;SAAIA;SAAiBC;;EAAmB,CAAA;EACxFJ,OAAOuB,UAAU;IACfC,aAAavB,oBAAoBwB;IACjCC,sBAAsB;MAACZ,YAAWa;;IAClCR,UAAUZ;EACZ,CAAA;EACAP,OAAOuB,UAAU;IACfC,aAAa1B,gBAAgB8B,MAAMd,YAAWa,eAAe5B,iBAAiB8B,qBAAqB;IACnGV,UAAUb;EACZ,CAAA;EACAN,OAAOuB,UAAU;;;;IAIfC,aAAa1B,gBAAgBgC,MAAM7B,oBAAoBwB,eAAexB,oBAAoB8B,aAAa;IACvGL,sBAAsB;MAACzB,oBAAoB+B;MAAalB,YAAWmB;;IACnEd,UAAUX;EACZ,CAAA;EACAR,OAAOuB,UAAU;IACfC,aAAazB,iBAAiBmC;IAC9Bf,UAAUT;EACZ,CAAA;;;;;EAKAV,OAAOuB,UAAU;IACfC,aAAa1B,gBAAgB8B,MAAM7B,iBAAiB8B,uBAAuBf,YAAWmB,UAAU;IAChGd,UAAUP;EACZ,CAAA;EACAZ,OAAOmC;AAAI;;;AC1Db,SAASC,YAAY;AAEd,IAAMC,QAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaJ;;;;EAIbK,MAAM;AACR;;;ACXA,SAASC,qBAAqB;;;ACA9B,SAASC,eAAe;AAExB,SAASC,mBAAmB;AAC5B,SAASC,sBAAsB;AAC/B,SAASC,kBAAkB;AAE3B,SAASC,4BAA4B;AAE9B,IAAMC,gBAAgB,CAACC,OAAAA;AAC5B,QAAM,EAAEC,MAAK,IAAKN,YAAAA;AAClB,QAAMO,QAAQN,eAAeK,OAAOD,IAAI,OAAA;AACxC,QAAMG,aAAaD,MAAME,OAAO,CAACC,SAASA,KAAKC,SAASR,oBAAAA;AACxD,SAAOJ,QAAQ,MAAMS,WAAWI,SAAS,CAACC,GAAGC,MAAMZ,WAAWW,EAAEE,YAAYD,EAAEC,UAAU,CAAA,GAAI;IAACP;GAAW;AAC1G;;;ACbA,SAASQ,eAAAA,oBAAmB;AAC5B,SAASC,YAAmC;AAC5C,SAASC,kBAAAA,uBAAsB;AAE/B,SAAwBC,cAAAA,mBAAkB;AAE1C,SAASC,2BAA2B;;;ACNpC,SAASC,oBAAoB;AAC7B,SAASC,aAAaC,WAAAA,gBAAe;AAErC,SAASC,oBAAoB;AAC7B,SAASC,qBAAqB;AAC9B,SAASC,iBAAiB;AAE1B,SACEC,oBAAAA,yBAKK;;;ACbP,SAASC,WAAAA,gBAAe;AAExB,SAASC,yBAAyB;AAClC,SAASC,uBAAuB;AAEhC,SAASC,oBAAAA,yBAAyC;;;ACLlD,SAASC,sBAAsB;;;ACA/B,SAASC,iBAAiB;AAE1B,SAASC,aAAwB;;;ACFjC,SAASC,WAAAA,gBAAe;AAGxB,SAASC,wBAAwB;",
|
|
6
|
+
"names": ["setAutoFreeze", "ActivationEvent", "ActivationEvents", "Plugin", "AppActivationEvents", "AppPlugin", "translations", "stackTranslations", "AppGraphBuilder", "CheckAppScheme", "DeckSettings", "DeckState", "OperationHandler", "ReactRoot", "ReactSurface", "UrlHandler", "meta", "DeckEvents", "DeckPlugin", "define", "pipe", "addAppGraphModule", "activate", "addOperationHandlerModule", "addSurfaceModule", "addTranslationsModule", "addModule", "activatesOn", "SetupSettings", "firesAfterActivation", "SettingsReady", "allOf", "OperationInvokerReady", "oneOf", "SetupAppGraph", "LayoutReady", "StateReady", "Startup", "make", "trim", "meta", "id", "name", "description", "icon", "useMediaQuery", "useMemo", "useAppGraph", "useConnections", "byPosition", "PLANK_COMPANION_TYPE", "useCompanions", "id", "graph", "nodes", "companions", "filter", "node", "type", "toSorted", "a", "b", "properties", "useAppGraph", "Node", "useConnections", "byPosition", "DECK_COMPANION_TYPE", "useAtomValue", "useCallback", "useMemo", "Capabilities", "useCapability", "invariant", "DeckCapabilities", "useMemo", "useAtomCapability", "useThemeContext", "DeckCapabilities", "useMainContext", "useEffect", "Graph", "useMemo", "getLinkedVariant"]
|
|
7
7
|
}
|