@cntrl-site/sdk 1.25.6 → 1.25.8
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/lib/FontFaceGenerator/FontFaceGenerator.js +6 -6
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -1
- package/lib/schemas/article/ItemArea.schema.d.ts +4 -1
- package/lib/schemas/article/ItemArea.schema.js +1 -0
- package/lib/schemas/article/ItemBase.schema.d.ts +5 -0
- package/lib/schemas/article/RichTextItem.schema.d.ts +5 -0
- package/lib/types/article/ItemArea.d.ts +5 -0
- package/lib/types/article/ItemArea.js +6 -1
- package/lib/utils.js +2 -2
- package/package.json +62 -62
- package/resources/template.scss.ejs +50 -50
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 CNTRL
|
|
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) 2022 CNTRL
|
|
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,2 +1,2 @@
|
|
|
1
|
-
# CNTRL SDK
|
|
2
|
-
This is a root SDK module for CNTRL. Should be used along with other framework-specific modules like `@cntrl-site/sdk-react`
|
|
1
|
+
# CNTRL SDK
|
|
2
|
+
This is a root SDK module for CNTRL. Should be used along with other framework-specific modules like `@cntrl-site/sdk-react`
|
|
@@ -15,12 +15,12 @@ class FontFaceGenerator {
|
|
|
15
15
|
const otherFiles = font.files
|
|
16
16
|
.filter(file => file.type !== 'eot')
|
|
17
17
|
.map(file => `url('${file.url}') format('${FILE_TYPES_MAP[file.type] || file.type}')`);
|
|
18
|
-
return `
|
|
19
|
-
@font-face {
|
|
20
|
-
font-family: "${font.name}";
|
|
21
|
-
font-weight: ${font.weight};
|
|
22
|
-
font-style: ${font.style};
|
|
23
|
-
${eotFile ? `src: url('${eotFile.url}');\n ` : ''}src: ${otherFiles.join(', ')};
|
|
18
|
+
return `
|
|
19
|
+
@font-face {
|
|
20
|
+
font-family: "${font.name}";
|
|
21
|
+
font-weight: ${font.weight};
|
|
22
|
+
font-style: ${font.style};
|
|
23
|
+
${eotFile ? `src: url('${eotFile.url}');\n ` : ''}src: ${otherFiles.join(', ')};
|
|
24
24
|
}`;
|
|
25
25
|
}).join('\n');
|
|
26
26
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { Rect } from './Rect/Rect';
|
|
|
6
6
|
export { SectionHeightMode } from './types/article/Section';
|
|
7
7
|
export { TextAlign, TextDecoration, TextTransform, VerticalAlign } from './types/article/RichText';
|
|
8
8
|
export { ArticleItemType } from './types/article/ArticleItemType';
|
|
9
|
-
export { AreaAnchor, AnchorSide, DimensionMode, PositionType } from './types/article/ItemArea';
|
|
9
|
+
export { AreaAnchor, AnchorSide, DimensionMode, PositionType, DimensionsType } from './types/article/ItemArea';
|
|
10
10
|
export { KeyframeType } from './types/keyframe/Keyframe';
|
|
11
11
|
export type { Article } from './types/article/Article';
|
|
12
12
|
export type { Section, SectionHeight } from './types/article/Section';
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KeyframeType = exports.PositionType = exports.DimensionMode = exports.AnchorSide = exports.AreaAnchor = exports.ArticleItemType = exports.VerticalAlign = exports.TextTransform = exports.TextDecoration = exports.TextAlign = exports.SectionHeightMode = exports.Rect = exports.ScrollPlaybackVideoManager = exports.measureFont = exports.getLayoutMediaQuery = exports.getLayoutStyles = exports.FontFaceGenerator = exports.CntrlClient = void 0;
|
|
3
|
+
exports.KeyframeType = exports.DimensionsType = exports.PositionType = exports.DimensionMode = exports.AnchorSide = exports.AreaAnchor = exports.ArticleItemType = exports.VerticalAlign = exports.TextTransform = exports.TextDecoration = exports.TextAlign = exports.SectionHeightMode = exports.Rect = exports.ScrollPlaybackVideoManager = exports.measureFont = exports.getLayoutMediaQuery = exports.getLayoutStyles = exports.FontFaceGenerator = exports.CntrlClient = void 0;
|
|
4
4
|
// logic
|
|
5
5
|
var Client_1 = require("./Client/Client");
|
|
6
6
|
Object.defineProperty(exports, "CntrlClient", { enumerable: true, get: function () { return Client_1.Client; } });
|
|
@@ -29,5 +29,6 @@ Object.defineProperty(exports, "AreaAnchor", { enumerable: true, get: function (
|
|
|
29
29
|
Object.defineProperty(exports, "AnchorSide", { enumerable: true, get: function () { return ItemArea_1.AnchorSide; } });
|
|
30
30
|
Object.defineProperty(exports, "DimensionMode", { enumerable: true, get: function () { return ItemArea_1.DimensionMode; } });
|
|
31
31
|
Object.defineProperty(exports, "PositionType", { enumerable: true, get: function () { return ItemArea_1.PositionType; } });
|
|
32
|
+
Object.defineProperty(exports, "DimensionsType", { enumerable: true, get: function () { return ItemArea_1.DimensionsType; } });
|
|
32
33
|
var Keyframe_1 = require("./types/keyframe/Keyframe");
|
|
33
34
|
Object.defineProperty(exports, "KeyframeType", { enumerable: true, get: function () { return Keyframe_1.KeyframeType; } });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { AnchorSide, PositionType, AreaAnchor } from '../../types/article/ItemArea';
|
|
2
|
+
import { AnchorSide, PositionType, AreaAnchor, DimensionsType } from '../../types/article/ItemArea';
|
|
3
3
|
export declare const ItemAreaSchema: z.ZodObject<{
|
|
4
4
|
top: z.ZodNumber;
|
|
5
5
|
left: z.ZodNumber;
|
|
@@ -10,6 +10,7 @@ export declare const ItemAreaSchema: z.ZodObject<{
|
|
|
10
10
|
anchorSide: z.ZodOptional<z.ZodNativeEnum<typeof AnchorSide>>;
|
|
11
11
|
scale: z.ZodNumber;
|
|
12
12
|
positionType: z.ZodNativeEnum<typeof PositionType>;
|
|
13
|
+
dimensionsType: z.ZodOptional<z.ZodNativeEnum<typeof DimensionsType>>;
|
|
13
14
|
scaleAnchor: z.ZodNativeEnum<typeof AreaAnchor>;
|
|
14
15
|
}, "strip", z.ZodTypeAny, {
|
|
15
16
|
left: number;
|
|
@@ -22,6 +23,7 @@ export declare const ItemAreaSchema: z.ZodObject<{
|
|
|
22
23
|
positionType: PositionType;
|
|
23
24
|
scaleAnchor: AreaAnchor;
|
|
24
25
|
anchorSide?: AnchorSide | undefined;
|
|
26
|
+
dimensionsType?: DimensionsType | undefined;
|
|
25
27
|
}, {
|
|
26
28
|
left: number;
|
|
27
29
|
top: number;
|
|
@@ -33,4 +35,5 @@ export declare const ItemAreaSchema: z.ZodObject<{
|
|
|
33
35
|
positionType: PositionType;
|
|
34
36
|
scaleAnchor: AreaAnchor;
|
|
35
37
|
anchorSide?: AnchorSide | undefined;
|
|
38
|
+
dimensionsType?: DimensionsType | undefined;
|
|
36
39
|
}>;
|
|
@@ -13,5 +13,6 @@ exports.ItemAreaSchema = zod_1.z.object({
|
|
|
13
13
|
anchorSide: zod_1.z.nativeEnum(ItemArea_1.AnchorSide).optional(),
|
|
14
14
|
scale: zod_1.z.number().nonnegative(),
|
|
15
15
|
positionType: zod_1.z.nativeEnum(ItemArea_1.PositionType),
|
|
16
|
+
dimensionsType: zod_1.z.nativeEnum(ItemArea_1.DimensionsType).optional(),
|
|
16
17
|
scaleAnchor: zod_1.z.nativeEnum(ItemArea_1.AreaAnchor)
|
|
17
18
|
});
|
|
@@ -35,6 +35,7 @@ export declare const ItemBaseSchema: z.ZodObject<{
|
|
|
35
35
|
anchorSide: z.ZodOptional<z.ZodNativeEnum<typeof import("../../types/article/ItemArea").AnchorSide>>;
|
|
36
36
|
scale: z.ZodNumber;
|
|
37
37
|
positionType: z.ZodNativeEnum<typeof import("../../types/article/ItemArea").PositionType>;
|
|
38
|
+
dimensionsType: z.ZodOptional<z.ZodNativeEnum<typeof import("../../types/article/ItemArea").DimensionsType>>;
|
|
38
39
|
scaleAnchor: z.ZodNativeEnum<typeof AreaAnchor>;
|
|
39
40
|
}, "strip", z.ZodTypeAny, {
|
|
40
41
|
left: number;
|
|
@@ -47,6 +48,7 @@ export declare const ItemBaseSchema: z.ZodObject<{
|
|
|
47
48
|
positionType: import("../../types/article/ItemArea").PositionType;
|
|
48
49
|
scaleAnchor: AreaAnchor;
|
|
49
50
|
anchorSide?: import("../../types/article/ItemArea").AnchorSide | undefined;
|
|
51
|
+
dimensionsType?: import("../../types/article/ItemArea").DimensionsType | undefined;
|
|
50
52
|
}, {
|
|
51
53
|
left: number;
|
|
52
54
|
top: number;
|
|
@@ -58,6 +60,7 @@ export declare const ItemBaseSchema: z.ZodObject<{
|
|
|
58
60
|
positionType: import("../../types/article/ItemArea").PositionType;
|
|
59
61
|
scaleAnchor: AreaAnchor;
|
|
60
62
|
anchorSide?: import("../../types/article/ItemArea").AnchorSide | undefined;
|
|
63
|
+
dimensionsType?: import("../../types/article/ItemArea").DimensionsType | undefined;
|
|
61
64
|
}>>;
|
|
62
65
|
hidden: z.ZodRecord<z.ZodString, z.ZodBoolean>;
|
|
63
66
|
link: z.ZodOptional<z.ZodObject<{
|
|
@@ -98,6 +101,7 @@ export declare const ItemBaseSchema: z.ZodObject<{
|
|
|
98
101
|
positionType: import("../../types/article/ItemArea").PositionType;
|
|
99
102
|
scaleAnchor: AreaAnchor;
|
|
100
103
|
anchorSide?: import("../../types/article/ItemArea").AnchorSide | undefined;
|
|
104
|
+
dimensionsType?: import("../../types/article/ItemArea").DimensionsType | undefined;
|
|
101
105
|
}>;
|
|
102
106
|
link?: {
|
|
103
107
|
url: string;
|
|
@@ -123,6 +127,7 @@ export declare const ItemBaseSchema: z.ZodObject<{
|
|
|
123
127
|
positionType: import("../../types/article/ItemArea").PositionType;
|
|
124
128
|
scaleAnchor: AreaAnchor;
|
|
125
129
|
anchorSide?: import("../../types/article/ItemArea").AnchorSide | undefined;
|
|
130
|
+
dimensionsType?: import("../../types/article/ItemArea").DimensionsType | undefined;
|
|
126
131
|
}>;
|
|
127
132
|
link?: {
|
|
128
133
|
url: string;
|
|
@@ -57,6 +57,7 @@ export declare const RichTextItemSchema: z.ZodObject<{
|
|
|
57
57
|
anchorSide: z.ZodOptional<z.ZodNativeEnum<typeof import("../..").AnchorSide>>;
|
|
58
58
|
scale: z.ZodNumber;
|
|
59
59
|
positionType: z.ZodNativeEnum<typeof import("../..").PositionType>;
|
|
60
|
+
dimensionsType: z.ZodOptional<z.ZodNativeEnum<typeof import("../..").DimensionsType>>;
|
|
60
61
|
scaleAnchor: z.ZodNativeEnum<typeof import("../..").AreaAnchor>;
|
|
61
62
|
}, "strip", z.ZodTypeAny, {
|
|
62
63
|
left: number;
|
|
@@ -69,6 +70,7 @@ export declare const RichTextItemSchema: z.ZodObject<{
|
|
|
69
70
|
positionType: import("../..").PositionType;
|
|
70
71
|
scaleAnchor: import("../..").AreaAnchor;
|
|
71
72
|
anchorSide?: import("../..").AnchorSide | undefined;
|
|
73
|
+
dimensionsType?: import("../..").DimensionsType | undefined;
|
|
72
74
|
}, {
|
|
73
75
|
left: number;
|
|
74
76
|
top: number;
|
|
@@ -80,6 +82,7 @@ export declare const RichTextItemSchema: z.ZodObject<{
|
|
|
80
82
|
positionType: import("../..").PositionType;
|
|
81
83
|
scaleAnchor: import("../..").AreaAnchor;
|
|
82
84
|
anchorSide?: import("../..").AnchorSide | undefined;
|
|
85
|
+
dimensionsType?: import("../..").DimensionsType | undefined;
|
|
83
86
|
}>>;
|
|
84
87
|
compoundSettings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
85
88
|
positionAnchor: z.ZodNativeEnum<typeof import("../..").AreaAnchor>;
|
|
@@ -1007,6 +1010,7 @@ export declare const RichTextItemSchema: z.ZodObject<{
|
|
|
1007
1010
|
positionType: import("../..").PositionType;
|
|
1008
1011
|
scaleAnchor: import("../..").AreaAnchor;
|
|
1009
1012
|
anchorSide?: import("../..").AnchorSide | undefined;
|
|
1013
|
+
dimensionsType?: import("../..").DimensionsType | undefined;
|
|
1010
1014
|
}>;
|
|
1011
1015
|
layoutParams: Record<string, {
|
|
1012
1016
|
color: string;
|
|
@@ -1197,6 +1201,7 @@ export declare const RichTextItemSchema: z.ZodObject<{
|
|
|
1197
1201
|
positionType: import("../..").PositionType;
|
|
1198
1202
|
scaleAnchor: import("../..").AreaAnchor;
|
|
1199
1203
|
anchorSide?: import("../..").AnchorSide | undefined;
|
|
1204
|
+
dimensionsType?: import("../..").DimensionsType | undefined;
|
|
1200
1205
|
}>;
|
|
1201
1206
|
layoutParams: Record<string, {
|
|
1202
1207
|
color: string;
|
|
@@ -7,6 +7,10 @@ export declare enum PositionType {
|
|
|
7
7
|
SectionBased = "section-based",
|
|
8
8
|
ScreenBased = "screen-based"
|
|
9
9
|
}
|
|
10
|
+
export declare enum DimensionsType {
|
|
11
|
+
PixelsBased = "pixels-based",
|
|
12
|
+
PercentageBased = "percentage-based"
|
|
13
|
+
}
|
|
10
14
|
export declare enum AreaAnchor {
|
|
11
15
|
TopLeft = "top-left",
|
|
12
16
|
TopCenter = "top-center",
|
|
@@ -28,6 +32,7 @@ export interface ItemArea {
|
|
|
28
32
|
width: number;
|
|
29
33
|
height: number;
|
|
30
34
|
positionType: PositionType;
|
|
35
|
+
dimensionsType?: DimensionsType;
|
|
31
36
|
zIndex: number;
|
|
32
37
|
angle: number;
|
|
33
38
|
anchorSide?: AnchorSide;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DimensionMode = exports.AreaAnchor = exports.PositionType = exports.AnchorSide = void 0;
|
|
3
|
+
exports.DimensionMode = exports.AreaAnchor = exports.DimensionsType = exports.PositionType = exports.AnchorSide = void 0;
|
|
4
4
|
var AnchorSide;
|
|
5
5
|
(function (AnchorSide) {
|
|
6
6
|
AnchorSide["Top"] = "top";
|
|
@@ -12,6 +12,11 @@ var PositionType;
|
|
|
12
12
|
PositionType["SectionBased"] = "section-based";
|
|
13
13
|
PositionType["ScreenBased"] = "screen-based";
|
|
14
14
|
})(PositionType || (exports.PositionType = PositionType = {}));
|
|
15
|
+
var DimensionsType;
|
|
16
|
+
(function (DimensionsType) {
|
|
17
|
+
DimensionsType["PixelsBased"] = "pixels-based";
|
|
18
|
+
DimensionsType["PercentageBased"] = "percentage-based";
|
|
19
|
+
})(DimensionsType || (exports.DimensionsType = DimensionsType = {}));
|
|
15
20
|
var AreaAnchor;
|
|
16
21
|
(function (AreaAnchor) {
|
|
17
22
|
AreaAnchor["TopLeft"] = "top-left";
|
package/lib/utils.js
CHANGED
|
@@ -8,8 +8,8 @@ function getLayoutStyles(layouts, layoutValues, mapToStyles) {
|
|
|
8
8
|
.sort((a, b) => a.startsWith - b.startsWith)
|
|
9
9
|
.reduce((acc, layout) => {
|
|
10
10
|
const values = layoutValues.map(lv => lv[layout.id]);
|
|
11
|
-
return `
|
|
12
|
-
${acc}
|
|
11
|
+
return `
|
|
12
|
+
${acc}
|
|
13
13
|
${layout.startsWith !== 0
|
|
14
14
|
? `@media (min-width: ${layout.startsWith}px) {${mapToStyles(values, layout.exemplary)}}`
|
|
15
15
|
: `${mapToStyles(values, layout.exemplary)}`}`;
|
package/package.json
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@cntrl-site/sdk",
|
|
3
|
-
"version": "1.25.
|
|
4
|
-
"description": "Generic SDK for use in public websites.",
|
|
5
|
-
"main": "lib/index.js",
|
|
6
|
-
"types": "lib/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"test": "jest",
|
|
9
|
-
"prebuild": "rimraf ./lib",
|
|
10
|
-
"build": "tsc --project tsconfig.build.json",
|
|
11
|
-
"prepublishOnly": "cross-env NODE_ENV=production npm run build"
|
|
12
|
-
},
|
|
13
|
-
"bin": {
|
|
14
|
-
"cntrl-sdk": "lib/cli.js"
|
|
15
|
-
},
|
|
16
|
-
"files": [
|
|
17
|
-
"lib",
|
|
18
|
-
"resources"
|
|
19
|
-
],
|
|
20
|
-
"repository": {
|
|
21
|
-
"type": "git",
|
|
22
|
-
"url": "git+https://github.com/cntrl-site/sdk.git"
|
|
23
|
-
},
|
|
24
|
-
"author": "arsen@momdesign.nyc",
|
|
25
|
-
"license": "MIT",
|
|
26
|
-
"bugs": {
|
|
27
|
-
"url": "https://github.com/cntrl-site/sdk/issues"
|
|
28
|
-
},
|
|
29
|
-
"homepage": "https://github.com/cntrl-site/sdk#readme",
|
|
30
|
-
"directories": {
|
|
31
|
-
"lib": "lib"
|
|
32
|
-
},
|
|
33
|
-
"dependencies": {
|
|
34
|
-
"@splidejs/react-splide": "^0.7.12",
|
|
35
|
-
"@types/ejs": "^3.1.2",
|
|
36
|
-
"@types/isomorphic-fetch": "^0.0.36",
|
|
37
|
-
"@types/ua-parser-js": "^0.7.39",
|
|
38
|
-
"commander": "^10.0.1",
|
|
39
|
-
"dotenv": "^16.1.3",
|
|
40
|
-
"ejs": "^3.1.9",
|
|
41
|
-
"isomorphic-fetch": "^3.0.0",
|
|
42
|
-
"mp4box": "^0.5.2",
|
|
43
|
-
"styled-jsx": "^5.1.6",
|
|
44
|
-
"ts-node": "^10.9.1",
|
|
45
|
-
"ua-parser-js": "^1.0.37",
|
|
46
|
-
"url": "^0.11.0",
|
|
47
|
-
"zod": "^3.22.4"
|
|
48
|
-
},
|
|
49
|
-
"devDependencies": {
|
|
50
|
-
"@tsconfig/node16": "^1.0.3",
|
|
51
|
-
"@tsconfig/recommended": "^1.0.1",
|
|
52
|
-
"@types/jest": "^29.0.0",
|
|
53
|
-
"@types/node": "^18.11.7",
|
|
54
|
-
"@types/react": "^18.2.0",
|
|
55
|
-
"@types/react-dom": "^18.2.0",
|
|
56
|
-
"@vitejs/plugin-react": "^4.3.4",
|
|
57
|
-
"cross-env": "^10.1.0",
|
|
58
|
-
"jest": "^28.1.3",
|
|
59
|
-
"ts-jest": "^28.0.8",
|
|
60
|
-
"typescript": "^5.2.2"
|
|
61
|
-
}
|
|
62
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@cntrl-site/sdk",
|
|
3
|
+
"version": "1.25.8",
|
|
4
|
+
"description": "Generic SDK for use in public websites.",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "jest",
|
|
9
|
+
"prebuild": "rimraf ./lib",
|
|
10
|
+
"build": "tsc --project tsconfig.build.json",
|
|
11
|
+
"prepublishOnly": "cross-env NODE_ENV=production npm run build"
|
|
12
|
+
},
|
|
13
|
+
"bin": {
|
|
14
|
+
"cntrl-sdk": "lib/cli.js"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"lib",
|
|
18
|
+
"resources"
|
|
19
|
+
],
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/cntrl-site/sdk.git"
|
|
23
|
+
},
|
|
24
|
+
"author": "arsen@momdesign.nyc",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/cntrl-site/sdk/issues"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/cntrl-site/sdk#readme",
|
|
30
|
+
"directories": {
|
|
31
|
+
"lib": "lib"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@splidejs/react-splide": "^0.7.12",
|
|
35
|
+
"@types/ejs": "^3.1.2",
|
|
36
|
+
"@types/isomorphic-fetch": "^0.0.36",
|
|
37
|
+
"@types/ua-parser-js": "^0.7.39",
|
|
38
|
+
"commander": "^10.0.1",
|
|
39
|
+
"dotenv": "^16.1.3",
|
|
40
|
+
"ejs": "^3.1.9",
|
|
41
|
+
"isomorphic-fetch": "^3.0.0",
|
|
42
|
+
"mp4box": "^0.5.2",
|
|
43
|
+
"styled-jsx": "^5.1.6",
|
|
44
|
+
"ts-node": "^10.9.1",
|
|
45
|
+
"ua-parser-js": "^1.0.37",
|
|
46
|
+
"url": "^0.11.0",
|
|
47
|
+
"zod": "^3.22.4"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@tsconfig/node16": "^1.0.3",
|
|
51
|
+
"@tsconfig/recommended": "^1.0.1",
|
|
52
|
+
"@types/jest": "^29.0.0",
|
|
53
|
+
"@types/node": "^18.11.7",
|
|
54
|
+
"@types/react": "^18.2.0",
|
|
55
|
+
"@types/react-dom": "^18.2.0",
|
|
56
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
57
|
+
"cross-env": "^10.1.0",
|
|
58
|
+
"jest": "^28.1.3",
|
|
59
|
+
"ts-jest": "^28.0.8",
|
|
60
|
+
"typescript": "^5.2.2"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
// CAUTION: THIS FILE IS AUTO-GENERATED BASED ON
|
|
2
|
-
// LAYOUT CONFIGURATION IN YOUR CNTRL PROJECT
|
|
3
|
-
// WE HIGHLY ADVICE YOU TO NOT CHANGE IT MANUALLY
|
|
4
|
-
@use "sass:map";
|
|
5
|
-
|
|
6
|
-
$__CNTRL_LAYOUT_WIDTH__: <%= ranges[0].exemplary %>;
|
|
7
|
-
|
|
8
|
-
$layout: (
|
|
9
|
-
<% ranges.forEach(function(range) { %>
|
|
10
|
-
<%= range.name %>: (
|
|
11
|
-
start: <%= range.start %>,
|
|
12
|
-
end: <%= range.end %>,
|
|
13
|
-
exemplary: <%= range.exemplary %>,
|
|
14
|
-
isFirst: <%= range.isFirst %>,
|
|
15
|
-
isLast: <%= range.isLast %>
|
|
16
|
-
),
|
|
17
|
-
<% }); %>
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
@function size($value) {
|
|
21
|
-
@return #{$value/$__CNTRL_LAYOUT_WIDTH__*100}vw;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@mixin for($name) {
|
|
25
|
-
$start: map.get(map.get($layout, $name), "start");
|
|
26
|
-
$end: map.get(map.get($layout, $name), "end");
|
|
27
|
-
$isFirst: map.get(map.get($layout, $name), "isFirst");
|
|
28
|
-
$isLast: map.get(map.get($layout, $name), "isLast");
|
|
29
|
-
$exemplary: map.get(map.get($layout, $name), "exemplary");
|
|
30
|
-
$__CNTRL_LAYOUT_WIDTH__: $exemplary !global;
|
|
31
|
-
|
|
32
|
-
@if $isFirst == true and $isLast == true {
|
|
33
|
-
@content;
|
|
34
|
-
} @else if $isFirst == true {
|
|
35
|
-
@media (max-width: #{$end}px) {
|
|
36
|
-
@content;
|
|
37
|
-
}
|
|
38
|
-
} @else if $isLast == true {
|
|
39
|
-
@media (min-width: #{$start}px) {
|
|
40
|
-
@content;
|
|
41
|
-
}
|
|
42
|
-
} @else {
|
|
43
|
-
@media (min-width: #{$start}px) and (max-width: #{$end}px) {
|
|
44
|
-
@content;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// reset global variable back to first layout's exemplary (mobile-first)
|
|
49
|
-
$__CNTRL_LAYOUT_WIDTH__: <%= ranges[0].exemplary %> !global;
|
|
50
|
-
}
|
|
1
|
+
// CAUTION: THIS FILE IS AUTO-GENERATED BASED ON
|
|
2
|
+
// LAYOUT CONFIGURATION IN YOUR CNTRL PROJECT
|
|
3
|
+
// WE HIGHLY ADVICE YOU TO NOT CHANGE IT MANUALLY
|
|
4
|
+
@use "sass:map";
|
|
5
|
+
|
|
6
|
+
$__CNTRL_LAYOUT_WIDTH__: <%= ranges[0].exemplary %>;
|
|
7
|
+
|
|
8
|
+
$layout: (
|
|
9
|
+
<% ranges.forEach(function(range) { %>
|
|
10
|
+
<%= range.name %>: (
|
|
11
|
+
start: <%= range.start %>,
|
|
12
|
+
end: <%= range.end %>,
|
|
13
|
+
exemplary: <%= range.exemplary %>,
|
|
14
|
+
isFirst: <%= range.isFirst %>,
|
|
15
|
+
isLast: <%= range.isLast %>
|
|
16
|
+
),
|
|
17
|
+
<% }); %>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
@function size($value) {
|
|
21
|
+
@return #{$value/$__CNTRL_LAYOUT_WIDTH__*100}vw;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@mixin for($name) {
|
|
25
|
+
$start: map.get(map.get($layout, $name), "start");
|
|
26
|
+
$end: map.get(map.get($layout, $name), "end");
|
|
27
|
+
$isFirst: map.get(map.get($layout, $name), "isFirst");
|
|
28
|
+
$isLast: map.get(map.get($layout, $name), "isLast");
|
|
29
|
+
$exemplary: map.get(map.get($layout, $name), "exemplary");
|
|
30
|
+
$__CNTRL_LAYOUT_WIDTH__: $exemplary !global;
|
|
31
|
+
|
|
32
|
+
@if $isFirst == true and $isLast == true {
|
|
33
|
+
@content;
|
|
34
|
+
} @else if $isFirst == true {
|
|
35
|
+
@media (max-width: #{$end}px) {
|
|
36
|
+
@content;
|
|
37
|
+
}
|
|
38
|
+
} @else if $isLast == true {
|
|
39
|
+
@media (min-width: #{$start}px) {
|
|
40
|
+
@content;
|
|
41
|
+
}
|
|
42
|
+
} @else {
|
|
43
|
+
@media (min-width: #{$start}px) and (max-width: #{$end}px) {
|
|
44
|
+
@content;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// reset global variable back to first layout's exemplary (mobile-first)
|
|
49
|
+
$__CNTRL_LAYOUT_WIDTH__: <%= ranges[0].exemplary %> !global;
|
|
50
|
+
}
|