@dxos/plugin-deck 0.7.5-labs.a279d8c → 0.7.5-labs.a8b535d

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 (236) 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-FT33W5CI.mjs +128 -0
  8. package/dist/lib/browser/chunk-FT33W5CI.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-G2X3ZDCE.mjs +24 -0
  10. package/dist/lib/browser/chunk-G2X3ZDCE.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-KANJBSIX.mjs +97 -0
  12. package/dist/lib/browser/chunk-KANJBSIX.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-JQJ5UWVB.mjs → chunk-N7TEPFVR.mjs} +3 -2
  14. package/dist/lib/browser/{chunk-JQJ5UWVB.mjs.map → chunk-N7TEPFVR.mjs.map} +3 -3
  15. package/dist/lib/browser/chunk-O4RFYYQ6.mjs +1114 -0
  16. package/dist/lib/browser/chunk-O4RFYYQ6.mjs.map +7 -0
  17. package/dist/lib/browser/index.mjs +45 -84
  18. package/dist/lib/browser/index.mjs.map +4 -4
  19. package/dist/lib/browser/intent-resolver-ZD67BRUI.mjs +488 -0
  20. package/dist/lib/browser/intent-resolver-ZD67BRUI.mjs.map +7 -0
  21. package/dist/lib/browser/meta.json +1 -1
  22. package/dist/lib/browser/{react-root-AWYSGU4Q.mjs → react-root-6ILKHD5J.mjs} +12 -17
  23. package/dist/lib/browser/react-root-6ILKHD5J.mjs.map +7 -0
  24. package/dist/lib/browser/react-surface-O75FKXAI.mjs +39 -0
  25. package/dist/lib/browser/react-surface-O75FKXAI.mjs.map +7 -0
  26. package/dist/lib/browser/{settings-FNWW6WIJ.mjs → settings-H35U6NHE.mjs} +6 -7
  27. package/dist/lib/browser/settings-H35U6NHE.mjs.map +7 -0
  28. package/dist/lib/browser/state-U4SHOPJW.mjs +129 -0
  29. package/dist/lib/browser/state-U4SHOPJW.mjs.map +7 -0
  30. package/dist/lib/browser/{tools-4XY7KFQF.mjs → tools-64LXGLYR.mjs} +24 -11
  31. package/dist/lib/browser/tools-64LXGLYR.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/{navigation/tools.d.ts → tools.d.ts} +1 -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 +117 -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/dist/types/tsconfig.tsbuildinfo +1 -1
  111. package/package.json +31 -31
  112. package/src/DeckPlugin.ts +23 -65
  113. package/src/capabilities/{layout/app-graph-builder.ts → app-graph-builder.ts} +40 -28
  114. package/src/capabilities/capabilities.ts +5 -7
  115. package/src/capabilities/{navigation/check-app-scheme.ts → check-app-scheme.ts} +2 -2
  116. package/src/capabilities/index.ts +12 -3
  117. package/src/capabilities/intent-resolver.ts +368 -0
  118. package/src/capabilities/{layout/react-root.tsx → react-root.tsx} +8 -14
  119. package/src/capabilities/react-surface.tsx +31 -0
  120. package/src/capabilities/{settings/settings.ts → settings.ts} +4 -5
  121. package/src/capabilities/state.ts +108 -0
  122. package/src/capabilities/{navigation/tools.ts → tools.ts} +18 -9
  123. package/src/capabilities/url-handler.ts +65 -0
  124. package/src/components/DeckLayout/ActiveNode.tsx +2 -3
  125. package/src/components/DeckLayout/ComplementarySidebar.tsx +185 -77
  126. package/src/components/DeckLayout/ContentEmpty.tsx +7 -10
  127. package/src/components/DeckLayout/DeckLayout.tsx +141 -84
  128. package/src/components/DeckLayout/Fullscreen.tsx +2 -3
  129. package/src/components/DeckLayout/NodePlankHeading.tsx +57 -65
  130. package/src/components/DeckLayout/Plank.tsx +33 -41
  131. package/src/components/DeckLayout/PlankControls.tsx +12 -11
  132. package/src/components/DeckLayout/PlankError.tsx +6 -5
  133. package/src/components/DeckLayout/Sidebar.tsx +17 -20
  134. package/src/components/DeckLayout/SidebarButton.tsx +25 -31
  135. package/src/components/DeckLayout/StatusBar.tsx +5 -11
  136. package/src/components/DeckLayout/Toast.tsx +2 -2
  137. package/src/components/LayoutSettings.tsx +8 -8
  138. package/src/components/fragments.ts +8 -0
  139. package/src/components/index.ts +0 -2
  140. package/src/events.ts +1 -0
  141. package/src/hooks/useMainSize.ts +3 -3
  142. package/src/hooks/useNode.ts +3 -1
  143. package/src/layout.ts +43 -212
  144. package/src/meta.ts +1 -0
  145. package/src/translations.ts +8 -8
  146. package/src/types.ts +103 -4
  147. package/src/util/index.ts +3 -1
  148. package/src/util/layoutAppliesTopbar.ts +7 -0
  149. package/src/util/set-active.ts +47 -0
  150. package/src/util/useHoistStatusbar.ts +13 -8
  151. package/dist/lib/browser/app-graph-builder-67VRUD5K.mjs.map +0 -7
  152. package/dist/lib/browser/chunk-2PJNBVCY.mjs +0 -39
  153. package/dist/lib/browser/chunk-2PJNBVCY.mjs.map +0 -7
  154. package/dist/lib/browser/chunk-4C2AFTET.mjs +0 -186
  155. package/dist/lib/browser/chunk-4C2AFTET.mjs.map +0 -7
  156. package/dist/lib/browser/chunk-5VFDMW5M.mjs.map +0 -7
  157. package/dist/lib/browser/chunk-KY5WXIXY.mjs +0 -44
  158. package/dist/lib/browser/chunk-KY5WXIXY.mjs.map +0 -7
  159. package/dist/lib/browser/chunk-WUMAJGVA.mjs +0 -1052
  160. package/dist/lib/browser/chunk-WUMAJGVA.mjs.map +0 -7
  161. package/dist/lib/browser/deck-PLCSKPGL.mjs +0 -26
  162. package/dist/lib/browser/deck-PLCSKPGL.mjs.map +0 -7
  163. package/dist/lib/browser/intent-resolver-FVOQSTBX.mjs +0 -152
  164. package/dist/lib/browser/intent-resolver-FVOQSTBX.mjs.map +0 -7
  165. package/dist/lib/browser/intent-resolver-K7GW4A2I.mjs +0 -249
  166. package/dist/lib/browser/intent-resolver-K7GW4A2I.mjs.map +0 -7
  167. package/dist/lib/browser/location-AIO6V3MK.mjs +0 -35
  168. package/dist/lib/browser/location-AIO6V3MK.mjs.map +0 -7
  169. package/dist/lib/browser/react-context-G6PDXUI5.mjs +0 -32
  170. package/dist/lib/browser/react-context-G6PDXUI5.mjs.map +0 -7
  171. package/dist/lib/browser/react-root-AWYSGU4Q.mjs.map +0 -7
  172. package/dist/lib/browser/react-surface-CLUABFNX.mjs +0 -28
  173. package/dist/lib/browser/react-surface-CLUABFNX.mjs.map +0 -7
  174. package/dist/lib/browser/settings-FNWW6WIJ.mjs.map +0 -7
  175. package/dist/lib/browser/state-7I5BD7SE.mjs +0 -34
  176. package/dist/lib/browser/state-7I5BD7SE.mjs.map +0 -7
  177. package/dist/lib/browser/tools-4XY7KFQF.mjs.map +0 -7
  178. package/dist/lib/browser/url-handler-JRAQRY73.mjs +0 -76
  179. package/dist/lib/browser/url-handler-JRAQRY73.mjs.map +0 -7
  180. package/dist/types/src/capabilities/layout/app-graph-builder.d.ts +0 -181
  181. package/dist/types/src/capabilities/layout/app-graph-builder.d.ts.map +0 -1
  182. package/dist/types/src/capabilities/layout/deck.d.ts +0 -4
  183. package/dist/types/src/capabilities/layout/deck.d.ts.map +0 -1
  184. package/dist/types/src/capabilities/layout/index.d.ts +0 -229
  185. package/dist/types/src/capabilities/layout/index.d.ts.map +0 -1
  186. package/dist/types/src/capabilities/layout/intent-resolver.d.ts.map +0 -1
  187. package/dist/types/src/capabilities/layout/react-context.d.ts +0 -8
  188. package/dist/types/src/capabilities/layout/react-context.d.ts.map +0 -1
  189. package/dist/types/src/capabilities/layout/react-root.d.ts.map +0 -1
  190. package/dist/types/src/capabilities/layout/state.d.ts +0 -42
  191. package/dist/types/src/capabilities/layout/state.d.ts.map +0 -1
  192. package/dist/types/src/capabilities/navigation/check-app-scheme.d.ts.map +0 -1
  193. package/dist/types/src/capabilities/navigation/index.d.ts +0 -6
  194. package/dist/types/src/capabilities/navigation/index.d.ts.map +0 -1
  195. package/dist/types/src/capabilities/navigation/intent-resolver.d.ts +0 -4
  196. package/dist/types/src/capabilities/navigation/intent-resolver.d.ts.map +0 -1
  197. package/dist/types/src/capabilities/navigation/location.d.ts +0 -4
  198. package/dist/types/src/capabilities/navigation/location.d.ts.map +0 -1
  199. package/dist/types/src/capabilities/navigation/set-location.d.ts +0 -10
  200. package/dist/types/src/capabilities/navigation/set-location.d.ts.map +0 -1
  201. package/dist/types/src/capabilities/navigation/tools.d.ts.map +0 -1
  202. package/dist/types/src/capabilities/navigation/url-handler.d.ts.map +0 -1
  203. package/dist/types/src/capabilities/settings/index.d.ts +0 -3
  204. package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
  205. package/dist/types/src/capabilities/settings/react-surface.d.ts.map +0 -1
  206. package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
  207. package/dist/types/src/components/DeckContext.d.ts +0 -11
  208. package/dist/types/src/components/DeckContext.d.ts.map +0 -1
  209. package/dist/types/src/components/LayoutContext.d.ts +0 -5
  210. package/dist/types/src/components/LayoutContext.d.ts.map +0 -1
  211. package/dist/types/src/layout.test.d.ts +0 -2
  212. package/dist/types/src/layout.test.d.ts.map +0 -1
  213. package/dist/types/src/util/layout-parts.d.ts +0 -7
  214. package/dist/types/src/util/layout-parts.d.ts.map +0 -1
  215. package/src/capabilities/layout/deck.ts +0 -25
  216. package/src/capabilities/layout/index.ts +0 -12
  217. package/src/capabilities/layout/intent-resolver.ts +0 -128
  218. package/src/capabilities/layout/react-context.tsx +0 -26
  219. package/src/capabilities/layout/state.ts +0 -32
  220. package/src/capabilities/navigation/index.ts +0 -11
  221. package/src/capabilities/navigation/intent-resolver.ts +0 -216
  222. package/src/capabilities/navigation/location.ts +0 -28
  223. package/src/capabilities/navigation/set-location.ts +0 -38
  224. package/src/capabilities/navigation/url-handler.ts +0 -67
  225. package/src/capabilities/settings/index.ts +0 -8
  226. package/src/capabilities/settings/react-surface.tsx +0 -23
  227. package/src/components/DeckContext.ts +0 -19
  228. package/src/components/LayoutContext.ts +0 -12
  229. package/src/layout.test.ts +0 -380
  230. package/src/util/layout-parts.ts +0 -12
  231. /package/dist/types/src/capabilities/{navigation/check-app-scheme.d.ts → check-app-scheme.d.ts} +0 -0
  232. /package/dist/types/src/capabilities/{layout/intent-resolver.d.ts → intent-resolver.d.ts} +0 -0
  233. /package/dist/types/src/capabilities/{layout/react-root.d.ts → react-root.d.ts} +0 -0
  234. /package/dist/types/src/capabilities/{settings/react-surface.d.ts → react-surface.d.ts} +0 -0
  235. /package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +0 -0
  236. /package/dist/types/src/capabilities/{navigation/url-handler.d.ts → url-handler.d.ts} +0 -0
