@jbpark/live-editor 4.6.1 → 5.0.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 +2 -2
- package/README.md +2 -2
- package/dist/{boundary-BLB80tyw.js → boundary-6_nTsWxP.js} +2 -2
- package/dist/{boundary-BLB80tyw.js.map → boundary-6_nTsWxP.js.map} +1 -1
- package/dist/{compile-Dxas-D05.js → compile-DwOyWrmI.js} +8 -7
- package/dist/compile-DwOyWrmI.js.map +1 -0
- package/dist/constants-D-XKuEY2.js +58 -0
- package/dist/constants-D-XKuEY2.js.map +1 -0
- package/dist/{context-B8MzP7_p.js → context-DDR1xVKo.js} +3 -3
- package/dist/{context-B8MzP7_p.js.map → context-DDR1xVKo.js.map} +1 -1
- package/dist/{core-Bgfek364.js → core-CKazr4tT.js} +2 -2
- package/dist/core-CKazr4tT.js.map +1 -0
- package/dist/{detect-typescript-Dr_oLniM.js → detect-typescript-CoAO-QUJ.js} +2 -2
- package/dist/{detect-typescript-Dr_oLniM.js.map → detect-typescript-CoAO-QUJ.js.map} +1 -1
- package/dist/dnd/index.d.ts +2 -2
- package/dist/dnd/index.js +2 -2
- package/dist/{dnd-V8NAxd_R.js → dnd-BlC1gqUy.js} +2558 -867
- package/dist/dnd-BlC1gqUy.js.map +1 -0
- package/dist/document-BQhb7YR8.d.ts +17 -0
- package/dist/{document-CHO215iP.js → document-DcwIEHRV.js} +189 -104
- package/dist/document-DcwIEHRV.js.map +1 -0
- package/dist/editor/index.js +2 -2
- package/dist/{editor-CMElfHer.js → editor-Bty5XzpV.js} +2 -2
- package/dist/{editor-CMElfHer.js.map → editor-Bty5XzpV.js.map} +1 -1
- package/dist/error/index.d.ts +1 -1
- package/dist/error/index.js +2 -2
- package/dist/{error-CN_GCnXB.js → error-DyYx2NQ2.js} +17 -31
- package/dist/error-DyYx2NQ2.js.map +1 -0
- package/dist/{index-CiWB0zFb.d.ts → index-0VB5C3Jk.d.ts} +28 -50
- package/dist/{index-DpDU1IAw.d.ts → index-92L7F440.d.ts} +2 -2
- package/dist/index-C8h8TcIl.d.ts +15 -0
- package/dist/{index-DQkL37eL.d.ts → index-Cl79M7ZJ.d.ts} +6 -4
- package/dist/{index-CRwEhJ7w.d.ts → index-kKUjo9lr.d.ts} +2 -2
- package/dist/{index-DrWtSKXu.d.ts → index-tAiuHZsC.d.ts} +2 -2
- package/dist/index.d.ts +9 -9
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/{messages-CSrMI4Rm.js → messages-Bt5WXKTE.js} +5 -2
- package/dist/messages-Bt5WXKTE.js.map +1 -0
- package/dist/{messages-IBPs4TkZ.d.ts → messages-Yb3b7YJt.d.ts} +5 -2
- package/dist/preview/index.d.ts +1 -1
- package/dist/preview/index.js +2 -2
- package/dist/{preview-CtyG5UbH.js → preview-DC0pyOdu.js} +4 -4
- package/dist/preview-DC0pyOdu.js.map +1 -0
- package/dist/provider/index.d.ts +2 -2
- package/dist/provider/index.js +2 -2
- package/dist/{sections-jYuqS4KB.js → sections-4uirsXRU.js} +4 -7
- package/dist/sections-4uirsXRU.js.map +1 -0
- package/dist/style.css +776 -346
- package/dist/{validate-DB59Z_Nx.d.ts → types-Czps1Txy.d.ts} +12 -28
- package/dist/update-2PJbwoS8.d.ts +68 -0
- package/dist/{items-BXXtMUNI.js → update-DNInQSM7.js} +143 -392
- package/dist/update-DNInQSM7.js.map +1 -0
- package/dist/{use-dynamic-tailwind-BP1toJkW.js → use-dynamic-tailwind-CSYKXDmX.js} +301 -273
- package/dist/use-dynamic-tailwind-CSYKXDmX.js.map +1 -0
- package/dist/utils/ast/index.d.ts +47 -4
- package/dist/utils/ast/index.js +4 -64
- package/dist/utils/ast/index.js.map +1 -1
- package/dist/utils/index.d.ts +13 -32
- package/dist/utils/index.js +4 -26
- package/dist/validate-CZz30Pnb.js +122 -0
- package/dist/validate-CZz30Pnb.js.map +1 -0
- package/dist/validate-CiA1LF6S.d.ts +33 -0
- package/package.json +9 -9
- package/dist/compile-Dxas-D05.js.map +0 -1
- package/dist/constants-DU17Tdwo.js +0 -1459
- package/dist/constants-DU17Tdwo.js.map +0 -1
- package/dist/core-Bgfek364.js.map +0 -1
- package/dist/dnd-V8NAxd_R.js.map +0 -1
- package/dist/document-CHO215iP.js.map +0 -1
- package/dist/document-DqRSCtsx.d.ts +0 -1614
- package/dist/error-CN_GCnXB.js.map +0 -1
- package/dist/index-C_PfR4X9.d.ts +0 -734
- package/dist/items-BXXtMUNI.js.map +0 -1
- package/dist/messages-CSrMI4Rm.js.map +0 -1
- package/dist/preview-CtyG5UbH.js.map +0 -1
- package/dist/sections-jYuqS4KB.js.map +0 -1
- package/dist/use-dynamic-tailwind-BP1toJkW.js.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/validate-iLo8IONY.js +0 -64
- package/dist/validate-iLo8IONY.js.map +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/utils/ast/document.d.ts
|
|
2
|
+
interface DocumentOptions {
|
|
3
|
+
containerId?: string;
|
|
4
|
+
}
|
|
5
|
+
interface SectionOptions extends DocumentOptions {
|
|
6
|
+
sectionNameFallback?: (index: number) => string;
|
|
7
|
+
}
|
|
8
|
+
type DocumentProblem = {
|
|
9
|
+
reason: 'parse-error';
|
|
10
|
+
error: unknown;
|
|
11
|
+
} | {
|
|
12
|
+
reason: 'container-not-found';
|
|
13
|
+
containerId: string;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { DocumentProblem as n, SectionOptions as r, DocumentOptions as t };
|
|
17
|
+
//# sourceMappingURL=document-BQhb7YR8.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as DEFAULT_CONTAINER_ID, n as CONFIG, r as DATA_ATTR
|
|
1
|
+
import { i as DEFAULT_CONTAINER_ID, n as CONFIG, r as DATA_ATTR } from "./constants-D-XKuEY2.js";
|
|
2
2
|
import { n as registerEditorCache } from "./editor-caches-ClMvdcQF.js";
|
|
3
3
|
import { t as createBoundedCache } from "./cache-B0-XcIxJ.js";
|
|
4
4
|
//#region \0rolldown/runtime.js
|
|
@@ -33,7 +33,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
enumerable: true
|
|
34
34
|
}) : target, mod));
|
|
35
35
|
//#endregion
|
|
36
|
-
//#region node_modules/.pnpm/@babel+parser@8.0.
|
|
36
|
+
//#region node_modules/.pnpm/@babel+parser@8.0.7/node_modules/@babel/parser/lib/index.js
|
|
37
37
|
var Position = class {
|
|
38
38
|
constructor(line, col, index) {
|
|
39
39
|
this.line = void 0;
|
|
@@ -8102,7 +8102,11 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8102
8102
|
if (isDeclaration) node.id = this.parseFunctionId(requireId);
|
|
8103
8103
|
this.scope.enter(514);
|
|
8104
8104
|
this.prodParam.enter(functionFlags(isAsync, node.generator));
|
|
8105
|
-
if (!isDeclaration
|
|
8105
|
+
if (!isDeclaration && tokenIsIdentifier(this.state.type)) {
|
|
8106
|
+
this.expressionScope.enter(newExpressionScope());
|
|
8107
|
+
node.id = this.parseFunctionId();
|
|
8108
|
+
this.expressionScope.exit();
|
|
8109
|
+
}
|
|
8106
8110
|
this.parseFunctionParams(node, false);
|
|
8107
8111
|
this.parseFunctionBodyAndFinish(node, isDeclaration ? "FunctionDeclaration" : "FunctionExpression");
|
|
8108
8112
|
this.prodParam.exit();
|
|
@@ -11498,7 +11502,7 @@ function getParserClass(pluginsMap) {
|
|
|
11498
11502
|
return cls;
|
|
11499
11503
|
}
|
|
11500
11504
|
//#endregion
|
|
11501
|
-
//#region node_modules/.pnpm/obug@
|
|
11505
|
+
//#region node_modules/.pnpm/obug@3.0.0/node_modules/obug/dist/core.js
|
|
11502
11506
|
/**
|
|
11503
11507
|
* Coerce `value`.
|
|
11504
11508
|
*/
|
|
@@ -11527,15 +11531,16 @@ function matchesTemplate(search, template) {
|
|
|
11527
11531
|
let templateIndex = 0;
|
|
11528
11532
|
let starIndex = -1;
|
|
11529
11533
|
let matchIndex = 0;
|
|
11530
|
-
while (searchIndex < search.length) if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*"))
|
|
11531
|
-
|
|
11532
|
-
|
|
11533
|
-
|
|
11534
|
-
|
|
11535
|
-
|
|
11536
|
-
|
|
11537
|
-
|
|
11538
|
-
|
|
11534
|
+
while (searchIndex < search.length) if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
|
11535
|
+
if (template[templateIndex] === "*") {
|
|
11536
|
+
starIndex = templateIndex;
|
|
11537
|
+
matchIndex = searchIndex;
|
|
11538
|
+
templateIndex++;
|
|
11539
|
+
} else {
|
|
11540
|
+
searchIndex++;
|
|
11541
|
+
templateIndex++;
|
|
11542
|
+
}
|
|
11543
|
+
} else if (starIndex !== -1) {
|
|
11539
11544
|
templateIndex = starIndex + 1;
|
|
11540
11545
|
matchIndex++;
|
|
11541
11546
|
searchIndex = matchIndex;
|
|
@@ -11548,12 +11553,12 @@ function humanize(value) {
|
|
|
11548
11553
|
return `${value}ms`;
|
|
11549
11554
|
}
|
|
11550
11555
|
let globalNamespaces = "";
|
|
11551
|
-
function createDebug$
|
|
11556
|
+
function createDebug$2(namespace, options) {
|
|
11552
11557
|
let prevTime;
|
|
11553
11558
|
let enableOverride;
|
|
11554
11559
|
let namespacesCache;
|
|
11555
11560
|
let enabledCache;
|
|
11556
|
-
const debug = (...args) => {
|
|
11561
|
+
const debug = ((...args) => {
|
|
11557
11562
|
if (!debug.enabled) return;
|
|
11558
11563
|
const curr = Date.now();
|
|
11559
11564
|
const diff = curr - (prevTime || curr);
|
|
@@ -11575,9 +11580,9 @@ function createDebug$1(namespace, options) {
|
|
|
11575
11580
|
});
|
|
11576
11581
|
options.formatArgs.call(debug, diff, args);
|
|
11577
11582
|
debug.log(...args);
|
|
11578
|
-
};
|
|
11583
|
+
});
|
|
11579
11584
|
debug.extend = function(namespace, delimiter = ":") {
|
|
11580
|
-
return createDebug$
|
|
11585
|
+
return createDebug$2(this.namespace + delimiter + namespace, {
|
|
11581
11586
|
useColors: this.useColors,
|
|
11582
11587
|
color: this.color,
|
|
11583
11588
|
formatArgs: this.formatArgs,
|
|
@@ -11625,7 +11630,43 @@ function enabled(name) {
|
|
|
11625
11630
|
return false;
|
|
11626
11631
|
}
|
|
11627
11632
|
//#endregion
|
|
11628
|
-
//#region node_modules/.pnpm/obug@
|
|
11633
|
+
//#region node_modules/.pnpm/obug@3.0.0/node_modules/obug/dist/plain.js
|
|
11634
|
+
function formatArgs$1(diff, args) {
|
|
11635
|
+
args[0] = `${this.namespace} ${args[0]} +${this.humanize(diff)}`;
|
|
11636
|
+
}
|
|
11637
|
+
const defaultOptions = {
|
|
11638
|
+
useColors: false,
|
|
11639
|
+
color: "",
|
|
11640
|
+
formatArgs: formatArgs$1,
|
|
11641
|
+
formatters: {
|
|
11642
|
+
/**
|
|
11643
|
+
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|
11644
|
+
*/
|
|
11645
|
+
j(v) {
|
|
11646
|
+
try {
|
|
11647
|
+
return JSON.stringify(v);
|
|
11648
|
+
} catch (error) {
|
|
11649
|
+
return `[UnexpectedJSONParseError]: ${error.message}`;
|
|
11650
|
+
}
|
|
11651
|
+
} },
|
|
11652
|
+
inspectOpts: {},
|
|
11653
|
+
humanize,
|
|
11654
|
+
log: console.debug || console.log || (() => {})
|
|
11655
|
+
};
|
|
11656
|
+
function createDebug$1(namespace, options) {
|
|
11657
|
+
return createDebug$2(namespace, Object.assign({}, defaultOptions, options));
|
|
11658
|
+
}
|
|
11659
|
+
function load() {
|
|
11660
|
+
let r;
|
|
11661
|
+
try {
|
|
11662
|
+
r = localStorage.getItem("debug") || localStorage.getItem("DEBUG");
|
|
11663
|
+
} catch (_unused) {}
|
|
11664
|
+
if (!r && typeof process !== "undefined" && "env" in process) r = process.env.DEBUG;
|
|
11665
|
+
return r || "";
|
|
11666
|
+
}
|
|
11667
|
+
enable(load());
|
|
11668
|
+
//#endregion
|
|
11669
|
+
//#region node_modules/.pnpm/obug@3.0.0/node_modules/obug/dist/browser.js
|
|
11629
11670
|
const colors = [
|
|
11630
11671
|
"#0000CC",
|
|
11631
11672
|
"#0000FF",
|
|
@@ -11722,58 +11763,15 @@ function formatArgs(diff, args) {
|
|
|
11722
11763
|
});
|
|
11723
11764
|
args.splice(lastC, 0, c);
|
|
11724
11765
|
}
|
|
11725
|
-
/**
|
|
11726
|
-
* Invokes `console.debug()` when available.
|
|
11727
|
-
* No-op when `console.debug` is not a "function".
|
|
11728
|
-
* If `console.debug` is not available, falls back
|
|
11729
|
-
* to `console.log`.
|
|
11730
|
-
*/
|
|
11731
|
-
const log = console.debug || console.log || (() => {});
|
|
11732
|
-
const storage = localstorage();
|
|
11733
|
-
const defaultOptions = {
|
|
11734
|
-
useColors: true,
|
|
11735
|
-
formatArgs,
|
|
11736
|
-
formatters: {
|
|
11737
|
-
/**
|
|
11738
|
-
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|
11739
|
-
*/
|
|
11740
|
-
j(v) {
|
|
11741
|
-
try {
|
|
11742
|
-
return JSON.stringify(v);
|
|
11743
|
-
} catch (error) {
|
|
11744
|
-
return `[UnexpectedJSONParseError]: ${error.message}`;
|
|
11745
|
-
}
|
|
11746
|
-
} },
|
|
11747
|
-
inspectOpts: {},
|
|
11748
|
-
humanize,
|
|
11749
|
-
log
|
|
11750
|
-
};
|
|
11751
11766
|
function createDebug(namespace, options) {
|
|
11752
11767
|
var _ref;
|
|
11753
11768
|
const color = (_ref = options && options.color) !== null && _ref !== void 0 ? _ref : selectColor(colors, namespace);
|
|
11754
|
-
return createDebug$1(namespace, Object.assign(
|
|
11769
|
+
return createDebug$1(namespace, Object.assign({
|
|
11770
|
+
useColors: true,
|
|
11771
|
+
color,
|
|
11772
|
+
formatArgs
|
|
11773
|
+
}, options));
|
|
11755
11774
|
}
|
|
11756
|
-
/**
|
|
11757
|
-
* Localstorage attempts to return the localstorage.
|
|
11758
|
-
*
|
|
11759
|
-
* This is necessary because safari throws
|
|
11760
|
-
* when a user disables cookies/localstorage
|
|
11761
|
-
* and you attempt to access it.
|
|
11762
|
-
*/
|
|
11763
|
-
function localstorage() {
|
|
11764
|
-
try {
|
|
11765
|
-
return localStorage;
|
|
11766
|
-
} catch (_unused) {}
|
|
11767
|
-
}
|
|
11768
|
-
function load() {
|
|
11769
|
-
let r;
|
|
11770
|
-
try {
|
|
11771
|
-
r = storage.getItem("debug") || storage.getItem("DEBUG");
|
|
11772
|
-
} catch (_unused2) {}
|
|
11773
|
-
if (!r && typeof process !== "undefined" && "env" in process) r = process.env.DEBUG;
|
|
11774
|
-
return r || "";
|
|
11775
|
-
}
|
|
11776
|
-
enable(load());
|
|
11777
11775
|
//#endregion
|
|
11778
11776
|
//#region node_modules/.pnpm/@babel+helper-validator-identifier@8.0.6/node_modules/@babel/helper-validator-identifier/lib/identifier-browser.js
|
|
11779
11777
|
const bmpIdentifierStart = /* @__PURE__ */ new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿ-ℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]");
|
|
@@ -13771,7 +13769,7 @@ var lib_exports = /* @__PURE__ */ __exportAll({
|
|
|
13771
13769
|
classPrivateMethod: () => classPrivateMethod,
|
|
13772
13770
|
classPrivateProperty: () => classPrivateProperty,
|
|
13773
13771
|
classProperty: () => classProperty,
|
|
13774
|
-
clone: () => clone
|
|
13772
|
+
clone: () => clone,
|
|
13775
13773
|
cloneDeep: () => cloneDeep,
|
|
13776
13774
|
cloneDeepWithoutLoc: () => cloneDeepWithoutLoc,
|
|
13777
13775
|
cloneNode: () => cloneNode$5,
|
|
@@ -23937,7 +23935,7 @@ function maybeCloneComments(comments, deep, withoutLoc, commentsCache) {
|
|
|
23937
23935
|
return ret;
|
|
23938
23936
|
});
|
|
23939
23937
|
}
|
|
23940
|
-
function clone
|
|
23938
|
+
function clone(node) {
|
|
23941
23939
|
return cloneNode$5(node, false);
|
|
23942
23940
|
}
|
|
23943
23941
|
function cloneDeep(node) {
|
|
@@ -30094,7 +30092,7 @@ const index = Object.assign(smart.bind(void 0), {
|
|
|
30094
30092
|
ast: smart.ast
|
|
30095
30093
|
});
|
|
30096
30094
|
//#endregion
|
|
30097
|
-
//#region node_modules/.pnpm/@babel+traverse@8.0.
|
|
30095
|
+
//#region node_modules/.pnpm/@babel+traverse@8.0.7/node_modules/@babel/traverse/lib/index.js
|
|
30098
30096
|
const virtualTypes = /*#__PURE__*/ Object.defineProperty({
|
|
30099
30097
|
__proto__: null,
|
|
30100
30098
|
BindingIdentifier: ["Identifier"],
|
|
@@ -30390,7 +30388,7 @@ function verify$1(visitor) {
|
|
|
30390
30388
|
for (const nodeType of Object.keys(visitor)) {
|
|
30391
30389
|
if (nodeType === "enter" || nodeType === "exit") validateVisitorMethods(nodeType, visitor[nodeType]);
|
|
30392
30390
|
if (shouldIgnoreKey(nodeType)) continue;
|
|
30393
|
-
if (!TYPES.includes(nodeType)) throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse 8.0.
|
|
30391
|
+
if (!TYPES.includes(nodeType)) throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse 8.0.7`);
|
|
30394
30392
|
const visitors = visitor[nodeType];
|
|
30395
30393
|
if (typeof visitors === "object") for (const visitorKey of Object.keys(visitors)) if (visitorKey === "enter" || visitorKey === "exit") validateVisitorMethods(`${nodeType}.${visitorKey}`, visitors[visitorKey]);
|
|
30396
30394
|
else throw new Error(`You passed \`traverse()\` a visitor object with the property ${nodeType} that has the invalid property ${visitorKey}`);
|
|
@@ -32208,7 +32206,7 @@ function _evaluate(path, state) {
|
|
|
32208
32206
|
if (testResult) return evaluateCached(path.get("consequent"), state);
|
|
32209
32207
|
else return evaluateCached(path.get("alternate"), state);
|
|
32210
32208
|
}
|
|
32211
|
-
if (path.isExpressionWrapper()) return evaluateCached(path.get("expression"), state);
|
|
32209
|
+
if (path.isExpressionWrapper() || path.isTSAsExpression() || path.isTSSatisfiesExpression() || path.isTSTypeAssertion() || path.isTSNonNullExpression() || path.isTSInstantiationExpression()) return evaluateCached(path.get("expression"), state);
|
|
32212
32210
|
if (path.isMemberExpression() && !path.parentPath.isCallExpression({ callee: path.node })) {
|
|
32213
32211
|
const property = path.get("property");
|
|
32214
32212
|
const object = path.get("object");
|
|
@@ -32261,6 +32259,11 @@ function _evaluate(path, state) {
|
|
|
32261
32259
|
deopt(bindingPath, state);
|
|
32262
32260
|
return;
|
|
32263
32261
|
}
|
|
32262
|
+
const idPath = bindingPath.get("id");
|
|
32263
|
+
if (!idPath.isIdentifier()) {
|
|
32264
|
+
deopt(idPath, state);
|
|
32265
|
+
return;
|
|
32266
|
+
}
|
|
32264
32267
|
const initPath = bindingPath.get("init");
|
|
32265
32268
|
const value = evaluateCached(initPath, state);
|
|
32266
32269
|
if (typeof value === "object" && value !== null && binding.references > 1) {
|
|
@@ -33733,27 +33736,77 @@ const resolveMemberName = (expr) => {
|
|
|
33733
33736
|
return parts.join(".");
|
|
33734
33737
|
};
|
|
33735
33738
|
//#endregion
|
|
33736
|
-
//#region src/utils/ast/
|
|
33737
|
-
const
|
|
33738
|
-
|
|
33739
|
-
|
|
33740
|
-
const
|
|
33741
|
-
|
|
33739
|
+
//#region src/utils/ast/patch.ts
|
|
33740
|
+
const hasOnlyLayoutNewlines = (content) => {
|
|
33741
|
+
let index = 0;
|
|
33742
|
+
while (index < content.length) {
|
|
33743
|
+
const char = content[index];
|
|
33744
|
+
if (char === "`" || char === "<") return false;
|
|
33745
|
+
if (char === "\"" || char === "'") {
|
|
33746
|
+
const next = skipStringLiteral(content, index);
|
|
33747
|
+
if (next === -1) return false;
|
|
33748
|
+
index = next;
|
|
33749
|
+
continue;
|
|
33750
|
+
}
|
|
33751
|
+
if (char === "/") {
|
|
33752
|
+
const following = content[index + 1];
|
|
33753
|
+
if (following === "/") {
|
|
33754
|
+
const lineEnd = content.indexOf("\n", index + 2);
|
|
33755
|
+
index = lineEnd === -1 ? content.length : lineEnd;
|
|
33756
|
+
continue;
|
|
33757
|
+
}
|
|
33758
|
+
if (following === "*") {
|
|
33759
|
+
const commentEnd = content.indexOf("*/", index + 2);
|
|
33760
|
+
if (commentEnd === -1) return false;
|
|
33761
|
+
index = commentEnd + 2;
|
|
33762
|
+
continue;
|
|
33763
|
+
}
|
|
33764
|
+
return false;
|
|
33765
|
+
}
|
|
33766
|
+
index++;
|
|
33767
|
+
}
|
|
33768
|
+
return true;
|
|
33742
33769
|
};
|
|
33743
|
-
const
|
|
33744
|
-
|
|
33745
|
-
|
|
33746
|
-
|
|
33747
|
-
|
|
33748
|
-
|
|
33749
|
-
|
|
33750
|
-
|
|
33751
|
-
|
|
33752
|
-
|
|
33770
|
+
const skipStringLiteral = (content, start) => {
|
|
33771
|
+
const quote = content[start];
|
|
33772
|
+
for (let index = start + 1; index < content.length; index++) {
|
|
33773
|
+
const char = content[index];
|
|
33774
|
+
if (char === "\\") {
|
|
33775
|
+
const escaped = content[index + 1];
|
|
33776
|
+
if (escaped === "\n" || escaped === "\r") return -1;
|
|
33777
|
+
index++;
|
|
33778
|
+
continue;
|
|
33779
|
+
}
|
|
33780
|
+
if (char === quote) return index + 1;
|
|
33781
|
+
if (char === "\n") return -1;
|
|
33753
33782
|
}
|
|
33783
|
+
return -1;
|
|
33784
|
+
};
|
|
33785
|
+
const lineIndentAt = (source, offset) => {
|
|
33786
|
+
const lineStart = source.lastIndexOf("\n", offset - 1) + 1;
|
|
33787
|
+
return /^[ \t]*/.exec(source.slice(lineStart, offset))?.[0] ?? "";
|
|
33754
33788
|
};
|
|
33755
|
-
const
|
|
33756
|
-
return
|
|
33789
|
+
const lineTerminatorOf = (source) => {
|
|
33790
|
+
return source.includes("\r\n") ? "\r\n" : "\n";
|
|
33791
|
+
};
|
|
33792
|
+
const applyEdits = (source, edits) => {
|
|
33793
|
+
if (edits.length === 0) return source;
|
|
33794
|
+
const ordered = [...edits].sort((a, b) => a.start - b.start || a.end - b.end);
|
|
33795
|
+
for (const edit of ordered) if (!Number.isInteger(edit.start) || !Number.isInteger(edit.end) || edit.start < 0 || edit.end > source.length || edit.start > edit.end) throw new Error(`Invalid source edit [${edit.start}, ${edit.end}) for a source of length ${source.length}`);
|
|
33796
|
+
for (let i = 1; i < ordered.length; i++) {
|
|
33797
|
+
const previous = ordered[i - 1];
|
|
33798
|
+
const current = ordered[i];
|
|
33799
|
+
if (current.start < previous.end) throw new Error(`Overlapping source edits: [${previous.start}, ${previous.end}) and [${current.start}, ${current.end})`);
|
|
33800
|
+
}
|
|
33801
|
+
let result = "";
|
|
33802
|
+
let cursor = 0;
|
|
33803
|
+
const terminator = lineTerminatorOf(source);
|
|
33804
|
+
for (const edit of ordered) {
|
|
33805
|
+
const content = edit.indent && edit.content.includes("\n") && hasOnlyLayoutNewlines(edit.content) ? edit.content.replace(/\n/g, `${terminator}${lineIndentAt(source, edit.start)}`) : edit.content;
|
|
33806
|
+
result += source.slice(cursor, edit.start) + content;
|
|
33807
|
+
cursor = edit.end;
|
|
33808
|
+
}
|
|
33809
|
+
return result + source.slice(cursor);
|
|
33757
33810
|
};
|
|
33758
33811
|
//#endregion
|
|
33759
33812
|
//#region src/utils/ast/tree.ts
|
|
@@ -33779,11 +33832,6 @@ const fillIdsFrom = (code, prefix) => {
|
|
|
33779
33832
|
return id;
|
|
33780
33833
|
});
|
|
33781
33834
|
};
|
|
33782
|
-
const clone = (element, generateId = () => nanoid(6)) => {
|
|
33783
|
-
const cloned = cloneNode$5(element, true);
|
|
33784
|
-
const generatedCode = generateCode(cloned);
|
|
33785
|
-
return parseExpression(replaceIds(generatedCode, generateId), { plugins: ["jsx", "typescript"] });
|
|
33786
|
-
};
|
|
33787
33835
|
//#endregion
|
|
33788
33836
|
//#region src/utils/ast/document.ts
|
|
33789
33837
|
const traverse = traverse$1;
|
|
@@ -33895,7 +33943,6 @@ const fillSectionIds = (code, generateId = () => nanoid(6), options) => {
|
|
|
33895
33943
|
if (!edits.length) return code;
|
|
33896
33944
|
return edits.reduceRight((acc, edit) => `${acc.slice(0, edit.start)}${edit.text}${acc.slice(edit.end)}`, code);
|
|
33897
33945
|
};
|
|
33898
|
-
const generateDocumentCode = (doc) => doc.code;
|
|
33899
33946
|
const getContainerInnerSpan = (container) => {
|
|
33900
33947
|
if (!container.closingElement) return;
|
|
33901
33948
|
return {
|
|
@@ -33915,6 +33962,22 @@ const commonSuffixLength = (a, b, limit) => {
|
|
|
33915
33962
|
while (i < limit && a[a.length - 1 - i] === b[b.length - 1 - i]) i++;
|
|
33916
33963
|
return i;
|
|
33917
33964
|
};
|
|
33965
|
+
const layoutNextTo = (code, neighbor) => {
|
|
33966
|
+
const lineStart = code.lastIndexOf("\n", neighbor.start - 1) + 1;
|
|
33967
|
+
const indent = code.slice(lineStart, neighbor.start);
|
|
33968
|
+
if (!/^[ \t]*$/.test(indent)) return null;
|
|
33969
|
+
return {
|
|
33970
|
+
eol: code.includes("\r\n") ? "\r\n" : "\n",
|
|
33971
|
+
indent
|
|
33972
|
+
};
|
|
33973
|
+
};
|
|
33974
|
+
const sectionsNextTo = (code, neighbor, newCodes, position) => {
|
|
33975
|
+
const layout = layoutNextTo(code, neighbor);
|
|
33976
|
+
if (!layout) return position === "before" ? `${newCodes.join("\n")}\n` : `\n${newCodes.join("\n")}`;
|
|
33977
|
+
const { eol, indent } = layout;
|
|
33978
|
+
const lines = newCodes.map((newCode) => eol === "\r\n" ? newCode.trim().replace(/\r?\n/g, eol) : newCode.trim());
|
|
33979
|
+
return position === "before" ? lines.map((line) => `${line}${eol}${indent}`).join("") : lines.map((line) => `${eol}${indent}${line}`).join("");
|
|
33980
|
+
};
|
|
33918
33981
|
const replaceDocumentSections = (fullCode, sectionCodes, options) => {
|
|
33919
33982
|
const doc = parseDocument(fullCode, options);
|
|
33920
33983
|
if (!doc) return fullCode;
|
|
@@ -33932,15 +33995,37 @@ const replaceDocumentSections = (fullCode, sectionCodes, options) => {
|
|
|
33932
33995
|
if (oldChangedStart >= oldChangedEndExclusive) {
|
|
33933
33996
|
if (newChanged.length === 0) return fullCode;
|
|
33934
33997
|
if (oldChangedStart < sections.length) {
|
|
33935
|
-
const
|
|
33936
|
-
return spliceCode(fullCode,
|
|
33998
|
+
const next = sections[oldChangedStart];
|
|
33999
|
+
return spliceCode(fullCode, next.start, next.start, sectionsNextTo(fullCode, next, newChanged, "before"));
|
|
33937
34000
|
}
|
|
33938
|
-
const
|
|
33939
|
-
return spliceCode(fullCode,
|
|
34001
|
+
const last = sections[sections.length - 1];
|
|
34002
|
+
return spliceCode(fullCode, last.end, last.end, sectionsNextTo(fullCode, last, newChanged, "after"));
|
|
34003
|
+
}
|
|
34004
|
+
const window = sections.slice(oldChangedStart, oldChangedEndExclusive);
|
|
34005
|
+
const paired = Math.min(window.length, newChanged.length);
|
|
34006
|
+
const edits = [];
|
|
34007
|
+
window.forEach((node, index) => {
|
|
34008
|
+
if (index < paired) {
|
|
34009
|
+
if (oldCodes[oldChangedStart + index] !== newChanged[index]) edits.push({
|
|
34010
|
+
start: node.start,
|
|
34011
|
+
end: node.end,
|
|
34012
|
+
content: newChanged[index]
|
|
34013
|
+
});
|
|
34014
|
+
} else edits.push({
|
|
34015
|
+
start: node.start,
|
|
34016
|
+
end: node.end,
|
|
34017
|
+
content: ""
|
|
34018
|
+
});
|
|
34019
|
+
});
|
|
34020
|
+
if (newChanged.length > paired) {
|
|
34021
|
+
const anchor = window[paired - 1];
|
|
34022
|
+
edits.push({
|
|
34023
|
+
start: anchor.end,
|
|
34024
|
+
end: anchor.end,
|
|
34025
|
+
content: sectionsNextTo(fullCode, anchor, newChanged.slice(paired), "after")
|
|
34026
|
+
});
|
|
33940
34027
|
}
|
|
33941
|
-
|
|
33942
|
-
const end = sections[oldChangedEndExclusive - 1].end;
|
|
33943
|
-
return spliceCode(fullCode, start, end, newChanged.join("\n"));
|
|
34028
|
+
return applyEdits(fullCode, edits);
|
|
33944
34029
|
};
|
|
33945
34030
|
const generateSectionPreview = (fullCode, sectionCode, options) => generateSectionPreviews(fullCode, [sectionCode], options)[0];
|
|
33946
34031
|
const generateSectionPreviews = (fullCode, sectionCodes, options) => {
|
|
@@ -33987,6 +34072,6 @@ const createSectionPreviewCache = () => {
|
|
|
33987
34072
|
return { compute };
|
|
33988
34073
|
};
|
|
33989
34074
|
//#endregion
|
|
33990
|
-
export {
|
|
34075
|
+
export { jsxOpeningFragment as $, isJSXText as A, isTSSatisfiesExpression as B, isJSXElement as C, isJSXIdentifier$2 as D, isJSXFragment as E, isParenthesizedExpression as F, jsxClosingElement as G, isTemplateLiteral$1 as H, isSpreadElement as I, jsxExpressionContainer as J, jsxClosingFragment as K, isStringLiteral$3 as L, isNumericLiteral as M, isObjectExpression$1 as N, isJSXOpeningElement as O, isObjectProperty$1 as P, jsxOpeningElement as Q, isTSAsExpression as R, isJSXAttribute as S, isJSXExpressionContainer as T, isUnaryExpression$1 as U, isTSTypeAssertion as V, jsxAttribute as W, jsxIdentifier$1 as X, jsxFragment as Y, jsxMemberExpression as Z, identifier$5 as _, inspectDocument as a, stringLiteral$2 as at, isExpression$5 as b, traverse as c, traverseFast$2 as ct, applyEdits as d, parseExpression as dt, jsxText as et, getJSXTagName as f, booleanLiteral as g, arrayExpression as h, getSections as i, objectProperty as it, isNullLiteral$1 as j, isJSXSpreadAttribute as k, fillIdsFrom as l, unaryExpression$1 as lt, generate as m, fillSectionIds as n, numericLiteral$1 as nt, parseDocument as o, templateElement as ot, nanoid as p, jsxElement as q, generateSectionPreview as r, objectExpression$1 as rt, replaceDocumentSections as s, templateLiteral as st, createSectionPreviewCache as t, nullLiteral as tt, replaceIds as u, parse$1 as ut, isArrayExpression$1 as v, isJSXEmptyExpression as w, isIdentifier$7 as x, isBooleanLiteral as y, isTSNonNullExpression as z };
|
|
33991
34076
|
|
|
33992
|
-
//# sourceMappingURL=document-
|
|
34077
|
+
//# sourceMappingURL=document-DcwIEHRV.js.map
|