@dxos/plugin-deck 0.7.5-main.9d2a38b → 0.7.5-main.b19bfc8

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 (233) hide show
  1. package/dist/lib/browser/{app-graph-builder-67VRUD5K.mjs → app-graph-builder-IYHAGFA3.mjs} +61 -31
  2. package/dist/lib/browser/app-graph-builder-IYHAGFA3.mjs.map +7 -0
  3. package/dist/lib/browser/{check-app-scheme-GEX6W2R5.mjs → check-app-scheme-S3EYUPMF.mjs} +3 -3
  4. package/dist/lib/browser/{check-app-scheme-GEX6W2R5.mjs.map → check-app-scheme-S3EYUPMF.mjs.map} +2 -2
  5. package/dist/lib/browser/{chunk-5VFDMW5M.mjs → chunk-22AQ5IVX.mjs} +2 -2
  6. package/dist/lib/browser/chunk-22AQ5IVX.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-CYE6QZBQ.mjs +128 -0
  8. package/dist/lib/browser/chunk-CYE6QZBQ.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-DIM5INBX.mjs +24 -0
  10. package/dist/lib/browser/chunk-DIM5INBX.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-DIXE74SK.mjs +1097 -0
  12. package/dist/lib/browser/chunk-DIXE74SK.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-KANJBSIX.mjs +97 -0
  14. package/dist/lib/browser/chunk-KANJBSIX.mjs.map +7 -0
  15. package/dist/lib/browser/{chunk-JQJ5UWVB.mjs → chunk-N7TEPFVR.mjs} +3 -2
  16. package/dist/lib/browser/{chunk-JQJ5UWVB.mjs.map → chunk-N7TEPFVR.mjs.map} +3 -3
  17. package/dist/lib/browser/index.mjs +45 -78
  18. package/dist/lib/browser/index.mjs.map +4 -4
  19. package/dist/lib/browser/intent-resolver-MWUADUNI.mjs +488 -0
  20. package/dist/lib/browser/intent-resolver-MWUADUNI.mjs.map +7 -0
  21. package/dist/lib/browser/meta.json +1 -1
  22. package/dist/lib/browser/{react-root-UL7ZDRVZ.mjs → react-root-IELFERPV.mjs} +12 -17
  23. package/dist/lib/browser/react-root-IELFERPV.mjs.map +7 -0
  24. package/dist/lib/browser/react-surface-WL45R43W.mjs +39 -0
  25. package/dist/lib/browser/react-surface-WL45R43W.mjs.map +7 -0
  26. package/dist/lib/browser/{settings-FNWW6WIJ.mjs → settings-YONG3QB7.mjs} +6 -7
  27. package/dist/lib/browser/settings-YONG3QB7.mjs.map +7 -0
  28. package/dist/lib/browser/state-MZZL5S2D.mjs +124 -0
  29. package/dist/lib/browser/state-MZZL5S2D.mjs.map +7 -0
  30. package/dist/lib/browser/tools-5LDJNU56.mjs +51 -0
  31. package/dist/lib/browser/tools-5LDJNU56.mjs.map +7 -0
  32. package/dist/lib/browser/types.mjs +16 -4
  33. package/dist/lib/browser/url-handler-MVHTKUYA.mjs +72 -0
  34. package/dist/lib/browser/url-handler-MVHTKUYA.mjs.map +7 -0
  35. package/dist/types/src/DeckPlugin.d.ts.map +1 -1
  36. package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
  37. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  38. package/dist/types/src/capabilities/capabilities.d.ts +137 -8
  39. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  40. package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -0
  41. package/dist/types/src/capabilities/index.d.ts +188 -3
  42. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  43. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
  44. package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
  45. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  46. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  47. package/dist/types/src/capabilities/state.d.ts +79 -0
  48. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  49. package/dist/types/src/capabilities/tools.d.ts +10 -0
  50. package/dist/types/src/capabilities/tools.d.ts.map +1 -0
  51. package/dist/types/src/capabilities/url-handler.d.ts.map +1 -0
  52. package/dist/types/src/components/DeckLayout/ActiveNode.d.ts +1 -2
  53. package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +1 -1
  54. package/dist/types/src/components/DeckLayout/Banner.d.ts +1 -2
  55. package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
  56. package/dist/types/src/components/DeckLayout/ComplementarySidebar.d.ts +1 -4
  57. package/dist/types/src/components/DeckLayout/ComplementarySidebar.d.ts.map +1 -1
  58. package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts +1 -2
  59. package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +1 -1
  60. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +2 -7
  61. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
  62. package/dist/types/src/components/DeckLayout/Fallback.d.ts +1 -2
  63. package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +1 -1
  64. package/dist/types/src/components/DeckLayout/Fullscreen.d.ts +1 -2
  65. package/dist/types/src/components/DeckLayout/Fullscreen.d.ts.map +1 -1
  66. package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts +3 -3
  67. package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts.map +1 -1
  68. package/dist/types/src/components/DeckLayout/Plank.d.ts +8 -6
  69. package/dist/types/src/components/DeckLayout/Plank.d.ts.map +1 -1
  70. package/dist/types/src/components/DeckLayout/PlankControls.d.ts +2 -2
  71. package/dist/types/src/components/DeckLayout/PlankControls.d.ts.map +1 -1
  72. package/dist/types/src/components/DeckLayout/PlankError.d.ts +6 -6
  73. package/dist/types/src/components/DeckLayout/PlankError.d.ts.map +1 -1
  74. package/dist/types/src/components/DeckLayout/PlankLoading.d.ts +1 -2
  75. package/dist/types/src/components/DeckLayout/PlankLoading.d.ts.map +1 -1
  76. package/dist/types/src/components/DeckLayout/Sidebar.d.ts +1 -2
  77. package/dist/types/src/components/DeckLayout/Sidebar.d.ts.map +1 -1
  78. package/dist/types/src/components/DeckLayout/SidebarButton.d.ts +6 -5
  79. package/dist/types/src/components/DeckLayout/SidebarButton.d.ts.map +1 -1
  80. package/dist/types/src/components/DeckLayout/StatusBar.d.ts +1 -2
  81. package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +1 -1
  82. package/dist/types/src/components/DeckLayout/Toast.d.ts +2 -3
  83. package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
  84. package/dist/types/src/components/DeckLayout/Topbar.d.ts +1 -2
  85. package/dist/types/src/components/DeckLayout/Topbar.d.ts.map +1 -1
  86. package/dist/types/src/components/LayoutSettings.d.ts +1 -2
  87. package/dist/types/src/components/LayoutSettings.d.ts.map +1 -1
  88. package/dist/types/src/components/fragments.d.ts +2 -0
  89. package/dist/types/src/components/fragments.d.ts.map +1 -1
  90. package/dist/types/src/components/index.d.ts +0 -2
  91. package/dist/types/src/components/index.d.ts.map +1 -1
  92. package/dist/types/src/events.d.ts +1 -0
  93. package/dist/types/src/events.d.ts.map +1 -1
  94. package/dist/types/src/hooks/useMainSize.d.ts +2 -2
  95. package/dist/types/src/hooks/useNode.d.ts.map +1 -1
  96. package/dist/types/src/layout.d.ts +5 -19
  97. package/dist/types/src/layout.d.ts.map +1 -1
  98. package/dist/types/src/meta.d.ts +1 -0
  99. package/dist/types/src/meta.d.ts.map +1 -1
  100. package/dist/types/src/translations.d.ts +3 -3
  101. package/dist/types/src/types.d.ts +111 -2
  102. package/dist/types/src/types.d.ts.map +1 -1
  103. package/dist/types/src/util/index.d.ts +3 -1
  104. package/dist/types/src/util/index.d.ts.map +1 -1
  105. package/dist/types/src/util/layoutAppliesTopbar.d.ts +2 -0
  106. package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -0
  107. package/dist/types/src/util/set-active.d.ts +9 -0
  108. package/dist/types/src/util/set-active.d.ts.map +1 -0
  109. package/dist/types/src/util/useHoistStatusbar.d.ts.map +1 -1
  110. package/package.json +32 -31
  111. package/src/DeckPlugin.ts +23 -59
  112. package/src/capabilities/{layout/app-graph-builder.ts → app-graph-builder.ts} +40 -28
  113. package/src/capabilities/capabilities.ts +5 -7
  114. package/src/capabilities/{navigation/check-app-scheme.ts → check-app-scheme.ts} +2 -2
  115. package/src/capabilities/index.ts +12 -3
  116. package/src/capabilities/intent-resolver.ts +368 -0
  117. package/src/capabilities/{layout/react-root.tsx → react-root.tsx} +8 -14
  118. package/src/capabilities/react-surface.tsx +31 -0
  119. package/src/capabilities/{settings/settings.ts → settings.ts} +4 -5
  120. package/src/capabilities/state.ts +107 -0
  121. package/src/capabilities/tools.ts +61 -0
  122. package/src/capabilities/url-handler.ts +65 -0
  123. package/src/components/DeckLayout/ActiveNode.tsx +2 -3
  124. package/src/components/DeckLayout/ComplementarySidebar.tsx +137 -76
  125. package/src/components/DeckLayout/ContentEmpty.tsx +7 -10
  126. package/src/components/DeckLayout/DeckLayout.tsx +141 -84
  127. package/src/components/DeckLayout/Fullscreen.tsx +2 -3
  128. package/src/components/DeckLayout/NodePlankHeading.tsx +57 -65
  129. package/src/components/DeckLayout/Plank.tsx +33 -41
  130. package/src/components/DeckLayout/PlankControls.tsx +12 -11
  131. package/src/components/DeckLayout/PlankError.tsx +6 -5
  132. package/src/components/DeckLayout/Sidebar.tsx +17 -20
  133. package/src/components/DeckLayout/SidebarButton.tsx +25 -31
  134. package/src/components/DeckLayout/StatusBar.tsx +5 -11
  135. package/src/components/DeckLayout/Toast.tsx +2 -2
  136. package/src/components/LayoutSettings.tsx +8 -8
  137. package/src/components/fragments.ts +8 -0
  138. package/src/components/index.ts +0 -2
  139. package/src/events.ts +1 -0
  140. package/src/hooks/useMainSize.ts +3 -3
  141. package/src/hooks/useNode.ts +3 -1
  142. package/src/layout.ts +43 -212
  143. package/src/meta.ts +1 -0
  144. package/src/translations.ts +8 -8
  145. package/src/types.ts +97 -4
  146. package/src/util/index.ts +3 -1
  147. package/src/util/layoutAppliesTopbar.ts +7 -0
  148. package/src/util/set-active.ts +47 -0
  149. package/src/util/useHoistStatusbar.ts +13 -8
  150. package/dist/lib/browser/app-graph-builder-67VRUD5K.mjs.map +0 -7
  151. package/dist/lib/browser/chunk-2M4PXYNB.mjs +0 -1052
  152. package/dist/lib/browser/chunk-2M4PXYNB.mjs.map +0 -7
  153. package/dist/lib/browser/chunk-2PJNBVCY.mjs +0 -39
  154. package/dist/lib/browser/chunk-2PJNBVCY.mjs.map +0 -7
  155. package/dist/lib/browser/chunk-4C2AFTET.mjs +0 -186
  156. package/dist/lib/browser/chunk-4C2AFTET.mjs.map +0 -7
  157. package/dist/lib/browser/chunk-5VFDMW5M.mjs.map +0 -7
  158. package/dist/lib/browser/chunk-KY5WXIXY.mjs +0 -44
  159. package/dist/lib/browser/chunk-KY5WXIXY.mjs.map +0 -7
  160. package/dist/lib/browser/deck-PLCSKPGL.mjs +0 -26
  161. package/dist/lib/browser/deck-PLCSKPGL.mjs.map +0 -7
  162. package/dist/lib/browser/intent-resolver-FVOQSTBX.mjs +0 -152
  163. package/dist/lib/browser/intent-resolver-FVOQSTBX.mjs.map +0 -7
  164. package/dist/lib/browser/intent-resolver-K7GW4A2I.mjs +0 -249
  165. package/dist/lib/browser/intent-resolver-K7GW4A2I.mjs.map +0 -7
  166. package/dist/lib/browser/location-QHRBQBQN.mjs +0 -35
  167. package/dist/lib/browser/location-QHRBQBQN.mjs.map +0 -7
  168. package/dist/lib/browser/react-context-3BDW7W2N.mjs +0 -32
  169. package/dist/lib/browser/react-context-3BDW7W2N.mjs.map +0 -7
  170. package/dist/lib/browser/react-root-UL7ZDRVZ.mjs.map +0 -7
  171. package/dist/lib/browser/react-surface-VPNOGGNN.mjs +0 -28
  172. package/dist/lib/browser/react-surface-VPNOGGNN.mjs.map +0 -7
  173. package/dist/lib/browser/settings-FNWW6WIJ.mjs.map +0 -7
  174. package/dist/lib/browser/state-7I5BD7SE.mjs +0 -34
  175. package/dist/lib/browser/state-7I5BD7SE.mjs.map +0 -7
  176. package/dist/lib/browser/url-handler-Z5B7LD3N.mjs +0 -76
  177. package/dist/lib/browser/url-handler-Z5B7LD3N.mjs.map +0 -7
  178. package/dist/types/src/capabilities/layout/app-graph-builder.d.ts +0 -181
  179. package/dist/types/src/capabilities/layout/app-graph-builder.d.ts.map +0 -1
  180. package/dist/types/src/capabilities/layout/deck.d.ts +0 -4
  181. package/dist/types/src/capabilities/layout/deck.d.ts.map +0 -1
  182. package/dist/types/src/capabilities/layout/index.d.ts +0 -229
  183. package/dist/types/src/capabilities/layout/index.d.ts.map +0 -1
  184. package/dist/types/src/capabilities/layout/intent-resolver.d.ts.map +0 -1
  185. package/dist/types/src/capabilities/layout/react-context.d.ts +0 -8
  186. package/dist/types/src/capabilities/layout/react-context.d.ts.map +0 -1
  187. package/dist/types/src/capabilities/layout/react-root.d.ts.map +0 -1
  188. package/dist/types/src/capabilities/layout/state.d.ts +0 -42
  189. package/dist/types/src/capabilities/layout/state.d.ts.map +0 -1
  190. package/dist/types/src/capabilities/navigation/check-app-scheme.d.ts.map +0 -1
  191. package/dist/types/src/capabilities/navigation/index.d.ts +0 -5
  192. package/dist/types/src/capabilities/navigation/index.d.ts.map +0 -1
  193. package/dist/types/src/capabilities/navigation/intent-resolver.d.ts +0 -4
  194. package/dist/types/src/capabilities/navigation/intent-resolver.d.ts.map +0 -1
  195. package/dist/types/src/capabilities/navigation/location.d.ts +0 -4
  196. package/dist/types/src/capabilities/navigation/location.d.ts.map +0 -1
  197. package/dist/types/src/capabilities/navigation/set-location.d.ts +0 -10
  198. package/dist/types/src/capabilities/navigation/set-location.d.ts.map +0 -1
  199. package/dist/types/src/capabilities/navigation/url-handler.d.ts.map +0 -1
  200. package/dist/types/src/capabilities/settings/index.d.ts +0 -3
  201. package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
  202. package/dist/types/src/capabilities/settings/react-surface.d.ts.map +0 -1
  203. package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
  204. package/dist/types/src/components/DeckContext.d.ts +0 -11
  205. package/dist/types/src/components/DeckContext.d.ts.map +0 -1
  206. package/dist/types/src/components/LayoutContext.d.ts +0 -5
  207. package/dist/types/src/components/LayoutContext.d.ts.map +0 -1
  208. package/dist/types/src/layout.test.d.ts +0 -2
  209. package/dist/types/src/layout.test.d.ts.map +0 -1
  210. package/dist/types/src/util/layout-parts.d.ts +0 -7
  211. package/dist/types/src/util/layout-parts.d.ts.map +0 -1
  212. package/src/capabilities/layout/deck.ts +0 -25
  213. package/src/capabilities/layout/index.ts +0 -12
  214. package/src/capabilities/layout/intent-resolver.ts +0 -128
  215. package/src/capabilities/layout/react-context.tsx +0 -26
  216. package/src/capabilities/layout/state.ts +0 -32
  217. package/src/capabilities/navigation/index.ts +0 -10
  218. package/src/capabilities/navigation/intent-resolver.ts +0 -216
  219. package/src/capabilities/navigation/location.ts +0 -28
  220. package/src/capabilities/navigation/set-location.ts +0 -38
  221. package/src/capabilities/navigation/url-handler.ts +0 -67
  222. package/src/capabilities/settings/index.ts +0 -8
  223. package/src/capabilities/settings/react-surface.tsx +0 -23
  224. package/src/components/DeckContext.ts +0 -19
  225. package/src/components/LayoutContext.ts +0 -12
  226. package/src/layout.test.ts +0 -380
  227. package/src/util/layout-parts.ts +0 -12
  228. /package/dist/types/src/capabilities/{navigation/check-app-scheme.d.ts → check-app-scheme.d.ts} +0 -0
  229. /package/dist/types/src/capabilities/{layout/intent-resolver.d.ts → intent-resolver.d.ts} +0 -0
  230. /package/dist/types/src/capabilities/{layout/react-root.d.ts → react-root.d.ts} +0 -0
  231. /package/dist/types/src/capabilities/{settings/react-surface.d.ts → react-surface.d.ts} +0 -0
  232. /package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +0 -0
  233. /package/dist/types/src/capabilities/{navigation/url-handler.d.ts → url-handler.d.ts} +0 -0
