@tailor-cms/ce-modal-manifest 0.1.0 → 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,62 +1,35 @@
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 index_exports = {};
21
- __export(index_exports, {
22
- ai: () => ai,
23
- default: () => index_default,
24
- initState: () => initState,
25
- name: () => name,
26
- type: () => type,
27
- version: () => version
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
28
4
  });
29
- module.exports = __toCommonJS(index_exports);
30
- var import_uuid = require("uuid");
31
- var type = "MODAL";
32
- var name = "Modal";
33
- var initState = () => ({
34
- title: null,
35
- embeds: {}
5
+ let uuid = require("uuid");
6
+ //#region src/index.ts
7
+ const type = "MODAL";
8
+ const name = "Modal";
9
+ const initState = () => ({
10
+ title: null,
11
+ embeds: {}
36
12
  });
37
- var version = "1.0";
38
- var ui = {
39
- // Display icon, https://pictogrammers.com/library/mdi/
40
- icon: "mdi-window-restore",
41
- // Does element support only full width or can be used within layouts
42
- // (e.g. 50/50 layout)
43
- forceFullWidth: false
13
+ const version = "1.0";
14
+ const ui = {
15
+ icon: "mdi-window-restore",
16
+ forceFullWidth: false
44
17
  };
45
- var ai = {
46
- Schema: {
47
- type: "json_schema",
48
- name: "ce_modal",
49
- schema: {
50
- type: "object",
51
- properties: {
52
- title: { type: "string" },
53
- content: { type: "string" }
54
- },
55
- required: ["title", "content"],
56
- additionalProperties: false
57
- }
58
- },
59
- getPrompt: () => `
18
+ const ai = {
19
+ Schema: {
20
+ type: "json_schema",
21
+ name: "ce_modal",
22
+ schema: {
23
+ type: "object",
24
+ properties: {
25
+ title: { type: "string" },
26
+ content: { type: "string" }
27
+ },
28
+ required: ["title", "content"],
29
+ additionalProperties: false
30
+ }
31
+ },
32
+ getPrompt: () => `
60
33
  Generate a modal content element as an object with the following
61
34
  properties:
62
35
  {
@@ -68,37 +41,35 @@ var ai = {
68
41
  - 'content' is the text to be displayed in the modal. Create few
69
42
  paragraphs about the topic.
70
43
  `,
71
- processResponse: (val) => {
72
- const embedId = (0, import_uuid.v4)();
73
- const embed = {
74
- id: embedId,
75
- data: { content: val.content },
76
- embedded: true,
77
- position: 1,
78
- type: "TIPTAP_HTML"
79
- };
80
- return {
81
- title: val.title,
82
- embeds: { [embedId]: embed }
83
- };
84
- }
44
+ processResponse: (val) => {
45
+ const embedId = (0, uuid.v4)();
46
+ const embed = {
47
+ id: embedId,
48
+ data: { content: val.content },
49
+ embedded: true,
50
+ position: 1,
51
+ type: "TIPTAP_HTML"
52
+ };
53
+ return {
54
+ title: val.title,
55
+ embeds: { [embedId]: embed }
56
+ };
57
+ }
85
58
  };
86
- var manifest = {
87
- type,
88
- version: "1.0",
89
- name,
90
- ssr: false,
91
- isComposite: true,
92
- initState,
93
- ui,
94
- ai
59
+ const manifest = {
60
+ type,
61
+ version: "1.0",
62
+ name,
63
+ ssr: false,
64
+ isComposite: true,
65
+ initState,
66
+ ui,
67
+ ai
95
68
  };
96
- var index_default = manifest;
97
- // Annotate the CommonJS export names for ESM import in node:
98
- 0 && (module.exports = {
99
- ai,
100
- initState,
101
- name,
102
- type,
103
- version
104
- });
69
+ //#endregion
70
+ exports.ai = ai;
71
+ exports.default = manifest;
72
+ exports.initState = initState;
73
+ exports.name = name;
74
+ exports.type = type;
75
+ exports.version = version;
package/dist/index.d.cts CHANGED
@@ -1,36 +1,21 @@
1
- import * as common from '@tailor-cms/cek-common';
2
- import { OpenAISchema } from '@tailor-cms/cek-common';
1
+ import * as common from "@tailor-cms/cek-common";
2
+ import { AiConfig } from "@tailor-cms/cek-common";
3
3
 
4
+ //#region src/interfaces.d.ts
4
5
  interface ElementData extends common.ElementConfig {
5
- title: string | null;
6
- embeds: Record<string, any>;
6
+ title: string | null;
7
+ embeds: Record<string, any>;
7
8
  }
8
9
  type DataInitializer = common.DataInitializer<ElementData>;
9
10
  type Element = common.Element<ElementData>;
10
11
  type ElementManifest = common.ElementManifest<ElementData>;
11
-
12
+ //#endregion
13
+ //#region src/index.d.ts
12
14
  declare const type = "MODAL";
13
15
  declare const name = "Modal";
14
16
  declare const initState: DataInitializer;
15
17
  declare const version = "1.0";
16
- declare const ai: {
17
- Schema: OpenAISchema;
18
- getPrompt: () => string;
19
- processResponse: (val: any) => {
20
- title: any;
21
- embeds: {
22
- [x: string]: {
23
- id: string;
24
- data: {
25
- content: any;
26
- };
27
- embedded: boolean;
28
- position: number;
29
- type: string;
30
- };
31
- };
32
- };
33
- };
18
+ declare const ai: AiConfig;
34
19
  declare const manifest: ElementManifest;
35
-
36
- export { type DataInitializer, type Element, type ElementData, type ElementManifest, ai, manifest as default, initState, name, type, version };
20
+ //#endregion
21
+ export { DataInitializer, Element, ElementData, ElementManifest, ai, manifest as default, initState, name, type, version };
@@ -0,0 +1,21 @@
1
+ import * as common from "@tailor-cms/cek-common";
2
+ import { AiConfig } from "@tailor-cms/cek-common";
3
+
4
+ //#region src/interfaces.d.ts
5
+ interface ElementData extends common.ElementConfig {
6
+ title: string | null;
7
+ embeds: Record<string, any>;
8
+ }
9
+ type DataInitializer = common.DataInitializer<ElementData>;
10
+ type Element = common.Element<ElementData>;
11
+ type ElementManifest = common.ElementManifest<ElementData>;
12
+ //#endregion
13
+ //#region src/index.d.ts
14
+ declare const type = "MODAL";
15
+ declare const name = "Modal";
16
+ declare const initState: DataInitializer;
17
+ declare const version = "1.0";
18
+ declare const ai: AiConfig;
19
+ declare const manifest: ElementManifest;
20
+ //#endregion
21
+ export { DataInitializer, Element, ElementData, ElementManifest, ai, manifest as default, initState, name, type, version };
package/dist/index.mjs ADDED
@@ -0,0 +1,66 @@
1
+ import { v4 } from "uuid";
2
+ //#region src/index.ts
3
+ const type = "MODAL";
4
+ const name = "Modal";
5
+ const initState = () => ({
6
+ title: null,
7
+ embeds: {}
8
+ });
9
+ const version = "1.0";
10
+ const ui = {
11
+ icon: "mdi-window-restore",
12
+ forceFullWidth: false
13
+ };
14
+ const ai = {
15
+ Schema: {
16
+ type: "json_schema",
17
+ name: "ce_modal",
18
+ schema: {
19
+ type: "object",
20
+ properties: {
21
+ title: { type: "string" },
22
+ content: { type: "string" }
23
+ },
24
+ required: ["title", "content"],
25
+ additionalProperties: false
26
+ }
27
+ },
28
+ getPrompt: () => `
29
+ Generate a modal content element as an object with the following
30
+ properties:
31
+ {
32
+ "title": "",
33
+ "content": "",
34
+ }
35
+ where:
36
+ - 'title' is the title of the modal. Do not use more than 3 words.
37
+ - 'content' is the text to be displayed in the modal. Create few
38
+ paragraphs about the topic.
39
+ `,
40
+ processResponse: (val) => {
41
+ const embedId = v4();
42
+ const embed = {
43
+ id: embedId,
44
+ data: { content: val.content },
45
+ embedded: true,
46
+ position: 1,
47
+ type: "TIPTAP_HTML"
48
+ };
49
+ return {
50
+ title: val.title,
51
+ embeds: { [embedId]: embed }
52
+ };
53
+ }
54
+ };
55
+ const manifest = {
56
+ type,
57
+ version: "1.0",
58
+ name,
59
+ ssr: false,
60
+ isComposite: true,
61
+ initState,
62
+ ui,
63
+ ai
64
+ };
65
+ //#endregion
66
+ export { ai, manifest as default, initState, name, type, version };
package/package.json CHANGED
@@ -3,50 +3,43 @@
3
3
  "description": "Tailor CMS modal manifest",
4
4
  "author": "Studion <info@gostudion.com> (https://github.com/tailor-cms)",
5
5
  "type": "module",
6
- "version": "0.1.0",
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
+ "uuid": "^14.0.0"
21
+ },
18
22
  "devDependencies": {
19
- "@tailor-cms/cek-common": "^1.3.2",
20
- "@tailor-cms/eslint-config": "1.1.2",
21
- "tsup": "^8.5.0",
22
- "typescript": "^5.8.3"
23
+ "@tailor-cms/eslint-config": "2.0.1",
24
+ "tsdown": "^0.21.10",
25
+ "typescript": "^6.0.3"
23
26
  },
24
- "tsup": {
25
- "entry": [
26
- "src/index.ts"
27
- ],
28
- "target": [
29
- "node14",
30
- "es2022"
31
- ],
27
+ "tsdown": {
28
+ "target": "node24",
32
29
  "format": [
33
30
  "cjs",
34
31
  "esm"
35
- ],
36
- "bundle": true,
37
- "minify": false,
38
- "clean": false,
39
- "dts": true
32
+ ]
40
33
  },
41
34
  "publishConfig": {
42
35
  "access": "public"
43
36
  },
44
- "dependencies": {
45
- "uuid": "^11.1.0"
37
+ "engines": {
38
+ "node": ">=24"
46
39
  },
47
40
  "scripts": {
48
- "dev": "tsup --watch",
49
- "build": "pnpm nuke:dist && tsup",
41
+ "dev": "tsdown --watch",
42
+ "build": "pnpm nuke:dist && tsdown",
50
43
  "lint": "eslint .",
51
44
  "lint:fix": "pnpm lint --fix",
52
45
  "nuke": "pnpm dlx del-cli dist node_modules",
package/dist/index.d.ts DELETED
@@ -1,36 +0,0 @@
1
- import * as common from '@tailor-cms/cek-common';
2
- import { OpenAISchema } from '@tailor-cms/cek-common';
3
-
4
- interface ElementData extends common.ElementConfig {
5
- title: string | null;
6
- embeds: Record<string, any>;
7
- }
8
- type DataInitializer = common.DataInitializer<ElementData>;
9
- type Element = common.Element<ElementData>;
10
- type ElementManifest = common.ElementManifest<ElementData>;
11
-
12
- declare const type = "MODAL";
13
- declare const name = "Modal";
14
- declare const initState: DataInitializer;
15
- declare const version = "1.0";
16
- declare const ai: {
17
- Schema: OpenAISchema;
18
- getPrompt: () => string;
19
- processResponse: (val: any) => {
20
- title: any;
21
- embeds: {
22
- [x: string]: {
23
- id: string;
24
- data: {
25
- content: any;
26
- };
27
- embedded: boolean;
28
- position: number;
29
- type: string;
30
- };
31
- };
32
- };
33
- };
34
- declare const manifest: ElementManifest;
35
-
36
- export { type DataInitializer, type Element, type ElementData, type ElementManifest, ai, manifest as default, initState, name, type, version };
package/dist/index.js DELETED
@@ -1,76 +0,0 @@
1
- // src/index.ts
2
- import { v4 as uuid } from "uuid";
3
- var type = "MODAL";
4
- var name = "Modal";
5
- var initState = () => ({
6
- title: null,
7
- embeds: {}
8
- });
9
- var version = "1.0";
10
- var ui = {
11
- // Display icon, https://pictogrammers.com/library/mdi/
12
- icon: "mdi-window-restore",
13
- // Does element support only full width or can be used within layouts
14
- // (e.g. 50/50 layout)
15
- forceFullWidth: false
16
- };
17
- var ai = {
18
- Schema: {
19
- type: "json_schema",
20
- name: "ce_modal",
21
- schema: {
22
- type: "object",
23
- properties: {
24
- title: { type: "string" },
25
- content: { type: "string" }
26
- },
27
- required: ["title", "content"],
28
- additionalProperties: false
29
- }
30
- },
31
- getPrompt: () => `
32
- Generate a modal content element as an object with the following
33
- properties:
34
- {
35
- "title": "",
36
- "content": "",
37
- }
38
- where:
39
- - 'title' is the title of the modal. Do not use more than 3 words.
40
- - 'content' is the text to be displayed in the modal. Create few
41
- paragraphs about the topic.
42
- `,
43
- processResponse: (val) => {
44
- const embedId = uuid();
45
- const embed = {
46
- id: embedId,
47
- data: { content: val.content },
48
- embedded: true,
49
- position: 1,
50
- type: "TIPTAP_HTML"
51
- };
52
- return {
53
- title: val.title,
54
- embeds: { [embedId]: embed }
55
- };
56
- }
57
- };
58
- var manifest = {
59
- type,
60
- version: "1.0",
61
- name,
62
- ssr: false,
63
- isComposite: true,
64
- initState,
65
- ui,
66
- ai
67
- };
68
- var index_default = manifest;
69
- export {
70
- ai,
71
- index_default as default,
72
- initState,
73
- name,
74
- type,
75
- version
76
- };