@cntrl-site/components 1.0.106 → 1.0.107-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/sources.js CHANGED
@@ -1,4 +1,1002 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./PretextComponent-Dnbenstn.js"),e=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent, type ReactNode } from 'react';
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./ArchivePopupComponent-BTniPIfi.js"),e=`import { Fragment, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent } from 'react';
2
+ import { createPortal } from 'react-dom';
3
+ import cn from 'classnames';
4
+ import { CommonComponentProps } from '../props';
5
+ import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
6
+ import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
7
+ import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
8
+ import { useLightboxScrollLock } from '../utils/useLightboxScrollLock';
9
+
10
+ type ArchivePopupMedia = {
11
+ assetId: string;
12
+ name?: string;
13
+ type?: 'image' | 'video';
14
+ objectFit?: 'cover' | 'contain';
15
+ };
16
+
17
+ /** Columns count the group column too, so the least is the group and its title. */
18
+ export const ARCHIVE_POPUP_MIN_COLUMNS = 2;
19
+ export const ARCHIVE_POPUP_MAX_COLUMNS = 5;
20
+ /** The fields of the columns after the title, in order; \`columns\` decides how many of them a row shows. */
21
+ export const ARCHIVE_POPUP_EXTRA_TITLE_KEYS = ['title2', 'title3', 'title4'] as const;
22
+ /** Every column but the last has a width of its own, like Programme's; the last takes what is left of the row. */
23
+ export const ARCHIVE_POPUP_COLUMN_WIDTH_KEYS = ['column1Width', 'column2Width', 'column3Width', 'column4Width'] as const;
24
+
25
+ type ArchivePopupColumnWidthKey = typeof ARCHIVE_POPUP_COLUMN_WIDTH_KEYS[number];
26
+
27
+ /**
28
+ * Where A's panel sits on the screen, as \`left\`/\`top\` of the screen and of the panel alike, so 0% is flush with
29
+ * one edge and 100% with the other. Named like Mercury's title position; center comes first because the editor
30
+ * puts the first value into a popup saved before there was a position, and those were centred.
31
+ */
32
+ const PANEL_POSITION_OFFSETS = {
33
+ center: { x: '50%', y: '50%' },
34
+ 'left-top': { x: '0%', y: '0%' },
35
+ 'top-center': { x: '50%', y: '0%' },
36
+ 'top-right': { x: '100%', y: '0%' },
37
+ 'left-center': { x: '0%', y: '50%' },
38
+ 'right-center': { x: '100%', y: '50%' },
39
+ 'left-bottom': { x: '0%', y: '100%' },
40
+ 'bottom-center': { x: '50%', y: '100%' },
41
+ 'right-bottom': { x: '100%', y: '100%' },
42
+ } as const;
43
+
44
+ export type ArchivePopupPanelPosition = keyof typeof PANEL_POSITION_OFFSETS;
45
+
46
+ export const ARCHIVE_POPUP_PANEL_POSITIONS = Object.keys(PANEL_POSITION_OFFSETS) as ArchivePopupPanelPosition[];
47
+
48
+ /** Each column of a row has a text style of its own, the group column's being \`column1\`. */
49
+ export const ARCHIVE_POPUP_COLUMN_STYLE_PREFIXES = ['column1', 'column2', 'column3', 'column4', 'column5'] as const;
50
+
51
+ type ArchivePopupColumnStylePrefix = typeof ARCHIVE_POPUP_COLUMN_STYLE_PREFIXES[number];
52
+
53
+ type ArchivePopupTitle = any[] | string;
54
+
55
+ export type ArchivePopupContentItem = {
56
+ group?: string;
57
+ /** Rich text, so parts of a title can be linked; a plain string is still shown as is. */
58
+ title?: ArchivePopupTitle;
59
+ title2?: ArchivePopupTitle;
60
+ title3?: ArchivePopupTitle;
61
+ title4?: ArchivePopupTitle;
62
+ image?: ArchivePopupMedia;
63
+ };
64
+
65
+ type FontSettings = { fontWeight: number; fontStyle: string };
66
+
67
+ type Padding = { top: number; right: number; bottom: number; left: number };
68
+
69
+ /** A text style as settings hold it, each field under the name of what it styles, e.g. \`triggerFontSize\`. */
70
+ type TextStyleFields = {
71
+ FontFamily?: string;
72
+ FontSettings?: FontSettings;
73
+ FontSize?: number;
74
+ LineHeight?: number;
75
+ LetterSpacing?: number;
76
+ WordSpacing?: number;
77
+ TextAlign?: TextStyles['textAlign'];
78
+ TextAppearance?: TextStyles['textAppearance'];
79
+ };
80
+
81
+ type PrefixedTextStyle<Prefix extends string> = {
82
+ [Key in keyof TextStyleFields as \`\${Prefix}\${Key}\`]?: TextStyleFields[Key];
83
+ };
84
+
85
+ type ArchivePopupSettings = PrefixedTextStyle<'trigger'>
86
+ & PrefixedTextStyle<ArchivePopupColumnStylePrefix>
87
+ // One style every column shared before each had its own; a column with no style of its own still shows it.
88
+ & PrefixedTextStyle<'list'>
89
+ & {
90
+ /** \`a\` opens from a label; \`b\` is always open, in place on the page. */
91
+ type?: 'a' | 'b';
92
+ triggerLabel?: string;
93
+ closeLabel?: string;
94
+ /** Every column of a row, the group column included. */
95
+ columns?: number;
96
+ columnGap?: number;
97
+ column1Width?: number;
98
+ column2Width?: number;
99
+ column3Width?: number;
100
+ column4Width?: number;
101
+ /** A only: B's panel stays where it is placed on the page. */
102
+ panelPosition?: string;
103
+ panelWidth?: number;
104
+ panelPadding?: Padding;
105
+ panelRadius?: number;
106
+ groupGap?: number;
107
+ triggerColor?: string;
108
+ triggerHoverColor?: string;
109
+ closeColor?: string;
110
+ closeHoverColor?: string;
111
+ panelColor?: string;
112
+ textColor?: string;
113
+ textHoverColor?: string;
114
+ overlayColor?: string;
115
+ };
116
+
117
+ type ArchivePopupProps = {
118
+ settings: ArchivePopupSettings;
119
+ content?: ArchivePopupContentItem[];
120
+ isEditor?: boolean;
121
+ isEditMode?: boolean;
122
+ isPreviewMode?: boolean;
123
+ activeEvent?: string;
124
+ portalId?: string;
125
+ } & CommonComponentProps;
126
+
127
+ export type ArchivePopupRow = {
128
+ item: ArchivePopupContentItem;
129
+ index: number;
130
+ };
131
+
132
+ export type ArchivePopupGroup = {
133
+ label: string;
134
+ rows: ArchivePopupRow[];
135
+ };
136
+
137
+ type ColorKeys =
138
+ | 'triggerColor'
139
+ | 'triggerHoverColor'
140
+ | 'closeColor'
141
+ | 'closeHoverColor'
142
+ | 'panelColor'
143
+ | 'textColor'
144
+ | 'textHoverColor'
145
+ | 'overlayColor';
146
+
147
+ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
148
+ triggerColor: 'trigger-color',
149
+ triggerHoverColor: 'trigger-hover-color',
150
+ closeColor: 'close-color',
151
+ closeHoverColor: 'close-hover-color',
152
+ panelColor: 'panel-color',
153
+ textColor: 'text-color',
154
+ textHoverColor: 'text-hover-color',
155
+ overlayColor: 'overlay-color',
156
+ };
157
+
158
+ const STATE_KEYS = ['hover', 'open'] as const;
159
+
160
+ const OVERLAY_ANIM_MS = 300;
161
+ // The least a padding handle is drawn at, so a zero padding can still be grabbed.
162
+ const PADDING_HANDLE_SIZE = 0.004;
163
+ const COLUMN_RESIZE_HANDLE_WIDTH = 0.004;
164
+ // The least a column is dragged down to, in pixels of the layout.
165
+ const MIN_COLUMN_WIDTH_PX = 20;
166
+ const DEFAULT_COLUMN_GAP = 0.0139;
167
+ const DEFAULT_PANEL_WIDTH = 0.3194;
168
+ const DEFAULT_PANEL_PADDING: Padding = { top: 0.00972, right: 0.00972, bottom: 0.00972, left: 0.00972 };
169
+ const IMAGE_FADE_MS = 800;
170
+
171
+ const LIGHTBOX_CSS_VARS = [
172
+ '--cntrl-article-width',
173
+ '--cntrl-article-top',
174
+ '--cntrl-article-left',
175
+ '--cntrl-viewport-height',
176
+ ] as const;
177
+
178
+ // A row with an empty group continues the group above it, so the label only has to be typed once.
179
+ type ColumnLayoutSettings = Pick<ArchivePopupSettings, 'columns' | 'columnGap' | 'panelWidth' | 'panelPadding'>
180
+ & Partial<Record<ArchivePopupColumnWidthKey, number>>;
181
+
182
+ function getColumnCount(columns: number | undefined): number {
183
+ return Math.min(Math.max(Math.round(columns ?? ARCHIVE_POPUP_MIN_COLUMNS), ARCHIVE_POPUP_MIN_COLUMNS), ARCHIVE_POPUP_MAX_COLUMNS);
184
+ }
185
+
186
+ /** The width a row's columns share: the panel's, less its padding and the gaps between them. */
187
+ function getColumnsSpace(settings: ColumnLayoutSettings): number {
188
+ const { panelWidth = DEFAULT_PANEL_WIDTH, panelPadding = DEFAULT_PANEL_PADDING, columnGap = DEFAULT_COLUMN_GAP } = settings;
189
+ const gaps = (getColumnCount(settings.columns) - 1) * columnGap;
190
+ return Math.max(0, panelWidth - panelPadding.left - panelPadding.right - gaps);
191
+ }
192
+
193
+ export function getArchivePopupEqualColumnWidths(settings: ColumnLayoutSettings): Partial<Record<ArchivePopupColumnWidthKey, number>> {
194
+ const count = getColumnCount(settings.columns);
195
+ const width = getColumnsSpace(settings) / count;
196
+ return Object.fromEntries(ARCHIVE_POPUP_COLUMN_WIDTH_KEYS.slice(0, count - 1).map((key) => [key, width]));
197
+ }
198
+
199
+ /**
200
+ * Every column's width, the last taking what the others leave. A column with no width of its own gets an equal share,
201
+ * and widths that no longer fit, after the panel narrows or a column is added, shrink together until they do.
202
+ */
203
+ export function resolveArchivePopupColumnWidths(settings: ColumnLayoutSettings): number[] {
204
+ const count = getColumnCount(settings.columns);
205
+ const space = getColumnsSpace(settings);
206
+ const sized = ARCHIVE_POPUP_COLUMN_WIDTH_KEYS.slice(0, count - 1).map((key) => {
207
+ const width = settings[key];
208
+ return typeof width === 'number' ? Math.max(0, width) : space / count;
209
+ });
210
+ const sizedTotal = sized.reduce((sum, width) => sum + width, 0);
211
+ const scale = sizedTotal > space ? space / sizedTotal : 1;
212
+ const fitted = sized.map((width) => width * scale);
213
+ return [...fitted, Math.max(0, space - sizedTotal * scale)];
214
+ }
215
+
216
+ /** Like Programme, a new column count starts the columns over at equal widths. */
217
+ export function applyArchivePopupColumnCountChange(
218
+ nextSettings: Record<string, any>,
219
+ prevSettings: Record<string, any>,
220
+ ): Record<string, any> {
221
+ if (typeof nextSettings.columns !== 'number' || nextSettings.columns === prevSettings.columns) {
222
+ return nextSettings;
223
+ }
224
+ return { ...nextSettings, ...getArchivePopupEqualColumnWidths({ ...prevSettings, ...nextSettings }) };
225
+ }
226
+
227
+ // The columns stay in proportion when the panel is drawn narrower than its width, on a small screen.
228
+ function getGridTemplateColumns(widths: number[]): string {
229
+ const total = widths.reduce((sum, width) => sum + width, 0);
230
+ return widths.map((width) => \`minmax(0, \${total > 0 ? (width / total) * 100 : 1}fr)\`).join(' ');
231
+ }
232
+
233
+ export function groupArchiveRows(items: ArchivePopupContentItem[]): ArchivePopupGroup[] {
234
+ const groups: ArchivePopupGroup[] = [];
235
+ items.forEach((item, index) => {
236
+ const label = item.group?.trim() ?? '';
237
+ const current = groups[groups.length - 1];
238
+ if (!current || (label !== '' && label !== current.label)) {
239
+ groups.push({ label, rows: [{ item, index }] });
240
+ return;
241
+ }
242
+ current.rows.push({ item, index });
243
+ });
244
+ return groups;
245
+ }
246
+
247
+ function isVideoMedia(media: ArchivePopupMedia): boolean {
248
+ if (media.type === 'video') return true;
249
+ if (media.type === 'image') return false;
250
+ return /\\.(mp4|webm|ogg|mov)(\\?|$)/i.test(media.name ?? '') || /\\.(mp4|webm|ogg|mov)(\\?|$)/i.test(media.assetId);
251
+ }
252
+
253
+ function findLayoutContainer(element: HTMLElement | null): HTMLElement | null {
254
+ let el = element;
255
+ while (el) {
256
+ if (getComputedStyle(el).getPropertyValue('--cntrl-article-width').trim()) {
257
+ return el;
258
+ }
259
+ el = el.parentElement;
260
+ }
261
+ return element;
262
+ }
263
+
264
+ function getLightboxLayoutStyle(container: HTMLElement | null): CSSProperties {
265
+ const style: Record<string, string> = {};
266
+ const layoutContainer = findLayoutContainer(container);
267
+ if (!layoutContainer) return style;
268
+ const computed = getComputedStyle(layoutContainer);
269
+ for (const varName of LIGHTBOX_CSS_VARS) {
270
+ const value = computed.getPropertyValue(varName).trim();
271
+ if (value) {
272
+ style[varName] = value;
273
+ }
274
+ }
275
+ return style;
276
+ }
277
+
278
+ function resolveTextStyle(settings: ArchivePopupSettings, prefix: string, fallbackPrefix?: string): TextStyles {
279
+ const values = settings as Record<string, unknown>;
280
+ const read = <Key extends keyof TextStyleFields>(key: Key) => (
281
+ values[\`\${prefix}\${key}\`] ?? (fallbackPrefix ? values[\`\${fallbackPrefix}\${key}\`] : undefined)
282
+ ) as TextStyleFields[Key];
283
+ const fontSettings = read('FontSettings');
284
+ return {
285
+ fontSettings: {
286
+ fontFamily: read('FontFamily'),
287
+ fontWeight: fontSettings?.fontWeight ?? 400,
288
+ fontStyle: fontSettings?.fontStyle ?? 'normal',
289
+ },
290
+ fontSize: read('FontSize') ?? 0.01,
291
+ lineHeight: read('LineHeight'),
292
+ letterSpacing: read('LetterSpacing') ?? 0,
293
+ wordSpacing: read('WordSpacing') ?? 0,
294
+ textAlign: read('TextAlign'),
295
+ textAppearance: read('TextAppearance'),
296
+ color: '#000000',
297
+ };
298
+ }
299
+
300
+ function getCSS(P: string): string {
301
+ return \`
302
+ .\${P}-trigger,
303
+ .\${P}-close {
304
+ display: inline-block;
305
+ margin: 0;
306
+ padding: 0;
307
+ border: 0;
308
+ background: none;
309
+ cursor: pointer;
310
+ white-space: nowrap;
311
+ transition: color 150ms ease;
312
+ -webkit-appearance: none;
313
+ appearance: none;
314
+ -webkit-tap-highlight-color: transparent;
315
+ }
316
+ .\${P}-trigger {
317
+ color: var(--\${P}-trigger-color);
318
+ }
319
+ .\${P}-close {
320
+ color: var(--\${P}-close-color);
321
+ }
322
+ .\${P}-trigger:focus,
323
+ .\${P}-close:focus {
324
+ outline: none;
325
+ }
326
+ .\${P}-trigger:focus-visible,
327
+ .\${P}-close:focus-visible {
328
+ outline: 1px solid currentColor;
329
+ outline-offset: 2px;
330
+ }
331
+ .\${P}-interactive .\${P}-trigger:hover,
332
+ .\${P}-state-hover .\${P}-trigger {
333
+ color: var(--\${P}-trigger-hover-color, var(--\${P}-trigger-color));
334
+ }
335
+ .\${P}-close:hover {
336
+ color: var(--\${P}-close-hover-color, var(--\${P}-close-color));
337
+ }
338
+ .\${P}-editor .\${P}-trigger {
339
+ cursor: default;
340
+ }
341
+ .\${P}-overlay {
342
+ position: fixed;
343
+ inset: 0;
344
+ z-index: 9997;
345
+ overflow: hidden;
346
+ overscroll-behavior: none;
347
+ opacity: 0;
348
+ pointer-events: none;
349
+ transition: opacity \${OVERLAY_ANIM_MS}ms ease;
350
+ }
351
+ .\${P}-inline-layer {
352
+ position: fixed;
353
+ inset: 0;
354
+ z-index: 9997;
355
+ overflow: hidden;
356
+ pointer-events: none;
357
+ }
358
+ .\${P}-overlay-editor {
359
+ inset: auto;
360
+ top: var(--cntrl-article-top, 0);
361
+ left: var(--cntrl-article-left, 0);
362
+ width: var(--cntrl-article-width, 100vw) !important;
363
+ height: var(--cntrl-viewport-height, 100vh) !important;
364
+ }
365
+ .\${P}-overlay-edit-mode {
366
+ z-index: 1;
367
+ }
368
+ .\${P}-overlay-active {
369
+ opacity: 1;
370
+ pointer-events: auto;
371
+ }
372
+ .\${P}-backdrop {
373
+ position: absolute;
374
+ inset: 0;
375
+ background-color: var(--\${P}-overlay-color);
376
+ }
377
+ .\${P}-media-layer {
378
+ position: absolute;
379
+ inset: 0;
380
+ pointer-events: none;
381
+ }
382
+ .\${P}-media {
383
+ position: absolute;
384
+ inset: 0;
385
+ width: 100%;
386
+ height: 100%;
387
+ object-fit: cover;
388
+ opacity: 0;
389
+ transition: opacity \${IMAGE_FADE_MS}ms cubic-bezier(0, 0, 0.58, 1);
390
+ }
391
+ .\${P}-media-contain {
392
+ object-fit: contain;
393
+ }
394
+ .\${P}-media-visible {
395
+ opacity: 1;
396
+ }
397
+ .\${P}-close {
398
+ position: absolute;
399
+ z-index: 2;
400
+ }
401
+ .\${P}-panel {
402
+ position: absolute;
403
+ top: var(--\${P}-panel-y);
404
+ left: var(--\${P}-panel-x);
405
+ z-index: 1;
406
+ box-sizing: border-box;
407
+ max-width: 100%;
408
+ max-height: 100%;
409
+ overflow-y: auto;
410
+ transform: translate(calc(-1 * var(--\${P}-panel-x)), calc(-1 * var(--\${P}-panel-y) + 12px));
411
+ background-color: var(--\${P}-panel-color);
412
+ color: var(--\${P}-text-color);
413
+ overscroll-behavior: contain;
414
+ transition: transform \${OVERLAY_ANIM_MS}ms cubic-bezier(0, 0, 0.58, 1);
415
+ }
416
+ .\${P}-overlay-active .\${P}-panel {
417
+ transform: translate(calc(-1 * var(--\${P}-panel-x)), calc(-1 * var(--\${P}-panel-y)));
418
+ }
419
+ .\${P}-panel-settled {
420
+ transition: none;
421
+ }
422
+ .\${P}-panel-inline {
423
+ position: relative;
424
+ top: auto;
425
+ left: auto;
426
+ max-height: none;
427
+ transform: none;
428
+ transition: none;
429
+ }
430
+ .\${P}-media-layer-instant .\${P}-media {
431
+ transition: none;
432
+ }
433
+ .\${P}-panel-copy {
434
+ position: absolute;
435
+ pointer-events: none;
436
+ }
437
+ .\${P}-panel-copy .\${P}-row-active .\${P}-title {
438
+ color: var(--\${P}-text-hover-color, var(--\${P}-text-color));
439
+ }
440
+ @media (prefers-reduced-motion: reduce) {
441
+ .\${P}-panel {
442
+ transition: none;
443
+ }
444
+ }
445
+ .\${P}-group ~ .\${P}-group {
446
+ margin-top: var(--\${P}-group-gap);
447
+ }
448
+ .\${P}-row {
449
+ display: grid;
450
+ grid-template-columns: var(--\${P}-grid-columns);
451
+ column-gap: var(--\${P}-column-gap);
452
+ align-items: baseline;
453
+ }
454
+ .\${P}-group-label {
455
+ min-width: 0;
456
+ overflow-wrap: anywhere;
457
+ }
458
+ .\${P}-title {
459
+ min-width: 0;
460
+ overflow-wrap: anywhere;
461
+ transition: color 150ms cubic-bezier(0, 0, 0.58, 1);
462
+ }
463
+ .\${P}-control-anchor {
464
+ position: absolute;
465
+ pointer-events: none;
466
+ z-index: 2;
467
+ }
468
+ .\${P}-title a {
469
+ text-decoration: inherit;
470
+ }
471
+ .\${P}-interactive .\${P}-row:hover .\${P}-title,
472
+ .\${P}-row:focus-within .\${P}-title,
473
+ .\${P}-state-hover .\${P}-row:first-child .\${P}-title {
474
+ color: var(--\${P}-text-hover-color, var(--\${P}-text-color));
475
+ }
476
+ \`;
477
+ }
478
+
479
+ function ArchivePopupMediaItem({
480
+ P,
481
+ media,
482
+ isVisible,
483
+ }: {
484
+ P: string;
485
+ media: ArchivePopupMedia;
486
+ isVisible: boolean;
487
+ }) {
488
+ const videoRef = useRef<HTMLVideoElement>(null);
489
+ const [isLoaded, setIsLoaded] = useState(false);
490
+ const isVideo = isVideoMedia(media);
491
+ const className = cn(
492
+ \`\${P}-media\`,
493
+ media.objectFit === 'contain' && \`\${P}-media-contain\`,
494
+ isVisible && isLoaded && \`\${P}-media-visible\`,
495
+ );
496
+
497
+ useEffect(() => {
498
+ const video = videoRef.current;
499
+ if (!isVideo || !video) return;
500
+ if (isVisible) {
501
+ video.play()?.catch(() => {});
502
+ } else {
503
+ video.pause();
504
+ }
505
+ }, [isVideo, isVisible]);
506
+
507
+ if (isVideo) {
508
+ return (
509
+ <video
510
+ ref={videoRef}
511
+ className={className}
512
+ src={media.assetId}
513
+ muted
514
+ loop
515
+ playsInline
516
+ preload="auto"
517
+ onLoadedData={() => setIsLoaded(true)}
518
+ />
519
+ );
520
+ }
521
+
522
+ return (
523
+ <img
524
+ className={className}
525
+ src={media.assetId}
526
+ alt=""
527
+ decoding="async"
528
+ onLoad={() => setIsLoaded(true)}
529
+ />
530
+ );
531
+ }
532
+
533
+ // A line in each gap, at the right edge of the column it sizes, as Programme's are.
534
+ function renderColumnWidthControls(
535
+ P: string,
536
+ widths: number[],
537
+ paddingLeft: number,
538
+ columnGap: number,
539
+ scaled: (value: number) => string,
540
+ ) {
541
+ const lastWidth = widths[widths.length - 1];
542
+ let columnLeft = paddingLeft;
543
+ return widths.slice(0, -1).map((width, index) => {
544
+ const gapCenter = columnLeft + width + columnGap / 2;
545
+ columnLeft += width + columnGap;
546
+ return (
547
+ <div
548
+ key={ARCHIVE_POPUP_COLUMN_WIDTH_KEYS[index]}
549
+ data-controls={ARCHIVE_POPUP_COLUMN_WIDTH_KEYS[index]}
550
+ data-controls-axis="x"
551
+ data-controls-variant="column-width"
552
+ data-controls-min={String(MIN_COLUMN_WIDTH_PX)}
553
+ // a column grows into the last one, which the editor keeps from going under its own least
554
+ data-controls-max-fraction={String(width + lastWidth)}
555
+ className={\`\${P}-control-anchor\`}
556
+ style={{ top: 0, left: scaled(gapCenter - COLUMN_RESIZE_HANDLE_WIDTH / 2), width: scaled(COLUMN_RESIZE_HANDLE_WIDTH), height: '100%' }}
557
+ />
558
+ );
559
+ });
560
+ }
561
+
562
+ function renderPanelPaddingControls(
563
+ P: string,
564
+ panelWidth: number,
565
+ padding: Padding,
566
+ scaled: (value: number) => string,
567
+ ) {
568
+ const handleSize = (value: number) => scaled(Math.max(value, PADDING_HANDLE_SIZE));
569
+ return (
570
+ <>
571
+ <div
572
+ data-controls="panelPadding.top"
573
+ data-controls-axis="y"
574
+ data-controls-variant="row-padding"
575
+ data-controls-min="0"
576
+ className={\`\${P}-control-anchor\`}
577
+ style={{ top: 0, left: 0, width: '100%', height: handleSize(padding.top) }}
578
+ />
579
+ <div
580
+ data-controls="panelPadding.bottom"
581
+ data-controls-axis="y"
582
+ data-controls-variant="row-padding"
583
+ data-controls-reverse=""
584
+ data-controls-min="0"
585
+ className={\`\${P}-control-anchor\`}
586
+ style={{ bottom: 0, left: 0, width: '100%', height: handleSize(padding.bottom) }}
587
+ />
588
+ <div
589
+ data-controls="panelPadding.left"
590
+ data-controls-axis="x"
591
+ data-controls-variant="column-padding"
592
+ data-controls-min="0"
593
+ data-controls-max-fraction={String(Math.max(0, panelWidth - padding.right))}
594
+ className={\`\${P}-control-anchor\`}
595
+ style={{ top: 0, left: 0, width: handleSize(padding.left), height: '100%' }}
596
+ />
597
+ <div
598
+ data-controls="panelPadding.right"
599
+ data-controls-axis="x"
600
+ data-controls-variant="column-padding"
601
+ data-controls-reverse=""
602
+ data-controls-min="0"
603
+ data-controls-max-fraction={String(Math.max(0, panelWidth - padding.left))}
604
+ className={\`\${P}-control-anchor\`}
605
+ style={{ top: 0, right: 0, width: handleSize(padding.right), height: '100%' }}
606
+ />
607
+ </>
608
+ );
609
+ }
610
+
611
+ export function ArchivePopup({
612
+ settings,
613
+ content,
614
+ isEditor,
615
+ isEditMode,
616
+ isPreviewMode,
617
+ activeEvent,
618
+ portalId,
619
+ currentState,
620
+ unavailableStates,
621
+ }: ArchivePopupProps) {
622
+ const { prefix: P } = useScopedStyles();
623
+ const {
624
+ type = 'a',
625
+ triggerLabel = 'Archive',
626
+ closeLabel = 'Close',
627
+ columns = ARCHIVE_POPUP_MIN_COLUMNS,
628
+ columnGap = DEFAULT_COLUMN_GAP,
629
+ panelPosition,
630
+ panelWidth = DEFAULT_PANEL_WIDTH,
631
+ panelPadding = DEFAULT_PANEL_PADDING,
632
+ panelRadius = 0,
633
+ groupGap = 0.0139,
634
+ triggerColor = '#000000',
635
+ triggerHoverColor = '#666666',
636
+ closeColor = '#000000',
637
+ closeHoverColor = '#666666',
638
+ panelColor = '#FFFFFF',
639
+ textColor = '#333132',
640
+ textHoverColor = '#BBBBBB',
641
+ overlayColor = '#FFFFFFE6',
642
+ } = settings;
643
+ const items = content ?? [];
644
+ const wrapperRef = useRef<HTMLDivElement>(null);
645
+ const triggerRef = useRef<HTMLButtonElement>(null);
646
+ const overlayRef = useRef<HTMLDivElement>(null);
647
+ const closeRef = useRef<HTMLButtonElement>(null);
648
+ const panelRef = useRef<HTMLDivElement>(null);
649
+ const inlineLayerRef = useRef<HTMLDivElement>(null);
650
+ const [isOpenUser, setIsOpen] = useState(false);
651
+ const [isOverlayMounted, setIsOverlayMounted] = useState(false);
652
+ const [isOverlayActive, setIsOverlayActive] = useState(false);
653
+ const [isOverlaySettled, setIsOverlaySettled] = useState(false);
654
+ const [activeIndex, setActiveIndex] = useState<number | null>(null);
655
+ const [mountedMedia, setMountedMedia] = useState<Set<number>>(() => new Set());
656
+ const [closePosition, setClosePosition] = useState<{ top: number; left: number } | null>(null);
657
+ const [layoutStyle, setLayoutStyle] = useState<CSSProperties>({});
658
+ const [copyRect, setCopyRect] = useState<{ top: number; left: number; width: number } | null>(null);
659
+ const [isMediaCut, setIsMediaCut] = useState(false);
660
+
661
+ const isEditorCanvas = Boolean(isEditor && !isPreviewMode);
662
+ const isInteractive = !isEditor || Boolean(isPreviewMode);
663
+ // B has no popup to open: its panel is always shown in place of the label.
664
+ const isInline = type === 'b';
665
+ const isOpenPinned = isEditorCanvas && currentState === 'open' && !unavailableStates?.includes('open');
666
+ // Escape from preview lands in edit mode: a popup opened there stays open, with its controls.
667
+ const isOpen = !isInline && (isOpenPinned || ((isInteractive || Boolean(isEditMode)) && isOpenUser));
668
+ const scaled = (value: number) => scalingValue(value, isEditor ?? false);
669
+ const scopedCss = useMemo(() => getCSS(P), [P]);
670
+ const groups = useMemo(() => groupArchiveRows(content ?? []), [content]);
671
+ const panelOffset = PANEL_POSITION_OFFSETS[panelPosition as ArchivePopupPanelPosition] ?? PANEL_POSITION_OFFSETS.center;
672
+ const columnCount = getColumnCount(columns);
673
+ const columnWidths = resolveArchivePopupColumnWidths(settings);
674
+ // the group takes the first column, the titles the rest
675
+ const titleKeys = ['title', ...ARCHIVE_POPUP_EXTRA_TITLE_KEYS].slice(0, columnCount - 1) as Array<'title' | typeof ARCHIVE_POPUP_EXTRA_TITLE_KEYS[number]>;
676
+
677
+ useLightboxScrollLock(isOpen && !isEditorCanvas);
678
+
679
+ useEffect(() => {
680
+ if (isEditorCanvas && !isEditMode) setIsOpen(false);
681
+ }, [isEditorCanvas, isEditMode]);
682
+
683
+ useEffect(() => {
684
+ if (isOpen) {
685
+ setLayoutStyle(getLightboxLayoutStyle(wrapperRef.current));
686
+ setIsOverlayMounted(true);
687
+ return;
688
+ }
689
+ setIsOverlayActive(false);
690
+ setActiveIndex(null);
691
+ const timer = window.setTimeout(() => setIsOverlayMounted(false), OVERLAY_ANIM_MS);
692
+ return () => window.clearTimeout(timer);
693
+ }, [isOpen]);
694
+
695
+ // Activate only after the mounted overlay's hidden styles are applied, or the appear has nothing to transition from.
696
+ useEffect(() => {
697
+ if (!isOpen || !isOverlayMounted) return;
698
+ overlayRef.current?.getBoundingClientRect();
699
+ const frame = requestAnimationFrame(() => setIsOverlayActive(true));
700
+ return () => cancelAnimationFrame(frame);
701
+ }, [isOpen, isOverlayMounted]);
702
+
703
+ // Canvas controls measure their anchors once, so they wait for the panel to finish sliding in.
704
+ useEffect(() => {
705
+ if (!isOverlayActive) {
706
+ setIsOverlaySettled(false);
707
+ return;
708
+ }
709
+ const timer = window.setTimeout(() => setIsOverlaySettled(true), OVERLAY_ANIM_MS);
710
+ return () => window.clearTimeout(timer);
711
+ }, [isOverlayActive]);
712
+
713
+ // The close button sits exactly where the trigger is, so the label swaps in place.
714
+ const updateClosePosition = useCallback(() => {
715
+ const trigger = triggerRef.current;
716
+ const overlay = overlayRef.current;
717
+ if (!trigger || !overlay) return;
718
+ const triggerRect = trigger.getBoundingClientRect();
719
+ const overlayRect = overlay.getBoundingClientRect();
720
+ setClosePosition({ top: triggerRect.top - overlayRect.top, left: triggerRect.left - overlayRect.left });
721
+ }, []);
722
+
723
+ useLayoutEffect(() => {
724
+ if (!isOverlayMounted) return;
725
+ updateClosePosition();
726
+ window.addEventListener('resize', updateClosePosition);
727
+ return () => window.removeEventListener('resize', updateClosePosition);
728
+ }, [isOverlayMounted, updateClosePosition]);
729
+
730
+ useEffect(() => {
731
+ if (!isOpen || !isInteractive) return;
732
+ closeRef.current?.focus({ preventScroll: true });
733
+ const onKeyDown = (event: KeyboardEvent) => {
734
+ if (event.key === 'Escape') setIsOpen(false);
735
+ };
736
+ document.addEventListener('keydown', onKeyDown);
737
+ return () => document.removeEventListener('keydown', onKeyDown);
738
+ }, [isOpen, isInteractive]);
739
+
740
+ // B's media fills the screen above the page, so a copy of the panel is laid exactly over the real one to stay readable.
741
+ useLayoutEffect(() => {
742
+ if (!isInline || activeIndex === null) return;
743
+ const panelEl = panelRef.current;
744
+ const layer = inlineLayerRef.current;
745
+ if (!panelEl || !layer) return;
746
+ const panelRect = panelEl.getBoundingClientRect();
747
+ const layerRect = layer.getBoundingClientRect();
748
+ setCopyRect({ top: panelRect.top - layerRect.top, left: panelRect.left - layerRect.left, width: panelRect.width });
749
+ }, [isInline, activeIndex]);
750
+
751
+ // The copy stays over the list while the media fades out, so the list never shows through a fading image.
752
+ useEffect(() => {
753
+ if (activeIndex !== null) return;
754
+ const timer = window.setTimeout(() => setCopyRect(null), IMAGE_FADE_MS);
755
+ return () => window.clearTimeout(timer);
756
+ }, [activeIndex]);
757
+
758
+ // The copy is only true to the panel until the page moves, so scrolling cuts the media at once rather than locking it,
759
+ // fading out included: a copy left over the list would stay put while the list scrolls away under it.
760
+ const isCopyShown = copyRect !== null;
761
+ useEffect(() => {
762
+ if (!isInline || !isCopyShown) return;
763
+ const cut = () => {
764
+ setIsMediaCut(true);
765
+ setActiveIndex(null);
766
+ setCopyRect(null);
767
+ };
768
+ document.addEventListener('scroll', cut, { capture: true, passive: true });
769
+ window.addEventListener('resize', cut);
770
+ return () => {
771
+ document.removeEventListener('scroll', cut, { capture: true });
772
+ window.removeEventListener('resize', cut);
773
+ };
774
+ }, [isInline, isCopyShown]);
775
+
776
+ const close = () => {
777
+ if (!isInteractive) return;
778
+ setIsOpen(false);
779
+ triggerRef.current?.focus({ preventScroll: true });
780
+ };
781
+
782
+ const showRowMedia = (index: number) => {
783
+ if (!isInteractive || !items[index]?.image?.assetId) {
784
+ setActiveIndex(null);
785
+ return;
786
+ }
787
+ setMountedMedia((prev) => (prev.has(index) ? prev : new Set(prev).add(index)));
788
+ if (isInline && activeIndex === null) setLayoutStyle(getLightboxLayoutStyle(wrapperRef.current));
789
+ setIsMediaCut(false);
790
+ setActiveIndex(index);
791
+ };
792
+
793
+ const hideRowMedia = (index: number) => {
794
+ setActiveIndex((current) => (current === index ? null : current));
795
+ };
796
+
797
+ // Title links only navigate on a live page or in preview, not on the editor canvas.
798
+ const onPanelClickCapture = (event: MouseEvent<HTMLDivElement>) => {
799
+ if (!isInteractive && (event.target as HTMLElement).closest('a')) {
800
+ event.preventDefault();
801
+ }
802
+ };
803
+
804
+ const triggerTypographyCss = omitTextColors(textStylesToCss(resolveTextStyle(settings, 'trigger'), isEditor));
805
+ const columnTypographyCss = ARCHIVE_POPUP_COLUMN_STYLE_PREFIXES.slice(0, columnCount).map((prefix) => (
806
+ omitTextColors(textStylesToCss(resolveTextStyle(settings, prefix, 'list'), isEditor))
807
+ ));
808
+
809
+ const colorVars = buildColorVars(P, {
810
+ triggerColor,
811
+ triggerHoverColor,
812
+ closeColor,
813
+ closeHoverColor,
814
+ panelColor,
815
+ textColor,
816
+ textHoverColor,
817
+ overlayColor,
818
+ }, COLOR_VAR_MAP, STATE_KEYS);
819
+ const stateClass = activeEvent && activeEvent !== 'default' ? \`\${P}-state-\${activeEvent}\` : '';
820
+ const interactiveClass = isInteractive ? \`\${P}-interactive\` : '';
821
+
822
+ const mediaLayer = (
823
+ <div className={cn(\`\${P}-media-layer\`, isMediaCut && \`\${P}-media-layer-instant\`)} aria-hidden="true">
824
+ {[...mountedMedia].map((index) => {
825
+ const media = items[index]?.image;
826
+ if (!media?.assetId) return null;
827
+ return (
828
+ <ArchivePopupMediaItem
829
+ key={\`\${index}-\${media.assetId}\`}
830
+ P={P}
831
+ media={media}
832
+ isVisible={activeIndex === index}
833
+ />
834
+ );
835
+ })}
836
+ </div>
837
+ );
838
+ // Inline there is no slide-in to wait for, so the canvas controls can measure straight away.
839
+ const showPanelControls = Boolean(isEditMode) && (isInline || isOverlaySettled);
840
+
841
+ const renderPanel = (isCopy: boolean) => (
842
+ <div
843
+ ref={isCopy ? undefined : panelRef}
844
+ className={cn(
845
+ \`\${P}-panel\`,
846
+ // Only the open and close slide; once open, a new position or size moves the panel straight there.
847
+ isOverlayActive && isOverlaySettled && \`\${P}-panel-settled\`,
848
+ isInline && \`\${P}-panel-inline\`,
849
+ isCopy && \`\${P}-panel-copy\`,
850
+ )}
851
+ style={{
852
+ width: scaled(panelWidth),
853
+ paddingTop: scaled(panelPadding.top),
854
+ paddingRight: scaled(panelPadding.right),
855
+ paddingBottom: scaled(panelPadding.bottom),
856
+ paddingLeft: scaled(panelPadding.left),
857
+ borderRadius: scaled(panelRadius),
858
+ [\`--\${P}-group-gap\`]: scaled(groupGap),
859
+ [\`--\${P}-panel-x\`]: panelOffset.x,
860
+ [\`--\${P}-panel-y\`]: panelOffset.y,
861
+ [\`--\${P}-grid-columns\`]: getGridTemplateColumns(columnWidths),
862
+ [\`--\${P}-column-gap\`]: scaled(columnGap),
863
+ ...(isCopy && copyRect ? { top: copyRect.top, left: copyRect.left, width: copyRect.width } : {}),
864
+ } as CSSProperties}
865
+ data-lightbox-scrollable={isInline ? undefined : ''}
866
+ aria-hidden={isCopy || undefined}
867
+ onMouseLeave={isCopy ? undefined : () => setActiveIndex(null)}
868
+ onClickCapture={isCopy ? undefined : onPanelClickCapture}
869
+ >
870
+ {!isCopy && showPanelControls && renderPanelPaddingControls(P, panelWidth, panelPadding, scaled)}
871
+ {!isCopy && showPanelControls && renderColumnWidthControls(P, columnWidths, panelPadding.left, columnGap, scaled)}
872
+ {groups.map((group, groupIndex) => (
873
+ <Fragment key={groupIndex}>
874
+ {!isCopy && showPanelControls && groupIndex > 0 && (
875
+ // Left at its static top, the anchor sits right where the gap above this group starts.
876
+ <div
877
+ data-controls="groupGap"
878
+ data-controls-paired=""
879
+ data-controls-axis="y"
880
+ data-controls-reverse=""
881
+ data-controls-min="0"
882
+ className={\`\${P}-control-anchor\`}
883
+ style={{ left: 0, width: '100%', height: scaled(Math.max(groupGap, PADDING_HANDLE_SIZE)) }}
884
+ />
885
+ )}
886
+ <div className={\`\${P}-group\`}>
887
+ {group.rows.map(({ item, index }, rowIndex) => (
888
+ <div
889
+ key={index}
890
+ className={cn(\`\${P}-row\`, isCopy && index === activeIndex && \`\${P}-row-active\`)}
891
+ {...(isCopy ? {} : {
892
+ onMouseEnter: () => showRowMedia(index),
893
+ onMouseLeave: () => hideRowMedia(index),
894
+ onFocus: () => showRowMedia(index),
895
+ onBlur: () => hideRowMedia(index),
896
+ })}
897
+ >
898
+ <span className={\`\${P}-group-label\`} style={columnTypographyCss[0]}>
899
+ {rowIndex === 0 ? group.label : ''}
900
+ </span>
901
+ {titleKeys.map((key, titleIndex) => {
902
+ const title = item[key];
903
+ return (
904
+ <div key={key} className={\`\${P}-title\`} style={columnTypographyCss[titleIndex + 1]}>
905
+ {Array.isArray(title) ? <RichTextRenderer content={title} /> : title}
906
+ </div>
907
+ );
908
+ })}
909
+ </div>
910
+ ))}
911
+ </div>
912
+ </Fragment>
913
+ ))}
914
+ </div>
915
+ );
916
+
917
+ const overlay = isOverlayMounted ? (
918
+ <div
919
+ ref={overlayRef}
920
+ className={cn(
921
+ \`\${P}-overlay\`,
922
+ isEditor && \`\${P}-overlay-editor\`,
923
+ isEditMode && \`\${P}-overlay-edit-mode\`,
924
+ isOverlayActive && \`\${P}-overlay-active\`,
925
+ interactiveClass,
926
+ stateClass,
927
+ )}
928
+ style={{ ...colorVars, ...layoutStyle }}
929
+ role="dialog"
930
+ aria-modal="true"
931
+ aria-label={triggerLabel}
932
+ data-selection="none"
933
+ >
934
+ <div className={\`\${P}-backdrop\`} aria-hidden="true" onClick={close} />
935
+ {mediaLayer}
936
+ <button
937
+ ref={closeRef}
938
+ type="button"
939
+ className={\`\${P}-close\`}
940
+ style={{
941
+ ...triggerTypographyCss,
942
+ top: closePosition?.top ?? 0,
943
+ left: closePosition?.left ?? 0,
944
+ visibility: closePosition ? 'visible' : 'hidden',
945
+ }}
946
+ onClick={close}
947
+ >
948
+ {closeLabel}
949
+ </button>
950
+ {renderPanel(false)}
951
+ </div>
952
+ ) : null;
953
+
954
+ const inlineLayer = isInline && mountedMedia.size > 0 ? (
955
+ <div
956
+ ref={inlineLayerRef}
957
+ className={cn(\`\${P}-inline-layer\`, isEditor && \`\${P}-overlay-editor\`, interactiveClass, stateClass)}
958
+ style={{ ...colorVars, ...layoutStyle }}
959
+ aria-hidden="true"
960
+ data-selection="none"
961
+ >
962
+ {mediaLayer}
963
+ {copyRect && renderPanel(true)}
964
+ </div>
965
+ ) : null;
966
+ const portalContent = overlay ?? inlineLayer;
967
+
968
+ return (
969
+ <>
970
+ <style dangerouslySetInnerHTML={{ __html: scopedCss }} />
971
+ <div
972
+ ref={wrapperRef}
973
+ className={cn(isEditorCanvas && \`\${P}-editor\`, interactiveClass, stateClass)}
974
+ style={colorVars}
975
+ >
976
+ {isInline ? renderPanel(false) : (
977
+ <button
978
+ ref={triggerRef}
979
+ type="button"
980
+ className={\`\${P}-trigger\`}
981
+ style={triggerTypographyCss}
982
+ aria-haspopup="dialog"
983
+ aria-expanded={isOpen}
984
+ onClick={() => {
985
+ if (isInteractive) setIsOpen(true);
986
+ }}
987
+ >
988
+ {triggerLabel}
989
+ </button>
990
+ )}
991
+ </div>
992
+ {portalContent && typeof document !== 'undefined' && createPortal(
993
+ portalContent,
994
+ (portalId ? document.getElementById(portalId) : null) ?? document.body,
995
+ )}
996
+ </>
997
+ );
998
+ }
999
+ `,t=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent, type ReactNode } from 'react';
2
1000
  import { CommonComponentProps } from '../props';
3
1001
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
4
1002
  import { useLightboxScrollLock } from '../utils/useLightboxScrollLock';
@@ -2639,7 +3637,7 @@ export function Burger({
2639
3637
  </div>
2640
3638
  );
2641
3639
  }
2642
- `,t=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3640
+ `,i=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2643
3641
  import { CommonComponentProps } from '../props';
2644
3642
  import { LinkWrapper, useScopedStyles, type ContentLink } from '../utils/index';
2645
3643
 
@@ -3168,7 +4166,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
3168
4166
  </>
3169
4167
  );
