@jbpark/live-editor 1.11.0 → 1.13.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.
@@ -1,5 +1,4 @@
1
1
  import { compile } from "tailwindcss";
2
-
3
2
  //#region src/utils/tailwind/index.ts
4
3
  const extractClasses = (code) => {
5
4
  const classes = /* @__PURE__ */ new Set();
@@ -31,7 +30,7 @@ const generateTailwindCSS = async (code) => {
31
30
  if (classes.length === 0) return "";
32
31
  return (await compile(`@tailwind utilities;`)).build(classes);
33
32
  };
34
-
35
33
  //#endregion
36
- export { generateTailwindCSS };
37
- //# sourceMappingURL=index.mjs.map
34
+ export { generateTailwindCSS as t };
35
+
36
+ //# sourceMappingURL=tailwind-CzPhj3D9.js.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,3 @@
1
+ import { a as generateDocumentCode, c as getSections, i as createSectionPreviewCache, l as parseDocument, n as SectionPreviewCache, o as generateSectionPreview, r as clearDocumentParseCache, s as generateSectionPreviews, t as DocumentTree, u as replaceDocumentSections } from "../../document-DXOwpvWM.js";
2
+ import { C as BindingRenderMap, D as ExtractedNodeValue, E as EditableNodeValueType, O as NodeValueType, S as BindingRenderLeaf, T as DataAttrNode, _ as findEditableChildren, a as replaceIds, b as BindingItem, c as clearExtractCache, d as arrayExpressionToCode, f as createNodeFromValue, g as parseValue, h as parseArrayExpression, i as fillIds, l as extract, m as extractObjectProperties, n as validateBindingValue, o as bulkUpdate, p as extractNodeValue, r as clone, s as update, t as ValidationResult, u as generateCode, v as getCurrentValue, w as BindingType, x as BindingOption, y as parseBinding } from "../../index-BVjSMVya.js";
3
+ export { type BindingItem, type BindingOption, type BindingRenderLeaf, type BindingRenderMap, type BindingType, type DataAttrNode, type DocumentTree, type EditableNodeValueType, type ExtractedNodeValue, type NodeValueType, type SectionPreviewCache, type ValidationResult, 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 };
@@ -1,4 +1,3 @@
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-CBw2uF_P.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-C0FNDLFQ.mjs";
3
-
4
- 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 };
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-CSIscFpL.js";
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-Dq1EfxA5.js";
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 };
@@ -1,8 +1,6 @@
1
- import { n as Section, t as Module } from "../index-DdSjzvA3.mjs";
2
- import { i as createSectionPreviewCache, n as SectionPreviewCache } from "../document-DqLm4Vqi.mjs";
1
+ import { _ as Section, g as Module, i as createSectionPreviewCache, n as SectionPreviewCache } from "../document-DXOwpvWM.js";
3
2
  import * as ui from "@jbpark/ui-kit";
4
3
  import * as utils from "@jbpark/ui-kit/utils";
5
-
6
4
  //#region node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/clsx.d.mts
7
5
  type ClassValue = ClassArray | ClassDictionary | string | number | bigint | null | boolean | undefined;
8
6
  type ClassDictionary = Record<string, any>;
@@ -26,4 +24,4 @@ declare const getCachedScriptBlob: (src: string) => Promise<string>;
26
24
  declare const preloadScripts: (scripts: string[]) => void;
27
25
  //#endregion
28
26
  export { type SectionPreviewCache, baseModules, clearCompilationCache, cn, compile, createSectionPreviewCache, detectTypeScript, extractSections, generateSection, generateSections, getCachedScriptBlob, preloadScripts, replaceSections, transformCode };
29
- //# sourceMappingURL=index.d.mts.map
27
+ //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,3 @@
1
- import { n as createSectionPreviewCache } from "../document-CBw2uF_P.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-BjYg1Sh8.mjs";
3
-
4
- export { baseModules, clearCompilationCache, cn, compile, createSectionPreviewCache, detectTypeScript, extractSections, generateSection, generateSections, getCachedScriptBlob, preloadScripts, replaceSections, transformCode };
1
+ import { n as createSectionPreviewCache } from "../document-CSIscFpL.js";
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-B11t9ZYd.js";
3
+ export { baseModules, clearCompilationCache, cn, compile, createSectionPreviewCache, detectTypeScript, extractSections, generateSection, generateSections, getCachedScriptBlob, preloadScripts, replaceSections, transformCode };
@@ -2,4 +2,4 @@
2
2
  declare const generateTailwindCSS: (code: string) => Promise<string>;
3
3
  //#endregion
4
4
  export { generateTailwindCSS };
5
- //# sourceMappingURL=index.d.mts.map
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ import { t as generateTailwindCSS } from "../../tailwind-CzPhj3D9.js";
2
+ export { generateTailwindCSS };