@servicetitan/json-render-react 0.2.0 → 0.3.1

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 (88) hide show
  1. package/dist/catalog/context/catalog-prompt.md +229 -0
  2. package/dist/catalog/context/schema.json +56 -0
  3. package/dist/catalog/core/catalog-prompt.md +104 -90
  4. package/dist/catalog/core/schema.json +0 -1
  5. package/dist/catalog/marketing/catalog-prompt.md +104 -90
  6. package/dist/catalog/marketing/schema.json +0 -1
  7. package/dist/context/catalog/catalog-def.d.ts +50 -0
  8. package/dist/context/catalog/context-card.catalog.d.ts +19 -0
  9. package/dist/context/catalog/context-card.d.ts +8 -0
  10. package/dist/context/catalog/context-data-table.catalog.d.ts +34 -0
  11. package/dist/context/catalog/context-data-table.css.d.ts +2 -0
  12. package/dist/context/catalog/context-data-table.d.ts +6 -0
  13. package/dist/context/catalog/context-file-list.catalog.d.ts +11 -0
  14. package/dist/context/catalog/context-file-list.css.d.ts +16 -0
  15. package/dist/context/catalog/context-file-list.d.ts +6 -0
  16. package/dist/context/catalog/context-list.catalog.d.ts +48 -0
  17. package/dist/context/catalog/context-list.css.d.ts +16 -0
  18. package/dist/context/catalog/context-list.d.ts +6 -0
  19. package/dist/context/catalog/context-metric-grid.catalog.d.ts +22 -0
  20. package/dist/context/catalog/context-metric-grid.css.d.ts +13 -0
  21. package/dist/context/catalog/context-metric-grid.d.ts +6 -0
  22. package/dist/context/catalog/context-note-list.catalog.d.ts +15 -0
  23. package/dist/context/catalog/context-note-list.d.ts +6 -0
  24. package/dist/context/catalog/context-overview.catalog.d.ts +8 -0
  25. package/dist/context/catalog/context-overview.css.d.ts +2 -0
  26. package/dist/context/catalog/context-overview.d.ts +6 -0
  27. package/dist/context/catalog/context-panel.catalog.d.ts +6 -0
  28. package/dist/context/catalog/context-panel.css.d.ts +1 -0
  29. package/dist/context/catalog/context-panel.d.ts +6 -0
  30. package/dist/context/catalog/context-tabular-list.catalog.d.ts +19 -0
  31. package/dist/context/catalog/context-tabular-list.css.d.ts +17 -0
  32. package/dist/context/catalog/context-tabular-list.d.ts +6 -0
  33. package/dist/context/catalog/index.d.ts +10 -0
  34. package/dist/context/catalog/schemas.d.ts +151 -0
  35. package/dist/context/components/collapsible-card.css.d.ts +41 -0
  36. package/dist/context/components/collapsible-card.d.ts +14 -0
  37. package/dist/context/components/context-ai-summary.css.d.ts +5 -0
  38. package/dist/context/components/context-ai-summary.d.ts +4 -0
  39. package/dist/context/components/context-chip-tone.d.ts +10 -0
  40. package/dist/context/components/context-note-list.css.d.ts +10 -0
  41. package/dist/context/components/context-render-error-boundary.d.ts +21 -0
  42. package/dist/context/constants.d.ts +6 -0
  43. package/dist/context/index.d.ts +4 -0
  44. package/dist/context/validate-context-spec-deep.d.ts +9 -0
  45. package/dist/context/validate-context-spec.d.ts +11 -0
  46. package/dist/core/catalog/alert.catalog.d.ts +2 -0
  47. package/dist/core/catalog/button.catalog.d.ts +3 -0
  48. package/dist/core/catalog/card.catalog.d.ts +2 -0
  49. package/dist/core/catalog/catalog-def.d.ts +33 -19
  50. package/dist/core/catalog/checkbox.catalog.d.ts +1 -0
  51. package/dist/core/catalog/chip.catalog.d.ts +1 -0
  52. package/dist/core/catalog/flex.catalog.d.ts +13 -0
  53. package/dist/core/catalog/grid.catalog.d.ts +4 -0
  54. package/dist/core/catalog/input.catalog.d.ts +1 -0
  55. package/dist/core/catalog/link.catalog.d.ts +2 -0
  56. package/dist/core/catalog/listbox.catalog.d.ts +1 -0
  57. package/dist/core/catalog/radio-group.catalog.d.ts +1 -0
  58. package/dist/core/catalog/schemas.d.ts +33 -19
  59. package/dist/core/catalog/switch.catalog.d.ts +1 -0
  60. package/dist/core/catalog/text.catalog.d.ts +0 -8
  61. package/dist/core/catalog/textarea.catalog.d.ts +1 -0
  62. package/dist/generate.d.ts +4 -4
  63. package/dist/index.d.ts +6 -3
  64. package/dist/index.js +2298 -0
  65. package/dist/index.js.map +1 -0
  66. package/dist/marketing/catalog/catalog.d.ts +1 -1
  67. package/dist/marketing/catalog/index.d.ts +1 -1
  68. package/dist/marketing/catalog/scoped-catalogs.d.ts +4 -0
  69. package/dist/registry-utils.d.ts +1 -1
  70. package/dist/registry.d.ts +1 -0
  71. package/dist/renderers/context-spec-renderer.d.ts +6 -0
  72. package/dist/renderers/sectioned-context-renderer.css.d.ts +1 -0
  73. package/dist/renderers/sectioned-context-renderer.d.ts +36 -0
  74. package/dist/renderers/spec-renderer.d.ts +6 -1
  75. package/dist/renderers/types.d.ts +2 -1
  76. package/dist/renderers/wrap-context-registry.d.ts +3 -0
  77. package/dist/scoped-catalog.d.ts +64 -0
  78. package/dist/styles.css +1 -1
  79. package/dist/test/setup-dom.d.ts +1 -0
  80. package/dist/types.d.ts +6 -3
  81. package/package.json +7 -4
  82. package/dist/core/catalog/badge.catalog.d.ts +0 -12
  83. package/dist/core/catalog/badge.css.d.ts +0 -1
  84. package/dist/core/catalog/badge.d.ts +0 -8
  85. package/dist/json-render-react.js +0 -1183
  86. package/dist/json-render-react.js.map +0 -1
  87. package/dist/marketing/catalog/teams.d.ts +0 -4
  88. package/dist/team-catalog.d.ts +0 -26