3170
4168
  }
3171
- `,i=`import { useCallback, useEffect, useMemo, useState } from 'react';
4169
+ `,o=`import { useCallback, useEffect, useMemo, useState } from 'react';
3172
4170
  import cn from 'classnames';
3173
4171
  import { CommonComponentProps } from '../props';
3174
4172
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
@@ -3916,7 +4914,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
3916
4914
  </>
3917
4915
  );
3918
4916
  }
3919
- `,o=`import React, { useMemo, useState } from 'react';
4917
+ `,r=`import React, { useMemo, useState } from 'react';
3920
4918
  import { CommonComponentProps } from '../props';
3921
4919
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
3922
4920
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
@@ -4554,7 +5552,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
4554
5552
  };
4555
5553
 
4556
5554
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
4557
- `,r=`import { Splide, SplideSlide } from '@splidejs/react-splide';
5555
+ `,a=`import { Splide, SplideSlide } from '@splidejs/react-splide';
4558
5556
  import '@splidejs/react-splide/css/core';
4559
5557
  import { CommonComponentProps } from '../props';
4560
5558
  import { EmbedMediaFrame, getEmbedAspect, getEmbedPlayback, isEmbedMedia } from '../utils/index';
@@ -6869,7 +7867,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
6869
7867
  };
6870
7868
 
