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

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 (204) hide show
  1. package/dist/lib/browser/{app-graph-builder-67VRUD5K.mjs → app-graph-builder-CI6ZFMNL.mjs} +57 -31
  2. package/dist/lib/browser/app-graph-builder-CI6ZFMNL.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-M2L53AIH.mjs +126 -0
  6. package/dist/lib/browser/chunk-M2L53AIH.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-JQJ5UWVB.mjs → chunk-N7TEPFVR.mjs} +3 -2
  8. package/dist/lib/browser/{chunk-JQJ5UWVB.mjs.map → chunk-N7TEPFVR.mjs.map} +3 -3
  9. package/dist/lib/browser/chunk-NYZJCVAU.mjs +22 -0
  10. package/dist/lib/browser/chunk-NYZJCVAU.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-WXNLVMK2.mjs +1119 -0
  12. package/dist/lib/browser/chunk-WXNLVMK2.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-5VFDMW5M.mjs → chunk-YQ2GWTDU.mjs} +2 -2
  14. package/dist/lib/browser/chunk-YQ2GWTDU.mjs.map +7 -0
  15. package/dist/lib/browser/index.mjs +32 -78
  16. package/dist/lib/browser/index.mjs.map +4 -4
  17. package/dist/lib/browser/intent-resolver-CSXFDKTC.mjs +494 -0
  18. package/dist/lib/browser/intent-resolver-CSXFDKTC.mjs.map +7 -0
  19. package/dist/lib/browser/meta.json +1 -1
  20. package/dist/lib/browser/{react-root-UL7ZDRVZ.mjs → react-root-ECDQZYQT.mjs} +10 -14
  21. package/dist/lib/browser/react-root-ECDQZYQT.mjs.map +7 -0
  22. package/dist/lib/browser/react-surface-4WIQZW2S.mjs +38 -0
  23. package/dist/lib/browser/react-surface-4WIQZW2S.mjs.map +7 -0
  24. package/dist/lib/browser/{settings-FNWW6WIJ.mjs → settings-WACNLCPB.mjs} +6 -7
  25. package/dist/lib/browser/settings-WACNLCPB.mjs.map +7 -0
  26. package/dist/lib/browser/state-VPOYUKK6.mjs +117 -0
  27. package/dist/lib/browser/state-VPOYUKK6.mjs.map +7 -0
  28. package/dist/lib/browser/types.mjs +16 -4
  29. package/dist/lib/browser/url-handler-HLF42IHP.mjs +70 -0
  30. package/dist/lib/browser/url-handler-HLF42IHP.mjs.map +7 -0
  31. package/dist/types/src/DeckPlugin.d.ts.map +1 -1
  32. package/dist/types/src/capabilities/{layout/app-graph-builder.d.ts → app-graph-builder.d.ts} +22 -22
  33. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  34. package/dist/types/src/capabilities/capabilities.d.ts +132 -3
  35. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  36. package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -0
  37. package/dist/types/src/capabilities/index.d.ts +187 -3
  38. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  39. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
  40. package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
  41. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  42. package/dist/types/src/capabilities/set-active.d.ts +9 -0
  43. package/dist/types/src/capabilities/set-active.d.ts.map +1 -0
  44. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  45. package/dist/types/src/capabilities/state.d.ts +76 -0
  46. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  47. package/dist/types/src/capabilities/url-handler.d.ts.map +1 -0
  48. package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +1 -1
  49. package/dist/types/src/components/DeckLayout/ComplementarySidebar.d.ts.map +1 -1
  50. package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +1 -1
  51. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +1 -4
  52. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
  53. package/dist/types/src/components/DeckLayout/Fullscreen.d.ts.map +1 -1
  54. package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts +3 -3
  55. package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts.map +1 -1
  56. package/dist/types/src/components/DeckLayout/Plank.d.ts +8 -6
  57. package/dist/types/src/components/DeckLayout/Plank.d.ts.map +1 -1
  58. package/dist/types/src/components/DeckLayout/PlankControls.d.ts +2 -2
  59. package/dist/types/src/components/DeckLayout/PlankControls.d.ts.map +1 -1
  60. package/dist/types/src/components/DeckLayout/PlankError.d.ts +4 -3
  61. package/dist/types/src/components/DeckLayout/PlankError.d.ts.map +1 -1
  62. package/dist/types/src/components/DeckLayout/Sidebar.d.ts.map +1 -1
  63. package/dist/types/src/components/DeckLayout/SidebarButton.d.ts +5 -3
  64. package/dist/types/src/components/DeckLayout/SidebarButton.d.ts.map +1 -1
  65. package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +1 -1
  66. package/dist/types/src/components/DeckLayout/Toast.d.ts +2 -2
  67. package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
  68. package/dist/types/src/components/fragments.d.ts +2 -0
  69. package/dist/types/src/components/fragments.d.ts.map +1 -1
  70. package/dist/types/src/components/index.d.ts +0 -2
  71. package/dist/types/src/components/index.d.ts.map +1 -1
  72. package/dist/types/src/hooks/useMainSize.d.ts +2 -2
  73. package/dist/types/src/layout.d.ts +5 -19
  74. package/dist/types/src/layout.d.ts.map +1 -1
  75. package/dist/types/src/meta.d.ts +1 -0
  76. package/dist/types/src/meta.d.ts.map +1 -1
  77. package/dist/types/src/translations.d.ts +3 -3
  78. package/dist/types/src/types.d.ts +107 -2
  79. package/dist/types/src/types.d.ts.map +1 -1
  80. package/dist/types/src/util/index.d.ts +2 -1
  81. package/dist/types/src/util/index.d.ts.map +1 -1
  82. package/dist/types/src/util/layoutAppliesTopbar.d.ts +2 -0
  83. package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -0
  84. package/dist/types/src/util/useHoistStatusbar.d.ts.map +1 -1
  85. package/package.json +30 -30
  86. package/src/DeckPlugin.ts +12 -58
  87. package/src/capabilities/{layout/app-graph-builder.ts → app-graph-builder.ts} +36 -28
  88. package/src/capabilities/capabilities.ts +4 -3
  89. package/src/capabilities/{navigation/check-app-scheme.ts → check-app-scheme.ts} +2 -2
  90. package/src/capabilities/index.ts +11 -3
  91. package/src/capabilities/intent-resolver.ts +350 -0
  92. package/src/capabilities/{layout/react-root.tsx → react-root.tsx} +7 -11
  93. package/src/capabilities/react-surface.tsx +31 -0
  94. package/src/capabilities/set-active.ts +43 -0
  95. package/src/capabilities/{settings/settings.ts → settings.ts} +4 -5
  96. package/src/capabilities/state.ts +102 -0
  97. package/src/capabilities/url-handler.ts +63 -0
  98. package/src/components/DeckLayout/ActiveNode.tsx +2 -3
  99. package/src/components/DeckLayout/ComplementarySidebar.tsx +118 -67
  100. package/src/components/DeckLayout/ContentEmpty.tsx +7 -10
  101. package/src/components/DeckLayout/DeckLayout.tsx +103 -61
  102. package/src/components/DeckLayout/Fullscreen.tsx +2 -3
  103. package/src/components/DeckLayout/NodePlankHeading.tsx +57 -65
  104. package/src/components/DeckLayout/Plank.tsx +32 -41
  105. package/src/components/DeckLayout/PlankControls.tsx +11 -10
  106. package/src/components/DeckLayout/PlankError.tsx +6 -5
  107. package/src/components/DeckLayout/Sidebar.tsx +17 -20
  108. package/src/components/DeckLayout/SidebarButton.tsx +25 -31
  109. package/src/components/DeckLayout/StatusBar.tsx +5 -11
  110. package/src/components/DeckLayout/Toast.tsx +2 -2
  111. package/src/components/LayoutSettings.tsx +8 -8
  112. package/src/components/fragments.ts +8 -0
  113. package/src/components/index.ts +0 -2
  114. package/src/hooks/useMainSize.ts +3 -3
  115. package/src/layout.ts +43 -212
  116. package/src/meta.ts +1 -0
  117. package/src/translations.ts +8 -8
  118. package/src/types.ts +88 -2
  119. package/src/util/index.ts +2 -1
  120. package/src/util/layoutAppliesTopbar.ts +7 -0
  121. package/src/util/useHoistStatusbar.ts +17 -8
  122. package/dist/lib/browser/app-graph-builder-67VRUD5K.mjs.map +0 -7
  123. package/dist/lib/browser/chunk-2M4PXYNB.mjs +0 -1052
  124. package/dist/lib/browser/chunk-2M4PXYNB.mjs.map +0 -7
  125. package/dist/lib/browser/chunk-2PJNBVCY.mjs +0 -39
  126. package/dist/lib/browser/chunk-2PJNBVCY.mjs.map +0 -7
  127. package/dist/lib/browser/chunk-4C2AFTET.mjs +0 -186
  128. package/dist/lib/browser/chunk-4C2AFTET.mjs.map +0 -7
  129. package/dist/lib/browser/chunk-5VFDMW5M.mjs.map +0 -7
  130. package/dist/lib/browser/chunk-KY5WXIXY.mjs +0 -44
  131. package/dist/lib/browser/chunk-KY5WXIXY.mjs.map +0 -7
  132. package/dist/lib/browser/deck-PLCSKPGL.mjs +0 -26
  133. package/dist/lib/browser/deck-PLCSKPGL.mjs.map +0 -7
  134. package/dist/lib/browser/intent-resolver-FVOQSTBX.mjs +0 -152
  135. package/dist/lib/browser/intent-resolver-FVOQSTBX.mjs.map +0 -7
  136. package/dist/lib/browser/intent-resolver-K7GW4A2I.mjs +0 -249
  137. package/dist/lib/browser/intent-resolver-K7GW4A2I.mjs.map +0 -7
  138. package/dist/lib/browser/location-QHRBQBQN.mjs +0 -35
  139. package/dist/lib/browser/location-QHRBQBQN.mjs.map +0 -7
  140. package/dist/lib/browser/react-context-3BDW7W2N.mjs +0 -32
  141. package/dist/lib/browser/react-context-3BDW7W2N.mjs.map +0 -7
  142. package/dist/lib/browser/react-root-UL7ZDRVZ.mjs.map +0 -7
  143. package/dist/lib/browser/react-surface-VPNOGGNN.mjs +0 -28
  144. package/dist/lib/browser/react-surface-VPNOGGNN.mjs.map +0 -7
  145. package/dist/lib/browser/settings-FNWW6WIJ.mjs.map +0 -7
  146. package/dist/lib/browser/state-7I5BD7SE.mjs +0 -34
  147. package/dist/lib/browser/state-7I5BD7SE.mjs.map +0 -7
  148. package/dist/lib/browser/url-handler-Z5B7LD3N.mjs +0 -76
  149. package/dist/lib/browser/url-handler-Z5B7LD3N.mjs.map +0 -7
  150. package/dist/types/src/capabilities/layout/app-graph-builder.d.ts.map +0 -1
  151. package/dist/types/src/capabilities/layout/deck.d.ts +0 -4
  152. package/dist/types/src/capabilities/layout/deck.d.ts.map +0 -1
  153. package/dist/types/src/capabilities/layout/index.d.ts +0 -229
  154. package/dist/types/src/capabilities/layout/index.d.ts.map +0 -1
  155. package/dist/types/src/capabilities/layout/intent-resolver.d.ts.map +0 -1
  156. package/dist/types/src/capabilities/layout/react-context.d.ts +0 -8
  157. package/dist/types/src/capabilities/layout/react-context.d.ts.map +0 -1
  158. package/dist/types/src/capabilities/layout/react-root.d.ts.map +0 -1
  159. package/dist/types/src/capabilities/layout/state.d.ts +0 -42
  160. package/dist/types/src/capabilities/layout/state.d.ts.map +0 -1
  161. package/dist/types/src/capabilities/navigation/check-app-scheme.d.ts.map +0 -1
  162. package/dist/types/src/capabilities/navigation/index.d.ts +0 -5
  163. package/dist/types/src/capabilities/navigation/index.d.ts.map +0 -1
  164. package/dist/types/src/capabilities/navigation/intent-resolver.d.ts +0 -4
  165. package/dist/types/src/capabilities/navigation/intent-resolver.d.ts.map +0 -1
  166. package/dist/types/src/capabilities/navigation/location.d.ts +0 -4
  167. package/dist/types/src/capabilities/navigation/location.d.ts.map +0 -1
  168. package/dist/types/src/capabilities/navigation/set-location.d.ts +0 -10
  169. package/dist/types/src/capabilities/navigation/set-location.d.ts.map +0 -1
  170. package/dist/types/src/capabilities/navigation/url-handler.d.ts.map +0 -1
  171. package/dist/types/src/capabilities/settings/index.d.ts +0 -3
  172. package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
  173. package/dist/types/src/capabilities/settings/react-surface.d.ts.map +0 -1
  174. package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
  175. package/dist/types/src/components/DeckContext.d.ts +0 -11
  176. package/dist/types/src/components/DeckContext.d.ts.map +0 -1
  177. package/dist/types/src/components/LayoutContext.d.ts +0 -5
  178. package/dist/types/src/components/LayoutContext.d.ts.map +0 -1
  179. package/dist/types/src/layout.test.d.ts +0 -2
  180. package/dist/types/src/layout.test.d.ts.map +0 -1
  181. package/dist/types/src/util/layout-parts.d.ts +0 -7
  182. package/dist/types/src/util/layout-parts.d.ts.map +0 -1
  183. package/src/capabilities/layout/deck.ts +0 -25
  184. package/src/capabilities/layout/index.ts +0 -12
  185. package/src/capabilities/layout/intent-resolver.ts +0 -128
  186. package/src/capabilities/layout/react-context.tsx +0 -26
  187. package/src/capabilities/layout/state.ts +0 -32
  188. package/src/capabilities/navigation/index.ts +0 -10
  189. package/src/capabilities/navigation/intent-resolver.ts +0 -216
  190. package/src/capabilities/navigation/location.ts +0 -28
  191. package/src/capabilities/navigation/set-location.ts +0 -38
  192. package/src/capabilities/navigation/url-handler.ts +0 -67
  193. package/src/capabilities/settings/index.ts +0 -8
  194. package/src/capabilities/settings/react-surface.tsx +0 -23
  195. package/src/components/DeckContext.ts +0 -19
  196. package/src/components/LayoutContext.ts +0 -12
  197. package/src/layout.test.ts +0 -380
  198. package/src/util/layout-parts.ts +0 -12
  199. /package/dist/types/src/capabilities/{navigation/check-app-scheme.d.ts → check-app-scheme.d.ts} +0 -0
  200. /package/dist/types/src/capabilities/{layout/intent-resolver.d.ts → intent-resolver.d.ts} +0 -0
  201. /package/dist/types/src/capabilities/{layout/react-root.d.ts → react-root.d.ts} +0 -0
  202. /package/dist/types/src/capabilities/{settings/react-surface.d.ts → react-surface.d.ts} +0 -0
  203. /package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +0 -0
  204. /package/dist/types/src/capabilities/{navigation/url-handler.d.ts → url-handler.d.ts} +0 -0
