@cntrl-site/components 1.0.12-alpha.23 → 1.0.12-alpha.25

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 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.
@@ -5,11 +5,10 @@ type FormProps = {
5
5
  content?: unknown;
6
6
  isEditor?: boolean;
7
7
  isEditMode?: boolean;
8
- isPreviewMode?: boolean;
9
8
  activeEvent: string | undefined;
10
9
  onUpdateSettings?: (settings: FormSettings) => void;
11
10
  } & CommonComponentProps;
12
- export declare function Form({ settings, isEditor, isEditMode, isPreviewMode, metadata, activeEvent }: FormProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function Form({ settings, isEditor, isEditMode, metadata, activeEvent }: FormProps): import("react/jsx-runtime").JSX.Element;
13
12
  export type FormFieldType = 'text' | 'textarea' | 'phone' | 'email';
14
13
  export type FormFieldItem = {
15
14
  name: string;
@@ -518,14 +518,14 @@ export declare const FormComponent: {
518
518
  fieldsToShow: number;
519
519
  fields: ({
520
520
  name: string;
521
- type: "text";
521
+ type: "email";
522
522
  placeholder: string;
523
523
  label: string;
524
524
  isRequired: boolean;
525
525
  error: string;
526
526
  } | {
527
527
  name: string;
528
- type: "email";
528
+ type: "text";
529
529
  placeholder: string;
530
530
  label: string;
531
531
  isRequired: boolean;
@@ -19,26 +19,21 @@ type GridLayoutConfig = {
19
19
  lockedParam?: 'wrapperWidth' | 'entryWidth' | 'horizontalGap' | null;
20
20
  };
21
21
  type GridSettings = {
22
- type: 'a' | 'b' | 'c';
22
+ type: 'A' | 'B';
23
23
  gridLayout: GridLayoutConfig;
24
24
  textBoxWidth: number;
25
25
  verticalGap: number;
26
26
  entriesCount: number;
27
- lightbox: 'on' | 'off';
27
+ lightbox: 'On' | 'Off';
28
28
  imageDisplay: {
29
- display: 'fit' | 'cover';
29
+ display: 'Fit' | 'Cover';
30
30
  ratioValue: '1:1' | '2:3' | '3:4' | '4:5' | '16:9';
31
31
  reversed: boolean;
32
32
  };
33
- lightboxImageDisplay?: 'fit' | 'cover' | {
34
- display?: 'fit' | 'cover';
35
- };
36
- slider: 'on' | 'off';
33
+ slider: 'On' | 'Off';
37
34
  sliderTiming: number;
38
- direction: 'horizontal' | 'vertical' | 'random';
39
- transition: 'fade' | 'slide';
40
- showText: 'always' | 'on hover';
41
- alignEntries: 'on' | 'off';
35
+ direction: 'Horizontal' | 'Vertical' | 'Random';
36
+ transition: 'Fade' | 'Slide';
42
37
  titleMarginTop: number;
43
38
  subtitleMarginTop: number;
44
39
  titleColor: string;
@@ -0,0 +1,101 @@
1
+ import { CommonComponentProps } from '../props';
2
+ import { TextStyles } from '../utils/textStylesToCss';
3
+ import { LayoutItem, LayoutTab } from '../../types/SchemaV1';
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
+ export declare const JOURNAL_TEXT_STYLE_PREFIXES: readonly ["title1", "title2", "title3", "count"];
16
+ export type JournalTextStylePrefix = typeof JOURNAL_TEXT_STYLE_PREFIXES[number];
17
+ export declare const JOURNAL_GLOBAL_TEXT_STYLE_KEYS: readonly ["fontFamily", "fontSettings", "fontSize", "lineHeight", "letterSpacing", "wordSpacing", "textAlign", "textAppearance"];
18
+ export type JournalGlobalTextStyleKey = typeof JOURNAL_GLOBAL_TEXT_STYLE_KEYS[number];
19
+ export declare function getJournalTextStyleSettingKey(prefix: JournalTextStylePrefix, globalKey: JournalGlobalTextStyleKey): string;
20
+ export declare const JOURNAL_TEXT_STYLE_TAB_LABELS: Record<JournalTextStylePrefix, string>;
21
+ export declare function createJournalTextStyleTabContentItems(prefix: JournalTextStylePrefix): LayoutItem[];
22
+ export declare function createJournalTextStylePanelTab(): LayoutTab;
23
+ type LightboxJournalProps = {
24
+ settings: LightboxJournalSettings;
25
+ content?: LightboxJournalItem[];
26
+ isEditor?: boolean;
27
+ isEditMode?: boolean;
28
+ isPreviewMode?: boolean;
29
+ portalId?: string;
30
+ } & CommonComponentProps;
31
+ export declare const LightboxJournal: ({ settings, content, isEditor, isEditMode, isPreviewMode, portalId }: LightboxJournalProps) => import("react/jsx-runtime").JSX.Element;
32
+ export type LightboxJournalSettings = {
33
+ cover: string | null;
34
+ coverFit: 'cover' | 'fit';
35
+ type: 'A' | 'B';
36
+ maxWidth: number;
37
+ maxHeight: number;
38
+ backgroundColor: string;
39
+ objectFit: 'cover' | 'fit';
40
+ imageGap?: number;
41
+ textMaxWidth: number;
42
+ textTransition: 'none' | 'fade';
43
+ titlesGap?: number;
44
+ countCloseGap?: number;
45
+ title1Color: string;
46
+ title2Color: string;
47
+ title3Color: string;
48
+ countColor: string;
49
+ title1FontFamily?: string;
50
+ title1FontSettings?: {
51
+ fontWeight: number;
52
+ fontStyle: string;
53
+ };
54
+ title1FontSize?: number;
55
+ title1LineHeight?: number;
56
+ title1LetterSpacing?: number;
57
+ title1WordSpacing?: number;
58
+ title1TextAlign?: 'left' | 'center' | 'right' | 'justify';
59
+ title1TextAppearance?: TextStyles['textAppearance'];
60
+ title2FontFamily?: string;
61
+ title2FontSettings?: {
62
+ fontWeight: number;
63
+ fontStyle: string;
64
+ };
65
+ title2FontSize?: number;
66
+ title2LineHeight?: number;
67
+ title2LetterSpacing?: number;
68
+ title2WordSpacing?: number;
69
+ title2TextAlign?: 'left' | 'center' | 'right' | 'justify';
70
+ title2TextAppearance?: TextStyles['textAppearance'];
71
+ title3FontFamily?: string;
72
+ title3FontSettings?: {
73
+ fontWeight: number;
74
+ fontStyle: string;
75
+ };
76
+ title3FontSize?: number;
77
+ title3LineHeight?: number;
78
+ title3LetterSpacing?: number;
79
+ title3WordSpacing?: number;
80
+ title3TextAlign?: 'left' | 'center' | 'right' | 'justify';
81
+ title3TextAppearance?: TextStyles['textAppearance'];
82
+ countFontFamily?: string;
83
+ countFontSettings?: {
84
+ fontWeight: number;
85
+ fontStyle: string;
86
+ };
87
+ countFontSize?: number;
88
+ countLineHeight?: number;
89
+ countLetterSpacing?: number;
90
+ countWordSpacing?: number;
91
+ countTextAlign?: 'left' | 'center' | 'right' | 'justify';
92
+ countTextAppearance?: TextStyles['textAppearance'];
93
+ contentMarginTop: number;
94
+ contentMarginLeft: number;
95
+ contentMarginRight: number;
96
+ closeIcon: string | null;
97
+ closeIconMaxWidth: number;
98
+ closeIconColor: string;
99
+ closeIconHoverColor: string;
100
+ };
101
+ export {};
@@ -0,0 +1,44 @@
1
+ import { ComponentSchemaV1 } from '../../types/SchemaV1';
2
+ export declare const LightboxJournalComponent: {
3
+ element: ({ settings, content, isEditor, isEditMode, isPreviewMode, portalId }: {
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,106 @@
1
+ import { CommonComponentProps } from '../props';
2
+ import { TextStyles } from '../utils/textStylesToCss';
3
+ import { LayoutItem, LayoutTab } from '../../types/SchemaV1';
4
+ export type LightboxStripItem = {
5
+ image: {
6
+ url: string;
7
+ name?: string;
8
+ objectFit?: 'cover' | 'contain';
9
+ };
10
+ title1?: string;
11
+ title2?: string;
12
+ title3?: string;
13
+ };
14
+ type LightboxStripLegacyItem = LightboxStripItem & {
15
+ text?: Array<{
16
+ type?: string;
17
+ children?: Array<{
18
+ text?: string;
19
+ }>;
20
+ }>;
21
+ };
22
+ export type SharedStripTitles = {
23
+ title1: string;
24
+ title2: string;
25
+ title3: string;
26
+ };
27
+ export declare function extractTitlesFromLegacyText(text: LightboxStripLegacyItem['text']): Partial<SharedStripTitles>;
28
+ export declare function resolveSharedStripTitles(items: LightboxStripLegacyItem[]): SharedStripTitles;
29
+ export type LightboxStripSettings = {
30
+ cover: string | null;
31
+ coverFit: 'cover' | 'fit';
32
+ type: 'A' | 'B';
33
+ backgroundColor: string;
34
+ contentBackgroundColor?: string;
35
+ thumbnailVisibility: 'on' | 'off';
36
+ thumbnailObjectFit: 'cover' | 'contain';
37
+ thumbnailTrigger: 'click' | 'hover';
38
+ thumbnailActive: 'invert' | 'grayscale' | 'scale-up' | 'opacity';
39
+ thumbnailGap: number;
40
+ thumbnailMarginBottom?: number;
41
+ imageGap?: number;
42
+ textMaxWidth: number;
43
+ title1Gap?: number;
44
+ title2Gap?: number;
45
+ title1Color: string;
46
+ title2Color: string;
47
+ title3Color: string;
48
+ title1FontFamily?: string;
49
+ title1FontSettings?: {
50
+ fontWeight: number;
51
+ fontStyle: string;
52
+ };
53
+ title1FontSize?: number;
54
+ title1LineHeight?: number;
55
+ title1LetterSpacing?: number;
56
+ title1WordSpacing?: number;
57
+ title1TextAlign?: 'left' | 'center' | 'right' | 'justify';
58
+ title1TextAppearance?: TextStyles['textAppearance'];
59
+ title2FontFamily?: string;
60
+ title2FontSettings?: {
61
+ fontWeight: number;
62
+ fontStyle: string;
63
+ };
64
+ title2FontSize?: number;
65
+ title2LineHeight?: number;
66
+ title2LetterSpacing?: number;
67
+ title2WordSpacing?: number;
68
+ title2TextAlign?: 'left' | 'center' | 'right' | 'justify';
69
+ title2TextAppearance?: TextStyles['textAppearance'];
70
+ title3FontFamily?: string;
71
+ title3FontSettings?: {
72
+ fontWeight: number;
73
+ fontStyle: string;
74
+ };
75
+ title3FontSize?: number;
76
+ title3LineHeight?: number;
77
+ title3LetterSpacing?: number;
78
+ title3WordSpacing?: number;
79
+ title3TextAlign?: 'left' | 'center' | 'right' | 'justify';
80
+ title3TextAppearance?: TextStyles['textAppearance'];
81
+ contentMarginTop: number;
82
+ contentMarginLeft: number;
83
+ contentMarginRight: number;
84
+ closeIcon: string | null;
85
+ closeIconMaxWidth: number;
86
+ closeIconColor: string;
87
+ closeIconHoverColor: string;
88
+ };
89
+ export declare const STRIP_TEXT_STYLE_PREFIXES: readonly ["title1", "title2", "title3"];
90
+ export type StripTextStylePrefix = typeof STRIP_TEXT_STYLE_PREFIXES[number];
91
+ export declare const STRIP_GLOBAL_TEXT_STYLE_KEYS: readonly ["fontFamily", "fontSettings", "fontSize", "lineHeight", "letterSpacing", "wordSpacing", "textAlign", "textAppearance"];
92
+ export type StripGlobalTextStyleKey = typeof STRIP_GLOBAL_TEXT_STYLE_KEYS[number];
93
+ export declare function getStripTextStyleSettingKey(prefix: StripTextStylePrefix, globalKey: StripGlobalTextStyleKey): string;
94
+ export declare const STRIP_TEXT_STYLE_TAB_LABELS: Record<StripTextStylePrefix, string>;
95
+ export declare function createStripTextStyleTabContentItems(prefix: StripTextStylePrefix): LayoutItem[];
96
+ export declare function createStripTextStylePanelTab(): LayoutTab;
97
+ type LightboxStripProps = {
98
+ settings: LightboxStripSettings;
99
+ content?: LightboxStripItem[];
100
+ isEditor?: boolean;
101
+ isEditMode?: boolean;
102
+ isPreviewMode?: boolean;
103
+ portalId?: string;
104
+ } & CommonComponentProps;
105
+ export declare const LightboxStrip: ({ settings, content, isEditor, isEditMode, isPreviewMode, portalId }: LightboxStripProps) => import("react/jsx-runtime").JSX.Element;
106
+ export {};
@@ -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
+ };
@@ -65,11 +65,11 @@ type ListColumnTextStyleOverrides = {
65
65
  export type ListColumnVerticalAlignKey = `${ListColumnPrefix}VerticalAlign`;
66
66
  export type ListSettings = {
67
67
  columns: number;
68
- type: 'a' | 'b';
68
+ type: 'A' | 'B';
69
69
  wrapperWidth: number;
70
70
  entriesCount: number;
71
71
  cellMinHeight: number;
72
- imageOnHover: 'on' | 'off';
72
+ imageOnHover: 'On' | 'Off';
73
73
  imageSize?: {
74
74
  min: number;
75
75
  max: number;
@@ -80,8 +80,7 @@ export type ListSettings = {
80
80
  showCut: number;
81
81
  cutCellMinHeight: number;
82
82
  cutLabel: string;
83
- entryHoverEffect: 'none' | 'default' | 'blinds' | 'reveal';
84
- entryHoverShowOption: 'always' | 'link only';
83
+ entryHoverEffect: 'None' | 'Default' | 'Blinds';
85
84
  rowPaddingTop: number;
86
85
  rowPaddingBottom: number;
87
86
  rowPaddingTopB: number;
@@ -145,7 +144,6 @@ export type ListTextStylePrefix = typeof LIST_TEXT_STYLE_PREFIXES[number];
145
144
  export declare const LIST_COLUMN_LETTERS: readonly ["A", "B", "C", "D", "E"];
146
145
  export declare function getListColumnVerticalAlignSettingKey(columnLetter: string): string;
147
146
  export declare const COLUMN_VALIGN_BASIC_OPTIONS: readonly ["Top", "Center", "Bottom"];
148
- export declare function normalizeListColumnVerticalAlign(value: string | undefined): string;
149
147
  export declare function isBaselineAnchorColumnVerticalAlign(value: string | undefined): boolean;
150
148
  export declare function parseBaselineAnchorLetter(value: string | undefined): string | null;
151
149
  export declare function isValidColumnBaselineVAlign(value: string | undefined, forColumnLetter: string, settings: ListSettings): boolean;
@@ -167,7 +165,6 @@ export declare function resolveListColumnPadding(columnWidth: number, paddingLef
167
165
  };
168
166
  export declare function getEffectiveListColumnWidths(columns: number, wrapperWidth: number, storedWidths: Record<ColumnWidthKey, number>): number[];
169
167
  export declare function resolveListColumnWidths(columns: number, wrapperWidth: number, storedWidths: Record<ColumnWidthKey, number>): number[];
170
- export declare function applyListColumnCountChange(nextSettings: ListSettings, prevSettings: ListSettings): ListSettings;
171
168
  export declare function applyListSettingsChange(nextSettings: ListSettings, prevSettings: ListSettings, options?: {
172
169
  designWidth?: number;
173
170
  }): ListSettings;
@@ -1,4 +1,4 @@
1
- import { List, applyListColumnCountChange } from './List';
1
+ import { List } from './List';
2
2
  import { ComponentSchemaV1 } from '../../types/SchemaV1';
3
3
  export declare const ListComponent: {
4
4
  element: typeof List;
@@ -6,7 +6,6 @@ export declare const ListComponent: {
6
6
  name: string;
7
7
  category: string;
8
8
  layoutMode: "structured";
9
- normalizeLayoutSettingsUpdate: typeof applyListColumnCountChange;
10
9
  preview: {
11
10
  type: "image";
12
11
  url: string;
@@ -4,10 +4,9 @@ type OnelinerFormProps = {
4
4
  settings: OnelinerFormSettings;
5
5
  content?: unknown;
6
6
  isEditor?: boolean;
7
- isPreviewMode?: boolean;
8
7
  activeEvent?: string;
9
8
  } & CommonComponentProps;
10
- export declare const OnelinerForm: ({ settings, isEditor, isPreviewMode, metadata, activeEvent }: OnelinerFormProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const OnelinerForm: ({ settings, isEditor, metadata, activeEvent }: OnelinerFormProps) => import("react/jsx-runtime").JSX.Element;
11
10
  type FieldConfig = {
12
11
  name: string;
13
12
  type: 'text' | 'phone' | 'email';
@@ -1,9 +1,8 @@
1
1
  export declare const OnelinerFormComponent: {
2
- element: ({ settings, isEditor, isPreviewMode, metadata, activeEvent }: {
2
+ element: ({ settings, isEditor, metadata, activeEvent }: {
3
3
  settings: import('./OnelinerForm').OnelinerFormSettings;
4
4
  content?: unknown;
5
5
  isEditor?: boolean;
6
- isPreviewMode?: boolean;
7
6
  activeEvent?: string;
8
7
  } & import('../props').CommonComponentProps) => import("react/jsx-runtime").JSX.Element;
9
8
  id: string;
@@ -0,0 +1 @@
1
+ export declare function getFontBasedOnSystem(): string;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { type Breakpoint, type Component, type ComponentDefaultSize, type ComponentSize, isSchemaV1 } from './types/Component';
1
+ export { type Component, isSchemaV1 } from './types/Component';
2
2
  export type { ComponentSchemaV1, SchemaProperty, PropertyScope, LayoutItem, LayoutRow, LayoutGroup, LayoutSwitcher, LayoutTab, SchemaSection, SchemaPanel, SchemaDisplay } from './types/SchemaV1';
3
3
  export { components } from './Components/components';