6871
7869
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
6872
- `,a=`import { useEffect, useMemo, useRef, type CSSProperties } from 'react';
7870
+ `,s=`import { useEffect, useMemo, useRef, type CSSProperties } from 'react';
6873
7871
  import { CommonComponentProps } from '../props';
6874
7872
  import { scalingValue } from '../utils/scalingValue';
6875
7873
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -7442,7 +8440,7 @@ export function Helix({
7442
8440
  </>
7443
8441
  );
7444
8442
  }
7445
- `,s=`import { CommonComponentProps } from '../props';
8443
+ `,l=`import { CommonComponentProps } from '../props';
7446
8444
  import { EmbedMediaFrame, getEmbedAspect, isEmbedMedia, scalingValue, useLazyVideos, useScopedStyles } from '../utils/index';
7447
8445
  import { LazyVideo } from '../helpers/LazyVideo/LazyVideo';
7448
8446
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
@@ -9831,7 +10829,7 @@ export function Hive({
9831
10829
  </>
9832
10830
  );
9833
10831
  }
9834
- `,l=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
10832
+ `,c=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
9835
10833
  import { createPortal } from 'react-dom';
9836
10834
  import { CommonComponentProps } from '../props';
9837
10835
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -10596,7 +11594,7 @@ export type LightboxJournalSettings = {
10596
11594
  closeIconColor: string;
10597
11595
  closeIconHoverColor: string;
10598
11596
  };
