@cntrl-site/components 1.0.115 → 1.0.116

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 (30) hide show
  1. package/dist/Chronicles-BNvvaFYY.mjs +744 -0
  2. package/dist/Chronicles-Dj1gvNjE.js +196 -0
  3. package/dist/{ChroniclesComponent-D-yEbs9w.mjs → ChroniclesComponent-0ZWBPdbh.mjs} +542 -491
  4. package/dist/ChroniclesComponent-D4_6w8f7.js +1 -0
  5. package/dist/Components/Chronicles/Chronicles.d.ts +7 -1
  6. package/dist/Components/Chronicles/ChroniclesComponent.d.ts +26 -2
  7. package/dist/Components/LightboxJournal/LightboxJournal.d.ts +1 -0
  8. package/dist/Components/LightboxStrip/LightboxStrip.d.ts +1 -0
  9. package/dist/LightboxJournal-Bmw2zm4t.js +549 -0
  10. package/dist/{LightboxJournal-D59ex6wH.mjs → LightboxJournal-gePVKQJ4.mjs} +429 -403
  11. package/dist/{LightboxStrip-YspzBP8N.mjs → LightboxStrip-BPQiQhd3.mjs} +461 -435
  12. package/dist/LightboxStrip-CTxRwLYk.js +412 -0
  13. package/dist/{components-D4ZrIo2M.js → components-B8MjlzLL.js} +1 -1
  14. package/dist/{components-Ds6rhj3U.mjs → components-BQjon_-7.mjs} +1 -1
  15. package/dist/elements.js +1 -1
  16. package/dist/elements.mjs +3 -3
  17. package/dist/elements.node.js +1 -1
  18. package/dist/elements.node.mjs +1 -1
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/index.mjs +36 -32
  22. package/dist/sources.js +124 -25
  23. package/dist/sources.mjs +131 -32
  24. package/dist/types/SchemaV1.d.ts +3 -0
  25. package/package.json +1 -1
  26. package/dist/Chronicles-Cy2h3jlZ.mjs +0 -724
  27. package/dist/Chronicles-D0ojQzOP.js +0 -196
  28. package/dist/ChroniclesComponent-Os_r2IYg.js +0 -1
  29. package/dist/LightboxJournal-DAEZOPDi.js +0 -523
  30. package/dist/LightboxStrip-BDjI1jyH.js +0 -386
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-D-yEbs9w.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-0ZWBPdbh.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';
@@ -7961,7 +7994,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
7961
7994
  };
7962
7995
 
7963
7996
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
7964
- `, E = `import { useEffect, useMemo, useRef, type CSSProperties } from 'react';
7997
+ `, T = `import { useEffect, useMemo, useRef, type CSSProperties } from 'react';
7965
7998
  import { CommonComponentProps } from '../props';
7966
7999
  import { scalingValue } from '../utils/scalingValue';
7967
8000
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -10995,6 +11028,11 @@ import { getAspectRatio, isImageRatioCover, type ImageRatioFit } from '../utils/
10995
11028
  import { LightboxOverlay } from './LightboxOverlay';
10996
11029
  import { buildJournalSlides, findJournalUrlSlideNumber, getEntryImages, hasJournalUrlParam, removeJournalUrlParam, setJournalUrlParam, slideNumberToIndex } from './utils';
10997
11030
 
