@snowcone-app/canvas 0.23.0 → 0.27.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/ERROR_CONTRACT.md +638 -0
- package/README.md +2 -1
- package/STYLING_CONTRACT.md +59 -8
- package/dist/{CanvasRenderer-6_HhR4-q.js → CanvasRenderer-yszzrDfo.js} +4 -4
- package/dist/{CanvasRenderer-6_HhR4-q.js.map → CanvasRenderer-yszzrDfo.js.map} +1 -1
- package/dist/{CanvasStateV1-DmZ1Qvvn.js → CanvasStateV1-BTbCD_xC.js} +3 -3
- package/dist/{CanvasStateV1-DmZ1Qvvn.js.map → CanvasStateV1-BTbCD_xC.js.map} +1 -1
- package/dist/{ContextualToolbars-BDEt9ND0.js → ContextualToolbars-BHjYsril.js} +6 -6
- package/dist/{ContextualToolbars-BDEt9ND0.js.map → ContextualToolbars-BHjYsril.js.map} +1 -1
- package/dist/{EditorCanvasImpl-Ckg7WO2j.js → EditorCanvasImpl-Ui8Ceb-h.js} +8 -8
- package/dist/{EditorCanvasImpl-Ckg7WO2j.js.map → EditorCanvasImpl-Ui8Ceb-h.js.map} +1 -1
- package/dist/{ExportManager-DoU4VK6h.js → ExportManager-BTcyj4cf.js} +2 -2
- package/dist/{ExportManager-DoU4VK6h.js.map → ExportManager-BTcyj4cf.js.map} +1 -1
- package/dist/{FontAnalyzer-CwIpgTGd.js → FontAnalyzer-EF3gLPr8.js} +30 -20
- package/dist/{FontAnalyzer-CwIpgTGd.js.map → FontAnalyzer-EF3gLPr8.js.map} +1 -1
- package/dist/{ImagePanel-BwqFDKvW.js → ImagePanel-CIk6z41z.js} +6 -6
- package/dist/{ImagePanel-BwqFDKvW.js.map → ImagePanel-CIk6z41z.js.map} +1 -1
- package/dist/{SnowconeCanvas-D1sLcIja.js → SnowconeCanvas-DuWALOAt.js} +10 -10
- package/dist/{SnowconeCanvas-D1sLcIja.js.map → SnowconeCanvas-DuWALOAt.js.map} +1 -1
- package/dist/{UnifiedFontService-CC3CSmH5.js → UnifiedFontService-CHVYDBDW.js} +869 -836
- package/dist/{UnifiedFontService-CC3CSmH5.js.map → UnifiedFontService-CHVYDBDW.js.map} +1 -1
- package/dist/advanced.mjs +14 -14
- package/dist/api/embed.d.ts +6 -2
- package/dist/components/editor/EditorLoadingOverlay.d.ts +12 -0
- package/dist/components/editor/EditorPlacements.d.ts +14 -0
- package/dist/components/editor/EditorPreview.d.ts +32 -8
- package/dist/components/editor/EditorRoot.d.ts +12 -0
- package/dist/components/editor/PreviewPrismOverlay.d.ts +23 -0
- package/dist/components/editor/RootInternals.d.ts +31 -0
- package/dist/components/editor/editorAudit.d.ts +66 -0
- package/dist/components/editor/index.d.ts +14 -0
- package/dist/components/editor/usePlacements.d.ts +14 -0
- package/dist/components/embed-realtime/context.d.ts +11 -2
- package/dist/components/embed-realtime/validateEmbed.d.ts +20 -1
- package/dist/contexts/EditorContext.d.ts +34 -0
- package/dist/core/HybridHistoryManager.d.ts +7 -0
- package/dist/core/elementGuards.d.ts +19 -0
- package/dist/{custom-icons-BW6hqmkL.js → custom-icons-CcLMyybv.js} +7 -7
- package/dist/{custom-icons-BW6hqmkL.js.map → custom-icons-CcLMyybv.js.map} +1 -1
- package/dist/design/design-builder.d.ts +41 -3
- package/dist/design/product-config.d.ts +10 -0
- package/dist/{design-builder-2VUjfmdt.js → design-builder-cZY958Rw.js} +109 -61
- package/dist/design-builder-cZY958Rw.js.map +1 -0
- package/dist/editorErrors-BhrZ_nwj.js +1219 -0
- package/dist/editorErrors-BhrZ_nwj.js.map +1 -0
- package/dist/embed-CJswRZte.js +1586 -0
- package/dist/embed-CJswRZte.js.map +1 -0
- package/dist/embed.mjs +42 -34
- package/dist/errors/editorError.d.ts +29 -1
- package/dist/{guards-8rkFAMBs.js → guards-DIX8aXWM.js} +2 -2
- package/dist/{guards-8rkFAMBs.js.map → guards-DIX8aXWM.js.map} +1 -1
- package/dist/hooks/elementPatch.d.ts +96 -0
- package/dist/hooks/useCommands.d.ts +20 -0
- package/dist/index.mjs +8 -8
- package/dist/internals.mjs +9 -9
- package/dist/style.css +1 -1
- package/dist/template-fields-BXl29sgh.js +716 -0
- package/dist/template-fields-BXl29sgh.js.map +1 -0
- package/dist/testing.mjs +4 -4
- package/dist/{usePieceGuideBundle-CbJJg66S.js → usePieceGuideBundle-DE21DQGZ.js} +2 -2
- package/dist/{usePieceGuideBundle-CbJJg66S.js.map → usePieceGuideBundle-DE21DQGZ.js.map} +1 -1
- package/dist/{validation-C9Fe9ahK.js → validation-DGXAQmUC.js} +11 -11
- package/dist/{validation-C9Fe9ahK.js.map → validation-DGXAQmUC.js.map} +1 -1
- package/example/package.json +1 -1
- package/llms.txt +3 -0
- package/package.json +7 -4
- package/dist/design-builder-2VUjfmdt.js.map +0 -1
- package/dist/editorErrors-B2mb1sVN.js +0 -1208
- package/dist/editorErrors-B2mb1sVN.js.map +0 -1
- package/dist/embed-DxsaqZJF.js +0 -1226
- package/dist/embed-DxsaqZJF.js.map +0 -1
- package/dist/template-fields-CQ6n2P4V.js +0 -548
- package/dist/template-fields-CQ6n2P4V.js.map +0 -1
|
@@ -0,0 +1,716 @@
|
|
|
1
|
+
import { g as C, u as ut, c as Y, b as W } from "./editorErrors-BhrZ_nwj.js";
|
|
2
|
+
import { l as it, i as gt, a as Nt } from "./design-builder-cZY958Rw.js";
|
|
3
|
+
import { toOptionAttributes as St, toCombinations as It, getMissingSelections as wt, validateProductSelection as Ot, findBestCombination as J, computeDisabledChoices as At } from "@snowcone-app/sdk";
|
|
4
|
+
import { useRef as E, useCallback as I, useEffect as Tt, useContext as ht, useId as kt, useLayoutEffect as Dt, useMemo as V, useState as ot } from "react";
|
|
5
|
+
import { G as Bt, I as z, P as _t, S as Ft, T as K, z as yt, U as st, c as Ut, y as rt } from "./FontAnalyzer-EF3gLPr8.js";
|
|
6
|
+
import { p as pt, U as Rt } from "./UnifiedFontService-CHVYDBDW.js";
|
|
7
|
+
import { a as Lt, o as R, b as d, n as Pt, l as b, u as at, c as Yt } from "./CanvasStateV1-BTbCD_xC.js";
|
|
8
|
+
function X(e) {
|
|
9
|
+
return e.text;
|
|
10
|
+
}
|
|
11
|
+
function L(e) {
|
|
12
|
+
return e.name;
|
|
13
|
+
}
|
|
14
|
+
class $e {
|
|
15
|
+
constructor(t) {
|
|
16
|
+
this.listeners = /* @__PURE__ */ new Set(), this.getState = () => this.state, this.subscribe = (o) => (this.listeners.add(o), () => this.listeners.delete(o)), this.state = t;
|
|
17
|
+
const n = /* @__PURE__ */ new Map();
|
|
18
|
+
for (const o of t.elements) {
|
|
19
|
+
const i = L(o), s = X(o);
|
|
20
|
+
i && typeof s == "string" && n.set(i, s);
|
|
21
|
+
}
|
|
22
|
+
this.seedTextByName = n;
|
|
23
|
+
}
|
|
24
|
+
/** Replace the whole state (the canvas `onChange` path). */
|
|
25
|
+
setState(t) {
|
|
26
|
+
this.state = t, this.emit();
|
|
27
|
+
}
|
|
28
|
+
/** The seed value of a named text layer (for completeness rule C3). */
|
|
29
|
+
seedTextOf(t) {
|
|
30
|
+
return this.seedTextByName.get(t);
|
|
31
|
+
}
|
|
32
|
+
/** Current text of a named text layer, or undefined when absent. */
|
|
33
|
+
textOf(t) {
|
|
34
|
+
const n = this.state.elements.find((o) => L(o) === t);
|
|
35
|
+
return n ? X(n) : void 0;
|
|
36
|
+
}
|
|
37
|
+
/** Kind of the named layer in the CURRENT state ('text' | 'image' | null
|
|
38
|
+
* for unbindable), or undefined when no layer has the name. */
|
|
39
|
+
layerKindOf(t) {
|
|
40
|
+
const n = this.state.elements.find((o) => L(o) === t);
|
|
41
|
+
return n ? it(n) : void 0;
|
|
42
|
+
}
|
|
43
|
+
/** Names of bindable layers in the current state, for error messages. */
|
|
44
|
+
bindableLayerNames() {
|
|
45
|
+
return this.state.elements.filter((t) => it(t) !== null).map(L).filter((t) => !!t);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Direct write path for `Editor.TextField` when NO canvas is mounted (with
|
|
49
|
+
* one, writes route through the editor command path and arrive back here
|
|
50
|
+
* via `setState`). Immutable update; last-write-wins.
|
|
51
|
+
*/
|
|
52
|
+
updateTextLayer(t, n) {
|
|
53
|
+
let o = !1;
|
|
54
|
+
const i = this.state.elements.map((s) => L(s) !== t ? s : (o = !0, { ...s, text: n }));
|
|
55
|
+
if (!o)
|
|
56
|
+
throw new C(
|
|
57
|
+
"E_LAYER_NOT_FOUND",
|
|
58
|
+
`no layer "${t}" in the current design state. Bindable layers: ${JSON.stringify(this.bindableLayerNames())}.`,
|
|
59
|
+
{ layerName: t, validNames: this.bindableLayerNames(), docSlug: "embed-mode" }
|
|
60
|
+
);
|
|
61
|
+
this.setState({ ...this.state, elements: i });
|
|
62
|
+
}
|
|
63
|
+
/** ≥1 element with visible content (completeness rule C4): non-empty text,
|
|
64
|
+
* an image with a URL, or a shape. Hidden elements don't count. */
|
|
65
|
+
hasRenderableElement() {
|
|
66
|
+
return this.state.elements.some((t) => {
|
|
67
|
+
if (t.visible === !1) return !1;
|
|
68
|
+
const n = t.transformType;
|
|
69
|
+
if (n === "image") return !!t.imageUrl;
|
|
70
|
+
if (n === "shape" || n === "group" || n === "path") return !0;
|
|
71
|
+
const o = X(t);
|
|
72
|
+
return typeof o == "string" && o.trim().length > 0;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
emit() {
|
|
76
|
+
for (const t of [...this.listeners]) t();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function lt(e) {
|
|
80
|
+
return (e.choices ?? []).map((t) => typeof t == "string" ? t : t.label ?? "").filter((t) => t !== "");
|
|
81
|
+
}
|
|
82
|
+
function Kt(e, t) {
|
|
83
|
+
if (!e.variantId) return {};
|
|
84
|
+
const n = t.find((i) => i.variantId === e.variantId);
|
|
85
|
+
if (!n) return {};
|
|
86
|
+
const o = {};
|
|
87
|
+
for (const [i, s] of Object.entries(n))
|
|
88
|
+
i === "variantId" || i === "price" || (typeof s == "string" ? o[i] = s : typeof s == "number" && (o[i] = String(s)));
|
|
89
|
+
return o;
|
|
90
|
+
}
|
|
91
|
+
class Ce {
|
|
92
|
+
constructor(t) {
|
|
93
|
+
this.quantity = 1, this.version = 0, this.listeners = /* @__PURE__ */ new Set(), this.getVersion = () => this.version, this.subscribe = (n) => (this.listeners.add(n), () => this.listeners.delete(n)), this.product = t, this.attrs = St({ options: t.options }), this.combos = It({ options: t.options }), this.selection = Kt(t, this.combos);
|
|
94
|
+
}
|
|
95
|
+
getAttributes() {
|
|
96
|
+
return this.attrs;
|
|
97
|
+
}
|
|
98
|
+
getSelection() {
|
|
99
|
+
return this.selection;
|
|
100
|
+
}
|
|
101
|
+
getQuantity() {
|
|
102
|
+
return this.quantity;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Select a choice for a variant attribute. Strict + loud (D4/E3): an
|
|
106
|
+
* attribute key or choice that doesn't exist on the product is a wiring
|
|
107
|
+
* mistake, not user state — throws `E_UNKNOWN_OPTION` listing what IS valid.
|
|
108
|
+
*/
|
|
109
|
+
select(t, n) {
|
|
110
|
+
const o = this.attrs[t];
|
|
111
|
+
if (!o)
|
|
112
|
+
throw new C(
|
|
113
|
+
"E_UNKNOWN_OPTION",
|
|
114
|
+
`product ${this.product.productId} has no option "${t}". Valid option keys: ${JSON.stringify(Object.keys(this.attrs))}.`,
|
|
115
|
+
{ key: t, validKeys: Object.keys(this.attrs), docSlug: "embed-mode" }
|
|
116
|
+
);
|
|
117
|
+
const i = lt(o);
|
|
118
|
+
if (i.length > 0 && !i.includes(n))
|
|
119
|
+
throw new C(
|
|
120
|
+
"E_UNKNOWN_OPTION",
|
|
121
|
+
`"${n}" is not a choice of option "${t}" on product ${this.product.productId}. Valid choices: ${JSON.stringify(i)}.`,
|
|
122
|
+
{ key: t, choice: n, validChoices: i, docSlug: "embed-mode" }
|
|
123
|
+
);
|
|
124
|
+
this.selection[t] !== n && (this.selection = { ...this.selection, [t]: n }, this.bump());
|
|
125
|
+
}
|
|
126
|
+
/** Quantity is USER state (completeness rule C5 gates on it) — never throws. */
|
|
127
|
+
setQuantity(t) {
|
|
128
|
+
this.quantity !== t && (this.quantity = t, this.bump());
|
|
129
|
+
}
|
|
130
|
+
/** Attribute keys still required (non-optional) but unselected — Buy's
|
|
131
|
+
* `option:<key>` reason codes. */
|
|
132
|
+
missingOptionKeys() {
|
|
133
|
+
return Object.keys(this.attrs).length === 0 ? [] : wt(this.attrs, this.selection);
|
|
134
|
+
}
|
|
135
|
+
/** Full selection resolution (the C1 amendment): true when every required
|
|
136
|
+
* attribute is selected AND the selection matches a valid combination. */
|
|
137
|
+
selectionValid() {
|
|
138
|
+
return Object.keys(this.attrs).length === 0 ? !0 : Ot(this.attrs, this.selection, this.combos);
|
|
139
|
+
}
|
|
140
|
+
/** The variant (gvid) the current selection resolves to. Falls back to the
|
|
141
|
+
* product's initial `variantId` while nothing has been selected. */
|
|
142
|
+
resolvedVariantId() {
|
|
143
|
+
if (Object.keys(this.attrs).length === 0 || this.combos.length === 0)
|
|
144
|
+
return this.product.variantId;
|
|
145
|
+
if (!this.selectionValid()) return;
|
|
146
|
+
const t = J(this.selection, this.combos, this.attrs);
|
|
147
|
+
return (typeof (t == null ? void 0 : t.variantId) == "string" && t.variantId !== "" ? t.variantId : void 0) ?? this.product.variantId;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* The variant (gvid) to RENDER with — deliberately looser than
|
|
151
|
+
* {@link resolvedVariantId}. That one is Buy's currency: it returns
|
|
152
|
+
* `undefined` while the selection is incomplete so completeness can gate.
|
|
153
|
+
* But the PRODUCT PHOTO must follow the shopper's picks immediately —
|
|
154
|
+
* "choose the Oak frame" should render Oak even while an unrelated axis
|
|
155
|
+
* (size, pocket) is still unselected. This resolves the best combination
|
|
156
|
+
* matching the CURRENT (possibly partial) selection, falling back to the
|
|
157
|
+
* product's initial variant. (Before this split, switching a color swatch
|
|
158
|
+
* with any axis unselected rendered nothing — the mockup silently stayed
|
|
159
|
+
* on the old color.)
|
|
160
|
+
*/
|
|
161
|
+
renderVariantId() {
|
|
162
|
+
if (Object.keys(this.attrs).length === 0 || this.combos.length === 0)
|
|
163
|
+
return this.product.variantId;
|
|
164
|
+
const t = J(this.selection, this.combos, this.attrs);
|
|
165
|
+
return (typeof (t == null ? void 0 : t.variantId) == "string" && t.variantId !== "" ? t.variantId : void 0) ?? this.product.variantId;
|
|
166
|
+
}
|
|
167
|
+
/** Price of the resolved combination, when the catalog carries one. */
|
|
168
|
+
resolvedPrice() {
|
|
169
|
+
if (!this.selectionValid()) return;
|
|
170
|
+
const t = J(this.selection, this.combos, this.attrs);
|
|
171
|
+
return typeof (t == null ? void 0 : t.price) == "number" ? t.price : void 0;
|
|
172
|
+
}
|
|
173
|
+
/** Choices invalid given the rest of the current selection — for hosts to
|
|
174
|
+
* disable/grey out in their variant UI. */
|
|
175
|
+
disabledChoices() {
|
|
176
|
+
const t = {};
|
|
177
|
+
for (const [n, o] of Object.entries(this.attrs))
|
|
178
|
+
t[n] = { ...o, choices: lt(o) };
|
|
179
|
+
return At(this.selection, t, this.combos);
|
|
180
|
+
}
|
|
181
|
+
/** The combinations (for payload assembly via `createCartDetail`). */
|
|
182
|
+
getCombinations() {
|
|
183
|
+
return this.combos;
|
|
184
|
+
}
|
|
185
|
+
bump() {
|
|
186
|
+
this.version++;
|
|
187
|
+
for (const t of [...this.listeners]) t();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function bt(e) {
|
|
191
|
+
return e instanceof K;
|
|
192
|
+
}
|
|
193
|
+
function Mt(e) {
|
|
194
|
+
return e instanceof z;
|
|
195
|
+
}
|
|
196
|
+
function Ht(e) {
|
|
197
|
+
return e instanceof Ft;
|
|
198
|
+
}
|
|
199
|
+
function jt(e) {
|
|
200
|
+
return e instanceof Bt;
|
|
201
|
+
}
|
|
202
|
+
function Wt(e) {
|
|
203
|
+
return e instanceof _t;
|
|
204
|
+
}
|
|
205
|
+
function Vt(e) {
|
|
206
|
+
return bt(e) ? "text" : Mt(e) ? "image" : Ht(e) ? "shape" : jt(e) ? "group" : Wt(e) ? "path" : null;
|
|
207
|
+
}
|
|
208
|
+
const P = ["x", "y", "rotation", "opacity", "name", "visible", "locked"], zt = ["text", "fontSize", "color", "fontFamily", "bold", "italic", "textAlign"], Gt = ["fillColor", "width", "height"], Jt = ["imageUrl", "width", "height"], Xt = {
|
|
209
|
+
text: [...P, ...zt],
|
|
210
|
+
shape: [...P, ...Gt],
|
|
211
|
+
image: [...P, ...Jt],
|
|
212
|
+
group: [...P],
|
|
213
|
+
path: [...P]
|
|
214
|
+
}, q = ["left", "center", "right"];
|
|
215
|
+
function S(e, t) {
|
|
216
|
+
return new C("E_INVALID_PATCH", e, { ...t, docSlug: "embed-mode" });
|
|
217
|
+
}
|
|
218
|
+
function Q(e, t, n) {
|
|
219
|
+
if (typeof t != "number" || !Number.isFinite(t))
|
|
220
|
+
throw S(
|
|
221
|
+
`patch key "${e}" must be a finite number, got ${JSON.stringify(t)} (element kind: ${n}).`,
|
|
222
|
+
{ key: e, kind: n, value: t }
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
function ct(e, t, n, o) {
|
|
226
|
+
if (typeof t !== n)
|
|
227
|
+
throw S(
|
|
228
|
+
`patch key "${e}" must be a ${n}, got ${JSON.stringify(t)} (element kind: ${o}).`,
|
|
229
|
+
{ key: e, kind: o, value: t }
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
function qt(e, t) {
|
|
233
|
+
const n = gt(t), o = n ? t.name : t;
|
|
234
|
+
if (!n) {
|
|
235
|
+
const r = e.get(o);
|
|
236
|
+
if (r) return r;
|
|
237
|
+
}
|
|
238
|
+
const i = e.getAllByName(o);
|
|
239
|
+
if (i.length > 0) return i[0];
|
|
240
|
+
const s = e.getAll(), a = s.map((r) => r.name).filter((r) => !!r);
|
|
241
|
+
throw new C(
|
|
242
|
+
"E_LAYER_NOT_FOUND",
|
|
243
|
+
`no element with ${n ? "layer name" : "id or layer name"} "${o}" in this document. Valid layer names: ${JSON.stringify(a)}; valid ids: ${JSON.stringify(s.map((r) => r.id))}.`,
|
|
244
|
+
{ layerName: o, validNames: a, validIds: s.map((r) => r.id), docSlug: "embed-mode" }
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
function Qt(e, t) {
|
|
248
|
+
const n = Vt(e);
|
|
249
|
+
if (!n)
|
|
250
|
+
throw S("target is not a patchable editor element.", { kind: null });
|
|
251
|
+
const o = Xt[n];
|
|
252
|
+
for (const [i, s] of Object.entries(t))
|
|
253
|
+
if (s !== void 0) {
|
|
254
|
+
if (!o.includes(i))
|
|
255
|
+
throw S(
|
|
256
|
+
`patch key "${i}" does not apply to a ${n} element. Valid keys for ${n}: ${JSON.stringify(o)}.`,
|
|
257
|
+
{ key: i, kind: n, validKeys: o }
|
|
258
|
+
);
|
|
259
|
+
switch (i) {
|
|
260
|
+
case "x":
|
|
261
|
+
case "y":
|
|
262
|
+
case "rotation":
|
|
263
|
+
Q(i, s, n);
|
|
264
|
+
break;
|
|
265
|
+
case "opacity":
|
|
266
|
+
if (Q(i, s, n), s < 0 || s > 1)
|
|
267
|
+
throw S(`opacity must be between 0 and 1, got ${s} (element kind: ${n}).`, {
|
|
268
|
+
key: i,
|
|
269
|
+
kind: n,
|
|
270
|
+
value: s
|
|
271
|
+
});
|
|
272
|
+
break;
|
|
273
|
+
case "fontSize":
|
|
274
|
+
case "width":
|
|
275
|
+
case "height":
|
|
276
|
+
if (Q(i, s, n), s <= 0)
|
|
277
|
+
throw S(`${i} must be > 0, got ${s} (element kind: ${n}).`, { key: i, kind: n, value: s });
|
|
278
|
+
break;
|
|
279
|
+
case "name":
|
|
280
|
+
case "text":
|
|
281
|
+
case "color":
|
|
282
|
+
case "fontFamily":
|
|
283
|
+
case "fillColor":
|
|
284
|
+
case "imageUrl":
|
|
285
|
+
ct(i, s, "string", n);
|
|
286
|
+
break;
|
|
287
|
+
case "visible":
|
|
288
|
+
case "locked":
|
|
289
|
+
case "bold":
|
|
290
|
+
case "italic":
|
|
291
|
+
ct(i, s, "boolean", n);
|
|
292
|
+
break;
|
|
293
|
+
case "textAlign":
|
|
294
|
+
if (typeof s != "string" || !q.includes(s))
|
|
295
|
+
throw S(
|
|
296
|
+
`textAlign must be one of ${JSON.stringify(q)}, got ${JSON.stringify(s)}.`,
|
|
297
|
+
{ key: i, kind: n, value: s, validKeys: q }
|
|
298
|
+
);
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return n;
|
|
303
|
+
}
|
|
304
|
+
function Zt(e, t) {
|
|
305
|
+
let n = !1;
|
|
306
|
+
if (t.x !== void 0 && (e.x = t.x), t.y !== void 0 && (e.y = t.y), t.rotation !== void 0 && e.setRotation(t.rotation), t.opacity !== void 0 && (e.opacity = t.opacity), t.name !== void 0 && (e.name = t.name), t.visible !== void 0 && (e.visible = t.visible), t.locked !== void 0 && (e.locked = t.locked), bt(e))
|
|
307
|
+
return t.text !== void 0 && e.setText(t.text), t.fontSize !== void 0 && e.setFontSize(t.fontSize), t.color !== void 0 && e.setColor(t.color), t.fontFamily !== void 0 && t.fontFamily !== e.fontFamily && (yt.clearCache(e.fontFamily), e.fontFamily = t.fontFamily), t.bold !== void 0 && (e.bold = t.bold), t.italic !== void 0 && (e.italic = t.italic), t.textAlign !== void 0 && (e.textAlign = t.textAlign), { needsImageLoad: n };
|
|
308
|
+
const o = e;
|
|
309
|
+
if (t.width !== void 0 && (o.transformData.width = t.width), t.height !== void 0 && (o.transformData.height = t.height), t.fillColor !== void 0 && (e.transformData.fillColor = t.fillColor), t.imageUrl !== void 0) {
|
|
310
|
+
const i = e;
|
|
311
|
+
t.imageUrl !== i.imageUrl && (i.imageLoaded = !1, i.imageElement = null, i.isCropping = !1, i.imageUrl = t.imageUrl, i.preserveDimensions = t.width !== void 0 || t.height !== void 0, n = !0);
|
|
312
|
+
}
|
|
313
|
+
return { needsImageLoad: n };
|
|
314
|
+
}
|
|
315
|
+
const mt = Ut("useCommands");
|
|
316
|
+
function Ne() {
|
|
317
|
+
const e = ut(), {
|
|
318
|
+
undo: t,
|
|
319
|
+
redo: n,
|
|
320
|
+
canUndo: o,
|
|
321
|
+
canRedo: i,
|
|
322
|
+
executeElementUpdate: s,
|
|
323
|
+
executeAddElement: a,
|
|
324
|
+
executeRemoveElement: r,
|
|
325
|
+
executeReorderElement: c,
|
|
326
|
+
executeCommandBatch: l,
|
|
327
|
+
executeCreateArtboard: m,
|
|
328
|
+
executeDeleteArtboard: v,
|
|
329
|
+
executeUpdateArtboard: w,
|
|
330
|
+
addElement: u,
|
|
331
|
+
elementStore: h,
|
|
332
|
+
artboardManager: O,
|
|
333
|
+
historyManager: x
|
|
334
|
+
} = e, _ = E(h);
|
|
335
|
+
_.current = h;
|
|
336
|
+
const A = E(s);
|
|
337
|
+
A.current = s;
|
|
338
|
+
const N = E(null), y = I(
|
|
339
|
+
(g, k, D) => {
|
|
340
|
+
const Et = _.current;
|
|
341
|
+
let p = qt(Et, g);
|
|
342
|
+
const M = O.getArtboardIdForElement(p.id) ?? O.getActiveArtboardId(), F = M ? x.peekArtboard(M) : null;
|
|
343
|
+
F instanceof st && F.elementId === p.id && F.newElement && (p = F.newElement), Qt(p, k);
|
|
344
|
+
const H = p.clone(), { needsImageLoad: $t } = Zt(H, k);
|
|
345
|
+
if ($t) {
|
|
346
|
+
const B = H;
|
|
347
|
+
B.onLoadCallback = (Ct) => {
|
|
348
|
+
A.current(p, Ct);
|
|
349
|
+
}, N.current = null, B.loadImage(B.imageUrl);
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
const U = N.current;
|
|
353
|
+
if (D != null && D.coalesce && U && U.elementId === p.id && F === U.command) {
|
|
354
|
+
U.command.newElement = H, U.command.execute();
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
if (A.current(p, H), D != null && D.coalesce && M) {
|
|
358
|
+
const B = x.peekArtboard(M);
|
|
359
|
+
N.current = B instanceof st ? { elementId: p.id, command: B } : null;
|
|
360
|
+
} else
|
|
361
|
+
N.current = null;
|
|
362
|
+
},
|
|
363
|
+
[O, x]
|
|
364
|
+
), f = I(() => {
|
|
365
|
+
mt.warn("[useCommands] clearHistory is not yet implemented in EditorContext");
|
|
366
|
+
}, []), T = I((g) => {
|
|
367
|
+
mt.warn("[useCommands] clearArtboardHistory is not yet implemented in EditorContext");
|
|
368
|
+
}, []);
|
|
369
|
+
return {
|
|
370
|
+
// Undo/Redo
|
|
371
|
+
undo: t,
|
|
372
|
+
redo: n,
|
|
373
|
+
canUndo: o,
|
|
374
|
+
canRedo: i,
|
|
375
|
+
// History management
|
|
376
|
+
clearHistory: f,
|
|
377
|
+
clearArtboardHistory: T,
|
|
378
|
+
// Declarative element write path
|
|
379
|
+
updateElement: y,
|
|
380
|
+
addElement: u,
|
|
381
|
+
// Command execution
|
|
382
|
+
executeElementUpdate: s,
|
|
383
|
+
executeAddElement: a,
|
|
384
|
+
executeRemoveElement: r,
|
|
385
|
+
executeReorderElement: c,
|
|
386
|
+
executeCreateArtboard: m,
|
|
387
|
+
executeDeleteArtboard: v,
|
|
388
|
+
executeUpdateArtboard: w,
|
|
389
|
+
// Batch execution
|
|
390
|
+
executeCommandBatch: l
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
function Se() {
|
|
394
|
+
const { selectedElement: e } = ut();
|
|
395
|
+
return e ?? null;
|
|
396
|
+
}
|
|
397
|
+
const te = 3e3, ft = {
|
|
398
|
+
text: "useTextBinding",
|
|
399
|
+
image: "useImageBinding",
|
|
400
|
+
font: "useFontBinding"
|
|
401
|
+
}, ee = {
|
|
402
|
+
text: "setText",
|
|
403
|
+
image: "setImageUrl",
|
|
404
|
+
font: "setFontFamily"
|
|
405
|
+
}, ne = {
|
|
406
|
+
text: "text",
|
|
407
|
+
image: "image",
|
|
408
|
+
font: "text"
|
|
409
|
+
}, Z = /* @__PURE__ */ new Set();
|
|
410
|
+
function dt(e) {
|
|
411
|
+
return e instanceof K ? "text" : e instanceof z ? "image" : "other";
|
|
412
|
+
}
|
|
413
|
+
function ie(e, t, n) {
|
|
414
|
+
const o = `[${ft[e]}]`, i = `the binding is dead (isConnected: false, ${ee[e]} is a no-op)`, s = ne[e], a = n.getAllByName(t);
|
|
415
|
+
if (a.length > 0) {
|
|
416
|
+
const l = [...new Set(a.map(dt))], m = s === "text" ? "image" : "text", v = l.length === 1 && l[0] === m ? ` Bind it with ${ft[m]}("${t}") instead.` : "";
|
|
417
|
+
return `${o} the layer named "${t}" is ${l.join("/")}, not ${s} — ${i}.${v}`;
|
|
418
|
+
}
|
|
419
|
+
const r = n.getAll().filter((l) => l.name).map((l) => `"${l.name}" (${dt(l)})`), c = r.length ? `Named layers on this canvas: ${r.join(", ")}. Check the name for a typo.` : `No element on this canvas has a name — name one via design().${s}(…, { name: '${t}' }) or the element's \`name\` property.`;
|
|
420
|
+
return `${o} no ${s} layer named "${t}" exists — ${i}. ${c}`;
|
|
421
|
+
}
|
|
422
|
+
function et(e, t, n, o) {
|
|
423
|
+
Tt(() => {
|
|
424
|
+
var a;
|
|
425
|
+
if (o || typeof rt > "u" || ((a = rt.env) == null ? void 0 : a.NODE_ENV) === "production") return;
|
|
426
|
+
const i = `${e}:${t}`;
|
|
427
|
+
if (Z.has(i)) return;
|
|
428
|
+
const s = setTimeout(() => {
|
|
429
|
+
Z.has(i) || (Z.add(i), console.warn(ie(e, t, n)));
|
|
430
|
+
}, te);
|
|
431
|
+
return () => clearTimeout(s);
|
|
432
|
+
}, [e, t, n, o]);
|
|
433
|
+
}
|
|
434
|
+
function G(e) {
|
|
435
|
+
const t = ht(pt), n = kt();
|
|
436
|
+
Dt(() => {
|
|
437
|
+
if (t)
|
|
438
|
+
return t.registry.requireCanvas(n, e);
|
|
439
|
+
}, [t, n, e]);
|
|
440
|
+
}
|
|
441
|
+
function tt(e) {
|
|
442
|
+
return e instanceof K ? "text" : e instanceof z ? "image" : null;
|
|
443
|
+
}
|
|
444
|
+
const oe = {
|
|
445
|
+
text: "useTextBinding / useFontBinding",
|
|
446
|
+
image: "useImageBinding"
|
|
447
|
+
};
|
|
448
|
+
function nt(e, t, n) {
|
|
449
|
+
const o = gt(e), i = o ? e.name : e, s = ht(pt), a = E(null);
|
|
450
|
+
if (o && e.kind !== t)
|
|
451
|
+
throw new C(
|
|
452
|
+
"E_LAYER_WRONG_KIND",
|
|
453
|
+
`layer "${i}" is a ${e.kind} token — this hook binds ${t} layers only (use ${oe[e.kind]}).`,
|
|
454
|
+
{ layerName: i, actualKind: e.kind, expectedKind: t, docSlug: "embed-mode" }
|
|
455
|
+
);
|
|
456
|
+
if (o && s && a.current !== i) {
|
|
457
|
+
const r = n.getAll();
|
|
458
|
+
if (r.length > 0) {
|
|
459
|
+
const c = n.getAllByName(i);
|
|
460
|
+
if (c.length === 0) {
|
|
461
|
+
const l = r.map((m) => ({ name: m.name, kind: tt(m) })).filter((m) => !!m.name && m.kind !== null);
|
|
462
|
+
throw new C(
|
|
463
|
+
"E_LAYER_NOT_FOUND",
|
|
464
|
+
`no layer "${i}" in this Root's document — the token was minted from a different design than the one passed to <Editor.Root design={…}>, or the layer was deleted. Bindable layers here: ${JSON.stringify(l.map((m) => m.name))}.`,
|
|
465
|
+
{ layerName: i, validNames: l.map((m) => m.name), docSlug: "embed-mode" }
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
if (!c.some((l) => tt(l) === t)) {
|
|
469
|
+
const l = tt(c[0]) ?? "unbindable";
|
|
470
|
+
throw new C(
|
|
471
|
+
"E_LAYER_WRONG_KIND",
|
|
472
|
+
`layer "${i}" is ${l === "unbindable" ? "not a bindable kind" : `an ${l} layer`} — this hook binds ${t} layers only.`,
|
|
473
|
+
{ layerName: i, actualKind: l, expectedKind: t, docSlug: "embed-mode" }
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
a.current = i;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
return i;
|
|
480
|
+
}
|
|
481
|
+
const se = () => {
|
|
482
|
+
}, re = [];
|
|
483
|
+
function Ie(e) {
|
|
484
|
+
const { elementStore: t } = Y();
|
|
485
|
+
G("useTextBinding()");
|
|
486
|
+
const n = nt(e, "text", t), { executeElementUpdate: o } = W(), i = V(() => t.getAllByName(n).filter((r) => r instanceof K), [t, n]), s = I(
|
|
487
|
+
(a) => {
|
|
488
|
+
for (const r of i) {
|
|
489
|
+
const c = r.clone();
|
|
490
|
+
c.setText(a), o(r, c);
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
[i, o]
|
|
494
|
+
);
|
|
495
|
+
return et("text", n, t, i.length > 0), i.length === 0 ? { text: "", setText: se, element: null, elements: re, isConnected: !1 } : {
|
|
496
|
+
text: i[0].getText(),
|
|
497
|
+
setText: s,
|
|
498
|
+
element: i[0],
|
|
499
|
+
elements: i,
|
|
500
|
+
isConnected: !0
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
const ae = () => {
|
|
504
|
+
}, le = [];
|
|
505
|
+
function ce(e, t, n) {
|
|
506
|
+
const o = e / t;
|
|
507
|
+
if (n >= o) {
|
|
508
|
+
const i = t, s = i * n, a = e / s;
|
|
509
|
+
return {
|
|
510
|
+
width: s,
|
|
511
|
+
height: i,
|
|
512
|
+
cropX: (1 - a) / 2,
|
|
513
|
+
cropY: 0,
|
|
514
|
+
cropWidth: a,
|
|
515
|
+
cropHeight: 1
|
|
516
|
+
};
|
|
517
|
+
} else {
|
|
518
|
+
const i = e, s = i / n, a = t / s;
|
|
519
|
+
return {
|
|
520
|
+
width: i,
|
|
521
|
+
height: s,
|
|
522
|
+
cropX: 0,
|
|
523
|
+
cropY: (1 - a) / 2,
|
|
524
|
+
cropWidth: 1,
|
|
525
|
+
cropHeight: a
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
function we(e, t) {
|
|
530
|
+
G("useImageBinding()");
|
|
531
|
+
const n = (t == null ? void 0 : t.fit) ?? "cover", { elementStore: o, setElements: i } = Y(), s = nt(e, "image", o), { executeElementUpdate: a } = W(), r = V(() => o.getAllByName(s).filter((h) => h instanceof z), [o, s]), c = E(/* @__PURE__ */ new Map());
|
|
532
|
+
for (const u of r)
|
|
533
|
+
if (!c.current.has(u.id)) {
|
|
534
|
+
const h = u.transformData;
|
|
535
|
+
c.current.set(u.id, {
|
|
536
|
+
width: h.width * h.cropWidth,
|
|
537
|
+
height: h.height * h.cropHeight
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
const l = E(r);
|
|
541
|
+
l.current = r;
|
|
542
|
+
const m = E(a);
|
|
543
|
+
m.current = a;
|
|
544
|
+
const v = E(i);
|
|
545
|
+
v.current = i;
|
|
546
|
+
const w = I(
|
|
547
|
+
(u) => {
|
|
548
|
+
const h = l.current, O = m.current;
|
|
549
|
+
for (const x of h) {
|
|
550
|
+
const _ = c.current.get(x.id);
|
|
551
|
+
if (!_) continue;
|
|
552
|
+
const { width: A, height: N } = _, y = x.clone();
|
|
553
|
+
y.imageLoaded = !1, y.imageElement = null, y.isCropping = !1, y.imageUrl = u, n === "cover" ? (y.preserveDimensions = !0, y.onLoadCallback = (f) => {
|
|
554
|
+
const T = f.imageAspectRatio || 1, g = ce(A, N, T);
|
|
555
|
+
f.transformData.width = g.width, f.transformData.height = g.height, f.transformData.cropX = g.cropX, f.transformData.cropY = g.cropY, f.transformData.cropWidth = g.cropWidth, f.transformData.cropHeight = g.cropHeight, O(x, f);
|
|
556
|
+
}) : (y.preserveDimensions = !1, y.onLoadCallback = (f) => {
|
|
557
|
+
const T = f.transformData.width, g = f.transformData.height, k = Math.min(A / T, N / g, 1);
|
|
558
|
+
k < 1 && (f.transformData.width = T * k, f.transformData.height = g * k), f.transformData.cropX = 0, f.transformData.cropY = 0, f.transformData.cropWidth = 1, f.transformData.cropHeight = 1, O(x, f);
|
|
559
|
+
}), y.loadImage(u);
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
[n]
|
|
563
|
+
// Stable deps only — imageElements/executeElementUpdate/setElements accessed via refs
|
|
564
|
+
);
|
|
565
|
+
return et("image", s, o, r.length > 0), r.length === 0 ? { imageUrl: "", setImageUrl: ae, element: null, elements: le, isConnected: !1 } : {
|
|
566
|
+
imageUrl: r[0].imageUrl,
|
|
567
|
+
setImageUrl: w,
|
|
568
|
+
element: r[0],
|
|
569
|
+
elements: r,
|
|
570
|
+
isConnected: !0
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
const me = [];
|
|
574
|
+
function j(e) {
|
|
575
|
+
let t = e.trim().toUpperCase();
|
|
576
|
+
return t.length === 4 && t.startsWith("#") && (t = "#" + t[1] + t[1] + t[2] + t[2] + t[3] + t[3]), t;
|
|
577
|
+
}
|
|
578
|
+
function $(e, t) {
|
|
579
|
+
return typeof e == "string" && j(e) === t;
|
|
580
|
+
}
|
|
581
|
+
function vt(e, t) {
|
|
582
|
+
var o, i, s;
|
|
583
|
+
const n = e;
|
|
584
|
+
return $(n.color, t) || $((o = n.transformData) == null ? void 0 : o.fillColor, t) || $((i = n.transformData) == null ? void 0 : i.strokeColor, t) || ((s = n.stroke) == null ? void 0 : s.enabled) === !0 && $(n.stroke.color, t);
|
|
585
|
+
}
|
|
586
|
+
function fe(e, t, n) {
|
|
587
|
+
var a, r, c;
|
|
588
|
+
if (!vt(e, t)) return null;
|
|
589
|
+
const o = e.clone(), i = e, s = o;
|
|
590
|
+
return $(i.color, t) && (typeof s.setColor == "function" ? s.setColor(n) : s.color = n), $((a = i.transformData) == null ? void 0 : a.fillColor, t) && (s.transformData = { ...s.transformData, fillColor: n }), $((r = i.transformData) == null ? void 0 : r.strokeColor, t) && (s.transformData = { ...s.transformData, strokeColor: n }), ((c = i.stroke) == null ? void 0 : c.enabled) === !0 && $(i.stroke.color, t) && (s.stroke = { ...s.stroke, color: n }), o;
|
|
591
|
+
}
|
|
592
|
+
function Oe(e) {
|
|
593
|
+
const t = Nt(e) ? e.value : e, { elementStore: n } = Y(), { executeElementUpdate: o } = W();
|
|
594
|
+
G("useColorBinding()");
|
|
595
|
+
const [i, s] = ot(() => j(t)), [a, r] = ot(t);
|
|
596
|
+
t !== a && (r(t), s(j(t)));
|
|
597
|
+
const c = V(
|
|
598
|
+
() => n.getAll().filter((m) => vt(m, i)),
|
|
599
|
+
[n, i]
|
|
600
|
+
), l = I(
|
|
601
|
+
(m) => {
|
|
602
|
+
const v = j(m);
|
|
603
|
+
if (v !== i) {
|
|
604
|
+
for (const w of n.getAll()) {
|
|
605
|
+
const u = fe(w, i, m);
|
|
606
|
+
u && o(w, u);
|
|
607
|
+
}
|
|
608
|
+
s(v);
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
[n, i, o]
|
|
612
|
+
);
|
|
613
|
+
return c.length === 0 ? { color: i, setColor: l, elements: me, isConnected: !1 } : { color: i, setColor: l, elements: c, isConnected: !0 };
|
|
614
|
+
}
|
|
615
|
+
const de = () => {
|
|
616
|
+
}, ue = [];
|
|
617
|
+
function Ae(e) {
|
|
618
|
+
const { elementStore: t } = Y();
|
|
619
|
+
G("useFontBinding()");
|
|
620
|
+
const n = nt(e, "text", t), { executeElementUpdate: o } = W(), i = V(() => t.getAllByName(n).filter((r) => r instanceof K), [t, n]), s = I(
|
|
621
|
+
(a) => {
|
|
622
|
+
Rt.loadGoogleFontByName(a);
|
|
623
|
+
for (const r of i) {
|
|
624
|
+
if (r.fontFamily === a) continue;
|
|
625
|
+
yt.clearCache(r.fontFamily);
|
|
626
|
+
const c = r.clone();
|
|
627
|
+
c.fontFamily = a, o(r, c);
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
[i, o]
|
|
631
|
+
);
|
|
632
|
+
return et("font", n, t, i.length > 0), i.length === 0 ? { fontFamily: "", setFontFamily: de, element: null, elements: ue, isConnected: !1 } : {
|
|
633
|
+
fontFamily: i[0].fontFamily,
|
|
634
|
+
setFontFamily: s,
|
|
635
|
+
element: i[0],
|
|
636
|
+
elements: i,
|
|
637
|
+
isConnected: !0
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
function Te(e) {
|
|
641
|
+
const { elementStore: t } = Y();
|
|
642
|
+
return e ? t.getByName(e) ?? null : null;
|
|
643
|
+
}
|
|
644
|
+
const xt = "personalization", ge = Lt("type", [
|
|
645
|
+
R({
|
|
646
|
+
type: b("text"),
|
|
647
|
+
name: d().min(1),
|
|
648
|
+
label: d(),
|
|
649
|
+
placeholder: d().optional(),
|
|
650
|
+
maxLength: Pt().int().positive().optional(),
|
|
651
|
+
artboard: d().min(1).optional(),
|
|
652
|
+
group: d().optional()
|
|
653
|
+
}),
|
|
654
|
+
R({
|
|
655
|
+
type: b("image"),
|
|
656
|
+
name: d().min(1),
|
|
657
|
+
label: d(),
|
|
658
|
+
placeholder: d().optional(),
|
|
659
|
+
fit: at([b("cover"), b("contain")]).optional(),
|
|
660
|
+
artboard: d().min(1).optional(),
|
|
661
|
+
group: d().optional()
|
|
662
|
+
}),
|
|
663
|
+
R({
|
|
664
|
+
type: b("color"),
|
|
665
|
+
color: d().min(1),
|
|
666
|
+
label: d(),
|
|
667
|
+
artboard: d().min(1).optional(),
|
|
668
|
+
group: d().optional()
|
|
669
|
+
}),
|
|
670
|
+
R({
|
|
671
|
+
type: b("select"),
|
|
672
|
+
name: d().min(1),
|
|
673
|
+
label: d(),
|
|
674
|
+
property: at([b("text"), b("imageUrl"), b("fontFamily")]),
|
|
675
|
+
options: Yt(R({ label: d(), value: d() })).min(1),
|
|
676
|
+
artboard: d().min(1).optional(),
|
|
677
|
+
group: d().optional()
|
|
678
|
+
})
|
|
679
|
+
]);
|
|
680
|
+
function ke(e) {
|
|
681
|
+
if (!e || typeof e != "object") return [];
|
|
682
|
+
const t = e[xt];
|
|
683
|
+
if (!Array.isArray(t)) return [];
|
|
684
|
+
const n = [];
|
|
685
|
+
for (const o of t) {
|
|
686
|
+
if (!o || typeof o != "object") continue;
|
|
687
|
+
const i = "type" in o ? o : { ...o, type: "text" }, s = ge.safeParse(i);
|
|
688
|
+
s.success && n.push(s.data);
|
|
689
|
+
}
|
|
690
|
+
return n;
|
|
691
|
+
}
|
|
692
|
+
function De(e, t) {
|
|
693
|
+
return { ...e, [xt]: t };
|
|
694
|
+
}
|
|
695
|
+
export {
|
|
696
|
+
Ce as C,
|
|
697
|
+
$e as D,
|
|
698
|
+
xt as T,
|
|
699
|
+
Ne as a,
|
|
700
|
+
Te as b,
|
|
701
|
+
Ae as c,
|
|
702
|
+
we as d,
|
|
703
|
+
Se as e,
|
|
704
|
+
Ie as f,
|
|
705
|
+
lt as g,
|
|
706
|
+
Vt as h,
|
|
707
|
+
jt as i,
|
|
708
|
+
Mt as j,
|
|
709
|
+
Wt as k,
|
|
710
|
+
Ht as l,
|
|
711
|
+
bt as m,
|
|
712
|
+
ke as r,
|
|
713
|
+
Oe as u,
|
|
714
|
+
De as w
|
|
715
|
+
};
|
|
716
|
+
//# sourceMappingURL=template-fields-BXl29sgh.js.map
|