markdown-flow-ui 0.2.35 → 0.3.0-dev.1

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 (183) hide show
  1. package/README.md +12 -0
  2. package/dist/_virtual/index.es10.js +2 -2
  3. package/dist/_virtual/index.es3.js +5 -4
  4. package/dist/_virtual/index.es3.js.map +1 -1
  5. package/dist/_virtual/index.es4.js +4 -5
  6. package/dist/_virtual/index.es4.js.map +1 -1
  7. package/dist/_virtual/index.es5.js +5 -5
  8. package/dist/_virtual/index.es6.js +5 -3
  9. package/dist/_virtual/index.es6.js.map +1 -1
  10. package/dist/_virtual/index.es7.js +3 -5
  11. package/dist/_virtual/index.es7.js.map +1 -1
  12. package/dist/_virtual/index.es8.js +2 -2
  13. package/dist/_virtual/index10.cjs +1 -1
  14. package/dist/_virtual/index3.cjs +1 -1
  15. package/dist/_virtual/index4.cjs +1 -1
  16. package/dist/_virtual/index5.cjs +1 -1
  17. package/dist/_virtual/index6.cjs +1 -1
  18. package/dist/_virtual/index7.cjs +1 -1
  19. package/dist/_virtual/index8.cjs +1 -1
  20. package/dist/_virtual/variable-marker.cjs +2 -0
  21. package/dist/_virtual/variable-marker.cjs.map +1 -0
  22. package/dist/_virtual/variable-marker.es.js +5 -0
  23. package/dist/_virtual/variable-marker.es.js.map +1 -0
  24. package/dist/_virtual/variable-name.cjs +2 -0
  25. package/dist/_virtual/variable-name.cjs.map +1 -0
  26. package/dist/_virtual/variable-name.es.js +5 -0
  27. package/dist/_virtual/variable-name.es.js.map +1 -0
  28. package/dist/components/ContentRender/ContentRender.cjs +2 -2
  29. package/dist/components/ContentRender/ContentRender.cjs.map +1 -1
  30. package/dist/components/ContentRender/ContentRender.es.js +206 -205
  31. package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
  32. package/dist/components/ContentRender/plugins/CustomVariable.cjs +1 -1
  33. package/dist/components/ContentRender/plugins/CustomVariable.cjs.map +1 -1
  34. package/dist/components/ContentRender/plugins/CustomVariable.es.js +52 -51
  35. package/dist/components/ContentRender/plugins/CustomVariable.es.js.map +1 -1
  36. package/dist/components/ContentRender/utils/inline-code-ranges.cjs +9 -9
  37. package/dist/components/ContentRender/utils/inline-code-ranges.cjs.map +1 -1
  38. package/dist/components/ContentRender/utils/inline-code-ranges.d.ts +3 -0
  39. package/dist/components/ContentRender/utils/inline-code-ranges.es.js +185 -161
  40. package/dist/components/ContentRender/utils/inline-code-ranges.es.js.map +1 -1
  41. package/dist/components/ContentRender/utils/mermaid-parse.cjs +4 -4
  42. package/dist/components/ContentRender/utils/mermaid-parse.cjs.map +1 -1
  43. package/dist/components/ContentRender/utils/mermaid-parse.es.js +53 -48
  44. package/dist/components/ContentRender/utils/mermaid-parse.es.js.map +1 -1
  45. package/dist/components/ContentRender/utils/split-content.cjs +6 -6
  46. package/dist/components/ContentRender/utils/split-content.cjs.map +1 -1
  47. package/dist/components/ContentRender/utils/split-content.d.ts +1 -0
  48. package/dist/components/ContentRender/utils/split-content.es.js +361 -313
  49. package/dist/components/ContentRender/utils/split-content.es.js.map +1 -1
  50. package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.cjs +1 -1
  51. package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.cjs.map +1 -1
  52. package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.es.js +286 -290
  53. package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.es.js.map +1 -1
  54. package/dist/components/MarkdownFlowEditor/components/VariableSelect.cjs +1 -1
  55. package/dist/components/MarkdownFlowEditor/components/VariableSelect.cjs.map +1 -1
  56. package/dist/components/MarkdownFlowEditor/components/VariableSelect.es.js +62 -63
  57. package/dist/components/MarkdownFlowEditor/components/VariableSelect.es.js.map +1 -1
  58. package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.cjs +1 -1
  59. package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.d.ts +1 -1
  60. package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.es.js +1 -1
  61. package/dist/components/MarkdownFlowEditor/locales/de-DE.json.cjs +1 -1
  62. package/dist/components/MarkdownFlowEditor/locales/de-DE.json.d.ts +1 -1
  63. package/dist/components/MarkdownFlowEditor/locales/de-DE.json.es.js +13 -13
  64. package/dist/components/MarkdownFlowEditor/locales/en-US.json.cjs +1 -1
  65. package/dist/components/MarkdownFlowEditor/locales/en-US.json.d.ts +1 -1
  66. package/dist/components/MarkdownFlowEditor/locales/en-US.json.es.js +19 -19
  67. package/dist/components/MarkdownFlowEditor/locales/es-ES.json.cjs +1 -1
  68. package/dist/components/MarkdownFlowEditor/locales/es-ES.json.d.ts +1 -1
  69. package/dist/components/MarkdownFlowEditor/locales/es-ES.json.es.js +13 -13
  70. package/dist/components/MarkdownFlowEditor/locales/fil-PH.json.cjs +1 -1
  71. package/dist/components/MarkdownFlowEditor/locales/fil-PH.json.d.ts +1 -1
  72. package/dist/components/MarkdownFlowEditor/locales/fil-PH.json.es.js +16 -16
  73. package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.cjs +1 -1
  74. package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.d.ts +1 -1
  75. package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.es.js +13 -13
  76. package/dist/components/MarkdownFlowEditor/locales/ja-JP.json.cjs +1 -1
  77. package/dist/components/MarkdownFlowEditor/locales/ja-JP.json.d.ts +1 -1
  78. package/dist/components/MarkdownFlowEditor/locales/ja-JP.json.es.js +1 -1
  79. package/dist/components/MarkdownFlowEditor/locales/th-TH.json.cjs +1 -1
  80. package/dist/components/MarkdownFlowEditor/locales/th-TH.json.d.ts +1 -1
  81. package/dist/components/MarkdownFlowEditor/locales/th-TH.json.es.js +1 -1
  82. package/dist/components/MarkdownFlowEditor/locales/ur-PK.json.cjs +1 -1
  83. package/dist/components/MarkdownFlowEditor/locales/ur-PK.json.d.ts +1 -1
  84. package/dist/components/MarkdownFlowEditor/locales/ur-PK.json.es.js +1 -1
  85. package/dist/components/MarkdownFlowEditor/locales/vi-VN.json.cjs +1 -1
  86. package/dist/components/MarkdownFlowEditor/locales/vi-VN.json.d.ts +1 -1
  87. package/dist/components/MarkdownFlowEditor/locales/vi-VN.json.es.js +13 -13
  88. package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.cjs +1 -1
  89. package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.d.ts +1 -1
  90. package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.es.js +1 -1
  91. package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs +3 -3
  92. package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs.map +1 -1
  93. package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js +176 -174
  94. package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js.map +1 -1
  95. package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.cjs +2 -1
  96. package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.cjs.map +1 -1
  97. package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.d.ts +3 -1
  98. package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.es.js +38 -55
  99. package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.es.js.map +1 -1
  100. package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.test.d.ts +1 -0
  101. package/dist/components/MarkdownFlowEditor/utils.cjs +1 -1
  102. package/dist/components/MarkdownFlowEditor/utils.cjs.map +1 -1
  103. package/dist/components/MarkdownFlowEditor/utils.d.ts +2 -3
  104. package/dist/components/MarkdownFlowEditor/utils.es.js +47 -51
  105. package/dist/components/MarkdownFlowEditor/utils.es.js.map +1 -1
  106. package/dist/components/MarkdownFlowEditor/utils.variables.test.d.ts +1 -0
  107. package/dist/components/ui/inputGroup/textarea.cjs +1 -1
  108. package/dist/components/ui/inputGroup/textarea.es.js +1 -1
  109. package/dist/lib/interaction-defaults.cjs +1 -1
  110. package/dist/lib/interaction-defaults.cjs.map +1 -1
  111. package/dist/lib/interaction-defaults.es.js +123 -132
  112. package/dist/lib/interaction-defaults.es.js.map +1 -1
  113. package/dist/lib/interaction-defaults.failure.test.d.ts +1 -0
  114. package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs +1 -1
  115. package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
  116. package/dist/node_modules/classnames/index.cjs +1 -1
  117. package/dist/node_modules/classnames/index.es.js +1 -1
  118. package/dist/node_modules/cose-base/cose-base.cjs +1 -1
  119. package/dist/node_modules/cose-base/cose-base.cjs.map +1 -1
  120. package/dist/node_modules/cose-base/cose-base.es.js +1 -1
  121. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs +1 -1
  122. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs.map +1 -1
  123. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.es.js +1 -1
  124. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs +1 -1
  125. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs.map +1 -1
  126. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.es.js +1 -1
  127. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.cjs +1 -1
  128. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.es.js +1 -1
  129. package/dist/node_modules/layout-base/layout-base.cjs +1 -1
  130. package/dist/node_modules/layout-base/layout-base.cjs.map +1 -1
  131. package/dist/node_modules/layout-base/layout-base.es.js +1 -1
  132. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAMF2YG6.cjs +1 -1
  133. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAMF2YG6.es.js +1 -1
  134. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-OMD6QJNC.cjs +1 -1
  135. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-OMD6QJNC.es.js +1 -1
  136. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-U37J5Y7L.cjs +1 -1
  137. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-U37J5Y7L.es.js +1 -1
  138. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-WV7ZQ7D5.cjs +1 -1
  139. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-WV7ZQ7D5.es.js +1 -1
  140. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-4MX5Z3NR.cjs +1 -1
  141. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-4MX5Z3NR.es.js +1 -1
  142. package/dist/node_modules/rc-input/es/BaseInput.cjs +1 -1
  143. package/dist/node_modules/rc-input/es/BaseInput.es.js +1 -1
  144. package/dist/node_modules/rc-textarea/es/ResizableTextArea.cjs +1 -1
  145. package/dist/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
  146. package/dist/node_modules/rc-textarea/es/TextArea.cjs +1 -1
  147. package/dist/node_modules/rc-textarea/es/TextArea.es.js +1 -1
  148. package/dist/node_modules/rc-textarea/es/index.cjs +1 -1
  149. package/dist/node_modules/rc-textarea/es/index.es.js +1 -1
  150. package/dist/node_modules/remark-flow/dist/escaping.cjs +2 -2
  151. package/dist/node_modules/remark-flow/dist/escaping.cjs.map +1 -1
  152. package/dist/node_modules/remark-flow/dist/escaping.es.js +128 -63
  153. package/dist/node_modules/remark-flow/dist/escaping.es.js.map +1 -1
  154. package/dist/node_modules/remark-flow/dist/index.cjs +1 -1
  155. package/dist/node_modules/remark-flow/dist/index.cjs.map +1 -1
  156. package/dist/node_modules/remark-flow/dist/index.es.js +62 -33
  157. package/dist/node_modules/remark-flow/dist/index.es.js.map +1 -1
  158. package/dist/node_modules/remark-flow/dist/interaction-parser.cjs +1 -1
  159. package/dist/node_modules/remark-flow/dist/interaction-parser.cjs.map +1 -1
  160. package/dist/node_modules/remark-flow/dist/interaction-parser.es.js +260 -256
  161. package/dist/node_modules/remark-flow/dist/interaction-parser.es.js.map +1 -1
  162. package/dist/node_modules/remark-flow/dist/interaction-plugin-core.cjs +1 -1
  163. package/dist/node_modules/remark-flow/dist/interaction-plugin-core.cjs.map +1 -1
  164. package/dist/node_modules/remark-flow/dist/interaction-plugin-core.es.js +71 -42
  165. package/dist/node_modules/remark-flow/dist/interaction-plugin-core.es.js.map +1 -1
  166. package/dist/node_modules/remark-flow/dist/interaction-syntax.cjs +1 -1
  167. package/dist/node_modules/remark-flow/dist/interaction-syntax.cjs.map +1 -1
  168. package/dist/node_modules/remark-flow/dist/interaction-syntax.es.js +500 -46
  169. package/dist/node_modules/remark-flow/dist/interaction-syntax.es.js.map +1 -1
  170. package/dist/node_modules/remark-flow/dist/variable-marker.cjs +2 -0
  171. package/dist/node_modules/remark-flow/dist/variable-marker.cjs.map +1 -0
  172. package/dist/node_modules/remark-flow/dist/variable-marker.es.js +77 -0
  173. package/dist/node_modules/remark-flow/dist/variable-marker.es.js.map +1 -0
  174. package/dist/node_modules/remark-flow/dist/variable-name.cjs +15 -0
  175. package/dist/node_modules/remark-flow/dist/variable-name.cjs.map +1 -0
  176. package/dist/node_modules/remark-flow/dist/variable-name.es.js +748 -0
  177. package/dist/node_modules/remark-flow/dist/variable-name.es.js.map +1 -0
  178. package/dist/node_modules/style-to-object/cjs/index.cjs +1 -1
  179. package/dist/node_modules/style-to-object/cjs/index.cjs.map +1 -1
  180. package/dist/node_modules/style-to-object/cjs/index.es.js +1 -1
  181. package/dist/node_modules/unified/lib/index.cjs +1 -1
  182. package/dist/node_modules/unified/lib/index.es.js +1 -1
  183. package/package.json +2 -2
