@cntrl-site/components 1.0.12-2 → 1.0.12-3

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.
@@ -6,6 +6,7 @@ type GridSchema = ComponentSchemaV1 & {
6
6
  type: 'array';
7
7
  settings?: {
8
8
  addItemFromFileExplorer?: boolean;
9
+ addItemWithoutImage?: boolean;
9
10
  };
10
11
  items: any;
11
12
  default: any[];
@@ -1,6 +1,54 @@
1
1
  import { CommonComponentProps } from '../props';
2
2
  import { TextStyles } from '../utils/textStylesToCss';
3
- type ListSettings = {
3
+ type ListFontSettings = {
4
+ fontWeight: number;
5
+ fontStyle: string;
6
+ };
7
+ type ListColumnPrefix = 'AColumn' | 'BColumn' | 'CColumn' | 'DColumn' | 'EColumn';
8
+ type ListColumnTextStyleOverrides = {
9
+ AColumnVerticalAlign?: string;
10
+ AColumnTextFontFamily?: string;
11
+ AColumnTextFontSettings?: ListFontSettings;
12
+ AColumnTextFontSize?: number;
13
+ AColumnTextLineHeight?: number;
14
+ AColumnTextLetterSpacing?: number;
15
+ AColumnTextWordSpacing?: number;
16
+ AColumnTextTextAppearance?: TextStyles['textAppearance'];
17
+ BColumnVerticalAlign?: string;
18
+ BColumnTextFontFamily?: string;
19
+ BColumnTextFontSettings?: ListFontSettings;
20
+ BColumnTextFontSize?: number;
21
+ BColumnTextLineHeight?: number;
22
+ BColumnTextLetterSpacing?: number;
23
+ BColumnTextWordSpacing?: number;
24
+ BColumnTextTextAppearance?: TextStyles['textAppearance'];
25
+ CColumnVerticalAlign?: string;
26
+ CColumnTextFontFamily?: string;
27
+ CColumnTextFontSettings?: ListFontSettings;
28
+ CColumnTextFontSize?: number;
29
+ CColumnTextLineHeight?: number;
30
+ CColumnTextLetterSpacing?: number;
31
+ CColumnTextWordSpacing?: number;
32
+ CColumnTextTextAppearance?: TextStyles['textAppearance'];
33
+ DColumnVerticalAlign?: string;
34
+ DColumnTextFontFamily?: string;
35
+ DColumnTextFontSettings?: ListFontSettings;
36
+ DColumnTextFontSize?: number;
37
+ DColumnTextLineHeight?: number;
38
+ DColumnTextLetterSpacing?: number;
39
+ DColumnTextWordSpacing?: number;
40
+ DColumnTextTextAppearance?: TextStyles['textAppearance'];
41
+ EColumnVerticalAlign?: string;
42
+ EColumnTextFontFamily?: string;
43
+ EColumnTextFontSettings?: ListFontSettings;
44
+ EColumnTextFontSize?: number;
45
+ EColumnTextLineHeight?: number;
46
+ EColumnTextLetterSpacing?: number;
47
+ EColumnTextWordSpacing?: number;
48
+ EColumnTextTextAppearance?: TextStyles['textAppearance'];
49
+ };
50
+ export type ListColumnVerticalAlignKey = `${ListColumnPrefix}VerticalAlign`;
51
+ export type ListSettings = {
4
52
  columns: number;
5
53
  type: 'A' | 'B';
6
54
  wrapperWidth: number;
@@ -45,10 +93,7 @@ type ListSettings = {
45
93
  textPaddingLR?: number;
46
94
  textColor: string;
47
95
  textFontFamily: string;
48
- textFontSettings?: {
49
- fontWeight: number;
50
- fontStyle: string;
51
- };
96
+ textFontSettings?: ListFontSettings;
52
97
  textFontSize?: number;
53
98
  textLineHeight?: number;
54
99
  textLetterSpacing?: number;
@@ -59,7 +104,7 @@ type ListSettings = {
59
104
  textHoverColor: string;
60
105
  backgroundHoverColor: string;
61
106
  dividerHoverColor: string;
62
- };
107
+ } & ListColumnTextStyleOverrides;
63
108
  type ListContentItem = {
64
109
  AColumn?: string;
65
110
  BColumnWidth?: string;
@@ -84,13 +129,20 @@ type ListProps = {
84
129
  } & CommonComponentProps;
85
130
  export declare const COLUMN_CONTENT_KEYS: readonly ["AColumn", "BColumnWidth", "CColumnWidth", "DColumnWidth", "EColumnWidth"];
86
131
  export declare const COLUMN_TEXT_PREFIXES: readonly ["AColumn", "BColumn", "CColumn", "DColumn", "EColumn"];
132
+ export declare const LIST_COLUMN_LETTERS: readonly ["A", "B", "C", "D", "E"];
133
+ export declare function getListColumnVerticalAlignSettingKey(columnLetter: string): string;
134
+ export declare const COLUMN_VALIGN_BASIC_OPTIONS: readonly ["Top", "Center", "Bottom"];
135
+ export declare function isTopColumnVerticalAlign(value: string | undefined): boolean;
136
+ export declare function parseBaselineAnchorLetter(value: string | undefined): string | null;
137
+ export declare function isValidColumnBaselineVAlign(value: string | undefined, forColumnLetter: string, settings: ListSettings): boolean;
138
+ export declare function getColumnVerticalAlignOptionsForLetter(columnLetter: string, settings: ListSettings): string[];
87
139
  export declare const LIST_GLOBAL_TEXT_STYLE_KEYS: readonly ["textFontFamily", "textFontSettings", "textFontSize", "textLineHeight", "textLetterSpacing", "textWordSpacing", "textTextAppearance"];
88
140
  export type ListGlobalTextStyleKey = typeof LIST_GLOBAL_TEXT_STYLE_KEYS[number];
89
141
  export declare function getListColumnTextSettingKey(prefix: typeof COLUMN_TEXT_PREFIXES[number], globalKey: ListGlobalTextStyleKey): string;
90
142
  declare const COLUMN_WIDTH_KEYS: readonly ["AColumnWidth", "BColumnWidth", "CColumnWidth", "DColumnWidth", "EColumnWidth"];
91
143
  type ColumnWidthKey = typeof COLUMN_WIDTH_KEYS[number];
92
144
  export declare function getListMinColumnWidth(designWidthPx?: number): number;
93
- export declare function getListEffectiveContentWidth(settings: Record<string, unknown>): number;
145
+ export declare function getListEffectiveContentWidth(settings: ListSettings): number;
94
146
  export declare function getEqualListColumnWidthUpdates(columns: number, contentWidth?: number): Record<ColumnWidthKey, number>;
95
147
  export declare function resolveListColumnPadding(columnWidth: number, paddingLeft: number, paddingRight: number): {
96
148
  paddingLeft: number;
@@ -98,8 +150,8 @@ export declare function resolveListColumnPadding(columnWidth: number, paddingLef
98
150
  };
99
151
  export declare function getEffectiveListColumnWidths(columns: number, wrapperWidth: number, storedWidths: Record<ColumnWidthKey, number>): number[];
100
152
  export declare function resolveListColumnWidths(columns: number, wrapperWidth: number, storedWidths: Record<ColumnWidthKey, number>): number[];
101
- export declare function applyListSettingsChange(nextSettings: Record<string, unknown>, prevSettings: Record<string, unknown>, options?: {
153
+ export declare function applyListSettingsChange(nextSettings: ListSettings, prevSettings: ListSettings, options?: {
102
154
  designWidth?: number;
103
- }): Record<string, unknown>;
155
+ }): ListSettings;
104
156
  export declare function List({ settings, content, isEditor, isPreviewMode, activeEvent, layoutId, onUpdateSettings }: ListProps): import("react/jsx-runtime").JSX.Element;
105
157
  export {};
@@ -6,6 +6,7 @@ type GridSchema = ComponentSchemaV1 & {
6
6
  type: 'array';
7
7
  settings?: {
8
8
  addItemFromFileExplorer?: boolean;
9
+ addItemWithoutImage?: boolean;
9
10
  };
10
11
  items: any;
11
12
  default: any[];