@@ -1,1183 +0,0 @@
1
- import { defineCatalog as e, getByPath as t } from "@json-render/core";
2
- import { JSONUIProvider as n, Renderer as r, createStateStore as i, defineRegistry as a, useStateStore as o } from "@json-render/react";
3
- import { schema as s } from "@json-render/react/schema";
4
- import { z as c } from "zod";
5
- import { Alert as l, Badge as u, Button as d, Card as f, Checkbox as ee, Chip as te, Divider as ne, FieldLabel as re, Flex as p, Grid as ie, Icon as ae, Link as m, Listbox as h, ProgressBar as g, Radio as _, Switch as oe, Text as v, TextField as se, Textarea as ce } from "@servicetitan/anvil2";
6
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
7
- import * as x from "@amcharts/amcharts5";
8
- import * as S from "@amcharts/amcharts5/xy";
9
- import { Children as C, useEffect as w, useMemo as T, useRef as E } from "react";
10
- import le from "@amcharts/amcharts5/themes/Animated";
11
- import { ThemeCategorical as ue, ThemeMonochrome as D, ThemeSemantic as de } from "@servicetitan/anvil2-ext-charts/am5";
12
- import O from "@servicetitan/anvil2/assets/icons/material/round/check_circle.svg";
13
- import k from "@servicetitan/anvil2/assets/icons/material/round/radio_button_unchecked.svg";
14
- import A from "@servicetitan/anvil2/assets/icons/st/in_progress.svg";
15
- import * as j from "@amcharts/amcharts5/percent";
16
- //#region src/core/actions.ts
17
- var M = {
18
- "atlas.submitUserAction": {
19
- params: c.object({
20
- data: c.record(c.string(), c.unknown()).optional(),
21
- actionId: c.string().optional()
22
- }),
23
- description: "Submit form data. actionId overrides default \"form_submit\" identifier."
24
- },
25
- "atlas.navigate": {
26
- params: c.object({ url: c.string() }),
27
- description: "Navigate to a URL or internal route. External URLs (http/https) open in a new tab; internal route strings navigate within the app."
28
- },
29
- "atlas.toolCall": {
30
- params: c.object({
31
- tool: c.string(),
32
- args: c.record(c.string(), c.unknown()).optional()
33
- }),
34
- description: "Invoke a tool on the active artifact panel app (an MCP-backed MFE). args is the tool argument payload; if omitted the current form state is sent."
35
- }
36
- }, fe = {
37
- "atlas.submitUserAction": async (e) => {},
38
- "atlas.navigate": async (e) => {},
39
- "atlas.toolCall": async (e) => {}
40
- }, N = [
41
- "chat",
42
- "panel",
43
- "app"
44
- ], P = {
45
- props: c.object({
46
- title: c.string(),
47
- status: c.enum([
48
- "info",
49
- "success",
50
- "warning",
51
- "danger"
52
- ]).optional(),
53
- dismissible: c.boolean().optional()
54
- }),
55
- slots: ["default"],
56
- description: "Alert/notification banner. dismissible: true adds a close button that emits a \"close\" event."
57
- }, pe = ({ props: e, emit: t, children: n }) => /* @__PURE__ */ y(l, {
58
- title: e.title,
59
- status: e.status ?? "info",
60
- ...e.dismissible ? { onClose: () => t("close") } : {},
61
- children: n
62
- });
63
- //#endregion
64
- //#region src/utils/defined-props.ts
65
- function F(e) {
66
- let t = {};
67
- for (let n of Object.keys(e)) {
68
- let r = e[n];
69
- r !== void 0 && (t[n] = r);
70
- }
71
- return t;
72
- }
73
- //#endregion
74
- //#region src/core/catalog/badge.catalog.ts
75
- var I = {
76
- props: c.object({
77
- content: c.string().optional(),
78
- offset: c.object({
79
- x: c.string().optional(),
80
- y: c.string().optional()
81
- }).optional()
82
- }),
83
- slots: ["default"],
84
- description: "Unread notification count on a Button or Link. Wrap the interactive element as a child of Badge (the renderer adds position:relative). content: numerical count only (e.g. 3, 99+); omit for dot-only. offset: {x, y} CSS values to fine-tune position on non-square anchors like links."
85
- }, me = "_128xbc80", he = ({ props: e, children: t }) => {
86
- let n = e.offset ? F({
87
- x: e.offset.x,
88
- y: e.offset.y
89
- }) : void 0, r = n ? /* @__PURE__ */ y(u, {
90
- offset: n,
91
- children: e.content
92
- }) : /* @__PURE__ */ y(u, { children: e.content });
93
- return t ? /* @__PURE__ */ b("div", {
94
- className: me,
95
- children: [t, r]
96
- }) : r;
97
- }, L = {
98
- props: c.object({
99
- data: c.array(c.object({
100
- category: c.string(),
101
- value: c.number()
102
- })),
103
- orientation: c.enum(["vertical", "horizontal"]).optional(),
104
- theme: c.enum([
105
- "monochrome",
106
- "categorical",
107
- "semantic"
108
- ]).optional(),
109
- height: c.number().optional(),
110
- unit: c.string().optional()
111
- }),
112
- slots: [],
113
- description: "Bar chart (vertical or horizontal) with Anvil2 theme. data: [{category, value}]. theme: monochrome (default, ≤4 vars), categorical (5-9 distinct), semantic (success/neutral/warning/danger order). unit: tooltip suffix."
114
- }, R = "zf6dad0";
115
- //#endregion
116
- //#region src/core/catalog/chart-utils.ts
117
- function z(e, t = "monochrome") {
118
- let n = {
119
- monochrome: D,
120
- categorical: ue,
121
- semantic: de
122
- }[t] ?? D;
123
- e.setThemes([le.new(e), n.new(e)]);
124
- }
125
- //#endregion
126
- //#region src/core/catalog/bar-chart.tsx
127
- var ge = ({ props: e }) => {
128
- let t = E(null);
129
- return w(() => {
130
- let n = t.current;
131
- if (!n) return;
132
- let r, i = () => {
133
- r && r.dispose(), r = x.Root.new(n), z(r, e.theme);
134
- let t = r.container.children.push(S.XYChart.new(r, { paddingLeft: 0 }));
135
- if (e.orientation === "horizontal") {
136
- let n = t.yAxes.push(S.CategoryAxis.new(r, {
137
- categoryField: "category",
138
- renderer: S.AxisRendererY.new(r, { minGridDistance: 20 })
139
- })), i = t.xAxes.push(S.ValueAxis.new(r, { renderer: S.AxisRendererX.new(r, {}) })), a = t.series.push(S.ColumnSeries.new(r, {
140
- xAxis: i,
141
- yAxis: n,
142
- valueXField: "value",
143
- categoryYField: "category"
144
- }));
145
- a.columns.template.setAll({ tooltipText: `{categoryY}: ${e.unit ?? ""}{valueX}` }), n.data.setAll(e.data), a.data.setAll(e.data);
146
- } else {
147
- let n = t.xAxes.push(S.CategoryAxis.new(r, {
148
- categoryField: "category",
149
- renderer: S.AxisRendererX.new(r, { minGridDistance: 30 })
150
- })), i = t.yAxes.push(S.ValueAxis.new(r, { renderer: S.AxisRendererY.new(r, {}) })), a = t.series.push(S.ColumnSeries.new(r, {
151
- xAxis: n,
152
- yAxis: i,
153
- valueYField: "value",
154
- categoryXField: "category"
155
- }));
156
- a.columns.template.setAll({ tooltipText: `{categoryX}: ${e.unit ?? ""}{valueY}` }), n.data.setAll(e.data), a.data.setAll(e.data);
157
- }
158
- }, a = new ResizeObserver((e) => {
159
- (e[0]?.contentRect.width ?? 0) > 0 && !r && i();
160
- });
161
- return a.observe(n), n.offsetWidth > 0 && i(), () => {
162
- a.disconnect(), r?.dispose();
163
- };
164
- }, []), /* @__PURE__ */ y("div", {
165
- ref: t,
166
- className: R,
167
- style: { height: e.height ?? 300 }
168
- });
169
- }, B = {
170
- props: c.object({
171
- label: c.string(),
172
- appearance: c.enum([
173
- "primary",
174
- "secondary",
175
- "ghost"
176
- ]).optional(),
177
- size: c.enum([
178
- "xsmall",
179
- "small",
180
- "medium",
181
- "large"
182
- ]).optional(),
183
- loading: c.boolean().optional(),
184
- disabled: c.boolean().optional()
185
- }),
186
- slots: [],
187
- description: "Clickable button. Every button automatically submits form data when pressed — the element key is used as the actionId to identify which button was clicked. loading: true shows a spinner. disabled: true prevents interaction. size: xsmall | small | medium (default) | large."
188
- }, _e = ({ props: e, emit: t }) => /* @__PURE__ */ y(d, {
189
- appearance: e.appearance ?? "secondary",
190
- ...F({
191
- size: e.size,
192
- loading: e.loading,
193
- disabled: e.disabled
194
- }),
195
- onClick: () => t("press"),
196
- children: e.label
197
- }), V = {
198
- props: c.object({
199
- background: c.enum(["strong", "stronger"]).optional(),
200
- padding: c.enum([
201
- "0",
202
- "xsmall",
203
- "small",
204
- "medium",
205
- "large"
206
- ]).optional()
207
- }),
208
- slots: ["default"],
209
- description: "White surface with padding; groups related content. background: strong | stronger for elevated surfaces. padding: 0 | xsmall | small | medium (default) | large."
210
- }, ve = ({ props: e, children: t }) => /* @__PURE__ */ y(f, {
211
- ...F({
212
- background: e.background,
213
- padding: e.padding
214
- }),
215
- children: t
216
- }), H = {
217
- props: c.object({
218
- label: c.string(),
219
- checked: c.boolean().optional(),
220
- disabled: c.boolean().optional()
221
- }),
222
- slots: [],
223
- description: "Checkbox input with label. Use $bindState on checked to track state."
224
- }, ye = {
225
- props: c.object({
226
- label: c.string(),
227
- size: c.enum(["small", "medium"]).optional(),
228
- color: c.string().optional(),
229
- icon: c.enum([
230
- "check-circle",
231
- "in-progress",
232
- "radio-button-unchecked"
233
- ]).optional(),
234
- removable: c.boolean().optional()
235
- }),
236
- slots: [],
237
- description: "Inline label pill for metadata, tags, or categories — use for job statuses, not notification counts (use Badge for those). size: small | medium (default). color: any CSS color. icon: optional leading icon. removable: true adds a close button (not available for size=small)."
238
- }, U = {
239
- props: c.object({
240
- vertical: c.boolean().optional(),
241
- spacing: c.enum([
242
- "0",
243
- "half",
244
- "1",
245
- "2",
246
- "3",
247
- "4",
248
- "5",
249
- "6",
250
- "8",
251
- "12"
252
- ]).optional(),
253
- alignContent: c.enum([
254
- "start",
255
- "center",
256
- "end"
257
- ]).optional()
258
- }),
259
- slots: [],
260
- description: "Divider between sections. vertical: true for vertical separator. spacing: gap around the divider. alignContent: alignment of content within the divider."
261
- }, W = {
262
- props: c.object({
263
- data: c.array(c.object({
264
- category: c.string(),
265
- value: c.number()
266
- })),
267
- theme: c.enum([
268
- "monochrome",
269
- "categorical",
270
- "semantic"
271
- ]).optional(),
272
- showLegend: c.boolean().optional(),
273
- height: c.number().optional(),
274
- unit: c.string().optional()
275
- }),
276
- slots: [],
277
- description: "Donut chart with optional legend and Anvil2 theme. data: [{category, value}]. theme: monochrome (≤4 vars), categorical (5-9 distinct), semantic (status values)."
278
- }, G = {
279
- props: c.object({
280
- direction: c.enum(["row", "column"]).optional(),
281
- gap: c.enum([
282
- "1",
283
- "2",
284
- "3",
285
- "4",
286
- "5",
287
- "6"
288
- ]).optional(),
289
- alignItems: c.enum([
290
- "center",
291
- "flex-start",
292
- "flex-end",
293
- "stretch",
294
- "baseline"
295
- ]).optional(),
296
- justifyContent: c.enum([
297
- "center",
298
- "flex-start",
299
- "flex-end",
300
- "space-between",
301
- "space-around",
302
- "space-evenly"
303
- ]).optional(),
304
- wrap: c.enum([
305
- "wrap",
306
- "nowrap",
307
- "wrap-reverse"
308
- ]).optional(),
309
- grow: c.number().optional(),
310
- shrink: c.number().optional(),
311
- inline: c.boolean().optional()
312
- }),
313
- slots: ["default"],
314
- description: "Flex layout container. gap: 1=4px 2=8px 3=12px 4=16px 5=20px 6=24px. grow: 1=fill available width. alignItems: vertical alignment. justifyContent: horizontal distribution."
315
- }, K = {
316
- props: c.object({
317
- templateColumns: c.string().optional(),
318
- gap: c.enum([
319
- "1",
320
- "2",
321
- "3",
322
- "4",
323
- "5",
324
- "6"
325
- ]).optional(),
326
- bordered: c.boolean().optional()
327
- }),
328
- slots: ["default"],
329
- description: "CSS Grid layout. templateColumns: CSS grid-template-columns value — \"repeat(3, 1fr)\" for equal columns, \"200px 1fr\" for fixed+flex two-column (e.g. key-value tables), \"1fr 1fr 80px\" for multi-column tables. Children flow into grid cells left-to-right, top-to-bottom. gap: 1=4px … 6=24px. bordered: true renders a bordered table with row separators and cell padding — use for key-value and data tables."
330
- }, q = {
331
- props: c.object({
332
- name: c.enum([
333
- "check-circle",
334
- "in-progress",
335
- "radio-button-unchecked"
336
- ]),
337
- size: c.enum([
338
- "small",
339
- "medium",
340
- "large",
341
- "xlarge"
342
- ]).optional(),
343
- color: c.string().optional()
344
- }),
345
- slots: [],
346
- description: "Anvil2 icon. name: check-circle=completed checkmark, in-progress=spinning partial circle, radio-button-unchecked=empty circle (pending)"
347
- }, J = {
348
- props: c.object({
349
- label: c.string(),
350
- placeholder: c.string().optional(),
351
- type: c.enum([
352
- "text",
353
- "password",
354
- "email",
355
- "tel",
356
- "url",
357
- "number"
358
- ]).optional(),
359
- value: c.string().optional(),
360
- disabled: c.boolean().optional()
361
- }),
362
- slots: [],
363
- description: "Free-text input field for user-typed values (names, notes, numbers, etc). type: text (default), password (masked), email, tel (phone), url, number. Use $bindState on value to bind to state. Prefer this over Select when the value is not from a fixed list."
364
- }, Y = {
365
- props: c.object({
366
- data: c.array(c.record(c.string(), c.union([c.string(), c.number()]))),
367
- series: c.array(c.string()).optional(),
368
- theme: c.enum([
369
- "monochrome",
370
- "categorical",
371
- "semantic"
372
- ]).optional(),
373
- showLegend: c.boolean().optional(),
374
- showDots: c.boolean().optional(),
375
- height: c.number().optional(),
376
- unit: c.string().optional()
377
- }),
378
- slots: [],
379
- description: "Line chart for tracking trends over time with optional multiple series. data: array of objects with a \"category\" key (x-axis label) and one numeric key per series (e.g. [{category: \"Jan\", revenue: 100, cost: 60}]). series: explicit list of series keys to plot (inferred from data keys if omitted, max 6). theme: monochrome (1-2 series), categorical (3-6 distinct). showLegend: true when multiple series (default true for 2+ series). showDots: true adds data-point markers (default true). unit: tooltip value suffix."
380
- }, X = {
381
- props: c.object({
382
- label: c.string(),
383
- href: c.string(),
384
- appearance: c.enum(["primary", "secondary"]).optional(),
385
- target: c.enum(["_blank", "_self"]).optional(),
386
- ghost: c.boolean().optional()
387
- }),
388
- slots: [],
389
- description: "Inline navigation link. href: destination URL. appearance: primary (default) | secondary. target: _blank opens in new tab (shows external-link icon). ghost: quieter styling (primary only)."
390
- }, Z = {
391
- props: c.object({
392
- label: c.string(),
393
- options: c.array(c.object({
394
- value: c.string(),
395
- label: c.string()
396
- })),
397
- value: c.string().optional(),
398
- disabled: c.boolean().optional()
399
- }),
400
- slots: [],
401
- description: "Listbox for choosing from a fixed list of known options. Use only when options are predefined. For free-text user input use Input instead."
402
- }, Q = {
403
- props: c.object({
404
- label: c.string(),
405
- value: c.number().min(0).max(100).optional(),
406
- description: c.string().optional(),
407
- indeterminate: c.boolean().optional()
408
- }),
409
- slots: [],
410
- description: "Progress bar showing task completion. value: 0–100 (percentage). Omit value and set indeterminate=true for unknown progress."
411
- }, be = {
412
- props: c.object({
413
- label: c.string(),
414
- options: c.array(c.object({
415
- value: c.string(),
416
- label: c.string()
417
- })),
418
- value: c.string().optional(),
419
- disabled: c.boolean().optional()
420
- }),
421
- slots: [],
422
- description: "Group of radio buttons for single selection. Use $bindState on value to capture selection."
423
- }, xe = {
424
- props: c.object({
425
- label: c.string(),
426
- checked: c.boolean().optional(),
427
- disabled: c.boolean().optional()
428
- }),
429
- slots: [],
430
- description: "Toggle switch for binary on/off settings. Prefer over Checkbox for enabling/disabling features. Use $bindState on checked to track state."
431
- }, Se = {
432
- props: c.object({
433
- content: c.string(),
434
- variant: c.enum([
435
- "headline",
436
- "body",
437
- "eyebrow"
438
- ]).optional(),
439
- size: c.enum([
440
- "small",
441
- "medium",
442
- "large",
443
- "xlarge"
444
- ]).optional(),
445
- subdued: c.boolean().optional(),
446
- el: c.enum([
447
- "h1",
448
- "h2",
449
- "h3",
450
- "h4",
451
- "h5",
452
- "h6"
453
- ]).optional()
454
- }),
455
- slots: [],
456
- description: "Display text. variant: headline=bold title, eyebrow=small label, body=default. size: small/medium/large/xlarge (headline and body only). subdued: deemphasized body text. el: heading element for variant=headline (default h3)."
457
- }, Ce = {
458
- props: c.object({
459
- label: c.string(),
460
- placeholder: c.string().optional(),
461
- description: c.string().optional(),
462
- moreInfo: c.string().optional(),
463
- value: c.string().optional(),
464
- rows: c.number().optional(),
465
- disabled: c.boolean().optional()
466
- }),
467
- slots: [],
468
- description: "Multi-line free-text input for long values (notes, descriptions, email body). Use $bindState on value to bind to state. rows: visible row count (default 3)."
469
- }, we = {
470
- Text: Se,
471
- Card: V,
472
- Flex: G,
473
- Grid: K,
474
- Alert: P,
475
- Divider: U,
476
- Icon: q,
477
- Badge: I,
478
- Chip: ye,
479
- Link: X,
480
- ProgressBar: Q,
481
- BarChart: L,
482
- DonutChart: W,
483
- LineChart: Y,
484
- Button: B,
485
- Checkbox: H,
486
- Input: J,
487
- Textarea: Ce,
488
- Listbox: Z,
489
- RadioGroup: be,
490
- Switch: xe
491
- }, Te = e(s, {
492
- components: we,
493
- actions: M
494
- }), Ee = ({ props: e, bindings: n, emit: r }) => {
495
- let i = n?.checked, { state: a, set: s } = o(), c = i ? t(a, i) : void 0, l = i ? c ?? e.checked ?? !1 : e.checked ?? !1;
496
- return /* @__PURE__ */ y(ee, {
497
- label: e.label,
498
- checked: l,
499
- onClick: (e, t) => {
500
- i && s(i, !(t?.checked ?? !1)), r("change");
501
- }
502
- });
503
- }, De = {
504
- "check-circle": O,
505
- "in-progress": A,
506
- "radio-button-unchecked": k
507
- }, Oe = ({ props: e, emit: t }) => {
508
- let n = e.icon ? De[e.icon] : void 0, r = e.removable && e.size !== "small" ? () => t("close") : void 0;
509
- return /* @__PURE__ */ y(te, {
510
- label: e.label,
511
- ...F({
512
- size: e.size,
513
- color: e.color,
514
- icon: n,
515
- onClose: r
516
- })
517
- });
518
- }, ke = ({ props: e }) => /* @__PURE__ */ y(ne, { ...F({
519
- vertical: e.vertical,
520
- spacing: e.spacing,
521
- alignContent: e.alignContent
522
- }) }), Ae = ({ props: e }) => {
523
- let t = E(null);
524
- return w(() => {
525
- let n = t.current;
526
- if (!n) return;
527
- let r, i = () => {
528
- r && r.dispose(), r = x.Root.new(n), z(r, e.theme);
529
- let t = r.container.children.push(j.PieChart.new(r, {
530
- layout: r.horizontalLayout,
531
- innerRadius: x.percent(50)
532
- })), i = t.series.push(j.PieSeries.new(r, {
533
- valueField: "value",
534
- categoryField: "category",
535
- legendValueText: ""
536
- }));
537
- i.labels.template.set("text", "{valuePercentTotal.formatNumber('#.')}%"), i.data.setAll(e.data), (e.showLegend ?? !0) && t.children.push(x.Legend.new(r, {
538
- centerY: x.percent(50),
539
- y: x.percent(50),
540
- layout: r.verticalLayout
541
- })).data.setAll(i.dataItems);
542
- }, a = new ResizeObserver((e) => {
543
- (e[0]?.contentRect.width ?? 0) > 0 && !r && i();
544
- });
545
- return a.observe(n), n.offsetWidth > 0 && i(), () => {
546
- a.disconnect(), r?.dispose();
547
- };
548
- }, []), /* @__PURE__ */ y("div", {
549
- ref: t,
550
- className: R,
551
- style: { height: e.height ?? 300 }
552
- });
553
- }, je = ({ props: e, children: t }) => /* @__PURE__ */ y(p, {
554
- ...F({
555
- direction: e.direction,
556
- gap: e.gap,
557
- alignItems: e.alignItems,
558
- justifyContent: e.justifyContent,
559
- wrap: e.wrap,
560
- grow: e.grow,
561
- shrink: e.shrink,
562
- inline: e.inline
563
- }),
564
- children: t
565
- }), Me = (...e) => e.filter(Boolean).join(" "), Ne = "_1v76lkh0", Pe = "_1v76lkh1";
566
- //#endregion
567
- //#region src/core/catalog/grid.tsx
568
- function Fe(e) {
569
- let t = e.match(/repeat\(\s*(\d+)/);
570
- return t?.[1] ? Number(t[1]) : e.trim().split(/\s+/).length;
571
- }
572
- var Ie = ({ props: e, children: t }) => {
573
- if (e.bordered) {
574
- let n = e.templateColumns ?? "1fr", r = C.count(t), i = Math.max(1, Fe(n)), a = Math.max(0, r - (r % i || i));
575
- return /* @__PURE__ */ y("div", {
576
- className: Ne,
577
- style: { gridTemplateColumns: n },
578
- children: C.map(t, (e, t) => /* @__PURE__ */ y("div", {
579
- className: Me(Pe, t < a && "_1v76lkh2"),
580
- children: e
581
- }))
582
- });
583
- }
584
- return /* @__PURE__ */ y(ie, {
585
- templateColumns: e.templateColumns,
586
- gap: e.gap ?? "2",
587
- children: t
588
- });
589
- }, Le = {
590
- "check-circle": O,
591
- "in-progress": A,
592
- "radio-button-unchecked": k
593
- }, Re = ({ props: e }) => {
594
- let t = Le[e.name];
595
- return t ? /* @__PURE__ */ y(ae, {
596
- svg: t,
597
- ...F({
598
- size: e.size,
599
- color: e.color
600
- })
601
- }) : null;
602
- }, ze = ({ props: e, bindings: n, emit: r }) => {
603
- let i = n?.value, { state: a, set: s } = o(), c = i ? t(a, i) : void 0, l = i ? c ?? e.value ?? "" : e.value ?? "";
604
- return /* @__PURE__ */ y(se, {
605
- label: e.label,
606
- type: e.type ?? "text",
607
- value: l,
608
- ...F({
609
- placeholder: e.placeholder,
610
- disabled: e.disabled
611
- }),
612
- onChange: (e) => {
613
- i && s(i, e.target.value), r("change");
614
- }
615
- });
616
- }, Be = ({ props: e }) => {
617
- let t = E(null);
618
- return w(() => {
619
- let n = t.current;
620
- if (!n) return;
621
- let r, i = () => {
622
- r && r.dispose(), r = x.Root.new(n), z(r, e.theme);
623
- let t = r.container.children.push(S.XYChart.new(r, { paddingLeft: 0 })), i = t.xAxes.push(S.CategoryAxis.new(r, {
624
- categoryField: "category",
625
- renderer: S.AxisRendererX.new(r, { minGridDistance: 30 })
626
- })), a = t.yAxes.push(S.ValueAxis.new(r, { renderer: S.AxisRendererY.new(r, {}) })), o = e.data[0], s = e.series ?? (o ? Object.keys(o).filter((e) => e !== "category") : []);
627
- for (let n of s) {
628
- let o = t.series.push(S.LineSeries.new(r, {
629
- name: n,
630
- xAxis: i,
631
- yAxis: a,
632
- valueYField: n,
633
- categoryXField: "category",
634
- tooltip: x.Tooltip.new(r, { labelText: `${n}: ${e.unit ?? ""}{valueY}` })
635
- }));
636
- o.strokes.template.setAll({ strokeWidth: 2 }), (e.showDots ?? !0) && o.bullets.push(() => {
637
- if (!r) throw Error("Chart root is not initialized");
638
- let e = o.get("fill");
639
- return x.Bullet.new(r, { sprite: x.Circle.new(r, {
640
- radius: 4,
641
- ...e ? { fill: e } : {},
642
- strokeWidth: 0
643
- }) });
644
- }), o.data.setAll(e.data);
645
- }
646
- i.data.setAll(e.data), (e.showLegend ?? s.length > 1) && t.children.push(x.Legend.new(r, {
647
- centerX: x.percent(50),
648
- x: x.percent(50),
649
- marginTop: 8
650
- })).data.setAll(t.series.values);
651
- }, a = new ResizeObserver((e) => {
652
- (e[0]?.contentRect.width ?? 0) > 0 && !r && i();
653
- });
654
- return a.observe(n), n.offsetWidth > 0 && i(), () => {
655
- a.disconnect(), r?.dispose();
656
- };
657
- }, []), /* @__PURE__ */ y("div", {
658
- ref: t,
659
- className: R,
660
- style: { height: e.height ?? 300 }
661
- });
662
- }, Ve = ({ props: e, emit: t }) => {
663
- let { label: n, href: r, appearance: i, target: a, ghost: o } = e, s = (e) => {
664
- e.preventDefault(), t("press");
665
- };
666
- return i === "secondary" ? /* @__PURE__ */ y(m, {
667
- appearance: "secondary",
668
- ghost: !1,
669
- href: r,
670
- ...a ? { target: a } : {},
671
- onClick: s,
672
- children: n
673
- }) : o === void 0 ? /* @__PURE__ */ y(m, {
674
- appearance: "primary",
675
- href: r,
676
- ...a ? { target: a } : {},
677
- onClick: s,
678
- children: n
679
- }) : /* @__PURE__ */ y(m, {
680
- appearance: "primary",
681
- ghost: o,
682
- href: r,
683
- ...a ? { target: a } : {},
684
- onClick: s,
685
- children: n
686
- });
687
- };
688
- //#endregion
689
- //#region ../../node_modules/.pnpm/@vanilla-extract+recipes@0.5.7_@vanilla-extract+css@1.20.1/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js
690
- function He(e, t) {
691
- if (typeof e != "object" || !e) return e;
692
- var n = e[Symbol.toPrimitive];
693
- if (n !== void 0) {
694
- var r = n.call(e, t || "default");
695
- if (typeof r != "object") return r;
696
- throw TypeError("@@toPrimitive must return a primitive value.");
697
- }
698
- return (t === "string" ? String : Number)(e);
699
- }
700
- function Ue(e) {
701
- var t = He(e, "string");
702
- return typeof t == "symbol" ? t : String(t);
703
- }
704
- function We(e, t, n) {
705
- return t = Ue(t), t in e ? Object.defineProperty(e, t, {
706
- value: n,
707
- enumerable: !0,
708
- configurable: !0,
709
- writable: !0
710
- }) : e[t] = n, e;
711
- }
712
- function Ge(e, t) {
713
- var n = Object.keys(e);
714
- if (Object.getOwnPropertySymbols) {
715
- var r = Object.getOwnPropertySymbols(e);
716
- t && (r = r.filter(function(t) {
717
- return Object.getOwnPropertyDescriptor(e, t).enumerable;
718
- })), n.push.apply(n, r);
719
- }
720
- return n;
721
- }
722
- function Ke(e) {
723
- for (var t = 1; t < arguments.length; t++) {
724
- var n = arguments[t] == null ? {} : arguments[t];
725
- t % 2 ? Ge(Object(n), !0).forEach(function(t) {
726
- We(e, t, n[t]);
727
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Ge(Object(n)).forEach(function(t) {
728
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
729
- });
730
- }
731
- return e;
732
- }
733
- function qe(e, t) {
734
- var n = {};
735
- for (var r in e) n[r] = t(e[r], r);
736
- return n;
737
- }
738
- var Je = (e, t, n) => {
739
- for (var r of Object.keys(e)) if (e[r] !== (t[r] ?? n[r])) return !1;
740
- return !0;
741
- }, Ye = (e) => {
742
- var t = (t) => {
743
- var n = e.defaultClassName, r = Ke(Ke({}, e.defaultVariants), t);
744
- for (var i in r) {
745
- var a = r[i] ?? e.defaultVariants[i];
746
- if (a != null) {
747
- var o = a;
748
- typeof o == "boolean" && (o = o === !0 ? "true" : "false");
749
- var s = e.variantClassNames[i][o];
750
- s && (n += " " + s);
751
- }
752
- }
753
- for (var [c, l] of e.compoundVariants) Je(c, r, e.defaultVariants) && (n += " " + l);
754
- return n;
755
- };
756
- return t.variants = () => Object.keys(e.variantClassNames), t.classNames = {
757
- get base() {
758
- return e.defaultClassName.split(" ")[0];
759
- },
760
- get variants() {
761
- return qe(e.variantClassNames, (e) => qe(e, (e) => e.split(" ")[0]));
762
- }
763
- }, t;
764
- }, Xe = Ye({
765
- defaultClassName: "_1le8ba60",
766
- variantClassNames: { disabled: {
767
- true: "_1le8ba61",
768
- false: "_1le8ba62"
769
- } },
770
- defaultVariants: {},
771
- compoundVariants: []
772
- }), Ze = [
773
- {
774
- name: "Text",
775
- catalog: Se,
776
- renderer: ({ props: e }) => {
777
- if (e.variant === "headline") {
778
- let t = e.el ?? "h3";
779
- return e.size === void 0 ? /* @__PURE__ */ y(v, {
780
- variant: "headline",
781
- el: t,
782
- children: e.content
783
- }) : /* @__PURE__ */ y(v, {
784
- variant: "headline",
785
- el: t,
786
- size: e.size,
787
- children: e.content
788
- });
789
- }
790
- return e.variant === "eyebrow" ? /* @__PURE__ */ y(v, {
791
- variant: "eyebrow",
792
- children: e.content
793
- }) : e.size !== void 0 && e.subdued !== void 0 ? /* @__PURE__ */ y(v, {
794
- variant: "body",
795
- size: e.size,
796
- subdued: e.subdued,
797
- children: e.content
798
- }) : e.size === void 0 ? e.subdued === void 0 ? /* @__PURE__ */ y(v, {
799
- variant: "body",
800
- children: e.content
801
- }) : /* @__PURE__ */ y(v, {
802
- variant: "body",
803
- subdued: e.subdued,
804
- children: e.content
805
- }) : /* @__PURE__ */ y(v, {
806
- variant: "body",
807
- size: e.size,
808
- children: e.content
809
- });
810
- },
811
- renderers: N
812
- },
813
- {
814
- name: "Card",
815
- catalog: V,
816
- renderer: ve,
817
- renderers: N
818
- },
819
- {
820
- name: "Flex",
821
- catalog: G,
822
- renderer: je,
823
- renderers: N
824
- },
825
- {
826
- name: "Grid",
827
- catalog: K,
828
- renderer: Ie,
829
- renderers: N
830
- },
831
- {
832
- name: "Alert",
833
- catalog: P,
834
- renderer: pe,
835
- renderers: N
836
- },
837
- {
838
- name: "Divider",
839
- catalog: U,
840
- renderer: ke,
841
- renderers: N
842
- },
843
- {
844
- name: "Icon",
845
- catalog: q,
846
- renderer: Re,
847
- renderers: N
848
- },
849
- {
850
- name: "Badge",
851
- catalog: I,
852
- renderer: he,
853
- renderers: N
854
- },
855
- {
856
- name: "Chip",
857
- catalog: ye,
858
- renderer: Oe,
859
- renderers: N
860
- },
861
- {
862
- name: "Link",
863
- catalog: X,
864
- renderer: Ve,
865
- renderers: N
866
- },
867
- {
868
- name: "ProgressBar",
869
- catalog: Q,
870
- renderer: ({ props: e }) => {
871
- let t = F({ description: e.description });
872
- return e.indeterminate || e.value === void 0 ? /* @__PURE__ */ y(g, {
873
- label: e.label,
874
- indeterminate: !0,
875
- ...t
876
- }) : /* @__PURE__ */ y(g, {
877
- label: e.label,
878
- value: e.value,
879
- ...t
880
- });
881
- },
882
- renderers: N
883
- },
884
- {
885
- name: "BarChart",
886
- catalog: L,
887
- renderer: ge,
888
- renderers: N
889
- },
890
- {
891
- name: "DonutChart",
892
- catalog: W,
893
- renderer: Ae,
894
- renderers: N
895
- },
896
- {
897
- name: "LineChart",
898
- catalog: Y,
899
- renderer: Be,
900
- renderers: N
901
- },
902
- {
903
- name: "Button",
904
- catalog: B,
905
- renderer: _e,
906
- renderers: N
907
- },
908
- {
909
- name: "Checkbox",
910
- catalog: H,
911
- renderer: Ee,
912
- renderers: N
913
- },
914
- {
915
- name: "Input",
916
- catalog: J,
917
- renderer: ze,
918
- renderers: N
919
- },
920
- {
921
- name: "Textarea",
922
- catalog: Ce,
923
- renderer: ({ props: e, bindings: n, emit: r }) => {
924
- let i = n?.value, { state: a, set: s } = o(), c = i ? t(a, i) : void 0, l = i ? c ?? e.value ?? "" : e.value ?? "";
925
- return /* @__PURE__ */ y(ce, {
926
- label: e.label,
927
- value: l,
928
- ...F({
929
- placeholder: e.placeholder,
930
- description: e.description,
931
- moreInfo: e.moreInfo,
932
- rows: e.rows,
933
- disabled: e.disabled
934
- }),
935
- onChange: (e) => {
936
- i && s(i, e.target.value), r("change");
937
- }
938
- });
939
- },
940
- renderers: N
941
- },
942
- {
943
- name: "Listbox",
944
- catalog: Z,
945
- renderer: ({ props: e, bindings: n, emit: r }) => {
946
- let i = n?.value, { state: a, set: s } = o(), c = i ? t(a, i) : void 0, l = i ? c ?? e.value ?? "" : e.value ?? "", u = e.options.map((e) => ({
947
- id: e.value,
948
- label: e.label
949
- })), d = u.find((e) => e.id === l);
950
- return /* @__PURE__ */ b("div", {
951
- className: Xe({ disabled: e.disabled ?? !1 }),
952
- children: [/* @__PURE__ */ y(re, { children: e.label }), /* @__PURE__ */ y(h, {
953
- items: u,
954
- ...d ? { selected: d } : {},
955
- onSelectionChange: (e) => {
956
- let t = e?.id ?? "";
957
- i && s(i, t), r("change");
958
- },
959
- children: ({ items: e }) => e.map((e) => /* @__PURE__ */ y(h.Option, {
960
- item: e,
961
- children: e.label
962
- }, e.id))
963
- })]
964
- });
965
- },
966
- renderers: N
967
- },
968
- {
969
- name: "RadioGroup",
970
- catalog: be,
971
- renderer: ({ props: e, bindings: n, emit: r }) => {
972
- let i = n?.value, { state: a, set: s } = o(), c = i ? t(a, i) : void 0, l = i ? c ?? e.value ?? "" : e.value ?? "";
973
- return /* @__PURE__ */ y(_.Group, {
974
- legend: e.label,
975
- children: e.options.map((e) => /* @__PURE__ */ y(_, {
976
- label: e.label,
977
- value: e.value,
978
- checked: l === e.value,
979
- onChange: () => {
980
- i && s(i, e.value), r("change");
981
- }
982
- }, e.value))
983
- });
984
- },
985
- renderers: N
986
- },
987
- {
988
- name: "Switch",
989
- catalog: xe,
990
- renderer: ({ props: e, bindings: n, emit: r }) => {
991
- let i = n?.checked, { state: a, set: s } = o(), c = i ? t(a, i) : void 0, l = i ? c ?? e.checked ?? !1 : e.checked ?? !1;
992
- return /* @__PURE__ */ y(oe, {
993
- label: e.label,
994
- value: e.label,
995
- checked: l,
996
- onChange: (e, t) => {
997
- i && s(i, t?.checked ?? !1), r("change");
998
- }
999
- });
1000
- },
1001
- renderers: N
1002
- }
1003
- ];
1004
- Object.fromEntries(Ze.map(({ name: e, renderer: t }) => [e, t]));
1005
- //#endregion
1006
- //#region src/team-catalog.ts
1007
- function Qe(e) {
1008
- return e;
1009
- }
1010
- function $e(t) {
1011
- let n = {
1012
- ...we,
1013
- ...t.components ?? {}
1014
- }, r = Object.fromEntries(Object.entries(t.actions ?? {}).map(([e, n]) => [`${t.prefix}.${e}`, n])), i = e(s, {
1015
- components: n,
1016
- actions: {
1017
- ...M,
1018
- ...r
1019
- }
1020
- });
1021
- return {
1022
- prefix: t.prefix,
1023
- catalog: i,
1024
- prompt(e) {
1025
- let n = [
1026
- i.prompt(),
1027
- "\n",
1028
- e
1029
- ];
1030
- return t.rules && n.push("\n", t.rules), n.join("");
1031
- },
1032
- jsonSchema() {
1033
- return i.jsonSchema();
1034
- }
1035
- };
1036
- }
1037
- //#endregion
1038
- //#region src/marketing/catalog/components/revenue-card.catalog.ts
1039
- var et = {
1040
- props: c.object({
1041
- title: c.string(),
1042
- value: c.string(),
1043
- trend: c.enum([
1044
- "up",
1045
- "down",
1046
- "flat"
1047
- ]).optional(),
1048
- delta: c.string().optional()
1049
- }),
1050
- slots: [],
1051
- description: "KPI metric card. trend: up=green↑ down=red↓ flat=grey→. delta e.g. \"+12% vs last month\". Leaf node — no children."
1052
- }, tt = Ye({
1053
- defaultClassName: "cy2dbi0",
1054
- variantClassNames: { trend: {
1055
- up: "cy2dbi1",
1056
- down: "cy2dbi2",
1057
- flat: "cy2dbi3"
1058
- } },
1059
- defaultVariants: {},
1060
- compoundVariants: []
1061
- }), nt = [{
1062
- name: "RevenueCard",
1063
- catalog: et,
1064
- renderer: ({ props: e }) => {
1065
- let t = e.trend ?? "flat", n = e.trend === "up" ? "↑" : e.trend === "down" ? "↓" : "→", r = tt({ trend: t });
1066
- return /* @__PURE__ */ y(f, { children: /* @__PURE__ */ b(p, {
1067
- direction: "column",
1068
- gap: "2",
1069
- children: [
1070
- /* @__PURE__ */ y(v, {
1071
- variant: "eyebrow",
1072
- children: e.title
1073
- }),
1074
- /* @__PURE__ */ y(v, {
1075
- variant: "headline",
1076
- el: "h3",
1077
- children: e.value
1078
- }),
1079
- e.delta && /* @__PURE__ */ b(p, {
1080
- direction: "row",
1081
- gap: "1",
1082
- alignItems: "center",
1083
- children: [/* @__PURE__ */ y("span", {
1084
- className: r,
1085
- children: n
1086
- }), /* @__PURE__ */ y(v, {
1087
- variant: "eyebrow",
1088
- className: r,
1089
- children: e.delta
1090
- })]
1091
- })
1092
- ]
1093
- }) });
1094
- },
1095
- renderers: N
1096
- }];
1097
- //#endregion
1098
- //#region src/registry-utils.ts
1099
- function rt(e, t) {
1100
- return e.filter(({ renderers: e }) => e.includes(t));
1101
- }
1102
- function it(e) {
1103
- return Object.fromEntries(e.map(({ name: e, catalog: t }) => [e, t]));
1104
- }
1105
- function at(e) {
1106
- return Object.fromEntries(e.map(({ name: e, renderer: t }) => [e, t]));
1107
- }
1108
- //#endregion
1109
- //#region src/registry.ts
1110
- var ot = [...Ze, ...nt];
1111
- function st(t = "chat") {
1112
- let n = rt(ot, t), r = it(n), i = at(n);
1113
- return a(e(s, {
1114
- components: r,
1115
- actions: M
1116
- }), {
1117
- components: i,
1118
- actions: fe
1119
- });
1120
- }
1121
- var $ = st("chat"), ct = $.registry, lt = $.handlers, ut = $.executeAction;
1122
- //#endregion
1123
- //#region src/renderers/internal/enrichments/button-actions.ts
1124
- function dt(e) {
1125
- let t = { ...e.elements };
1126
- for (let [e, n] of Object.entries(t)) {
1127
- if (n.type !== "Button" || n.on?.press) continue;
1128
- let r = e;
1129
- t[e] = {
1130
- ...n,
1131
- on: {
1132
- ...n.on,
1133
- press: {
1134
- action: "atlas.submitUserAction",
1135
- params: { actionId: r }
1136
- }
1137
- }
1138
- };
1139
- }
1140
- return {
1141
- ...e,
1142
- elements: t
1143
- };
1144
- }
1145
- //#endregion
1146
- //#region src/renderers/internal/enrichments/useEnrichedSpec.ts
1147
- function ft(e, t) {
1148
- return T(() => t.reduce((e, t) => t(e), e), [e, t]);
1149
- }
1150
- //#endregion
1151
- //#region src/renderers/spec-renderer.tsx
1152
- var pt = [dt], mt = ({ spec: e, registry: t, handlers: a, actions: o }) => {
1153
- let s = ft(e, pt), c = E(null), l = E(null);
1154
- if (c.current !== e && (c.current = e, l.current = i(s.state ?? {})), l.current === null) throw Error("State store is not initialized");
1155
- let u = l.current;
1156
- return /* @__PURE__ */ y(n, {
1157
- registry: t,
1158
- store: u,
1159
- handlers: T(() => {
1160
- let e = a(() => void 0, () => u.getSnapshot()), t = o ? o({
1161
- setState: u.set,
1162
- getSnapshot: () => u.getSnapshot()
1163
- }) : {};
1164
- return {
1165
- ...e,
1166
- ...t
1167
- };
1168
- }, [
1169
- a,
1170
- o,
1171
- u
1172
- ]),
1173
- functions: T(() => ({ computeTotal: (e) => `$${((Number.parseFloat(String(e.quantity ?? 0)) || 0) * (Number.parseFloat(String(e.unitPrice ?? "0").replace(/[^0-9.]/g, "")) || 0)).toFixed(2)}` }), []),
1174
- children: /* @__PURE__ */ y(r, {
1175
- spec: s,
1176
- registry: t
1177
- })
1178
- });
1179
- };
1180
- //#endregion
1181
- export { mt as SpecRenderer, Te as catalog, Qe as createTeamCatalog, ut as executeAction, st as getRegistry, lt as handlers, $e as mergeCatalogs, ct as registry };
1182
-
1183
- //# sourceMappingURL=json-render-react.js.map