10599
- `,c=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
11597
+ `,d=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
10600
11598
  import { createPortal } from 'react-dom';
10601
11599
  import { CommonComponentProps } from '../props';
10602
11600
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -11142,7 +12140,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
11142
12140
  </>
11143
12141
  );
11144
12142
  };
11145
- `,d=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
12143
+ `,u=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
11146
12144
  import { createPortal } from 'react-dom';
11147
12145
  import { CommonComponentProps } from '../props';
11148
12146
  import { buildColorVars, EmbedMediaFrame, isEmbedMedia, scalingValue, useScopedStyles, type ContentLink } from '../utils/index';
@@ -14247,7 +15245,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
14247
15245
  </>
14248
15246
  );
14249
15247
  }
14250
- `,u=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
15248
+ `,g=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
14251
15249
  import cn from 'classnames';
14252
15250
  import { CommonComponentProps } from '../props';
14253
15251
  import { EmbedMediaFrame, getEmbedAspect, isEmbedMedia, LinkWrapper, scalingValue, useScopedStyles, type ContentLink } from '../utils/index';
@@ -15105,7 +16103,7 @@ type MarqueeProps = {
15105
16103
  isPreviewMode?: boolean;
15106
16104
  isEditMode?: boolean;
15107
16105
  } & CommonComponentProps;
