@tailor-cms/ce-html-raw-manifest 0.0.2 → 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 +49 -62
- package/dist/index.d.cts +10 -13
- package/dist/index.d.mts +21 -0
- package/dist/index.mjs +43 -0
- package/package.json +17 -22
- package/dist/index.d.ts +0 -24
- package/dist/index.js +0 -38
package/dist/index.cjs
CHANGED
|
@@ -1,66 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
default: () => index_default,
|
|
23
|
-
initState: () => initState,
|
|
24
|
-
mocks: () => mocks,
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// Display icon, https://pictogrammers.com/library/mdi/
|
|
38
|
-
icon: "mdi-code-tags",
|
|
39
|
-
// Does element support only full width or can be used within layouts
|
|
40
|
-
// (e.g. 50/50 layout)
|
|
41
|
-
forceFullWidth: true
|
|
5
|
+
//#region src/index.ts
|
|
6
|
+
const type = "HTML_RAW";
|
|
7
|
+
const name = "Raw HTML";
|
|
8
|
+
const initState = () => ({ content: "" });
|
|
9
|
+
const version = "1.0";
|
|
10
|
+
const ui = {
|
|
11
|
+
icon: "mdi-code-tags",
|
|
12
|
+
forceFullWidth: true
|
|
42
13
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
14
|
+
const ai = {
|
|
15
|
+
Schema: {
|
|
16
|
+
type: "json_schema",
|
|
17
|
+
name: "ce_html_raw",
|
|
18
|
+
schema: {
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: { content: { type: "string" } },
|
|
21
|
+
required: ["content"],
|
|
22
|
+
additionalProperties: false
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
getPrompt: () => `
|
|
26
|
+
Generate a raw HTML snippet as an object with the following properties:
|
|
27
|
+
{ "content": "" }
|
|
28
|
+
where:
|
|
29
|
+
- 'content' is a self-contained HTML snippet intended to be rendered inside
|
|
30
|
+
a sandboxed iframe. Do not include <style> tags, inline style attributes,
|
|
31
|
+
or <html>/<head>/<body> wrappers.
|
|
32
|
+
`,
|
|
33
|
+
processResponse: (val) => val
|
|
48
34
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
35
|
+
const isEmpty = (data) => !data.content;
|
|
36
|
+
const manifest = {
|
|
37
|
+
type,
|
|
38
|
+
version: "1.0",
|
|
39
|
+
name,
|
|
40
|
+
ssr: false,
|
|
41
|
+
initState,
|
|
42
|
+
isEmpty,
|
|
43
|
+
ui,
|
|
44
|
+
ai
|
|
57
45
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
});
|
|
46
|
+
//#endregion
|
|
47
|
+
exports.ai = ai;
|
|
48
|
+
exports.default = manifest;
|
|
49
|
+
exports.initState = initState;
|
|
50
|
+
exports.isEmpty = isEmpty;
|
|
51
|
+
exports.name = name;
|
|
52
|
+
exports.type = type;
|
|
53
|
+
exports.version = version;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
import * as common from
|
|
1
|
+
import * as common from "@tailor-cms/cek-common";
|
|
2
|
+
import { AiConfig } from "@tailor-cms/cek-common";
|
|
2
3
|
|
|
4
|
+
//#region src/interfaces.d.ts
|
|
3
5
|
interface ElementData extends common.ElementConfig {
|
|
4
|
-
|
|
6
|
+
content: string;
|
|
5
7
|
}
|
|
6
8
|
type DataInitializer = common.DataInitializer<ElementData>;
|
|
7
9
|
type Element = common.Element<ElementData>;
|
|
8
10
|
type ElementManifest = common.ElementManifest<ElementData>;
|
|
9
|
-
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/index.d.ts
|
|
10
13
|
declare const type = "HTML_RAW";
|
|
11
14
|
declare const name = "Raw HTML";
|
|
12
15
|
declare const initState: DataInitializer;
|
|
13
16
|
declare const version = "1.0";
|
|
14
|
-
declare const
|
|
15
|
-
|
|
16
|
-
name: string;
|
|
17
|
-
data: {
|
|
18
|
-
state: string;
|
|
19
|
-
};
|
|
20
|
-
}[];
|
|
21
|
-
};
|
|
17
|
+
declare const ai: AiConfig;
|
|
18
|
+
declare const isEmpty: (data: ElementData) => boolean;
|
|
22
19
|
declare const manifest: ElementManifest;
|
|
23
|
-
|
|
24
|
-
export {
|
|
20
|
+
//#endregion
|
|
21
|
+
export { DataInitializer, Element, ElementData, ElementManifest, ai, manifest as default, initState, isEmpty, name, type, version };
|
package/dist/index.d.mts
ADDED
|
@@ -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
|
+
content: string;
|
|
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 = "HTML_RAW";
|
|
14
|
+
declare const name = "Raw HTML";
|
|
15
|
+
declare const initState: DataInitializer;
|
|
16
|
+
declare const version = "1.0";
|
|
17
|
+
declare const ai: AiConfig;
|
|
18
|
+
declare const isEmpty: (data: ElementData) => boolean;
|
|
19
|
+
declare const manifest: ElementManifest;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { DataInitializer, Element, ElementData, ElementManifest, ai, manifest as default, initState, isEmpty, name, type, version };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//#region src/index.ts
|
|
2
|
+
const type = "HTML_RAW";
|
|
3
|
+
const name = "Raw HTML";
|
|
4
|
+
const initState = () => ({ content: "" });
|
|
5
|
+
const version = "1.0";
|
|
6
|
+
const ui = {
|
|
7
|
+
icon: "mdi-code-tags",
|
|
8
|
+
forceFullWidth: true
|
|
9
|
+
};
|
|
10
|
+
const ai = {
|
|
11
|
+
Schema: {
|
|
12
|
+
type: "json_schema",
|
|
13
|
+
name: "ce_html_raw",
|
|
14
|
+
schema: {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: { content: { type: "string" } },
|
|
17
|
+
required: ["content"],
|
|
18
|
+
additionalProperties: false
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
getPrompt: () => `
|
|
22
|
+
Generate a raw HTML snippet as an object with the following properties:
|
|
23
|
+
{ "content": "" }
|
|
24
|
+
where:
|
|
25
|
+
- 'content' is a self-contained HTML snippet intended to be rendered inside
|
|
26
|
+
a sandboxed iframe. Do not include <style> tags, inline style attributes,
|
|
27
|
+
or <html>/<head>/<body> wrappers.
|
|
28
|
+
`,
|
|
29
|
+
processResponse: (val) => val
|
|
30
|
+
};
|
|
31
|
+
const isEmpty = (data) => !data.content;
|
|
32
|
+
const manifest = {
|
|
33
|
+
type,
|
|
34
|
+
version: "1.0",
|
|
35
|
+
name,
|
|
36
|
+
ssr: false,
|
|
37
|
+
initState,
|
|
38
|
+
isEmpty,
|
|
39
|
+
ui,
|
|
40
|
+
ai
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { ai, manifest as default, initState, isEmpty, name, type, version };
|
package/package.json
CHANGED
|
@@ -3,47 +3,42 @@
|
|
|
3
3
|
"description": "Raw HTML editor component manifest",
|
|
4
4
|
"author": "Studion <info@gostudion.com> (https://github.com/tailor-cms)",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"version": "0.0
|
|
6
|
+
"version": "2.0.0",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"import": "./dist/index.
|
|
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.
|
|
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/
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"typescript": "^5.8.3"
|
|
22
|
+
"@tailor-cms/eslint-config": "2.0.1",
|
|
23
|
+
"tsdown": "^0.21.10",
|
|
24
|
+
"typescript": "^6.0.3"
|
|
23
25
|
},
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"src/index.ts"
|
|
27
|
-
],
|
|
28
|
-
"target": [
|
|
29
|
-
"node14",
|
|
30
|
-
"es2022"
|
|
31
|
-
],
|
|
26
|
+
"tsdown": {
|
|
27
|
+
"target": "node24",
|
|
32
28
|
"format": [
|
|
33
29
|
"cjs",
|
|
34
30
|
"esm"
|
|
35
|
-
]
|
|
36
|
-
"bundle": true,
|
|
37
|
-
"minify": false,
|
|
38
|
-
"clean": false,
|
|
39
|
-
"dts": true
|
|
31
|
+
]
|
|
40
32
|
},
|
|
41
33
|
"publishConfig": {
|
|
42
34
|
"access": "public"
|
|
43
35
|
},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=24"
|
|
38
|
+
},
|
|
44
39
|
"scripts": {
|
|
45
|
-
"dev": "
|
|
46
|
-
"build": "pnpm nuke:dist &&
|
|
40
|
+
"dev": "tsdown --watch",
|
|
41
|
+
"build": "pnpm nuke:dist && tsdown",
|
|
47
42
|
"lint": "eslint .",
|
|
48
43
|
"lint:fix": "pnpm lint --fix",
|
|
49
44
|
"nuke": "pnpm dlx del-cli dist node_modules",
|
package/dist/index.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as common from '@tailor-cms/cek-common';
|
|
2
|
-
|
|
3
|
-
interface ElementData extends common.ElementConfig {
|
|
4
|
-
content: string;
|
|
5
|
-
}
|
|
6
|
-
type DataInitializer = common.DataInitializer<ElementData>;
|
|
7
|
-
type Element = common.Element<ElementData>;
|
|
8
|
-
type ElementManifest = common.ElementManifest<ElementData>;
|
|
9
|
-
|
|
10
|
-
declare const type = "HTML_RAW";
|
|
11
|
-
declare const name = "Raw HTML";
|
|
12
|
-
declare const initState: DataInitializer;
|
|
13
|
-
declare const version = "1.0";
|
|
14
|
-
declare const mocks: {
|
|
15
|
-
displayContexts: {
|
|
16
|
-
name: string;
|
|
17
|
-
data: {
|
|
18
|
-
state: string;
|
|
19
|
-
};
|
|
20
|
-
}[];
|
|
21
|
-
};
|
|
22
|
-
declare const manifest: ElementManifest;
|
|
23
|
-
|
|
24
|
-
export { type DataInitializer, type Element, type ElementData, type ElementManifest, manifest as default, initState, mocks, name, type, version };
|
package/dist/index.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// src/index.ts
|
|
2
|
-
var type = "HTML_RAW";
|
|
3
|
-
var name = "Raw HTML";
|
|
4
|
-
var initState = () => ({
|
|
5
|
-
content: ""
|
|
6
|
-
});
|
|
7
|
-
var version = "1.0";
|
|
8
|
-
var ui = {
|
|
9
|
-
// Display icon, https://pictogrammers.com/library/mdi/
|
|
10
|
-
icon: "mdi-code-tags",
|
|
11
|
-
// Does element support only full width or can be used within layouts
|
|
12
|
-
// (e.g. 50/50 layout)
|
|
13
|
-
forceFullWidth: true
|
|
14
|
-
};
|
|
15
|
-
var mocks = {
|
|
16
|
-
displayContexts: [
|
|
17
|
-
{ name: "Test preset 1", data: { state: "I have a value" } },
|
|
18
|
-
{ name: "Test preset 2", data: { state: "I have a different value" } }
|
|
19
|
-
]
|
|
20
|
-
};
|
|
21
|
-
var manifest = {
|
|
22
|
-
type,
|
|
23
|
-
version: "1.0",
|
|
24
|
-
name,
|
|
25
|
-
ssr: false,
|
|
26
|
-
initState,
|
|
27
|
-
ui,
|
|
28
|
-
mocks
|
|
29
|
-
};
|
|
30
|
-
var index_default = manifest;
|
|
31
|
-
export {
|
|
32
|
-
index_default as default,
|
|
33
|
-
initState,
|
|
34
|
-
mocks,
|
|
35
|
-
name,
|
|
36
|
-
type,
|
|
37
|
-
version
|
|
38
|
-
};
|