@dxos/plugin-deck 0.8.4-main.c1de068 → 0.8.4-main.dedc0f3

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.
Files changed (96) hide show
  1. package/dist/lib/browser/{app-graph-builder-JTFSDT2I.mjs → app-graph-builder-DVEKLXB4.mjs} +3 -3
  2. package/dist/lib/browser/app-graph-builder-DVEKLXB4.mjs.map +7 -0
  3. package/dist/lib/browser/{check-app-scheme-57U62A3A.mjs → check-app-scheme-3BQJXWEY.mjs} +1 -1
  4. package/dist/lib/browser/{check-app-scheme-57U62A3A.mjs.map → check-app-scheme-3BQJXWEY.mjs.map} +2 -2
  5. package/dist/lib/browser/{chunk-JFTXENFN.mjs → chunk-NRCPV6AV.mjs} +2 -2
  6. package/dist/lib/browser/{chunk-JFTXENFN.mjs.map → chunk-NRCPV6AV.mjs.map} +2 -2
  7. package/dist/lib/browser/{chunk-D7KTFCUV.mjs → chunk-NU7H23SK.mjs} +198 -194
  8. package/dist/lib/browser/chunk-NU7H23SK.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-QDZO4AJ4.mjs → chunk-WILMPGDV.mjs} +11 -11
  10. package/dist/lib/browser/{chunk-QDZO4AJ4.mjs.map → chunk-WILMPGDV.mjs.map} +3 -3
  11. package/dist/lib/browser/index.mjs +14 -7
  12. package/dist/lib/browser/index.mjs.map +3 -3
  13. package/dist/lib/browser/{intent-resolver-P2OBK5HK.mjs → intent-resolver-2SUIIV6N.mjs} +5 -5
  14. package/dist/lib/browser/intent-resolver-2SUIIV6N.mjs.map +7 -0
  15. package/dist/lib/browser/meta.json +1 -1
  16. package/dist/lib/browser/{react-root-PO64J7ML.mjs → react-root-7PRVDLF7.mjs} +4 -4
  17. package/dist/lib/browser/{react-root-PO64J7ML.mjs.map → react-root-7PRVDLF7.mjs.map} +2 -2
  18. package/dist/lib/browser/{react-surface-E45YOVF5.mjs → react-surface-FNY2YC2F.mjs} +4 -4
  19. package/dist/lib/browser/{react-surface-E45YOVF5.mjs.map → react-surface-FNY2YC2F.mjs.map} +1 -1
  20. package/dist/lib/browser/{settings-6AJZPZPM.mjs → settings-LUPQPZ27.mjs} +1 -1
  21. package/dist/lib/browser/{settings-6AJZPZPM.mjs.map → settings-LUPQPZ27.mjs.map} +1 -1
  22. package/dist/lib/browser/{state-MVDYX77Y.mjs → state-CRXR7X63.mjs} +2 -2
  23. package/dist/lib/browser/toolkit-XGJSBY67.mjs +61 -0
  24. package/dist/lib/browser/toolkit-XGJSBY67.mjs.map +7 -0
  25. package/dist/lib/browser/{url-handler-7L7M6IKH.mjs → url-handler-LROZYQ26.mjs} +2 -2
  26. package/dist/lib/browser/url-handler-LROZYQ26.mjs.map +7 -0
  27. package/dist/types/src/DeckPlugin.d.ts.map +1 -1
  28. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  29. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  30. package/dist/types/src/capabilities/check-app-scheme.d.ts +1 -1
  31. package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
  32. package/dist/types/src/capabilities/index.d.ts +9 -9
  33. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  34. package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
  35. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  36. package/dist/types/src/capabilities/react-root.d.ts +2 -2
  37. package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
  38. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  39. package/dist/types/src/capabilities/settings.d.ts +1 -1
  40. package/dist/types/src/capabilities/state.d.ts +2 -2
  41. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  42. package/dist/types/src/capabilities/toolkit.d.ts +5 -0
  43. package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
  44. package/dist/types/src/capabilities/tools.d.ts +1 -1
  45. package/dist/types/src/capabilities/tools.d.ts.map +1 -1
  46. package/dist/types/src/capabilities/url-handler.d.ts +1 -1
  47. package/dist/types/src/capabilities/url-handler.d.ts.map +1 -1
  48. package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
  49. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
  50. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
  51. package/dist/types/src/components/Plank/Plank.d.ts +1 -1
  52. package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
  53. package/dist/types/src/components/Plank/Plank.stories.d.ts +84 -4
  54. package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
  55. package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
  56. package/dist/types/src/components/Plank/PlankHeading.d.ts +1 -1
  57. package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
  58. package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
  59. package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
  60. package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
  61. package/dist/types/src/translations.d.ts +1 -0
  62. package/dist/types/src/translations.d.ts.map +1 -1
  63. package/dist/types/tsconfig.tsbuildinfo +1 -1
  64. package/package.json +37 -33
  65. package/src/DeckPlugin.ts +11 -5
  66. package/src/capabilities/app-graph-builder.ts +4 -3
  67. package/src/capabilities/check-app-scheme.ts +1 -1
  68. package/src/capabilities/index.ts +2 -1
  69. package/src/capabilities/intent-resolver.ts +10 -9
  70. package/src/capabilities/react-root.tsx +2 -1
  71. package/src/capabilities/react-surface.tsx +1 -1
  72. package/src/capabilities/settings.ts +1 -1
  73. package/src/capabilities/state.ts +3 -2
  74. package/src/capabilities/toolkit.ts +55 -0
  75. package/src/capabilities/tools.ts +9 -6
  76. package/src/capabilities/url-handler.ts +3 -2
  77. package/src/components/DeckLayout/Banner.tsx +1 -1
  78. package/src/components/DeckLayout/ContentEmpty.tsx +1 -1
  79. package/src/components/DeckLayout/DeckLayout.tsx +11 -10
  80. package/src/components/DeckSettings/DeckSettings.tsx +72 -63
  81. package/src/components/Plank/Plank.stories.tsx +7 -6
  82. package/src/components/Plank/Plank.tsx +7 -6
  83. package/src/components/Plank/PlankError.tsx +2 -1
  84. package/src/components/Plank/PlankHeading.tsx +5 -4
  85. package/src/components/Sidebar/ComplementarySidebar.tsx +4 -3
  86. package/src/components/Sidebar/SidebarButton.tsx +2 -2
  87. package/src/hooks/useDeckCompanions.ts +2 -2
  88. package/src/hooks/useNodeActionExpander.ts +1 -1
  89. package/src/translations.ts +1 -0
  90. package/dist/lib/browser/app-graph-builder-JTFSDT2I.mjs.map +0 -7
  91. package/dist/lib/browser/chunk-D7KTFCUV.mjs.map +0 -7
  92. package/dist/lib/browser/intent-resolver-P2OBK5HK.mjs.map +0 -7
  93. package/dist/lib/browser/tools-TKQDPCHJ.mjs +0 -88
  94. package/dist/lib/browser/tools-TKQDPCHJ.mjs.map +0 -7
  95. package/dist/lib/browser/url-handler-7L7M6IKH.mjs.map +0 -7
  96. /package/dist/lib/browser/{state-MVDYX77Y.mjs.map → state-CRXR7X63.mjs.map} +0 -0