11031
+ const HOVER_ANIM_MS = 400;
11032
+ const HOVER_EASING = 'cubic-bezier(0.25, 0.1, 0.25, 1)';
11033
+ const HOVER_ZOOM = 1.1;
11034
+ const HOVER_ZOOM_INSET = \`\${(((1 - 1 / HOVER_ZOOM) / 2) * 100).toFixed(4)}%\`;
11035
+
10998
11036
  function getCSS(P: string): string {
10999
11037
  return \`
11000
11038
  .\${P}-wrapper {
@@ -11041,6 +11079,32 @@ function getCSS(P: string): string {
11041
11079
  max-width: 100%;
11042
11080
  }
11043
11081
 
11082
+ .\${P}-hover-zoom-in .\${P}-cover-image {
11083
+ clip-path: inset(0);
11084
+ transition: transform \${HOVER_ANIM_MS}ms \${HOVER_EASING}, clip-path \${HOVER_ANIM_MS}ms \${HOVER_EASING};
11085
+ }
11086
+
11087
+ .\${P}-hover-scale-down .\${P}-cover-image {
11088
+ transition: transform \${HOVER_ANIM_MS}ms \${HOVER_EASING};
11089
+ }
11090
+
11091
+ .\${P}-hover-greyscale .\${P}-cover-image {
11092
+ transition: filter \${HOVER_ANIM_MS}ms \${HOVER_EASING};
11093
+ }
11094
+
11095
+ @media (hover: hover) {
11096
+ .\${P}-hover-zoom-in .\${P}-cover:hover .\${P}-cover-image {
11097
+ transform: scale(\${HOVER_ZOOM});
11098
+ clip-path: inset(\${HOVER_ZOOM_INSET});
11099
+ }
11100
+ .\${P}-hover-scale-down .\${P}-cover:hover .\${P}-cover-image {
11101
+ transform: scale(0.9);
11102
+ }
11103
+ .\${P}-hover-greyscale .\${P}-cover:hover .\${P}-cover-image {
11104
+ filter: grayscale(1);
11105
+ }
11106
+ }
11107
+
11044
11108
  .\${P}-lightbox {
11045
11109
  position: fixed;
11046
11110
  inset: 0;
@@ -11546,7 +11610,8 @@ type LightboxJournalProps = {
11546
11610
  export const LightboxJournal = ({ settings, content, isEditor, isEditMode, isPreviewMode, portalId, metadata }: LightboxJournalProps) => {
11547
11611
  const { prefix: P } = useScopedStyles();
11548
11612
  const itemId = metadata?.itemId ?? null;
11549
- const { cover, coverFit, type } = settings;
11613
+ const { cover, coverFit, type, hover = 'none' } = settings;
11614
+ const hoverEffectClass = hover !== 'none' && (!isEditor || isPreviewMode) ? \` \${P}-hover-\${hover}\` : '';
11550
11615
  const wrapperRef = useRef<HTMLDivElement>(null);
11551
11616
  const [lightboxOpen, setLightboxOpen] = useState(false);
11552
11617
  const [lightboxInitialSlideIndex, setLightboxInitialSlideIndex] = useState(0);
@@ -11639,7 +11704,7 @@ export const LightboxJournal = ({ settings, content, isEditor, isEditMode, isPre
11639
11704
 
11640
11705
  return (
11641
11706
  <>
11642
- <div ref={wrapperRef} className={\`\${P}-wrapper\`}>
11707
+ <div ref={wrapperRef} className={\`\${P}-wrapper\${hoverEffectClass}\`}>
11643
11708
  <style dangerouslySetInnerHTML={{ __html: getCSS(P) }} />
11644
11709
  {cover ? (
11645
11710
  <button
@@ -11693,6 +11758,7 @@ export const LightboxJournal = ({ settings, content, isEditor, isEditMode, isPre
11693
11758
  export type LightboxJournalSettings = {
11694
11759
  cover: string | null;
11695
11760
  coverFit: ImageRatioFit;
11761
+ hover?: 'none' | 'zoom-in' | 'greyscale' | 'scale-down';
11696
11762
  type: 'A' | 'B';
11697
11763
  maxWidth: number;
11698
11764
  maxHeight: number;
@@ -11776,6 +11842,11 @@ export type {
11776
11842
  StripTitleWidthKey,
11777
11843
  } from './utils';
11778
11844
 
11845
+ const HOVER_ANIM_MS = 400;
11846
+ const HOVER_EASING = 'cubic-bezier(0.25, 0.1, 0.25, 1)';
11847
+ const HOVER_ZOOM = 1.1;
11848
+ const HOVER_ZOOM_INSET = \`\${(((1 - 1 / HOVER_ZOOM) / 2) * 100).toFixed(4)}%\`;
11849
+
11779
11850
  function getCSS(P: string): string {
11780
11851
  return \`
11781
11852
  .\${P}-wrapper {
@@ -11822,6 +11893,32 @@ function getCSS(P: string): string {
11822
11893
  max-width: 100%;
11823
11894
  }
11824
11895
 
11896
+ .\${P}-hover-zoom-in .\${P}-cover-image {
11897
+ clip-path: inset(0);
11898
+ transition: transform \${HOVER_ANIM_MS}ms \${HOVER_EASING}, clip-path \${HOVER_ANIM_MS}ms \${HOVER_EASING};
11899
+ }
11900
+
11901
+ .\${P}-hover-scale-down .\${P}-cover-image {
11902
+ transition: transform \${HOVER_ANIM_MS}ms \${HOVER_EASING};
11903
+ }
11904
+
11905
+ .\${P}-hover-greyscale .\${P}-cover-image {
11906
+ transition: filter \${HOVER_ANIM_MS}ms \${HOVER_EASING};
11907
+ }
11908
+
11909
+ @media (hover: hover) {
11910
+ .\${P}-hover-zoom-in .\${P}-cover:hover .\${P}-cover-image {
11911
+ transform: scale(\${HOVER_ZOOM});
11912
+ clip-path: inset(\${HOVER_ZOOM_INSET});
11913
+ }
11914
+ .\${P}-hover-scale-down .\${P}-cover:hover .\${P}-cover-image {
11915
+ transform: scale(0.9);
11916
+ }
11917
+ .\${P}-hover-greyscale .\${P}-cover:hover .\${P}-cover-image {
11918
+ filter: grayscale(1);
11919
+ }
11920
+ }
11921
+
11825
11922
  .\${P}-lightbox {
11826
11923
  position: fixed;
11827
11924
  inset: 0;
@@ -12179,6 +12276,7 @@ export type LightboxStripItem = {
12179
12276
  export type LightboxStripSettings = {
12180
12277
  cover: string | null;
12181
12278
  coverFit: ImageRatioFit;
12279
+ hover?: 'none' | 'zoom-in' | 'greyscale' | 'scale-down';
12182
12280
  backgroundColor: string;
12183
12281
  thumbnailVisibility: 'on' | 'off';
12184
12282
  thumbnailSize: number;
@@ -12243,7 +12341,8 @@ type LightboxStripProps = {
12243
12341
 
12244
12342
  export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPreviewMode, portalId }: LightboxStripProps) => {
12245
12343
  const { prefix: P } = useScopedStyles();
12246
- const { cover, coverFit } = settings;
12344
+ const { cover, coverFit, hover = 'none' } = settings;
12345
+ const hoverEffectClass = hover !== 'none' && (!isEditor || isPreviewMode) ? \` \${P}-hover-\${hover}\` : '';
12247
12346
  const wrapperRef = useRef<HTMLDivElement>(null);
12248
12347
  const [lightboxOpen, setLightboxOpen] = useState(false);
12249
12348
  const items = content ?? [];
@@ -12261,7 +12360,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
12261
12360
 
12262
12361
  return (
12263
12362
  <>
12264
- <div ref={wrapperRef} className={\`\${P}-wrapper\`}>
12363
+ <div ref={wrapperRef} className={\`\${P}-wrapper\${hoverEffectClass}\`}>
12265
12364
  <style dangerouslySetInnerHTML={{ __html: getCSS(P) }} />
12266
12365
  {cover && (
12267
12366
  <div
@@ -25207,12 +25306,12 @@ export function Waterfall({
25207
25306
  }
25208
25307
  `, U = {
25209
25308
  [y.id]: S,
25210
- [b.id]: w,
25211
- [x.id]: C,
25309
+ [b.id]: C,
25310
+ [x.id]: w,
25212
25311
  [P.id]: $,
25213
25312
  [v.id]: I,
25214
- [f.id]: T,
25215
- [h.id]: E,
25313
+ [f.id]: E,
25314
+ [h.id]: T,
25216
25315
  [p.id]: R,
25217
25316
  [m.id]: M,
25218
25317
  [g.id]: L,
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/components",
3
- "version": "1.0.115",
3
+ "version": "1.0.116",
4
4
  "description": "Custom components for control editor and public websites.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",