15108
- `,g=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type PointerEvent as ReactPointerEvent } from 'react';
16106
+ `,m=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type PointerEvent as ReactPointerEvent } from 'react';
15109
16107
  import cn from 'classnames';
15110
16108
  import { CommonComponentProps } from '../props';
15111
16109
  import { LinkWrapper, scalingValue, useScopedStyles, type ContentLink } from '../utils/index';
@@ -16048,7 +17046,7 @@ type MarqueeTextProps = {
16048
17046
  isPreviewMode?: boolean;
16049
17047
  isEditMode?: boolean;
16050
17048
  } & CommonComponentProps;
16051
- `,m=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
17049
+ `,p=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
16052
17050
  import { createPortal } from 'react-dom';
16053
17051
  import type React from 'react';
16054
17052
  import { CommonComponentProps } from '../props';
@@ -18530,7 +19528,7 @@ export function Mercury({
18530
19528
  </>
18531
19529
  );
18532
19530
  }
18533
- `,p=`import React, { useMemo, useState } from 'react';
19531
+ `,h=`import React, { useMemo, useState } from 'react';
18534
19532
  import { CommonComponentProps } from '../props';
18535
19533
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
18536
19534
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
@@ -19109,7 +20107,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
19109
20107
  };
19110
20108
 
19111
20109
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
19112
- `,h=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
20110
+ `,f=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
19113
20111
  import type React from 'react';
