@jbpark/live-editor 4.6.1 → 6.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.
Files changed (91) hide show
  1. package/README.ko.md +37 -35
  2. package/README.md +37 -35
  3. package/dist/{boundary-BLB80tyw.js → boundary-CySnDUs2.js} +5 -4
  4. package/dist/boundary-CySnDUs2.js.map +1 -0
  5. package/dist/{compile-Dxas-D05.js → compile-my0AjsCw.js} +8 -7
  6. package/dist/compile-my0AjsCw.js.map +1 -0
  7. package/dist/constants-st9gnJ5g.js +55 -0
  8. package/dist/constants-st9gnJ5g.js.map +1 -0
  9. package/dist/{context-B8MzP7_p.js → context-Bjq0CvBE.js} +3 -3
  10. package/dist/{context-B8MzP7_p.js.map → context-Bjq0CvBE.js.map} +1 -1
  11. package/dist/{core-Bgfek364.js → core-BNVuH8-l.js} +51 -14
  12. package/dist/core-BNVuH8-l.js.map +1 -0
  13. package/dist/{detect-typescript-Dr_oLniM.js → detect-typescript-CMF0FVKD.js} +2 -2
  14. package/dist/{detect-typescript-Dr_oLniM.js.map → detect-typescript-CMF0FVKD.js.map} +1 -1
  15. package/dist/dnd/index.d.ts +3 -2
  16. package/dist/dnd/index.js +3 -2
  17. package/dist/dnd-BvjEDo-x.js +4197 -0
  18. package/dist/dnd-BvjEDo-x.js.map +1 -0
  19. package/dist/document-BQhb7YR8.d.ts +17 -0
  20. package/dist/{document-CHO215iP.js → document-uHqw0mvr.js} +194 -109
  21. package/dist/document-uHqw0mvr.js.map +1 -0
  22. package/dist/edit-options-C_r9aCz4.d.ts +100 -0
  23. package/dist/editor/index.d.ts +1 -1
  24. package/dist/editor/index.js +2 -2
  25. package/dist/{editor-CMElfHer.js → editor-CvnzrM9J.js} +2 -2
  26. package/dist/{editor-CMElfHer.js.map → editor-CvnzrM9J.js.map} +1 -1
  27. package/dist/error/index.d.ts +1 -1
  28. package/dist/error/index.js +2 -2
  29. package/dist/{error-CN_GCnXB.js → error-CFzvnLCf.js} +18 -32
  30. package/dist/error-CFzvnLCf.js.map +1 -0
  31. package/dist/{index-DpDU1IAw.d.ts → index-92L7F440.d.ts} +2 -2
  32. package/dist/{index-DrWtSKXu.d.ts → index-BZpZwrxT.d.ts} +2 -2
  33. package/dist/index-C8h8TcIl.d.ts +15 -0
  34. package/dist/{index-13BDSrQc.d.ts → index-C93npmTU.d.ts} +4 -6
  35. package/dist/{index-DQkL37eL.d.ts → index-CqsS207F.d.ts} +6 -12
  36. package/dist/{index-CiWB0zFb.d.ts → index-DQcdHg_V.d.ts} +18 -136
  37. package/dist/{index-CRwEhJ7w.d.ts → index-DfIvkht8.d.ts} +3 -3
  38. package/dist/index.d.ts +12 -11
  39. package/dist/index.js +6 -6
  40. package/dist/index.js.map +1 -1
  41. package/dist/{messages-IBPs4TkZ.d.ts → messages-BpN3QIhj.d.ts} +8 -2
  42. package/dist/{messages-CSrMI4Rm.js → messages-DrINcRdG.js} +8 -2
  43. package/dist/messages-DrINcRdG.js.map +1 -0
  44. package/dist/preview/index.d.ts +2 -2
  45. package/dist/preview/index.js +2 -3
  46. package/dist/{preview-CtyG5UbH.js → preview-B05MkVIQ.js} +16 -13
  47. package/dist/preview-B05MkVIQ.js.map +1 -0
  48. package/dist/provider/index.d.ts +2 -2
  49. package/dist/provider/index.js +2 -2
  50. package/dist/{sections-jYuqS4KB.js → sections-DhH_aVf5.js} +4 -7
  51. package/dist/sections-DhH_aVf5.js.map +1 -0
  52. package/dist/style.css +809 -4950
  53. package/dist/{validate-DB59Z_Nx.d.ts → types-Czps1Txy.d.ts} +12 -28
  54. package/dist/ui-kit/index.d.ts +22 -0
  55. package/dist/{constants-DU17Tdwo.js → ui-kit/index.js} +147 -54
  56. package/dist/ui-kit/index.js.map +1 -0
  57. package/dist/ui-kit/style.css +5039 -0
  58. package/dist/update-2PJbwoS8.d.ts +68 -0
  59. package/dist/{items-BXXtMUNI.js → update-BuYQJqjq.js} +143 -392
  60. package/dist/update-BuYQJqjq.js.map +1 -0
  61. package/dist/{use-dynamic-tailwind-BP1toJkW.js → use-dynamic-tailwind-B3l1qZRW.js} +318 -287
  62. package/dist/use-dynamic-tailwind-B3l1qZRW.js.map +1 -0
  63. package/dist/use-field-state-iQGW0vc6.js +131 -0
  64. package/dist/use-field-state-iQGW0vc6.js.map +1 -0
  65. package/dist/utils/ast/index.d.ts +47 -4
  66. package/dist/utils/ast/index.js +4 -64
  67. package/dist/utils/ast/index.js.map +1 -1
  68. package/dist/utils/index.d.ts +13 -32
  69. package/dist/utils/index.js +4 -26
  70. package/dist/validate-CZz30Pnb.js +122 -0
  71. package/dist/validate-CZz30Pnb.js.map +1 -0
  72. package/dist/validate-CiA1LF6S.d.ts +33 -0
  73. package/package.json +20 -10
  74. package/dist/boundary-BLB80tyw.js.map +0 -1
  75. package/dist/compile-Dxas-D05.js.map +0 -1
  76. package/dist/constants-DU17Tdwo.js.map +0 -1
  77. package/dist/core-Bgfek364.js.map +0 -1
  78. package/dist/dnd-V8NAxd_R.js +0 -2755
  79. package/dist/dnd-V8NAxd_R.js.map +0 -1
  80. package/dist/document-CHO215iP.js.map +0 -1
  81. package/dist/document-DqRSCtsx.d.ts +0 -1614
  82. package/dist/error-CN_GCnXB.js.map +0 -1
  83. package/dist/index-C_PfR4X9.d.ts +0 -734
  84. package/dist/items-BXXtMUNI.js.map +0 -1
  85. package/dist/messages-CSrMI4Rm.js.map +0 -1
  86. package/dist/preview-CtyG5UbH.js.map +0 -1
  87. package/dist/sections-jYuqS4KB.js.map +0 -1
  88. package/dist/use-dynamic-tailwind-BP1toJkW.js.map +0 -1
  89. package/dist/utils/index.js.map +0 -1
  90. package/dist/validate-iLo8IONY.js +0 -64
  91. 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, s as REGEX } from "./constants-DU17Tdwo.js";
