@jbpark/live-editor 1.7.0 → 1.8.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-DxgO-X_f.mjs → ast-DiVN0l7x.mjs} +6 -2
- package/dist/ast-DiVN0l7x.mjs.map +1 -0
- package/dist/{document-kU_tXfS_.mjs → document-DJDRM79h.mjs} +54 -14
- package/dist/document-DJDRM79h.mjs.map +1 -0
- package/dist/index.mjs +14 -12
- package/dist/index.mjs.map +1 -1
- package/dist/utils/ast/index.mjs +2 -2
- package/dist/utils/index.mjs +2 -2
- package/dist/{utils-qt78kxvP.mjs → utils-D1tlgtgj.mjs} +4 -14
- package/dist/{utils-qt78kxvP.mjs.map → utils-D1tlgtgj.mjs.map} +1 -1
- package/package.json +3 -3
- package/dist/ast-DxgO-X_f.mjs.map +0 -1
- package/dist/document-kU_tXfS_.mjs.map +0 -1
package/dist/utils/ast/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-
|
|
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-DJDRM79h.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-DiVN0l7x.mjs";
|
|
3
3
|
|
|
4
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.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
1
|
+
import "../document-DJDRM79h.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-D1tlgtgj.mjs";
|
|
3
3
|
|
|
4
4
|
export { baseModules, clearCompilationCache, cn, compile, detectTypeScript, extractSections, generateSection, generateSections, getCachedScriptBlob, preloadScripts, replaceSections, transformCode };
|
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-DJDRM79h.mjs";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import * as Babel from "@babel/standalone";
|
|
4
4
|
import * as ui from "@jbpark/ui-kit";
|
|
@@ -1922,19 +1922,9 @@ const baseModules = {
|
|
|
1922
1922
|
"ui-kit/utils": utils
|
|
1923
1923
|
};
|
|
1924
1924
|
const compilationCache = createBoundedCache(CONFIG.CACHE_LIMIT);
|
|
1925
|
-
const simpleHash = (str) => {
|
|
1926
|
-
let hash = 0;
|
|
1927
|
-
if (str.length === 0) return "0";
|
|
1928
|
-
for (let i = 0; i < str.length; i++) {
|
|
1929
|
-
const char = str.charCodeAt(i);
|
|
1930
|
-
hash = (hash << 5) - hash + char;
|
|
1931
|
-
hash = hash & hash;
|
|
1932
|
-
}
|
|
1933
|
-
return Math.abs(hash).toString(36);
|
|
1934
|
-
};
|
|
1935
1925
|
const createCacheKey = (code, modules) => {
|
|
1936
1926
|
const moduleKeys = Object.keys(modules).sort().join(",");
|
|
1937
|
-
return
|
|
1927
|
+
return code + "|" + moduleKeys;
|
|
1938
1928
|
};
|
|
1939
1929
|
const compile = (code, modules) => {
|
|
1940
1930
|
const cacheKey = createCacheKey(code, modules);
|
|
@@ -2020,7 +2010,7 @@ const generateSection = (code, fullCode) => {
|
|
|
2020
2010
|
const generateSections = (codes, fullCode) => {
|
|
2021
2011
|
return generateSectionPreviews(fullCode, codes);
|
|
2022
2012
|
};
|
|
2023
|
-
const scriptCache = createBoundedCache(CONFIG.
|
|
2013
|
+
const scriptCache = createBoundedCache(CONFIG.SCRIPT_CACHE_LIMIT, (_src, blobUrl) => URL.revokeObjectURL(blobUrl));
|
|
2024
2014
|
const loadingScriptCache = /* @__PURE__ */ new Map();
|
|
2025
2015
|
const getCachedScriptBlob = async (src) => {
|
|
2026
2016
|
const cached = scriptCache.get(src);
|
|
@@ -2043,4 +2033,4 @@ const preloadScripts = (scripts) => {
|
|
|
2043
2033
|
|
|
2044
2034
|
//#endregion
|
|
2045
2035
|
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-
|
|
2036
|
+
//# sourceMappingURL=utils-D1tlgtgj.mjs.map
|