@alfadocs/ui-kit 1.42.0 → 1.44.0

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 (126) hide show
  1. package/dist/_chunks/{calendar-ChJQzRw-.js → calendar-U6N0F99w.js} +383 -359
  2. package/dist/_chunks/calendar-workspace-DBYAtdyd.js +12161 -0
  3. package/dist/_chunks/control-room-rail-Cv7GpMqX.js +354 -0
  4. package/dist/_chunks/{face-scheme-Dg6ZyLKb.js → face-scheme-Bm6pe7R8.js} +265 -275
  5. package/dist/_chunks/help-me-write-templates-GUeEn3Ff.js +741 -0
  6. package/dist/_chunks/{marketplace-app-shell-D_g9BaDI.js → marketplace-app-shell-DdwPj03y.js} +3 -3
  7. package/dist/_chunks/{notes-panel-CRAovkjx.js → notes-panel-CY4KmDo-.js} +159 -152
  8. package/dist/_chunks/{panel-subview-PMBRPFOa.js → panel-subview-CYnuX-KR.js} +61 -40
  9. package/dist/_chunks/rich-text-editor-BYE6kK4u.js +3839 -0
  10. package/dist/_chunks/{sidebar-ClTY9lLI.js → sidebar-DbZXLl8h.js} +2 -2
  11. package/dist/_chunks/tab-bar-Cw9UK18Z.js +228 -0
  12. package/dist/_chunks/{tool-rail-D89USYE6.js → tool-rail-CCFqDfAn.js} +282 -276
  13. package/dist/_chunks/undo-2-CYNAzclj.js +26 -0
  14. package/dist/_chunks/use-edge-resize-BHesP0kg.js +149 -0
  15. package/dist/_chunks/use-scroll-overflow-UbLrUfBo.js +72 -0
  16. package/dist/_chunks/variables-menu-vXUaSBj4.js +401 -0
  17. package/dist/agent-catalog.json +84 -3
  18. package/dist/agent-i18n/en.json +14 -3
  19. package/dist/components/calendar/calendar.d.ts +6 -0
  20. package/dist/components/calendar/index.js +1 -1
  21. package/dist/components/control-room-rail/control-room-rail.d.ts +9 -0
  22. package/dist/components/control-room-rail/index.js +1 -1
  23. package/dist/components/face-scheme/index.js +1 -1
  24. package/dist/components/index.d.ts +1 -0
  25. package/dist/components/notes-panel/index.js +1 -1
  26. package/dist/components/notes-panel/notes-panel.d.ts +4 -0
  27. package/dist/components/panel-subview/index.js +1 -1
  28. package/dist/components/panel-subview/panel-subview.d.ts +6 -0
  29. package/dist/components/rich-text-editor/editor-toolbar.d.ts +35 -3
  30. package/dist/components/rich-text-editor/index.d.ts +1 -1
  31. package/dist/components/rich-text-editor/index.js +1 -1
  32. package/dist/components/rich-text-editor/rich-text-editor.d.ts +98 -15
  33. package/dist/components/sidebar/index.js +1 -1
  34. package/dist/components/tab-bar/index.js +1 -1
  35. package/dist/components/tool-rail/index.js +1 -1
  36. package/dist/components/tool-rail/tool-rail.d.ts +16 -0
  37. package/dist/components/variables-menu/index.d.ts +4 -0
  38. package/dist/components/variables-menu/index.js +6 -0
  39. package/dist/components/variables-menu/variables-menu.agent.d.ts +10 -0
  40. package/dist/components/variables-menu/variables-menu.d.ts +53 -0
  41. package/dist/hooks/index.d.ts +2 -0
  42. package/dist/hooks/index.js +35 -32
  43. package/dist/hooks/use-edge-resize.d.ts +13 -1
  44. package/dist/host-compat.css +5 -5
  45. package/dist/i18n/locales/ar.d.ts +77 -6
  46. package/dist/i18n/locales/ar.js +78 -7
  47. package/dist/i18n/locales/de.d.ts +77 -6
  48. package/dist/i18n/locales/de.js +78 -7
  49. package/dist/i18n/locales/el.d.ts +77 -6
  50. package/dist/i18n/locales/el.js +78 -7
  51. package/dist/i18n/locales/en.d.ts +77 -6
  52. package/dist/i18n/locales/en.js +85 -7
  53. package/dist/i18n/locales/es.d.ts +77 -6
  54. package/dist/i18n/locales/es.js +78 -7
  55. package/dist/i18n/locales/fr.d.ts +77 -6
  56. package/dist/i18n/locales/fr.js +78 -7
  57. package/dist/i18n/locales/hi.d.ts +77 -6
  58. package/dist/i18n/locales/hi.js +78 -7
  59. package/dist/i18n/locales/it.d.ts +77 -6
  60. package/dist/i18n/locales/it.js +78 -7
  61. package/dist/i18n/locales/ja.d.ts +77 -6
  62. package/dist/i18n/locales/ja.js +78 -7
  63. package/dist/i18n/locales/nl.d.ts +77 -6
  64. package/dist/i18n/locales/nl.js +78 -7
  65. package/dist/i18n/locales/pl.d.ts +77 -6
  66. package/dist/i18n/locales/pl.js +78 -7
  67. package/dist/i18n/locales/pt.d.ts +77 -6
  68. package/dist/i18n/locales/pt.js +78 -7
  69. package/dist/i18n/locales/ro.d.ts +77 -6
  70. package/dist/i18n/locales/ro.js +78 -7
  71. package/dist/i18n/locales/ru.d.ts +77 -6
  72. package/dist/i18n/locales/ru.js +78 -7
  73. package/dist/i18n/locales/sq.d.ts +77 -6
  74. package/dist/i18n/locales/sq.js +78 -7
  75. package/dist/i18n/locales/sv.d.ts +77 -6
  76. package/dist/i18n/locales/sv.js +78 -7
  77. package/dist/i18n/locales/tr.d.ts +77 -6
  78. package/dist/i18n/locales/tr.js +78 -7
  79. package/dist/i18n/locales/zh.d.ts +77 -6
  80. package/dist/i18n/locales/zh.js +78 -7
  81. package/dist/index.js +916 -913
  82. package/dist/locales/ar.json +78 -7
  83. package/dist/locales/de.json +78 -7
  84. package/dist/locales/el.json +78 -7
  85. package/dist/locales/en.json +78 -7
  86. package/dist/locales/es.json +78 -7
  87. package/dist/locales/fr.json +78 -7
  88. package/dist/locales/hi.json +78 -7
  89. package/dist/locales/it.json +78 -7
  90. package/dist/locales/ja.json +78 -7
  91. package/dist/locales/nl.json +78 -7
  92. package/dist/locales/pl.json +78 -7
  93. package/dist/locales/pt.json +78 -7
  94. package/dist/locales/ro.json +78 -7
  95. package/dist/locales/ru.json +78 -7
  96. package/dist/locales/sq.json +78 -7
  97. package/dist/locales/sv.json +78 -7
  98. package/dist/locales/tr.json +78 -7
  99. package/dist/locales/zh.json +78 -7
  100. package/dist/patterns/calendar/calendar-bookings-panel.d.ts +8 -3
  101. package/dist/patterns/calendar/calendar-care-rules.d.ts +49 -0
  102. package/dist/patterns/calendar/calendar-task-editor.d.ts +31 -0
  103. package/dist/patterns/calendar/calendar-workspace.d.ts +8 -1
  104. package/dist/patterns/calendar/calendar-workspace.model.d.ts +39 -12
  105. package/dist/patterns/calendar/calendar.data.d.ts +9 -0
  106. package/dist/patterns/calendar/calendar.journey.d.ts +35 -3
  107. package/dist/patterns/calendar/calendar.model.d.ts +23 -1
  108. package/dist/patterns/calendar/calendar.sheets.d.ts +21 -3
  109. package/dist/patterns/calendar/calendar.surface.d.ts +6 -1
  110. package/dist/patterns/calendar/calendar.types.d.ts +32 -1
  111. package/dist/patterns/calendar/index.js +1 -1
  112. package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +58 -26
  113. package/dist/patterns/help-me-write-templates/index.d.ts +1 -1
  114. package/dist/patterns/help-me-write-templates/index.js +1 -1
  115. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  116. package/dist/tokens.css +6 -6
  117. package/package.json +5 -1
  118. package/dist/_chunks/calendar-workspace-qlxrxCqm.js +0 -11392
  119. package/dist/_chunks/control-room-rail-CnNZusR5.js +0 -337
  120. package/dist/_chunks/help-me-write-templates-B-m7zgJa.js +0 -775
  121. package/dist/_chunks/highlighter-DSkckT2Q.js +0 -15
  122. package/dist/_chunks/rich-text-editor-DUMeifwc.js +0 -3176
  123. package/dist/_chunks/tab-bar-rDkLiaA6.js +0 -268
  124. package/dist/_chunks/use-edge-resize-ZnGG7gyO.js +0 -139
  125. package/dist/_chunks/use-overflow-collapse-BIOzKbni.js +0 -32
  126. package/dist/_chunks/wand-sparkles-DAjKyhz7.js +0 -27
