markstream-react 0.0.56-beta.1 → 0.0.56-beta.3
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 +47 -1
- package/dist/Tooltip-DygdyBfV.js +205 -0
- package/dist/codeBlockExtraProps-B08PlQGP.js +8 -0
- package/dist/{index-D0DspXy9.js → index-BQgUvQrW.js} +41 -41
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/index.px.css +1 -1
- package/dist/index.tailwind.css +1 -1
- package/dist/languageIconExtended-DRR7G3nV.js +1 -0
- package/dist/markstream-react.css +1 -1
- package/dist/next.d.ts +2 -0
- package/dist/next.js +1 -1
- package/dist/server.d.ts +3 -1
- package/dist/server.js +1 -1
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.js +1 -1
- package/dist/types/components/CodeBlockNode/PreCodeNode.d.ts +1 -1
- package/dist/types/components/CodeBlockNode/codeTypography.d.ts +14 -0
- package/dist/types/hooks/useSmoothMarkdownStream.d.ts +18 -1
- package/dist/types/server-renderer/index.d.ts +1 -1
- package/dist/types/types/component-props.d.ts +2 -0
- package/package.json +6 -2
- package/dist/Tooltip-Bx_S1cbE.js +0 -207
- package/dist/codeBlockExtraProps-RaPzFq78.js +0 -3
- package/dist/languageIconExtended-B1nZmPQn.js +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{jsx as t,Fragment as n}from"react/jsx-runtime";import e from"react";import{normalizeCustomHtmlTagName as o,hasCustomHtmlComponents as r,tokenizeHtml as s,BLOCKED_HTML_TAGS as a,isHtmlTagHardBlocked as l,isHtmlTagBlocked as i,sanitizeHtmlAttrs as c,isCustomHtmlComponentTag as u,convertHtmlAttrsToProps as h,getHtmlTagFromContent as p}from"stream-markdown-parser";const d=/* @__PURE__ */new Set(["table","code_block","html_block","blockquote","list","list_item","definition_list","footnote","footnote_reference","footnote_anchor","admonition","thematic_break","math_block","thinking","vmr_container"]);function g(t){if(Array.isArray(t)&&0!==t.length)return t.reduce((t,[n,e])=>n?(t["for"===n?"htmlFor":"class"===n?"className":n]=null==e||e,t):t,{})}function m(n,e,o,r){if(!Array.isArray(n)||0===n.length)return null;const s=[];for(let a=0;a<n.length;a++){const l=n[a];if(l){if("label_open"===l.type){const i=[];for(a++;a<n.length;){const t=n[a];if("label_close"===(null==t?void 0:t.type))break;t&&i.push(t),a++}const c=`${o}-label-${a}`;s.push(
|
|
2
|
-
/* @__PURE__ */t("label",{...g(l.attrs),children:m(i,e,`${c}-child`,r)},c));continue}"label_close"!==l.type&&s.push(r(l,`${o}-${a}`,e))}}return s}function f(e,o,r,s){/* @__PURE__ */
|
|
3
|
-
return t(n,{children:m(e,o,`${r}-inline`,s)})}const v=!1;function w(){return v}const k="__global__",y="__MARKSTREAM_REACT_CUSTOM_COMPONENTS_STORE__",x=(()=>{const t=globalThis;if(t[y])return t[y];const n={scopedComponents:{},revision:0,listeners:/* @__PURE__ */new Set};return t[y]=n,n})();function C(){x.revision++;for(const t of Array.from(x.listeners))try{t()}catch{}}function b(t){return x.listeners.add(t),()=>{x.listeners.delete(t)}}function N(){return x.revision}function j(t,n){"string"==typeof t?x.scopedComponents[t]={...n||{}}:x.scopedComponents[k]={...t},C()}function M(t){const n=x.scopedComponents[k]||{};if(!t)return n;const e=x.scopedComponents[t]||{};return n&&0!==Object.keys(n).length?e&&0!==Object.keys(e).length?{...n,...e}:n:e}function $(t){if(t===k)throw new Error("removeCustomComponents: cannot delete global mapping; call clearGlobalCustomComponents instead.");delete x.scopedComponents[t],C()}function _(){delete x.scopedComponents[k],C()}function B(t){return null==t?void 0:t.markstreamDisplay}function S(t,n){return t.markstreamDisplay=n,t}function L(t){return t}function O(t){return t}function A(t){if(!t)return{};const n={};for(const[e,r]of Object.entries(t)){const t=o(e);t&&(n[t]=r)}return n}function E(t,n,e){if(w())for(const o of Object.keys(t))n[o]&&!e.has(o)&&(e.add(o),console.warn(`[markstream-react] "${o}" was provided in both streamingComponents and htmlComponents. The streamingComponents entry will be used for parser-backed rendering.`))}const H='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M13.5 6.5v6a2 2 0 01-2 2h-7a2 2 0 01-2-2v-9c0-1.1.9-2 2-2h4.01" />\n <path d="m8.5 1.5 5 5h-4a1 1 0 01-1-1zm-3 10h5m-5-3h5m-5-3h1" />\n </g>\n</svg>\n\n';let P=null,V=null,T=null;const z=/* @__PURE__ */new Set;function D(t){P=null!=t?t:null}const F={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",d2lang:"d2",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"},W={"":H,plain:H,text:H,javascript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4.5 11c0 .828427.6715729 1.5 1.5 1.5.8284271 0 1.5-.671573 1.5-1.5V7.5M12.5 8.75C12.5 8.05964406 11.9627417 7.5 11.3 7.5L10.7 7.5C10.0372583 7.5 9.5 8.05964406 9.5 8.75 9.5 9.44035594 10.0372583 10 10.7 10L11.3 10C11.9627417 10 12.5 10.5596441 12.5 11.25 12.5 11.9403559 11.9627417 12.5 11.3 12.5L10.7 12.5C10.0372583 12.5 9.5 11.9403559 9.5 11.25" />\n <path d="m 4,1.5 h 8 c 1.385,0 2.5,1.115 2.5,2.5 v 8 c 0,1.385 -1.115,2.5 -2.5,2.5 H 4 C 2.615,14.5 1.5,13.385 1.5,12 V 4 C 1.5,2.615 2.615,1.5 4,1.5 Z" />\n </g>\n</svg>\n\n',typescript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 1.5h8A2.5 2.5 0 0114.5 4v8a2.5 2.5 0 01-2.5 2.5H4A2.5 2.5 0 011.5 12V4A2.5 2.5 0 014 1.5" />\n <path d="M12.5 8.75c0-.69-.54-1.25-1.2-1.25h-.6c-.66 0-1.2.56-1.2 1.25S10.04 10 10.7 10h.6c.66 0 1.2.56 1.2 1.25s-.54 1.25-1.2 1.25h-.6c-.66 0-1.2-.56-1.2-1.25m-3-3.75v5M5 7.5h3" />\n </g>\n</svg>\n\n',jsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#99d1db" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 10.8c4.14 0 7.5-1.25 7.5-2.8S12.14 5.2 8 5.2.5 6.45.5 8s3.36 2.8 7.5 2.8" />\n <path d="M5.52 9.4c2.07 3.5 4.86 5.72 6.23 4.95 1.37-.78.8-4.24-1.27-7.75C8.41 3.1 5.62.88 4.25 1.65c-1.37.78-.8 4.24 1.27 7.75" />\n <path d="M5.52 6.6c-2.07 3.5-2.64 6.97-1.27 7.75 1.37.77 4.16-1.45 6.23-4.95s2.64-6.97 1.27-7.75C10.38.88 7.59 3.1 5.52 6.6" />\n <path d="M8.5 8a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n\n',tsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 11.3c4.14 0 7.5-1.28 7.5-2.86S12.14 5.58 8 5.58.5 6.86.5 8.44s3.36 2.87 7.5 2.87Z" />\n <path d="M5.52 9.87c2.07 3.6 4.86 5.86 6.23 5.07 1.37-.8.8-4.34-1.27-7.93S5.62 1.16 4.25 1.95s-.8 4.34 1.27 7.92" />\n <path d="M5.52 7.01c-2.07 3.59-2.64 7.14-1.27 7.93s4.16-1.48 6.23-5.07c2.07-3.58 2.64-7.13 1.27-7.92-1.37-.8-4.16 1.47-6.23 5.06" />\n <path d="M8.5 8.44a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n\n',html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ef9f76" d="M1.5 1.5h13L13 13l-5 2-5-2z" />\n <path stroke="#c6d0f5" d="M11 4.5H5l.25 3h5.5l-.25 3-2.5 1-2.5-1-.08-1" />\n </g>\n</svg>\n\n',css:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round">\n <path d="m4 1.5h8c1.38 0 2.5 1.12 2.5 2.5v8c0 1.38-1.12 2.5-2.5 2.5h-8c-1.38 0-2.5-1.12-2.5-2.5v-8c0-1.38 1.12-2.5 2.5-2.5z" />\n <path stroke-width=".814" d="m 10.240861,11.529149 c 0,0.58011 0.437448,1.039154 0.96002,1.035371 l 0.451635,-0.0032 c 0.522572,-0.0036 0.949379,-0.451477 0.949379,-1.032848 0,-0.581372 -0.426807,-1.065638 -0.949379,-1.065638 l -0.451635,3.4e-5 c -0.522572,3.9e-5 -0.949379,-0.4855273 -0.949379,-1.0656374 0,-0.5801104 0.426807,-1.0378931 0.949379,-1.0378931 l 0.451635,2.825e-4 c 0.522572,3.267e-4 0.951743,0.4577827 0.951743,1.0378931 M 6.8003972,11.529149 c 0,0.58011 0.4374474,1.039154 0.9600196,1.035371 l 0.46464,-0.0032 c 0.5225722,-0.0035 0.9363738,-0.451477 0.9363738,-1.031587 0,-0.580111 -0.4090724,-1.065638 -0.9316446,-1.065638 l -0.4693692,3.4e-5 c -0.5225722,3.8e-5 -0.949379,-0.4855272 -0.949379,-1.0656373 0,-0.5801104 0.4268068,-1.0378931 0.949379,-1.0378931 h 0.4516348 c 0.5225722,0 0.9635665,0.4577827 0.9635665,1.0378931 M 3.4072246,11.529149 c 0,0.58011 0.4374474,1.051765 0.9600196,1.051765 H 4.818879 c 0.5225722,0 0.949379,-0.456521 0.949379,-1.037893 m 0.01129,-2.1312747 c 0,-0.5801103 -0.4374474,-1.037893 -0.9600196,-1.037893 L 4.3678939,8.3741358 C 3.8453217,8.3744624 3.4078743,8.8420074 3.4078743,9.4233788 v 2.1186642" />\n </g>\n</svg>\n\n',json:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M4.5 2.5H4c-.75 0-1.5.75-1.5 1.5v2c0 1.1-1 2-1.83 2 .83 0 1.83.9 1.83 2v2c0 .75.75 1.5 1.5 1.5h.5m7-11h.5c.75 0 1.5.75 1.5 1.5v2c0 1.1 1 2 1.83 2-.83 0-1.83.9-1.83 2v2c0 .74-.75 1.5-1.5 1.5h-.5m-6.5-3a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1" />\n</svg>\n\n',python:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#8caaee" d="M8.5 5.5h-3m6 0V3c0-.8-.7-1.5-1.5-1.5H7c-.8 0-1.5.7-1.5 1.5v2.5H3c-.8 0-1.5.7-1.5 1.5v2c0 .8.7 1.5 1.48 1.5" />\n <path stroke="#e5c890" d="M10.5 10.5h-3m-3 0V13c0 .8.7 1.5 1.5 1.5h3c.8 0 1.5-.7 1.5-1.5v-2.5H13c.8 0 1.5-.7 1.5-1.5V7c0-.8-.7-1.5-1.48-1.5H11.5c0 1.5 0 2-1 2h-2" />\n <path stroke="#8caaee" d="M2.98 10.5H4.5c0-1.5 0-2 1-2h2M7.5 3.5v0" />\n <path stroke="#e5c890" d="m 8.5,12.5 v 0" />\n </g>\n</svg>\n\n',shell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M2 15.5c-.7 0-1.5-.8-1.5-1.5V5c0-.7.8-1.5 1.5-1.5h9c.7 0 1.5.8 1.5 1.5v9c0 .7-.8 1.5-1.5 1.5z" />\n <path d="m1.2 3.8 3.04-2.5S5.17.5 5.7.5h8.4c.66 0 1.4.73 1.4 1.4v7.73a2.7 2.7 0 01-.7 1.75l-2.68 3.51M3 8.5l3 2-3 2m4 0h2" />\n </g>\n</svg>\n\n',markdown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m9.25 8.25 2.25 2.25 2.25-2.25M3.5 11V5.5l2.04 3 1.96-3V11m4-.5V5M1.65 2.5h12.7c.59 0 1.15.49 1.15 1v9c0 .51-.56 1-1.15 1H1.65c-.59 0-1.15-.49-1.15-1V3.58c0-.5.56-1.08 1.15-1.08" />\n</svg>\n\n',mermaid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M1.5 2.5c0 6 2.25 5.75 4 7 .83.67 1.17 2 1 4h3c-.17-2 .17-3.33 1-4 1.75-1.25 4-1 4-7C12 2.5 10 3 8 7 6 3 4 2.5 1.5 2.5" />\n</svg>\n\n'};function G(t){var n;const e=function(t){if(!t)return"";const n=t.trim();if(!n)return"";const[e]=n.split(/\s+/),[o]=e.split(":");return o.toLowerCase()}(t);return null!=(n=F[e])?n:e}function I(t){const n=G(t);if(!n)return"plaintext";switch(n){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return n}}async function J(){return V||(T||(T=import("./languageIconExtended-B1nZmPQn.js").then(t=>(V=t.EXTENDED_LANGUAGE_ICON_MAP,function(){for(const t of z)try{t()}catch{}}(),V)).catch(()=>null)),T)}async function R(){await J()}function q(t){return z.add(t),()=>{z.delete(t)}}function K(t){if(P){const n=P(t);if(null!=n&&""!==n)return n}const n=G(t),e=W[n];if(e)return e;return(null==V?void 0:V[n])||(J(),'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16">\x3c!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --\x3e<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m10 9l-3 3l3 3m4 0l3-3l-3-3"/><rect width="18" height="18" x="3" y="3" rx="2"/></g></svg>\n\n')}const U={javascript:"JavaScript",typescript:"TypeScript",jsx:"JSX",tsx:"TSX",shell:"Shell",plain:"Text",text:"Text",markdown:"Markdown",json:"JSON",python:"Python",cpp:"C++",csharp:"C#",vue:"Vue",html:"HTML",css:"CSS",svg:"SVG",mermaid:"Mermaid",d2:"D2"};function X(t){return t.startsWith("--")?t:t.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Z(t){const n={...t};if(Object.prototype.hasOwnProperty.call(n,"class")&&(n.className=n.class,delete n.class),Object.prototype.hasOwnProperty.call(n,"for")&&(n.htmlFor=n.for,delete n.for),"string"==typeof n.style){const t=function(t){const n=t.trim();if(!n)return;const e={};for(const o of n.split(";")){const t=o.trim();if(!t)continue;const n=t.indexOf(":");if(-1===n)continue;const r=X(t.slice(0,n).trim()),s=t.slice(n+1).trim();r&&(e[r]=s)}return Object.keys(e).length?e:void 0}(n.style);t?n.style=t:delete n.style}return n}const Q=s,Y=c;function tt(t,n){return u(t,n)}function nt(t,n){return r(t,n)}function et(t,n,e=!1){const o=Object.entries(null!=n?n:{}),r=o.length>0?o.map(([t,n])=>""===n?` ${t}`:` ${t}="${n}"`).join(""):"";return e?`<${t}${r} />`:`<${t}${r}>`}function ot(t,n){Array.isArray(n)?t.push(...n):null!=n&&t.push(n)}function rt(t,n){var e,o;return(null==(e=n.nodeComponents)?void 0:e[t])||(null==(o=n.nodeComponents)?void 0:o[t.toLowerCase()])}function st(t){if(null==t||"boolean"==typeof t)return"";if("string"==typeof t||"number"==typeof t)return String(t);if(Array.isArray(t))return t.map(st).join("");if(!e.isValidElement(t))return"";const n=t;if("string"!=typeof n.type)return st(n.props.children);const o=Object.entries(n.props).filter(([t,n])=>"children"!==t&&"key"!==t&&"ref"!==t&&null!=n&&"boolean"!=typeof n).map(([t,n])=>` ${"className"===t?"class":t}="${String(n)}"`).join("");return`<${n.type}${o}>${st(n.props.children)}</${n.type}>`}function at(t){return Object.entries(t).map(([t,n])=>[t,""===n?null:n])}function lt(t){var n,e;const o=t.sourceNode,r=!0!==(null==(n=t.ctx)?void 0:n.final)&&(!1===(null==(e=t.ctx)?void 0:e.final)||Boolean(null==o?void 0:o.loading));return{loading:r,autoClosed:r||Boolean(null==o?void 0:o.autoClosed)}}function it(t,n,e){return function(t,n){var e,o;return Boolean((null==(e=n.propComponents)?void 0:e[t])||(null==(o=n.propComponents)?void 0:o[t.toLowerCase()]))}(t,e)?h(n):n}function ct(t,n,r,s,a,l,i,c=lt(a)){const u=o(t),h=null!=l?l:function(t){return t.map(st).join("")}(r),p={type:u,tag:u,attrs:at(n),content:h,raw:null!=i?i:`${et(t,n)}${h}</${t}>`,loading:c.loading,autoClosed:c.autoClosed};if(a.ctx&&a.renderNode)return a.renderNode(p,s,a.ctx);const d=rt(t,a);return d?e.createElement(d,{key:s,node:p}):null}function ut(t,n,o="safe",r={}){var s,c,u;if(!t)return[];if("escape"===o)return[t];try{const h=Q(t);let p=0;const d=null!=(s=r.keyPrefix)?s:"ms-html",g=[],m=[];for(const t of h){if("text"===t.type){if(g.length>0&&g[g.length-1].hardBlocked)continue;(g.length>0?g[g.length-1].children:m).push(null!=(c=t.content)?c:""),g.length>0&&g[g.length-1].sourceParts.push(null!=(u=t.content)?u:"");continue}if("self_closing"===t.type){const s=t.attrs||{},c=et(t.tagName,s,!0),u=tt(t.tagName,n),h=Boolean(rt(t.tagName,r));if(a.has(t.tagName.toLowerCase())||!u&&!h&&l(t.tagName,o))continue;if(!u&&!h&&i(t.tagName,o)){(g.length>0?g[g.length-1].children:m).push(c),g.length>0&&g[g.length-1].sourceParts.push(c);continue}const f=Y(s,o,t.tagName),v=f.key,w=null!=v&&""!==v?v:`${d}-${p++}`,k=u?n[t.tagName]||n[t.tagName.toLowerCase()]:void 0,y=g.length>0?g[g.length-1].children:m;if(h)y.push(ct(t.tagName,s,[],w,r,"",c,{loading:!1,autoClosed:!1}));else if(k){const n=it(t.tagName,f,r);y.push(e.createElement(k,{...n,key:w}))}else y.push(e.createElement(t.tagName,{...Z(f),key:w,suppressHydrationWarning:!0}));g.length>0&&g[g.length-1].sourceParts.push(c);continue}if("tag_open"===t.type){const e=g.length>0&&g[g.length-1].hardBlocked,s=tt(t.tagName,n),c=Boolean(rt(t.tagName,r));g.push({tagName:t.tagName,children:[],attrs:t.attrs,sourceParts:[],customComponent:s||c,hardBlocked:e||a.has(t.tagName.toLowerCase())||!s&&!c&&l(t.tagName,o),softBlocked:!e&&!s&&!c&&i(t.tagName,o)});continue}const s=t.tagName.toLowerCase();let h=-1;for(let t=g.length-1;t>=0;t--)if(g[t].tagName.toLowerCase()===s){h=t;break}if(-1!==h)for(;g.length>h;){const t=g.pop();if(!t)continue;const a=t.sourceParts.join(""),l=`${et(t.tagName,t.attrs)}${a}</${t.tagName}>`;let i;if(t.hardBlocked)i=null;else if(t.softBlocked)i=[et(t.tagName,t.attrs),...t.children,`</${t.tagName}>`];else{const c=Y(t.attrs||{},o,t.tagName),u=c.key,h=null!=u&&""!==u?u:`${d}-${p++}`,g=t.customComponent?n[t.tagName]||n[t.tagName.toLowerCase()]:void 0;if(Boolean(rt(t.tagName,r))){const n=t.tagName.toLowerCase()===s?{loading:!1,autoClosed:!1}:lt(r);i=ct(t.tagName,t.attrs||{},t.children,h,r,a,l,n)}else i=g?e.createElement(g,{...it(t.tagName,c,r),key:h},...t.children):e.createElement(t.tagName,{...Z(c),key:h,suppressHydrationWarning:!0},...t.children)}g.length>0?ot(g[g.length-1].children,i):ot(m,i),g.length>0&&!t.hardBlocked&&g[g.length-1].sourceParts.push(l)}}for(;g.length>0;){const t=g.pop();if(!t||t.hardBlocked)continue;const s=t.sourceParts.join(""),a=`${et(t.tagName,t.attrs)}${s}`;if(t.softBlocked){ot(m,[et(t.tagName,t.attrs),...t.children,`</${t.tagName}>`]),g.length>0&&g[g.length-1].sourceParts.push(a);continue}const l=Y(t.attrs||{},o,t.tagName),i=l.key,c=null!=i&&""!==i?i:`${d}-${p++}`,u=t.customComponent?n[t.tagName]||n[t.tagName.toLowerCase()]:void 0;let h;h=Boolean(rt(t.tagName,r))?ct(t.tagName,t.attrs||{},t.children,c,r,s,a,lt(r)):u?e.createElement(u,{...it(t.tagName,l,r),key:c},...t.children):e.createElement(t.tagName,{...Z(l),key:c,suppressHydrationWarning:!0},...t.children),m.push(h),g.length>0&&g[g.length-1].sourceParts.push(a)}return m}catch{return null}}function ht(t){const n="number"==typeof t?t:Number.parseFloat(String(null!=t?t:""));return Number.isFinite(n)&&n>0?n:null}function pt(t){const n=t.split(/\r?\n/).filter(t=>/^\s*-\s+/.test(t)).length;return n>=3?500:n>0?280+60*n:360}function dt(t,n=360,e=500){return null==e?Math.max(n,t):Math.min(Math.max(n,t),e)}function gt(t){return t?t.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}function mt(t){const n="number"==typeof t?t:Number.parseFloat(String(null!=t?t:""));return Number.isFinite(n)&&n>0?n:null}function ft(t){const n=t.split(/\r?\n/).map(t=>t.trim()).filter(t=>t&&!t.startsWith("%%")),e=Math.max(1,n.length),o=function(t){var n;for(const e of t.split(/\r?\n/)){const t=e.trim();if(!t||t.startsWith("%%"))continue;const o=t.match(/^([A-Z][\w-]*)\b/i);return(null==(n=null==o?void 0:o[1])?void 0:n.toLowerCase())||""}return""}(t);return"gantt"===o?220+28*e:"sequencediagram"===o?180+26*e:"classdiagram"===o||"statediagram"===o||"erdiagram"===o?180+24*e:"flowchart"===o||"graph"===o?170+28*e:200+22*e}function vt(t,n=360,e=500){return null==e?Math.max(n,t):Math.min(Math.max(n,t),e)}function wt(t,n,e){var r,s;const a=o(t.type),l=(null!=e?e:[]).map(t=>o(t)).filter(Boolean),i="html_inline"===a||"html_block"===a;if(!i&&!l.includes(a))return null;const c=i?o(t.tag)||p(t.content):o(t.tag)||a;if(!c)return null;const u=l.includes(c),h=null!=(s=null!=(r=n[c])?r:n[a])?s:null,d=u||i?h:null;return{tag:c,isWhitelisted:u,component:d,display:B(d)}}function kt(t,n,e){var o;return"block"===(null==(o=wt(t,n,e))?void 0:o.display)}const yt=/* @__PURE__ */new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function xt(t,n={}){var e;const o={},r=new Set(null!=(e=n.omit)?e:[]);if(!t||"object"!=typeof t)return o;const s=Object.getOwnPropertyDescriptors(t);for(const[a,l]of Object.entries(s))yt.has(a)||r.has(a)||l.enumerable&&"value"in l&&(o[a]=l.value);return o}export{f as A,d as B,m as C,wt as D,I as E,Y as F,j as G,D as H,b as I,q as J,g as K,Q as L,E as M,S as N,vt as a,_ as b,dt as c,O as d,L as e,pt as f,ft as g,xt as h,B as i,N as j,M as k,K as l,nt as m,tt as n,w as o,kt as p,U as q,A as r,Z as s,gt as t,G as u,ut as v,mt as w,ht as x,R as y,$ as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const n={cpp:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 2.5559121,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441189,0 l -1.789955,-1.782586 c -1.7574201,1.750224 -4.606788,1.750224 -6.3642295,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642295,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.7460031,-2.73472867 -7.198136,-2.73472867 -9.9441191,0 -2.74598585,2.7347089 -2.74598585,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M7.5 6v4M5.513524 7.9999996H9.51304M13.486476 5.9999996v4M11.5 7.9999992h3.999516" />\n</svg>\n\n',svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="m4.54 10 6.92-4m-6.92 4a1.5 1.5 0 10-2.6 1.5 1.5 1.5 0 002.6-1.5M8 4v8m0-8a1.5 1.5 0 100-3 1.5 1.5 0 000 3M4.54 6l6.92 4M4.54 6a1.5 1.5 0 10-2.6-1.5A1.5 1.5 0 004.54 6M8 12a1.5 1.5 0 100 3 1.5 1.5 0 000-3m3.46-2a1.5 1.5 0 102.6 1.5 1.5 1.5 0 00-2.6-1.5m0-4a1.5 1.5 0 102.6-1.5 1.5 1.5 0 00-2.6 1.5" />\n</svg>\n\n',vue:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#a6d189" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1 1.5h5.44L8 4.56 9.56 1.5H15l-6.99 13z" />\n <path d="M12.05 1.73 8 9.28 3.95 1.73" />\n </g>\n</svg>\n\n'};export{n as EXTENDED_LANGUAGE_ICON_MAP};
|