@namroodinc/liquid-editorial 0.6.9 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/UPGRADING.md +64 -0
- package/dist/chunks/{ColourField-DC6cLb9h.js → ColourField-B-tjjBfA.js} +2 -2
- package/dist/chunks/{ColourField-DC6cLb9h.js.map → ColourField-B-tjjBfA.js.map} +1 -1
- package/dist/chunks/{ColourField-NnFxLEsh.cjs → ColourField-ynUP1pfN.cjs} +2 -2
- package/dist/chunks/{ColourField-NnFxLEsh.cjs.map → ColourField-ynUP1pfN.cjs.map} +1 -1
- package/dist/chunks/FormEditor-C_4JbAnS.cjs +2 -0
- package/dist/chunks/FormEditor-C_4JbAnS.cjs.map +1 -0
- package/dist/chunks/{FormEditor-BkBhcYI5.js → FormEditor-ucTbDyQt.js} +177 -161
- package/dist/chunks/FormEditor-ucTbDyQt.js.map +1 -0
- package/dist/chunks/NumberField-1EYJdwDY.cjs +2 -0
- package/dist/chunks/NumberField-1EYJdwDY.cjs.map +1 -0
- package/dist/chunks/NumberField-DizR4NJv.js +178 -0
- package/dist/chunks/NumberField-DizR4NJv.js.map +1 -0
- package/dist/chunks/Slider-BfvNPjRJ.cjs +2 -0
- package/dist/chunks/Slider-BfvNPjRJ.cjs.map +1 -0
- package/dist/chunks/Slider-Cab6NqhK.js +168 -0
- package/dist/chunks/Slider-Cab6NqhK.js.map +1 -0
- package/dist/chunks/decimal-Ca7qJExZ.cjs +2 -0
- package/dist/chunks/decimal-Ca7qJExZ.cjs.map +1 -0
- package/dist/chunks/decimal-hq_W9D3s.js +15 -0
- package/dist/chunks/decimal-hq_W9D3s.js.map +1 -0
- package/dist/components/ColourField/index.cjs +1 -1
- package/dist/components/ColourField/index.js +1 -1
- package/dist/components/FormEditor/README.md +33 -7
- package/dist/components/FormEditor/index.cjs +1 -1
- package/dist/components/FormEditor/index.js +1 -1
- package/dist/components/FormEditor/model.d.cts +5 -0
- package/dist/components/FormEditor/model.d.cts.map +1 -1
- package/dist/components/FormEditor/model.d.ts +5 -0
- package/dist/components/FormEditor/model.d.ts.map +1 -1
- package/dist/components/ImageCropper/index.cjs +1 -1
- package/dist/components/ImageCropper/index.js +1 -1
- package/dist/components/NumberField/index.cjs +1 -2
- package/dist/components/NumberField/index.d.cts +10 -3
- package/dist/components/NumberField/index.d.cts.map +1 -1
- package/dist/components/NumberField/index.d.ts +10 -3
- package/dist/components/NumberField/index.d.ts.map +1 -1
- package/dist/components/NumberField/index.js +1 -128
- package/dist/components/NumberField/step.d.cts +29 -0
- package/dist/components/NumberField/step.d.cts.map +1 -0
- package/dist/components/NumberField/step.d.ts +29 -0
- package/dist/components/NumberField/step.d.ts.map +1 -0
- package/dist/components/Slider/index.cjs +1 -1
- package/dist/components/Slider/index.d.cts.map +1 -1
- package/dist/components/Slider/index.d.ts.map +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/Slider/scale.d.cts +0 -2
- package/dist/components/Slider/scale.d.cts.map +1 -1
- package/dist/components/Slider/scale.d.ts +0 -2
- package/dist/components/Slider/scale.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +5 -5
- package/dist/internal/decimal.d.cts +7 -0
- package/dist/internal/decimal.d.cts.map +1 -0
- package/dist/internal/decimal.d.ts +7 -0
- package/dist/internal/decimal.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/chunks/FormEditor-B4mtAxaU.cjs +0 -2
- package/dist/chunks/FormEditor-B4mtAxaU.cjs.map +0 -1
- package/dist/chunks/FormEditor-BkBhcYI5.js.map +0 -1
- package/dist/chunks/Slider-k8weRl34.cjs +0 -2
- package/dist/chunks/Slider-k8weRl34.cjs.map +0 -1
- package/dist/chunks/Slider-vdMFLX-H.js +0 -174
- package/dist/chunks/Slider-vdMFLX-H.js.map +0 -1
- package/dist/components/NumberField/index.cjs.map +0 -1
- package/dist/components/NumberField/index.js.map +0 -1
|
@@ -1,128 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/* empty css */
|
|
3
|
-
import { r as t } from "../../chunks/binding-Bshy43sG.js";
|
|
4
|
-
import { FieldAffix as n } from "../FieldAffix/index.js";
|
|
5
|
-
import { forwardRef as r, useCallback as i, useRef as a, useState as o } from "react";
|
|
6
|
-
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
-
//#region src/components/NumberField/index.tsx
|
|
8
|
-
function l(...e) {
|
|
9
|
-
return e.filter(Boolean).join(" ");
|
|
10
|
-
}
|
|
11
|
-
var u = r(function({ size: t = "md", value: r, defaultValue: u = "", onValueChange: d, min: f, max: p, step: m = 1, prefix: h, suffix: g, isDisabled: _ = !1, isInvalid: v = !1, hasSteppers: y = !0, decreaseLabel: b = "Decrease", increaseLabel: x = "Increase", className: S, disabled: C, "aria-invalid": w, ...T }, E) {
|
|
12
|
-
let [D, O] = o(u), k = r ?? D, A = a(null), j = i((e) => {
|
|
13
|
-
r === void 0 && O(e), d?.(e);
|
|
14
|
-
}, [d, r]), M = (e) => {
|
|
15
|
-
let t = (k === "" ? f ?? 0 : k) + e * (m === "any" ? 1 : m);
|
|
16
|
-
f !== void 0 && (t = Math.max(f, t)), p !== void 0 && (t = Math.min(p, t)), t = Number(t.toFixed(10)), j(t), A.current?.focus();
|
|
17
|
-
}, N = k !== "" && (f !== void 0 && k < f || p !== void 0 && k > p);
|
|
18
|
-
return /* @__PURE__ */ c("div", {
|
|
19
|
-
className: l("ds-number", S),
|
|
20
|
-
"data-size": t,
|
|
21
|
-
children: [
|
|
22
|
-
y && /* @__PURE__ */ s(e, {
|
|
23
|
-
size: t,
|
|
24
|
-
isIconOnly: !0,
|
|
25
|
-
iconStart: "minus",
|
|
26
|
-
className: "ds-number__step",
|
|
27
|
-
"aria-label": b,
|
|
28
|
-
isDisabled: _ || C || f !== void 0 && k !== "" && k <= f,
|
|
29
|
-
onClick: () => M(-1)
|
|
30
|
-
}),
|
|
31
|
-
/* @__PURE__ */ s(n, {
|
|
32
|
-
className: "ds-number__body",
|
|
33
|
-
lead: h,
|
|
34
|
-
trail: g,
|
|
35
|
-
children: /* @__PURE__ */ s("input", {
|
|
36
|
-
ref: (e) => {
|
|
37
|
-
A.current = e, typeof E == "function" ? E(e) : E && (E.current = e);
|
|
38
|
-
},
|
|
39
|
-
type: "number",
|
|
40
|
-
inputMode: "decimal",
|
|
41
|
-
value: k,
|
|
42
|
-
min: f,
|
|
43
|
-
max: p,
|
|
44
|
-
step: m,
|
|
45
|
-
disabled: _ || C,
|
|
46
|
-
"aria-invalid": v || N || w || void 0,
|
|
47
|
-
"data-size": t,
|
|
48
|
-
className: "ds-field-skin ds-number__input",
|
|
49
|
-
onChange: (e) => {
|
|
50
|
-
let t = e.target.value;
|
|
51
|
-
j(t === "" ? "" : Number(t));
|
|
52
|
-
},
|
|
53
|
-
...T
|
|
54
|
-
})
|
|
55
|
-
}),
|
|
56
|
-
y && /* @__PURE__ */ s(e, {
|
|
57
|
-
size: t,
|
|
58
|
-
isIconOnly: !0,
|
|
59
|
-
iconStart: "plus",
|
|
60
|
-
className: "ds-number__step",
|
|
61
|
-
"aria-label": x,
|
|
62
|
-
isDisabled: _ || C || p !== void 0 && k !== "" && k >= p,
|
|
63
|
-
onClick: () => M(1)
|
|
64
|
-
})
|
|
65
|
-
]
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
function d({ value: e, defaultValue: n = {
|
|
69
|
-
min: "",
|
|
70
|
-
max: ""
|
|
71
|
-
}, onValueChange: r, size: i = "md", min: a, max: d, step: f = 1, prefix: p, suffix: m, isDisabled: h = !1, minLabel: g = "Minimum", maxLabel: _ = "Maximum", className: v, ...y }) {
|
|
72
|
-
let [b, x] = o(n), S = e ?? b, C = (t) => {
|
|
73
|
-
e === void 0 && x(t), r?.(t);
|
|
74
|
-
}, w = S.min !== "" && S.max !== "" && S.min > S.max, { attributes: T } = t(y);
|
|
75
|
-
return /* @__PURE__ */ c("div", {
|
|
76
|
-
...T,
|
|
77
|
-
className: l("ds-number-range", v),
|
|
78
|
-
children: [
|
|
79
|
-
/* @__PURE__ */ s(u, {
|
|
80
|
-
"aria-invalid": y["aria-invalid"],
|
|
81
|
-
"aria-label": g,
|
|
82
|
-
decreaseLabel: `Decrease ${g}`,
|
|
83
|
-
increaseLabel: `Increase ${g}`,
|
|
84
|
-
size: i,
|
|
85
|
-
value: S.min,
|
|
86
|
-
min: a,
|
|
87
|
-
max: d,
|
|
88
|
-
step: f,
|
|
89
|
-
prefix: p,
|
|
90
|
-
suffix: m,
|
|
91
|
-
isDisabled: h,
|
|
92
|
-
isInvalid: w,
|
|
93
|
-
onValueChange: (e) => C({
|
|
94
|
-
...S,
|
|
95
|
-
min: e
|
|
96
|
-
})
|
|
97
|
-
}),
|
|
98
|
-
/* @__PURE__ */ s("span", {
|
|
99
|
-
className: "ds-number-range__dash",
|
|
100
|
-
"aria-hidden": "true",
|
|
101
|
-
children: "–"
|
|
102
|
-
}),
|
|
103
|
-
/* @__PURE__ */ s(u, {
|
|
104
|
-
"aria-invalid": y["aria-invalid"],
|
|
105
|
-
"aria-label": _,
|
|
106
|
-
decreaseLabel: `Decrease ${_}`,
|
|
107
|
-
increaseLabel: `Increase ${_}`,
|
|
108
|
-
size: i,
|
|
109
|
-
value: S.max,
|
|
110
|
-
min: a,
|
|
111
|
-
max: d,
|
|
112
|
-
step: f,
|
|
113
|
-
prefix: p,
|
|
114
|
-
suffix: m,
|
|
115
|
-
isDisabled: h,
|
|
116
|
-
isInvalid: w,
|
|
117
|
-
onValueChange: (e) => C({
|
|
118
|
-
...S,
|
|
119
|
-
max: e
|
|
120
|
-
})
|
|
121
|
-
})
|
|
122
|
-
]
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
//#endregion
|
|
126
|
-
export { u as NumberField, d as NumberRangeField };
|
|
127
|
-
|
|
128
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { t as NumberField, n as NumberRangeField } from "../../chunks/NumberField-DizR4NJv.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** The bounds and step a NumberField's steppers and arrow keys move within. */
|
|
2
|
+
export interface NumberScale {
|
|
3
|
+
min?: number;
|
|
4
|
+
max?: number;
|
|
5
|
+
step: number | "any";
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* How far one press or arrow key moves, or undefined for a step that is not a
|
|
9
|
+
* positive finite number. `"any"` has no step of its own: it moves by 1, or by
|
|
10
|
+
* the largest power of ten below the range when `min` and `max` are at most 1
|
|
11
|
+
* apart, so a 0–1 ratio moves by 0.1 instead of jumping between its ends.
|
|
12
|
+
*/
|
|
13
|
+
export declare function stepSize({ min, max, step }: NumberScale): number | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Where one press or arrow key moves `current`, or undefined when it cannot move.
|
|
16
|
+
*
|
|
17
|
+
* A numeric step keeps values on the grid `min + k × step` (from 0 without a
|
|
18
|
+
* `min`), as browser stepping does, so stepped values never fail step
|
|
19
|
+
* validation. An off-grid value first moves to the neighbouring grid value, and
|
|
20
|
+
* `max` stops at the highest grid value inside it. `"any"` adds `stepSize` at
|
|
21
|
+
* the operands' precision. Results stay inside the bounds and never move
|
|
22
|
+
* against the pressed direction, so an out-of-range value only steps back in.
|
|
23
|
+
*
|
|
24
|
+
* An empty field counts as 0, except that the first press lands on a bound at
|
|
25
|
+
* or beyond 0: an empty `min: 1` field gives 1 and an empty `min: 0` field
|
|
26
|
+
* gives 0, instead of stepping past them.
|
|
27
|
+
*/
|
|
28
|
+
export declare function stepTarget(current: number | "", direction: 1 | -1, scale: NumberScale): number | undefined;
|
|
29
|
+
//# sourceMappingURL=step.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step.d.cts","sourceRoot":"","sources":["../../../src/components/NumberField/step.ts"],"names":[],"mappings":"AAEA,+EAA+E;AAC/E,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;CACtB;AAKD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAW5E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,GAAG,EAAE,EACpB,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,EACjB,KAAK,EAAE,WAAW,GACjB,MAAM,GAAG,SAAS,CAcpB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** The bounds and step a NumberField's steppers and arrow keys move within. */
|
|
2
|
+
export interface NumberScale {
|
|
3
|
+
min?: number;
|
|
4
|
+
max?: number;
|
|
5
|
+
step: number | "any";
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* How far one press or arrow key moves, or undefined for a step that is not a
|
|
9
|
+
* positive finite number. `"any"` has no step of its own: it moves by 1, or by
|
|
10
|
+
* the largest power of ten below the range when `min` and `max` are at most 1
|
|
11
|
+
* apart, so a 0–1 ratio moves by 0.1 instead of jumping between its ends.
|
|
12
|
+
*/
|
|
13
|
+
export declare function stepSize({ min, max, step }: NumberScale): number | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Where one press or arrow key moves `current`, or undefined when it cannot move.
|
|
16
|
+
*
|
|
17
|
+
* A numeric step keeps values on the grid `min + k × step` (from 0 without a
|
|
18
|
+
* `min`), as browser stepping does, so stepped values never fail step
|
|
19
|
+
* validation. An off-grid value first moves to the neighbouring grid value, and
|
|
20
|
+
* `max` stops at the highest grid value inside it. `"any"` adds `stepSize` at
|
|
21
|
+
* the operands' precision. Results stay inside the bounds and never move
|
|
22
|
+
* against the pressed direction, so an out-of-range value only steps back in.
|
|
23
|
+
*
|
|
24
|
+
* An empty field counts as 0, except that the first press lands on a bound at
|
|
25
|
+
* or beyond 0: an empty `min: 1` field gives 1 and an empty `min: 0` field
|
|
26
|
+
* gives 0, instead of stepping past them.
|
|
27
|
+
*/
|
|
28
|
+
export declare function stepTarget(current: number | "", direction: 1 | -1, scale: NumberScale): number | undefined;
|
|
29
|
+
//# sourceMappingURL=step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../src/components/NumberField/step.ts"],"names":[],"mappings":"AAEA,+EAA+E;AAC/E,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;CACtB;AAKD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAW5E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,GAAG,EAAE,EACpB,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,EACjB,KAAK,EAAE,WAAW,GACjB,MAAM,GAAG,SAAS,CAcpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Slider-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Slider-BfvNPjRJ.cjs");exports.RangeSlider=e.t,exports.Slider=e.n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Slider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EAGzB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Slider/index.tsx"],"names":[],"mappings":"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,gBAAgB,KAAK,IAAI,CAAC;IAClD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sFAAsF;IACtF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2FAA2F;IAC3F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,YAAmC,EACnC,aAAa,EACb,aAAa,EACb,GAAwB,EACxB,GAAwB,EACxB,IAA0B,EAC1B,aAAoB,EACpB,MAAM,EACN,MAAM,EACN,SAAS,EACT,OAAc,EACd,UAAkB,EAClB,QAAoB,EACpB,QAAoB,EACpB,SAAS,EACT,GAAG,OAAO,EACX,EAAE,gBAAgB,+BAgFlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EAGzB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EAGzB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C,OAAO,aAAa,CAAC;A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aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sFAAsF;IACtF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2FAA2F;IAC3F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,YAAmC,EACnC,aAAa,EACb,aAAa,EACb,GAAwB,EACxB,GAAwB,EACxB,IAA0B,EAC1B,aAAoB,EACpB,MAAM,EACN,MAAM,EACN,SAAS,EACT,OAAc,EACd,UAAkB,EAClB,QAAoB,EACpB,QAAoB,EACpB,SAAS,EACT,GAAG,OAAO,EACX,EAAE,gBAAgB,+BAgFlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as RangeSlider, n as Slider } from "../../chunks/Slider-
|
|
1
|
+
export { t as RangeSlider, n as Slider } from "../../chunks/Slider-Cab6NqhK.js";
|
|
@@ -8,6 +8,4 @@ export interface SliderScale {
|
|
|
8
8
|
export declare const sliderDefaults: SliderScale;
|
|
9
9
|
export declare function sliderScale({ min, max, step, }?: Partial<SliderScale>): SliderScale;
|
|
10
10
|
export declare function clampToScale(value: number, { min, max }: SliderScale): number;
|
|
11
|
-
/** `a + b` at the operands' decimal precision: 0.3 + -0.1 is 0.2, not 0.19999999999999998. */
|
|
12
|
-
export declare function preciseSum(a: number, b: number): number;
|
|
13
11
|
//# sourceMappingURL=scale.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scale.d.cts","sourceRoot":"","sources":["../../../src/components/Slider/scale.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kFAAkF;AAClF,eAAO,MAAM,cAAc,EAAE,WAA2C,CAAC;AAEzE,wBAAgB,WAAW,CAAC,EAC1B,GAAwB,EACxB,GAAwB,EACxB,IAA0B,GAC3B,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CAEzC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,WAAW,UAEpE
|
|
1
|
+
{"version":3,"file":"scale.d.cts","sourceRoot":"","sources":["../../../src/components/Slider/scale.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kFAAkF;AAClF,eAAO,MAAM,cAAc,EAAE,WAA2C,CAAC;AAEzE,wBAAgB,WAAW,CAAC,EAC1B,GAAwB,EACxB,GAAwB,EACxB,IAA0B,GAC3B,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CAEzC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,WAAW,UAEpE"}
|
|
@@ -8,6 +8,4 @@ export interface SliderScale {
|
|
|
8
8
|
export declare const sliderDefaults: SliderScale;
|
|
9
9
|
export declare function sliderScale({ min, max, step, }?: Partial<SliderScale>): SliderScale;
|
|
10
10
|
export declare function clampToScale(value: number, { min, max }: SliderScale): number;
|
|
11
|
-
/** `a + b` at the operands' decimal precision: 0.3 + -0.1 is 0.2, not 0.19999999999999998. */
|
|
12
|
-
export declare function preciseSum(a: number, b: number): number;
|
|
13
11
|
//# sourceMappingURL=scale.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/scale.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kFAAkF;AAClF,eAAO,MAAM,cAAc,EAAE,WAA2C,CAAC;AAEzE,wBAAgB,WAAW,CAAC,EAC1B,GAAwB,EACxB,GAAwB,EACxB,IAA0B,GAC3B,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CAEzC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,WAAW,UAEpE
|
|
1
|
+
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/scale.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kFAAkF;AAClF,eAAO,MAAM,cAAc,EAAE,WAA2C,CAAC;AAEzE,wBAAgB,WAAW,CAAC,EAC1B,GAAwB,EACxB,GAAwB,EACxB,IAA0B,GAC3B,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CAEzC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,WAAW,UAEpE"}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./chunks/Icon-WOhlu6Rp.cjs"),t=require("./components/Button/index.cjs"),n=require("./components/Drawer/index.cjs"),r=require("./components/SideNav/index.cjs"),i=require("./components/TopNav/index.cjs"),a=require("./components/AppShell/index.cjs"),o=require("./components/ButtonGroup/index.cjs"),s=require("./components/Badge/index.cjs"),c=require("./components/Field/index.cjs"),l=require("./components/Modal/index.cjs"),u=require("./components/TextField/index.cjs"),d=require("./chunks/RichTextEditor-DAnjElUO.cjs"),f=require("./components/Container/index.cjs"),p=require("./components/FieldAffix/index.cjs"),m=require("./components/SearchField/index.cjs"),h=require("./components/SortableList/index.cjs"),g=require("./chunks/EntryPicker-daSkD4aR.cjs"),_=require("./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./chunks/Icon-WOhlu6Rp.cjs"),t=require("./components/Button/index.cjs"),n=require("./components/Drawer/index.cjs"),r=require("./components/SideNav/index.cjs"),i=require("./components/TopNav/index.cjs"),a=require("./components/AppShell/index.cjs"),o=require("./components/ButtonGroup/index.cjs"),s=require("./components/Badge/index.cjs"),c=require("./components/Field/index.cjs"),l=require("./components/Modal/index.cjs"),u=require("./components/TextField/index.cjs"),d=require("./chunks/RichTextEditor-DAnjElUO.cjs"),f=require("./components/Container/index.cjs"),p=require("./components/FieldAffix/index.cjs"),m=require("./components/SearchField/index.cjs"),h=require("./components/SortableList/index.cjs"),g=require("./chunks/EntryPicker-daSkD4aR.cjs"),_=require("./chunks/NumberField-1EYJdwDY.cjs"),v=require("./components/Popover/index.cjs"),y=require("./components/Select/index.cjs"),b=require("./components/Switch/index.cjs"),x=require("./chunks/ColourField-ynUP1pfN.cjs"),S=require("./chunks/Slider-BfvNPjRJ.cjs"),C=require("./chunks/DatePicker-01sor8iD.cjs"),w=require("./components/TagsInput/index.cjs"),T=require("./components/Grid/index.cjs"),E=require("./components/Choice/index.cjs"),D=require("./components/SelectionCard/index.cjs"),O=require("./chunks/FormEditor-C_4JbAnS.cjs"),k=require("./chunks/Board-CMf5Azt0.cjs"),A=require("./chunks/Avatar-B_2lI7fS.cjs"),j=require("./components/Table/index.cjs"),M=require("./components/Menu/index.cjs"),N=require("./components/Toast/index.cjs"),P=require("./components/Banner/index.cjs"),F=require("./components/Skeleton/index.cjs"),I=require("./components/SubNav/index.cjs"),L=require("./components/Stepper/index.cjs"),R=require("./components/AssetCard/index.cjs"),z=require("./components/AssetGrid/index.cjs"),B=require("./components/ImageCropper/index.cjs"),V=require("./components/Time/index.cjs"),H=require("./components/Pagination/index.cjs"),U=require("./components/EditLayout/index.cjs"),W=require("./chunks/CollectionView-BIuOL917.cjs"),G=require("./chunks/LoadState-C7tQ6fIP.cjs"),K=require("./components/EditSection/index.cjs"),q=require("./components/PageHeader/index.cjs"),J=require("./components/MetaList/index.cjs"),Y=require("./chunks/Wizard-B_CPW1V6.cjs");exports.AppShell=a.AppShell,exports.AssetCard=R.AssetCard,exports.AssetTile=R.AssetCard,exports.AssetCardSkeleton=R.AssetCardSkeleton,exports.AssetTileSkeleton=R.AssetCardSkeleton,exports.AssetGrid=z.AssetGrid,exports.AssetGridEmpty=z.AssetGridEmpty,exports.Avatar=A.t,exports.AvatarGroup=A.n,exports.Badge=s.Badge,exports.Banner=P.Banner,exports.Board=k.t,exports.BoardCard=k.n,exports.BoardColumn=k.r,exports.Button=t.Button,exports.ButtonGroup=o.ButtonGroup,exports.Calendar=C.t,exports.Checkbox=E.Checkbox,exports.CheckboxCard=D.CheckboxCard,exports.ChoiceGroup=E.ChoiceGroup,exports.CollectionEmpty=W.n,exports.CollectionView=W.t,exports.ColourField=x.t,exports.ColourPanel=x.n,exports.Container=f.Container,exports.DateField=C.n,exports.DateRangeField=C.r,exports.Drawer=n.Drawer,exports.EditLayout=U.EditLayout,exports.EditSection=K.EditSection,exports.EntryPicker=g.t,exports.Field=c.Field,exports.FieldAffix=p.FieldAffix,exports.FormEditor=O.t,exports.Grid=T.Grid,exports.GridItem=T.GridItem,exports.Icon=e.t,exports.ImageCropper=B.ImageCropper,exports.LoadError=G.n,exports.LoadState=G.t,exports.Menu=M.Menu,exports.MenuItem=M.MenuItem,exports.MenuLabel=M.MenuLabel,exports.MenuSeparator=M.MenuSeparator,exports.MetaList=J.MetaList,exports.Modal=l.Modal,exports.NumberField=_.t,exports.NumberRangeField=_.n,exports.PageHeader=q.PageHeader,exports.Pagination=H.Pagination,exports.Popover=v.Popover,exports.Radio=E.Radio,exports.RadioCard=D.RadioCard,exports.RangeSlider=S.t,exports.ReviewTable=Y.n,exports.RichTextEditor=d.t,exports.SearchField=m.SearchField,exports.Select=y.Select,exports.SelectionCardGroup=D.SelectionCardGroup,exports.SideNav=r.SideNav,exports.SideNavFooter=r.SideNavFooter,exports.SideNavHeader=r.SideNavHeader,exports.SideNavItem=r.SideNavItem,exports.SideNavSection=r.SideNavSection,exports.Skeleton=F.Skeleton,exports.SkeletonText=F.SkeletonText,exports.Slider=S.n,exports.SortableList=h.SortableList,exports.SortableListItem=h.SortableListItem,exports.Stack=T.Stack,exports.Stepper=L.Stepper,exports.SubNav=I.SubNav,exports.SubNavButton=I.SubNavButton,exports.SubNavItem=I.SubNavItem,exports.Switch=b.Switch,exports.Table=j.Table,exports.TableBody=j.TableBody,exports.TableCell=j.TableCell,exports.TableEmpty=j.TableEmpty,exports.TableFrame=j.TableFrame,exports.TableHead=j.TableHead,exports.TableHeaderCell=j.TableHeaderCell,exports.TableRow=j.TableRow,exports.TableToolbar=j.TableToolbar,exports.TagsInput=w.TagsInput,exports.TextArea=u.TextArea,exports.TextField=u.TextField,exports.Time=V.Time,exports.Toast=N.Toast,exports.ToastProvider=N.ToastProvider,exports.TopNav=i.TopNav,exports.TopNavItem=i.TopNavItem,exports.Wizard=Y.t,exports.cropToBlob=B.cropToBlob,exports.formatAbsoluteDate=V.formatAbsoluteDate,exports.formatAbsoluteTime=V.formatAbsoluteTime,exports.formatIsoDate=C.i,exports.formatRelativeTime=V.formatRelativeTime,exports.iconNames=e.n,exports.icons=e.r,exports.useSideNavCollapsed=r.useSideNavCollapsed,exports.useToast=N.useToast,exports.validateFormValues=O.n;
|
package/dist/index.js
CHANGED
|
@@ -15,18 +15,18 @@ import { FieldAffix as y } from "./components/FieldAffix/index.js";
|
|
|
15
15
|
import { SearchField as b } from "./components/SearchField/index.js";
|
|
16
16
|
import { SortableList as x, SortableListItem as S } from "./components/SortableList/index.js";
|
|
17
17
|
import { t as C } from "./chunks/EntryPicker-B88N69zH.js";
|
|
18
|
-
import {
|
|
18
|
+
import { n as w, t as T } from "./chunks/NumberField-DizR4NJv.js";
|
|
19
19
|
import { Popover as E } from "./components/Popover/index.js";
|
|
20
20
|
import { Select as D } from "./components/Select/index.js";
|
|
21
21
|
import { Switch as O } from "./components/Switch/index.js";
|
|
22
|
-
import { n as k, t as A } from "./chunks/ColourField-
|
|
23
|
-
import { n as j, t as M } from "./chunks/Slider-
|
|
22
|
+
import { n as k, t as A } from "./chunks/ColourField-B-tjjBfA.js";
|
|
23
|
+
import { n as j, t as M } from "./chunks/Slider-Cab6NqhK.js";
|
|
24
24
|
import { i as N, n as P, r as F, t as I } from "./chunks/DatePicker-DJAqXUDJ.js";
|
|
25
25
|
import { TagsInput as L } from "./components/TagsInput/index.js";
|
|
26
26
|
import { Grid as R, GridItem as z, Stack as B } from "./components/Grid/index.js";
|
|
27
27
|
import { Checkbox as V, ChoiceGroup as H, Radio as U } from "./components/Choice/index.js";
|
|
28
28
|
import { CheckboxCard as W, RadioCard as G, SelectionCardGroup as K } from "./components/SelectionCard/index.js";
|
|
29
|
-
import { n as q, t as J } from "./chunks/FormEditor-
|
|
29
|
+
import { n as q, t as J } from "./chunks/FormEditor-ucTbDyQt.js";
|
|
30
30
|
import { n as Y, r as X, t as Z } from "./chunks/Board-B8wK079I.js";
|
|
31
31
|
import { n as re, t as ie } from "./chunks/Avatar-DdFEOumt.js";
|
|
32
32
|
import { Table as ae, TableBody as oe, TableCell as se, TableEmpty as ce, TableFrame as le, TableHead as ue, TableHeaderCell as de, TableRow as fe, TableToolbar as pe } from "./components/Table/index.js";
|
|
@@ -48,4 +48,4 @@ import { EditSection as He } from "./components/EditSection/index.js";
|
|
|
48
48
|
import { PageHeader as Ue } from "./components/PageHeader/index.js";
|
|
49
49
|
import { MetaList as We } from "./components/MetaList/index.js";
|
|
50
50
|
import { n as Ge, t as Ke } from "./chunks/Wizard-C1iR5z44.js";
|
|
51
|
-
export { u as AppShell, Q as AssetCard, Q as AssetTile, $ as AssetCardSkeleton, $ as AssetTileSkeleton, Oe as AssetGrid, ke as AssetGridEmpty, ie as Avatar, re as AvatarGroup, f as Badge, xe as Banner, Z as Board, Y as BoardCard, X as BoardColumn, ne as Button, d as ButtonGroup, I as Calendar, V as Checkbox, W as CheckboxCard, H as ChoiceGroup, Re as CollectionEmpty, ze as CollectionView, A as ColourField, k as ColourPanel, v as Container, P as DateField, F as DateRangeField, t as Drawer, Le as EditLayout, He as EditSection, C as EntryPicker, p as Field, y as FieldAffix, J as FormEditor, R as Grid, z as GridItem, te as Icon, Ae as ImageCropper, Be as LoadError, Ve as LoadState, me as Menu, he as MenuItem, ge as MenuLabel, _e as MenuSeparator, We as MetaList, m as Modal,
|
|
51
|
+
export { u as AppShell, Q as AssetCard, Q as AssetTile, $ as AssetCardSkeleton, $ as AssetTileSkeleton, Oe as AssetGrid, ke as AssetGridEmpty, ie as Avatar, re as AvatarGroup, f as Badge, xe as Banner, Z as Board, Y as BoardCard, X as BoardColumn, ne as Button, d as ButtonGroup, I as Calendar, V as Checkbox, W as CheckboxCard, H as ChoiceGroup, Re as CollectionEmpty, ze as CollectionView, A as ColourField, k as ColourPanel, v as Container, P as DateField, F as DateRangeField, t as Drawer, Le as EditLayout, He as EditSection, C as EntryPicker, p as Field, y as FieldAffix, J as FormEditor, R as Grid, z as GridItem, te as Icon, Ae as ImageCropper, Be as LoadError, Ve as LoadState, me as Menu, he as MenuItem, ge as MenuLabel, _e as MenuSeparator, We as MetaList, m as Modal, T as NumberField, w as NumberRangeField, Ue as PageHeader, Ie as Pagination, E as Popover, U as Radio, G as RadioCard, M as RangeSlider, Ge as ReviewTable, _ as RichTextEditor, b as SearchField, D as Select, K as SelectionCardGroup, n as SideNav, r as SideNavFooter, i as SideNavHeader, a as SideNavItem, o as SideNavSection, Se as Skeleton, Ce as SkeletonText, j as Slider, x as SortableList, S as SortableListItem, B as Stack, De as Stepper, we as SubNav, Te as SubNavButton, Ee as SubNavItem, O as Switch, ae as Table, oe as TableBody, se as TableCell, ce as TableEmpty, le as TableFrame, ue as TableHead, de as TableHeaderCell, fe as TableRow, pe as TableToolbar, L as TagsInput, h as TextArea, g as TextField, Me as Time, ve as Toast, ye as ToastProvider, c as TopNav, l as TopNavItem, Ke as Wizard, je as cropToBlob, Ne as formatAbsoluteDate, Pe as formatAbsoluteTime, N as formatIsoDate, Fe as formatRelativeTime, e as iconNames, ee as icons, s as useSideNavCollapsed, be as useToast, q as validateFormValues };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Decimal places, including those an exponent implies, such as 1e-7. */
|
|
2
|
+
export declare function decimals(value: number): number;
|
|
3
|
+
/** `value` rounded to `places`, capped at the 100 places `toFixed` accepts. */
|
|
4
|
+
export declare function roundTo(value: number, places: number): number;
|
|
5
|
+
/** `a + b` at the operands' decimal precision: 0.3 + -0.1 is 0.2, not 0.19999999999999998. */
|
|
6
|
+
export declare function preciseSum(a: number, b: number): number;
|
|
7
|
+
//# sourceMappingURL=decimal.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decimal.d.cts","sourceRoot":"","sources":["../../src/internal/decimal.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,UAGrC;AAED,+EAA+E;AAC/E,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAEpD;AAED,8FAA8F;AAC9F,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAE9C"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Decimal places, including those an exponent implies, such as 1e-7. */
|
|
2
|
+
export declare function decimals(value: number): number;
|
|
3
|
+
/** `value` rounded to `places`, capped at the 100 places `toFixed` accepts. */
|
|
4
|
+
export declare function roundTo(value: number, places: number): number;
|
|
5
|
+
/** `a + b` at the operands' decimal precision: 0.3 + -0.1 is 0.2, not 0.19999999999999998. */
|
|
6
|
+
export declare function preciseSum(a: number, b: number): number;
|
|
7
|
+
//# sourceMappingURL=decimal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decimal.d.ts","sourceRoot":"","sources":["../../src/internal/decimal.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,UAGrC;AAED,+EAA+E;AAC/E,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAEpD;AAED,8FAA8F;AAC9F,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAE9C"}
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./colour-BmtxDlWF.cjs"),t=require("../components/Button/index.cjs"),n=require("../components/Field/index.cjs"),r=require("../components/TextField/index.cjs"),i=require("./RichTextEditor-DAnjElUO.cjs"),a=require("../components/Container/index.cjs"),o=require("./EntryPicker-daSkD4aR.cjs"),s=require("../components/NumberField/index.cjs"),c=require("../components/Select/index.cjs"),l=require("../components/Switch/index.cjs"),u=require("./ColourField-NnFxLEsh.cjs"),d=require("./Slider-k8weRl34.cjs"),f=require("./DatePicker-01sor8iD.cjs"),p=require("../components/TagsInput/index.cjs"),m=require("../components/Choice/index.cjs"),h=require("../components/SelectionCard/index.cjs");let g=require("react"),_=require("react/jsx-runtime");var v=[`wide`,`full`],y=[`sm`,`md`,`lg`],b=new Set([`shortText`,`longText`,`richText`,`number`,`boolean`,`dateTime`,`asset`,`reference`,`select`,`slider`,`rangeSlider`,`colour`,`radioGroup`,`checkboxGroup`,`tags`,`date`,`divider`]);function x(e){let t=new Set;for(let n of e.fields){if(!n.id?.trim()||t.has(n.id))throw Error(`Form field IDs must be nonempty and unique.`);if(!b.has(n.type))throw Error(`Unsupported form field type: ${n.type}`);(n.type===`select`||n.type===`radioGroup`||n.type===`checkboxGroup`)&&ee(n),(n.type===`slider`||n.type===`rangeSlider`)&&A(n),n.type!==`divider`&&(k(n),w(n)),t.add(n.id)}}var S=new Set([`shortText`,`longText`,`tags`,`asset`,`reference`]);function C(e){return S.has(e.type)}function w(e){if(C(e)){if(e.limitDisplay!==void 0&&![`used`,`remaining`].includes(e.limitDisplay))throw Error(`Field ${e.id} needs a limitDisplay of used or remaining.`);if(e.limitVisibility!==void 0&&![`always`,`nearLimit`].includes(e.limitVisibility))throw Error(`Field ${e.id} needs a limitVisibility of always or nearLimit.`);if(e.showLimitRing!==void 0&&typeof e.showLimitRing!=`boolean`)throw Error(`Field ${e.id} needs a boolean showLimitRing.`)}}function T(e,t,n){return C(e)?{limitDisplay:e.limitDisplay,limitVisibility:e.limitVisibility,showLimitRing:e.showLimitRing,limit:E(e,t,n??[])}:{}}function E(e,t,n){switch(e.type){case`shortText`:case`longText`:return e.maxLength===void 0?void 0:{count:D(t).length,max:e.maxLength};case`tags`:return e.max===void 0?void 0:{count:H(t).length,max:e.max};default:return o.n(O(e),n.length,N(e).max)}}function D(e){return typeof e==`string`?e:``}function O(e){return e.multiple?`multiple`:`single`}function k(e){if(e.width!==void 0&&!y.includes(e.width))throw Error(`Field ${e.id} needs a width of sm, md or lg.`);if(e.type===`richText`&&e.expandedWidth!==void 0&&!v.includes(e.expandedWidth))throw Error(`Rich text field ${e.id} needs an expandedWidth of wide or full.`)}function A(e){let{min:t,max:n,step:r}=d.a(e);if(![t,n,r].every(Number.isFinite)||t>=n||r<=0)throw Error(`Slider field ${e.id} needs finite min < max and a positive step.`);if(e.type===`rangeSlider`&&r>d.i(n,-t))throw Error(`Range slider ${e.id} needs room for at least one step.`)}function ee(e){if(!Array.isArray(e.options)){let t=e.type===`select`?`Select`:`Choice`;throw Error(`${t} field ${e.id} needs an options array.`)}if(e.type===`select`)return;let t=e.options.map(e=>e.value);if(t.some(e=>typeof e!=`string`||!e.trim())||new Set(t).size!==t.length)throw Error(`Choice field ${e.id} needs nonempty, unique option values.`)}var j={asset:{key:`assetId`,itemLabel:`asset`,itemsLabel:`assets`},reference:{key:`entryId`,itemLabel:`entry`,itemsLabel:`entries`}};function M(e){return e.type===`asset`||e.type===`reference`?e.picker?.label??e.label:e.label}function N(e){let t=j[e.type],{addLabel:n=`Choose ${M(e)}`,emptyLabel:r,itemLabel:i=t.itemLabel,itemsLabel:a=t.itemsLabel,max:o,isReorderable:s}=e.picker??{};return{addLabel:n,emptyLabel:r,itemLabel:i,itemsLabel:a,max:o,isReorderable:s}}function P(e,t){let{key:n}=j[e.type];return(Array.isArray(t)?t:t===void 0?[]:[t]).flatMap(e=>I(e,n)?[e[n]]:[])}function F(e){if(typeof e!=`string`)return;let t=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(?:Z|\+00:00)$/.exec(e);if(!t)return;let n=`${t[1]}:${t[2]??`00`}.${(t[3]??``).padEnd(3,`0`)}Z`,r=new Date(n);if(Number.isFinite(r.getTime())&&r.toISOString()===n)return n}function I(e,t){return!!e&&typeof e==`object`&&t in e&&typeof e[t]==`string`&&e[t].trim().length>0}function L(e){return!!e.text?.trim()||e.type===`horizontalRule`||!!e.content?.some(L)}function R(e){return`${M(e)} is required.`}function z(e,t){if(typeof t!=`string`)return`Enter text.`;if(e.required&&!t.trim())return R(e);if((e.type===`shortText`||e.type===`longText`)&&e.maxLength!==void 0&&t.length>e.maxLength)return`Enter no more than ${e.maxLength} characters.`}function B(e,t){let n=i.n(t);if(n)return n;if(e.required&&!L(t))return R(e)}function V(e,t){if(typeof t!=`string`)return`Choose an available option.`;if(t===``)return e.required?R(e):void 0;if((e.type===`select`||e.type===`radioGroup`)&&e.options.length>0&&!e.options.some(e=>e.value===t))return`Choose an available option.`}function H(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function U(e,t){if(!Array.isArray(t)||!t.every(e=>typeof e==`string`&&e.trim())||new Set(t).size!==t.length)return`Enter a list of unique, nonempty text values.`;if(e.required&&!t.length)return R(e);if(e.type===`tags`&&e.max!==void 0&&t.length>e.max)return`Enter no more than ${e.max} tags.`;if(e.type===`checkboxGroup`&&e.options.length&&t.some(t=>!e.options.some(e=>e.value===t)))return`Choose available options.`}function W(e,t){if(typeof t!=`number`||!Number.isFinite(t))return`Enter a finite number.`;let{min:n,max:r}=e.type===`slider`||e.type===`rangeSlider`?d.a(e):e.type===`number`?e:{};if(n!==void 0&&t<n)return`Enter a number of at least ${n}.`;if(r!==void 0&&t>r)return`Enter a number no greater than ${r}.`}function G(e,t){if(typeof t!=`string`)return`Enter a valid calendar date (YYYY-MM-DD).`;if(!t)return e.required?R(e):void 0;if(!f.a(t))return`Enter a valid calendar date (YYYY-MM-DD).`;if(e.type===`date`){if(e.min&&t<e.min)return`Choose a date on or after ${e.min}.`;if(e.max&&t>e.max)return`Choose a date on or before ${e.max}.`}}function K(e,t){return typeof e==`number`&&Number.isFinite(e)?d.r(e,t):void 0}function q(e,t){let n=e,r=K(n?.min,t),i=K(n?.max,t);if(r===void 0&&i===void 0)return;let[a,o]=[r??t.min,i??t.max].sort((e,t)=>e-t);return{min:a,max:o}}function J(e,t){if(!t||typeof t!=`object`||Array.isArray(t))return`Enter a range.`;let n=t,r=n.min,i=n.max,a=W(e,r)??W(e,i);if(a)return a;if(r>i)return`The start must not be greater than the end.`;if(e.type===`rangeSlider`&&d.i(i,-r)<d.a(e).step)return`Keep the range endpoints at least one step apart.`}function Y(t,n){return typeof n==`string`?n.trim()?e.i(n)?void 0:`Enter a valid colour.`:t.required?R(t):void 0:`Enter a valid colour.`}function X(e,t){if(e.type!==`asset`&&e.type!==`reference`)return;let{key:n,itemLabel:r,itemsLabel:i}=j[e.type];if(!e.multiple)return I(t,n)?void 0:`Choose an ${r}.`;if(!Array.isArray(t)||!t.every(e=>I(e,n)))return`Choose a list of ${i}.`;if(e.required&&t.length===0)return R(e);let a=e.picker?.max;if(a!==void 0&&t.length>a)return`Choose no more than ${a} ${N(e).itemsLabel}.`}var Z={shortText:z,longText:z,richText:B,number:W,slider:W,rangeSlider:J,date:G,colour:Y,radioGroup:V,checkboxGroup:U,tags:U,boolean:(e,t)=>typeof t==`boolean`?void 0:`Choose a boolean value.`,dateTime:(e,t)=>F(t)?void 0:`Enter a valid UTC date and time.`,select:V,asset:X,reference:X};function Q(e,t){return t===void 0?e.required?R(e):void 0:Z[e.type](e,t)}function te(e,t){return x(e),Object.fromEntries(e.fields.flatMap(e=>{if(e.type===`divider`)return[];let n=Q(e,Object.hasOwn(t,e.id)?t[e.id]:void 0);return n?[[e.id,n]]:[]}))}function ne({field:e,option:t,name:n,checked:r,isDisabled:i,invalid:a,onChange:o}){let s={name:n,value:t.value,checked:r,disabled:i||t.isDisabled,"aria-invalid":a,onChange:()=>{!i&&!t.isDisabled&&o()}};if(e.appearance===`card`){let n=e.type===`radioGroup`?h.RadioCard:h.CheckboxCard;return(0,_.jsx)(n,{...s,title:t.label,description:t.description})}let c=e.type===`radioGroup`?m.Radio:m.Checkbox;return(0,_.jsx)(c,{...s,children:(0,_.jsxs)(`span`,{children:[t.label,t.description&&(0,_.jsx)(`span`,{className:`ds-form-editor__option-description`,children:t.description})]})})}function re({field:e,stored:n,isDisabled:r,required:i,accessibility:a,onChange:o}){let s=e.type===`checkboxGroup`,c=s?H(n):typeof n==`string`&&n?[n]:[],l=e.appearance===`card`?h.SelectionCardGroup:m.ChoiceGroup;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(l,{...a,label:e.label,columns:e.columns??(e.appearance===`card`?2:1),children:e.options.map(t=>(0,_.jsx)(ne,{field:e,option:t,name:a.id,checked:c.includes(t.value),isDisabled:r,invalid:a[`aria-invalid`],onChange:()=>{o(s?c.includes(t.value)?c.filter(e=>e!==t.value):[...c,t.value]:t.value)}},t.value))}),!s&&!i&&c.length>0&&(0,_.jsxs)(t.Button,{variant:`simple`,size:`sm`,isDisabled:r,onClick:()=>o(void 0),children:[`Clear `,e.label]})]})}function ie({field:e,stored:t,isDisabled:n,accessibility:r,onChange:i}){let a=d.a(e),o=K(t,a);return(0,_.jsx)(d.n,{...r,...a,prefix:e.prefix,suffix:e.suffix,hasValueLabel:e.hasValueLabel,valueText:o===void 0?e.placeholder??`Not set`:void 0,autoFocus:e.autoFocus,isDisabled:n,value:o??a.min,onValueChange:i,onValueCommit:e=>{o===void 0&&i(e)}})}function ae({field:e,stored:t,isDisabled:n,accessibility:r,onChange:i}){let a=d.a(e),o=q(t,a);return(0,_.jsx)(d.t,{...r,...a,prefix:e.prefix,suffix:e.suffix,hasValueLabel:e.hasValueLabel,minLabel:`${e.label} minimum`,maxLabel:`${e.label} maximum`,isDisabled:n,valueText:o===void 0?e.placeholder??`Not set`:void 0,hasFill:o!==void 0,value:o??{min:a.min,max:a.max},onValueChange:i,onValueCommit:e=>{o===void 0&&i(e)}})}function oe({field:t,stored:n,isDisabled:r,required:i,accessibility:a,onChange:o}){let s={stored:n,isDisabled:r,required:i,accessibility:a,onChange:o};switch(t.type){case`radioGroup`:case`checkboxGroup`:return(0,_.jsx)(re,{field:t,...s});case`rangeSlider`:return(0,_.jsx)(ae,{field:t,...s});case`slider`:return(0,_.jsx)(ie,{field:t,...s});case`colour`:return(0,_.jsx)(u.t,{...a,required:i,placeholder:t.placeholder,presets:t.presets,showPresets:t.showPresets,picker:t.picker,placement:t.placement,readOnly:t.readOnly,autoFocus:t.autoFocus,isDisabled:r,value:typeof n==`string`?n:``,onInput:t=>{let n=t.currentTarget.value;n.trim()&&!e.i(n)&&o(n)},onValueChange:e=>o(e===``?void 0:e)});case`tags`:return(0,_.jsx)(p.TagsInput,{...a,required:i,placeholder:t.placeholder,max:t.max,isDisabled:r,value:H(n),onValueChange:o});case`date`:return(0,_.jsx)(f.n,{...a,placeholder:t.placeholder,min:t.min,max:t.max,placement:t.placement,isDisabled:r,isClearable:!0,clearLabel:`Clear ${t.label}`,value:typeof n==`string`?n:``,onValueChange:e=>o(e===``?void 0:e)})}}function se(e,t){if(e.type===`asset`){let n=t.map(e=>({assetId:e}));return e.multiple?n:n[0]}let n=t.map(e=>({entryId:e}));return e.multiple?n:n[0]}function ce({field:e,stored:t,isDisabled:n,required:r,accessibility:i,onChange:a}){return(0,_.jsx)(s.NumberField,{...i,required:r,isDisabled:n,placeholder:e.placeholder,min:e.min,max:e.max,step:e.step??`any`,hasSteppers:e.hasSteppers??!1,prefix:e.prefix,suffix:e.suffix,autoFocus:e.autoFocus,decreaseLabel:`Decrease ${e.label}`,increaseLabel:`Increase ${e.label}`,value:typeof t==`number`&&Number.isFinite(t)?t:``,onValueChange:e=>{(e===``||Number.isFinite(e))&&a(e===``?void 0:e)}})}function le({field:e,stored:t,isDisabled:n,required:r,accessibility:i,onChange:a}){let o=!r&&!e.options.some(e=>e.value===``);return(0,_.jsx)(c.Select,{...i,"aria-required":r||void 0,isDisabled:n,isInvalid:i[`aria-invalid`],options:o?[{value:``,label:e.placeholder??`None`},...e.options]:e.options,placeholder:e.placeholder,autoFocus:e.autoFocus,value:typeof t==`string`?t:``,onValueChange:e=>a(e===``?void 0:e)})}function ue({field:e,selected:t,items:n,isDisabled:r,accessibility:i,onChange:a}){return(0,_.jsx)(o.t,{...i,items:n,value:t,...N(e),mode:O(e),isDisabled:r,onValueChange:t=>a(se(e,t))})}function $({field:e,stored:t,selected:n,items:a,isDisabled:o,accessibility:{required:s,...c},onChange:u}){let d={stored:t,isDisabled:o,required:s,accessibility:c,onChange:u};switch(e.type){case`shortText`:return(0,_.jsx)(r.TextField,{...c,required:s,disabled:o,placeholder:e.placeholder,type:e.inputType,maxLength:e.maxLength,readOnly:e.readOnly,autoFocus:e.autoFocus,value:D(t),onChange:e=>u(e.target.value)});case`longText`:return(0,_.jsx)(r.TextArea,{...c,required:s,disabled:o,placeholder:e.placeholder,rows:e.rows,maxLength:e.maxLength,readOnly:e.readOnly,autoFocus:e.autoFocus,value:D(t),onChange:e=>u(e.target.value)});case`number`:return(0,_.jsx)(ce,{field:e,...d});case`boolean`:return(0,_.jsx)(l.Switch,{...c,isDisabled:o,autoFocus:e.autoFocus,isSelected:t===!0,onSelectedChange:u});case`dateTime`:return(0,_.jsx)(r.TextField,{...c,required:s,disabled:o,type:`datetime-local`,step:`0.001`,autoFocus:e.autoFocus,value:F(t)?.slice(0,-1)??``,onChange:e=>u(F(`${e.target.value}Z`))});case`richText`:return(0,_.jsx)(i.t,{...c,expandedWidth:e.expandedWidth,label:e.label,isRequired:s,isDisabled:o,placeholder:e.placeholder,format:`json`,value:t===void 0?i.r:t,onChange:u});case`select`:return(0,_.jsx)(le,{field:e,...d});case`asset`:case`reference`:return(0,_.jsx)(ue,{field:e,items:a,selected:n??[],...d});default:return(0,_.jsx)(oe,{field:e,...d})}}function de({field:e,stored:t,items:r,isDisabled:i,error:o,isErrorVisible:s,onChange:c}){let l=(0,g.useMemo)(()=>o===void 0&&s?Q(e,t):void 0,[o,s,e,t]),u=(0,g.useMemo)(()=>e.type===`asset`||e.type===`reference`?P(e,t):void 0,[e,t]);return(0,_.jsx)(a.Container,{width:e.width,padded:!1,center:!1,className:`ds-form-editor__field`,children:(0,_.jsx)(n.Field,{...T(e,t,u),label:e.type===`dateTime`?`${e.label} (UTC)`:M(e),hint:e.hint,labelHint:e.labelHint,error:o??l,isRequired:e.required,count:u?.length??(e.type===`checkboxGroup`?H(t).length:void 0),isGroup:u!==void 0||fe.has(e.type),children:n=>(0,_.jsx)($,{field:e,stored:t,selected:u,items:r,isDisabled:i,accessibility:n,onChange:c})})})}var fe=new Set([`radioGroup`,`checkboxGroup`,`rangeSlider`]),pe=new Set([`slider`,`rangeSlider`,`date`,`colour`]);function me({schema:e,value:t,defaultValue:n={},onValueChange:r,pickerItems:i={},errors:a={},isDisabled:o=!1,showAllErrors:s=!1,columns:c=1,minColumnWidth:l=`16rem`,className:u,style:d,...f}){let[p,m]=(0,g.useState)(n),[h,v]=(0,g.useState)(()=>new Set),y=t??p;(0,g.useMemo)(()=>x(e),[e]);let b=(e,n)=>{let i={...y};n===void 0?delete i[e]:i[e]=n,t===void 0&&m(i),v(t=>new Set(t).add(e)),r?.(i,{fieldId:e})},S=c===`auto`?{"--form-editor-min-column":l}:{"--form-editor-columns":c,"--form-editor-min-column":l};return(0,_.jsx)(`div`,{className:[`ds-form-editor`,c===`auto`&&`ds-form-editor--auto`,u].filter(Boolean).join(` `),style:{...S,...d},...f,children:e.fields.map(e=>{if(e.type===`divider`)return(0,_.jsx)(`hr`,{className:`ds-form-editor__divider`},e.id);let t=Object.hasOwn(y,e.id)?y[e.id]:void 0,n=o||!!e.isDisabled,r=n||`readOnly`in e&&!!e.readOnly,c=typeof t==`string`?t.trim()!==``:t!==void 0,l=s||h.has(e.id)||c&&pe.has(e.type)||e.type===`number`&&typeof t==`number`;return(0,_.jsx)(de,{field:e,stored:t,items:i[e.id]??[],isDisabled:n,error:a[e.id],isErrorVisible:l,onChange:t=>{r||b(e.id,t)}},e.id)})})}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return me}});
|
|
2
|
-
//# sourceMappingURL=FormEditor-B4mtAxaU.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormEditor-B4mtAxaU.cjs","names":["selectionLimit","sliderScale","preciseSum","documentError","isIsoDate","clampToScale","parseColour","RadioCard","CheckboxCard","Radio","Checkbox","SelectionCardGroup","ChoiceGroup","_Fragment","Button","sliderScale","Slider","RangeSlider","ColourField","parseColour","TagsInput","DateField","NumberField","Select","EntryPicker","TextField","TextArea","Switch","RichTextEditor","emptyDocument","useMemo","Container","Field","useState","require_colour","require_components_Button_index","require_components_Field_index","require_components_TextField_index","require_RichTextEditor","require_components_Container_index","require_EntryPicker","require_components_NumberField_index","require_components_Select_index","require_components_Switch_index","require_ColourField","require_Slider","require_DatePicker","require_components_TagsInput_index","require_components_Choice_index","require_components_SelectionCard_index","react","react_jsx_runtime","expandedWidths","fieldWidths","fieldTypes","assertModel","ids","field","model","assertChoices","assertSlider","assertMeasures","assertLimitOptions","limitedTypes","supportsLimit","fieldLimitProps","schemaLimit","stored","selected","textValue","stringList","pickerMode","pickerCopy","min","max","step","kind","values","option","value","linkCopy","fieldLabel","defaults","selectedIds","isLink","link","key","parseUtcDateTime","match","canonical","date","hasRichText","node","requiredError","textError","richTextError","error","choiceError","item","listError","numberError","dateError","sliderValue","scale","rangeSliderValue","range","start","end","low","high","a","b","rangeError","colourError","linkError","itemLabel","itemsLabel","validators","fieldError","validateFormValues","Option","props","isDisabled","invalid","onChange","Card","Choice","ChoiceControl","multiple","Group","accessibility","required","SliderControl","shown","next","RangeSliderControl","AdditionalControl","raw","event","pickerValue","links","NumberControl","SelectControl","isClearable","PickerControl","FormControl","shared","FormEditorField","validation","isErrorVisible","groupTypes","loadedValidationTypes","FormEditor","rest","internal","setInternal","defaultValue","changed","setChanged","current","schema","commit","fieldId","previous","onValueChange","layout","columns","minColumnWidth","className","style","fieldDisabled","isLocked","isLoaded","showAllErrors","pickerItems","errors"],"sources":["../../src/components/RichTextEditor/expanded-width.ts","../../src/components/FormEditor/model.ts","../../src/components/FormEditor/choice-control.tsx","../../src/components/FormEditor/additional-control.tsx","../../src/components/FormEditor/control.tsx","../../src/components/FormEditor/index.tsx"],"sourcesContent":["/** Expanded writing measures: `wide` caps at the shared wide Modal width; `full` fills the viewport inside the scrim's gutters. */\nexport const expandedWidths = [\"wide\", \"full\"] as const;\n\nexport type RichTextEditorExpandedWidth = (typeof expandedWidths)[number];\n","import type { ReactNode } from \"react\";\nimport type { SelectOption } from \"../Select\";\nimport type { EntryPickerMode, EntryPickerProps } from \"../EntryPicker\";\nimport { selectionLimit } from \"../EntryPicker/limit\";\nimport type { JSONContent } from \"@tiptap/react\";\nimport { documentError } from \"../RichTextEditor/document\";\nimport type { RichTextDocument } from \"../RichTextEditor\";\nimport { expandedWidths, type RichTextEditorExpandedWidth } from \"../RichTextEditor/expanded-width\";\nimport { isIsoDate } from \"../DatePicker/date\";\nimport type { RangeSliderValue } from \"../Slider\";\nimport { clampToScale, preciseSum, sliderScale, type SliderScale } from \"../Slider/scale\";\nimport { parseColour } from \"../ColourField/colour\";\nimport type { PopoverPlacement } from \"../Popover\";\nimport type { ContainerWidth } from \"../Container\";\nimport type { FieldLimit, FieldLimitOptions } from \"../Field/types\";\n\n/** The shared measures a field may cap at; checked against Container's scale. */\nconst fieldWidths = [\"sm\", \"md\", \"lg\"] as const satisfies readonly ContainerWidth[];\n\ninterface FormFieldBase {\n id: string;\n label: string;\n labelHint?: ReactNode;\n hint?: ReactNode;\n /** Maximum width of the whole field, using Container's measures and its `lg` default. */\n width?: (typeof fieldWidths)[number];\n placeholder?: string;\n required?: boolean;\n isDisabled?: boolean;\n}\n\ninterface SliderOptions {\n multiple?: never;\n min?: number;\n max?: number;\n step?: number;\n prefix?: string;\n suffix?: string;\n hasValueLabel?: boolean;\n}\n\ninterface ChoiceOptions {\n multiple?: never;\n autoFocus?: never;\n options: SelectOption[];\n appearance?: \"default\" | \"card\";\n /** Maximum options per row inside this group; independent of FormEditor columns. */\n columns?: 1 | 2 | 3;\n}\n\nexport type FormField = FormFieldBase &\n (\n | ({\n type: \"shortText\";\n inputType?: \"text\" | \"email\";\n maxLength?: number;\n readOnly?: boolean;\n autoFocus?: boolean;\n multiple?: never;\n } & FieldLimitOptions)\n | ({\n type: \"longText\";\n rows?: number;\n maxLength?: number;\n readOnly?: boolean;\n autoFocus?: boolean;\n multiple?: never;\n } & FieldLimitOptions)\n | { type: \"boolean\" | \"dateTime\"; autoFocus?: boolean; multiple?: never }\n | {\n type: \"richText\";\n expandedWidth?: RichTextEditorExpandedWidth;\n autoFocus?: never;\n multiple?: never;\n }\n | {\n type: \"number\";\n min?: number;\n max?: number;\n step?: number | \"any\";\n hasSteppers?: boolean;\n prefix?: string;\n suffix?: string;\n autoFocus?: boolean;\n multiple?: never;\n }\n | { type: \"select\"; options: SelectOption[]; autoFocus?: boolean; multiple?: never }\n | ({ type: \"slider\"; autoFocus?: boolean } & SliderOptions)\n | ({ type: \"rangeSlider\"; autoFocus?: never } & SliderOptions)\n | ({ type: \"radioGroup\" } & ChoiceOptions)\n | ({ type: \"checkboxGroup\" } & ChoiceOptions)\n | {\n type: \"colour\";\n multiple?: never;\n presets?: string[];\n showPresets?: boolean;\n picker?: \"custom\" | \"native\";\n placement?: PopoverPlacement;\n readOnly?: boolean;\n autoFocus?: boolean;\n }\n | ({ type: \"tags\"; max?: number; multiple?: never; autoFocus?: never } & FieldLimitOptions)\n | {\n type: \"date\";\n min?: string;\n max?: string;\n placement?: PopoverPlacement;\n multiple?: never;\n autoFocus?: never;\n }\n | ({\n type: \"asset\" | \"reference\";\n multiple?: boolean;\n autoFocus?: never;\n picker?: Pick<\n EntryPickerProps,\n \"label\" | \"addLabel\" | \"emptyLabel\" | \"itemLabel\" | \"itemsLabel\" | \"max\" | \"isReorderable\"\n >;\n } & FieldLimitOptions)\n );\n\nexport type FieldOf<T extends FormField[\"type\"]> = Extract<FormField, { type: T }>;\n\n/** Layout only: no label, value, disabled state, or validation. */\nexport interface FormDivider {\n id: string;\n type: \"divider\";\n}\n\nexport type FormItem = FormField | FormDivider;\n\nexport interface FormSchema {\n fields: readonly FormItem[];\n}\n\nexport interface AssetValue {\n assetId: string;\n}\nexport interface ReferenceValue {\n entryId: string;\n}\nexport type FormFieldValue =\n | string\n | number\n | boolean\n | RichTextDocument\n | AssetValue\n | ReferenceValue\n | string[]\n | RangeSliderValue\n | AssetValue[]\n | ReferenceValue[];\nexport type FormValues = Record<string, FormFieldValue | undefined>;\nexport type FormErrors = Partial<Record<string, string>>;\n\nconst fieldTypes = new Set([\n \"shortText\",\n \"longText\",\n \"richText\",\n \"number\",\n \"boolean\",\n \"dateTime\",\n \"asset\",\n \"reference\",\n \"select\",\n \"slider\",\n \"rangeSlider\",\n \"colour\",\n \"radioGroup\",\n \"checkboxGroup\",\n \"tags\",\n \"date\",\n \"divider\",\n]);\n\nexport function assertModel(model: FormSchema) {\n const ids = new Set<string>();\n for (const field of model.fields) {\n if (!field.id?.trim() || ids.has(field.id)) {\n throw new Error(\"Form field IDs must be nonempty and unique.\");\n }\n if (!fieldTypes.has(field.type)) {\n throw new Error(`Unsupported form field type: ${field.type}`);\n }\n if (field.type === \"select\" || field.type === \"radioGroup\" || field.type === \"checkboxGroup\") {\n assertChoices(field);\n }\n if (field.type === \"slider\" || field.type === \"rangeSlider\") {\n assertSlider(field);\n }\n if (field.type !== \"divider\") {\n assertMeasures(field);\n assertLimitOptions(field);\n }\n ids.add(field.id);\n }\n}\n\nconst limitedTypes = new Set([\"shortText\", \"longText\", \"tags\", \"asset\", \"reference\"]);\n\nfunction supportsLimit(\n field: FormField,\n): field is FieldOf<\"shortText\" | \"longText\" | \"tags\" | \"asset\" | \"reference\"> {\n return limitedTypes.has(field.type);\n}\n\nfunction assertLimitOptions(field: FormField) {\n if (!supportsLimit(field)) {\n return;\n }\n if (field.limitDisplay !== undefined && ![\"used\", \"remaining\"].includes(field.limitDisplay)) {\n throw new Error(`Field ${field.id} needs a limitDisplay of used or remaining.`);\n }\n if (\n field.limitVisibility !== undefined &&\n ![\"always\", \"nearLimit\"].includes(field.limitVisibility)\n ) {\n throw new Error(`Field ${field.id} needs a limitVisibility of always or nearLimit.`);\n }\n if (field.showLimitRing !== undefined && typeof field.showLimitRing !== \"boolean\") {\n throw new Error(`Field ${field.id} needs a boolean showLimitRing.`);\n }\n}\n\n/**\n * Explicit limits for complete server markup. Counts come from the helpers the\n * adapters display with (`textValue`, `stringList`, the owning field's selected\n * IDs and EntryPicker's `selectionLimit`), so the counter cannot drift from them.\n */\nexport function fieldLimitProps(\n field: FormField,\n stored: FormFieldValue | undefined,\n selected: string[] | undefined,\n): FieldLimitOptions & { limit?: FieldLimit } {\n if (!supportsLimit(field)) {\n return {};\n }\n return {\n limitDisplay: field.limitDisplay,\n limitVisibility: field.limitVisibility,\n showLimitRing: field.showLimitRing,\n limit: schemaLimit(field, stored, selected ?? []),\n };\n}\n\nfunction schemaLimit(\n field: FieldOf<\"shortText\" | \"longText\" | \"tags\" | \"asset\" | \"reference\">,\n stored: FormFieldValue | undefined,\n selected: string[],\n): FieldLimit | undefined {\n switch (field.type) {\n case \"shortText\":\n case \"longText\":\n return field.maxLength === undefined\n ? undefined\n : { count: textValue(stored).length, max: field.maxLength };\n case \"tags\":\n return field.max === undefined\n ? undefined\n : { count: stringList(stored).length, max: field.max };\n default:\n return selectionLimit(pickerMode(field), selected.length, pickerCopy(field).max);\n }\n}\n\n/** The text a shortText or longText adapter displays. */\nexport function textValue(stored: unknown): string {\n return typeof stored === \"string\" ? stored : \"\";\n}\n\n/** The EntryPicker mode a picker field renders with. */\nexport function pickerMode(field: FieldOf<\"asset\" | \"reference\">): EntryPickerMode {\n return field.multiple ? \"multiple\" : \"single\";\n}\n\n/** Runtime schemas can carry any string; the types only cover typed schemas. */\nfunction assertMeasures(field: FormField) {\n if (field.width !== undefined && !fieldWidths.includes(field.width)) {\n throw new Error(`Field ${field.id} needs a width of sm, md or lg.`);\n }\n if (\n field.type === \"richText\" &&\n field.expandedWidth !== undefined &&\n !expandedWidths.includes(field.expandedWidth)\n ) {\n throw new Error(`Rich text field ${field.id} needs an expandedWidth of wide or full.`);\n }\n}\n\nfunction assertSlider(field: FieldOf<\"slider\" | \"rangeSlider\">) {\n const { min, max, step } = sliderScale(field);\n if (![min, max, step].every(Number.isFinite) || min >= max || step <= 0) {\n throw new Error(`Slider field ${field.id} needs finite min < max and a positive step.`);\n }\n if (field.type === \"rangeSlider\" && step > preciseSum(max, -min)) {\n throw new Error(`Range slider ${field.id} needs room for at least one step.`);\n }\n}\n\nfunction assertChoices(field: FieldOf<\"select\" | \"radioGroup\" | \"checkboxGroup\">) {\n if (!Array.isArray(field.options)) {\n const kind = field.type === \"select\" ? \"Select\" : \"Choice\";\n throw new Error(`${kind} field ${field.id} needs an options array.`);\n }\n if (field.type === \"select\") {\n return;\n }\n const values = field.options.map((option) => option.value);\n if (\n values.some((value) => typeof value !== \"string\" || !value.trim()) ||\n new Set(values).size !== values.length\n ) {\n throw new Error(`Choice field ${field.id} needs nonempty, unique option values.`);\n }\n}\n\nconst linkCopy = {\n asset: { key: \"assetId\", itemLabel: \"asset\", itemsLabel: \"assets\" },\n reference: { key: \"entryId\", itemLabel: \"entry\", itemsLabel: \"entries\" },\n} as const;\n\n/** The field's visible and accessible name. A picker's `label` overrides it. */\nexport function fieldLabel(field: FormField): string {\n return field.type === \"asset\" || field.type === \"reference\"\n ? (field.picker?.label ?? field.label)\n : field.label;\n}\n\n/** Picker action and item copy, with asset or entry wording for any option left out or undefined. */\nexport function pickerCopy(field: FieldOf<\"asset\" | \"reference\">) {\n const defaults = linkCopy[field.type];\n const {\n addLabel = `Choose ${fieldLabel(field)}`,\n emptyLabel,\n itemLabel = defaults.itemLabel,\n itemsLabel = defaults.itemsLabel,\n max,\n isReorderable,\n } = field.picker ?? {};\n return { addLabel, emptyLabel, itemLabel, itemsLabel, max, isReorderable };\n}\n\n/** The picked IDs, in stored order, skipping anything that isn't a link. */\nexport function selectedIds(field: FieldOf<\"asset\" | \"reference\">, value: unknown): string[] {\n const { key } = linkCopy[field.type];\n const links = Array.isArray(value) ? value : value === undefined ? [] : [value];\n return links.flatMap((link) =>\n isLink(link, key) ? [(link as Record<string, string>)[key]] : [],\n );\n}\n\n/** Accept UTC ISO strings without rolling invalid dates into the next month. */\nexport function parseUtcDateTime(value: unknown): string | undefined {\n if (typeof value !== \"string\") {\n return;\n }\n const match = /^(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2})(?::(\\d{2})(?:\\.(\\d{1,3}))?)?(?:Z|\\+00:00)$/.exec(\n value,\n );\n if (!match) {\n return;\n }\n const canonical = `${match[1]}:${match[2] ?? \"00\"}.${(match[3] ?? \"\").padEnd(3, \"0\")}Z`;\n const date = new Date(canonical);\n if (Number.isFinite(date.getTime()) && date.toISOString() === canonical) {\n return canonical;\n }\n}\n\nfunction isLink(value: unknown, key: \"assetId\" | \"entryId\"): boolean {\n return (\n !!value &&\n typeof value === \"object\" &&\n key in value &&\n typeof (value as Record<string, unknown>)[key] === \"string\" &&\n (value as Record<string, string>)[key].trim().length > 0\n );\n}\n\nfunction hasRichText(node: JSONContent): boolean {\n return !!node.text?.trim() || node.type === \"horizontalRule\" || !!node.content?.some(hasRichText);\n}\n\nfunction requiredError(field: FormField): string {\n return `${fieldLabel(field)} is required.`;\n}\n\nfunction textError(field: FormField, value: unknown): string | undefined {\n if (typeof value !== \"string\") {\n return \"Enter text.\";\n }\n if (field.required && !value.trim()) {\n return requiredError(field);\n }\n if (\n (field.type === \"shortText\" || field.type === \"longText\") &&\n field.maxLength !== undefined &&\n value.length > field.maxLength\n ) {\n return `Enter no more than ${field.maxLength} characters.`;\n }\n}\n\nfunction richTextError(field: FormField, value: unknown): string | undefined {\n const error = documentError(value);\n if (error) {\n return error;\n }\n if (field.required && !hasRichText(value as RichTextDocument)) {\n return requiredError(field);\n }\n}\n\nfunction choiceError(field: FormField, value: unknown): string | undefined {\n if (typeof value !== \"string\") {\n return \"Choose an available option.\";\n }\n if (value === \"\") {\n return field.required ? requiredError(field) : undefined;\n }\n // An empty list means the choices are still loading, so a stored value stays valid until they arrive.\n if (\n (field.type === \"select\" || field.type === \"radioGroup\") &&\n field.options.length > 0 &&\n !field.options.some((option) => option.value === value)\n ) {\n return \"Choose an available option.\";\n }\n}\n\nexport function stringList(value: unknown): string[] {\n return Array.isArray(value)\n ? value.filter((item): item is string => typeof item === \"string\")\n : [];\n}\n\nfunction listError(field: FormField, value: unknown): string | undefined {\n if (\n !Array.isArray(value) ||\n !value.every((item) => typeof item === \"string\" && item.trim()) ||\n new Set(value).size !== value.length\n ) {\n return \"Enter a list of unique, nonempty text values.\";\n }\n if (field.required && !value.length) {\n return requiredError(field);\n }\n if (field.type === \"tags\" && field.max !== undefined && value.length > field.max) {\n return `Enter no more than ${field.max} tags.`;\n }\n if (\n field.type === \"checkboxGroup\" &&\n field.options.length &&\n value.some((item) => !field.options.some((option) => option.value === item))\n ) {\n return \"Choose available options.\";\n }\n}\n\nfunction numberError(field: FormField, value: unknown): string | undefined {\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n return \"Enter a finite number.\";\n }\n const { min, max }: { min?: number; max?: number } =\n field.type === \"slider\" || field.type === \"rangeSlider\"\n ? sliderScale(field)\n : field.type === \"number\"\n ? field\n : {};\n if (min !== undefined && value < min) {\n return `Enter a number of at least ${min}.`;\n }\n if (max !== undefined && value > max) {\n return `Enter a number no greater than ${max}.`;\n }\n}\n\nfunction dateError(field: FormField, value: unknown): string | undefined {\n if (typeof value !== \"string\") {\n return \"Enter a valid calendar date (YYYY-MM-DD).\";\n }\n if (!value) {\n return field.required ? requiredError(field) : undefined;\n }\n if (!isIsoDate(value)) {\n return \"Enter a valid calendar date (YYYY-MM-DD).\";\n }\n if (field.type !== \"date\") {\n return;\n }\n if (field.min && value < field.min) {\n return `Choose a date on or after ${field.min}.`;\n }\n if (field.max && value > field.max) {\n return `Choose a date on or before ${field.max}.`;\n }\n}\n\n/**\n * Display positions for loaded values: out-of-scale numbers clamp and reversed\n * endpoints swap, without overwriting the stored data that validation reports.\n * A value that is not a finite number has no position, so the control is unset.\n */\nexport function sliderValue(value: unknown, scale: SliderScale): number | undefined {\n return typeof value === \"number\" && Number.isFinite(value)\n ? clampToScale(value, scale)\n : undefined;\n}\n\n/** A range with neither endpoint usable is unset; one usable endpoint pairs with the scale's end. */\nexport function rangeSliderValue(value: unknown, scale: SliderScale): RangeSliderValue | undefined {\n const range = value as Partial<Record<\"min\" | \"max\", unknown>> | null;\n const start = sliderValue(range?.min, scale);\n const end = sliderValue(range?.max, scale);\n if (start === undefined && end === undefined) {\n return undefined;\n }\n const [low, high] = [start ?? scale.min, end ?? scale.max].sort((a, b) => a - b);\n return { min: low, max: high };\n}\n\nfunction rangeError(field: FormField, value: unknown): string | undefined {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return \"Enter a range.\";\n }\n const range = value as Record<string, unknown>;\n const start = range.min;\n const end = range.max;\n const error = numberError(field, start) ?? numberError(field, end);\n if (error) {\n return error;\n }\n if ((start as number) > (end as number)) {\n return \"The start must not be greater than the end.\";\n }\n if (\n field.type === \"rangeSlider\" &&\n preciseSum(end as number, -(start as number)) < sliderScale(field).step\n ) {\n return \"Keep the range endpoints at least one step apart.\";\n }\n}\n\nfunction colourError(field: FormField, value: unknown): string | undefined {\n if (typeof value !== \"string\") {\n return \"Enter a valid colour.\";\n }\n if (!value.trim()) {\n return field.required ? requiredError(field) : undefined;\n }\n return parseColour(value) ? undefined : \"Enter a valid colour.\";\n}\n\nfunction linkError(field: FormField, value: unknown): string | undefined {\n if (field.type !== \"asset\" && field.type !== \"reference\") {\n return;\n }\n const { key, itemLabel, itemsLabel } = linkCopy[field.type];\n if (!field.multiple) {\n return isLink(value, key) ? undefined : `Choose an ${itemLabel}.`;\n }\n if (!Array.isArray(value) || !value.every((item) => isLink(item, key))) {\n return `Choose a list of ${itemsLabel}.`;\n }\n if (field.required && value.length === 0) {\n return requiredError(field);\n }\n const max = field.picker?.max;\n if (max !== undefined && value.length > max) {\n return `Choose no more than ${max} ${pickerCopy(field).itemsLabel}.`;\n }\n}\n\nconst validators: Record<\n FormField[\"type\"],\n (field: FormField, value: unknown) => string | undefined\n> = {\n shortText: textError,\n longText: textError,\n richText: richTextError,\n number: numberError,\n slider: numberError,\n rangeSlider: rangeError,\n date: dateError,\n colour: colourError,\n radioGroup: choiceError,\n checkboxGroup: listError,\n tags: listError,\n boolean: (_field, value) => (typeof value === \"boolean\" ? undefined : \"Choose a boolean value.\"),\n dateTime: (_field, value) =>\n parseUtcDateTime(value) ? undefined : \"Enter a valid UTC date and time.\",\n select: choiceError,\n asset: linkError,\n reference: linkError,\n};\n\nexport function fieldError(field: FormField, value: unknown): string | undefined {\n if (value === undefined) {\n return field.required ? requiredError(field) : undefined;\n }\n return validators[field.type](field, value);\n}\n\n/** Validate data loaded from JSON as well as values emitted by FormEditor. */\nexport function validateFormValues(model: FormSchema, values: Record<string, unknown>): FormErrors {\n assertModel(model);\n return Object.fromEntries(\n model.fields.flatMap((field): [string, string][] => {\n if (field.type === \"divider\") {\n return [];\n }\n const error = fieldError(\n field,\n Object.hasOwn(values, field.id) ? values[field.id] : undefined,\n );\n return error ? [[field.id, error]] : [];\n }),\n );\n}\n","import { Button } from \"../Button\";\nimport { Checkbox, ChoiceGroup, Radio } from \"../Choice\";\nimport { CheckboxCard, RadioCard, SelectionCardGroup } from \"../SelectionCard\";\nimport type { SelectOption } from \"../Select\";\nimport type { ControlProps } from \"./control\";\nimport { stringList, type FieldOf } from \"./model\";\n\ntype ChoiceField = FieldOf<\"radioGroup\" | \"checkboxGroup\">;\n\nfunction Option({\n field,\n option,\n name,\n checked,\n isDisabled,\n invalid,\n onChange,\n}: {\n field: ChoiceField;\n option: SelectOption;\n name: string;\n checked: boolean;\n isDisabled: boolean;\n invalid: true | undefined;\n onChange: () => void;\n}) {\n const props = {\n name,\n value: option.value,\n checked,\n disabled: isDisabled || option.isDisabled,\n \"aria-invalid\": invalid,\n onChange: () => {\n if (!isDisabled && !option.isDisabled) {\n onChange();\n }\n },\n };\n if (field.appearance === \"card\") {\n const Card = field.type === \"radioGroup\" ? RadioCard : CheckboxCard;\n return (\n <Card\n {...props}\n title={option.label}\n description={option.description}\n />\n );\n }\n const Choice = field.type === \"radioGroup\" ? Radio : Checkbox;\n return (\n <Choice {...props}>\n <span>\n {option.label}\n {option.description && (\n <span className=\"ds-form-editor__option-description\">{option.description}</span>\n )}\n </span>\n </Choice>\n );\n}\n\nexport function ChoiceControl({\n field,\n stored,\n isDisabled,\n required,\n accessibility,\n onChange,\n}: ControlProps<ChoiceField>) {\n const multiple = field.type === \"checkboxGroup\";\n // Option values are nonempty, so a stored \"\" selects nothing.\n const selected = multiple\n ? stringList(stored)\n : typeof stored === \"string\" && stored\n ? [stored]\n : [];\n const Group = field.appearance === \"card\" ? SelectionCardGroup : ChoiceGroup;\n return (\n <>\n <Group\n {...accessibility}\n label={field.label}\n columns={field.columns ?? (field.appearance === \"card\" ? 2 : 1)}\n >\n {field.options.map((option) => (\n <Option\n key={option.value}\n field={field}\n option={option}\n name={accessibility.id}\n checked={selected.includes(option.value)}\n isDisabled={isDisabled}\n invalid={accessibility[\"aria-invalid\"]}\n onChange={() => {\n if (multiple) {\n onChange(\n selected.includes(option.value)\n ? selected.filter((value) => value !== option.value)\n : [...selected, option.value],\n );\n } else {\n onChange(option.value);\n }\n }}\n />\n ))}\n </Group>\n {!multiple && !required && selected.length > 0 && (\n <Button\n variant=\"simple\"\n size=\"sm\"\n isDisabled={isDisabled}\n onClick={() => onChange(undefined)}\n >\n Clear {field.label}\n </Button>\n )}\n </>\n );\n}\n","import { ColourField } from \"../ColourField\";\nimport { parseColour } from \"../ColourField/colour\";\nimport { DateField } from \"../DatePicker\";\nimport { RangeSlider, Slider } from \"../Slider\";\nimport { sliderScale } from \"../Slider/scale\";\nimport { TagsInput } from \"../TagsInput\";\nimport { ChoiceControl } from \"./choice-control\";\nimport type { ControlProps } from \"./control\";\nimport { rangeSliderValue, sliderValue, stringList, type FieldOf } from \"./model\";\n\ntype AdditionalField = FieldOf<\n \"slider\" | \"rangeSlider\" | \"date\" | \"colour\" | \"tags\" | \"radioGroup\" | \"checkboxGroup\"\n>;\n\nfunction SliderControl({\n field,\n stored,\n isDisabled,\n accessibility,\n onChange,\n}: ControlProps<FieldOf<\"slider\">>) {\n const scale = sliderScale(field);\n const shown = sliderValue(stored, scale);\n return (\n <Slider\n {...accessibility}\n {...scale}\n prefix={field.prefix}\n suffix={field.suffix}\n hasValueLabel={field.hasValueLabel}\n valueText={shown === undefined ? (field.placeholder ?? \"Not set\") : undefined}\n autoFocus={field.autoFocus}\n isDisabled={isDisabled}\n value={shown ?? scale.min}\n onValueChange={onChange}\n // An unset thumb rests at the minimum, where a click or a key toward it fires\n // no change event. Committing stores the position the slider shows.\n onValueCommit={(next) => {\n if (shown === undefined) {\n onChange(next);\n }\n }}\n />\n );\n}\n\nfunction RangeSliderControl({\n field,\n stored,\n isDisabled,\n accessibility,\n onChange,\n}: ControlProps<FieldOf<\"rangeSlider\">>) {\n const scale = sliderScale(field);\n const shown = rangeSliderValue(stored, scale);\n return (\n <RangeSlider\n {...accessibility}\n {...scale}\n prefix={field.prefix}\n suffix={field.suffix}\n hasValueLabel={field.hasValueLabel}\n minLabel={`${field.label} minimum`}\n maxLabel={`${field.label} maximum`}\n isDisabled={isDisabled}\n // Unset thumbs rest at both ends without a fill, so nothing looks chosen; a click\n // or key that leaves them there stores the full range they show.\n valueText={shown === undefined ? (field.placeholder ?? \"Not set\") : undefined}\n hasFill={shown !== undefined}\n value={shown ?? { min: scale.min, max: scale.max }}\n onValueChange={onChange}\n onValueCommit={(next) => {\n if (shown === undefined) {\n onChange(next);\n }\n }}\n />\n );\n}\n\nexport function AdditionalControl({\n field,\n stored,\n isDisabled,\n required,\n accessibility,\n onChange,\n}: ControlProps<AdditionalField>) {\n const props = { stored, isDisabled, required, accessibility, onChange };\n switch (field.type) {\n case \"radioGroup\":\n case \"checkboxGroup\":\n return (\n <ChoiceControl\n field={field}\n {...props}\n />\n );\n case \"rangeSlider\":\n return (\n <RangeSliderControl\n field={field}\n {...props}\n />\n );\n case \"slider\":\n return (\n <SliderControl\n field={field}\n {...props}\n />\n );\n case \"colour\":\n return (\n <ColourField\n {...accessibility}\n required={required}\n placeholder={field.placeholder}\n presets={field.presets}\n showPresets={field.showPresets}\n picker={field.picker}\n placement={field.placement}\n readOnly={field.readOnly}\n autoFocus={field.autoFocus}\n isDisabled={isDisabled}\n value={typeof stored === \"string\" ? stored : \"\"}\n onInput={(event) => {\n const raw = event.currentTarget.value;\n if (raw.trim() && !parseColour(raw)) {\n onChange(raw);\n }\n }}\n onValueChange={(next) => onChange(next === \"\" ? undefined : next)}\n />\n );\n case \"tags\":\n return (\n <TagsInput\n {...accessibility}\n required={required}\n placeholder={field.placeholder}\n max={field.max}\n isDisabled={isDisabled}\n value={stringList(stored)}\n onValueChange={onChange}\n />\n );\n case \"date\":\n return (\n <DateField\n {...accessibility}\n placeholder={field.placeholder}\n min={field.min}\n max={field.max}\n placement={field.placement}\n isDisabled={isDisabled}\n isClearable\n clearLabel={`Clear ${field.label}`}\n value={typeof stored === \"string\" ? stored : \"\"}\n onValueChange={(next) => onChange(next === \"\" ? undefined : next)}\n />\n );\n }\n}\n","import { EntryPicker, type EntryItem } from \"../EntryPicker\";\nimport type { FieldRenderProps } from \"../Field\";\nimport { NumberField } from \"../NumberField\";\nimport { RichTextEditor, type RichTextDocument } from \"../RichTextEditor\";\nimport { emptyDocument } from \"../RichTextEditor/document\";\nimport { Select } from \"../Select\";\nimport { Switch } from \"../Switch\";\nimport { TextArea, TextField } from \"../TextField\";\nimport { AdditionalControl } from \"./additional-control\";\nimport {\n parseUtcDateTime,\n pickerCopy,\n pickerMode,\n textValue,\n type FieldOf,\n type FormField,\n type FormFieldValue,\n} from \"./model\";\n\nfunction pickerValue(\n field: FieldOf<\"asset\" | \"reference\">,\n ids: string[],\n): FormFieldValue | undefined {\n if (field.type === \"asset\") {\n const links = ids.map((assetId) => ({ assetId }));\n return field.multiple ? links : links[0];\n }\n const links = ids.map((entryId) => ({ entryId }));\n return field.multiple ? links : links[0];\n}\n\ntype Accessibility = FieldRenderProps;\n\nexport interface ControlProps<F extends FormField> {\n field: F;\n stored: FormFieldValue | undefined;\n isDisabled: boolean;\n required: boolean | undefined;\n accessibility: Omit<Accessibility, \"required\">;\n onChange: (value: FormFieldValue | undefined) => void;\n}\n\nfunction NumberControl({\n field,\n stored,\n isDisabled,\n required,\n accessibility,\n onChange,\n}: ControlProps<FieldOf<\"number\">>) {\n return (\n <NumberField\n {...accessibility}\n required={required}\n isDisabled={isDisabled}\n placeholder={field.placeholder}\n min={field.min}\n max={field.max}\n step={field.step ?? \"any\"}\n hasSteppers={field.hasSteppers ?? false}\n prefix={field.prefix}\n suffix={field.suffix}\n autoFocus={field.autoFocus}\n decreaseLabel={`Decrease ${field.label}`}\n increaseLabel={`Increase ${field.label}`}\n value={typeof stored === \"number\" && Number.isFinite(stored) ? stored : \"\"}\n onValueChange={(next) => {\n if (next === \"\" || Number.isFinite(next)) {\n onChange(next === \"\" ? undefined : next);\n }\n }}\n />\n );\n}\n\nfunction SelectControl({\n field,\n stored,\n isDisabled,\n required,\n accessibility,\n onChange,\n}: ControlProps<FieldOf<\"select\">>) {\n // Optional selects lead with an empty choice; picking it removes the key.\n const isClearable = !required && !field.options.some((option) => option.value === \"\");\n return (\n <Select\n {...accessibility}\n aria-required={required || undefined}\n isDisabled={isDisabled}\n isInvalid={accessibility[\"aria-invalid\"]}\n options={\n isClearable\n ? [{ value: \"\", label: field.placeholder ?? \"None\" }, ...field.options]\n : field.options\n }\n placeholder={field.placeholder}\n autoFocus={field.autoFocus}\n value={typeof stored === \"string\" ? stored : \"\"}\n onValueChange={(next) => onChange(next === \"\" ? undefined : next)}\n />\n );\n}\n\nfunction PickerControl({\n field,\n selected,\n items,\n isDisabled,\n accessibility,\n onChange,\n}: ControlProps<FieldOf<\"asset\" | \"reference\">> & { items: EntryItem[]; selected: string[] }) {\n return (\n <EntryPicker\n {...accessibility}\n items={items}\n value={selected}\n {...pickerCopy(field)}\n mode={pickerMode(field)}\n isDisabled={isDisabled}\n onValueChange={(ids) => onChange(pickerValue(field, ids))}\n />\n );\n}\n\ninterface FormControlProps {\n field: FormField;\n stored: FormFieldValue | undefined;\n /** Picker fields' stored IDs, derived once by the owning field. */\n selected: string[] | undefined;\n items: EntryItem[];\n isDisabled: boolean;\n accessibility: Accessibility;\n onChange: (value: FormFieldValue | undefined) => void;\n}\n\nexport function FormControl({\n field,\n stored,\n selected,\n items,\n isDisabled,\n accessibility: { required, ...accessibility },\n onChange,\n}: FormControlProps) {\n const shared = { stored, isDisabled, required, accessibility, onChange };\n switch (field.type) {\n case \"shortText\":\n return (\n <TextField\n {...accessibility}\n required={required}\n disabled={isDisabled}\n placeholder={field.placeholder}\n type={field.inputType}\n maxLength={field.maxLength}\n readOnly={field.readOnly}\n autoFocus={field.autoFocus}\n value={textValue(stored)}\n onChange={(event) => onChange(event.target.value)}\n />\n );\n case \"longText\":\n return (\n <TextArea\n {...accessibility}\n required={required}\n disabled={isDisabled}\n placeholder={field.placeholder}\n rows={field.rows}\n maxLength={field.maxLength}\n readOnly={field.readOnly}\n autoFocus={field.autoFocus}\n value={textValue(stored)}\n onChange={(event) => onChange(event.target.value)}\n />\n );\n case \"number\":\n return (\n <NumberControl\n field={field}\n {...shared}\n />\n );\n case \"boolean\":\n return (\n <Switch\n {...accessibility}\n isDisabled={isDisabled}\n autoFocus={field.autoFocus}\n isSelected={stored === true}\n onSelectedChange={onChange}\n />\n );\n case \"dateTime\":\n return (\n <TextField\n {...accessibility}\n required={required}\n disabled={isDisabled}\n type=\"datetime-local\"\n step=\"0.001\"\n autoFocus={field.autoFocus}\n value={parseUtcDateTime(stored)?.slice(0, -1) ?? \"\"}\n onChange={(event) => onChange(parseUtcDateTime(`${event.target.value}Z`))}\n />\n );\n case \"richText\":\n return (\n <RichTextEditor\n {...accessibility}\n expandedWidth={field.expandedWidth}\n label={field.label}\n isRequired={required}\n isDisabled={isDisabled}\n placeholder={field.placeholder}\n format=\"json\"\n value={stored === undefined ? emptyDocument : (stored as RichTextDocument)}\n onChange={onChange}\n />\n );\n case \"select\":\n return (\n <SelectControl\n field={field}\n {...shared}\n />\n );\n case \"asset\":\n case \"reference\":\n return (\n <PickerControl\n field={field}\n items={items}\n selected={selected ?? []}\n {...shared}\n />\n );\n default:\n return (\n <AdditionalControl\n field={field}\n {...shared}\n />\n );\n }\n}\n","import { useMemo, useState, type CSSProperties, type HTMLAttributes } from \"react\";\nimport { Container } from \"../Container\";\nimport type { EntryItem } from \"../EntryPicker\";\nimport { Field } from \"../Field\";\nimport type { GridColumns } from \"../Grid\";\nimport { FormControl } from \"./control\";\nimport {\n assertModel,\n fieldError,\n fieldLabel,\n fieldLimitProps,\n selectedIds,\n stringList,\n type FormField,\n type FormSchema,\n type FormErrors,\n type FormFieldValue,\n type FormValues,\n} from \"./model\";\nimport \"./style.css\";\n\nexport { validateFormValues } from \"./model\";\nexport type {\n AssetValue,\n FormField,\n FormDivider,\n FormItem,\n FormSchema,\n FormErrors,\n FormFieldValue,\n FormValues,\n ReferenceValue,\n} from \"./model\";\n\nexport interface FormChange {\n fieldId: string;\n}\n\nexport interface FormEditorProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n \"defaultValue\" | \"onChange\"\n> {\n schema: FormSchema;\n value?: FormValues;\n defaultValue?: FormValues;\n onValueChange?: (values: FormValues, change: FormChange) => void;\n /** Available assets or entries, keyed by field ID. Loading belongs to the app. */\n pickerItems?: Record<string, EntryItem[]>;\n /** App-provided messages take precedence over built-in validation. */\n errors?: FormErrors;\n isDisabled?: boolean;\n showAllErrors?: boolean;\n /** Columns at the widest. The form drops one whenever a field would be narrower than `minColumnWidth`. */\n columns?: GridColumns;\n /** Narrowest a field may get before the form drops a column. */\n minColumnWidth?: string;\n}\n\ninterface FormEditorFieldProps {\n field: FormField;\n stored: FormFieldValue | undefined;\n items: EntryItem[];\n isDisabled: boolean;\n error: string | undefined;\n isErrorVisible: boolean;\n onChange: (value: FormFieldValue | undefined) => void;\n}\n\n/** Validates only when its message can show, and only when its own field or value changes. */\nfunction FormEditorField({\n field,\n stored,\n items,\n isDisabled,\n error,\n isErrorVisible,\n onChange,\n}: FormEditorFieldProps) {\n const validation = useMemo(\n () => (error === undefined && isErrorVisible ? fieldError(field, stored) : undefined),\n [error, isErrorVisible, field, stored],\n );\n const selected = useMemo(\n () =>\n field.type === \"asset\" || field.type === \"reference\" ? selectedIds(field, stored) : undefined,\n [field, stored],\n );\n return (\n <Container\n width={field.width}\n padded={false}\n center={false}\n className=\"ds-form-editor__field\"\n >\n <Field\n {...fieldLimitProps(field, stored, selected)}\n label={field.type === \"dateTime\" ? `${field.label} (UTC)` : fieldLabel(field)}\n hint={field.hint}\n labelHint={field.labelHint}\n error={error ?? validation}\n isRequired={field.required}\n count={\n selected?.length ??\n (field.type === \"checkboxGroup\" ? stringList(stored).length : undefined)\n }\n isGroup={selected !== undefined || groupTypes.has(field.type)}\n >\n {(accessibility) => (\n <FormControl\n field={field}\n stored={stored}\n selected={selected}\n items={items}\n isDisabled={isDisabled}\n accessibility={accessibility}\n onChange={onChange}\n />\n )}\n </Field>\n </Container>\n );\n}\n\nconst groupTypes = new Set([\"radioGroup\", \"checkboxGroup\", \"rangeSlider\"]);\nconst loadedValidationTypes = new Set([\"slider\", \"rangeSlider\", \"date\", \"colour\"]);\n\n/** Ordered form controls. Loading, submission, and persistence belong to the app. */\nexport function FormEditor({\n schema,\n value,\n defaultValue = {},\n onValueChange,\n pickerItems = {},\n errors = {},\n isDisabled = false,\n showAllErrors = false,\n columns = 1,\n minColumnWidth = \"16rem\",\n className,\n style,\n ...rest\n}: FormEditorProps) {\n const [internal, setInternal] = useState<FormValues>(defaultValue);\n const [changed, setChanged] = useState<Set<string>>(() => new Set());\n const current = value ?? internal;\n useMemo(() => assertModel(schema), [schema]);\n\n const commit = (fieldId: string, next: FormFieldValue | undefined) => {\n const values = { ...current };\n if (next === undefined) {\n delete values[fieldId];\n } else {\n values[fieldId] = next;\n }\n if (value === undefined) {\n setInternal(values);\n }\n setChanged((previous) => new Set(previous).add(fieldId));\n onValueChange?.(values, { fieldId });\n };\n\n const layout =\n columns === \"auto\"\n ? { \"--form-editor-min-column\": minColumnWidth }\n : { \"--form-editor-columns\": columns, \"--form-editor-min-column\": minColumnWidth };\n\n return (\n <div\n className={[\"ds-form-editor\", columns === \"auto\" && \"ds-form-editor--auto\", className]\n .filter(Boolean)\n .join(\" \")}\n style={{ ...layout, ...style } as CSSProperties}\n {...rest}\n >\n {schema.fields.map((field) => {\n if (field.type === \"divider\") {\n return (\n <hr\n key={field.id}\n className=\"ds-form-editor__divider\"\n />\n );\n }\n const stored = Object.hasOwn(current, field.id) ? current[field.id] : undefined;\n const fieldDisabled = isDisabled || Boolean(field.isDisabled);\n const isLocked = fieldDisabled || (\"readOnly\" in field && Boolean(field.readOnly));\n // Explain loaded invalid values alongside the controls' invalid styling. Blank\n // strings are empty, so their required message waits like any other field's.\n const isLoaded = typeof stored === \"string\" ? stored.trim() !== \"\" : stored !== undefined;\n const isErrorVisible =\n showAllErrors ||\n changed.has(field.id) ||\n (isLoaded && loadedValidationTypes.has(field.type)) ||\n (field.type === \"number\" && typeof stored === \"number\");\n return (\n <FormEditorField\n key={field.id}\n field={field}\n stored={stored}\n items={pickerItems[field.id] ?? []}\n isDisabled={fieldDisabled}\n error={errors[field.id]}\n isErrorVisible={isErrorVisible}\n onChange={(next) => {\n if (!isLocked) {\n commit(field.id, next);\n }\n }}\n />\n );\n })}\n </div>\n );\n}\n"],"mappings":"A,gvBACA,IAAaoD,EAAiB,CAAC,OAAQ,MAAM,ECgBvCC,EAAc,CAAC,KAAM,KAAM,IAAI,EA0I/BC,EAAa,IAAI,IAAI,CACzB,YACA,WACA,WACA,SACA,UACA,WACA,QACA,YACA,SACA,SACA,cACA,SACA,aACA,gBACA,OACA,OACA,SACF,CAAC,EAED,SAAgBC,EAAY,EAAmB,CAC7C,IAAMC,EAAM,IAAI,IAChB,IAAK,IAAMC,KAASC,EAAM,OAAQ,CAChC,GAAI,CAACD,EAAM,IAAI,KAAK,GAAKD,EAAI,IAAIC,EAAM,EAAE,EACvC,MAAU,MAAM,6CAA6C,EAE/D,GAAI,CAACH,EAAW,IAAIG,EAAM,IAAI,EAC5B,MAAU,MAAM,gCAAgCA,EAAM,MAAM,GAE1DA,EAAM,OAAS,UAAYA,EAAM,OAAS,cAAgBA,EAAM,OAAS,kBAC3EE,GAAcF,CAAK,GAEjBA,EAAM,OAAS,UAAYA,EAAM,OAAS,gBAC5CG,EAAaH,CAAK,EAEhBA,EAAM,OAAS,YACjBI,EAAeJ,CAAK,EACpBK,EAAmBL,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