@cntrl-site/components 1.0.12-2 → 1.0.12-alpha.0

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.
@@ -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[];
@@ -0,0 +1,26 @@
1
+ import { CommonComponentProps } from '../props';
2
+ export declare const Marquee: ({ settings, content, isEditor, isPreviewMode }: MarqueeProps) => import("react/jsx-runtime").JSX.Element;
3
+ export type MarqueeItem = {
4
+ image?: {
5
+ url?: string;
6
+ name?: string;
7
+ };
8
+ link?: string;
9
+ };
10
+ export type MarqueeSettings = {
11
+ speed: number;
12
+ direction: 'left' | 'right';
13
+ pauseOnHover: 'on' | 'off';
14
+ hoverEffect: 'off' | 'brightness' | 'grayscale' | 'saturate' | 'randomize';
15
+ gap: number;
16
+ imageMaxWidth: number;
17
+ imageMaxHeight: number;
18
+ imageFit: 'cover' | 'contain';
19
+ };
20
+ type MarqueeProps = {
21
+ settings: MarqueeSettings;
22
+ content?: MarqueeItem[];
23
+ isEditor?: boolean;
24
+ isPreviewMode?: boolean;
25
+ } & CommonComponentProps;
26
+ export {};
@@ -0,0 +1,40 @@
1
+ import { ComponentSchemaV1 } from '../../types/SchemaV1';
2
+ export declare const MarqueeComponent: {
3
+ element: ({ settings, content, isEditor, isPreviewMode }: {
4
+ settings: import('./Marquee').MarqueeSettings;
5
+ content?: import('./Marquee').MarqueeItem[];
6
+ isEditor?: boolean;
7
+ isPreviewMode?: boolean;
8
+ } & import('../props').CommonComponentProps) => import("react/jsx-runtime").JSX.Element;
9
+ id: string;
10
+ name: string;
11
+ category: string;
12
+ version: number;
13
+ defaultSize: {
14
+ d: {
15
+ width: string;
16
+ height: number;
17
+ };
18
+ m: {
19
+ width: number;
20
+ height: number;
21
+ };
22
+ };
23
+ preview: {
24
+ type: "image";
25
+ url: string;
26
+ };
27
+ schema: ComponentSchemaV1;
28
+ sourceCode: string;
29
+ assetsPaths: {
30
+ content: {
31
+ path: string;
32
+ placeholderEnabled: boolean;
33
+ }[];
34
+ parameters: never[];
35
+ };
36
+ fontSettingsPaths: {
37
+ content: never[];
38
+ parameters: never[];
39
+ };
40
+ };