@cntrl-site/components 0.1.2 → 0.1.4-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.
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.
@@ -4,7 +4,7 @@ interface SliderProps {
4
4
  styles: SliderStyles;
5
5
  isEditor?: boolean;
6
6
  }
7
- export declare function ControlSlider({ settings, content, styles: sliderStyles, isEditor }: SliderProps): JSX.Element;
7
+ export declare function ControlSlider({ settings, content, styles: sliderStyles, isEditor }: SliderProps): import("react/jsx-runtime").JSX.Element;
8
8
  type SliderItem = {
9
9
  image: {
10
10
  url: string;
@@ -7,10 +7,6 @@ export declare const ControlImageRevealSliderComponent: {
7
7
  type: "video";
8
8
  url: string;
9
9
  };
10
- defaultSize: {
11
- width: number;
12
- height: number;
13
- };
14
10
  schema: {
15
11
  type: string;
16
12
  properties: {
@@ -175,9 +171,12 @@ export declare const ControlImageRevealSliderComponent: {
175
171
  display: {
176
172
  type: string;
177
173
  label: string;
178
- isObjectFitEditable: boolean;
179
- minWidth: number;
180
- maxWidth: number;
174
+ display: {
175
+ type: string;
176
+ isObjectFitEditable: boolean;
177
+ minWidth: number;
178
+ maxWidth: number;
179
+ };
181
180
  };
182
181
  properties: {
183
182
  url: {
@@ -199,8 +198,11 @@ export declare const ControlImageRevealSliderComponent: {
199
198
  type: string;
200
199
  label: string;
201
200
  placeholder: string;
202
- minWidth: number;
203
- maxWidth: number;
201
+ display: {
202
+ type: string;
203
+ minWidth: number;
204
+ maxWidth: number;
205
+ };
204
206
  };
205
207
  };
206
208
  };
@@ -34,5 +34,5 @@ type ImageRevealSliderItem = {
34
34
  };
35
35
  link: string;
36
36
  };
37
- export declare function ImageRevealSlider({ settings, content, isEditor }: ImageRevealSliderProps): JSX.Element;
37
+ export declare function ImageRevealSlider({ settings, content, isEditor }: ImageRevealSliderProps): import("react/jsx-runtime").JSX.Element;
38
38
  export {};
@@ -7,7 +7,7 @@ type LightboxGalleryProps = {
7
7
  activeEvent: 'close' | 'open';
8
8
  isEditor?: boolean;
9
9
  };
10
- export declare const LightboxGallery: ({ settings, content, styles, portalId, activeEvent, isEditor }: LightboxGalleryProps) => JSX.Element;
10
+ export declare const LightboxGallery: ({ settings, content, styles, portalId, activeEvent, isEditor }: LightboxGalleryProps) => import("react/jsx-runtime").JSX.Element;
11
11
  type LightboxImage = {
12
12
  image: {
13
13
  url: string;
package/dist/index.js CHANGED
@@ -1221,10 +1221,6 @@ const ControlImageRevealSliderComponent = {
1221
1221
  type: "video",
1222
1222
  url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7EQ3WSW43JG5YMC8B2HTPKT.mp4"
1223
1223
  },
1224
- defaultSize: {
1225
- width: 700,
1226
- height: 400
1227
- },
1228
1224
  schema: {
1229
1225
  type: "object",
1230
1226
  properties: {
@@ -1410,11 +1406,14 @@ const ControlImageRevealSliderComponent = {
1410
1406
  image: {
1411
1407
  type: "object",
1412
1408
  display: {
1413
- type: "media-input",
1409
+ type: "object",
1414
1410
  label: "Image",
1415
- isObjectFitEditable: false,
1416
- minWidth: 58,
1417
- maxWidth: 108
1411
+ display: {
1412
+ type: "media-input",
1413
+ isObjectFitEditable: false,
1414
+ minWidth: 58,
1415
+ maxWidth: 108
1416
+ }
1418
1417
  },
1419
1418
  properties: {
1420
1419
  url: {
@@ -1431,13 +1430,16 @@ const ControlImageRevealSliderComponent = {
1431
1430
  required: ["url", "name"]
1432
1431
  },
1433
1432
  link: {
1434
- type: "string",
1433
+ type: "object",
1435
1434
  display: {
1436
- type: "text-input",
1435
+ type: "object",
1437
1436
  label: "URL",
1438
1437
  placeholder: "Enter link...",
1439
- minWidth: 300,
1440
- maxWidth: 550
1438
+ display: {
1439
+ type: "text-input",
1440
+ minWidth: 300,
1441
+ maxWidth: 550
1442
+ }
1441
1443
  }
1442
1444
  }
1443
1445
  },
@@ -1944,10 +1946,6 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
1944
1946
  e.stopPropagation();
1945
1947
  return;
1946
1948
  }
1947
- const target = e.target;
1948
- if (target && (target.closest(`.${classes.thumbsContainer}`) || target.closest(`.${classes.thumbItem}`))) {
1949
- return;
1950
- }
1951
1949
  if (e.touches.length === 0 && e.changedTouches.length > 0) {
1952
1950
  const currentImage = content[currentIndex];
1953
1951
  const isCover = (currentImage == null ? void 0 : currentImage.image.objectFit) === "cover";
package/dist/index.mjs CHANGED
@@ -1219,10 +1219,6 @@ const ControlImageRevealSliderComponent = {
1219
1219
  type: "video",
1220
1220
  url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7EQ3WSW43JG5YMC8B2HTPKT.mp4"
1221
1221
  },
1222
- defaultSize: {
1223
- width: 700,
1224
- height: 400
1225
- },
1226
1222
  schema: {
1227
1223
  type: "object",
1228
1224
  properties: {
@@ -1408,11 +1404,14 @@ const ControlImageRevealSliderComponent = {
1408
1404
  image: {
1409
1405
  type: "object",
1410
1406
  display: {
1411
- type: "media-input",
1407
+ type: "object",
1412
1408
  label: "Image",
1413
- isObjectFitEditable: false,
1414
- minWidth: 58,
1415
- maxWidth: 108
1409
+ display: {
1410
+ type: "media-input",
1411
+ isObjectFitEditable: false,
1412
+ minWidth: 58,
1413
+ maxWidth: 108
1414
+ }
1416
1415
  },
1417
1416
  properties: {
1418
1417
  url: {
@@ -1429,13 +1428,16 @@ const ControlImageRevealSliderComponent = {
1429
1428
  required: ["url", "name"]
1430
1429
  },
1431
1430
  link: {
1432
- type: "string",
1431
+ type: "object",
1433
1432
  display: {
1434
- type: "text-input",
1433
+ type: "object",
1435
1434
  label: "URL",
1436
1435
  placeholder: "Enter link...",
1437
- minWidth: 300,
1438
- maxWidth: 550
1436
+ display: {
1437
+ type: "text-input",
1438
+ minWidth: 300,
1439
+ maxWidth: 550
1440
+ }
1439
1441
  }
1440
1442
  }
1441
1443
  },
@@ -1942,10 +1944,6 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
1942
1944
  e.stopPropagation();
1943
1945
  return;
1944
1946
  }
1945
- const target = e.target;
1946
- if (target && (target.closest(`.${classes.thumbsContainer}`) || target.closest(`.${classes.thumbItem}`))) {
1947
- return;
1948
- }
1949
1947
  if (e.touches.length === 0 && e.changedTouches.length > 0) {
1950
1948
  const currentImage = content[currentIndex];
1951
1949
  const isCover = (currentImage == null ? void 0 : currentImage.image.objectFit) === "cover";
@@ -3,9 +3,9 @@ export type Component = {
3
3
  element: (props: any) => React.ReactElement;
4
4
  id: string;
5
5
  name: string;
6
- defaultSize: {
7
- width: number;
8
- height: number;
6
+ defaultSize?: {
7
+ width?: number;
8
+ height?: number;
9
9
  };
10
10
  schema: any;
11
11
  preview?: {
package/package.json CHANGED
@@ -1,68 +1,68 @@
1
- {
2
- "name": "@cntrl-site/components",
3
- "version": "0.1.2",
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
- "./style/components.css": {
19
- "default": "./dist/components.css"
20
- }
21
- },
22
- "scripts": {
23
- "test": "jest",
24
- "dev": "vite development",
25
- "prebuild": "rimraf ./dist",
26
- "build": "vite build",
27
- "prepublishOnly": "cross-env NODE_ENV=production npm run build"
28
- },
29
- "files": [
30
- "dist",
31
- "resources"
32
- ],
33
- "repository": {
34
- "type": "git",
35
- "url": "git+https://github.com/cntrl-site/components.git"
36
- },
37
- "author": "arsen@momdesign.nyc",
38
- "license": "MIT",
39
- "bugs": {
40
- "url": "https://github.com/cntrl-site/components/issues"
41
- },
42
- "homepage": "https://github.com/cntrl-site/components#readme",
43
- "directories": {
44
- "lib": "dist"
45
- },
46
- "dependencies": {
47
- "@antfu/eslint-config": "^3.16.0",
48
- "@splidejs/react-splide": "^0.7.12",
49
- "classnames": "^2.5.1",
50
- "ts-node": "^10.9.1"
51
- },
52
- "devDependencies": {
53
- "@tsconfig/node16": "^1.0.3",
54
- "@tsconfig/recommended": "^1.0.1",
55
- "@types/node": "^18.11.7",
56
- "@types/react": "^18.2.0",
57
- "@types/react-dom": "^18.2.0",
58
- "@vitejs/plugin-react": "^4.3.4",
59
- "cross-env": "^10.1.0",
60
- "react": "^18.2.0",
61
- "react-dom": "^18.2.0",
62
- "rimraf": "^6.0.1",
63
- "sass": "^1.86.3",
64
- "typescript": "^5.2.2",
65
- "vite": "^6.2.5",
66
- "vite-plugin-dts": "^4.5.3"
67
- }
68
- }
1
+ {
2
+ "name": "@cntrl-site/components",
3
+ "version": "0.1.4-0",
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
+ "./style/components.css": {
19
+ "default": "./dist/components.css"
20
+ }
21
+ },
22
+ "scripts": {
23
+ "test": "jest",
24
+ "dev": "vite development",
25
+ "prebuild": "rimraf ./dist",
26
+ "build": "vite build",
27
+ "prepublishOnly": "cross-env NODE_ENV=production npm run build"
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "resources"
32
+ ],
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/cntrl-site/components.git"
36
+ },
37
+ "author": "arsen@momdesign.nyc",
38
+ "license": "MIT",
39
+ "bugs": {
40
+ "url": "https://github.com/cntrl-site/components/issues"
41
+ },
42
+ "homepage": "https://github.com/cntrl-site/components#readme",
43
+ "directories": {
44
+ "lib": "dist"
45
+ },
46
+ "dependencies": {
47
+ "@antfu/eslint-config": "^3.16.0",
48
+ "@splidejs/react-splide": "^0.7.12",
49
+ "classnames": "^2.5.1",
50
+ "ts-node": "^10.9.1"
51
+ },
52
+ "devDependencies": {
53
+ "@tsconfig/node16": "^1.0.3",
54
+ "@tsconfig/recommended": "^1.0.1",
55
+ "@types/node": "^18.11.7",
56
+ "@types/react": "^18.2.0",
57
+ "@types/react-dom": "^18.2.0",
58
+ "@vitejs/plugin-react": "^4.3.4",
59
+ "cross-env": "^10.1.0",
60
+ "react": "^18.2.0",
61
+ "react-dom": "^18.2.0",
62
+ "rimraf": "^6.0.1",
63
+ "sass": "^1.86.3",
64
+ "typescript": "^5.2.2",
65
+ "vite": "^6.2.5",
66
+ "vite-plugin-dts": "^4.5.3"
67
+ }
68
+ }