@cntrl-site/components 1.0.116-alpha.0 → 1.0.117

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.
Files changed (73) hide show
  1. package/dist/{Burger-DyORh_vF.mjs → Burger-BkVgNMGU.mjs} +1 -1
  2. package/dist/{Burger-B4kXX9aY.js → Burger-C3yVbQcq.js} +1 -1
  3. package/dist/Chronicles-BNvvaFYY.mjs +744 -0
  4. package/dist/Chronicles-Dj1gvNjE.js +196 -0
  5. package/dist/ChroniclesComponent-CoOgQZx2.js +1 -0
  6. package/dist/{ChroniclesComponent-jh4v7wp6.mjs → ChroniclesComponent-Szt0H-op.mjs} +542 -491
  7. package/dist/Components/Chronicles/Chronicles.d.ts +7 -1
  8. package/dist/Components/Chronicles/ChroniclesComponent.d.ts +26 -2
  9. package/dist/Components/LightboxJournal/LightboxJournal.d.ts +1 -0
  10. package/dist/Components/LightboxStrip/LightboxStrip.d.ts +1 -0
  11. package/dist/Components/helpers/SvgImage/loadSvgMaskUrl.d.ts +0 -7
  12. package/dist/{ControlSlider-DB4nbVLT.js → ControlSlider-C8ckUIDm.js} +1 -1
  13. package/dist/{ControlSlider-3w-bHQEg.mjs → ControlSlider-DqKfaKMG.mjs} +1 -1
  14. package/dist/{FAQ-GmiwRdFq.mjs → FAQ-CJHCMSBa.mjs} +1 -1
  15. package/dist/{FAQ-7HEkaoU6.js → FAQ-DLh63Utr.js} +1 -1
  16. package/dist/{Grid-BzarI5Mc.js → Grid-C4hO8KCr.js} +14 -9
  17. package/dist/{Grid-Z2JZyUdC.mjs → Grid-Dud7PLS9.mjs} +201 -196
  18. package/dist/{Hive-34KvKNsa.js → Hive-CzabuuCc.js} +1 -1
  19. package/dist/{Hive-7xHXyMM1.mjs → Hive-DyxYd5eg.mjs} +1 -1
  20. package/dist/{HiveLightboxTitles-BCoL46-V.mjs → HiveLightboxTitles-DhEeFKWs.mjs} +1 -1
  21. package/dist/{HiveLightboxTitles-DEeyQGcf.js → HiveLightboxTitles-DlyptAaK.js} +1 -1
  22. package/dist/{Lightbox-DzPqgKP4.mjs → Lightbox-BY99NS14.mjs} +1 -1
  23. package/dist/{Lightbox-Cb7lyaNt.js → Lightbox-DZckgBzK.js} +1 -1
  24. package/dist/{LightboxJournal-C_q7_s-B.mjs → LightboxJournal-BDUs6T0B.mjs} +466 -434
  25. package/dist/LightboxJournal-Bf_rZzmz.js +555 -0
  26. package/dist/{LightboxStrip-BrNj7ipX.mjs → LightboxStrip-Cuhb2fIR.mjs} +459 -427
  27. package/dist/LightboxStrip-RA4ABUC-.js +418 -0
  28. package/dist/{Mercury-BmhtFYOw.js → Mercury-B-s2Kvuq.js} +1 -1
  29. package/dist/{Mercury-Q788wrYQ.mjs → Mercury-CCW0Es-s.mjs} +1 -1
  30. package/dist/{OnelinerForm-D8WIB9Qy.mjs → OnelinerForm-BEu7_sho.mjs} +1 -1
  31. package/dist/{OnelinerForm-CUmY-bXL.js → OnelinerForm-C2Y_XMCY.js} +1 -1
  32. package/dist/{SimpleButton-DTpzfmb6.mjs → SimpleButton-C-o2W9bS.mjs} +1 -1
  33. package/dist/{SimpleButton-DtaCYa3y.js → SimpleButton-nGEcO2gB.js} +1 -1
  34. package/dist/{Slider20-q0iGgnE3.js → Slider20-BOmjDRf2.js} +1 -1
  35. package/dist/{Slider20-CKngROrc.mjs → Slider20-DUi6qwnd.mjs} +1 -1
  36. package/dist/SvgImage-B5mR9y6q.mjs +51 -0
  37. package/dist/SvgImage-DFlmxAoL.js +1 -0
  38. package/dist/{TestimonialSingle-CpEUendN.js → TestimonialSingle-BORQom3u.js} +1 -1
  39. package/dist/{TestimonialSingle-Bax71Hyo.mjs → TestimonialSingle-DrnyReim.mjs} +1 -1
  40. package/dist/{Waterfall-znaoynn5.mjs → Waterfall-3kKioKh2.mjs} +1 -1
  41. package/dist/{Waterfall-B9YWMhrg.js → Waterfall-DII4-WV5.js} +1 -1
  42. package/dist/{components-C9Fu28pp.mjs → components-DSHc15vW.mjs} +29 -653
  43. package/dist/components-iORMB3kt.js +1 -0
  44. package/dist/elements.js +1 -1
  45. package/dist/elements.mjs +23 -24
  46. package/dist/elements.node.js +1 -1
  47. package/dist/elements.node.mjs +1 -1
  48. package/dist/index.d.ts +2 -4
  49. package/dist/index.js +1 -1
  50. package/dist/index.mjs +38 -61
  51. package/dist/loadSvgMaskUrl-DfF7ay6h.js +1 -0
  52. package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +20 -0
  53. package/dist/sources.js +143 -30
  54. package/dist/sources.mjs +150 -37
  55. package/dist/types/Component.d.ts +0 -7
  56. package/dist/types/SchemaV1.d.ts +3 -3
  57. package/package.json +1 -1
  58. package/dist/Chronicles-Cy2h3jlZ.mjs +0 -724
  59. package/dist/Chronicles-D0ojQzOP.js +0 -196
  60. package/dist/ChroniclesComponent-DYPJBI3d.js +0 -1
  61. package/dist/Components/PopupMenu/PopupMenu.d.ts +0 -73
  62. package/dist/Components/PopupMenu/PopupMenuComponent.d.ts +0 -594
  63. package/dist/Components/PopupMenu/popupMenuLayout.d.ts +0 -203
  64. package/dist/Components/PopupMenu/popupMenuSnap.d.ts +0 -61
  65. package/dist/LightboxJournal-BFF5aKRz.js +0 -523
  66. package/dist/LightboxStrip-CC2e0_9A.js +0 -386
  67. package/dist/PopupMenu-CYdDyzEt.mjs +0 -1372
  68. package/dist/PopupMenu-Di1fHgho.js +0 -409
  69. package/dist/SvgImage-CwRq9-ec.mjs +0 -56
  70. package/dist/SvgImage-_QN8ngad.js +0 -1
  71. package/dist/components-6QFLq5OI.js +0 -1
  72. package/dist/loadSvgMaskUrl-B6kHUyof.js +0 -1
  73. package/dist/loadSvgMaskUrl-DUhCVvpl.mjs +0 -39
