@jbpark/live-editor 1.5.0 → 1.7.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-DyDLUN5F.mjs → ast-DxgO-X_f.mjs} +122 -93
- package/dist/ast-DxgO-X_f.mjs.map +1 -0
- package/dist/{document-BGG0pNR2.mjs → document-kU_tXfS_.mjs} +73 -76
- package/dist/document-kU_tXfS_.mjs.map +1 -0
- package/dist/index.mjs +23 -19
- package/dist/index.mjs.map +1 -1
- package/dist/utils/ast/index.d.mts +3 -1
- package/dist/utils/ast/index.mjs +3 -3
- package/dist/utils/index.d.mts +2 -1
- package/dist/utils/index.mjs +3 -3
- package/dist/{utils-UTqUJaVs.mjs → utils-qt78kxvP.mjs} +6 -3
- package/dist/{utils-UTqUJaVs.mjs.map → utils-qt78kxvP.mjs.map} +1 -1
- package/package.json +2 -1
- package/dist/ast-DyDLUN5F.mjs.map +0 -1
- package/dist/document-BGG0pNR2.mjs.map +0 -1
|
@@ -1613,6 +1613,7 @@ declare function clearExtractCache(): void;
|
|
|
1613
1613
|
//#endregion
|
|
1614
1614
|
//#region src/utils/ast/document.d.ts
|
|
1615
1615
|
interface DocumentTree {
|
|
1616
|
+
code: string;
|
|
1616
1617
|
ast: File;
|
|
1617
1618
|
container: JSXElement;
|
|
1618
1619
|
}
|
|
@@ -1622,6 +1623,7 @@ declare const getSections: (doc: DocumentTree) => Section[];
|
|
|
1622
1623
|
declare const generateDocumentCode: (doc: DocumentTree) => string;
|
|
1623
1624
|
declare const replaceDocumentSections: (fullCode: string, sectionCodes: string[]) => string;
|
|
1624
1625
|
declare const generateSectionPreview: (fullCode: string, sectionCode: string) => string;
|
|
1626
|
+
declare const generateSectionPreviews: (fullCode: string, sectionCodes: string[]) => string[];
|
|
1625
1627
|
//#endregion
|
|
1626
1628
|
//#region src/utils/ast/update.d.ts
|
|
1627
1629
|
interface UpdateResult {
|
|
@@ -1647,5 +1649,5 @@ interface ValidationResult {
|
|
|
1647
1649
|
}
|
|
1648
1650
|
declare const validateBindingValue: (binding: BindingItem, value: unknown) => ValidationResult;
|
|
1649
1651
|
//#endregion
|
|
1650
|
-
export { type BindingItem, type BindingOption, type BindingRenderLeaf, type BindingRenderMap, type BindingType, type DataAttrNode, type DocumentTree, type EditableNodeValueType, type ExtractedNodeValue, type NodeValueType, type ValidationResult, arrayExpressionToCode, bulkUpdate, clearDocumentParseCache, clearExtractCache, clone, createNodeFromValue, extract, extractNodeValue, extractObjectProperties, fillIds, findEditableChildren, generateCode, generateDocumentCode, generateSectionPreview, getCurrentValue, getSections, parseArrayExpression, parseBinding, parseDocument, parseValue, replaceDocumentSections, replaceIds, update, validateBindingValue };
|
|
1652
|
+
export { type BindingItem, type BindingOption, type BindingRenderLeaf, type BindingRenderMap, type BindingType, type DataAttrNode, type DocumentTree, type EditableNodeValueType, type ExtractedNodeValue, type NodeValueType, type ValidationResult, 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 };
|
|
1651
1653
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/utils/ast/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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 } from "../../ast-
|
|
1
|
+
import { a as getSections, i as generateSectionPreviews, n as generateDocumentCode, o as parseDocument, r as generateSectionPreview, s as replaceDocumentSections, t as clearDocumentParseCache } from "../../document-kU_tXfS_.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-DxgO-X_f.mjs";
|
|
3
3
|
|
|
4
|
-
export { arrayExpressionToCode, bulkUpdate, clearDocumentParseCache, clearExtractCache, clone, createNodeFromValue, extract, extractNodeValue, extractObjectProperties, fillIds, findEditableChildren, generateCode, generateDocumentCode, generateSectionPreview, getCurrentValue, getSections, parseArrayExpression, parseBinding, parseDocument, parseValue, replaceDocumentSections, replaceIds, update, validateBindingValue };
|
|
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 };
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -20,8 +20,9 @@ declare const detectTypeScript: (code: string) => boolean;
|
|
|
20
20
|
declare const extractSections: (code: string) => Section[];
|
|
21
21
|
declare const replaceSections: (code: string, sections: string[]) => string;
|
|
22
22
|
declare const generateSection: (code: string, fullCode: string) => string;
|
|
23
|
+
declare const generateSections: (codes: string[], fullCode: string) => string[];
|
|
23
24
|
declare const getCachedScriptBlob: (src: string) => Promise<string>;
|
|
24
25
|
declare const preloadScripts: (scripts: string[]) => void;
|
|
25
26
|
//#endregion
|
|
26
|
-
export { baseModules, clearCompilationCache, cn, compile, detectTypeScript, extractSections, generateSection, getCachedScriptBlob, preloadScripts, replaceSections, transformCode };
|
|
27
|
+
export { baseModules, clearCompilationCache, cn, compile, detectTypeScript, extractSections, generateSection, generateSections, getCachedScriptBlob, preloadScripts, replaceSections, transformCode };
|
|
27
28
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../document-
|
|
2
|
-
import { a as detectTypeScript, c as
|
|
1
|
+
import "../document-kU_tXfS_.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-qt78kxvP.mjs";
|
|
3
3
|
|
|
4
|
-
export { baseModules, clearCompilationCache, cn, compile, detectTypeScript, extractSections, generateSection, getCachedScriptBlob, preloadScripts, replaceSections, transformCode };
|
|
4
|
+
export { baseModules, clearCompilationCache, cn, compile, detectTypeScript, extractSections, generateSection, generateSections, getCachedScriptBlob, preloadScripts, replaceSections, transformCode };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as getSections, c as createBoundedCache, i as generateSectionPreviews, m as CONFIG, o as parseDocument, r as generateSectionPreview, s as replaceDocumentSections, v as REGEX, y as TS_PATTERNS } from "./document-kU_tXfS_.mjs";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import * as Babel from "@babel/standalone";
|
|
4
4
|
import * as ui from "@jbpark/ui-kit";
|
|
@@ -2017,6 +2017,9 @@ const replaceSections = (code, sections) => {
|
|
|
2017
2017
|
const generateSection = (code, fullCode) => {
|
|
2018
2018
|
return generateSectionPreview(fullCode, code);
|
|
2019
2019
|
};
|
|
2020
|
+
const generateSections = (codes, fullCode) => {
|
|
2021
|
+
return generateSectionPreviews(fullCode, codes);
|
|
2022
|
+
};
|
|
2020
2023
|
const scriptCache = createBoundedCache(CONFIG.CACHE_LIMIT, (_src, blobUrl) => URL.revokeObjectURL(blobUrl));
|
|
2021
2024
|
const loadingScriptCache = /* @__PURE__ */ new Map();
|
|
2022
2025
|
const getCachedScriptBlob = async (src) => {
|
|
@@ -2039,5 +2042,5 @@ const preloadScripts = (scripts) => {
|
|
|
2039
2042
|
};
|
|
2040
2043
|
|
|
2041
2044
|
//#endregion
|
|
2042
|
-
export { detectTypeScript as a,
|
|
2043
|
-
//# sourceMappingURL=utils-
|
|
2045
|
+
export { detectTypeScript as a, generateSections as c, replaceSections as d, transformCode as f, compile as i, getCachedScriptBlob as l, clearCompilationCache as n, extractSections as o, cn as r, generateSection as s, baseModules as t, preloadScripts as u };
|
|
2046
|
+
//# sourceMappingURL=utils-qt78kxvP.mjs.map
|