@cntrl-site/components 1.0.115-alpha.0 → 1.0.115-alpha.1
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/Components/PopupMenu/PopupMenu.d.ts +3 -1
- package/dist/Components/PopupMenu/PopupMenuComponent.d.ts +1 -0
- package/dist/PopupMenu-Ct6PbiJq.js +369 -0
- package/dist/{PopupMenu-RPz8MN6s.mjs → PopupMenu-DGVvx5AW.mjs} +337 -296
- package/dist/{components-DScrkzXw.js → components-DCG0h7Jb.js} +1 -1
- package/dist/{components-y6LC2ILa.mjs → components-DH803b-9.mjs} +8 -5
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +1 -1
- package/dist/elements.node.js +1 -1
- package/dist/elements.node.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
- package/dist/PopupMenu-On4dKyT3.js +0 -369
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as Z, useState as
|
|
1
|
+
import { jsx as C, jsxs as q } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as Z, useState as U, useEffect as D, useRef as W, useLayoutEffect as Ut } from "react";
|
|
3
3
|
import { createPortal as fe } from "react-dom";
|
|
4
4
|
import { s as qt } from "./scalingValue-C9JH5L6O.mjs";
|
|
5
5
|
import { u as $e } from "./useScopedStyles-DhBG3557.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
6
|
+
import { i as be, E as ve } from "./EmbedMediaFrame-DwHeOAy5.mjs";
|
|
7
|
+
import { u as xe } from "./useLightboxScrollLock-VQ07s7EJ.mjs";
|
|
8
|
+
import { n as ye } from "./textStylesToCss-05Mn6I_2.mjs";
|
|
9
|
+
import { R as we } from "./RichTextRenderer-D52Xto59.mjs";
|
|
10
|
+
import { S as Me } from "./SvgImage-CwRq9-ec.mjs";
|
|
11
|
+
const ke = 60, Ce = 900 / 1440, Ie = ["left", "center", "right"], Zt = {
|
|
11
12
|
columns: 12,
|
|
12
13
|
columnWidth: 99 / 1440,
|
|
13
14
|
gutter: 20 / 1440
|
|
14
15
|
};
|
|
15
|
-
function
|
|
16
|
-
const o = (
|
|
16
|
+
function Se(t, e = Zt) {
|
|
17
|
+
const o = (s) => typeof s == "number" && Number.isFinite(s), n = (s, ...c) => c.find(o) ?? s, r = t.gridLayout ?? {}, u = Math.max(0, n(e.gutter, r.horizontalGap, t.gridGutter));
|
|
17
18
|
return {
|
|
18
19
|
columns: Math.max(1, Math.round(n(e.columns, r.columnsCount, t.gridColumns))),
|
|
19
20
|
columnWidth: Math.max(0, n(e.columnWidth, r.entryWidth, t.gridColumnWidth)),
|
|
@@ -26,25 +27,25 @@ function et(t) {
|
|
|
26
27
|
}
|
|
27
28
|
function Kt(t) {
|
|
28
29
|
const e = t.popupHeight;
|
|
29
|
-
return Math.min(100, Math.max(0, typeof e == "number" && Number.isFinite(e) ? e :
|
|
30
|
+
return Math.min(100, Math.max(0, typeof e == "number" && Number.isFinite(e) ? e : ke));
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
+
function _e(t, e = Ce) {
|
|
32
33
|
return Kt(t) / 100 * e;
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
35
|
+
function ze(t) {
|
|
36
|
+
return Ie.includes(t.popupAlign) ? t.popupAlign : "center";
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
+
function Ae(t, e) {
|
|
38
39
|
var r;
|
|
39
40
|
const o = (r = t.gridLayout) == null ? void 0 : r.wrapperWidth, n = e.columns * e.columnWidth + (e.columns - 1) * e.gutter;
|
|
40
41
|
return typeof o == "number" && Number.isFinite(o) && o > 0 ? Math.max(o, n) : n > 0 ? n : 1;
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
+
function Ne(t) {
|
|
43
44
|
if (typeof t == "number") return { top: t, right: t, bottom: t, left: t };
|
|
44
45
|
const e = (o) => typeof o == "number" && Number.isFinite(o) ? Math.max(0, o) : 0;
|
|
45
46
|
return { top: e(t == null ? void 0 : t.top), right: e(t == null ? void 0 : t.right), bottom: e(t == null ? void 0 : t.bottom), left: e(t == null ? void 0 : t.left) };
|
|
46
47
|
}
|
|
47
|
-
const
|
|
48
|
+
const Re = {
|
|
48
49
|
span: {
|
|
49
50
|
text: { min: 1 / 4, max: 5 / 12 },
|
|
50
51
|
image: { min: 1 / 6, max: 1 / 3 },
|
|
@@ -53,52 +54,52 @@ const ze = {
|
|
|
53
54
|
},
|
|
54
55
|
breakChance: 0.25
|
|
55
56
|
};
|
|
56
|
-
function
|
|
57
|
-
const u =
|
|
58
|
-
let
|
|
59
|
-
const
|
|
60
|
-
for (const
|
|
61
|
-
const
|
|
62
|
-
let
|
|
63
|
-
const
|
|
64
|
-
(
|
|
65
|
-
const
|
|
66
|
-
for (let
|
|
67
|
-
|
|
57
|
+
function Te(t, e, o, n, r = Re) {
|
|
58
|
+
const u = De(o), s = Math.max(1, Math.floor(e.columns)), c = [];
|
|
59
|
+
let h = 0, d = new Array(s).fill(!1);
|
|
60
|
+
const g = {};
|
|
61
|
+
for (const z of t) {
|
|
62
|
+
const f = g[z] ?? (g[z] = We(r.span[z] ?? r.span.text, s, u));
|
|
63
|
+
let m = Yt(d, f);
|
|
64
|
+
const x = d.some(Boolean);
|
|
65
|
+
(m.length === 0 || x && u() < r.breakChance) && (h += 1, d = new Array(s).fill(!1), m = Yt(d, f));
|
|
66
|
+
const R = m[Math.floor(u() * m.length)];
|
|
67
|
+
for (let N = Math.max(0, R - 1); N < Math.min(s, R + f + 1); N++) d[N] = !0;
|
|
68
|
+
c.push({ column: R, span: f, row: h });
|
|
68
69
|
}
|
|
69
|
-
const a =
|
|
70
|
+
const a = h + 1;
|
|
70
71
|
return {
|
|
71
72
|
seed: o,
|
|
72
|
-
grid: { ...e, columns:
|
|
73
|
-
placements:
|
|
73
|
+
grid: { ...e, columns: s },
|
|
74
|
+
placements: c.map(({ column: z, span: f, row: m }) => ({ column: z, span: f, top: K(e, m * n / a, n) }))
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
+
function mo() {
|
|
77
78
|
return Math.floor(Math.random() * 2147483647);
|
|
78
79
|
}
|
|
79
80
|
function K(t, e, o = 1 / 0) {
|
|
80
|
-
const n = t.beat ?? 0, r = Math.max(0, o), u = n > 0 ? Math.round(e / n) * n : e,
|
|
81
|
-
return Math.round(Math.max(0,
|
|
81
|
+
const n = t.beat ?? 0, r = Math.max(0, o), u = n > 0 ? Math.round(e / n) * n : e, s = u <= r ? u : n > 0 ? Math.floor(r / n + 1e-9) * n : r;
|
|
82
|
+
return Math.round(Math.max(0, s) * 1e6) / 1e6;
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
+
function wt(t) {
|
|
84
85
|
return t.beat && t.beat > 0 ? t.beat : 8 / 1440;
|
|
85
86
|
}
|
|
86
87
|
function lt(t, e, o = 1 / 0) {
|
|
87
|
-
const n = t.beat ?? 0, r =
|
|
88
|
-
return Jt(Math.max(r,
|
|
88
|
+
const n = t.beat ?? 0, r = wt(t), u = n > 0 ? Math.round(e / n) * n : e, s = u <= o ? u : n > 0 ? Math.floor(o / n + 1e-9) * n : o;
|
|
89
|
+
return Jt(Math.max(r, s));
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
+
function Le(t, e) {
|
|
91
92
|
const o = (n, r) => Math.abs(n - r) < 1e-9;
|
|
92
93
|
return Math.floor(t.columns) === Math.floor(e.columns) && o(t.columnWidth, e.columnWidth) && o(t.gutter, e.gutter) && o(et(t), et(e)) && o(t.beat ?? 0, e.beat ?? 0);
|
|
93
94
|
}
|
|
94
|
-
function
|
|
95
|
+
function Be(t, e) {
|
|
95
96
|
const o = { ...e, columns: Math.max(1, Math.floor(e.columns)) };
|
|
96
|
-
if (
|
|
97
|
-
const n = Math.max(1, Math.floor(t.grid.columns)), r = o.columns, u = (
|
|
98
|
-
const
|
|
99
|
-
return
|
|
97
|
+
if (Le(t.grid, o)) return t;
|
|
98
|
+
const n = Math.max(1, Math.floor(t.grid.columns)), r = o.columns, u = (c) => n === r ? c : Math.round(c * r / n), s = t.placements.map((c) => {
|
|
99
|
+
const h = Math.min(r, Math.max(1, u(c.span))), d = Math.min(Math.max(0, u(c.column)), r - h), g = K(o, c.top);
|
|
100
|
+
return c.height === void 0 ? { column: d, span: h, top: g } : { column: d, span: h, top: g, height: lt(o, c.height) };
|
|
100
101
|
});
|
|
101
|
-
return { ...t, grid: o, placements:
|
|
102
|
+
return { ...t, grid: o, placements: s };
|
|
102
103
|
}
|
|
103
104
|
function Jt(t) {
|
|
104
105
|
return Math.round(t * 1e6) / 1e6;
|
|
@@ -106,62 +107,62 @@ function Jt(t) {
|
|
|
106
107
|
function Qt(t, e, o, n, r) {
|
|
107
108
|
return t.column < o.column + o.span && o.column < t.column + t.span && t.top < o.top + n + r - 1e-9 && o.top < t.top + e + r - 1e-9;
|
|
108
109
|
}
|
|
109
|
-
function
|
|
110
|
+
function Ee(t, e, o, n, r) {
|
|
110
111
|
const u = t.placements[e];
|
|
111
112
|
return u ? Pt(t, e, { ...u, column: o, top: n }, r) : null;
|
|
112
113
|
}
|
|
113
|
-
function
|
|
114
|
+
function Fe(t, e, o, n) {
|
|
114
115
|
if (!t.placements[e]) return null;
|
|
115
|
-
const { columns: r } = t.grid, u = Math.min(Math.max(0, o.column), r - 1),
|
|
116
|
-
return Pt(t, e,
|
|
116
|
+
const { columns: r } = t.grid, u = Math.min(Math.max(0, o.column), r - 1), s = Math.min(Math.max(1, o.span), r - u), c = K(t.grid, o.top, n ? n.height - wt(t.grid) : 1 / 0), h = o.height === void 0 ? void 0 : lt(t.grid, o.height, n ? n.height - c : 1 / 0);
|
|
117
|
+
return Pt(t, e, h === void 0 ? { column: u, span: s, top: c } : { column: u, span: s, top: c, height: h }, n);
|
|
117
118
|
}
|
|
118
119
|
function Pt(t, e, o, n) {
|
|
119
|
-
const { columns: r } = t.grid, u = et(t.grid),
|
|
120
|
-
if (
|
|
121
|
-
const
|
|
120
|
+
const { columns: r } = t.grid, u = et(t.grid), s = Math.min(o.span, r);
|
|
121
|
+
if (s < 1 || o.column < 0 || o.column + s > r) return null;
|
|
122
|
+
const c = o.height ?? (n == null ? void 0 : n.heights[e]) ?? 0, h = {
|
|
122
123
|
column: o.column,
|
|
123
|
-
span:
|
|
124
|
-
top: K(t.grid, o.top, n ? n.height -
|
|
124
|
+
span: s,
|
|
125
|
+
top: K(t.grid, o.top, n ? n.height - c : 1 / 0),
|
|
125
126
|
...o.height === void 0 ? {} : { height: o.height }
|
|
126
127
|
};
|
|
127
|
-
return n && t.placements.some((
|
|
128
|
+
return n && t.placements.some((d, g) => g !== e && Qt(h, c, d, n.heights[g] ?? 0, u)) ? null : {
|
|
128
129
|
...t,
|
|
129
130
|
edited: !0,
|
|
130
|
-
placements: t.placements.map((
|
|
131
|
+
placements: t.placements.map((d, g) => g === e ? h : d)
|
|
131
132
|
};
|
|
132
133
|
}
|
|
133
|
-
function
|
|
134
|
-
const { columns: o } = t.grid, n = et(t.grid), r = t.grid.beat ?? 0, u = e.height,
|
|
135
|
-
let { top:
|
|
136
|
-
for (let
|
|
137
|
-
|
|
138
|
-
for (const
|
|
139
|
-
const k =
|
|
140
|
-
if (!Qt({ ...
|
|
141
|
-
const
|
|
142
|
-
|
|
134
|
+
function Ge(t, e) {
|
|
135
|
+
const { columns: o } = t.grid, n = et(t.grid), r = t.grid.beat ?? 0, u = e.height, s = t.placements.map((f, m) => e.heights[m] ?? 0), c = [...t.placements], h = c.map((f, m) => m).sort((f, m) => c[f].top - c[m].top || f - m), d = [], g = (f, m) => {
|
|
136
|
+
let { top: x } = f;
|
|
137
|
+
for (let R = !0, N = 0; R && N <= d.length; N++) {
|
|
138
|
+
R = !1;
|
|
139
|
+
for (const T of d) {
|
|
140
|
+
const k = c[T];
|
|
141
|
+
if (!Qt({ ...f, top: x }, m, k, s[T], n)) continue;
|
|
142
|
+
const A = k.top + s[T] + n, S = r > 0 ? Jt(Math.ceil(A / r - 1e-9) * r) : Math.ceil(A * 1e6 - 1e-6) / 1e6;
|
|
143
|
+
S <= x || (x = S, R = !0);
|
|
143
144
|
}
|
|
144
145
|
}
|
|
145
|
-
return
|
|
146
|
-
}, a = (
|
|
147
|
-
let
|
|
148
|
-
for (const
|
|
149
|
-
const
|
|
150
|
-
let
|
|
151
|
-
if (
|
|
152
|
-
const
|
|
153
|
-
let
|
|
154
|
-
for (const k of
|
|
155
|
-
const
|
|
156
|
-
!a(
|
|
146
|
+
return x;
|
|
147
|
+
}, a = (f, m) => f + m > u + 1e-9;
|
|
148
|
+
let z = !1;
|
|
149
|
+
for (const f of h) {
|
|
150
|
+
const m = c[f];
|
|
151
|
+
let x = { column: m.column, top: g(m, s[f]) };
|
|
152
|
+
if (x.top !== m.top && a(x.top, s[f])) {
|
|
153
|
+
const R = Math.min(m.span, o), N = Array.from({ length: Math.max(0, o - R + 1) }, (k, A) => A).sort((k, A) => Math.abs(k - m.column) - Math.abs(A - m.column) || k - A);
|
|
154
|
+
let T = null;
|
|
155
|
+
for (const k of N) {
|
|
156
|
+
const A = g({ ...m, column: k }, s[f]);
|
|
157
|
+
!a(A, s[f]) && (!T || A < T.top - 1e-9) && (T = { column: k, top: A });
|
|
157
158
|
}
|
|
158
|
-
|
|
159
|
+
T && (x = T);
|
|
159
160
|
}
|
|
160
|
-
(
|
|
161
|
+
(x.column !== m.column || x.top !== m.top) && (c[f] = { ...c[f], ...x }, z = !0), d.push(f);
|
|
161
162
|
}
|
|
162
|
-
return
|
|
163
|
+
return z ? { ...t, placements: c } : t;
|
|
163
164
|
}
|
|
164
|
-
function
|
|
165
|
+
function We(t, e, o) {
|
|
165
166
|
const n = Math.max(1, Math.round(t.min * e)), r = Math.max(n, Math.round(t.max * e));
|
|
166
167
|
return Math.min(e, n + Math.floor(o() * (r - n + 1)));
|
|
167
168
|
}
|
|
@@ -178,7 +179,7 @@ function Yt(t, e) {
|
|
|
178
179
|
}
|
|
179
180
|
return o;
|
|
180
181
|
}
|
|
181
|
-
function
|
|
182
|
+
function De(t) {
|
|
182
183
|
let e = t >>> 0;
|
|
183
184
|
return () => {
|
|
184
185
|
e = e + 1831565813 >>> 0;
|
|
@@ -186,25 +187,25 @@ function Fe(t) {
|
|
|
186
187
|
return o = Math.imul(o ^ o >>> 15, o | 1), o ^= o + Math.imul(o ^ o >>> 7, o | 61), ((o ^ o >>> 14) >>> 0) / 4294967296;
|
|
187
188
|
};
|
|
188
189
|
}
|
|
189
|
-
const Y = 300,
|
|
190
|
-
function
|
|
190
|
+
const Y = 300, Oe = 3e3, te = ["slide down", "slide up", "fade", "scale", "none"], He = "slide down";
|
|
191
|
+
function je(t) {
|
|
191
192
|
const e = t.popupTransition;
|
|
192
|
-
return te.includes(e) ? e :
|
|
193
|
+
return te.includes(e) ? e : He;
|
|
193
194
|
}
|
|
194
|
-
const
|
|
195
|
+
const Ue = ["burger", "plus", "icon", "text"], Ye = 24 / 1440, Ve = ["--cntrl-article-top", "--cntrl-article-left", "--cntrl-article-width", "--cntrl-viewport-height"], Xe = ["top", "right", "bottom", "left", "top-left", "top-right", "bottom-right", "bottom-left"], qe = ["right", "left"];
|
|
195
196
|
function Vt(t, e) {
|
|
196
197
|
return { ...e, heights: e.heights.map((o, n) => {
|
|
197
198
|
var r;
|
|
198
199
|
return ((r = t.placements[n]) == null ? void 0 : r.height) ?? o;
|
|
199
200
|
}) };
|
|
200
201
|
}
|
|
201
|
-
function
|
|
202
|
+
function Ze(t, e) {
|
|
202
203
|
return t.column === e.column && t.span === e.span && t.top === e.top && t.height === e.height;
|
|
203
204
|
}
|
|
204
205
|
function Xt(t, e) {
|
|
205
|
-
return e.handle ?
|
|
206
|
+
return e.handle ? Fe(t, e.index, e.placement, e.measure) : Ee(t, e.index, e.placement.column, e.placement.top, e.measure);
|
|
206
207
|
}
|
|
207
|
-
function
|
|
208
|
+
function Ke(t) {
|
|
208
209
|
return `
|
|
209
210
|
/* the element is the trigger alone, placed and sized on the page as any other element; the popup opens over the page */
|
|
210
211
|
.${t}-root {
|
|
@@ -576,191 +577,191 @@ function qe(t) {
|
|
|
576
577
|
`;
|
|
577
578
|
}
|
|
578
579
|
function tt(t, e, o, n) {
|
|
579
|
-
const r = (
|
|
580
|
-
const
|
|
581
|
-
return
|
|
582
|
-
},
|
|
580
|
+
const r = (h) => t[`${e}${h}`] ?? (n ? t[`${n}${h}`] : void 0), u = (h) => {
|
|
581
|
+
const d = r(h);
|
|
582
|
+
return d === void 0 ? void 0 : qt(d, o);
|
|
583
|
+
}, s = r("FontSettings"), c = r("TextAppearance");
|
|
583
584
|
return {
|
|
584
|
-
fontFamily:
|
|
585
|
-
fontWeight:
|
|
586
|
-
fontStyle:
|
|
585
|
+
fontFamily: ye(r("FontFamily")),
|
|
586
|
+
fontWeight: s == null ? void 0 : s.fontWeight,
|
|
587
|
+
fontStyle: s == null ? void 0 : s.fontStyle,
|
|
587
588
|
fontSize: u("FontSize"),
|
|
588
589
|
lineHeight: u("LineHeight"),
|
|
589
590
|
letterSpacing: u("LetterSpacing"),
|
|
590
591
|
wordSpacing: u("WordSpacing"),
|
|
591
|
-
textTransform:
|
|
592
|
-
textDecoration:
|
|
593
|
-
fontVariant:
|
|
592
|
+
textTransform: c == null ? void 0 : c.textTransform,
|
|
593
|
+
textDecoration: c == null ? void 0 : c.textDecoration,
|
|
594
|
+
fontVariant: c == null ? void 0 : c.fontVariant
|
|
594
595
|
};
|
|
595
596
|
}
|
|
596
597
|
function Mt(t) {
|
|
597
598
|
const e = t.type ?? "text";
|
|
598
599
|
return e === "list" ? "listA" : e;
|
|
599
600
|
}
|
|
600
|
-
function
|
|
601
|
-
return t != null && t.grid && Array.isArray(t.placements) && t.placements.every((r) => typeof (r == null ? void 0 : r.top) == "number") ?
|
|
601
|
+
function Je(t, e, o, n) {
|
|
602
|
+
return t != null && t.grid && Array.isArray(t.placements) && t.placements.every((r) => typeof (r == null ? void 0 : r.top) == "number") ? Qe(Be(t, n), e) : Te(e.map(Mt), n, 1, o);
|
|
602
603
|
}
|
|
603
|
-
function
|
|
604
|
+
function Qe(t, e) {
|
|
604
605
|
const o = (n, r) => n.height !== void 0 && e[r] && Mt(e[r]) !== "image";
|
|
605
606
|
return t.placements.some(o) ? {
|
|
606
607
|
...t,
|
|
607
608
|
placements: t.placements.map((n, r) => {
|
|
608
609
|
if (!o(n, r)) return n;
|
|
609
|
-
const { height: u, ...
|
|
610
|
-
return
|
|
610
|
+
const { height: u, ...s } = n;
|
|
611
|
+
return s;
|
|
611
612
|
})
|
|
612
613
|
} : t;
|
|
613
614
|
}
|
|
614
|
-
function
|
|
615
|
+
function Pe(t, e) {
|
|
615
616
|
const o = (n, r) => Math.abs(n - r) < 1e-4;
|
|
616
617
|
return o(t.height, e.height) && t.heights.length === e.heights.length && t.heights.every((n, r) => o(n, e.heights[r]));
|
|
617
618
|
}
|
|
618
|
-
function
|
|
619
|
+
function yt(t, e) {
|
|
619
620
|
const { columns: o } = t.grid, n = t.placements[e];
|
|
620
621
|
if (!n) return { column: 0, span: Math.min(o, Math.max(1, Math.round(o / 4))), top: 0 };
|
|
621
622
|
const r = Math.min(n.span, o), u = { column: Math.min(n.column, o - r), span: r, top: n.top };
|
|
622
623
|
return typeof n.height == "number" ? { ...u, height: n.height } : u;
|
|
623
624
|
}
|
|
624
|
-
function
|
|
625
|
+
function to({
|
|
625
626
|
settings: t,
|
|
626
627
|
content: e = [],
|
|
627
628
|
isEditor: o,
|
|
628
629
|
isEditMode: n,
|
|
629
630
|
isPreviewMode: r,
|
|
630
631
|
layoutId: u,
|
|
631
|
-
portalId:
|
|
632
|
-
currentState:
|
|
633
|
-
unavailableStates:
|
|
634
|
-
onOpenChange:
|
|
635
|
-
onUpdateSettings:
|
|
632
|
+
portalId: s,
|
|
633
|
+
currentState: c,
|
|
634
|
+
unavailableStates: h = [],
|
|
635
|
+
onOpenChange: d,
|
|
636
|
+
onUpdateSettings: g
|
|
636
637
|
}) {
|
|
637
638
|
var Ot, Ht;
|
|
638
|
-
const { prefix: a } = $e(),
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
}, [
|
|
642
|
-
|
|
643
|
-
}, [u]),
|
|
644
|
-
if (
|
|
645
|
-
|
|
639
|
+
const { prefix: a } = $e(), z = Z(() => Ke(a), [a]), [f, m] = U(!1), [x, R] = U(!1), [N, T] = U(!1), k = !!(o && !r), A = k && c === "open" && !h.includes("open"), S = A || !k && f, ct = je(t);
|
|
640
|
+
xe(S && !k), D(() => {
|
|
641
|
+
d == null || d(S);
|
|
642
|
+
}, [S, d]), D(() => {
|
|
643
|
+
m(!1);
|
|
644
|
+
}, [u]), D(() => {
|
|
645
|
+
if (S) {
|
|
646
|
+
R(!0);
|
|
646
647
|
return;
|
|
647
648
|
}
|
|
648
|
-
|
|
649
|
-
const i = window.setTimeout(() =>
|
|
649
|
+
T(!1);
|
|
650
|
+
const i = window.setTimeout(() => R(!1), ct === "none" ? 0 : Y);
|
|
650
651
|
return () => window.clearTimeout(i);
|
|
651
|
-
}, [
|
|
652
|
-
if (!
|
|
652
|
+
}, [S, ct]), D(() => {
|
|
653
|
+
if (!S || !x) return;
|
|
653
654
|
const i = Q.current;
|
|
654
655
|
i && getComputedStyle(i.querySelector("[role=dialog]") ?? i).opacity;
|
|
655
|
-
const l = requestAnimationFrame(() =>
|
|
656
|
+
const l = requestAnimationFrame(() => T(!0));
|
|
656
657
|
return () => cancelAnimationFrame(l);
|
|
657
|
-
}, [
|
|
658
|
-
if (!
|
|
658
|
+
}, [S, x]), D(() => {
|
|
659
|
+
if (!S || k) return;
|
|
659
660
|
const i = (l) => {
|
|
660
|
-
l.key === "Escape" &&
|
|
661
|
+
l.key === "Escape" && m(!1);
|
|
661
662
|
};
|
|
662
663
|
return window.addEventListener("keydown", i), () => window.removeEventListener("keydown", i);
|
|
663
|
-
}, [
|
|
664
|
-
const _ = (i) => qt(i ?? 0, o), kt =
|
|
664
|
+
}, [S, k]);
|
|
665
|
+
const _ = (i) => qt(i ?? 0, o), kt = _e(t), ot = (Ot = t.menuLayout) == null ? void 0 : Ot.grid, Ct = Se(t, ot != null && ot.columnWidth ? ot : Zt), st = `min(100%, ${_(Ae(t, Ct))})`, ut = _(t.popupOffset), ee = {
|
|
665
666
|
left: `calc(0px + ${ut})`,
|
|
666
667
|
center: `calc((100% - ${st}) / 2 + ${ut})`,
|
|
667
668
|
right: `calc(100% - ${st} + ${ut})`
|
|
668
|
-
}[
|
|
669
|
-
() => ({ columns: It, columnWidth:
|
|
670
|
-
[It,
|
|
669
|
+
}[ze(t)], { columns: It, columnWidth: St, gutter: _t, rowGap: zt } = Ct, At = Z(
|
|
670
|
+
() => ({ columns: It, columnWidth: St, gutter: _t, rowGap: zt }),
|
|
671
|
+
[It, St, _t, zt]
|
|
671
672
|
), J = Z(
|
|
672
|
-
() =>
|
|
673
|
-
[t.menuLayout, e, kt,
|
|
674
|
-
), [ht, oe] =
|
|
675
|
-
gridTemplateColumns: `repeat(${
|
|
673
|
+
() => Je(t.menuLayout, e, kt, At),
|
|
674
|
+
[t.menuLayout, e, kt, At]
|
|
675
|
+
), [ht, oe] = U(null), pt = Z(() => ht ? Vt(J, ht) : null, [J, ht]), I = Z(() => pt ? Ge(J, pt) : J, [J, pt]), { columns: F, gutter: dt, columnWidth: mt } = I.grid, ne = F * mt + (F - 1) * dt, gt = mt > 0 ? {
|
|
676
|
+
gridTemplateColumns: `repeat(${F}, minmax(0, ${_(mt)}))`,
|
|
676
677
|
columnGap: _(dt),
|
|
677
678
|
width: `min(100%, ${_(ne)})`,
|
|
678
679
|
marginInline: "auto"
|
|
679
|
-
} : { gridTemplateColumns: `repeat(${
|
|
680
|
+
} : { gridTemplateColumns: `repeat(${F}, minmax(0, 1fr))`, columnGap: _(dt) }, Nt = t.triggerLabel || "Menu", nt = Ne(t.triggerPadding), V = t.triggerType === "icon" && !t.triggerIcon ? "burger" : t.triggerType ?? "text", re = tt(t, "trigger", o), ie = tt(t, "title", o), ae = {
|
|
680
681
|
text: tt(t, "text", o),
|
|
681
682
|
listA: tt(t, "listA", o, "text"),
|
|
682
683
|
listB: tt(t, "listB", o, "text")
|
|
683
|
-
},
|
|
684
|
+
}, O = ((Ht = t.stateOverrides) == null ? void 0 : Ht.open) ?? {}, Rt = {
|
|
684
685
|
[`--${a}-trigger-bg`]: t.barBackgroundColor,
|
|
685
|
-
[`--${a}-trigger-color`]: (
|
|
686
|
-
[`--${a}-overlay-color`]:
|
|
686
|
+
[`--${a}-trigger-color`]: (S ? O.triggerColor : void 0) ?? t.triggerColor,
|
|
687
|
+
[`--${a}-overlay-color`]: O.overlayColor ?? t.overlayColor,
|
|
687
688
|
[`--${a}-overlay-blur`]: t.overlayBlur ? `blur(${_(t.overlayBlur)})` : void 0,
|
|
688
|
-
[`--${a}-popup-bg`]:
|
|
689
|
-
[`--${a}-title-color`]:
|
|
690
|
-
[`--${a}-text-color`]:
|
|
691
|
-
[`--${a}-list-a-color`]:
|
|
692
|
-
[`--${a}-list-b-color`]:
|
|
693
|
-
}, Tt =
|
|
689
|
+
[`--${a}-popup-bg`]: O.popupBackgroundColor ?? t.popupBackgroundColor,
|
|
690
|
+
[`--${a}-title-color`]: O.titleColor ?? t.titleColor,
|
|
691
|
+
[`--${a}-text-color`]: O.textColor ?? t.textColor,
|
|
692
|
+
[`--${a}-list-a-color`]: O.listAColor ?? t.listAColor,
|
|
693
|
+
[`--${a}-list-b-color`]: O.listBColor ?? t.listBColor
|
|
694
|
+
}, Tt = W(null), le = Z(() => {
|
|
694
695
|
const i = Tt.current;
|
|
695
|
-
if (!
|
|
696
|
+
if (!x || !o || !i) return;
|
|
696
697
|
const l = getComputedStyle(i);
|
|
697
698
|
return Object.fromEntries(
|
|
698
|
-
|
|
699
|
+
Ve.map((p) => [p, l.getPropertyValue(p).trim()]).filter(([, p]) => p)
|
|
699
700
|
);
|
|
700
|
-
}, [
|
|
701
|
+
}, [x, o]), Q = W(null), Lt = W(null), Bt = W(null), ft = W(null), P = W([]), [B, ce] = U(null), $t = W(null), X = (i) => {
|
|
701
702
|
$t.current = i, ce(i);
|
|
702
|
-
},
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
}, [
|
|
706
|
-
const [bt, Et] =
|
|
703
|
+
}, G = !!(A && n && g), se = B ? Xt(I, B) : null;
|
|
704
|
+
D(() => {
|
|
705
|
+
G || X(null);
|
|
706
|
+
}, [G]);
|
|
707
|
+
const [bt, Et] = U(null);
|
|
707
708
|
Ut(() => {
|
|
708
709
|
const i = Lt.current;
|
|
709
|
-
if (!
|
|
710
|
+
if (!x || !i) {
|
|
710
711
|
Et(null);
|
|
711
712
|
return;
|
|
712
713
|
}
|
|
713
714
|
const l = () => {
|
|
714
|
-
const
|
|
715
|
-
if (!
|
|
716
|
-
const
|
|
717
|
-
Et((
|
|
715
|
+
const w = Q.current;
|
|
716
|
+
if (!w) return;
|
|
717
|
+
const b = w.getBoundingClientRect(), $ = i.getBoundingClientRect(), M = { top: $.top - b.top, left: $.left - b.left, width: $.width, height: $.height };
|
|
718
|
+
Et((v) => v && v.top === M.top && v.left === M.left && v.width === M.width && v.height === M.height ? v : M);
|
|
718
719
|
};
|
|
719
720
|
l();
|
|
720
|
-
const
|
|
721
|
-
return
|
|
722
|
-
|
|
721
|
+
const p = new ResizeObserver(l);
|
|
722
|
+
return p.observe(i), window.addEventListener("resize", l), window.addEventListener("scroll", l, { capture: !0, passive: !0 }), () => {
|
|
723
|
+
p.disconnect(), window.removeEventListener("resize", l), window.removeEventListener("scroll", l, { capture: !0 });
|
|
723
724
|
};
|
|
724
|
-
}, [
|
|
725
|
+
}, [x]), Ut(() => {
|
|
725
726
|
const i = Bt.current, l = ft.current;
|
|
726
|
-
if (!
|
|
727
|
-
const
|
|
727
|
+
if (!x || !i || !l) return;
|
|
728
|
+
const p = () => {
|
|
728
729
|
var M;
|
|
729
|
-
const
|
|
730
|
-
if (
|
|
731
|
-
const
|
|
732
|
-
height: i.getBoundingClientRect().height /
|
|
733
|
-
heights: e.map((
|
|
734
|
-
var
|
|
735
|
-
return (((
|
|
730
|
+
const b = (M = Q.current) == null ? void 0 : M.getBoundingClientRect().width;
|
|
731
|
+
if (!b) return;
|
|
732
|
+
const $ = {
|
|
733
|
+
height: i.getBoundingClientRect().height / b,
|
|
734
|
+
heights: e.map((v, L) => {
|
|
735
|
+
var y;
|
|
736
|
+
return (((y = P.current[L]) == null ? void 0 : y.getBoundingClientRect().height) ?? 0) / b;
|
|
736
737
|
})
|
|
737
738
|
};
|
|
738
|
-
oe((
|
|
739
|
+
oe((v) => v && Pe(v, $) ? v : $);
|
|
739
740
|
};
|
|
740
|
-
|
|
741
|
-
const
|
|
742
|
-
return
|
|
743
|
-
}, [
|
|
744
|
-
const
|
|
745
|
-
const i = ft.current, l = i.getBoundingClientRect(),
|
|
746
|
-
return { area: l, gap:
|
|
747
|
-
}, ue = (i, l,
|
|
748
|
-
var L,
|
|
749
|
-
if (!
|
|
741
|
+
p();
|
|
742
|
+
const w = new ResizeObserver(p);
|
|
743
|
+
return w.observe(i), w.observe(l), P.current.slice(0, e.length).forEach((b) => b && w.observe(b)), () => w.disconnect();
|
|
744
|
+
}, [x, e]);
|
|
745
|
+
const Ft = () => {
|
|
746
|
+
const i = ft.current, l = i.getBoundingClientRect(), p = i.offsetWidth ? l.width / i.offsetWidth : 1, w = (parseFloat(getComputedStyle(i).columnGap) || 0) * p;
|
|
747
|
+
return { area: l, gap: w, pitch: (l.width + w) / F };
|
|
748
|
+
}, ue = (i, l, p) => {
|
|
749
|
+
var L, y;
|
|
750
|
+
if (!G || !I.placements[l] || i.button !== 0) return;
|
|
750
751
|
i.preventDefault(), i.stopPropagation(), i.currentTarget.setPointerCapture(i.pointerId);
|
|
751
|
-
const { area:
|
|
752
|
+
const { area: w, pitch: b } = Ft(), $ = ((L = P.current[l]) == null ? void 0 : L.getBoundingClientRect()) ?? i.currentTarget.getBoundingClientRect(), M = ((y = Q.current) == null ? void 0 : y.getBoundingClientRect().width) || 1, v = yt(I, l);
|
|
752
753
|
X({
|
|
753
754
|
index: l,
|
|
754
755
|
pointerId: i.pointerId,
|
|
755
|
-
handle:
|
|
756
|
-
grabColumn: Math.min(Math.max(Math.floor((i.clientX -
|
|
757
|
-
grabY: i.clientY -
|
|
756
|
+
handle: p,
|
|
757
|
+
grabColumn: Math.min(Math.max(Math.floor((i.clientX - w.left) / b) - v.column, 0), v.span - 1),
|
|
758
|
+
grabY: i.clientY - $.top,
|
|
758
759
|
unit: M,
|
|
759
|
-
start:
|
|
760
|
-
placement:
|
|
761
|
-
measure: Vt(
|
|
762
|
-
height:
|
|
763
|
-
heights: e.map((
|
|
760
|
+
start: v,
|
|
761
|
+
placement: v,
|
|
762
|
+
measure: Vt(I, {
|
|
763
|
+
height: w.height / M,
|
|
764
|
+
heights: e.map((H, rt) => {
|
|
764
765
|
var E;
|
|
765
766
|
return (((E = P.current[rt]) == null ? void 0 : E.getBoundingClientRect().height) ?? 0) / M;
|
|
766
767
|
})
|
|
@@ -770,45 +771,45 @@ function Qe({
|
|
|
770
771
|
const l = $t.current;
|
|
771
772
|
if (!l || i.pointerId !== l.pointerId) return;
|
|
772
773
|
i.stopPropagation();
|
|
773
|
-
const { area:
|
|
774
|
-
if (!
|
|
774
|
+
const { area: p, gap: w, pitch: b } = Ft(), { start: $, measure: M, handle: v } = l, L = M.height;
|
|
775
|
+
if (!v) {
|
|
775
776
|
X({
|
|
776
777
|
...l,
|
|
777
778
|
placement: {
|
|
778
|
-
|
|
779
|
-
column: Math.min(Math.max(Math.floor((i.clientX -
|
|
780
|
-
top: K(
|
|
779
|
+
...$,
|
|
780
|
+
column: Math.min(Math.max(Math.floor((i.clientX - p.left) / b) - l.grabColumn, 0), F - $.span),
|
|
781
|
+
top: K(I.grid, (i.clientY - l.grabY - p.top) / l.unit, L - M.heights[l.index])
|
|
781
782
|
}
|
|
782
783
|
});
|
|
783
784
|
return;
|
|
784
785
|
}
|
|
785
|
-
const
|
|
786
|
-
let { column: E, span: it, top:
|
|
787
|
-
if (
|
|
788
|
-
const jt =
|
|
789
|
-
|
|
786
|
+
const y = i.clientX - p.left, H = (i.clientY - p.top) / l.unit, rt = $.column + $.span;
|
|
787
|
+
let { column: E, span: it, top: j } = $, at = $.height;
|
|
788
|
+
if (v.includes("left") && (E = Math.min(Math.max(Math.round(y / b), 0), rt - 1), it = rt - E), v.includes("right") && (it = Math.min(Math.max(Math.round((y + w) / b), E + 1), F) - E), v.includes("top")) {
|
|
789
|
+
const jt = $.top + ($.height ?? M.heights[l.index] ?? 0);
|
|
790
|
+
j = K(I.grid, H, jt - wt(I.grid)), at = lt(I.grid, jt - j, L - j);
|
|
790
791
|
}
|
|
791
|
-
|
|
792
|
+
v.includes("bottom") && (at = lt(I.grid, H - j, L - j)), X({ ...l, placement: at === void 0 ? { column: E, span: it, top: j } : { column: E, span: it, top: j, height: at } });
|
|
792
793
|
}, pe = (i) => {
|
|
793
794
|
const l = $t.current;
|
|
794
795
|
if (!l || i.pointerId !== l.pointerId) return;
|
|
795
796
|
i.stopPropagation();
|
|
796
|
-
const
|
|
797
|
-
|
|
797
|
+
const p = Xt(I, l), w = p == null ? void 0 : p.placements[l.index];
|
|
798
|
+
p && w && !Ze(w, yt(I, l.index)) && (g == null || g({ ...t, menuLayout: p })), X(null);
|
|
798
799
|
}, de = (i, l) => {
|
|
799
800
|
i.stopPropagation();
|
|
800
|
-
const
|
|
801
|
-
if (!
|
|
802
|
-
const { height:
|
|
803
|
-
|
|
801
|
+
const p = I.placements[l];
|
|
802
|
+
if (!G || !p || p.height === void 0) return;
|
|
803
|
+
const { height: w, ...b } = p;
|
|
804
|
+
g == null || g({
|
|
804
805
|
...t,
|
|
805
|
-
menuLayout: { ...
|
|
806
|
+
menuLayout: { ...I, edited: !0, placements: I.placements.map(($, M) => M === l ? b : $) }
|
|
806
807
|
});
|
|
807
|
-
}, vt = () =>
|
|
808
|
+
}, vt = () => m(!1), me = (i) => {
|
|
808
809
|
!k && i.target.closest("a") && vt();
|
|
809
810
|
}, ge = (i, l) => {
|
|
810
|
-
const
|
|
811
|
-
onPointerDown: (
|
|
811
|
+
const p = Mt(i), w = (i.images ?? []).filter((y) => y == null ? void 0 : y.assetId), b = (B == null ? void 0 : B.index) === l, $ = b ? B.placement : yt(I, l), M = $.height !== void 0, v = G && (!B || b), L = (y) => ({
|
|
812
|
+
onPointerDown: (H) => ue(H, l, y),
|
|
812
813
|
onPointerMove: he,
|
|
813
814
|
onPointerUp: pe,
|
|
814
815
|
onPointerCancel: () => X(null)
|
|
@@ -816,68 +817,68 @@ function Qe({
|
|
|
816
817
|
return /* @__PURE__ */ q(
|
|
817
818
|
"div",
|
|
818
819
|
{
|
|
819
|
-
className: `${a}-slot${
|
|
820
|
-
style: { gridColumn: `${
|
|
820
|
+
className: `${a}-slot${b ? ` ${a}-slot-dragged` : ""}`,
|
|
821
|
+
style: { gridColumn: `${$.column + 1} / span ${$.span}` },
|
|
821
822
|
children: [
|
|
822
|
-
/* @__PURE__ */
|
|
823
|
+
/* @__PURE__ */ C("div", { className: `${a}-spacer`, style: { height: _($.top) } }),
|
|
823
824
|
/* @__PURE__ */ q("div", { className: `${a}-frame`, children: [
|
|
824
825
|
/* @__PURE__ */ q(
|
|
825
826
|
"div",
|
|
826
827
|
{
|
|
827
|
-
ref: (
|
|
828
|
-
P.current[l] =
|
|
828
|
+
ref: (y) => {
|
|
829
|
+
P.current[l] = y;
|
|
829
830
|
},
|
|
830
831
|
className: [
|
|
831
|
-
`${a}-block ${a}-block-${
|
|
832
|
+
`${a}-block ${a}-block-${p}`,
|
|
832
833
|
M ? `${a}-block-sized` : "",
|
|
833
|
-
|
|
834
|
-
|
|
834
|
+
b ? `${a}-block-dragged` : "",
|
|
835
|
+
b && !se ? `${a}-block-invalid` : ""
|
|
835
836
|
].filter(Boolean).join(" "),
|
|
836
|
-
style: M ? { height: _(
|
|
837
|
-
...
|
|
837
|
+
style: M ? { height: _($.height) } : void 0,
|
|
838
|
+
...G ? L(null) : {},
|
|
838
839
|
children: [
|
|
839
|
-
i.title &&
|
|
840
|
-
|
|
840
|
+
i.title && p !== "image" ? /* @__PURE__ */ C("div", { className: `${a}-block-title`, style: { ...ie, marginBottom: _(t.titleGap) }, children: i.title }) : null,
|
|
841
|
+
p === "image" ? /* @__PURE__ */ C(oo, { prefix: a, images: w, isRunning: S, radius: _(t.imageRadius) }) : /* @__PURE__ */ C("div", { className: `${a}-block-text`, style: ae[p], children: /* @__PURE__ */ C(we, { content: Array.isArray(i.text) ? i.text : [] }) })
|
|
841
842
|
]
|
|
842
843
|
}
|
|
843
844
|
),
|
|
844
|
-
|
|
845
|
+
v ? (p === "image" ? Xe : qe).map((y) => /* @__PURE__ */ C(
|
|
845
846
|
"div",
|
|
846
847
|
{
|
|
847
|
-
className: `${a}-handle ${a}-handle-${
|
|
848
|
+
className: `${a}-handle ${a}-handle-${y}${b && B.handle === y ? ` ${a}-handle-active` : ""}`,
|
|
848
849
|
"aria-hidden": !0,
|
|
849
|
-
...L(
|
|
850
|
-
onDoubleClick:
|
|
850
|
+
...L(y),
|
|
851
|
+
onDoubleClick: y.includes("top") || y.includes("bottom") ? (H) => de(H, l) : void 0
|
|
851
852
|
},
|
|
852
|
-
|
|
853
|
+
y
|
|
853
854
|
)) : null
|
|
854
855
|
] })
|
|
855
856
|
]
|
|
856
857
|
},
|
|
857
858
|
l
|
|
858
859
|
);
|
|
859
|
-
},
|
|
860
|
+
}, Gt = {
|
|
860
861
|
...V === "text" ? re : void 0,
|
|
861
862
|
padding: [nt.top, nt.right, nt.bottom, nt.left].map((i) => _(i)).join(" "),
|
|
862
|
-
[`--${a}-icon-size`]: _(t.triggerIconSize ??
|
|
863
|
-
}, Wt = V === "text" ?
|
|
864
|
-
|
|
863
|
+
[`--${a}-icon-size`]: _(t.triggerIconSize ?? Ye)
|
|
864
|
+
}, Wt = V === "text" ? Nt : /* @__PURE__ */ C("span", { className: `${a}-icon ${a}-icon-${V}`, "aria-hidden": !0, children: V === "icon" ? /* @__PURE__ */ C(
|
|
865
|
+
Me,
|
|
865
866
|
{
|
|
866
867
|
url: t.triggerIcon,
|
|
867
868
|
fill: `var(--${a}-trigger-color)`,
|
|
868
869
|
hoverFill: `var(--${a}-trigger-color)`,
|
|
869
870
|
className: `${a}-icon-picture`
|
|
870
871
|
}
|
|
871
|
-
) : Array.from({ length: V === "burger" ? 3 : 2 }, (i, l) => /* @__PURE__ */
|
|
872
|
+
) : Array.from({ length: V === "burger" ? 3 : 2 }, (i, l) => /* @__PURE__ */ C("span", { className: `${a}-icon-line` }, l)) }), xt = I.grid.beat || et(I.grid), Dt = x ? /* @__PURE__ */ q(
|
|
872
873
|
"div",
|
|
873
874
|
{
|
|
874
875
|
ref: Q,
|
|
875
876
|
"data-selection": "none",
|
|
876
|
-
className: [`${a}-overlay`, `${a}-transition-${ct.replace(" ", "-")}`, o ? `${a}-overlay-editor` : "",
|
|
877
|
-
style: { ...le, ...
|
|
878
|
-
"aria-hidden": !
|
|
877
|
+
className: [`${a}-overlay`, `${a}-transition-${ct.replace(" ", "-")}`, o ? `${a}-overlay-editor` : "", N ? `${a}-overlay-active` : ""].filter(Boolean).join(" "),
|
|
878
|
+
style: { ...le, ...Rt },
|
|
879
|
+
"aria-hidden": !N,
|
|
879
880
|
children: [
|
|
880
|
-
/* @__PURE__ */
|
|
881
|
+
/* @__PURE__ */ C(
|
|
881
882
|
"button",
|
|
882
883
|
{
|
|
883
884
|
type: "button",
|
|
@@ -887,7 +888,7 @@ function Qe({
|
|
|
887
888
|
onClick: k ? void 0 : vt
|
|
888
889
|
}
|
|
889
890
|
),
|
|
890
|
-
/* @__PURE__ */
|
|
891
|
+
/* @__PURE__ */ C(
|
|
891
892
|
"div",
|
|
892
893
|
{
|
|
893
894
|
ref: Bt,
|
|
@@ -907,11 +908,11 @@ function Qe({
|
|
|
907
908
|
"div",
|
|
908
909
|
{
|
|
909
910
|
ref: ft,
|
|
910
|
-
className: `${a}-grid${
|
|
911
|
+
className: `${a}-grid${G ? ` ${a}-grid-editable` : ""}`,
|
|
911
912
|
style: gt,
|
|
912
913
|
children: [
|
|
913
914
|
e.map(ge),
|
|
914
|
-
|
|
915
|
+
G ? /* @__PURE__ */ C(
|
|
915
916
|
"div",
|
|
916
917
|
{
|
|
917
918
|
className: `${a}-guides${xt > 0 ? ` ${a}-guides-beats` : ""}${B ? ` ${a}-guides-shown` : ""}`,
|
|
@@ -921,7 +922,7 @@ function Qe({
|
|
|
921
922
|
[`--${a}-beat`]: xt > 0 ? _(xt) : void 0
|
|
922
923
|
},
|
|
923
924
|
"aria-hidden": !0,
|
|
924
|
-
children: Array.from({ length:
|
|
925
|
+
children: Array.from({ length: F }, (i, l) => /* @__PURE__ */ C("div", { className: `${a}-guide` }, l))
|
|
925
926
|
}
|
|
926
927
|
) : null
|
|
927
928
|
]
|
|
@@ -929,19 +930,19 @@ function Qe({
|
|
|
929
930
|
)
|
|
930
931
|
}
|
|
931
932
|
),
|
|
932
|
-
bt ? /* @__PURE__ */
|
|
933
|
+
bt ? /* @__PURE__ */ C(
|
|
933
934
|
"button",
|
|
934
935
|
{
|
|
935
936
|
type: "button",
|
|
936
937
|
className: [
|
|
937
938
|
`${a}-button ${a}-close`,
|
|
938
|
-
|
|
939
|
+
N ? `${a}-button-open` : "",
|
|
939
940
|
k ? `${a}-close-inert` : ""
|
|
940
941
|
].filter(Boolean).join(" "),
|
|
941
|
-
style: { ...
|
|
942
|
+
style: { ...Gt, ...bt },
|
|
942
943
|
"aria-label": "Close menu",
|
|
943
|
-
"aria-expanded":
|
|
944
|
-
tabIndex:
|
|
944
|
+
"aria-expanded": S,
|
|
945
|
+
tabIndex: N ? void 0 : -1,
|
|
945
946
|
onClick: k ? void 0 : vt,
|
|
946
947
|
children: Wt
|
|
947
948
|
}
|
|
@@ -949,78 +950,118 @@ function Qe({
|
|
|
949
950
|
]
|
|
950
951
|
}
|
|
951
952
|
) : null;
|
|
952
|
-
return /* @__PURE__ */ q("div", { ref: Tt, className: `${a}-root`, style:
|
|
953
|
-
/* @__PURE__ */
|
|
954
|
-
/* @__PURE__ */
|
|
953
|
+
return /* @__PURE__ */ q("div", { ref: Tt, className: `${a}-root`, style: Rt, "data-edit-mode": n ? "" : void 0, children: [
|
|
954
|
+
/* @__PURE__ */ C("style", { dangerouslySetInnerHTML: { __html: z } }),
|
|
955
|
+
/* @__PURE__ */ C(
|
|
955
956
|
"button",
|
|
956
957
|
{
|
|
957
958
|
ref: Lt,
|
|
958
959
|
type: "button",
|
|
959
960
|
className: [
|
|
960
961
|
`${a}-button`,
|
|
961
|
-
|
|
962
|
+
S ? `${a}-button-open` : "",
|
|
962
963
|
// the close button over the popup stands in for it while the popup shows
|
|
963
964
|
bt ? `${a}-button-hidden` : ""
|
|
964
965
|
].filter(Boolean).join(" "),
|
|
965
|
-
style:
|
|
966
|
-
"aria-expanded":
|
|
967
|
-
"aria-label": V === "text" ? void 0 :
|
|
968
|
-
onClick: k ? void 0 : () =>
|
|
966
|
+
style: Gt,
|
|
967
|
+
"aria-expanded": S,
|
|
968
|
+
"aria-label": V === "text" ? void 0 : Nt,
|
|
969
|
+
onClick: k ? void 0 : () => m((i) => !i),
|
|
969
970
|
children: Wt
|
|
970
971
|
}
|
|
971
972
|
),
|
|
972
|
-
Dt && typeof document < "u" ? fe(Dt, (
|
|
973
|
+
Dt && typeof document < "u" ? fe(Dt, (s ? document.getElementById(s) : null) ?? document.body) : null
|
|
973
974
|
] });
|
|
974
975
|
}
|
|
975
|
-
function
|
|
976
|
-
|
|
977
|
-
|
|
976
|
+
function eo(t) {
|
|
977
|
+
return t.type === "video" ? !0 : t.type ? !1 : /\.(mp4|webm|ogg|mov)(\?|$)/i.test(t.name || t.assetId);
|
|
978
|
+
}
|
|
979
|
+
function oo({ prefix: t, images: e, isRunning: o, radius: n }) {
|
|
980
|
+
const [r, u] = U(0), s = W([]), c = e.length;
|
|
981
|
+
return D(() => {
|
|
978
982
|
if (!o || c < 2) {
|
|
979
983
|
u(0);
|
|
980
984
|
return;
|
|
981
985
|
}
|
|
982
|
-
const
|
|
983
|
-
return () => window.clearInterval(
|
|
984
|
-
}, [o, c]),
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
986
|
+
const h = window.setInterval(() => u((d) => (d + 1) % c), Oe);
|
|
987
|
+
return () => window.clearInterval(h);
|
|
988
|
+
}, [o, c]), D(() => {
|
|
989
|
+
s.current.slice(0, c).forEach((h, d) => {
|
|
990
|
+
var g;
|
|
991
|
+
h && (o && d === r % c ? (g = h.play()) == null || g.catch(() => {
|
|
992
|
+
}) : h.pause());
|
|
993
|
+
});
|
|
994
|
+
}, [o, r, c, e]), /* @__PURE__ */ C("div", { className: `${t}-images`, children: e.map((h, d) => {
|
|
995
|
+
const g = d === r % c, a = `${t}-image${g ? "" : ` ${t}-image-hidden`}`, z = { borderRadius: n };
|
|
996
|
+
return be(h) ? /* @__PURE__ */ C(
|
|
997
|
+
ve,
|
|
998
|
+
{
|
|
999
|
+
className: a,
|
|
1000
|
+
media: h,
|
|
1001
|
+
fit: "cover",
|
|
1002
|
+
lazy: !1,
|
|
1003
|
+
silentLoop: !0,
|
|
1004
|
+
"aria-hidden": !g,
|
|
1005
|
+
style: z
|
|
1006
|
+
},
|
|
1007
|
+
d
|
|
1008
|
+
) : eo(h) ? /* @__PURE__ */ C(
|
|
1009
|
+
"video",
|
|
1010
|
+
{
|
|
1011
|
+
ref: (f) => {
|
|
1012
|
+
s.current[d] = f;
|
|
1013
|
+
},
|
|
1014
|
+
className: a,
|
|
1015
|
+
src: h.assetId,
|
|
1016
|
+
autoPlay: o && g,
|
|
1017
|
+
muted: !0,
|
|
1018
|
+
loop: !0,
|
|
1019
|
+
playsInline: !0,
|
|
1020
|
+
"aria-hidden": !g,
|
|
1021
|
+
style: z
|
|
1022
|
+
},
|
|
1023
|
+
d
|
|
1024
|
+
) : /* @__PURE__ */ C(
|
|
1025
|
+
"img",
|
|
1026
|
+
{
|
|
1027
|
+
className: a,
|
|
1028
|
+
src: h.assetId,
|
|
1029
|
+
alt: h.name ?? "",
|
|
1030
|
+
"aria-hidden": !g,
|
|
1031
|
+
style: z
|
|
1032
|
+
},
|
|
1033
|
+
d
|
|
1034
|
+
);
|
|
1035
|
+
}) });
|
|
1036
|
+
}
|
|
1037
|
+
const go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
997
1038
|
__proto__: null,
|
|
998
1039
|
POPUP_MENU_TRANSITIONS: te,
|
|
999
|
-
POPUP_MENU_TRIGGER_TYPES:
|
|
1000
|
-
PopupMenu:
|
|
1040
|
+
POPUP_MENU_TRIGGER_TYPES: Ue,
|
|
1041
|
+
PopupMenu: to
|
|
1001
1042
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1002
1043
|
export {
|
|
1003
|
-
|
|
1004
|
-
|
|
1044
|
+
Ce as D,
|
|
1045
|
+
Ie as P,
|
|
1005
1046
|
K as a,
|
|
1006
1047
|
lt as b,
|
|
1007
|
-
|
|
1048
|
+
_e as c,
|
|
1008
1049
|
Kt as d,
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1050
|
+
Ae as e,
|
|
1051
|
+
Be as f,
|
|
1052
|
+
Te as g,
|
|
1053
|
+
Ne as h,
|
|
1054
|
+
Le as i,
|
|
1055
|
+
Se as j,
|
|
1015
1056
|
Zt as k,
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1057
|
+
mo as l,
|
|
1058
|
+
Ee as m,
|
|
1059
|
+
Re as n,
|
|
1060
|
+
ke as o,
|
|
1020
1061
|
te as p,
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1062
|
+
Ue as q,
|
|
1063
|
+
Fe as r,
|
|
1064
|
+
Ge as s,
|
|
1065
|
+
to as t,
|
|
1066
|
+
go as u
|
|
1026
1067
|
};
|