@cntrl-site/components 1.0.11-alpha.4 → 1.0.11-alpha.6
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/ControlSlider/ControlSlider.d.ts +25 -2
- package/dist/Components/Form/FormComponent.d.ts +9 -3
- package/dist/Components/Lightbox/Lightbox.d.ts +25 -2
- package/dist/Components/Marquee/Marquee.d.ts +43 -0
- package/dist/Components/Marquee/MarqueeComponent.d.ts +40 -0
- package/dist/Components/OnelinerForm/OnelinerFormComponent.d.ts +14 -3
- package/dist/index.js +2973 -4083
- package/dist/index.mjs +6903 -9275
- package/dist/types/SchemaV1.d.ts +1 -2
- package/package.json +85 -85
- package/dist/Components/Grid/Grid.d.ts +0 -61
- package/dist/Components/Grid/GridComponent.d.ts +0 -39
- package/dist/Components/List/List.d.ts +0 -75
- package/dist/Components/List/ListComponent.d.ts +0 -39
- package/dist/Components/utils/getMainFontBaseOnSystem.d.ts +0 -1
- package/dist/types/TextElementStyles.d.ts +0 -24
package/dist/types/SchemaV1.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type SchemaDisplay = {
|
|
|
4
4
|
[key: string]: unknown;
|
|
5
5
|
};
|
|
6
6
|
export type SchemaProperty = {
|
|
7
|
-
type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'fields' | readonly ['string', 'null']
|
|
7
|
+
type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'fields' | readonly ['string', 'null'];
|
|
8
8
|
scope?: PropertyScope;
|
|
9
9
|
title?: string;
|
|
10
10
|
message?: string;
|
|
@@ -15,7 +15,6 @@ export type SchemaProperty = {
|
|
|
15
15
|
properties?: Record<string, SchemaProperty>;
|
|
16
16
|
layout?: LayoutItem[];
|
|
17
17
|
items?: SchemaProperty;
|
|
18
|
-
gridParams?: SchemaProperty;
|
|
19
18
|
default?: unknown;
|
|
20
19
|
min?: number;
|
|
21
20
|
max?: number;
|
package/package.json
CHANGED
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@cntrl-site/components",
|
|
3
|
-
"version": "1.0.11-alpha.
|
|
4
|
-
"description": "Custom components for control editor and public websites.",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.mjs",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"style": "dist/components.css",
|
|
9
|
-
"sideEffects": [
|
|
10
|
-
"**/*.css"
|
|
11
|
-
],
|
|
12
|
-
"exports": {
|
|
13
|
-
".": {
|
|
14
|
-
"types": "./dist/index.d.ts",
|
|
15
|
-
"import": "./dist/index.mjs",
|
|
16
|
-
"require": "./dist/index.js"
|
|
17
|
-
},
|
|
18
|
-
"./utils": {
|
|
19
|
-
"types": "./dist/Components/utils/index.d.ts",
|
|
20
|
-
"import": "./dist/utils.mjs",
|
|
21
|
-
"require": "./dist/utils.js"
|
|
22
|
-
},
|
|
23
|
-
"./style/components.css": {
|
|
24
|
-
"default": "./dist/components.css"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"typesVersions": {
|
|
28
|
-
"*": {
|
|
29
|
-
"utils": [
|
|
30
|
-
"./dist/Components/utils/index.d.ts"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"scripts": {
|
|
35
|
-
"test": "jest",
|
|
36
|
-
"dev": "vite development",
|
|
37
|
-
"prebuild": "rimraf ./dist",
|
|
38
|
-
"build": "vite build",
|
|
39
|
-
"build:watch": "vite build --watch",
|
|
40
|
-
"prepublishOnly": "cross-env NODE_ENV=production npm run build"
|
|
41
|
-
},
|
|
42
|
-
"files": [
|
|
43
|
-
"dist",
|
|
44
|
-
"resources"
|
|
45
|
-
],
|
|
46
|
-
"repository": {
|
|
47
|
-
"type": "git",
|
|
48
|
-
"url": "git+https://github.com/cntrl-site/components.git"
|
|
49
|
-
},
|
|
50
|
-
"author": "arsen@momdesign.nyc",
|
|
51
|
-
"license": "MIT",
|
|
52
|
-
"bugs": {
|
|
53
|
-
"url": "https://github.com/cntrl-site/components/issues"
|
|
54
|
-
},
|
|
55
|
-
"homepage": "https://github.com/cntrl-site/components#readme",
|
|
56
|
-
"directories": {
|
|
57
|
-
"lib": "dist"
|
|
58
|
-
},
|
|
59
|
-
"dependencies": {
|
|
60
|
-
"classnames": "^2.5.1"
|
|
61
|
-
},
|
|
62
|
-
"peerDependencies": {
|
|
63
|
-
"react": "^18.0.0",
|
|
64
|
-
"react-dom": "^18.0.0"
|
|
65
|
-
},
|
|
66
|
-
"devDependencies": {
|
|
67
|
-
"@antfu/eslint-config": "^3.16.0",
|
|
68
|
-
"@splidejs/react-splide": "^0.7.12",
|
|
69
|
-
"ts-node": "^10.9.1",
|
|
70
|
-
"@tsconfig/node16": "^1.0.3",
|
|
71
|
-
"@tsconfig/recommended": "^1.0.1",
|
|
72
|
-
"@types/node": "^18.11.7",
|
|
73
|
-
"@types/react": "^18.2.0",
|
|
74
|
-
"@types/react-dom": "^18.2.0",
|
|
75
|
-
"@vitejs/plugin-react": "^4.3.4",
|
|
76
|
-
"cross-env": "^10.1.0",
|
|
77
|
-
"react": "^18.2.0",
|
|
78
|
-
"react-dom": "^18.2.0",
|
|
79
|
-
"rimraf": "^6.0.1",
|
|
80
|
-
"sass": "^1.86.3",
|
|
81
|
-
"typescript": "^5.2.2",
|
|
82
|
-
"vite": "^6.2.5",
|
|
83
|
-
"vite-plugin-dts": "^4.5.3"
|
|
84
|
-
}
|
|
85
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@cntrl-site/components",
|
|
3
|
+
"version": "1.0.11-alpha.6",
|
|
4
|
+
"description": "Custom components for control editor and public websites.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"style": "dist/components.css",
|
|
9
|
+
"sideEffects": [
|
|
10
|
+
"**/*.css"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.mjs",
|
|
16
|
+
"require": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./utils": {
|
|
19
|
+
"types": "./dist/Components/utils/index.d.ts",
|
|
20
|
+
"import": "./dist/utils.mjs",
|
|
21
|
+
"require": "./dist/utils.js"
|
|
22
|
+
},
|
|
23
|
+
"./style/components.css": {
|
|
24
|
+
"default": "./dist/components.css"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"typesVersions": {
|
|
28
|
+
"*": {
|
|
29
|
+
"utils": [
|
|
30
|
+
"./dist/Components/utils/index.d.ts"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"test": "jest",
|
|
36
|
+
"dev": "vite development",
|
|
37
|
+
"prebuild": "rimraf ./dist",
|
|
38
|
+
"build": "vite build",
|
|
39
|
+
"build:watch": "vite build --watch",
|
|
40
|
+
"prepublishOnly": "cross-env NODE_ENV=production npm run build"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist",
|
|
44
|
+
"resources"
|
|
45
|
+
],
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "git+https://github.com/cntrl-site/components.git"
|
|
49
|
+
},
|
|
50
|
+
"author": "arsen@momdesign.nyc",
|
|
51
|
+
"license": "MIT",
|
|
52
|
+
"bugs": {
|
|
53
|
+
"url": "https://github.com/cntrl-site/components/issues"
|
|
54
|
+
},
|
|
55
|
+
"homepage": "https://github.com/cntrl-site/components#readme",
|
|
56
|
+
"directories": {
|
|
57
|
+
"lib": "dist"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"classnames": "^2.5.1"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"react": "^18.0.0",
|
|
64
|
+
"react-dom": "^18.0.0"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@antfu/eslint-config": "^3.16.0",
|
|
68
|
+
"@splidejs/react-splide": "^0.7.12",
|
|
69
|
+
"ts-node": "^10.9.1",
|
|
70
|
+
"@tsconfig/node16": "^1.0.3",
|
|
71
|
+
"@tsconfig/recommended": "^1.0.1",
|
|
72
|
+
"@types/node": "^18.11.7",
|
|
73
|
+
"@types/react": "^18.2.0",
|
|
74
|
+
"@types/react-dom": "^18.2.0",
|
|
75
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
76
|
+
"cross-env": "^10.1.0",
|
|
77
|
+
"react": "^18.2.0",
|
|
78
|
+
"react-dom": "^18.2.0",
|
|
79
|
+
"rimraf": "^6.0.1",
|
|
80
|
+
"sass": "^1.86.3",
|
|
81
|
+
"typescript": "^5.2.2",
|
|
82
|
+
"vite": "^6.2.5",
|
|
83
|
+
"vite-plugin-dts": "^4.5.3"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { CommonComponentProps } from '../props';
|
|
2
|
-
import { TextStyles } from '../utils/textStylesToCss';
|
|
3
|
-
type GridProps = {
|
|
4
|
-
layoutId?: string;
|
|
5
|
-
settings: GridSettings;
|
|
6
|
-
content?: any;
|
|
7
|
-
isEditor?: boolean;
|
|
8
|
-
isPreviewMode?: boolean;
|
|
9
|
-
activeEvent: string | undefined;
|
|
10
|
-
onUpdateSettings?: (settings: GridSettings) => void;
|
|
11
|
-
} & CommonComponentProps;
|
|
12
|
-
export declare function Grid({ settings, content, isEditor, isPreviewMode, metadata, activeEvent, layoutId }: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
type GridLayoutConfig = {
|
|
14
|
-
entryWidth: number;
|
|
15
|
-
horizontalGap: number;
|
|
16
|
-
wrapperWidth: number;
|
|
17
|
-
columnsCount: number;
|
|
18
|
-
lockedParam?: 'wrapperWidth' | 'entryWidth' | 'horizontalGap' | null;
|
|
19
|
-
};
|
|
20
|
-
type GridSettings = {
|
|
21
|
-
type: 'A' | 'B';
|
|
22
|
-
gridLayout: GridLayoutConfig;
|
|
23
|
-
textBoxWidth: number;
|
|
24
|
-
verticalGap: number;
|
|
25
|
-
entriesCount: number;
|
|
26
|
-
lightbox: 'On' | 'Off';
|
|
27
|
-
imageDisplay: {
|
|
28
|
-
display: 'Fit' | 'Cover';
|
|
29
|
-
ratioValue: '1:1' | '2:3' | '3:4' | '4:5' | '16:9';
|
|
30
|
-
reversed: boolean;
|
|
31
|
-
};
|
|
32
|
-
slider: 'On' | 'Off';
|
|
33
|
-
sliderTiming: number;
|
|
34
|
-
direction: 'Horizontal' | 'Vertical' | 'Random';
|
|
35
|
-
transition: 'Fade' | 'Slide';
|
|
36
|
-
titleMarginTop: number;
|
|
37
|
-
subtitleMarginTop: number;
|
|
38
|
-
titleColor: string;
|
|
39
|
-
subtitleColor: string;
|
|
40
|
-
titleFontFamily: string;
|
|
41
|
-
titleFontSettings?: {
|
|
42
|
-
fontWeight: number;
|
|
43
|
-
fontStyle: string;
|
|
44
|
-
};
|
|
45
|
-
titleFontSize?: number;
|
|
46
|
-
titleLineHeight?: number;
|
|
47
|
-
titleLetterSpacing?: number;
|
|
48
|
-
titleWordSpacing?: number;
|
|
49
|
-
titleTextAppearance?: TextStyles['textAppearance'];
|
|
50
|
-
subtitleFontFamily: string;
|
|
51
|
-
subtitleFontSettings?: {
|
|
52
|
-
fontWeight: number;
|
|
53
|
-
fontStyle: string;
|
|
54
|
-
};
|
|
55
|
-
subtitleFontSize?: number;
|
|
56
|
-
subtitleLineHeight?: number;
|
|
57
|
-
subtitleLetterSpacing?: number;
|
|
58
|
-
subtitleWordSpacing?: number;
|
|
59
|
-
subtitleTextAppearance?: TextStyles['textAppearance'];
|
|
60
|
-
};
|
|
61
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Grid } from './Grid';
|
|
2
|
-
import { ComponentSchemaV1 } from '../../types/SchemaV1';
|
|
3
|
-
type GridSchema = ComponentSchemaV1 & {
|
|
4
|
-
properties: {
|
|
5
|
-
content: {
|
|
6
|
-
type: 'array';
|
|
7
|
-
settings?: {
|
|
8
|
-
addItemFromFileExplorer?: boolean;
|
|
9
|
-
};
|
|
10
|
-
items: any;
|
|
11
|
-
default: any[];
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export declare const GridComponent: {
|
|
16
|
-
element: typeof Grid;
|
|
17
|
-
id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
category: string;
|
|
20
|
-
preview: {
|
|
21
|
-
type: "image";
|
|
22
|
-
url: string;
|
|
23
|
-
};
|
|
24
|
-
version: number;
|
|
25
|
-
defaultSize: {
|
|
26
|
-
width: number;
|
|
27
|
-
height: number;
|
|
28
|
-
};
|
|
29
|
-
assetsPaths: {
|
|
30
|
-
content: {
|
|
31
|
-
path: string;
|
|
32
|
-
placeholderEnabled: boolean;
|
|
33
|
-
}[];
|
|
34
|
-
parameters: never[];
|
|
35
|
-
};
|
|
36
|
-
schema: GridSchema;
|
|
37
|
-
sourceCode: string;
|
|
38
|
-
};
|
|
39
|
-
export {};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { CommonComponentProps } from '../props';
|
|
2
|
-
import { TextStyles } from '../utils/textStylesToCss';
|
|
3
|
-
declare const COLUMN_WIDTH_KEYS: readonly ["AColumnWidth", "BColumn", "CColumn", "DColumn", "EColumn"];
|
|
4
|
-
type ColumnWidthKey = typeof COLUMN_WIDTH_KEYS[number];
|
|
5
|
-
export declare function getListEffectiveContentWidth(settings: Record<string, unknown>): number;
|
|
6
|
-
export declare function getEqualListColumnWidthUpdates(columns: number, contentWidth?: number): Record<ColumnWidthKey, number>;
|
|
7
|
-
export declare function resolveListColumnWidths(columns: number, wrapperWidth: number, storedWidths: Record<ColumnWidthKey, number>): number[];
|
|
8
|
-
export declare function applyListSettingsChange(nextSettings: Record<string, unknown>, prevSettings: Record<string, unknown>): Record<string, unknown>;
|
|
9
|
-
type ListContentItem = {
|
|
10
|
-
AColumn?: string;
|
|
11
|
-
BColumn?: string;
|
|
12
|
-
CColumn?: string;
|
|
13
|
-
DColumn?: string;
|
|
14
|
-
EColumn?: string;
|
|
15
|
-
image?: {
|
|
16
|
-
objectFit?: 'cover' | 'contain';
|
|
17
|
-
url: string;
|
|
18
|
-
name: string;
|
|
19
|
-
};
|
|
20
|
-
link?: string;
|
|
21
|
-
};
|
|
22
|
-
type ListProps = {
|
|
23
|
-
layoutId?: string;
|
|
24
|
-
settings: ListSettings;
|
|
25
|
-
content?: ListContentItem[];
|
|
26
|
-
isEditor?: boolean;
|
|
27
|
-
isPreviewMode?: boolean;
|
|
28
|
-
activeEvent: string | undefined;
|
|
29
|
-
onUpdateSettings?: (settings: ListSettings) => void;
|
|
30
|
-
} & CommonComponentProps;
|
|
31
|
-
export declare function List({ settings, content, isEditor, isPreviewMode, metadata, activeEvent, layoutId, onUpdateSettings }: ListProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
type ListSettings = {
|
|
33
|
-
columns: number;
|
|
34
|
-
wrapperWidth: number;
|
|
35
|
-
entriesCount: number;
|
|
36
|
-
cellMinHeight: number;
|
|
37
|
-
imageOnHover: 'On' | 'Off';
|
|
38
|
-
imageSize?: {
|
|
39
|
-
min: number;
|
|
40
|
-
max: number;
|
|
41
|
-
};
|
|
42
|
-
dividerWidth: number;
|
|
43
|
-
cut: number;
|
|
44
|
-
showCut: number;
|
|
45
|
-
cutCellMinHeight: number;
|
|
46
|
-
cutLabel: string;
|
|
47
|
-
entryHoverEffect: 'None' | 'Default' | 'Blinds';
|
|
48
|
-
rowPaddingTop: number;
|
|
49
|
-
rowPaddingBottom: number;
|
|
50
|
-
wrapperPaddingLeft: number;
|
|
51
|
-
wrapperPaddingRight: number;
|
|
52
|
-
AColumnWidth: number;
|
|
53
|
-
BColumn: number;
|
|
54
|
-
CColumn: number;
|
|
55
|
-
DColumn: number;
|
|
56
|
-
EColumn: number;
|
|
57
|
-
columnsOrder?: string[];
|
|
58
|
-
textColor: string;
|
|
59
|
-
textFontFamily: string;
|
|
60
|
-
textFontSettings?: {
|
|
61
|
-
fontWeight: number;
|
|
62
|
-
fontStyle: string;
|
|
63
|
-
};
|
|
64
|
-
textFontSize?: number;
|
|
65
|
-
textLineHeight?: number;
|
|
66
|
-
textLetterSpacing?: number;
|
|
67
|
-
textWordSpacing?: number;
|
|
68
|
-
textTextAppearance?: TextStyles['textAppearance'];
|
|
69
|
-
backgroundColor: string;
|
|
70
|
-
dividerColor: string;
|
|
71
|
-
textHoverColor: string;
|
|
72
|
-
backgroundHoverColor: string;
|
|
73
|
-
dividerHoverColor: string;
|
|
74
|
-
};
|
|
75
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { List } from './List';
|
|
2
|
-
import { ComponentSchemaV1 } from '../../types/SchemaV1';
|
|
3
|
-
type GridSchema = ComponentSchemaV1 & {
|
|
4
|
-
properties: {
|
|
5
|
-
content: {
|
|
6
|
-
type: 'array';
|
|
7
|
-
settings?: {
|
|
8
|
-
addItemFromFileExplorer?: boolean;
|
|
9
|
-
};
|
|
10
|
-
items: any;
|
|
11
|
-
default: any[];
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export declare const ListComponent: {
|
|
16
|
-
element: typeof List;
|
|
17
|
-
id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
category: string;
|
|
20
|
-
preview: {
|
|
21
|
-
type: "image";
|
|
22
|
-
url: string;
|
|
23
|
-
};
|
|
24
|
-
version: number;
|
|
25
|
-
defaultSize: {
|
|
26
|
-
width: number;
|
|
27
|
-
height: number;
|
|
28
|
-
};
|
|
29
|
-
assetsPaths: {
|
|
30
|
-
content: {
|
|
31
|
-
path: string;
|
|
32
|
-
placeholderEnabled: boolean;
|
|
33
|
-
}[];
|
|
34
|
-
parameters: never[];
|
|
35
|
-
};
|
|
36
|
-
schema: GridSchema;
|
|
37
|
-
sourceCode: string;
|
|
38
|
-
};
|
|
39
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getFontBasedOnSystem(): string;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export type TextElementStyles = {
|
|
2
|
-
fontSettings: {
|
|
3
|
-
fontFamily: string;
|
|
4
|
-
fontWeight: number;
|
|
5
|
-
fontStyle: string;
|
|
6
|
-
};
|
|
7
|
-
widthSettings: {
|
|
8
|
-
width: number;
|
|
9
|
-
sizing: 'auto' | 'manual';
|
|
10
|
-
};
|
|
11
|
-
letterSpacing: number;
|
|
12
|
-
textAlign: 'left' | 'center' | 'right';
|
|
13
|
-
wordSpacing: number;
|
|
14
|
-
fontSizeLineHeight: {
|
|
15
|
-
fontSize: number;
|
|
16
|
-
lineHeight: number;
|
|
17
|
-
};
|
|
18
|
-
textAppearance: {
|
|
19
|
-
textTransform: 'none' | 'uppercase' | 'lowercase';
|
|
20
|
-
textDecoration: 'none' | 'underline';
|
|
21
|
-
fontVariant: 'normal' | 'small-caps';
|
|
22
|
-
};
|
|
23
|
-
color: string;
|
|
24
|
-
};
|