@@ -1,186 +0,0 @@
1
- // packages/plugins/plugin-deck/src/capabilities/navigation/set-location.ts
2
- import { openIds } from "@dxos/app-framework";
3
- var setLocation = ({ next, location, layout, attention }) => {
4
- const part = layout.layoutMode === "solo" ? "solo" : "main";
5
- const ids = openIds(next, [
6
- part
7
- ]);
8
- const current = openIds(location.active, [
9
- part
10
- ]);
11
- const removed = current.filter((id) => !ids.includes(id));
12
- const closed = Array.from(/* @__PURE__ */ new Set([
13
- ...location.closed.filter((id) => !ids.includes(id)),
14
- ...removed
15
- ]));
16
- location.closed = closed;
17
- location.active = next;
18
- if (attention) {
19
- const attended = attention.current;
20
- const [attendedId] = Array.from(attended);
21
- const isAttendedAvailable = !!attendedId && ids.includes(attendedId);
22
- if (!isAttendedAvailable) {
23
- const currentIds = location.active[part]?.map(({ id }) => id) ?? [];
24
- const attendedIndex = currentIds.indexOf(attendedId);
25
- const index = attendedIndex === -1 ? 0 : attendedIndex >= ids.length ? ids.length - 1 : attendedIndex;
26
- return next[part]?.[index].id;
27
- }
28
- }
29
- };
30
-
31
- // packages/plugins/plugin-deck/src/layout.ts
32
- import { produce } from "immer";
33
- import { SLUG_ENTRY_SEPARATOR, SLUG_KEY_VALUE_SEPARATOR, SLUG_LIST_SEPARATOR, SLUG_PATH_SEPARATOR } from "@dxos/app-framework";
34
- var partsThatSupportIncrement = [
35
- "main"
36
- ];
37
- var openEntry = (layout, part, entry, options) => {
38
- return produce(layout, (draft) => {
39
- const layoutPart = draft[part];
40
- if (!layoutPart) {
41
- draft[part] = [
42
- entry
43
- ];
44
- return;
45
- }
46
- if (part === "main") {
47
- if (layoutPart.find((e) => e.id === entry.id)) {
48
- return;
49
- }
50
- const plankPositioning = options?.positioning ?? "start";
51
- const pivotId = options?.pivotId;
52
- if (pivotId) {
53
- const pivotIndex = layoutPart.findIndex((e) => e.id === pivotId);
54
- if (pivotIndex !== -1) {
55
- if (plankPositioning === "start") {
56
- layoutPart.splice(pivotIndex, 0, entry);
57
- } else {
58
- layoutPart.splice(pivotIndex + 1, 0, entry);
59
- }
60
- return;
61
- }
62
- }
63
- if (plankPositioning === "start") {
64
- layoutPart.unshift(entry);
65
- } else {
66
- layoutPart.push(entry);
67
- }
68
- } else {
69
- draft[part] = [
70
- entry
71
- ];
72
- }
73
- });
74
- };
75
- var closeEntry = (layout, layoutCoordinate) => {
76
- return produce(layout, (draft) => {
77
- const { part, entryId: slugId } = layoutCoordinate;
78
- const layoutPart = draft[part];
79
- if (!layoutPart) {
80
- return;
81
- }
82
- const index = layoutPart.findIndex((entry) => entry.id === slugId);
83
- if (index === -1) {
84
- return;
85
- }
86
- if (layoutPart.length === 1) {
87
- delete draft[part];
88
- } else {
89
- layoutPart.splice(index, 1);
90
- }
91
- });
92
- };
93
- var incrementPlank = (layout, adjustment) => {
94
- return produce(layout, (draft) => {
95
- const { layoutCoordinate, type } = adjustment;
96
- const { part, entryId } = layoutCoordinate;
97
- if (partsThatSupportIncrement.includes(part) === false) {
98
- return;
99
- }
100
- const layoutPart = draft[part];
101
- if (!layoutPart) {
102
- return;
103
- }
104
- const index = layoutPart.findIndex((entry) => entry.id === entryId);
105
- if (index === -1 || type === "increment-start" && index === 0 || type === "increment-end" && index === layoutPart.length - 1) {
106
- return;
107
- }
108
- if (type === "increment-start") {
109
- [layoutPart[index - 1], layoutPart[index]] = [
110
- layoutPart[index],
111
- layoutPart[index - 1]
112
- ];
113
- } else if (type === "increment-end") {
114
- [layoutPart[index], layoutPart[index + 1]] = [
115
- layoutPart[index + 1],
116
- layoutPart[index]
117
- ];
118
- }
119
- });
120
- };
121
- var removePart = (layout, part) => {
122
- return produce(layout, (draft) => {
123
- delete draft[part];
124
- });
125
- };
126
- var mergeLayoutParts = (...layoutParts) => {
127
- return layoutParts.reduce((merged, current) => produce(merged, (draft) => {
128
- Object.entries(current).forEach(([part, entries]) => {
129
- const typedPart = part;
130
- if (!draft[typedPart]) {
131
- draft[typedPart] = [];
132
- }
133
- const partEntries = draft[typedPart];
134
- entries.forEach((entry) => {
135
- const existingIndex = partEntries.findIndex((e) => e.id === entry.id);
136
- if (existingIndex !== -1) {
137
- partEntries[existingIndex] = entry;
138
- } else {
139
- partEntries.push(entry);
140
- }
141
- });
142
- });
143
- }), {});
144
- };
145
- var parseLayoutEntry = (itemString) => {
146
- const [id, path] = itemString.split(SLUG_PATH_SEPARATOR);
147
- const entry = {
148
- id
149
- };
150
- if (path) {
151
- entry.path = path;
152
- }
153
- return entry;
154
- };
155
- var uriToSoloPart = (uri) => {
156
- const parts = uri.split("/");
157
- const slug = parts[parts.length - 1];
158
- if (slug.length > 0) {
159
- return {
160
- solo: [
161
- parseLayoutEntry(slug)
162
- ]
163
- };
164
- }
165
- return void 0;
166
- };
167
- var soloPartToUri = (layout) => {
168
- const soloPart = layout?.solo;
169
- if (!soloPart || soloPart.length === 0) {
170
- return "";
171
- }
172
- const entry = soloPart[0];
173
- return `${entry.id}${entry.path ? SLUG_PATH_SEPARATOR + entry.path : ""}`;
174
- };
175
-
176
- export {
177
- setLocation,
178
- openEntry,
179
- closeEntry,
180
- incrementPlank,
181
- removePart,
182
- mergeLayoutParts,
183
- uriToSoloPart,
184
- soloPartToUri
185
- };
186
- //# sourceMappingURL=chunk-4C2AFTET.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/navigation/set-location.ts", "../../../src/layout.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { openIds, type Layout, type LayoutParts, type Capabilities } from '@dxos/app-framework';\nimport { type AttentionManager } from '@dxos/plugin-attention';\n\nexport type SetLocationOptions = {\n next: LayoutParts;\n location: Capabilities.MutableLocation;\n layout: Layout;\n attention?: AttentionManager;\n};\n\nexport const setLocation = ({ next, location, layout, attention }: SetLocationOptions) => {\n const part = layout.layoutMode === 'solo' ? 'solo' : 'main';\n const ids = openIds(next, [part]);\n\n const current = openIds(location.active, [part]);\n const removed = current.filter((id) => !ids.includes(id));\n const closed = Array.from(new Set([...location.closed.filter((id) => !ids.includes(id)), ...removed]));\n\n location.closed = closed;\n location.active = next;\n\n if (attention) {\n const attended = attention.current;\n const [attendedId] = Array.from(attended);\n const isAttendedAvailable = !!attendedId && ids.includes(attendedId);\n if (!isAttendedAvailable) {\n const currentIds = location.active[part]?.map(({ id }) => id) ?? [];\n const attendedIndex = currentIds.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 >= ids.length ? ids.length - 1 : attendedIndex;\n return next[part]?.[index].id;\n }\n }\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { produce } from 'immer';\n\nimport {\n type LayoutAdjustment,\n type LayoutCoordinate,\n type LayoutEntry,\n type LayoutPart,\n type LayoutParts,\n SLUG_ENTRY_SEPARATOR,\n SLUG_KEY_VALUE_SEPARATOR,\n SLUG_LIST_SEPARATOR,\n SLUG_PATH_SEPARATOR,\n} from '@dxos/app-framework';\n\nimport { type NewPlankPositioning } from './types';\n\n// Part feature support\nconst partsThatSupportIncrement = ['main'] as LayoutPart[];\n\n//\n// --- Layout Parts Manipulation ----------------------------------------------\n\ntype OpenLayoutEntryOptions = { positioning?: NewPlankPositioning; pivotId?: string };\n\nexport const openEntry = (\n layout: LayoutParts,\n part: LayoutPart,\n entry: LayoutEntry,\n options?: OpenLayoutEntryOptions,\n): LayoutParts => {\n return produce(layout, (draft) => {\n const layoutPart = draft[part];\n // If the part doesn't exist, create it.\n if (!layoutPart) {\n draft[part] = [entry];\n return;\n }\n if (part === 'main') {\n // Check that the entry is not already in the part\n if (layoutPart.find((e) => e.id === entry.id)) {\n return;\n }\n\n const plankPositioning = options?.positioning ?? 'start';\n const pivotId = options?.pivotId;\n\n if (pivotId) {\n const pivotIndex = layoutPart.findIndex((e) => e.id === pivotId);\n if (pivotIndex !== -1) {\n if (plankPositioning === 'start') {\n layoutPart.splice(pivotIndex, 0, entry);\n } else {\n layoutPart.splice(pivotIndex + 1, 0, entry);\n }\n return;\n }\n }\n\n // If no pivot found or provided, fall back to original behavior\n if (plankPositioning === 'start') {\n layoutPart.unshift(entry);\n } else {\n layoutPart.push(entry);\n }\n } else {\n // If the part is not main, we're going to replace the single entry in the part with the new entry.\n draft[part] = [entry];\n }\n });\n};\n\nexport const closeEntry = (layout: LayoutParts, layoutCoordinate: LayoutCoordinate): LayoutParts => {\n return produce(layout, (draft) => {\n const { part, entryId: slugId } = layoutCoordinate;\n const layoutPart = draft[part];\n if (!layoutPart) {\n return;\n }\n\n const index = layoutPart.findIndex((entry) => entry.id === slugId);\n if (index === -1) {\n return;\n }\n\n // If there's only one entry in the layout part, remove the whole part from the layout.\n if (layoutPart.length === 1) {\n delete draft[part];\n } else {\n layoutPart.splice(index, 1);\n }\n });\n};\n\nexport const incrementPlank = (layout: LayoutParts, adjustment: LayoutAdjustment): LayoutParts => {\n return produce(layout, (draft) => {\n const { layoutCoordinate, type } = adjustment;\n const { part, entryId } = layoutCoordinate;\n\n // Only allow adjustments in the 'main' part\n if (partsThatSupportIncrement.includes(part) === false) {\n return;\n }\n\n const layoutPart = draft[part];\n if (!layoutPart) {\n return;\n }\n const index = layoutPart.findIndex((entry) => entry.id === entryId);\n if (\n index === -1 ||\n (type === 'increment-start' && index === 0) ||\n (type === 'increment-end' && index === layoutPart.length - 1)\n ) {\n return;\n }\n\n if (type === 'increment-start') {\n // Swap the current item with the previous item.\n [layoutPart[index - 1], layoutPart[index]] = [layoutPart[index], layoutPart[index - 1]];\n } else if (type === 'increment-end') {\n // Swap the current item with the next item.\n [layoutPart[index], layoutPart[index + 1]] = [layoutPart[index + 1], layoutPart[index]];\n }\n });\n};\n\nexport const removePart = (layout: LayoutParts, part: LayoutPart): LayoutParts => {\n return produce(layout, (draft) => {\n delete draft[part];\n });\n};\n\nexport const mergeLayoutParts = (...layoutParts: LayoutParts[]): LayoutParts => {\n return layoutParts.reduce(\n (merged, current) =>\n produce(merged, (draft) => {\n Object.entries(current).forEach(([part, entries]) => {\n const typedPart = part as LayoutPart;\n\n if (!draft[typedPart]) {\n draft[typedPart] = [];\n }\n\n const partEntries = draft[typedPart] as LayoutEntry[];\n\n entries.forEach((entry) => {\n const existingIndex = partEntries.findIndex((e) => e.id === entry.id);\n if (existingIndex !== -1) {\n partEntries[existingIndex] = entry;\n } else {\n partEntries.push(entry);\n }\n });\n });\n }),\n {} as LayoutParts,\n );\n};\n\n//\n// URI Projection\n//\n\nconst parseLayoutEntry = (itemString: string): LayoutEntry => {\n // Layout entries are in the form of 'id~path' or just 'id'\n const [id, path] = itemString.split(SLUG_PATH_SEPARATOR);\n const entry: LayoutEntry = { id };\n if (path) {\n entry.path = path;\n }\n return entry;\n};\n\nexport const uriToSoloPart = (uri: string): LayoutParts | undefined => {\n // Now after the domain part, there will be a single ID with an optional path\n const parts = uri.split('/');\n const slug = parts[parts.length - 1]; // Take the last part of the URI\n\n if (slug.length > 0) {\n return {\n solo: [parseLayoutEntry(slug)],\n };\n }\n\n return undefined;\n};\n\nexport const soloPartToUri = (layout: LayoutParts): string => {\n const soloPart = layout?.solo;\n if (!soloPart || soloPart.length === 0) {\n return '';\n }\n\n const entry = soloPart[0];\n return `${entry.id}${entry.path ? SLUG_PATH_SEPARATOR + entry.path : ''}`;\n};\n\n/**\n * Converts a URI string into a LayoutParts object.\n * @deprecated Keeping these as a reference for now. We should remove these once we're sure we don't need them.\n */\nexport const uriToActiveParts = (uri: string): LayoutParts => {\n const parts = uri.split('/');\n const slug = parts[parts.length - 1]; // Take the last part of the URI\n\n if (!slug) {\n return {}; // Return an empty object if the slug is empty\n }\n\n return slug.split(SLUG_ENTRY_SEPARATOR).reduce((acc: LayoutParts, partDescriptor) => {\n const [part, layoutEntry] = partDescriptor.split(SLUG_KEY_VALUE_SEPARATOR);\n if (part && layoutEntry) {\n // TODO(Zan): Remove this cast.\n acc[part as LayoutPart] = layoutEntry.split(SLUG_LIST_SEPARATOR).map(parseLayoutEntry);\n }\n return acc;\n }, {} as LayoutParts);\n};\n\nconst formatLayoutEntry = ({ id, path }: LayoutEntry): string => {\n // NOTE(Zan): Format = `[SOLO_INDICATOR] ID [PATH_SEPARATOR PATH]`.\n let entry = '';\n entry += id;\n if (path) {\n entry += `${SLUG_PATH_SEPARATOR}${path}`;\n }\n return entry;\n};\n\nconst formatPartDescriptor = (part: LayoutPart, layoutEntries: LayoutEntry[]): string => {\n const formattedEntries = layoutEntries.map(formatLayoutEntry).join(SLUG_LIST_SEPARATOR);\n return `${part}${SLUG_KEY_VALUE_SEPARATOR}${formattedEntries}`;\n};\n\n/**\n * Converts a LayoutParts object into a URI string.\n * @deprecated Keeping these as a reference for now. We should remove these once we're sure we don't need them.\n */\nexport const activePartsToUri = (activeParts: LayoutParts): string => {\n return Object.entries(activeParts)\n .filter(([, layoutEntries]) => layoutEntries.length > 0) // Only include non-empty parts\n .map(([part, layoutEntries]) => formatPartDescriptor(part as LayoutPart, layoutEntries))\n .join(SLUG_ENTRY_SEPARATOR);\n};\n"],
5
- "mappings": ";AAIA,SAASA,eAAiE;AAUnE,IAAMC,cAAc,CAAC,EAAEC,MAAMC,UAAUC,QAAQC,UAAS,MAAsB;AACnF,QAAMC,OAAOF,OAAOG,eAAe,SAAS,SAAS;AACrD,QAAMC,MAAMC,QAAQP,MAAM;IAACI;GAAK;AAEhC,QAAMI,UAAUD,QAAQN,SAASQ,QAAQ;IAACL;GAAK;AAC/C,QAAMM,UAAUF,QAAQG,OAAO,CAACC,OAAO,CAACN,IAAIO,SAASD,EAAAA,CAAAA;AACrD,QAAME,SAASC,MAAMC,KAAK,oBAAIC,IAAI;OAAIhB,SAASa,OAAOH,OAAO,CAACC,OAAO,CAACN,IAAIO,SAASD,EAAAA,CAAAA;OAASF;GAAQ,CAAA;AAEpGT,WAASa,SAASA;AAClBb,WAASQ,SAAST;AAElB,MAAIG,WAAW;AACb,UAAMe,WAAWf,UAAUK;AAC3B,UAAM,CAACW,UAAAA,IAAcJ,MAA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,GAAG;AACnB,WAAO;MACL0B,MAAM;QAACT,iBAAiBQ,IAAAA;;IAC1B;EACF;AAEA,SAAOE;AACT;AAEO,IAAMC,gBAAgB,CAACnD,WAAAA;AAC5B,QAAMoD,WAAWpD,QAAQiD;AACzB,MAAI,CAACG,YAAYA,SAAS7B,WAAW,GAAG;AACtC,WAAO;EACT;AAEA,QAAMrB,QAAQkD,SAAS,CAAA;AACvB,SAAO,GAAGlD,MAAMO,EAAE,GAAGP,MAAMwC,OAAOE,sBAAsB1C,MAAMwC,OAAO,EAAA;AACvE;",
6
- "names": ["openIds", "setLocation", "next", "location", "layout", "attention", "part", "layoutMode", "ids", "openIds", "current", "active", "removed", "filter", "id", "includes", "closed", "Array", "from", "Set", "attended", "attendedId", "isAttendedAvailable", "currentIds", "map", "attendedIndex", "indexOf", "index", "length", "produce", "SLUG_ENTRY_SEPARATOR", "SLUG_KEY_VALUE_SEPARATOR", "SLUG_LIST_SEPARATOR", "SLUG_PATH_SEPARATOR", "partsThatSupportIncrement", "openEntry", "layout", "part", "entry", "options", "produce", "draft", "layoutPart", "find", "e", "id", "plankPositioning", "positioning", "pivotId", "pivotIndex", "findIndex", "splice", "unshift", "push", "closeEntry", "layoutCoordinate", "entryId", "slugId", "index", "length", "incrementPlank", "adjustment", "type", "includes", "removePart", "mergeLayoutParts", "layoutParts", "reduce", "merged", "current", "Object", "entries", "forEach", "typedPart", "partEntries", "existingIndex", "parseLayoutEntry", "itemString", "path", "split", "SLUG_PATH_SEPARATOR", "uriToSoloPart", "uri", "parts", "slug", "solo", "undefined", "soloPartToUri", "soloPart"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/capabilities.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability, type Label } from '@dxos/app-framework';\nimport { type DeepReadonly } from '@dxos/util';\n\nimport { type DeckContextType } from '../components';\nimport { DECK_PLUGIN } from '../meta';\n\nexport namespace DeckCapabilities {\n export const DeckState = defineCapability<DeepReadonly<DeckContextType>>(`${DECK_PLUGIN}/capability/state`);\n export const MutableDeckState = defineCapability<DeckContextType>(`${DECK_PLUGIN}/capability/state`);\n export const ComplementaryPanel = defineCapability<{ id: string; label: Label; icon: string }>(\n `${DECK_PLUGIN}/capability/complementary-panel`,\n );\n}\n"],
5
- "mappings": ";;;;;AAIA,SAASA,wBAAoC;;UAM5BC,mBAAAA;oBACFC,YAAYC,iBAAgD,GAAGC,WAAAA,mBAA8B;oBAC7FC,mBAAmBF,iBAAkC,GAAGC,WAAAA,mBAA8B;oBACtFE,qBAAqBH,iBAChC,GAAGC,WAAAA,iCAA4C;AAEnD,GANiBH,qBAAAA,mBAAAA,CAAAA,EAAAA;",
6
- "names": ["defineCapability", "DeckCapabilities", "DeckState", "defineCapability", "DECK_PLUGIN", "MutableDeckState", "ComplementaryPanel"]
7
- }
@@ -1,44 +0,0 @@
1
- import {
2
- DECK_PLUGIN
3
- } from "./chunk-JQJ5UWVB.mjs";
4
-
5
- // packages/plugins/plugin-deck/src/types.ts
6
- import { S } from "@dxos/echo-schema";
7
- var NewPlankPositions = [
8
- "start",
9
- "end"
10
- ];
11
- var OverscrollOptions = [
12
- "none",
13
- "centering"
14
- ];
15
- var DeckSettingsSchema = S.mutable(S.Struct({
16
- showHints: S.Boolean,
17
- customSlots: S.Boolean,
18
- flatDeck: S.Boolean,
19
- enableNativeRedirect: S.Boolean,
20
- newPlankPositioning: S.Literal(...NewPlankPositions),
21
- overscroll: S.Literal(...OverscrollOptions)
22
- }));
23
- var DECK_ACTION = `${DECK_PLUGIN}/action`;
24
- var DeckAction;
25
- (function(DeckAction2) {
26
- class UpdatePlankSize extends S.TaggedClass()(`${DECK_ACTION}/update-plank-size`, {
27
- input: S.Struct({
28
- id: S.String,
29
- size: S.Number
30
- }),
31
- output: S.Void
32
- }) {
33
- }
34
- DeckAction2.UpdatePlankSize = UpdatePlankSize;
35
- })(DeckAction || (DeckAction = {}));
36
-
37
- export {
38
- NewPlankPositions,
39
- OverscrollOptions,
40
- DeckSettingsSchema,
41
- DECK_ACTION,
42
- DeckAction
43
- };
44
- //# sourceMappingURL=chunk-KY5WXIXY.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { S } from '@dxos/echo-schema';\nimport { type Label } from '@dxos/react-ui';\n\nimport { DECK_PLUGIN } from './meta';\n\n// TODO(Zan): In the future we should consider adding new planks adjacent to the attended plank.\nexport const NewPlankPositions = ['start', 'end'] as const;\nexport type NewPlankPositioning = (typeof NewPlankPositions)[number];\n\nexport const OverscrollOptions = ['none', 'centering'] as const;\nexport type Overscroll = (typeof OverscrollOptions)[number];\n\n// TODO(wittjosiah): Include a predicate for whether the panel is visible for the current subject.\nexport type Panel = { id: string; label: Label; icon: string };\n\nexport const DeckSettingsSchema = S.mutable(\n S.Struct({\n showHints: S.Boolean,\n customSlots: S.Boolean,\n flatDeck: S.Boolean,\n enableNativeRedirect: S.Boolean,\n newPlankPositioning: S.Literal(...NewPlankPositions),\n overscroll: S.Literal(...OverscrollOptions),\n }),\n);\n\nexport type DeckSettingsProps = S.Schema.Type<typeof DeckSettingsSchema>;\n\nexport const DECK_ACTION = `${DECK_PLUGIN}/action`;\n\nexport namespace DeckAction {\n export class UpdatePlankSize extends S.TaggedClass<UpdatePlankSize>()(`${DECK_ACTION}/update-plank-size`, {\n input: S.Struct({\n id: S.String,\n size: S.Number,\n }),\n output: S.Void,\n }) {}\n}\n"],
5
- "mappings": ";;;;;AAIA,SAASA,SAAS;AAMX,IAAMC,oBAAoB;EAAC;EAAS;;AAGpC,IAAMC,oBAAoB;EAAC;EAAQ;;AAMnC,IAAMC,qBAAqBC,EAAEC,QAClCD,EAAEE,OAAO;EACPC,WAAWH,EAAEI;EACbC,aAAaL,EAAEI;EACfE,UAAUN,EAAEI;EACZG,sBAAsBP,EAAEI;EACxBI,qBAAqBR,EAAES,QAAO,GAAIZ,iBAAAA;EAClCa,YAAYV,EAAES,QAAO,GAAIX,iBAAAA;AAC3B,CAAA,CAAA;AAKK,IAAMa,cAAc,GAAGC,WAAAA;;UAEbC,aAAAA;EACR,MAAMC,wBAAwBd,EAAEe,YAAW,EAAoB,GAAGJ,WAAAA,sBAAiC;IACxGK,OAAOhB,EAAEE,OAAO;MACde,IAAIjB,EAAEkB;MACNC,MAAMnB,EAAEoB;IACV,CAAA;IACAC,QAAQrB,EAAEsB;EACZ,CAAA,EAAA;EAAI;cANSR,kBAAAA;AAOf,GARiBD,eAAAA,aAAAA,CAAAA,EAAAA;",
6
- "names": ["S", "NewPlankPositions", "OverscrollOptions", "DeckSettingsSchema", "S", "mutable", "Struct", "showHints", "Boolean", "customSlots", "flatDeck", "enableNativeRedirect", "newPlankPositioning", "Literal", "overscroll", "DECK_ACTION", "DECK_PLUGIN", "DeckAction", "UpdatePlankSize", "TaggedClass", "input", "id", "String", "size", "Number", "output", "Void"]
7
- }