19114
20112
  import { CommonComponentProps } from '../props';
19115
20113
  import { scalingValue, useScopedStyles } from '../utils/index';
@@ -19948,7 +20946,7 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
19948
20946
  </>
19949
20947
  );
19950
20948
  }
19951
- `,f=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
20949
+ `,v=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
19952
20950
  import cn from 'classnames';
19953
20951
  import { CommonComponentProps } from '../props';
19954
20952
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -20576,7 +21574,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
20576
21574
  </>
20577
21575
  );
20578
21576
  }
20579
- `,v=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
21577
+ `,P=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
20580
21578
  import { SvgImage } from '../helpers/SvgImage/SvgImage';
20581
21579
  import { CommonComponentProps } from '../props';
20582
21580
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
@@ -21208,7 +22206,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
21208
22206
  </>
21209
22207
  );
21210
22208
  }
21211
- `,P=`import React, { useCallback, useEffect, useRef, useState } from 'react';
22209
+ `,x=`import React, { useCallback, useEffect, useRef, useState } from 'react';
21212
22210
  import cn from 'classnames';
21213
22211
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
21214
22212
  import { scalingValue } from '../utils/scalingValue';
@@ -22390,7 +23388,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
22390
23388
  </svg>
22391
23389
  );
22392
23390
  }
