@cntrl-site/components 1.0.118-alpha.2 → 1.0.118-alpha.4
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/{Burger-C3yVbQcq.js → Burger-B4kXX9aY.js} +1 -1
- package/dist/{Burger-BkVgNMGU.mjs → Burger-DyORh_vF.mjs} +1 -1
- package/dist/{ChroniclesComponent-Ds59v_47.mjs → ChroniclesComponent-DVoJ0kdT.mjs} +442 -512
- package/dist/ChroniclesComponent-Nm_yIRmr.js +1 -0
- package/dist/Components/Grid/Grid.d.ts +7 -25
- package/dist/Components/PopupMenu/PopupMenu.d.ts +73 -0
- package/dist/Components/PopupMenu/PopupMenuComponent.d.ts +594 -0
- package/dist/Components/PopupMenu/popupMenuLayout.d.ts +203 -0
- package/dist/Components/PopupMenu/popupMenuSnap.d.ts +61 -0
- package/dist/Components/helpers/SvgImage/loadSvgMaskUrl.d.ts +7 -0
- package/dist/{ControlSlider-DqKfaKMG.mjs → ControlSlider-3w-bHQEg.mjs} +1 -1
- package/dist/{ControlSlider-C8ckUIDm.js → ControlSlider-DB4nbVLT.js} +1 -1
- package/dist/{FAQ-DLh63Utr.js → FAQ-7HEkaoU6.js} +1 -1
- package/dist/{FAQ-CJHCMSBa.mjs → FAQ-GmiwRdFq.mjs} +1 -1
- package/dist/Grid-BuRdth9A.mjs +1622 -0
- package/dist/Grid-tqSSYh2-.js +408 -0
- package/dist/{Hive-CzabuuCc.js → Hive-34KvKNsa.js} +1 -1
- package/dist/{Hive-DyxYd5eg.mjs → Hive-7xHXyMM1.mjs} +1 -1
- package/dist/{HiveLightboxTitles-DhEeFKWs.mjs → HiveLightboxTitles-BCoL46-V.mjs} +1 -1
- package/dist/{HiveLightboxTitles-DlyptAaK.js → HiveLightboxTitles-DEeyQGcf.js} +1 -1
- package/dist/{Lightbox-DZckgBzK.js → Lightbox-Cb7lyaNt.js} +1 -1
- package/dist/{Lightbox-BY99NS14.mjs → Lightbox-DzPqgKP4.mjs} +1 -1
- package/dist/{LightboxJournal-Bf_rZzmz.js → LightboxJournal-B-vul_be.js} +1 -1
- package/dist/{LightboxJournal-BDUs6T0B.mjs → LightboxJournal-DisD2DLv.mjs} +1 -1
- package/dist/{LightboxStrip-RA4ABUC-.js → LightboxStrip-YDyEPEb6.js} +1 -1
- package/dist/{LightboxStrip-Cuhb2fIR.mjs → LightboxStrip-wCHUhAqN.mjs} +1 -1
- package/dist/{Mercury-B-s2Kvuq.js → Mercury-BmhtFYOw.js} +1 -1
- package/dist/{Mercury-CCW0Es-s.mjs → Mercury-Q788wrYQ.mjs} +1 -1
- package/dist/{OnelinerForm-C2Y_XMCY.js → OnelinerForm-CUmY-bXL.js} +1 -1
- package/dist/{OnelinerForm-BEu7_sho.mjs → OnelinerForm-D8WIB9Qy.mjs} +1 -1
- package/dist/PopupMenu-CYdDyzEt.mjs +1372 -0
- package/dist/PopupMenu-Di1fHgho.js +409 -0
- package/dist/{SimpleButton-C-o2W9bS.mjs → SimpleButton-DTpzfmb6.mjs} +1 -1
- package/dist/{SimpleButton-nGEcO2gB.js → SimpleButton-DtaCYa3y.js} +1 -1
- package/dist/{Slider20-DUi6qwnd.mjs → Slider20-CKngROrc.mjs} +1 -1
- package/dist/{Slider20-BOmjDRf2.js → Slider20-q0iGgnE3.js} +1 -1
- package/dist/SvgImage-CwRq9-ec.mjs +56 -0
- package/dist/SvgImage-_QN8ngad.js +1 -0
- package/dist/{TestimonialSingle-DrnyReim.mjs → TestimonialSingle-Bax71Hyo.mjs} +1 -1
- package/dist/{TestimonialSingle-BORQom3u.js → TestimonialSingle-CpEUendN.js} +1 -1
- package/dist/{Waterfall-DII4-WV5.js → Waterfall-B9YWMhrg.js} +1 -1
- package/dist/{Waterfall-3kKioKh2.mjs → Waterfall-znaoynn5.mjs} +1 -1
- package/dist/components-BYoTPJk3.js +1 -0
- package/dist/{components-MVf3iei3.mjs → components-eK82xypT.mjs} +653 -30
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +24 -24
- package/dist/elements.node.js +1 -1
- package/dist/elements.node.mjs +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +63 -36
- package/dist/loadSvgMaskUrl-B6kHUyof.js +1 -0
- package/dist/loadSvgMaskUrl-DUhCVvpl.mjs +39 -0
- package/dist/sources.js +48 -250
- package/dist/sources.mjs +87 -290
- package/dist/types/Component.d.ts +7 -0
- package/dist/types/SchemaV1.d.ts +3 -0
- package/package.json +1 -1
- package/dist/ChroniclesComponent--pzhQXVD.js +0 -1
- package/dist/Components/Grid/CustomGridComponent.d.ts +0 -41
- package/dist/Grid-B0NOfgEm.mjs +0 -1713
- package/dist/Grid-DNaBgqZo.js +0 -415
- package/dist/SvgImage-B5mR9y6q.mjs +0 -51
- package/dist/SvgImage-DFlmxAoL.js +0 -1
- package/dist/components-tuVRZ0WY.js +0 -1
- package/dist/loadSvgMaskUrl-DfF7ay6h.js +0 -1
- package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +0 -20
package/dist/sources.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./ChroniclesComponent
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./ChroniclesComponent-Nm_yIRmr.js"),e=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent, type ReactNode } from 'react';
|
|
2
2
|
import { CommonComponentProps } from '../props';
|
|
3
3
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
4
4
|
import { useLightboxScrollLock } from '../utils/useLightboxScrollLock';
|
|
@@ -2683,7 +2683,7 @@ export function Burger({
|
|
|
2683
2683
|
</div>
|
|
2684
2684
|
);
|
|
2685
2685
|
}
|
|
2686
|
-
`,
|
|
2686
|
+
`,t=`import { Fragment, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent } from 'react';
|
|
2687
2687
|
import { createPortal } from 'react-dom';
|
|
2688
2688
|
import cn from 'classnames';
|
|
2689
2689
|
import { CommonComponentProps } from '../props';
|
|
@@ -3730,7 +3730,7 @@ export function Chronicles({
|
|
|
3730
3730
|
</>
|
|
3731
3731
|
);
|
|
3732
3732
|
}
|
|
3733
|
-
`,
|
|
3733
|
+
`,i=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3734
3734
|
import { CommonComponentProps } from '../props';
|
|
3735
3735
|
import { LinkWrapper, useScopedStyles, type ContentLink } from '../utils/index';
|
|
3736
3736
|
|
|
@@ -4259,7 +4259,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
4259
4259
|
</>
|
|
4260
4260
|
);
|
|
4261
4261
|
}
|
|
4262
|
-
`,
|
|
4262
|
+
`,o=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
4263
4263
|
import cn from 'classnames';
|
|
4264
4264
|
import { CommonComponentProps } from '../props';
|
|
4265
4265
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -5003,7 +5003,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
5003
5003
|
</>
|
|
5004
5004
|
);
|
|
5005
5005
|
}
|
|
5006
|
-
`,
|
|
5006
|
+
`,r=`import React, { useMemo, useState } from 'react';
|
|
5007
5007
|
import { CommonComponentProps } from '../props';
|
|
5008
5008
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
5009
5009
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -5641,7 +5641,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
5641
5641
|
};
|
|
5642
5642
|
|
|
5643
5643
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
5644
|
-
`,
|
|
5644
|
+
`,a=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5645
5645
|
import '@splidejs/react-splide/css/core';
|
|
5646
5646
|
import { CommonComponentProps } from '../props';
|
|
5647
5647
|
import { EmbedMediaFrame, getEmbedAspect, getEmbedPlayback, isEmbedMedia } from '../utils/index';
|
|
@@ -5779,13 +5779,6 @@ function getCSS(P: string): string {
|
|
|
5779
5779
|
flex-direction: column;
|
|
5780
5780
|
align-items: center;
|
|
5781
5781
|
}
|
|
5782
|
-
.\${P}-custom-layout .\${P}-item-image-link {
|
|
5783
|
-
flex: 1 1 0%;
|
|
5784
|
-
min-height: 0;
|
|
5785
|
-
}
|
|
5786
|
-
.\${P}-custom-layout.\${P}-text-outside .\${P}-item-image-link {
|
|
5787
|
-
flex: none;
|
|
5788
|
-
}
|
|
5789
5782
|
.\${P}-item-text-link {
|
|
5790
5783
|
display: flex;
|
|
5791
5784
|
flex-direction: column;
|
|
@@ -7307,94 +7300,11 @@ function resolveLightboxImageDisplay(
|
|
|
7307
7300
|
return value?.display === 'cover' ? 'cover' : 'fit';
|
|
7308
7301
|
}
|
|
7309
7302
|
|
|
7310
|
-
function getCustomGridSpanWidth(layout: CustomGridLayout, span: number): number {
|
|
7311
|
-
return layout.columnWidth * span + layout.gutterWidth * Math.max(0, span - 1);
|
|
7312
|
-
}
|
|
7313
|
-
|
|
7314
|
-
type CustomGridSlot = {
|
|
7315
|
-
// first column the entry covers and how many, kept in the layout's columns
|
|
7316
|
-
column: number;
|
|
7317
|
-
span: number;
|
|
7318
|
-
width: number;
|
|
7319
|
-
top: number;
|
|
7320
|
-
height: number;
|
|
7321
|
-
gridColumn: string;
|
|
7322
|
-
gridRow: string;
|
|
7323
|
-
};
|
|
7324
|
-
|
|
7325
|
-
function getCustomGridBlocksBottom(layout: CustomGridLayout): number {
|
|
7326
|
-
return layout.blocks.reduce((bottom, block) => Math.max(bottom, Math.max(0, block.top) + Math.max(0, block.height)), 0);
|
|
7327
|
-
}
|
|
7328
|
-
|
|
7329
|
-
function getCustomGridVerticalGap(layout: CustomGridLayout): number {
|
|
7330
|
-
if (typeof layout.verticalGap === 'number') return Math.max(0, layout.verticalGap);
|
|
7331
|
-
return Math.max(0, (layout.repeatHeight ?? 0) - getCustomGridBlocksBottom(layout));
|
|
7332
|
-
}
|
|
7333
|
-
|
|
7334
|
-
// entries fill the layout's blocks in order, one group after another
|
|
7335
|
-
function getCustomGridSlot(layout: CustomGridLayout, index: number): CustomGridSlot {
|
|
7336
|
-
const block = layout.blocks[index % layout.blocks.length];
|
|
7337
|
-
const span = Math.min(Math.max(1, Math.round(block.span)), layout.columnsCount);
|
|
7338
|
-
const column = Math.min(Math.max(0, Math.round(block.column)), layout.columnsCount - span);
|
|
7339
|
-
return {
|
|
7340
|
-
column,
|
|
7341
|
-
span,
|
|
7342
|
-
width: getCustomGridSpanWidth(layout, span),
|
|
7343
|
-
top: Math.max(0, block.top),
|
|
7344
|
-
height: Math.max(0, block.height),
|
|
7345
|
-
gridColumn: \`\${column + 1} / span \${span}\`,
|
|
7346
|
-
gridRow: \`\${Math.floor(index / layout.blocks.length) + 1}\`,
|
|
7347
|
-
};
|
|
7348
|
-
}
|
|
7349
|
-
|
|
7350
|
-
// the first of the grid's beats at or under \`value\`, from the top of the group
|
|
7351
|
-
function snapDownToCustomGridBeat(layout: CustomGridLayout, value: number): number {
|
|
7352
|
-
const beat = layout.beat ?? 0;
|
|
7353
|
-
return beat > 0 ? Math.ceil(value / beat - 1e-6) * beat : value;
|
|
7354
|
-
}
|
|
7355
|
-
|
|
7356
|
-
/**
|
|
7357
|
-
* With the text outside the blocks, every entry's text takes room under its block: an entry of its
|
|
7358
|
-
* group under it in the same columns keeps where it is drawn, moved along with the entry above,
|
|
7359
|
-
* unless that text reaches it, and then goes onto the first beat under the text. The group grows to
|
|
7360
|
-
* the first beat under its lowest text. Text heights, tops and group heights are in layout units,
|
|
7361
|
-
* like the blocks'.
|
|
7362
|
-
*/
|
|
7363
|
-
function getCustomGridOutsideTextPlacement(layout: CustomGridLayout, textHeights: number[]) {
|
|
7364
|
-
const slots = textHeights.map((_, index) => getCustomGridSlot(layout, index));
|
|
7365
|
-
const tops = slots.map(slot => slot.top);
|
|
7366
|
-
const groupHeights: number[] = [];
|
|
7367
|
-
for (let groupStart = 0; groupStart < slots.length; groupStart += layout.blocks.length) {
|
|
7368
|
-
const group = slots
|
|
7369
|
-
.map((slot, index) => ({ slot, index }))
|
|
7370
|
-
.slice(groupStart, groupStart + layout.blocks.length)
|
|
7371
|
-
.sort((a, b) => a.slot.top - b.slot.top);
|
|
7372
|
-
let bottom = getCustomGridBlocksBottom(layout);
|
|
7373
|
-
for (const { slot, index } of group) {
|
|
7374
|
-
let top = slot.top;
|
|
7375
|
-
for (const { slot: above, index: aboveIndex } of group) {
|
|
7376
|
-
const isAbove = above.top + above.height <= slot.top + 1e-6 && aboveIndex !== index;
|
|
7377
|
-
const sharesColumns = above.column < slot.column + slot.span && slot.column < above.column + above.span;
|
|
7378
|
-
if (isAbove && sharesColumns) {
|
|
7379
|
-
const textBottom = tops[aboveIndex] + above.height + textHeights[aboveIndex];
|
|
7380
|
-
const drawnTop = slot.top + tops[aboveIndex] - above.top;
|
|
7381
|
-
top = Math.max(top, drawnTop >= textBottom - 1e-6 ? drawnTop : snapDownToCustomGridBeat(layout, textBottom));
|
|
7382
|
-
}
|
|
7383
|
-
}
|
|
7384
|
-
tops[index] = top;
|
|
7385
|
-
bottom = Math.max(bottom, tops[index] + slot.height + textHeights[index]);
|
|
7386
|
-
}
|
|
7387
|
-
groupHeights.push(snapDownToCustomGridBeat(layout, bottom));
|
|
7388
|
-
}
|
|
7389
|
-
return { tops, groupHeights };
|
|
7390
|
-
}
|
|
7391
|
-
|
|
7392
7303
|
export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, metadata, activeEvent, layoutId, portalId }: GridProps) {
|
|
7393
7304
|
const { prefix: P } = useScopedStyles();
|
|
7394
7305
|
const {
|
|
7395
7306
|
type = 'a',
|
|
7396
7307
|
gridLayout,
|
|
7397
|
-
customGrid,
|
|
7398
7308
|
textBoxWidth = 100,
|
|
7399
7309
|
verticalGap,
|
|
7400
7310
|
entriesCount,
|
|
@@ -7442,7 +7352,6 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
7442
7352
|
hover = 'none',
|
|
7443
7353
|
alignEntries = 'off',
|
|
7444
7354
|
align = 'top',
|
|
7445
|
-
textGrowth = 'inside',
|
|
7446
7355
|
} = settings;
|
|
7447
7356
|
|
|
7448
7357
|
const resolvedTitleTextStyle: TextStyles = {
|
|
@@ -7532,16 +7441,7 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
7532
7441
|
const hoverEffectClass = hover !== 'none' && (!isEditor || isPreviewMode) ? \` \${P}-hover-\${hover}\` : '';
|
|
7533
7442
|
const wrapperStateClasses = \`\${stateClass}\${showTextOnHover ? \` \${P}-show-text-hover\` : ''}\${hoverEffectClass}\`.trim();
|
|
7534
7443
|
|
|
7535
|
-
|
|
7536
|
-
// group of blocks repeats for as many entries as there are. Stored, it is only the preset it is
|
|
7537
|
-
// linked to; the CMS and the site put the blocks in before it gets here
|
|
7538
|
-
const customLayout = customGrid && Array.isArray(customGrid.blocks) && customGrid.blocks.length > 0 ? customGrid : undefined;
|
|
7539
|
-
const resEntriesCount = customLayout || entriesCount === 0 ? Infinity : entriesCount;
|
|
7540
|
-
// outside, the media fills the block and the text takes room of its own beyond it: below the
|
|
7541
|
-
// media, or above it when the type puts the text first, moving the entries under it down
|
|
7542
|
-
const isTextOutside = !!customLayout && textGrowth === 'outside';
|
|
7543
|
-
const itemInnerRefs = useRef<(HTMLDivElement | null)[]>([]);
|
|
7544
|
-
const [customTextHeights, setCustomTextHeights] = useState<number[]>([]);
|
|
7444
|
+
const resEntriesCount = entriesCount === 0 ? Infinity : entriesCount;
|
|
7545
7445
|
|
|
7546
7446
|
const cropContent = (content ?? []).slice(0, resEntriesCount);
|
|
7547
7447
|
const lightboxMediaToPreload = useMemo(
|
|
@@ -7549,24 +7449,23 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
7549
7449
|
[cropContent, lightbox],
|
|
7550
7450
|
);
|
|
7551
7451
|
|
|
7552
|
-
const size = gridLayout
|
|
7452
|
+
const size = gridLayout.entryWidth ?? 0.2;
|
|
7553
7453
|
|
|
7554
|
-
const
|
|
7555
|
-
const
|
|
7556
|
-
const
|
|
7557
|
-
const ratioReversed = imageDisplaySettings?.reversed ?? false;
|
|
7454
|
+
const isCover = imageDisplay?.display === 'cover';
|
|
7455
|
+
const ratioValue = imageDisplay?.ratioValue ?? '1:1';
|
|
7456
|
+
const ratioReversed = imageDisplay?.reversed ?? false;
|
|
7558
7457
|
const [rW, rH] = ratioValue.split(':').map(Number);
|
|
7559
7458
|
const effW = ratioReversed ? rH : rW;
|
|
7560
7459
|
const effH = ratioReversed ? rW : rH;
|
|
7561
7460
|
const aspectRatio = \`\${effW} / \${effH}\`;
|
|
7562
7461
|
|
|
7563
|
-
const columnsCount = gridLayout
|
|
7462
|
+
const columnsCount = gridLayout.columnsCount;
|
|
7564
7463
|
const entryWidthScaled = scalingValue(size ?? 0, isEditor);
|
|
7565
|
-
|
|
7566
|
-
const isFitSlider = !
|
|
7464
|
+
const imageWrapperWidth = entryWidthScaled;
|
|
7465
|
+
const isFitSlider = !isCover && slider !== 'off';
|
|
7567
7466
|
|
|
7568
7467
|
const itemsInLastRow = cropContent.length % columnsCount || columnsCount;
|
|
7569
|
-
const isPartialLastRow =
|
|
7468
|
+
const isPartialLastRow = itemsInLastRow < columnsCount && cropContent.length > 0;
|
|
7570
7469
|
const lastRowStartIndex = cropContent.length - itemsInLastRow;
|
|
7571
7470
|
const lastRowStartColumn = isPartialLastRow
|
|
7572
7471
|
? Math.floor((columnsCount - itemsInLastRow) / 2) + 1
|
|
@@ -7574,23 +7473,19 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
7574
7473
|
|
|
7575
7474
|
const imageBorderRadius = imageCorners ? scalingValue(imageCorners, isEditor) : undefined;
|
|
7576
7475
|
|
|
7577
|
-
const
|
|
7578
|
-
width:
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
? isTextOutside
|
|
7583
|
-
? { height: scalingValue(slot.height, isEditor), flexShrink: 0, overflow: 'hidden' }
|
|
7584
|
-
: { flex: '1 1 0%', minHeight: 0, overflow: 'hidden' }
|
|
7585
|
-
: isCover
|
|
7586
|
-
? { aspectRatio, height: 'auto', overflow: 'hidden' }
|
|
7587
|
-
: { height: 'auto' }),
|
|
7476
|
+
const imageWrapperStyle: React.CSSProperties = {
|
|
7477
|
+
width: imageWrapperWidth,
|
|
7478
|
+
...(isCover
|
|
7479
|
+
? { aspectRatio, height: 'auto', overflow: 'hidden' }
|
|
7480
|
+
: { height: 'auto' }),
|
|
7588
7481
|
...(imageBorderRadius ? { borderRadius: imageBorderRadius, overflow: 'hidden' } : {}),
|
|
7589
|
-
}
|
|
7482
|
+
};
|
|
7590
7483
|
|
|
7591
7484
|
const imageWrapperClassName = \`\${P}-item-image-wrapper\${isFitSlider ? \` \${P}-item-image-wrapper-fit-slider\` : ''}\`.trim();
|
|
7592
7485
|
const isTextBeforeImage = type === 'd' || type === 'e' || type === 'f';
|
|
7593
|
-
const shouldAlignEntries =
|
|
7486
|
+
const shouldAlignEntries = alignEntries === 'on';
|
|
7487
|
+
const textBoxWidthStyle = \`calc(\${scalingValue(size ?? 0, isEditor)} * (\${textBoxWidth} / 100))\`;
|
|
7488
|
+
const controlWidthStyle = scalingValue(size * textBoxWidth / 100, isEditor);
|
|
7594
7489
|
|
|
7595
7490
|
const imageRadiusStyle = imageBorderRadius
|
|
7596
7491
|
? { borderRadius: imageBorderRadius, [MEDIA_RADIUS_VAR]: imageBorderRadius } as React.CSSProperties
|
|
@@ -7610,68 +7505,9 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
7610
7505
|
width: 'auto',
|
|
7611
7506
|
height: 'auto',
|
|
7612
7507
|
maxWidth: '100%',
|
|
7613
|
-
...(customLayout ? { maxHeight: '100%' } : {}),
|
|
7614
7508
|
...imageRadiusStyle,
|
|
7615
7509
|
};
|
|
7616
7510
|
|
|
7617
|
-
// the text's height is only known once laid out: what an entry measures beyond its media, in
|
|
7618
|
-
// layout units, the layout's whole width taken as the wrapper's
|
|
7619
|
-
const customGridWidth = customLayout ? getCustomGridSpanWidth(customLayout, customLayout.columnsCount) : 0;
|
|
7620
|
-
useLayoutEffect(() => {
|
|
7621
|
-
if (!isTextOutside) {
|
|
7622
|
-
setCustomTextHeights(prev => (prev.length > 0 ? [] : prev));
|
|
7623
|
-
return;
|
|
7624
|
-
}
|
|
7625
|
-
const wrapper = containerRef.current;
|
|
7626
|
-
const inners = itemInnerRefs.current.slice(0, cropContent.length);
|
|
7627
|
-
const measure = () => {
|
|
7628
|
-
const unit = wrapper && customGridWidth > 0 ? wrapper.offsetWidth / customGridWidth : 0;
|
|
7629
|
-
const heights = inners.map((inner) => {
|
|
7630
|
-
const media = inner?.querySelector<HTMLElement>(\`.\${P}-item-image-wrapper\`);
|
|
7631
|
-
return inner && media && unit > 0 ? Math.max(0, inner.offsetHeight - media.offsetHeight) / unit : 0;
|
|
7632
|
-
});
|
|
7633
|
-
setCustomTextHeights(prev => (
|
|
7634
|
-
prev.length === heights.length && prev.every((height, index) => Math.abs(height - heights[index]) < 1e-5)
|
|
7635
|
-
? prev
|
|
7636
|
-
: heights
|
|
7637
|
-
));
|
|
7638
|
-
};
|
|
7639
|
-
measure();
|
|
7640
|
-
const ro = new ResizeObserver(measure);
|
|
7641
|
-
if (wrapper) ro.observe(wrapper);
|
|
7642
|
-
inners.forEach(inner => inner && ro.observe(inner));
|
|
7643
|
-
return () => ro.disconnect();
|
|
7644
|
-
}, [isTextOutside, cropContent.length, customGridWidth, P]);
|
|
7645
|
-
const customOutsideText = customLayout && isTextOutside
|
|
7646
|
-
? getCustomGridOutsideTextPlacement(customLayout, cropContent.map((_: unknown, index: number) => customTextHeights[index] ?? 0))
|
|
7647
|
-
: undefined;
|
|
7648
|
-
|
|
7649
|
-
const customRowsCount = customLayout ? Math.ceil(cropContent.length / customLayout.blocks.length) : 0;
|
|
7650
|
-
const customGroupHeight = customLayout ? scalingValue(getCustomGridBlocksBottom(customLayout), isEditor) : '';
|
|
7651
|
-
const wrapperLayoutStyle: React.CSSProperties = customLayout
|
|
7652
|
-
? {
|
|
7653
|
-
gridTemplateColumns: \`repeat(\${customLayout.columnsCount}, \${scalingValue(customLayout.columnWidth, isEditor)})\`,
|
|
7654
|
-
// every group keeps the height of its blocks, or of the beats its text outside them takes,
|
|
7655
|
-
// but the last, which ends where its entries do
|
|
7656
|
-
gridTemplateRows: customRowsCount > 1
|
|
7657
|
-
? customOutsideText
|
|
7658
|
-
? \`\${customOutsideText.groupHeights.slice(0, -1).map(height => \`minmax(\${scalingValue(height, isEditor)}, auto)\`).join(' ')} auto\`
|
|
7659
|
-
: \`repeat(\${customRowsCount - 1}, minmax(\${customGroupHeight}, auto)) auto\`
|
|
7660
|
-
: 'auto',
|
|
7661
|
-
rowGap: scalingValue(getCustomGridVerticalGap(customLayout), isEditor),
|
|
7662
|
-
columnGap: scalingValue(customLayout.gutterWidth, isEditor),
|
|
7663
|
-
width: scalingValue(getCustomGridSpanWidth(customLayout, customLayout.columnsCount), isEditor),
|
|
7664
|
-
}
|
|
7665
|
-
: {
|
|
7666
|
-
gridTemplateColumns: \`repeat(\${columnsCount}, \${entryWidthScaled})\`,
|
|
7667
|
-
rowGap: shouldAlignEntries ? 0 : scalingValue(verticalGap ?? 0, isEditor),
|
|
7668
|
-
columnGap: scalingValue(gridLayout?.horizontalGap ?? 0, isEditor),
|
|
7669
|
-
width: scalingValue(gridLayout?.wrapperWidth ?? 0, isEditor),
|
|
7670
|
-
...(shouldAlignEntries
|
|
7671
|
-
? { [\`--\${P}-align-entries-row-gap\`]: scalingValue(verticalGap ?? 0, isEditor) }
|
|
7672
|
-
: {}),
|
|
7673
|
-
};
|
|
7674
|
-
|
|
7675
7511
|
const [containerWidth, setContainerWidth] = useState(0);
|
|
7676
7512
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
7677
7513
|
|
|
@@ -7741,8 +7577,16 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
7741
7577
|
<div style={colorVars}>
|
|
7742
7578
|
<div
|
|
7743
7579
|
ref={containerRef}
|
|
7744
|
-
className={\`\${P}-wrapper \${P}-type-\${type}\${shouldAlignEntries ? \` \${P}-align-entries\` : ''}
|
|
7745
|
-
style={
|
|
7580
|
+
className={\`\${P}-wrapper \${P}-type-\${type}\${shouldAlignEntries ? \` \${P}-align-entries\` : ''} \${P}-image-align-\${align} \${wrapperStateClasses}\`.trim()}
|
|
7581
|
+
style={{
|
|
7582
|
+
gridTemplateColumns: \`repeat(\${columnsCount}, \${entryWidthScaled})\`,
|
|
7583
|
+
rowGap: shouldAlignEntries ? 0 : scalingValue(verticalGap ?? 0, isEditor),
|
|
7584
|
+
columnGap: scalingValue(gridLayout.horizontalGap ?? 0, isEditor),
|
|
7585
|
+
width: scalingValue(gridLayout.wrapperWidth ?? 0, isEditor),
|
|
7586
|
+
...(shouldAlignEntries
|
|
7587
|
+
? { [\`--\${P}-align-entries-row-gap\`]: scalingValue(verticalGap ?? 0, isEditor) }
|
|
7588
|
+
: {}),
|
|
7589
|
+
}}>
|
|
7746
7590
|
{cropContent.map((item: any, index: number) => {
|
|
7747
7591
|
const hasTitle = hasText(item.title);
|
|
7748
7592
|
const hasSubtitle = hasText(item.subtitle);
|
|
@@ -7752,20 +7596,6 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
7752
7596
|
const gridColumn = isPartialLastRow && index >= lastRowStartIndex
|
|
7753
7597
|
? \`\${lastRowStartColumn + (index - lastRowStartIndex)}\`
|
|
7754
7598
|
: undefined;
|
|
7755
|
-
const customSlot = customLayout ? getCustomGridSlot(customLayout, index) : undefined;
|
|
7756
|
-
const itemSize = customSlot?.width ?? size;
|
|
7757
|
-
const itemWidthScaled = scalingValue(itemSize, isEditor);
|
|
7758
|
-
const textBoxWidthStyle = \`calc(\${itemWidthScaled} * (\${textBoxWidth} / 100))\`;
|
|
7759
|
-
const controlWidthStyle = scalingValue(itemSize * textBoxWidth / 100, isEditor);
|
|
7760
|
-
const imageWrapperStyle = getImageWrapperStyle(itemWidthScaled, customSlot);
|
|
7761
|
-
const itemStyle: React.CSSProperties | undefined = customSlot
|
|
7762
|
-
? {
|
|
7763
|
-
gridColumn: customSlot.gridColumn,
|
|
7764
|
-
gridRow: customSlot.gridRow,
|
|
7765
|
-
alignSelf: 'start',
|
|
7766
|
-
marginTop: scalingValue(customOutsideText?.tops[index] ?? customSlot.top, isEditor),
|
|
7767
|
-
}
|
|
7768
|
-
: gridColumn && !shouldAlignEntries ? { gridColumn } : undefined;
|
|
7769
7599
|
|
|
7770
7600
|
const typeCTextBlock = isTextBeforeImage ? (
|
|
7771
7601
|
<div className={\`\${P}-item-text-block\`}>
|
|
@@ -7913,7 +7743,7 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
7913
7743
|
</div>
|
|
7914
7744
|
)}
|
|
7915
7745
|
<Splide
|
|
7916
|
-
key={\`\${transition}-\${
|
|
7746
|
+
key={\`\${transition}-\${size}-\${direction}-\${sliderTiming}-\${containerWidth}-\${layoutId}\`}
|
|
7917
7747
|
className={\`\${P}-item-slider\`}
|
|
7918
7748
|
options={{
|
|
7919
7749
|
arrows: false,
|
|
@@ -8007,18 +7837,16 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
8007
7837
|
<div
|
|
8008
7838
|
key={index}
|
|
8009
7839
|
className={\`\${P}-item\`.trim()}
|
|
8010
|
-
style={
|
|
7840
|
+
style={gridColumn && !shouldAlignEntries ? { gridColumn } : undefined}
|
|
8011
7841
|
>
|
|
8012
7842
|
<div
|
|
8013
|
-
|
|
8014
|
-
|
|
8015
|
-
? \`\${P}-item-inner\`
|
|
7843
|
+
className={\`\${isEditMode
|
|
7844
|
+
? \`\${P}-item-inner\`
|
|
8016
7845
|
: \`\${P}-item-inner-hidden\`}\${shouldAlignEntries && isLastRow ? \` \${P}-item-inner-last-row\` : ''}\`.trim()}
|
|
8017
7846
|
style={{
|
|
8018
7847
|
width: (textBoxWidth ?? 0) > 100
|
|
8019
|
-
? \`calc(\${
|
|
8020
|
-
:
|
|
8021
|
-
...(customSlot && !isTextOutside ? { height: scalingValue(customSlot.height, isEditor) } : {}),
|
|
7848
|
+
? \`calc(\${entryWidthScaled} * (\${textBoxWidth} / 100))\`
|
|
7849
|
+
: entryWidthScaled,
|
|
8022
7850
|
...(gridColumn && shouldAlignEntries ? { gridColumn } : {}),
|
|
8023
7851
|
}}
|
|
8024
7852
|
>
|
|
@@ -8101,45 +7929,17 @@ type GridLayoutConfig = {
|
|
|
8101
7929
|
lockedParam?: 'wrapperWidth' | 'entryWidth' | 'horizontalGap' | null;
|
|
8102
7930
|
};
|
|
8103
7931
|
|
|
8104
|
-
type CustomGridBlock = {
|
|
8105
|
-
// first column the block covers, from 0
|
|
8106
|
-
column: number;
|
|
8107
|
-
span: number;
|
|
8108
|
-
// offset from the top of its group
|
|
8109
|
-
top: number;
|
|
8110
|
-
// height of the whole entry: its media fills what the text leaves
|
|
8111
|
-
height: number;
|
|
8112
|
-
};
|
|
8113
|
-
|
|
8114
|
-
// lengths are fractions of the layout width, like the article grid's
|
|
8115
|
-
type CustomGridLayout = {
|
|
8116
|
-
columnsCount: number;
|
|
8117
|
-
columnWidth: number;
|
|
8118
|
-
gutterWidth: number;
|
|
8119
|
-
maxWidth: number | null;
|
|
8120
|
-
// space between one group of blocks and the next
|
|
8121
|
-
verticalGap?: number;
|
|
8122
|
-
// the article grid's beat: entries the text outside the blocks pushes down land on it; 0, or
|
|
8123
|
-
// missing from layouts resolved before it, when there is none
|
|
8124
|
-
beat?: number;
|
|
8125
|
-
// layouts saved before the vertical gap kept the height of a whole group instead
|
|
8126
|
-
repeatHeight?: number;
|
|
8127
|
-
blocks: CustomGridBlock[];
|
|
8128
|
-
};
|
|
8129
|
-
|
|
8130
7932
|
type GridSettings = {
|
|
8131
7933
|
type: 'a' | 'b' | 'c' | 'd' | 'e' | 'f';
|
|
8132
|
-
|
|
8133
|
-
gridLayout?: GridLayoutConfig;
|
|
8134
|
-
customGrid?: CustomGridLayout;
|
|
7934
|
+
gridLayout: GridLayoutConfig;
|
|
8135
7935
|
textBoxWidth: number;
|
|
8136
|
-
verticalGap
|
|
8137
|
-
entriesCount
|
|
7936
|
+
verticalGap: number;
|
|
7937
|
+
entriesCount: number;
|
|
8138
7938
|
lightbox: 'on' | 'off';
|
|
8139
|
-
imageDisplay:
|
|
7939
|
+
imageDisplay: {
|
|
8140
7940
|
display: 'fit' | 'cover';
|
|
8141
|
-
ratioValue
|
|
8142
|
-
reversed
|
|
7941
|
+
ratioValue: '1:1' | '2:3' | '3:4' | '4:5' | '16:9';
|
|
7942
|
+
reversed: boolean;
|
|
8143
7943
|
};
|
|
8144
7944
|
imageCorners?: number;
|
|
8145
7945
|
lightboxImageDisplay?: 'fit' | 'cover' | { display?: 'fit' | 'cover' };
|
|
@@ -8149,10 +7949,8 @@ type GridSettings = {
|
|
|
8149
7949
|
transition: 'fade' | 'slide',
|
|
8150
7950
|
showText: 'always' | 'on hover';
|
|
8151
7951
|
hover?: 'none' | 'zoom-in' | 'greyscale' | 'scale-down';
|
|
8152
|
-
alignEntries
|
|
7952
|
+
alignEntries: 'on' | 'off';
|
|
8153
7953
|
align?: 'top' | 'center' | 'bottom';
|
|
8154
|
-
// with a custom layout: whether a block holds the entry's text or only its media
|
|
8155
|
-
textGrowth?: 'inside' | 'outside';
|
|
8156
7954
|
titleMarginTop: number;
|
|
8157
7955
|
subtitleMarginTop: number;
|
|
8158
7956
|
titleColor: string;
|
|
@@ -25519,4 +25317,4 @@ export function Waterfall({
|
|
|
25519
25317
|
</>
|
|
25520
25318
|
);
|
|
25521
25319
|
}
|
|
25522
|
-
`,C={[n.BurgerComponent.id]:
|
|
25320
|
+
`,C={[n.BurgerComponent.id]:e,[n.ChroniclesComponent.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;
|