@dooc-dev/dooc 0.0.5 → 0.0.6

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.
Files changed (176) hide show
  1. package/dist/cli.js +128 -67
  2. package/dist/code-worker.global.js +152 -0
  3. package/dist/code.global.js +101 -101
  4. package/dist/compiler/bundle-urls.js +2 -0
  5. package/dist/compiler/check.js +2 -0
  6. package/dist/compiler/compile.js +13 -3
  7. package/dist/compiler/dxf.d.ts +1 -0
  8. package/dist/compiler/dxf.js +81 -0
  9. package/dist/compiler/export.js +22 -15
  10. package/dist/compiler/figures.js +39 -10
  11. package/dist/compiler/files.js +2 -0
  12. package/dist/compiler/ignored-files.d.ts +2 -0
  13. package/dist/compiler/ignored-files.js +30 -0
  14. package/dist/compiler/ops.js +1 -1
  15. package/dist/compiler/subformat-schema.d.ts +14 -0
  16. package/dist/compiler/subformat-schema.js +92 -0
  17. package/dist/compiler/subformats.d.ts +5 -7
  18. package/dist/compiler/subformats.js +115 -75
  19. package/dist/core/code-file.js +7 -5
  20. package/dist/core/code-grammars.d.ts +5 -0
  21. package/dist/core/code-grammars.js +34 -0
  22. package/dist/core/content-metadata.d.ts +2 -1
  23. package/dist/core/content-metadata.js +7 -2
  24. package/dist/core/content-types.d.ts +1 -1
  25. package/dist/core/escape-html.d.ts +1 -0
  26. package/dist/core/escape-html.js +1 -0
  27. package/dist/core/figure-frame.js +1 -1
  28. package/dist/core/file-embed.js +7 -3
  29. package/dist/core/html.d.ts +4 -1
  30. package/dist/core/html.js +8 -7
  31. package/dist/core/language.js +5 -2
  32. package/dist/core/markdown.js +3 -1
  33. package/dist/core/previewers.d.ts +8 -0
  34. package/dist/core/previewers.js +2 -0
  35. package/dist/core/schema-fields.d.ts +13 -0
  36. package/dist/core/schema-fields.js +175 -0
  37. package/dist/core/schema-graph-mount.js +26 -3
  38. package/dist/core/schema-refs.d.ts +8 -0
  39. package/dist/core/schema-refs.js +82 -0
  40. package/dist/core/toc-ui.js +1 -1
  41. package/dist/edit.global.js +266 -285
  42. package/dist/flow.global.js +3 -3
  43. package/dist/graph/abnfDiagram-S7VZAUFO-ASBULSKE.js +1 -0
  44. package/dist/graph/architecture-WOLXFQ4H-V57EDXXY.js +1 -0
  45. package/dist/graph/architectureDiagram-YGSQEFNW-GIMP347N.js +36 -0
  46. package/dist/graph/blockDiagram-APKKGZFW-RDL2T4JW.js +140 -0
  47. package/dist/graph/bpmnIcons-APHXDYXF-TWOSQNUQ.js +1 -0
  48. package/dist/graph/c4Diagram-KJ2TOQU5-75LIUC4F.js +38 -0
  49. package/dist/graph/chunk-26TUJSYJ.js +1 -0
  50. package/dist/graph/chunk-3LU66YMI.js +1 -0
  51. package/dist/graph/chunk-3RNHDNP5.js +1 -0
  52. package/dist/graph/chunk-3Y2PDVDE.js +1 -0
  53. package/dist/graph/chunk-3YJHMOOA.js +3 -0
  54. package/dist/graph/chunk-4KILFWYV.js +339 -0
  55. package/dist/graph/chunk-4QDE4SUK.js +1 -0
  56. package/dist/graph/chunk-5OO6DATX.js +1 -0
  57. package/dist/graph/chunk-5UUEAHTN.js +1 -0
  58. package/dist/graph/chunk-6T55RVVR.js +1 -0
  59. package/dist/graph/chunk-ARAJTKOH.js +2 -0
  60. package/dist/graph/chunk-BBD5CEDC.js +72 -0
  61. package/dist/graph/chunk-BVXT562I.js +1 -0
  62. package/dist/graph/chunk-BZAMCJ6B.js +32 -0
  63. package/dist/graph/chunk-C6J4A356.js +15 -0
  64. package/dist/graph/chunk-EG5UVNOC.js +213 -0
  65. package/dist/graph/chunk-GF4TOPUK.js +1 -0
  66. package/dist/graph/chunk-GYT4IYBZ.js +1 -0
  67. package/dist/graph/chunk-HJG2HUYJ.js +88 -0
  68. package/dist/graph/chunk-HOPPTA6H.js +62 -0
  69. package/dist/graph/chunk-I3DMZIHV.js +1 -0
  70. package/dist/graph/chunk-IC23EEF6.js +1 -0
  71. package/dist/graph/chunk-ISO77HML.js +1 -0
  72. package/dist/graph/chunk-JD7ZBJD2.js +1 -0
  73. package/dist/graph/chunk-JRSH5GNS.js +1 -0
  74. package/dist/graph/chunk-JSHWCPFJ.js +1 -0
  75. package/dist/graph/chunk-K2KLZU7M.js +10 -0
  76. package/dist/graph/chunk-K4I76XBX.js +14 -0
  77. package/dist/graph/chunk-KT4VPQD5.js +135 -0
  78. package/dist/graph/chunk-KU6GTEMS.js +1 -0
  79. package/dist/graph/chunk-LT6LXKCR.js +136 -0
  80. package/dist/graph/chunk-MPR575IN.js +1 -0
  81. package/dist/graph/chunk-N3OHKGRZ.js +1 -0
  82. package/dist/graph/chunk-O656ZI37.js +1 -0
  83. package/dist/graph/chunk-OFZLK5G4.js +1 -0
  84. package/dist/graph/chunk-PDH25ALM.js +2 -0
  85. package/dist/graph/chunk-PW2RGZ3O.js +1 -0
  86. package/dist/graph/chunk-QCJUF4YA.js +1 -0
  87. package/dist/graph/chunk-QEEA3KYY.js +2 -0
  88. package/dist/graph/chunk-QYAXYFNI.js +1 -0
  89. package/dist/graph/chunk-QYTM6GY3.js +1 -0
  90. package/dist/graph/chunk-R63JUMUK.js +1 -0
  91. package/dist/graph/chunk-SCEY3ZPT.js +1 -0
  92. package/dist/graph/chunk-VM2H7G2R.js +1 -0
  93. package/dist/graph/chunk-XQS73SBQ.js +1 -0
  94. package/dist/graph/chunk-YCRLJT2S.js +1 -0
  95. package/dist/graph/chunk-Z4FIZ7CR.js +1 -0
  96. package/dist/graph/chunk-ZMCB7VP2.js +1 -0
  97. package/dist/graph/chunk-ZSZXN4BT.js +2 -0
  98. package/dist/graph/classDiagram-v2-L25IHNXF-JL7LVDZH.js +217 -0
  99. package/dist/graph/cose-bilkent-JH36ORCC-PNM3EYPB.js +1 -0
  100. package/dist/graph/cynefin-EF2NZ3EQ-PSXP3DXL.js +1 -0
  101. package/dist/graph/cynefinDiagram-L36ESFBY-QVY54CXO.js +62 -0
  102. package/dist/graph/dagre-SPEB5RXH-HPGQXBZJ.js +4 -0
  103. package/dist/graph/diagram-3B7GL73J-DWH5WS2P.js +200 -0
  104. package/dist/graph/diagram-DNEMPZML-TEGH2U5I.js +24 -0
  105. package/dist/graph/diagram-L3MUGCDN-X4MREUWR.js +41 -0
  106. package/dist/graph/diagram-LA4NIPWU-NXT746HG.js +24 -0
  107. package/dist/graph/diagram-MHCOC4E2-JGHXSAGS.js +3 -0
  108. package/dist/graph/diagram-XPFHEONP-ZHZPBLT4.js +30 -0
  109. package/dist/graph/ebnfDiagram-UZSYDL2S-SMF6KJ43.js +1 -0
  110. package/dist/graph/elk-XV6XMXQE-AZ4HLCWI.js +27 -0
  111. package/dist/graph/erDiagram-EYBAPDEH-B3JNJ357.js +99 -0
  112. package/dist/graph/eventmodeling-K75KTNOO-WG6DDYMC.js +1 -0
  113. package/dist/graph/flowDiagram-MALGAFMO-2R7EYAQI.js +1 -0
  114. package/dist/graph/ganttDiagram-23REXITY-YXBYWFOJ.js +292 -0
  115. package/dist/graph/gitGraph-VSP46ZUC-VBFWJBBT.js +1 -0
  116. package/dist/graph/gitGraphDiagram-STJD7YCW-4FZDCFGV.js +106 -0
  117. package/dist/graph/info-OHQRW6UA-ALVDUVYV.js +1 -0
  118. package/dist/graph/infoDiagram-KBXO4MBG-7EHX2GQG.js +2 -0
  119. package/dist/graph/ishikawaDiagram-M35NCXHK-FRZD2PWQ.js +70 -0
  120. package/dist/graph/journeyDiagram-OPLOXDXO-7Z66JCPR.js +139 -0
  121. package/dist/graph/kanban-definition-BZKZHSQY-NN5AIKTE.js +89 -0
  122. package/dist/graph/katex-DXDNVO6V.js +257 -0
  123. package/dist/graph/mindmap-definition-I2QAS2VK-HDPCABN2.js +98 -0
  124. package/dist/graph/packet-JDAUHWVQ-5MQIBWAH.js +1 -0
  125. package/dist/graph/pegDiagram-FD4XPPHP-H2BFNCKT.js +1 -0
  126. package/dist/graph/pie-XZMESJXO-T5VRKHVT.js +1 -0
  127. package/dist/graph/pieDiagram-J4AKIIQI-O3NJSVD3.js +39 -0
  128. package/dist/graph/quadrantDiagram-XTYBLID2-TMTZJI3P.js +7 -0
  129. package/dist/graph/radar-ABXABTNO-C6FXIBYW.js +1 -0
  130. package/dist/graph/railroad-I3PHUGI6-ZSO5JXB3.js +1 -0
  131. package/dist/graph/railroad-abnf-LNEFI6M7-CI4GQRHB.js +1 -0
  132. package/dist/graph/railroad-ebnf-DWYD2UWJ-MUENNCGK.js +1 -0
  133. package/dist/graph/railroad-peg-JR7BVNR7-N3X5GGIX.js +1 -0
  134. package/dist/graph/railroadDiagram-MRQ6NCDL-JHWS23UO.js +1 -0
  135. package/dist/graph/requirementDiagram-Y7LWUY3S-7DVLPO4B.js +84 -0
  136. package/dist/graph/sankeyDiagram-WGJFYUXA-Z5L4R5TR.js +40 -0
  137. package/dist/graph/schema-graph-global.js +639 -0
  138. package/dist/graph/sequenceDiagram-5NDRBG5M-RCTU25NT.js +169 -0
  139. package/dist/graph/sizeCapture-INFHLROL-RROY32P5.js +1 -0
  140. package/dist/graph/stateDiagram-v2-FJ4FJNEA-BXUSPWDK.js +291 -0
  141. package/dist/graph/swimlanes-UMQ2AFYF-LDD74Q2S.js +1 -0
  142. package/dist/graph/swimlanesDiagram-OMPLPG4O-ZYULLJSU.js +8 -0
  143. package/dist/graph/timeline-definition-SEUHKTQE-ZQSMIVAS.js +120 -0
  144. package/dist/graph/treeView-D4JQ5SDB-42S7U73N.js +1 -0
  145. package/dist/graph/treemap-SAJKECNS-RUBYQ7XF.js +1 -0
  146. package/dist/graph/usecaseDiagram-AFA6YXN4-57RDRYXF.js +370 -0
  147. package/dist/graph/vennDiagram-NNMJR3RB-5C3LVAV6.js +34 -0
  148. package/dist/graph/wardley-7MLQ67FV-NV5HXTTC.js +1 -0
  149. package/dist/graph/wardleyDiagram-S7YFUSEH-6D5BKXHM.js +78 -0
  150. package/dist/graph/xychartDiagram-GGNKY7IX-6ET3ZM67.js +7 -0
  151. package/dist/mcp.js +5 -4
  152. package/dist/plugins.global.js +71 -104
  153. package/dist/subformats.global.js +6 -112
  154. package/dist/ui.global.js +75 -108
  155. package/dist/viewer/build.d.ts +2 -0
  156. package/dist/viewer/build.js +22 -8
  157. package/dist/viewer/code-file.js +7 -2
  158. package/dist/viewer/figure-preview.d.ts +4 -0
  159. package/dist/viewer/figure-preview.js +54 -0
  160. package/dist/viewer/hmr.js +4 -3
  161. package/dist/viewer/lazy-preview.d.ts +2 -0
  162. package/dist/viewer/lazy-preview.js +43 -0
  163. package/dist/viewer/locales/eng.json +26 -3
  164. package/dist/viewer/locales/jpn.json +26 -3
  165. package/dist/viewer/locales/zho.json +26 -3
  166. package/dist/viewer/plugin-blocks.js +1 -1
  167. package/dist/viewer/plugins.js +1 -1
  168. package/dist/viewer/resource-library.d.ts +1 -1
  169. package/dist/viewer/resource-library.js +5 -4
  170. package/dist/viewer/serve.d.ts +2 -1
  171. package/dist/viewer/serve.js +148 -41
  172. package/dist/viewer/textfile.d.ts +2 -0
  173. package/dist/viewer/textfile.js +20 -5
  174. package/package.json +5 -3
  175. package/dist/viewer/lazy-graph.d.ts +0 -2
  176. package/dist/viewer/lazy-graph.js +0 -30
