webim-adapter 0.1.0 → 0.2.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/build/webim-adapter.js +286 -228
- package/build/webim-embed.js +10 -8
- package/build/webim-ssr.js +288 -230
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -26,55 +26,55 @@ function f(e) {
|
|
|
26
26
|
f,
|
|
27
27
|
p
|
|
28
28
|
].some((e) => e !== void 0) && m.push(`${u(s ?? 0)} ${u(c ?? 0)} ${u(f ?? 0)} ${p || "rgba(0, 0, 0, 0.35)"}`), m.length && (t.textShadow = m.join(", "));
|
|
29
|
-
let h = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, g = (e) => e.type === "move" ? `translate(${u(e.x ?? 0)}, ${u(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${h(e.a ?? 0)})` : e.type === "skew" ? `skew(${h(e.x ?? 0)}, ${h(e.y ?? 0)})` : null, { transforms: _, translateX: v, translateY: y, scale: b, rotate: x, skewX: S, skewY:
|
|
29
|
+
let h = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, g = (e) => e.type === "move" ? `translate(${u(e.x ?? 0)}, ${u(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${h(e.a ?? 0)})` : e.type === "skew" ? `skew(${h(e.x ?? 0)}, ${h(e.y ?? 0)})` : null, { transforms: _, translateX: v, translateY: y, scale: b, rotate: x, skewX: S, skewY: ee } = t;
|
|
30
30
|
delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
|
|
31
|
-
let
|
|
32
|
-
(v !== void 0 || y !== void 0) &&
|
|
33
|
-
let
|
|
31
|
+
let C = (Array.isArray(_) ? _ : []).filter((e) => e && e.on !== !1).map(g).filter(Boolean);
|
|
32
|
+
(v !== void 0 || y !== void 0) && C.push(`translate(${u(v ?? 0)}, ${u(y ?? 0)})`), b !== void 0 && C.push(`scale(${b})`), x !== void 0 && C.push(`rotate(${h(x)})`), (S !== void 0 || ee !== void 0) && C.push(`skew(${h(S ?? 0)}, ${h(ee ?? 0)})`), C.length && (t.transform = C.join(" "));
|
|
33
|
+
let w = (e) => `${e.inset ? "inset " : ""}${u(e.x ?? 0)} ${u(e.y ?? 0)} ${u(e.blur ?? 0)} ${u(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: T, boxShadowX: E, boxShadowY: D, boxShadowBlur: O, boxShadowSpread: k, boxShadowColor: A, boxShadowInset: j } = t;
|
|
34
34
|
delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
|
|
35
|
-
let
|
|
35
|
+
let M = (Array.isArray(T) ? T : []).filter((e) => e && e.on !== !1).map(w);
|
|
36
36
|
[
|
|
37
|
+
E,
|
|
37
38
|
D,
|
|
38
39
|
O,
|
|
39
40
|
k,
|
|
40
41
|
A,
|
|
41
|
-
j
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}))
|
|
51
|
-
let ee = (e) => e.type === "blur" ? `blur(${u(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, te = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(ee), { filters: ne, backdropFilters: re, filterBlur: P, filterGrayscale: F, filterBrightness: I, filterContrast: L, filterSaturate: R } = t;
|
|
42
|
+
j
|
|
43
|
+
].some((e) => e !== void 0) && M.push(w({
|
|
44
|
+
x: E,
|
|
45
|
+
y: D,
|
|
46
|
+
blur: O,
|
|
47
|
+
spread: k,
|
|
48
|
+
color: A,
|
|
49
|
+
inset: j
|
|
50
|
+
})), M.length && (t.boxShadow = M.join(", "));
|
|
51
|
+
let te = (e) => e.type === "blur" ? `blur(${u(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, N = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(te), { filters: ne, backdropFilters: re, filterBlur: P, filterGrayscale: F, filterBrightness: I, filterContrast: L, filterSaturate: R } = t;
|
|
52
52
|
delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
|
|
53
|
-
let z =
|
|
53
|
+
let z = N(ne);
|
|
54
54
|
P !== void 0 && z.push(`blur(${u(P)})`), F !== void 0 && z.push(`grayscale(${F}%)`), I !== void 0 && z.push(`brightness(${I}%)`), L !== void 0 && z.push(`contrast(${L}%)`), R !== void 0 && z.push(`saturate(${R}%)`), z.length && (t.filter = z.join(" "));
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
let { textStrokeWidth:
|
|
58
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
59
|
-
let { clipText:
|
|
60
|
-
delete t.clipText,
|
|
61
|
-
let { transitions:
|
|
55
|
+
let B = N(re);
|
|
56
|
+
B.length && (t.backdropFilter = B.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
57
|
+
let { textStrokeWidth: V, textStrokeColor: H } = t;
|
|
58
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (V !== void 0 || H !== void 0) && (t.WebkitTextStroke = `${u(V ?? 1)} ${H || "currentColor"}`);
|
|
59
|
+
let { clipText: ie } = t;
|
|
60
|
+
delete t.clipText, ie && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
61
|
+
let { transitions: U, transitionDuration: W, transitionEasing: G, transitionProperty: ae } = t, K = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
62
62
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
63
|
-
let
|
|
64
|
-
if (
|
|
63
|
+
let q = (Array.isArray(U) ? U : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${K(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
64
|
+
if (W !== void 0 && q.push(`${ae || "all"} ${K(W)} ${G || "ease"}`), q.length && (t.transition = q.join(", ")), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
65
65
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
66
66
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
67
67
|
}
|
|
68
68
|
delete t.backgroundVideo;
|
|
69
|
-
let { overlayColor:
|
|
70
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
71
|
-
let e = `color-mix(in srgb, ${
|
|
69
|
+
let { overlayColor: J, overlayOpacity: Y } = t;
|
|
70
|
+
if (delete t.overlayColor, delete t.overlayOpacity, J) {
|
|
71
|
+
let e = `color-mix(in srgb, ${J} ${Y ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
72
72
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
73
73
|
}
|
|
74
74
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
75
|
-
let { backgroundLayers:
|
|
75
|
+
let { backgroundLayers: oe } = t;
|
|
76
76
|
delete t.backgroundLayers;
|
|
77
|
-
let X = (Array.isArray(
|
|
77
|
+
let X = (Array.isArray(oe) ? oe : []).filter((e) => e && e.on !== !1);
|
|
78
78
|
if (X.length) {
|
|
79
79
|
let e = [], n = [], r = [], i = [], a = [];
|
|
80
80
|
for (let t of X) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
@@ -117,7 +117,38 @@ function v(e, t, n, r = !1) {
|
|
|
117
117
|
function y(e, t, n) {
|
|
118
118
|
return Object.entries(p).map(([r, i]) => v(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
119
119
|
}
|
|
120
|
-
|
|
120
|
+
var b = [
|
|
121
|
+
{
|
|
122
|
+
key: "tablet",
|
|
123
|
+
max: 991
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
key: "mobileLandscape",
|
|
127
|
+
max: 767
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
key: "mobile",
|
|
131
|
+
max: 478
|
|
132
|
+
}
|
|
133
|
+
], x = (e) => Object.entries(f(e)).map(([e, t]) => `${_(e)}: ${t} !important;`).join(" ");
|
|
134
|
+
function S(e, t) {
|
|
135
|
+
return b.map(({ key: n, max: r }) => {
|
|
136
|
+
let i = t?.[n] ? x(t[n]) : "";
|
|
137
|
+
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
138
|
+
}).filter(Boolean).join("\n");
|
|
139
|
+
}
|
|
140
|
+
function ee(e, t) {
|
|
141
|
+
let n = [], r = (e) => {
|
|
142
|
+
for (let [t, r] of Object.entries(e || {})) {
|
|
143
|
+
let e = S(t, r.props);
|
|
144
|
+
e && n.push(e);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
r(e);
|
|
148
|
+
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
149
|
+
return n.join("\n");
|
|
150
|
+
}
|
|
151
|
+
function C(e, t) {
|
|
121
152
|
let n = [], r = (e) => {
|
|
122
153
|
for (let [t, r] of Object.entries(e || {})) {
|
|
123
154
|
let e = y(t, r.props);
|
|
@@ -128,7 +159,7 @@ function b(e, t) {
|
|
|
128
159
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
129
160
|
return n.join("\n");
|
|
130
161
|
}
|
|
131
|
-
var
|
|
162
|
+
var w = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", T = {
|
|
132
163
|
light: {
|
|
133
164
|
background: "#ffffff",
|
|
134
165
|
text: "#111827",
|
|
@@ -165,23 +196,23 @@ var x = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
165
196
|
contrastText: "#052e2b"
|
|
166
197
|
}
|
|
167
198
|
}
|
|
168
|
-
},
|
|
199
|
+
}, E = {
|
|
169
200
|
font: "system",
|
|
170
201
|
headingFont: "inherit",
|
|
171
|
-
light:
|
|
172
|
-
dark:
|
|
173
|
-
},
|
|
202
|
+
light: T.light,
|
|
203
|
+
dark: T.dark
|
|
204
|
+
}, D = {
|
|
174
205
|
system: {
|
|
175
206
|
label: "System",
|
|
176
|
-
value:
|
|
207
|
+
value: w
|
|
177
208
|
},
|
|
178
209
|
inter: {
|
|
179
210
|
label: "Inter",
|
|
180
|
-
value: `"Inter", ${
|
|
211
|
+
value: `"Inter", ${w}`
|
|
181
212
|
},
|
|
182
213
|
outfit: {
|
|
183
214
|
label: "Outfit",
|
|
184
|
-
value: `"Outfit", ${
|
|
215
|
+
value: `"Outfit", ${w}`
|
|
185
216
|
},
|
|
186
217
|
serif: {
|
|
187
218
|
label: "Serif",
|
|
@@ -191,7 +222,7 @@ var x = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
191
222
|
label: "Mono",
|
|
192
223
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
193
224
|
}
|
|
194
|
-
},
|
|
225
|
+
}, O = (e, t) => D[e]?.value ?? t, k = (e, ...t) => {
|
|
195
226
|
let n = Object.assign({}, e, ...t);
|
|
196
227
|
return n.primary = {
|
|
197
228
|
...e.primary,
|
|
@@ -207,16 +238,16 @@ var x = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
207
238
|
}), {})
|
|
208
239
|
}, n;
|
|
209
240
|
};
|
|
210
|
-
function
|
|
241
|
+
function A(e) {
|
|
211
242
|
let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
|
|
212
243
|
return {
|
|
213
|
-
font: r ??
|
|
214
|
-
headingFont: i ??
|
|
215
|
-
light:
|
|
216
|
-
dark:
|
|
244
|
+
font: r ?? E.font,
|
|
245
|
+
headingFont: i ?? E.headingFont,
|
|
246
|
+
light: k(T.light, a, t),
|
|
247
|
+
dark: k(T.dark, n)
|
|
217
248
|
};
|
|
218
249
|
}
|
|
219
|
-
function
|
|
250
|
+
function j(e) {
|
|
220
251
|
return {
|
|
221
252
|
"--page-bg": e.background,
|
|
222
253
|
"--page-text": e.text,
|
|
@@ -232,28 +263,28 @@ function O(e) {
|
|
|
232
263
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
233
264
|
};
|
|
234
265
|
}
|
|
235
|
-
function
|
|
236
|
-
let t =
|
|
266
|
+
function M(e) {
|
|
267
|
+
let t = A(e);
|
|
237
268
|
return {
|
|
238
269
|
backgroundColor: "var(--page-bg)",
|
|
239
270
|
color: "var(--page-text)",
|
|
240
|
-
fontFamily:
|
|
241
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
271
|
+
fontFamily: O(t.font, w),
|
|
272
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : O(t.headingFont, "inherit")
|
|
242
273
|
};
|
|
243
274
|
}
|
|
244
|
-
function
|
|
245
|
-
let n =
|
|
275
|
+
function te(e, t = "light") {
|
|
276
|
+
let n = A(e);
|
|
246
277
|
return {
|
|
247
|
-
...
|
|
248
|
-
...
|
|
278
|
+
...M(e),
|
|
279
|
+
...j(n[t] ?? n.light)
|
|
249
280
|
};
|
|
250
281
|
}
|
|
251
|
-
function
|
|
282
|
+
function N(e, t) {
|
|
252
283
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
253
284
|
}
|
|
254
285
|
//#endregion
|
|
255
286
|
//#region src/bundle.js
|
|
256
|
-
function
|
|
287
|
+
function ne({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
257
288
|
let a = {
|
|
258
289
|
...t?.global ?? {},
|
|
259
290
|
...t?.tenant ?? {}
|
|
@@ -263,7 +294,7 @@ function M({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
263
294
|
title: e.title,
|
|
264
295
|
slug: e.slug,
|
|
265
296
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
266
|
-
theme:
|
|
297
|
+
theme: N(o, a.builder_themes?.themes),
|
|
267
298
|
components: a.builder_components?.components ?? {},
|
|
268
299
|
custom: o.custom,
|
|
269
300
|
seo: o.seo,
|
|
@@ -274,16 +305,16 @@ function M({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
274
305
|
}
|
|
275
306
|
//#endregion
|
|
276
307
|
//#region src/fetchPage.js
|
|
277
|
-
var
|
|
308
|
+
var re = async (e) => {
|
|
278
309
|
let t = await e.json().catch(() => null);
|
|
279
310
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
280
311
|
return t?.payload ?? t;
|
|
281
312
|
};
|
|
282
|
-
async function
|
|
313
|
+
async function P({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, fetch: a }) {
|
|
283
314
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
284
315
|
if (!n) throw Error("fetchPage: slug is required");
|
|
285
|
-
let o = a ?? fetch, s = e.replace(/\/$/, ""), c = t ? { "x-tenant": t } : {}, [l, u] = await Promise.all([o(`${s}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: c }).then(
|
|
286
|
-
return
|
|
316
|
+
let o = a ?? fetch, s = e.replace(/\/$/, ""), c = t ? { "x-tenant": t } : {}, [l, u] = await Promise.all([o(`${s}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: c }).then(re), o(`${s}/settings/public`, { headers: c }).then(re)]);
|
|
317
|
+
return ne({
|
|
287
318
|
page: l,
|
|
288
319
|
settings: u,
|
|
289
320
|
tenant: t,
|
|
@@ -397,14 +428,14 @@ new Map([
|
|
|
397
428
|
fallback: "sans-serif"
|
|
398
429
|
}
|
|
399
430
|
].map((e) => [e.family, e]));
|
|
400
|
-
function
|
|
431
|
+
function F(e) {
|
|
401
432
|
return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
|
|
402
433
|
}
|
|
403
|
-
var
|
|
434
|
+
var I = (e) => F([e]), L = (e) => {
|
|
404
435
|
let t = typeof e == "string" && e.match(/^"([^"]+)"/);
|
|
405
436
|
return t ? t[1] : null;
|
|
406
437
|
};
|
|
407
|
-
function
|
|
438
|
+
function R(e, t) {
|
|
408
439
|
let n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
409
440
|
for (let t of Object.values(e || {})) for (let e of [
|
|
410
441
|
"style",
|
|
@@ -412,7 +443,7 @@ function P(e, t) {
|
|
|
412
443
|
"pressed",
|
|
413
444
|
"focused"
|
|
414
445
|
]) {
|
|
415
|
-
let r =
|
|
446
|
+
let r = L(t.props?.[e]?.fontFamily);
|
|
416
447
|
r && n.add(r);
|
|
417
448
|
}
|
|
418
449
|
};
|
|
@@ -422,30 +453,30 @@ function P(e, t) {
|
|
|
422
453
|
}
|
|
423
454
|
//#endregion
|
|
424
455
|
//#region ../ui/src/components/builder/views.jsx
|
|
425
|
-
var
|
|
456
|
+
var z = t({
|
|
426
457
|
tenant: "",
|
|
427
458
|
apiUrl: "/api"
|
|
428
|
-
}),
|
|
459
|
+
}), B = {
|
|
429
460
|
margin: 0,
|
|
430
461
|
fontWeight: 700,
|
|
431
462
|
lineHeight: 1.2,
|
|
432
463
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
433
|
-
},
|
|
464
|
+
}, V = { margin: 0 }, H = {
|
|
434
465
|
display: "inline-block",
|
|
435
466
|
textDecoration: "none",
|
|
436
467
|
cursor: "pointer",
|
|
437
468
|
backgroundColor: "var(--page-accent, #111827)",
|
|
438
469
|
color: "var(--page-accent-text, #ffffff)"
|
|
439
|
-
},
|
|
470
|
+
}, ie = {
|
|
440
471
|
flexGrow: 1,
|
|
441
472
|
display: "flex",
|
|
442
473
|
flexDirection: "column",
|
|
443
474
|
position: "relative"
|
|
444
|
-
},
|
|
475
|
+
}, U = {
|
|
445
476
|
display: "flex",
|
|
446
477
|
flexDirection: "column"
|
|
447
478
|
};
|
|
448
|
-
function
|
|
479
|
+
function W({ style: e }) {
|
|
449
480
|
let t = e?.backgroundVideo;
|
|
450
481
|
if (!t) return null;
|
|
451
482
|
let n = {
|
|
@@ -471,7 +502,7 @@ function B({ style: e }) {
|
|
|
471
502
|
background: r
|
|
472
503
|
} })] });
|
|
473
504
|
}
|
|
474
|
-
var
|
|
505
|
+
var G = (e, t) => e?.backgroundVideo ? {
|
|
475
506
|
position: "relative",
|
|
476
507
|
...t,
|
|
477
508
|
...f(e)
|
|
@@ -483,47 +514,54 @@ function ae({ style: e, nodeRef: t, children: n }) {
|
|
|
483
514
|
return /* @__PURE__ */ c("div", {
|
|
484
515
|
ref: t,
|
|
485
516
|
style: {
|
|
486
|
-
...
|
|
517
|
+
...ie,
|
|
487
518
|
...f(e)
|
|
488
519
|
},
|
|
489
|
-
children: [/* @__PURE__ */ s(
|
|
520
|
+
children: [/* @__PURE__ */ s(W, { style: e }), n]
|
|
490
521
|
});
|
|
491
522
|
}
|
|
492
|
-
function
|
|
523
|
+
function K({ style: e, nodeRef: t, children: n }) {
|
|
493
524
|
return /* @__PURE__ */ c("section", {
|
|
494
525
|
ref: t,
|
|
495
|
-
style:
|
|
496
|
-
children: [/* @__PURE__ */ s(
|
|
526
|
+
style: G(e, U),
|
|
527
|
+
children: [/* @__PURE__ */ s(W, { style: e }), n]
|
|
497
528
|
});
|
|
498
529
|
}
|
|
499
|
-
function
|
|
530
|
+
function q({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
531
|
+
let i = t ? {
|
|
532
|
+
position: "relative",
|
|
533
|
+
minHeight: 240
|
|
534
|
+
} : null;
|
|
500
535
|
return /* @__PURE__ */ c("div", {
|
|
501
|
-
ref:
|
|
502
|
-
style:
|
|
503
|
-
|
|
536
|
+
ref: n,
|
|
537
|
+
style: i ? {
|
|
538
|
+
...i,
|
|
539
|
+
...G(e)
|
|
540
|
+
} : G(e),
|
|
541
|
+
children: [/* @__PURE__ */ s(W, { style: e }), r]
|
|
504
542
|
});
|
|
505
543
|
}
|
|
506
|
-
function
|
|
544
|
+
function J({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
507
545
|
return /* @__PURE__ */ s(n, {
|
|
508
546
|
ref: a,
|
|
509
547
|
style: {
|
|
510
|
-
...
|
|
548
|
+
...B,
|
|
511
549
|
...f(r)
|
|
512
550
|
},
|
|
513
|
-
children:
|
|
551
|
+
children: X(t, e, i)
|
|
514
552
|
});
|
|
515
553
|
}
|
|
516
|
-
var
|
|
517
|
-
fontFamily:
|
|
554
|
+
var Y = {
|
|
555
|
+
fontFamily: D.mono.value,
|
|
518
556
|
background: "rgba(148, 163, 184, 0.18)",
|
|
519
557
|
padding: "1px 5px",
|
|
520
558
|
borderRadius: 4,
|
|
521
559
|
fontSize: "0.9em"
|
|
522
560
|
};
|
|
523
|
-
function
|
|
561
|
+
function oe(e, t = [], n) {
|
|
524
562
|
let r = e;
|
|
525
563
|
return t.includes("sup") ? r = /* @__PURE__ */ s("sup", { children: r }) : t.includes("sub") && (r = /* @__PURE__ */ s("sub", { children: r })), t.includes("code") && (r = /* @__PURE__ */ s("code", {
|
|
526
|
-
style:
|
|
564
|
+
style: Y,
|
|
527
565
|
children: r
|
|
528
566
|
})), t.includes("strike") && (r = /* @__PURE__ */ s("s", { children: r })), t.includes("underline") && (r = /* @__PURE__ */ s("u", { children: r })), t.includes("italic") && (r = /* @__PURE__ */ s("em", { children: r })), t.includes("bold") && (r = /* @__PURE__ */ s("strong", { children: r })), n && (r = /* @__PURE__ */ s("a", {
|
|
529
567
|
href: n,
|
|
@@ -531,13 +569,13 @@ function G(e, t = [], n) {
|
|
|
531
569
|
children: r
|
|
532
570
|
})), r;
|
|
533
571
|
}
|
|
534
|
-
function
|
|
572
|
+
function X(t, n, r) {
|
|
535
573
|
return t?.length ? t.map((t, n) => {
|
|
536
574
|
if (t.slot) return /* @__PURE__ */ s(e, { children: r?.[t.slot] ?? null }, n);
|
|
537
|
-
if (t.parts) return /* @__PURE__ */ s(e, { children:
|
|
575
|
+
if (t.parts) return /* @__PURE__ */ s(e, { children: X(t.parts, "", r) }, n);
|
|
538
576
|
let i = t.text;
|
|
539
577
|
return t.sup ? i = /* @__PURE__ */ s("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ s("sub", { children: i })), t.code && (i = /* @__PURE__ */ s("code", {
|
|
540
|
-
style:
|
|
578
|
+
style: Y,
|
|
541
579
|
children: i
|
|
542
580
|
})), t.strike && (i = /* @__PURE__ */ s("s", { children: i })), t.underline && (i = /* @__PURE__ */ s("u", { children: i })), t.italic && (i = /* @__PURE__ */ s("em", { children: i })), t.bold && (i = /* @__PURE__ */ s("strong", { children: i })), t.href && (i = /* @__PURE__ */ s("a", {
|
|
543
581
|
href: t.href,
|
|
@@ -546,13 +584,13 @@ function K(t, n, r) {
|
|
|
546
584
|
})), /* @__PURE__ */ s(e, { children: i }, n);
|
|
547
585
|
}) : n;
|
|
548
586
|
}
|
|
549
|
-
function
|
|
587
|
+
function se({ parts: e, text: t, marks: n, href: r, style: i }) {
|
|
550
588
|
return /* @__PURE__ */ s("span", {
|
|
551
589
|
style: f(i),
|
|
552
|
-
children: e?.length ?
|
|
590
|
+
children: e?.length ? X(e, t) : oe(t, n, r)
|
|
553
591
|
});
|
|
554
592
|
}
|
|
555
|
-
var
|
|
593
|
+
var ce = {
|
|
556
594
|
h1: 40,
|
|
557
595
|
h2: 32,
|
|
558
596
|
h3: 26,
|
|
@@ -560,7 +598,7 @@ var J = {
|
|
|
560
598
|
h5: 19,
|
|
561
599
|
h6: 16
|
|
562
600
|
};
|
|
563
|
-
function
|
|
601
|
+
function le({ align: e = "center", width: t } = {}) {
|
|
564
602
|
let n = t ? `${t}%` : void 0;
|
|
565
603
|
return e === "full" ? { width: "100%" } : e === "left" ? {
|
|
566
604
|
float: "left",
|
|
@@ -583,8 +621,8 @@ function Y({ align: e = "center", width: t } = {}) {
|
|
|
583
621
|
marginRight: "auto"
|
|
584
622
|
};
|
|
585
623
|
}
|
|
586
|
-
function
|
|
587
|
-
let r = n ?? ((e, n) =>
|
|
624
|
+
function ue(e = [], t, n) {
|
|
625
|
+
let r = n ?? ((e, n) => X(e, n, t));
|
|
588
626
|
return e.map((t, n) => {
|
|
589
627
|
let i = {
|
|
590
628
|
marginTop: 0,
|
|
@@ -606,7 +644,7 @@ function X(e = [], t, n) {
|
|
|
606
644
|
marginLeft: 0,
|
|
607
645
|
marginRight: 0,
|
|
608
646
|
...i,
|
|
609
|
-
...
|
|
647
|
+
...le(t)
|
|
610
648
|
},
|
|
611
649
|
children: [t.href ? /* @__PURE__ */ s("a", {
|
|
612
650
|
href: t.href,
|
|
@@ -623,15 +661,15 @@ function X(e = [], t, n) {
|
|
|
623
661
|
})]
|
|
624
662
|
}, n);
|
|
625
663
|
}
|
|
626
|
-
if (t.type === "video") return
|
|
664
|
+
if (t.type === "video") return xe(t.url) ? /* @__PURE__ */ s("div", {
|
|
627
665
|
style: {
|
|
628
666
|
...i,
|
|
629
|
-
...
|
|
667
|
+
...le({
|
|
630
668
|
align: t.align,
|
|
631
669
|
width: t.width ?? 100
|
|
632
670
|
})
|
|
633
671
|
},
|
|
634
|
-
children: /* @__PURE__ */ s(
|
|
672
|
+
children: /* @__PURE__ */ s(Se, {
|
|
635
673
|
url: t.url,
|
|
636
674
|
autoplay: t.autoplay,
|
|
637
675
|
muted: t.muted,
|
|
@@ -660,17 +698,17 @@ function X(e = [], t, n) {
|
|
|
660
698
|
}
|
|
661
699
|
if (t.type === "quote") return /* @__PURE__ */ s("blockquote", {
|
|
662
700
|
style: {
|
|
663
|
-
...
|
|
701
|
+
...fe,
|
|
664
702
|
...i
|
|
665
703
|
},
|
|
666
704
|
children: r(t.parts, t.text)
|
|
667
705
|
}, n);
|
|
668
|
-
if (
|
|
706
|
+
if (ce[t.type]) {
|
|
669
707
|
let e = t.type;
|
|
670
708
|
return /* @__PURE__ */ s(e, {
|
|
671
709
|
style: {
|
|
672
|
-
...
|
|
673
|
-
fontSize:
|
|
710
|
+
...B,
|
|
711
|
+
fontSize: ce[t.type],
|
|
674
712
|
...i
|
|
675
713
|
},
|
|
676
714
|
children: r(t.parts, t.text)
|
|
@@ -678,39 +716,39 @@ function X(e = [], t, n) {
|
|
|
678
716
|
}
|
|
679
717
|
return /* @__PURE__ */ s("p", {
|
|
680
718
|
style: {
|
|
681
|
-
...
|
|
719
|
+
...V,
|
|
682
720
|
...i
|
|
683
721
|
},
|
|
684
722
|
children: r(t.parts, t.text)
|
|
685
723
|
}, n);
|
|
686
724
|
});
|
|
687
725
|
}
|
|
688
|
-
function
|
|
726
|
+
function de({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
689
727
|
return /* @__PURE__ */ s("div", {
|
|
690
728
|
ref: r,
|
|
691
729
|
style: {
|
|
692
730
|
display: "flow-root",
|
|
693
731
|
...f(t)
|
|
694
732
|
},
|
|
695
|
-
children:
|
|
733
|
+
children: ue(e, n)
|
|
696
734
|
});
|
|
697
735
|
}
|
|
698
|
-
var
|
|
736
|
+
var fe = {
|
|
699
737
|
margin: 0,
|
|
700
738
|
padding: "8px 0 8px 20px",
|
|
701
739
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
702
740
|
};
|
|
703
|
-
function
|
|
741
|
+
function pe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
704
742
|
return /* @__PURE__ */ s("blockquote", {
|
|
705
743
|
ref: i,
|
|
706
744
|
style: {
|
|
707
|
-
...
|
|
745
|
+
...fe,
|
|
708
746
|
...f(n)
|
|
709
747
|
},
|
|
710
|
-
children:
|
|
748
|
+
children: X(t, e, r)
|
|
711
749
|
});
|
|
712
750
|
}
|
|
713
|
-
function
|
|
751
|
+
function me({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
714
752
|
return /* @__PURE__ */ s(e ? "ol" : "ul", {
|
|
715
753
|
ref: r,
|
|
716
754
|
style: {
|
|
@@ -720,53 +758,53 @@ function ue({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
|
720
758
|
},
|
|
721
759
|
children: t.map((e, t) => /* @__PURE__ */ s("li", {
|
|
722
760
|
style: { marginBottom: 4 },
|
|
723
|
-
children:
|
|
761
|
+
children: X(e.parts, e.text)
|
|
724
762
|
}, t))
|
|
725
763
|
});
|
|
726
764
|
}
|
|
727
|
-
function
|
|
765
|
+
function he({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
728
766
|
return /* @__PURE__ */ s("p", {
|
|
729
767
|
ref: i,
|
|
730
768
|
style: {
|
|
731
|
-
...
|
|
769
|
+
...V,
|
|
732
770
|
...f(n)
|
|
733
771
|
},
|
|
734
|
-
children:
|
|
772
|
+
children: X(t, e, r)
|
|
735
773
|
});
|
|
736
774
|
}
|
|
737
|
-
var
|
|
775
|
+
var ge = {
|
|
738
776
|
color: "var(--page-accent, inherit)",
|
|
739
777
|
textDecoration: "underline",
|
|
740
778
|
textUnderlineOffset: 3,
|
|
741
779
|
cursor: "pointer"
|
|
742
780
|
};
|
|
743
|
-
function
|
|
781
|
+
function _e({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
744
782
|
return /* @__PURE__ */ s("a", {
|
|
745
783
|
ref: o,
|
|
746
784
|
href: n || "#",
|
|
747
785
|
target: r || void 0,
|
|
748
786
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
749
787
|
style: {
|
|
750
|
-
...
|
|
788
|
+
...ge,
|
|
751
789
|
...f(i)
|
|
752
790
|
},
|
|
753
|
-
children:
|
|
791
|
+
children: X(t, e, a)
|
|
754
792
|
});
|
|
755
793
|
}
|
|
756
|
-
function
|
|
794
|
+
function ve({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
757
795
|
return /* @__PURE__ */ s("a", {
|
|
758
796
|
ref: o,
|
|
759
797
|
href: n || "#",
|
|
760
798
|
target: r || void 0,
|
|
761
799
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
762
800
|
style: {
|
|
763
|
-
...
|
|
801
|
+
...H,
|
|
764
802
|
...f(i)
|
|
765
803
|
},
|
|
766
|
-
children:
|
|
804
|
+
children: X(t, e, a)
|
|
767
805
|
});
|
|
768
806
|
}
|
|
769
|
-
function
|
|
807
|
+
function ye({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
770
808
|
return e ? /* @__PURE__ */ s("img", {
|
|
771
809
|
ref: r,
|
|
772
810
|
src: e,
|
|
@@ -778,7 +816,7 @@ function he({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
778
816
|
}
|
|
779
817
|
}) : null;
|
|
780
818
|
}
|
|
781
|
-
function
|
|
819
|
+
function be({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: c }) {
|
|
782
820
|
return e ? /* @__PURE__ */ s("video", {
|
|
783
821
|
ref: c,
|
|
784
822
|
src: e,
|
|
@@ -796,9 +834,9 @@ function ge({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
796
834
|
}
|
|
797
835
|
}) : null;
|
|
798
836
|
}
|
|
799
|
-
var
|
|
800
|
-
function
|
|
801
|
-
let l =
|
|
837
|
+
var xe = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
838
|
+
function Se({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: c }) {
|
|
839
|
+
let l = xe(e);
|
|
802
840
|
if (!l) return null;
|
|
803
841
|
let u = new URLSearchParams({ rel: "0" });
|
|
804
842
|
return t && u.set("autoplay", "1"), (n || t) && u.set("mute", "1"), i || u.set("controls", "0"), r && (u.set("loop", "1"), u.set("playlist", l)), Number(a) > 0 && u.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ s("div", {
|
|
@@ -824,7 +862,7 @@ function ve({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
824
862
|
})
|
|
825
863
|
});
|
|
826
864
|
}
|
|
827
|
-
function
|
|
865
|
+
function Ce({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
828
866
|
return e ? /* @__PURE__ */ s("iframe", {
|
|
829
867
|
ref: i,
|
|
830
868
|
src: e,
|
|
@@ -840,7 +878,7 @@ function ye({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
840
878
|
}
|
|
841
879
|
}) : null;
|
|
842
880
|
}
|
|
843
|
-
function
|
|
881
|
+
function we({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
|
|
844
882
|
let [o, c] = a(null);
|
|
845
883
|
return r(() => {
|
|
846
884
|
o && (o.innerHTML = e || "", t && o.querySelectorAll("script").forEach((e) => {
|
|
@@ -859,7 +897,7 @@ function be({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
|
|
|
859
897
|
style: f(n)
|
|
860
898
|
});
|
|
861
899
|
}
|
|
862
|
-
function
|
|
900
|
+
function Te({ height: e, nodeRef: t }) {
|
|
863
901
|
return /* @__PURE__ */ s("div", {
|
|
864
902
|
ref: t,
|
|
865
903
|
style: {
|
|
@@ -869,7 +907,7 @@ function xe({ height: e, nodeRef: t }) {
|
|
|
869
907
|
}
|
|
870
908
|
});
|
|
871
909
|
}
|
|
872
|
-
function
|
|
910
|
+
function Ee({ style: e, nodeRef: t }) {
|
|
873
911
|
return /* @__PURE__ */ s("div", {
|
|
874
912
|
ref: t,
|
|
875
913
|
style: {
|
|
@@ -880,7 +918,7 @@ function Se({ style: e, nodeRef: t }) {
|
|
|
880
918
|
}
|
|
881
919
|
});
|
|
882
920
|
}
|
|
883
|
-
var
|
|
921
|
+
var De = {
|
|
884
922
|
position: "absolute",
|
|
885
923
|
top: "50%",
|
|
886
924
|
transform: "translateY(-50%)",
|
|
@@ -897,7 +935,7 @@ var Ce = {
|
|
|
897
935
|
alignItems: "center",
|
|
898
936
|
justifyContent: "center",
|
|
899
937
|
padding: 0
|
|
900
|
-
},
|
|
938
|
+
}, Oe = {
|
|
901
939
|
bottom: {
|
|
902
940
|
inset: "auto 0 0 0",
|
|
903
941
|
padding: "40px 24px 20px",
|
|
@@ -916,8 +954,8 @@ var Ce = {
|
|
|
916
954
|
padding: 24,
|
|
917
955
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
918
956
|
}
|
|
919
|
-
},
|
|
920
|
-
function
|
|
957
|
+
}, ke = 48;
|
|
958
|
+
function Ae({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, height: l = 320, swipe: u = !0, style: d, nodeRef: p }) {
|
|
921
959
|
let [m, h] = a(0), [g, _] = a(!1), [v, y] = a(null), b = e ? Math.min(m, e - 1) : 0;
|
|
922
960
|
if (r(() => {
|
|
923
961
|
if (!n || g || v || e < 2) return;
|
|
@@ -933,7 +971,7 @@ function Ee({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
933
971
|
let x = (t) => h((t + e) % e), S = () => {
|
|
934
972
|
if (!v) return;
|
|
935
973
|
let { dx: e } = v;
|
|
936
|
-
y(null), e < -48 ? x(b + 1) : e >
|
|
974
|
+
y(null), e < -48 ? x(b + 1) : e > ke && x(b - 1);
|
|
937
975
|
};
|
|
938
976
|
return /* @__PURE__ */ c("div", {
|
|
939
977
|
ref: p,
|
|
@@ -981,7 +1019,7 @@ function Ee({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
981
1019
|
type: "button",
|
|
982
1020
|
"aria-label": "Previous slide",
|
|
983
1021
|
style: {
|
|
984
|
-
...
|
|
1022
|
+
...De,
|
|
985
1023
|
left: 12
|
|
986
1024
|
},
|
|
987
1025
|
onClick: () => x(b - 1),
|
|
@@ -991,7 +1029,7 @@ function Ee({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
991
1029
|
type: "button",
|
|
992
1030
|
"aria-label": "Next slide",
|
|
993
1031
|
style: {
|
|
994
|
-
...
|
|
1032
|
+
...De,
|
|
995
1033
|
right: 12
|
|
996
1034
|
},
|
|
997
1035
|
onClick: () => x(b + 1),
|
|
@@ -1025,7 +1063,7 @@ function Ee({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
1025
1063
|
] })]
|
|
1026
1064
|
});
|
|
1027
1065
|
}
|
|
1028
|
-
var
|
|
1066
|
+
var je = (e, t) => ({
|
|
1029
1067
|
position: "absolute",
|
|
1030
1068
|
inset: 0,
|
|
1031
1069
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1033,18 +1071,18 @@ var De = (e, t) => ({
|
|
|
1033
1071
|
backgroundSize: "cover",
|
|
1034
1072
|
backgroundPosition: "center"
|
|
1035
1073
|
});
|
|
1036
|
-
function
|
|
1037
|
-
return e.length ? /* @__PURE__ */ s(
|
|
1074
|
+
function Me({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1075
|
+
return e.length ? /* @__PURE__ */ s(Ae, {
|
|
1038
1076
|
...r,
|
|
1039
1077
|
count: e.length,
|
|
1040
1078
|
renderSlide: (r) => {
|
|
1041
1079
|
let i = e[r];
|
|
1042
|
-
return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", { style:
|
|
1080
|
+
return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", { style: je(i.image) }), (i.title || i.text) && /* @__PURE__ */ c("div", {
|
|
1043
1081
|
style: {
|
|
1044
1082
|
position: "absolute",
|
|
1045
1083
|
color: "#fff",
|
|
1046
1084
|
textAlign: n,
|
|
1047
|
-
...
|
|
1085
|
+
...Oe[t] ?? Oe.bottom
|
|
1048
1086
|
},
|
|
1049
1087
|
children: [i.title && /* @__PURE__ */ s("div", {
|
|
1050
1088
|
style: {
|
|
@@ -1064,13 +1102,13 @@ function Oe({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1064
1102
|
}
|
|
1065
1103
|
}) : null;
|
|
1066
1104
|
}
|
|
1067
|
-
function
|
|
1068
|
-
return e.length ? /* @__PURE__ */ s(
|
|
1105
|
+
function Ne({ slides: e = [], linked: t, ...n }) {
|
|
1106
|
+
return e.length ? /* @__PURE__ */ s(Ae, {
|
|
1069
1107
|
...n,
|
|
1070
1108
|
count: e.length,
|
|
1071
1109
|
renderSlide: (n) => {
|
|
1072
1110
|
let r = e[n];
|
|
1073
|
-
return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", { style:
|
|
1111
|
+
return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", { style: je(r.image, r.color) }), /* @__PURE__ */ s("div", {
|
|
1074
1112
|
style: {
|
|
1075
1113
|
position: "absolute",
|
|
1076
1114
|
inset: 0,
|
|
@@ -1087,14 +1125,14 @@ var Z = {
|
|
|
1087
1125
|
textDecoration: "none",
|
|
1088
1126
|
fontSize: 14,
|
|
1089
1127
|
opacity: .85
|
|
1090
|
-
},
|
|
1128
|
+
}, Pe = {
|
|
1091
1129
|
background: "var(--page-bg, #ffffff)",
|
|
1092
1130
|
color: "var(--page-text, #111827)",
|
|
1093
1131
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
1094
1132
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1095
1133
|
zIndex: 60
|
|
1096
1134
|
};
|
|
1097
|
-
function
|
|
1135
|
+
function Fe({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u = "auto", breakpoint: d = 768 }) {
|
|
1098
1136
|
let [p, m] = a(null), [h, g] = a(!1), [_, v] = a(!1), [y, b] = a(null);
|
|
1099
1137
|
r(() => {
|
|
1100
1138
|
if (!p) return;
|
|
@@ -1205,7 +1243,7 @@ function je({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
|
|
|
1205
1243
|
]
|
|
1206
1244
|
}), y === e.key && (n ? /* @__PURE__ */ s("div", {
|
|
1207
1245
|
style: {
|
|
1208
|
-
...
|
|
1246
|
+
...Pe,
|
|
1209
1247
|
position: "absolute",
|
|
1210
1248
|
left: 0,
|
|
1211
1249
|
right: 0,
|
|
@@ -1221,7 +1259,7 @@ function je({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
|
|
|
1221
1259
|
}))
|
|
1222
1260
|
}) : /* @__PURE__ */ s("div", {
|
|
1223
1261
|
style: {
|
|
1224
|
-
...
|
|
1262
|
+
...Pe,
|
|
1225
1263
|
position: "absolute",
|
|
1226
1264
|
top: "100%",
|
|
1227
1265
|
left: 0,
|
|
@@ -1261,7 +1299,7 @@ function je({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
|
|
|
1261
1299
|
]
|
|
1262
1300
|
});
|
|
1263
1301
|
}
|
|
1264
|
-
function
|
|
1302
|
+
function Ie({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
1265
1303
|
let [i, o] = a(0), l = e.length ? Math.min(i, e.length - 1) : 0;
|
|
1266
1304
|
return e.length ? /* @__PURE__ */ c("div", {
|
|
1267
1305
|
ref: r,
|
|
@@ -1301,7 +1339,7 @@ function Me({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
1301
1339
|
}, e.key))]
|
|
1302
1340
|
}) : null;
|
|
1303
1341
|
}
|
|
1304
|
-
function
|
|
1342
|
+
function Le({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
|
|
1305
1343
|
let [o, l] = a(() => new Set(e.length ? [e[0].key] : []));
|
|
1306
1344
|
if (!e.length) return null;
|
|
1307
1345
|
let u = (e) => l((t) => {
|
|
@@ -1358,11 +1396,11 @@ function Ne({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1358
1396
|
})
|
|
1359
1397
|
});
|
|
1360
1398
|
}
|
|
1361
|
-
var
|
|
1399
|
+
var Re = {
|
|
1362
1400
|
display: "flex",
|
|
1363
1401
|
flexDirection: "column",
|
|
1364
1402
|
gap: "12px"
|
|
1365
|
-
},
|
|
1403
|
+
}, ze = {
|
|
1366
1404
|
fontSize: "14px",
|
|
1367
1405
|
fontWeight: 500,
|
|
1368
1406
|
color: "var(--page-text, #111827)"
|
|
@@ -1376,19 +1414,19 @@ var Pe = {
|
|
|
1376
1414
|
boxSizing: "border-box",
|
|
1377
1415
|
backgroundColor: "#ffffff",
|
|
1378
1416
|
color: "#111827"
|
|
1379
|
-
},
|
|
1417
|
+
}, Be = {
|
|
1380
1418
|
display: "flex",
|
|
1381
1419
|
alignItems: "center",
|
|
1382
1420
|
gap: "8px",
|
|
1383
1421
|
fontSize: "14px",
|
|
1384
1422
|
color: "var(--page-text, #111827)"
|
|
1385
|
-
},
|
|
1423
|
+
}, Ve = (e) => e ? {
|
|
1386
1424
|
readOnly: !0,
|
|
1387
1425
|
tabIndex: -1,
|
|
1388
1426
|
onMouseDown: (e) => e.preventDefault()
|
|
1389
1427
|
} : {};
|
|
1390
|
-
function
|
|
1391
|
-
let { tenant: g, apiUrl: _ } = n(
|
|
1428
|
+
function He({ style: e, action: t, method: r, name: i, enctype: o, formSlug: l, nodeRef: u, inert: d, children: p, linked: m, show: h }) {
|
|
1429
|
+
let { tenant: g, apiUrl: _ } = n(z), [v, y] = a("form"), b = d ? h || "form" : v;
|
|
1392
1430
|
return /* @__PURE__ */ c("div", {
|
|
1393
1431
|
ref: u,
|
|
1394
1432
|
style: f(e),
|
|
@@ -1434,7 +1472,7 @@ function Re({ style: e, action: t, method: r, name: i, enctype: o, formSlug: l,
|
|
|
1434
1472
|
}
|
|
1435
1473
|
},
|
|
1436
1474
|
style: {
|
|
1437
|
-
...
|
|
1475
|
+
...Re,
|
|
1438
1476
|
display: b === "success" ? "none" : "flex"
|
|
1439
1477
|
},
|
|
1440
1478
|
children: p
|
|
@@ -1453,17 +1491,17 @@ function Re({ style: e, action: t, method: r, name: i, enctype: o, formSlug: l,
|
|
|
1453
1491
|
]
|
|
1454
1492
|
});
|
|
1455
1493
|
}
|
|
1456
|
-
function
|
|
1494
|
+
function Ue({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
1457
1495
|
return /* @__PURE__ */ s("label", {
|
|
1458
1496
|
ref: r,
|
|
1459
1497
|
style: {
|
|
1460
|
-
...
|
|
1498
|
+
...ze,
|
|
1461
1499
|
...f(n)
|
|
1462
1500
|
},
|
|
1463
|
-
children:
|
|
1501
|
+
children: X(t, e, i)
|
|
1464
1502
|
});
|
|
1465
1503
|
}
|
|
1466
|
-
function
|
|
1504
|
+
function We({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1467
1505
|
return /* @__PURE__ */ s("input", {
|
|
1468
1506
|
ref: a,
|
|
1469
1507
|
type: e,
|
|
@@ -1474,10 +1512,10 @@ function Be({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
1474
1512
|
...Q,
|
|
1475
1513
|
...f(i)
|
|
1476
1514
|
},
|
|
1477
|
-
...
|
|
1515
|
+
...Ve(o)
|
|
1478
1516
|
});
|
|
1479
1517
|
}
|
|
1480
|
-
function
|
|
1518
|
+
function Ge({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1481
1519
|
return /* @__PURE__ */ s("textarea", {
|
|
1482
1520
|
ref: a,
|
|
1483
1521
|
name: e || void 0,
|
|
@@ -1489,14 +1527,14 @@ function Ve({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
1489
1527
|
resize: "vertical",
|
|
1490
1528
|
...f(i)
|
|
1491
1529
|
},
|
|
1492
|
-
...
|
|
1530
|
+
...Ve(o)
|
|
1493
1531
|
});
|
|
1494
1532
|
}
|
|
1495
|
-
function
|
|
1533
|
+
function Ke({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: l }) {
|
|
1496
1534
|
return /* @__PURE__ */ c("label", {
|
|
1497
1535
|
ref: o,
|
|
1498
1536
|
style: {
|
|
1499
|
-
...
|
|
1537
|
+
...Be,
|
|
1500
1538
|
...f(a)
|
|
1501
1539
|
},
|
|
1502
1540
|
children: [/* @__PURE__ */ s("input", {
|
|
@@ -1513,7 +1551,7 @@ function He({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
1513
1551
|
}), t]
|
|
1514
1552
|
});
|
|
1515
1553
|
}
|
|
1516
|
-
function
|
|
1554
|
+
function qe({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
1517
1555
|
return /* @__PURE__ */ c("select", {
|
|
1518
1556
|
ref: a,
|
|
1519
1557
|
name: e || void 0,
|
|
@@ -1536,7 +1574,7 @@ function Ue({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
1536
1574
|
}, t))]
|
|
1537
1575
|
});
|
|
1538
1576
|
}
|
|
1539
|
-
function
|
|
1577
|
+
function Je({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: o, inert: l }) {
|
|
1540
1578
|
let [u, d] = a(null);
|
|
1541
1579
|
return /* @__PURE__ */ c("label", {
|
|
1542
1580
|
ref: o,
|
|
@@ -1568,12 +1606,12 @@ function We({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
1568
1606
|
]
|
|
1569
1607
|
});
|
|
1570
1608
|
}
|
|
1571
|
-
function
|
|
1609
|
+
function Ye({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
1572
1610
|
return /* @__PURE__ */ s("button", {
|
|
1573
1611
|
ref: n,
|
|
1574
1612
|
type: r ? "button" : "submit",
|
|
1575
1613
|
style: {
|
|
1576
|
-
...
|
|
1614
|
+
...H,
|
|
1577
1615
|
border: 0,
|
|
1578
1616
|
cursor: "pointer",
|
|
1579
1617
|
alignSelf: "flex-start",
|
|
@@ -1582,46 +1620,64 @@ function Ge({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
1582
1620
|
children: e
|
|
1583
1621
|
});
|
|
1584
1622
|
}
|
|
1585
|
-
|
|
1623
|
+
function Xe({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
1624
|
+
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
1625
|
+
return /* @__PURE__ */ s("div", {
|
|
1626
|
+
ref: r,
|
|
1627
|
+
style: {
|
|
1628
|
+
display: "grid",
|
|
1629
|
+
gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
|
|
1630
|
+
gap: 16,
|
|
1631
|
+
width: "100%",
|
|
1632
|
+
...f(n)
|
|
1633
|
+
},
|
|
1634
|
+
children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ s("div", {
|
|
1635
|
+
style: { minWidth: 0 },
|
|
1636
|
+
children: i?.[`cell-${t}`] ?? null
|
|
1637
|
+
}, t))
|
|
1638
|
+
});
|
|
1639
|
+
}
|
|
1640
|
+
var Ze = {
|
|
1586
1641
|
PageRoot: ae,
|
|
1587
|
-
Section:
|
|
1588
|
-
Container:
|
|
1589
|
-
Heading:
|
|
1590
|
-
TextBlock:
|
|
1591
|
-
ButtonBlock:
|
|
1592
|
-
ImageBlock:
|
|
1593
|
-
Spacer:
|
|
1594
|
-
Divider:
|
|
1595
|
-
SliderBlock:
|
|
1596
|
-
CanvasSlider:
|
|
1597
|
-
TabsBlock:
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1642
|
+
Section: K,
|
|
1643
|
+
Container: q,
|
|
1644
|
+
Heading: J,
|
|
1645
|
+
TextBlock: he,
|
|
1646
|
+
ButtonBlock: ve,
|
|
1647
|
+
ImageBlock: ye,
|
|
1648
|
+
Spacer: Te,
|
|
1649
|
+
Divider: Ee,
|
|
1650
|
+
SliderBlock: Me,
|
|
1651
|
+
CanvasSlider: Ne,
|
|
1652
|
+
TabsBlock: Ie,
|
|
1653
|
+
QuickStack: Xe,
|
|
1654
|
+
AccordionBlock: Le,
|
|
1655
|
+
NavbarBlock: Fe,
|
|
1656
|
+
ListBlock: me,
|
|
1657
|
+
TextSpan: se,
|
|
1658
|
+
QuoteBlock: pe,
|
|
1659
|
+
TextLink: _e,
|
|
1660
|
+
RichTextBlock: de,
|
|
1661
|
+
RichContentBlock: de,
|
|
1662
|
+
VideoBlock: be,
|
|
1663
|
+
YouTubeBlock: Se,
|
|
1664
|
+
IframeBlock: Ce,
|
|
1665
|
+
EmbedBlock: we,
|
|
1666
|
+
FormBlock: He,
|
|
1667
|
+
FormLabel: Ue,
|
|
1668
|
+
FormInput: We,
|
|
1669
|
+
FormTextarea: Ge,
|
|
1670
|
+
FormCheckbox: (e) => /* @__PURE__ */ s(Ke, {
|
|
1615
1671
|
kind: "checkbox",
|
|
1616
1672
|
...e
|
|
1617
1673
|
}),
|
|
1618
|
-
FormRadio: (e) => /* @__PURE__ */ s(
|
|
1674
|
+
FormRadio: (e) => /* @__PURE__ */ s(Ke, {
|
|
1619
1675
|
kind: "radio",
|
|
1620
1676
|
...e
|
|
1621
1677
|
}),
|
|
1622
|
-
FormSelect:
|
|
1623
|
-
FormFile:
|
|
1624
|
-
FormSubmit:
|
|
1678
|
+
FormSelect: qe,
|
|
1679
|
+
FormFile: Je,
|
|
1680
|
+
FormSubmit: Ye
|
|
1625
1681
|
};
|
|
1626
1682
|
//#endregion
|
|
1627
1683
|
//#region ../ui/src/components/builder/render.jsx
|
|
@@ -1635,7 +1691,7 @@ function $(t, n, r, i = /* @__PURE__ */ new Set()) {
|
|
|
1635
1691
|
let c = new Set(i).add(n);
|
|
1636
1692
|
return /* @__PURE__ */ s(e, { children: $(o.template.rootId, o.template.nodes, r, c) }, t);
|
|
1637
1693
|
}
|
|
1638
|
-
let c =
|
|
1694
|
+
let c = Ze[o];
|
|
1639
1695
|
if (!c) return null;
|
|
1640
1696
|
let l = (a.nodes ?? []).map((e) => $(e, n, r, i)).filter(Boolean), u = Object.entries(a.linkedNodes ?? {}), d = u.length ? Object.fromEntries(u.map(([e, t]) => [e, $(t, n, r, i)])) : void 0;
|
|
1641
1697
|
return /* @__PURE__ */ s(c, {
|
|
@@ -1649,8 +1705,8 @@ function $(t, n, r, i = /* @__PURE__ */ new Set()) {
|
|
|
1649
1705
|
}
|
|
1650
1706
|
//#endregion
|
|
1651
1707
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
1652
|
-
var
|
|
1653
|
-
function
|
|
1708
|
+
var Qe = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
|
|
1709
|
+
function $e({ blocks: e, theme: t, components: n, mode: i = "auto", style: a, custom: o, tenant: l, apiUrl: u }) {
|
|
1654
1710
|
let d = o?.js?.trim();
|
|
1655
1711
|
if (r(() => {
|
|
1656
1712
|
if (!d) return;
|
|
@@ -1661,12 +1717,12 @@ function Je({ blocks: e, theme: t, components: n, mode: i = "auto", style: a, cu
|
|
|
1661
1717
|
minHeight: "100%",
|
|
1662
1718
|
display: "flex",
|
|
1663
1719
|
flexDirection: "column"
|
|
1664
|
-
}, p = $("ROOT", e, n), m =
|
|
1720
|
+
}, p = $("ROOT", e, n), m = C(e, n), h = ee(e, n), g = o?.css?.trim(), _ = R(e, n).map((e) => /* @__PURE__ */ s("link", {
|
|
1665
1721
|
rel: "stylesheet",
|
|
1666
1722
|
precedence: "default",
|
|
1667
|
-
href:
|
|
1723
|
+
href: I(e)
|
|
1668
1724
|
}, e));
|
|
1669
|
-
if (i !== "auto") return /* @__PURE__ */ s(
|
|
1725
|
+
if (i !== "auto") return /* @__PURE__ */ s(z.Provider, {
|
|
1670
1726
|
value: {
|
|
1671
1727
|
tenant: l || "",
|
|
1672
1728
|
apiUrl: u || "/api"
|
|
@@ -1674,19 +1730,20 @@ function Je({ blocks: e, theme: t, components: n, mode: i = "auto", style: a, cu
|
|
|
1674
1730
|
children: /* @__PURE__ */ c("div", {
|
|
1675
1731
|
style: {
|
|
1676
1732
|
...f,
|
|
1677
|
-
...
|
|
1733
|
+
...te(t, i),
|
|
1678
1734
|
...a
|
|
1679
1735
|
},
|
|
1680
1736
|
children: [
|
|
1681
|
-
|
|
1737
|
+
_,
|
|
1682
1738
|
m && /* @__PURE__ */ s("style", { children: m }),
|
|
1683
1739
|
h && /* @__PURE__ */ s("style", { children: h }),
|
|
1740
|
+
g && /* @__PURE__ */ s("style", { children: g }),
|
|
1684
1741
|
p
|
|
1685
1742
|
]
|
|
1686
1743
|
})
|
|
1687
1744
|
});
|
|
1688
|
-
let
|
|
1689
|
-
return /* @__PURE__ */ s(
|
|
1745
|
+
let v = A(t);
|
|
1746
|
+
return /* @__PURE__ */ s(z.Provider, {
|
|
1690
1747
|
value: {
|
|
1691
1748
|
tenant: l || "",
|
|
1692
1749
|
apiUrl: u || "/api"
|
|
@@ -1695,15 +1752,16 @@ function Je({ blocks: e, theme: t, components: n, mode: i = "auto", style: a, cu
|
|
|
1695
1752
|
className: "webim-page",
|
|
1696
1753
|
style: {
|
|
1697
1754
|
...f,
|
|
1698
|
-
...
|
|
1755
|
+
...M(t),
|
|
1699
1756
|
...a
|
|
1700
1757
|
},
|
|
1701
1758
|
children: [
|
|
1702
|
-
/* @__PURE__ */ s("style", { children: `.webim-page { ${
|
|
1703
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
1704
|
-
|
|
1759
|
+
/* @__PURE__ */ s("style", { children: `.webim-page { ${Qe(j(v.light))} }
|
|
1760
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Qe(j(v.dark))} } }` }),
|
|
1761
|
+
_,
|
|
1705
1762
|
m && /* @__PURE__ */ s("style", { children: m }),
|
|
1706
1763
|
h && /* @__PURE__ */ s("style", { children: h }),
|
|
1764
|
+
g && /* @__PURE__ */ s("style", { children: g }),
|
|
1707
1765
|
p
|
|
1708
1766
|
]
|
|
1709
1767
|
})
|
|
@@ -1711,8 +1769,8 @@ function Je({ blocks: e, theme: t, components: n, mode: i = "auto", style: a, cu
|
|
|
1711
1769
|
}
|
|
1712
1770
|
//#endregion
|
|
1713
1771
|
//#region src/WebimContent.jsx
|
|
1714
|
-
function
|
|
1715
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ s(
|
|
1772
|
+
function et({ bundle: e, mode: t = "auto", style: n }) {
|
|
1773
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ s($e, {
|
|
1716
1774
|
blocks: e.blocks,
|
|
1717
1775
|
theme: e.theme,
|
|
1718
1776
|
components: e.components,
|
|
@@ -1725,7 +1783,7 @@ function Ye({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
1725
1783
|
}
|
|
1726
1784
|
//#endregion
|
|
1727
1785
|
//#region src/WebimPage.jsx
|
|
1728
|
-
function
|
|
1786
|
+
function tt({ apiUrl: e, tenant: t, slug: n, locale: o, preview: c, mode: l = "auto", style: u, fallback: d = null, errorFallback: f = null, onLoad: p, onError: m }) {
|
|
1729
1787
|
let [h, g] = a({ status: "loading" }), _ = i({
|
|
1730
1788
|
onLoad: p,
|
|
1731
1789
|
onError: m
|
|
@@ -1735,7 +1793,7 @@ function Xe({ apiUrl: e, tenant: t, slug: n, locale: o, preview: c, mode: l = "a
|
|
|
1735
1793
|
onError: m
|
|
1736
1794
|
}, r(() => {
|
|
1737
1795
|
let r = !0;
|
|
1738
|
-
return g({ status: "loading" }),
|
|
1796
|
+
return g({ status: "loading" }), P({
|
|
1739
1797
|
apiUrl: e,
|
|
1740
1798
|
tenant: t,
|
|
1741
1799
|
slug: n,
|
|
@@ -1760,11 +1818,11 @@ function Xe({ apiUrl: e, tenant: t, slug: n, locale: o, preview: c, mode: l = "a
|
|
|
1760
1818
|
n,
|
|
1761
1819
|
o,
|
|
1762
1820
|
c
|
|
1763
|
-
]), h.status === "loading" ? d : h.status === "error" ? typeof f == "function" ? f(h.error) : f : /* @__PURE__ */ s(
|
|
1821
|
+
]), h.status === "loading" ? d : h.status === "error" ? typeof f == "function" ? f(h.error) : f : /* @__PURE__ */ s(et, {
|
|
1764
1822
|
bundle: h.bundle,
|
|
1765
1823
|
mode: l,
|
|
1766
1824
|
style: u
|
|
1767
1825
|
});
|
|
1768
1826
|
}
|
|
1769
1827
|
//#endregion
|
|
1770
|
-
export {
|
|
1828
|
+
export { $e as PageRenderer, et as WebimContent, tt as WebimPage, P as fetchPage, ue as renderRichContent, N as resolveTheme };
|