markdown-flow-ui 0.2.36-dev.1 → 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.
- package/README.md +11 -11
- package/dist/_virtual/index.es10.js +2 -2
- package/dist/_virtual/index.es3.js +5 -4
- package/dist/_virtual/index.es3.js.map +1 -1
- package/dist/_virtual/index.es4.js +4 -5
- package/dist/_virtual/index.es4.js.map +1 -1
- package/dist/_virtual/index.es5.js +5 -5
- package/dist/_virtual/index.es6.js +5 -3
- package/dist/_virtual/index.es6.js.map +1 -1
- package/dist/_virtual/index.es7.js +3 -5
- package/dist/_virtual/index.es7.js.map +1 -1
- package/dist/_virtual/index.es9.js +2 -2
- package/dist/_virtual/index10.cjs +1 -1
- package/dist/_virtual/index3.cjs +1 -1
- package/dist/_virtual/index4.cjs +1 -1
- package/dist/_virtual/index5.cjs +1 -1
- package/dist/_virtual/index6.cjs +1 -1
- package/dist/_virtual/index7.cjs +1 -1
- package/dist/_virtual/index9.cjs +1 -1
- package/dist/_virtual/variable-marker.cjs +2 -0
- package/dist/_virtual/variable-marker.cjs.map +1 -0
- package/dist/_virtual/variable-marker.es.js +5 -0
- package/dist/_virtual/variable-marker.es.js.map +1 -0
- package/dist/components/ContentRender/ContentRender.cjs +2 -2
- package/dist/components/ContentRender/ContentRender.cjs.map +1 -1
- package/dist/components/ContentRender/ContentRender.es.js +206 -205
- package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
- package/dist/components/ContentRender/utils/inline-code-ranges.cjs +9 -9
- package/dist/components/ContentRender/utils/inline-code-ranges.cjs.map +1 -1
- package/dist/components/ContentRender/utils/inline-code-ranges.d.ts +3 -0
- package/dist/components/ContentRender/utils/inline-code-ranges.es.js +185 -161
- package/dist/components/ContentRender/utils/inline-code-ranges.es.js.map +1 -1
- package/dist/components/ContentRender/utils/mermaid-parse.cjs +4 -4
- package/dist/components/ContentRender/utils/mermaid-parse.cjs.map +1 -1
- package/dist/components/ContentRender/utils/mermaid-parse.es.js +53 -48
- package/dist/components/ContentRender/utils/mermaid-parse.es.js.map +1 -1
- package/dist/components/ContentRender/utils/split-content.cjs +6 -6
- package/dist/components/ContentRender/utils/split-content.cjs.map +1 -1
- package/dist/components/ContentRender/utils/split-content.d.ts +1 -0
- package/dist/components/ContentRender/utils/split-content.es.js +361 -313
- package/dist/components/ContentRender/utils/split-content.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.es.js +278 -283
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.es.js +57 -58
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.es.js +1 -1
- package/dist/components/MarkdownFlowEditor/locales/de-DE.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/de-DE.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/de-DE.json.es.js +19 -19
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.es.js +5 -5
- package/dist/components/MarkdownFlowEditor/locales/es-ES.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/es-ES.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/es-ES.json.es.js +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fil-PH.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fil-PH.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fil-PH.json.es.js +15 -15
- package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.es.js +13 -13
- package/dist/components/MarkdownFlowEditor/locales/ja-JP.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ja-JP.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ja-JP.json.es.js +1 -1
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.es.js +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ur-PK.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ur-PK.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ur-PK.json.es.js +1 -1
- package/dist/components/MarkdownFlowEditor/locales/vi-VN.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/vi-VN.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/vi-VN.json.es.js +15 -15
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.es.js +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs +3 -3
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js +177 -176
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.cjs +2 -1
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.d.ts +3 -1
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.es.js +38 -55
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/utils.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/utils.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/utils.d.ts +2 -2
- package/dist/components/MarkdownFlowEditor/utils.es.js +34 -31
- package/dist/components/MarkdownFlowEditor/utils.es.js.map +1 -1
- package/dist/components/ui/inputGroup/textarea.cjs +1 -1
- package/dist/components/ui/inputGroup/textarea.es.js +1 -1
- package/dist/lib/interaction-defaults.cjs +1 -1
- package/dist/lib/interaction-defaults.cjs.map +1 -1
- package/dist/lib/interaction-defaults.es.js +124 -133
- package/dist/lib/interaction-defaults.es.js.map +1 -1
- package/dist/lib/interaction-defaults.failure.test.d.ts +1 -0
- package/dist/node_modules/classnames/index.cjs +1 -1
- package/dist/node_modules/classnames/index.es.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.cjs +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAMF2YG6.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAMF2YG6.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-OMD6QJNC.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-OMD6QJNC.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-U37J5Y7L.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-U37J5Y7L.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-WV7ZQ7D5.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-WV7ZQ7D5.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-4MX5Z3NR.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-4MX5Z3NR.es.js +1 -1
- package/dist/node_modules/rc-input/es/BaseInput.cjs +1 -1
- package/dist/node_modules/rc-input/es/BaseInput.es.js +1 -1
- package/dist/node_modules/rc-textarea/es/ResizableTextArea.cjs +1 -1
- package/dist/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
- package/dist/node_modules/rc-textarea/es/TextArea.cjs +1 -1
- package/dist/node_modules/rc-textarea/es/TextArea.es.js +1 -1
- package/dist/node_modules/rc-textarea/es/index.cjs +1 -1
- package/dist/node_modules/rc-textarea/es/index.es.js +1 -1
- package/dist/node_modules/remark-flow/dist/escaping.cjs +2 -2
- package/dist/node_modules/remark-flow/dist/escaping.cjs.map +1 -1
- package/dist/node_modules/remark-flow/dist/escaping.es.js +128 -63
- package/dist/node_modules/remark-flow/dist/escaping.es.js.map +1 -1
- package/dist/node_modules/remark-flow/dist/index.cjs +1 -1
- package/dist/node_modules/remark-flow/dist/index.cjs.map +1 -1
- package/dist/node_modules/remark-flow/dist/index.es.js +49 -37
- package/dist/node_modules/remark-flow/dist/index.es.js.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-parser.cjs +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-parser.cjs.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-parser.es.js +260 -255
- package/dist/node_modules/remark-flow/dist/interaction-parser.es.js.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-plugin-core.cjs +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-plugin-core.cjs.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-plugin-core.es.js +71 -42
- package/dist/node_modules/remark-flow/dist/interaction-plugin-core.es.js.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-syntax.cjs +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-syntax.cjs.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-syntax.es.js +500 -46
- package/dist/node_modules/remark-flow/dist/interaction-syntax.es.js.map +1 -1
- package/dist/node_modules/remark-flow/dist/variable-marker.cjs +2 -0
- package/dist/node_modules/remark-flow/dist/variable-marker.cjs.map +1 -0
- package/dist/node_modules/remark-flow/dist/variable-marker.es.js +77 -0
- package/dist/node_modules/remark-flow/dist/variable-marker.es.js.map +1 -0
- package/dist/node_modules/remark-flow/dist/variable-name.cjs +14 -1
- package/dist/node_modules/remark-flow/dist/variable-name.cjs.map +1 -1
- package/dist/node_modules/remark-flow/dist/variable-name.es.js +742 -25
- package/dist/node_modules/remark-flow/dist/variable-name.es.js.map +1 -1
- package/dist/node_modules/style-to-object/cjs/index.cjs +1 -1
- package/dist/node_modules/style-to-object/cjs/index.cjs.map +1 -1
- package/dist/node_modules/style-to-object/cjs/index.es.js +1 -1
- package/dist/node_modules/unified/lib/index.cjs +1 -1
- package/dist/node_modules/unified/lib/index.es.js +1 -1
- package/package.json +2 -2
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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))
|
|
12
|
+
for (const o of Object.values(e)) D(o);
|
|
12
13
|
Object.freeze(e);
|
|
13
14
|
}
|
|
14
15
|
return e;
|
|
15
|
-
},
|
|
16
|
-
let s = 0, t = "",
|
|
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],
|
|
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
|
-
|
|
29
|
-
else if (
|
|
29
|
+
g = !0, a += 1;
|
|
30
|
+
else if (c) {
|
|
30
31
|
if (l === ">")
|
|
31
|
-
|
|
32
|
+
c = !1, f = "after-angle";
|
|
32
33
|
else if (l === "<" || /[\r\n]/.test(l)) return;
|
|
33
|
-
} else if (
|
|
34
|
+
} else if (m) {
|
|
34
35
|
if (s) return;
|
|
35
|
-
|
|
36
|
-
} else if (!
|
|
37
|
-
|
|
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),
|
|
41
|
+
l === "(" ? s += 1 : l === ")" && (s -= 1), g = !0;
|
|
41
42
|
}
|
|
42
|
-
else if (
|
|
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
|
-
},
|
|
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
|
|
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 ===
|
|
72
|
+
if (t === m) return;
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
|
-
let
|
|
75
|
-
const
|
|
75
|
+
let c = 0;
|
|
76
|
+
const g = t;
|
|
76
77
|
for (; t < e.length && /\s/.test(e[t]); ) {
|
|
77
78
|
if (e[t] === `
|
|
78
|
-
` && ++
|
|
79
|
+
` && ++c > 1) return;
|
|
79
80
|
t += 1;
|
|
80
81
|
}
|
|
81
82
|
const f = e[t];
|
|
82
|
-
if (t ===
|
|
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
|
|
88
|
-
if (
|
|
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(
|
|
94
|
-
if (
|
|
95
|
-
else if (
|
|
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
|
-
},
|
|
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
|
-
},
|
|
105
|
-
const
|
|
106
|
-
let n = 0, a = 0, l = 0,
|
|
107
|
-
const
|
|
108
|
-
for (const
|
|
109
|
-
|
|
110
|
-
start:
|
|
111
|
-
end:
|
|
112
|
-
imageAltEnd:
|
|
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
|
|
119
|
-
if (
|
|
120
|
-
t.has(
|
|
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 <
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
f.length = 0, n =
|
|
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] === "[" && (
|
|
135
|
-
f.push({ start: n, image: n ===
|
|
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
|
|
138
|
-
if (
|
|
139
|
-
if (
|
|
140
|
-
let
|
|
138
|
+
const r = f.pop();
|
|
139
|
+
if (r !== void 0) {
|
|
140
|
+
if (r.image) {
|
|
141
|
+
let u;
|
|
141
142
|
if (e[n + 1] === "(")
|
|
142
|
-
|
|
143
|
+
u = P(e, n + 1);
|
|
143
144
|
else if (n + 1 === e.length)
|
|
144
|
-
|
|
145
|
+
u = { end: e.length, pending: !0 };
|
|
145
146
|
else if (e[n + 1] === "[") {
|
|
146
|
-
let
|
|
147
|
-
for (;
|
|
147
|
+
let h = n + 2;
|
|
148
|
+
for (; h < e.length && e[h] !== "]" && e[h] !== "[" && e[h] !== `
|
|
148
149
|
`; )
|
|
149
|
-
|
|
150
|
-
(
|
|
151
|
-
end: e[
|
|
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 (
|
|
156
|
-
|
|
157
|
-
start:
|
|
156
|
+
if (u) {
|
|
157
|
+
g.push({
|
|
158
|
+
start: r.start + 1,
|
|
158
159
|
imageAltEnd: n,
|
|
159
|
-
...
|
|
160
|
-
}), n =
|
|
160
|
+
...u
|
|
161
|
+
}), n = u.end;
|
|
161
162
|
continue;
|
|
162
163
|
}
|
|
163
164
|
}
|
|
164
|
-
if (!
|
|
165
|
-
const
|
|
166
|
-
if (
|
|
167
|
-
|
|
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] === ":" &&
|
|
172
|
-
const
|
|
173
|
-
if (
|
|
174
|
-
|
|
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
|
|
182
|
-
for (; /[ \t\r]/.test(e[
|
|
183
|
-
e[
|
|
184
|
-
` && (
|
|
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
|
|
191
|
+
const p = $(e, n);
|
|
191
192
|
if (e.startsWith("<!--", n)) {
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
} else if (
|
|
195
|
-
if (!
|
|
196
|
-
const
|
|
197
|
-
|
|
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 (
|
|
200
|
-
n =
|
|
200
|
+
} else if (p.kind === "declaration")
|
|
201
|
+
n = p.end;
|
|
201
202
|
else {
|
|
202
|
-
if (
|
|
203
|
+
if (p.kind === "incomplete")
|
|
203
204
|
break;
|
|
204
205
|
n += 1;
|
|
205
206
|
}
|
|
206
207
|
}
|
|
207
|
-
return
|
|
208
|
-
},
|
|
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
|
-
},
|
|
233
|
+
}, ee = (e, o, s) => {
|
|
233
234
|
let t = 1;
|
|
234
|
-
for (let
|
|
235
|
-
if (e[
|
|
236
|
-
else if (e[
|
|
237
|
-
else if (e[
|
|
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
|
-
},
|
|
240
|
-
const o =
|
|
241
|
-
|
|
242
|
-
const y = i.position?.start.offset,
|
|
243
|
-
if (y === void 0 ||
|
|
244
|
-
if (
|
|
245
|
-
|
|
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
|
-
|
|
253
|
+
O = y + 2, x = ee(e, y, R) - 1;
|
|
248
254
|
else if (i.type !== "definition" && e[y] === "[") {
|
|
249
|
-
const
|
|
250
|
-
if (
|
|
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 (
|
|
253
|
-
const
|
|
254
|
-
start:
|
|
255
|
-
end:
|
|
256
|
-
...
|
|
257
|
-
...
|
|
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
|
-
|
|
265
|
+
n.push(_), i.type === "imageReference" && z.set(_, i.identifier);
|
|
260
266
|
}
|
|
261
267
|
return;
|
|
262
268
|
}
|
|
263
|
-
const
|
|
264
|
-
if (!
|
|
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
|
|
272
|
+
const M = Object.freeze({ start: y, end: R });
|
|
267
273
|
if (i.type === "html") {
|
|
268
|
-
|
|
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
|
-
|
|
277
|
+
c.push(M), T && t.push(M), i.type === "inlineCode" && s.push(M);
|
|
272
278
|
});
|
|
273
|
-
const
|
|
274
|
-
const
|
|
275
|
-
return
|
|
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
|
-
|
|
285
|
+
m.get(d) ?? i.end
|
|
280
286
|
)
|
|
281
287
|
};
|
|
282
|
-
}),
|
|
283
|
-
(i,
|
|
284
|
-
),
|
|
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
|
-
|
|
287
|
-
|
|
307
|
+
u,
|
|
308
|
+
l,
|
|
288
309
|
new Set(
|
|
289
|
-
|
|
310
|
+
v.filter((i) => i.imageAltEnd !== void 0).map((i) => i.start)
|
|
290
311
|
)
|
|
291
|
-
),
|
|
292
|
-
...
|
|
293
|
-
...
|
|
294
|
-
]),
|
|
295
|
-
|
|
296
|
-
const
|
|
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
|
|
299
|
-
if (i.type !== "code" ||
|
|
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
|
-
`,
|
|
303
|
-
/^[ \t]{0,3}$/.test(e.slice(y,
|
|
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:
|
|
327
|
+
tree: D(o),
|
|
307
328
|
inline: Object.freeze(s),
|
|
308
329
|
markdown: Object.freeze(t),
|
|
309
|
-
literal: Object.freeze(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
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
|
-
},
|
|
316
|
-
const o =
|
|
339
|
+
}, ne = (e) => {
|
|
340
|
+
const o = j.get(e);
|
|
317
341
|
if (o)
|
|
318
|
-
return
|
|
319
|
-
const s =
|
|
320
|
-
if (e.length >
|
|
321
|
-
for (;
|
|
322
|
-
const t =
|
|
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
|
-
|
|
348
|
+
A -= t.length, j.delete(t);
|
|
325
349
|
}
|
|
326
|
-
return
|
|
327
|
-
},
|
|
328
|
-
const s =
|
|
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
|
-
},
|
|
354
|
+
}, de = (e) => e.includes("`") ? V(e, !0) : K, ae = (e) => V(e, !1);
|
|
331
355
|
export {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
356
|
+
de as getInlineCodeRanges,
|
|
357
|
+
ae as getMarkdownCodeRanges,
|
|
358
|
+
ne as getMarkdownSourceAnalysis
|
|
335
359
|
};
|
|
336
360
|
//# sourceMappingURL=inline-code-ranges.es.js.map
|