@@ -1,21 +1,22 @@
1
- import { remarkPlugins as H } from "./markdown-plugins.es.js";
2
- import { findResumedProseFence as P } from "./resumed-prose-fence.es.js";
3
- import { readHtmlMarkup as L, findStreamingHtmlBlockEnd as D, isHtmlRawTextTag as N } from "./html-block-end.es.js";
4
- import { unified as B } from "../../../node_modules/unified/lib/index.es.js";
5
- import X from "../../../node_modules/remark-parse/lib/index.es.js";
6
- import { visit as $ } from "../../../node_modules/unist-util-visit/lib/index.es.js";
7
- const q = B().use(X).use(H), F = 16, C = 256 * 1024, G = Object.freeze([]), R = /* @__PURE__ */ new Map();
8
- let x = 0;
9
- const I = (e) => {
1
+ import { d as N } from "../../../_virtual/index.es.js";
2
+ import { remarkPlugins as B } from "./markdown-plugins.es.js";
3
+ import { findResumedProseFence as X } from "./resumed-prose-fence.es.js";
4
+ import { readHtmlMarkup as $, findStreamingHtmlBlockEnd as q, isHtmlRawTextTag as F } from "./html-block-end.es.js";
5
+ import { unified as G } from "../../../node_modules/unified/lib/index.es.js";
6
+ import U from "../../../node_modules/remark-parse/lib/index.es.js";
7
+ import { visit as W } from "../../../node_modules/unist-util-visit/lib/index.es.js";
8
+ const Y = G().use(U).use(B), J = 16, H = 256 * 1024, K = Object.freeze([]), j = /* @__PURE__ */ new Map();
9
+ let A = 0;
10
+ const D = (e) => {
10
11
  if (e && typeof e == "object") {
11
- for (const o of Object.values(e)) I(o);
12
+ for (const o of Object.values(e)) D(o);
12
13
  Object.freeze(e);
13
14
  }
14
15
  return e;
15
- }, S = (e, o) => {
16
- let s = 0, t = "", r = !1, p = !1, f = "destination", n = -1;
16
+ }, P = (e, o) => {
17
+ let s = 0, t = "", c = !1, g = !1, f = "destination", n = -1;
17
18
  for (let a = o + 1; a < e.length; a += 1) {
18
- const l = e[a], h = /[ \t\r\n]/.test(l);
19
+ const l = e[a], m = /[ \t\r\n]/.test(l);
19
20
  if (l === `
20
21
  `) {
21
22
  if (n >= 0) return { end: n, pending: !0 };
@@ -25,21 +26,21 @@ const I = (e) => {
25
26
  l === "\\" ? a += 1 : l === t && (t = "", f = "close");
26
27
  else if (f === "destination")
27
28
  if (l === "\\")
28
- p = !0, a += 1;
29
- else if (r) {
29
+ g = !0, a += 1;
30
+ else if (c) {
30
31
  if (l === ">")
31
- r = !1, f = "after-angle";
32
+ c = !1, f = "after-angle";
32
33
  else if (l === "<" || /[\r\n]/.test(l)) return;
33
- } else if (h) {
34
+ } else if (m) {
34
35
  if (s) return;
35
- p && (f = "title");
36
- } else if (!p && l === "<")
37
- r = !0, p = !0;
36
+ g && (f = "title");
37
+ } else if (!g && l === "<")
38
+ c = !0, g = !0;
38
39
  else {
39
40
  if (l === ")" && s === 0) return { end: a + 1 };
40
- l === "(" ? s += 1 : l === ")" && (s -= 1), p = !0;
41
+ l === "(" ? s += 1 : l === ")" && (s -= 1), g = !0;
41
42
  }
42
- else if (h)
43
+ else if (m)
43
44
  f === "after-angle" && (f = "title");
44
45
  else {
45
46
  if (l === ")")
@@ -51,7 +52,7 @@ const I = (e) => {
51
52
  }
52
53
  }
53
54
  return { end: e.length, pending: !0 };
54
- }, T = (e, o, s) => {
55
+ }, L = (e, o, s) => {
55
56
  let t = o;
56
57
  if (!s) {
57
58
  for (; e[t] === " " || e[t] === " "; ) t += 1;
@@ -63,67 +64,67 @@ const I = (e) => {
63
64
  if (e[t] !== ">") return;
64
65
  t += 1;
65
66
  } else {
66
- const h = t;
67
+ const m = t;
67
68
  for (; t < e.length && !/\s/.test(e[t]); ) {
68
69
  if (e[t] === "<" || e[t] === ">") return;
69
70
  t += e[t] === "\\" ? 2 : 1;
70
71
  }
71
- if (t === h) return;
72
+ if (t === m) return;
72
73
  }
73
74
  }
74
- let r = 0;
75
- const p = t;
75
+ let c = 0;
76
+ const g = t;
76
77
  for (; t < e.length && /\s/.test(e[t]); ) {
77
78
  if (e[t] === `
78
- ` && ++r > 1) return;
79
+ ` && ++c > 1) return;
79
80
  t += 1;
80
81
  }
81
82
  const f = e[t];
82
- if (t === p || f !== '"' && f !== "'" && f !== "(")
83
+ if (t === g || f !== '"' && f !== "'" && f !== "(")
83
84
  return;
84
85
  const n = t, a = f === "(" ? ")" : f;
85
86
  let l = -1;
86
87
  for (t += 1; t < e.length; t += 1) {
87
- const h = e[t];
88
- if (h === `
88
+ const m = e[t];
89
+ if (m === `
89
90
  `) {
90
91
  if (l >= 0)
91
92
  return { start: n, end: l, pending: !0 };
92
93
  l = t;
93
- } else /[ \t\r]/.test(h) || (l = -1);
94
- if (h === "\\") t += 1;
95
- else if (h === a) return;
94
+ } else /[ \t\r]/.test(m) || (l = -1);
95
+ if (m === "\\") t += 1;
96
+ else if (m === a) return;
96
97
  }
97
98
  return { start: n, end: e.length, pending: !0 };
98
- }, U = (e, o) => {
99
+ }, Q = (e, o) => {
99
100
  let s = o - 1;
100
101
  for (; s >= 0 && e[s] === " " && o - s <= 3; )
101
102
  s -= 1;
102
103
  return s < 0 || e[s] === `
103
104
  `;
104
- }, W = (e, o, s, t) => {
105
- const r = [], p = [], f = [];
106
- let n = 0, a = 0, l = 0, h = 0, M = -1;
107
- const k = (m) => {
108
- for (const g of f)
109
- g.image && p.push({
110
- start: g.start + 1,
111
- end: m,
112
- imageAltEnd: m,
105
+ }, Z = (e, o, s, t) => {
106
+ const c = [], g = [], f = [];
107
+ let n = 0, a = 0, l = 0, m = 0, z = -1;
108
+ const v = (E) => {
109
+ for (const p of f)
110
+ p.image && g.push({
111
+ start: p.start + 1,
112
+ end: E,
113
+ imageAltEnd: E,
113
114
  pending: !0
114
115
  });
115
116
  };
116
117
  for (; n < e.length; ) {
117
118
  for (; o[a]?.end <= n; ) a += 1;
118
- const m = o[a];
119
- if (m && m.start <= n) {
120
- t.has(m.start) && f[f.length - 1]?.start === m.start - 1 && f.pop(), n = m.end;
119
+ const E = o[a];
120
+ if (E && E.start <= n) {
121
+ t.has(E.start) && f[f.length - 1]?.start === E.start - 1 && f.pop(), n = E.end;
121
122
  continue;
122
123
  }
123
- if (n >= l && n < h) {
124
- const d = P(e, n);
125
- if (d) {
126
- f.length = 0, n = d.end;
124
+ if (n >= l && n < m) {
125
+ const r = X(e, n);
126
+ if (r) {
127
+ f.length = 0, n = r.end;
127
128
  continue;
128
129
  }
129
130
  }
@@ -131,81 +132,81 @@ const I = (e) => {
131
132
  n += 2;
132
133
  continue;
133
134
  }
134
- if (e[n] === "!" && e[n + 1] === "[" && (M = n + 1), n >= l && e[n] === "[")
135
- f.push({ start: n, image: n === M });
135
+ if (e[n] === "!" && e[n + 1] === "[" && (z = n + 1), n >= l && e[n] === "[")
136
+ f.push({ start: n, image: n === z });
136
137
  else if (n >= l && e[n] === "]") {
137
- const d = f.pop();
138
- if (d !== void 0) {
139
- if (d.image) {
140
- let i;
138
+ const r = f.pop();
139
+ if (r !== void 0) {
140
+ if (r.image) {
141
+ let u;
141
142
  if (e[n + 1] === "(")
142
- i = S(e, n + 1);
143
+ u = P(e, n + 1);
143
144
  else if (n + 1 === e.length)
144
- i = { end: e.length, pending: !0 };
145
+ u = { end: e.length, pending: !0 };
145
146
  else if (e[n + 1] === "[") {
146
- let c = n + 2;
147
- for (; c < e.length && e[c] !== "]" && e[c] !== "[" && e[c] !== `
147
+ let h = n + 2;
148
+ for (; h < e.length && e[h] !== "]" && e[h] !== "[" && e[h] !== `
148
149
  `; )
149
- c += e[c] === "\\" ? 2 : 1;
150
- (c === e.length || e[c] === "]") && (i = {
151
- end: e[c] === "]" ? c + 1 : e.length,
150
+ h += e[h] === "\\" ? 2 : 1;
151
+ (h === e.length || e[h] === "]") && (u = {
152
+ end: e[h] === "]" ? h + 1 : e.length,
152
153
  pending: !0
153
154
  });
154
155
  }
155
- if (i) {
156
- p.push({
157
- start: d.start + 1,
156
+ if (u) {
157
+ g.push({
158
+ start: r.start + 1,
158
159
  imageAltEnd: n,
159
- ...i
160
- }), n = i.end;
160
+ ...u
161
+ }), n = u.end;
161
162
  continue;
162
163
  }
163
164
  }
164
- if (!d.image && e[n + 1] === "(" && m?.start !== n + 1) {
165
- const i = S(e, n + 1);
166
- if (i) {
167
- p.push({ start: n + 1, ...i }), n = i.end;
165
+ if (!r.image && e[n + 1] === "(" && E?.start !== n + 1) {
166
+ const u = P(e, n + 1);
167
+ if (u) {
168
+ g.push({ start: n + 1, ...u }), n = u.end;
168
169
  continue;
169
170
  }
170
171
  }
171
- if (e[n + 1] === ":" && U(e, d.start)) {
172
- const i = T(e, n + 2, !1);
173
- if (i) {
174
- p.push({ ...i, start: n + 1 }), n = i.end;
172
+ if (e[n + 1] === ":" && Q(e, r.start)) {
173
+ const u = L(e, n + 2, !1);
174
+ if (u) {
175
+ g.push({ ...u, start: n + 1 }), n = u.end;
175
176
  continue;
176
177
  }
177
178
  }
178
179
  }
179
180
  } else if (e[n] === `
180
181
  `) {
181
- let d = n - 1;
182
- for (; /[ \t\r]/.test(e[d] ?? ""); ) d -= 1;
183
- e[d] === `
184
- ` && (k(d), f.length = 0);
182
+ let r = n - 1;
183
+ for (; /[ \t\r]/.test(e[r] ?? ""); ) r -= 1;
184
+ e[r] === `
185
+ ` && (v(r), f.length = 0);
185
186
  }
186
187
  if (e[n] !== "<") {
187
188
  n += 1;
188
189
  continue;
189
190
  }
190
- const g = L(e, n);
191
+ const p = $(e, n);
191
192
  if (e.startsWith("<!--", n)) {
192
- const d = g.kind === "comment" ? g.end : e.length;
193
- r.push(Object.freeze({ start: n, end: d })), n = d;
194
- } else if (g.kind === "tag") {
195
- if (!g.closing && n >= l && s.has(n) && (l = D(e, n), h = s.get(n), f.length = 0), n = g.end, !g.closing && N(g.name)) {
196
- const d = new RegExp(`</${g.name}(?=[\\s/>])`, "gi");
197
- d.lastIndex = n, n = d.exec(e)?.index ?? e.length;
193
+ const r = p.kind === "comment" ? p.end : e.length;
194
+ c.push(Object.freeze({ start: n, end: r })), n = r;
195
+ } else if (p.kind === "tag") {
196
+ if (!p.closing && n >= l && s.has(n) && (l = q(e, n), m = s.get(n), f.length = 0), n = p.end, !p.closing && F(p.name)) {
197
+ const r = new RegExp(`</${p.name}(?=[\\s/>])`, "gi");
198
+ r.lastIndex = n, n = r.exec(e)?.index ?? e.length;
198
199
  }
199
- } else if (g.kind === "declaration")
200
- n = g.end;
200
+ } else if (p.kind === "declaration")
201
+ n = p.end;
201
202
  else {
202
- if (g.kind === "incomplete")
203
+ if (p.kind === "incomplete")
203
204
  break;
204
205
  n += 1;
205
206
  }
206
207
  }
207
- return k(e.length), { comments: r, metadata: p };
208
- }, Y = (e) => {
208
+ return v(e.length), { comments: c, metadata: g };
209
+ }, w = (e) => {
209
210
  e.sort((s, t) => s.start - t.start);
210
211
  const o = [];
211
212
  for (const s of e) {
@@ -229,108 +230,131 @@ const I = (e) => {
229
230
  }) : o.push(Object.freeze(s));
230
231
  }
231
232
  return o;
232
- }, J = (e, o, s) => {
233
+ }, ee = (e, o, s) => {
233
234
  let t = 1;
234
- for (let r = o + 2; r < s; r += 1)
235
- if (e[r] === "\\") r += 1;
236
- else if (e[r] === "[") t += 1;
237
- else if (e[r] === "]" && --t === 0) return r + 1;
235
+ for (let c = o + 2; c < s; c += 1)
236
+ if (e[c] === "\\") c += 1;
237
+ else if (e[c] === "[") t += 1;
238
+ else if (e[c] === "]" && --t === 0) return c + 1;
238
239
  return s;
239
- }, K = (e) => {
240
- const o = q.parse(e), s = [], t = [], r = [], p = [], f = [], n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
241
- $(o, (i, c, u) => {
242
- const y = i.position?.start.offset, E = i.position?.end.offset;
243
- if (y === void 0 || E === void 0) return;
244
- if (i.type === "definition" && !a.has(i.identifier) && a.set(i.identifier, E), i.type === "definition" || i.type === "link" || i.type === "linkReference" || i.type === "image" || i.type === "imageReference") {
245
- let b = y, j;
240
+ }, te = (e) => {
241
+ const o = Y.parse(e), s = [], t = [], c = [], g = [], f = [], n = [], a = [], l = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ new Map();
242
+ W(o, (i, d, b) => {
243
+ const y = i.position?.start.offset, R = i.position?.end.offset;
244
+ if (y === void 0 || R === void 0) return;
245
+ if (["flowInteraction", "flowVariableMarker"].includes(i.type)) {
246
+ const O = Object.freeze({ start: y, end: R });
247
+ g.push(O), String(i.type) === "flowInteraction" && f.push(O);
248
+ return;
249
+ }
250
+ if (i.type === "definition" && !m.has(i.identifier) && m.set(i.identifier, R), i.type === "definition" || i.type === "link" || i.type === "linkReference" || i.type === "image" || i.type === "imageReference") {
251
+ let O = y, x;
246
252
  if (i.type === "image" || i.type === "imageReference")
247
- b = y + 2, j = J(e, y, E) - 1;
253
+ O = y + 2, x = ee(e, y, R) - 1;
248
254
  else if (i.type !== "definition" && e[y] === "[") {
249
- const v = i.children[i.children.length - 1]?.position?.end.offset ?? y + 1;
250
- if (b = e.indexOf("]", v) + 1, b <= v || b > E) return;
255
+ const k = i.children[i.children.length - 1]?.position?.end.offset ?? y + 1;
256
+ if (O = e.indexOf("]", k) + 1, O <= k || O > R) return;
251
257
  }
252
- if (b < E) {
253
- const v = i.type === "definition" && !i.title ? T(e, E, !0) : void 0, A = {
254
- start: b,
255
- end: v?.end ?? E,
256
- ...v ? { pending: !0 } : {},
257
- ...j === void 0 ? {} : { imageAltEnd: j }
258
+ if (O < R) {
259
+ const k = i.type === "definition" && !i.title ? L(e, R, !0) : void 0, _ = {
260
+ start: O,
261
+ end: k?.end ?? R,
262
+ ...k ? { pending: !0 } : {},
263
+ ...x === void 0 ? {} : { imageAltEnd: x }
258
264
  };
259
- p.push(A), i.type === "imageReference" && l.set(A, i.identifier);
265
+ n.push(_), i.type === "imageReference" && z.set(_, i.identifier);
260
266
  }
261
267
  return;
262
268
  }
263
- const z = i.type === "inlineCode" || i.type === "code";
264
- if (!z && i.type !== "inlineMath" && i.type !== "math" && i.type !== "html")
269
+ const T = i.type === "inlineCode" || i.type === "code";
270
+ if (!T && i.type !== "inlineMath" && i.type !== "math" && i.type !== "html")
265
271
  return;
266
- const O = Object.freeze({ start: y, end: E });
272
+ const M = Object.freeze({ start: y, end: R });
267
273
  if (i.type === "html") {
268
- f.push(O), u && u.type !== "paragraph" && u.type !== "heading" && u.type !== "tableCell" && u.type !== "link" && u.type !== "linkReference" && u.type !== "emphasis" && u.type !== "strong" && u.type !== "delete" && n.set(y, E);
274
+ a.push(M), b && b.type !== "paragraph" && b.type !== "heading" && b.type !== "tableCell" && b.type !== "link" && b.type !== "linkReference" && b.type !== "emphasis" && b.type !== "strong" && b.type !== "delete" && l.set(y, R);
269
275
  return;
270
276
  }
271
- r.push(O), z && t.push(O), i.type === "inlineCode" && s.push(O);
277
+ c.push(M), T && t.push(M), i.type === "inlineCode" && s.push(M);
272
278
  });
273
- const h = p.map((i) => {
274
- const c = l.get(i);
275
- return c === void 0 ? i : {
279
+ const v = n.map((i) => {
280
+ const d = z.get(i);
281
+ return d === void 0 ? i : {
276
282
  ...i,
277
283
  imageResolveEnd: Math.max(
278
284
  i.end,
279
- a.get(c) ?? i.end
285
+ m.get(d) ?? i.end
280
286
  )
281
287
  };
282
- }), M = [...r, ...h].sort(
283
- (i, c) => i.start - c.start
284
- ), k = W(
288
+ }), E = [...c, ...v, ...a], p = N.findDocumentVariableMarkers(e).map(
289
+ ({ start: i, end: d }) => Object.freeze({ start: i, end: d })
290
+ ), r = p.filter(
291
+ (i) => !E.some(
292
+ (d) => d.start <= i.start && i.start < d.end
293
+ )
294
+ );
295
+ c.push(
296
+ ...r.filter(
297
+ (i) => !g.some(
298
+ (d) => d.start <= i.start && i.end <= d.end
299
+ )
300
+ ),
301
+ ...g
302
+ );
303
+ const u = [...c, ...v].sort(
304
+ (i, d) => i.start - d.start
305
+ ), h = Z(
285
306
  e,
286
- M,
287
- n,
307
+ u,
308
+ l,
288
309
  new Set(
289
- h.filter((i) => i.imageAltEnd !== void 0).map((i) => i.start)
310
+ v.filter((i) => i.imageAltEnd !== void 0).map((i) => i.start)
290
311
  )
291
- ), m = Y([
292
- ...h,
293
- ...k.metadata
294
- ]), g = k.comments;
295
- r.push(...m, ...g), r.sort((i, c) => i.start - c.start);
296
- const d = [];
312
+ ), C = w([
313
+ ...v,
314
+ ...h.metadata
315
+ ]), S = h.comments;
316
+ c.push(...C, ...S), c.sort((i, d) => i.start - d.start);
317
+ const I = [];
297
318
  for (const i of o.children) {
298
- const c = i.position?.start.offset, u = i.position?.end.offset;
299
- if (i.type !== "code" || c === void 0 || u === void 0)
319
+ const d = i.position?.start.offset, b = i.position?.end.offset;
320
+ if (i.type !== "code" || d === void 0 || b === void 0)
300
321
  continue;
301
322
  const y = e.lastIndexOf(`
302
- `, c - 1) + 1;
303
- /^[ \t]{0,3}$/.test(e.slice(y, c)) && /^(?:`{3,}|~{3,})/.test(e.slice(c)) && d.push(Object.freeze({ start: y, end: u }));
323
+ `, d - 1) + 1;
324
+ /^[ \t]{0,3}$/.test(e.slice(y, d)) && /^(?:`{3,}|~{3,})/.test(e.slice(d)) && I.push(Object.freeze({ start: y, end: b }));
304
325
  }
305
326
  return Object.freeze({
306
- tree: I(o),
327
+ tree: D(o),
307
328
  inline: Object.freeze(s),
308
329
  markdown: Object.freeze(t),
309
- literal: Object.freeze(r),
310
- metadata: Object.freeze(m),
311
- comments: Object.freeze(g),
312
- fences: Object.freeze(d),
313
- html: Object.freeze(f)
330
+ literal: Object.freeze(c),
331
+ variables: Object.freeze(r.map((i) => Object.freeze(i))),
332
+ documentVariables: Object.freeze(p),
333
+ interactions: Object.freeze(f),
334
+ metadata: Object.freeze(C),
335
+ comments: Object.freeze(S),
336
+ fences: Object.freeze(I),
337
+ html: Object.freeze(a)
314
338
  });
315
- }, Q = (e) => {
316
- const o = R.get(e);
339
+ }, ne = (e) => {
340
+ const o = j.get(e);
317
341
  if (o)
318
- return R.delete(e), R.set(e, o), o;
319
- const s = K(e);
320
- if (e.length > C) return s;
321
- for (; R.size >= F || x + e.length > C; ) {
322
- const t = R.keys().next().value;
342
+ return j.delete(e), j.set(e, o), o;
343
+ const s = te(e);
344
+ if (e.length > H) return s;
345
+ for (; j.size >= J || A + e.length > H; ) {
346
+ const t = j.keys().next().value;
323
347
  if (t === void 0) break;
324
- x -= t.length, R.delete(t);
348
+ A -= t.length, j.delete(t);
325
349
  }
326
- return R.set(e, s), x += e.length, s;
327
- }, _ = (e, o) => {
328
- const s = Q(e);
350
+ return j.set(e, s), A += e.length, s;
351
+ }, V = (e, o) => {
352
+ const s = ne(e);
329
353
  return o ? s.inline : s.markdown;
330
- }, ie = (e) => e.includes("`") ? _(e, !0) : G, se = (e) => _(e, !1);
354
+ }, de = (e) => e.includes("`") ? V(e, !0) : K, ae = (e) => V(e, !1);
331
355
  export {
332
- ie as getInlineCodeRanges,
333
- se as getMarkdownCodeRanges,
334
- Q as getMarkdownSourceAnalysis
356
+ de as getInlineCodeRanges,
357
+ ae as getMarkdownCodeRanges,
358
+ ne as getMarkdownSourceAnalysis
335
359
  };
336
360
  //# sourceMappingURL=inline-code-ranges.es.js.map