@cntrl-site/components 1.0.111-alpha.0 → 1.0.111
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-DbxkGNoB.mjs → components-DtO0Ti47.mjs} +29 -605
- package/dist/components-f82884Bk.js +1 -0
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +8 -9
- package/dist/elements.node.js +1 -1
- package/dist/elements.node.mjs +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +27 -44
- package/dist/types/SchemaV1.d.ts +0 -2
- package/package.json +1 -1
- package/dist/Components/PopupMenu/PopupMenu.d.ts +0 -57
- package/dist/Components/PopupMenu/PopupMenuComponent.d.ts +0 -587
- package/dist/Components/PopupMenu/popupMenuLayout.d.ts +0 -140
- package/dist/PopupMenu-BVc8Y4Tt.mjs +0 -929
- package/dist/PopupMenu-Dty5qHl8.js +0 -348
- package/dist/components-ByRCe3b5.js +0 -1
|
@@ -1,929 +0,0 @@
|
|
|
1
|
-
import { jsxs as V, jsx as w } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as et, useState as U, useEffect as Z, useRef as lt, useLayoutEffect as ie } from "react";
|
|
3
|
-
import { s as Gt } from "./scalingValue-C9JH5L6O.mjs";
|
|
4
|
-
import { u as ae } from "./useScopedStyles-DhBG3557.mjs";
|
|
5
|
-
import { u as le } from "./useLightboxScrollLock-VQ07s7EJ.mjs";
|
|
6
|
-
import { n as se } from "./textStylesToCss-05Mn6I_2.mjs";
|
|
7
|
-
import { R as ce } from "./RichTextRenderer-D52Xto59.mjs";
|
|
8
|
-
import { S as he } from "./SvgImage-B5mR9y6q.mjs";
|
|
9
|
-
const Ht = 560 / 1440, Et = {
|
|
10
|
-
columns: 12,
|
|
11
|
-
columnWidth: 92 / 1440,
|
|
12
|
-
gutter: 20 / 1440,
|
|
13
|
-
beat: 8 / 1440
|
|
14
|
-
};
|
|
15
|
-
function ue(t, o = Et) {
|
|
16
|
-
const e = (n, r) => typeof n == "number" && Number.isFinite(n) ? n : r;
|
|
17
|
-
return {
|
|
18
|
-
columns: Math.max(1, Math.round(e(t.gridColumns, o.columns))),
|
|
19
|
-
columnWidth: Math.max(0, e(t.gridColumnWidth, o.columnWidth)),
|
|
20
|
-
gutter: Math.max(0, e(t.gridGutter, o.gutter)),
|
|
21
|
-
beat: Math.max(0, e(t.gridRowHeight, o.beat ?? 0))
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
function pe(t) {
|
|
25
|
-
const { top: o, bottom: e } = st(t.popupPadding);
|
|
26
|
-
return Math.max(0, (t.popupHeight ?? Ht) - o - e);
|
|
27
|
-
}
|
|
28
|
-
function st(t) {
|
|
29
|
-
if (typeof t == "number") return { top: t, right: t, bottom: t, left: t };
|
|
30
|
-
const o = (e) => typeof e == "number" && Number.isFinite(e) ? Math.max(0, e) : 0;
|
|
31
|
-
return { top: o(t == null ? void 0 : t.top), right: o(t == null ? void 0 : t.right), bottom: o(t == null ? void 0 : t.bottom), left: o(t == null ? void 0 : t.left) };
|
|
32
|
-
}
|
|
33
|
-
const de = {
|
|
34
|
-
span: {
|
|
35
|
-
text: { min: 1 / 4, max: 5 / 12 },
|
|
36
|
-
image: { min: 1 / 6, max: 1 / 3 },
|
|
37
|
-
listA: { min: 1 / 6, max: 1 / 4 },
|
|
38
|
-
listB: { min: 1 / 6, max: 1 / 4 }
|
|
39
|
-
},
|
|
40
|
-
breakChance: 0.25
|
|
41
|
-
};
|
|
42
|
-
function me(t, o, e, n, r = de) {
|
|
43
|
-
const l = Me(e), h = Math.max(1, Math.floor(o.columns)), s = [];
|
|
44
|
-
let u = 0, f = new Array(h).fill(!1);
|
|
45
|
-
const i = {};
|
|
46
|
-
for (const S of t) {
|
|
47
|
-
const B = i[S] ?? (i[S] = ve(r.span[S] ?? r.span.text, h, l));
|
|
48
|
-
let A = Lt(f, B);
|
|
49
|
-
const m = f.some(Boolean);
|
|
50
|
-
(A.length === 0 || m && l() < r.breakChance) && (u += 1, f = new Array(h).fill(!1), A = Lt(f, B));
|
|
51
|
-
const p = A[Math.floor(l() * A.length)];
|
|
52
|
-
for (let k = Math.max(0, p - 1); k < Math.min(h, p + B + 1); k++) f[k] = !0;
|
|
53
|
-
s.push({ column: p, span: B, row: u });
|
|
54
|
-
}
|
|
55
|
-
const N = u + 1;
|
|
56
|
-
return {
|
|
57
|
-
seed: e,
|
|
58
|
-
grid: { ...o, columns: h },
|
|
59
|
-
placements: s.map(({ column: S, span: B, row: A }) => ({ column: S, span: B, top: K(o, A * n / N, n) }))
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
function Ee() {
|
|
63
|
-
return Math.floor(Math.random() * 2147483647);
|
|
64
|
-
}
|
|
65
|
-
function K(t, o, e = 1 / 0) {
|
|
66
|
-
const n = t.beat ?? 0, r = Math.max(0, e), l = n > 0 ? Math.round(o / n) * n : o, h = l <= r ? l : n > 0 ? Math.floor(r / n + 1e-9) * n : r;
|
|
67
|
-
return Math.round(Math.max(0, h) * 1e6) / 1e6;
|
|
68
|
-
}
|
|
69
|
-
function Mt(t) {
|
|
70
|
-
return t.beat && t.beat > 0 ? t.beat : 8 / 1440;
|
|
71
|
-
}
|
|
72
|
-
function ct(t, o, e = 1 / 0) {
|
|
73
|
-
const n = t.beat ?? 0, r = Mt(t), l = n > 0 ? Math.round(o / n) * n : o, h = l <= e ? l : n > 0 ? Math.floor(e / n + 1e-9) * n : e;
|
|
74
|
-
return ht(Math.max(r, h));
|
|
75
|
-
}
|
|
76
|
-
function ge(t, o) {
|
|
77
|
-
const e = (n, r) => Math.abs(n - r) < 1e-9;
|
|
78
|
-
return Math.floor(t.columns) === Math.floor(o.columns) && e(t.columnWidth, o.columnWidth) && e(t.gutter, o.gutter) && e(t.beat ?? 0, o.beat ?? 0);
|
|
79
|
-
}
|
|
80
|
-
function fe(t, o) {
|
|
81
|
-
const e = { ...o, columns: Math.max(1, Math.floor(o.columns)) };
|
|
82
|
-
if (ge(t.grid, e)) return t;
|
|
83
|
-
const n = Math.max(1, Math.floor(t.grid.columns)), r = e.columns, l = (s) => n === r ? s : Math.round(s * r / n), h = t.placements.map((s) => {
|
|
84
|
-
const u = Math.min(r, Math.max(1, l(s.span))), f = Math.min(Math.max(0, l(s.column)), r - u), i = K(e, s.top);
|
|
85
|
-
return s.height === void 0 ? { column: f, span: u, top: i } : { column: f, span: u, top: i, height: ct(e, s.height) };
|
|
86
|
-
});
|
|
87
|
-
return { ...t, grid: e, placements: h };
|
|
88
|
-
}
|
|
89
|
-
function yt(t, o, e, n = 0) {
|
|
90
|
-
const r = (s) => n > 0 ? Math.floor(s / n + 1e-9) * n : s, l = e / 4, h = o > e - t + 1e-9 && e - t < l ? r(e - Math.min(o, l)) : t;
|
|
91
|
-
return { top: ht(Math.max(0, h)), maxHeight: ht(Math.max(0, r(Math.max(e - Math.max(0, h), l)))) };
|
|
92
|
-
}
|
|
93
|
-
function ht(t) {
|
|
94
|
-
return Math.round(t * 1e6) / 1e6;
|
|
95
|
-
}
|
|
96
|
-
function vt(t, o, e, n) {
|
|
97
|
-
return yt(t, o, e, n).top;
|
|
98
|
-
}
|
|
99
|
-
function Wt(t, o, e, n, r, l, h = 0) {
|
|
100
|
-
const s = vt(t.top, o, r, h), u = vt(e.top, n, r, h);
|
|
101
|
-
return t.column < e.column + e.span && e.column < t.column + t.span && s < u + n + l - 1e-9 && u < s + o + l - 1e-9;
|
|
102
|
-
}
|
|
103
|
-
function $e(t, o, e, n, r) {
|
|
104
|
-
const l = t.placements[o];
|
|
105
|
-
return l ? jt(t, o, { ...l, column: e, top: n }, r) : null;
|
|
106
|
-
}
|
|
107
|
-
function be(t, o, e, n) {
|
|
108
|
-
if (!t.placements[o]) return null;
|
|
109
|
-
const { columns: r } = t.grid, l = Math.min(Math.max(0, e.column), r - 1), h = Math.min(Math.max(1, e.span), r - l), s = K(t.grid, e.top, n ? n.height - Mt(t.grid) : 1 / 0), u = e.height === void 0 ? void 0 : ct(t.grid, e.height, n ? n.height - s : 1 / 0);
|
|
110
|
-
return jt(t, o, u === void 0 ? { column: l, span: h, top: s } : { column: l, span: h, top: s, height: u }, n);
|
|
111
|
-
}
|
|
112
|
-
function jt(t, o, e, n) {
|
|
113
|
-
const { columns: r, gutter: l, beat: h } = t.grid, s = Math.min(e.span, r);
|
|
114
|
-
if (s < 1 || e.column < 0 || e.column + s > r) return null;
|
|
115
|
-
const u = e.height ?? (n == null ? void 0 : n.heights[o]) ?? 0, f = {
|
|
116
|
-
column: e.column,
|
|
117
|
-
span: s,
|
|
118
|
-
top: K(t.grid, e.top, n ? n.height - u : 1 / 0),
|
|
119
|
-
...e.height === void 0 ? {} : { height: e.height }
|
|
120
|
-
};
|
|
121
|
-
return n && t.placements.some((i, N) => N !== o && Wt(f, u, i, n.heights[N] ?? 0, n.height, l, h)) ? null : {
|
|
122
|
-
...t,
|
|
123
|
-
edited: !0,
|
|
124
|
-
placements: t.placements.map((i, N) => N === o ? f : i)
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
function xe(t, o) {
|
|
128
|
-
const { gutter: e, columns: n } = t.grid, r = t.grid.beat ?? 0, l = o.height, h = t.placements.map((m, p) => o.heights[p] ?? 0), s = [...t.placements], u = (m, p) => ({ ...m, top: vt(m.top, p, l, r) }), f = s.map((m, p) => u(m, h[p])), i = f.map((m, p) => p).sort((m, p) => f[m].top - f[p].top || m - p), N = [], S = (m, p) => {
|
|
129
|
-
let { top: k } = m;
|
|
130
|
-
for (let R = !0; R; ) {
|
|
131
|
-
R = !1;
|
|
132
|
-
for (const _ of N) {
|
|
133
|
-
const x = u(s[_], h[_]);
|
|
134
|
-
if (!Wt({ ...m, top: k }, p, x, h[_], 1 / 0, e)) continue;
|
|
135
|
-
const d = x.top + h[_] + e;
|
|
136
|
-
k = ht(r > 0 ? Math.ceil(d / r - 1e-9) * r : d), R = !0;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return k;
|
|
140
|
-
}, B = (m, p) => yt(m, p, l, r).top < m - 1e-9;
|
|
141
|
-
let A = !1;
|
|
142
|
-
for (const m of i) {
|
|
143
|
-
const p = f[m];
|
|
144
|
-
let k = { column: p.column, top: S(p, h[m]) };
|
|
145
|
-
if (k.top !== p.top && B(k.top, h[m])) {
|
|
146
|
-
const R = Math.min(p.span, n), _ = Array.from({ length: Math.max(0, n - R + 1) }, (d, T) => T).sort((d, T) => Math.abs(d - p.column) - Math.abs(T - p.column) || d - T);
|
|
147
|
-
let x = null;
|
|
148
|
-
for (const d of _) {
|
|
149
|
-
const T = S({ ...p, column: d }, h[m]);
|
|
150
|
-
!B(T, h[m]) && (!x || T < x.top - 1e-9) && (x = { column: d, top: T });
|
|
151
|
-
}
|
|
152
|
-
x && (k = x);
|
|
153
|
-
}
|
|
154
|
-
(k.column !== p.column || k.top !== p.top) && (s[m] = { ...s[m], ...k }, A = !0), N.push(m);
|
|
155
|
-
}
|
|
156
|
-
return A ? { ...t, placements: s } : t;
|
|
157
|
-
}
|
|
158
|
-
function ve(t, o, e) {
|
|
159
|
-
const n = Math.max(1, Math.round(t.min * o)), r = Math.max(n, Math.round(t.max * o));
|
|
160
|
-
return Math.min(o, n + Math.floor(e() * (r - n + 1)));
|
|
161
|
-
}
|
|
162
|
-
function Lt(t, o) {
|
|
163
|
-
const e = [];
|
|
164
|
-
for (let n = 0; n + o <= t.length; n++) {
|
|
165
|
-
let r = !0;
|
|
166
|
-
for (let l = n; l < n + o; l++)
|
|
167
|
-
if (t[l]) {
|
|
168
|
-
r = !1;
|
|
169
|
-
break;
|
|
170
|
-
}
|
|
171
|
-
r && e.push(n);
|
|
172
|
-
}
|
|
173
|
-
return e;
|
|
174
|
-
}
|
|
175
|
-
function Me(t) {
|
|
176
|
-
let o = t >>> 0;
|
|
177
|
-
return () => {
|
|
178
|
-
o = o + 1831565813 >>> 0;
|
|
179
|
-
let e = o;
|
|
180
|
-
return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
const X = 300, ye = 3e3, we = ["burger", "plus", "image", "text"], ke = 24 / 1440, Ce = ["top", "right", "bottom", "left", "top-left", "top-right", "bottom-right", "bottom-left"];
|
|
184
|
-
function Ft(t, o) {
|
|
185
|
-
return { ...o, heights: o.heights.map((e, n) => {
|
|
186
|
-
var r;
|
|
187
|
-
return ((r = t.placements[n]) == null ? void 0 : r.height) ?? e;
|
|
188
|
-
}) };
|
|
189
|
-
}
|
|
190
|
-
function ze(t, o) {
|
|
191
|
-
return t.column === o.column && t.span === o.span && t.top === o.top && t.height === o.height;
|
|
192
|
-
}
|
|
193
|
-
function Dt(t, o) {
|
|
194
|
-
return o.handle ? be(t, o.index, o.placement, o.measure) : $e(t, o.index, o.placement.column, o.placement.top, o.measure);
|
|
195
|
-
}
|
|
196
|
-
function Ie(t) {
|
|
197
|
-
return `
|
|
198
|
-
/* there is no bar: the menu is only its trigger, placed left, centre or right across the navigation's width,
|
|
199
|
-
which lets the page take a pointer anywhere else across it */
|
|
200
|
-
.${t}-root {
|
|
201
|
-
position: relative;
|
|
202
|
-
width: 100%;
|
|
203
|
-
box-sizing: border-box;
|
|
204
|
-
pointer-events: none;
|
|
205
|
-
}
|
|
206
|
-
.${t}-bar {
|
|
207
|
-
display: grid;
|
|
208
|
-
grid-template-columns: 1fr auto 1fr;
|
|
209
|
-
align-items: start;
|
|
210
|
-
box-sizing: border-box;
|
|
211
|
-
}
|
|
212
|
-
/* as big as its icon or text and its padding */
|
|
213
|
-
.${t}-button {
|
|
214
|
-
all: unset;
|
|
215
|
-
box-sizing: border-box;
|
|
216
|
-
cursor: pointer;
|
|
217
|
-
white-space: nowrap;
|
|
218
|
-
pointer-events: auto;
|
|
219
|
-
color: var(--${t}-trigger-color);
|
|
220
|
-
background-color: var(--${t}-trigger-bg);
|
|
221
|
-
}
|
|
222
|
-
.${t}-button-icon {
|
|
223
|
-
display: flex;
|
|
224
|
-
align-items: center;
|
|
225
|
-
justify-content: center;
|
|
226
|
-
}
|
|
227
|
-
/* an icon trigger's lines, as thick as a twelfth of it and a pixel at least, drawn in the trigger's colour */
|
|
228
|
-
.${t}-icon {
|
|
229
|
-
position: relative;
|
|
230
|
-
display: block;
|
|
231
|
-
flex: none;
|
|
232
|
-
width: var(--${t}-icon-size);
|
|
233
|
-
height: var(--${t}-icon-size);
|
|
234
|
-
--${t}-icon-stroke: max(1px, calc(var(--${t}-icon-size) / 12));
|
|
235
|
-
transition: transform ${X}ms ease;
|
|
236
|
-
}
|
|
237
|
-
.${t}-icon-line {
|
|
238
|
-
position: absolute;
|
|
239
|
-
left: 0;
|
|
240
|
-
width: 100%;
|
|
241
|
-
height: var(--${t}-icon-stroke);
|
|
242
|
-
top: calc(50% - var(--${t}-icon-stroke) / 2);
|
|
243
|
-
background-color: currentColor;
|
|
244
|
-
transition: transform ${X}ms ease, opacity ${X}ms ease;
|
|
245
|
-
}
|
|
246
|
-
/* three lines, the outer two meeting in the middle and crossing as the popup opens, the middle one fading */
|
|
247
|
-
.${t}-icon-burger .${t}-icon-line:nth-child(1) { transform: translateY(calc(var(--${t}-icon-size) * -0.3)) rotate(0deg) scaleX(1); }
|
|
248
|
-
.${t}-icon-burger .${t}-icon-line:nth-child(3) { transform: translateY(calc(var(--${t}-icon-size) * 0.3)) rotate(0deg) scaleX(1); }
|
|
249
|
-
.${t}-button-open .${t}-icon-burger .${t}-icon-line:nth-child(1) { transform: translateY(0) rotate(45deg) scaleX(1); }
|
|
250
|
-
.${t}-button-open .${t}-icon-burger .${t}-icon-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
|
|
251
|
-
.${t}-button-open .${t}-icon-burger .${t}-icon-line:nth-child(3) { transform: translateY(0) rotate(-45deg) scaleX(1); }
|
|
252
|
-
/* a plus, turned an eighth as the popup opens, into a cross */
|
|
253
|
-
.${t}-icon-plus .${t}-icon-line:nth-child(2) { transform: rotate(90deg); }
|
|
254
|
-
.${t}-button-open .${t}-icon-plus { transform: rotate(45deg); }
|
|
255
|
-
/* the user's image, fitted to the icon's size: an SVG tinted with the trigger's colour, anything else as it is */
|
|
256
|
-
.${t}-icon-picture {
|
|
257
|
-
display: block;
|
|
258
|
-
width: 100%;
|
|
259
|
-
height: 100%;
|
|
260
|
-
}
|
|
261
|
-
@media (prefers-reduced-motion: reduce) {
|
|
262
|
-
.${t}-icon,
|
|
263
|
-
.${t}-icon-line {
|
|
264
|
-
transition: none;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
.${t}-slot-left { justify-self: start; }
|
|
268
|
-
.${t}-slot-center { justify-self: center; }
|
|
269
|
-
.${t}-slot-right { justify-self: end; }
|
|
270
|
-
.${t}-button:focus-visible {
|
|
271
|
-
outline: 1px solid currentColor;
|
|
272
|
-
outline-offset: 2px;
|
|
273
|
-
}
|
|
274
|
-
.${t}-overlay {
|
|
275
|
-
position: fixed;
|
|
276
|
-
inset: auto;
|
|
277
|
-
top: var(--cntrl-article-top, 0);
|
|
278
|
-
left: var(--cntrl-article-left, 0);
|
|
279
|
-
width: var(--cntrl-article-width, 100vw);
|
|
280
|
-
height: var(--cntrl-viewport-height, 100vh);
|
|
281
|
-
z-index: 2;
|
|
282
|
-
pointer-events: none;
|
|
283
|
-
overflow: hidden;
|
|
284
|
-
}
|
|
285
|
-
.${t}-overlay-active {
|
|
286
|
-
pointer-events: auto;
|
|
287
|
-
}
|
|
288
|
-
.${t}-backdrop {
|
|
289
|
-
all: unset;
|
|
290
|
-
position: absolute;
|
|
291
|
-
inset: 0;
|
|
292
|
-
background-color: var(--${t}-overlay-color);
|
|
293
|
-
opacity: 0;
|
|
294
|
-
transition: opacity ${X}ms ease;
|
|
295
|
-
}
|
|
296
|
-
.${t}-card {
|
|
297
|
-
position: absolute;
|
|
298
|
-
box-sizing: border-box;
|
|
299
|
-
overflow: hidden;
|
|
300
|
-
background-color: var(--${t}-popup-bg);
|
|
301
|
-
opacity: 0;
|
|
302
|
-
transform: translateY(-8px);
|
|
303
|
-
transition: opacity ${X}ms ease, transform ${X}ms ease;
|
|
304
|
-
}
|
|
305
|
-
.${t}-overlay-active .${t}-backdrop,
|
|
306
|
-
.${t}-overlay-active .${t}-card {
|
|
307
|
-
opacity: 1;
|
|
308
|
-
transform: none;
|
|
309
|
-
}
|
|
310
|
-
/* one row as tall as the popup, which every block shares: its column from the grid, its height from a spacer
|
|
311
|
-
above it. Each slot is a container as tall as that row, even where a short window makes it shorter than set,
|
|
312
|
-
and its block is held to the room left below its top, in whole beats once measured (see drawPopupMenuBlock),
|
|
313
|
-
so that a block never reaches below the popup, nor is pushed up over one above it */
|
|
314
|
-
.${t}-grid {
|
|
315
|
-
position: relative;
|
|
316
|
-
display: grid;
|
|
317
|
-
grid-template-rows: minmax(0, 1fr);
|
|
318
|
-
height: 100%;
|
|
319
|
-
}
|
|
320
|
-
/* the grid the blocks snap to, drawn as the article's is while a block is moved or resized: a hairline at both
|
|
321
|
-
edges of every column, and one down every beat from the popup's top inside its padding */
|
|
322
|
-
.${t}-guides {
|
|
323
|
-
position: absolute;
|
|
324
|
-
inset: 0;
|
|
325
|
-
z-index: 2;
|
|
326
|
-
display: grid;
|
|
327
|
-
grid-template-rows: minmax(0, 1fr);
|
|
328
|
-
pointer-events: none;
|
|
329
|
-
opacity: 0;
|
|
330
|
-
transition: opacity 200ms ease;
|
|
331
|
-
--${t}-guide-color: var(--cntrl-grid-color, rgba(255, 92, 2, 0.45));
|
|
332
|
-
}
|
|
333
|
-
.${t}-guides-shown {
|
|
334
|
-
opacity: 1;
|
|
335
|
-
}
|
|
336
|
-
.${t}-guides-beats {
|
|
337
|
-
background-image: repeating-linear-gradient(
|
|
338
|
-
to bottom,
|
|
339
|
-
var(--${t}-guide-color) 0 1px,
|
|
340
|
-
transparent 1px var(--${t}-beat)
|
|
341
|
-
);
|
|
342
|
-
}
|
|
343
|
-
.${t}-guide {
|
|
344
|
-
grid-row: 1;
|
|
345
|
-
box-shadow: inset 1px 0 var(--${t}-guide-color), inset -1px 0 var(--${t}-guide-color);
|
|
346
|
-
}
|
|
347
|
-
/* the block and, on the canvas, the handles it is resized by, which sit on its edges outside any scroller */
|
|
348
|
-
.${t}-frame {
|
|
349
|
-
position: relative;
|
|
350
|
-
display: flex;
|
|
351
|
-
flex-direction: column;
|
|
352
|
-
flex: none;
|
|
353
|
-
min-width: 0;
|
|
354
|
-
min-height: 0;
|
|
355
|
-
}
|
|
356
|
-
.${t}-slot {
|
|
357
|
-
display: flex;
|
|
358
|
-
flex-direction: column;
|
|
359
|
-
grid-row: 1;
|
|
360
|
-
min-width: 0;
|
|
361
|
-
min-height: 0;
|
|
362
|
-
container-type: size;
|
|
363
|
-
pointer-events: none;
|
|
364
|
-
}
|
|
365
|
-
.${t}-spacer {
|
|
366
|
-
flex: 0 1 auto;
|
|
367
|
-
min-height: 0;
|
|
368
|
-
}
|
|
369
|
-
.${t}-block {
|
|
370
|
-
flex: none;
|
|
371
|
-
min-width: 0;
|
|
372
|
-
max-height: var(--${t}-room-left, 100cqh);
|
|
373
|
-
pointer-events: auto;
|
|
374
|
-
}
|
|
375
|
-
/* text longer than the room left scrolls within its block; only then, as a scroller would cut the trimmed
|
|
376
|
-
text's descenders */
|
|
377
|
-
.${t}-block-full {
|
|
378
|
-
overflow-y: auto;
|
|
379
|
-
}
|
|
380
|
-
/* the text's box runs from the first line's cap height to the last line's baseline, where the browser can
|
|
381
|
-
trim it: a title lines up with the top of an image beside it, and the block is no taller than its text */
|
|
382
|
-
.${t}-block.${t}-block-text,
|
|
383
|
-
.${t}-block.${t}-block-listA,
|
|
384
|
-
.${t}-block.${t}-block-listB {
|
|
385
|
-
text-box: trim-both cap alphabetic;
|
|
386
|
-
}
|
|
387
|
-
.${t}-block-title {
|
|
388
|
-
color: var(--${t}-title-color);
|
|
389
|
-
}
|
|
390
|
-
.${t}-block-text {
|
|
391
|
-
color: var(--${t}-text-color);
|
|
392
|
-
}
|
|
393
|
-
.${t}-block-text a {
|
|
394
|
-
color: inherit;
|
|
395
|
-
}
|
|
396
|
-
.${t}-block-listA .${t}-block-text {
|
|
397
|
-
color: var(--${t}-list-a-color, var(--${t}-text-color));
|
|
398
|
-
}
|
|
399
|
-
.${t}-block-listB .${t}-block-text {
|
|
400
|
-
color: var(--${t}-list-b-color, var(--${t}-text-color));
|
|
401
|
-
}
|
|
402
|
-
.${t}-block-listA .${t}-block-text a,
|
|
403
|
-
.${t}-block-listB .${t}-block-text a {
|
|
404
|
-
text-decoration: none;
|
|
405
|
-
}
|
|
406
|
-
.${t}-block-listA .${t}-block-text a:hover,
|
|
407
|
-
.${t}-block-listB .${t}-block-text a:hover {
|
|
408
|
-
text-decoration: underline;
|
|
409
|
-
}
|
|
410
|
-
.${t}-images {
|
|
411
|
-
display: grid;
|
|
412
|
-
}
|
|
413
|
-
/* every image takes the same cell, so the block is as tall as its tallest image and keeps still as they change */
|
|
414
|
-
.${t}-image {
|
|
415
|
-
display: block;
|
|
416
|
-
grid-area: 1 / 1;
|
|
417
|
-
width: 100%;
|
|
418
|
-
height: auto;
|
|
419
|
-
/* an image always fills its box, cut where it is taller than the room left */
|
|
420
|
-
max-height: var(--${t}-room-left, 100cqh);
|
|
421
|
-
object-fit: cover;
|
|
422
|
-
}
|
|
423
|
-
/* a block resized to a height: its images fill it, cut to it */
|
|
424
|
-
.${t}-block-sized .${t}-images {
|
|
425
|
-
height: 100%;
|
|
426
|
-
grid-template-rows: minmax(0, 100%);
|
|
427
|
-
}
|
|
428
|
-
.${t}-block-sized .${t}-image {
|
|
429
|
-
height: 100%;
|
|
430
|
-
}
|
|
431
|
-
.${t}-image {
|
|
432
|
-
transition: opacity 800ms ease-in-out;
|
|
433
|
-
}
|
|
434
|
-
.${t}-image-hidden {
|
|
435
|
-
opacity: 0;
|
|
436
|
-
}
|
|
437
|
-
@media (prefers-reduced-motion: reduce) {
|
|
438
|
-
.${t}-image {
|
|
439
|
-
transition: none;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
.${t}-grid-editable .${t}-block {
|
|
443
|
-
cursor: grab;
|
|
444
|
-
touch-action: none;
|
|
445
|
-
user-select: none;
|
|
446
|
-
}
|
|
447
|
-
.${t}-grid-editable .${t}-block * {
|
|
448
|
-
pointer-events: none;
|
|
449
|
-
}
|
|
450
|
-
.${t}-slot-dragged {
|
|
451
|
-
z-index: 1;
|
|
452
|
-
}
|
|
453
|
-
.${t}-grid-editable .${t}-block-dragged {
|
|
454
|
-
cursor: grabbing;
|
|
455
|
-
outline: 1px solid #FF5C02;
|
|
456
|
-
outline-offset: 2px;
|
|
457
|
-
}
|
|
458
|
-
.${t}-grid-editable .${t}-frame:hover > .${t}-block:not(.${t}-block-dragged) {
|
|
459
|
-
outline: 1px solid rgba(255, 92, 2, 0.4);
|
|
460
|
-
outline-offset: 2px;
|
|
461
|
-
}
|
|
462
|
-
.${t}-grid-editable .${t}-block-invalid {
|
|
463
|
-
opacity: 0.5;
|
|
464
|
-
outline-style: dashed;
|
|
465
|
-
}
|
|
466
|
-
/* edges are a bar that grows from the block's edge as the pointer comes to it, as a structured block's do;
|
|
467
|
-
corners a small square */
|
|
468
|
-
.${t}-handle {
|
|
469
|
-
position: absolute;
|
|
470
|
-
z-index: 3;
|
|
471
|
-
pointer-events: auto;
|
|
472
|
-
touch-action: none;
|
|
473
|
-
}
|
|
474
|
-
.${t}-handle::after {
|
|
475
|
-
content: '';
|
|
476
|
-
position: absolute;
|
|
477
|
-
box-sizing: border-box;
|
|
478
|
-
opacity: 0;
|
|
479
|
-
transition: opacity 150ms ease, transform 150ms ease;
|
|
480
|
-
}
|
|
481
|
-
.${t}-handle-left,
|
|
482
|
-
.${t}-handle-right {
|
|
483
|
-
top: 0;
|
|
484
|
-
bottom: 0;
|
|
485
|
-
width: 10px;
|
|
486
|
-
cursor: ew-resize;
|
|
487
|
-
}
|
|
488
|
-
.${t}-handle-left { left: -5px; }
|
|
489
|
-
.${t}-handle-right { right: -5px; }
|
|
490
|
-
.${t}-handle-top,
|
|
491
|
-
.${t}-handle-bottom {
|
|
492
|
-
left: 0;
|
|
493
|
-
right: 0;
|
|
494
|
-
height: 10px;
|
|
495
|
-
cursor: ns-resize;
|
|
496
|
-
}
|
|
497
|
-
.${t}-handle-top { top: -5px; }
|
|
498
|
-
.${t}-handle-bottom { bottom: -5px; }
|
|
499
|
-
.${t}-handle-left::after,
|
|
500
|
-
.${t}-handle-right::after {
|
|
501
|
-
top: 0;
|
|
502
|
-
bottom: 0;
|
|
503
|
-
left: 3px;
|
|
504
|
-
width: 4px;
|
|
505
|
-
background-color: #FF5C02;
|
|
506
|
-
transform: scaleX(0.25);
|
|
507
|
-
}
|
|
508
|
-
.${t}-handle-top::after,
|
|
509
|
-
.${t}-handle-bottom::after {
|
|
510
|
-
left: 0;
|
|
511
|
-
right: 0;
|
|
512
|
-
top: 3px;
|
|
513
|
-
height: 4px;
|
|
514
|
-
background-color: #FF5C02;
|
|
515
|
-
transform: scaleY(0.25);
|
|
516
|
-
}
|
|
517
|
-
.${t}-handle-top-left,
|
|
518
|
-
.${t}-handle-top-right,
|
|
519
|
-
.${t}-handle-bottom-right,
|
|
520
|
-
.${t}-handle-bottom-left {
|
|
521
|
-
width: 12px;
|
|
522
|
-
height: 12px;
|
|
523
|
-
}
|
|
524
|
-
.${t}-handle-top-left { top: -6px; left: -6px; cursor: nwse-resize; }
|
|
525
|
-
.${t}-handle-bottom-right { bottom: -6px; right: -6px; cursor: nwse-resize; }
|
|
526
|
-
.${t}-handle-top-right { top: -6px; right: -6px; cursor: nesw-resize; }
|
|
527
|
-
.${t}-handle-bottom-left { bottom: -6px; left: -6px; cursor: nesw-resize; }
|
|
528
|
-
.${t}-handle-top-left::after,
|
|
529
|
-
.${t}-handle-top-right::after,
|
|
530
|
-
.${t}-handle-bottom-right::after,
|
|
531
|
-
.${t}-handle-bottom-left::after {
|
|
532
|
-
inset: 3px;
|
|
533
|
-
background-color: #ffffff;
|
|
534
|
-
border: 1px solid #FF5C02;
|
|
535
|
-
}
|
|
536
|
-
.${t}-frame:hover > .${t}-handle::after {
|
|
537
|
-
opacity: 0.6;
|
|
538
|
-
}
|
|
539
|
-
.${t}-handle:hover::after,
|
|
540
|
-
.${t}-handle-active::after {
|
|
541
|
-
opacity: 1;
|
|
542
|
-
transform: none;
|
|
543
|
-
}
|
|
544
|
-
`;
|
|
545
|
-
}
|
|
546
|
-
function ot(t, o, e, n) {
|
|
547
|
-
const r = (u) => t[`${o}${u}`] ?? (n ? t[`${n}${u}`] : void 0), l = (u) => {
|
|
548
|
-
const f = r(u);
|
|
549
|
-
return f === void 0 ? void 0 : Gt(f, e);
|
|
550
|
-
}, h = r("FontSettings"), s = r("TextAppearance");
|
|
551
|
-
return {
|
|
552
|
-
fontFamily: se(r("FontFamily")),
|
|
553
|
-
fontWeight: h == null ? void 0 : h.fontWeight,
|
|
554
|
-
fontStyle: h == null ? void 0 : h.fontStyle,
|
|
555
|
-
fontSize: l("FontSize"),
|
|
556
|
-
lineHeight: l("LineHeight"),
|
|
557
|
-
letterSpacing: l("LetterSpacing"),
|
|
558
|
-
wordSpacing: l("WordSpacing"),
|
|
559
|
-
textTransform: s == null ? void 0 : s.textTransform,
|
|
560
|
-
textDecoration: s == null ? void 0 : s.textDecoration,
|
|
561
|
-
fontVariant: s == null ? void 0 : s.fontVariant
|
|
562
|
-
};
|
|
563
|
-
}
|
|
564
|
-
function Yt(t) {
|
|
565
|
-
const o = t.type ?? "text";
|
|
566
|
-
return o === "list" ? "listA" : o;
|
|
567
|
-
}
|
|
568
|
-
function Be(t, o, e, n) {
|
|
569
|
-
return t != null && t.grid && Array.isArray(t.placements) && t.placements.every((r) => typeof (r == null ? void 0 : r.top) == "number") ? fe(t, n) : me(o.map(Yt), n, 1, e);
|
|
570
|
-
}
|
|
571
|
-
function Re(t, o) {
|
|
572
|
-
const e = (n, r) => Math.abs(n - r) < 1e-4;
|
|
573
|
-
return e(t.height, o.height) && t.heights.length === o.heights.length && t.heights.every((n, r) => e(n, o.heights[r]));
|
|
574
|
-
}
|
|
575
|
-
function xt(t, o) {
|
|
576
|
-
const { columns: e } = t.grid, n = t.placements[o];
|
|
577
|
-
if (!n) return { column: 0, span: Math.min(e, Math.max(1, Math.round(e / 4))), top: 0 };
|
|
578
|
-
const r = Math.min(n.span, e), l = { column: Math.min(n.column, e - r), span: r, top: n.top };
|
|
579
|
-
return typeof n.height == "number" ? { ...l, height: n.height } : l;
|
|
580
|
-
}
|
|
581
|
-
function Ae({
|
|
582
|
-
settings: t,
|
|
583
|
-
content: o = [],
|
|
584
|
-
isEditor: e,
|
|
585
|
-
isEditMode: n,
|
|
586
|
-
isPreviewMode: r,
|
|
587
|
-
layoutId: l,
|
|
588
|
-
currentState: h,
|
|
589
|
-
unavailableStates: s = [],
|
|
590
|
-
onOpenChange: u,
|
|
591
|
-
onUpdateSettings: f
|
|
592
|
-
}) {
|
|
593
|
-
var St, Tt;
|
|
594
|
-
const { prefix: i } = ae(), N = et(() => Ie(i), [i]), [S, B] = U(!1), [A, m] = U(!1), [p, k] = U(!1), R = !!(e && !r), _ = R && h === "open" && !s.includes("open"), x = _ || !R && S;
|
|
595
|
-
le(x && !R), Z(() => {
|
|
596
|
-
u == null || u(x);
|
|
597
|
-
}, [x, u]), Z(() => {
|
|
598
|
-
B(!1);
|
|
599
|
-
}, [l]), Z(() => {
|
|
600
|
-
if (x) {
|
|
601
|
-
m(!0);
|
|
602
|
-
const c = requestAnimationFrame(() => k(!0));
|
|
603
|
-
return () => cancelAnimationFrame(c);
|
|
604
|
-
}
|
|
605
|
-
k(!1);
|
|
606
|
-
const a = window.setTimeout(() => m(!1), X);
|
|
607
|
-
return () => window.clearTimeout(a);
|
|
608
|
-
}, [x]), Z(() => {
|
|
609
|
-
if (!x || R) return;
|
|
610
|
-
const a = (c) => {
|
|
611
|
-
c.key === "Escape" && B(!1);
|
|
612
|
-
};
|
|
613
|
-
return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
|
|
614
|
-
}, [x, R]);
|
|
615
|
-
const d = (a) => Gt(a ?? 0, e), T = pe(t), nt = st(t.popupPadding), J = st(t.popupInset), rt = (St = t.menuLayout) == null ? void 0 : St.grid, Ot = ue(t, rt != null && rt.columnWidth ? rt : Et), { columns: wt, columnWidth: kt, gutter: Ct, beat: zt } = Ot, It = et(
|
|
616
|
-
() => ({ columns: wt, columnWidth: kt, gutter: Ct, beat: zt }),
|
|
617
|
-
[wt, kt, Ct, zt]
|
|
618
|
-
), Q = et(
|
|
619
|
-
() => Be(t.menuLayout, o, T, It),
|
|
620
|
-
[t.menuLayout, o, T, It]
|
|
621
|
-
), [ut, Xt] = U(null), F = et(() => ut ? Ft(Q, ut) : null, [Q, ut]), v = et(() => F ? xe(Q, F) : Q, [Q, F]), { columns: D, gutter: pt, columnWidth: dt } = v.grid, qt = D * dt + (D - 1) * pt, mt = dt > 0 ? {
|
|
622
|
-
gridTemplateColumns: `repeat(${D}, minmax(0, ${d(dt)}))`,
|
|
623
|
-
columnGap: d(pt),
|
|
624
|
-
width: `min(100%, ${d(qt)})`,
|
|
625
|
-
marginInline: "auto"
|
|
626
|
-
} : { gridTemplateColumns: `repeat(${D}, minmax(0, 1fr))`, columnGap: d(pt) }, gt = t.triggerPosition ?? "right", Bt = t.triggerLabel || "Menu", it = st(t.triggerPadding), E = t.triggerType === "image" && !t.triggerIcon ? "burger" : t.triggerType ?? "text", Vt = ot(t, "trigger", e), Ut = ot(t, "title", e), Zt = {
|
|
627
|
-
text: ot(t, "text", e),
|
|
628
|
-
listA: ot(t, "listA", e, "text"),
|
|
629
|
-
listB: ot(t, "listB", e, "text")
|
|
630
|
-
}, W = ((Tt = t.stateOverrides) == null ? void 0 : Tt.open) ?? {}, Rt = {
|
|
631
|
-
[`--${i}-trigger-bg`]: t.barBackgroundColor,
|
|
632
|
-
[`--${i}-trigger-color`]: (x ? W.triggerColor : void 0) ?? t.triggerColor,
|
|
633
|
-
[`--${i}-overlay-color`]: W.overlayColor ?? t.overlayColor,
|
|
634
|
-
[`--${i}-popup-bg`]: W.popupBackgroundColor ?? t.popupBackgroundColor,
|
|
635
|
-
[`--${i}-title-color`]: W.titleColor ?? t.titleColor,
|
|
636
|
-
[`--${i}-text-color`]: W.textColor ?? t.textColor,
|
|
637
|
-
[`--${i}-list-a-color`]: W.listAColor ?? t.listAColor,
|
|
638
|
-
[`--${i}-list-b-color`]: W.listBColor ?? t.listBColor
|
|
639
|
-
}, ft = lt(null), $t = lt(null), P = lt([]), [L, Kt] = U(null), bt = lt(null), q = (a) => {
|
|
640
|
-
bt.current = a, Kt(a);
|
|
641
|
-
}, G = !!(_ && n && f), Jt = L ? Dt(v, L) : null;
|
|
642
|
-
Z(() => {
|
|
643
|
-
G || q(null);
|
|
644
|
-
}, [G]), ie(() => {
|
|
645
|
-
const a = $t.current;
|
|
646
|
-
if (!A || !a) return;
|
|
647
|
-
const c = () => {
|
|
648
|
-
var $;
|
|
649
|
-
const M = ($ = ft.current) == null ? void 0 : $.getBoundingClientRect().width;
|
|
650
|
-
if (!M) return;
|
|
651
|
-
const C = {
|
|
652
|
-
height: a.getBoundingClientRect().height / M,
|
|
653
|
-
heights: o.map((y, I) => {
|
|
654
|
-
var z;
|
|
655
|
-
return (((z = P.current[I]) == null ? void 0 : z.getBoundingClientRect().height) ?? 0) / M;
|
|
656
|
-
})
|
|
657
|
-
};
|
|
658
|
-
Xt((y) => y && Re(y, C) ? y : C);
|
|
659
|
-
};
|
|
660
|
-
c();
|
|
661
|
-
const g = new ResizeObserver(c);
|
|
662
|
-
return g.observe(a), P.current.slice(0, o.length).forEach((M) => M && g.observe(M)), () => g.disconnect();
|
|
663
|
-
}, [A, o]);
|
|
664
|
-
const At = () => {
|
|
665
|
-
const a = $t.current, c = a.getBoundingClientRect(), g = a.offsetWidth ? c.width / a.offsetWidth : 1, M = (parseFloat(getComputedStyle(a).columnGap) || 0) * g;
|
|
666
|
-
return { area: c, gap: M, pitch: (c.width + M) / D };
|
|
667
|
-
}, Qt = (a, c, g) => {
|
|
668
|
-
var z, j;
|
|
669
|
-
if (!G || !v.placements[c] || a.button !== 0) return;
|
|
670
|
-
a.preventDefault(), a.stopPropagation(), a.currentTarget.setPointerCapture(a.pointerId);
|
|
671
|
-
const { area: M, pitch: C } = At(), $ = ((z = P.current[c]) == null ? void 0 : z.getBoundingClientRect()) ?? a.currentTarget.getBoundingClientRect(), y = ((j = ft.current) == null ? void 0 : j.getBoundingClientRect().width) || 1, I = xt(v, c);
|
|
672
|
-
q({
|
|
673
|
-
index: c,
|
|
674
|
-
pointerId: a.pointerId,
|
|
675
|
-
handle: g,
|
|
676
|
-
grabColumn: Math.min(Math.max(Math.floor((a.clientX - M.left) / C) - I.column, 0), I.span - 1),
|
|
677
|
-
grabY: a.clientY - $.top,
|
|
678
|
-
unit: y,
|
|
679
|
-
start: I,
|
|
680
|
-
placement: I,
|
|
681
|
-
measure: Ft(v, {
|
|
682
|
-
height: M.height / y,
|
|
683
|
-
heights: o.map((tt, Y) => {
|
|
684
|
-
var b;
|
|
685
|
-
return (((b = P.current[Y]) == null ? void 0 : b.getBoundingClientRect().height) ?? 0) / y;
|
|
686
|
-
})
|
|
687
|
-
})
|
|
688
|
-
});
|
|
689
|
-
}, Pt = (a) => {
|
|
690
|
-
const c = bt.current;
|
|
691
|
-
if (!c || a.pointerId !== c.pointerId) return;
|
|
692
|
-
a.stopPropagation();
|
|
693
|
-
const { area: g, gap: M, pitch: C } = At(), { start: $, measure: y, handle: I } = c, z = y.height;
|
|
694
|
-
if (!I) {
|
|
695
|
-
q({
|
|
696
|
-
...c,
|
|
697
|
-
placement: {
|
|
698
|
-
...$,
|
|
699
|
-
column: Math.min(Math.max(Math.floor((a.clientX - g.left) / C) - c.grabColumn, 0), D - $.span),
|
|
700
|
-
top: K(v.grid, (a.clientY - c.grabY - g.top) / c.unit, z - y.heights[c.index])
|
|
701
|
-
}
|
|
702
|
-
});
|
|
703
|
-
return;
|
|
704
|
-
}
|
|
705
|
-
const j = a.clientX - g.left, tt = (a.clientY - g.top) / c.unit, Y = $.column + $.span;
|
|
706
|
-
let { column: b, span: H, top: O } = $, at = $.height;
|
|
707
|
-
if (I.includes("left") && (b = Math.min(Math.max(Math.round(j / C), 0), Y - 1), H = Y - b), I.includes("right") && (H = Math.min(Math.max(Math.round((j + M) / C), b + 1), D) - b), I.includes("top")) {
|
|
708
|
-
const _t = $.top + ($.height ?? y.heights[c.index] ?? 0);
|
|
709
|
-
O = K(v.grid, tt, _t - Mt(v.grid)), at = ct(v.grid, _t - O, z - O);
|
|
710
|
-
}
|
|
711
|
-
I.includes("bottom") && (at = ct(v.grid, tt - O, z - O)), q({ ...c, placement: at === void 0 ? { column: b, span: H, top: O } : { column: b, span: H, top: O, height: at } });
|
|
712
|
-
}, te = (a) => {
|
|
713
|
-
const c = bt.current;
|
|
714
|
-
if (!c || a.pointerId !== c.pointerId) return;
|
|
715
|
-
a.stopPropagation();
|
|
716
|
-
const g = Dt(v, c), M = g == null ? void 0 : g.placements[c.index];
|
|
717
|
-
g && M && !ze(M, xt(v, c.index)) && (f == null || f({ ...t, menuLayout: g })), q(null);
|
|
718
|
-
}, ee = (a, c) => {
|
|
719
|
-
a.stopPropagation();
|
|
720
|
-
const g = v.placements[c];
|
|
721
|
-
if (!G || !g || g.height === void 0) return;
|
|
722
|
-
const { height: M, ...C } = g;
|
|
723
|
-
f == null || f({
|
|
724
|
-
...t,
|
|
725
|
-
menuLayout: { ...v, edited: !0, placements: v.placements.map(($, y) => y === c ? C : $) }
|
|
726
|
-
});
|
|
727
|
-
}, Nt = () => B(!1), oe = (a) => {
|
|
728
|
-
!R && a.target.closest("a") && Nt();
|
|
729
|
-
}, ne = (a, c) => {
|
|
730
|
-
const g = Yt(a), M = (a.images ?? []).filter((b) => b == null ? void 0 : b.assetId), C = (L == null ? void 0 : L.index) === c, $ = C ? L.placement : xt(v, c), y = $.height !== void 0, I = $.height ?? (F == null ? void 0 : F.heights[c]) ?? 0, z = F ? yt($.top, I, F.height, v.grid.beat) : null, j = g !== "image" && (y || z !== null && I >= z.maxHeight - 1e-3), tt = G && (!L || C), Y = (b) => ({
|
|
731
|
-
onPointerDown: (H) => Qt(H, c, b),
|
|
732
|
-
onPointerMove: Pt,
|
|
733
|
-
onPointerUp: te,
|
|
734
|
-
onPointerCancel: () => q(null)
|
|
735
|
-
});
|
|
736
|
-
return /* @__PURE__ */ V(
|
|
737
|
-
"div",
|
|
738
|
-
{
|
|
739
|
-
className: `${i}-slot${C ? ` ${i}-slot-dragged` : ""}`,
|
|
740
|
-
style: {
|
|
741
|
-
gridColumn: `${$.column + 1} / span ${$.span}`,
|
|
742
|
-
[`--${i}-room-left`]: z ? d(z.maxHeight) : `max(100cqh - ${d($.top)}, 25cqh)`
|
|
743
|
-
},
|
|
744
|
-
children: [
|
|
745
|
-
/* @__PURE__ */ w("div", { className: `${i}-spacer`, style: { flexBasis: d(z ? z.top : $.top) } }),
|
|
746
|
-
/* @__PURE__ */ V("div", { className: `${i}-frame`, children: [
|
|
747
|
-
/* @__PURE__ */ V(
|
|
748
|
-
"div",
|
|
749
|
-
{
|
|
750
|
-
ref: (b) => {
|
|
751
|
-
P.current[c] = b;
|
|
752
|
-
},
|
|
753
|
-
className: [
|
|
754
|
-
`${i}-block ${i}-block-${g}`,
|
|
755
|
-
y ? `${i}-block-sized` : "",
|
|
756
|
-
j ? `${i}-block-full` : "",
|
|
757
|
-
C ? `${i}-block-dragged` : "",
|
|
758
|
-
C && !Jt ? `${i}-block-invalid` : ""
|
|
759
|
-
].filter(Boolean).join(" "),
|
|
760
|
-
style: y ? { height: d($.height) } : void 0,
|
|
761
|
-
...G ? Y(null) : {},
|
|
762
|
-
children: [
|
|
763
|
-
a.title && g !== "image" ? /* @__PURE__ */ w("div", { className: `${i}-block-title`, style: { ...Ut, marginBottom: d(t.titleGap) }, children: a.title }) : null,
|
|
764
|
-
g === "image" ? /* @__PURE__ */ w(Ne, { prefix: i, images: M, isRunning: x, radius: d(t.imageRadius) }) : /* @__PURE__ */ w("div", { className: `${i}-block-text`, style: Zt[g], children: /* @__PURE__ */ w(ce, { content: Array.isArray(a.text) ? a.text : [] }) })
|
|
765
|
-
]
|
|
766
|
-
}
|
|
767
|
-
),
|
|
768
|
-
tt ? Ce.map((b) => /* @__PURE__ */ w(
|
|
769
|
-
"div",
|
|
770
|
-
{
|
|
771
|
-
className: `${i}-handle ${i}-handle-${b}${C && L.handle === b ? ` ${i}-handle-active` : ""}`,
|
|
772
|
-
"aria-hidden": !0,
|
|
773
|
-
...Y(b),
|
|
774
|
-
onDoubleClick: b.includes("top") || b.includes("bottom") ? (H) => ee(H, c) : void 0
|
|
775
|
-
},
|
|
776
|
-
b
|
|
777
|
-
)) : null
|
|
778
|
-
] })
|
|
779
|
-
]
|
|
780
|
-
},
|
|
781
|
-
c
|
|
782
|
-
);
|
|
783
|
-
}, re = A ? /* @__PURE__ */ V(
|
|
784
|
-
"div",
|
|
785
|
-
{
|
|
786
|
-
ref: ft,
|
|
787
|
-
"data-selection": "none",
|
|
788
|
-
className: `${i}-overlay ${p ? `${i}-overlay-active` : ""}`.trim(),
|
|
789
|
-
style: Rt,
|
|
790
|
-
"aria-hidden": !p,
|
|
791
|
-
children: [
|
|
792
|
-
/* @__PURE__ */ w(
|
|
793
|
-
"button",
|
|
794
|
-
{
|
|
795
|
-
type: "button",
|
|
796
|
-
className: `${i}-backdrop`,
|
|
797
|
-
"aria-label": "Close menu",
|
|
798
|
-
tabIndex: -1,
|
|
799
|
-
onClick: R ? void 0 : Nt
|
|
800
|
-
}
|
|
801
|
-
),
|
|
802
|
-
/* @__PURE__ */ w(
|
|
803
|
-
"div",
|
|
804
|
-
{
|
|
805
|
-
className: `${i}-card`,
|
|
806
|
-
role: "dialog",
|
|
807
|
-
"aria-modal": "true",
|
|
808
|
-
"aria-label": t.triggerLabel || "Menu",
|
|
809
|
-
onClick: oe,
|
|
810
|
-
style: {
|
|
811
|
-
height: d(t.popupHeight ?? Ht),
|
|
812
|
-
// the margin's top, left and right place it; with its bottom, it is held inside a window shorter than it
|
|
813
|
-
top: d(J.top),
|
|
814
|
-
left: d(J.left),
|
|
815
|
-
right: d(J.right),
|
|
816
|
-
maxHeight: `calc(100% - ${d(J.top)} - ${d(J.bottom)})`,
|
|
817
|
-
padding: [nt.top, nt.right, nt.bottom, nt.left].map((a) => d(a)).join(" "),
|
|
818
|
-
borderRadius: d(t.popupRadius)
|
|
819
|
-
},
|
|
820
|
-
children: /* @__PURE__ */ V(
|
|
821
|
-
"div",
|
|
822
|
-
{
|
|
823
|
-
ref: $t,
|
|
824
|
-
className: `${i}-grid${G ? ` ${i}-grid-editable` : ""}`,
|
|
825
|
-
style: mt,
|
|
826
|
-
children: [
|
|
827
|
-
o.map(ne),
|
|
828
|
-
G ? /* @__PURE__ */ w(
|
|
829
|
-
"div",
|
|
830
|
-
{
|
|
831
|
-
className: `${i}-guides${v.grid.beat ? ` ${i}-guides-beats` : ""}${L ? ` ${i}-guides-shown` : ""}`,
|
|
832
|
-
style: {
|
|
833
|
-
gridTemplateColumns: mt.gridTemplateColumns,
|
|
834
|
-
columnGap: mt.columnGap,
|
|
835
|
-
[`--${i}-beat`]: v.grid.beat ? d(v.grid.beat) : void 0
|
|
836
|
-
},
|
|
837
|
-
"aria-hidden": !0,
|
|
838
|
-
children: Array.from({ length: D }, (a, c) => /* @__PURE__ */ w("div", { className: `${i}-guide` }, c))
|
|
839
|
-
}
|
|
840
|
-
) : null
|
|
841
|
-
]
|
|
842
|
-
}
|
|
843
|
-
)
|
|
844
|
-
}
|
|
845
|
-
)
|
|
846
|
-
]
|
|
847
|
-
}
|
|
848
|
-
) : null;
|
|
849
|
-
return /* @__PURE__ */ V("div", { className: `${i}-root`, style: Rt, "data-edit-mode": n ? "" : void 0, children: [
|
|
850
|
-
/* @__PURE__ */ w("style", { dangerouslySetInnerHTML: { __html: N } }),
|
|
851
|
-
/* @__PURE__ */ w("div", { className: `${i}-bar`, children: /* @__PURE__ */ w(
|
|
852
|
-
"button",
|
|
853
|
-
{
|
|
854
|
-
type: "button",
|
|
855
|
-
className: [
|
|
856
|
-
`${i}-button ${i}-slot-${gt}`,
|
|
857
|
-
E !== "text" ? `${i}-button-icon` : "",
|
|
858
|
-
x ? `${i}-button-open` : ""
|
|
859
|
-
].filter(Boolean).join(" "),
|
|
860
|
-
style: {
|
|
861
|
-
...E === "text" ? Vt : void 0,
|
|
862
|
-
gridColumn: gt === "left" ? 1 : gt === "center" ? 2 : 3,
|
|
863
|
-
gridRow: 1,
|
|
864
|
-
padding: [it.top, it.right, it.bottom, it.left].map((a) => d(a)).join(" "),
|
|
865
|
-
[`--${i}-icon-size`]: d(t.triggerIconSize ?? ke)
|
|
866
|
-
},
|
|
867
|
-
"aria-expanded": x,
|
|
868
|
-
"aria-label": E === "text" ? void 0 : Bt,
|
|
869
|
-
onClick: R ? void 0 : () => B((a) => !a),
|
|
870
|
-
children: E === "text" ? Bt : /* @__PURE__ */ w("span", { className: `${i}-icon ${i}-icon-${E}`, "aria-hidden": !0, children: E === "image" ? /* @__PURE__ */ w(
|
|
871
|
-
he,
|
|
872
|
-
{
|
|
873
|
-
url: t.triggerIcon,
|
|
874
|
-
fill: `var(--${i}-trigger-color)`,
|
|
875
|
-
hoverFill: `var(--${i}-trigger-color)`,
|
|
876
|
-
className: `${i}-icon-picture`
|
|
877
|
-
}
|
|
878
|
-
) : Array.from({ length: E === "burger" ? 3 : 2 }, (a, c) => /* @__PURE__ */ w("span", { className: `${i}-icon-line` }, c)) })
|
|
879
|
-
}
|
|
880
|
-
) }),
|
|
881
|
-
re
|
|
882
|
-
] });
|
|
883
|
-
}
|
|
884
|
-
function Ne({ prefix: t, images: o, isRunning: e, radius: n }) {
|
|
885
|
-
const [r, l] = U(0), h = o.length;
|
|
886
|
-
return Z(() => {
|
|
887
|
-
if (!e || h < 2) {
|
|
888
|
-
l(0);
|
|
889
|
-
return;
|
|
890
|
-
}
|
|
891
|
-
const s = window.setInterval(() => l((u) => (u + 1) % h), ye);
|
|
892
|
-
return () => window.clearInterval(s);
|
|
893
|
-
}, [e, h]), /* @__PURE__ */ w("div", { className: `${t}-images`, children: o.map((s, u) => /* @__PURE__ */ w(
|
|
894
|
-
"img",
|
|
895
|
-
{
|
|
896
|
-
className: `${t}-image${u === r % h ? "" : ` ${t}-image-hidden`}`,
|
|
897
|
-
src: s.assetId,
|
|
898
|
-
alt: s.name ?? "",
|
|
899
|
-
"aria-hidden": u !== r % h,
|
|
900
|
-
style: { borderRadius: n }
|
|
901
|
-
},
|
|
902
|
-
u
|
|
903
|
-
)) });
|
|
904
|
-
}
|
|
905
|
-
const We = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
906
|
-
__proto__: null,
|
|
907
|
-
POPUP_MENU_TRIGGER_TYPES: we,
|
|
908
|
-
PopupMenu: Ae
|
|
909
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
910
|
-
export {
|
|
911
|
-
Et as D,
|
|
912
|
-
we as P,
|
|
913
|
-
K as a,
|
|
914
|
-
ct as b,
|
|
915
|
-
pe as c,
|
|
916
|
-
st as d,
|
|
917
|
-
ue as e,
|
|
918
|
-
fe as f,
|
|
919
|
-
me as g,
|
|
920
|
-
Ee as h,
|
|
921
|
-
ge as i,
|
|
922
|
-
de as j,
|
|
923
|
-
Ht as k,
|
|
924
|
-
Ae as l,
|
|
925
|
-
$e as m,
|
|
926
|
-
We as n,
|
|
927
|
-
be as r,
|
|
928
|
-
xe as s
|
|
929
|
-
};
|