markdown-flow-ui 0.1.83-beta.29 → 0.1.83-beta.30
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/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/hast-util-to-jsx-runtime@2.3.6/node_modules/hast-util-to-jsx-runtime/lib/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/hast-util-to-jsx-runtime@2.3.6/node_modules/hast-util-to-jsx-runtime/lib/index.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-YG6GDRKO.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-YG6GDRKO.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-S3R3BYOJ.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-S3R3BYOJ.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-LVOFAZNH.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-LVOFAZNH.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/index.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-custom-variable.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-custom-variable.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-interaction.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-interaction.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.cjs.js.map +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.es.js +1 -1
- package/dist/_virtual/index.cjs10.js +1 -1
- package/dist/_virtual/index.cjs2.js +1 -1
- package/dist/_virtual/index.cjs3.js +1 -1
- package/dist/_virtual/index.cjs4.js +1 -1
- package/dist/_virtual/index.cjs5.js +1 -1
- package/dist/_virtual/index.cjs6.js +1 -1
- package/dist/_virtual/index.cjs7.js +1 -1
- package/dist/_virtual/index.cjs8.js +1 -1
- package/dist/_virtual/index.es10.js +2 -2
- package/dist/_virtual/index.es2.js +2 -5
- package/dist/_virtual/index.es2.js.map +1 -1
- package/dist/_virtual/index.es3.js +4 -2
- package/dist/_virtual/index.es3.js.map +1 -1
- package/dist/_virtual/index.es4.js +5 -4
- package/dist/_virtual/index.es4.js.map +1 -1
- package/dist/_virtual/index.es5.js +5 -2
- package/dist/_virtual/index.es5.js.map +1 -1
- package/dist/_virtual/index.es6.js +4 -4
- package/dist/_virtual/index.es7.js +3 -5
- package/dist/_virtual/index.es7.js.map +1 -1
- package/dist/_virtual/index.es8.js +2 -3
- package/dist/_virtual/index.es8.js.map +1 -1
- package/dist/components/ContentRender/utils/split-content.cjs.js +2 -2
- package/dist/components/ContentRender/utils/split-content.cjs.js.map +1 -1
- package/dist/components/ContentRender/utils/split-content.es.js +80 -71
- package/dist/components/ContentRender/utils/split-content.es.js.map +1 -1
- package/dist/components/ui/inputGroup/textarea.cjs.js +1 -1
- package/dist/components/ui/inputGroup/textarea.es.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as e } from "../../../../../../../../../_virtual/index.
|
|
1
|
+
import { __exports as e } from "../../../../../../../../../_virtual/index.es2.js";
|
|
2
2
|
import { __require as _ } from "./remark-custom-variable.es.js";
|
|
3
3
|
import { __require as m } from "./remark-flow.es.js";
|
|
4
4
|
import { __require as f } from "./remark-interaction.es.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../../../../../../../../_virtual/remark-custom-variable.cjs.js"),g=require("../../../../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../../../../../../../../_virtual/remark-custom-variable.cjs.js"),g=require("../../../../../../../../../_virtual/index.cjs3.js"),y=require("./interaction-parser.cjs.js");var _;function h(){if(_)return s.__exports;_=1,Object.defineProperty(s.__exports,"__esModule",{value:!0}),s.__exports.default=f;const d=g.default,m=y.__require();function p(t,a,o,r,n){return[{type:"text",value:t.substring(0,a)},{type:"element",data:{hName:n,hProperties:r}},{type:"text",value:t.substring(o)}]}function f(){return t=>{const a=new m.InteractionParser;(0,d.visit)(t,"text",(o,r,n)=>{if(r===null||n===null)return;const u=o.value,i=/\?\[([^\]]*)\](?!\()/.exec(u);if(i){const c=i[0],l=i.index,x=l+c.length;try{const e=i[1];if(e.includes("%{")&&(!e.includes("%{{")||e.includes("%{{}}")))return;const b=a.parseToRemarkFormat(c),v=p(u,l,x,b,"custom-variable");n.children.splice(r,1,...v)}catch(e){console.warn("Failed to parse variable interaction syntax:",e)}}})}}return s.__exports}exports.__require=h;
|
|
2
2
|
//# sourceMappingURL=remark-custom-variable.cjs.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __exports as a } from "../../../../../../../../../_virtual/remark-custom-variable.es.js";
|
|
2
|
-
import g from "../../../../../../../../../_virtual/index.
|
|
2
|
+
import g from "../../../../../../../../../_virtual/index.es3.js";
|
|
3
3
|
import { __require as h } from "./interaction-parser.es.js";
|
|
4
4
|
var m;
|
|
5
5
|
function C() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../../../../../../../../_virtual/remark-interaction.cjs.js"),v=require("../../../../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../../../../../../../../_virtual/remark-interaction.cjs.js"),v=require("../../../../../../../../../_virtual/index.cjs3.js"),y=require("./interaction-parser.cjs.js");var _;function h(){if(_)return n.__exports;_=1,Object.defineProperty(n.__exports,"__esModule",{value:!0}),n.__exports.default=m;const d=v.default,p=y.__require();function x(e,i,s,t,r){return[{type:"text",value:e.substring(0,i)},{type:"element",data:{hName:r,hProperties:t}},{type:"text",value:e.substring(s)}]}function m(){return e=>{const i=new p.InteractionParser;(0,d.visit)(e,"text",(s,t,r)=>{if(t===null||r===null)return;const c=s.value,o=/\?\[([^\]]*)\](?!\()/.exec(c);if(o){const u=o[0],l=o.index,f=l+u.length;try{const a=i.parseToRemarkFormat(u),g=x(c,l,f,a,"custom-variable");r.children.splice(t,1,...g)}catch(a){console.warn("Failed to parse interaction syntax:",a)}}})}}return n.__exports}exports.__require=h;
|
|
2
2
|
//# sourceMappingURL=remark-interaction.cjs.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __exports as n } from "../../../../../../../../../_virtual/remark-interaction.es.js";
|
|
2
|
-
import I from "../../../../../../../../../_virtual/index.
|
|
2
|
+
import I from "../../../../../../../../../_virtual/index.es3.js";
|
|
3
3
|
import { __require as g } from "./interaction-parser.es.js";
|
|
4
4
|
var m;
|
|
5
5
|
function k() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../../../../../../../_virtual/index.cjs8.js"),a=require("../../../../inline-style-parser@0.2.4/node_modules/inline-style-parser/index.cjs.js");var i;function d(){if(i)return t.__exports;i=1;var s=t.__exports&&t.__exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t.__exports,"__esModule",{value:!0}),t.__exports.default=l;const f=s(a.__require());function l(e,o){let r=null;if(!e||typeof e!="string")return r;const c=(0,f.default)(e),p=typeof o=="function";return c.forEach(u=>{if(u.type!=="declaration")return;const{property:_,value:n}=u;p?o(_,n,u):n&&(r=r||{},r[_]=n)}),r}return t.__exports}exports.__require=d;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../../../../../../../../node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.js"],"sourcesContent":["\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = StyleToObject;\nconst inline_style_parser_1 = __importDefault(require(\"inline-style-parser\"));\n/**\n * Parses inline style to object.\n *\n * @param style - Inline style.\n * @param iterator - Iterator.\n * @returns - Style object or null.\n *\n * @example Parsing inline style to object:\n *\n * ```js\n * import parse from 'style-to-object';\n * parse('line-height: 42;'); // { 'line-height': '42' }\n * ```\n */\nfunction StyleToObject(style, iterator) {\n let styleObject = null;\n if (!style || typeof style !== 'string') {\n return styleObject;\n }\n const declarations = (0, inline_style_parser_1.default)(style);\n const hasIterator = typeof iterator === 'function';\n declarations.forEach((declaration) => {\n if (declaration.type !== 'declaration') {\n return;\n }\n const { property, value } = declaration;\n if (hasIterator) {\n iterator(property, value, declaration);\n }\n else if (value) {\n styleObject = styleObject || {};\n styleObject[property] = value;\n }\n });\n return styleObject;\n}\n//# sourceMappingURL=index.js.map"],"names":["__importDefault","this","mod","cjs","StyleToObject","inline_style_parser_1","require$$0","style","iterator","styleObject","declarations","hasIterator","declaration","property","value"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../../../../../../../node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.js"],"sourcesContent":["\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = StyleToObject;\nconst inline_style_parser_1 = __importDefault(require(\"inline-style-parser\"));\n/**\n * Parses inline style to object.\n *\n * @param style - Inline style.\n * @param iterator - Iterator.\n * @returns - Style object or null.\n *\n * @example Parsing inline style to object:\n *\n * ```js\n * import parse from 'style-to-object';\n * parse('line-height: 42;'); // { 'line-height': '42' }\n * ```\n */\nfunction StyleToObject(style, iterator) {\n let styleObject = null;\n if (!style || typeof style !== 'string') {\n return styleObject;\n }\n const declarations = (0, inline_style_parser_1.default)(style);\n const hasIterator = typeof iterator === 'function';\n declarations.forEach((declaration) => {\n if (declaration.type !== 'declaration') {\n return;\n }\n const { property, value } = declaration;\n if (hasIterator) {\n iterator(property, value, declaration);\n }\n else if (value) {\n styleObject = styleObject || {};\n styleObject[property] = value;\n }\n });\n return styleObject;\n}\n//# sourceMappingURL=index.js.map"],"names":["__importDefault","this","mod","cjs","StyleToObject","inline_style_parser_1","require$$0","style","iterator","styleObject","declarations","hasIterator","declaration","property","value"],"mappings":"qSACA,IAAIA,EAAmBC,EAAAA,WAAQA,EAAAA,UAAK,iBAAoB,SAAUC,EAAK,CACnE,OAAQA,GAAOA,EAAI,WAAcA,EAAM,CAAE,QAAWA,CAAG,CAC3D,EACA,OAAO,eAAeC,EAAAA,UAAS,aAAc,CAAE,MAAO,GAAM,EAC5DA,EAAAA,UAAA,QAAkBC,EAClB,MAAMC,EAAwBL,EAAgBM,EAAAA,WAA8B,EAe5E,SAASF,EAAcG,EAAOC,EAAU,CACpC,IAAIC,EAAc,KAClB,GAAI,CAACF,GAAS,OAAOA,GAAU,SAC3B,OAAOE,EAEX,MAAMC,KAAmBL,EAAsB,SAASE,CAAK,EACvDI,EAAc,OAAOH,GAAa,WACxC,OAAAE,EAAa,QAASE,GAAgB,CAClC,GAAIA,EAAY,OAAS,cACrB,OAEJ,KAAM,CAAE,SAAAC,EAAU,MAAAC,CAAK,EAAKF,EACxBD,EACAH,EAASK,EAAUC,EAAOF,CAAW,EAEhCE,IACLL,EAAcA,GAAe,CAAA,EAC7BA,EAAYI,CAAQ,EAAIC,EAEpC,CAAK,EACML,CACX","x_google_ignoreList":[0]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as r } from "../../../../../../../../../_virtual/index.
|
|
1
|
+
import { __exports as r } from "../../../../../../../../../_virtual/index.es8.js";
|
|
2
2
|
import { __require as p } from "../../../../inline-style-parser@0.2.4/node_modules/inline-style-parser/index.es.js";
|
|
3
3
|
var f;
|
|
4
4
|
function q() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("../../../../bail@2.0.2/node_modules/bail/index.cjs.js"),w=require("../../../../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("../../../../bail@2.0.2/node_modules/bail/index.cjs.js"),w=require("../../../../../../../../../_virtual/index.cjs6.js"),z=require("../../../../is-plain-obj@4.1.0/node_modules/is-plain-obj/index.cjs.js"),C=require("./callable-instance.cjs.js"),S=require("../../../../trough@2.2.0/node_modules/trough/lib/index.cjs.js"),A=require("../../../../vfile@6.0.3/node_modules/vfile/lib/index.cjs.js"),F={}.hasOwnProperty;class m extends C.CallableInstance{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=S.trough()}copy(){const e=new m;let n=-1;for(;++n<this.attachers.length;){const t=this.attachers[n];e.use(...t)}return e.data(w.default(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(x("data",this.frozen),this.namespace[e]=n,this):F.call(this.namespace,e)&&this.namespace[e]||void 0:e?(x("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...t]=this.attachers[this.freezeIndex];if(t[0]===!1)continue;t[0]===!0&&(t[0]=void 0);const i=n.call(e,...t);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=y(e),t=this.parser||this.Parser;return g("parse",t),t(String(n),n)}process(e,n){const t=this;return this.freeze(),g("process",this.parser||this.Parser),b("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,h){const u=y(e),l=t.parse(u);t.run(l,u,function(o,c,f){if(o||!c||!f)return s(o);const p=c,d=t.stringify(p,f);D(d)?f.value=d:f.result=d,s(o,f)});function s(o,c){o||!c?h(o):a?a(c):n(void 0,c)}}}processSync(e){let n=!1,t;return this.freeze(),g("processSync",this.parser||this.Parser),b("processSync",this.compiler||this.Compiler),this.process(e,i),T("processSync","process",n),t;function i(a,h){n=!0,P.bail(a),t=h}}run(e,n,t){I(e),this.freeze();const i=this.transformers;return!t&&typeof n=="function"&&(t=n,n=void 0),t?a(void 0,t):new Promise(a);function a(h,u){const l=y(n);i.run(e,l,s);function s(o,c,f){const p=c||e;o?u(o):h?h(p):t(void 0,p,f)}}}runSync(e,n){let t=!1,i;return this.run(e,n,a),T("runSync","run",t),i;function a(h,u){P.bail(h),i=u,t=!0}}stringify(e,n){this.freeze();const t=y(n),i=this.compiler||this.Compiler;return b("stringify",i),I(e),i(e,t)}use(e,...n){const t=this.attachers,i=this.namespace;if(x("use",this.frozen),e!=null)if(typeof e=="function")l(e,n);else if(typeof e=="object")Array.isArray(e)?u(e):h(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function a(s){if(typeof s=="function")l(s,[]);else if(typeof s=="object")if(Array.isArray(s)){const[o,...c]=s;l(o,c)}else h(s);else throw new TypeError("Expected usable value, not `"+s+"`")}function h(s){if(!("plugins"in s)&&!("settings"in s))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(s.plugins),s.settings&&(i.settings=w.default(!0,i.settings,s.settings))}function u(s){let o=-1;if(s!=null)if(Array.isArray(s))for(;++o<s.length;){const c=s[o];a(c)}else throw new TypeError("Expected a list of plugins, not `"+s+"`")}function l(s,o){let c=-1,f=-1;for(;++c<t.length;)if(t[c][0]===s){f=c;break}if(f===-1)t.push([s,...o]);else if(o.length>0){let[p,...d]=o;const E=t[f][1];z.default(E)&&z.default(p)&&(p=w.default(!0,E,p)),t[f]=[s,p,...d]}}}}const q=new m().freeze();function g(r,e){if(typeof e!="function")throw new TypeError("Cannot `"+r+"` without `parser`")}function b(r,e){if(typeof e!="function")throw new TypeError("Cannot `"+r+"` without `compiler`")}function x(r,e){if(e)throw new Error("Cannot call `"+r+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function I(r){if(!z.default(r)||typeof r.type!="string")throw new TypeError("Expected node, got `"+r+"`")}function T(r,e,n){if(!n)throw new Error("`"+r+"` finished async. Use `"+e+"` instead")}function y(r){return j(r)?r:new A.VFile(r)}function j(r){return!!(r&&typeof r=="object"&&"message"in r&&"messages"in r)}function D(r){return typeof r=="string"||L(r)}function L(r){return!!(r&&typeof r=="object"&&"byteLength"in r&&"byteOffset"in r)}exports.Processor=m;exports.unified=q;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { bail as P } from "../../../../bail@2.0.2/node_modules/bail/index.es.js";
|
|
2
|
-
import y from "../../../../../../../../../_virtual/index.
|
|
2
|
+
import y from "../../../../../../../../../_virtual/index.es6.js";
|
|
3
3
|
import z from "../../../../is-plain-obj@4.1.0/node_modules/is-plain-obj/index.es.js";
|
|
4
4
|
import { CallableInstance as C } from "./callable-instance.es.js";
|
|
5
5
|
import { trough as A } from "../../../../trough@2.2.0/node_modules/trough/lib/index.es.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
|
|
2
2
|
//# sourceMappingURL=index.cjs10.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
|
2
2
|
//# sourceMappingURL=index.cjs2.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./_commonjsHelpers.cjs.js"),t=require("../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unist-util-visit@5.0.0/node_modules/unist-util-visit/index.cjs.js"),r=e.getAugmentedNamespace(t);exports.default=r;
|
|
2
2
|
//# sourceMappingURL=index.cjs3.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./_commonjsHelpers.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./_commonjsHelpers.cjs.js"),r=require("../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.cjs.js");var s=r.__require();const t=e.getDefaultExportFromCjs(s);exports.default=t;
|
|
2
2
|
//# sourceMappingURL=index.cjs4.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./_commonjsHelpers.cjs.js"),r=require("../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/style-to-js@1.1.18/node_modules/style-to-js/cjs/index.cjs.js");var t=r.__require();const o=e.getDefaultExportFromCjs(t);exports.default=o;
|
|
2
2
|
//# sourceMappingURL=index.cjs5.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./_commonjsHelpers.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./_commonjsHelpers.cjs.js"),t=require("../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/extend@3.0.2/node_modules/extend/index.cjs.js");var r=t.__require();const o=e.getDefaultExportFromCjs(r);exports.default=o;
|
|
2
2
|
//# sourceMappingURL=index.cjs6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.cjs.js");var r=e.__require();exports.distExports=r;
|
|
2
2
|
//# sourceMappingURL=index.cjs7.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
|
2
2
|
//# sourceMappingURL=index.cjs8.js.map
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { __require as s } from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js";
|
|
3
|
-
var e = s();
|
|
4
|
-
const t = /* @__PURE__ */ r(e);
|
|
1
|
+
var r = {};
|
|
5
2
|
export {
|
|
6
|
-
|
|
3
|
+
r as __exports
|
|
7
4
|
};
|
|
8
5
|
//# sourceMappingURL=index.es2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es2.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { getAugmentedNamespace as e } from "./_commonjsHelpers.es.js";
|
|
2
|
+
import * as r from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unist-util-visit@5.0.0/node_modules/unist-util-visit/index.es.js";
|
|
3
|
+
const m = /* @__PURE__ */ e(r);
|
|
2
4
|
export {
|
|
3
|
-
|
|
5
|
+
m as default
|
|
4
6
|
};
|
|
5
7
|
//# sourceMappingURL=index.es3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es3.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.es.js";
|
|
2
|
+
import { __require as s } from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js";
|
|
3
|
+
var e = s();
|
|
4
|
+
const t = /* @__PURE__ */ r(e);
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
+
t as default
|
|
6
7
|
};
|
|
7
8
|
//# sourceMappingURL=index.es4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es4.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es4.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.es.js";
|
|
2
|
+
import { __require as o } from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/style-to-js@1.1.18/node_modules/style-to-js/cjs/index.es.js";
|
|
3
|
+
var t = o();
|
|
4
|
+
const a = /* @__PURE__ */ r(t);
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
a as default
|
|
4
7
|
};
|
|
5
8
|
//# sourceMappingURL=index.es5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es5.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es5.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getDefaultExportFromCjs as
|
|
2
|
-
import { __require as
|
|
3
|
-
var t =
|
|
4
|
-
const a = /* @__PURE__ */
|
|
1
|
+
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.es.js";
|
|
2
|
+
import { __require as r } from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/extend@3.0.2/node_modules/extend/index.es.js";
|
|
3
|
+
var t = r();
|
|
4
|
+
const a = /* @__PURE__ */ e(t);
|
|
5
5
|
export {
|
|
6
6
|
a as default
|
|
7
7
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
var t = r();
|
|
4
|
-
const a = /* @__PURE__ */ e(t);
|
|
1
|
+
import { __require as r } from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.es.js";
|
|
2
|
+
var i = r();
|
|
5
3
|
export {
|
|
6
|
-
|
|
4
|
+
i as d
|
|
7
5
|
};
|
|
8
6
|
//# sourceMappingURL=index.es7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es7.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es7.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
var i = r();
|
|
1
|
+
var r = {};
|
|
3
2
|
export {
|
|
4
|
-
|
|
3
|
+
r as __exports
|
|
5
4
|
};
|
|
6
5
|
//# sourceMappingURL=index.es8.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es8.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es8.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=/<(script|style|link|iframe|html|head|body|meta|title|base|template|div|section|article|main)[\s>]/i,R=[/<svg[\s\S]*?<\/svg>/i,/<img\b[^>]*?>/i,/```mermaid[\s\S]*?```/i,/```[a-zA-Z0-9]+[\s\S]*?```/i],M=/!\[[^\]]*]\([^\s)\n]+(?:\s+"[^"]*")?\)/i,B=/<\/[a-z][^>]*>\s*\n(?=[^\s<])/gi,O=/<custom-button-after-content\b[\s\S]*?<\/custom-button-after-content>/gi,T=t=>{const e=[],n=/```/g;let s;for(;(s=n.exec(t))!==null;){const o=s.index,c=n.exec(t);if(!c){e.push({start:o,end:t.length});break}e.push({start:o,end:c.index+3})}return e},_=(t,e)=>e.some(({start:n,end:s})=>t>=n&&t<s),y=(t,e,n)=>{const s=e.flags.includes("g")?e.flags:`${e.flags}g`,o=new RegExp(e.source,s);let c;for(;(c=o.exec(t))!==null;)if(!_(c.index,n))return c.index;return-1},P=(t,e)=>{let n=t.length,s;for(B.lastIndex=0;s=B.exec(t);)if(!(s.index<=e)){n=s.index+s[0].length;break}return n},F=t=>{if(!t.length)return t;const e=[];return t.forEach(n=>{if(n.type!=="sandbox"){e.push(n);return}O.lastIndex=0;let s=0,o;for(;(o=O.exec(n.value))!==null;){const i=n.value.slice(s,o.index);i.trim()&&e.push({type:"sandbox",value:i}),e.push({type:"markdown",value:o[0]}),s=o.index+o[0].length}const c=n.value.slice(s);c.trim()&&e.push({type:"sandbox",value:c})}),e},C=t=>{let e=null;return R.forEach(n=>{const s=n.exec(t);if(!s||typeof s.index!="number")return;const o=s.index,c=s.index+s[0].length;(!e||o<e.start)&&(e={start:o,end:c})}),e},z=(t,e)=>{const n=y(t,M,e);if(n===-1)return null;const s=t.slice(n).match(M);return s?{start:n,end:n+s[0].length}:null},D=t=>{const e=t.match(/^\s*\|.+\|\s*$/m);if(!e||typeof e.index!="number")return null;const n=e[0].match(/^\s*/)?.[0].length??0,s=e.index+n,o=t.slice(s).split(`
|
|
2
2
|
`),c=[];for(const h of o){if(!h.trim().startsWith("|"))break;c.push(h)}const i=c.join(`
|
|
3
|
-
`);return{start:
|
|
3
|
+
`);return{start:s,block:i,end:s+i.length}},f=(t,e=!1)=>{const n=l=>F(l),s=t.indexOf("```");if(e&&s!==-1&&t.indexOf("```",s+3)===-1)return n([{type:"markdown",value:t}]);const o=T(t),c=y(t,N,o),i=y(t,/<svg\b/i,o),h=c!==-1&&i!==-1&&c<i;if(i!==-1&&!h){const l=t.slice(0,i),r=t.indexOf("</svg>",i),a=r===-1?`${t.slice(i)}</svg>`:t.slice(i,r+6),b=r===-1?"":t.slice(r+6);if(e){const p=[];return l.trim()&&p.push({type:"text",value:l}),p.push({type:"markdown",value:a}),b.trim()&&p.push(...f(b,!0)),n(p)}if(r===-1)return n([{type:"markdown",value:a}])}const u=D(t);if(u){const l=[],r=t.slice(0,u.start);e&&r.trim()&&l.push({type:"text",value:r}),l.push({type:"markdown",value:u.block});const a=t.slice(u.end),b=a.length<t.length;return a.trim()&&b&&l.push(...e?f(a,!0):f(a)),n(l)}const m=C(t),g=z(t,o),d=m&&g?m.start<=g.start?m:g:m??g;if(c===-1&&!d)return e&&t.trim()?n([{type:"text",value:t}]):[];const v=!!d&&(c===-1||d.start<c),S=v?d.start:c,I=v?d.end:P(t,S),x=[],k=t.slice(0,S),A=t.slice(S,I),E=t.slice(I);return e&&k.trim()&&x.push({type:"text",value:k}),x.push({type:v?"markdown":"sandbox",value:A}),E.trim()&&x.push(...f(E,e)),n(x)};exports.splitContentSegments=f;
|
|
4
4
|
//# sourceMappingURL=split-content.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-content.cjs.js","sources":["../../../../src/components/ContentRender/utils/split-content.ts"],"sourcesContent":["export type RenderSegment =\n | { type: \"markdown\"; value: string }\n | { type: \"sandbox\"; value: string }\n | { type: \"text\"; value: string };\n\nconst SANDBOX_START_PATTERN =\n /<(script|style|link|iframe|html|head|body|meta|title|base|template|div|section|article|main)[\\s>]/i;\n\nconst INLINE_SANDBOX_PATTERNS: RegExp[] = [\n /<svg[\\s\\S]*?<\\/svg>/i,\n /<img\\b[^>]*?>/i,\n /```mermaid[\\s\\S]*?```/i,\n /```[a-zA-Z0-9]+[\\s\\S]*?```/i,\n];\n\nconst closingBoundary = /<\\/[a-z][^>]*>\\s*\\n(?=[^\\s<])/gi;\nconst CUSTOM_BUTTON_PATTERN =\n /<custom-button-after-content\\b[\\s\\S]*?<\\/custom-button-after-content>/gi;\n\ntype MatchResult = { start: number; end: number };\ntype FenceRange = { start: number; end: number };\n\nconst getFenceRanges = (raw: string): FenceRange[] => {\n const ranges: FenceRange[] = [];\n const fencePattern = /```/g;\n let match: RegExpExecArray | null;\n\n while ((match = fencePattern.exec(raw)) !== null) {\n const start = match.index;\n const closeMatch = fencePattern.exec(raw);\n if (!closeMatch) {\n ranges.push({ start, end: raw.length });\n break;\n }\n ranges.push({ start, end: closeMatch.index + 3 });\n }\n\n return ranges;\n};\n\nconst isIndexInRanges = (index: number, ranges: FenceRange[]) =>\n ranges.some(({ start, end }) => index >= start && index < end);\n\nconst findFirstMatchOutsideFence = (\n raw: string,\n pattern: RegExp,\n fenceRanges: FenceRange[]\n) => {\n const flags = pattern.flags.includes(\"g\")\n ? pattern.flags\n : `${pattern.flags}g`;\n const matcher = new RegExp(pattern.source, flags);\n let match: RegExpExecArray | null;\n\n while ((match = matcher.exec(raw)) !== null) {\n if (!isIndexInRanges(match.index, fenceRanges)) {\n return match.index;\n }\n }\n\n return -1;\n};\n\nconst findHtmlBlockEnd = (raw: string, startIndex: number) => {\n let blockEnd = raw.length;\n let match: RegExpExecArray | null;\n closingBoundary.lastIndex = 0;\n\n while ((match = closingBoundary.exec(raw))) {\n if (match.index <= startIndex) continue;\n blockEnd = match.index + match[0].length;\n break;\n }\n\n return blockEnd;\n};\n\nconst splitCustomButtonsFromSandbox = (segments: RenderSegment[]) => {\n if (!segments.length) return segments;\n const output: RenderSegment[] = [];\n\n segments.forEach((segment) => {\n if (segment.type !== \"sandbox\") {\n output.push(segment);\n return;\n }\n\n CUSTOM_BUTTON_PATTERN.lastIndex = 0;\n let lastIndex = 0;\n let match: RegExpExecArray | null;\n\n while ((match = CUSTOM_BUTTON_PATTERN.exec(segment.value)) !== null) {\n const before = segment.value.slice(lastIndex, match.index);\n if (before.trim()) {\n output.push({ type: \"sandbox\", value: before });\n }\n output.push({ type: \"markdown\", value: match[0] });\n lastIndex = match.index + match[0].length;\n }\n\n const rest = segment.value.slice(lastIndex);\n if (rest.trim()) {\n output.push({ type: \"sandbox\", value: rest });\n }\n });\n\n return output;\n};\n\nconst findInlineSandboxMatch = (raw: string): MatchResult | null => {\n let earliest: MatchResult | null = null;\n\n INLINE_SANDBOX_PATTERNS.forEach((pattern) => {\n const match = pattern.exec(raw);\n if (!match || typeof match.index !== \"number\") return;\n const start = match.index;\n const end = match.index + match[0].length;\n\n if (!earliest || start < earliest.start) {\n earliest = { start, end };\n }\n });\n\n return earliest;\n};\n\nconst extractTableBlock = (\n raw: string\n): { start: number; block: string; end: number } | null => {\n const tableMatch = raw.match(/^\\s*\\|.+\\|\\s*$/m);\n if (!tableMatch || typeof tableMatch.index !== \"number\") return null;\n\n const leadingSpaces = tableMatch[0].match(/^\\s*/)?.[0].length ?? 0;\n const tableStart = tableMatch.index + leadingSpaces;\n\n const lines = raw.slice(tableStart).split(\"\\n\");\n const tableLines: string[] = [];\n\n for (const line of lines) {\n const trimmed = line.trim();\n if (!trimmed.startsWith(\"|\")) break;\n tableLines.push(line);\n }\n\n const block = tableLines.join(\"\\n\");\n return { start: tableStart, block, end: tableStart + block.length };\n};\n\n// Split incoming markdown content into markdown and sandbox HTML segments\nexport const splitContentSegments = (\n raw: string,\n keepText = false\n): RenderSegment[] => {\n const finalizeSegments = (segments: RenderSegment[]) =>\n splitCustomButtonsFromSandbox(segments);\n\n const fenceStart = raw.indexOf(\"```\");\n if (keepText && fenceStart !== -1) {\n const closingFence = raw.indexOf(\"```\", fenceStart + 3);\n if (closingFence === -1) {\n return finalizeSegments([{ type: \"markdown\", value: raw }]);\n }\n }\n\n const fenceRanges = getFenceRanges(raw);\n // Avoid treating fenced code blocks as sandbox content.\n const sandboxStartIndex = findFirstMatchOutsideFence(\n raw,\n SANDBOX_START_PATTERN,\n fenceRanges\n );\n const svgOpenIndex = findFirstMatchOutsideFence(raw, /<svg\\b/i, fenceRanges);\n const hasSandboxBeforeSvg =\n sandboxStartIndex !== -1 &&\n svgOpenIndex !== -1 &&\n sandboxStartIndex < svgOpenIndex;\n if (svgOpenIndex !== -1 && !hasSandboxBeforeSvg) {\n const before = raw.slice(0, svgOpenIndex);\n const closeIdx = raw.indexOf(\"</svg>\", svgOpenIndex);\n const svgBlock =\n closeIdx === -1\n ? `${raw.slice(svgOpenIndex)}</svg>`\n : raw.slice(svgOpenIndex, closeIdx + \"</svg>\".length);\n const after = closeIdx === -1 ? \"\" : raw.slice(closeIdx + \"</svg>\".length);\n\n if (keepText) {\n const segments: RenderSegment[] = [];\n if (before.trim()) {\n segments.push({ type: \"text\", value: before });\n }\n segments.push({ type: \"markdown\", value: svgBlock });\n if (after.trim()) {\n segments.push(...splitContentSegments(after, true));\n }\n return finalizeSegments(segments);\n }\n\n if (closeIdx === -1) {\n return finalizeSegments([{ type: \"markdown\", value: svgBlock }]);\n }\n }\n\n const tableBlock = extractTableBlock(raw);\n if (tableBlock) {\n const segments: RenderSegment[] = [];\n const before = raw.slice(0, tableBlock.start);\n if (keepText && before.trim()) {\n segments.push({ type: \"text\", value: before });\n }\n segments.push({ type: \"markdown\", value: tableBlock.block });\n const after = raw.slice(tableBlock.end);\n const hasProgress = after.length < raw.length;\n if (after.trim() && hasProgress) {\n segments.push(\n ...(keepText\n ? splitContentSegments(after, true)\n : splitContentSegments(after))\n );\n }\n return finalizeSegments(segments);\n }\n\n const inlineMatch = findInlineSandboxMatch(raw);\n\n if (sandboxStartIndex === -1 && !inlineMatch) {\n if (keepText && raw.trim()) {\n return finalizeSegments([{ type: \"text\", value: raw }]);\n }\n return [];\n }\n\n const shouldUseInline =\n !!inlineMatch &&\n (sandboxStartIndex === -1 || inlineMatch.start < sandboxStartIndex);\n\n const startIndex = shouldUseInline ? inlineMatch!.start : sandboxStartIndex;\n const blockEnd = shouldUseInline\n ? inlineMatch!.end\n : findHtmlBlockEnd(raw, startIndex);\n\n const segments: RenderSegment[] = [];\n const before = raw.slice(0, startIndex);\n const matchedBlock = raw.slice(startIndex, blockEnd);\n const after = raw.slice(blockEnd);\n\n if (keepText && before.trim()) {\n segments.push({ type: \"text\", value: before });\n }\n\n segments.push({\n type: shouldUseInline ? \"markdown\" : \"sandbox\",\n value: matchedBlock,\n });\n\n if (after.trim()) {\n segments.push(...splitContentSegments(after, keepText));\n }\n\n return finalizeSegments(segments);\n};\n"],"names":["SANDBOX_START_PATTERN","INLINE_SANDBOX_PATTERNS","closingBoundary","CUSTOM_BUTTON_PATTERN","getFenceRanges","raw","ranges","fencePattern","match","start","closeMatch","isIndexInRanges","index","end","findFirstMatchOutsideFence","pattern","fenceRanges","flags","matcher","findHtmlBlockEnd","startIndex","blockEnd","splitCustomButtonsFromSandbox","segments","output","segment","lastIndex","before","rest","findInlineSandboxMatch","earliest","extractTableBlock","tableMatch","leadingSpaces","tableStart","lines","tableLines","line","block","splitContentSegments","keepText","finalizeSegments","fenceStart","sandboxStartIndex","svgOpenIndex","hasSandboxBeforeSvg","closeIdx","svgBlock","after","tableBlock","hasProgress","inlineMatch","shouldUseInline","matchedBlock"],"mappings":"gFAKA,MAAMA,EACJ,qGAEIC,EAAoC,CACxC,uBACA,iBACA,yBACA,6BACF,EAEMC,EAAkB,kCAClBC,EACJ,0EAKIC,EAAkBC,GAA8B,CACpD,MAAMC,EAAuB,CAAA,EACvBC,EAAe,OACrB,IAAIC,EAEJ,MAAQA,EAAQD,EAAa,KAAKF,CAAG,KAAO,MAAM,CAChD,MAAMI,EAAQD,EAAM,MACdE,EAAaH,EAAa,KAAKF,CAAG,EACxC,GAAI,CAACK,EAAY,CACfJ,EAAO,KAAK,CAAE,MAAAG,EAAO,IAAKJ,EAAI,OAAQ,EACtC,KACF,CACAC,EAAO,KAAK,CAAE,MAAAG,EAAO,IAAKC,EAAW,MAAQ,EAAG,CAClD,CAEA,OAAOJ,CACT,EAEMK,EAAkB,CAACC,EAAeN,IACtCA,EAAO,KAAK,CAAC,CAAE,MAAAG,EAAO,IAAAI,CAAA,IAAUD,GAASH,GAASG,EAAQC,CAAG,EAEzDC,EAA6B,CACjCT,EACAU,EACAC,IACG,CACH,MAAMC,EAAQF,EAAQ,MAAM,SAAS,GAAG,EACpCA,EAAQ,MACR,GAAGA,EAAQ,KAAK,IACdG,EAAU,IAAI,OAAOH,EAAQ,OAAQE,CAAK,EAChD,IAAIT,EAEJ,MAAQA,EAAQU,EAAQ,KAAKb,CAAG,KAAO,MACrC,GAAI,CAACM,EAAgBH,EAAM,MAAOQ,CAAW,EAC3C,OAAOR,EAAM,MAIjB,MAAO,EACT,EAEMW,EAAmB,CAACd,EAAae,IAAuB,CAC5D,IAAIC,EAAWhB,EAAI,OACfG,EAGJ,IAFAN,EAAgB,UAAY,EAEpBM,EAAQN,EAAgB,KAAKG,CAAG,GACtC,GAAI,EAAAG,EAAM,OAASY,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AAI,MAAMe,EAAYC,CAAQ,EAC7C2B,EAAQ3C,EAAI,MAAMgB,CAAQ,EAEhC,OAAImB,GAAYb,EAAO,QACrBJ,EAAS,KAAK,CAAE,KAAM,OAAQ,MAAOI,EAAQ,EAG/CJ,EAAS,KAAK,CACZ,KAAM6B,EAAkB,WAAa,UACrC,MAAOC,CAAA,CACR,EAEGL,EAAM,QACRzB,EAAS,KAAK,GAAGgB,EAAqBS,EAAOR,CAAQ,CAAC,EAGjDC,EAAiBlB,CAAQ,CAClC"}
|
|
1
|
+
{"version":3,"file":"split-content.cjs.js","sources":["../../../../src/components/ContentRender/utils/split-content.ts"],"sourcesContent":["export type RenderSegment =\n | { type: \"markdown\"; value: string }\n | { type: \"sandbox\"; value: string }\n | { type: \"text\"; value: string };\n\nconst SANDBOX_START_PATTERN =\n /<(script|style|link|iframe|html|head|body|meta|title|base|template|div|section|article|main)[\\s>]/i;\n\nconst INLINE_SANDBOX_PATTERNS: RegExp[] = [\n /<svg[\\s\\S]*?<\\/svg>/i,\n /<img\\b[^>]*?>/i,\n /```mermaid[\\s\\S]*?```/i,\n /```[a-zA-Z0-9]+[\\s\\S]*?```/i,\n];\nconst MARKDOWN_IMAGE_PATTERN = /!\\[[^\\]]*]\\([^\\s)\\n]+(?:\\s+\"[^\"]*\")?\\)/i;\n\nconst closingBoundary = /<\\/[a-z][^>]*>\\s*\\n(?=[^\\s<])/gi;\nconst CUSTOM_BUTTON_PATTERN =\n /<custom-button-after-content\\b[\\s\\S]*?<\\/custom-button-after-content>/gi;\n\ntype MatchResult = { start: number; end: number };\ntype FenceRange = { start: number; end: number };\n\nconst getFenceRanges = (raw: string): FenceRange[] => {\n const ranges: FenceRange[] = [];\n const fencePattern = /```/g;\n let match: RegExpExecArray | null;\n\n while ((match = fencePattern.exec(raw)) !== null) {\n const start = match.index;\n const closeMatch = fencePattern.exec(raw);\n if (!closeMatch) {\n ranges.push({ start, end: raw.length });\n break;\n }\n ranges.push({ start, end: closeMatch.index + 3 });\n }\n\n return ranges;\n};\n\nconst isIndexInRanges = (index: number, ranges: FenceRange[]) =>\n ranges.some(({ start, end }) => index >= start && index < end);\n\nconst findFirstMatchOutsideFence = (\n raw: string,\n pattern: RegExp,\n fenceRanges: FenceRange[]\n) => {\n const flags = pattern.flags.includes(\"g\")\n ? pattern.flags\n : `${pattern.flags}g`;\n const matcher = new RegExp(pattern.source, flags);\n let match: RegExpExecArray | null;\n\n while ((match = matcher.exec(raw)) !== null) {\n if (!isIndexInRanges(match.index, fenceRanges)) {\n return match.index;\n }\n }\n\n return -1;\n};\n\nconst findHtmlBlockEnd = (raw: string, startIndex: number) => {\n let blockEnd = raw.length;\n let match: RegExpExecArray | null;\n closingBoundary.lastIndex = 0;\n\n while ((match = closingBoundary.exec(raw))) {\n if (match.index <= startIndex) continue;\n blockEnd = match.index + match[0].length;\n break;\n }\n\n return blockEnd;\n};\n\nconst splitCustomButtonsFromSandbox = (segments: RenderSegment[]) => {\n if (!segments.length) return segments;\n const output: RenderSegment[] = [];\n\n segments.forEach((segment) => {\n if (segment.type !== \"sandbox\") {\n output.push(segment);\n return;\n }\n\n CUSTOM_BUTTON_PATTERN.lastIndex = 0;\n let lastIndex = 0;\n let match: RegExpExecArray | null;\n\n while ((match = CUSTOM_BUTTON_PATTERN.exec(segment.value)) !== null) {\n const before = segment.value.slice(lastIndex, match.index);\n if (before.trim()) {\n output.push({ type: \"sandbox\", value: before });\n }\n output.push({ type: \"markdown\", value: match[0] });\n lastIndex = match.index + match[0].length;\n }\n\n const rest = segment.value.slice(lastIndex);\n if (rest.trim()) {\n output.push({ type: \"sandbox\", value: rest });\n }\n });\n\n return output;\n};\n\nconst findInlineSandboxMatch = (raw: string): MatchResult | null => {\n let earliest: MatchResult | null = null;\n\n INLINE_SANDBOX_PATTERNS.forEach((pattern) => {\n const match = pattern.exec(raw);\n if (!match || typeof match.index !== \"number\") return;\n const start = match.index;\n const end = match.index + match[0].length;\n\n if (!earliest || start < earliest.start) {\n earliest = { start, end };\n }\n });\n\n return earliest;\n};\n\nconst findMarkdownImageMatch = (\n raw: string,\n fenceRanges: FenceRange[]\n): MatchResult | null => {\n const start = findFirstMatchOutsideFence(\n raw,\n MARKDOWN_IMAGE_PATTERN,\n fenceRanges\n );\n\n if (start === -1) return null;\n const match = raw.slice(start).match(MARKDOWN_IMAGE_PATTERN);\n if (!match) return null;\n\n return { start, end: start + match[0].length };\n};\n\nconst extractTableBlock = (\n raw: string\n): { start: number; block: string; end: number } | null => {\n const tableMatch = raw.match(/^\\s*\\|.+\\|\\s*$/m);\n if (!tableMatch || typeof tableMatch.index !== \"number\") return null;\n\n const leadingSpaces = tableMatch[0].match(/^\\s*/)?.[0].length ?? 0;\n const tableStart = tableMatch.index + leadingSpaces;\n\n const lines = raw.slice(tableStart).split(\"\\n\");\n const tableLines: string[] = [];\n\n for (const line of lines) {\n const trimmed = line.trim();\n if (!trimmed.startsWith(\"|\")) break;\n tableLines.push(line);\n }\n\n const block = tableLines.join(\"\\n\");\n return { start: tableStart, block, end: tableStart + block.length };\n};\n\n// Split incoming markdown content into markdown and sandbox HTML segments\nexport const splitContentSegments = (\n raw: string,\n keepText = false\n): RenderSegment[] => {\n const finalizeSegments = (segments: RenderSegment[]) =>\n splitCustomButtonsFromSandbox(segments);\n\n const fenceStart = raw.indexOf(\"```\");\n if (keepText && fenceStart !== -1) {\n const closingFence = raw.indexOf(\"```\", fenceStart + 3);\n if (closingFence === -1) {\n return finalizeSegments([{ type: \"markdown\", value: raw }]);\n }\n }\n\n const fenceRanges = getFenceRanges(raw);\n // Avoid treating fenced code blocks as sandbox content.\n const sandboxStartIndex = findFirstMatchOutsideFence(\n raw,\n SANDBOX_START_PATTERN,\n fenceRanges\n );\n const svgOpenIndex = findFirstMatchOutsideFence(raw, /<svg\\b/i, fenceRanges);\n const hasSandboxBeforeSvg =\n sandboxStartIndex !== -1 &&\n svgOpenIndex !== -1 &&\n sandboxStartIndex < svgOpenIndex;\n if (svgOpenIndex !== -1 && !hasSandboxBeforeSvg) {\n const before = raw.slice(0, svgOpenIndex);\n const closeIdx = raw.indexOf(\"</svg>\", svgOpenIndex);\n const svgBlock =\n closeIdx === -1\n ? `${raw.slice(svgOpenIndex)}</svg>`\n : raw.slice(svgOpenIndex, closeIdx + \"</svg>\".length);\n const after = closeIdx === -1 ? \"\" : raw.slice(closeIdx + \"</svg>\".length);\n\n if (keepText) {\n const segments: RenderSegment[] = [];\n if (before.trim()) {\n segments.push({ type: \"text\", value: before });\n }\n segments.push({ type: \"markdown\", value: svgBlock });\n if (after.trim()) {\n segments.push(...splitContentSegments(after, true));\n }\n return finalizeSegments(segments);\n }\n\n if (closeIdx === -1) {\n return finalizeSegments([{ type: \"markdown\", value: svgBlock }]);\n }\n }\n\n const tableBlock = extractTableBlock(raw);\n if (tableBlock) {\n const segments: RenderSegment[] = [];\n const before = raw.slice(0, tableBlock.start);\n if (keepText && before.trim()) {\n segments.push({ type: \"text\", value: before });\n }\n segments.push({ type: \"markdown\", value: tableBlock.block });\n const after = raw.slice(tableBlock.end);\n const hasProgress = after.length < raw.length;\n if (after.trim() && hasProgress) {\n segments.push(\n ...(keepText\n ? splitContentSegments(after, true)\n : splitContentSegments(after))\n );\n }\n return finalizeSegments(segments);\n }\n\n const inlineMatch = findInlineSandboxMatch(raw);\n const markdownImageMatch = findMarkdownImageMatch(raw, fenceRanges);\n const inlineCandidate =\n inlineMatch && markdownImageMatch\n ? inlineMatch.start <= markdownImageMatch.start\n ? inlineMatch\n : markdownImageMatch\n : (inlineMatch ?? markdownImageMatch);\n\n if (sandboxStartIndex === -1 && !inlineCandidate) {\n if (keepText && raw.trim()) {\n return finalizeSegments([{ type: \"text\", value: raw }]);\n }\n return [];\n }\n\n const shouldUseInline =\n !!inlineCandidate &&\n (sandboxStartIndex === -1 || inlineCandidate.start < sandboxStartIndex);\n\n const startIndex = shouldUseInline\n ? inlineCandidate!.start\n : sandboxStartIndex;\n const blockEnd = shouldUseInline\n ? inlineCandidate!.end\n : findHtmlBlockEnd(raw, startIndex);\n\n const segments: RenderSegment[] = [];\n const before = raw.slice(0, startIndex);\n const matchedBlock = raw.slice(startIndex, blockEnd);\n const after = raw.slice(blockEnd);\n\n if (keepText && before.trim()) {\n segments.push({ type: \"text\", value: before });\n }\n\n segments.push({\n type: shouldUseInline ? \"markdown\" : \"sandbox\",\n value: matchedBlock,\n });\n\n if (after.trim()) {\n segments.push(...splitContentSegments(after, keepText));\n }\n\n return finalizeSegments(segments);\n};\n"],"names":["SANDBOX_START_PATTERN","INLINE_SANDBOX_PATTERNS","MARKDOWN_IMAGE_PATTERN","closingBoundary","CUSTOM_BUTTON_PATTERN","getFenceRanges","raw","ranges","fencePattern","match","start","closeMatch","isIndexInRanges","index","end","findFirstMatchOutsideFence","pattern","fenceRanges","flags","matcher","findHtmlBlockEnd","startIndex","blockEnd","splitCustomButtonsFromSandbox","segments","output","segment","lastIndex","before","rest","findInlineSandboxMatch","earliest","findMarkdownImageMatch","extractTableBlock","tableMatch","leadingSpaces","tableStart","lines","tableLines","line","block","splitContentSegments","keepText","finalizeSegments","fenceStart","sandboxStartIndex","svgOpenIndex","hasSandboxBeforeSvg","closeIdx","svgBlock","after","tableBlock","hasProgress","inlineMatch","markdownImageMatch","inlineCandidate","shouldUseInline","matchedBlock"],"mappings":"gFAKA,MAAMA,EACJ,qGAEIC,EAAoC,CACxC,uBACA,iBACA,yBACA,6BACF,EACMC,EAAyB,0CAEzBC,EAAkB,kCAClBC,EACJ,0EAKIC,EAAkBC,GAA8B,CACpD,MAAMC,EAAuB,CAAA,EACvBC,EAAe,OACrB,IAAIC,EAEJ,MAAQA,EAAQD,EAAa,KAAKF,CAAG,KAAO,MAAM,CAChD,MAAMI,EAAQD,EAAM,MACdE,EAAaH,EAAa,KAAKF,CAAG,EACxC,GAAI,CAACK,EAAY,CACfJ,EAAO,KAAK,CAAE,MAAAG,EAAO,IAAKJ,EAAI,OAAQ,EACtC,KACF,CACAC,EAAO,KAAK,CAAE,MAAAG,EAAO,IAAK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rC,MAAOC,CAAA,CACR,EAEGP,EAAM,QACR1B,EAAS,KAAK,GAAGiB,EAAqBS,EAAOR,CAAQ,CAAC,EAGjDC,EAAiBnB,CAAQ,CAClC"}
|
|
@@ -1,64 +1,73 @@
|
|
|
1
|
-
const O = /<(script|style|link|iframe|html|head|body|meta|title|base|template|div|section|article|main)[\s>]/i,
|
|
1
|
+
const O = /<(script|style|link|iframe|html|head|body|meta|title|base|template|div|section|article|main)[\s>]/i, R = [
|
|
2
2
|
/<svg[\s\S]*?<\/svg>/i,
|
|
3
3
|
/<img\b[^>]*?>/i,
|
|
4
4
|
/```mermaid[\s\S]*?```/i,
|
|
5
5
|
/```[a-zA-Z0-9]+[\s\S]*?```/i
|
|
6
|
-
],
|
|
7
|
-
const
|
|
8
|
-
let
|
|
9
|
-
for (; (
|
|
10
|
-
const o =
|
|
6
|
+
], B = /!\[[^\]]*]\([^\s)\n]+(?:\s+"[^"]*")?\)/i, M = /<\/[a-z][^>]*>\s*\n(?=[^\s<])/gi, A = /<custom-button-after-content\b[\s\S]*?<\/custom-button-after-content>/gi, T = (t) => {
|
|
7
|
+
const n = [], e = /```/g;
|
|
8
|
+
let s;
|
|
9
|
+
for (; (s = e.exec(t)) !== null; ) {
|
|
10
|
+
const o = s.index, c = e.exec(t);
|
|
11
11
|
if (!c) {
|
|
12
|
-
|
|
12
|
+
n.push({ start: o, end: t.length });
|
|
13
13
|
break;
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
n.push({ start: o, end: c.index + 3 });
|
|
16
16
|
}
|
|
17
|
-
return
|
|
18
|
-
},
|
|
19
|
-
const
|
|
17
|
+
return n;
|
|
18
|
+
}, _ = (t, n) => n.some(({ start: e, end: s }) => t >= e && t < s), y = (t, n, e) => {
|
|
19
|
+
const s = n.flags.includes("g") ? n.flags : `${n.flags}g`, o = new RegExp(n.source, s);
|
|
20
20
|
let c;
|
|
21
21
|
for (; (c = o.exec(t)) !== null; )
|
|
22
|
-
if (!
|
|
22
|
+
if (!_(c.index, e))
|
|
23
23
|
return c.index;
|
|
24
24
|
return -1;
|
|
25
|
-
}, F = (t,
|
|
26
|
-
let
|
|
27
|
-
for (
|
|
28
|
-
if (!(
|
|
29
|
-
|
|
25
|
+
}, F = (t, n) => {
|
|
26
|
+
let e = t.length, s;
|
|
27
|
+
for (M.lastIndex = 0; s = M.exec(t); )
|
|
28
|
+
if (!(s.index <= n)) {
|
|
29
|
+
e = s.index + s[0].length;
|
|
30
30
|
break;
|
|
31
31
|
}
|
|
32
|
-
return
|
|
33
|
-
},
|
|
32
|
+
return e;
|
|
33
|
+
}, P = (t) => {
|
|
34
34
|
if (!t.length) return t;
|
|
35
|
-
const
|
|
36
|
-
return t.forEach((
|
|
37
|
-
if (
|
|
38
|
-
|
|
35
|
+
const n = [];
|
|
36
|
+
return t.forEach((e) => {
|
|
37
|
+
if (e.type !== "sandbox") {
|
|
38
|
+
n.push(e);
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
let
|
|
43
|
-
for (; (o =
|
|
44
|
-
const i =
|
|
45
|
-
i.trim() &&
|
|
41
|
+
A.lastIndex = 0;
|
|
42
|
+
let s = 0, o;
|
|
43
|
+
for (; (o = A.exec(e.value)) !== null; ) {
|
|
44
|
+
const i = e.value.slice(s, o.index);
|
|
45
|
+
i.trim() && n.push({ type: "sandbox", value: i }), n.push({ type: "markdown", value: o[0] }), s = o.index + o[0].length;
|
|
46
46
|
}
|
|
47
|
-
const c =
|
|
48
|
-
c.trim() &&
|
|
49
|
-
}),
|
|
50
|
-
},
|
|
51
|
-
let
|
|
52
|
-
return
|
|
53
|
-
const
|
|
54
|
-
if (!
|
|
55
|
-
const o =
|
|
56
|
-
(!
|
|
57
|
-
}),
|
|
58
|
-
},
|
|
59
|
-
const e =
|
|
60
|
-
|
|
61
|
-
|
|
47
|
+
const c = e.value.slice(s);
|
|
48
|
+
c.trim() && n.push({ type: "sandbox", value: c });
|
|
49
|
+
}), n;
|
|
50
|
+
}, C = (t) => {
|
|
51
|
+
let n = null;
|
|
52
|
+
return R.forEach((e) => {
|
|
53
|
+
const s = e.exec(t);
|
|
54
|
+
if (!s || typeof s.index != "number") return;
|
|
55
|
+
const o = s.index, c = s.index + s[0].length;
|
|
56
|
+
(!n || o < n.start) && (n = { start: o, end: c });
|
|
57
|
+
}), n;
|
|
58
|
+
}, z = (t, n) => {
|
|
59
|
+
const e = y(
|
|
60
|
+
t,
|
|
61
|
+
B,
|
|
62
|
+
n
|
|
63
|
+
);
|
|
64
|
+
if (e === -1) return null;
|
|
65
|
+
const s = t.slice(e).match(B);
|
|
66
|
+
return s ? { start: e, end: e + s[0].length } : null;
|
|
67
|
+
}, D = (t) => {
|
|
68
|
+
const n = t.match(/^\s*\|.+\|\s*$/m);
|
|
69
|
+
if (!n || typeof n.index != "number") return null;
|
|
70
|
+
const e = n[0].match(/^\s*/)?.[0].length ?? 0, s = n.index + e, o = t.slice(s).split(`
|
|
62
71
|
`), c = [];
|
|
63
72
|
for (const f of o) {
|
|
64
73
|
if (!f.trim().startsWith("|")) break;
|
|
@@ -66,44 +75,44 @@ const O = /<(script|style|link|iframe|html|head|body|meta|title|base|template|di
|
|
|
66
75
|
}
|
|
67
76
|
const i = c.join(`
|
|
68
77
|
`);
|
|
69
|
-
return { start:
|
|
70
|
-
},
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
73
|
-
return
|
|
74
|
-
const o =
|
|
78
|
+
return { start: s, block: i, end: s + i.length };
|
|
79
|
+
}, p = (t, n = !1) => {
|
|
80
|
+
const e = (l) => P(l), s = t.indexOf("```");
|
|
81
|
+
if (n && s !== -1 && t.indexOf("```", s + 3) === -1)
|
|
82
|
+
return e([{ type: "markdown", value: t }]);
|
|
83
|
+
const o = T(t), c = y(
|
|
75
84
|
t,
|
|
76
85
|
O,
|
|
77
86
|
o
|
|
78
|
-
), i =
|
|
87
|
+
), i = y(t, /<svg\b/i, o), f = c !== -1 && i !== -1 && c < i;
|
|
79
88
|
if (i !== -1 && !f) {
|
|
80
|
-
const l = t.slice(0, i),
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
return l.trim() &&
|
|
89
|
+
const l = t.slice(0, i), a = t.indexOf("</svg>", i), r = a === -1 ? `${t.slice(i)}</svg>` : t.slice(i, a + 6), x = a === -1 ? "" : t.slice(a + 6);
|
|
90
|
+
if (n) {
|
|
91
|
+
const b = [];
|
|
92
|
+
return l.trim() && b.push({ type: "text", value: l }), b.push({ type: "markdown", value: r }), x.trim() && b.push(...p(x, !0)), e(b);
|
|
84
93
|
}
|
|
85
|
-
if (
|
|
86
|
-
return
|
|
94
|
+
if (a === -1)
|
|
95
|
+
return e([{ type: "markdown", value: r }]);
|
|
87
96
|
}
|
|
88
|
-
const u =
|
|
97
|
+
const u = D(t);
|
|
89
98
|
if (u) {
|
|
90
|
-
const l = [],
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
return
|
|
94
|
-
...
|
|
95
|
-
),
|
|
99
|
+
const l = [], a = t.slice(0, u.start);
|
|
100
|
+
n && a.trim() && l.push({ type: "text", value: a }), l.push({ type: "markdown", value: u.block });
|
|
101
|
+
const r = t.slice(u.end), x = r.length < t.length;
|
|
102
|
+
return r.trim() && x && l.push(
|
|
103
|
+
...n ? p(r, !0) : p(r)
|
|
104
|
+
), e(l);
|
|
96
105
|
}
|
|
97
|
-
const
|
|
106
|
+
const h = C(t), m = z(t, o), d = h && m ? h.start <= m.start ? h : m : h ?? m;
|
|
98
107
|
if (c === -1 && !d)
|
|
99
|
-
return
|
|
100
|
-
const
|
|
101
|
-
return
|
|
102
|
-
type:
|
|
103
|
-
value:
|
|
104
|
-
}),
|
|
108
|
+
return n && t.trim() ? e([{ type: "text", value: t }]) : [];
|
|
109
|
+
const v = !!d && (c === -1 || d.start < c), S = v ? d.start : c, I = v ? d.end : F(t, S), g = [], k = t.slice(0, S), N = t.slice(S, I), E = t.slice(I);
|
|
110
|
+
return n && k.trim() && g.push({ type: "text", value: k }), g.push({
|
|
111
|
+
type: v ? "markdown" : "sandbox",
|
|
112
|
+
value: N
|
|
113
|
+
}), E.trim() && g.push(...p(E, n)), e(g);
|
|
105
114
|
};
|
|
106
115
|
export {
|
|
107
|
-
|
|
116
|
+
p as splitContentSegments
|
|
108
117
|
};
|
|
109
118
|
//# sourceMappingURL=split-content.es.js.map
|