@@ -0,0 +1,30 @@
1
+ import{a as z}from"./chunk-N3OHKGRZ.js";import{a as O}from"./chunk-IC23EEF6.js";import{a as G}from"./chunk-3YJHMOOA.js";import"./chunk-PDH25ALM.js";import"./chunk-QYTM6GY3.js";import"./chunk-XQS73SBQ.js";import"./chunk-GF4TOPUK.js";import"./chunk-QYAXYFNI.js";import"./chunk-SCEY3ZPT.js";import"./chunk-3LU66YMI.js";import"./chunk-O656ZI37.js";import"./chunk-BVXT562I.js";import"./chunk-ARAJTKOH.js";import"./chunk-ZSZXN4BT.js";import"./chunk-5OO6DATX.js";import"./chunk-MPR575IN.js";import"./chunk-JSHWCPFJ.js";import"./chunk-Z4FIZ7CR.js";import"./chunk-LT6LXKCR.js";import{a as X}from"./chunk-YCRLJT2S.js";import{b as H,e as W}from"./chunk-ISO77HML.js";import{p as y}from"./chunk-QEEA3KYY.js";import"./chunk-OFZLK5G4.js";import{C as I,I as N,P as A,U as E,V as L,W as D,X as _,Y as M,Z as S,_ as R,r as k}from"./chunk-KT4VPQD5.js";import{b as C}from"./chunk-JRSH5GNS.js";import{a as f}from"./chunk-GYT4IYBZ.js";import"./chunk-3RNHDNP5.js";var q=/[─━│┃└┗├┣]/,U=/[└┗├┣]/,re=/[─━]/,Y=/^[\s│┃]+$/,P=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,F=/^\s*%%/,ne=" ";function j(r){return r.some(t=>q.test(t))}f(j,"isBoxDrawingFormat");function J(r){for(let t of r){let e=U.exec(t);if(e?.index&&e.index>0)return e.index}return 4}f(J,"inferSegmentWidth");function K(r,t){return r.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{let s=parseInt(n,10),i=t.get(s);return i?`line ${i}`:e})}f(K,"remapErrorLines");function Q(r){let t=r.split(`
2
+ `),e=new Map,n=-1;for(let[p,c]of t.entries())if(c.trim()==="treeView-beta"){n=p;break}if(n===-1)return{text:r,lineMap:e};let s=[];for(let p=n+1;p<t.length;p++){let c=t[p];c.trim()===""||F.test(c)||P.test(c)||Y.test(c)||s.push(c.replace(/\t/g," "))}if(!j(s))return{text:r,lineMap:e};let i=J(s),o=[],a=0;for(let p=0;p<=n;p++)o.push(t[p]),a++,e.set(a,p+1);for(let p=n+1;p<t.length;p++){let c=t[p],d=c.trim(),h=p+1;if(d===""){o.push(c),a++,e.set(a,h);continue}if(F.test(c)){o.push(c),a++,e.set(a,h);continue}if(P.test(c)){o.push(c),a++,e.set(a,h);continue}if(Y.test(c))continue;let l=c.replace(/\t/g," "),m=U.exec(l);if(m?.index!==void 0){let g=m.index,w=Math.round(g/i)+1,u=g+1;for(;u<l.length&&re.test(l[u]);)u++;for(;u<l.length&&l[u]===" ";)u++;let v=l.slice(u).trimEnd();if(!v)throw new Error(`Line ${h}: Empty node \u2014 expected a filename or directory name after the box-drawing prefix`);let te=ne.repeat(w);o.push(te+v),a++,e.set(a,h)}else{if(/^[\s─━│┃└┗├┣]+$/.test(l))continue;if(q.test(l))o.push(c),a++,e.set(a,h);else{if(/^\s+/.test(l))throw new Error(`Line ${h}: Unexpected indentation without box-drawing characters. In box-drawing format, use \u251C\u2500\u2500 or \u2514\u2500\u2500 prefixes for indented nodes.`);o.push(c),a++,e.set(a,h)}}}return{text:o.join(`
3
+ `),lineMap:e}}f(Q,"preprocessBoxDrawing");var x=new z(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),ie=f(()=>{x.reset(),E()},"clear"),oe=f(()=>x.records.stack[0],"getRoot"),se=f(()=>x.records.cnt,"getCount"),ae=k.treeView,ce=f(()=>y(ae,I().treeView),"getConfig"),le=f((r,t,e,n,s,i)=>{for(;r<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();let o={id:x.records.cnt++,level:r,name:t,nodeType:e,icon:s,cssClass:n,description:i,children:[]};x.records.stack[x.records.stack.length-1].children.push(o),x.records.stack.push(o)},"addNode"),de={clear:ie,addNode:le,getRoot:oe,getCount:se,getConfig:ce,getAccTitle:D,getAccDescription:M,getDiagramTitle:R,setAccDescription:_,setAccTitle:L,setDiagramTitle:S},B=de,he=f(r=>{O(r,B);for(let t of r.nodes){let e=typeof t.indent=="number"?t.indent:0,n=t.name,s=n.endsWith("/");s&&(n=n.slice(0,-1));let i=s?"directory":"file",o=t.classAnnotation||void 0,a=t.iconAnnotation,p=a!==void 0?a||"none":void 0,c=t.descAnnotation||void 0,d=c?N(c,I()):void 0;B.addNode(e,n,i,o,p,d)}},"populate"),pe={parse:f(async r=>{let{text:t,lineMap:e}=Q(r);try{let n=await G("treeView",t);C.debug(n),he(n)}catch(n){throw e.size>0&&n instanceof Error&&(n.message=K(n.message,e)),n}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function ee(r,t){let e=t?.filenameIcons?.[r];if(e)return e;let n=r.lastIndexOf(".");if(n>0){let s=r.substring(n).toLowerCase(),i=t?.extensionIcons;return i?.[s]??i?.[s.slice(1)]}}f(ee,"detectIcon");function T(r,t){return r.includes(":")?r:r in b.icons||!t?`${b.prefix}:${r}`:`${t}:${r}`}f(T,"qualifyIcon");function $(r,t){if(r.icon!=="none"){if(r.icon)return T(r.icon,t.defaultIconPack);if(t.showIcons){if(r.nodeType==="file"){let e=ee(r.name,t);if(e==="none")return;if(e)return T(e,t.defaultIconPack)}return`${b.prefix}:${r.nodeType==="directory"?"folder":"file"}`}}}f($,"getNodeIcon");H([{name:b.prefix,icons:b}]);var V=14,fe=4,ge=16,ue=f(async(r,t)=>{let e=[],n=f(i=>{let o=$(i,t);o&&e.push({icon:o,node:i}),i.children.forEach(n)},"collect");n(r);let s=await Promise.all(e.map(async({icon:i,node:o})=>({id:o.id,svg:await W(i,{height:V,width:V})})));return new Map(s.map(({id:i,svg:o})=>[i,o]))},"resolveNodeIcons"),me=f((r,t,e,n,s,i)=>{let o=n.append("g"),a="treeView-node-label";e.nodeType==="directory"&&(a+=" treeView-node-dir"),e.cssClass&&(a+=` ${e.cssClass}`);let p=V+fe,c=$(e,s),d=c!==void 0;c&&o.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${r+s.paddingX}, ${t+s.paddingY})`).html(i.get(e.id)??"");let h=o.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",a),{height:l,width:m}=h.node().getBBox(),g=l+s.paddingY*2,w=r+s.paddingX+(d?p:0);h.attr("x",w),h.attr("y",t+g/2);let u=w+m,v=m+s.paddingX*2+(d?p:0);return e.BBox={x:r,y:t,width:v,height:g},e.cssClass?.split(/\s+/).includes("highlight")&&o.insert("rect",":first-child").attr("x",r).attr("y",t+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:e,nodeGroup:o,labelRightEdge:u,centerY:t+g/2}},"positionLabel"),Z=f((r,t,e,n,s,i)=>r.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",s).attr("stroke-width",i).attr("class","treeView-node-line"),"positionLine"),we=f((r,t,e,n)=>{let s=0,i=0,o=[],a=f((d,h,l,m)=>{let g=m*(l.rowIndent+l.paddingX),w=me(g,s,h,d,l,n);o.push(w);let{height:u,width:v}=h.BBox;Z(d,g-l.rowIndent,s+u/2,g,s+u/2,l.lineThickness),i=Math.max(i,g+v),s+=u},"drawNode"),p=f((d,h=0)=>{a(r,d,e,h),d.children.forEach(w=>{p(w,h+1)});let{x:l,y:m,height:g}=d.BBox;if(d.children.length){let{y:w,height:u}=d.children[d.children.length-1].BBox;Z(r,l+e.paddingX,m+g,l+e.paddingX,w+u/2+e.lineThickness/2,e.lineThickness)}},"processNode");p(t);let c=o.filter(d=>d.node.description);if(c.length>0){let h=Math.max(...o.map(l=>l.labelRightEdge))+ge;for(let l of c){let g=l.nodeGroup.append("text").text(l.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",h).attr("y",l.centerY).node().getBBox();i=Math.max(i,h+g.width+e.paddingX)}}for(let d of o)if(d.node.cssClass?.split(/\s+/).includes("highlight")){let h=d.nodeGroup.select(".treeView-highlight-bg");if(!h.empty()){let l=i-d.node.BBox.x+8;h.attr("width",l),i=Math.max(i,d.node.BBox.x+l+2)}}return{totalHeight:s,totalWidth:i}},"drawTree"),xe=f(async(r,t,e,n)=>{C.debug(`Rendering treeView diagram
4
+ `+r);let s=n.db,i=s.getRoot(),o=s.getConfig(),a=X(t),p=a.append("g");p.attr("class","tree-view");let c=await ue(i,o),{totalHeight:d,totalWidth:h}=we(p,i,o,c);a.attr("viewBox",`-${o.lineThickness/2} 0 ${h} ${d}`),A(a,d,h,o.useMaxWidth)},"draw"),ve={draw:xe},be=ve,Ce={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ie=f(({treeView:r})=>{let{labelFontSize:t,labelColor:e,lineColor:n,iconColor:s,descriptionColor:i,highlightBg:o,highlightStroke:a}=y(Ce,r);return`
5
+ .treeView-node-label {
6
+ font-size: ${t};
7
+ fill: ${e};
8
+ white-space: pre;
9
+ }
10
+ .treeView-node-dir {
11
+ font-weight: bold;
12
+ }
13
+ .treeView-node-line {
14
+ stroke: ${n};
15
+ }
16
+ .treeView-node-icon {
17
+ color: ${s};
18
+ }
19
+ .treeView-node-description {
20
+ font-size: ${t};
21
+ fill: ${i};
22
+ font-style: italic;
23
+ white-space: pre;
24
+ }
25
+ .treeView-highlight-bg {
26
+ fill: ${o};
27
+ stroke: ${a};
28
+ stroke-width: 1;
29
+ }
30
+ `},"styles"),ye=Ie,De={db:B,renderer:be,parser:pe,styles:ye};export{De as diagram};
@@ -0,0 +1 @@
1
+ import{a as n,b as p,c as f}from"./chunk-HJG2HUYJ.js";import{a as i}from"./chunk-IC23EEF6.js";import{b as l}from"./chunk-3YJHMOOA.js";import"./chunk-PDH25ALM.js";import"./chunk-QYTM6GY3.js";import"./chunk-XQS73SBQ.js";import"./chunk-GF4TOPUK.js";import"./chunk-QYAXYFNI.js";import"./chunk-SCEY3ZPT.js";import"./chunk-3LU66YMI.js";import"./chunk-O656ZI37.js";import"./chunk-BVXT562I.js";import"./chunk-ARAJTKOH.js";import{b as m}from"./chunk-ZSZXN4BT.js";import"./chunk-5OO6DATX.js";import"./chunk-MPR575IN.js";import"./chunk-JSHWCPFJ.js";import"./chunk-Z4FIZ7CR.js";import"./chunk-LT6LXKCR.js";import"./chunk-YCRLJT2S.js";import"./chunk-KT4VPQD5.js";import{b as o}from"./chunk-JRSH5GNS.js";import{a as t}from"./chunk-GYT4IYBZ.js";import"./chunk-3RNHDNP5.js";var c=m().RailroadEbnf.parser.LangiumParser,s=t(e=>{let r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{let r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),u=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},u(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),y=t(e=>e.postfixes.reduce((r,a)=>b(r,a),u(e.base)),"transformTerm"),d=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{i(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(d(r)))},"populateDb"),P={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");let r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new l(r);let a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},$={parser:P,db:n,renderer:f,styles:p};export{$ as diagram};