@jbpark/live-editor 1.10.0 → 1.12.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/{ast-DiVN0l7x.mjs → ast-9E8pNi7j.mjs} +44 -41
- package/dist/ast-9E8pNi7j.mjs.map +1 -0
- package/dist/document-BVWq-dmf.d.mts +1520 -0
- package/dist/{document-DJDRM79h.mjs → document-DocoSXLT.mjs} +2970 -3088
- package/dist/document-DocoSXLT.mjs.map +1 -0
- package/dist/{index-DdSjzvA3.d.mts → index-C8h8TcIl.d.mts} +1 -1
- package/dist/index.d.mts +22 -149
- package/dist/index.mjs +812 -511
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +782 -0
- package/dist/tailwind-CzPhj3D9.mjs +36 -0
- package/dist/tailwind-CzPhj3D9.mjs.map +1 -0
- package/dist/utils/ast/index.d.mts +4 -1519
- package/dist/utils/ast/index.mjs +3 -4
- package/dist/utils/index.d.mts +3 -3
- package/dist/utils/index.mjs +3 -4
- package/dist/utils/tailwind/index.mjs +1 -36
- package/dist/{utils-D1tlgtgj.mjs → utils-DP9WPbBJ.mjs} +1505 -18
- package/dist/utils-DP9WPbBJ.mjs.map +1 -0
- package/package.json +44 -43
- package/dist/ast-DiVN0l7x.mjs.map +0 -1
- package/dist/document-DJDRM79h.mjs.map +0 -1
- package/dist/index.css +0 -77
- package/dist/index.css.map +0 -1
- package/dist/utils/tailwind/index.mjs.map +0 -1
- package/dist/utils-D1tlgtgj.mjs.map +0 -1
package/dist/utils/ast/index.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { _ as parseArrayExpression, a as bulkUpdate, c as extract, d as getCurrentValue, f as parseBinding, g as extractObjectProperties, h as extractNodeValue, i as replaceIds, m as createNodeFromValue, n as clone, o as update, p as arrayExpressionToCode, r as fillIds, s as clearExtractCache, t as validateBindingValue, u as findEditableChildren, v as parseValue, y as generateCode } from "../../ast-
|
|
3
|
-
|
|
4
|
-
export { arrayExpressionToCode, bulkUpdate, clearDocumentParseCache, clearExtractCache, clone, createNodeFromValue, extract, extractNodeValue, extractObjectProperties, fillIds, findEditableChildren, generateCode, generateDocumentCode, generateSectionPreview, generateSectionPreviews, getCurrentValue, getSections, parseArrayExpression, parseBinding, parseDocument, parseValue, replaceDocumentSections, replaceIds, update, validateBindingValue };
|
|
1
|
+
import { a as generateSectionPreviews, c as replaceDocumentSections, i as generateSectionPreview, n as createSectionPreviewCache, o as getSections, r as generateDocumentCode, s as parseDocument, t as clearDocumentParseCache } from "../../document-DocoSXLT.mjs";
|
|
2
|
+
import { _ as parseArrayExpression, a as bulkUpdate, c as extract, d as getCurrentValue, f as parseBinding, g as extractObjectProperties, h as extractNodeValue, i as replaceIds, m as createNodeFromValue, n as clone, o as update, p as arrayExpressionToCode, r as fillIds, s as clearExtractCache, t as validateBindingValue, u as findEditableChildren, v as parseValue, y as generateCode } from "../../ast-9E8pNi7j.mjs";
|
|
3
|
+
export { arrayExpressionToCode, bulkUpdate, clearDocumentParseCache, clearExtractCache, clone, createNodeFromValue, createSectionPreviewCache, extract, extractNodeValue, extractObjectProperties, fillIds, findEditableChildren, generateCode, generateDocumentCode, generateSectionPreview, generateSectionPreviews, getCurrentValue, getSections, parseArrayExpression, parseBinding, parseDocument, parseValue, replaceDocumentSections, replaceIds, update, validateBindingValue };
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as Section, t as Module } from "../index-
|
|
1
|
+
import { n as Section, t as Module } from "../index-C8h8TcIl.mjs";
|
|
2
|
+
import { i as createSectionPreviewCache, n as SectionPreviewCache } from "../document-BVWq-dmf.mjs";
|
|
2
3
|
import * as ui from "@jbpark/ui-kit";
|
|
3
4
|
import * as utils from "@jbpark/ui-kit/utils";
|
|
4
|
-
|
|
5
5
|
//#region node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/clsx.d.mts
|
|
6
6
|
type ClassValue = ClassArray | ClassDictionary | string | number | bigint | null | boolean | undefined;
|
|
7
7
|
type ClassDictionary = Record<string, any>;
|
|
@@ -24,5 +24,5 @@ declare const generateSections: (codes: string[], fullCode: string) => string[];
|
|
|
24
24
|
declare const getCachedScriptBlob: (src: string) => Promise<string>;
|
|
25
25
|
declare const preloadScripts: (scripts: string[]) => void;
|
|
26
26
|
//#endregion
|
|
27
|
-
export { baseModules, clearCompilationCache, cn, compile, detectTypeScript, extractSections, generateSection, generateSections, getCachedScriptBlob, preloadScripts, replaceSections, transformCode };
|
|
27
|
+
export { type SectionPreviewCache, baseModules, clearCompilationCache, cn, compile, createSectionPreviewCache, detectTypeScript, extractSections, generateSection, generateSections, getCachedScriptBlob, preloadScripts, replaceSections, transformCode };
|
|
28
28
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "../document-
|
|
2
|
-
import { a as detectTypeScript, c as generateSections, d as replaceSections, f as transformCode, i as compile, l as getCachedScriptBlob, n as clearCompilationCache, o as extractSections, r as cn, s as generateSection, t as baseModules, u as preloadScripts } from "../utils-
|
|
3
|
-
|
|
4
|
-
export { baseModules, clearCompilationCache, cn, compile, detectTypeScript, extractSections, generateSection, generateSections, getCachedScriptBlob, preloadScripts, replaceSections, transformCode };
|
|
1
|
+
import { n as createSectionPreviewCache } from "../document-DocoSXLT.mjs";
|
|
2
|
+
import { a as detectTypeScript, c as generateSections, d as replaceSections, f as transformCode, i as compile, l as getCachedScriptBlob, n as clearCompilationCache, o as extractSections, r as cn, s as generateSection, t as baseModules, u as preloadScripts } from "../utils-DP9WPbBJ.mjs";
|
|
3
|
+
export { baseModules, clearCompilationCache, cn, compile, createSectionPreviewCache, detectTypeScript, extractSections, generateSection, generateSections, getCachedScriptBlob, preloadScripts, replaceSections, transformCode };
|
|
@@ -1,37 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/utils/tailwind/index.ts
|
|
4
|
-
const extractClasses = (code) => {
|
|
5
|
-
const classes = /* @__PURE__ */ new Set();
|
|
6
|
-
const cnPattern = /cn\(([^)]*(?:\([^)]*\)[^)]*)*)\)/gs;
|
|
7
|
-
let cnMatch;
|
|
8
|
-
while ((cnMatch = cnPattern.exec(code)) !== null) {
|
|
9
|
-
const cnContent = cnMatch[1];
|
|
10
|
-
const stringPattern = /['"`]([^'"`]+)['"`]/g;
|
|
11
|
-
let strMatch;
|
|
12
|
-
while ((strMatch = stringPattern.exec(cnContent)) !== null) strMatch[1].split(/\s+/).forEach((cls) => {
|
|
13
|
-
if (cls.trim()) classes.add(cls.trim());
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
for (const pattern of [/className=["']([^"']+)["']/g, /className=\{["'`]([^"'`]+)["'`]\}/g]) {
|
|
17
|
-
let match;
|
|
18
|
-
while ((match = pattern.exec(code)) !== null) match[1].split(/\s+/).forEach((cls) => {
|
|
19
|
-
if (cls.trim()) classes.add(cls.trim());
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
const conditionalPattern = /&&\s*['"`]([^'"`]+)['"`]/g;
|
|
23
|
-
let condMatch;
|
|
24
|
-
while ((condMatch = conditionalPattern.exec(code)) !== null) condMatch[1].split(/\s+/).forEach((cls) => {
|
|
25
|
-
if (cls.trim()) classes.add(cls.trim());
|
|
26
|
-
});
|
|
27
|
-
return Array.from(classes);
|
|
28
|
-
};
|
|
29
|
-
const generateTailwindCSS = async (code) => {
|
|
30
|
-
const classes = extractClasses(code);
|
|
31
|
-
if (classes.length === 0) return "";
|
|
32
|
-
return (await compile(`@tailwind utilities;`)).build(classes);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
//#endregion
|
|
1
|
+
import { t as generateTailwindCSS } from "../../tailwind-CzPhj3D9.mjs";
|
|
36
2
|
export { generateTailwindCSS };
|
|
37
|
-
//# sourceMappingURL=index.mjs.map
|