sema-code-ui 0.0.0-stage → 2.1.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.
Files changed (372) hide show
  1. package/README.md +29 -2
  2. package/bin/sema-code-ui.js +2 -0
  3. package/dist/cli.js +4461 -0
  4. package/dist/public/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  5. package/dist/public/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  6. package/dist/public/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  7. package/dist/public/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  8. package/dist/public/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  9. package/dist/public/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  10. package/dist/public/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  11. package/dist/public/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  12. package/dist/public/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  13. package/dist/public/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  14. package/dist/public/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  15. package/dist/public/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  16. package/dist/public/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  17. package/dist/public/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  18. package/dist/public/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  19. package/dist/public/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  20. package/dist/public/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  21. package/dist/public/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  22. package/dist/public/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  23. package/dist/public/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  24. package/dist/public/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  25. package/dist/public/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  26. package/dist/public/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  27. package/dist/public/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  28. package/dist/public/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  29. package/dist/public/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  30. package/dist/public/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  31. package/dist/public/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  32. package/dist/public/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  33. package/dist/public/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  34. package/dist/public/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  35. package/dist/public/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  36. package/dist/public/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  37. package/dist/public/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  38. package/dist/public/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  39. package/dist/public/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  40. package/dist/public/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  41. package/dist/public/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  42. package/dist/public/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  43. package/dist/public/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  44. package/dist/public/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  45. package/dist/public/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  46. package/dist/public/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  47. package/dist/public/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  48. package/dist/public/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  49. package/dist/public/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  50. package/dist/public/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  51. package/dist/public/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  52. package/dist/public/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  53. package/dist/public/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  54. package/dist/public/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  55. package/dist/public/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  56. package/dist/public/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  57. package/dist/public/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  58. package/dist/public/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  59. package/dist/public/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  60. package/dist/public/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  61. package/dist/public/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  62. package/dist/public/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  63. package/dist/public/assets/_commonjs-dynamic-modules-TDtrdbi3.js +1 -0
  64. package/dist/public/assets/abnfDiagram-VCTEODGH-CGBiNVzS.js +1 -0
  65. package/dist/public/assets/arc-BglvR1Nw.js +1 -0
  66. package/dist/public/assets/architectureDiagram-5GKGNRK7-D-TtloeJ.js +36 -0
  67. package/dist/public/assets/blockDiagram-I7D4REHJ-Cq2S84M5.js +129 -0
  68. package/dist/public/assets/c4Diagram-7LVT6UL2-CGzXl2lP.js +38 -0
  69. package/dist/public/assets/channel-DBs40jui.js +1 -0
  70. package/dist/public/assets/chunk-2Q5K7J3B-9LvXpA47.js +1 -0
  71. package/dist/public/assets/chunk-5VM5RSS4-D1S0MGVF.js +15 -0
  72. package/dist/public/assets/chunk-F27PBJKO-C4LbCQlU.js +1 -0
  73. package/dist/public/assets/chunk-IMKFNOWR-4PnH64ro.js +231 -0
  74. package/dist/public/assets/chunk-JWPE2WC7-CGr4Qo3G.js +1 -0
  75. package/dist/public/assets/chunk-POPQ4Y6H-BsVaDbuk.js +1 -0
  76. package/dist/public/assets/chunk-SVP7TREG-DaoV4cvr.js +88 -0
  77. package/dist/public/assets/chunk-TICWLB2K-CUkTqbrd.js +206 -0
  78. package/dist/public/assets/chunk-XXDRQBXY-Dzvju4Ip.js +1 -0
  79. package/dist/public/assets/classDiagram-ZZMXUADV-DgdzCEek.js +1 -0
  80. package/dist/public/assets/classDiagram-v2-VYDZK3BY-DgdzCEek.js +1 -0
  81. package/dist/public/assets/cose-bilkent-JH36ORCC-G_6m6phT.js +1 -0
  82. package/dist/public/assets/cynefin-OW5HDTMX-DNlkzb75.js +178 -0
  83. package/dist/public/assets/cynefinDiagram-5FMLGOSQ-CUYIya-v.js +62 -0
  84. package/dist/public/assets/cytoscape.esm-Bch-eiPH.js +331 -0
  85. package/dist/public/assets/dagre-GXQ25YYZ-X-WMCXwm.js +4 -0
  86. package/dist/public/assets/defaultLocale-DX6XiGOO.js +1 -0
  87. package/dist/public/assets/diagram-S7CK7UJ4-D9qq-Nh-.js +30 -0
  88. package/dist/public/assets/diagram-UQ7AKVKN-BtyebA5k.js +41 -0
  89. package/dist/public/assets/diagram-VSXAHHWV-ByiRvMYj.js +3 -0
  90. package/dist/public/assets/diagram-VX7I27RA-B4Q87XmS.js +24 -0
  91. package/dist/public/assets/diagram-Z3DM3KII-C20xUinS.js +24 -0
  92. package/dist/public/assets/docx-preview-By0bChU4.js +27 -0
  93. package/dist/public/assets/ebnfDiagram-PWID7BFC-BSgKcdFO.js +1 -0
  94. package/dist/public/assets/erDiagram-RLTQ6QDP-CaHaWnsv.js +99 -0
  95. package/dist/public/assets/exceljs.min-gM4gH5Gq.js +57 -0
  96. package/dist/public/assets/flowDiagram-HODETNUW-CVcnJhfM.js +168 -0
  97. package/dist/public/assets/ganttDiagram-EL5Y4UJY-BcoeVppO.js +292 -0
  98. package/dist/public/assets/gitGraphDiagram-WWUBYQGX-CRa9nfQx.js +106 -0
  99. package/dist/public/assets/index-B_RX2-hb.js +1 -0
  100. package/dist/public/assets/index-C1rb1p6e.js +74 -0
  101. package/dist/public/assets/index-CAIdgE5N.js +1 -0
  102. package/dist/public/assets/index-CzzBflnb.js +926 -0
  103. package/dist/public/assets/index-Dp4rS1se.js +198 -0
  104. package/dist/public/assets/index-S9Q0LBW-.css +32 -0
  105. package/dist/public/assets/infoDiagram-27XIBGKW-jp91CW_t.js +2 -0
  106. package/dist/public/assets/init-Gi6I4Gst.js +1 -0
  107. package/dist/public/assets/ishikawaDiagram-5VMMS53U-BZ9oY1Uj.js +70 -0
  108. package/dist/public/assets/journeyDiagram-3NMN7TZE-B2WAQmmS.js +139 -0
  109. package/dist/public/assets/jstat-so0kbz-l.js +1 -0
  110. package/dist/public/assets/jszip.min-DWvxclux.js +12 -0
  111. package/dist/public/assets/kanban-definition-UXKFOSKX-D5-GIJO5.js +89 -0
  112. package/dist/public/assets/layout-DYtELJIl.js +1 -0
  113. package/dist/public/assets/linear-DbovTL4l.js +1 -0
  114. package/dist/public/assets/mermaid.core-Dxd70N1A.js +312 -0
  115. package/dist/public/assets/mindmap-definition-YA3MSWOX-Bn8mkGMq.js +96 -0
  116. package/dist/public/assets/ordinal-Cboi1Yqb.js +1 -0
  117. package/dist/public/assets/pdf-B5ZmZFk6.js +57 -0
  118. package/dist/public/assets/pdf.worker.min-BmVo14Nb.mjs +28 -0
  119. package/dist/public/assets/pdf.worker.min-LAOCk-LR.js +1 -0
  120. package/dist/public/assets/pegDiagram-XKGWAZYB-5tFkd0cP.js +1 -0
  121. package/dist/public/assets/pieDiagram-E7YTZNPT-DX66sAtC.js +39 -0
  122. package/dist/public/assets/pptx-preview.es-DincQuqW.js +28 -0
  123. package/dist/public/assets/quadrantDiagram-AXDQQJYC-CmXSUFtt.js +7 -0
  124. package/dist/public/assets/railroadDiagram-O6MQD6OU-gGq9JGa0.js +1 -0
  125. package/dist/public/assets/requirementDiagram-BXWQKSXE-BBZ6UKXG.js +84 -0
  126. package/dist/public/assets/sankeyDiagram-P5KCCOFB-D60eqaP-.js +40 -0
  127. package/dist/public/assets/sequenceDiagram-WJ2MYXX4-BNBpkdVG.js +162 -0
  128. package/dist/public/assets/sizeCapture-INFHLROL-C8Vx_po6.js +1 -0
  129. package/dist/public/assets/stateDiagram-D77RDMKH-CDVBatbI.js +1 -0
  130. package/dist/public/assets/stateDiagram-v2-MP3YSRHH-BfcNGrJG.js +1 -0
  131. package/dist/public/assets/swimlanes-42K2YHIH-BosFCGMd.js +1 -0
  132. package/dist/public/assets/swimlanesDiagram-VR7AAH4N-DIoVwcjU.js +8 -0
  133. package/dist/public/assets/timeline-definition-24CTP7MA-DKWiUBYP.js +120 -0
  134. package/dist/public/assets/vennDiagram-4TSXK5OY-B2coEXMy.js +34 -0
  135. package/dist/public/assets/wardleyDiagram-VM6X3IG4-BwqNy4EW.js +78 -0
  136. package/dist/public/assets/xychartDiagram-S5SC5T6Z-B2ouoySc.js +7 -0
  137. package/dist/public/icon.svg +8 -0
  138. package/dist/public/index.html +14 -0
  139. package/dist/public/pdfjs-6.3.289/cmaps/78-EUC-H.bcmap +0 -0
  140. package/dist/public/pdfjs-6.3.289/cmaps/78-EUC-V.bcmap +0 -0
  141. package/dist/public/pdfjs-6.3.289/cmaps/78-H.bcmap +0 -0
  142. package/dist/public/pdfjs-6.3.289/cmaps/78-RKSJ-H.bcmap +0 -0
  143. package/dist/public/pdfjs-6.3.289/cmaps/78-RKSJ-V.bcmap +0 -0
  144. package/dist/public/pdfjs-6.3.289/cmaps/78-V.bcmap +0 -0
  145. package/dist/public/pdfjs-6.3.289/cmaps/78ms-RKSJ-H.bcmap +0 -0
  146. package/dist/public/pdfjs-6.3.289/cmaps/78ms-RKSJ-V.bcmap +0 -0
  147. package/dist/public/pdfjs-6.3.289/cmaps/83pv-RKSJ-H.bcmap +0 -0
  148. package/dist/public/pdfjs-6.3.289/cmaps/90ms-RKSJ-H.bcmap +0 -0
  149. package/dist/public/pdfjs-6.3.289/cmaps/90ms-RKSJ-V.bcmap +0 -0
  150. package/dist/public/pdfjs-6.3.289/cmaps/90msp-RKSJ-H.bcmap +0 -0
  151. package/dist/public/pdfjs-6.3.289/cmaps/90msp-RKSJ-V.bcmap +0 -0
  152. package/dist/public/pdfjs-6.3.289/cmaps/90pv-RKSJ-H.bcmap +0 -0
  153. package/dist/public/pdfjs-6.3.289/cmaps/90pv-RKSJ-V.bcmap +0 -0
  154. package/dist/public/pdfjs-6.3.289/cmaps/Add-H.bcmap +0 -0
  155. package/dist/public/pdfjs-6.3.289/cmaps/Add-RKSJ-H.bcmap +0 -0
  156. package/dist/public/pdfjs-6.3.289/cmaps/Add-RKSJ-V.bcmap +0 -0
  157. package/dist/public/pdfjs-6.3.289/cmaps/Add-V.bcmap +0 -0
  158. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-CNS1-0.bcmap +0 -0
  159. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-CNS1-1.bcmap +0 -0
  160. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-CNS1-2.bcmap +0 -0
  161. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-CNS1-3.bcmap +0 -0
  162. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-CNS1-4.bcmap +0 -0
  163. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-CNS1-5.bcmap +0 -0
  164. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-CNS1-6.bcmap +0 -0
  165. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  166. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-GB1-0.bcmap +0 -0
  167. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-GB1-1.bcmap +0 -0
  168. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-GB1-2.bcmap +0 -0
  169. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-GB1-3.bcmap +0 -0
  170. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-GB1-4.bcmap +0 -0
  171. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-GB1-5.bcmap +0 -0
  172. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  173. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Japan1-0.bcmap +0 -0
  174. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Japan1-1.bcmap +0 -0
  175. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Japan1-2.bcmap +0 -0
  176. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Japan1-3.bcmap +0 -0
  177. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Japan1-4.bcmap +0 -0
  178. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Japan1-5.bcmap +0 -0
  179. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Japan1-6.bcmap +0 -0
  180. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  181. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Korea1-0.bcmap +0 -0
  182. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Korea1-1.bcmap +0 -0
  183. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Korea1-2.bcmap +0 -0
  184. package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  185. package/dist/public/pdfjs-6.3.289/cmaps/B5-H.bcmap +0 -0
  186. package/dist/public/pdfjs-6.3.289/cmaps/B5-V.bcmap +0 -0
  187. package/dist/public/pdfjs-6.3.289/cmaps/B5pc-H.bcmap +0 -0
  188. package/dist/public/pdfjs-6.3.289/cmaps/B5pc-V.bcmap +0 -0
  189. package/dist/public/pdfjs-6.3.289/cmaps/CNS-EUC-H.bcmap +0 -0
  190. package/dist/public/pdfjs-6.3.289/cmaps/CNS-EUC-V.bcmap +0 -0
  191. package/dist/public/pdfjs-6.3.289/cmaps/CNS1-H.bcmap +0 -0
  192. package/dist/public/pdfjs-6.3.289/cmaps/CNS1-V.bcmap +0 -0
  193. package/dist/public/pdfjs-6.3.289/cmaps/CNS2-H.bcmap +0 -0
  194. package/dist/public/pdfjs-6.3.289/cmaps/CNS2-V.bcmap +3 -0
  195. package/dist/public/pdfjs-6.3.289/cmaps/ETHK-B5-H.bcmap +0 -0
  196. package/dist/public/pdfjs-6.3.289/cmaps/ETHK-B5-V.bcmap +0 -0
  197. package/dist/public/pdfjs-6.3.289/cmaps/ETen-B5-H.bcmap +0 -0
  198. package/dist/public/pdfjs-6.3.289/cmaps/ETen-B5-V.bcmap +0 -0
  199. package/dist/public/pdfjs-6.3.289/cmaps/ETenms-B5-H.bcmap +3 -0
  200. package/dist/public/pdfjs-6.3.289/cmaps/ETenms-B5-V.bcmap +0 -0
  201. package/dist/public/pdfjs-6.3.289/cmaps/EUC-H.bcmap +0 -0
  202. package/dist/public/pdfjs-6.3.289/cmaps/EUC-V.bcmap +0 -0
  203. package/dist/public/pdfjs-6.3.289/cmaps/Ext-H.bcmap +0 -0
  204. package/dist/public/pdfjs-6.3.289/cmaps/Ext-RKSJ-H.bcmap +0 -0
  205. package/dist/public/pdfjs-6.3.289/cmaps/Ext-RKSJ-V.bcmap +0 -0
  206. package/dist/public/pdfjs-6.3.289/cmaps/Ext-V.bcmap +0 -0
  207. package/dist/public/pdfjs-6.3.289/cmaps/GB-EUC-H.bcmap +0 -0
  208. package/dist/public/pdfjs-6.3.289/cmaps/GB-EUC-V.bcmap +0 -0
  209. package/dist/public/pdfjs-6.3.289/cmaps/GB-H.bcmap +4 -0
  210. package/dist/public/pdfjs-6.3.289/cmaps/GB-V.bcmap +0 -0
  211. package/dist/public/pdfjs-6.3.289/cmaps/GBK-EUC-H.bcmap +0 -0
  212. package/dist/public/pdfjs-6.3.289/cmaps/GBK-EUC-V.bcmap +0 -0
  213. package/dist/public/pdfjs-6.3.289/cmaps/GBK2K-H.bcmap +0 -0
  214. package/dist/public/pdfjs-6.3.289/cmaps/GBK2K-V.bcmap +0 -0
  215. package/dist/public/pdfjs-6.3.289/cmaps/GBKp-EUC-H.bcmap +0 -0
  216. package/dist/public/pdfjs-6.3.289/cmaps/GBKp-EUC-V.bcmap +0 -0
  217. package/dist/public/pdfjs-6.3.289/cmaps/GBT-EUC-H.bcmap +0 -0
  218. package/dist/public/pdfjs-6.3.289/cmaps/GBT-EUC-V.bcmap +0 -0
  219. package/dist/public/pdfjs-6.3.289/cmaps/GBT-H.bcmap +0 -0
  220. package/dist/public/pdfjs-6.3.289/cmaps/GBT-V.bcmap +0 -0
  221. package/dist/public/pdfjs-6.3.289/cmaps/GBTpc-EUC-H.bcmap +0 -0
  222. package/dist/public/pdfjs-6.3.289/cmaps/GBTpc-EUC-V.bcmap +0 -0
  223. package/dist/public/pdfjs-6.3.289/cmaps/GBpc-EUC-H.bcmap +0 -0
  224. package/dist/public/pdfjs-6.3.289/cmaps/GBpc-EUC-V.bcmap +0 -0
  225. package/dist/public/pdfjs-6.3.289/cmaps/H.bcmap +0 -0
  226. package/dist/public/pdfjs-6.3.289/cmaps/HKdla-B5-H.bcmap +0 -0
  227. package/dist/public/pdfjs-6.3.289/cmaps/HKdla-B5-V.bcmap +0 -0
  228. package/dist/public/pdfjs-6.3.289/cmaps/HKdlb-B5-H.bcmap +0 -0
  229. package/dist/public/pdfjs-6.3.289/cmaps/HKdlb-B5-V.bcmap +0 -0
  230. package/dist/public/pdfjs-6.3.289/cmaps/HKgccs-B5-H.bcmap +0 -0
  231. package/dist/public/pdfjs-6.3.289/cmaps/HKgccs-B5-V.bcmap +0 -0
  232. package/dist/public/pdfjs-6.3.289/cmaps/HKm314-B5-H.bcmap +0 -0
  233. package/dist/public/pdfjs-6.3.289/cmaps/HKm314-B5-V.bcmap +0 -0
  234. package/dist/public/pdfjs-6.3.289/cmaps/HKm471-B5-H.bcmap +0 -0
  235. package/dist/public/pdfjs-6.3.289/cmaps/HKm471-B5-V.bcmap +0 -0
  236. package/dist/public/pdfjs-6.3.289/cmaps/HKscs-B5-H.bcmap +0 -0
  237. package/dist/public/pdfjs-6.3.289/cmaps/HKscs-B5-V.bcmap +0 -0
  238. package/dist/public/pdfjs-6.3.289/cmaps/Hankaku.bcmap +0 -0
  239. package/dist/public/pdfjs-6.3.289/cmaps/Hiragana.bcmap +0 -0
  240. package/dist/public/pdfjs-6.3.289/cmaps/KSC-EUC-H.bcmap +0 -0
  241. package/dist/public/pdfjs-6.3.289/cmaps/KSC-EUC-V.bcmap +0 -0
  242. package/dist/public/pdfjs-6.3.289/cmaps/KSC-H.bcmap +0 -0
  243. package/dist/public/pdfjs-6.3.289/cmaps/KSC-Johab-H.bcmap +0 -0
  244. package/dist/public/pdfjs-6.3.289/cmaps/KSC-Johab-V.bcmap +0 -0
  245. package/dist/public/pdfjs-6.3.289/cmaps/KSC-V.bcmap +0 -0
  246. package/dist/public/pdfjs-6.3.289/cmaps/KSCms-UHC-H.bcmap +0 -0
  247. package/dist/public/pdfjs-6.3.289/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  248. package/dist/public/pdfjs-6.3.289/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  249. package/dist/public/pdfjs-6.3.289/cmaps/KSCms-UHC-V.bcmap +0 -0
  250. package/dist/public/pdfjs-6.3.289/cmaps/KSCpc-EUC-H.bcmap +0 -0
  251. package/dist/public/pdfjs-6.3.289/cmaps/KSCpc-EUC-V.bcmap +0 -0
  252. package/dist/public/pdfjs-6.3.289/cmaps/Katakana.bcmap +0 -0
  253. package/dist/public/pdfjs-6.3.289/cmaps/LICENSE +36 -0
  254. package/dist/public/pdfjs-6.3.289/cmaps/NWP-H.bcmap +0 -0
  255. package/dist/public/pdfjs-6.3.289/cmaps/NWP-V.bcmap +0 -0
  256. package/dist/public/pdfjs-6.3.289/cmaps/RKSJ-H.bcmap +0 -0
  257. package/dist/public/pdfjs-6.3.289/cmaps/RKSJ-V.bcmap +0 -0
  258. package/dist/public/pdfjs-6.3.289/cmaps/Roman.bcmap +0 -0
  259. package/dist/public/pdfjs-6.3.289/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  260. package/dist/public/pdfjs-6.3.289/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  261. package/dist/public/pdfjs-6.3.289/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  262. package/dist/public/pdfjs-6.3.289/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  263. package/dist/public/pdfjs-6.3.289/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  264. package/dist/public/pdfjs-6.3.289/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  265. package/dist/public/pdfjs-6.3.289/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  266. package/dist/public/pdfjs-6.3.289/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  267. package/dist/public/pdfjs-6.3.289/cmaps/UniGB-UCS2-H.bcmap +0 -0
  268. package/dist/public/pdfjs-6.3.289/cmaps/UniGB-UCS2-V.bcmap +0 -0
  269. package/dist/public/pdfjs-6.3.289/cmaps/UniGB-UTF16-H.bcmap +0 -0
  270. package/dist/public/pdfjs-6.3.289/cmaps/UniGB-UTF16-V.bcmap +0 -0
  271. package/dist/public/pdfjs-6.3.289/cmaps/UniGB-UTF32-H.bcmap +0 -0
  272. package/dist/public/pdfjs-6.3.289/cmaps/UniGB-UTF32-V.bcmap +0 -0
  273. package/dist/public/pdfjs-6.3.289/cmaps/UniGB-UTF8-H.bcmap +0 -0
  274. package/dist/public/pdfjs-6.3.289/cmaps/UniGB-UTF8-V.bcmap +0 -0
  275. package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  276. package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  277. package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  278. package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  279. package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  280. package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  281. package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  282. package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  283. package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  284. package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  285. package/dist/public/pdfjs-6.3.289/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  286. package/dist/public/pdfjs-6.3.289/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  287. package/dist/public/pdfjs-6.3.289/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  288. package/dist/public/pdfjs-6.3.289/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  289. package/dist/public/pdfjs-6.3.289/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  290. package/dist/public/pdfjs-6.3.289/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  291. package/dist/public/pdfjs-6.3.289/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  292. package/dist/public/pdfjs-6.3.289/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  293. package/dist/public/pdfjs-6.3.289/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  294. package/dist/public/pdfjs-6.3.289/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  295. package/dist/public/pdfjs-6.3.289/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  296. package/dist/public/pdfjs-6.3.289/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  297. package/dist/public/pdfjs-6.3.289/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  298. package/dist/public/pdfjs-6.3.289/cmaps/UniKS-UCS2-H.bcmap +0 -0
  299. package/dist/public/pdfjs-6.3.289/cmaps/UniKS-UCS2-V.bcmap +0 -0
  300. package/dist/public/pdfjs-6.3.289/cmaps/UniKS-UTF16-H.bcmap +0 -0
  301. package/dist/public/pdfjs-6.3.289/cmaps/UniKS-UTF16-V.bcmap +0 -0
  302. package/dist/public/pdfjs-6.3.289/cmaps/UniKS-UTF32-H.bcmap +0 -0
  303. package/dist/public/pdfjs-6.3.289/cmaps/UniKS-UTF32-V.bcmap +0 -0
  304. package/dist/public/pdfjs-6.3.289/cmaps/UniKS-UTF8-H.bcmap +0 -0
  305. package/dist/public/pdfjs-6.3.289/cmaps/UniKS-UTF8-V.bcmap +0 -0
  306. package/dist/public/pdfjs-6.3.289/cmaps/V.bcmap +0 -0
  307. package/dist/public/pdfjs-6.3.289/cmaps/WP-Symbol.bcmap +0 -0
  308. package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitDingbats.pfb +0 -0
  309. package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitFixed.pfb +0 -0
  310. package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitFixedBold.pfb +0 -0
  311. package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  312. package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitFixedItalic.pfb +0 -0
  313. package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitSerif.pfb +0 -0
  314. package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitSerifBold.pfb +0 -0
  315. package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  316. package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitSerifItalic.pfb +0 -0
  317. package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitSymbol.pfb +0 -0
  318. package/dist/public/pdfjs-6.3.289/standard_fonts/LICENSE_FOXIT +27 -0
  319. package/dist/public/pdfjs-6.3.289/standard_fonts/LICENSE_LIBERATION +363 -0
  320. package/dist/public/pdfjs-6.3.289/standard_fonts/LiberationSans-Bold.ttf +0 -0
  321. package/dist/public/pdfjs-6.3.289/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  322. package/dist/public/pdfjs-6.3.289/standard_fonts/LiberationSans-Italic.ttf +0 -0
  323. package/dist/public/pdfjs-6.3.289/standard_fonts/LiberationSans-Regular.ttf +0 -0
  324. package/dist/public/pdfjs-6.3.289/wasm/LICENSE_JBIG2 +196 -0
  325. package/dist/public/pdfjs-6.3.289/wasm/LICENSE_OPENJPEG +39 -0
  326. package/dist/public/pdfjs-6.3.289/wasm/LICENSE_PDFJS_JBIG2 +13 -0
  327. package/dist/public/pdfjs-6.3.289/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
  328. package/dist/public/pdfjs-6.3.289/wasm/LICENSE_PDFJS_QCMS +19 -0
  329. package/dist/public/pdfjs-6.3.289/wasm/LICENSE_QCMS +21 -0
  330. package/dist/public/pdfjs-6.3.289/wasm/jbig2.wasm +0 -0
  331. package/dist/public/pdfjs-6.3.289/wasm/jbig2_nowasm_fallback.js +15 -0
  332. package/dist/public/pdfjs-6.3.289/wasm/openjpeg.wasm +0 -0
  333. package/dist/public/pdfjs-6.3.289/wasm/openjpeg_nowasm_fallback.js +17 -0
  334. package/dist/public/pdfjs-6.3.289/wasm/qcms_bg.wasm +0 -0
  335. package/dist/public/pdfjs-6.3.289/wasm/quickjs-eval.js +16 -0
  336. package/dist/public/pdfjs-6.3.289/wasm/quickjs-eval.wasm +0 -0
  337. package/dist/public/viz-runtime.js +2 -0
  338. package/dist/resources/README.md +89 -0
  339. package/dist/resources/chrome/.mcp.json +9 -0
  340. package/dist/resources/chrome/skills/chrome-use/SKILL.md +78 -0
  341. package/dist/resources/mcp/fetch.json +14 -0
  342. package/dist/resources/mcp/playwright.json +14 -0
  343. package/dist/resources/skills/android-native-dev.json +13 -0
  344. package/dist/resources/skills/archify.json +13 -0
  345. package/dist/resources/skills/avoid-ai-writing.json +13 -0
  346. package/dist/resources/skills/brainstorming.json +13 -0
  347. package/dist/resources/skills/budget-variance-analysis.json +13 -0
  348. package/dist/resources/skills/code-review.json +13 -0
  349. package/dist/resources/skills/contract-review.json +13 -0
  350. package/dist/resources/skills/decision-memo.json +13 -0
  351. package/dist/resources/skills/deck-from-doc.json +13 -0
  352. package/dist/resources/skills/documentation-and-adrs.json +13 -0
  353. package/dist/resources/skills/flutter-dev.json +13 -0
  354. package/dist/resources/skills/frontend-dev.json +13 -0
  355. package/dist/resources/skills/ios-application-dev.json +13 -0
  356. package/dist/resources/skills/landing-page-generator.json +13 -0
  357. package/dist/resources/skills/minimax-docx.json +14 -0
  358. package/dist/resources/skills/minimax-pdf.json +14 -0
  359. package/dist/resources/skills/minimax-xlsx.json +14 -0
  360. package/dist/resources/skills/pptx-generator.json +14 -0
  361. package/dist/resources/skills/react-native-dev.json +13 -0
  362. package/dist/resources/skills/remotion-best-practices.json +12 -0
  363. package/dist/resources/skills/shader-dev.json +13 -0
  364. package/dist/resources/skills/systematic-debugging.json +13 -0
  365. package/dist/resources/skills/visualize/SKILL.md +413 -0
  366. package/dist/resources/skills/visualize/card.json +7 -0
  367. package/dist/resources/skills/visualize/scripts/check.mjs +539 -0
  368. package/dist/resources/skills/visualize/scripts/path.mjs +24 -0
  369. package/dist/resources/skills/wiki-page-writer.json +13 -0
  370. package/dist/resources/skills/writing-plans.json +13 -0
  371. package/dist/worker-entry.js +308 -0
  372. package/package.json +48 -4