@@ -1,337 +0,0 @@
1
- import { jsx as h, jsxs as D, Fragment as lo } from "react/jsx-runtime";
2
- import { useState as _, useCallback as g, useMemo as T, useRef as B, useContext as H, useId as io, useEffect as ao, createContext as co, forwardRef as uo } from "react";
3
- import { useTranslation as po } from "react-i18next";
4
- import { I as G } from "./icon-button-CehAeZoP.js";
5
- import { a as fo } from "./panel-header-D_mTdhUp.js";
6
- import { T as mo } from "./tool-rail-D89USYE6.js";
7
- import { u as go } from "./use-persistent-state-nZwZAnE9.js";
8
- import { S as Ro } from "./star-Bf9L2Uot.js";
9
- import { X as vo } from "./x-B5YnXwCz.js";
10
- const ho = {
11
- id: "control-room-rail",
12
- capabilities: ["open", "close", "select_single"],
13
- state: {
14
- activeToolId: {
15
- type: "string | null",
16
- descriptionKey: "ui.toolRail.agent.state.activeToolId",
17
- description: "Id of the tool whose panel is currently open, or null when the rail is collapsed to its strip. No panel content is ever exposed.",
18
- read: (t) => t.getActiveToolId()
19
- }
20
- },
21
- actions: {
22
- open: {
23
- // Pure ephemeral panel state (open) — no data loss, no external effect.
24
- safety: "read",
25
- argsType: "{ id: string }",
26
- argsSchema: {
27
- type: "object",
28
- properties: { id: { type: "string" } },
29
- required: ["id"]
30
- },
31
- idempotent: !0,
32
- descriptionKey: "ui.toolRail.agent.actions.open",
33
- description: "Open the given tool's panel.",
34
- examples: [{ args: { id: "inbox" }, note: "Open the inbox tool panel." }],
35
- invoke: (t, n) => {
36
- t.open(n.id);
37
- }
38
- },
39
- close: {
40
- safety: "read",
41
- idempotent: !0,
42
- descriptionKey: "ui.toolRail.agent.actions.close",
43
- description: "Collapse the rail to its strip (no active tool).",
44
- invoke: (t) => {
45
- t.close();
46
- }
47
- },
48
- select_tool: {
49
- safety: "read",
50
- argsType: "{ id: string | null }",
51
- argsSchema: {
52
- type: "object",
53
- properties: { id: { type: ["string", "null"] } },
54
- required: ["id"]
55
- },
56
- idempotent: !0,
57
- descriptionKey: "ui.toolRail.agent.actions.selectTool",
58
- description: "Set the active tool by id (opens its panel), or pass null to collapse.",
59
- invoke: (t, n) => {
60
- t.setActiveTool(n.id);
61
- }
62
- }
63
- },
64
- domHooks: {
65
- root: {
66
- attr: "data-component",
67
- value: "control-room-rail",
68
- description: "Marks the ControlRoomRail wrapper."
69
- },
70
- instanceId: {
71
- attr: "data-component-id",
72
- sourceProp: "id",
73
- description: "Sourced from the id prop. Required to address a specific rail from the agent."
74
- },
75
- item: {
76
- attr: "data-tool-id",
77
- description: "Stable tool id emitted on each strip IconButton. The active icon also carries data-active set to its id."
78
- }
79
- }
80
- }, S = co(null);
81
- function jo({
82
- globalTools: t = [],
83
- children: n
84
- }) {
85
- const [u, s] = _(
86
- () => /* @__PURE__ */ new Map()
87
- ), p = g(
88
- (i, l) => {
89
- s((a) => {
90
- const M = new Map(a);
91
- return M.set(i, l), M;
92
- });
93
- },
94
- []
95
- ), P = g((i) => {
96
- s((l) => {
97
- if (!l.has(i)) return l;
98
- const a = new Map(l);
99
- return a.delete(i), a;
100
- });
101
- }, []), f = T(
102
- () => Array.from(u.values()).flat(),
103
- [u]
104
- ), v = B(null), k = g((i) => {
105
- v.current = i;
106
- }, []), m = g((i) => {
107
- var l;
108
- (l = v.current) == null || l.setActiveTool(i);
109
- }, []), b = g(() => {
110
- var i;
111
- (i = v.current) == null || i.setActiveTool(null);
112
- }, []), y = T(
113
- () => ({
114
- globalTools: t,
115
- contextualTools: f,
116
- registerContextualTools: p,
117
- unregisterContextualTools: P,
118
- registerRail: k,
119
- openTool: m,
120
- closeTool: b
121
- }),
122
- [
123
- t,
124
- f,
125
- p,
126
- P,
127
- k,
128
- m,
129
- b
130
- ]
131
- );
132
- return /* @__PURE__ */ h(S.Provider, { value: y, children: n });
133
- }
134
- function Ho(t) {
135
- const n = H(S), u = n == null ? void 0 : n.registerContextualTools, s = n == null ? void 0 : n.unregisterContextualTools, p = io();
136
- ao(() => {
137
- if (!(!u || !s))
138
- return u(p, t), () => s(p);
139
- }, [u, s, p, t]);
140
- }
141
- function To() {
142
- const t = H(S);
143
- return T(() => {
144
- if (!t) return [];
145
- const n = t.contextualTools.map((s) => ({
146
- ...s,
147
- scope: "contextual"
148
- })), u = t.globalTools.map((s) => ({
149
- ...s,
150
- scope: "global"
151
- }));
152
- return [...n, ...u];
153
- }, [t]);
154
- }
155
- function Ko() {
156
- const t = H(S), n = g(() => {
157
- }, []);
158
- return {
159
- openTool: (t == null ? void 0 : t.openTool) ?? n,
160
- closeTool: (t == null ? void 0 : t.closeTool) ?? n
161
- };
162
- }
163
- function yo() {
164
- const t = H(S), n = g((u) => {
165
- }, []);
166
- return (t == null ? void 0 : t.registerRail) ?? n;
167
- }
168
- const qo = uo(function({
169
- tools: n,
170
- railLabel: u,
171
- reorderable: s = !0,
172
- favoriteIds: p,
173
- defaultFavoriteIds: P,
174
- pinnedFavoriteIds: f,
175
- onFavoriteIdsChange: v,
176
- persistFavoritesKey: k = "ui.controlRoom.favorites",
177
- activeToolId: m,
178
- defaultActiveToolId: b = null,
179
- onActiveToolChange: y,
180
- ...i
181
- }, l) {
182
- const { t: a } = po(), [M, J] = _(
183
- m ?? b ?? null
184
- ), L = m !== void 0 ? m : M, Q = g(
185
- (o) => {
186
- m === void 0 && J(o), y == null || y(o);
187
- },
188
- [m, y]
189
- ), U = To(), C = n ?? U, K = p !== void 0, [W, Y] = go(
190
- k,
191
- () => P ?? C.filter((o) => o.scope === "global").map((o) => o.id),
192
- { disabled: K }
193
- ), q = K ? p : W, A = T(() => f != null && f.length ? [
194
- ...f,
195
- ...q.filter((o) => !f.includes(o))
196
- ] : q, [f, q]), d = T(() => {
197
- const o = /* @__PURE__ */ new Map();
198
- for (const r of C) o.set(r.id, r);
199
- return o;
200
- }, [C]), w = T(
201
- () => new Set(A.filter((o) => d.has(o))),
202
- [A, d]
203
- ), O = (o) => {
204
- const r = o(A.filter((e) => d.has(e)));
205
- K || Y((e) => o(e.filter((c) => d.has(c)))), v == null || v(r);
206
- }, E = T(() => {
207
- if (!s) return C;
208
- const o = A.filter((e) => d.has(e)).map((e) => ({
209
- ...d.get(e),
210
- scope: "global",
211
- reorderable: !0
212
- })), r = C.filter((e) => !w.has(e.id)).map((e) => ({
213
- ...e,
214
- scope: "contextual",
215
- reorderable: !0
216
- }));
217
- return [...o, ...r];
218
- }, [s, C, A, d, w]), [Z, F] = _(""), z = B(!1), I = (o, r) => {
219
- const e = r ? a("controlRoom.pinnedAnnounce", {
220
- tool: o,
221
- defaultValue: "Pinned {{tool}} to favourites"
222
- }) : a("controlRoom.unpinnedAnnounce", {
223
- tool: o,
224
- defaultValue: "Removed {{tool}} from favourites"
225
- });
226
- z.current = !z.current, F(z.current ? e : `${e}​`);
227
- }, oo = (o) => {
228
- var r;
229
- I(((r = d.get(o)) == null ? void 0 : r.label) ?? o, !w.has(o)), O(
230
- (e) => e.includes(o) ? e.filter((c) => c !== o) : [...e, o]
231
- );
232
- }, to = (o, r) => {
233
- var c;
234
- const e = (c = E[o]) == null ? void 0 : c.id;
235
- e !== void 0 && O((x) => {
236
- const V = x.filter((R) => d.has(R)), j = V.length;
237
- if (o < j) {
238
- if (r >= j) return V.filter((so) => so !== e);
239
- const R = V.slice();
240
- return R.splice(o, 1), R.splice(r, 0, e), R;
241
- }
242
- if (r <= j) {
243
- const R = V.slice();
244
- return R.splice(Math.min(r, j), 0, e), R;
245
- }
246
- return x;
247
- });
248
- }, eo = ({
249
- tool: o,
250
- from: r,
251
- to: e
252
- }) => {
253
- const c = w.size, x = r < c;
254
- return x && e >= c ? a("controlRoom.unpinnedAnnounce", {
255
- tool: o.label,
256
- defaultValue: "Removed {{tool}} from favourites"
257
- }) : !x && e <= c ? a("controlRoom.pinnedAnnounce", {
258
- tool: o.label,
259
- defaultValue: "Pinned {{tool}} to favourites"
260
- }) : x && e < c ? a("controlRoom.reorderAnnounce", {
261
- tool: o.label,
262
- to: e + 1,
263
- total: c,
264
- defaultValue: "{{tool}} moved to position {{to}} of {{total}}"
265
- }) : "";
266
- }, X = B(null), $ = yo(), no = g(
267
- (o) => {
268
- X.current = o, $(o), typeof l == "function" ? l(o) : l && (l.current = o);
269
- },
270
- [$, l]
271
- ), N = L != null ? d.get(L) ?? null : null, ro = N ? /* @__PURE__ */ D(lo, { children: [
272
- s ? (() => {
273
- const o = w.has(N.id);
274
- return /* @__PURE__ */ h(
275
- G,
276
- {
277
- icon: /* @__PURE__ */ h(
278
- Ro,
279
- {
280
- "aria-hidden": "true",
281
- fill: o ? "currentColor" : "none",
282
- className: o ? "ds:text-[color:var(--accent)]" : void 0
283
- }
284
- ),
285
- intent: "ghost",
286
- size: "sm",
287
- "aria-pressed": o,
288
- "aria-label": a("controlRoom.favorite", {
289
- defaultValue: "Favourite"
290
- }),
291
- onClick: () => oo(N.id)
292
- }
293
- );
294
- })() : null,
295
- /* @__PURE__ */ h(
296
- G,
297
- {
298
- icon: /* @__PURE__ */ h(vo, { "aria-hidden": "true" }),
299
- intent: "ghost",
300
- size: "sm",
301
- "aria-label": a("controlRoom.close", { defaultValue: "Close" }),
302
- onClick: () => {
303
- var o;
304
- return (o = X.current) == null ? void 0 : o.close();
305
- }
306
- }
307
- )
308
- ] }) : null;
309
- return /* @__PURE__ */ D(fo, { actions: ro, children: [
310
- /* @__PURE__ */ h(
311
- mo,
312
- {
313
- ref: no,
314
- dataComponent: "control-room-rail",
315
- agentAdapter: ho,
316
- tools: E,
317
- activeToolId: m,
318
- defaultActiveToolId: b,
319
- onActiveToolChange: Q,
320
- railLabel: u ?? a("controlRoom.railLabel", { defaultValue: "Control room" }),
321
- onReorder: s ? to : void 0,
322
- formatReorderAnnouncement: s ? eo : void 0,
323
- ...i
324
- }
325
- ),
326
- s ? /* @__PURE__ */ h("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: Z }) : null
327
- ] });
328
- });
329
- export {
330
- jo as C,
331
- qo as a,
332
- To as b,
333
- ho as c,
334
- Ho as d,
335
- Ko as u
336
- };
337
- //# sourceMappingURL=control-room-rail-CnNZusR5.js.map