@dashspec/renderer 0.1.41 → 0.1.42

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 (37) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +1 -1
  3. package/dist/FlowMapView-BSTKU7D4.js +458 -0
  4. package/dist/FlowMapView-BSTKU7D4.js.map +1 -0
  5. package/dist/chunk-5LRFKK4I.js +118 -0
  6. package/dist/chunk-5LRFKK4I.js.map +1 -0
  7. package/dist/{chunk-NLKXHTLO.js → chunk-D4GFCPCL.js} +6 -33
  8. package/dist/chunk-D4GFCPCL.js.map +1 -0
  9. package/dist/chunk-E4CT25TF.js +440 -0
  10. package/dist/chunk-E4CT25TF.js.map +1 -0
  11. package/dist/chunk-HUBYJ34E.js +38 -0
  12. package/dist/chunk-HUBYJ34E.js.map +1 -0
  13. package/dist/{chunk-M4WXE3FW.js → chunk-JCPQBIAL.js} +5 -3
  14. package/dist/{chunk-M4WXE3FW.js.map → chunk-JCPQBIAL.js.map} +1 -1
  15. package/dist/{chunk-YOCDUP7X.js → chunk-O4BYNRCA.js} +204 -526
  16. package/dist/chunk-O4BYNRCA.js.map +1 -0
  17. package/dist/{core-DE2SVeij.d.ts → core-B0gU-OwN.d.ts} +34 -1
  18. package/dist/core.d.ts +1 -1
  19. package/dist/core.js +18 -16
  20. package/dist/index.d.ts +33 -4
  21. package/dist/index.js +353 -290
  22. package/dist/index.js.map +1 -1
  23. package/dist/sandbox-RCDZ7SDZ.js +11 -0
  24. package/dist/sandbox.js +3 -2
  25. package/dist/schema.json +12 -0
  26. package/docs/README.md +1 -1
  27. package/docs/api.md +1 -1
  28. package/docs/data.md +8 -0
  29. package/docs/design-systems.md +21 -0
  30. package/docs/getting-started.md +1 -1
  31. package/docs/json-format.md +2 -0
  32. package/docs/widgets.md +2 -1
  33. package/package.json +1 -1
  34. package/dist/chunk-NLKXHTLO.js.map +0 -1
  35. package/dist/chunk-YOCDUP7X.js.map +0 -1
  36. package/dist/sandbox-WEMG76LE.js +0 -10
  37. /package/dist/{sandbox-WEMG76LE.js.map → sandbox-RCDZ7SDZ.js.map} +0 -0
package/dist/index.js CHANGED
@@ -30,8 +30,8 @@ import {
30
30
  EventHandler,
31
31
  EventMap,
32
32
  Expression,
33
- ExpressionError,
34
33
  FilterContract,
34
+ FlowMapContract,
35
35
  FnProp,
36
36
  GaugeContract,
37
37
  Handler,
@@ -83,49 +83,66 @@ import {
83
83
  buildUrl,
84
84
  builtInWidgetChecks,
85
85
  checkWidget,
86
- collectReferences,
87
- compile,
88
86
  createHelpers,
89
87
  createHttpClient,
90
88
  createWidgetRegistry,
91
89
  dashboardJsonSchema,
92
- evaluate,
93
- evaluateSafe,
94
- expressionReferences,
95
90
  graphqlData,
96
- interpolate,
97
- interpolateUrl,
98
91
  isCallbackSource,
99
92
  isSafeUrl,
100
93
  loadDocument,
101
94
  mergeConnections,
102
95
  migrateDocument,
103
- parse,
104
96
  parseDuration,
105
- placeholders,
106
97
  plantDate,
107
98
  plantDayStart,
108
- resolve,
109
99
  resolveBaseUrl,
110
- resolveRequest,
111
100
  safeLink,
112
101
  satisfies,
113
- scope,
114
- stripStrings,
115
- templateReferences,
116
102
  translator,
117
103
  validateDocument,
118
104
  widgetChecks
119
- } from "./chunk-YOCDUP7X.js";
105
+ } from "./chunk-O4BYNRCA.js";
106
+ import {
107
+ Chips,
108
+ asRows,
109
+ deepMerge,
110
+ evalOver,
111
+ field,
112
+ formatValue,
113
+ safeImageSrc,
114
+ toNumber,
115
+ tone,
116
+ toneOf
117
+ } from "./chunk-5LRFKK4I.js";
118
+ import {
119
+ ExpressionError,
120
+ collectReferences,
121
+ compile,
122
+ evaluate,
123
+ evaluateSafe,
124
+ expressionReferences,
125
+ interpolate,
126
+ interpolateUrl,
127
+ parse,
128
+ placeholders,
129
+ resolve,
130
+ resolveRequest,
131
+ scope,
132
+ stripStrings,
133
+ templateReferences
134
+ } from "./chunk-E4CT25TF.js";
120
135
  import {
121
136
  createStateProxy,
122
- getPath,
123
137
  offRunner,
124
138
  stateActions,
125
139
  stateSlice,
126
140
  stateWriteProblem,
127
141
  trustedRunner
128
- } from "./chunk-NLKXHTLO.js";
142
+ } from "./chunk-D4GFCPCL.js";
143
+ import {
144
+ getPath
145
+ } from "./chunk-HUBYJ34E.js";
129
146
 
130
147
  // src/components/context.tsx
131
148
  import { createContext, useCallback, useContext, useRef, useSyncExternalStore } from "react";
