@cntrl-site/components 1.0.40 → 1.0.41-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.
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { CommonComponentProps } from '../props';
|
|
2
|
+
import { TextStyles } from '../utils/textStylesToCss';
|
|
3
|
+
import { WaterfallLightboxSettings, WaterfallMedia } from './WaterfallLightbox';
|
|
4
|
+
export type WaterfallContentItem = {
|
|
5
|
+
title?: string;
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
caption?: string;
|
|
8
|
+
image?: WaterfallMedia;
|
|
9
|
+
};
|
|
10
|
+
export type WaterfallSettings = {
|
|
11
|
+
wrapperWidth?: number;
|
|
12
|
+
imageDisplay?: {
|
|
13
|
+
display: 'fit' | 'cover';
|
|
14
|
+
ratioValue: '1:1' | '2:3' | '3:4' | '4:5' | '16:9';
|
|
15
|
+
reversed: boolean;
|
|
16
|
+
};
|
|
17
|
+
titleColor?: string;
|
|
18
|
+
titleFontFamily?: string;
|
|
19
|
+
titleFontSettings?: {
|
|
20
|
+
fontWeight: number;
|
|
21
|
+
fontStyle: string;
|
|
22
|
+
};
|
|
23
|
+
titleFontSize?: number;
|
|
24
|
+
titleLineHeight?: number;
|
|
25
|
+
titleLetterSpacing?: number;
|
|
26
|
+
titleWordSpacing?: number;
|
|
27
|
+
titleTextAppearance?: TextStyles['textAppearance'];
|
|
28
|
+
horizontalGap?: number;
|
|
29
|
+
imageHoverEffect?: 'none' | 'scale-in' | 'saturate';
|
|
30
|
+
} & WaterfallLightboxSettings;
|
|
31
|
+
type WaterfallProps = {
|
|
32
|
+
settings?: WaterfallSettings;
|
|
33
|
+
content?: WaterfallContentItem[];
|
|
34
|
+
isEditor?: boolean;
|
|
35
|
+
isPreviewMode?: boolean;
|
|
36
|
+
isEditMode?: boolean;
|
|
37
|
+
layoutId?: string;
|
|
38
|
+
portalId?: string;
|
|
39
|
+
} & CommonComponentProps;
|
|
40
|
+
export declare function Waterfall({ settings, content, isEditor, isPreviewMode, isEditMode, layoutId, portalId, }: WaterfallProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Waterfall } from './Waterfall';
|
|
2
|
+
import { ComponentSchemaV1 } from '../../types/SchemaV1';
|
|
3
|
+
export declare const WaterfallComponent: {
|
|
4
|
+
element: typeof Waterfall;
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
category: string;
|
|
8
|
+
layoutMode: "structured";
|
|
9
|
+
version: number;
|
|
10
|
+
defaultSize: {
|
|
11
|
+
d: {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
assetsPaths: {
|
|
17
|
+
content: {
|
|
18
|
+
path: string;
|
|
19
|
+
placeholderEnabled: boolean;
|
|
20
|
+
}[];
|
|
21
|
+
parameters: never[];
|
|
22
|
+
};
|
|
23
|
+
fontSettingsPaths: {
|
|
24
|
+
content: never[];
|
|
25
|
+
parameters: {
|
|
26
|
+
path: string;
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
fontRelations: {
|
|
30
|
+
titleFontSettings: string;
|
|
31
|
+
};
|
|
32
|
+
schema: ComponentSchemaV1;
|
|
33
|
+
sourceCode: string;
|
|
34
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { HiveLightboxTextEntry, HiveLightboxTitleSettings } from '../Hive/HiveLightboxTitles';
|
|
2
|
+
export type WaterfallMedia = {
|
|
3
|
+
url: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
objectFit?: 'cover' | 'contain';
|
|
6
|
+
type?: 'image' | 'video';
|
|
7
|
+
};
|
|
8
|
+
export type WaterfallLightboxContentItem = {
|
|
9
|
+
title?: string;
|
|
10
|
+
subtitle?: string;
|
|
11
|
+
caption?: string;
|
|
12
|
+
image?: WaterfallMedia;
|
|
13
|
+
};
|
|
14
|
+
export type WaterfallLightboxSettings = HiveLightboxTitleSettings;
|
|
15
|
+
export type LightboxEntryData = {
|
|
16
|
+
gridIndex: number;
|
|
17
|
+
items: WaterfallMedia[];
|
|
18
|
+
entry: HiveLightboxTextEntry;
|
|
19
|
+
};
|
|
20
|
+
export type AnimRect = {
|
|
21
|
+
top: number;
|
|
22
|
+
left: number;
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
};
|
|
26
|
+
export declare function getLightboxCSS(P: string): string;
|
|
27
|
+
export declare function getMediaClickSourceRect(target: HTMLElement, objectFit: 'cover' | 'contain'): AnimRect;
|
|
28
|
+
export declare function getItemSourceRect(container: HTMLElement, gridIndex: number, objectFit: 'cover' | 'contain'): AnimRect | null;
|
|
29
|
+
export declare function buildLightboxEntries(content: WaterfallLightboxContentItem[]): LightboxEntryData[];
|
|
30
|
+
export declare function collectAllWaterfallMedia(content: WaterfallLightboxContentItem[]): WaterfallMedia[];
|
|
31
|
+
export declare function PreloadedMediaPool({ mediaList }: {
|
|
32
|
+
mediaList: WaterfallMedia[];
|
|
33
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
34
|
+
export declare function Lightbox({ prefix: P, items, index, entry, settings, isEditor, isEditMode, isPreviewMode, canNavigate, lightboxEntries, entryIdx, layoutId, sourceRect, resolveCloseSourceRect, onClose, onPrev, onNext, }: {
|
|
35
|
+
prefix: string;
|
|
36
|
+
items: WaterfallMedia[];
|
|
37
|
+
index: number;
|
|
38
|
+
entry: HiveLightboxTextEntry;
|
|
39
|
+
settings: HiveLightboxTitleSettings;
|
|
40
|
+
isEditor?: boolean;
|
|
41
|
+
isEditMode?: boolean;
|
|
42
|
+
isPreviewMode?: boolean;
|
|
43
|
+
canNavigate: boolean;
|
|
44
|
+
lightboxEntries: LightboxEntryData[];
|
|
45
|
+
entryIdx: number;
|
|
46
|
+
layoutId?: string;
|
|
47
|
+
sourceRect?: AnimRect | null;
|
|
48
|
+
resolveCloseSourceRect?: () => AnimRect | null;
|
|
49
|
+
onClose: () => void;
|
|
50
|
+
onPrev: () => void;
|
|
51
|
+
onNext: () => void;
|
|
52
|
+
}): import("react/jsx-runtime").JSX.Element;
|