markdown-flow-ui 0.2.26 → 0.2.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/escaping.cjs +2 -0
- package/dist/_virtual/escaping.cjs.map +1 -0
- package/dist/_virtual/escaping.es.js +5 -0
- package/dist/_virtual/escaping.es.js.map +1 -0
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.es.js +27 -26
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.es.js.map +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 +131 -117
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js.map +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 +25 -23
- package/dist/lib/interaction-defaults.es.js.map +1 -1
- package/dist/node_modules/remark-flow/dist/escaping.cjs +3 -0
- package/dist/node_modules/remark-flow/dist/escaping.cjs.map +1 -0
- package/dist/node_modules/remark-flow/dist/escaping.es.js +96 -0
- package/dist/node_modules/remark-flow/dist/escaping.es.js.map +1 -0
- 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 +46 -25
- 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 +123 -106
- 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 +19 -18
- package/dist/node_modules/remark-flow/dist/interaction-plugin-core.es.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction-plugin-core.cjs","sources":["../../../../node_modules/remark-flow/dist/interaction-plugin-core.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.transformInteractionsInTree = transformInteractionsInTree;\nconst unist_util_visit_1 = require(\"unist-util-visit\");\nconst interaction_parser_1 = require(\"./interaction-parser\");\n/**\n * Create AST node segments\n */\nfunction createSegments(value, startIndex, endIndex, parsedResult, hName) {\n return [\n {\n type: 'text',\n value: value.substring(0, startIndex),\n },\n {\n type: 'element',\n data: {\n hName,\n hProperties: parsedResult,\n },\n },\n {\n type: 'text',\n value: value.substring(endIndex),\n },\n ];\n}\n/**\n * Shared visitor body for the remark plugins: find `?[...]` interaction\n * syntax in text nodes and replace it with a `custom-variable` element.\n * remark-interaction and remark-custom-variable are thin wrappers around\n * this (they only differ in the warning label used on parse failures).\n *\n * @param tree - The AST to transform in place\n * @param warnLabel - Label used in the console warning on parse failures\n */\nfunction transformInteractionsInTree(tree, warnLabel) {\n const parser = new interaction_parser_1.InteractionParser();\n (0, unist_util_visit_1.visit)(tree, 'text', (node, index, parent) => {\n // Input validation\n if (index === null || parent === null)\n return;\n const value = node.value;\n // Check if contains interaction syntax\n const interactionRegex =
|
|
1
|
+
{"version":3,"file":"interaction-plugin-core.cjs","sources":["../../../../node_modules/remark-flow/dist/interaction-plugin-core.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.transformInteractionsInTree = transformInteractionsInTree;\nconst unist_util_visit_1 = require(\"unist-util-visit\");\nconst interaction_parser_1 = require(\"./interaction-parser\");\nconst escaping_1 = require(\"./escaping\");\n/**\n * Create AST node segments\n */\nfunction createSegments(value, startIndex, endIndex, parsedResult, hName) {\n return [\n {\n type: 'text',\n value: value.substring(0, startIndex),\n },\n {\n type: 'element',\n data: {\n hName,\n hProperties: parsedResult,\n },\n },\n {\n type: 'text',\n value: value.substring(endIndex),\n },\n ];\n}\n/**\n * Shared visitor body for the remark plugins: find `?[...]` interaction\n * syntax in text nodes and replace it with a `custom-variable` element.\n * remark-interaction and remark-custom-variable are thin wrappers around\n * this (they only differ in the warning label used on parse failures).\n *\n * @param tree - The AST to transform in place\n * @param warnLabel - Label used in the console warning on parse failures\n */\nfunction transformInteractionsInTree(tree, warnLabel) {\n const parser = new interaction_parser_1.InteractionParser();\n (0, unist_util_visit_1.visit)(tree, 'text', (node, index, parent) => {\n // Input validation\n if (index === null || parent === null)\n return;\n const value = node.value;\n // Check if contains interaction syntax\n const interactionRegex = new RegExp(`\\\\?\\\\[(${escaping_1.INTERACTION_CONTENT_SOURCE})\\\\](?!\\\\()`);\n const match = interactionRegex.exec(value);\n if (match) {\n const fullMatch = match[0];\n const startIndex = match.index;\n const endIndex = startIndex + fullMatch.length;\n try {\n // Check for invalid variable syntax: keep the original text\n // instead of misparsing %{variable} / %{{}} as display buttons.\n const innerContent = match[1];\n if (innerContent.includes('%{')) {\n if (!innerContent.includes('%{{')) {\n // Contains invalid variable syntax %{variable} instead of %{{variable}}\n return;\n }\n // Check for empty variable name %{{}}\n if (innerContent.includes('%{{}}')) {\n return;\n }\n }\n const parsedResult = parser.parseToRemarkFormat(fullMatch);\n // Create AST segments\n const segments = createSegments(value, startIndex, endIndex, parsedResult, 'custom-variable');\n parent.children.splice(index, 1, ...segments);\n }\n catch (error) {\n console.warn(`Failed to parse ${warnLabel} syntax:`, error);\n // Keep original if parsing fails\n }\n }\n });\n}\n//# sourceMappingURL=interaction-plugin-core.js.map"],"names":["interactionPluginCore","transformInteractionsInTree","unist_util_visit_1","require$$0","interaction_parser_1","require$$1","escaping_1","require$$2","createSegments","value","startIndex","endIndex","parsedResult","hName","tree","warnLabel","parser","node","index","parent","match","fullMatch","innerContent","segments","error"],"mappings":"4SACA,OAAO,eAAeA,EAAAA,UAAS,aAAc,CAAE,MAAO,GAAM,EAC5DA,EAAAA,UAAA,4BAAsCC,EACtC,MAAMC,EAAqBC,EAAAA,QACrBC,EAAuBC,EAAAA,UAAA,EACvBC,EAAaC,EAAAA,UAAA,EAInB,SAASC,EAAeC,EAAOC,EAAYC,EAAUC,EAAcC,EAAO,CACtE,MAAO,CACH,CACI,KAAM,OACN,MAAOJ,EAAM,UAAU,EAAGC,CAAU,GAExC,CACI,KAAM,UACN,KAAM,CACF,MAAAG,EACA,YAAaD,IAGrB,CACI,KAAM,OACN,MAAOH,EAAM,UAAUE,CAAQ,GAG3C,CAUA,SAASV,EAA4Ba,EAAMC,EAAW,CAClD,MAAMC,EAAS,IAAIZ,EAAqB,qBACpCF,EAAmB,OAAOY,EAAM,OAAQ,CAACG,EAAMC,EAAOC,IAAW,CAEjE,GAAID,IAAU,MAAQC,IAAW,KAC7B,OACJ,MAAMV,EAAQQ,EAAK,MAGbG,EADmB,IAAI,OAAO,UAAUd,EAAW,0BAA0B,aAAa,EACjE,KAAKG,CAAK,EACzC,GAAIW,EAAO,CACP,MAAMC,EAAYD,EAAM,CAAC,EACnBV,EAAaU,EAAM,MACnBT,EAAWD,EAAaW,EAAU,OACxC,GAAI,CAGA,MAAMC,EAAeF,EAAM,CAAC,EAC5B,GAAIE,EAAa,SAAS,IAAI,IACtB,CAACA,EAAa,SAAS,KAAK,GAK5BA,EAAa,SAAS,OAAO,GAC7B,OAGR,MAAMV,EAAeI,EAAO,oBAAoBK,CAAS,EAEnDE,EAAWf,EAAeC,EAAOC,EAAYC,EAAUC,EAAc,iBAAiB,EAC5FO,EAAO,SAAS,OAAOD,EAAO,EAAG,GAAGK,CAAQ,CAC5D,OACmBC,EAAO,CACV,QAAQ,KAAK,mBAAmBT,CAAS,WAAYS,CAAK,CAE1E,CACA,CACA,CAAK,CACL","x_google_ignoreList":[0]}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { __exports as i } from "../../../_virtual/interaction-plugin-core.es.js";
|
|
2
|
-
import
|
|
3
|
-
import { __require as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import R from "../../../_virtual/index.es3.js";
|
|
3
|
+
import { __require as h } from "./interaction-parser.es.js";
|
|
4
|
+
import { __require as C } from "./escaping.es.js";
|
|
5
|
+
var _;
|
|
6
|
+
function N() {
|
|
7
|
+
if (_) return i;
|
|
8
|
+
_ = 1, Object.defineProperty(i, "__esModule", { value: !0 }), i.transformInteractionsInTree = x;
|
|
9
|
+
const f = R, m = h(), d = C();
|
|
10
|
+
function g(t, s, o, a, r) {
|
|
10
11
|
return [
|
|
11
12
|
{
|
|
12
13
|
type: "text",
|
|
13
|
-
value: t.substring(0,
|
|
14
|
+
value: t.substring(0, s)
|
|
14
15
|
},
|
|
15
16
|
{
|
|
16
17
|
type: "element",
|
|
@@ -21,26 +22,26 @@ function C() {
|
|
|
21
22
|
},
|
|
22
23
|
{
|
|
23
24
|
type: "text",
|
|
24
|
-
value: t.substring(
|
|
25
|
+
value: t.substring(o)
|
|
25
26
|
}
|
|
26
27
|
];
|
|
27
28
|
}
|
|
28
|
-
function x(t,
|
|
29
|
-
const
|
|
30
|
-
(0,
|
|
29
|
+
function x(t, s) {
|
|
30
|
+
const o = new m.InteractionParser();
|
|
31
|
+
(0, f.visit)(t, "text", (a, r, c) => {
|
|
31
32
|
if (r === null || c === null)
|
|
32
33
|
return;
|
|
33
|
-
const u = a.value, n =
|
|
34
|
+
const u = a.value, n = new RegExp(`\\?\\[(${d.INTERACTION_CONTENT_SOURCE})\\](?!\\()`).exec(u);
|
|
34
35
|
if (n) {
|
|
35
|
-
const l = n[0],
|
|
36
|
+
const l = n[0], p = n.index, I = p + l.length;
|
|
36
37
|
try {
|
|
37
38
|
const e = n[1];
|
|
38
39
|
if (e.includes("%{") && (!e.includes("%{{") || e.includes("%{{}}")))
|
|
39
40
|
return;
|
|
40
|
-
const
|
|
41
|
+
const q = o.parseToRemarkFormat(l), v = g(u, p, I, q, "custom-variable");
|
|
41
42
|
c.children.splice(r, 1, ...v);
|
|
42
43
|
} catch (e) {
|
|
43
|
-
console.warn(`Failed to parse ${
|
|
44
|
+
console.warn(`Failed to parse ${s} syntax:`, e);
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
});
|
|
@@ -48,6 +49,6 @@ function C() {
|
|
|
48
49
|
return i;
|
|
49
50
|
}
|
|
50
51
|
export {
|
|
51
|
-
|
|
52
|
+
N as __require
|
|
52
53
|
};
|
|
53
54
|
//# sourceMappingURL=interaction-plugin-core.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction-plugin-core.es.js","sources":["../../../../node_modules/remark-flow/dist/interaction-plugin-core.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.transformInteractionsInTree = transformInteractionsInTree;\nconst unist_util_visit_1 = require(\"unist-util-visit\");\nconst interaction_parser_1 = require(\"./interaction-parser\");\n/**\n * Create AST node segments\n */\nfunction createSegments(value, startIndex, endIndex, parsedResult, hName) {\n return [\n {\n type: 'text',\n value: value.substring(0, startIndex),\n },\n {\n type: 'element',\n data: {\n hName,\n hProperties: parsedResult,\n },\n },\n {\n type: 'text',\n value: value.substring(endIndex),\n },\n ];\n}\n/**\n * Shared visitor body for the remark plugins: find `?[...]` interaction\n * syntax in text nodes and replace it with a `custom-variable` element.\n * remark-interaction and remark-custom-variable are thin wrappers around\n * this (they only differ in the warning label used on parse failures).\n *\n * @param tree - The AST to transform in place\n * @param warnLabel - Label used in the console warning on parse failures\n */\nfunction transformInteractionsInTree(tree, warnLabel) {\n const parser = new interaction_parser_1.InteractionParser();\n (0, unist_util_visit_1.visit)(tree, 'text', (node, index, parent) => {\n // Input validation\n if (index === null || parent === null)\n return;\n const value = node.value;\n // Check if contains interaction syntax\n const interactionRegex =
|
|
1
|
+
{"version":3,"file":"interaction-plugin-core.es.js","sources":["../../../../node_modules/remark-flow/dist/interaction-plugin-core.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.transformInteractionsInTree = transformInteractionsInTree;\nconst unist_util_visit_1 = require(\"unist-util-visit\");\nconst interaction_parser_1 = require(\"./interaction-parser\");\nconst escaping_1 = require(\"./escaping\");\n/**\n * Create AST node segments\n */\nfunction createSegments(value, startIndex, endIndex, parsedResult, hName) {\n return [\n {\n type: 'text',\n value: value.substring(0, startIndex),\n },\n {\n type: 'element',\n data: {\n hName,\n hProperties: parsedResult,\n },\n },\n {\n type: 'text',\n value: value.substring(endIndex),\n },\n ];\n}\n/**\n * Shared visitor body for the remark plugins: find `?[...]` interaction\n * syntax in text nodes and replace it with a `custom-variable` element.\n * remark-interaction and remark-custom-variable are thin wrappers around\n * this (they only differ in the warning label used on parse failures).\n *\n * @param tree - The AST to transform in place\n * @param warnLabel - Label used in the console warning on parse failures\n */\nfunction transformInteractionsInTree(tree, warnLabel) {\n const parser = new interaction_parser_1.InteractionParser();\n (0, unist_util_visit_1.visit)(tree, 'text', (node, index, parent) => {\n // Input validation\n if (index === null || parent === null)\n return;\n const value = node.value;\n // Check if contains interaction syntax\n const interactionRegex = new RegExp(`\\\\?\\\\[(${escaping_1.INTERACTION_CONTENT_SOURCE})\\\\](?!\\\\()`);\n const match = interactionRegex.exec(value);\n if (match) {\n const fullMatch = match[0];\n const startIndex = match.index;\n const endIndex = startIndex + fullMatch.length;\n try {\n // Check for invalid variable syntax: keep the original text\n // instead of misparsing %{variable} / %{{}} as display buttons.\n const innerContent = match[1];\n if (innerContent.includes('%{')) {\n if (!innerContent.includes('%{{')) {\n // Contains invalid variable syntax %{variable} instead of %{{variable}}\n return;\n }\n // Check for empty variable name %{{}}\n if (innerContent.includes('%{{}}')) {\n return;\n }\n }\n const parsedResult = parser.parseToRemarkFormat(fullMatch);\n // Create AST segments\n const segments = createSegments(value, startIndex, endIndex, parsedResult, 'custom-variable');\n parent.children.splice(index, 1, ...segments);\n }\n catch (error) {\n console.warn(`Failed to parse ${warnLabel} syntax:`, error);\n // Keep original if parsing fails\n }\n }\n });\n}\n//# sourceMappingURL=interaction-plugin-core.js.map"],"names":["interactionPluginCore","transformInteractionsInTree","unist_util_visit_1","require$$0","interaction_parser_1","require$$1","escaping_1","require$$2","createSegments","value","startIndex","endIndex","parsedResult","hName","tree","warnLabel","parser","node","index","parent","match","fullMatch","innerContent","segments","error"],"mappings":";;;;;;;SACA,OAAO,eAAeA,GAAS,cAAc,EAAE,OAAO,IAAM,GAC5DA,EAAA,8BAAsCC;AACtC,QAAMC,IAAqBC,GACrBC,IAAuBC,EAAA,GACvBC,IAAaC,EAAA;AAInB,WAASC,EAAeC,GAAOC,GAAYC,GAAUC,GAAcC,GAAO;AACtE,WAAO;AAAA,MACH;AAAA,QACI,MAAM;AAAA,QACN,OAAOJ,EAAM,UAAU,GAAGC,CAAU;AAAA;MAExC;AAAA,QACI,MAAM;AAAA,QACN,MAAM;AAAA,UACF,OAAAG;AAAA,UACA,aAAaD;AAAA;;MAGrB;AAAA,QACI,MAAM;AAAA,QACN,OAAOH,EAAM,UAAUE,CAAQ;AAAA;;EAG3C;AAUA,WAASV,EAA4Ba,GAAMC,GAAW;AAClD,UAAMC,IAAS,IAAIZ,EAAqB,kBAAiB;AACzD,QAAIF,EAAmB,OAAOY,GAAM,QAAQ,CAACG,GAAMC,GAAOC,MAAW;AAEjE,UAAID,MAAU,QAAQC,MAAW;AAC7B;AACJ,YAAMV,IAAQQ,EAAK,OAGbG,IADmB,IAAI,OAAO,UAAUd,EAAW,0BAA0B,aAAa,EACjE,KAAKG,CAAK;AACzC,UAAIW,GAAO;AACP,cAAMC,IAAYD,EAAM,CAAC,GACnBV,IAAaU,EAAM,OACnBT,IAAWD,IAAaW,EAAU;AACxC,YAAI;AAGA,gBAAMC,IAAeF,EAAM,CAAC;AAC5B,cAAIE,EAAa,SAAS,IAAI,MACtB,CAACA,EAAa,SAAS,KAAK,KAK5BA,EAAa,SAAS,OAAO;AAC7B;AAGR,gBAAMV,IAAeI,EAAO,oBAAoBK,CAAS,GAEnDE,IAAWf,EAAeC,GAAOC,GAAYC,GAAUC,GAAc,iBAAiB;AAC5F,UAAAO,EAAO,SAAS,OAAOD,GAAO,GAAG,GAAGK,CAAQ;AAAA,QAC5D,SACmBC,GAAO;AACV,kBAAQ,KAAK,mBAAmBT,CAAS,YAAYS,CAAK;AAAA,QAE1E;AAAA,MACA;AAAA,IACA,CAAK;AAAA,EACL;;;","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"rehype-katex": "^7.0.1",
|
|
39
39
|
"rehype-raw": "^7.0.0",
|
|
40
40
|
"remark-breaks": "^4.0.0",
|
|
41
|
-
"remark-flow": "^1.2
|
|
41
|
+
"remark-flow": "^1.3.2",
|
|
42
42
|
"remark-gfm": "^4.0.1",
|
|
43
43
|
"remark-math": "^6.0.0",
|
|
44
44
|
"tailwind-merge": "^3.3.1",
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
]
|
|
183
183
|
}
|
|
184
184
|
},
|
|
185
|
-
"version": "0.2.
|
|
185
|
+
"version": "0.2.27",
|
|
186
186
|
"type": "module",
|
|
187
187
|
"exports": {
|
|
188
188
|
".": {
|