@@ -0,0 +1,539 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Layout check for a visualize skill artifact. Zero dependencies.
4
+ *
5
+ * node check.mjs <file.html> [--no-screenshot]
6
+ *
7
+ * 1. ECharts layout check without a browser: the page's inline scripts run in a Node vm with a minimal DOM stub,
8
+ * echarts.init is redirected to server-side rendering (svg, ssr), then every text span in the zrender display
9
+ * list is measured. Reports text overlaps, text past the chart container, labels clipped by the plot area,
10
+ * fonts under 11px, text contrast against the theme background, and script errors. Runs at 720px and 320px
11
+ * page widths, each in the light theme (no data-theme) and the dark theme (<html data-theme="dark">): the
12
+ * custom properties of `:root {}` and `:root[data-theme="dark"] {}` are parsed from the <style> block and
13
+ * served through getComputedStyle, so a page that reads tokens() renders with the right colors per theme.
14
+ * Text widths are estimated (no canvas in Node), so distances are approximate.
15
+ * 2. Theme lint: the dark token block must exist, no prefers-color-scheme, no hard-coded color literal in the
16
+ * script or in CSS rules outside the token blocks (selectors containing "mock" are exempt for UI mockups).
17
+ * 3. Screenshot when a Chromium-based browser is installed (Chrome, Edge, Chromium, or $SEMA_VIZ_BROWSER):
18
+ * headless light-theme render at 720px into the system temp dir, path printed for the model to view.
19
+ *
20
+ * Exit code is always 0; the report on stdout is the result. Last line: `RESULT: OK` or `RESULT: <n> issue(s)`.
21
+ */
22
+ import fs from 'node:fs';
23
+ import os from 'node:os';
24
+ import path from 'node:path';
25
+ import vm from 'node:vm';
26
+ import { spawn, spawnSync } from 'node:child_process';
27
+ import { createRequire } from 'node:module';
28
+ import { fileURLToPath } from 'node:url';
29
+
30
+ const SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url));
31
+ // <root>/skills/visualize/scripts → <root>
32
+ const ROOT = path.resolve(SCRIPT_DIR, '..', '..', '..');
33
+ const CACHE_DIR = path.join(ROOT, 'cache', 'viz');
34
+ const WIDTHS = [720, 320];
35
+ const BODY_PADDING_X = 32; // body { padding: 12px 16px }
36
+ const MIN_FONT = 11;
37
+ const MAX_ISSUES = 20;
38
+ const ECHARTS_SRC_RE = /^https:\/\/cdn\.jsdelivr\.net\/npm\/echarts@(\d+\.\d+\.\d+)\/dist\/echarts\.min\.js$/;
39
+
40
+ const args = process.argv.slice(2);
41
+ const file = args.find(a => !a.startsWith('--'));
42
+ if (!file) { console.log('usage: node check.mjs <file.html> [--no-screenshot]'); process.exit(0); }
43
+ const abs = path.resolve(file);
44
+ if (!fs.existsSync(abs)) { console.log(`RESULT: file not found: ${abs}`); process.exit(0); }
45
+ const html = fs.readFileSync(abs, 'utf8');
46
+ const wantShot = !args.includes('--no-screenshot');
47
+
48
+ const issues = [];
49
+ const notes = [];
50
+ const add = (scope, kind, text, hint) => issues.push({ scope, kind, text, hint });
51
+
52
+ // The file must live in <root>/attachments/<uuid>/: anywhere else the host will not render it inline and edits prompt for permission
53
+ const ATTACH_DIR = path.join(ROOT, 'attachments');
54
+ if (!/^[0-9a-f-]{36}$/i.test(path.basename(path.dirname(abs))) || path.resolve(path.dirname(path.dirname(abs))) !== ATTACH_DIR) {
55
+ add('file', 'location', `file is at ${abs}`, `Get a path from path.mjs (${path.join(SCRIPT_DIR, 'path.mjs')} <title>), write the file there and check that file instead.`);
56
+ }
57
+
58
+ // ---------- HTML parsing (regex level; the file is our own contract, not arbitrary HTML) ----------
59
+ const scripts = [];
60
+ for (const m of html.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi)) {
61
+ const attrs = m[1] || '';
62
+ const src = /\bsrc\s*=\s*["']([^"']+)["']/i.exec(attrs)?.[1];
63
+ const type = /\btype\s*=\s*["']([^"']+)["']/i.exec(attrs)?.[1]?.toLowerCase();
64
+ if (src) scripts.push({ src });
65
+ else if (!type || /javascript|ecmascript/.test(type)) scripts.push({ code: m[2] });
66
+ else if (type === 'module') scripts.push({ code: m[2], module: true });
67
+ }
68
+ const externals = scripts.filter(s => s.src).map(s => s.src);
69
+ const echartsSrc = externals.find(s => ECHARTS_SRC_RE.test(s));
70
+ const usesD3 = externals.some(s => /\/d3@/.test(s));
71
+
72
+ // CSS: selector → declared height in px (only what a container needs)
73
+ const cssHeights = new Map();
74
+ for (const m of html.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi)) {
75
+ for (const rule of m[1].matchAll(/([^{}]+)\{([^{}]*)\}/g)) {
76
+ const h = /(?:^|;)\s*height\s*:\s*(\d+(?:\.\d+)?)px/i.exec(rule[2]);
77
+ if (!h) continue;
78
+ for (const sel of rule[1].split(',')) cssHeights.set(sel.trim(), parseFloat(h[1]));
79
+ }
80
+ }
81
+
82
+ // elements: document order, tag/id/classes/inline height
83
+ const elements = [];
84
+ for (const m of html.matchAll(/<([a-zA-Z][\w-]*)\b([^>]*)>/g)) {
85
+ const tag = m[1].toLowerCase();
86
+ if (['script', 'style', 'meta', 'link', 'title', 'html', 'head', '!doctype'].includes(tag)) continue;
87
+ const attrs = m[2] || '';
88
+ const id = /\bid\s*=\s*["']([^"']+)["']/i.exec(attrs)?.[1];
89
+ const cls = (/\bclass\s*=\s*["']([^"']*)["']/i.exec(attrs)?.[1] || '').split(/\s+/).filter(Boolean);
90
+ const inlineH = /\bstyle\s*=\s*["'][^"']*height\s*:\s*(\d+(?:\.\d+)?)px/i.exec(attrs)?.[1];
91
+ const dataset = {};
92
+ for (const d of attrs.matchAll(/\bdata-([\w-]+)\s*=\s*["']([^"']*)["']/g)) dataset[d[1].replace(/-(\w)/g, (_, c) => c.toUpperCase())] = d[2];
93
+ elements.push({ tag, id, cls, height: inlineH ? parseFloat(inlineH) : undefined, dataset });
94
+ }
95
+
96
+ // ---------- theme tokens and theme lint ----------
97
+ const cssText = [...html.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi)].map(m => m[1]).join('\n');
98
+ const cssRules = [...cssText.matchAll(/([^{}]+)\{([^{}]*)\}/g)].map(r => ({ sel: r[1].trim().replace(/\s+/g, ' '), body: r[2] }));
99
+ const DARK_SEL = ':root[data-theme="dark"]';
100
+ function customProps(sel) {
101
+ const out = {};
102
+ for (const r of cssRules) {
103
+ if (r.sel !== sel) continue;
104
+ for (const d of r.body.split(';')) { const i = d.indexOf(':'); if (i < 0) continue; const k = d.slice(0, i).trim(); if (k.startsWith('--')) out[k] = d.slice(i + 1).trim(); }
105
+ }
106
+ return out;
107
+ }
108
+ const lightTokens = customProps(':root');
109
+ const darkOverrides = customProps(DARK_SEL);
110
+ const darkTokens = { ...lightTokens, ...darkOverrides };
111
+ const THEMES = [{ name: 'light', tokens: lightTokens }, { name: 'dark', tokens: darkTokens }];
112
+ const COLOR_LITERAL_RE = /#[0-9a-f]{3,8}\b|\brgba?\(/gi;
113
+ const stripComments = s => s.replace(/\/\*[\s\S]*?\*\//g, '').replace(/(^|[^:'"\\])\/\/[^\n]*/g, '$1');
114
+ if (Object.keys(darkOverrides).length === 0) {
115
+ add('file', 'theme', `no \`${DARK_SEL}\` token block`, 'Copy both token blocks from the skill Theme section verbatim; the host switches themes with <html data-theme="dark">.');
116
+ }
117
+ if (/prefers-color-scheme/.test(html)) {
118
+ add('file', 'theme', 'uses prefers-color-scheme', 'The host picks the theme with data-theme on <html>; remove the media query and put the dark values under :root[data-theme="dark"].');
119
+ }
120
+ for (const s of scripts) {
121
+ if (!s.code) continue;
122
+ const hits = stripComments(s.code).match(COLOR_LITERAL_RE);
123
+ if (hits) { add('file', 'theme', `${hits.length} hard-coded color(s) in the script, e.g. ${hits[0]}`, 'Take every color from tokens() at render time (skill Theme section); a literal keeps its light value when the host switches to dark.'); break; }
124
+ }
125
+ for (const r of cssRules) {
126
+ if (r.sel.startsWith(':root') || /mock/i.test(r.sel) || r.sel.startsWith('@')) continue;
127
+ const hits = stripComments(r.body).match(COLOR_LITERAL_RE);
128
+ if (hits) { add('file', 'theme', `hard-coded color in CSS rule "${r.sel}": ${hits[0]}`, 'Use var(--token) so the rule follows the theme; product colors of a UI mockup belong on a .mockup root rule.'); break; }
129
+ }
130
+
131
+ // ---------- color math (WCAG relative luminance / contrast) ----------
132
+ function parseColor(c) {
133
+ if (typeof c !== 'string') return null;
134
+ c = c.trim().toLowerCase();
135
+ let m;
136
+ if ((m = /^#([0-9a-f]{3,4})$/.exec(c))) return [...m[1].slice(0, 3)].map(h => parseInt(h + h, 16));
137
+ if ((m = /^#([0-9a-f]{6})(?:[0-9a-f]{2})?$/.exec(c))) return [0, 2, 4].map(i => parseInt(m[1].slice(i, i + 2), 16));
138
+ if ((m = /^rgba?\(([^)]+)\)$/.exec(c))) { const p = m[1].split(/[\s,/]+/).slice(0, 3).map(Number); return p.length === 3 && p.every(n => !isNaN(n)) ? p : null; }
139
+ return null;
140
+ }
141
+ function luminance(c) {
142
+ const rgb = parseColor(c);
143
+ if (!rgb) return null;
144
+ const f = v => { v /= 255; return v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4; };
145
+ return 0.2126 * f(rgb[0]) + 0.7152 * f(rgb[1]) + 0.0722 * f(rgb[2]);
146
+ }
147
+ const contrast = (a, b) => (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);
148
+ const MIN_CONTRAST = 3;
149
+
150
+ function declaredHeight(tag, id, cls) {
151
+ if (id && cssHeights.has('#' + id)) return cssHeights.get('#' + id);
152
+ for (const c of cls) if (cssHeights.has('.' + c)) return cssHeights.get('.' + c);
153
+ if (cssHeights.has(tag)) return cssHeights.get(tag);
154
+ return undefined;
155
+ }
156
+
157
+ // ---------- minimal DOM stub ----------
158
+ function makeDom(contentWidth, log) {
159
+ const byId = new Map();
160
+ const all = [];
161
+ const listeners = { DOMContentLoaded: [], load: [], resize: [] };
162
+
163
+ class Style {
164
+ constructor() { this._ = {}; }
165
+ setProperty(k, v) { this._[k] = String(v); }
166
+ getPropertyValue(k) { return this._[k] || ''; }
167
+ removeProperty(k) { delete this._[k]; }
168
+ }
169
+ class ClassList {
170
+ constructor(el) { this.el = el; }
171
+ add(...c) { for (const x of c) if (!this.el.cls.includes(x)) this.el.cls.push(x); }
172
+ remove(...c) { this.el.cls = this.el.cls.filter(x => !c.includes(x)); }
173
+ toggle(c, f) { const has = this.el.cls.includes(c); if (f === undefined ? has : !f) this.remove(c); else this.add(c); return !has; }
174
+ contains(c) { return this.el.cls.includes(c); }
175
+ }
176
+ class El {
177
+ constructor(tag, id, cls, height, dataset) {
178
+ this.tagName = tag.toUpperCase(); this.id = id || ''; this.cls = cls || []; this.declaredHeight = height;
179
+ this.dataset = dataset || {}; this.children = []; this.parentElement = null; this.style = new Style();
180
+ this.classList = new ClassList(this); this.attrs = {}; this._text = ''; this.value = ''; this.checked = false; this.disabled = false;
181
+ this.ownerDocument = document; this.namespaceURI = ''; this.childNodes = this.children; this.hidden = false; this.title = '';
182
+ all.push(this); if (id) byId.set(id, this);
183
+ }
184
+ get className() { return this.cls.join(' '); } set className(v) { this.cls = String(v).split(/\s+/).filter(Boolean); }
185
+ get textContent() { return this._text; } set textContent(v) { this._text = String(v); this.children = []; }
186
+ get innerText() { return this._text; } set innerText(v) { this._text = String(v); }
187
+ get innerHTML() { return this._text; } set innerHTML(v) { this._text = String(v).replace(/<[^>]*>/g, ''); this.children = []; }
188
+ get outerHTML() { return ''; }
189
+ get firstChild() { return this.children[0] || null; } get lastChild() { return this.children[this.children.length - 1] || null; }
190
+ get firstElementChild() { return this.firstChild; } get lastElementChild() { return this.lastChild; }
191
+ get nextSibling() { return null; } get nextElementSibling() { return null; } get previousElementSibling() { return null; }
192
+ get parentNode() { return this.parentElement; }
193
+ get clientWidth() { return contentWidth; } get offsetWidth() { return contentWidth; }
194
+ get clientHeight() { return this.declaredHeight ?? declaredHeight(this.tagName.toLowerCase(), this.id, this.cls) ?? 0; }
195
+ get offsetHeight() { return this.clientHeight; } get scrollHeight() { return this.clientHeight; } get scrollWidth() { return contentWidth; }
196
+ get scrollTop() { return 0; } set scrollTop(_) {} get scrollLeft() { return 0; } set scrollLeft(_) {}
197
+ getBoundingClientRect() { const h = this.clientHeight; return { x: 0, y: 0, left: 0, top: 0, right: contentWidth, bottom: h, width: contentWidth, height: h }; }
198
+ getClientRects() { return [this.getBoundingClientRect()]; }
199
+ appendChild(c) { if (c && c.parentElement) c.parentElement.removeChild(c); if (c) { c.parentElement = this; this.children.push(c); } return c; }
200
+ append(...cs) { for (const c of cs) if (typeof c === 'object') this.appendChild(c); else this._text += String(c); }
201
+ prepend(...cs) { for (const c of cs.reverse()) if (typeof c === 'object') { c.parentElement = this; this.children.unshift(c); } }
202
+ insertBefore(c, ref) { const i = this.children.indexOf(ref); c.parentElement = this; if (i < 0) this.children.push(c); else this.children.splice(i, 0, c); return c; }
203
+ removeChild(c) { this.children = this.children.filter(x => x !== c); c.parentElement = null; return c; }
204
+ replaceChildren(...cs) { this.children = []; this._text = ''; this.append(...cs); }
205
+ replaceChild(n, o) { this.insertBefore(n, o); this.removeChild(o); return o; }
206
+ remove() { if (this.parentElement) this.parentElement.removeChild(this); }
207
+ contains(c) { let p = c; while (p) { if (p === this) return true; p = p.parentElement; } return false; }
208
+ cloneNode() { return new El(this.tagName, '', [...this.cls], this.declaredHeight, { ...this.dataset }); }
209
+ setAttribute(k, v) { this.attrs[k] = String(v); if (k === 'id') { this.id = String(v); byId.set(this.id, this); } if (k === 'class') this.className = v; if (k.startsWith('data-')) this.dataset[k.slice(5).replace(/-(\w)/g, (_, c) => c.toUpperCase())] = String(v); }
210
+ getAttribute(k) { if (k === 'id') return this.id; if (k === 'class') return this.className; return this.attrs[k] ?? null; }
211
+ hasAttribute(k) { return this.getAttribute(k) != null; }
212
+ removeAttribute(k) { delete this.attrs[k]; }
213
+ toggleAttribute(k, f) { if (f === undefined ? this.hasAttribute(k) : !f) this.removeAttribute(k); else this.setAttribute(k, ''); }
214
+ addEventListener() {} removeEventListener() {} dispatchEvent() { return true; }
215
+ focus() {} blur() {} click() {} scrollIntoView() {} closest() { return null; } matches() { return false; }
216
+ querySelector(s) { return query(s, this.children)[0] || null; }
217
+ querySelectorAll(s) { return query(s, this.children); }
218
+ getElementsByTagName(t) { return descendants(this.children).filter(e => e.tagName === t.toUpperCase()); }
219
+ getContext() { return null; }
220
+ getBBox() { return { x: 0, y: 0, width: 0, height: 0 }; }
221
+ getComputedTextLength() { return 0; }
222
+ }
223
+ function descendants(list) { const out = []; for (const e of list) { out.push(e); out.push(...descendants(e.children)); } return out; }
224
+ function matchCompound(e, comp) {
225
+ for (const part of comp.match(/#[\w-]+|\.[\w-]+|\[[^\]]+\]|^[a-zA-Z][\w-]*|\*|:[\w-]+(\([^)]*\))?/g) || []) {
226
+ if (part.startsWith('#')) { if (e.id !== part.slice(1)) return false; }
227
+ else if (part.startsWith('.')) { if (!e.cls.includes(part.slice(1))) return false; }
228
+ else if (part.startsWith('[')) { const [k, v] = part.slice(1, -1).split('='); const val = e.getAttribute(k.trim()); if (val == null) return false; if (v !== undefined && val !== v.replace(/^["']|["']$/g, '')) return false; }
229
+ else if (part.startsWith(':')) { /* pseudo-classes ignored */ }
230
+ else if (part !== '*' && e.tagName !== part.toUpperCase()) return false;
231
+ }
232
+ return true;
233
+ }
234
+ function query(sel, scope) {
235
+ const pool = descendants(scope);
236
+ const out = [];
237
+ for (const alt of String(sel).split(',')) {
238
+ const compound = alt.trim().split(/\s*[>~+]\s*|\s+/).filter(Boolean).pop();
239
+ if (!compound) continue;
240
+ for (const e of pool) if (matchCompound(e, compound) && !out.includes(e)) out.push(e);
241
+ }
242
+ return out;
243
+ }
244
+ const document = {
245
+ readyState: 'complete', title: /<title>([^<]*)<\/title>/i.exec(html)?.[1] || '', hidden: false, visibilityState: 'visible',
246
+ fonts: { ready: Promise.resolve(), addEventListener() {} },
247
+ getElementById: id => byId.get(id) || null,
248
+ querySelector: s => query(s, document.body.children)[0] || null,
249
+ querySelectorAll: s => query(s, document.body.children),
250
+ getElementsByTagName: t => descendants(document.body.children).filter(e => e.tagName === t.toUpperCase()),
251
+ getElementsByClassName: c => descendants(document.body.children).filter(e => e.cls.includes(c)),
252
+ createElement: t => new El(t), createElementNS: (_, t) => new El(t),
253
+ createTextNode: t => ({ textContent: String(t), nodeType: 3 }),
254
+ createDocumentFragment: () => new El('fragment'),
255
+ addEventListener: (k, f) => { (listeners[k] ||= []).push(f); }, removeEventListener() {}, dispatchEvent() { return true; },
256
+ currentScript: null,
257
+ };
258
+ const body = new El('body'); const root = new El('html'); const head = new El('head');
259
+ root.appendChild(head); root.appendChild(body);
260
+ document.body = body; document.documentElement = root; document.head = head;
261
+ // Pre-register the static elements as a flat list under body; nesting is not tracked
262
+ for (const e of elements) if (!['body', 'head'].includes(e.tag)) body.appendChild(new El(e.tag, e.id, e.cls, e.height, e.dataset));
263
+ return { document, listeners, El };
264
+ }
265
+
266
+ // ---------- ECharts loader ----------
267
+ async function loadEcharts() {
268
+ if (!echartsSrc) return null;
269
+ const version = ECHARTS_SRC_RE.exec(echartsSrc)[1];
270
+ const cached = path.join(CACHE_DIR, `echarts-${version}.js`);
271
+ if (!fs.existsSync(cached)) {
272
+ try {
273
+ fs.mkdirSync(CACHE_DIR, { recursive: true });
274
+ const res = await fetch(echartsSrc, { signal: AbortSignal.timeout(20000) });
275
+ if (!res.ok) throw new Error(`HTTP ${res.status}`);
276
+ fs.writeFileSync(cached, await res.text());
277
+ } catch (e) {
278
+ notes.push(`ECharts layout check skipped: could not download ${echartsSrc} (${e.message})`);
279
+ return null;
280
+ }
281
+ }
282
+ return createRequire(import.meta.url)(cached);
283
+ }
284
+
285
+ // ---------- run the page at one width ----------
286
+ async function runAt(width, echarts, theme) {
287
+ const scope = theme.name === 'dark' ? `${width}px dark` : `${width}px`;
288
+ const contentWidth = width - BODY_PADDING_X;
289
+ const errors = [];
290
+ const { document, listeners } = makeDom(contentWidth, errors);
291
+ // The host sets the attribute before load; the page must read tokens from documentElement, so serve them there
292
+ if (theme.name === 'dark') document.documentElement.setAttribute('data-theme', 'dark');
293
+ const tk = theme.tokens;
294
+ const bg = tk['--bg'] || '#ffffff';
295
+ const computed = { fontFamily: tk['--font'] || 'system-ui, sans-serif', backgroundColor: bg, color: tk['--ink'] || '#0b0b0b', fontSize: '14px', getPropertyValue: k => tk[k] || '' };
296
+ const charts = [];
297
+ const timers = new Set();
298
+ const echartsProxy = echarts && new Proxy(echarts, {
299
+ get(t, k) {
300
+ if (k === 'init') return (el, theme, opts) => {
301
+ const w = (el && el.clientWidth) || contentWidth;
302
+ let h = (el && el.clientHeight) || 0;
303
+ if (!h) { h = 320; if (el) add(scope, 'height', `chart container${el.id ? ' #' + el.id : ''} has no explicit CSS height`, 'Give the container an explicit height (e.g. 320px) so the axis band is never cut off.'); }
304
+ const chart = echarts.init(null, theme, { renderer: 'svg', ssr: true, width: w, height: h });
305
+ // SSR renders the first frame; with animation on, labels sit at their animation start positions
306
+ const setOption = chart.setOption.bind(chart);
307
+ chart.setOption = (opt, ...rest) => setOption(opt && typeof opt === 'object' ? { ...opt, animation: false } : opt, ...rest);
308
+ charts.push({ el, chart, w, h });
309
+ return chart;
310
+ };
311
+ if (k === 'getInstanceByDom') return el => charts.find(c => c.el === el)?.chart;
312
+ if (k === 'dispose') return el => { const c = charts.find(c => c.el === el || c.chart === el); c?.chart.dispose(); };
313
+ return t[k];
314
+ },
315
+ });
316
+ const win = {
317
+ document, echarts: echartsProxy, console: { ...console, error: (...a) => errors.push(a.map(String).join(' ')), warn() {}, log() {}, info() {}, debug() {}, table() {} },
318
+ innerWidth: width, innerHeight: 900, devicePixelRatio: 1, screen: { width, height: 900 },
319
+ navigator: { language: 'zh-CN', languages: ['zh-CN'], userAgent: 'node-check', clipboard: {} },
320
+ location: { href: 'file://' + abs, search: '', hash: '', protocol: 'file:' },
321
+ localStorage: { getItem: () => null, setItem() {}, removeItem() {} }, sessionStorage: { getItem: () => null, setItem() {}, removeItem() {} },
322
+ getComputedStyle: () => computed,
323
+ matchMedia: () => ({ matches: false, addEventListener() {}, removeEventListener() {}, addListener() {} }),
324
+ ResizeObserver: class { observe() {} unobserve() {} disconnect() {} },
325
+ IntersectionObserver: class { observe() {} unobserve() {} disconnect() {} },
326
+ MutationObserver: class { observe() {} disconnect() {} },
327
+ requestAnimationFrame: f => { const t = setTimeout(() => f(Date.now()), 16); timers.add(t); return t; }, cancelAnimationFrame: t => clearTimeout(t),
328
+ setTimeout: (f, ms, ...a) => { const t = setTimeout(f, Math.min(ms || 0, 50), ...a); timers.add(t); return t; }, clearTimeout,
329
+ setInterval: (f, ms, ...a) => { const t = setInterval(f, Math.max(ms || 0, 50), ...a); timers.add(t); return t; }, clearInterval,
330
+ addEventListener: (k, f) => { (listeners[k] ||= []).push(f); }, removeEventListener() {}, dispatchEvent() { return true; },
331
+ performance, Event: class { constructor(type) { this.type = type; } }, CustomEvent: class { constructor(type, init) { this.type = type; this.detail = init?.detail; } },
332
+ URL, URLSearchParams, Intl, Math, JSON, Date, Number, String, Array, Object, Promise, Map, Set, WeakMap, Symbol, RegExp, Error, TypeError, parseFloat, parseInt, isNaN, isFinite, structuredClone,
333
+ fetch: () => Promise.reject(new Error('fetch is not allowed in a visualization')),
334
+ alert() {}, scrollTo() {}, open() {}, getSelection: () => null,
335
+ };
336
+ win.window = win; win.self = win; win.globalThis = win; win.top = win; win.parent = win;
337
+ const ctx = vm.createContext(win);
338
+ // Browsers make these window properties unforgeable: a top-level `const top = ...` is a SyntaxError that
339
+ // stops the whole script. Reproduce that so the checker catches it.
340
+ win.__unforgeable = { window: win, document, location: win.location, top: win };
341
+ vm.runInContext(`for (const k in __unforgeable) Object.defineProperty(globalThis, k, { value: __unforgeable[k], writable: false, configurable: false, enumerable: true });`, ctx);
342
+ delete win.__unforgeable;
343
+
344
+ for (const s of scripts) {
345
+ if (!s.code) continue;
346
+ try {
347
+ vm.runInContext(s.code, ctx, { filename: path.basename(abs), timeout: 5000 });
348
+ } catch (e) { errors.push(`${e.name}: ${e.message}`); }
349
+ }
350
+ for (const k of ['DOMContentLoaded', 'load']) for (const f of listeners[k] || []) { try { f({ type: k }); } catch (e) { errors.push(`${e.name}: ${e.message}`); } }
351
+ await new Promise(r => setTimeout(r, 250));
352
+ for (const t of timers) { clearTimeout(t); clearInterval(t); }
353
+
354
+ for (const err of errors) {
355
+ const reserved = /SyntaxError: Identifier '(window|document|location|top)' has already been declared/.exec(err);
356
+ const domGap = /is not a function|is not defined|of undefined|of null|Cannot read/.test(err) && /document|window|canvas|getContext|SVG|d3|topojson|currentScript|Range|innerHTML/i.test(err);
357
+ add(scope, 'script', `script error: ${err}`,
358
+ reserved ? `'${reserved[1]}' is a reserved window property; a top-level declaration with that name is a SyntaxError in the browser and nothing in the script runs. Rename it and wrap the script body in an IIFE.`
359
+ : err.startsWith('SyntaxError') ? 'A syntax error stops the whole script in the browser: nothing renders. Fix it.'
360
+ : domGap ? 'The checker runs without a real DOM; if this only involves a browser API the page needs at runtime, ignore it. Otherwise fix it.' : 'Fix the script.');
361
+ }
362
+ if (echarts && charts.length === 0 && !usesD3) notes.push(`${scope}: no echarts.init call was reached`);
363
+
364
+ for (const { el, chart, w, h } of charts) {
365
+ try { analyzeChart(scope, el, chart, w, h, theme.name, bg); } catch (e) { notes.push(`${scope}: analysis failed (${e.message})`); }
366
+ try { chart.dispose(); } catch { /* ignore */ }
367
+ }
368
+ }
369
+
370
+ // ---------- measure text spans in a rendered ECharts instance ----------
371
+ function analyzeChart(scope, el, chart, W, H, themeName, bg) {
372
+ const label = el && el.id ? `#${el.id}` : 'chart';
373
+ const list = chart.getZr().storage.getDisplayList(true, false);
374
+ const texts = [];
375
+ for (const t of list) {
376
+ if (t.type !== 'tspan' || t.ignore || t.invisible) continue;
377
+ const s = t.style || {};
378
+ if (!s.text || s.opacity === 0) continue;
379
+ // owning component and hidden ancestors come from the chain; the effective clip is what zrender computed
380
+ // for this span itself (__clipPaths), which already honors ignoreClip (e.g. ECharts end labels)
381
+ let p = t, hidden = false, comp = '', clip = null;
382
+ while (p) {
383
+ if (p.ignore || p.invisible) hidden = true;
384
+ if (!comp && p.__ecComponentInfo) comp = p.__ecComponentInfo.mainType;
385
+ p = p.parent || p.__hostTarget;
386
+ }
387
+ if (hidden) continue;
388
+ for (const cp of t.__clipPaths || []) { const cr = cp.getBoundingRect().clone(); const cm = cp.getComputedTransform(); if (cm) cr.applyTransform(cm); clip = clip ? intersectRect(clip, cr) : cr; }
389
+ const r = t.getBoundingRect().clone(); const m = t.getComputedTransform(); if (m) r.applyTransform(m);
390
+ texts.push({ text: String(s.text), comp: comp || 'text', font: s.fontSize || 12, fill: s.fill, r, clip });
391
+ }
392
+ const chartTexts = texts.filter(x => !/^\s*$/.test(x.text));
393
+ const fmt = x => `"${x.text}" (${x.comp})`;
394
+ if (args.includes('--dump')) for (const x of chartTexts) console.log(` ${scope} ${label} ${fmt(x)} at ${[x.r.x, x.r.y, x.r.width, x.r.height].map(Math.round).join(',')} clip ${x.clip ? [x.clip.x, x.clip.y, x.clip.width, x.clip.height].map(Math.round).join(',') : '-'} font ${x.font}`);
395
+ const seen = new Set();
396
+ // 1. overlaps
397
+ for (let i = 0; i < chartTexts.length; i++) for (let j = i + 1; j < chartTexts.length; j++) {
398
+ const a = chartTexts[i], b = chartTexts[j];
399
+ const ov = overlap(a.r, b.r, 1);
400
+ if (ov <= 0) continue;
401
+ const key = [a.text, b.text, a.comp, b.comp].join('|'); if (seen.has(key)) continue; seen.add(key);
402
+ add(scope, 'overlap', `${label}: ${fmt(a)} overlaps ${fmt(b)} by ${Math.round(ov)}px`, overlapHint(a, b));
403
+ }
404
+ // 2. clipped by the plot area, else beyond the chart container
405
+ for (const x of chartTexts) {
406
+ const clipped = x.clip && outside(x.r, x.clip);
407
+ if (clipped && clipped.by >= 1) { add(scope, 'clipped', `${label}: ${fmt(x)} is clipped by the plot area (${Math.round(clipped.by)}px past its ${clipped.side} edge)`, 'Keep the label inside the plot (label position, axis min/max or boundaryGap), or set series.clip: false when it is a value label on a mark.'); continue; }
408
+ const out = outside(x.r, { x: 0, y: 0, width: W, height: H });
409
+ if (out) add(scope, 'outside', `${label}: ${fmt(x)} extends ${Math.round(out.by)}px past the ${out.side} edge of the chart container`, outsideHint(x, out.side));
410
+ }
411
+ // 3. contrast against the page background of this theme. Near-white fills are labels drawn inside a mark
412
+ // and sit on the series color, not the background, so they are skipped; unparsable fills (auto/inherit) too.
413
+ const bgL = luminance(bg);
414
+ if (bgL != null) {
415
+ const seenFill = new Set();
416
+ for (const x of chartTexts) {
417
+ const l = luminance(x.fill);
418
+ if (l == null || l > 0.9 || seenFill.has(x.fill)) continue;
419
+ const ratio = contrast(l, bgL);
420
+ if (ratio >= MIN_CONTRAST) continue;
421
+ seenFill.add(x.fill);
422
+ add(scope, 'contrast', `${label}: ${fmt(x)} in ${x.fill} has ${ratio.toFixed(1)}:1 contrast on the ${themeName} background ${bg}`,
423
+ 'Text colors come from tokens() at render time (ink / ink-2 / muted), never from a literal, and the chart is rebuilt in render() on data-theme change.');
424
+ }
425
+ }
426
+ // 4. small fonts
427
+ const small = chartTexts.filter(x => x.font < MIN_FONT);
428
+ if (small.length) add(scope, 'font', `${label}: ${small.length} text(s) under ${MIN_FONT}px, e.g. ${fmt(small[0])} at ${small[0].font}px`, `Use at least ${MIN_FONT}px for every visible text.`);
429
+ if (chartTexts.length === 0) notes.push(`${scope}: ${label} rendered no text (empty chart or unsupported series type)`);
430
+ }
431
+
432
+ function intersectRect(a, b) {
433
+ const x = Math.max(a.x, b.x), y = Math.max(a.y, b.y);
434
+ const x2 = Math.min(a.x + a.width, b.x + b.width), y2 = Math.min(a.y + a.height, b.y + b.height);
435
+ return { x, y, width: Math.max(0, x2 - x), height: Math.max(0, y2 - y) };
436
+ }
437
+ function overlap(a, b, shrink) {
438
+ const ix = Math.min(a.x + a.width, b.x + b.width) - Math.max(a.x, b.x) - shrink * 2;
439
+ const iy = Math.min(a.y + a.height, b.y + b.height) - Math.max(a.y, b.y) - shrink * 2;
440
+ return ix > 0 && iy > 0 ? Math.min(ix, iy) : 0;
441
+ }
442
+ function outside(r, box) {
443
+ const tol = 0.5;
444
+ const sides = [
445
+ ['left', box.x - r.x], ['right', r.x + r.width - (box.x + box.width)],
446
+ ['top', box.y - r.y], ['bottom', r.y + r.height - (box.y + box.height)],
447
+ ].filter(([, by]) => by > tol).sort((a, b) => b[1] - a[1]);
448
+ return sides.length ? { side: sides[0][0], by: sides[0][1] } : null;
449
+ }
450
+ function overlapHint(a, b) {
451
+ const comps = [a.comp, b.comp];
452
+ if (comps.includes('legend') && comps.includes('yAxis')) return 'The axis name collides with the legend: put the unit in the subtitle or axisLabel.formatter instead of yAxis.name, or move the legend to the bottom, or raise grid.top.';
453
+ if (comps.includes('legend')) return 'Raise grid.top (or grid.bottom for a bottom legend) so the legend has its own band.';
454
+ if (a.comp === 'xAxis' && b.comp === 'xAxis') return 'Category labels collide: show fewer ticks (axisLabel.interval), rotate them, or switch to horizontal bars.';
455
+ if (a.comp === 'series' && b.comp === 'series') return 'Data labels collide: label fewer points, or set labelLayout: { hideOverlap: true }.';
456
+ if (comps.includes('title')) return 'Move the title into the HTML heading and drop the in-chart title.';
457
+ return 'Move one of the texts, or reserve more space for it.';
458
+ }
459
+ function outsideHint(x, side) {
460
+ if (x.comp === 'series') return `Reserve room for the label: increase grid.${side} to the label width plus 8px (e.g. 56 for a short end label).`;
461
+ if (x.comp === 'legend') return 'The legend does not fit: let it wrap (legend.type default) or move it to the bottom.';
462
+ return `Increase grid.${side} or the container height so the text fits.`;
463
+ }
464
+
465
+ // ---------- screenshot via a locally installed Chromium browser ----------
466
+ function findBrowser() {
467
+ if (process.env.SEMA_VIZ_BROWSER && fs.existsSync(process.env.SEMA_VIZ_BROWSER)) return process.env.SEMA_VIZ_BROWSER;
468
+ const p = process.platform;
469
+ const candidates = p === 'darwin' ? [
470
+ '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
471
+ '/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge',
472
+ '/Applications/Chromium.app/Contents/MacOS/Chromium',
473
+ '/Applications/Brave Browser.app/Contents/MacOS/Brave Browser',
474
+ ] : p === 'win32' ? [
475
+ path.join(process.env['ProgramFiles'] || 'C:\\Program Files', 'Google/Chrome/Application/chrome.exe'),
476
+ path.join(process.env['ProgramFiles(x86)'] || 'C:\\Program Files (x86)', 'Google/Chrome/Application/chrome.exe'),
477
+ path.join(process.env.LOCALAPPDATA || '', 'Google/Chrome/Application/chrome.exe'),
478
+ path.join(process.env['ProgramFiles(x86)'] || 'C:\\Program Files (x86)', 'Microsoft/Edge/Application/msedge.exe'),
479
+ path.join(process.env['ProgramFiles'] || 'C:\\Program Files', 'Microsoft/Edge/Application/msedge.exe'),
480
+ ] : [];
481
+ for (const c of candidates) if (c && fs.existsSync(c)) return c;
482
+ if (p !== 'win32') for (const name of ['google-chrome', 'google-chrome-stable', 'chromium', 'chromium-browser', 'microsoft-edge']) {
483
+ const r = spawnSync('which', [name], { encoding: 'utf8' });
484
+ if (r.status === 0 && r.stdout.trim()) return r.stdout.trim();
485
+ }
486
+ return null;
487
+ }
488
+ async function screenshot() {
489
+ const browser = findBrowser();
490
+ if (!browser) return 'skipped: no Chromium-based browser found (set SEMA_VIZ_BROWSER to a chrome/msedge executable to enable)';
491
+ const outDir = fs.mkdtempSync(path.join(os.tmpdir(), 'sema-viz-'));
492
+ const png = path.join(outDir, path.basename(abs).replace(/\.html?$/i, '') + '.png');
493
+ const profile = path.join(outDir, 'profile');
494
+ // A page with a running animation loop keeps headless Chrome alive after the screenshot is written,
495
+ // so poll for the file and kill the browser instead of waiting for it to exit.
496
+ const child = spawn(browser, [
497
+ '--headless=new', '--disable-gpu', '--hide-scrollbars', '--no-first-run', '--no-default-browser-check', '--disable-extensions', '--disable-sync',
498
+ `--user-data-dir=${profile}`, `--window-size=${WIDTHS[0]},1000`, '--virtual-time-budget=5000', `--screenshot=${png}`, 'file://' + abs,
499
+ ], { stdio: ['ignore', 'ignore', 'pipe'] });
500
+ let stderr = '';
501
+ child.stderr.on('data', d => { stderr += d; });
502
+ let exited = false;
503
+ child.on('exit', () => { exited = true; });
504
+ const deadline = Date.now() + 30000;
505
+ while (Date.now() < deadline && !exited) {
506
+ if (fs.existsSync(png) && fs.statSync(png).size > 0) { await new Promise(r => setTimeout(r, 300)); break; }
507
+ await new Promise(r => setTimeout(r, 200));
508
+ }
509
+ if (!exited) child.kill();
510
+ if (!fs.existsSync(png)) return `skipped: browser did not produce an image (${stderr.trim().split('\n').pop() || 'unknown error'})`;
511
+ try { fs.rmSync(profile, { recursive: true, force: true }); } catch { /* ignore */ }
512
+ return `${png} (${WIDTHS[0]}x1000, page may be shorter than the image)`;
513
+ }
514
+
515
+ // ---------- main ----------
516
+ const echarts = await loadEcharts();
517
+ if (!echartsSrc && !usesD3) notes.push('no pinned ECharts script found; only script errors and the screenshot are checked');
518
+ if (usesD3) notes.push('D3 content is not measured by this checker; rely on the screenshot for it');
519
+ // Light first, then dark: a layout issue shows up under light and is deduplicated below; what remains under a
520
+ // dark scope is dark-only (a color literal, a render() path that breaks on re-render, low contrast)
521
+ const runs = [];
522
+ for (const theme of THEMES) for (const w of WIDTHS) { await runAt(w, echarts, theme); runs.push(theme.name === 'dark' ? `${w}px dark` : `${w}px`); }
523
+
524
+ // A narrower width or the other theme usually repeats the same issues; print each distinct issue once, at the first scope it appears
525
+ const seenText = new Set();
526
+ const distinct = issues.filter(i => { const k = `${i.kind}|${i.text.replace(/\d+px/g, '')}`; if (seenText.has(k)) return false; seenText.add(k); return true; });
527
+ const shown = distinct.slice(0, MAX_ISSUES);
528
+ for (const i of shown.filter(i => i.scope === 'file')) console.log(`[file] ${i.text}\n fix: ${i.hint}`);
529
+ for (const scope of runs) {
530
+ const mine = shown.filter(i => i.scope === scope);
531
+ const total = issues.filter(i => i.scope === scope).length;
532
+ console.log(`[layout ${scope}] ${total ? total + ' issue(s)' + (mine.length < total ? ` (${total - mine.length} same as above)` : '') : 'clean'}`);
533
+ for (const i of mine) console.log(`- ${i.text}\n fix: ${i.hint}`);
534
+ }
535
+ if (distinct.length > MAX_ISSUES) console.log(`(${distinct.length - MAX_ISSUES} more not shown)`);
536
+ for (const n of [...new Set(notes)]) console.log(`note: ${n}`);
537
+ if (wantShot) console.log(`[screenshot] ${distinct.length ? 'skipped until the issues above are fixed' : await screenshot()}`);
538
+ console.log(distinct.length ? `RESULT: ${distinct.length} issue(s)` : 'RESULT: OK');
539
+ process.exit(0);
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Allocate the output path for a new visualization and print it. Zero dependencies.
4
+ *
5
+ * node path.mjs <title>
6
+ *
7
+ * Creates <root>/attachments/<uuid>/ (root = the .sema directory this skill is installed under) and prints
8
+ * the absolute path <root>/attachments/<uuid>/<title>.html on a single line. The model writes the file there.
9
+ * The title is normalized to ASCII lowercase-hyphenated; a non-ASCII title falls back to `visualization`.
10
+ */
11
+ import fs from 'node:fs';
12
+ import path from 'node:path';
13
+ import { randomUUID } from 'node:crypto';
14
+ import { fileURLToPath } from 'node:url';
15
+
16
+ // <root>/skills/visualize/scripts → <root>
17
+ const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..', '..');
18
+ const raw = process.argv.slice(2).join(' ').trim();
19
+ const title = raw.toLowerCase().replace(/\.html?$/, '').replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 60) || 'visualization';
20
+ const dir = path.join(ROOT, 'attachments', randomUUID());
21
+ fs.mkdirSync(dir, { recursive: true });
22
+ // Forward slashes on every platform: the model passes this path to Git Bash on Windows, where
23
+ // an unquoted backslash path would be mangled. Node and the file tools accept C:/... as well.
24
+ console.log(path.join(dir, `${title}.html`).split(path.sep).join('/'));
@@ -0,0 +1,13 @@
1
+ {
2
+ "card": {
3
+ "name": "仓库知识库生成",
4
+ "description": "微软 deep-wiki 技能:把代码仓自动整理成结构化 wiki、上手文档和变更记录。",
5
+ "category": "dev",
6
+ "order": 50
7
+ },
8
+ "source": {
9
+ "repo": "microsoft/skills",
10
+ "ref": "7066b58141d8cc66f39356b2ee5bb64d428dcf17",
11
+ "path": ".github/plugins/deep-wiki/skills/wiki-page-writer"
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "card": {
3
+ "name": "写实施计划",
4
+ "description": "把模糊需求拆成分阶段、可验证、带验收标准的计划文档。",
5
+ "category": "dev",
6
+ "order": 20
7
+ },
8
+ "source": {
9
+ "repo": "obra/superpowers",
10
+ "ref": "b36e0829c6d0140e93cfef2ca599b1b07d4a7797",
11
+ "path": "skills/writing-plans"
12
+ }
13
+ }