@snowcone-app/canvas 0.15.0 → 0.17.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/dist/{CanvasStateV1-BQD8fCBU.js → CanvasStateV1-C6i6vU6p.js} +63 -63
- package/dist/{CanvasStateV1-BQD8fCBU.js.map → CanvasStateV1-C6i6vU6p.js.map} +1 -1
- package/dist/EditorCanvasImpl-DkgE5-C2.js +68 -0
- package/dist/EditorCanvasImpl-DkgE5-C2.js.map +1 -0
- package/dist/EditorContext-CyanYzo2.js +1131 -0
- package/dist/EditorContext-CyanYzo2.js.map +1 -0
- package/dist/{ImportManager-eotl7r5d.js → ElementFactory-C05JJkRp.js} +1510 -5121
- package/dist/ElementFactory-C05JJkRp.js.map +1 -0
- package/dist/{HybridHistoryManager-NL3zyEl4.js → HybridHistoryManager-Bht98XRv.js} +98 -98
- package/dist/{HybridHistoryManager-NL3zyEl4.js.map → HybridHistoryManager-Bht98XRv.js.map} +1 -1
- package/dist/ImportManager-kRYfIX-D.js +3617 -0
- package/dist/ImportManager-kRYfIX-D.js.map +1 -0
- package/dist/SnowconeCanvas-C3eZ9PP8.js +1047 -0
- package/dist/SnowconeCanvas-C3eZ9PP8.js.map +1 -0
- package/dist/ThemeContext-Rjz25x9X.js +75 -0
- package/dist/ThemeContext-Rjz25x9X.js.map +1 -0
- package/dist/UnifiedFontService-BAtqqkU4.js +1478 -0
- package/dist/UnifiedFontService-BAtqqkU4.js.map +1 -0
- package/dist/advanced.mjs +210 -207
- package/dist/advanced.mjs.map +1 -1
- package/dist/api/embed.d.ts +8 -4
- package/dist/api/testing.d.ts +1 -0
- package/dist/components/editor/EditorBuy.d.ts +49 -0
- package/dist/components/editor/EditorCanvas.d.ts +30 -0
- package/dist/components/editor/EditorCanvasImpl.d.ts +33 -0
- package/dist/components/editor/EditorPreview.d.ts +39 -0
- package/dist/components/editor/EditorRoot.d.ts +86 -0
- package/dist/components/editor/EditorTextField.d.ts +22 -0
- package/dist/components/editor/RootInternals.d.ts +77 -0
- package/dist/components/editor/designStateStore.d.ts +45 -0
- package/dist/components/editor/index.d.ts +23 -0
- package/dist/components/embed-realtime/RealtimeCanvas.d.ts +1 -1
- package/dist/components/embed-realtime/RealtimeEmbed.d.ts +5 -78
- package/dist/components/embed-realtime/RealtimeMockup.d.ts +5 -34
- package/dist/components/embed-realtime/context.d.ts +12 -2
- package/dist/components/embed-realtime/validateEmbed.d.ts +17 -3
- package/dist/contexts/EditorContext.d.ts +1 -0
- package/dist/design/design-builder.d.ts +81 -6
- package/dist/editorError-DMENTZ-3.js +19 -0
- package/dist/editorError-DMENTZ-3.js.map +1 -0
- package/dist/editorErrors-DbIEtCTt.js +29 -0
- package/dist/editorErrors-DbIEtCTt.js.map +1 -0
- package/dist/embed-Bdj4PKUA.js +737 -0
- package/dist/embed-Bdj4PKUA.js.map +1 -0
- package/dist/embed.mjs +38 -230
- package/dist/embed.mjs.map +1 -1
- package/dist/errors/editorError.d.ts +57 -0
- package/dist/iconify-D6eVIEy4.js +1089 -0
- package/dist/iconify-D6eVIEy4.js.map +1 -0
- package/dist/index.mjs +48 -46
- package/dist/index.mjs.map +1 -1
- package/dist/internals.mjs +105 -104
- package/dist/internals.mjs.map +1 -1
- package/dist/rendering/PieceGuideRenderer.d.ts +2 -16
- package/dist/template-fields-GOM4MNfq.js +643 -0
- package/dist/template-fields-GOM4MNfq.js.map +1 -0
- package/dist/testing/editorErrors.d.ts +30 -0
- package/dist/testing.mjs +28 -23
- package/dist/testing.mjs.map +1 -1
- package/dist/{usePieceGuideBundle-Cyl695jv.js → usePieceGuideBundle-CGERAQJl.js} +2 -2
- package/dist/{usePieceGuideBundle-Cyl695jv.js.map → usePieceGuideBundle-CGERAQJl.js.map} +1 -1
- package/dist/utils/inkLuminance.d.ts +38 -0
- package/dist/validation-DEd6EOCP.js +19947 -0
- package/dist/validation-DEd6EOCP.js.map +1 -0
- package/dist/workers/export-worker.bundle.string.d.ts +1 -1
- package/package.json +9 -4
- package/dist/ImportManager-eotl7r5d.js.map +0 -1
- package/dist/ThemeContext-Cl1JPVLZ.js +0 -1158
- package/dist/ThemeContext-Cl1JPVLZ.js.map +0 -1
- package/dist/template-fields-coO73lV3.js +0 -1632
- package/dist/template-fields-coO73lV3.js.map +0 -1
- package/dist/validation-BahKiJWj.js +0 -22973
- package/dist/validation-BahKiJWj.js.map +0 -1
|
@@ -0,0 +1,737 @@
|
|
|
1
|
+
import { C as Ee, e as Re } from "./UnifiedFontService-BAtqqkU4.js";
|
|
2
|
+
import { y as x } from "./HybridHistoryManager-Bht98XRv.js";
|
|
3
|
+
import { jsx as f, jsxs as Q, Fragment as we } from "react/jsx-runtime";
|
|
4
|
+
import { useContext as Z, createContext as ee, useRef as T, useState as O, useMemo as I, useEffect as $, useSyncExternalStore as A, Component as xe, forwardRef as te, useId as ne, useLayoutEffect as re, useCallback as se } from "react";
|
|
5
|
+
import { assertVariantSelected as ie, RenderSession as Se, createCartDetail as Ie } from "@snowcone-app/sdk";
|
|
6
|
+
import { u as Ce, p as Ne } from "./usePieceGuideBundle-CGERAQJl.js";
|
|
7
|
+
import { E as R, i as Te, a as ae } from "./editorError-DMENTZ-3.js";
|
|
8
|
+
import { r as oe } from "./editorErrors-DbIEtCTt.js";
|
|
9
|
+
import { l as X, i as Oe, s as le } from "./template-fields-GOM4MNfq.js";
|
|
10
|
+
import "./EditorContext-CyanYzo2.js";
|
|
11
|
+
import "./CanvasStateV1-C6i6vU6p.js";
|
|
12
|
+
const de = ee(void 0);
|
|
13
|
+
function L() {
|
|
14
|
+
const t = Z(de);
|
|
15
|
+
if (!t)
|
|
16
|
+
throw new Error(
|
|
17
|
+
"useRealtimeMockups / <RealtimeCanvas> / <RealtimeMockup> must be rendered inside <RealtimeEmbed>. Wrap them: <RealtimeEmbed shop=… product=… design=… grantUrl=…>…</RealtimeEmbed>"
|
|
18
|
+
);
|
|
19
|
+
return t;
|
|
20
|
+
}
|
|
21
|
+
const ke = "[RealtimeEmbed]";
|
|
22
|
+
function _e(t) {
|
|
23
|
+
var r, s;
|
|
24
|
+
if ((r = t == null ? void 0 : t.requiredPlacements) != null && r.length)
|
|
25
|
+
return t.requiredPlacements.filter((a) => !a.autoFilledByVariant).map((a) => a.label);
|
|
26
|
+
const e = new Set(
|
|
27
|
+
(((s = t == null ? void 0 : t.options) == null ? void 0 : s.combinations) ?? []).map((a) => a.variantId).filter((a) => typeof a == "string" && a !== "")
|
|
28
|
+
);
|
|
29
|
+
return !!(t != null && t.variantId) || e.size > 1 ? [] : (t == null ? void 0 : t.placements) ?? [];
|
|
30
|
+
}
|
|
31
|
+
function ue({ shop: t, product: e, design: n, hasGrant: r }) {
|
|
32
|
+
var m, d;
|
|
33
|
+
const s = [];
|
|
34
|
+
if (t || s.push({
|
|
35
|
+
severity: "error",
|
|
36
|
+
issue: "missing-shop",
|
|
37
|
+
message: "`shop` is required (your publishable shop id)."
|
|
38
|
+
}), r || s.push({
|
|
39
|
+
severity: "error",
|
|
40
|
+
issue: "missing-grant",
|
|
41
|
+
message: "no grant source — pass `grantUrl` (a proxy to mintRealtimeGrant) or `grant`. Without it the session can never authorize and no mockup renders."
|
|
42
|
+
}), (m = e == null ? void 0 : e.mockupIds) != null && m.length || s.push({
|
|
43
|
+
severity: "error",
|
|
44
|
+
issue: "empty-mockup-ids",
|
|
45
|
+
message: 'product.mockupIds is empty — pass the catalog scene codes (product.mockups[].id) you want rendered, e.g. ["FV1qjO"].'
|
|
46
|
+
}), e != null && e.options)
|
|
47
|
+
try {
|
|
48
|
+
ie(e);
|
|
49
|
+
} catch (c) {
|
|
50
|
+
s.push({
|
|
51
|
+
severity: "error",
|
|
52
|
+
issue: "variant-required",
|
|
53
|
+
message: c instanceof Error ? c.message : String(c)
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const a = n.toJSON(), l = a.activeArtboard, i = _e(e);
|
|
57
|
+
i.length > 1 && s.push({
|
|
58
|
+
severity: "error",
|
|
59
|
+
issue: "multi-placement",
|
|
60
|
+
message: `product ${e.productId} requires placements [${i.join(", ")}] but this embed renders a single placement ("${l}"). The render will time out waiting for the others. This product needs the eject path — see https://developers.snowcone.app/embed-mode#eject.`
|
|
61
|
+
}), (d = e == null ? void 0 : e.placements) != null && d.length && !e.placements.includes(l) && s.push({
|
|
62
|
+
severity: "error",
|
|
63
|
+
issue: "placement-mismatch",
|
|
64
|
+
message: `the design's placement "${l}" is not in product.placements [${e.placements.join(", ")}]. The canvas artboard name and renderState placement must equal a real product placement label, or the server renders a blank mockup. Fix the \`name\` passed to design({ name }).`
|
|
65
|
+
});
|
|
66
|
+
const o = a.elements.map((c) => c.name).filter((c) => !!c), u = o.filter((c, y) => o.indexOf(c) !== y);
|
|
67
|
+
return u.length && s.push({
|
|
68
|
+
severity: "warn",
|
|
69
|
+
issue: "duplicate-layer-names",
|
|
70
|
+
message: `duplicate layer name(s) [${[...new Set(u)].join(", ")}] — useTextBinding(name) / useImageBinding(name) bind to the FIRST match, so a duplicate name makes a control edit the wrong layer. Keep names unique.`
|
|
71
|
+
}), s;
|
|
72
|
+
}
|
|
73
|
+
function $e(t) {
|
|
74
|
+
for (const e of ue(t))
|
|
75
|
+
(e.severity === "error" && e.issue !== "placement-mismatch" ? console.error : console.warn)(`${ke} ${e.message}`);
|
|
76
|
+
}
|
|
77
|
+
function j(t) {
|
|
78
|
+
return t.text;
|
|
79
|
+
}
|
|
80
|
+
function _(t) {
|
|
81
|
+
return t.name;
|
|
82
|
+
}
|
|
83
|
+
class Be {
|
|
84
|
+
constructor(e) {
|
|
85
|
+
this.listeners = /* @__PURE__ */ new Set(), this.getState = () => this.state, this.subscribe = (r) => (this.listeners.add(r), () => this.listeners.delete(r)), this.state = e;
|
|
86
|
+
const n = /* @__PURE__ */ new Map();
|
|
87
|
+
for (const r of e.elements) {
|
|
88
|
+
const s = _(r), a = j(r);
|
|
89
|
+
s && typeof a == "string" && n.set(s, a);
|
|
90
|
+
}
|
|
91
|
+
this.seedTextByName = n;
|
|
92
|
+
}
|
|
93
|
+
/** Replace the whole state (the canvas `onChange` path). */
|
|
94
|
+
setState(e) {
|
|
95
|
+
this.state = e, this.emit();
|
|
96
|
+
}
|
|
97
|
+
/** The seed value of a named text layer (for completeness rule C3). */
|
|
98
|
+
seedTextOf(e) {
|
|
99
|
+
return this.seedTextByName.get(e);
|
|
100
|
+
}
|
|
101
|
+
/** Current text of a named text layer, or undefined when absent. */
|
|
102
|
+
textOf(e) {
|
|
103
|
+
const n = this.state.elements.find((r) => _(r) === e);
|
|
104
|
+
return n ? j(n) : void 0;
|
|
105
|
+
}
|
|
106
|
+
/** Kind of the named layer in the CURRENT state ('text' | 'image' | null
|
|
107
|
+
* for unbindable), or undefined when no layer has the name. */
|
|
108
|
+
layerKindOf(e) {
|
|
109
|
+
const n = this.state.elements.find((r) => _(r) === e);
|
|
110
|
+
return n ? X(n) : void 0;
|
|
111
|
+
}
|
|
112
|
+
/** Names of bindable layers in the current state, for error messages. */
|
|
113
|
+
bindableLayerNames() {
|
|
114
|
+
return this.state.elements.filter((e) => X(e) !== null).map(_).filter((e) => !!e);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Direct write path for `Editor.TextField` when NO canvas is mounted (with
|
|
118
|
+
* one, writes route through the editor command path and arrive back here
|
|
119
|
+
* via `setState`). Immutable update; last-write-wins.
|
|
120
|
+
*/
|
|
121
|
+
updateTextLayer(e, n) {
|
|
122
|
+
let r = !1;
|
|
123
|
+
const s = this.state.elements.map((a) => _(a) !== e ? a : (r = !0, { ...a, text: n }));
|
|
124
|
+
if (!r)
|
|
125
|
+
throw new R(
|
|
126
|
+
"E_LAYER_NOT_FOUND",
|
|
127
|
+
`no layer "${e}" in the current design state. Bindable layers: ${JSON.stringify(this.bindableLayerNames())}.`,
|
|
128
|
+
{ layerName: e, validNames: this.bindableLayerNames(), docSlug: "embed-mode" }
|
|
129
|
+
);
|
|
130
|
+
this.setState({ ...this.state, elements: s });
|
|
131
|
+
}
|
|
132
|
+
/** ≥1 element with visible content (completeness rule C4): non-empty text,
|
|
133
|
+
* an image with a URL, or a shape. */
|
|
134
|
+
hasRenderableElement() {
|
|
135
|
+
return this.state.elements.some((e) => {
|
|
136
|
+
const n = e.transformType;
|
|
137
|
+
if (n === "image") return !!e.imageUrl;
|
|
138
|
+
if (n === "shape" || n === "group" || n === "path") return !0;
|
|
139
|
+
const r = j(e);
|
|
140
|
+
return typeof r == "string" && r.trim().length > 0;
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
emit() {
|
|
144
|
+
for (const e of [...this.listeners]) e();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
class De {
|
|
148
|
+
constructor() {
|
|
149
|
+
this.canvasIds = /* @__PURE__ */ new Set(), this.requirements = /* @__PURE__ */ new Map(), this.textFields = /* @__PURE__ */ new Map(), this.bridge = null, this.listeners = /* @__PURE__ */ new Set(), this.version = 0, this.getVersion = () => this.version, this.subscribe = (e) => (this.listeners.add(e), () => this.listeners.delete(e));
|
|
150
|
+
}
|
|
151
|
+
registerCanvas(e) {
|
|
152
|
+
return this.canvasIds.add(e), this.bump(), () => {
|
|
153
|
+
this.canvasIds.delete(e), this.bump();
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
hasCanvas() {
|
|
157
|
+
return this.canvasIds.size > 0;
|
|
158
|
+
}
|
|
159
|
+
/** Declare that a part is meaningless without a mounted Canvas (ADR-0085 §4
|
|
160
|
+
* table). Validated by Root once per commit. */
|
|
161
|
+
requireCanvas(e, n) {
|
|
162
|
+
return this.requirements.set(e, n), this.bump(), () => {
|
|
163
|
+
this.requirements.delete(e), this.bump();
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/** Run by Root during RENDER, re-triggered by every registry change — by
|
|
167
|
+
* then the whole commit's registrations are in, so there is no race
|
|
168
|
+
* against the lazy chunk (ADR-0085 §4). Throws land in Root's boundary. */
|
|
169
|
+
validate() {
|
|
170
|
+
if (this.canvasIds.size > 1)
|
|
171
|
+
throw new R(
|
|
172
|
+
"E_DUPLICATE_CANVAS",
|
|
173
|
+
"two <Editor.Canvas> parts are mounted under one <Editor.Root>. A Root owns exactly one editable artboard — remove one Canvas, or mount a second <Editor.Root> for a second editor. (Multiple <Editor.Preview> parts ARE valid.)",
|
|
174
|
+
{ docSlug: "embed-mode" }
|
|
175
|
+
);
|
|
176
|
+
if (this.requirements.size > 0 && !this.hasCanvas()) {
|
|
177
|
+
const e = [...new Set(this.requirements.values())];
|
|
178
|
+
throw new R(
|
|
179
|
+
"E_REQUIRES_CANVAS",
|
|
180
|
+
`${e.join(", ")} require${e.length === 1 ? "s" : ""} an <Editor.Canvas> under the same <Editor.Root> — they operate on the editable artboard (selection, editor commands). Mount <Editor.Canvas/>, or remove the part. Canvas-free parts: Editor.Preview, Editor.Buy, Editor.TextField, Editor.Layers.`,
|
|
181
|
+
{ parts: e, docSlug: "embed-mode" }
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
registerTextField(e, n) {
|
|
186
|
+
return this.textFields.set(e, n), this.bump(), () => {
|
|
187
|
+
this.textFields.delete(e), this.bump();
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/** Mounted TextField registrations — Buy's required-layer list (C2/C3).
|
|
191
|
+
* Unmounted (incl. conditionally hidden) fields are absent by construction. */
|
|
192
|
+
getTextFields() {
|
|
193
|
+
return [...this.textFields.values()];
|
|
194
|
+
}
|
|
195
|
+
registerCanvasBridge(e) {
|
|
196
|
+
return this.bridge = e, this.bump(), () => {
|
|
197
|
+
this.bridge === e && (this.bridge = null), this.bump();
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
getCanvasBridge() {
|
|
201
|
+
return this.bridge;
|
|
202
|
+
}
|
|
203
|
+
bump() {
|
|
204
|
+
this.version++;
|
|
205
|
+
for (const e of [...this.listeners]) e();
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const ce = ee(null);
|
|
209
|
+
function G(t) {
|
|
210
|
+
const e = Z(ce);
|
|
211
|
+
if (!e)
|
|
212
|
+
throw new R(
|
|
213
|
+
"E_OUTSIDE_ROOT",
|
|
214
|
+
`<${t}> must be rendered inside <Editor.Root>. Wrap it: <Editor.Root shop={…} product={…} design={…} grantUrl={…}><${t}/></Editor.Root>`,
|
|
215
|
+
{ part: t, docSlug: "embed-mode" }
|
|
216
|
+
);
|
|
217
|
+
return e;
|
|
218
|
+
}
|
|
219
|
+
function Fe(t) {
|
|
220
|
+
return {
|
|
221
|
+
reportInvariant(e) {
|
|
222
|
+
if (Te()) throw e;
|
|
223
|
+
t(e);
|
|
224
|
+
},
|
|
225
|
+
reportRuntimeError(e) {
|
|
226
|
+
oe(e), t(e);
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
const me = 8e3;
|
|
231
|
+
function Ue(t) {
|
|
232
|
+
return `[RealtimeEmbed] No mockup after ${Math.round(me / 1e3)}s. Common causes: a variant product missing \`variantId\` (pass \`product.options\` so the embed can flag it up front), a multi-placement product (the server waits for every required placement but <RealtimeEmbed> sends only "${t}" — pass \`product.requiredPlacements\` so this is flagged at mount; such products need the eject path), an unreachable or non-public asset URL in the design, or the placement "${t}" not existing on the product. The render may still arrive — this is a heads-up, not a failure.`;
|
|
233
|
+
}
|
|
234
|
+
function Ae(t) {
|
|
235
|
+
if ("grantUrl" in t && t.grantUrl)
|
|
236
|
+
return { grantUrl: t.grantUrl };
|
|
237
|
+
const e = t.grant;
|
|
238
|
+
return typeof e == "function" ? { getToken: e } : { getToken: () => Promise.resolve(e) };
|
|
239
|
+
}
|
|
240
|
+
function fe({ error: t, onRetry: e }) {
|
|
241
|
+
const n = ae(t) ? t.code : "EDITOR_ERROR";
|
|
242
|
+
return /* @__PURE__ */ Q(
|
|
243
|
+
"div",
|
|
244
|
+
{
|
|
245
|
+
"data-sc-part": "error",
|
|
246
|
+
role: "alert",
|
|
247
|
+
style: {
|
|
248
|
+
padding: "16px",
|
|
249
|
+
borderRadius: "12px",
|
|
250
|
+
border: "1px solid var(--sc-color-destructive, #b91c1c)",
|
|
251
|
+
background: "var(--sc-color-surface, #fef2f2)",
|
|
252
|
+
color: "var(--sc-color-foreground, #7f1d1d)",
|
|
253
|
+
fontFamily: "ui-sans-serif, system-ui, sans-serif",
|
|
254
|
+
fontSize: "13px",
|
|
255
|
+
lineHeight: 1.5
|
|
256
|
+
},
|
|
257
|
+
children: [
|
|
258
|
+
/* @__PURE__ */ Q("p", { style: { margin: 0, fontWeight: 700 }, children: [
|
|
259
|
+
"Editor failed: ",
|
|
260
|
+
n
|
|
261
|
+
] }),
|
|
262
|
+
/* @__PURE__ */ f("p", { style: { margin: "4px 0 0" }, children: t.message }),
|
|
263
|
+
e ? /* @__PURE__ */ f(
|
|
264
|
+
"button",
|
|
265
|
+
{
|
|
266
|
+
type: "button",
|
|
267
|
+
"data-sc-part": "error-retry",
|
|
268
|
+
onClick: e,
|
|
269
|
+
style: {
|
|
270
|
+
marginTop: "10px",
|
|
271
|
+
padding: "6px 14px",
|
|
272
|
+
borderRadius: "9999px",
|
|
273
|
+
border: "1px solid currentColor",
|
|
274
|
+
background: "transparent",
|
|
275
|
+
color: "inherit",
|
|
276
|
+
font: "inherit",
|
|
277
|
+
fontWeight: 600,
|
|
278
|
+
cursor: "pointer"
|
|
279
|
+
},
|
|
280
|
+
children: "Retry"
|
|
281
|
+
}
|
|
282
|
+
) : null
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
class Le extends xe {
|
|
288
|
+
constructor() {
|
|
289
|
+
super(...arguments), this.state = { caught: null };
|
|
290
|
+
}
|
|
291
|
+
static getDerivedStateFromError(e) {
|
|
292
|
+
return { caught: e };
|
|
293
|
+
}
|
|
294
|
+
componentDidCatch(e) {
|
|
295
|
+
var n;
|
|
296
|
+
oe(e), typeof x < "u" && ((n = x.env) == null ? void 0 : n.NODE_ENV) !== "production" && console.error("[Editor.Root] contained a composition error:", e);
|
|
297
|
+
}
|
|
298
|
+
render() {
|
|
299
|
+
return this.state.caught ? /* @__PURE__ */ f(fe, { error: this.state.caught }) : this.props.children;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
function qe({ reportedError: t, onRetry: e, children: n }) {
|
|
303
|
+
if (t) {
|
|
304
|
+
const r = ae(t) && t.code === "E_CHUNK_LOAD_FAILED";
|
|
305
|
+
return /* @__PURE__ */ f(fe, { error: t, onRetry: r ? e : void 0 });
|
|
306
|
+
}
|
|
307
|
+
return /* @__PURE__ */ f(Le, { reportedError: null, onRetry: e, children: n });
|
|
308
|
+
}
|
|
309
|
+
function Me(t) {
|
|
310
|
+
const {
|
|
311
|
+
shop: e,
|
|
312
|
+
product: n,
|
|
313
|
+
design: r,
|
|
314
|
+
throttleMs: s = 200,
|
|
315
|
+
onMockups: a,
|
|
316
|
+
onRenderError: l,
|
|
317
|
+
wsUrl: i,
|
|
318
|
+
services: o,
|
|
319
|
+
children: u,
|
|
320
|
+
internals: m,
|
|
321
|
+
__validation: d = "throw"
|
|
322
|
+
} = t, c = I(() => r.toJSON().activeArtboard, [r]), y = Ce(n.variantId ?? n.defaultGvid), g = I(() => {
|
|
323
|
+
if (!y) return null;
|
|
324
|
+
const h = r.toJSON().artboards[0];
|
|
325
|
+
return Ne(y, h) ?? null;
|
|
326
|
+
}, [y, r]), b = T(a), p = T(l);
|
|
327
|
+
b.current = a, p.current = l;
|
|
328
|
+
const [S, q] = O([]), [C, N] = O(!0), [H, B] = O(null), M = !!("grantUrl" in t && t.grantUrl || "grant" in t && t.grant), V = Ae(t), ye = "grantUrl" in V ? V.grantUrl : "getToken", W = `${n.productId}|${n.mockupIds.join(",")}|${n.variantId ?? ""}`, D = `${e}|${W}|${c}|${M}`;
|
|
329
|
+
I(() => {
|
|
330
|
+
var E;
|
|
331
|
+
if (d !== "throw") return;
|
|
332
|
+
const h = ue({ shop: e, product: n, design: r, hasGrant: M }), v = h.find((k) => k.severity === "error");
|
|
333
|
+
if (v)
|
|
334
|
+
throw new R("E_EMBED_CONFIG", v.message, {
|
|
335
|
+
issue: v.issue,
|
|
336
|
+
docSlug: "embed-mode"
|
|
337
|
+
});
|
|
338
|
+
for (const k of h)
|
|
339
|
+
typeof x < "u" && ((E = x.env) == null ? void 0 : E.NODE_ENV) !== "production" && console.warn(`[Editor.Root] ${k.message}`);
|
|
340
|
+
}, [D, d]);
|
|
341
|
+
const z = T(null);
|
|
342
|
+
$(() => {
|
|
343
|
+
var h;
|
|
344
|
+
if (d === "warn" && typeof x < "u" && ((h = x.env) == null ? void 0 : h.NODE_ENV) !== "production") {
|
|
345
|
+
if (z.current === D) return;
|
|
346
|
+
z.current = D, $e({ shop: e, product: n, design: r, hasGrant: M });
|
|
347
|
+
}
|
|
348
|
+
}, [D, d]);
|
|
349
|
+
const F = I(
|
|
350
|
+
() => {
|
|
351
|
+
try {
|
|
352
|
+
return { session: new Se({ shop: e, product: n, wsUrl: i, ...V }) };
|
|
353
|
+
} catch (h) {
|
|
354
|
+
return { error: h instanceof Error ? h.message : String(h) };
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
358
|
+
[e, W, c, i, ye]
|
|
359
|
+
), w = "session" in F ? F.session : null, U = "error" in F ? F.error : null, P = I(() => (h, v = s) => {
|
|
360
|
+
w && (B(null), N(!0), w.renderState(c, h, v).catch((E) => {
|
|
361
|
+
var Y;
|
|
362
|
+
const k = E instanceof Error ? E.message : String(E);
|
|
363
|
+
B(k), N(!1), (Y = p.current) == null || Y.call(p, k);
|
|
364
|
+
}));
|
|
365
|
+
}, [w, c, s]);
|
|
366
|
+
$(() => {
|
|
367
|
+
var h;
|
|
368
|
+
if (U) {
|
|
369
|
+
B(U), N(!1), (h = p.current) == null || h.call(p, U);
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
if (w)
|
|
373
|
+
return w.onMockups((v) => {
|
|
374
|
+
var E;
|
|
375
|
+
q(v), N(!1), (E = b.current) == null || E.call(b, v);
|
|
376
|
+
}), w.onError((v) => {
|
|
377
|
+
var E;
|
|
378
|
+
B(v), N(!1), (E = p.current) == null || E.call(p, v);
|
|
379
|
+
}), P(r.toServerRequest()), () => w.close();
|
|
380
|
+
}, [w, U]), $(() => {
|
|
381
|
+
var v;
|
|
382
|
+
if (!C || typeof x > "u" || ((v = x.env) == null ? void 0 : v.NODE_ENV) === "production") return;
|
|
383
|
+
const h = setTimeout(() => console.warn(Ue(c)), me);
|
|
384
|
+
return () => clearTimeout(h);
|
|
385
|
+
}, [C, c]);
|
|
386
|
+
const ve = I(
|
|
387
|
+
() => ({
|
|
388
|
+
session: w,
|
|
389
|
+
design: r,
|
|
390
|
+
placement: c,
|
|
391
|
+
product: n,
|
|
392
|
+
mockups: S,
|
|
393
|
+
isRendering: C,
|
|
394
|
+
error: H,
|
|
395
|
+
throttleMs: s,
|
|
396
|
+
pieceGuides: g,
|
|
397
|
+
pushRender: P,
|
|
398
|
+
stateStore: m.store
|
|
399
|
+
}),
|
|
400
|
+
[w, r, c, n, S, C, H, s, g, P, m.store]
|
|
401
|
+
), be = A(
|
|
402
|
+
m.registry.subscribe,
|
|
403
|
+
m.registry.getVersion,
|
|
404
|
+
m.registry.getVersion
|
|
405
|
+
);
|
|
406
|
+
I(() => m.registry.validate(), [m.registry, be]);
|
|
407
|
+
const J = /* @__PURE__ */ f(ce.Provider, { value: m, children: /* @__PURE__ */ f(de.Provider, { value: ve, children: u }) });
|
|
408
|
+
return o ? /* @__PURE__ */ f(Ee, { services: o, children: J }) : J;
|
|
409
|
+
}
|
|
410
|
+
function he(t) {
|
|
411
|
+
const { design: e } = t, n = T(null), [r, s] = O(null);
|
|
412
|
+
(n.current === null || n.current.design !== e) && (n.current = {
|
|
413
|
+
design: e,
|
|
414
|
+
internals: {
|
|
415
|
+
store: new Be(e.toJSON()),
|
|
416
|
+
registry: new De()
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
const a = I(
|
|
420
|
+
() => ({
|
|
421
|
+
...n.current.internals,
|
|
422
|
+
...Fe(s)
|
|
423
|
+
}),
|
|
424
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
425
|
+
[n.current.internals]
|
|
426
|
+
);
|
|
427
|
+
return (
|
|
428
|
+
// `display: contents` — the .sc-root scope without a layout box, so the
|
|
429
|
+
// host's grid/flex sees the parts directly (and the legacy RealtimeEmbed
|
|
430
|
+
// wrapper, which had no DOM at all, stays layout-identical).
|
|
431
|
+
/* @__PURE__ */ f("div", { className: "sc-root", style: { display: "contents" }, "data-sc-part": "root", children: /* @__PURE__ */ f(qe, { reportedError: r, onRetry: () => s(null), children: /* @__PURE__ */ f(Me, { ...t, internals: a }) }) })
|
|
432
|
+
);
|
|
433
|
+
}
|
|
434
|
+
let Ve = () => import("./EditorCanvasImpl-DkgE5-C2.js").then((t) => t.EditorCanvasImpl);
|
|
435
|
+
function ge() {
|
|
436
|
+
return Ve();
|
|
437
|
+
}
|
|
438
|
+
const Pe = te(function({ children: e, maxHeight: n, className: r, style: s }, a) {
|
|
439
|
+
const l = G("Editor.Canvas"), i = ne();
|
|
440
|
+
re(() => l.registry.registerCanvas(i), [l.registry, i]);
|
|
441
|
+
const [o, u] = O(null);
|
|
442
|
+
return $(() => {
|
|
443
|
+
let m = !1;
|
|
444
|
+
return ge().then(
|
|
445
|
+
(d) => {
|
|
446
|
+
m || u(() => d);
|
|
447
|
+
},
|
|
448
|
+
(d) => {
|
|
449
|
+
m || l.reportRuntimeError(
|
|
450
|
+
new R(
|
|
451
|
+
"E_CHUNK_LOAD_FAILED",
|
|
452
|
+
`the editor's rendering chunk failed to load (${d instanceof Error ? d.message : String(d)}). This is a network/CDN failure, not a composition mistake — retry, or check the deployment serves the @snowcone-app/canvas lazy chunks.`,
|
|
453
|
+
{ cause: d instanceof Error ? d.message : String(d), docSlug: "embed-mode" }
|
|
454
|
+
)
|
|
455
|
+
);
|
|
456
|
+
}
|
|
457
|
+
), () => {
|
|
458
|
+
m = !0;
|
|
459
|
+
};
|
|
460
|
+
}, [l]), o ? /* @__PURE__ */ f(o, { ref: a, kit: "embed-only", partAttr: "canvas", maxHeight: n, className: r, style: s, children: e }) : /* @__PURE__ */ f(
|
|
461
|
+
"div",
|
|
462
|
+
{
|
|
463
|
+
"data-sc-part": "canvas",
|
|
464
|
+
"data-sc-state": "loading",
|
|
465
|
+
className: r,
|
|
466
|
+
style: { minHeight: n ?? 200, ...s },
|
|
467
|
+
"aria-busy": "true"
|
|
468
|
+
}
|
|
469
|
+
);
|
|
470
|
+
}), je = 1.2, K = [1200, 1400, 1600, 1800, 2e3, 2500, 3e3, 4e3];
|
|
471
|
+
function Ke(t) {
|
|
472
|
+
for (const e of K)
|
|
473
|
+
if (e >= t) return e;
|
|
474
|
+
return K[K.length - 1];
|
|
475
|
+
}
|
|
476
|
+
function Ge(t, e) {
|
|
477
|
+
if (!(t > 0) || !(e > 0) || e <= t * je) return null;
|
|
478
|
+
const n = Ke(e);
|
|
479
|
+
return `[RealtimeMockup] mockup rendered at ${t}px but displayed at ~${e} device px — the preview will look soft. Pass \`product.width\` (e.g. ${n}) on the embed for a crisp preview.`;
|
|
480
|
+
}
|
|
481
|
+
function pe({
|
|
482
|
+
mockupId: t,
|
|
483
|
+
fallback: e = null,
|
|
484
|
+
alt: n = "Live product mockup",
|
|
485
|
+
className: r,
|
|
486
|
+
style: s
|
|
487
|
+
}) {
|
|
488
|
+
const { mockups: a } = L(), l = T(/* @__PURE__ */ new Set()), i = t ? a.find((u) => u.mockupId === t && u.imageUrl) : a.find((u) => u.imageUrl);
|
|
489
|
+
if (!(i != null && i.imageUrl))
|
|
490
|
+
return /* @__PURE__ */ f(we, { children: e });
|
|
491
|
+
const o = (u) => {
|
|
492
|
+
var g;
|
|
493
|
+
if (typeof x > "u" || ((g = x.env) == null ? void 0 : g.NODE_ENV) === "production" || typeof window > "u" || l.current.has(i.mockupId)) return;
|
|
494
|
+
const m = u.currentTarget, d = m.getBoundingClientRect().width;
|
|
495
|
+
if (d <= 0) return;
|
|
496
|
+
const c = Math.round(d * (window.devicePixelRatio || 1)), y = Ge(m.naturalWidth, c);
|
|
497
|
+
y && (l.current.add(i.mockupId), console.warn(y));
|
|
498
|
+
};
|
|
499
|
+
return (
|
|
500
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
501
|
+
/* @__PURE__ */ f(
|
|
502
|
+
"img",
|
|
503
|
+
{
|
|
504
|
+
"data-sc-part": "preview",
|
|
505
|
+
src: i.imageUrl,
|
|
506
|
+
alt: n,
|
|
507
|
+
className: r,
|
|
508
|
+
style: s,
|
|
509
|
+
onLoad: o
|
|
510
|
+
}
|
|
511
|
+
)
|
|
512
|
+
);
|
|
513
|
+
}
|
|
514
|
+
function He(t) {
|
|
515
|
+
const { layer: e, optional: n = !1, placeholder: r, className: s, style: a } = t, l = G("Editor.TextField"), { pushRender: i, throttleMs: o, stateStore: u } = L(), m = ne(), d = T(null);
|
|
516
|
+
if (!Oe(e))
|
|
517
|
+
throw new R(
|
|
518
|
+
"E_LAYER_TOKEN_REQUIRED",
|
|
519
|
+
`the \`layer\` prop must be a token minted by the design — pass layer={design.layer("name")}, not ${typeof e == "string" ? `the bare string "${e}"` : "a plain value"}. Tokens validate the name against the design's layers at mint time.`,
|
|
520
|
+
{ received: typeof e == "string" ? e : typeof e, docSlug: "embed-mode" }
|
|
521
|
+
);
|
|
522
|
+
if (d.current !== e.name) {
|
|
523
|
+
const g = u.layerKindOf(e.name);
|
|
524
|
+
if (g === void 0)
|
|
525
|
+
throw new R(
|
|
526
|
+
"E_LAYER_NOT_FOUND",
|
|
527
|
+
`no layer "${e.name}" in this Root's design — the token was minted from a different design than the one passed to <Editor.Root design={…}>. Bindable layers here: ${JSON.stringify(u.bindableLayerNames())}.`,
|
|
528
|
+
{ layerName: e.name, validNames: u.bindableLayerNames(), docSlug: "embed-mode" }
|
|
529
|
+
);
|
|
530
|
+
if (g !== "text")
|
|
531
|
+
throw new R(
|
|
532
|
+
"E_LAYER_WRONG_KIND",
|
|
533
|
+
`layer "${e.name}" is ${g === null ? "not a bindable kind" : `an ${g} layer`} — <Editor.TextField> binds text layers only.`,
|
|
534
|
+
{ layerName: e.name, actualKind: g, docSlug: "embed-mode" }
|
|
535
|
+
);
|
|
536
|
+
d.current = e.name;
|
|
537
|
+
}
|
|
538
|
+
re(() => l.registry.registerTextField(m, { name: e.name, optional: n }), [l.registry, m, e.name, n]);
|
|
539
|
+
const c = A(
|
|
540
|
+
u.subscribe,
|
|
541
|
+
() => u.textOf(e.name) ?? "",
|
|
542
|
+
() => u.textOf(e.name) ?? ""
|
|
543
|
+
), y = se(
|
|
544
|
+
(g) => {
|
|
545
|
+
const b = g.target.value, p = l.registry.getCanvasBridge();
|
|
546
|
+
if (p) {
|
|
547
|
+
p.setTextByName(e.name, b) || l.reportInvariant(
|
|
548
|
+
new R(
|
|
549
|
+
"E_LAYER_NOT_FOUND",
|
|
550
|
+
`layer "${e.name}" no longer exists in the mounted canvas — it was removed or renamed after this <Editor.TextField> bound to it. Bound layers must not be renamed or deleted while a field is mounted (ADR-0085 §3).`,
|
|
551
|
+
{ layerName: e.name, docSlug: "embed-mode" }
|
|
552
|
+
)
|
|
553
|
+
);
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
u.updateTextLayer(e.name, b), i(le(u.getState()), o);
|
|
557
|
+
},
|
|
558
|
+
[l, e.name, u, i, o]
|
|
559
|
+
);
|
|
560
|
+
return /* @__PURE__ */ f(
|
|
561
|
+
"input",
|
|
562
|
+
{
|
|
563
|
+
"data-sc-part": "textfield",
|
|
564
|
+
"data-sc-layer": e.name,
|
|
565
|
+
type: "text",
|
|
566
|
+
value: c,
|
|
567
|
+
onChange: y,
|
|
568
|
+
placeholder: r,
|
|
569
|
+
"aria-label": t["aria-label"] ?? e.name,
|
|
570
|
+
className: s,
|
|
571
|
+
style: a
|
|
572
|
+
}
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
function We(t) {
|
|
576
|
+
const e = [];
|
|
577
|
+
if (t.product.options)
|
|
578
|
+
try {
|
|
579
|
+
ie(t.product);
|
|
580
|
+
} catch {
|
|
581
|
+
e.push("variant");
|
|
582
|
+
}
|
|
583
|
+
for (const n of t.textFields) {
|
|
584
|
+
if (n.optional) continue;
|
|
585
|
+
const r = (t.textOf(n.name) ?? "").trim();
|
|
586
|
+
if (r.length === 0) {
|
|
587
|
+
e.push(`layer:${n.name}`);
|
|
588
|
+
continue;
|
|
589
|
+
}
|
|
590
|
+
const s = (t.seedTextOf(n.name) ?? "").trim();
|
|
591
|
+
s.length > 0 && r === s && e.push(`layer-seed:${n.name}`);
|
|
592
|
+
}
|
|
593
|
+
return t.hasRenderableElement || e.push("empty-design"), (!Number.isInteger(t.quantity) || t.quantity < 1) && e.push("quantity"), e;
|
|
594
|
+
}
|
|
595
|
+
function ze(t, e) {
|
|
596
|
+
const n = t.options, r = n == null ? void 0 : n.combinations;
|
|
597
|
+
if (!n || !(r != null && r.length)) return null;
|
|
598
|
+
const s = r.find((i) => i.variantId && i.variantId === t.variantId) ?? r[0];
|
|
599
|
+
if (!s) return null;
|
|
600
|
+
const a = {};
|
|
601
|
+
for (const [i, o] of Object.entries(s))
|
|
602
|
+
i === "variantId" || i === "price" || (typeof o == "string" ? a[i] = o : typeof o == "number" && (a[i] = String(o)));
|
|
603
|
+
const l = Object.fromEntries(
|
|
604
|
+
Object.keys(a).map((i) => [
|
|
605
|
+
i,
|
|
606
|
+
{ key: i, affectsCombinations: !0, choices: [...new Set(r.map((o) => String(o[i] ?? "")))] }
|
|
607
|
+
])
|
|
608
|
+
);
|
|
609
|
+
return Ie({
|
|
610
|
+
productId: t.productId,
|
|
611
|
+
quantity: e,
|
|
612
|
+
selection: a,
|
|
613
|
+
combinations: r,
|
|
614
|
+
attributes: l
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
function Je(t) {
|
|
618
|
+
const { onAddToCart: e, quantity: n = 1, children: r, className: s, style: a } = t, l = G("Editor.Buy"), { product: i, stateStore: o } = L();
|
|
619
|
+
if (!(i != null && i.productId))
|
|
620
|
+
throw new R(
|
|
621
|
+
"E_BUY_NO_PRODUCT",
|
|
622
|
+
"<Editor.Buy> has no product context — pass `product` (with `productId`) on <Editor.Root product={…}>. Buy assembles its cart payload from the Root product and the live design state.",
|
|
623
|
+
{ docSlug: "embed-mode" }
|
|
624
|
+
);
|
|
625
|
+
const u = A(o.subscribe, o.getState, o.getState), m = A(
|
|
626
|
+
l.registry.subscribe,
|
|
627
|
+
l.registry.getVersion,
|
|
628
|
+
l.registry.getVersion
|
|
629
|
+
), d = I(
|
|
630
|
+
() => We({
|
|
631
|
+
product: i,
|
|
632
|
+
quantity: n,
|
|
633
|
+
textFields: l.registry.getTextFields(),
|
|
634
|
+
textOf: (S) => o.textOf(S),
|
|
635
|
+
seedTextOf: (S) => o.seedTextOf(S),
|
|
636
|
+
hasRenderableElement: o.hasRenderableElement()
|
|
637
|
+
}),
|
|
638
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
639
|
+
[i, n, u, m]
|
|
640
|
+
), c = d.length === 0, [y, g] = O(!1), b = T(!1), p = se(() => {
|
|
641
|
+
if (b.current || !c) return;
|
|
642
|
+
b.current = !0, g(!0);
|
|
643
|
+
const S = o.getState(), q = {
|
|
644
|
+
productId: i.productId,
|
|
645
|
+
...i.variantId ? { variantId: i.variantId } : {},
|
|
646
|
+
quantity: n,
|
|
647
|
+
cartDetail: ze(i, n),
|
|
648
|
+
designState: S,
|
|
649
|
+
serverRequest: le(S)
|
|
650
|
+
};
|
|
651
|
+
let C;
|
|
652
|
+
try {
|
|
653
|
+
C = e(q);
|
|
654
|
+
} catch (N) {
|
|
655
|
+
throw b.current = !1, g(!1), N;
|
|
656
|
+
}
|
|
657
|
+
Promise.resolve(C).finally(() => {
|
|
658
|
+
b.current = !1, g(!1);
|
|
659
|
+
});
|
|
660
|
+
}, [c, i, n, o, e]);
|
|
661
|
+
return /* @__PURE__ */ f(
|
|
662
|
+
"button",
|
|
663
|
+
{
|
|
664
|
+
type: "button",
|
|
665
|
+
"data-sc-part": "buy",
|
|
666
|
+
"data-sc-buy-state": y ? "busy" : c ? "ready" : "incomplete",
|
|
667
|
+
"data-sc-buy-missing": d.join(",") || void 0,
|
|
668
|
+
disabled: !c || y,
|
|
669
|
+
"aria-busy": y || void 0,
|
|
670
|
+
onClick: p,
|
|
671
|
+
className: s,
|
|
672
|
+
style: a,
|
|
673
|
+
children: r ?? "Add to cart"
|
|
674
|
+
}
|
|
675
|
+
);
|
|
676
|
+
}
|
|
677
|
+
const ot = {
|
|
678
|
+
/** The one provider boundary — session, design, live state, error boundary. */
|
|
679
|
+
Root: he,
|
|
680
|
+
/** The editable artboard (the ONE lazy renderer boundary — D9). */
|
|
681
|
+
Canvas: Pe,
|
|
682
|
+
/** Live product mockup. ×N under one Root is valid. */
|
|
683
|
+
Preview: pe,
|
|
684
|
+
/** Form input bound to a design text layer by typed token (T1). */
|
|
685
|
+
TextField: He,
|
|
686
|
+
/** Smart commerce part: completeness + payload assembly; submit = host callback. */
|
|
687
|
+
Buy: Je
|
|
688
|
+
};
|
|
689
|
+
function lt(t) {
|
|
690
|
+
return /* @__PURE__ */ f(he, { ...t, __validation: "warn" });
|
|
691
|
+
}
|
|
692
|
+
const dt = te(
|
|
693
|
+
function(e, n) {
|
|
694
|
+
const { children: r, className: s, style: a, maxHeight: l, ...i } = e, [o, u] = O(null);
|
|
695
|
+
return $(() => {
|
|
696
|
+
let m = !1;
|
|
697
|
+
return ge().then(
|
|
698
|
+
(d) => {
|
|
699
|
+
m || u(() => d);
|
|
700
|
+
},
|
|
701
|
+
(d) => {
|
|
702
|
+
console.error("[RealtimeCanvas] failed to load the rendering chunk:", d);
|
|
703
|
+
}
|
|
704
|
+
), () => {
|
|
705
|
+
m = !0;
|
|
706
|
+
};
|
|
707
|
+
}, []), o ? /* @__PURE__ */ f(o, { ref: n, selfScope: !0, maxHeight: l, className: s, style: a, ...i, children: r }) : /* @__PURE__ */ f(
|
|
708
|
+
"div",
|
|
709
|
+
{
|
|
710
|
+
className: `sc-root${s ? ` ${s}` : ""}`,
|
|
711
|
+
style: { minHeight: l ?? 200, ...a },
|
|
712
|
+
"aria-busy": "true"
|
|
713
|
+
}
|
|
714
|
+
);
|
|
715
|
+
}
|
|
716
|
+
);
|
|
717
|
+
function ut(t) {
|
|
718
|
+
return /* @__PURE__ */ f(pe, { ...t });
|
|
719
|
+
}
|
|
720
|
+
function ct() {
|
|
721
|
+
const { mockups: t, isRendering: e, error: n } = L();
|
|
722
|
+
return { mockups: t, isRendering: e, error: n };
|
|
723
|
+
}
|
|
724
|
+
Re();
|
|
725
|
+
export {
|
|
726
|
+
Be as D,
|
|
727
|
+
ce as E,
|
|
728
|
+
dt as R,
|
|
729
|
+
ot as a,
|
|
730
|
+
lt as b,
|
|
731
|
+
ut as c,
|
|
732
|
+
ue as d,
|
|
733
|
+
ct as e,
|
|
734
|
+
L as u,
|
|
735
|
+
$e as v
|
|
736
|
+
};
|
|
737
|
+
//# sourceMappingURL=embed-Bdj4PKUA.js.map
|