22393
- `,x=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
23391
+ `,b=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
22394
23392
  import cn from 'classnames';
22395
23393
  import { CommonComponentProps } from '../props';
22396
23394
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -23021,7 +24019,7 @@ type TestimonialsSettings = {
23021
24019
  logoHeight: number;
23022
24020
  captionMarginTop: number;
23023
24021
  };
23024
- `,b=`import cn from 'classnames';
24022
+ `,y=`import cn from 'classnames';
23025
24023
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
23026
24024
  import { CommonComponentProps } from '../props';
23027
24025
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -23517,7 +24515,7 @@ type TestimonialsSettings = {
23517
24515
  icon?: string | null;
23518
24516
  };
23519
24517
  };
23520
- `,y=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
24518
+ `,S=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
23521
24519
  import type React from 'react';
23522
24520
  import { createPortal } from 'react-dom';
23523
24521
  import { CommonComponentProps } from '../props';
@@ -24050,4 +25048,4 @@ export function Waterfall({
24050
25048
  </>
24051
25049
  );
24052
25050
  }
24053
- `,S={[n.BurgerComponent.id]:e,[n.ClickGallerieComponent.id]:t,[n.FAQComponent.id]:i,[n.FormComponent.id]:o,[n.GridComponent.id]:r,[n.HelixComponent.id]:a,[n.HiveComponent.id]:s,[n.LightboxJournalComponent.id]:l,[n.LightboxStripComponent.id]:c,[n.ListComponent.id]:d,[n.MarqueeComponent.id]:u,[n.MarqueeTextComponent.id]:g,[n.MercuryComponent.id]:m,[n.OnelinerFormComponent.id]:p,[n.PretextComponent.id]:h,[n.ScaleComponent.id]:f,[n.SimpleButtonComponent.id]:v,[n.Slider20Component.id]:P,[n.TestimonialGridComponent.id]:x,[n.TestimonialSingleComponent.id]:b,[n.WaterfallComponent.id]:y};exports.componentSources=S;
25051
+ `,C={[n.ArchivePopupComponent.id]:e,[n.BurgerComponent.id]:t,[n.ClickGallerieComponent.id]:i,[n.FAQComponent.id]:o,[n.FormComponent.id]:r,[n.GridComponent.id]:a,[n.HelixComponent.id]:s,[n.HiveComponent.id]:l,[n.LightboxJournalComponent.id]:c,[n.LightboxStripComponent.id]:d,[n.ListComponent.id]:u,[n.MarqueeComponent.id]:g,[n.MarqueeTextComponent.id]:m,[n.MercuryComponent.id]:p,[n.OnelinerFormComponent.id]:h,[n.PretextComponent.id]:f,[n.ScaleComponent.id]:v,[n.SimpleButtonComponent.id]:P,[n.Slider20Component.id]:x,[n.TestimonialGridComponent.id]:b,[n.TestimonialSingleComponent.id]:y,[n.WaterfallComponent.id]:S};exports.componentSources=C;