@@ -0,0 +1,488 @@
1
+ import {
2
+ setActive
3
+ } from "./chunk-KANJBSIX.mjs";
4
+ import {
5
+ DeckCapabilities
6
+ } from "./chunk-22AQ5IVX.mjs";
7
+ import {
8
+ DeckAction,
9
+ getMode,
10
+ isLayoutMode
11
+ } from "./chunk-CYE6QZBQ.mjs";
12
+ import {
13
+ DECK_PLUGIN
14
+ } from "./chunk-N7TEPFVR.mjs";
15
+
16
+ // packages/plugins/plugin-deck/src/capabilities/intent-resolver.ts
17
+ import { batch } from "@preact/signals-core";
18
+ import { pipe } from "effect";
19
+ import { Capabilities, createResolver, contributes, IntentAction, LayoutAction, createIntent, chain } from "@dxos/app-framework";
20
+ import { getTypename, S } from "@dxos/echo-schema";
21
+ import { isReactiveObject } from "@dxos/live-object";
22
+ import { log } from "@dxos/log";
23
+ import { AttentionCapabilities } from "@dxos/plugin-attention";
24
+ import { ObservabilityAction } from "@dxos/plugin-observability/types";
25
+ import { isNonNullable } from "@dxos/util";
26
+
27
+ // packages/plugins/plugin-deck/src/layout.ts
28
+ import { produce } from "immer";
29
+ var openEntry = (deck, entryId, options) => {
30
+ return produce(deck, (draft) => {
31
+ if (draft.find((id) => id === entryId)) {
32
+ return;
33
+ }
34
+ const key = options?.key;
35
+ const plankPositioning = options?.positioning ?? "start";
36
+ const pivotId = options?.pivotId;
37
+ if (key) {
38
+ const index = draft.findIndex((id) => id.split("+")[0] === key);
39
+ if (index !== -1) {
40
+ draft.splice(index, 1, entryId);
41
+ return;
42
+ }
43
+ }
44
+ if (pivotId) {
45
+ const pivotIndex = draft.findIndex((id) => id === pivotId);
46
+ if (pivotIndex !== -1) {
47
+ if (plankPositioning === "start") {
48
+ draft.splice(pivotIndex, 0, entryId);
49
+ } else {
50
+ draft.splice(pivotIndex + 1, 0, entryId);
51
+ }
52
+ return;
53
+ }
54
+ }
55
+ if (plankPositioning === "start") {
56
+ draft.unshift(entryId);
57
+ } else {
58
+ draft.push(entryId);
59
+ }
60
+ });
61
+ };
62
+ var closeEntry = (deck, entryId) => {
63
+ return produce(deck, (draft) => {
64
+ const index = draft.findIndex((id) => id === entryId);
65
+ if (index !== -1) {
66
+ draft.splice(index, 1);
67
+ }
68
+ });
69
+ };
70
+ var incrementPlank = (deck, adjustment) => {
71
+ return produce(deck, (draft) => {
72
+ const index = draft.findIndex((id) => id === adjustment.id);
73
+ if (index === -1 || adjustment.type === "increment-start" && index === 0 || adjustment.type === "increment-end" && index === draft.length - 1) {
74
+ return;
75
+ }
76
+ if (adjustment.type === "increment-start") {
77
+ [draft[index - 1], draft[index]] = [
78
+ draft[index],
79
+ draft[index - 1]
80
+ ];
81
+ } else if (adjustment.type === "increment-end") {
82
+ [draft[index], draft[index + 1]] = [
83
+ draft[index + 1],
84
+ draft[index]
85
+ ];
86
+ }
87
+ });
88
+ };
89
+
90
+ // packages/plugins/plugin-deck/src/capabilities/intent-resolver.ts
91
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-deck/src/capabilities/intent-resolver.ts";
92
+ var intent_resolver_default = (context) => contributes(Capabilities.IntentResolver, [
93
+ createResolver({
94
+ intent: IntentAction.ShowUndo,
95
+ resolve: (data) => {
96
+ const layout = context.requestCapability(DeckCapabilities.MutableDeckState);
97
+ const { undoPromise: undo } = context.requestCapability(Capabilities.IntentDispatcher);
98
+ if (layout.currentUndoId) {
99
+ layout.toasts = layout.toasts.filter((toast) => toast.id !== layout.currentUndoId);
100
+ }
101
+ layout.currentUndoId = `${IntentAction.ShowUndo._tag}-${Date.now()}`;
102
+ layout.toasts = [
103
+ ...layout.toasts,
104
+ {
105
+ id: layout.currentUndoId,
106
+ title: data.message ?? [
107
+ "undo available label",
108
+ {
109
+ ns: DECK_PLUGIN
110
+ }
111
+ ],
112
+ duration: 1e4,
113
+ actionLabel: [
114
+ "undo action label",
115
+ {
116
+ ns: DECK_PLUGIN
117
+ }
118
+ ],
119
+ actionAlt: [
120
+ "undo action alt",
121
+ {
122
+ ns: DECK_PLUGIN
123
+ }
124
+ ],
125
+ closeLabel: [
126
+ "undo close label",
127
+ {
128
+ ns: DECK_PLUGIN
129
+ }
130
+ ],
131
+ onAction: () => undo()
132
+ }
133
+ ];
134
+ }
135
+ }),
136
+ createResolver({
137
+ intent: LayoutAction.UpdateLayout,
138
+ // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.UpdateSidebar.fields.input)`
139
+ // but the filter is not being applied correctly.
140
+ filter: (data) => S.is(LayoutAction.UpdateSidebar.fields.input)(data),
141
+ resolve: ({ options }) => {
142
+ const layout = context.requestCapability(DeckCapabilities.MutableDeckState);
143
+ const next = options?.state ?? layout.sidebarState;
144
+ if (next !== layout.sidebarState) {
145
+ layout.sidebarState = next;
146
+ }
147
+ }
148
+ }),
149
+ createResolver({
150
+ intent: LayoutAction.UpdateLayout,
151
+ // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.UpdateComplementary.fields.input)`
152
+ // but the filter is not being applied correctly.
153
+ filter: (data) => S.is(LayoutAction.UpdateComplementary.fields.input)(data),
154
+ resolve: ({ subject, options }) => {
155
+ const layout = context.requestCapability(DeckCapabilities.MutableDeckState);
156
+ if (layout.complementarySidebarPanel !== subject) {
157
+ layout.complementarySidebarPanel = subject;
158
+ }
159
+ const next = subject ? "expanded" : options?.state ?? layout.complementarySidebarState;
160
+ if (next !== layout.complementarySidebarState) {
161
+ layout.complementarySidebarState = next;
162
+ }
163
+ }
164
+ }),
165
+ createResolver({
166
+ intent: LayoutAction.UpdateLayout,
167
+ // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.UpdateDialog.fields.input)`
168
+ // but the filter is not being applied correctly.
169
+ filter: (data) => S.is(LayoutAction.UpdateDialog.fields.input)(data),
170
+ resolve: ({ subject, options }) => {
171
+ const layout = context.requestCapability(DeckCapabilities.MutableDeckState);
172
+ layout.dialogOpen = options.state ?? Boolean(subject);
173
+ layout.dialogContent = subject ? {
174
+ component: subject,
175
+ props: options.props
176
+ } : null;
177
+ layout.dialogBlockAlign = options.blockAlign ?? "center";
178
+ layout.dialogType = options.type ?? "default";
179
+ }
180
+ }),
181
+ createResolver({
182
+ intent: LayoutAction.UpdateLayout,
183
+ // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.UpdatePopover.fields.input)`
184
+ // but the filter is not being applied correctly.
185
+ filter: (data) => S.is(LayoutAction.UpdatePopover.fields.input)(data),
186
+ resolve: ({ subject, options }) => {
187
+ const layout = context.requestCapability(DeckCapabilities.MutableDeckState);
188
+ layout.popoverOpen = options.state ?? Boolean(subject);
189
+ layout.popoverContent = subject ? {
190
+ component: subject,
191
+ props: options.props
192
+ } : null;
193
+ layout.popoverAnchorId = options.anchorId;
194
+ layout.popoverSide = options.side;
195
+ }
196
+ }),
197
+ createResolver({
198
+ intent: LayoutAction.UpdateLayout,
199
+ // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.AddToast.fields.input)`
200
+ // but the filter is not being applied correctly.
201
+ filter: (data) => S.is(LayoutAction.AddToast.fields.input)(data),
202
+ resolve: ({ subject }) => {
203
+ const layout = context.requestCapability(DeckCapabilities.MutableDeckState);
204
+ layout.toasts.push(subject);
205
+ }
206
+ }),
207
+ createResolver({
208
+ intent: LayoutAction.UpdateLayout,
209
+ // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.SetLayoutMode.fields.input)`
210
+ // but the filter is not being applied correctly.
211
+ filter: (data) => {
212
+ if (!S.is(LayoutAction.SetLayoutMode.fields.input)(data)) {
213
+ return false;
214
+ }
215
+ if ("mode" in data.options) {
216
+ return isLayoutMode(data.options.mode);
217
+ }
218
+ return true;
219
+ },
220
+ resolve: ({ subject, options }) => {
221
+ const state = context.requestCapability(DeckCapabilities.MutableDeckState);
222
+ const setMode = (mode) => {
223
+ const deck = state.deck;
224
+ const current = deck.solo ? [
225
+ deck.solo
226
+ ] : deck.active;
227
+ const next = (mode !== "deck" ? [
228
+ subject ?? deck.solo ?? deck.active[0]
229
+ ] : [
230
+ ...deck.active,
231
+ deck.solo
232
+ ]).filter(isNonNullable);
233
+ const removed = current.filter((id) => !next.includes(id));
234
+ const closed = Array.from(/* @__PURE__ */ new Set([
235
+ ...deck.inactive.filter((id) => !next.includes(id)),
236
+ ...removed
237
+ ]));
238
+ deck.inactive = closed;
239
+ if (mode !== "deck" && next[0]) {
240
+ deck.solo = next[0];
241
+ } else if (mode === "deck" && deck.solo) {
242
+ deck.solo = void 0;
243
+ deck.initialized = true;
244
+ }
245
+ if (mode === "fullscreen" && !deck.fullscreen) {
246
+ deck.fullscreen = true;
247
+ } else if (mode !== "fullscreen" && deck.fullscreen) {
248
+ deck.fullscreen = false;
249
+ }
250
+ };
251
+ return batch(() => {
252
+ if ("mode" in options) {
253
+ const current = getMode(state.deck);
254
+ if (current !== options.mode) {
255
+ state.previousMode[state.activeDeck] = current;
256
+ }
257
+ setMode(options.mode);
258
+ } else if ("revert" in options) {
259
+ const last = state.previousMode[state.activeDeck];
260
+ setMode(last ?? "solo");
261
+ } else {
262
+ log.warn("Invalid layout mode", options, {
263
+ F: __dxlog_file,
264
+ L: 185,
265
+ S: void 0,
266
+ C: (f, a) => f(...a)
267
+ });
268
+ }
269
+ });
270
+ }
271
+ }),
272
+ createResolver({
273
+ intent: LayoutAction.UpdateLayout,
274
+ filter: (data) => S.is(LayoutAction.SwitchWorkspace.fields.input)(data),
275
+ resolve: ({ subject }) => {
276
+ const state = context.requestCapability(DeckCapabilities.MutableDeckState);
277
+ batch(() => {
278
+ if (!state.activeDeck.startsWith("!")) {
279
+ state.previousDeck = state.activeDeck;
280
+ }
281
+ state.activeDeck = subject;
282
+ if (!state.decks[subject]) {
283
+ state.decks[subject] = {
284
+ initialized: false,
285
+ active: [],
286
+ inactive: [],
287
+ fullscreen: false,
288
+ plankSizing: {}
289
+ };
290
+ }
291
+ });
292
+ const first = state.deck.solo ? state.deck.solo : state.deck.active[0];
293
+ if (first) {
294
+ return {
295
+ intents: [
296
+ createIntent(LayoutAction.ScrollIntoView, {
297
+ part: "current",
298
+ subject: first
299
+ })
300
+ ]
301
+ };
302
+ }
303
+ }
304
+ }),
305
+ createResolver({
306
+ intent: LayoutAction.UpdateLayout,
307
+ filter: (data) => S.is(LayoutAction.RevertWorkspace.fields.input)(data),
308
+ resolve: () => {
309
+ const state = context.requestCapability(DeckCapabilities.MutableDeckState);
310
+ return {
311
+ intents: [
312
+ createIntent(LayoutAction.SwitchWorkspace, {
313
+ part: "workspace",
314
+ subject: state.previousDeck
315
+ })
316
+ ]
317
+ };
318
+ }
319
+ }),
320
+ createResolver({
321
+ intent: LayoutAction.UpdateLayout,
322
+ filter: (data) => S.is(LayoutAction.Open.fields.input)(data),
323
+ resolve: ({ subject, options }) => {
324
+ const { graph } = context.requestCapability(Capabilities.AppGraph);
325
+ const state = context.requestCapability(DeckCapabilities.MutableDeckState);
326
+ const attention = context.requestCapability(AttentionCapabilities.Attention);
327
+ const settings = context.requestCapabilities(Capabilities.SettingsStore)[0]?.getStore(DECK_PLUGIN)?.value;
328
+ const previouslyOpenIds = new Set(state.deck.solo ? [
329
+ state.deck.solo
330
+ ] : state.deck.active);
331
+ batch(() => {
332
+ const next = state.deck.solo ? subject : subject.reduce((acc, entryId) => openEntry(acc, entryId, {
333
+ key: options?.key,
334
+ positioning: options?.positioning ?? settings?.newPlankPositioning,
335
+ pivotId: options?.pivotId
336
+ }), state.deck.active);
337
+ return setActive({
338
+ next,
339
+ state,
340
+ attention
341
+ });
342
+ });
343
+ const ids = state.deck.solo ? [
344
+ state.deck.solo
345
+ ] : state.deck.active;
346
+ const newlyOpen = ids.filter((i) => !previouslyOpenIds.has(i));
347
+ return {
348
+ intents: [
349
+ ...options?.scrollIntoView !== false ? [
350
+ createIntent(LayoutAction.ScrollIntoView, {
351
+ part: "current",
352
+ subject: newlyOpen[0] ?? subject[0]
353
+ })
354
+ ] : [],
355
+ createIntent(LayoutAction.Expose, {
356
+ part: "navigation",
357
+ subject: newlyOpen[0] ?? subject[0]
358
+ }),
359
+ ...newlyOpen.map((id) => {
360
+ const active = graph?.findNode(id)?.data;
361
+ const typename = isReactiveObject(active) ? getTypename(active) : void 0;
362
+ return createIntent(ObservabilityAction.SendEvent, {
363
+ name: "navigation.activate",
364
+ properties: {
365
+ id,
366
+ typename
367
+ }
368
+ });
369
+ })
370
+ ]
371
+ };
372
+ }
373
+ }),
374
+ createResolver({
375
+ intent: LayoutAction.UpdateLayout,
376
+ filter: (data) => S.is(LayoutAction.Close.fields.input)(data),
377
+ resolve: ({ subject }) => {
378
+ const state = context.requestCapability(DeckCapabilities.MutableDeckState);
379
+ const attention = context.requestCapability(AttentionCapabilities.Attention);
380
+ const active = state.deck.solo ? [
381
+ state.deck.solo
382
+ ] : state.deck.active;
383
+ const next = subject.reduce((acc, id) => closeEntry(acc, id), active);
384
+ const toAttend = setActive({
385
+ next,
386
+ state,
387
+ attention
388
+ });
389
+ return {
390
+ intents: toAttend ? [
391
+ createIntent(LayoutAction.ScrollIntoView, {
392
+ part: "current",
393
+ subject: toAttend
394
+ })
395
+ ] : []
396
+ };
397
+ }
398
+ }),
399
+ createResolver({
400
+ intent: LayoutAction.UpdateLayout,
401
+ filter: (data) => S.is(LayoutAction.Set.fields.input)(data),
402
+ resolve: ({ subject }) => {
403
+ const state = context.requestCapability(DeckCapabilities.MutableDeckState);
404
+ const attention = context.requestCapability(AttentionCapabilities.Attention);
405
+ const toAttend = setActive({
406
+ next: subject,
407
+ state,
408
+ attention
409
+ });
410
+ return {
411
+ intents: toAttend ? [
412
+ createIntent(LayoutAction.ScrollIntoView, {
413
+ part: "current",
414
+ subject: toAttend
415
+ })
416
+ ] : []
417
+ };
418
+ }
419
+ }),
420
+ createResolver({
421
+ intent: LayoutAction.UpdateLayout,
422
+ filter: (data) => S.is(LayoutAction.ScrollIntoView.fields.input)(data),
423
+ resolve: ({ subject }) => {
424
+ const layout = context.requestCapability(DeckCapabilities.MutableDeckState);
425
+ layout.scrollIntoView = subject;
426
+ }
427
+ }),
428
+ createResolver({
429
+ intent: DeckAction.UpdatePlankSize,
430
+ resolve: (data) => {
431
+ const state = context.requestCapability(DeckCapabilities.MutableDeckState);
432
+ state.deck.plankSizing[data.id] = data.size;
433
+ }
434
+ }),
435
+ createResolver({
436
+ intent: DeckAction.Adjust,
437
+ resolve: (adjustment) => {
438
+ const state = context.requestCapability(DeckCapabilities.MutableDeckState);
439
+ const attention = context.requestCapability(AttentionCapabilities.Attention);
440
+ return batch(() => {
441
+ if (adjustment.type === "increment-end" || adjustment.type === "increment-start") {
442
+ setActive({
443
+ next: incrementPlank(state.deck.active, adjustment),
444
+ state,
445
+ attention
446
+ });
447
+ }
448
+ if (adjustment.type === "solo") {
449
+ const entryId = adjustment.id;
450
+ if (!state.deck.solo) {
451
+ return {
452
+ intents: [
453
+ createIntent(LayoutAction.SetLayoutMode, {
454
+ part: "mode",
455
+ subject: entryId,
456
+ options: {
457
+ mode: "solo"
458
+ }
459
+ })
460
+ ]
461
+ };
462
+ } else {
463
+ return {
464
+ intents: [
465
+ // NOTE: The order of these is important.
466
+ pipe(createIntent(LayoutAction.SetLayoutMode, {
467
+ part: "mode",
468
+ options: {
469
+ mode: "deck"
470
+ }
471
+ }), chain(LayoutAction.Open, {
472
+ part: "main",
473
+ subject: [
474
+ entryId
475
+ ]
476
+ }))
477
+ ]
478
+ };
479
+ }
480
+ }
481
+ });
482
+ }
483
+ })
484
+ ]);
485
+ export {
486
+ intent_resolver_default as default
487
+ };
488
+ //# sourceMappingURL=intent-resolver-MWUADUNI.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/intent-resolver.ts", "../../../src/layout.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { batch } from '@preact/signals-core';\nimport { pipe } from 'effect';\n\nimport {\n Capabilities,\n createResolver,\n contributes,\n IntentAction,\n LayoutAction,\n type PluginsContext,\n createIntent,\n chain,\n} from '@dxos/app-framework';\nimport { getTypename, S } from '@dxos/echo-schema';\nimport { isReactiveObject } from '@dxos/live-object';\nimport { log } from '@dxos/log';\nimport { AttentionCapabilities } from '@dxos/plugin-attention';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { isNonNullable } from '@dxos/util';\n\nimport { DeckCapabilities } from './capabilities';\nimport { closeEntry, incrementPlank, openEntry } from '../layout';\nimport { DECK_PLUGIN } from '../meta';\nimport { DeckAction, type LayoutMode, type DeckSettingsProps, isLayoutMode, getMode } from '../types';\nimport { setActive } from '../util';\n\nexport default (context: PluginsContext) =>\n contributes(Capabilities.IntentResolver, [\n createResolver({\n intent: IntentAction.ShowUndo,\n resolve: (data) => {\n const layout = context.requestCapability(DeckCapabilities.MutableDeckState);\n const { undoPromise: undo } = context.requestCapability(Capabilities.IntentDispatcher);\n\n // TODO(wittjosiah): Support undoing further back than the last action.\n if (layout.currentUndoId) {\n layout.toasts = layout.toasts.filter((toast) => toast.id !== layout.currentUndoId);\n }\n layout.currentUndoId = `${IntentAction.ShowUndo._tag}-${Date.now()}`;\n layout.toasts = [\n ...layout.toasts,\n {\n id: layout.currentUndoId,\n title: data.message ?? ['undo available label', { ns: DECK_PLUGIN }],\n duration: 10_000,\n actionLabel: ['undo action label', { ns: DECK_PLUGIN }],\n actionAlt: ['undo action alt', { ns: DECK_PLUGIN }],\n closeLabel: ['undo close label', { ns: DECK_PLUGIN }],\n onAction: () => undo(),\n },\n ];\n },\n }),\n createResolver({\n intent: LayoutAction.UpdateLayout,\n // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.UpdateSidebar.fields.input)`\n // but the filter is not being applied correctly.\n filter: (data): data is S.Schema.Type<typeof LayoutAction.UpdateSidebar.fields.input> =>\n S.is(LayoutAction.UpdateSidebar.fields.input)(data),\n resolve: ({ options }) => {\n const layout = context.requestCapability(DeckCapabilities.MutableDeckState);\n const next = options?.state ?? layout.sidebarState;\n if (next !== layout.sidebarState) {\n layout.sidebarState = next;\n }\n },\n }),\n createResolver({\n intent: LayoutAction.UpdateLayout,\n // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.UpdateComplementary.fields.input)`\n // but the filter is not being applied correctly.\n filter: (data): data is S.Schema.Type<typeof LayoutAction.UpdateComplementary.fields.input> =>\n S.is(LayoutAction.UpdateComplementary.fields.input)(data),\n resolve: ({ subject, options }) => {\n const layout = context.requestCapability(DeckCapabilities.MutableDeckState);\n\n if (layout.complementarySidebarPanel !== subject) {\n layout.complementarySidebarPanel = subject;\n }\n\n const next = subject ? 'expanded' : options?.state ?? layout.complementarySidebarState;\n if (next !== layout.complementarySidebarState) {\n layout.complementarySidebarState = next;\n }\n },\n }),\n createResolver({\n intent: LayoutAction.UpdateLayout,\n // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.UpdateDialog.fields.input)`\n // but the filter is not being applied correctly.\n filter: (data): data is S.Schema.Type<typeof LayoutAction.UpdateDialog.fields.input> =>\n S.is(LayoutAction.UpdateDialog.fields.input)(data),\n resolve: ({ subject, options }) => {\n const layout = context.requestCapability(DeckCapabilities.MutableDeckState);\n layout.dialogOpen = options.state ?? Boolean(subject);\n layout.dialogContent = subject ? { component: subject, props: options.props } : null;\n layout.dialogBlockAlign = options.blockAlign ?? 'center';\n layout.dialogType = options.type ?? 'default';\n },\n }),\n createResolver({\n intent: LayoutAction.UpdateLayout,\n // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.UpdatePopover.fields.input)`\n // but the filter is not being applied correctly.\n filter: (data): data is S.Schema.Type<typeof LayoutAction.UpdatePopover.fields.input> =>\n S.is(LayoutAction.UpdatePopover.fields.input)(data),\n resolve: ({ subject, options }) => {\n const layout = context.requestCapability(DeckCapabilities.MutableDeckState);\n layout.popoverOpen = options.state ?? Boolean(subject);\n layout.popoverContent = subject ? { component: subject, props: options.props } : null;\n layout.popoverAnchorId = options.anchorId;\n layout.popoverSide = options.side;\n },\n }),\n createResolver({\n intent: LayoutAction.UpdateLayout,\n // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.AddToast.fields.input)`\n // but the filter is not being applied correctly.\n filter: (data): data is S.Schema.Type<typeof LayoutAction.AddToast.fields.input> =>\n S.is(LayoutAction.AddToast.fields.input)(data),\n resolve: ({ subject }) => {\n const layout = context.requestCapability(DeckCapabilities.MutableDeckState);\n layout.toasts.push(subject);\n },\n }),\n createResolver({\n intent: LayoutAction.UpdateLayout,\n // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.SetLayoutMode.fields.input)`\n // but the filter is not being applied correctly.\n filter: (data): data is S.Schema.Type<typeof LayoutAction.SetLayoutMode.fields.input> => {\n if (!S.is(LayoutAction.SetLayoutMode.fields.input)(data)) {\n return false;\n }\n\n if ('mode' in data.options) {\n return isLayoutMode(data.options.mode);\n }\n\n return true;\n },\n resolve: ({ subject, options }) => {\n const state = context.requestCapability(DeckCapabilities.MutableDeckState);\n\n const setMode = (mode: LayoutMode) => {\n const deck = state.deck;\n const current = deck.solo ? [deck.solo] : deck.active;\n // When un-soloing, the solo entry is added to the deck.\n const next = (\n mode !== 'deck' ? [subject ?? deck.solo ?? deck.active[0]] : [...deck.active, deck.solo]\n ).filter(isNonNullable);\n\n const removed = current.filter((id) => !next.includes(id));\n const closed = Array.from(new Set([...deck.inactive.filter((id) => !next.includes(id)), ...removed]));\n deck.inactive = closed;\n\n if (mode !== 'deck' && next[0]) {\n deck.solo = next[0];\n } else if (mode === 'deck' && deck.solo) {\n deck.solo = undefined;\n deck.initialized = true;\n }\n\n if (mode === 'fullscreen' && !deck.fullscreen) {\n deck.fullscreen = true;\n } else if (mode !== 'fullscreen' && deck.fullscreen) {\n deck.fullscreen = false;\n }\n };\n\n return batch(() => {\n if ('mode' in options) {\n const current = getMode(state.deck);\n if (current !== options.mode) {\n state.previousMode[state.activeDeck] = current;\n }\n setMode(options.mode as LayoutMode);\n } else if ('revert' in options) {\n const last = state.previousMode[state.activeDeck];\n setMode(last ?? 'solo');\n } else {\n log.warn('Invalid layout mode', options);\n }\n });\n },\n }),\n createResolver({\n intent: LayoutAction.UpdateLayout,\n filter: (data): data is S.Schema.Type<typeof LayoutAction.SwitchWorkspace.fields.input> =>\n S.is(LayoutAction.SwitchWorkspace.fields.input)(data),\n resolve: ({ subject }) => {\n const state = context.requestCapability(DeckCapabilities.MutableDeckState);\n batch(() => {\n // TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.\n // Ideally this should be worked into the data model in a generic way.\n if (!state.activeDeck.startsWith('!')) {\n state.previousDeck = state.activeDeck;\n }\n state.activeDeck = subject;\n if (!state.decks[subject]) {\n state.decks[subject] = { initialized: false, active: [], inactive: [], fullscreen: false, plankSizing: {} };\n }\n });\n\n const first = state.deck.solo ? state.deck.solo : state.deck.active[0];\n if (first) {\n return {\n intents: [createIntent(LayoutAction.ScrollIntoView, { part: 'current', subject: first })],\n };\n }\n },\n }),\n createResolver({\n intent: LayoutAction.UpdateLayout,\n filter: (data): data is S.Schema.Type<typeof LayoutAction.RevertWorkspace.fields.input> =>\n S.is(LayoutAction.RevertWorkspace.fields.input)(data),\n resolve: () => {\n const state = context.requestCapability(DeckCapabilities.MutableDeckState);\n return {\n intents: [createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: state.previousDeck })],\n };\n },\n }),\n createResolver({\n intent: LayoutAction.UpdateLayout,\n filter: (data): data is S.Schema.Type<typeof LayoutAction.Open.fields.input> =>\n S.is(LayoutAction.Open.fields.input)(data),\n resolve: ({ subject, options }) => {\n const { graph } = context.requestCapability(Capabilities.AppGraph);\n const state = context.requestCapability(DeckCapabilities.MutableDeckState);\n const attention = context.requestCapability(AttentionCapabilities.Attention);\n const settings = context\n .requestCapabilities(Capabilities.SettingsStore)[0]\n ?.getStore<DeckSettingsProps>(DECK_PLUGIN)?.value;\n\n const previouslyOpenIds = new Set<string>(state.deck.solo ? [state.deck.solo] : state.deck.active);\n batch(() => {\n const next = state.deck.solo\n ? (subject as string[])\n : subject.reduce(\n (acc, entryId) =>\n openEntry(acc, entryId, {\n key: options?.key,\n positioning: options?.positioning ?? settings?.newPlankPositioning,\n pivotId: options?.pivotId,\n }),\n state.deck.active,\n );\n\n return setActive({ next, state, attention });\n });\n\n const ids = state.deck.solo ? [state.deck.solo] : state.deck.active;\n const newlyOpen = ids.filter((i) => !previouslyOpenIds.has(i));\n\n return {\n intents: [\n ...(options?.scrollIntoView !== false\n ? [createIntent(LayoutAction.ScrollIntoView, { part: 'current', subject: newlyOpen[0] ?? subject[0] })]\n : []),\n createIntent(LayoutAction.Expose, { part: 'navigation', subject: newlyOpen[0] ?? subject[0] }),\n ...newlyOpen.map((id) => {\n const active = graph?.findNode(id)?.data;\n const typename = isReactiveObject(active) ? getTypename(active) : undefined;\n return createIntent(ObservabilityAction.SendEvent, {\n name: 'navigation.activate',\n properties: {\n id,\n typename,\n },\n });\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: LayoutAction.UpdateLayout,\n filter: (data): data is S.Schema.Type<typeof LayoutAction.Close.fields.input> =>\n S.is(LayoutAction.Close.fields.input)(data),\n resolve: ({ subject }) => {\n const state = context.requestCapability(DeckCapabilities.MutableDeckState);\n const attention = context.requestCapability(AttentionCapabilities.Attention);\n const active = state.deck.solo ? [state.deck.solo] : state.deck.active;\n const next = subject.reduce((acc, id) => closeEntry(acc, id), active);\n const toAttend = setActive({ next, state, attention });\n return {\n intents: toAttend ? [createIntent(LayoutAction.ScrollIntoView, { part: 'current', subject: toAttend })] : [],\n };\n },\n }),\n createResolver({\n intent: LayoutAction.UpdateLayout,\n filter: (data): data is S.Schema.Type<typeof LayoutAction.Set.fields.input> =>\n S.is(LayoutAction.Set.fields.input)(data),\n resolve: ({ subject }) => {\n const state = context.requestCapability(DeckCapabilities.MutableDeckState);\n const attention = context.requestCapability(AttentionCapabilities.Attention);\n const toAttend = setActive({ next: subject as string[], state, attention });\n return {\n intents: toAttend ? [createIntent(LayoutAction.ScrollIntoView, { part: 'current', subject: toAttend })] : [],\n };\n },\n }),\n createResolver({\n intent: LayoutAction.UpdateLayout,\n filter: (data): data is S.Schema.Type<typeof LayoutAction.ScrollIntoView.fields.input> =>\n S.is(LayoutAction.ScrollIntoView.fields.input)(data),\n resolve: ({ subject }) => {\n const layout = context.requestCapability(DeckCapabilities.MutableDeckState);\n layout.scrollIntoView = subject;\n },\n }),\n createResolver({\n intent: DeckAction.UpdatePlankSize,\n resolve: (data) => {\n const state = context.requestCapability(DeckCapabilities.MutableDeckState);\n state.deck.plankSizing[data.id] = data.size;\n },\n }),\n createResolver({\n intent: DeckAction.Adjust,\n resolve: (adjustment) => {\n const state = context.requestCapability(DeckCapabilities.MutableDeckState);\n const attention = context.requestCapability(AttentionCapabilities.Attention);\n\n return batch(() => {\n if (adjustment.type === 'increment-end' || adjustment.type === 'increment-start') {\n setActive({\n next: incrementPlank(state.deck.active, adjustment),\n state,\n attention,\n });\n }\n\n if (adjustment.type === 'solo') {\n const entryId = adjustment.id;\n if (!state.deck.solo) {\n // Solo the entry.\n return {\n intents: [\n createIntent(LayoutAction.SetLayoutMode, {\n part: 'mode',\n subject: entryId,\n options: { mode: 'solo' },\n }),\n ],\n };\n } else {\n // Un-solo the current entry.\n return {\n intents: [\n // NOTE: The order of these is important.\n pipe(\n createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { mode: 'deck' } }),\n chain(LayoutAction.Open, { part: 'main', subject: [entryId] }),\n ),\n ],\n };\n }\n }\n });\n },\n }),\n ]);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { produce } from 'immer';\n\nimport { type DeckAction, type NewPlankPositioning } from './types';\n\ntype OpenLayoutEntryOptions = { key?: string; positioning?: NewPlankPositioning; pivotId?: string };\n\nexport const openEntry = (deck: string[], entryId: string, options?: OpenLayoutEntryOptions): string[] => {\n return produce(deck, (draft) => {\n // Check that the entry is not already in the part\n if (draft.find((id) => id === entryId)) {\n return;\n }\n\n const key = options?.key;\n const plankPositioning = options?.positioning ?? 'start';\n const pivotId = options?.pivotId;\n\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 if (pivotId) {\n const pivotIndex = draft.findIndex((id) => id === pivotId);\n if (pivotIndex !== -1) {\n if (plankPositioning === 'start') {\n draft.splice(pivotIndex, 0, entryId);\n } else {\n draft.splice(pivotIndex + 1, 0, entryId);\n }\n return;\n }\n }\n\n // If no pivot found or provided, fall back to original behavior\n if (plankPositioning === 'start') {\n draft.unshift(entryId);\n } else {\n draft.push(entryId);\n }\n });\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,aAAa;AACtB,SAASC,YAAY;AAErB,SACEC,cACAC,gBACAC,aACAC,cACAC,cAEAC,cACAC,aACK;AACP,SAASC,aAAaC,SAAS;AAC/B,SAASC,wBAAwB;AACjC,SAASC,WAAW;AACpB,SAASC,6BAA6B;AACtC,SAASC,2BAA2B;AACpC,SAASC,qBAAqB;;;AClB9B,SAASC,eAAe;AAMjB,IAAMC,YAAY,CAACC,MAAgBC,SAAiBC,YAAAA;AACzD,SAAOC,QAAQH,MAAM,CAACI,UAAAA;AAEpB,QAAIA,MAAMC,KAAK,CAACC,OAAOA,OAAOL,OAAAA,GAAU;AACtC;IACF;AAEA,UAAMM,MAAML,SAASK;AACrB,UAAMC,mBAAmBN,SAASO,eAAe;AACjD,UAAMC,UAAUR,SAASQ;AAEzB,QAAIH,KAAK;AACP,YAAMI,QAAQP,MAAMQ,UAAU,CAACN,OAAOA,GAAGO,MAAM,GAAA,EAAK,CAAA,MAAON,GAAAA;AAC3D,UAAII,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AC1EH,aAAOwH,iBAAiBpF;IAC1B;EACF,CAAA;EACA1C,eAAe;IACbC,QAAQ2I,WAAWC;IACnBzI,SAAS,CAACC,SAAAA;AACR,YAAMkC,QAAQ3C,QAAQW,kBAAkBC,iBAAiBC,gBAAgB;AACzE8B,YAAM6B,KAAK0B,YAAYzF,KAAKY,EAAE,IAAIZ,KAAKyI;IACzC;EACF,CAAA;EACA9I,eAAe;IACbC,QAAQ2I,WAAWG;IACnB3I,SAAS,CAAC4I,eAAAA;AACR,YAAMzG,QAAQ3C,QAAQW,kBAAkBC,iBAAiBC,gBAAgB;AACzE,YAAM+F,YAAY5G,QAAQW,kBAAkBkG,sBAAsBC,SAAS;AAE3E,aAAOvB,MAAM,MAAA;AACX,YAAI6D,WAAW1F,SAAS,mBAAmB0F,WAAW1F,SAAS,mBAAmB;AAChFmE,oBAAU;YACRnF,MAAM2G,eAAe1G,MAAM6B,KAAKG,QAAQyE,UAAAA;YACxCzG;YACAiE;UACF,CAAA;QACF;AAEA,YAAIwC,WAAW1F,SAAS,QAAQ;AAC9B,gBAAM6D,UAAU6B,WAAW/H;AAC3B,cAAI,CAACsB,MAAM6B,KAAKE,MAAM;AAEpB,mBAAO;cACL0B,SAAS;gBACPC,aAAanE,aAAakC,eAAe;kBACvCmC,MAAM;kBACNzD,SAASyE;kBACT9E,SAAS;oBAAE6B,MAAM;kBAAO;gBAC1B,CAAA;;YAEJ;UACF,OAAO;AAEL,mBAAO;cACL8B,SAAS;;gBAEPkD,KACEjD,aAAanE,aAAakC,eAAe;kBAAEmC,MAAM;kBAAQ9D,SAAS;oBAAE6B,MAAM;kBAAO;gBAAE,CAAA,GACnFiF,MAAMrH,aAAauE,MAAM;kBAAEF,MAAM;kBAAQzD,SAAS;oBAACyE;;gBAAS,CAAA,CAAA;;YAGlE;UACF;QACF;MACF,CAAA;IACF;EACF,CAAA;CACD;",
6
+ "names": ["batch", "pipe", "Capabilities", "createResolver", "contributes", "IntentAction", "LayoutAction", "createIntent", "chain", "getTypename", "S", "isReactiveObject", "log", "AttentionCapabilities", "ObservabilityAction", "isNonNullable", "produce", "openEntry", "deck", "entryId", "options", "produce", "draft", "find", "id", "key", "plankPositioning", "positioning", "pivotId", "index", "findIndex", "split", "splice", "pivotIndex", "unshift", "push", "closeEntry", "incrementPlank", "adjustment", "type", "length", "context", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "IntentAction", "ShowUndo", "resolve", "data", "layout", "requestCapability", "DeckCapabilities", "MutableDeckState", "undoPromise", "undo", "IntentDispatcher", "currentUndoId", "toasts", "filter", "toast", "id", "_tag", "Date", "now", "title", "message", "ns", "DECK_PLUGIN", "duration", "actionLabel", "actionAlt", "closeLabel", "onAction", "LayoutAction", "UpdateLayout", "S", "is", "UpdateSidebar", "fields", "input", "options", "next", "state", "sidebarState", "UpdateComplementary", "subject", "complementarySidebarPanel", "complementarySidebarState", "UpdateDialog", "dialogOpen", "Boolean", "dialogContent", "component", "props", "dialogBlockAlign", "blockAlign", "dialogType", "type", "UpdatePopover", "popoverOpen", "popoverContent", "popoverAnchorId", "anchorId", "popoverSide", "side", "AddToast", "push", "SetLayoutMode", "isLayoutMode", "mode", "setMode", "deck", "current", "solo", "active", "isNonNullable", "removed", "includes", "closed", "Array", "from", "Set", "inactive", "undefined", "initialized", "fullscreen", "batch", "getMode", "previousMode", "activeDeck", "last", "log", "warn", "SwitchWorkspace", "startsWith", "previousDeck", "decks", "plankSizing", "first", "intents", "createIntent", "ScrollIntoView", "part", "RevertWorkspace", "Open", "graph", "AppGraph", "attention", "AttentionCapabilities", "Attention", "settings", "requestCapabilities", "SettingsStore", "getStore", "value", "previouslyOpenIds", "reduce", "acc", "entryId", "openEntry", "key", "positioning", "newPlankPositioning", "pivotId", "setActive", "ids", "newlyOpen", "i", "has", "scrollIntoView", "Expose", "map", "findNode", "typename", "isReactiveObject", "getTypename", "ObservabilityAction", "SendEvent", "name", "properties", "Close", "closeEntry", "toAttend", "DeckAction", "UpdatePlankSize", "size", "Adjust", "adjustment", "incrementPlank", "pipe", "chain"]
7
+ }