package/dist/sources.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { W as n, b as e, T as t, g as i, f as o, S as r, P as a, O as s, h as l, a as c, M as d, L as u, d as g, e as m, H as p, i as h, G as f, F as v, c as P, C as x, j as b, B as y } from "./ChroniclesComponent-jh4v7wp6.mjs";
1
+ import { W as n, b as e, T as t, g as i, f as o, S as r, P as a, O as s, h as l, a as c, M as d, L as u, d as g, e as m, H as p, i as h, G as f, F as v, c as P, C as x, j as b, B as y } from "./ChroniclesComponent-Szt0H-op.mjs";
2
2
  const S = `import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent, type ReactNode } from 'react';
3
3
  import { CommonComponentProps } from '../props';
4
4
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
@@ -2684,7 +2684,7 @@ export function Burger({
2684
2684
  </div>
2685
2685
  );
2686
2686
  }
2687
- `, w = `import { Fragment, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent } from 'react';
2687
+ `, C = `import { Fragment, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent } from 'react';
2688
2688
  import { createPortal } from 'react-dom';
2689
2689
  import cn from 'classnames';
2690
2690
  import { CommonComponentProps } from '../props';
@@ -2695,8 +2695,21 @@ import { useLightboxScrollLock } from '../utils/useLightboxScrollLock';
2695
2695
  export const CHRONICLES_EXTRA_TITLE_KEYS = ['title2', 'title3', 'title4'] as const;
2696
2696
  export const CHRONICLES_COLUMN_WIDTH_KEYS = ['column1Width', 'column2Width', 'column3Width', 'column4Width'] as const;
2697
2697
  export const CHRONICLES_COLUMN_STYLE_PREFIXES = ['column1', 'column2', 'column3', 'column4', 'column5'] as const;
2698
+ export const CHRONICLES_COLUMN_KEYS = ['group', 'title', ...CHRONICLES_EXTRA_TITLE_KEYS] as const;
2699
+ export const CHRONICLES_COLUMN_LETTERS = ['A', 'B', 'C', 'D', 'E'] as const;
2698
2700
 
2699
- const TITLE_KEYS = ['title', ...CHRONICLES_EXTRA_TITLE_KEYS] as const;
2701
+ export type ChroniclesColumnKey = typeof CHRONICLES_COLUMN_KEYS[number];
2702
+
2703
+ export const CHRONICLES_COLUMN_STYLE_PREFIX_BY_KEY = Object.fromEntries(
2704
+ CHRONICLES_COLUMN_KEYS.map((key, index) => [key, CHRONICLES_COLUMN_STYLE_PREFIXES[index]]),
2705
+ ) as Record<ChroniclesColumnKey, typeof CHRONICLES_COLUMN_STYLE_PREFIXES[number]>;
2706
+
2707
+ export function getChroniclesColumnsOrder(order: unknown): ChroniclesColumnKey[] {
2708
+ const saved = Array.isArray(order)
2709
+ ? order.filter((key): key is ChroniclesColumnKey => (CHRONICLES_COLUMN_KEYS as readonly unknown[]).includes(key))
2710
+ : [];
2711
+ return [...new Set([...saved, ...CHRONICLES_COLUMN_KEYS])];
2712
+ }
2700
2713
 
2701
2714
  const PANEL_POSITION_OFFSETS = {
2702
2715
  center: { x: '50%', y: '50%' },
@@ -2740,7 +2753,7 @@ const COLOR_VAR_MAP = {
2740
2753
 
2741
2754
  const PADDING_CONTROLS = [
2742
2755
  { side: 'top', axis: 'y', variant: 'row-padding' },
2743
- { side: 'bottom', axis: 'y', variant: 'row-padding', reverse: true },
2756
+ { side: 'bottom', axis: 'y', variant: 'row-padding',},
2744
2757
  { side: 'left', axis: 'x', variant: 'column-padding', opposite: 'right' },
2745
2758
  { side: 'right', axis: 'x', variant: 'column-padding', opposite: 'left', reverse: true },
2746
2759
  ] as const;
@@ -2790,6 +2803,7 @@ type PrefixedTextStyle<Prefix extends string> = {
2790
2803
 
2791
2804
  type ColumnLayoutSettings = Partial<Record<ColumnWidthKey, number>> & {
2792
2805
  columns: number;
2806
+ columnsOrder?: string[];
2793
2807
  columnGap: number;
2794
2808
  panelWidth: number;
2795
2809
  panelPadding: Padding;
@@ -2831,14 +2845,33 @@ export function getChroniclesEqualColumnWidths(settings: ColumnLayoutSettings):
2831
2845
  return Object.fromEntries(CHRONICLES_COLUMN_WIDTH_KEYS.slice(0, settings.columns - 1).map((key) => [key, width]));
2832
2846
  }
2833
2847
 
2834
- export function applyChroniclesColumnCountChange(
2848
+ export function applyChroniclesLayoutSettingsChange(
2835
2849
  nextSettings: Record<string, any>,
2836
2850
  prevSettings: Record<string, any>,
2837
2851
  ): Record<string, any> {
2838
- if (typeof nextSettings.columns !== 'number' || nextSettings.columns === prevSettings.columns) {
2852
+ const merged = { ...prevSettings, ...nextSettings } as ColumnLayoutSettings;
2853
+ if (typeof nextSettings.columns === 'number' && nextSettings.columns !== prevSettings.columns) {
2854
+ return { ...nextSettings, ...getChroniclesEqualColumnWidths(merged) };
2855
+ }
2856
+
2857
+ const nextOrder = getChroniclesColumnsOrder(nextSettings.columnsOrder);
2858
+ const prevOrder = getChroniclesColumnsOrder(prevSettings.columnsOrder);
2859
+ if (typeof merged.columns !== 'number' || nextOrder.every((key, index) => key === prevOrder[index])) {
2839
2860
  return nextSettings;
2840
2861
  }
2841
- return { ...nextSettings, ...getChroniclesEqualColumnWidths({ ...prevSettings, ...nextSettings } as ColumnLayoutSettings) };
2862
+
2863
+ const prevWidths = resolveColumnWidths(merged);
2864
+ const prevShown = prevOrder.slice(0, merged.columns);
2865
+ const nextShown = nextOrder.slice(0, merged.columns);
2866
+ const freedWidths = prevShown.flatMap((key, slot) => (nextShown.includes(key) ? [] : [prevWidths[slot]]));
2867
+ const widths = nextShown.map((key) => {
2868
+ const prevSlot = prevShown.indexOf(key);
2869
+ return prevSlot >= 0 ? prevWidths[prevSlot] : freedWidths.shift() ?? 0;
2870
+ });
2871
+ return {
2872
+ ...nextSettings,
2873
+ ...Object.fromEntries(CHRONICLES_COLUMN_WIDTH_KEYS.slice(0, merged.columns - 1).map((key, slot) => [key, widths[slot]])),
2874
+ };
2842
2875
  }
2843
2876
 
2844
2877
  function resolveColumnWidths(settings: ColumnLayoutSettings): number[] {
@@ -2857,11 +2890,11 @@ function getGridTemplateColumns(widths: number[]): string {
2857
2890
  return widths.map((width) => \`minmax(0, \${total > 0 ? (width / total) * 100 : 1}fr)\`).join(' ');
2858
2891
  }
2859
2892
 
2860
- // A row with an empty group continues the group above it.
2861
- function groupRows(items: ChroniclesItem[]): ChroniclesGroup[] {
2893
+ // The first column groups the rows: a row with it empty continues the group above it.
2894
+ function groupRows(items: ChroniclesItem[], groupKey: ChroniclesColumnKey): ChroniclesGroup[] {
2862
2895
  const groups: ChroniclesGroup[] = [];
2863
2896
  items.forEach((item, index) => {
2864
- const label = item.group?.trim() ?? '';
2897
+ const label = item[groupKey]?.trim() ?? '';
2865
2898
  const current = groups[groups.length - 1];
2866
2899
  if (!current || (label !== '' && label !== current.label)) {
2867
2900
  groups.push({ label, rows: [{ item, index }] });
@@ -3293,11 +3326,13 @@ export function Chronicles({
3293
3326
  const scopedCss = useMemo(() => getCSS(P), [P]);
3294
3327
  const panelOffset = PANEL_POSITION_OFFSETS[panelPosition];
3295
3328
  const columnWidths = resolveColumnWidths(settings);
3296
- const titleKeys = TITLE_KEYS.slice(0, columns - 1);
3329
+ const shownKeys = getChroniclesColumnsOrder(settings.columnsOrder).slice(0, columns);
3297
3330
  const hasGroupColumn = columns > 1;
3331
+ const groupKey = shownKeys[0];
3332
+ const rowKeys = hasGroupColumn ? shownKeys.slice(1) : shownKeys;
3298
3333
  const groups = useMemo<ChroniclesGroup[]>(() => (
3299
- hasGroupColumn ? groupRows(items) : [{ label: '', rows: items.map((item, index) => ({ item, index })) }]
3300
- ), [items, hasGroupColumn]);
3334
+ hasGroupColumn ? groupRows(items, groupKey) : [{ label: '', rows: items.map((item, index) => ({ item, index })) }]
3335
+ ), [items, hasGroupColumn, groupKey]);
3301
3336
 
3302
3337
  const activeMedia = activeIndex === null ? [] : getRowMedia(items[activeIndex]);
3303
3338
  const shownAsset = activeMedia[activeMediaIndex];
@@ -3480,9 +3515,11 @@ export function Chronicles({
3480
3515
  };
3481
3516
 
3482
3517
  const triggerTypographyCss = omitTextColors(textStylesToCss(resolveTextStyle(settings, 'trigger'), isEditor));
3483
- const columnTypographyCss = CHRONICLES_COLUMN_STYLE_PREFIXES.slice(0, columns).map((prefix) => (
3484
- omitTextColors(textStylesToCss(resolveTextStyle(settings, prefix), isEditor))
3518
+ // one per shown column, in slot order
3519
+ const columnTypographyCss = shownKeys.map((key) => (
3520
+ omitTextColors(textStylesToCss(resolveTextStyle(settings, CHRONICLES_COLUMN_STYLE_PREFIX_BY_KEY[key]), isEditor))
3485
3521
  ));
3522
+ const rowTypographyCss = hasGroupColumn ? columnTypographyCss.slice(1) : columnTypographyCss;
3486
3523
  const labelLineHeight = columnTypographyCss[0].lineHeight;
3487
3524
  const titleLineHeight = columnTypographyCss[1]?.lineHeight;
3488
3525
  const groupLabelOffset = labelLineHeight !== undefined && titleLineHeight !== undefined
@@ -3561,7 +3598,6 @@ export function Chronicles({
3561
3598
  data-controls="groupGap"
3562
3599
  data-controls-paired=""
3563
3600
  data-controls-axis="y"
3564
- data-controls-reverse=""
3565
3601
  data-controls-min="0"
3566
3602
  className={\`\${P}-control-anchor\`}
3567
3603
  style={{ left: 0, width: '100%', height: scaled(Math.max(groupGap, MIN_HANDLE_SIZE)) }}
@@ -3601,11 +3637,8 @@ export function Chronicles({
3601
3637
  {...linkProps}
3602
3638
  {...hoverProps}
3603
3639
  >
3604
- {!hasGroupColumn && (
3605
- <div className={\`\${P}-title\`} style={columnTypographyCss[0]}>{item.group}</div>
3606
- )}
3607
- {titleKeys.map((key, titleIndex) => (
3608
- <div key={key} className={\`\${P}-title\`} style={columnTypographyCss[titleIndex + 1]}>{item[key]}</div>
3640
+ {rowKeys.map((key, cellIndex) => (
3641
+ <div key={key} className={\`\${P}-title\`} style={rowTypographyCss[cellIndex]}>{item[key]}</div>
3609
3642
  ))}
3610
3643
  </RowElement>
3611
3644
  );
@@ -3698,7 +3731,7 @@ export function Chronicles({
3698
3731
  </>
3699
3732
  );
3700
3733
  }
3701
- `, C = `import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3734
+ `, w = `import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3702
3735
  import { CommonComponentProps } from '../props';
3703
3736
  import { LinkWrapper, useScopedStyles, type ContentLink } from '../utils/index';
3704
3737
 
@@ -5609,7 +5642,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
5609
5642
  };
5610
5643
 
5611
5644
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
5612
- `, T = `import { Splide, SplideSlide } from '@splidejs/react-splide';
5645
+ `, E = `import { Splide, SplideSlide } from '@splidejs/react-splide';
5613
5646
  import '@splidejs/react-splide/css/core';
5614
5647
  import { CommonComponentProps } from '../props';
5615
5648
  import { EmbedMediaFrame, getEmbedAspect, getEmbedPlayback, isEmbedMedia } from '../utils/index';
@@ -5669,7 +5702,6 @@ function getGridTextLeadingVars(
5669
5702
  const HOVER_ANIM_MS = 400;
5670
5703
  const HOVER_EASING = 'cubic-bezier(0.25, 0.1, 0.25, 1)';
5671
5704
  const HOVER_ZOOM = 1.1;
5672
- const HOVER_ZOOM_INSET = \`\${(((1 - 1 / HOVER_ZOOM) / 2) * 100).toFixed(4)}%\`;
5673
5705
  const MEDIA_RADIUS_VAR = '--grid-media-radius';
5674
5706
 
5675
5707
  function getCSS(P: string): string {
@@ -5815,10 +5847,16 @@ function getCSS(P: string): string {
5815
5847
  .\${P}-show-text-hover .\${P}-item-inner-hidden:hover .\${P}-item-subtitle {
5816
5848
  opacity: 1;
5817
5849
  }
5850
+ @property --\${P}-hover-zoom {
5851
+ syntax: '<number>';
5852
+ inherits: false;
5853
+ initial-value: 1;
5854
+ }
5818
5855
  .\${P}-hover-zoom-in .\${P}-item-image,
5819
5856
  .\${P}-hover-zoom-in .\${P}-item-video {
5820
- clip-path: inset(0 round var(\${MEDIA_RADIUS_VAR}, 0px));
5821
- transition: transform \${HOVER_ANIM_MS}ms \${HOVER_EASING}, clip-path \${HOVER_ANIM_MS}ms \${HOVER_EASING};
5857
+ transform: scale(var(--\${P}-hover-zoom));
5858
+ clip-path: inset(calc(50% - 50% / var(--\${P}-hover-zoom)) round calc(var(\${MEDIA_RADIUS_VAR}, 0px) / var(--\${P}-hover-zoom)));
5859
+ transition: --\${P}-hover-zoom \${HOVER_ANIM_MS}ms \${HOVER_EASING};
5822
5860
  }
5823
5861
  .\${P}-hover-scale-down .\${P}-item-image,
5824
5862
  .\${P}-hover-scale-down .\${P}-item-video {
@@ -5829,8 +5867,7 @@ function getCSS(P: string): string {
5829
5867
  }
5830
5868
  @media (hover: hover) {
5831
5869
  .\${P}-hover-zoom-in .\${P}-item-image-wrapper:has(.\${P}-item-image:hover, .\${P}-item-video:hover) :is(.\${P}-item-image, .\${P}-item-video) {
5832
- transform: scale(\${HOVER_ZOOM});
5833
- clip-path: inset(\${HOVER_ZOOM_INSET} round calc(var(\${MEDIA_RADIUS_VAR}, 0px) / \${HOVER_ZOOM}));
5870
+ --\${P}-hover-zoom: \${HOVER_ZOOM};
5834
5871
  }
5835
5872
  .\${P}-hover-scale-down .\${P}-item-image-wrapper:hover .\${P}-item-image,
5836
5873
  .\${P}-hover-scale-down .\${P}-item-image-wrapper:hover .\${P}-item-video {
@@ -7961,7 +7998,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
7961
7998
  };
7962
7999
 
7963
8000
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
7964
- `, E = `import { useEffect, useMemo, useRef, type CSSProperties } from 'react';
8001
+ `, T = `import { useEffect, useMemo, useRef, type CSSProperties } from 'react';
7965
8002
  import { CommonComponentProps } from '../props';
7966
8003
  import { scalingValue } from '../utils/scalingValue';
7967
8004
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -10995,6 +11032,10 @@ import { getAspectRatio, isImageRatioCover, type ImageRatioFit } from '../utils/
10995
11032
  import { LightboxOverlay } from './LightboxOverlay';
10996
11033
  import { buildJournalSlides, findJournalUrlSlideNumber, getEntryImages, hasJournalUrlParam, removeJournalUrlParam, setJournalUrlParam, slideNumberToIndex } from './utils';
10997
11034
 
11035
+ const HOVER_ANIM_MS = 400;
11036
+ const HOVER_EASING = 'cubic-bezier(0.25, 0.1, 0.25, 1)';
11037
+ const HOVER_ZOOM = 1.1;
11038
+
10998
11039
  function getCSS(P: string): string {
10999
11040
  return \`
11000
11041
  .\${P}-wrapper {
@@ -11041,6 +11082,38 @@ function getCSS(P: string): string {
11041
11082
  max-width: 100%;
11042
11083
  }
11043
11084
 
11085
+ @property --\${P}-hover-zoom {
11086
+ syntax: '<number>';
11087
+ inherits: false;
11088
+ initial-value: 1;
11089
+ }
11090
+
11091
+ .\${P}-hover-zoom-in .\${P}-cover-image {
11092
+ transform: scale(var(--\${P}-hover-zoom));
11093
+ clip-path: inset(calc(50% - 50% / var(--\${P}-hover-zoom)));
11094
+ transition: --\${P}-hover-zoom \${HOVER_ANIM_MS}ms \${HOVER_EASING};
11095
+ }
11096
+
11097
+ .\${P}-hover-scale-down .\${P}-cover-image {
11098
+ transition: transform \${HOVER_ANIM_MS}ms \${HOVER_EASING};
11099
+ }
11100
+
11101
+ .\${P}-hover-greyscale .\${P}-cover-image {
11102
+ transition: filter \${HOVER_ANIM_MS}ms \${HOVER_EASING};
11103
+ }
11104
+
11105
+ @media (hover: hover) {
11106
+ .\${P}-hover-zoom-in .\${P}-cover:hover .\${P}-cover-image {
11107
+ --\${P}-hover-zoom: \${HOVER_ZOOM};
11108
+ }
11109
+ .\${P}-hover-scale-down .\${P}-cover:hover .\${P}-cover-image {
11110
+ transform: scale(0.9);
11111
+ }
11112
+ .\${P}-hover-greyscale .\${P}-cover:hover .\${P}-cover-image {
11113
+ filter: grayscale(1);
11114
+ }
11115
+ }
11116
+
11044
11117
  .\${P}-lightbox {
11045
11118
  position: fixed;
11046
11119
  inset: 0;
@@ -11546,7 +11619,8 @@ type LightboxJournalProps = {
11546
11619
  export const LightboxJournal = ({ settings, content, isEditor, isEditMode, isPreviewMode, portalId, metadata }: LightboxJournalProps) => {
11547
11620
  const { prefix: P } = useScopedStyles();
11548
11621
  const itemId = metadata?.itemId ?? null;
11549
- const { cover, coverFit, type } = settings;
11622
+ const { cover, coverFit, type, hover = 'none' } = settings;
11623
+ const hoverEffectClass = hover !== 'none' && (!isEditor || isPreviewMode) ? \` \${P}-hover-\${hover}\` : '';
11550
11624
  const wrapperRef = useRef<HTMLDivElement>(null);
11551
11625
  const [lightboxOpen, setLightboxOpen] = useState(false);
11552
11626
  const [lightboxInitialSlideIndex, setLightboxInitialSlideIndex] = useState(0);
@@ -11639,7 +11713,7 @@ export const LightboxJournal = ({ settings, content, isEditor, isEditMode, isPre
11639
11713
 
11640
11714
  return (
11641
11715
  <>
11642
- <div ref={wrapperRef} className={\`\${P}-wrapper\`}>
11716
+ <div ref={wrapperRef} className={\`\${P}-wrapper\${hoverEffectClass}\`}>
11643
11717
  <style dangerouslySetInnerHTML={{ __html: getCSS(P) }} />
11644
11718
  {cover ? (
11645
11719
  <button
@@ -11693,6 +11767,7 @@ export const LightboxJournal = ({ settings, content, isEditor, isEditMode, isPre
11693
11767
  export type LightboxJournalSettings = {
11694
11768
  cover: string | null;
11695
11769
  coverFit: ImageRatioFit;
11770
+ hover?: 'none' | 'zoom-in' | 'greyscale' | 'scale-down';
11696
11771
  type: 'A' | 'B';
11697
11772
  maxWidth: number;
11698
11773
  maxHeight: number;
@@ -11776,6 +11851,10 @@ export type {
11776
11851
  StripTitleWidthKey,
11777
11852
  } from './utils';
11778
11853
 
11854
+ const HOVER_ANIM_MS = 400;
11855
+ const HOVER_EASING = 'cubic-bezier(0.25, 0.1, 0.25, 1)';
11856
+ const HOVER_ZOOM = 1.1;
11857
+
11779
11858
  function getCSS(P: string): string {
11780
11859
  return \`
11781
11860
  .\${P}-wrapper {
@@ -11822,6 +11901,38 @@ function getCSS(P: string): string {
11822
11901
  max-width: 100%;
11823
11902
  }
11824
11903
 
11904
+ @property --\${P}-hover-zoom {
11905
+ syntax: '<number>';
11906
+ inherits: false;
11907
+ initial-value: 1;
11908
+ }
11909
+
11910
+ .\${P}-hover-zoom-in .\${P}-cover-image {
11911
+ transform: scale(var(--\${P}-hover-zoom));
11912
+ clip-path: inset(calc(50% - 50% / var(--\${P}-hover-zoom)));
11913
+ transition: --\${P}-hover-zoom \${HOVER_ANIM_MS}ms \${HOVER_EASING};
11914
+ }
11915
+
11916
+ .\${P}-hover-scale-down .\${P}-cover-image {
11917
+ transition: transform \${HOVER_ANIM_MS}ms \${HOVER_EASING};
11918
+ }
11919
+
11920
+ .\${P}-hover-greyscale .\${P}-cover-image {
11921
+ transition: filter \${HOVER_ANIM_MS}ms \${HOVER_EASING};
11922
+ }
11923
+
11924
+ @media (hover: hover) {
11925
+ .\${P}-hover-zoom-in .\${P}-cover:hover .\${P}-cover-image {
11926
+ --\${P}-hover-zoom: \${HOVER_ZOOM};
11927
+ }
11928
+ .\${P}-hover-scale-down .\${P}-cover:hover .\${P}-cover-image {
11929
+ transform: scale(0.9);
11930
+ }
11931
+ .\${P}-hover-greyscale .\${P}-cover:hover .\${P}-cover-image {
11932
+ filter: grayscale(1);
11933
+ }
11934
+ }
11935
+
11825
11936
  .\${P}-lightbox {
11826
11937
  position: fixed;
11827
11938
  inset: 0;
@@ -12179,6 +12290,7 @@ export type LightboxStripItem = {
12179
12290
  export type LightboxStripSettings = {
12180
12291
  cover: string | null;
12181
12292
  coverFit: ImageRatioFit;
12293
+ hover?: 'none' | 'zoom-in' | 'greyscale' | 'scale-down';
12182
12294
  backgroundColor: string;
12183
12295
  thumbnailVisibility: 'on' | 'off';
12184
12296
  thumbnailSize: number;
@@ -12243,7 +12355,8 @@ type LightboxStripProps = {
12243
12355
 
12244
12356
  export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPreviewMode, portalId }: LightboxStripProps) => {
12245
12357
  const { prefix: P } = useScopedStyles();
12246
- const { cover, coverFit } = settings;
12358
+ const { cover, coverFit, hover = 'none' } = settings;
12359
+ const hoverEffectClass = hover !== 'none' && (!isEditor || isPreviewMode) ? \` \${P}-hover-\${hover}\` : '';
12247
12360
  const wrapperRef = useRef<HTMLDivElement>(null);
12248
12361
  const [lightboxOpen, setLightboxOpen] = useState(false);
12249
12362
  const items = content ?? [];
@@ -12261,7 +12374,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
12261
12374
 
12262
12375
  return (
12263
12376
  <>
12264
- <div ref={wrapperRef} className={\`\${P}-wrapper\`}>
12377
+ <div ref={wrapperRef} className={\`\${P}-wrapper\${hoverEffectClass}\`}>
12265
12378
  <style dangerouslySetInnerHTML={{ __html: getCSS(P) }} />
12266
12379
  {cover && (
12267
12380
  <div
@@ -25207,12 +25320,12 @@ export function Waterfall({
25207
25320
  }
25208
25321
  `, U = {
25209
25322
  [y.id]: S,
25210
- [b.id]: w,
25211
- [x.id]: C,
25323
+ [b.id]: C,
25324
+ [x.id]: w,
25212
25325
  [P.id]: $,
25213
25326
  [v.id]: I,
25214
- [f.id]: T,
25215
- [h.id]: E,
25327
+ [f.id]: E,
25328
+ [h.id]: T,
25216
25329
  [p.id]: R,
25217
25330
  [m.id]: M,
25218
25331
  [g.id]: L,
@@ -8,11 +8,6 @@ export type ComponentSize = {
8
8
  export type ComponentDefaultSize = Partial<Record<Breakpoint, ComponentSize>>;
9
9
  export type ComponentNavigationPosition = 'default' | 'stickyTop' | 'switch';
10
10
  export type ComponentDefaultNavigationPosition = Partial<Record<Breakpoint, ComponentNavigationPosition>>;
11
- /**
12
- * How a navigation component is laid out: across the page's width ('full-width'), or placed and sized
13
- * like an item, staying put on the screen ('freeform').
14
- */
15
- export type ComponentNavigationLayout = 'full-width' | 'freeform';
16
11
  export type Component = {
17
12
  element: (props: any) => React.ReactElement;
18
13
  id: string;
@@ -22,8 +17,6 @@ export type Component = {
22
17
  layoutMode?: 'freeform' | 'structured' | 'navigation';
23
18
  defaultSize?: ComponentDefaultSize;
24
19
  defaultNavigationPosition?: ComponentDefaultNavigationPosition;
25
- /** For a `layoutMode: 'navigation'` component; none is 'full-width'. */
26
- navigationLayout?: ComponentNavigationLayout;
27
20
  schema: any;
28
21
  preview?: {
29
22
  type: 'image' | 'video';
@@ -64,6 +64,7 @@ export type SchemaDisplayRule = {
64
64
  };
65
65
  /** The post header fields a content field can be filled from when a collection is connected, and the post page's link. */
66
66
  export type ContentKey = 'title' | 'subtitle' | 'date' | 'gallery' | 'link';
67
+ export type ContentFormat = 'year';
67
68
  /**
68
69
  * A link as a `link-input` content field holds it. In the editor `value` is a url, a page id or a
69
70
  * section id; a published site gets it with `value` already the url to follow.
@@ -89,6 +90,8 @@ export type ComponentContentProperty = {
89
90
  placeholder?: string;
90
91
  /** The post field this one is filled from when a collection is connected; none leaves it to the user. */
91
92
  contentKey?: ContentKey;
93
+ /** How a value filled from a post is shown: 'year' keeps only the year of a date. */
94
+ contentFormat?: ContentFormat;
92
95
  display?: SchemaDisplay;
93
96
  properties?: Record<string, ComponentContentProperty>;
94
97
  items?: ComponentContentProperty;
@@ -97,9 +100,6 @@ export type ComponentContentProperty = {
97
100
  min?: number;
98
101
  max?: number;
99
102
  default?: unknown;
100
- /** How the field is drawn instead in a row whose `type` is one of these keys, laid over the rest; a display
101
- * with `visible: false` leaves the field out of those rows. */
102
- byRowType?: Record<string, Pick<ComponentContentProperty, 'placeholder' | 'display'>>;
103
103
  };
104
104
  export type ComponentContentSchema = {
105
105
  type: 'array';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/components",
3
- "version": "1.0.116-alpha.0",
3
+ "version": "1.0.117",
4
4
  "description": "Custom components for control editor and public websites.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",