1
+ import { i as DEFAULT_CONTAINER_ID, n as CONFIG, r as DATA_ATTR } from "./constants-st9gnJ5g.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.6/node_modules/@babel/parser/lib/index.js
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) node.id = this.parseFunctionId();
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@2.1.4/node_modules/obug/dist/core.js
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] === "*")) if (template[templateIndex] === "*") {
11531
- starIndex = templateIndex;
11532
- matchIndex = searchIndex;
11533
- templateIndex++;
11534
- } else {
11535
- searchIndex++;
11536
- templateIndex++;
11537
- }
11538
- else if (starIndex !== -1) {
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$1(namespace, options) {
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$1(this.namespace + delimiter + namespace, {
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@2.1.4/node_modules/obug/dist/browser.js
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(defaultOptions, { color }, options));
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$1,
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$1(node) {
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.6/node_modules/@babel/traverse/lib/index.js
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.6`);
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) {
@@ -33702,13 +33705,13 @@ traverse$1.hasType = function(tree, type, denylistTypes) {
33702
33705
  };
33703
33706
  traverse$1.cache = cache;
33704
33707
  //#endregion
33705
- //#region node_modules/.pnpm/nanoid@6.0.1/node_modules/nanoid/url-alphabet/index.js
33706
- let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
33708
+ //#region node_modules/.pnpm/nanoid@6.0.2/node_modules/nanoid/url-alphabet/index.js
33709
+ let urlAlphabet = "57X6y3wQZNzYjJB2L_10pxbackgroundhimselfUTF-8DEMOGRAPHICSVqvt4KW9";
33707
33710
  //#endregion
33708
- //#region node_modules/.pnpm/nanoid@6.0.1/node_modules/nanoid/index.browser.js
33711
+ //#region node_modules/.pnpm/nanoid@6.0.2/node_modules/nanoid/index.browser.js
33709
33712
  let nanoid = (size = 21) => {
33710
- let id = "";
33711
- let bytes = crypto.getRandomValues(new Uint8Array(size |= 0));
33713
+ var id = "";
33714
+ var bytes = crypto.getRandomValues(new Uint8Array(size |= 0));
33712
33715
  while (size--) id += urlAlphabet[bytes[size] & 63];
33713
33716
  return id;
33714
33717
  };
@@ -33733,27 +33736,77 @@ const resolveMemberName = (expr) => {
33733
33736
  return parts.join(".");
33734
33737
  };
33735
33738
  //#endregion
33736
- //#region src/utils/ast/helpers.ts
33737
- const wrap = (code) => {
33738
- return `<>${code}</>`;
33739
- };
33740
- const unwrap = (generated) => {
33741
- return generated.replace(/^<>\s*/g, "").replace(/\s*<\/>\s*;?\s*$/g, "").trim();
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 attrValue = ({ value, isStringLiteral }) => {
33744
- if (value === null) return null;
33745
- if (isStringLiteral) return stringLiteral$2(value);
33746
- const trimmed = value.trim();
33747
- if (REGEX.NUMBER.test(trimmed)) return jsxExpressionContainer(numericLiteral$1(parseFloat(trimmed)));
33748
- if (REGEX.BOOLEAN_OR_NULL.test(trimmed)) return jsxExpressionContainer(parseExpression(trimmed, { plugins: ["jsx", "typescript"] }));
33749
- try {
33750
- return jsxExpressionContainer(parseExpression(trimmed, { plugins: ["jsx", "typescript"] }));
33751
- } catch {
33752
- return stringLiteral$2(trimmed);
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 generateCode = (node) => {
33756
- return generate(node, { jsescOption: { minimal: true } }).code;
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 at = sections[oldChangedStart].start;
33936
- return spliceCode(fullCode, at, at, `${newChanged.join("\n")}\n`);
33998
+ const next = sections[oldChangedStart];
33999
+ return spliceCode(fullCode, next.start, next.start, sectionsNextTo(fullCode, next, newChanged, "before"));
33937
34000
  }
33938
- const at = sections[sections.length - 1].end;
33939
- return spliceCode(fullCode, at, at, `\n${newChanged.join("\n")}`);
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
- const start = sections[oldChangedStart].start;
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 { jsxClosingFragment as $, isJSXElement as A, isObjectExpression$1 as B, booleanLiteral as C, isExpression$5 as D, isBooleanLiteral as E, isJSXOpeningElement as F, isTSAsExpression as G, isParenthesizedExpression as H, isJSXSpreadAttribute as I, isTSTypeAssertion as J, isTSNonNullExpression as K, isJSXText as L, isJSXExpressionContainer as M, isJSXFragment as N, isIdentifier$7 as O, isJSXIdentifier$2 as P, jsxClosingElement as Q, isNullLiteral$1 as R, arrayExpression as S, isArrayExpression$1 as T, isSpreadElement as U, isObjectProperty$1 as V, isStringLiteral$3 as W, isUnaryExpression$1 as X, isTemplateLiteral$1 as Y, jsxAttribute as Z, generateCode as _, parse$1 as _t, generateSectionPreview as a, jsxOpeningElement as at, getJSXTagName as b, inspectDocument as c, nullLiteral as ct, traverse as d, objectProperty as dt, jsxElement as et, clone as f, stringLiteral$2 as ft, attrValue as g, unaryExpression$1 as gt, replaceIds as h, traverseFast$2 as ht, generateDocumentCode as i, jsxMemberExpression as it, isJSXEmptyExpression as j, isJSXAttribute as k, parseDocument as l, numericLiteral$1 as lt, fillIdsFrom as m, templateLiteral as mt, createSectionPreviewCache as n, jsxFragment as nt, generateSectionPreviews as o, jsxOpeningFragment as ot, fillIds as p, templateElement as pt, isTSSatisfiesExpression as q, fillSectionIds as r, jsxIdentifier$1 as rt, getSections as s, jsxText as st, clearDocumentParseCache as t, jsxExpressionContainer as tt, replaceDocumentSections as u, objectExpression$1 as ut, unwrap as v, parseExpression as vt, identifier$5 as w, nanoid as x, wrap as y, isNumericLiteral as z };
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-CHO215iP.js.map
34077
+ //# sourceMappingURL=document-uHqw0mvr.js.map