@@ -251,7 +268,8 @@ function buildTree(state, data, inputs) {
251
268
  computing.add(id);
252
269
  const up = derive(def.from);
253
270
  computing.delete(id);
254
- const filters = readsState(def.transform);
271
+ const pathTpl = typeof def.path === "string" ? def.path : void 0;
272
+ const filters = readsState(def.transform) || Boolean(pathTpl?.includes("${"));
255
273
  const keyState = filters ? state : null;
256
274
  const keyContext = filters ? inputs.context : null;
257
275
  const prev = memo.get(id);
@@ -264,7 +282,12 @@ function buildTree(state, data, inputs) {
264
282
  if (up.data === void 0) result = { status: up.status, ...up.error ? { error: up.error } : {} };
265
283
  else {
266
284
  try {
267
- const out = applyTransform(up.data, def.transform ?? [], root, {
285
+ let input = up.data;
286
+ if (pathTpl) {
287
+ const resolved = pathTpl.includes("${") ? String(interpolate(pathTpl, root) ?? "") : pathTpl;
288
+ input = resolved ? getPath(up.data, resolved) : up.data;
289
+ }
290
+ const out = applyTransform(input, def.transform ?? [], root, {
268
291
  ...inputs.runFn ? { runFn: inputs.runFn } : {},
269
292
  ...inputs.maxRows ? { maxRows: inputs.maxRows } : {}
270
293
  });
@@ -1962,6 +1985,18 @@ function partsCss(theme, scope2, mode = "light") {
1962
1985
  decl({ width: px(p.liveDot?.size), height: px(p.liveDot?.size), background: c(p.liveDot?.color) })
1963
1986
  ],
1964
1987
  [".ds-live[data-stale] > span", decl({ background: c(p.liveDot?.staleColor) })],
1988
+ [
1989
+ ".ds-flow-hover",
1990
+ decl({
1991
+ padding: p.popover?.padding,
1992
+ "border-radius": px(p.popover?.radius),
1993
+ border: p.popover?.border,
1994
+ "backdrop-filter": p.popover?.blur !== void 0 ? `blur(${p.popover.blur}px)` : void 0,
1995
+ display: p.popover?.gap !== void 0 ? "flex" : void 0,
1996
+ "flex-direction": p.popover?.gap !== void 0 ? "column" : void 0,
1997
+ gap: px(p.popover?.gap)
1998
+ })
1999
+ ],
1965
2000
  [".ds-filters", decl({ padding: p.filterBar?.padding, "border-radius": px(p.filterBar?.radius) })],
1966
2001
  [".ds-chart-legend", decl({ gap: px(p.legend?.gap) })],
1967
2002
  [
@@ -2034,54 +2069,6 @@ function defineWidget(def) {
2034
2069
  return def;
2035
2070
  }
2036
2071
 
2037
- // src/widgets/shared/format.ts
2038
- var field = (row, path) => path === void 0 ? row : getPath(row, path);
2039
- var toNumber = (v2) => {
2040
- if (typeof v2 === "number") return Number.isFinite(v2) ? v2 : void 0;
2041
- if (typeof v2 === "string" && v2.trim() !== "" && !Number.isNaN(Number(v2))) return Number(v2);
2042
- return void 0;
2043
- };
2044
- function formatValue(v2, h, format = "number", decimals) {
2045
- if (v2 === null || v2 === void 0 || v2 === "") return "\u2013";
2046
- switch (format) {
2047
- case "text":
2048
- return String(v2);
2049
- case "compact":
2050
- return h.fmt.compact(v2);
2051
- case "percent":
2052
- return h.fmt.percent(v2, decimals ?? 0);
2053
- case "duration":
2054
- return h.fmt.duration(v2);
2055
- case "date":
2056
- return h.fmt.date(v2, "date");
2057
- case "datetime":
2058
- return h.fmt.date(v2, "datetime");
2059
- case "time":
2060
- return h.fmt.date(v2, "time");
2061
- default: {
2062
- const n = toNumber(v2);
2063
- return n === void 0 ? String(v2) : h.fmt.number(n, decimals);
2064
- }
2065
- }
2066
- }
2067
- var tone = (t) => {
2068
- const k = t && ["good", "warn", "bad", "neutral", "info"].includes(t) ? t : "neutral";
2069
- return {
2070
- fg: `var(--ds-color-status-${k}-fg)`,
2071
- bg: `var(--ds-color-status-${k}-bg)`,
2072
- border: `var(--ds-color-status-${k}-border)`,
2073
- solid: `var(--ds-color-status-${k}-solid)`
2074
- };
2075
- };
2076
- var asRows = (data) => Array.isArray(data) ? data : data && typeof data === "object" ? [data] : [];
2077
- function deepMerge(base, extra) {
2078
- if (!extra || typeof extra !== "object" || Array.isArray(extra)) return extra ?? base;
2079
- if (!base || typeof base !== "object" || Array.isArray(base)) return extra;
2080
- const out = { ...base };
2081
- for (const [k, v2] of Object.entries(extra)) out[k] = k in out ? deepMerge(out[k], v2) : v2;
2082
- return out;
2083
- }
2084
-
2085
2072
  // src/widgets/builtins/Breakdown.tsx
2086
2073
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
2087
2074
  var Breakdown = defineWidget({
@@ -2321,7 +2308,8 @@ var Container = defineWidget({
2321
2308
  gap: spec.gap,
2322
2309
  justifyContent: JUSTIFY[spec.justify],
2323
2310
  alignItems: ALIGN[spec.align],
2324
- ["--ds-child-flex"]: spec.equal ? `1 1 ${spec.childMinWidth}px` : "0 0 auto",
2311
+ // An equal split is across a row; in a column, children keep their own height.
2312
+ ["--ds-child-flex"]: spec.equal && spec.direction === "row" ? `1 1 ${spec.childMinWidth}px` : "0 0 auto",
2325
2313
  ["--ds-child-min"]: `${spec.direction === "row" ? spec.childMinWidth : 0}px`,
2326
2314
  overflow: spec.scroll ? "auto" : "visible"
2327
2315
  };
@@ -3710,21 +3698,69 @@ var Filter = defineWidget({
3710
3698
  }
3711
3699
  });
3712
3700
 
3713
- // src/widgets/builtins/Image.tsx
3714
- import "zod";
3715
-
3716
- // src/widgets/shared/safeSrc.ts
3717
- function safeImageSrc(u) {
3718
- if (typeof u !== "string") return void 0;
3719
- let i = 0;
3720
- while (i < u.length && u.charCodeAt(i) <= 32) i++;
3721
- const t = u.slice(i);
3722
- if (/^[/\\]{2}/.test(t)) return void 0;
3723
- return /^(https?:|\/|\.|data:image\/)/i.test(t) ? u : void 0;
3701
+ // src/widgets/wrap.tsx
3702
+ import { Suspense, lazy } from "react";
3703
+ import { z as z6 } from "zod";
3704
+ import { jsx as jsx10 } from "react/jsx-runtime";
3705
+ function wrapComponent(Component2, o) {
3706
+ const schema = o.schema ?? z6.record(z6.unknown());
3707
+ const eventNames = [...new Set(Object.values(o.events ?? {}))];
3708
+ return defineWidget({
3709
+ kind: o.kind,
3710
+ version: o.version ?? 1,
3711
+ meta: o.meta,
3712
+ schema,
3713
+ ...o.defaults ? { defaults: o.defaults } : {},
3714
+ ...o.implements ? { implements: o.implements } : {},
3715
+ ...o.exposes ? { exposes: o.exposes } : {},
3716
+ ...o.frame ? { frame: o.frame } : {},
3717
+ ...o.small ? { small: true } : {},
3718
+ events: eventNames,
3719
+ ...o.slots ? { slots: Object.fromEntries(Object.values(o.slots).map((s) => [s, { label: s }])) } : {},
3720
+ component: function Wrapped(props) {
3721
+ const mapped = o.mapProps ? o.mapProps(props) : { ...props.spec, data: props.data };
3722
+ const handlers = {};
3723
+ for (const [prop, event] of Object.entries(o.events ?? {}))
3724
+ handlers[prop] = (value, ...rest) => props.emit(event, void 0, { value, args: [value, ...rest] });
3725
+ for (const [prop, path] of Object.entries(o.writes ?? {})) {
3726
+ const before = handlers[prop];
3727
+ handlers[prop] = (value, ...rest) => {
3728
+ props.store.set(path, value);
3729
+ before?.(value, ...rest);
3730
+ };
3731
+ }
3732
+ const slotProps = {};
3733
+ for (const [prop, slot] of Object.entries(o.slots ?? {})) slotProps[prop] = props.renderSlot(slot);
3734
+ return /* @__PURE__ */ jsx10(Component2, { ...mapped, ...handlers, ...slotProps });
3735
+ }
3736
+ });
3737
+ }
3738
+ function lazyWidget(def) {
3739
+ const { load, fallback, ...rest } = def;
3740
+ let Comp;
3741
+ return defineWidget({
3742
+ ...rest,
3743
+ component: function LazyWidget(props) {
3744
+ Comp ??= lazy(load);
3745
+ return /* @__PURE__ */ jsx10(Suspense, { fallback: fallback ?? /* @__PURE__ */ jsx10("div", { className: "ds-skeleton", "aria-busy": "true" }), children: /* @__PURE__ */ jsx10(Comp, { ...props }) });
3746
+ }
3747
+ });
3724
3748
  }
3725
3749
 
3750
+ // src/widgets/builtins/FlowMap.tsx
3751
+ var FlowMap = lazyWidget({
3752
+ ...FlowMapContract,
3753
+ implements: "flow-map",
3754
+ exposes: { selection: "the clicked step's row" },
3755
+ meta: { label: "Flow map", icon: "flow", category: "Process", size: { w: 12, h: 12, minW: 6, minH: 6 } },
3756
+ events: ["click", "hover", "hoverEnd"],
3757
+ parts: ["step", "chip", "tag"],
3758
+ load: () => import("./FlowMapView-BSTKU7D4.js").then((m) => ({ default: m.FlowMapView }))
3759
+ });
3760
+
3726
3761
  // src/widgets/builtins/Image.tsx
3727
- import { jsx as jsx10 } from "react/jsx-runtime";
3762
+ import "zod";
3763
+ import { jsx as jsx11 } from "react/jsx-runtime";
3728
3764
  var Image = defineWidget({
3729
3765
  ...ImageContract,
3730
3766
  implements: "image",
@@ -3732,15 +3768,15 @@ var Image = defineWidget({
3732
3768
  events: ["click"],
3733
3769
  component: function ImageWidget({ spec, data, emit }) {
3734
3770
  const src = safeImageSrc(spec.src ?? field(data, spec.srcField) ?? (typeof data === "string" ? data : void 0));
3735
- if (!src) return /* @__PURE__ */ jsx10("div", { className: "ds-state", children: "No image" });
3736
- return /* @__PURE__ */ jsx10(
3771
+ if (!src) return /* @__PURE__ */ jsx11("div", { className: "ds-state", children: "No image" });
3772
+ return /* @__PURE__ */ jsx11(
3737
3773
  "button",
3738
3774
  {
3739
3775
  type: "button",
3740
3776
  className: "ds-plain",
3741
3777
  onClick: () => emit("click", "image", { value: src }),
3742
3778
  style: { width: "100%", height: "100%" },
3743
- children: /* @__PURE__ */ jsx10("img", { src, alt: spec.alt, style: { width: "100%", height: "100%", objectFit: spec.fit } })
3779
+ children: /* @__PURE__ */ jsx11("img", { src, alt: spec.alt, style: { width: "100%", height: "100%", objectFit: spec.fit } })
3744
3780
  }
3745
3781
  );
3746
3782
  }
@@ -3748,7 +3784,7 @@ var Image = defineWidget({
3748
3784
 
3749
3785
  // src/widgets/builtins/ImageMap.tsx
3750
3786
  import "zod";
3751
- import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
3787
+ import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
3752
3788
  var ImageMap = defineWidget({
3753
3789
  ...ImageMapContract,
3754
3790
  implements: "image-map",
@@ -3767,7 +3803,7 @@ var ImageMap = defineWidget({
3767
3803
  })) : [];
3768
3804
  const src = safeImageSrc(spec.src);
3769
3805
  return /* @__PURE__ */ jsxs7("div", { className: "ds-imagemap", children: [
3770
- src && /* @__PURE__ */ jsx11("img", { src, alt: spec.alt }),
3806
+ src && /* @__PURE__ */ jsx12("img", { src, alt: spec.alt }),
3771
3807
  markers.map((mk, i) => {
3772
3808
  const t = mk.status ? spec.statusMap?.[mk.status] ?? mk.status : "info";
3773
3809
  return /* @__PURE__ */ jsxs7(
@@ -3806,7 +3842,7 @@ import "zod";
3806
3842
  // src/widgets/shared/InfoTip.tsx
3807
3843
  import { useEffect as useEffect3, useLayoutEffect as useLayoutEffect2, useRef as useRef4, useState as useState3 } from "react";
3808
3844
  import { createPortal as createPortal2 } from "react-dom";
3809
- import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
3845
+ import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
3810
3846
  function InfoTip({ text: text2 }) {
3811
3847
  const ref = useRef4(null);
3812
3848
  const tip = useRef4(null);
@@ -3859,11 +3895,11 @@ function InfoTip({ text: text2 }) {
3859
3895
  onBlur: hide,
3860
3896
  children: [
3861
3897
  /* @__PURE__ */ jsxs8("svg", { viewBox: "0 0 16 16", width: "14", height: "14", "aria-hidden": "true", children: [
3862
- /* @__PURE__ */ jsx12("circle", { cx: "8", cy: "8", r: "6.5", fill: "none", stroke: "currentColor", strokeWidth: "1" }),
3863
- /* @__PURE__ */ jsx12("path", { d: "M8 7.2v3.6M8 5.2v.1", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round" })
3898
+ /* @__PURE__ */ jsx13("circle", { cx: "8", cy: "8", r: "6.5", fill: "none", stroke: "currentColor", strokeWidth: "1" }),
3899
+ /* @__PURE__ */ jsx13("path", { d: "M8 7.2v3.6M8 5.2v.1", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round" })
3864
3900
  ] }),
3865
3901
  mounted && root && createPortal2(
3866
- /* @__PURE__ */ jsx12(
3902
+ /* @__PURE__ */ jsx13(
3867
3903
  "span",
3868
3904
  {
3869
3905
  ref: tip,
@@ -3949,7 +3985,7 @@ var Boundary = class extends Component {
3949
3985
 
3950
3986
  // src/components/Slot.tsx
3951
3987
  import { createContext as createContext3, useContext as useContext4 } from "react";
3952
- import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
3988
+ import { Fragment as Fragment5, jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
3953
3989
  var NodeScopeContext = createContext3({});
3954
3990
  var useNodeScope = () => useContext4(NodeScopeContext);
3955
3991
  var SlotOwnerContext = createContext3(null);
@@ -3985,7 +4021,7 @@ function Slot({
3985
4021
  item: item !== void 0 ? item : outer.item,
3986
4022
  index: index !== void 0 ? index : outer.index
3987
4023
  };
3988
- return /* @__PURE__ */ jsx13(NodeScopeContext.Provider, { value: scope2, children: /* @__PURE__ */ jsxs9(
4024
+ return /* @__PURE__ */ jsx14(NodeScopeContext.Provider, { value: scope2, children: /* @__PURE__ */ jsxs9(
3989
4025
  "div",
3990
4026
  {
3991
4027
  className: className ? `ds-slot ${className}` : "ds-slot",
@@ -3994,16 +4030,16 @@ function Slot({
3994
4030
  "data-owner": owner.id,
3995
4031
  "data-empty": ids.length === 0 || void 0,
3996
4032
  children: [
3997
- ids.map((id) => /* @__PURE__ */ jsx13(SlotItem, { children: renderChild(id) }, id)),
3998
- ids.length === 0 && editing && (empty ?? /* @__PURE__ */ jsx13("span", { className: "ds-slot-hint", children: "Drop here" }))
4033
+ ids.map((id) => /* @__PURE__ */ jsx14(SlotItem, { children: renderChild(id) }, id)),
4034
+ ids.length === 0 && editing && (empty ?? /* @__PURE__ */ jsx14("span", { className: "ds-slot-hint", children: "Drop here" }))
3999
4035
  ]
4000
4036
  }
4001
4037
  ) });
4002
4038
  }
4003
- var SlotItem = ({ children }) => /* @__PURE__ */ jsx13(Fragment5, { children });
4039
+ var SlotItem = ({ children }) => /* @__PURE__ */ jsx14(Fragment5, { children });
4004
4040
 
4005
4041
  // src/components/PanelFrame.tsx
4006
- import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
4042
+ import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
4007
4043
  var isEmpty = (d) => d === void 0 || d === null || Array.isArray(d) && d.length === 0 || typeof d === "object" && !Array.isArray(d) && Object.keys(d).length === 0;
4008
4044
  function useSize() {
4009
4045
  const [size2, setSize] = useState4({ width: 0, height: 0 });
@@ -4215,7 +4251,7 @@ function dropIndexAt(panel, x, y) {
4215
4251
  return { slot: box.getAttribute("data-slot") ?? void 0, index: indexIn(box, x, y) };
4216
4252
  }
4217
4253
  function PanelFrame({ id, nested = false }) {
4218
- return /* @__PURE__ */ jsx14(Boundary, { resetKeys: [id], fallback: (e) => /* @__PURE__ */ jsx14(PanelCrash, { id, error: e }), children: /* @__PURE__ */ jsx14(PanelFrameInner, { id, nested }) });
4254
+ return /* @__PURE__ */ jsx15(Boundary, { resetKeys: [id], fallback: (e) => /* @__PURE__ */ jsx15(PanelCrash, { id, error: e }), children: /* @__PURE__ */ jsx15(PanelFrameInner, { id, nested }) });
4219
4255
  }
4220
4256
  function PanelCrash({ id, error }) {
4221
4257
  const { options } = useDashboard();
@@ -4225,7 +4261,7 @@ function PanelCrash({ id, error }) {
4225
4261
  } catch {
4226
4262
  custom = void 0;
4227
4263
  }
4228
- return /* @__PURE__ */ jsx14("section", { className: "ds-panel", "data-panel": id, "aria-label": id, children: /* @__PURE__ */ jsx14("div", { className: "ds-panel-body", children: custom ?? /* @__PURE__ */ jsxs10("div", { className: "ds-state ds-state-error", role: "alert", children: [
4264
+ return /* @__PURE__ */ jsx15("section", { className: "ds-panel", "data-panel": id, "aria-label": id, children: /* @__PURE__ */ jsx15("div", { className: "ds-panel-body", children: custom ?? /* @__PURE__ */ jsxs10("div", { className: "ds-state ds-state-error", role: "alert", children: [
4229
4265
  "This panel could not be shown: ",
4230
4266
  error.message
4231
4267
  ] }) }) });
@@ -4312,7 +4348,7 @@ function PanelFrameInner({ id, nested }) {
4312
4348
  ),
4313
4349
  samePanelView
4314
4350
  );
4315
- const renderNested = useCallback4((child) => /* @__PURE__ */ jsx14(PanelFrame, { id: child, nested: true }, child), []);
4351
+ const renderNested = useCallback4((child) => /* @__PURE__ */ jsx15(PanelFrame, { id: child, nested: true }, child), []);
4316
4352
  const store = useMemo3(() => widgetStore(runtime), [runtime]);
4317
4353
  const [bodyRef, size2] = useSize();
4318
4354
  const frameRef = useRef5(null);
@@ -4403,14 +4439,14 @@ function PanelFrameInner({ id, nested }) {
4403
4439
  "\u201D"
4404
4440
  ] });
4405
4441
  else if (view.error && view.data === void 0)
4406
- body = options.renderError?.(view.error, id) ?? /* @__PURE__ */ jsx14("div", { className: "ds-state ds-state-error", role: "alert", children: view.messages?.error ?? view.error.message });
4442
+ body = options.renderError?.(view.error, id) ?? /* @__PURE__ */ jsx15("div", { className: "ds-state ds-state-error", role: "alert", children: view.messages?.error ?? view.error.message });
4407
4443
  else if (view.source && view.data === void 0 && (view.status === "loading" || view.status === "idle"))
4408
- body = options.renderLoading?.(id, loadingText(view.messages)) ?? /* @__PURE__ */ jsx14(LoadingState, { text: loadingText(view.messages) });
4444
+ body = options.renderLoading?.(id, loadingText(view.messages)) ?? /* @__PURE__ */ jsx15(LoadingState, { text: loadingText(view.messages) });
4409
4445
  else if (view.source && isEmpty(view.data) && widget.empty !== "widget")
4410
- body = options.renderEmpty?.(id) ?? /* @__PURE__ */ jsx14("div", { className: "ds-state", children: view.messages?.empty ?? "No data" });
4446
+ body = options.renderEmpty?.(id) ?? /* @__PURE__ */ jsx15("div", { className: "ds-state", children: view.messages?.empty ?? "No data" });
4411
4447
  else {
4412
4448
  const W = widget.component;
4413
- body = /* @__PURE__ */ jsx14(
4449
+ body = /* @__PURE__ */ jsx15(
4414
4450
  Boundary,
4415
4451
  {
4416
4452
  resetKeys: [view.data, props],
@@ -4418,7 +4454,7 @@ function PanelFrameInner({ id, nested }) {
4418
4454
  "This panel could not be shown: ",
4419
4455
  e.message
4420
4456
  ] }),
4421
- children: /* @__PURE__ */ jsx14(
4457
+ children: /* @__PURE__ */ jsx15(
4422
4458
  W,
4423
4459
  {
4424
4460
  spec: props,
@@ -4434,7 +4470,7 @@ function PanelFrameInner({ id, nested }) {
4434
4470
  mode: options.mode,
4435
4471
  helpers: runtime.helpers,
4436
4472
  panelId: id,
4437
- renderSlot: (name, o) => /* @__PURE__ */ jsx14(Slot, { name, ...o }),
4473
+ renderSlot: (name, o) => /* @__PURE__ */ jsx15(Slot, { name, ...o }),
4438
4474
  store
4439
4475
  }
4440
4476
  )
@@ -4451,7 +4487,7 @@ function PanelFrameInner({ id, nested }) {
4451
4487
  const name = el?.getAttribute("data-slot") ?? defaultSlot;
4452
4488
  return { slot: name, index: el ? indexIn(el, x, y) : void 0 };
4453
4489
  };
4454
- return /* @__PURE__ */ jsx14(SlotOwnerContext.Provider, { value: { id, data: view.data, def }, children: /* @__PURE__ */ jsx14(SlotChildContext.Provider, { value: renderNested, children: /* @__PURE__ */ jsxs10(
4490
+ return /* @__PURE__ */ jsx15(SlotOwnerContext.Provider, { value: { id, data: view.data, def }, children: /* @__PURE__ */ jsx15(SlotChildContext.Provider, { value: renderNested, children: /* @__PURE__ */ jsxs10(
4455
4491
  "section",
4456
4492
  {
4457
4493
  ref: frameRef,
@@ -4504,15 +4540,15 @@ function PanelFrameInner({ id, nested }) {
4504
4540
  /* @__PURE__ */ jsxs10("div", { style: { minWidth: 0 }, children: [
4505
4541
  title && /* @__PURE__ */ jsxs10("h3", { className: "ds-panel-title", children: [
4506
4542
  title,
4507
- info && /* @__PURE__ */ jsx14(InfoTip, { text: info })
4543
+ info && /* @__PURE__ */ jsx15(InfoTip, { text: info })
4508
4544
  ] }),
4509
- subtitle && /* @__PURE__ */ jsx14("p", { className: "ds-panel-subtitle", children: subtitle }),
4545
+ subtitle && /* @__PURE__ */ jsx15("p", { className: "ds-panel-subtitle", children: subtitle }),
4510
4546
  drill.length > 0 && /* @__PURE__ */ jsxs10("nav", { className: "ds-crumbs", "aria-label": "Drill path", children: [
4511
- /* @__PURE__ */ jsx14("button", { type: "button", onClick: () => runtime.runAction({ do: "drillReset", panel: id }), children: "All" }),
4547
+ /* @__PURE__ */ jsx15("button", { type: "button", onClick: () => runtime.runAction({ do: "drillReset", panel: id }), children: "All" }),
4512
4548
  drill.map((d, i) => /* @__PURE__ */ jsxs10("span", { children: [
4513
4549
  "\u203A",
4514
4550
  " ",
4515
- i < drill.length - 1 ? /* @__PURE__ */ jsx14(
4551
+ i < drill.length - 1 ? /* @__PURE__ */ jsx15(
4516
4552
  "button",
4517
4553
  {
4518
4554
  type: "button",
@@ -4526,13 +4562,13 @@ function PanelFrameInner({ id, nested }) {
4526
4562
  ] })
4527
4563
  ] }),
4528
4564
  /* @__PURE__ */ jsxs10("div", { className: "ds-panel-tools", children: [
4529
- headerKids.length > 0 && /* @__PURE__ */ jsx14(Slot, { name: "header", className: "ds-panel-addons" }),
4530
- meta2 && /* @__PURE__ */ jsx14("span", { className: "ds-panel-meta", children: meta2 }),
4565
+ headerKids.length > 0 && /* @__PURE__ */ jsx15(Slot, { name: "header", className: "ds-panel-addons" }),
4566
+ meta2 && /* @__PURE__ */ jsx15("span", { className: "ds-panel-meta", children: meta2 }),
4531
4567
  live2 ? /* @__PURE__ */ jsxs10("span", { className: "ds-live", "data-stale": view.stale || void 0, title: view.error?.message, children: [
4532
- /* @__PURE__ */ jsx14("span", { "aria-hidden": "true" }),
4568
+ /* @__PURE__ */ jsx15("span", { "aria-hidden": "true" }),
4533
4569
  liveLabel(props.liveText, view.updatedAt, runtime.helpers)
4534
- ] }) : view.stale && /* @__PURE__ */ jsx14("span", { className: "ds-badge ds-badge-stale", title: view.error?.message, children: "Stale" }),
4535
- controls.map((c) => /* @__PURE__ */ jsx14(
4570
+ ] }) : view.stale && /* @__PURE__ */ jsx15("span", { className: "ds-badge ds-badge-stale", title: view.error?.message, children: "Stale" }),
4571
+ controls.map((c) => /* @__PURE__ */ jsx15(
4536
4572
  ControlField,
4537
4573
  {
4538
4574
  def: c,
@@ -4549,9 +4585,9 @@ function PanelFrameInner({ id, nested }) {
4549
4585
  ))
4550
4586
  ] })
4551
4587
  ] }),
4552
- toolbarKids.length > 0 && /* @__PURE__ */ jsx14(Slot, { name: "toolbar", className: "ds-panel-toolbar" }),
4553
- /* @__PURE__ */ jsx14("div", { className: "ds-panel-body", ref: bodyRef, children: body }),
4554
- footerKids.length > 0 && /* @__PURE__ */ jsx14(Slot, { name: "footer", className: "ds-panel-foot" })
4588
+ toolbarKids.length > 0 && /* @__PURE__ */ jsx15(Slot, { name: "toolbar", className: "ds-panel-toolbar" }),
4589
+ /* @__PURE__ */ jsx15("div", { className: "ds-panel-body", ref: bodyRef, children: body }),
4590
+ footerKids.length > 0 && /* @__PURE__ */ jsx15(Slot, { name: "footer", className: "ds-panel-foot" })
4555
4591
  ]
4556
4592
  }
4557
4593
  ) }) });
@@ -4561,10 +4597,10 @@ function loadingText(messages) {
4561
4597
  return v2 === void 0 || v2 === null || v2 === "" ? void 0 : String(v2);
4562
4598
  }
4563
4599
  function LoadingState({ text: text2 }) {
4564
- if (!text2) return /* @__PURE__ */ jsx14("div", { className: "ds-skeleton", "aria-busy": "true", "aria-label": "Loading" });
4600
+ if (!text2) return /* @__PURE__ */ jsx15("div", { className: "ds-skeleton", "aria-busy": "true", "aria-label": "Loading" });
4565
4601
  return /* @__PURE__ */ jsxs10("output", { className: "ds-loading", "aria-busy": "true", children: [
4566
- /* @__PURE__ */ jsx14("div", { className: "ds-skeleton", "aria-hidden": "true" }),
4567
- /* @__PURE__ */ jsx14("span", { className: "ds-loading-text", children: text2 })
4602
+ /* @__PURE__ */ jsx15("div", { className: "ds-skeleton", "aria-hidden": "true" }),
4603
+ /* @__PURE__ */ jsx15("span", { className: "ds-loading-text", children: text2 })
4568
4604
  ] });
4569
4605
  }
4570
4606
 
@@ -4618,7 +4654,7 @@ function useCountUp(target, ms = 700) {
4618
4654
  }
4619
4655
 
4620
4656
  // src/widgets/builtins/Kpi.tsx
4621
- import { Fragment as Fragment6, jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
4657
+ import { Fragment as Fragment6, jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
4622
4658
  var Kpi = defineWidget({
4623
4659
  ...KpiContract,
4624
4660
  implements: "kpi",
@@ -4654,10 +4690,10 @@ var Kpi = defineWidget({
4654
4690
  const ratio = n !== void 0 && pTarget ? Math.min(spec.progress?.cap ?? Number.POSITIVE_INFINITY, n / pTarget * 100) : void 0;
4655
4691
  return /* @__PURE__ */ jsxs11("div", { className: "ds-kpi", "data-size": spec.size, children: [
4656
4692
  /* @__PURE__ */ jsxs11("div", { className: "ds-kpi-label", children: [
4657
- /* @__PURE__ */ jsx15("span", { children: spec.title }),
4658
- spec.info && /* @__PURE__ */ jsx15(InfoTip, { text: spec.info })
4693
+ /* @__PURE__ */ jsx16("span", { children: spec.title }),
4694
+ spec.info && /* @__PURE__ */ jsx16(InfoTip, { text: spec.info })
4659
4695
  ] }),
4660
- /* @__PURE__ */ jsx15(
4696
+ /* @__PURE__ */ jsx16(
4661
4697
  "button",
4662
4698
  {
4663
4699
  type: "button",
@@ -4668,7 +4704,7 @@ var Kpi = defineWidget({
4668
4704
  "aria-label": `${spec.title ?? "Value"}: ${empty ? spec.emptyText ?? "no value" : fmt(value)}${unit ? ` ${unit}` : ""}`,
4669
4705
  children: empty ? (
4670
4706
  // No value is not zero: the author's text, else a dash.
4671
- /* @__PURE__ */ jsx15("span", { className: "ds-kpi-empty", children: spec.emptyText || "\u2014" })
4707
+ /* @__PURE__ */ jsx16("span", { className: "ds-kpi-empty", children: spec.emptyText || "\u2014" })
4672
4708
  ) : /* @__PURE__ */ jsxs11(Fragment6, { children: [
4673
4709
  /* @__PURE__ */ jsxs11(
4674
4710
  "span",
@@ -4681,7 +4717,7 @@ var Kpi = defineWidget({
4681
4717
  ]
4682
4718
  }
4683
4719
  ),
4684
- unit && spec.unitStyle !== "value" && /* @__PURE__ */ jsx15("span", { className: "ds-kpi-unit", children: unit })
4720
+ unit && spec.unitStyle !== "value" && /* @__PURE__ */ jsx16("span", { className: "ds-kpi-unit", children: unit })
4685
4721
  ] })
4686
4722
  }
4687
4723
  ),
@@ -4701,8 +4737,8 @@ var Kpi = defineWidget({
4701
4737
  ]
4702
4738
  }
4703
4739
  ),
4704
- spec.note && /* @__PURE__ */ jsx15("span", { className: "ds-kpi-sub", children: spec.note }),
4705
- spec.sublabel && /* @__PURE__ */ jsx15("span", { className: "ds-kpi-sub", children: spec.sublabel }),
4740
+ spec.note && /* @__PURE__ */ jsx16("span", { className: "ds-kpi-sub", children: spec.note }),
4741
+ spec.sublabel && /* @__PURE__ */ jsx16("span", { className: "ds-kpi-sub", children: spec.sublabel }),
4706
4742
  low !== void 0 && high !== void 0 && /* @__PURE__ */ jsxs11("span", { className: "ds-kpi-sub", children: [
4707
4743
  "Expected ",
4708
4744
  fmt(low),
@@ -4710,7 +4746,7 @@ var Kpi = defineWidget({
4710
4746
  fmt(high)
4711
4747
  ] }),
4712
4748
  ratio !== void 0 && // biome-ignore lint/a11y/useFocusableInteractive: a progress bar is read-only, not interactive
4713
- /* @__PURE__ */ jsx15(
4749
+ /* @__PURE__ */ jsx16(
4714
4750
  "span",
4715
4751
  {
4716
4752
  className: "ds-progress",
@@ -4718,7 +4754,7 @@ var Kpi = defineWidget({
4718
4754
  "aria-valuenow": Math.round(ratio),
4719
4755
  "aria-valuemin": 0,
4720
4756
  "aria-valuemax": 100,
4721
- children: /* @__PURE__ */ jsx15(
4757
+ children: /* @__PURE__ */ jsx16(
4722
4758
  "span",
4723
4759
  {
4724
4760
  style: { width: `${Math.min(100, ratio)}%`, background: tone(ratio >= 100 ? "good" : "info").solid }
@@ -4727,8 +4763,8 @@ var Kpi = defineWidget({
4727
4763
  }
4728
4764
  ),
4729
4765
  (hasTarget || targetText) && /* @__PURE__ */ jsxs11("div", { className: "ds-kpi-foot", children: [
4730
- hasTarget && target === void 0 ? /* @__PURE__ */ jsx15("span", { className: "ds-chip", "data-tone": "bad", children: spec.targetMissing }) : /* @__PURE__ */ jsx15("span", { "data-ds-part": "target", children: targetText }),
4731
- spec.badge !== false && met !== void 0 && !empty && /* @__PURE__ */ jsx15("span", { className: "ds-chip", "data-tone": met ? "good" : "bad", "data-ds-part": "badge", children: met ? labels.good : labels.bad })
4766
+ hasTarget && target === void 0 ? /* @__PURE__ */ jsx16("span", { className: "ds-chip", "data-tone": "bad", children: spec.targetMissing }) : /* @__PURE__ */ jsx16("span", { "data-ds-part": "target", children: targetText }),
4767
+ spec.badge !== false && met !== void 0 && !empty && /* @__PURE__ */ jsx16("span", { className: "ds-chip", "data-tone": met ? "good" : "bad", "data-ds-part": "badge", children: met ? labels.good : labels.bad })
4732
4768
  ] })
4733
4769
  ] });
4734
4770
  }
@@ -4736,7 +4772,7 @@ var Kpi = defineWidget({
4736
4772
 
4737
4773
  // src/widgets/builtins/Sparkline.tsx
4738
4774
  import "zod";
4739
- import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
4775
+ import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
4740
4776
  function sparkPath(values, w, h, pad = 2) {
4741
4777
  if (values.length === 0) return { line: "", area: "" };
4742
4778
  const min = values.reduce((a, b) => Math.min(a, b));
@@ -4757,8 +4793,8 @@ function SparkSvg({
4757
4793
  const w = 120;
4758
4794
  const { line, area: fill } = sparkPath(values, w, height);
4759
4795
  return /* @__PURE__ */ jsxs12("svg", { viewBox: `0 0 ${w} ${height}`, preserveAspectRatio: "none", style: { width: "100%", height }, "aria-hidden": "true", children: [
4760
- area && /* @__PURE__ */ jsx16("path", { d: fill, fill: color2, opacity: 0.15 }),
4761
- /* @__PURE__ */ jsx16("path", { d: line, fill: "none", stroke: color2, strokeWidth: 1.5, vectorEffect: "non-scaling-stroke" })
4796
+ area && /* @__PURE__ */ jsx17("path", { d: fill, fill: color2, opacity: 0.15 }),
4797
+ /* @__PURE__ */ jsx17("path", { d: line, fill: "none", stroke: color2, strokeWidth: 1.5, vectorEffect: "non-scaling-stroke" })
4762
4798
  ] });
4763
4799
  }
4764
4800
  var Sparkline = defineWidget({
@@ -4770,14 +4806,14 @@ var Sparkline = defineWidget({
4770
4806
  component: function SparklineWidget({ spec, data, size: size2, emit }) {
4771
4807
  const rows = asRows(data);
4772
4808
  const values = rows.map((r) => toNumber(field(r, spec.y)) ?? 0);
4773
- return /* @__PURE__ */ jsx16(
4809
+ return /* @__PURE__ */ jsx17(
4774
4810
  "div",
4775
4811
  {
4776
4812
  onMouseEnter: () => emit("hover", "line", { value: values[values.length - 1] }),
4777
4813
  style: { height: "100%" },
4778
4814
  role: "img",
4779
4815
  "aria-label": `${spec.title ?? spec.y}: ${values.length} points`,
4780
- children: /* @__PURE__ */ jsx16(SparkSvg, { values, area: spec.area, height: Math.max(24, size2.height || 32) })
4816
+ children: /* @__PURE__ */ jsx17(SparkSvg, { values, area: spec.area, height: Math.max(24, size2.height || 32) })
4781
4817
  }
4782
4818
  );
4783
4819
  }
@@ -4785,7 +4821,7 @@ var Sparkline = defineWidget({
4785
4821
 
4786
4822
  // src/widgets/builtins/StageTracker.tsx
4787
4823
  import "zod";
4788
- import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
4824
+ import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
4789
4825
  var StageTracker = defineWidget({
4790
4826
  ...StageTrackerContract,
4791
4827
  implements: "stages",
@@ -4795,16 +4831,16 @@ var StageTracker = defineWidget({
4795
4831
  component: function StageTrackerWidget({ spec, data, emit }) {
4796
4832
  const raw = typeof data === "string" || typeof data === "number" ? data : field(data, spec.current);
4797
4833
  const idx = typeof raw === "number" ? raw : spec.stages.findIndex((s) => s.toLowerCase() === String(raw ?? "").toLowerCase());
4798
- return /* @__PURE__ */ jsx17("ol", { className: "ds-stages", children: spec.stages.map((s, i) => {
4834
+ return /* @__PURE__ */ jsx18("ol", { className: "ds-stages", children: spec.stages.map((s, i) => {
4799
4835
  const state = i < idx ? "done" : i === idx ? "current" : "todo";
4800
- return /* @__PURE__ */ jsx17("li", { "data-state": state, children: /* @__PURE__ */ jsxs13(
4836
+ return /* @__PURE__ */ jsx18("li", { "data-state": state, children: /* @__PURE__ */ jsxs13(
4801
4837
  "button",
4802
4838
  {
4803
4839
  type: "button",
4804
4840
  onClick: () => emit("click", "stage", { value: s, index: i, datum: data }),
4805
4841
  "aria-current": state === "current" ? "step" : void 0,
4806
4842
  children: [
4807
- /* @__PURE__ */ jsx17("span", { className: "ds-stage-dot", "aria-hidden": "true", children: state === "done" ? "\u2713" : i + 1 }),
4843
+ /* @__PURE__ */ jsx18("span", { className: "ds-stage-dot", "aria-hidden": "true", children: state === "done" ? "\u2713" : i + 1 }),
4808
4844
  s
4809
4845
  ]
4810
4846
  }
@@ -4815,7 +4851,7 @@ var StageTracker = defineWidget({
4815
4851
 
4816
4852
  // src/widgets/builtins/StateTimeline.tsx
4817
4853
  import "zod";
4818
- import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
4854
+ import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
4819
4855
  var StateTimeline = defineWidget({
4820
4856
  ...StateTimelineContract,
4821
4857
  implements: "timeline",
@@ -4840,10 +4876,10 @@ var StateTimeline = defineWidget({
4840
4876
  return { p, from, to, state };
4841
4877
  });
4842
4878
  return /* @__PURE__ */ jsxs14("div", { className: "ds-timeline-lane", children: [
4843
- lane && /* @__PURE__ */ jsx18("span", { className: "ds-timeline-name", children: lane }),
4844
- /* @__PURE__ */ jsx18("div", { className: "ds-timeline-bar", role: "img", "aria-label": `${spec.title ?? "Timeline"} ${lane}`, children: segs.filter((s) => s.to > s.from).map((s) => (
4879
+ lane && /* @__PURE__ */ jsx19("span", { className: "ds-timeline-name", children: lane }),
4880
+ /* @__PURE__ */ jsx19("div", { className: "ds-timeline-bar", role: "img", "aria-label": `${spec.title ?? "Timeline"} ${lane}`, children: segs.filter((s) => s.to > s.from).map((s) => (
4845
4881
  // biome-ignore lint/a11y/useKeyWithClickEvents: the per-state totals below summarise the same data for keyboard users
4846
- /* @__PURE__ */ jsx18(
4882
+ /* @__PURE__ */ jsx19(
4847
4883
  "span",
4848
4884
  {
4849
4885
  title: `${s.state} \xB7 ${helpers.fmt.date(s.from, "time")}\u2013${helpers.fmt.date(s.to, "time")} (${helpers.fmt.duration((s.to - s.from) / 1e3)})`,
@@ -4861,11 +4897,11 @@ var StateTimeline = defineWidget({
4861
4897
  ] }, lane);
4862
4898
  }),
4863
4899
  /* @__PURE__ */ jsxs14("div", { className: "ds-timeline-axis", children: [
4864
- /* @__PURE__ */ jsx18("span", { children: helpers.fmt.date(start, "time") }),
4865
- /* @__PURE__ */ jsx18("span", { children: spec.endLabel ?? helpers.fmt.date(end, "time") })
4900
+ /* @__PURE__ */ jsx19("span", { children: helpers.fmt.date(start, "time") }),
4901
+ /* @__PURE__ */ jsx19("span", { children: spec.endLabel ?? helpers.fmt.date(end, "time") })
4866
4902
  ] }),
4867
- /* @__PURE__ */ jsx18("ul", { className: "ds-legend", children: [...states.entries()].map(([s, ms]) => /* @__PURE__ */ jsxs14("li", { children: [
4868
- /* @__PURE__ */ jsx18(
4903
+ /* @__PURE__ */ jsx19("ul", { className: "ds-legend", children: [...states.entries()].map(([s, ms]) => /* @__PURE__ */ jsxs14("li", { children: [
4904
+ /* @__PURE__ */ jsx19(
4869
4905
  "span",
4870
4906
  {
4871
4907
  className: "ds-dot",
@@ -4875,7 +4911,7 @@ var StateTimeline = defineWidget({
4875
4911
  ),
4876
4912
  s,
4877
4913
  " ",
4878
- /* @__PURE__ */ jsx18("strong", { children: helpers.fmt.duration(ms / 1e3) })
4914
+ /* @__PURE__ */ jsx19("strong", { children: helpers.fmt.duration(ms / 1e3) })
4879
4915
  ] }, s)) })
4880
4916
  ] });
4881
4917
  }
@@ -4883,7 +4919,7 @@ var StateTimeline = defineWidget({
4883
4919
 
4884
4920
  // src/widgets/builtins/Status.tsx
4885
4921
  import "zod";
4886
- import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
4922
+ import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
4887
4923
  var Status = defineWidget({
4888
4924
  ...StatusContract,
4889
4925
  implements: "badge",
@@ -4898,56 +4934,16 @@ var Status = defineWidget({
4898
4934
  const text2 = spec.text ?? spec.labels?.[state] ?? state.charAt(0).toUpperCase() + state.slice(1);
4899
4935
  return /* @__PURE__ */ jsxs15("button", { type: "button", className: "ds-status", onClick: () => emit("click", "status", { datum: row, value: state }), children: [
4900
4936
  /* @__PURE__ */ jsxs15("span", { className: "ds-pill", style: { background: tone(t).bg, color: tone(t).fg, borderColor: tone(t).border }, children: [
4901
- /* @__PURE__ */ jsx19("span", { className: "ds-dot", style: { background: tone(t).solid }, "aria-hidden": "true" }),
4937
+ /* @__PURE__ */ jsx20("span", { className: "ds-dot", style: { background: tone(t).solid }, "aria-hidden": "true" }),
4902
4938
  text2
4903
4939
  ] }),
4904
- spec.label && /* @__PURE__ */ jsx19("span", { className: "ds-status-label", children: String(field(row, spec.label) ?? "") })
4940
+ spec.label && /* @__PURE__ */ jsx20("span", { className: "ds-status-label", children: String(field(row, spec.label) ?? "") })
4905
4941
  ] });
4906
4942
  }
4907
4943
  });
4908
4944
 
4909
4945
  // src/widgets/builtins/Table.tsx
4910
4946
  import { useEffect as useEffect6, useMemo as useMemo4, useRef as useRef7, useState as useState6 } from "react";
4911
-
4912
- // src/widgets/shared/chips.tsx
4913
- import { jsx as jsx20 } from "react/jsx-runtime";
4914
- var TONES = /* @__PURE__ */ new Set(["good", "warn", "bad", "neutral", "info", "action", "muted"]);
4915
- function evalOver(expr, vars, helpers) {
4916
- try {
4917
- return evaluate(expr, scope(vars, helpers));
4918
- } catch {
4919
- return void 0;
4920
- }
4921
- }
4922
- function toneOf(tone2, vars, helpers) {
4923
- if (!tone2) return void 0;
4924
- if (TONES.has(tone2)) return tone2;
4925
- const t = evalOver(tone2, vars, helpers);
4926
- return typeof t === "string" ? t : void 0;
4927
- }
4928
- function Chips({
4929
- chips,
4930
- vars,
4931
- helpers
4932
- }) {
4933
- if (!chips?.length) return null;
4934
- const shown = chips.filter((c) => c.when === void 0 || Boolean(evalOver(c.when, vars, helpers))).map((c) => {
4935
- let text2 = "";
4936
- try {
4937
- const v2 = interpolate(c.text, scope(vars, helpers));
4938
- text2 = v2 === null || v2 === void 0 ? "" : String(v2);
4939
- } catch {
4940
- }
4941
- return { text: text2, tone: toneOf(c.tone, vars, helpers) ?? "neutral" };
4942
- }).filter((c) => c.text);
4943
- if (shown.length === 0) return null;
4944
- return /* @__PURE__ */ jsx20("span", { className: "ds-chips", children: shown.map((c, i) => (
4945
- // biome-ignore lint/suspicious/noArrayIndexKey: chips come from a fixed list in the spec
4946
- /* @__PURE__ */ jsx20("span", { className: "ds-chip", "data-tone": c.tone, children: c.text }, i)
4947
- )) });
4948
- }
4949
-
4950
- // src/widgets/builtins/Table.tsx
4951
4947
  import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
4952
4948
  var ROW_H = 36;
4953
4949
  function pageList(current, pages) {
@@ -6604,6 +6600,7 @@ var builtInWidgets = [
6604
6600
  Status,
6605
6601
  CardGrid,
6606
6602
  ImageMap,
6603
+ FlowMap,
6607
6604
  Sparkline,
6608
6605
  Content,
6609
6606
  Image,
@@ -6873,11 +6870,11 @@ function Grid({
6873
6870
 
6874
6871
  // src/components/ModalHost.tsx
6875
6872
  import { useCallback as useCallback6, useEffect as useEffect9, useRef as useRef10 } from "react";
6876
- import { jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
6873
+ import { Fragment as Fragment10, jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
6877
6874
  var WIDTH = { sm: "420px", md: "720px", lg: "1040px", xl: "1320px", full: "100%" };
6878
6875
  var FOCUSABLE2 = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
6879
6876
  function ModalHost() {
6880
- const { runtime } = useDashboard();
6877
+ const { runtime, options } = useDashboard();
6881
6878
  const modals = runtime.doc.spec.modals ?? {};
6882
6879
  const open = useTree(
6883
6880
  // biome-ignore lint/correctness/useExhaustiveDependencies: modals are fixed per runtime
@@ -6886,10 +6883,10 @@ function ModalHost() {
6886
6883
  const byExpression = useTree(
6887
6884
  // biome-ignore lint/correctness/useExhaustiveDependencies: modals are fixed per runtime
6888
6885
  useCallback6(
6889
- (t) => Object.entries(modals).filter(([, m2]) => {
6890
- if (typeof m2.open !== "string") return false;
6886
+ (t) => Object.entries(modals).filter(([, m]) => {
6887
+ if (typeof m.open !== "string") return false;
6891
6888
  try {
6892
- return Boolean(interpolate(m2.open, rootScope(t, runtime.helpers)));
6889
+ return Boolean(interpolate(m.open, rootScope(t, runtime.helpers)));
6893
6890
  } catch {
6894
6891
  return false;
6895
6892
  }
@@ -6913,9 +6910,9 @@ function ModalHost() {
6913
6910
  }
6914
6911
  }, [byExpression, runtime]);
6915
6912
  function titleOf(t, id) {
6916
- const m2 = modals[id];
6913
+ const m = modals[id];
6917
6914
  try {
6918
- return m2?.title ? String(interpolate(m2.title, rootScope(t, runtime.helpers)) ?? "") : "";
6915
+ return m?.title ? String(interpolate(m.title, rootScope(t, runtime.helpers)) ?? "") : "";
6919
6916
  } catch {
6920
6917
  return "";
6921
6918
  }
@@ -6932,8 +6929,9 @@ function ModalHost() {
6932
6929
  }, [openId, runtime, modals]);
6933
6930
  const closeRef = useRef10(close);
6934
6931
  closeRef.current = close;
6932
+ const hostDrawerOpen = Boolean(options.ui?.Drawer && openId && modals[openId]?.presentation === "drawer");
6935
6933
  useEffect9(() => {
6936
- if (!openId) return;
6934
+ if (!openId || hostDrawerOpen) return;
6937
6935
  const prev = document.activeElement;
6938
6936
  dialog.current?.focus();
6939
6937
  const onKey = (e) => {
@@ -6968,35 +6966,56 @@ function ModalHost() {
6968
6966
  for (const el of siblings) el.removeAttribute("inert");
6969
6967
  prev?.focus?.();
6970
6968
  };
6971
- }, [openId]);
6969
+ }, [openId, hostDrawerOpen]);
6972
6970
  const hidden = useHiddenPanels(open ? Object.keys(modals[open.id]?.panels ?? {}) : []);
6973
- if (!open) return null;
6974
- const m = modals[open.id];
6975
- if (!m) return null;
6976
- const grid = runtime.doc.spec.grid;
6977
- return /* @__PURE__ */ jsx28(
6978
- "div",
6979
- {
6980
- ref: scrim,
6981
- className: "ds-scrim",
6982
- "data-presentation": m.presentation ?? "modal",
6983
- onMouseDown: (e) => e.target === e.currentTarget && close(),
6984
- children: /* @__PURE__ */ jsxs21(
6985
- "dialog",
6986
- {
6987
- open: true,
6988
- className: "ds-dialog",
6989
- "aria-modal": "true",
6990
- "aria-label": open.title || open.id,
6991
- tabIndex: -1,
6992
- ref: dialog,
6993
- style: { ["--ds-dialog-w"]: WIDTH[m.size ?? "md"] ?? WIDTH.md },
6994
- children: [
6995
- /* @__PURE__ */ jsxs21("div", { className: "ds-dialog-head", children: [
6996
- /* @__PURE__ */ jsx28("h2", { children: open.title }),
6997
- /* @__PURE__ */ jsx28("button", { type: "button", className: "ds-close", "aria-label": "Close", onClick: close, children: "\xD7" })
6998
- ] }),
6999
- /* @__PURE__ */ jsx28(
6971
+ const HostDrawer = options.ui?.Drawer;
6972
+ const available = useTree(
6973
+ // biome-ignore lint/correctness/useExhaustiveDependencies: modals are fixed per runtime
6974
+ useCallback6(
6975
+ (t) => Object.entries(modals).filter(([, m]) => {
6976
+ if (typeof m.availableWhen !== "string") return true;
6977
+ try {
6978
+ return Boolean(evaluate(m.availableWhen, rootScope(t, runtime.helpers)));
6979
+ } catch {
6980
+ return false;
6981
+ }
6982
+ }).map(([id]) => id).join("\0"),
6983
+ [runtime]
6984
+ ),
6985
+ Object.is
6986
+ ).split("\0");
6987
+ useEffect9(() => {
6988
+ if (openId && modals[openId]?.availableWhen && !available.includes(openId))
6989
+ runtime.store.dispatch(stateActions.closeModal());
6990
+ });
6991
+ const lastArgs = useRef10(/* @__PURE__ */ new Map());
6992
+ const openArgs = useTree(
6993
+ useCallback6((t) => t.modal ? t.modal.args : void 0, []),
6994
+ Object.is
6995
+ );
6996
+ if (open?.id) lastArgs.current.set(open.id, openArgs);
6997
+ if (HostDrawer) {
6998
+ const drawers = Object.entries(modals).filter(
6999
+ ([id, m]) => m.presentation === "drawer" && (!m.availableWhen || available.includes(id))
7000
+ );
7001
+ if (drawers.length) {
7002
+ const grid = runtime.doc.spec.grid;
7003
+ const drawerEls = /* @__PURE__ */ jsx28(Fragment10, { children: drawers.map(([id, m]) => {
7004
+ const isOpen = open?.id === id;
7005
+ return /* @__PURE__ */ jsx28(
7006
+ HostDrawer,
7007
+ {
7008
+ id,
7009
+ open: isOpen,
7010
+ title: isOpen ? open.title : "",
7011
+ onClose: isOpen ? close : () => {
7012
+ },
7013
+ onReopen: () => void runtime.runAction({
7014
+ do: "openModal",
7015
+ modal: id,
7016
+ args: lastArgs.current.get(id) ?? m.defaultArgs
7017
+ }),
7018
+ children: isOpen ? /* @__PURE__ */ jsx28(
7000
7019
  Grid,
7001
7020
  {
7002
7021
  layouts: [{ items: m.layout }],
@@ -7005,14 +7024,68 @@ function ModalHost() {
7005
7024
  columns: grid.columns,
7006
7025
  rowHeight: grid.rowHeight,
7007
7026
  gap: grid.gap,
7008
- children: (id) => /* @__PURE__ */ jsx28(PanelFrame, { id })
7027
+ exactHeights: grid.exactHeights,
7028
+ children: (pid) => /* @__PURE__ */ jsx28(PanelFrame, { id: pid })
7009
7029
  }
7010
- )
7011
- ]
7012
- }
7013
- )
7030
+ ) : null
7031
+ },
7032
+ id
7033
+ );
7034
+ }) });
7035
+ if (!open || modals[open.id]?.presentation === "drawer") return drawerEls;
7036
+ return /* @__PURE__ */ jsxs21(Fragment10, { children: [
7037
+ drawerEls,
7038
+ renderModal(open)
7039
+ ] });
7014
7040
  }
7015
- );
7041
+ }
7042
+ if (!open) return null;
7043
+ return renderModal(open);
7044
+ function renderModal(open2) {
7045
+ const m = modals[open2.id];
7046
+ if (!m) return null;
7047
+ const grid = runtime.doc.spec.grid;
7048
+ return /* @__PURE__ */ jsx28(
7049
+ "div",
7050
+ {
7051
+ ref: scrim,
7052
+ className: "ds-scrim",
7053
+ "data-presentation": m.presentation ?? "modal",
7054
+ onMouseDown: (e) => e.target === e.currentTarget && close(),
7055
+ children: /* @__PURE__ */ jsxs21(
7056
+ "dialog",
7057
+ {
7058
+ open: true,
7059
+ className: "ds-dialog",
7060
+ "aria-modal": "true",
7061
+ "aria-label": open2.title || open2.id,
7062
+ tabIndex: -1,
7063
+ ref: dialog,
7064
+ style: { ["--ds-dialog-w"]: WIDTH[m.size ?? "md"] ?? WIDTH.md },
7065
+ children: [
7066
+ /* @__PURE__ */ jsxs21("div", { className: "ds-dialog-head", children: [
7067
+ /* @__PURE__ */ jsx28("h2", { children: open2.title }),
7068
+ /* @__PURE__ */ jsx28("button", { type: "button", className: "ds-close", "aria-label": "Close", onClick: close, children: "\xD7" })
7069
+ ] }),
7070
+ /* @__PURE__ */ jsx28(
7071
+ Grid,
7072
+ {
7073
+ layouts: [{ items: m.layout }],
7074
+ hidden,
7075
+ view: null,
7076
+ columns: grid.columns,
7077
+ rowHeight: grid.rowHeight,
7078
+ gap: grid.gap,
7079
+ exactHeights: grid.exactHeights,
7080
+ children: (id) => /* @__PURE__ */ jsx28(PanelFrame, { id })
7081
+ }
7082
+ )
7083
+ ]
7084
+ }
7085
+ )
7086
+ }
7087
+ );
7088
+ }
7016
7089
  }
7017
7090
 
7018
7091
  // src/components/Provider.tsx
@@ -7066,7 +7139,7 @@ function pickTheme(name, themes, fallback) {
7066
7139
 
7067
7140
  // src/components/Tour.tsx
7068
7141
  import { useCallback as useCallback7, useEffect as useEffect10, useId as useId5, useLayoutEffect as useLayoutEffect3, useRef as useRef12, useState as useState9 } from "react";
7069
- import { Fragment as Fragment10, jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
7142
+ import { Fragment as Fragment11, jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
7070
7143
  var useClientLayoutEffect = typeof window === "undefined" ? useEffect10 : useLayoutEffect3;
7071
7144
  function panelElement(root, id) {
7072
7145
  if (!root || !id) return null;
@@ -7143,7 +7216,7 @@ function TourButton({ steps }) {
7143
7216
  }, [isOpen]);
7144
7217
  if (steps.length === 0) return null;
7145
7218
  const last = at === steps.length - 1;
7146
- return /* @__PURE__ */ jsxs22(Fragment10, { children: [
7219
+ return /* @__PURE__ */ jsxs22(Fragment11, { children: [
7147
7220
  /* @__PURE__ */ jsx30(
7148
7221
  "button",
7149
7222
  {
@@ -7825,6 +7898,45 @@ var RENDERER_CSS = `
7825
7898
  .ds-repeater { height: 100%; overflow: auto; }
7826
7899
  .ds-repeater-item { display: flex; flex-direction: column; gap: 8px; }
7827
7900
  .ds-repeater-item > .ds-panel { height: auto; }
7901
+ /* FlowMap: a process flow; every colour from the theme, so it works in light and dark */
7902
+ .ds-flow { display: block; min-width: 0; }
7903
+ .ds-flow-scroll { flex: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
7904
+ .ds-flow-svg { display: block; width: 100%; height: auto; margin: 0 auto; }
7905
+ .ds-flow-track { fill: none; stroke: var(--ds-flow-track, var(--ds-color-border-default)); stroke-width: var(--ds-flow-track-width, 6); stroke-linecap: round; stroke-linejoin: round; }
7906
+ .ds-flow-track[data-dashed] { stroke-linecap: butt; stroke-dasharray: 5 2.5; }
7907
+ .ds-flow-chevron { fill: none; stroke: var(--ds-color-text-subtle); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
7908
+ .ds-flow-tag rect { fill: var(--ds-color-status-info-bg); }
7909
+ .ds-flow-tag text { font-family: var(--ds-font-heading); font-size: 11px; font-weight: 500; fill: var(--ds-color-status-info-fg); }
7910
+ .ds-flow-tag[data-dim] rect { fill: var(--ds-color-surface-table-header); }
7911
+ .ds-flow-tag[data-dim] text { fill: var(--ds-color-text-subtle); }
7912
+ .ds-flow-step { cursor: pointer; outline: none; }
7913
+ .ds-flow-step[data-untracked] { cursor: default; }
7914
+ .ds-flow-step:focus-visible .ds-flow-hit { stroke: var(--ds-color-border-focus); stroke-width: 2; }
7915
+ .ds-flow-hit { fill: transparent; pointer-events: all; }
7916
+ .ds-flow-label { font-family: var(--ds-font-heading); font-size: 14px; font-weight: 700; fill: var(--ds-color-text-primary); paint-order: stroke; stroke: var(--ds-color-surface-card); stroke-width: 6px; stroke-linejoin: round; }
7917
+ .ds-flow-label[data-selected] { font-size: 16px; }
7918
+ .ds-flow-step[data-untracked] .ds-flow-label { fill: var(--ds-color-text-disabled); }
7919
+ .ds-flow-untracked { fill: var(--ds-color-surface-card); stroke: var(--ds-color-text-disabled); stroke-width: 2; stroke-dasharray: 3 2; }
7920
+ .ds-flow-shape { stroke: var(--ds-color-surface-card); stroke-width: 3; paint-order: stroke; }
7921
+ .ds-flow-step[data-dim] .ds-flow-shape { fill: var(--ds-color-text-subtle); }
7922
+ .ds-flow-step[data-dim] image { filter: grayscale(1); }
7923
+ .ds-flow-halo { animation: ds-flow-pulse 1.2s ease-in-out infinite; }
7924
+ @keyframes ds-flow-pulse { 50% { opacity: .7; } }
7925
+ @media (prefers-reduced-motion: reduce) { .ds-flow-halo { animation: none; } }
7926
+ .ds-flow-chip rect { fill: var(--ds-color-surface-table-header); }
7927
+ .ds-flow-chip text { font-family: var(--ds-font-body); fill: var(--ds-color-text-primary); }
7928
+ .ds-flow-chip-value { font-size: 14px; font-weight: 700; }
7929
+ .ds-flow-chip-unit { font-size: 12px; font-weight: 400; fill: var(--ds-color-text-subtle); }
7930
+ .ds-flow-chip[data-tone="good"] rect { fill: var(--ds-color-status-good-bg); }
7931
+ .ds-flow-chip[data-tone="good"] text, .ds-flow-chip[data-tone="good"] .ds-flow-chip-unit { fill: var(--ds-color-status-good-fg); }
7932
+ .ds-flow-chip[data-tone="dim"] text, .ds-flow-chip[data-tone="dim"] .ds-flow-chip-unit { fill: var(--ds-color-text-subtle); }
7933
+ .ds-flow-chip[data-tone="selected"] rect { fill: var(--ds-color-surface-selection); }
7934
+ .ds-flow-chip[data-tone="selected"] text, .ds-flow-chip[data-tone="selected"] .ds-flow-chip-unit { fill: var(--ds-color-action-primary); }
7935
+ .ds-flow-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 20px; font-family: var(--ds-font-body); font-size: 12px; color: var(--ds-color-text-primary); }
7936
+ .ds-flow-legend li { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
7937
+ .ds-panel-tools .ds-flow-legend { flex: none; }
7938
+ .ds-flow-hover { position: fixed; z-index: var(--ds-z-tooltip); min-width: 220px; max-width: 320px; padding: 12px; border-radius: 12px; background: var(--ds-color-chart-tooltip-bg); color: var(--ds-color-chart-tooltip-text); box-shadow: var(--ds-shadow-overlay); backdrop-filter: blur(16px); }
7939
+ .ds-flow-hover > * { margin: 0; }
7828
7940
  `;
7829
7941
 
7830
7942
  // src/components/urlSync.ts
@@ -7893,7 +8005,7 @@ function releaseDefaultPrefix(owner) {
7893
8005
  }
7894
8006
 
7895
8007
  // src/components/DashboardRenderer.tsx
7896
- import { Fragment as Fragment11, jsx as jsx31, jsxs as jsxs23 } from "react/jsx-runtime";
8008
+ import { Fragment as Fragment12, jsx as jsx31, jsxs as jsxs23 } from "react/jsx-runtime";
7897
8009
  function usesScripts(doc) {
7898
8010
  const handler = (h) => {
7899
8011
  if (typeof h === "string") return isCallbackSource(h);
@@ -8023,7 +8135,7 @@ var DashboardRenderer = forwardRef(
8023
8135
  useEffect12(() => {
8024
8136
  if (!needsSandbox || sandbox) return;
8025
8137
  let cancelled = false;
8026
- import("./sandbox-WEMG76LE.js").then((m) => m.createSandboxRunner()).then((r) => !cancelled && setSandbox(r)).catch((e) => !cancelled && setSandboxError(String(e?.message ?? e)));
8138
+ import("./sandbox-RCDZ7SDZ.js").then((m) => m.createSandboxRunner()).then((r) => !cancelled && setSandbox(r)).catch((e) => !cancelled && setSandboxError(String(e?.message ?? e)));
8027
8139
  return () => {
8028
8140
  cancelled = true;
8029
8141
  };
@@ -8365,7 +8477,7 @@ function DashboardBody({
8365
8477
  const grid = doc.spec.grid;
8366
8478
  const tour = editable ? NO_STEPS : doc.spec.tour ?? NO_STEPS;
8367
8479
  const hidden = useHiddenPanels(Object.keys(doc.spec.panels));
8368
- return /* @__PURE__ */ jsxs23(Fragment11, { children: [
8480
+ return /* @__PURE__ */ jsxs23(Fragment12, { children: [
8369
8481
  !hideHeader && (head.title || head.synced || tour.length > 0) && /* @__PURE__ */ jsxs23("div", { className: "ds-header", children: [
8370
8482
  head.title && /* @__PURE__ */ jsx31("h2", { className: "ds-title", children: head.title }),
8371
8483
  head.description && /* @__PURE__ */ jsx31("p", { className: "ds-desc", children: head.description }),
@@ -8443,55 +8555,6 @@ var token = {
8443
8555
  /** A font family: `token.font("heading")`. */
8444
8556
  font: (name) => `var(--ds-font-${name})`
8445
8557
  };
8446
-
8447
- // src/widgets/wrap.tsx
8448
- import { Suspense, lazy } from "react";
8449
- import { z as z17 } from "zod";
8450
- import { jsx as jsx32 } from "react/jsx-runtime";
8451
- function wrapComponent(Component2, o) {
8452
- const schema = o.schema ?? z17.record(z17.unknown());
8453
- const eventNames = [...new Set(Object.values(o.events ?? {}))];
8454
- return defineWidget({
8455
- kind: o.kind,
8456
- version: o.version ?? 1,
8457
- meta: o.meta,
8458
- schema,
8459
- ...o.defaults ? { defaults: o.defaults } : {},
8460
- ...o.implements ? { implements: o.implements } : {},
8461
- ...o.exposes ? { exposes: o.exposes } : {},
8462
- ...o.frame ? { frame: o.frame } : {},
8463
- ...o.small ? { small: true } : {},
8464
- events: eventNames,
8465
- ...o.slots ? { slots: Object.fromEntries(Object.values(o.slots).map((s) => [s, { label: s }])) } : {},
8466
- component: function Wrapped(props) {
8467
- const mapped = o.mapProps ? o.mapProps(props) : { ...props.spec, data: props.data };
8468
- const handlers = {};
8469
- for (const [prop, event] of Object.entries(o.events ?? {}))
8470
- handlers[prop] = (value, ...rest) => props.emit(event, void 0, { value, args: [value, ...rest] });
8471
- for (const [prop, path] of Object.entries(o.writes ?? {})) {
8472
- const before = handlers[prop];
8473
- handlers[prop] = (value, ...rest) => {
8474
- props.store.set(path, value);
8475
- before?.(value, ...rest);
8476
- };
8477
- }
8478
- const slotProps = {};
8479
- for (const [prop, slot] of Object.entries(o.slots ?? {})) slotProps[prop] = props.renderSlot(slot);
8480
- return /* @__PURE__ */ jsx32(Component2, { ...mapped, ...handlers, ...slotProps });
8481
- }
8482
- });
8483
- }
8484
- function lazyWidget(def) {
8485
- const { load, fallback, ...rest } = def;
8486
- let Comp;
8487
- return defineWidget({
8488
- ...rest,
8489
- component: function LazyWidget(props) {
8490
- Comp ??= lazy(load);
8491
- return /* @__PURE__ */ jsx32(Suspense, { fallback: fallback ?? /* @__PURE__ */ jsx32("div", { className: "ds-skeleton", "aria-busy": "true" }), children: /* @__PURE__ */ jsx32(Comp, { ...props }) });
8492
- }
8493
- });
8494
- }
8495
8558
  export {
8496
8559
  ACTION_KINDS,
8497
8560
  ACTION_SCHEMAS,