@jbpark/live-editor 1.13.0 → 1.15.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/README.ko.md +15 -16
- package/README.md +17 -16
- package/dist/context-DrqO0VVu.js +38 -0
- package/dist/context-DrqO0VVu.js.map +1 -0
- package/dist/core-B7igZRDs.js +11195 -0
- package/dist/core-B7igZRDs.js.map +1 -0
- package/dist/dnd/index.d.ts +2 -0
- package/dist/dnd/index.js +2 -0
- package/dist/dnd-BdNgmgYB.js +1717 -0
- package/dist/dnd-BdNgmgYB.js.map +1 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/index.js +3 -0
- package/dist/editor-DmgTeTcG.js +51 -0
- package/dist/editor-DmgTeTcG.js.map +1 -0
- package/dist/error/index.d.ts +2 -0
- package/dist/error/index.js +2 -0
- package/dist/error-DRMGumEj.js +168 -0
- package/dist/error-DRMGumEj.js.map +1 -0
- package/dist/frame-C11nuIBH.js +357 -0
- package/dist/frame-C11nuIBH.js.map +1 -0
- package/dist/index-BnncHZTt.d.ts +63 -0
- package/dist/index-C4TBkJBG.d.ts +37 -0
- package/dist/index-CCynrS6c.d.ts +52 -0
- package/dist/index-DpDU1IAw.d.ts +23 -0
- package/dist/index-lgHdCda5.d.ts +17 -0
- package/dist/index.d.ts +13 -185
- package/dist/index.js +8 -13599
- package/dist/index.js.map +1 -1
- package/dist/preview/index.d.ts +2 -0
- package/dist/preview/index.js +2 -0
- package/dist/preview-DkLLqgKE.js +113 -0
- package/dist/preview-DkLLqgKE.js.map +1 -0
- package/dist/provider/index.d.ts +8 -0
- package/dist/provider/index.js +2 -0
- package/dist/states-Ci1AvoQ9.js +18 -0
- package/dist/states-Ci1AvoQ9.js.map +1 -0
- package/dist/style.css +4231 -619
- package/dist/tailwind-CbjdLyVX.js +28 -0
- package/dist/tailwind-CbjdLyVX.js.map +1 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/tailwind/index.d.ts +2 -2
- package/dist/utils/tailwind/index.js +2 -2
- package/dist/{utils-B11t9ZYd.js → utils-BzfDKU6y.js} +10 -23
- package/dist/{utils-B11t9ZYd.js.map → utils-BzfDKU6y.js.map} +1 -1
- package/package.json +27 -15
- package/dist/tailwind-CzPhj3D9.js +0 -36
- package/dist/tailwind-CzPhj3D9.js.map +0 -1
package/package.json
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.
|
|
7
|
+
"version": "1.15.0",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"module": "./dist/index.js",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
|
+
"sideEffects": ["**/*.css"],
|
|
11
12
|
"description": "Interactive UI editor with real-time preview and drag-and-drop. Syncs canvas edits back to source code via AST transforms and renders the preview in an iframe for DOM/CSS isolation (not a security sandbox).",
|
|
12
13
|
"keywords": [
|
|
13
14
|
"live-editor",
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
],
|
|
27
28
|
"author": "jbpark",
|
|
28
29
|
"license": "MIT",
|
|
29
|
-
"homepage": "https://
|
|
30
|
+
"homepage": "https://live-editor-lab.vercel.app",
|
|
30
31
|
"repository": {
|
|
31
32
|
"type": "git",
|
|
32
33
|
"url": "git+https://github.com/pjb0811/live-editor.git"
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
},
|
|
37
38
|
"engines": {
|
|
38
39
|
"node": ">=20",
|
|
39
|
-
"pnpm": ">=
|
|
40
|
+
"pnpm": ">=10"
|
|
40
41
|
},
|
|
41
42
|
"packageManager": "pnpm@10.29.3",
|
|
42
43
|
"exports": {
|
|
@@ -44,6 +45,26 @@
|
|
|
44
45
|
"types": "./dist/index.d.ts",
|
|
45
46
|
"import": "./dist/index.js"
|
|
46
47
|
},
|
|
48
|
+
"./provider": {
|
|
49
|
+
"types": "./dist/provider/index.d.ts",
|
|
50
|
+
"import": "./dist/provider/index.js"
|
|
51
|
+
},
|
|
52
|
+
"./dnd": {
|
|
53
|
+
"types": "./dist/dnd/index.d.ts",
|
|
54
|
+
"import": "./dist/dnd/index.js"
|
|
55
|
+
},
|
|
56
|
+
"./editor": {
|
|
57
|
+
"types": "./dist/editor/index.d.ts",
|
|
58
|
+
"import": "./dist/editor/index.js"
|
|
59
|
+
},
|
|
60
|
+
"./preview": {
|
|
61
|
+
"types": "./dist/preview/index.d.ts",
|
|
62
|
+
"import": "./dist/preview/index.js"
|
|
63
|
+
},
|
|
64
|
+
"./error": {
|
|
65
|
+
"types": "./dist/error/index.d.ts",
|
|
66
|
+
"import": "./dist/error/index.js"
|
|
67
|
+
},
|
|
47
68
|
"./utils": {
|
|
48
69
|
"types": "./dist/utils/index.d.ts",
|
|
49
70
|
"import": "./dist/utils/index.js"
|
|
@@ -72,7 +93,6 @@
|
|
|
72
93
|
"test:watch": "vitest",
|
|
73
94
|
"bench": "vitest bench",
|
|
74
95
|
"preview": "vite preview",
|
|
75
|
-
"sync:draggable-items": "node scripts/sync-draggable-items.mjs",
|
|
76
96
|
"prepublishOnly": "pnpm build",
|
|
77
97
|
"prepare": "husky"
|
|
78
98
|
},
|
|
@@ -84,7 +104,7 @@
|
|
|
84
104
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
85
105
|
"@dnd-kit/sortable": "^10.0.0",
|
|
86
106
|
"@dnd-kit/utilities": "^3.2.2",
|
|
87
|
-
"@jbpark/ui-kit": "^5.
|
|
107
|
+
"@jbpark/ui-kit": "^5.4.1",
|
|
88
108
|
"@jbpark/use-hooks": "^4.0.1",
|
|
89
109
|
"@tailwindcss/vite": "^4.3.3",
|
|
90
110
|
"@tiptap/core": "^3.30.1",
|
|
@@ -94,16 +114,14 @@
|
|
|
94
114
|
"@uiw/codemirror-theme-vscode": "^4.25.11",
|
|
95
115
|
"@uiw/react-codemirror": "^4.25.11",
|
|
96
116
|
"lucide-react": "^1.31.0",
|
|
97
|
-
"
|
|
117
|
+
"prettier": "^3.9.6",
|
|
98
118
|
"tailwindcss": "^4.3.3",
|
|
99
119
|
"uuid": "^14.0.1",
|
|
100
120
|
"zod": "^4.4.3"
|
|
101
121
|
},
|
|
102
122
|
"peerDependencies": {
|
|
103
|
-
"prettier": "^3.8.0",
|
|
104
123
|
"react": ">=19.0.0",
|
|
105
|
-
"react-dom": ">=19.0.0"
|
|
106
|
-
"typescript": "~5.8.3"
|
|
124
|
+
"react-dom": ">=19.0.0"
|
|
107
125
|
},
|
|
108
126
|
"devDependencies": {
|
|
109
127
|
"@changesets/cli": "^3.0.0",
|
|
@@ -123,7 +141,6 @@
|
|
|
123
141
|
"globals": "^17.11.0",
|
|
124
142
|
"husky": "^9.1.7",
|
|
125
143
|
"lint-staged": "^17.3.0",
|
|
126
|
-
"prettier": "^3.9.6",
|
|
127
144
|
"prettier-plugin-classnames": "^0.10.4",
|
|
128
145
|
"prettier-plugin-merge": "^0.10.1",
|
|
129
146
|
"prettier-plugin-tailwindcss": "^0.8.1",
|
|
@@ -143,10 +160,5 @@
|
|
|
143
160
|
"bash -c 'pnpm lint'",
|
|
144
161
|
"bash -c 'tsc -b'"
|
|
145
162
|
]
|
|
146
|
-
},
|
|
147
|
-
"pnpm": {
|
|
148
|
-
"overrides": {
|
|
149
|
-
"@codemirror/state": "^6.7.1"
|
|
150
|
-
}
|
|
151
163
|
}
|
|
152
164
|
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { compile } from "tailwindcss";
|
|
2
|
-
//#region src/utils/tailwind/index.ts
|
|
3
|
-
const extractClasses = (code) => {
|
|
4
|
-
const classes = /* @__PURE__ */ new Set();
|
|
5
|
-
const cnPattern = /cn\(([^)]*(?:\([^)]*\)[^)]*)*)\)/gs;
|
|
6
|
-
let cnMatch;
|
|
7
|
-
while ((cnMatch = cnPattern.exec(code)) !== null) {
|
|
8
|
-
const cnContent = cnMatch[1];
|
|
9
|
-
const stringPattern = /['"`]([^'"`]+)['"`]/g;
|
|
10
|
-
let strMatch;
|
|
11
|
-
while ((strMatch = stringPattern.exec(cnContent)) !== null) strMatch[1].split(/\s+/).forEach((cls) => {
|
|
12
|
-
if (cls.trim()) classes.add(cls.trim());
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
for (const pattern of [/className=["']([^"']+)["']/g, /className=\{["'`]([^"'`]+)["'`]\}/g]) {
|
|
16
|
-
let match;
|
|
17
|
-
while ((match = pattern.exec(code)) !== null) match[1].split(/\s+/).forEach((cls) => {
|
|
18
|
-
if (cls.trim()) classes.add(cls.trim());
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
const conditionalPattern = /&&\s*['"`]([^'"`]+)['"`]/g;
|
|
22
|
-
let condMatch;
|
|
23
|
-
while ((condMatch = conditionalPattern.exec(code)) !== null) condMatch[1].split(/\s+/).forEach((cls) => {
|
|
24
|
-
if (cls.trim()) classes.add(cls.trim());
|
|
25
|
-
});
|
|
26
|
-
return Array.from(classes);
|
|
27
|
-
};
|
|
28
|
-
const generateTailwindCSS = async (code) => {
|
|
29
|
-
const classes = extractClasses(code);
|
|
30
|
-
if (classes.length === 0) return "";
|
|
31
|
-
return (await compile(`@tailwind utilities;`)).build(classes);
|
|
32
|
-
};
|
|
33
|
-
//#endregion
|
|
34
|
-
export { generateTailwindCSS as t };
|
|
35
|
-
|
|
36
|
-
//# sourceMappingURL=tailwind-CzPhj3D9.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind-CzPhj3D9.js","names":[],"sources":["../src/utils/tailwind/index.ts"],"sourcesContent":["import { compile } from 'tailwindcss';\n\nconst extractClasses = (code: string): string[] => {\n const classes = new Set<string>();\n\n const cnPattern = /cn\\(([^)]*(?:\\([^)]*\\)[^)]*)*)\\)/gs;\n let cnMatch;\n\n while ((cnMatch = cnPattern.exec(code)) !== null) {\n const cnContent = cnMatch[1];\n\n const stringPattern = /['\"`]([^'\"`]+)['\"`]/g;\n let strMatch;\n\n while ((strMatch = stringPattern.exec(cnContent!)) !== null) {\n strMatch[1]!.split(/\\s+/).forEach(cls => {\n if (cls.trim()) classes.add(cls.trim());\n });\n }\n }\n\n const classNamePatterns = [\n /className=[\"']([^\"']+)[\"']/g,\n /className=\\{[\"'`]([^\"'`]+)[\"'`]\\}/g,\n ];\n\n for (const pattern of classNamePatterns) {\n let match;\n while ((match = pattern.exec(code)) !== null) {\n match[1]!.split(/\\s+/).forEach(cls => {\n if (cls.trim()) classes.add(cls.trim());\n });\n }\n }\n\n const conditionalPattern = /&&\\s*['\"`]([^'\"`]+)['\"`]/g;\n let condMatch;\n\n while ((condMatch = conditionalPattern.exec(code)) !== null) {\n condMatch[1]!.split(/\\s+/).forEach(cls => {\n if (cls.trim()) classes.add(cls.trim());\n });\n }\n\n return Array.from(classes);\n};\n\nexport const generateTailwindCSS = async (code: string): Promise<string> => {\n const classes = extractClasses(code);\n\n if (classes.length === 0) {\n return '';\n }\n\n const compiler = await compile(`@tailwind utilities;`);\n const css = compiler.build(classes);\n\n return css;\n};\n"],"mappings":";;AAEA,MAAM,kBAAkB,SAA2B;CACjD,MAAM,0BAAU,IAAI,IAAY;CAEhC,MAAM,YAAY;CAClB,IAAI;CAEJ,QAAQ,UAAU,UAAU,KAAK,IAAI,OAAO,MAAM;EAChD,MAAM,YAAY,QAAQ;EAE1B,MAAM,gBAAgB;EACtB,IAAI;EAEJ,QAAQ,WAAW,cAAc,KAAK,SAAU,OAAO,MACrD,SAAS,EAAE,CAAE,MAAM,KAAK,CAAC,CAAC,SAAQ,QAAO;GACvC,IAAI,IAAI,KAAK,GAAG,QAAQ,IAAI,IAAI,KAAK,CAAC;EACxC,CAAC;CAEL;CAOA,KAAK,MAAM,WAAW,CAJpB,+BACA,oCAGoC,GAAG;EACvC,IAAI;EACJ,QAAQ,QAAQ,QAAQ,KAAK,IAAI,OAAO,MACtC,MAAM,EAAE,CAAE,MAAM,KAAK,CAAC,CAAC,SAAQ,QAAO;GACpC,IAAI,IAAI,KAAK,GAAG,QAAQ,IAAI,IAAI,KAAK,CAAC;EACxC,CAAC;CAEL;CAEA,MAAM,qBAAqB;CAC3B,IAAI;CAEJ,QAAQ,YAAY,mBAAmB,KAAK,IAAI,OAAO,MACrD,UAAU,EAAE,CAAE,MAAM,KAAK,CAAC,CAAC,SAAQ,QAAO;EACxC,IAAI,IAAI,KAAK,GAAG,QAAQ,IAAI,IAAI,KAAK,CAAC;CACxC,CAAC;CAGH,OAAO,MAAM,KAAK,OAAO;AAC3B;AAEA,MAAa,sBAAsB,OAAO,SAAkC;CAC1E,MAAM,UAAU,eAAe,IAAI;CAEnC,IAAI,QAAQ,WAAW,GACrB,OAAO;CAMT,QAFY,MADW,QAAQ,sBAAsB,EAAA,CAChC,MAAM,OAElB;AACX"}
|