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