@zombie-mermaid/svg-renderer 5.8.0 → 5.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +13 -4
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@zombie-mermaid/core"),t=require("@zombie-mermaid/mermaid-parser"),n=require("entities");function r(t){return e.f`M ${t.x} ${t.y}`}function i(t){return r(t[0])+t.slice(1).map(t=>e.f` L ${t.x} ${t.y}`).join(``)}function a(t){if(t.length<3)return i(t);let n=t[t.length-1],a=[r(t[0])],o=(t,n,r)=>e.f` C ${(2*t.x+n.x)/3} ${(2*t.y+n.y)/3},`+e.f` ${(t.x+2*n.x)/3} ${(t.y+2*n.y)/3},`+e.f` ${(t.x+4*n.x+r.x)/6} ${(t.y+4*n.y+r.y)/6}`;a.push(e.f` L ${(5*t[0].x+t[1].x)/6}`+e.f` ${(5*t[0].y+t[1].y)/6}`);for(let e=2;e<t.length;e++)a.push(o(t[e-2],t[e-1],t[e]));return a.push(o(t[t.length-2],n,n)),a.push(e.f` L ${n.x} ${n.y}`),a.join(``)}function o(t){if(t.length<3)return i(t);let n=[r(t[0])];for(let r=1;r<t.length-1;r++){let i=t[r-1],a=t[r],o=t[r+1],s=Math.hypot(a.x-i.x,a.y-i.y),c=Math.hypot(o.x-a.x,o.y-a.y);if(s===0||c===0){n.push(e.f` L ${a.x} ${a.y}`);continue}let l=Math.min(12,s/2,c/2),u=a.x-(a.x-i.x)/s*l,d=a.y-(a.y-i.y)/s*l,f=a.x+(o.x-a.x)/c*l,p=a.y+(o.y-a.y)/c*l;n.push(e.f` L ${u} ${d}`),n.push(e.f` Q ${a.x} ${a.y}, ${f} ${p}`)}let a=t[t.length-1];return n.push(e.f` L ${a.x} ${a.y}`),n.join(``)}function s(t,n){let i=[r(t[0])],a=t.length-1;for(let r=0;r<a;r++){let o=t[r],s=t[r+1];if(r===a-1){i.push(e.f` L ${s.x} ${s.y}`);break}if(n===`before`)i.push(e.f` L ${o.x} ${s.y} L ${s.x} ${s.y}`);else if(n===`after`)i.push(e.f` L ${s.x} ${o.y} L ${s.x} ${s.y}`);else{let t=(o.y+s.y)/2;i.push(e.f` L ${o.x} ${t} L ${s.x} ${t} L ${s.x} ${s.y}`)}}return i.join(``)}function c(e,t=`linear`){if(e.length===0)return``;if(e.length===1)return r(e[0]);switch(t){case`basis`:return a(e);case`natural`:return o(e);case`step`:return s(e,`mid`);case`stepBefore`:return s(e,`before`);case`stepAfter`:return s(e,`after`);default:return i(e)}}function l(e){let t=e?.worker?.worker;return typeof t==`object`&&!!t&&`dispatcher`in t}var u=null,d=null,f=null,p=class extends Error{constructor(){super("zombie-mermaid: rendering a flowchart, state, class, ER or architecture diagram needs the optional peer dependency \"elkjs\". Install it (npm i elkjs) and call registerElk(ELK) once at startup with `import ELK from 'elkjs/lib/elk.bundled.js'`. Sequence, pie, xychart, C4 and ASCII output do not need it. A flowchart can also pass `layout: 'simple'` to skip elkjs."),this.name=`ElkNotRegisteredError`}};function m(e){u=e,d=null,f=null}function h(){let e=globalThis.process;if(!e?.versions?.node||typeof e.getBuiltinModule!=`function`)return null;let t=e.getBuiltinModule(`node:module`);if(!t)return null;let n=[`elkjs`,`lib`,`elk.bundled.js`].join(`/`),r=[typeof __filename==`string`?__filename:{}.url,new URL(`file://${g(e)}/`).href];for(let e of r)try{let r=t.createRequire(e)(n),i=typeof r==`function`?r:r.default;if(typeof i==`function`)return i}catch{}return null}function g(e){let t=e.cwd;return typeof t==`function`?t.call(e):`/`}var _=20;function v(e=_){if(!Number.isInteger(e)||e<1)throw Error(`createLayoutCache: maxSize must be a positive integer, got ${e}`);return{map:new Map,maxSize:e}}function y(e){if(Array.isArray(e))return`[${e.map(y).join(`,`)}]`;if(typeof e==`object`&&e){let t=e;return`{${Object.keys(t).sort().map(e=>`${JSON.stringify(e)}:${y(t[e])}`).join(`,`)}}`}return JSON.stringify(e)}function b(){if(d&&f)return f;let e=u??=h();if(!e)throw new p;let t=[],n=globalThis.setTimeout;globalThis.setTimeout=(e,r)=>r===0?(t.push(e),0):n(e,r);let r=globalThis,i=Object.getOwnPropertyDescriptor(r,`self`),a=`self`in r&&r.document===void 0&&i?.configurable!==!1;a&&Object.defineProperty(r,"self",{value:void 0,configurable:!0,writable:!0});let
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@zombie-mermaid/core"),t=require("@zombie-mermaid/mermaid-parser"),n=require("entities");function r(t){return e.f`M ${t.x} ${t.y}`}function i(t){return r(t[0])+t.slice(1).map(t=>e.f` L ${t.x} ${t.y}`).join(``)}function a(t){if(t.length<3)return i(t);let n=t[t.length-1],a=[r(t[0])],o=(t,n,r)=>e.f` C ${(2*t.x+n.x)/3} ${(2*t.y+n.y)/3},`+e.f` ${(t.x+2*n.x)/3} ${(t.y+2*n.y)/3},`+e.f` ${(t.x+4*n.x+r.x)/6} ${(t.y+4*n.y+r.y)/6}`;a.push(e.f` L ${(5*t[0].x+t[1].x)/6}`+e.f` ${(5*t[0].y+t[1].y)/6}`);for(let e=2;e<t.length;e++)a.push(o(t[e-2],t[e-1],t[e]));return a.push(o(t[t.length-2],n,n)),a.push(e.f` L ${n.x} ${n.y}`),a.join(``)}function o(t){if(t.length<3)return i(t);let n=[r(t[0])];for(let r=1;r<t.length-1;r++){let i=t[r-1],a=t[r],o=t[r+1],s=Math.hypot(a.x-i.x,a.y-i.y),c=Math.hypot(o.x-a.x,o.y-a.y);if(s===0||c===0){n.push(e.f` L ${a.x} ${a.y}`);continue}let l=Math.min(12,s/2,c/2),u=a.x-(a.x-i.x)/s*l,d=a.y-(a.y-i.y)/s*l,f=a.x+(o.x-a.x)/c*l,p=a.y+(o.y-a.y)/c*l;n.push(e.f` L ${u} ${d}`),n.push(e.f` Q ${a.x} ${a.y}, ${f} ${p}`)}let a=t[t.length-1];return n.push(e.f` L ${a.x} ${a.y}`),n.join(``)}function s(t,n){let i=[r(t[0])],a=t.length-1;for(let r=0;r<a;r++){let o=t[r],s=t[r+1];if(r===a-1){i.push(e.f` L ${s.x} ${s.y}`);break}if(n===`before`)i.push(e.f` L ${o.x} ${s.y} L ${s.x} ${s.y}`);else if(n===`after`)i.push(e.f` L ${s.x} ${o.y} L ${s.x} ${s.y}`);else{let t=(o.y+s.y)/2;i.push(e.f` L ${o.x} ${t} L ${s.x} ${t} L ${s.x} ${s.y}`)}}return i.join(``)}function c(e,t=`linear`){if(e.length===0)return``;if(e.length===1)return r(e[0]);switch(t){case`basis`:return a(e);case`natural`:return o(e);case`step`:return s(e,`mid`);case`stepBefore`:return s(e,`before`);case`stepAfter`:return s(e,`after`);default:return i(e)}}function l(e){let t=e?.worker?.worker;return typeof t==`object`&&!!t&&`dispatcher`in t}var u=null,d=null,f=null,p=class extends Error{constructor(){super("zombie-mermaid: rendering a flowchart, state, class, ER or architecture diagram needs the optional peer dependency \"elkjs\". Install it (npm i elkjs) and call registerElk(ELK) once at startup with `import ELK from 'elkjs/lib/elk.bundled.js'`. Sequence, pie, xychart, C4 and ASCII output do not need it. A flowchart can also pass `layout: 'simple'` to skip elkjs."),this.name=`ElkNotRegisteredError`}};function m(e){u=e,d=null,f=null}function h(){let e=globalThis.process;if(!e?.versions?.node||typeof e.getBuiltinModule!=`function`)return null;let t=e.getBuiltinModule(`node:module`);if(!t)return null;let n=[`elkjs`,`lib`,`elk.bundled.js`].join(`/`),r=[typeof __filename==`string`?__filename:{}.url,new URL(`file://${g(e)}/`).href];for(let e of r)try{let r=t.createRequire(e)(n),i=typeof r==`function`?r:r.default;if(typeof i==`function`)return i}catch{}return null}function g(e){let t=e.cwd;return typeof t==`function`?t.call(e):`/`}var _=20;function v(e=_){if(!Number.isInteger(e)||e<1)throw Error(`createLayoutCache: maxSize must be a positive integer, got ${e}`);return{map:new Map,maxSize:e}}function y(e){if(Array.isArray(e))return`[${e.map(y).join(`,`)}]`;if(typeof e==`object`&&e){let t=e;return`{${Object.keys(t).sort().map(e=>`${JSON.stringify(e)}:${y(t[e])}`).join(`,`)}}`}return JSON.stringify(e)}function b(){if(d&&f)return f;let e=u??=h();if(!e)throw new p;let t=[],n=globalThis.setTimeout;globalThis.setTimeout=(e,r)=>r===0?(t.push(e),0):n(e,r);let r=globalThis,i=Object.getOwnPropertyDescriptor(r,`self`),a=`self`in r&&r.document===void 0&&i?.configurable!==!1,o=a&&r.global===void 0;a&&(Object.defineProperty(r,"self",{value:void 0,configurable:!0,writable:!0}),o&&(r.global=globalThis));let s;try{s=new e}finally{a&&(i?Object.defineProperty(r,"self",i):delete r.self,o&&delete r.global),globalThis.setTimeout=n}if(!l(s))throw Error(`zombie-mermaid: registerElk() needs the ELK class from 'elkjs/lib/elk.bundled.js' (or 'elkjs/lib/main.js'), whose synchronous worker this renderer drives directly.`);return d=s,t.forEach(e=>e()),f=d.worker.worker,f}function x(e,t){let n=t,r=n?y(e):void 0;if(n&&r!==void 0){let e=n.map.get(r);if(e)return n.map.delete(r),n.map.set(r,e),e}let i=b(),a=e=>{let t,n,r=i.onmessage;return i.onmessage=e=>{e.data.error?n=e.data.error:t=e.data.data},i.dispatcher.saveDispatch({data:{id:0,cmd:`layout`,graph:e}}),i.onmessage=r,{result:t,error:n}},{result:o,error:s}=a(e);if(String(s?.message??s).includes(`Invalid hitboxes`)&&({result:o,error:s}=a({...e,layoutOptions:{...e.layoutOptions,"elk.layered.compaction.postCompaction.strategy":`NONE`}})),s)throw s;if(!o)throw Error(`ELK layout did not return synchronously`);if(n&&r!==void 0&&(n.map.set(r,o),n.map.size>n.maxSize)){let e=n.map.keys().next().value;e!==void 0&&n.map.delete(e)}return o}var S=`JetBrains Mono NL`,C=`@font-face {
|
|
2
2
|
font-family: 'JetBrains Mono NL';
|
|
3
3
|
font-style: normal;
|
|
4
4
|
font-weight: 400;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{DEFAULTS as e,applyThemeVariables as t,buildStyleBlock as n,checkGraphSize as r,checkLimit as i,detectDiagramType as a,dropInvalidColors as o,escapeAttr as s,escapeXml as c,extractAccessibility as l,f as u,findBackEdgeIndexes as d,findBackEdges as f,formatCssColor as p,getReadableTextColor as m,isMonospaceFont as h,measureMultilineText as g,measureTextWidth as _,mixSrgb as v,niceTickValues as y,niceTickValues as b,parseCssColor as x,renderMultilineText as S,renderMultilineTextWithBackground as C,resolveNodeStyle as w,safeHref as T,sanitizeClassName as E,setMonospaceMetrics as D,splitStatements as O,styleOpenTag as k,subgraphDirectionIsHonored as ee,subgraphFeedbackEdges as te,subgraphsTied as ne,svgOpenTag as A,themeStyleDeclarations as j,withDirectionOverride as M,withoutOwnClusterEdges as re}from"@zombie-mermaid/core";import{CHART_ACCENT_FALLBACK as N,architectureToGraph as ie,c4BoundaryTypeLine as ae,c4RelLabelLines as oe,c4TypeLine as se,formatClassMember as ce,getSeriesColor as le,parseArchitecture as ue,parseC4Diagram as de,parseClassDiagram as fe,parseErDiagram as pe,parseMermaid as me,parsePieChart as he,parseSequenceDiagram as ge,parseXYChart as _e}from"@zombie-mermaid/mermaid-parser";import{decodeXML as ve}from"entities";function ye(e){return u`M ${e.x} ${e.y}`}function be(e){return ye(e[0])+e.slice(1).map(e=>u` L ${e.x} ${e.y}`).join(``)}function xe(e){if(e.length<3)return be(e);let t=e[e.length-1],n=[ye(e[0])],r=(e,t,n)=>u` C ${(2*e.x+t.x)/3} ${(2*e.y+t.y)/3},`+u` ${(e.x+2*t.x)/3} ${(e.y+2*t.y)/3},`+u` ${(e.x+4*t.x+n.x)/6} ${(e.y+4*t.y+n.y)/6}`;n.push(u` L ${(5*e[0].x+e[1].x)/6}`+u` ${(5*e[0].y+e[1].y)/6}`);for(let t=2;t<e.length;t++)n.push(r(e[t-2],e[t-1],e[t]));return n.push(r(e[e.length-2],t,t)),n.push(u` L ${t.x} ${t.y}`),n.join(``)}function Se(e){if(e.length<3)return be(e);let t=[ye(e[0])];for(let n=1;n<e.length-1;n++){let r=e[n-1],i=e[n],a=e[n+1],o=Math.hypot(i.x-r.x,i.y-r.y),s=Math.hypot(a.x-i.x,a.y-i.y);if(o===0||s===0){t.push(u` L ${i.x} ${i.y}`);continue}let c=Math.min(12,o/2,s/2),l=i.x-(i.x-r.x)/o*c,d=i.y-(i.y-r.y)/o*c,f=i.x+(a.x-i.x)/s*c,p=i.y+(a.y-i.y)/s*c;t.push(u` L ${l} ${d}`),t.push(u` Q ${i.x} ${i.y}, ${f} ${p}`)}let n=e[e.length-1];return t.push(u` L ${n.x} ${n.y}`),t.join(``)}function Ce(e,t){let n=[ye(e[0])],r=e.length-1;for(let i=0;i<r;i++){let a=e[i],o=e[i+1];if(i===r-1){n.push(u` L ${o.x} ${o.y}`);break}if(t===`before`)n.push(u` L ${a.x} ${o.y} L ${o.x} ${o.y}`);else if(t===`after`)n.push(u` L ${o.x} ${a.y} L ${o.x} ${o.y}`);else{let e=(a.y+o.y)/2;n.push(u` L ${a.x} ${e} L ${o.x} ${e} L ${o.x} ${o.y}`)}}return n.join(``)}function we(e,t=`linear`){if(e.length===0)return``;if(e.length===1)return ye(e[0]);switch(t){case`basis`:return xe(e);case`natural`:return Se(e);case`step`:return Ce(e,`mid`);case`stepBefore`:return Ce(e,`before`);case`stepAfter`:return Ce(e,`after`);default:return be(e)}}function Te(e){let t=e?.worker?.worker;return typeof t==`object`&&!!t&&`dispatcher`in t}var Ee=null,De=null,Oe=null,ke=class extends Error{constructor(){super("zombie-mermaid: rendering a flowchart, state, class, ER or architecture diagram needs the optional peer dependency \"elkjs\". Install it (npm i elkjs) and call registerElk(ELK) once at startup with `import ELK from 'elkjs/lib/elk.bundled.js'`. Sequence, pie, xychart, C4 and ASCII output do not need it. A flowchart can also pass `layout: 'simple'` to skip elkjs."),this.name=`ElkNotRegisteredError`}};function Ae(e){Ee=e,De=null,Oe=null}function je(){let e=globalThis.process;if(!e?.versions?.node||typeof e.getBuiltinModule!=`function`)return null;let t=e.getBuiltinModule(`node:module`);if(!t)return null;let n=[`elkjs`,`lib`,`elk.bundled.js`].join(`/`),r=[typeof __filename==`string`?__filename:import.meta.url,new URL(`file://${Me(e)}/`).href];for(let e of r)try{let r=t.createRequire(e)(n),i=typeof r==`function`?r:r.default;if(typeof i==`function`)return i}catch{}return null}function Me(e){let t=e.cwd;return typeof t==`function`?t.call(e):`/`}var Ne=20;function Pe(e=Ne){if(!Number.isInteger(e)||e<1)throw Error(`createLayoutCache: maxSize must be a positive integer, got ${e}`);return{map:new Map,maxSize:e}}function Fe(e){if(Array.isArray(e))return`[${e.map(Fe).join(`,`)}]`;if(typeof e==`object`&&e){let t=e;return`{${Object.keys(t).sort().map(e=>`${JSON.stringify(e)}:${Fe(t[e])}`).join(`,`)}}`}return JSON.stringify(e)}function Ie(){if(De&&Oe)return Oe;let e=Ee??=je();if(!e)throw new ke;let t=[],n=globalThis.setTimeout;globalThis.setTimeout=(e,r)=>r===0?(t.push(e),0):n(e,r);let r=globalThis,i=Object.getOwnPropertyDescriptor(r,`self`),a=`self`in r&&r.document===void 0&&i?.configurable!==!1;a&&Object.defineProperty(r,"self",{value:void 0,configurable:!0,writable:!0});let
|
|
1
|
+
import{DEFAULTS as e,applyThemeVariables as t,buildStyleBlock as n,checkGraphSize as r,checkLimit as i,detectDiagramType as a,dropInvalidColors as o,escapeAttr as s,escapeXml as c,extractAccessibility as l,f as u,findBackEdgeIndexes as d,findBackEdges as f,formatCssColor as p,getReadableTextColor as m,isMonospaceFont as h,measureMultilineText as g,measureTextWidth as _,mixSrgb as v,niceTickValues as y,niceTickValues as b,parseCssColor as x,renderMultilineText as S,renderMultilineTextWithBackground as C,resolveNodeStyle as w,safeHref as T,sanitizeClassName as E,setMonospaceMetrics as D,splitStatements as O,styleOpenTag as k,subgraphDirectionIsHonored as ee,subgraphFeedbackEdges as te,subgraphsTied as ne,svgOpenTag as A,themeStyleDeclarations as j,withDirectionOverride as M,withoutOwnClusterEdges as re}from"@zombie-mermaid/core";import{CHART_ACCENT_FALLBACK as N,architectureToGraph as ie,c4BoundaryTypeLine as ae,c4RelLabelLines as oe,c4TypeLine as se,formatClassMember as ce,getSeriesColor as le,parseArchitecture as ue,parseC4Diagram as de,parseClassDiagram as fe,parseErDiagram as pe,parseMermaid as me,parsePieChart as he,parseSequenceDiagram as ge,parseXYChart as _e}from"@zombie-mermaid/mermaid-parser";import{decodeXML as ve}from"entities";function ye(e){return u`M ${e.x} ${e.y}`}function be(e){return ye(e[0])+e.slice(1).map(e=>u` L ${e.x} ${e.y}`).join(``)}function xe(e){if(e.length<3)return be(e);let t=e[e.length-1],n=[ye(e[0])],r=(e,t,n)=>u` C ${(2*e.x+t.x)/3} ${(2*e.y+t.y)/3},`+u` ${(e.x+2*t.x)/3} ${(e.y+2*t.y)/3},`+u` ${(e.x+4*t.x+n.x)/6} ${(e.y+4*t.y+n.y)/6}`;n.push(u` L ${(5*e[0].x+e[1].x)/6}`+u` ${(5*e[0].y+e[1].y)/6}`);for(let t=2;t<e.length;t++)n.push(r(e[t-2],e[t-1],e[t]));return n.push(r(e[e.length-2],t,t)),n.push(u` L ${t.x} ${t.y}`),n.join(``)}function Se(e){if(e.length<3)return be(e);let t=[ye(e[0])];for(let n=1;n<e.length-1;n++){let r=e[n-1],i=e[n],a=e[n+1],o=Math.hypot(i.x-r.x,i.y-r.y),s=Math.hypot(a.x-i.x,a.y-i.y);if(o===0||s===0){t.push(u` L ${i.x} ${i.y}`);continue}let c=Math.min(12,o/2,s/2),l=i.x-(i.x-r.x)/o*c,d=i.y-(i.y-r.y)/o*c,f=i.x+(a.x-i.x)/s*c,p=i.y+(a.y-i.y)/s*c;t.push(u` L ${l} ${d}`),t.push(u` Q ${i.x} ${i.y}, ${f} ${p}`)}let n=e[e.length-1];return t.push(u` L ${n.x} ${n.y}`),t.join(``)}function Ce(e,t){let n=[ye(e[0])],r=e.length-1;for(let i=0;i<r;i++){let a=e[i],o=e[i+1];if(i===r-1){n.push(u` L ${o.x} ${o.y}`);break}if(t===`before`)n.push(u` L ${a.x} ${o.y} L ${o.x} ${o.y}`);else if(t===`after`)n.push(u` L ${o.x} ${a.y} L ${o.x} ${o.y}`);else{let e=(a.y+o.y)/2;n.push(u` L ${a.x} ${e} L ${o.x} ${e} L ${o.x} ${o.y}`)}}return n.join(``)}function we(e,t=`linear`){if(e.length===0)return``;if(e.length===1)return ye(e[0]);switch(t){case`basis`:return xe(e);case`natural`:return Se(e);case`step`:return Ce(e,`mid`);case`stepBefore`:return Ce(e,`before`);case`stepAfter`:return Ce(e,`after`);default:return be(e)}}function Te(e){let t=e?.worker?.worker;return typeof t==`object`&&!!t&&`dispatcher`in t}var Ee=null,De=null,Oe=null,ke=class extends Error{constructor(){super("zombie-mermaid: rendering a flowchart, state, class, ER or architecture diagram needs the optional peer dependency \"elkjs\". Install it (npm i elkjs) and call registerElk(ELK) once at startup with `import ELK from 'elkjs/lib/elk.bundled.js'`. Sequence, pie, xychart, C4 and ASCII output do not need it. A flowchart can also pass `layout: 'simple'` to skip elkjs."),this.name=`ElkNotRegisteredError`}};function Ae(e){Ee=e,De=null,Oe=null}function je(){let e=globalThis.process;if(!e?.versions?.node||typeof e.getBuiltinModule!=`function`)return null;let t=e.getBuiltinModule(`node:module`);if(!t)return null;let n=[`elkjs`,`lib`,`elk.bundled.js`].join(`/`),r=[typeof __filename==`string`?__filename:import.meta.url,new URL(`file://${Me(e)}/`).href];for(let e of r)try{let r=t.createRequire(e)(n),i=typeof r==`function`?r:r.default;if(typeof i==`function`)return i}catch{}return null}function Me(e){let t=e.cwd;return typeof t==`function`?t.call(e):`/`}var Ne=20;function Pe(e=Ne){if(!Number.isInteger(e)||e<1)throw Error(`createLayoutCache: maxSize must be a positive integer, got ${e}`);return{map:new Map,maxSize:e}}function Fe(e){if(Array.isArray(e))return`[${e.map(Fe).join(`,`)}]`;if(typeof e==`object`&&e){let t=e;return`{${Object.keys(t).sort().map(e=>`${JSON.stringify(e)}:${Fe(t[e])}`).join(`,`)}}`}return JSON.stringify(e)}function Ie(){if(De&&Oe)return Oe;let e=Ee??=je();if(!e)throw new ke;let t=[],n=globalThis.setTimeout;globalThis.setTimeout=(e,r)=>r===0?(t.push(e),0):n(e,r);let r=globalThis,i=Object.getOwnPropertyDescriptor(r,`self`),a=`self`in r&&r.document===void 0&&i?.configurable!==!1,o=a&&r.global===void 0;a&&(Object.defineProperty(r,"self",{value:void 0,configurable:!0,writable:!0}),o&&(r.global=globalThis));let s;try{s=new e}finally{a&&(i?Object.defineProperty(r,"self",i):delete r.self,o&&delete r.global),globalThis.setTimeout=n}if(!Te(s))throw Error(`zombie-mermaid: registerElk() needs the ELK class from 'elkjs/lib/elk.bundled.js' (or 'elkjs/lib/main.js'), whose synchronous worker this renderer drives directly.`);return De=s,t.forEach(e=>e()),Oe=De.worker.worker,Oe}function Le(e,t){let n=t,r=n?Fe(e):void 0;if(n&&r!==void 0){let e=n.map.get(r);if(e)return n.map.delete(r),n.map.set(r,e),e}let i=Ie(),a=e=>{let t,n,r=i.onmessage;return i.onmessage=e=>{e.data.error?n=e.data.error:t=e.data.data},i.dispatcher.saveDispatch({data:{id:0,cmd:`layout`,graph:e}}),i.onmessage=r,{result:t,error:n}},{result:o,error:s}=a(e);if(String(s?.message??s).includes(`Invalid hitboxes`)&&({result:o,error:s}=a({...e,layoutOptions:{...e.layoutOptions,"elk.layered.compaction.postCompaction.strategy":`NONE`}})),s)throw s;if(!o)throw Error(`ELK layout did not return synchronously`);if(n&&r!==void 0&&(n.map.set(r,o),n.map.size>n.maxSize)){let e=n.map.keys().next().value;e!==void 0&&n.map.delete(e)}return o}var Re=`JetBrains Mono NL`,ze=`@font-face {
|
|
2
2
|
font-family: 'JetBrains Mono NL';
|
|
3
3
|
font-style: normal;
|
|
4
4
|
font-weight: 400;
|
package/package.json
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zombie-mermaid/svg-renderer",
|
|
3
|
-
"version": "5.8.
|
|
3
|
+
"version": "5.8.1",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "SVG rendering primitives and the ELK-backed layout engine behind zombie-mermaid's SVG output.",
|
|
5
|
+
"description": "SVG rendering primitives and the ELK-backed layout engine behind zombie-mermaid's SVG output (maintained continuation of beautiful-mermaid).",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"mermaid",
|
|
8
|
+
"zombie-mermaid",
|
|
9
|
+
"beautiful-mermaid",
|
|
10
|
+
"diagram",
|
|
11
|
+
"svg",
|
|
12
|
+
"elk",
|
|
13
|
+
"layout"
|
|
14
|
+
],
|
|
6
15
|
"repository": {
|
|
7
16
|
"type": "git",
|
|
8
17
|
"url": "https://github.com/dfadler/zombie-mermaid",
|
|
@@ -41,8 +50,8 @@
|
|
|
41
50
|
],
|
|
42
51
|
"dependencies": {
|
|
43
52
|
"entities": "^7.0.1",
|
|
44
|
-
"@zombie-mermaid/core": "5.8.
|
|
45
|
-
"@zombie-mermaid/mermaid-parser": "5.8.
|
|
53
|
+
"@zombie-mermaid/core": "5.8.1",
|
|
54
|
+
"@zombie-mermaid/mermaid-parser": "5.8.1"
|
|
46
55
|
},
|
|
47
56
|
"peerDependencies": {
|
|
48
57
|
"elkjs": "^0.11.0 || ^0.12.0"
|