@@ -0,0 +1,494 @@
1
+ import {
2
+ DeckCapabilities
3
+ } from "./chunk-YQ2GWTDU.mjs";
4
+ import {
5
+ DeckAction,
6
+ getMode,
7
+ isLayoutMode
8
+ } from "./chunk-M2L53AIH.mjs";
9
+ import {
10
+ DECK_PLUGIN
11
+ } from "./chunk-N7TEPFVR.mjs";
12
+
13
+ // packages/plugins/plugin-deck/src/capabilities/intent-resolver.ts
14
+ import { batch as batch2 } from "@preact/signals-core";
15
+ import { pipe } from "effect";
16
+ import { Capabilities, createResolver, contributes, IntentAction, LayoutAction, createIntent, chain } from "@dxos/app-framework";
17
+ import { getTypename, S } from "@dxos/echo-schema";
18
+ import { isReactiveObject } from "@dxos/live-object";
19
+ import { log } from "@dxos/log";
20
+ import { AttentionCapabilities } from "@dxos/plugin-attention";
21
+ import { ObservabilityAction } from "@dxos/plugin-observability/types";
22
+ import { nonNullable } from "@dxos/util";
23
+
24
+ // packages/plugins/plugin-deck/src/capabilities/set-active.ts
25
+ import { batch } from "@preact/signals-core";
26
+ var setActive = ({ next, state, attention }) => {
27
+ return batch(() => {
28
+ const active = state.deck.solo ? [
29
+ state.deck.solo
30
+ ] : state.deck.active;
31
+ const removed = active.filter((id) => !next.includes(id));
32
+ const closed = Array.from(/* @__PURE__ */ new Set([
33
+ ...state.deck.inactive.filter((id) => !next.includes(id)),
34
+ ...removed
35
+ ]));
36
+ state.deck.inactive = closed;
37
+ if (state.deck.solo || !state.deck.initialized) {
38
+ state.deck.solo = next[0];
39
+ } else {
40
+ state.deck.active = next;
41
+ }
42
+ if (attention) {
43
+ const attended = attention.current;
44
+ const [attendedId] = Array.from(attended);
45
+ const isAttendedAvailable = !!attendedId && next.includes(attendedId);
46
+ if (!isAttendedAvailable) {
47
+ const attendedIndex = active.indexOf(attendedId);
48
+ const index = attendedIndex === -1 ? 0 : attendedIndex >= next.length ? next.length - 1 : attendedIndex;
49
+ return next[index];
50
+ }
51
+ }
52
+ });
53
+ };
54
+
55
+ // packages/plugins/plugin-deck/src/layout.ts
56
+ import { produce } from "immer";
57
+ var openEntry = (deck, entryId, options) => {
58
+ return produce(deck, (draft) => {
59
+ if (draft.find((id) => id === entryId)) {
60
+ return;
61
+ }
62
+ const key = options?.key;
63
+ const plankPositioning = options?.positioning ?? "start";
64
+ const pivotId = options?.pivotId;
65
+ if (key) {
66
+ const index = draft.findIndex((id) => id.startsWith(key));
67
+ if (index !== -1) {
68
+ draft.splice(index, 1, entryId);
69
+ return;
70
+ }
71
+ }
72
+ if (pivotId) {
73
+ const pivotIndex = draft.findIndex((id) => id === pivotId);
74
+ if (pivotIndex !== -1) {
75
+ if (plankPositioning === "start") {
76
+ draft.splice(pivotIndex, 0, entryId);
77
+ } else {
78
+ draft.splice(pivotIndex + 1, 0, entryId);
79
+ }
80
+ return;
81
+ }
82
+ }
83
+ if (plankPositioning === "start") {
84
+ draft.unshift(entryId);
85
+ } else {
86
+ draft.push(entryId);
87
+ }
88
+ });
89
+ };
90
+ var closeEntry = (deck, entryId) => {
91
+ return produce(deck, (draft) => {
92
+ const index = draft.findIndex((id) => id === entryId);
93
+ if (index !== -1) {
94
+ draft.splice(index, 1);
95
+ }
96
+ });
97
+ };
98
+ var incrementPlank = (deck, adjustment) => {
99
+ return produce(deck, (draft) => {
100
+ const index = draft.findIndex((id) => id === adjustment.id);
101
+ if (index === -1 || adjustment.type === "increment-start" && index === 0 || adjustment.type === "increment-end" && index === draft.length - 1) {
102
+ return;
103
+ }
104
+ if (adjustment.type === "increment-start") {
105
+ [draft[index - 1], draft[index]] = [
106
+ draft[index],
107
+ draft[index - 1]
108
+ ];
109
+ } else if (adjustment.type === "increment-end") {
110
+ [draft[index], draft[index + 1]] = [
111
+ draft[index + 1],
112
+ draft[index]
113
+ ];
114
+ }
115
+ });
116
+ };
117
+
118
+ // packages/plugins/plugin-deck/src/capabilities/intent-resolver.ts
119
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-deck/src/capabilities/intent-resolver.ts";
120
+ var intent_resolver_default = (context) => contributes(Capabilities.IntentResolver, [
121
+ createResolver({
122
+ intent: IntentAction.ShowUndo,
123
+ resolve: (data) => {
124
+ const layout = context.requestCapability(DeckCapabilities.MutableDeckState);
125
+ const { undoPromise: undo } = context.requestCapability(Capabilities.IntentDispatcher);
126
+ if (layout.currentUndoId) {
127
+ layout.toasts = layout.toasts.filter((toast) => toast.id !== layout.currentUndoId);
128
+ }
129
+ layout.currentUndoId = `${IntentAction.ShowUndo._tag}-${Date.now()}`;
130
+ layout.toasts = [
131
+ ...layout.toasts,
132
+ {
133
+ id: layout.currentUndoId,
134
+ title: data.message ?? [
135
+ "undo available label",
136
+ {
137
+ ns: DECK_PLUGIN
138
+ }
139
+ ],
140
+ duration: 1e4,
141
+ actionLabel: [
142
+ "undo action label",
143
+ {
144
+ ns: DECK_PLUGIN
145
+ }
146
+ ],
147
+ actionAlt: [
148
+ "undo action alt",
149
+ {
150
+ ns: DECK_PLUGIN
151
+ }
152
+ ],
153
+ closeLabel: [
154
+ "undo close label",
155
+ {
156
+ ns: DECK_PLUGIN
157
+ }
158
+ ],
159
+ onAction: () => undo()
160
+ }
161
+ ];
162
+ }
163
+ }),
164
+ createResolver({
165
+ intent: LayoutAction.UpdateLayout,
166
+ // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.UpdateSidebar.fields.input)`
167
+ // but the filter is not being applied correctly.
168
+ filter: (data) => S.is(LayoutAction.UpdateSidebar.fields.input)(data),
169
+ resolve: ({ options }) => {
170
+ const layout = context.requestCapability(DeckCapabilities.MutableDeckState);
171
+ const next = options?.state ?? layout.sidebarState;
172
+ if (next !== layout.sidebarState) {
173
+ layout.sidebarState = next;
174
+ }
175
+ }
176
+ }),
177
+ createResolver({
178
+ intent: LayoutAction.UpdateLayout,
179
+ // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.UpdateComplementary.fields.input)`
180
+ // but the filter is not being applied correctly.
181
+ filter: (data) => S.is(LayoutAction.UpdateComplementary.fields.input)(data),
182
+ resolve: ({ subject, options }) => {
183
+ const layout = context.requestCapability(DeckCapabilities.MutableDeckState);
184
+ if (layout.complementarySidebarPanel !== subject) {
185
+ layout.complementarySidebarPanel = subject;
186
+ }
187
+ const next = subject ? "expanded" : options?.state ?? layout.complementarySidebarState;
188
+ if (next !== layout.complementarySidebarState) {
189
+ layout.complementarySidebarState = next;
190
+ }
191
+ }
192
+ }),
193
+ createResolver({
194
+ intent: LayoutAction.UpdateLayout,
195
+ // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.UpdateDialog.fields.input)`
196
+ // but the filter is not being applied correctly.
197
+ filter: (data) => S.is(LayoutAction.UpdateDialog.fields.input)(data),
198
+ resolve: ({ subject, options }) => {
199
+ const layout = context.requestCapability(DeckCapabilities.MutableDeckState);
200
+ layout.dialogOpen = options.state ?? Boolean(subject);
201
+ layout.dialogContent = subject ? {
202
+ component: subject,
203
+ props: options.props
204
+ } : null;
205
+ layout.dialogBlockAlign = options.blockAlign ?? "center";
206
+ layout.dialogType = options.type ?? "default";
207
+ }
208
+ }),
209
+ createResolver({
210
+ intent: LayoutAction.UpdateLayout,
211
+ // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.UpdatePopover.fields.input)`
212
+ // but the filter is not being applied correctly.
213
+ filter: (data) => S.is(LayoutAction.UpdatePopover.fields.input)(data),
214
+ resolve: ({ subject, options }) => {
215
+ const layout = context.requestCapability(DeckCapabilities.MutableDeckState);
216
+ layout.popoverOpen = options.state ?? Boolean(subject);
217
+ layout.popoverContent = subject ? {
218
+ component: subject,
219
+ props: options.props
220
+ } : null;
221
+ layout.popoverAnchorId = options.anchorId;
222
+ }
223
+ }),
224
+ createResolver({
225
+ intent: LayoutAction.UpdateLayout,
226
+ // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.AddToast.fields.input)`
227
+ // but the filter is not being applied correctly.
228
+ filter: (data) => S.is(LayoutAction.AddToast.fields.input)(data),
229
+ resolve: ({ subject }) => {
230
+ const layout = context.requestCapability(DeckCapabilities.MutableDeckState);
231
+ layout.toasts.push(subject);
232
+ }
233
+ }),
234
+ createResolver({
235
+ intent: LayoutAction.UpdateLayout,
236
+ // TODO(wittjosiah): This should be able to just be `S.is(LayoutAction.SetLayoutMode.fields.input)`
237
+ // but the filter is not being applied correctly.
238
+ filter: (data) => {
239
+ if (!S.is(LayoutAction.SetLayoutMode.fields.input)(data)) {
240
+ return false;
241
+ }
242
+ if ("mode" in data.options) {
243
+ return isLayoutMode(data.options.mode);
244
+ }
245
+ return true;
246
+ },
247
+ resolve: ({ subject, options }) => {
248
+ const state = context.requestCapability(DeckCapabilities.MutableDeckState);
249
+ const setMode = (mode) => {
250
+ const deck = state.deck;
251
+ const current = deck.solo ? [
252
+ deck.solo
253
+ ] : deck.active;
254
+ const next = (mode === "solo" ? [
255
+ subject ?? deck.solo ?? deck.active[0]
256
+ ] : [
257
+ ...deck.active,
258
+ deck.solo
259
+ ]).filter(nonNullable);
260
+ const removed = current.filter((id) => !next.includes(id));
261
+ const closed = Array.from(/* @__PURE__ */ new Set([
262
+ ...deck.inactive.filter((id) => !next.includes(id)),
263
+ ...removed
264
+ ]));
265
+ deck.inactive = closed;
266
+ if (mode === "solo" && next[0]) {
267
+ deck.solo = next[0];
268
+ } else if (mode !== "solo" && deck.solo) {
269
+ deck.solo = void 0;
270
+ deck.initialized = true;
271
+ }
272
+ if (mode === "fullscreen" && !deck.fullscreen) {
273
+ deck.fullscreen = true;
274
+ } else if (mode !== "fullscreen" && deck.fullscreen) {
275
+ deck.fullscreen = false;
276
+ }
277
+ };
278
+ return batch2(() => {
279
+ if ("mode" in options) {
280
+ const current = getMode(state.deck);
281
+ if (current !== options.mode) {
282
+ state.previousMode[state.activeDeck] = current;
283
+ }
284
+ setMode(options.mode);
285
+ } else if ("revert" in options) {
286
+ const last = state.previousMode[state.activeDeck];
287
+ setMode(last ?? "solo");
288
+ } else {
289
+ log.warn("Invalid layout mode", options, {
290
+ F: __dxlog_file,
291
+ L: 184,
292
+ S: void 0,
293
+ C: (f, a) => f(...a)
294
+ });
295
+ }
296
+ });
297
+ }
298
+ }),
299
+ createResolver({
300
+ intent: LayoutAction.UpdateLayout,
301
+ filter: (data) => S.is(LayoutAction.SwitchWorkspace.fields.input)(data),
302
+ resolve: ({ subject }) => {
303
+ const state = context.requestCapability(DeckCapabilities.MutableDeckState);
304
+ batch2(() => {
305
+ state.activeDeck = subject;
306
+ if (!state.decks[subject]) {
307
+ state.decks[subject] = {
308
+ initialized: false,
309
+ active: [],
310
+ inactive: [],
311
+ fullscreen: false,
312
+ plankSizing: {}
313
+ };
314
+ }
315
+ });
316
+ const first = state.decks[state.activeDeck].active[0];
317
+ if (first) {
318
+ return {
319
+ intents: [
320
+ createIntent(LayoutAction.ScrollIntoView, {
321
+ part: "current",
322
+ subject: first
323
+ })
324
+ ]
325
+ };
326
+ }
327
+ }
328
+ }),
329
+ createResolver({
330
+ intent: LayoutAction.UpdateLayout,
331
+ filter: (data) => S.is(LayoutAction.Open.fields.input)(data),
332
+ resolve: ({ subject, options }) => {
333
+ const { graph } = context.requestCapability(Capabilities.AppGraph);
334
+ const state = context.requestCapability(DeckCapabilities.MutableDeckState);
335
+ const attention = context.requestCapability(AttentionCapabilities.Attention);
336
+ const settings = context.requestCapabilities(Capabilities.SettingsStore)[0]?.getStore(DECK_PLUGIN)?.value;
337
+ const previouslyOpenIds = new Set(state.deck.solo ? [
338
+ state.deck.solo
339
+ ] : state.deck.active);
340
+ batch2(() => {
341
+ const next = state.deck.solo ? subject : subject.reduce((acc, entryId) => openEntry(acc, entryId, {
342
+ key: options?.key,
343
+ positioning: options?.positioning ?? settings?.newPlankPositioning,
344
+ pivotId: options?.pivotId
345
+ }), state.deck.active);
346
+ return setActive({
347
+ next,
348
+ state,
349
+ attention
350
+ });
351
+ });
352
+ const ids = state.deck.solo ? [
353
+ state.deck.solo
354
+ ] : state.deck.active;
355
+ const newlyOpen = ids.filter((i) => !previouslyOpenIds.has(i));
356
+ return {
357
+ intents: [
358
+ ...options?.scrollIntoView !== false ? [
359
+ createIntent(LayoutAction.ScrollIntoView, {
360
+ part: "current",
361
+ subject: newlyOpen[0] ?? subject[0]
362
+ })
363
+ ] : [],
364
+ createIntent(LayoutAction.Expose, {
365
+ part: "navigation",
366
+ subject: newlyOpen[0] ?? subject[0]
367
+ }),
368
+ ...newlyOpen.map((id) => {
369
+ const active = graph?.findNode(id)?.data;
370
+ const typename = isReactiveObject(active) ? getTypename(active) : void 0;
371
+ return createIntent(ObservabilityAction.SendEvent, {
372
+ name: "navigation.activate",
373
+ properties: {
374
+ id,
375
+ typename
376
+ }
377
+ });
378
+ })
379
+ ]
380
+ };
381
+ }
382
+ }),
383
+ createResolver({
384
+ intent: LayoutAction.UpdateLayout,
385
+ filter: (data) => S.is(LayoutAction.Close.fields.input)(data),
386
+ resolve: ({ subject }) => {
387
+ const state = context.requestCapability(DeckCapabilities.MutableDeckState);
388
+ const attention = context.requestCapability(AttentionCapabilities.Attention);
389
+ const next = subject.reduce((acc, id) => closeEntry(acc, id), state.deck.active);
390
+ const toAttend = setActive({
391
+ next,
392
+ state,
393
+ attention
394
+ });
395
+ return {
396
+ intents: toAttend ? [
397
+ createIntent(LayoutAction.ScrollIntoView, {
398
+ part: "current",
399
+ subject: toAttend
400
+ })
401
+ ] : []
402
+ };
403
+ }
404
+ }),
405
+ createResolver({
406
+ intent: LayoutAction.UpdateLayout,
407
+ filter: (data) => S.is(LayoutAction.Set.fields.input)(data),
408
+ resolve: ({ subject }) => {
409
+ const state = context.requestCapability(DeckCapabilities.MutableDeckState);
410
+ const attention = context.requestCapability(AttentionCapabilities.Attention);
411
+ const toAttend = setActive({
412
+ next: subject,
413
+ state,
414
+ attention
415
+ });
416
+ return {
417
+ intents: toAttend ? [
418
+ createIntent(LayoutAction.ScrollIntoView, {
419
+ part: "current",
420
+ subject: toAttend
421
+ })
422
+ ] : []
423
+ };
424
+ }
425
+ }),
426
+ createResolver({
427
+ intent: LayoutAction.UpdateLayout,
428
+ filter: (data) => S.is(LayoutAction.ScrollIntoView.fields.input)(data),
429
+ resolve: ({ subject }) => {
430
+ const layout = context.requestCapability(DeckCapabilities.MutableDeckState);
431
+ layout.scrollIntoView = subject;
432
+ }
433
+ }),
434
+ createResolver({
435
+ intent: DeckAction.UpdatePlankSize,
436
+ resolve: (data) => {
437
+ const state = context.requestCapability(DeckCapabilities.MutableDeckState);
438
+ state.deck.plankSizing[data.id] = data.size;
439
+ }
440
+ }),
441
+ createResolver({
442
+ intent: DeckAction.Adjust,
443
+ resolve: (adjustment) => {
444
+ const state = context.requestCapability(DeckCapabilities.MutableDeckState);
445
+ const attention = context.requestCapability(AttentionCapabilities.Attention);
446
+ return batch2(() => {
447
+ if (adjustment.type === "increment-end" || adjustment.type === "increment-start") {
448
+ setActive({
449
+ next: incrementPlank(state.deck.active, adjustment),
450
+ state,
451
+ attention
452
+ });
453
+ }
454
+ if (adjustment.type === "solo") {
455
+ const entryId = adjustment.id;
456
+ if (!state.deck.solo) {
457
+ return {
458
+ intents: [
459
+ createIntent(LayoutAction.SetLayoutMode, {
460
+ part: "mode",
461
+ subject: entryId,
462
+ options: {
463
+ mode: "solo"
464
+ }
465
+ })
466
+ ]
467
+ };
468
+ } else {
469
+ return {
470
+ intents: [
471
+ // NOTE: The order of these is important.
472
+ pipe(createIntent(LayoutAction.SetLayoutMode, {
473
+ part: "mode",
474
+ options: {
475
+ mode: "deck"
476
+ }
477
+ }), chain(LayoutAction.Open, {
478
+ part: "main",
479
+ subject: [
480
+ entryId
481
+ ]
482
+ }))
483
+ ]
484
+ };
485
+ }
486
+ }
487
+ });
488
+ }
489
+ })
490
+ ]);
491
+ export {
492
+ intent_resolver_default as default
493
+ };
494
+ //# sourceMappingURL=intent-resolver-CSXFDKTC.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/intent-resolver.ts", "../../../src/capabilities/set-active.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 { nonNullable } from '@dxos/util';\n\nimport { DeckCapabilities } from './capabilities';\nimport { setActive } from './set-active';\nimport { closeEntry, incrementPlank, openEntry } from '../layout';\nimport { DECK_PLUGIN } from '../meta';\nimport { DeckAction, type LayoutMode, type DeckSettingsProps, isLayoutMode, getMode } from '../types';\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 },\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 === 'solo' ? [subject ?? deck.solo ?? deck.active[0]] : [...deck.active, deck.solo]\n ).filter(nonNullable);\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 === 'solo' && next[0]) {\n deck.solo = next[0];\n } else if (mode !== 'solo' && 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 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.decks[state.activeDeck].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.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 next = subject.reduce((acc, id) => closeEntry(acc, id), state.deck.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 2025 DXOS.org\n//\n\nimport { batch } from '@preact/signals-core';\n\nimport { type AttentionManager } from '@dxos/plugin-attention';\n\nimport { type DeckState } from '../types';\n\nexport type SetActiveOptions = {\n next: string[];\n state: DeckState;\n attention?: AttentionManager;\n};\n\nexport const setActive = ({ next, state, attention }: SetActiveOptions) => {\n return batch(() => {\n const active = state.deck.solo ? [state.deck.solo] : state.deck.active;\n const removed = active.filter((id) => !next.includes(id));\n const closed = Array.from(new Set([...state.deck.inactive.filter((id) => !next.includes(id)), ...removed]));\n\n state.deck.inactive = closed;\n\n if (state.deck.solo || !state.deck.initialized) {\n state.deck.solo = next[0];\n } else {\n state.deck.active = next;\n }\n\n if (attention) {\n const attended = attention.current;\n const [attendedId] = Array.from(attended);\n const isAttendedAvailable = !!attendedId && next.includes(attendedId);\n if (!isAttendedAvailable) {\n const attendedIndex = active.indexOf(attendedId);\n // If outside of bounds, focus on the first/last plank, otherwise focus on the new plank in the same position.\n const index = attendedIndex === -1 ? 0 : attendedIndex >= next.length ? next.length - 1 : attendedIndex;\n return next[index];\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.startsWith(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,SAAAA,cAAa;AACtB,SAASC,YAAY;AAErB,SACEC,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A;EACAzI,eAAe;IACbC,QAAQsI,WAAWG;IACnBtI,SAAS,CAACuI,eAAAA;AACR,YAAMpG,QAAQ3C,QAAQW,kBAAkBC,iBAAiBC,gBAAgB;AACzE,YAAM0F,YAAYvG,QAAQW,kBAAkB6F,sBAAsBC,SAAS;AAE3E,aAAOpB,OAAM,MAAA;AACX,YAAI0D,WAAWrF,SAAS,mBAAmBqF,WAAWrF,SAAS,mBAAmB;AAChF8D,oBAAU;YACR9E,MAAMsG,eAAerG,MAAM2B,KAAKG,QAAQsE,UAAAA;YACxCpG;YACA4D;UACF,CAAA;QACF;AAEA,YAAIwC,WAAWrF,SAAS,QAAQ;AAC9B,gBAAMwD,UAAU6B,WAAW1H;AAC3B,cAAI,CAACsB,MAAM2B,KAAKE,MAAM;AAEpB,mBAAO;cACLwB,SAAS;gBACPC,aAAa/D,aAAagC,eAAe;kBACvCiC,MAAM;kBACNrD,SAASoE;kBACTzE,SAAS;oBAAE2B,MAAM;kBAAO;gBAC1B,CAAA;;YAEJ;UACF,OAAO;AAEL,mBAAO;cACL4B,SAAS;;gBAEPiD,KACEhD,aAAa/D,aAAagC,eAAe;kBAAEiC,MAAM;kBAAQ1D,SAAS;oBAAE2B,MAAM;kBAAO;gBAAE,CAAA,GACnF8E,MAAMhH,aAAakE,MAAM;kBAAED,MAAM;kBAAQrD,SAAS;oBAACoE;;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", "nonNullable", "batch", "setActive", "next", "state", "attention", "batch", "active", "deck", "solo", "removed", "filter", "id", "includes", "closed", "Array", "from", "Set", "inactive", "initialized", "attended", "current", "attendedId", "isAttendedAvailable", "attendedIndex", "indexOf", "index", "length", "produce", "openEntry", "deck", "entryId", "options", "produce", "draft", "find", "id", "key", "plankPositioning", "positioning", "pivotId", "index", "findIndex", "startsWith", "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", "AddToast", "push", "SetLayoutMode", "isLayoutMode", "mode", "setMode", "deck", "current", "solo", "active", "nonNullable", "removed", "includes", "closed", "Array", "from", "Set", "inactive", "undefined", "initialized", "fullscreen", "batch", "getMode", "previousMode", "activeDeck", "last", "log", "warn", "SwitchWorkspace", "decks", "plankSizing", "first", "intents", "createIntent", "ScrollIntoView", "part", "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
+ }