@edgex-fe/editor-preview 0.0.1
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/README.md +98 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +115 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/sanitizer-runtime.browser.d.ts +6 -0
- package/dist/internal/sanitizer-runtime.browser.js +205 -0
- package/dist/internal/sanitizer-runtime.browser.js.map +1 -0
- package/dist/internal/sanitizer-runtime.node.d.ts +6 -0
- package/dist/internal/sanitizer-runtime.node.js +228 -0
- package/dist/internal/sanitizer-runtime.node.js.map +1 -0
- package/dist/styles/editor-preview.css +778 -0
- package/dist/types-S5GYGk8H.d.ts +14 -0
- package/package.json +75 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type EditorHtml = string;
|
|
2
|
+
type EditorSanitizer = (html: EditorHtml) => EditorHtml;
|
|
3
|
+
type EditorClassName = string | false | null | undefined;
|
|
4
|
+
interface EditorRenderOptions {
|
|
5
|
+
className?: string;
|
|
6
|
+
sanitize?: EditorSanitizer | false;
|
|
7
|
+
}
|
|
8
|
+
interface EditorElement extends HTMLElement {
|
|
9
|
+
html: EditorHtml;
|
|
10
|
+
render(html?: EditorHtml): void;
|
|
11
|
+
clear(): void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type { EditorElement as E, EditorClassName as a, EditorHtml as b, EditorRenderOptions as c, EditorSanitizer as d };
|
package/package.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@edgex-fe/editor-preview",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Framework-agnostic EdgeX editor content preview renderer",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": "^20.19.0 || ^22.13.0 || >=24.0.0"
|
|
9
|
+
},
|
|
10
|
+
"main": "./src/index.ts",
|
|
11
|
+
"module": "./src/index.ts",
|
|
12
|
+
"types": "./src/index.ts",
|
|
13
|
+
"sideEffects": [
|
|
14
|
+
"**/*.css"
|
|
15
|
+
],
|
|
16
|
+
"exports": {
|
|
17
|
+
".": "./src/index.ts",
|
|
18
|
+
"./internal/sanitizer-runtime": {
|
|
19
|
+
"node": "./src/sanitizerRuntime.node.ts",
|
|
20
|
+
"default": "./src/sanitizerRuntime.browser.ts"
|
|
21
|
+
},
|
|
22
|
+
"./styles.css": "./src/styles/editor-preview.css",
|
|
23
|
+
"./styles/*": "./src/styles/*"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public",
|
|
30
|
+
"main": "./dist/index.js",
|
|
31
|
+
"module": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./internal/sanitizer-runtime": {
|
|
39
|
+
"node": {
|
|
40
|
+
"types": "./dist/internal/sanitizer-runtime.node.d.ts",
|
|
41
|
+
"import": "./dist/internal/sanitizer-runtime.node.js"
|
|
42
|
+
},
|
|
43
|
+
"default": {
|
|
44
|
+
"types": "./dist/internal/sanitizer-runtime.browser.d.ts",
|
|
45
|
+
"import": "./dist/internal/sanitizer-runtime.browser.js"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"./styles.css": "./dist/styles/editor-preview.css",
|
|
49
|
+
"./styles/*": "./dist/styles/*"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsup",
|
|
54
|
+
"check-types": "tsc --noEmit",
|
|
55
|
+
"lint": "eslint . --cache --cache-location node_modules/.cache/eslint/ --cache-strategy content --max-warnings 0",
|
|
56
|
+
"test": "vitest run",
|
|
57
|
+
"prepublishOnly": "pnpm build"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"dompurify": "3.4.11",
|
|
61
|
+
"hast-util-from-html": "2.0.3",
|
|
62
|
+
"hast-util-sanitize": "5.0.2",
|
|
63
|
+
"hast-util-to-html": "9.0.5",
|
|
64
|
+
"tslib": "^2.8.1"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@edgex/typescript-config": "workspace:*",
|
|
68
|
+
"@types/hast": "3.0.4",
|
|
69
|
+
"@types/jsdom": "^28.0.3",
|
|
70
|
+
"jsdom": "29.1.1",
|
|
71
|
+
"tsup": "^8.5.1",
|
|
72
|
+
"typescript": "5.8.2",
|
|
73
|
+
"vitest": "^4.0.15"
|
|
74
|
+
}
|
|
75
|
+
}
|