@cntrl-site/components 1.0.19 → 1.0.21
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/LICENSE +21 -21
- package/README.md +2 -2
- package/dist/Components/LightboxJournal/LightboxJournal.d.ts +97 -0
- package/dist/Components/LightboxJournal/LightboxJournalComponent.d.ts +44 -0
- package/dist/Components/LightboxJournal/LightboxOverlay.d.ts +16 -0
- package/dist/Components/LightboxJournal/utils.d.ts +85 -0
- package/dist/Components/LightboxStrip/LightboxOverlay.d.ts +12 -0
- package/dist/Components/LightboxStrip/LightboxStrip.d.ts +92 -0
- package/dist/Components/LightboxStrip/LightboxStripComponent.d.ts +44 -0
- package/dist/Components/LightboxStrip/utils.d.ts +72 -0
- package/dist/Components/utils/animateStripScroll.d.ts +8 -0
- package/dist/Components/utils/imageFitStyles.d.ts +7 -0
- package/dist/Components/utils/useLightboxScrollLock.d.ts +1 -0
- package/dist/Components/utils/useLightboxSwipeDismiss.d.ts +25 -0
- package/dist/index.js +10601 -8330
- package/dist/index.mjs +23016 -17161
- package/package.json +85 -85
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 GX Platform
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 GX Platform
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# Control Components
|
|
2
|
-
|
|
1
|
+
# Control Components
|
|
2
|
+
|
|
3
3
|
This is custom components for control editor and public websites.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { CommonComponentProps } from '../props';
|
|
2
|
+
import { TextStyles } from '../utils/textStylesToCss';
|
|
3
|
+
import { ImageRatioFit } from '../utils/imageFitStyles';
|
|
4
|
+
export type LightboxJournalImage = {
|
|
5
|
+
url: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
objectFit?: 'cover' | 'contain';
|
|
8
|
+
};
|
|
9
|
+
export type LightboxJournalItem = {
|
|
10
|
+
title1: string;
|
|
11
|
+
title2: string;
|
|
12
|
+
title3: string;
|
|
13
|
+
image: LightboxJournalImage[];
|
|
14
|
+
};
|
|
15
|
+
type LightboxJournalProps = {
|
|
16
|
+
settings: LightboxJournalSettings;
|
|
17
|
+
content?: LightboxJournalItem[];
|
|
18
|
+
isEditor?: boolean;
|
|
19
|
+
isEditMode?: boolean;
|
|
20
|
+
isPreviewMode?: boolean;
|
|
21
|
+
portalId?: string;
|
|
22
|
+
} & CommonComponentProps;
|
|
23
|
+
export declare const LightboxJournal: ({ settings, content, isEditor, isEditMode, isPreviewMode, portalId, metadata }: LightboxJournalProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export type LightboxJournalSettings = {
|
|
25
|
+
cover: string | null;
|
|
26
|
+
coverFit: ImageRatioFit;
|
|
27
|
+
type: 'A' | 'B';
|
|
28
|
+
maxWidth: number;
|
|
29
|
+
maxHeight: number;
|
|
30
|
+
backgroundColor: string;
|
|
31
|
+
imageGap?: number;
|
|
32
|
+
textTransition: 'none' | 'fade';
|
|
33
|
+
title1Width?: number;
|
|
34
|
+
title2Width?: number;
|
|
35
|
+
title3Width?: number;
|
|
36
|
+
title1MarginLeft?: number;
|
|
37
|
+
title2MarginLeft?: number;
|
|
38
|
+
title3MarginLeft?: number;
|
|
39
|
+
titleRowMarginBottom?: number;
|
|
40
|
+
titleHeaderLayout?: 'desktop' | 'mobile';
|
|
41
|
+
countCloseGap?: number;
|
|
42
|
+
title1Color: string;
|
|
43
|
+
title2Color: string;
|
|
44
|
+
title3Color: string;
|
|
45
|
+
countColor: string;
|
|
46
|
+
title1FontFamily?: string;
|
|
47
|
+
title1FontSettings?: {
|
|
48
|
+
fontWeight: number;
|
|
49
|
+
fontStyle: string;
|
|
50
|
+
};
|
|
51
|
+
title1FontSize?: number;
|
|
52
|
+
title1LineHeight?: number;
|
|
53
|
+
title1LetterSpacing?: number;
|
|
54
|
+
title1WordSpacing?: number;
|
|
55
|
+
title1TextAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
56
|
+
title1TextAppearance?: TextStyles['textAppearance'];
|
|
57
|
+
title2FontFamily?: string;
|
|
58
|
+
title2FontSettings?: {
|
|
59
|
+
fontWeight: number;
|
|
60
|
+
fontStyle: string;
|
|
61
|
+
};
|
|
62
|
+
title2FontSize?: number;
|
|
63
|
+
title2LineHeight?: number;
|
|
64
|
+
title2LetterSpacing?: number;
|
|
65
|
+
title2WordSpacing?: number;
|
|
66
|
+
title2TextAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
67
|
+
title2TextAppearance?: TextStyles['textAppearance'];
|
|
68
|
+
title3FontFamily?: string;
|
|
69
|
+
title3FontSettings?: {
|
|
70
|
+
fontWeight: number;
|
|
71
|
+
fontStyle: string;
|
|
72
|
+
};
|
|
73
|
+
title3FontSize?: number;
|
|
74
|
+
title3LineHeight?: number;
|
|
75
|
+
title3LetterSpacing?: number;
|
|
76
|
+
title3WordSpacing?: number;
|
|
77
|
+
title3TextAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
78
|
+
title3TextAppearance?: TextStyles['textAppearance'];
|
|
79
|
+
countFontFamily?: string;
|
|
80
|
+
countFontSettings?: {
|
|
81
|
+
fontWeight: number;
|
|
82
|
+
fontStyle: string;
|
|
83
|
+
};
|
|
84
|
+
countFontSize?: number;
|
|
85
|
+
countLineHeight?: number;
|
|
86
|
+
countLetterSpacing?: number;
|
|
87
|
+
countWordSpacing?: number;
|
|
88
|
+
countTextAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
89
|
+
countTextAppearance?: TextStyles['textAppearance'];
|
|
90
|
+
contentMarginTop: number;
|
|
91
|
+
iconMarginRight: number;
|
|
92
|
+
closeIcon: string | null;
|
|
93
|
+
closeIconMaxWidth: number;
|
|
94
|
+
closeIconColor: string;
|
|
95
|
+
closeIconHoverColor: string;
|
|
96
|
+
};
|
|
97
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ComponentSchemaV1 } from '../../types/SchemaV1';
|
|
2
|
+
export declare const LightboxJournalComponent: {
|
|
3
|
+
element: ({ settings, content, isEditor, isEditMode, isPreviewMode, portalId, metadata }: {
|
|
4
|
+
settings: import('./LightboxJournal').LightboxJournalSettings;
|
|
5
|
+
content?: import('./LightboxJournal').LightboxJournalItem[];
|
|
6
|
+
isEditor?: boolean;
|
|
7
|
+
isEditMode?: boolean;
|
|
8
|
+
isPreviewMode?: boolean;
|
|
9
|
+
portalId?: string;
|
|
10
|
+
} & import('../props').CommonComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
category: string;
|
|
14
|
+
version: number;
|
|
15
|
+
defaultSize: {
|
|
16
|
+
d: {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
};
|
|
20
|
+
m: {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
preview: {
|
|
26
|
+
type: "image";
|
|
27
|
+
url: string;
|
|
28
|
+
};
|
|
29
|
+
schema: ComponentSchemaV1;
|
|
30
|
+
sourceCode: string;
|
|
31
|
+
assetsPaths: {
|
|
32
|
+
content: {
|
|
33
|
+
path: string;
|
|
34
|
+
placeholderEnabled: boolean;
|
|
35
|
+
}[];
|
|
36
|
+
parameters: never[];
|
|
37
|
+
};
|
|
38
|
+
fontSettingsPaths: {
|
|
39
|
+
content: never[];
|
|
40
|
+
parameters: {
|
|
41
|
+
path: string;
|
|
42
|
+
}[];
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LightboxJournalItem, LightboxJournalSettings } from './LightboxJournal';
|
|
2
|
+
type LightboxOverlayProps = {
|
|
3
|
+
prefix: string;
|
|
4
|
+
entries: LightboxJournalItem[];
|
|
5
|
+
settings: LightboxJournalSettings;
|
|
6
|
+
isEditor?: boolean;
|
|
7
|
+
isEditMode?: boolean;
|
|
8
|
+
isPreviewMode?: boolean;
|
|
9
|
+
initialSlideIndex?: number;
|
|
10
|
+
enableUrlSync?: boolean;
|
|
11
|
+
journalItemId?: string | null;
|
|
12
|
+
onBeforeClose?: () => void;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const LightboxOverlay: ({ prefix: P, entries, settings, isEditor, isEditMode, isPreviewMode, initialSlideIndex, enableUrlSync, journalItemId, onBeforeClose, onClose, }: LightboxOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { TextStyles } from '../utils/textStylesToCss';
|
|
3
|
+
import { LayoutItem, LayoutTab } from '../../types/SchemaV1';
|
|
4
|
+
type JournalImage = {
|
|
5
|
+
url: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
objectFit?: 'cover' | 'contain';
|
|
8
|
+
};
|
|
9
|
+
type JournalEntry = {
|
|
10
|
+
title1: string;
|
|
11
|
+
title2: string;
|
|
12
|
+
title3: string;
|
|
13
|
+
image: JournalImage[];
|
|
14
|
+
};
|
|
15
|
+
type JournalSettings = {
|
|
16
|
+
title1Color: string;
|
|
17
|
+
title2Color: string;
|
|
18
|
+
title3Color: string;
|
|
19
|
+
countColor: string;
|
|
20
|
+
} & Record<string, unknown>;
|
|
21
|
+
export declare const STRIP_NAV_SWIPE_MIN_PX = 50;
|
|
22
|
+
export declare const STRIP_NAV_TAP_MAX_PX = 10;
|
|
23
|
+
export declare const findJournalUrlSlideNumber: (itemId?: string | null) => number | null;
|
|
24
|
+
export declare const slideNumberToIndex: (slideNumber: number, slideCount: number) => number;
|
|
25
|
+
export declare const setJournalUrlParam: (slideNumber: number, itemId?: string | null, replace?: boolean) => void;
|
|
26
|
+
export declare const hasJournalUrlParam: (itemId?: string | null) => boolean;
|
|
27
|
+
export declare const removeJournalUrlParam: (didPushHistory: boolean, itemId?: string | null) => void;
|
|
28
|
+
type JournalSlide = {
|
|
29
|
+
entry: JournalEntry;
|
|
30
|
+
entryIndex: number;
|
|
31
|
+
images: JournalImage[];
|
|
32
|
+
};
|
|
33
|
+
export declare const getGapControlSize: (gap: string) => string;
|
|
34
|
+
export declare const getEntryImages: (entry: JournalEntry | undefined) => JournalImage[];
|
|
35
|
+
export declare const buildJournalSlides: (entries: JournalEntry[], journalType: "A" | "B") => JournalSlide[];
|
|
36
|
+
export declare const formatSlideCounter: (slides: JournalSlide[], activeSlideIndex: number, journalType: "A" | "B", entries: JournalEntry[]) => string;
|
|
37
|
+
export declare const getEntryTitleKey: (entry: JournalEntry | undefined) => string;
|
|
38
|
+
export declare const shouldShowCounter: (journalType: "A" | "B", slides: JournalSlide[], entries: JournalEntry[]) => boolean;
|
|
39
|
+
type JournalTitleWidthKey = 'title1Width' | 'title2Width' | 'title3Width';
|
|
40
|
+
export declare const TITLE_RESIZE_HANDLE_WIDTH = 0.004;
|
|
41
|
+
export declare const TITLE_PADDING_HANDLE_WIDTH = 0.004;
|
|
42
|
+
export declare const DEFAULT_JOURNAL_TITLE_WIDTHS: Record<JournalTitleWidthKey, number>;
|
|
43
|
+
export type JournalTitleSlot = {
|
|
44
|
+
prefix: 'title1' | 'title2' | 'title3';
|
|
45
|
+
widthKey: JournalTitleWidthKey;
|
|
46
|
+
marginLeftKey?: 'title2MarginLeft' | 'title3MarginLeft';
|
|
47
|
+
className: string;
|
|
48
|
+
style: CSSProperties;
|
|
49
|
+
text: string;
|
|
50
|
+
};
|
|
51
|
+
export declare const buildJournalTitleSlots: (prefix: string, entry: JournalEntry, title1Style: CSSProperties, title2Style: CSSProperties, title3Style: CSSProperties) => JournalTitleSlot[];
|
|
52
|
+
export declare const resolveJournalTitleWidths: (count: number, storedWidths: number[]) => number[];
|
|
53
|
+
export declare const getEffectiveJournalTitleWidths: (count: number, storedWidths: number[]) => number[];
|
|
54
|
+
export declare const getJournalTitleMaxWidth: (columnIndex: number, resolvedWidths: number[]) => number;
|
|
55
|
+
export declare const getRowScopedJournalTitleWidths: (slots: JournalTitleSlot[], widthByKey: Record<JournalTitleWidthKey, number>) => {
|
|
56
|
+
resolved: number[];
|
|
57
|
+
effective: number[];
|
|
58
|
+
};
|
|
59
|
+
export declare const getJournalTitleOffsetBeforeSlot: (slots: JournalTitleSlot[], resolvedWidths: number[], marginByKey: Record<"title2MarginLeft" | "title3MarginLeft", number>, slotIndex: number) => number;
|
|
60
|
+
export declare const getJournalTitleBoundaryOffset: (slots: JournalTitleSlot[], resolvedWidths: number[], marginByKey: Record<"title2MarginLeft" | "title3MarginLeft", number>, upToIndex: number) => number;
|
|
61
|
+
export declare const JOURNAL_TEXT_STYLE_PREFIXES: readonly ["title1", "title2", "title3", "count"];
|
|
62
|
+
export type JournalTextStylePrefix = typeof JOURNAL_TEXT_STYLE_PREFIXES[number];
|
|
63
|
+
export declare const JOURNAL_GLOBAL_TEXT_STYLE_KEYS: readonly ["fontFamily", "fontSettings", "fontSize", "lineHeight", "letterSpacing", "wordSpacing", "textAlign", "textAppearance"];
|
|
64
|
+
export type JournalGlobalTextStyleKey = typeof JOURNAL_GLOBAL_TEXT_STYLE_KEYS[number];
|
|
65
|
+
export declare const getJournalTextStyleSettingKey: (prefix: JournalTextStylePrefix, globalKey: JournalGlobalTextStyleKey) => string;
|
|
66
|
+
export declare const JOURNAL_TEXT_STYLE_TAB_LABELS: Record<JournalTextStylePrefix, string>;
|
|
67
|
+
export declare const createJournalTextStyleTabContentItems: (prefix: JournalTextStylePrefix) => LayoutItem[];
|
|
68
|
+
export declare const createJournalTextStylePanelTab: () => LayoutTab;
|
|
69
|
+
type ResolvedJournalTextFields = {
|
|
70
|
+
fontFamily: string;
|
|
71
|
+
fontSettings: {
|
|
72
|
+
fontWeight: number;
|
|
73
|
+
fontStyle: string;
|
|
74
|
+
};
|
|
75
|
+
fontSize?: number;
|
|
76
|
+
lineHeight?: number;
|
|
77
|
+
letterSpacing: number;
|
|
78
|
+
wordSpacing: number;
|
|
79
|
+
textAlign: 'left' | 'center' | 'right' | 'justify';
|
|
80
|
+
textAppearance?: TextStyles['textAppearance'];
|
|
81
|
+
color?: string;
|
|
82
|
+
};
|
|
83
|
+
export declare const resolveJournalTextFields: (settings: JournalSettings, prefix: JournalTextStylePrefix) => ResolvedJournalTextFields;
|
|
84
|
+
export declare const journalTextFieldsToCss: (prefix: JournalTextStylePrefix, fields: ResolvedJournalTextFields, isEditor?: boolean) => CSSProperties;
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LightboxStripItem, LightboxStripSettings } from './LightboxStrip';
|
|
2
|
+
type LightboxOverlayProps = {
|
|
3
|
+
prefix: string;
|
|
4
|
+
images: LightboxStripItem[];
|
|
5
|
+
settings: LightboxStripSettings;
|
|
6
|
+
isEditor?: boolean;
|
|
7
|
+
isEditMode?: boolean;
|
|
8
|
+
isPreviewMode?: boolean;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const LightboxOverlay: ({ prefix: P, images, settings, isEditor, isEditMode, isPreviewMode, onClose, }: LightboxOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { CommonComponentProps } from '../props';
|
|
2
|
+
import { ImageRatioFit } from '../utils/imageFitStyles';
|
|
3
|
+
import { TextStyles } from '../utils/textStylesToCss';
|
|
4
|
+
export { createStripTextStylePanelTab, createStripTextStyleTabContentItems, extractTitlesFromLegacyText, getStripTextStyleSettingKey, resolveSharedStripTitles, STRIP_GLOBAL_TEXT_STYLE_KEYS, STRIP_TEXT_STYLE_PREFIXES, STRIP_TEXT_STYLE_TAB_LABELS, STRIP_TITLE_WIDTH_KEYS, } from './utils';
|
|
5
|
+
export type { StripGlobalTextStyleKey, StripTextStylePrefix, StripTitleWidthKey, } from './utils';
|
|
6
|
+
export type LightboxStripItem = {
|
|
7
|
+
image: {
|
|
8
|
+
url: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
objectFit?: 'cover' | 'contain';
|
|
11
|
+
};
|
|
12
|
+
title1?: string;
|
|
13
|
+
title2?: string;
|
|
14
|
+
title3?: string;
|
|
15
|
+
};
|
|
16
|
+
export type SharedStripTitles = {
|
|
17
|
+
title1: string;
|
|
18
|
+
title2: string;
|
|
19
|
+
title3: string;
|
|
20
|
+
};
|
|
21
|
+
export type LightboxStripSettings = {
|
|
22
|
+
cover: string | null;
|
|
23
|
+
coverFit: ImageRatioFit;
|
|
24
|
+
backgroundColor: string;
|
|
25
|
+
thumbnailVisibility: 'on' | 'off';
|
|
26
|
+
thumbnailObjectFit: ImageRatioFit;
|
|
27
|
+
thumbnailTrigger: 'click' | 'hover';
|
|
28
|
+
thumbnailActive: 'outline' | 'color' | 'scale-up';
|
|
29
|
+
thumbnailActiveColor: string;
|
|
30
|
+
thumbnailGap: number;
|
|
31
|
+
thumbnailMarginBottom?: number;
|
|
32
|
+
imageGap?: number;
|
|
33
|
+
title1Width: number;
|
|
34
|
+
title2Width: number;
|
|
35
|
+
title3Width: number;
|
|
36
|
+
title1MarginLeft: number;
|
|
37
|
+
title2MarginLeft: number;
|
|
38
|
+
title3MarginLeft: number;
|
|
39
|
+
titleRowMarginBottom?: number;
|
|
40
|
+
titleHeaderLayout?: 'desktop' | 'mobile';
|
|
41
|
+
title1Color: string;
|
|
42
|
+
title2Color: string;
|
|
43
|
+
title3Color: string;
|
|
44
|
+
title1FontFamily?: string;
|
|
45
|
+
title1FontSettings?: {
|
|
46
|
+
fontWeight: number;
|
|
47
|
+
fontStyle: string;
|
|
48
|
+
};
|
|
49
|
+
title1FontSize?: number;
|
|
50
|
+
title1LineHeight?: number;
|
|
51
|
+
title1LetterSpacing?: number;
|
|
52
|
+
title1WordSpacing?: number;
|
|
53
|
+
title1TextAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
54
|
+
title1TextAppearance?: TextStyles['textAppearance'];
|
|
55
|
+
title2FontFamily?: string;
|
|
56
|
+
title2FontSettings?: {
|
|
57
|
+
fontWeight: number;
|
|
58
|
+
fontStyle: string;
|
|
59
|
+
};
|
|
60
|
+
title2FontSize?: number;
|
|
61
|
+
title2LineHeight?: number;
|
|
62
|
+
title2LetterSpacing?: number;
|
|
63
|
+
title2WordSpacing?: number;
|
|
64
|
+
title2TextAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
65
|
+
title2TextAppearance?: TextStyles['textAppearance'];
|
|
66
|
+
title3FontFamily?: string;
|
|
67
|
+
title3FontSettings?: {
|
|
68
|
+
fontWeight: number;
|
|
69
|
+
fontStyle: string;
|
|
70
|
+
};
|
|
71
|
+
title3FontSize?: number;
|
|
72
|
+
title3LineHeight?: number;
|
|
73
|
+
title3LetterSpacing?: number;
|
|
74
|
+
title3WordSpacing?: number;
|
|
75
|
+
title3TextAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
76
|
+
title3TextAppearance?: TextStyles['textAppearance'];
|
|
77
|
+
contentMarginTop: number;
|
|
78
|
+
iconMarginLeft: number;
|
|
79
|
+
closeIcon: string | null;
|
|
80
|
+
closeIconMaxWidth: number;
|
|
81
|
+
closeIconColor: string;
|
|
82
|
+
closeIconHoverColor: string;
|
|
83
|
+
};
|
|
84
|
+
type LightboxStripProps = {
|
|
85
|
+
settings: LightboxStripSettings;
|
|
86
|
+
content?: LightboxStripItem[];
|
|
87
|
+
isEditor?: boolean;
|
|
88
|
+
isEditMode?: boolean;
|
|
89
|
+
isPreviewMode?: boolean;
|
|
90
|
+
portalId?: string;
|
|
91
|
+
} & CommonComponentProps;
|
|
92
|
+
export declare const LightboxStrip: ({ settings, content, isEditor, isEditMode, isPreviewMode, portalId }: LightboxStripProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ComponentSchemaV1 } from '../../types/SchemaV1';
|
|
2
|
+
export declare const LightboxStripComponent: {
|
|
3
|
+
element: ({ settings, content, isEditor, isEditMode, isPreviewMode, portalId }: {
|
|
4
|
+
settings: import('./LightboxStrip').LightboxStripSettings;
|
|
5
|
+
content?: import('./LightboxStrip').LightboxStripItem[];
|
|
6
|
+
isEditor?: boolean;
|
|
7
|
+
isEditMode?: boolean;
|
|
8
|
+
isPreviewMode?: boolean;
|
|
9
|
+
portalId?: string;
|
|
10
|
+
} & import('../props').CommonComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
category: string;
|
|
14
|
+
version: number;
|
|
15
|
+
defaultSize: {
|
|
16
|
+
d: {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
};
|
|
20
|
+
m: {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
preview: {
|
|
26
|
+
type: "image";
|
|
27
|
+
url: string;
|
|
28
|
+
};
|
|
29
|
+
schema: ComponentSchemaV1;
|
|
30
|
+
sourceCode: string;
|
|
31
|
+
assetsPaths: {
|
|
32
|
+
content: {
|
|
33
|
+
path: string;
|
|
34
|
+
placeholderEnabled: boolean;
|
|
35
|
+
}[];
|
|
36
|
+
parameters: never[];
|
|
37
|
+
};
|
|
38
|
+
fontSettingsPaths: {
|
|
39
|
+
content: never[];
|
|
40
|
+
parameters: {
|
|
41
|
+
path: string;
|
|
42
|
+
}[];
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { TextStyles } from '../utils/textStylesToCss';
|
|
3
|
+
import { LayoutItem, LayoutTab } from '../../types/SchemaV1';
|
|
4
|
+
import { LightboxStripItem, LightboxStripSettings, SharedStripTitles } from './LightboxStrip';
|
|
5
|
+
export declare const LIGHTBOX_ANIM_MS = 300;
|
|
6
|
+
export declare const SNAP_SCROLL_MIN_MS = 900;
|
|
7
|
+
export declare const SNAP_SCROLL_MAX_MS = 1500;
|
|
8
|
+
export declare const SNAP_SCROLL_EASING = "cubic-bezier(0.16, 1, 0.3, 1)";
|
|
9
|
+
export declare const CONTROLS_IDLE_MS = 3000;
|
|
10
|
+
export declare const THUMB_MAX_SIZE_PX = 50;
|
|
11
|
+
export declare const WHEEL_SPEED = 2;
|
|
12
|
+
export declare const WHEEL_LINE_HEIGHT_PX = 16;
|
|
13
|
+
export declare const WHEEL_LERP = 0.05;
|
|
14
|
+
export declare const MOUSE_DRAG_THRESHOLD_PX = 1;
|
|
15
|
+
export declare const DRAG_SNAP_RATIO = 0.5;
|
|
16
|
+
export declare const GAP_LABEL_AREA_PX = 20;
|
|
17
|
+
export declare const TITLE_RESIZE_HANDLE_WIDTH = 0.004;
|
|
18
|
+
export declare const STRIP_TEXT_STYLE_PREFIXES: readonly ["title1", "title2", "title3"];
|
|
19
|
+
export type StripTextStylePrefix = typeof STRIP_TEXT_STYLE_PREFIXES[number];
|
|
20
|
+
export declare const STRIP_GLOBAL_TEXT_STYLE_KEYS: readonly ["fontFamily", "fontSettings", "fontSize", "lineHeight", "letterSpacing", "wordSpacing", "textAlign", "textAppearance"];
|
|
21
|
+
export type StripGlobalTextStyleKey = typeof STRIP_GLOBAL_TEXT_STYLE_KEYS[number];
|
|
22
|
+
export declare const STRIP_TEXT_STYLE_TAB_LABELS: Record<StripTextStylePrefix, string>;
|
|
23
|
+
export declare const STRIP_TITLE_WIDTH_KEYS: readonly ["title1Width", "title2Width", "title3Width"];
|
|
24
|
+
export type StripTitleWidthKey = typeof STRIP_TITLE_WIDTH_KEYS[number];
|
|
25
|
+
type LightboxStripLegacyItem = LightboxStripItem & {
|
|
26
|
+
text?: Array<{
|
|
27
|
+
type?: string;
|
|
28
|
+
children?: Array<{
|
|
29
|
+
text?: string;
|
|
30
|
+
}>;
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
type ResolvedStripTextFields = {
|
|
34
|
+
fontFamily: string;
|
|
35
|
+
fontSettings: {
|
|
36
|
+
fontWeight: number;
|
|
37
|
+
fontStyle: string;
|
|
38
|
+
};
|
|
39
|
+
fontSize?: number;
|
|
40
|
+
lineHeight?: number;
|
|
41
|
+
letterSpacing: number;
|
|
42
|
+
wordSpacing: number;
|
|
43
|
+
textAlign: 'left' | 'center' | 'right' | 'justify';
|
|
44
|
+
textAppearance?: TextStyles['textAppearance'];
|
|
45
|
+
color?: string;
|
|
46
|
+
};
|
|
47
|
+
export type StripTitleSlot = {
|
|
48
|
+
prefix: StripTextStylePrefix;
|
|
49
|
+
widthKey: StripTitleWidthKey;
|
|
50
|
+
marginLeftKey?: 'title1MarginLeft' | 'title2MarginLeft' | 'title3MarginLeft';
|
|
51
|
+
className: string;
|
|
52
|
+
style: CSSProperties;
|
|
53
|
+
text: string;
|
|
54
|
+
};
|
|
55
|
+
export declare const getGapControlSize: (gap: string) => string;
|
|
56
|
+
export declare const extractTitlesFromLegacyText: (text: LightboxStripLegacyItem["text"]) => Partial<SharedStripTitles>;
|
|
57
|
+
export declare const resolveSharedStripTitles: (items: LightboxStripLegacyItem[]) => SharedStripTitles;
|
|
58
|
+
export declare const getStripTextStyleSettingKey: (prefix: StripTextStylePrefix, globalKey: StripGlobalTextStyleKey) => string;
|
|
59
|
+
export declare const createStripTextStyleTabContentItems: (prefix: StripTextStylePrefix) => LayoutItem[];
|
|
60
|
+
export declare const createStripTextStylePanelTab: () => LayoutTab;
|
|
61
|
+
export declare const resolveStripTitleWidths: (count: number, storedWidths: number[]) => number[];
|
|
62
|
+
export declare const getEffectiveStripTitleWidths: (count: number, storedWidths: number[]) => number[];
|
|
63
|
+
export declare const getStripTitleMaxWidth: (columnIndex: number, resolvedWidths: number[]) => number;
|
|
64
|
+
export declare const getRowScopedStripTitleWidths: (slots: StripTitleSlot[], widthByKey: Record<StripTitleWidthKey, number>) => {
|
|
65
|
+
resolved: number[];
|
|
66
|
+
effective: number[];
|
|
67
|
+
};
|
|
68
|
+
export declare const buildStripTitleSlots: (prefix: string, title1: string, title2: string, title3: string, title1Style: CSSProperties, title2Style: CSSProperties, title3Style: CSSProperties) => StripTitleSlot[];
|
|
69
|
+
export declare const resolveStripTextFields: (settings: LightboxStripSettings, prefix: StripTextStylePrefix) => ResolvedStripTextFields;
|
|
70
|
+
export declare const getStripTitleOffsetBeforeSlot: (slots: StripTitleSlot[], resolvedWidths: number[], marginByKey: Record<"title1MarginLeft" | "title2MarginLeft" | "title3MarginLeft", number>, slotIndex: number) => number;
|
|
71
|
+
export declare const stripTextFieldsToCss: (prefix: StripTextStylePrefix, fields: ReturnType<typeof resolveStripTextFields>, isEditor?: boolean) => CSSProperties;
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type AnimateStripScrollOptions = {
|
|
2
|
+
duration: number;
|
|
3
|
+
easing: string;
|
|
4
|
+
onComplete?: () => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const getDistanceScaledDuration: (distance: number, minMs: number, maxMs: number, referenceDistance: number) => number;
|
|
7
|
+
export declare const animateStripScroll: (strip: HTMLElement, track: HTMLElement, targetLeft: number, { duration, easing, onComplete }: AnimateStripScrollOptions) => (() => void);
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type ImageRatioFit = {
|
|
2
|
+
display: 'fit' | 'cover';
|
|
3
|
+
ratioValue: '1:1' | '2:3' | '3:4' | '4:5' | '16:9';
|
|
4
|
+
reversed: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const isImageRatioCover: (fit: ImageRatioFit) => boolean;
|
|
7
|
+
export declare const getAspectRatio: (fit: ImageRatioFit) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useLightboxScrollLock: () => void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type UseLightboxSwipeDismissOptions = {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
animMs?: number;
|
|
5
|
+
isBlockedTarget?: (target: HTMLElement) => boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const useLightboxSwipeDismiss: ({ enabled, onClose, animMs, isBlockedTarget, }: UseLightboxSwipeDismissOptions) => {
|
|
8
|
+
isSwipeDragging: boolean;
|
|
9
|
+
backdropStyle: React.CSSProperties;
|
|
10
|
+
mediaAreaStyle: React.CSSProperties;
|
|
11
|
+
overlayContentStyle: import('react').CSSProperties | undefined;
|
|
12
|
+
swipeHandlers: {
|
|
13
|
+
onPointerDown: (event: React.PointerEvent<HTMLElement>) => void;
|
|
14
|
+
onPointerMove: (event: React.PointerEvent<HTMLElement>) => void;
|
|
15
|
+
onPointerUp: (event: React.PointerEvent<HTMLElement>) => void;
|
|
16
|
+
onPointerCancel: (event: React.PointerEvent<HTMLElement>) => void;
|
|
17
|
+
} | {
|
|
18
|
+
onPointerDown?: undefined;
|
|
19
|
+
onPointerMove?: undefined;
|
|
20
|
+
onPointerUp?: undefined;
|
|
21
|
+
onPointerCancel?: undefined;
|
|
22
|
+
};
|
|
23
|
+
dismissAreaStyle: import('react').CSSProperties | undefined;
|
|
24
|
+
};
|
|
25
|
+
export {};
|