@@ -8,9 +8,9 @@ import {
8
8
  // src/capabilities/app-graph-builder.ts
9
9
  import { Rx } from "@effect-rx/rx-react";
10
10
  import { Option, pipe } from "effect";
11
- import { Capabilities, contributes, createIntent, LayoutAction } from "@dxos/app-framework";
11
+ import { Capabilities, LayoutAction, contributes, createIntent } from "@dxos/app-framework";
12
12
  import { AttentionCapabilities } from "@dxos/plugin-attention";
13
- import { createExtension, ROOT_ID, rxFromSignal } from "@dxos/plugin-graph";
13
+ import { ROOT_ID, createExtension, rxFromSignal } from "@dxos/plugin-graph";
14
14
  var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
15
15
  id: DECK_PLUGIN,
16
16
  actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === ROOT_ID ? Option.some(node2) : Option.none()), Option.map(() => {
@@ -149,4 +149,4 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
149
149
  export {
150
150
  app_graph_builder_default as default
151
151
  };
152
- //# sourceMappingURL=app-graph-builder-JTFSDT2I.mjs.map
152
+ //# sourceMappingURL=app-graph-builder-DVEKLXB4.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/app-graph-builder.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';\nimport { AttentionCapabilities } from '@dxos/plugin-attention';\nimport { ROOT_ID, createExtension, rxFromSignal } from '@dxos/plugin-graph';\n\nimport { DECK_PLUGIN } from '../meta';\n\nimport { DeckCapabilities } from './capabilities';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: DECK_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => {\n const state = context.getCapability(DeckCapabilities.MutableDeckState);\n\n // NOTE(Zan): This is currently disabled.\n // TODO(Zan): Fullscreen needs to know the active node and provide that to the layout part.\n const _fullscreen = {\n id: `${LayoutAction.UpdateLayout._tag}/fullscreen`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { mode: 'fullscreen' } }),\n );\n },\n properties: {\n label: ['toggle fullscreen label', { ns: DECK_PLUGIN }],\n icon: 'ph--arrows-out--regular',\n keyBinding: {\n macos: 'ctrl+meta+f',\n windows: 'shift+ctrl+f',\n },\n },\n };\n\n const closeCurrent = {\n id: `${LayoutAction.Close._tag}/current`,\n data: async () => {\n const attention = context.getCapability(AttentionCapabilities.Attention);\n const attended = attention.current.at(-1);\n if (attended) {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.Close, {\n part: 'main',\n subject: [attended],\n options: { state: false },\n }),\n );\n }\n },\n properties: {\n label: ['close current label', { ns: DECK_PLUGIN }],\n icon: 'ph--x--regular',\n },\n };\n\n const closeOthers = {\n id: `${LayoutAction.Close._tag}/others`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const attention = context.getCapability(AttentionCapabilities.Attention);\n const attended = attention.current.at(-1);\n const ids = state.deck.active.filter((id) => id !== attended) ?? [];\n await dispatch(\n createIntent(LayoutAction.Close, { part: 'main', subject: ids, options: { state: false } }),\n );\n },\n properties: {\n label: ['close others label', { ns: DECK_PLUGIN }],\n icon: 'ph--x-square--regular',\n },\n };\n\n const closeAll = {\n id: `${LayoutAction.Close._tag}/all`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.Close, {\n part: 'main',\n subject: state.deck.active,\n options: { state: false },\n }),\n );\n },\n properties: {\n label: ['close all label', { ns: DECK_PLUGIN }],\n icon: 'ph--x-circle--regular',\n },\n };\n\n const toggleSidebar = {\n id: `${LayoutAction.UpdateSidebar._tag}/nav`,\n data: async () => {\n state.sidebarState = state.sidebarState === 'expanded' ? 'collapsed' : 'expanded';\n },\n properties: {\n label: [\n get(\n rxFromSignal(() =>\n state.sidebarState === 'expanded'\n ? 'collapse navigation sidebar label'\n : 'open navigation sidebar label',\n ),\n ),\n { ns: DECK_PLUGIN },\n ],\n icon: 'ph--sidebar--regular',\n keyBinding: {\n macos: \"meta+'\",\n },\n disposition: 'pin-end',\n position: 'hoist',\n l0Breakpoint: 'lg',\n },\n };\n\n return get(\n rxFromSignal(() =>\n !state.deck.solo ? [closeCurrent, closeOthers, closeAll, toggleSidebar] : [toggleSidebar],\n ),\n );\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n );\n"],
5
+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yC,eAAezC,MAAMyC,iBAAiB,aAAa,cAAc;MACzE;MACAxB,YAAY;QACVC,OAAO;UACL1B,IACEkD,aAAa,MACX1C,MAAMyC,iBAAiB,aACnB,sCACA,+BAAA,CAAA;UAGR;YAAEtB,IAAIhC;UAAY;;QAEpBiC,MAAM;QACNC,YAAY;UACVC,OAAO;QACT;QACAqB,aAAa;QACbC,UAAU;QACVC,cAAc;MAChB;IACF;AAEA,WAAOrD,IACLkD,aAAa,MACX,CAAC1C,MAAMmC,KAAKW,OAAO;MAACtB;MAAcS;MAAaK;MAAUC;QAAiB;MAACA;KAAc,CAAA;EAG/F,CAAA,GACA7C,OAAOqD,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
6
+ "names": ["Rx", "Option", "pipe", "Capabilities", "LayoutAction", "contributes", "createIntent", "AttentionCapabilities", "ROOT_ID", "createExtension", "rxFromSignal", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "DECK_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "ROOT_ID", "some", "none", "map", "state", "getCapability", "DeckCapabilities", "MutableDeckState", "_fullscreen", "LayoutAction", "UpdateLayout", "_tag", "data", "dispatchPromise", "dispatch", "IntentDispatcher", "createIntent", "SetLayoutMode", "part", "options", "mode", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "closeCurrent", "Close", "attention", "AttentionCapabilities", "Attention", "attended", "current", "at", "subject", "closeOthers", "ids", "deck", "active", "filter", "closeAll", "toggleSidebar", "UpdateSidebar", "sidebarState", "rxFromSignal", "disposition", "position", "l0Breakpoint", "solo", "getOrElse"]
7
+ }
@@ -29,4 +29,4 @@ var check_app_scheme_default = async (context) => {
29
29
  export {
30
30
  check_app_scheme_default as default
31
31
  };
32
- //# sourceMappingURL=check-app-scheme-57U62A3A.mjs.map
32
+ //# sourceMappingURL=check-app-scheme-3BQJXWEY.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/capabilities/check-app-scheme.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';\n\nimport { DECK_PLUGIN } from '../meta';\nimport { type DeckSettingsProps } from '../types';\n\nconst isSocket = !!(globalThis as any).__args;\n\n// TODO(mjamesderocher): Can we get this directly from Socket?\nconst appScheme = 'composer://';\n\n// TODO(mjamesderocher): Factor out as part of NavigationPlugin.\nconst checkAppScheme = (url: string) => {\n const iframe = document.createElement('iframe');\n iframe.style.display = 'none';\n document.body.appendChild(iframe);\n\n iframe.src = url + window.location.pathname.replace(/^\\/+/, '') + window.location.search;\n\n const timer = setTimeout(() => {\n document.body.removeChild(iframe);\n }, 3000);\n\n window.addEventListener('pagehide', (event) => {\n clearTimeout(timer);\n document.body.removeChild(iframe);\n });\n};\n\nexport default async (context: PluginContext) => {\n const settings = context.getCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(DECK_PLUGIN)?.value;\n if (!isSocket && settings?.enableNativeRedirect) {\n checkAppScheme(appScheme);\n }\n\n return contributes(Capabilities.Null, null);\n};\n"],
5
- "mappings": ";;;;;AAIA,SAASA,cAAcC,mBAAuC;AAK9D,IAAMC,WAAW,CAAC,CAAEC,WAAmBC;AAGvC,IAAMC,YAAY;AAGlB,IAAMC,iBAAiB,CAACC,QAAAA;AACtB,QAAMC,SAASC,SAASC,cAAc,QAAA;AACtCF,SAAOG,MAAMC,UAAU;AACvBH,WAASI,KAAKC,YAAYN,MAAAA;AAE1BA,SAAOO,MAAMR,MAAMS,OAAOC,SAASC,SAASC,QAAQ,QAAQ,EAAA,IAAMH,OAAOC,SAASG;AAElF,QAAMC,QAAQC,WAAW,MAAA;AACvBb,aAASI,KAAKU,YAAYf,MAAAA;EAC5B,GAAG,GAAA;AAEHQ,SAAOQ,iBAAiB,YAAY,CAACC,UAAAA;AACnCC,iBAAaL,KAAAA;AACbZ,aAASI,KAAKU,YAAYf,MAAAA;EAC5B,CAAA;AACF;AAEA,IAAA,2BAAe,OAAOmB,YAAAA;AACpB,QAAMC,WAAWD,QAAQE,cAAcC,aAAaC,aAAa,EAAEC,SAA4BC,WAAAA,GAAcC;AAC7G,MAAI,CAAChC,YAAY0B,UAAUO,sBAAsB;AAC/C7B,mBAAeD,SAAAA;EACjB;AAEA,SAAO+B,YAAYN,aAAaO,MAAM,IAAA;AACxC;",
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';\n\nimport { DECK_PLUGIN } from '../meta';\nimport { type DeckSettingsProps } from '../types';\n\nconst isSocket = !!(globalThis as any).__args;\n\n// TODO(mjamesderocher): Can we get this directly from Socket?\nconst appScheme = 'composer://';\n\n// TODO(mjamesderocher): Factor out as part of NavigationPlugin.\nconst checkAppScheme = (url: string) => {\n const iframe = document.createElement('iframe');\n iframe.style.display = 'none';\n document.body.appendChild(iframe);\n\n iframe.src = url + window.location.pathname.replace(/^\\/+/, '') + window.location.search;\n\n const timer = setTimeout(() => {\n document.body.removeChild(iframe);\n }, 3000);\n\n window.addEventListener('pagehide', (event) => {\n clearTimeout(timer);\n document.body.removeChild(iframe);\n });\n};\n\nexport default async (context: PluginContext) => {\n const settings = context.getCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(DECK_PLUGIN)?.value;\n if (!isSocket && settings?.enableNativeRedirect) {\n checkAppScheme(appScheme);\n }\n\n return contributes(Capabilities.Null, null);\n};\n"],
5
+ "mappings": ";;;;;AAIA,SAASA,cAAkCC,mBAAmB;AAK9D,IAAMC,WAAW,CAAC,CAAEC,WAAmBC;AAGvC,IAAMC,YAAY;AAGlB,IAAMC,iBAAiB,CAACC,QAAAA;AACtB,QAAMC,SAASC,SAASC,cAAc,QAAA;AACtCF,SAAOG,MAAMC,UAAU;AACvBH,WAASI,KAAKC,YAAYN,MAAAA;AAE1BA,SAAOO,MAAMR,MAAMS,OAAOC,SAASC,SAASC,QAAQ,QAAQ,EAAA,IAAMH,OAAOC,SAASG;AAElF,QAAMC,QAAQC,WAAW,MAAA;AACvBb,aAASI,KAAKU,YAAYf,MAAAA;EAC5B,GAAG,GAAA;AAEHQ,SAAOQ,iBAAiB,YAAY,CAACC,UAAAA;AACnCC,iBAAaL,KAAAA;AACbZ,aAASI,KAAKU,YAAYf,MAAAA;EAC5B,CAAA;AACF;AAEA,IAAA,2BAAe,OAAOmB,YAAAA;AACpB,QAAMC,WAAWD,QAAQE,cAAcC,aAAaC,aAAa,EAAEC,SAA4BC,WAAAA,GAAcC;AAC7G,MAAI,CAAChC,YAAY0B,UAAUO,sBAAsB;AAC/C7B,mBAAeD,SAAAA;EACjB;AAEA,SAAO+B,YAAYN,aAAaO,MAAM,IAAA;AACxC;",
6
6
  "names": ["Capabilities", "contributes", "isSocket", "globalThis", "__args", "appScheme", "checkAppScheme", "url", "iframe", "document", "createElement", "style", "display", "body", "appendChild", "src", "window", "location", "pathname", "replace", "search", "timer", "setTimeout", "removeChild", "addEventListener", "event", "clearTimeout", "context", "settings", "getCapability", "Capabilities", "SettingsStore", "getStore", "DECK_PLUGIN", "value", "enableNativeRedirect", "contributes", "Null"]
7
7
  }
@@ -54,7 +54,7 @@ var DeckStateFactory = () => {
54
54
  const deck = this.decks[this.activeDeck];
55
55
  invariant(deck, `Deck not found: ${this.activeDeck}`, {
56
56
  F: __dxlog_file,
57
- L: 56,
57
+ L: 57,
58
58
  S: this,
59
59
  A: [
60
60
  "deck",
@@ -126,4 +126,4 @@ export {
126
126
  DeckStateFactory,
127
127
  state_default
128
128
  };
129
- //# sourceMappingURL=chunk-JFTXENFN.mjs.map
129
+ //# sourceMappingURL=chunk-NRCPV6AV.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/capabilities/state.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes } from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { live } from '@dxos/live-object';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { type SidebarState } from '@dxos/react-ui';\n\nimport { DeckCapabilities } from './capabilities';\nimport { DECK_PLUGIN } from '../meta';\nimport { getMode, type DeckPluginState, defaultDeck, type DeckState } from '../types';\n\nconst boolean = /true|false/;\n\n// TODO(thure, 18 Feb 2025): Remove after the next release.\n\nconst migrateSidebarStateDefaults = {\n [`${DECK_PLUGIN}/complementary-sidebar-state`]: 'expanded',\n [`${DECK_PLUGIN}/sidebar-state`]: 'collapsed',\n};\n\nconst migrateSidebarState = () => {\n Object.entries(migrateSidebarStateDefaults).forEach(([key, defaultValue]) => {\n if (boolean.test(localStorage.getItem(key) ?? 'never')) {\n localStorage.setItem(key, defaultValue);\n }\n });\n};\n\nexport const DeckStateFactory = () => {\n migrateSidebarState();\n\n const state = new LocalStorageStore<DeckPluginState>(DECK_PLUGIN, {\n sidebarState: 'expanded',\n complementarySidebarState: 'collapsed',\n complementarySidebarPanel: undefined,\n dialogContent: null,\n dialogOpen: false,\n dialogBlockAlign: undefined,\n dialogType: undefined,\n popoverContent: null,\n popoverAnchor: undefined,\n popoverAnchorId: undefined,\n popoverOpen: false,\n toasts: [],\n currentUndoId: undefined,\n activeDeck: 'default',\n previousDeck: 'default',\n decks: {\n default: { ...defaultDeck },\n },\n get deck() {\n const deck = this.decks[this.activeDeck];\n invariant(deck, `Deck not found: ${this.activeDeck}`);\n return deck;\n },\n previousMode: {},\n scrollIntoView: undefined,\n });\n\n state\n .prop({ key: 'sidebarState', type: LocalStorageStore.enum<SidebarState>() })\n .prop({ key: 'complementarySidebarState', type: LocalStorageStore.enum<SidebarState>() })\n .prop({ key: 'complementarySidebarPanel', type: LocalStorageStore.string({ allowUndefined: true }) })\n .prop({ key: 'decks', type: LocalStorageStore.json<Record<string, DeckState>>() })\n .prop({ key: 'activeDeck', type: LocalStorageStore.string() })\n .prop({ key: 'previousDeck', type: LocalStorageStore.string() });\n\n const layout = live<Capabilities.Layout>({\n get mode() {\n return getMode(state.values.deck);\n },\n get dialogOpen() {\n return state.values.dialogOpen;\n },\n get sidebarOpen() {\n return state.values.sidebarState === 'expanded';\n },\n get complementarySidebarOpen() {\n return state.values.complementarySidebarState === 'expanded';\n },\n get workspace() {\n return state.values.activeDeck;\n },\n get active() {\n return state.values.deck.solo ? [state.values.deck.solo] : state.values.deck.active;\n },\n get inactive() {\n return state.values.deck.inactive;\n },\n get scrollIntoView() {\n return state.values.scrollIntoView;\n },\n });\n\n return [\n contributes(DeckCapabilities.DeckState, state.values, () => state.close()),\n contributes(Capabilities.Layout, layout),\n ];\n};\n\nexport default DeckStateFactory;\n"],
5
- "mappings": ";;;;;;;;;;;;AAIA,SAASA,cAAcC,mBAAmB;AAC1C,SAASC,iBAAiB;AAC1B,SAASC,YAAY;AACrB,SAASC,yBAAyB;;AAOlC,IAAMC,UAAU;AAIhB,IAAMC,8BAA8B;EAClC,CAAC,GAAGC,WAAAA,8BAAyC,GAAG;EAChD,CAAC,GAAGA,WAAAA,gBAA2B,GAAG;AACpC;AAEA,IAAMC,sBAAsB,MAAA;AAC1BC,SAAOC,QAAQJ,2BAAAA,EAA6BK,QAAQ,CAAC,CAACC,KAAKC,YAAAA,MAAa;AACtE,QAAIR,QAAQS,KAAKC,aAAaC,QAAQJ,GAAAA,KAAQ,OAAA,GAAU;AACtDG,mBAAaE,QAAQL,KAAKC,YAAAA;IAC5B;EACF,CAAA;AACF;AAEO,IAAMK,mBAAmB,MAAA;AAC9BV,sBAAAA;AAEA,QAAMW,QAAQ,IAAIC,kBAAmCb,aAAa;IAChEc,cAAc;IACdC,2BAA2B;IAC3BC,2BAA2BC;IAC3BC,eAAe;IACfC,YAAY;IACZC,kBAAkBH;IAClBI,YAAYJ;IACZK,gBAAgB;IAChBC,eAAeN;IACfO,iBAAiBP;IACjBQ,aAAa;IACbC,QAAQ,CAAA;IACRC,eAAeV;IACfW,YAAY;IACZC,cAAc;IACdC,O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KoB;IAC3B;IACA,IAAIjB,iBAAiB;AACnB,aAAOxB,MAAMmC,OAAOX;IACtB;EACF,CAAA;AAEA,SAAO;IACLkB,YAAYC,iBAAiBC,WAAW5C,MAAMmC,QAAQ,MAAMnC,MAAM6C,MAAK,CAAA;IACvEH,YAAYI,aAAaC,QAAQhB,MAAAA;;AAErC;AAEA,IAAA,gBAAehC;",
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes } from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { live } from '@dxos/live-object';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { type SidebarState } from '@dxos/react-ui';\n\nimport { DECK_PLUGIN } from '../meta';\nimport { type DeckPluginState, type DeckState, defaultDeck, getMode } from '../types';\n\nimport { DeckCapabilities } from './capabilities';\n\nconst boolean = /true|false/;\n\n// TODO(thure, 18 Feb 2025): Remove after the next release.\n\nconst migrateSidebarStateDefaults = {\n [`${DECK_PLUGIN}/complementary-sidebar-state`]: 'expanded',\n [`${DECK_PLUGIN}/sidebar-state`]: 'collapsed',\n};\n\nconst migrateSidebarState = () => {\n Object.entries(migrateSidebarStateDefaults).forEach(([key, defaultValue]) => {\n if (boolean.test(localStorage.getItem(key) ?? 'never')) {\n localStorage.setItem(key, defaultValue);\n }\n });\n};\n\nexport const DeckStateFactory = () => {\n migrateSidebarState();\n\n const state = new LocalStorageStore<DeckPluginState>(DECK_PLUGIN, {\n sidebarState: 'expanded',\n complementarySidebarState: 'collapsed',\n complementarySidebarPanel: undefined,\n dialogContent: null,\n dialogOpen: false,\n dialogBlockAlign: undefined,\n dialogType: undefined,\n popoverContent: null,\n popoverAnchor: undefined,\n popoverAnchorId: undefined,\n popoverOpen: false,\n toasts: [],\n currentUndoId: undefined,\n activeDeck: 'default',\n previousDeck: 'default',\n decks: {\n default: { ...defaultDeck },\n },\n get deck() {\n const deck = this.decks[this.activeDeck];\n invariant(deck, `Deck not found: ${this.activeDeck}`);\n return deck;\n },\n previousMode: {},\n scrollIntoView: undefined,\n });\n\n state\n .prop({ key: 'sidebarState', type: LocalStorageStore.enum<SidebarState>() })\n .prop({ key: 'complementarySidebarState', type: LocalStorageStore.enum<SidebarState>() })\n .prop({ key: 'complementarySidebarPanel', type: LocalStorageStore.string({ allowUndefined: true }) })\n .prop({ key: 'decks', type: LocalStorageStore.json<Record<string, DeckState>>() })\n .prop({ key: 'activeDeck', type: LocalStorageStore.string() })\n .prop({ key: 'previousDeck', type: LocalStorageStore.string() });\n\n const layout = live<Capabilities.Layout>({\n get mode() {\n return getMode(state.values.deck);\n },\n get dialogOpen() {\n return state.values.dialogOpen;\n },\n get sidebarOpen() {\n return state.values.sidebarState === 'expanded';\n },\n get complementarySidebarOpen() {\n return state.values.complementarySidebarState === 'expanded';\n },\n get workspace() {\n return state.values.activeDeck;\n },\n get active() {\n return state.values.deck.solo ? [state.values.deck.solo] : state.values.deck.active;\n },\n get inactive() {\n return state.values.deck.inactive;\n },\n get scrollIntoView() {\n return state.values.scrollIntoView;\n },\n });\n\n return [\n contributes(DeckCapabilities.DeckState, state.values, () => state.close()),\n contributes(Capabilities.Layout, layout),\n ];\n};\n\nexport default DeckStateFactory;\n"],
5
+ "mappings": ";;;;;;;;;;;;AAIA,SAASA,cAAcC,mBAAmB;AAC1C,SAASC,iBAAiB;AAC1B,SAASC,YAAY;AACrB,SAASC,yBAAyB;;AAQlC,IAAMC,UAAU;AAIhB,IAAMC,8BAA8B;EAClC,CAAC,GAAGC,WAAAA,8BAAyC,GAAG;EAChD,CAAC,GAAGA,WAAAA,gBAA2B,GAAG;AACpC;AAEA,IAAMC,sBAAsB,MAAA;AAC1BC,SAAOC,QAAQJ,2BAAAA,EAA6BK,QAAQ,CAAC,CAACC,KAAKC,YAAAA,MAAa;AACtE,QAAIR,QAAQS,KAAKC,aAAaC,QAAQJ,GAAAA,KAAQ,OAAA,GAAU;AACtDG,mBAAaE,QAAQL,KAAKC,YAAAA;IAC5B;EACF,CAAA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iBAAiB;IACvC;IACA,IAAImC,2BAA2B;AAC7B,aAAOrC,MAAMmC,OAAOhC,8BAA8B;IACpD;IACA,IAAImC,YAAY;AACd,aAAOtC,MAAMmC,OAAOnB;IACtB;IACA,IAAIuB,SAAS;AACX,aAAOvC,MAAMmC,OAAOd,KAAKmB,OAAO;QAACxC,MAAMmC,OAAOd,KAAKmB;UAAQxC,MAAMmC,OAAOd,KAAKkB;IAC/E;IACA,IAAIE,WAAW;AACb,aAAOzC,MAAMmC,OAAOd,KAAKoB;IAC3B;IACA,IAAIjB,iBAAiB;AACnB,aAAOxB,MAAMmC,OAAOX;IACtB;EACF,CAAA;AAEA,SAAO;IACLkB,YAAYC,iBAAiBC,WAAW5C,MAAMmC,QAAQ,MAAMnC,MAAM6C,MAAK,CAAA;IACvEH,YAAYI,aAAaC,QAAQhB,MAAAA;;AAErC;AAEA,IAAA,gBAAehC;",
6
6
  "names": ["Capabilities", "contributes", "invariant", "live", "LocalStorageStore", "boolean", "migrateSidebarStateDefaults", "DECK_PLUGIN", "migrateSidebarState", "Object", "entries", "forEach", "key", "defaultValue", "test", "localStorage", "getItem", "setItem", "DeckStateFactory", "state", "LocalStorageStore", "sidebarState", "complementarySidebarState", "complementarySidebarPanel", "undefined", "dialogContent", "dialogOpen", "dialogBlockAlign", "dialogType", "popoverContent", "popoverAnchor", "popoverAnchorId", "popoverOpen", "toasts", "currentUndoId", "activeDeck", "previousDeck", "decks", "default", "defaultDeck", "deck", "invariant", "previousMode", "scrollIntoView", "prop", "type", "enum", "string", "allowUndefined", "json", "layout", "live", "mode", "getMode", "values", "sidebarOpen", "complementarySidebarOpen", "workspace", "active", "solo", "inactive", "contributes", "DeckCapabilities", "DeckState", "close", "Capabilities", "Layout"]
7
7
  }