@tailor-cms/ce-embed-manifest 0.0.9 → 2.0.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/dist/index.cjs CHANGED
@@ -1,55 +1,30 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name2 in all)
7
- __defProp(target, name2, { get: all[name2], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/index.ts
20
- var src_exports = {};
21
- __export(src_exports, {
22
- default: () => src_default,
23
- initState: () => initState,
24
- name: () => name,
25
- type: () => type,
26
- version: () => version
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
27
4
  });
28
- module.exports = __toCommonJS(src_exports);
29
- var type = "EMBED";
30
- var name = "Embed";
31
- var initState = () => ({ height: 260 });
32
- var version = "1.0";
33
- var ui = {
34
- // Display icon, https://pictogrammers.com/library/mdi/
35
- icon: "mdi-application-brackets",
36
- // Does element support only full width or can be used within layouts
37
- // (e.g. 50/50 layout)
38
- forceFullWidth: false
5
+ //#region src/index.ts
6
+ const type = "EMBED";
7
+ const name = "Embed";
8
+ const initState = () => ({ height: 260 });
9
+ const version = "1.0";
10
+ const ui = {
11
+ icon: "mdi-application-brackets",
12
+ forceFullWidth: false
39
13
  };
40
- var manifest = {
41
- type,
42
- version: "1.0",
43
- name,
44
- ssr: false,
45
- initState,
46
- ui
14
+ const isEmpty = (data) => !data.url;
15
+ const manifest = {
16
+ type,
17
+ version: "1.0",
18
+ name,
19
+ ssr: false,
20
+ initState,
21
+ isEmpty,
22
+ ui
47
23
  };
48
- var src_default = manifest;
49
- // Annotate the CommonJS export names for ESM import in node:
50
- 0 && (module.exports = {
51
- initState,
52
- name,
53
- type,
54
- version
55
- });
24
+ //#endregion
25
+ exports.default = manifest;
26
+ exports.initState = initState;
27
+ exports.isEmpty = isEmpty;
28
+ exports.name = name;
29
+ exports.type = type;
30
+ exports.version = version;
package/dist/index.d.cts CHANGED
@@ -1,56 +1,20 @@
1
- interface ElementData {
2
- url?: string;
3
- height: number;
4
- }
5
- interface Element {
6
- id: number;
7
- uid: string;
8
- activityId: number;
9
- repositoryId: number;
10
- contentId: string;
11
- contentSignature: string;
12
- type: string;
13
- position: number;
14
- data: ElementData;
15
- meta: {
16
- [key: string]: unknown;
17
- };
18
- refs: {
19
- [key: string]: unknown;
20
- };
21
- linked: boolean;
22
- detached: boolean;
23
- createdAt: string;
24
- updatedAt: string;
25
- deletedAt: string | null;
26
- }
27
- type DataInitializer = () => ElementData;
28
- interface ElementManifest {
29
- type: string;
30
- version: string;
31
- name: string;
32
- ssr: boolean;
33
- initState: DataInitializer;
34
- Edit?: object;
35
- TopToolbar?: object;
36
- SideToolbar?: object;
37
- Display?: object;
38
- ui: {
39
- icon: string;
40
- forceFullWidth: boolean;
41
- };
42
- mocks?: {
43
- displayContexts: Array<{
44
- name: string;
45
- data: any;
46
- }>;
47
- };
48
- }
1
+ import * as common from "@tailor-cms/cek-common";
49
2
 
3
+ //#region src/interfaces.d.ts
4
+ interface ElementData extends common.ElementConfig {
5
+ url?: string;
6
+ height: number;
7
+ }
8
+ type DataInitializer = common.DataInitializer<ElementData>;
9
+ type Element = common.Element<ElementData>;
10
+ type ElementManifest = common.ElementManifest<ElementData>;
11
+ //#endregion
12
+ //#region src/index.d.ts
50
13
  declare const type = "EMBED";
51
14
  declare const name = "Embed";
52
15
  declare const initState: DataInitializer;
53
16
  declare const version = "1.0";
17
+ declare const isEmpty: (data: ElementData) => boolean;
54
18
  declare const manifest: ElementManifest;
55
-
56
- export { type DataInitializer, type Element, type ElementData, type ElementManifest, manifest as default, initState, name, type, version };
19
+ //#endregion
20
+ export { DataInitializer, Element, ElementData, ElementManifest, manifest as default, initState, isEmpty, name, type, version };
@@ -0,0 +1,20 @@
1
+ import * as common from "@tailor-cms/cek-common";
2
+
3
+ //#region src/interfaces.d.ts
4
+ interface ElementData extends common.ElementConfig {
5
+ url?: string;
6
+ height: number;
7
+ }
8
+ type DataInitializer = common.DataInitializer<ElementData>;
9
+ type Element = common.Element<ElementData>;
10
+ type ElementManifest = common.ElementManifest<ElementData>;
11
+ //#endregion
12
+ //#region src/index.d.ts
13
+ declare const type = "EMBED";
14
+ declare const name = "Embed";
15
+ declare const initState: DataInitializer;
16
+ declare const version = "1.0";
17
+ declare const isEmpty: (data: ElementData) => boolean;
18
+ declare const manifest: ElementManifest;
19
+ //#endregion
20
+ export { DataInitializer, Element, ElementData, ElementManifest, manifest as default, initState, isEmpty, name, type, version };
package/dist/index.mjs ADDED
@@ -0,0 +1,21 @@
1
+ //#region src/index.ts
2
+ const type = "EMBED";
3
+ const name = "Embed";
4
+ const initState = () => ({ height: 260 });
5
+ const version = "1.0";
6
+ const ui = {
7
+ icon: "mdi-application-brackets",
8
+ forceFullWidth: false
9
+ };
10
+ const isEmpty = (data) => !data.url;
11
+ const manifest = {
12
+ type,
13
+ version: "1.0",
14
+ name,
15
+ ssr: false,
16
+ initState,
17
+ isEmpty,
18
+ ui
19
+ };
20
+ //#endregion
21
+ export { manifest as default, initState, isEmpty, name, type, version };
package/package.json CHANGED
@@ -3,47 +3,46 @@
3
3
  "description": "Tailor CMS embed element manifest",
4
4
  "author": "Studion <info@gostudion.com> (https://github.com/tailor-cms)",
5
5
  "type": "module",
6
- "version": "0.0.9",
6
+ "version": "2.0.0",
7
7
  "exports": {
8
8
  ".": {
9
- "import": "./dist/index.js",
9
+ "import": "./dist/index.mjs",
10
10
  "require": "./dist/index.cjs"
11
11
  }
12
12
  },
13
13
  "main": "./dist/index.cjs",
14
- "types": "./dist/index.d.ts",
14
+ "types": "./dist/index.d.mts",
15
15
  "files": [
16
16
  "dist"
17
17
  ],
18
+ "dependencies": {
19
+ "@tailor-cms/cek-common": "2.0.1"
20
+ },
18
21
  "devDependencies": {
19
- "@tailor-cms/eslint-config": "0.0.2",
20
- "tsup": "^7.2.0",
21
- "typescript": "^5.1.6"
22
+ "@tailor-cms/eslint-config": "2.0.1",
23
+ "tsdown": "^0.21.10",
24
+ "typescript": "^6.0.3"
22
25
  },
23
- "tsup": {
24
- "entry": [
25
- "src/index.ts"
26
- ],
27
- "target": [
28
- "node14",
29
- "es2022"
30
- ],
26
+ "tsdown": {
27
+ "target": "node24",
31
28
  "format": [
32
29
  "cjs",
33
30
  "esm"
34
- ],
35
- "bundle": true,
36
- "minify": false,
37
- "clean": false,
38
- "dts": true
31
+ ]
39
32
  },
40
33
  "publishConfig": {
41
34
  "access": "public"
42
35
  },
36
+ "engines": {
37
+ "node": ">=24"
38
+ },
43
39
  "scripts": {
44
- "dev": "tsup --watch",
45
- "build": "tsup",
46
- "lint": "eslint --ext .js,.ts .",
47
- "lint:fix": "pnpm lint --fix"
40
+ "dev": "tsdown --watch",
41
+ "build": "pnpm nuke:dist && tsdown",
42
+ "lint": "eslint .",
43
+ "lint:fix": "pnpm lint --fix",
44
+ "nuke": "pnpm dlx del-cli dist node_modules",
45
+ "nuke:dist": "pnpm dlx del-cli dist",
46
+ "prepublish": "pnpm build"
48
47
  }
49
48
  }
package/dist/index.d.ts DELETED
@@ -1,56 +0,0 @@
1
- interface ElementData {
2
- url?: string;
3
- height: number;
4
- }
5
- interface Element {
6
- id: number;
7
- uid: string;
8
- activityId: number;
9
- repositoryId: number;
10
- contentId: string;
11
- contentSignature: string;
12
- type: string;
13
- position: number;
14
- data: ElementData;
15
- meta: {
16
- [key: string]: unknown;
17
- };
18
- refs: {
19
- [key: string]: unknown;
20
- };
21
- linked: boolean;
22
- detached: boolean;
23
- createdAt: string;
24
- updatedAt: string;
25
- deletedAt: string | null;
26
- }
27
- type DataInitializer = () => ElementData;
28
- interface ElementManifest {
29
- type: string;
30
- version: string;
31
- name: string;
32
- ssr: boolean;
33
- initState: DataInitializer;
34
- Edit?: object;
35
- TopToolbar?: object;
36
- SideToolbar?: object;
37
- Display?: object;
38
- ui: {
39
- icon: string;
40
- forceFullWidth: boolean;
41
- };
42
- mocks?: {
43
- displayContexts: Array<{
44
- name: string;
45
- data: any;
46
- }>;
47
- };
48
- }
49
-
50
- declare const type = "EMBED";
51
- declare const name = "Embed";
52
- declare const initState: DataInitializer;
53
- declare const version = "1.0";
54
- declare const manifest: ElementManifest;
55
-
56
- export { type DataInitializer, type Element, type ElementData, type ElementManifest, manifest as default, initState, name, type, version };
package/dist/index.js DELETED
@@ -1,28 +0,0 @@
1
- // src/index.ts
2
- var type = "EMBED";
3
- var name = "Embed";
4
- var initState = () => ({ height: 260 });
5
- var version = "1.0";
6
- var ui = {
7
- // Display icon, https://pictogrammers.com/library/mdi/
8
- icon: "mdi-application-brackets",
9
- // Does element support only full width or can be used within layouts
10
- // (e.g. 50/50 layout)
11
- forceFullWidth: false
12
- };
13
- var manifest = {
14
- type,
15
- version: "1.0",
16
- name,
17
- ssr: false,
18
- initState,
19
- ui
20
- };
21
- var src_default = manifest;
22
- export {
23
- src_default as default,
24
- initState,
25
- name,
26
- type,
27
- version
28
- };