@dooc-dev/dooc 0.0.6 → 0.0.8

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 (395) hide show
  1. package/dist/client.global.js +1 -0
  2. package/dist/code-worker.global.js +11 -11
  3. package/dist/code.global.js +75 -75
  4. package/dist/edit.global.js +234 -231
  5. package/dist/{compiler → engine/compiler}/bundle-urls.js +1 -4
  6. package/dist/{compiler → engine/compiler}/check-prose.d.ts +1 -1
  7. package/dist/{compiler → engine/compiler}/check-prose.js +1 -1
  8. package/dist/{compiler → engine/compiler}/check.js +15 -27
  9. package/dist/{compiler → engine/compiler}/code-blocks.js +3 -1
  10. package/dist/{compiler → engine/compiler}/code-languages.js +1 -2
  11. package/dist/{compiler → engine/compiler}/compile.d.ts +5 -4
  12. package/dist/{compiler → engine/compiler}/compile.js +91 -32
  13. package/dist/{compiler → engine/compiler}/config.js +1 -3
  14. package/dist/{compiler → engine/compiler}/dialect.d.ts +1 -3
  15. package/dist/{compiler → engine/compiler}/dialect.js +8 -52
  16. package/dist/{compiler → engine/compiler}/dxf.js +1 -1
  17. package/dist/{compiler → engine/compiler}/export.js +15 -8
  18. package/dist/{compiler → engine/compiler}/figures.js +26 -22
  19. package/dist/{compiler → engine/compiler}/file-cache.d.ts +1 -2
  20. package/dist/{compiler → engine/compiler}/file-cache.js +8 -15
  21. package/dist/{compiler → engine/compiler}/files.js +49 -38
  22. package/dist/{compiler → engine/compiler}/fonts.js +1 -3
  23. package/dist/{compiler → engine/compiler}/from-mdast.js +1 -1
  24. package/dist/engine/compiler/host.d.ts +10 -0
  25. package/dist/engine/compiler/host.js +16 -0
  26. package/dist/{compiler → engine/compiler}/icons.d.ts +3 -0
  27. package/dist/{compiler → engine/compiler}/icons.js +28 -10
  28. package/dist/{compiler → engine/compiler}/ignored-files.d.ts +2 -0
  29. package/dist/{compiler → engine/compiler}/ignored-files.js +12 -3
  30. package/dist/{compiler → engine/compiler}/locales.js +2 -8
  31. package/dist/{compiler → engine/compiler}/manifest.d.ts +3 -2
  32. package/dist/engine/compiler/manifest.js +46 -0
  33. package/dist/{compiler → engine/compiler}/ops.d.ts +4 -1
  34. package/dist/{compiler → engine/compiler}/ops.js +36 -21
  35. package/dist/engine/compiler/schema-file-references.d.ts +2 -0
  36. package/dist/engine/compiler/schema-file-references.js +82 -0
  37. package/dist/engine/compiler/serialize.d.ts +2 -0
  38. package/dist/engine/compiler/serialize.js +5 -0
  39. package/dist/{compiler → engine/compiler}/subformat-schema.js +1 -3
  40. package/dist/{compiler → engine/compiler}/subformats.d.ts +10 -0
  41. package/dist/{compiler → engine/compiler}/subformats.js +122 -18
  42. package/dist/{compiler → engine/compiler}/textfile-remote.js +1 -2
  43. package/dist/{compiler → engine/compiler}/textfile.js +4 -6
  44. package/dist/{compiler → engine/compiler}/theme-variants.js +1 -1
  45. package/dist/{compiler → engine/compiler}/zip.js +1 -1
  46. package/dist/{core → engine/core}/blocks.d.ts +6 -4
  47. package/dist/{core → engine/core}/content-metadata.d.ts +6 -1
  48. package/dist/{core → engine/core}/content-metadata.js +84 -18
  49. package/dist/{core → engine/core}/content-types.d.ts +4 -2
  50. package/dist/{core → engine/core}/html.d.ts +7 -0
  51. package/dist/{core → engine/core}/html.js +44 -3
  52. package/dist/{core → engine/core}/icons.d.ts +3 -0
  53. package/dist/engine/core/icons.js +20 -0
  54. package/dist/{core → engine/core}/routing.d.ts +2 -0
  55. package/dist/{core → engine/core}/routing.js +9 -0
  56. package/dist/{core → engine/core}/schema-refs.d.ts +1 -1
  57. package/dist/{core → engine/core}/schema-refs.js +3 -1
  58. package/dist/engine/core/subformat-references.d.ts +5 -0
  59. package/dist/engine/core/subformat-references.js +33 -0
  60. package/dist/{core → engine/core}/subformats.d.ts +7 -0
  61. package/dist/{core → engine/core}/subformats.js +5 -1
  62. package/dist/{core → engine/core}/taxonomy.d.ts +2 -3
  63. package/dist/{core → engine/core}/taxonomy.js +1 -5
  64. package/dist/flow.global.js +1031 -1057
  65. package/dist/frontend/application-request.d.ts +14 -0
  66. package/dist/frontend/application-request.js +36 -0
  67. package/dist/frontend/document-application.d.ts +200 -0
  68. package/dist/{viewer/serve.js → frontend/document-application.js} +1611 -1670
  69. package/dist/frontend/figure-preview.d.ts +4 -0
  70. package/dist/{viewer → frontend}/figure-preview.js +4 -4
  71. package/dist/{viewer → frontend}/file-references.d.ts +1 -1
  72. package/dist/{viewer → frontend}/file-references.js +3 -3
  73. package/dist/{viewer → frontend}/font-picker.d.ts +1 -1
  74. package/dist/{viewer → frontend}/font-settings.d.ts +1 -1
  75. package/dist/{viewer → frontend}/language-picker.js +112 -18
  76. package/dist/{viewer → frontend}/locales/eng.json +16 -2
  77. package/dist/{viewer → frontend}/locales/jpn.json +16 -2
  78. package/dist/{viewer → frontend}/locales/zho.json +16 -2
  79. package/dist/{viewer → frontend}/nav-focus.js +2 -0
  80. package/dist/{viewer → frontend}/plugin-blocks.js +2 -2
  81. package/dist/{viewer → frontend}/resize.js +14 -2
  82. package/dist/frontend/resource-download.d.ts +2 -0
  83. package/dist/frontend/resource-download.js +43 -0
  84. package/dist/{viewer → frontend}/resource-library.d.ts +9 -2
  85. package/dist/{viewer → frontend}/resource-library.js +133 -37
  86. package/dist/{core → frontend}/schema-graph-flow.d.ts +1 -1
  87. package/dist/{core → frontend}/schema-graph-flow.js +1 -1
  88. package/dist/{viewer → frontend}/search.d.ts +2 -2
  89. package/dist/{viewer → frontend}/search.js +26 -8
  90. package/dist/graph/{abnfDiagram-S7VZAUFO-ASBULSKE.js → abnfDiagram-S7VZAUFO-GAGCW2J5.js} +1 -1
  91. package/dist/graph/{architecture-WOLXFQ4H-V57EDXXY.js → architecture-WOLXFQ4H-AWAC3VBS.js} +1 -1
  92. package/dist/graph/{architectureDiagram-YGSQEFNW-GIMP347N.js → architectureDiagram-YGSQEFNW-WQ7QKSUJ.js} +1 -1
  93. package/dist/graph/{blockDiagram-APKKGZFW-RDL2T4JW.js → blockDiagram-APKKGZFW-H7ZNJMOM.js} +1 -1
  94. package/dist/graph/{bpmnIcons-APHXDYXF-TWOSQNUQ.js → bpmnIcons-APHXDYXF-EAVPNTFE.js} +1 -1
  95. package/dist/graph/{c4Diagram-KJ2TOQU5-75LIUC4F.js → c4Diagram-KJ2TOQU5-3IYS34YL.js} +1 -1
  96. package/dist/graph/{chunk-KU6GTEMS.js → chunk-3CJU2RDX.js} +1 -1
  97. package/dist/graph/{chunk-ISO77HML.js → chunk-5N2X2DXU.js} +1 -1
  98. package/dist/graph/{chunk-YCRLJT2S.js → chunk-67BPVAXC.js} +1 -1
  99. package/dist/graph/{chunk-26TUJSYJ.js → chunk-6CDZONCA.js} +1 -1
  100. package/dist/graph/{chunk-I3DMZIHV.js → chunk-7ASYMKN2.js} +1 -1
  101. package/dist/graph/{chunk-K2KLZU7M.js → chunk-7JQUFVT4.js} +2 -2
  102. package/dist/graph/{chunk-BBD5CEDC.js → chunk-7LSMJ4VU.js} +1 -1
  103. package/dist/graph/{chunk-EG5UVNOC.js → chunk-7UKJADAE.js} +1 -1
  104. package/dist/graph/{chunk-BZAMCJ6B.js → chunk-AARGNXTW.js} +1 -1
  105. package/dist/graph/{chunk-HOPPTA6H.js → chunk-BOXAA5AP.js} +2 -2
  106. package/dist/graph/{chunk-N3OHKGRZ.js → chunk-BTMPKSGF.js} +1 -1
  107. package/dist/graph/{chunk-QCJUF4YA.js → chunk-DIDARDST.js} +1 -1
  108. package/dist/graph/{chunk-R63JUMUK.js → chunk-EWYECPNJ.js} +1 -1
  109. package/dist/graph/{chunk-3YJHMOOA.js → chunk-FD7ZFC7R.js} +1 -1
  110. package/dist/graph/chunk-GWYODWCE.js +1 -0
  111. package/dist/graph/{chunk-IC23EEF6.js → chunk-HKRJKXEE.js} +1 -1
  112. package/dist/graph/{chunk-PW2RGZ3O.js → chunk-I5LEUF24.js} +1 -1
  113. package/dist/graph/{chunk-OFZLK5G4.js → chunk-ICJPOOXG.js} +1 -1
  114. package/dist/graph/{chunk-KT4VPQD5.js → chunk-IVZHB6RS.js} +2 -2
  115. package/dist/graph/{chunk-VM2H7G2R.js → chunk-JZGXHT3J.js} +1 -1
  116. package/dist/graph/{chunk-HJG2HUYJ.js → chunk-LSRL537V.js} +1 -1
  117. package/dist/graph/{chunk-C6J4A356.js → chunk-N44XPVUD.js} +1 -1
  118. package/dist/graph/{chunk-JD7ZBJD2.js → chunk-NDAMZVXQ.js} +1 -1
  119. package/dist/graph/{chunk-QEEA3KYY.js → chunk-QLS7NIYR.js} +1 -1
  120. package/dist/graph/{chunk-JRSH5GNS.js → chunk-QQIGL7OP.js} +1 -1
  121. package/dist/graph/chunk-SQE76S5B.js +1 -0
  122. package/dist/graph/{chunk-ZMCB7VP2.js → chunk-WQHTQAFY.js} +1 -1
  123. package/dist/graph/{classDiagram-v2-L25IHNXF-JL7LVDZH.js → classDiagram-v2-L25IHNXF-HNTCDTNK.js} +1 -1
  124. package/dist/graph/{cose-bilkent-JH36ORCC-PNM3EYPB.js → cose-bilkent-JH36ORCC-2GVA7XKO.js} +1 -1
  125. package/dist/graph/{cynefin-EF2NZ3EQ-PSXP3DXL.js → cynefin-EF2NZ3EQ-TCI65RAQ.js} +1 -1
  126. package/dist/graph/{cynefinDiagram-L36ESFBY-QVY54CXO.js → cynefinDiagram-L36ESFBY-OKQ5BLVF.js} +1 -1
  127. package/dist/graph/{dagre-SPEB5RXH-HPGQXBZJ.js → dagre-SPEB5RXH-KZEBD52K.js} +1 -1
  128. package/dist/graph/{diagram-3B7GL73J-DWH5WS2P.js → diagram-3B7GL73J-ESCBJM3O.js} +1 -1
  129. package/dist/graph/{diagram-DNEMPZML-TEGH2U5I.js → diagram-DNEMPZML-ZIBUSQZI.js} +1 -1
  130. package/dist/graph/{diagram-L3MUGCDN-X4MREUWR.js → diagram-L3MUGCDN-IGK62IPN.js} +1 -1
  131. package/dist/graph/{diagram-LA4NIPWU-NXT746HG.js → diagram-LA4NIPWU-2KZCOFJ5.js} +1 -1
  132. package/dist/graph/{diagram-MHCOC4E2-JGHXSAGS.js → diagram-MHCOC4E2-EYAAB236.js} +1 -1
  133. package/dist/graph/{diagram-XPFHEONP-ZHZPBLT4.js → diagram-XPFHEONP-OZ5ARGMG.js} +1 -1
  134. package/dist/graph/{ebnfDiagram-UZSYDL2S-SMF6KJ43.js → ebnfDiagram-UZSYDL2S-M3XJHARD.js} +1 -1
  135. package/dist/graph/{erDiagram-EYBAPDEH-B3JNJ357.js → erDiagram-EYBAPDEH-Y7KUBH7A.js} +1 -1
  136. package/dist/graph/{eventmodeling-K75KTNOO-WG6DDYMC.js → eventmodeling-K75KTNOO-ROLYRDEP.js} +1 -1
  137. package/dist/graph/flowDiagram-MALGAFMO-AAUEIPCR.js +1 -0
  138. package/dist/graph/{ganttDiagram-23REXITY-YXBYWFOJ.js → ganttDiagram-23REXITY-JSBTFSSJ.js} +1 -1
  139. package/dist/graph/{gitGraph-VSP46ZUC-VBFWJBBT.js → gitGraph-VSP46ZUC-ZCBCDVNF.js} +1 -1
  140. package/dist/graph/{gitGraphDiagram-STJD7YCW-4FZDCFGV.js → gitGraphDiagram-STJD7YCW-3ZA5FT3G.js} +1 -1
  141. package/dist/graph/{info-OHQRW6UA-ALVDUVYV.js → info-OHQRW6UA-JKJGOQNY.js} +1 -1
  142. package/dist/graph/infoDiagram-KBXO4MBG-6LFMPP2O.js +2 -0
  143. package/dist/graph/{ishikawaDiagram-M35NCXHK-FRZD2PWQ.js → ishikawaDiagram-M35NCXHK-YLEU44DY.js} +1 -1
  144. package/dist/graph/{journeyDiagram-OPLOXDXO-7Z66JCPR.js → journeyDiagram-OPLOXDXO-ZHJV66ZT.js} +1 -1
  145. package/dist/graph/{kanban-definition-BZKZHSQY-NN5AIKTE.js → kanban-definition-BZKZHSQY-SDU25WUM.js} +1 -1
  146. package/dist/graph/{katex-DXDNVO6V.js → katex-WSLZOTY7.js} +1 -1
  147. package/dist/graph/{mindmap-definition-I2QAS2VK-HDPCABN2.js → mindmap-definition-I2QAS2VK-XQNBCYHN.js} +1 -1
  148. package/dist/graph/{packet-JDAUHWVQ-5MQIBWAH.js → packet-JDAUHWVQ-Y3H77ERD.js} +1 -1
  149. package/dist/graph/{pegDiagram-FD4XPPHP-H2BFNCKT.js → pegDiagram-FD4XPPHP-YO4VWH6V.js} +1 -1
  150. package/dist/graph/{pie-XZMESJXO-T5VRKHVT.js → pie-XZMESJXO-PRER4XL5.js} +1 -1
  151. package/dist/graph/{pieDiagram-J4AKIIQI-O3NJSVD3.js → pieDiagram-J4AKIIQI-TJ5WOOSV.js} +1 -1
  152. package/dist/graph/{quadrantDiagram-XTYBLID2-TMTZJI3P.js → quadrantDiagram-XTYBLID2-G6MSSZLW.js} +1 -1
  153. package/dist/graph/{radar-ABXABTNO-C6FXIBYW.js → radar-ABXABTNO-M6MV34GM.js} +1 -1
  154. package/dist/graph/{railroad-I3PHUGI6-ZSO5JXB3.js → railroad-I3PHUGI6-YIWPGN6Q.js} +1 -1
  155. package/dist/graph/{railroad-abnf-LNEFI6M7-CI4GQRHB.js → railroad-abnf-LNEFI6M7-7JHLZ2R7.js} +1 -1
  156. package/dist/graph/{railroad-ebnf-DWYD2UWJ-MUENNCGK.js → railroad-ebnf-DWYD2UWJ-V55BXEWY.js} +1 -1
  157. package/dist/graph/{railroad-peg-JR7BVNR7-N3X5GGIX.js → railroad-peg-JR7BVNR7-XCGKDRMK.js} +1 -1
  158. package/dist/graph/{railroadDiagram-MRQ6NCDL-JHWS23UO.js → railroadDiagram-MRQ6NCDL-RACSFXC4.js} +1 -1
  159. package/dist/graph/{requirementDiagram-Y7LWUY3S-7DVLPO4B.js → requirementDiagram-Y7LWUY3S-4LQIQWHQ.js} +1 -1
  160. package/dist/graph/{sankeyDiagram-WGJFYUXA-Z5L4R5TR.js → sankeyDiagram-WGJFYUXA-K3RXG5FB.js} +1 -1
  161. package/dist/graph/schema-graph-global.js +17 -17
  162. package/dist/graph/{sequenceDiagram-5NDRBG5M-RCTU25NT.js → sequenceDiagram-5NDRBG5M-Y6RBHRS3.js} +1 -1
  163. package/dist/graph/{sizeCapture-INFHLROL-RROY32P5.js → sizeCapture-INFHLROL-TJW3VUGH.js} +1 -1
  164. package/dist/graph/{stateDiagram-v2-FJ4FJNEA-BXUSPWDK.js → stateDiagram-v2-FJ4FJNEA-4M5WZORG.js} +1 -1
  165. package/dist/graph/swimlanes-UMQ2AFYF-O4W6U4RO.js +1 -0
  166. package/dist/graph/swimlanesDiagram-OMPLPG4O-HZAKM45N.js +8 -0
  167. package/dist/graph/{timeline-definition-SEUHKTQE-ZQSMIVAS.js → timeline-definition-SEUHKTQE-IHISQ4Q7.js} +1 -1
  168. package/dist/graph/{treeView-D4JQ5SDB-42S7U73N.js → treeView-D4JQ5SDB-EVGY4VYS.js} +1 -1
  169. package/dist/graph/{treemap-SAJKECNS-RUBYQ7XF.js → treemap-SAJKECNS-LN3SMFRX.js} +1 -1
  170. package/dist/graph/{usecaseDiagram-AFA6YXN4-57RDRYXF.js → usecaseDiagram-AFA6YXN4-B645A3J6.js} +1 -1
  171. package/dist/graph/{vennDiagram-NNMJR3RB-5C3LVAV6.js → vennDiagram-NNMJR3RB-K3HWMON6.js} +1 -1
  172. package/dist/graph/{wardley-7MLQ67FV-NV5HXTTC.js → wardley-7MLQ67FV-RRWOELC6.js} +1 -1
  173. package/dist/graph/{wardleyDiagram-S7YFUSEH-6D5BKXHM.js → wardleyDiagram-S7YFUSEH-DMMWKJEK.js} +1 -1
  174. package/dist/graph/{xychartDiagram-GGNKY7IX-6ET3ZM67.js → xychartDiagram-GGNKY7IX-K6MUQVXR.js} +1 -1
  175. package/dist/install.sh +68 -0
  176. package/dist/plugins.global.js +62 -62
  177. package/dist/{viewer → server}/assets.d.ts +2 -0
  178. package/dist/server/assets.js +7 -0
  179. package/dist/{viewer → server}/build-plugins.js +4 -4
  180. package/dist/{viewer → server}/build.d.ts +2 -1
  181. package/dist/{viewer → server}/build.js +31 -15
  182. package/dist/{cli.js → server/cli.js} +223 -56
  183. package/dist/server/editor-tools.d.ts +1 -0
  184. package/dist/server/editor-tools.js +1 -0
  185. package/dist/{viewer → server}/extension-pack.js +2 -2
  186. package/dist/{viewer → server}/extensions.d.ts +1 -1
  187. package/dist/{viewer → server}/extensions.js +3 -3
  188. package/dist/server/git-diff.d.ts +10 -0
  189. package/dist/{viewer → server}/git-diff.js +45 -10
  190. package/dist/server/git-origin.d.ts +4 -0
  191. package/dist/server/git-origin.js +103 -0
  192. package/dist/server/git.d.ts +9 -0
  193. package/dist/{viewer → server}/git.js +50 -6
  194. package/dist/server/history.d.ts +14 -0
  195. package/dist/server/history.js +205 -0
  196. package/dist/{viewer → server}/hmr.d.ts +0 -22
  197. package/dist/server/hmr.js +168 -0
  198. package/dist/server/index.d.ts +17 -0
  199. package/dist/{index.js → server/index.js} +16 -16
  200. package/dist/{viewer → server}/ja-lint.d.ts +1 -1
  201. package/dist/{viewer → server}/languages.d.ts +1 -1
  202. package/dist/{viewer → server}/languages.js +3 -3
  203. package/dist/{mcp.d.ts → server/mcp.d.ts} +2 -2
  204. package/dist/{mcp.js → server/mcp.js} +60 -21
  205. package/dist/{viewer → server}/plugin-config.d.ts +2 -2
  206. package/dist/{viewer → server}/plugin-config.js +2 -2
  207. package/dist/{plugins → server/plugins}/local-storage.d.ts +1 -1
  208. package/dist/{plugins → server/plugins}/local-storage.js +1 -1
  209. package/dist/{plugins → server/plugins}/runtime.d.ts +4 -4
  210. package/dist/{plugins → server/plugins}/runtime.js +4 -4
  211. package/dist/{viewer → server}/plugins.d.ts +3 -3
  212. package/dist/{viewer → server}/plugins.js +14 -13
  213. package/dist/server/resource-library.d.ts +1 -0
  214. package/dist/server/resource-library.js +1 -0
  215. package/dist/server/self.d.ts +5 -0
  216. package/dist/server/self.js +98 -0
  217. package/dist/server/serve.d.ts +61 -0
  218. package/dist/server/serve.js +503 -0
  219. package/dist/server/static-client.d.ts +4 -0
  220. package/dist/server/static-client.js +117 -0
  221. package/dist/server/workspace-server.d.ts +16 -0
  222. package/dist/server/workspace-server.js +266 -0
  223. package/dist/{viewer → server}/workspace.d.ts +6 -1
  224. package/dist/{viewer → server}/workspace.js +46 -0
  225. package/dist/subformats.global.js +92 -6
  226. package/dist/ui.global.js +85 -72
  227. package/dist/workspace/client.d.ts +13 -0
  228. package/dist/workspace/client.js +114 -0
  229. package/dist/{viewer → workspace}/code-file.d.ts +1 -1
  230. package/dist/{viewer → workspace}/code-file.js +7 -7
  231. package/dist/workspace/connection.d.ts +27 -0
  232. package/dist/workspace/connection.js +38 -0
  233. package/dist/{viewer → workspace}/editor-tools.d.ts +7 -1
  234. package/dist/{viewer → workspace}/editor-tools.js +12 -9
  235. package/dist/{viewer → workspace}/git-types.d.ts +7 -0
  236. package/dist/workspace/github.d.ts +4 -0
  237. package/dist/workspace/github.js +99 -0
  238. package/dist/workspace/history.d.ts +46 -0
  239. package/dist/workspace/history.js +86 -0
  240. package/dist/workspace/protocol.d.ts +38 -0
  241. package/dist/workspace/protocol.js +20 -0
  242. package/dist/workspace/resource-download.d.ts +1 -0
  243. package/dist/workspace/resource-download.js +8 -0
  244. package/dist/workspace/server.d.ts +9 -0
  245. package/dist/workspace/server.js +48 -0
  246. package/dist/{viewer → workspace}/site-icon.js +9 -10
  247. package/dist/{viewer → workspace}/site-title.js +6 -7
  248. package/dist/{viewer → workspace}/textfile.d.ts +1 -1
  249. package/dist/{viewer → workspace}/textfile.js +5 -5
  250. package/dist/workspace-worker.global.js +2859 -0
  251. package/package.json +43 -21
  252. package/dist/compiler/manifest.js +0 -37
  253. package/dist/compiler/serialize.d.ts +0 -3
  254. package/dist/compiler/serialize.js +0 -16
  255. package/dist/core/icons.js +0 -5
  256. package/dist/graph/chunk-3RNHDNP5.js +0 -1
  257. package/dist/graph/chunk-5UUEAHTN.js +0 -1
  258. package/dist/graph/chunk-6T55RVVR.js +0 -1
  259. package/dist/graph/elk-XV6XMXQE-AZ4HLCWI.js +0 -27
  260. package/dist/graph/flowDiagram-MALGAFMO-2R7EYAQI.js +0 -1
  261. package/dist/graph/infoDiagram-KBXO4MBG-7EHX2GQG.js +0 -2
  262. package/dist/graph/swimlanes-UMQ2AFYF-LDD74Q2S.js +0 -1
  263. package/dist/graph/swimlanesDiagram-OMPLPG4O-ZYULLJSU.js +0 -8
  264. package/dist/index.d.ts +0 -17
  265. package/dist/viewer/assets.js +0 -3
  266. package/dist/viewer/figure-preview.d.ts +0 -4
  267. package/dist/viewer/git-diff.d.ts +0 -6
  268. package/dist/viewer/git.d.ts +0 -5
  269. package/dist/viewer/hmr.js +0 -341
  270. package/dist/viewer/serve.d.ts +0 -216
  271. /package/dist/{compiler → engine/compiler}/asset-references.d.ts +0 -0
  272. /package/dist/{compiler → engine/compiler}/asset-references.js +0 -0
  273. /package/dist/{compiler → engine/compiler}/bundle-urls.d.ts +0 -0
  274. /package/dist/{compiler → engine/compiler}/check-types.d.ts +0 -0
  275. /package/dist/{compiler → engine/compiler}/check-types.js +0 -0
  276. /package/dist/{compiler → engine/compiler}/check.d.ts +0 -0
  277. /package/dist/{compiler → engine/compiler}/code-blocks.d.ts +0 -0
  278. /package/dist/{compiler → engine/compiler}/code-languages.d.ts +0 -0
  279. /package/dist/{compiler → engine/compiler}/config.d.ts +0 -0
  280. /package/dist/{compiler → engine/compiler}/drawio.d.ts +0 -0
  281. /package/dist/{compiler → engine/compiler}/drawio.js +0 -0
  282. /package/dist/{compiler → engine/compiler}/dxf.d.ts +0 -0
  283. /package/dist/{compiler → engine/compiler}/export.d.ts +0 -0
  284. /package/dist/{compiler → engine/compiler}/figures.d.ts +0 -0
  285. /package/dist/{compiler → engine/compiler}/files.d.ts +0 -0
  286. /package/dist/{compiler → engine/compiler}/fonts.d.ts +0 -0
  287. /package/dist/{compiler → engine/compiler}/format.d.ts +0 -0
  288. /package/dist/{compiler → engine/compiler}/format.js +0 -0
  289. /package/dist/{compiler → engine/compiler}/from-mdast.d.ts +0 -0
  290. /package/dist/{compiler → engine/compiler}/language-codes.d.ts +0 -0
  291. /package/dist/{compiler → engine/compiler}/language-codes.js +0 -0
  292. /package/dist/{compiler → engine/compiler}/locales.d.ts +0 -0
  293. /package/dist/{compiler → engine/compiler}/public-file.d.ts +0 -0
  294. /package/dist/{compiler → engine/compiler}/public-file.js +0 -0
  295. /package/dist/{compiler → engine/compiler}/subformat-schema.d.ts +0 -0
  296. /package/dist/{compiler → engine/compiler}/terms.d.ts +0 -0
  297. /package/dist/{compiler → engine/compiler}/terms.js +0 -0
  298. /package/dist/{compiler → engine/compiler}/textfile-remote.d.ts +0 -0
  299. /package/dist/{compiler → engine/compiler}/textfile.d.ts +0 -0
  300. /package/dist/{compiler → engine/compiler}/theme-variants.d.ts +0 -0
  301. /package/dist/{compiler → engine/compiler}/zip.d.ts +0 -0
  302. /package/dist/{core → engine/core}/blocks.js +0 -0
  303. /package/dist/{core → engine/core}/code-file.d.ts +0 -0
  304. /package/dist/{core → engine/core}/code-file.js +0 -0
  305. /package/dist/{core → engine/core}/code-grammars.d.ts +0 -0
  306. /package/dist/{core → engine/core}/code-grammars.js +0 -0
  307. /package/dist/{core → engine/core}/content-types.js +0 -0
  308. /package/dist/{core → engine/core}/escape-html.d.ts +0 -0
  309. /package/dist/{core → engine/core}/escape-html.js +0 -0
  310. /package/dist/{core → engine/core}/extension-package.d.ts +0 -0
  311. /package/dist/{core → engine/core}/extension-package.js +0 -0
  312. /package/dist/{core → engine/core}/figure-frame.d.ts +0 -0
  313. /package/dist/{core → engine/core}/figure-frame.js +0 -0
  314. /package/dist/{core → engine/core}/file-embed.d.ts +0 -0
  315. /package/dist/{core → engine/core}/file-embed.js +0 -0
  316. /package/dist/{core → engine/core}/files.d.ts +0 -0
  317. /package/dist/{core → engine/core}/files.js +0 -0
  318. /package/dist/{core → engine/core}/graph-common.d.ts +0 -0
  319. /package/dist/{core → engine/core}/graph-common.js +0 -0
  320. /package/dist/{core → engine/core}/graph.d.ts +0 -0
  321. /package/dist/{core → engine/core}/graph.js +0 -0
  322. /package/dist/{core → engine/core}/inline.d.ts +0 -0
  323. /package/dist/{core → engine/core}/inline.js +0 -0
  324. /package/dist/{core → engine/core}/json-tools.d.ts +0 -0
  325. /package/dist/{core → engine/core}/json-tools.js +0 -0
  326. /package/dist/{core → engine/core}/language.d.ts +0 -0
  327. /package/dist/{core → engine/core}/language.js +0 -0
  328. /package/dist/{core → engine/core}/languages/ja.d.ts +0 -0
  329. /package/dist/{core → engine/core}/languages/ja.js +0 -0
  330. /package/dist/{core → engine/core}/markdown.d.ts +0 -0
  331. /package/dist/{core → engine/core}/markdown.js +0 -0
  332. /package/dist/{core → engine/core}/previewers.d.ts +0 -0
  333. /package/dist/{core → engine/core}/previewers.js +0 -0
  334. /package/dist/{core → engine/core}/schema-comments.d.ts +0 -0
  335. /package/dist/{core → engine/core}/schema-comments.js +0 -0
  336. /package/dist/{core → engine/core}/schema-fields.d.ts +0 -0
  337. /package/dist/{core → engine/core}/schema-fields.js +0 -0
  338. /package/dist/{core → engine/core}/schema-graph.d.ts +0 -0
  339. /package/dist/{core → engine/core}/schema-graph.js +0 -0
  340. /package/dist/{core → engine/core}/subformat-record.d.ts +0 -0
  341. /package/dist/{core → engine/core}/subformat-record.js +0 -0
  342. /package/dist/{core → engine/core}/term-reference.d.ts +0 -0
  343. /package/dist/{core → engine/core}/term-reference.js +0 -0
  344. /package/dist/{core → engine/core}/textfile.d.ts +0 -0
  345. /package/dist/{core → engine/core}/textfile.js +0 -0
  346. /package/dist/{core → engine/core}/theme-variants.d.ts +0 -0
  347. /package/dist/{core → engine/core}/theme-variants.js +0 -0
  348. /package/dist/{core → engine/core}/workspace.d.ts +0 -0
  349. /package/dist/{core → engine/core}/workspace.js +0 -0
  350. /package/dist/{viewer → frontend}/bundle-network.d.ts +0 -0
  351. /package/dist/{viewer → frontend}/bundle-network.js +0 -0
  352. /package/dist/{core → frontend}/flow-base-css.generated.d.ts +0 -0
  353. /package/dist/{core → frontend}/flow-base-css.generated.js +0 -0
  354. /package/dist/{core → frontend}/flow-css.d.ts +0 -0
  355. /package/dist/{core → frontend}/flow-css.js +0 -0
  356. /package/dist/{viewer → frontend}/font-picker.js +0 -0
  357. /package/dist/{viewer → frontend}/font-settings.js +0 -0
  358. /package/dist/{viewer → frontend}/i18n.d.ts +0 -0
  359. /package/dist/{viewer → frontend}/i18n.js +0 -0
  360. /package/dist/{viewer → frontend}/language-picker.d.ts +0 -0
  361. /package/dist/{viewer → frontend}/lazy-preview.d.ts +0 -0
  362. /package/dist/{viewer → frontend}/lazy-preview.js +0 -0
  363. /package/dist/{viewer → frontend}/nav-focus.d.ts +0 -0
  364. /package/dist/{viewer → frontend}/nav-update.d.ts +0 -0
  365. /package/dist/{viewer → frontend}/nav-update.js +0 -0
  366. /package/dist/{viewer → frontend}/plugin-blocks.d.ts +0 -0
  367. /package/dist/{viewer → frontend}/plugin-style.d.ts +0 -0
  368. /package/dist/{viewer → frontend}/plugin-style.js +0 -0
  369. /package/dist/{viewer → frontend}/plugin-view.d.ts +0 -0
  370. /package/dist/{viewer → frontend}/plugin-view.js +0 -0
  371. /package/dist/{viewer → frontend}/resize.d.ts +0 -0
  372. /package/dist/{core → frontend}/schema-graph-mount.d.ts +0 -0
  373. /package/dist/{core → frontend}/schema-graph-mount.js +0 -0
  374. /package/dist/{core → frontend}/table-ui.d.ts +0 -0
  375. /package/dist/{core → frontend}/table-ui.js +0 -0
  376. /package/dist/{core → frontend}/terms-ui.d.ts +0 -0
  377. /package/dist/{core → frontend}/terms-ui.js +0 -0
  378. /package/dist/{viewer → frontend}/theme-picker.d.ts +0 -0
  379. /package/dist/{viewer → frontend}/theme-picker.js +0 -0
  380. /package/dist/{core → frontend}/toc-ui.d.ts +0 -0
  381. /package/dist/{core → frontend}/toc-ui.js +0 -0
  382. /package/dist/{core → frontend}/video-ui.d.ts +0 -0
  383. /package/dist/{core → frontend}/video-ui.js +0 -0
  384. /package/dist/graph/{chunk-GYT4IYBZ.js → chunk-RJFVWYCA.js} +0 -0
  385. /package/dist/{viewer → server}/build-plugins.d.ts +0 -0
  386. /package/dist/{cli.d.ts → server/cli.d.ts} +0 -0
  387. /package/dist/{viewer → server}/extension-pack.d.ts +0 -0
  388. /package/dist/{viewer → server}/fonts/LICENSE.txt +0 -0
  389. /package/dist/{viewer → server}/fonts/udev-gothic-regular.woff2 +0 -0
  390. /package/dist/{viewer → server}/fonts.d.ts +0 -0
  391. /package/dist/{viewer → server}/fonts.js +0 -0
  392. /package/dist/{viewer → server}/ja-lint.js +0 -0
  393. /package/dist/{viewer → workspace}/git-types.js +0 -0
  394. /package/dist/{viewer → workspace}/site-icon.d.ts +0 -0
  395. /package/dist/{viewer → workspace}/site-title.d.ts +0 -0
@@ -1,15 +1,12 @@
1
- import { createHash } from "node:crypto";
2
- import { readFileSync } from "node:fs";
3
- import { posix } from "node:path";
4
1
  import { parseFragment, serialize } from "parse5";
5
2
  import postcss from "postcss";
6
3
  import valueParser from "postcss-value-parser";
7
4
  import { embeddedImages, parseMdast } from "../core/markdown.js";
8
5
  import { isRemoteTextfile } from "../core/textfile.js";
9
6
  import { collectRefs } from "./dialect.js";
7
+ import { createHash, fetchPublicFile, posix, readFileSync } from "./host.js";
10
8
  import { assertNotIgnored } from "./ignored-files.js";
11
9
  import { readManifest } from "./manifest.js";
12
- import { fetchPublicFile } from "./public-file.js";
13
10
  import { textfilePath } from "./textfile.js";
14
11
  import { remoteTextfileSource } from "./textfile-remote.js";
15
12
  const types = {
@@ -5,7 +5,7 @@ export interface ProseSegment {
5
5
  line: number;
6
6
  column: number;
7
7
  }
8
- /** Extract rendered prose, leaving code examples, URLs and front-matter syntax out. */
8
+ /** Extract rendered prose, leaving code examples, and URLs out. */
9
9
  export declare const markdownProse: (root: Root, lineOffset?: number) => ProseSegment[];
10
10
  export declare const assetProse: (file: string, raw: string) => ProseSegment[] | undefined;
11
11
  export declare const checkProse: (segments: ProseSegment[], language: string) => Omit<CheckDiagnostic, "file" | "check">[];
@@ -2,7 +2,7 @@ import { francAll } from "franc";
2
2
  import { visit } from "unist-util-visit";
3
3
  import { parseMdast } from "../core/markdown.js";
4
4
  import { parseContentSource } from "./code-blocks.js";
5
- /** Extract rendered prose, leaving code examples, URLs and front-matter syntax out. */
5
+ /** Extract rendered prose, leaving code examples, and URLs out. */
6
6
  export const markdownProse = (root, lineOffset = 0) => {
7
7
  const segments = [];
8
8
  visit(root, (node) => {
@@ -1,7 +1,4 @@
1
- import { createHash } from "node:crypto";
2
- import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
3
- import { resolve } from "node:path";
4
- import { flattenTree, MANIFEST_FILE } from "../core/content-metadata.js";
1
+ import { flattenTree } from "../core/content-metadata.js";
5
2
  import { docFile, localFile } from "../core/files.js";
6
3
  import { DEFAULT_LANG } from "../core/language.js";
7
4
  import { contentLinks, embeddedImages, parseMdast } from "../core/markdown.js";
@@ -12,9 +9,10 @@ import { CHECK_KINDS, } from "./check-types.js";
12
9
  import { parseContentSource } from "./code-blocks.js";
13
10
  import { compileSite } from "./compile.js";
14
11
  import { collectRefs, parseDoc } from "./dialect.js";
12
+ import { createHash, existsSync, readdirSync, readFileSync, resolve, statSync } from "./host.js";
15
13
  import { contentLanguageCode, isContentLanguage } from "./language-codes.js";
16
14
  import { siteContentLanguages, translationFile } from "./locales.js";
17
- import { parseManifestText } from "./manifest.js";
15
+ import { manifestFile, parseManifestText } from "./manifest.js";
18
16
  import { textfilePath } from "./textfile.js";
19
17
  import { siteThemes, themeVariants } from "./theme-variants.js";
20
18
  export { CHECK_KINDS } from "./check-types.js";
@@ -79,7 +77,7 @@ export const checkSite = (root, options = {}) => {
79
77
  throw new Error(`${key} must be a boolean`);
80
78
  }
81
79
  catch (error) {
82
- add("INVOCATION_INVALID", "error", MANIFEST_FILE, messageOf(error));
80
+ add("INVOCATION_INVALID", "error", manifestFile(root), messageOf(error));
83
81
  report.exitCode = 2;
84
82
  return finish(report, options);
85
83
  }
@@ -164,25 +162,25 @@ export const checkSite = (root, options = {}) => {
164
162
  try {
165
163
  if (!statSync(report.root).isDirectory())
166
164
  throw new Error("Docs root must be a directory");
167
- const data = read(MANIFEST_FILE);
165
+ const data = read(manifestFile(root));
168
166
  if (!data)
169
167
  return finish(report, options);
170
- const raw = text(MANIFEST_FILE, data, {});
168
+ const raw = text(manifestFile(root), data, {});
171
169
  if (raw === undefined)
172
170
  return finish(report, options);
173
- const manifest = parseManifestText(raw);
171
+ const manifest = parseManifestText(raw, manifestFile(root));
174
172
  for (const message of manifest.errors)
175
- add("MANIFEST_INVALID", "error", MANIFEST_FILE, message);
173
+ add("MANIFEST_INVALID", "error", manifestFile(root), message);
176
174
  if (manifest.errors.length)
177
175
  return finish(report, options);
178
176
  if (manifest.licence)
179
- read(manifest.licence, { sourceFile: MANIFEST_FILE });
177
+ read(manifest.licence, { sourceFile: manifestFile(root) });
180
178
  let sourceLanguage;
181
179
  try {
182
180
  sourceLanguage = contentLanguageCode(manifest.defaultLang ?? DEFAULT_LANG);
183
181
  }
184
182
  catch (error) {
185
- add("LANGUAGE_INVALID", "error", MANIFEST_FILE, messageOf(error), {}, { check: "config" });
183
+ add("LANGUAGE_INVALID", "error", manifestFile(root), messageOf(error), {}, { check: "config" });
186
184
  return finish(report, options);
187
185
  }
188
186
  report.languages = siteContentLanguages(report.root, manifest).sort();
@@ -202,7 +200,7 @@ export const checkSite = (root, options = {}) => {
202
200
  add("THEME_UNDECLARED", "warning", `themes/${theme}`, "Theme variant is not enabled by the site declaration and will not be displayed.", { theme });
203
201
  }
204
202
  const docs = new Map(flattenTree(manifest.tree)
205
- .filter((node) => !node.subformat)
203
+ .filter((node) => !node.subformat && !node.library)
206
204
  .map(({ id }) => [docFile(id, manifest.files), id]));
207
205
  const visited = new Set();
208
206
  const checkedThemes = new Set();
@@ -343,20 +341,8 @@ export const checkSite = (root, options = {}) => {
343
341
  add("DOCUMENT_INVALID", "error", file, message, context, {
344
342
  line: Number(/^L(\d+):/.exec(message)?.[1]) || undefined,
345
343
  });
346
- if (doc.frontmatter?.lang) {
347
- try {
348
- const actual = contentLanguageCode(doc.frontmatter.lang);
349
- if (actual !== language)
350
- add("LANGUAGE_MISMATCH", "error", file, `Front-matter declares ${actual}; expected ${language}.`, context, { detectedLanguage: actual });
351
- }
352
- catch (error) {
353
- add("LANGUAGE_INVALID", "error", file, messageOf(error), context);
354
- }
355
- }
356
344
  if (has("languages")) {
357
345
  const prose = markdownProse(doc.root);
358
- if (doc.frontmatter?.title)
359
- prose.unshift({ text: doc.frontmatter.title, line: 2, column: 1 });
360
346
  for (const finding of checkProse(prose, language))
361
347
  report.diagnostics.push({ ...context, ...finding, file, check: "languages" });
362
348
  }
@@ -430,7 +416,7 @@ export const checkSite = (root, options = {}) => {
430
416
  const compiled = compileSite(report.root, { locale: language });
431
417
  for (const message of compiled.siteErrors) {
432
418
  const prefix = message.split(":")[0] ?? "";
433
- add("RENDER_INVALID", "error", localFile(prefix) ? prefix : MANIFEST_FILE, message, { language });
419
+ add("RENDER_INVALID", "error", localFile(prefix) ? prefix : manifestFile(root), message, { language });
434
420
  }
435
421
  for (const [sourceFile, source] of compiled.sources) {
436
422
  const candidate = language === sourceLanguage
@@ -442,7 +428,9 @@ export const checkSite = (root, options = {}) => {
442
428
  }
443
429
  }
444
430
  catch (error) {
445
- add("RENDER_INVALID", "error", MANIFEST_FILE, messageOf(error), { language });
431
+ add("RENDER_INVALID", "error", manifestFile(root), messageOf(error), {
432
+ language,
433
+ });
446
434
  }
447
435
  }
448
436
  }
@@ -2,7 +2,7 @@ import { visit } from "unist-util-visit";
2
2
  import { parseFigureLink } from "../core/file-embed.js";
3
3
  import { parseGraphSource } from "../core/graph.js";
4
4
  import { inlineToText, listItems, parseMdast } from "../core/markdown.js";
5
- import { parseDocLink } from "../core/routing.js";
5
+ import { isReferenceUrl, parseDocLink } from "../core/routing.js";
6
6
  import { parseSchemaSource } from "../core/schema-graph.js";
7
7
  import { CODE_TEMPLATES } from "../core/taxonomy.js";
8
8
  import { parseTermReference } from "../core/term-reference.js";
@@ -111,6 +111,8 @@ export const parseContentSource = (language, source, id, caption) => {
111
111
  });
112
112
  if (node.type === "link") {
113
113
  try {
114
+ if (!isReferenceUrl(node.url))
115
+ throw new Error("links require a local reference, HTTP(S) URL or email address");
114
116
  if (!node.url || node.url.startsWith("doc:"))
115
117
  throw new Error("Use a Markdown file link");
116
118
  parseDocLink(node.url);
@@ -1,8 +1,7 @@
1
- import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
2
- import { join, relative, resolve } from "node:path";
3
1
  import { languageAliasNames, languageNames } from "@shikijs/langs";
4
2
  import { bundledLanguages } from "shiki/langs";
5
3
  import { CODE_LANGS, CODE_TEMPLATES } from "../core/taxonomy.js";
4
+ import { existsSync, join, mkdirSync, readdirSync, readFileSync, relative, resolve, writeFileSync, } from "./host.js";
6
5
  import { ignoredFiles } from "./ignored-files.js";
7
6
  export const CODE_LANGUAGES_DIR = ".dooc/code-languages";
8
7
  const supported = new Set([
@@ -12,11 +12,11 @@ export interface DocSource {
12
12
  /** Files already discovered during parsing, used by the viewer's change watcher. */
13
13
  referencedFiles: string[];
14
14
  /**
15
- * Raw text on disk (including front-matter). The editor's initial value and the base for
15
+ * Raw text on disk. The editor's initial value and the base for
16
16
  * detecting external changes.
17
17
  */
18
18
  raw: string;
19
- /** Validated front-matter; undefined if broken (CompiledDoc then uses the id as title). */
19
+ /** Document metadata from the manifest. */
20
20
  frontmatter: Frontmatter | undefined;
21
21
  /**
22
22
  * For the editor's source-mapping display: each block's start line, relative to the body
@@ -45,7 +45,7 @@ export interface Compiled {
45
45
  siteErrors: string[];
46
46
  /** All errors (siteErrors + each doc's errors with a file prefix). */
47
47
  errors: string[];
48
- /** Site default language (docs without front-matter `lang` resolve to it). */
48
+ /** Site default language. */
49
49
  defaultLang: string;
50
50
  contentLanguages?: string[];
51
51
  themes?: ("light" | "dark")[];
@@ -76,6 +76,7 @@ export interface DraftContext {
76
76
  docs: readonly (DocRef & {
77
77
  file: string;
78
78
  toc?: readonly TocEntry[];
79
+ title?: string;
79
80
  })[];
80
81
  /** name → figure (file = `figures/<file>`). */
81
82
  figures: {
@@ -83,7 +84,7 @@ export interface DraftContext {
83
84
  file: string;
84
85
  } | undefined;
85
86
  };
86
- /** Site default language for a draft without front-matter `lang`. Default: DEFAULT_LANG. */
87
+ /** Site default language for a draft. Default: DEFAULT_LANG. */
87
88
  defaultLang?: string;
88
89
  }
89
90
  export declare const createCompiler: (root: string, options?: CompileOptions) => Compiler;
@@ -1,14 +1,13 @@
1
1
  // Reads dooc.yaml and source files into validated, in-memory content for the viewer and HTML
2
2
  // bundles. createCompiler caches unchanged files; compileSite performs a one-shot compilation.
3
- import { existsSync, readdirSync, statSync } from "node:fs";
4
- import { join } from "node:path";
5
3
  import { walkBlocks } from "../core/blocks.js";
6
- import { docIdOfFile, flattenTree, MANIFEST_FILE } from "../core/content-metadata.js";
4
+ import { docIdOfFile, flattenTree } from "../core/content-metadata.js";
7
5
  import { termMap } from "../core/inline.js";
8
6
  import { DEFAULT_LANG, isLangTag } from "../core/language.js";
9
7
  import { contentLinks, parseMdast } from "../core/markdown.js";
10
8
  import { defaultPreviewSettings, parsePreviewSettings, } from "../core/previewers.js";
11
- import { parseDocLink } from "../core/routing.js";
9
+ import { docPath, parseDocLink } from "../core/routing.js";
10
+ import { subformatReferences } from "../core/subformat-references.js";
12
11
  import { isTermFile } from "../core/term-reference.js";
13
12
  import { isRemoteTextfile } from "../core/textfile.js";
14
13
  import { parseContentSource } from "./code-blocks.js";
@@ -17,12 +16,13 @@ import { figureName, loadFigures } from "./figures.js";
17
16
  import { createFileCache, createSigCache, dirSig, fileSig } from "./file-cache.js";
18
17
  import { projectFiles } from "./files.js";
19
18
  import { toBlocks } from "./from-mdast.js";
19
+ import { existsSync, join, readdirSync, statSync } from "./host.js";
20
20
  import { loadIcons, squareSvg } from "./icons.js";
21
21
  import { assertNotIgnored, ignoredFiles } from "./ignored-files.js";
22
22
  import { contentLanguageCode, isContentLanguage } from "./language-codes.js";
23
23
  import { siteContentLanguages, translationFile } from "./locales.js";
24
- import { parseManifestText } from "./manifest.js";
25
- import { loadSubformat, parseSubformatRecord, validateSubformatRecord } from "./subformats.js";
24
+ import { manifestFile, parseManifestText } from "./manifest.js";
25
+ import { loadSubformat, parseSubformatRecord, subformatIconSvg, validateSubformatRecord, } from "./subformats.js";
26
26
  import { parseTermSource } from "./terms.js";
27
27
  import { readTextfile, selectTextfileRange } from "./textfile.js";
28
28
  import { TextfileUnavailable } from "./textfile-remote.js";
@@ -38,8 +38,8 @@ export const collectDocLinks = (body) => contentLinks(parseMdast(body))
38
38
  return false;
39
39
  }
40
40
  });
41
- // Maps mdast line numbers (1-indexed in raw, which includes front-matter) to the body-relative
42
- // lines the editor shows. body is a suffix of raw (parseDoc only strips the front-matter), so
41
+ // Maps mdast line numbers (1-indexed in raw) to the body-relative
42
+ // lines the editor shows. body is a suffix of raw (parseDoc keeps the whole source), so
43
43
  // subtract the number of newlines before it.
44
44
  const toBodyLines = (raw, body, lines) => {
45
45
  const before = raw.slice(0, raw.length - body.length).split("\n").length - 1;
@@ -134,7 +134,11 @@ const resolveFiles = (f, root, textfiles, previews, themes) => {
134
134
  if (block.type === "term")
135
135
  terms.push(block.entry);
136
136
  if (parsed.blocks[0]) {
137
- const block = { ...parsed.blocks[0], ...(b.alt ? { alt: b.alt } : {}) };
137
+ const block = {
138
+ ...parsed.blocks[0],
139
+ sourceFile: b.filename,
140
+ ...(b.alt ? { alt: b.alt } : {}),
141
+ };
138
142
  return block.type === "table" && b.tableMode
139
143
  ? { ...block, tableMode: b.tableMode }
140
144
  : block;
@@ -187,14 +191,13 @@ const resolveFiles = (f, root, textfiles, previews, themes) => {
187
191
  parsed: { ...f.parsed, errors, terms },
188
192
  };
189
193
  };
190
- const toDoc = (id, parent, file, f, defaultLang) => ({
194
+ const toDoc = (id, parent, file, f, lang, title) => ({
191
195
  id,
192
196
  ...(parent == null ? {} : { parent }),
193
197
  file,
194
- // Keep the doc even if its front-matter is broken (so it can be opened and fixed in the
195
- // viewer). In that case parsed.errors is set, so it won't be distributed.
196
- ...(f.parsed.frontmatter ?? { title: id }),
197
- lang: f.parsed.frontmatter?.lang ?? defaultLang,
198
+ // The manifest owns the title; an untitled document shows its file name.
199
+ title: title ?? (file.split("/").pop() ?? file).replace(/\.md$/i, ""),
200
+ lang,
198
201
  body: f.parsed.body,
199
202
  blocks: f.blocks,
200
203
  toc: f.toc,
@@ -232,10 +235,10 @@ export const createCompiler = (root, options = {}) => {
232
235
  const manifestCache = createFileCache();
233
236
  const figuresCache = createSigCache();
234
237
  const compile = () => {
235
- const manifestPath = join(root, MANIFEST_FILE);
238
+ const manifestPath = join(root, manifestFile(root));
236
239
  const manifest = existsSync(manifestPath)
237
- ? manifestCache.get(manifestPath, parseManifestText)
238
- : { tree: [], errors: [`${MANIFEST_FILE} is required`] };
240
+ ? manifestCache.get(manifestPath, (raw) => parseManifestText(raw, manifestFile(root)))
241
+ : { tree: [], errors: [`${manifestFile(root)} is required`] };
239
242
  const defaultLang = options.defaultLang ?? manifest.defaultLang ?? DEFAULT_LANG;
240
243
  if (options.locale &&
241
244
  manifest.languages &&
@@ -256,7 +259,7 @@ export const createCompiler = (root, options = {}) => {
256
259
  throw new Error("expected a regular file");
257
260
  }
258
261
  catch (error) {
259
- siteErrors.push(`${MANIFEST_FILE}: system.licence ${manifest.licence}: ${error instanceof Error ? error.message : error}`);
262
+ siteErrors.push(`${manifestFile(root)}: system.licence ${manifest.licence}: ${error instanceof Error ? error.message : error}`);
260
263
  }
261
264
  }
262
265
  if (!isLangTag(defaultLang)) {
@@ -270,7 +273,7 @@ export const createCompiler = (root, options = {}) => {
270
273
  const files = [];
271
274
  if (!existsSync(contentDir) &&
272
275
  !manifest.files &&
273
- !flattenTree(manifest.tree).some((node) => node.subformat)) {
276
+ !flattenTree(manifest.tree).some((node) => node.subformat || node.library)) {
274
277
  siteErrors.push(`${contentDir}: content/ is missing`);
275
278
  }
276
279
  else {
@@ -299,7 +302,7 @@ export const createCompiler = (root, options = {}) => {
299
302
  }));
300
303
  }
301
304
  catch (error) {
302
- siteErrors.push(`${MANIFEST_FILE}: icon ${iconFile}: ${error instanceof Error ? error.message : error}`);
305
+ siteErrors.push(`${manifestFile(root)}: icon ${iconFile}: ${error instanceof Error ? error.message : error}`);
303
306
  }
304
307
  }
305
308
  siteErrors.push(...manifestErrors);
@@ -325,8 +328,8 @@ export const createCompiler = (root, options = {}) => {
325
328
  onDisk.add(id);
326
329
  }
327
330
  // Manifest pre-order is the display order.
328
- for (const { id, parent, subformat } of flattenTree(tree)) {
329
- if (subformat)
331
+ for (const { id, parent, subformat, library, title } of flattenTree(tree)) {
332
+ if (subformat || library)
330
333
  continue;
331
334
  const rel = docFile(id, manifest.files);
332
335
  if (rel.startsWith("content/")) {
@@ -344,7 +347,7 @@ export const createCompiler = (root, options = {}) => {
344
347
  continue;
345
348
  }
346
349
  if (!existsSync(path)) {
347
- siteErrors.push(`${rel}: listed in ${MANIFEST_FILE} but the file is missing`);
350
+ siteErrors.push(`${rel}: listed in ${manifestFile(root)} but the file is missing`);
348
351
  continue;
349
352
  }
350
353
  let parsed = docCache.get(path, (raw) => parseFile(raw, previews, rel));
@@ -364,10 +367,10 @@ export const createCompiler = (root, options = {}) => {
364
367
  }
365
368
  }
366
369
  parsed = resolveFiles(parsed, root, undefined, previews, themes);
367
- files.push({ doc: toDoc(id, parent, rel, parsed, language), parsed });
370
+ files.push({ doc: toDoc(id, parent, rel, parsed, language, title), parsed });
368
371
  }
369
372
  for (const id of onDisk) {
370
- siteErrors.push(`content/${id}.md: not registered in ${MANIFEST_FILE}`);
373
+ siteErrors.push(`content/${id}.md: not registered in ${manifestFile(root)}`);
371
374
  }
372
375
  }
373
376
  for (const file of new Set(files.flatMap(({ parsed }) => parsed.figureFiles)))
@@ -377,9 +380,12 @@ export const createCompiler = (root, options = {}) => {
377
380
  const { icons, errors: iconErrors } = loadIcons(root, new Set([
378
381
  ...files.map((f) => f.doc.id),
379
382
  ...flattenTree(manifest.tree)
380
- .filter((node) => node.subformat)
383
+ .filter((node) => node.subformat || node.library)
381
384
  .map((node) => node.id),
382
- ]), iconFile, manifest.files, Object.values(manifest.themeIcons ?? {}));
385
+ ]), iconFile, manifest.files, [
386
+ ...Object.values(manifest.themeIcons ?? {}),
387
+ ...(manifest.subformats ?? []).flatMap((format) => format.icon ?? []),
388
+ ]);
383
389
  siteErrors.push(...iconErrors);
384
390
  for (const { doc } of files) {
385
391
  const icon = icons.get(doc.id);
@@ -402,12 +408,25 @@ export const createCompiler = (root, options = {}) => {
402
408
  terms: parsed.parsed.terms,
403
409
  referencedFiles: parsed.referencedFiles,
404
410
  raw: parsed.raw,
405
- frontmatter: parsed.parsed.frontmatter,
411
+ frontmatter: { title: doc.title },
406
412
  lines: parsed.lines,
407
413
  errors: errs,
408
414
  });
409
415
  }
410
- for (const node of flattenTree(manifest.tree).filter((node) => node.subformat)) {
416
+ const subformatPages = flattenTree(manifest.tree).filter((node) => node.subformat);
417
+ const recordReferences = new Map();
418
+ if (subformatPages.length)
419
+ for (const { doc, parsed } of files)
420
+ for (const ref of subformatReferences(parsed.parsed.root)) {
421
+ const references = recordReferences.get(ref.file) ?? [];
422
+ references.push({
423
+ file: doc.file,
424
+ line: ref.line,
425
+ href: docPath(docs, doc.id),
426
+ });
427
+ recordReferences.set(ref.file, references);
428
+ }
429
+ for (const node of subformatPages) {
411
430
  const config = manifest.subformats?.find((format) => format.ext === node.subformat);
412
431
  if (!config)
413
432
  continue;
@@ -419,6 +438,12 @@ export const createCompiler = (root, options = {}) => {
419
438
  fields: [],
420
439
  records: [],
421
440
  };
441
+ try {
442
+ collection.iconSvg = subformatIconSvg(root, config);
443
+ }
444
+ catch (error) {
445
+ pageErrors.push(`icon: ${error instanceof Error ? error.message : error}`);
446
+ }
422
447
  try {
423
448
  assertNotIgnored(root, config.schema);
424
449
  if (!paths.some((file) => file.path === config.schema))
@@ -432,7 +457,12 @@ export const createCompiler = (root, options = {}) => {
432
457
  const content = readTextfile(root, record.path);
433
458
  const data = parseSubformatRecord(content, config.format);
434
459
  validateSubformatRecord(loaded, data);
435
- collection.records.push({ file: record.path, content, data });
460
+ collection.records.push({
461
+ file: record.path,
462
+ content,
463
+ data,
464
+ references: recordReferences.get(record.path) ?? [],
465
+ });
436
466
  }
437
467
  catch (error) {
438
468
  pageErrors.push(`${record.path}: ${error instanceof Error ? error.message : error}`);
@@ -465,6 +495,34 @@ export const createCompiler = (root, options = {}) => {
465
495
  });
466
496
  errors.push(...pageErrors);
467
497
  }
498
+ // Library pages are rendered from the workspace index when shown, not compiled here.
499
+ for (const node of flattenTree(manifest.tree)) {
500
+ if (!node.library)
501
+ continue;
502
+ const file = `library:${node.library}`;
503
+ const title = node.title ?? node.library;
504
+ docs.push({
505
+ id: node.id,
506
+ parent: node.parent,
507
+ title,
508
+ file,
509
+ lang: defaultLang,
510
+ library: node.library,
511
+ icon: icons.get(node.id),
512
+ body: "",
513
+ blocks: [],
514
+ toc: [],
515
+ refs: { figures: [], terms: [] },
516
+ });
517
+ sources.set(file, {
518
+ terms: [],
519
+ referencedFiles: [],
520
+ raw: "",
521
+ frontmatter: { title },
522
+ lines: [],
523
+ errors: [],
524
+ });
525
+ }
468
526
  const order = flattenTree(manifest.tree).map((node) => node.id);
469
527
  docs.sort((a, b) => order.indexOf(a.id) - order.indexOf(b.id));
470
528
  if (!docs.length) {
@@ -499,13 +557,14 @@ export const compileDraft = (ctx, file, raw) => {
499
557
  const known = ctx.docs.find((d) => d.file === file);
500
558
  const previews = ctx.previews;
501
559
  const parsed = resolveFiles(parseFile(raw, previews, file), ctx.root, ctx.textfiles, previews);
560
+ const doc = toDoc(known?.id ?? "", known?.parent, file, parsed, ctx.defaultLang ?? DEFAULT_LANG, known?.title);
502
561
  return {
503
- doc: toDoc(known?.id ?? "", known?.parent, file, parsed, ctx.defaultLang ?? DEFAULT_LANG),
562
+ doc,
504
563
  source: {
505
564
  terms: parsed.parsed.terms,
506
565
  referencedFiles: parsed.referencedFiles,
507
566
  raw,
508
- frontmatter: parsed.parsed.frontmatter,
567
+ frontmatter: { title: doc.title },
509
568
  lines: parsed.lines,
510
569
  errors: docErrors(parsed, ctx),
511
570
  },
@@ -2,10 +2,8 @@
2
2
  // The file is a JS module, so loading it runs
3
3
  // its code — it belongs to the docs root like a build config. Read once per process; restart
4
4
  // after changing it.
5
- import { existsSync } from "node:fs";
6
- import { join } from "node:path";
7
- import { pathToFileURL } from "node:url";
8
5
  import { isLangTag } from "../core/language.js";
6
+ import { existsSync, join, pathToFileURL } from "./host.js";
9
7
  import { ignoredFiles } from "./ignored-files.js";
10
8
  export const CONFIG_FILE = "docs.config.mjs";
11
9
  const FUNCTION_KEYS = ["isTermBoundary", "compareTerms", "lint"];
@@ -1,12 +1,10 @@
1
1
  import type { Root } from "mdast";
2
2
  import type { TermEntry } from "../core/content-types.js";
3
3
  import type { PreviewSettings } from "../core/previewers.js";
4
- import { type Frontmatter } from "../core/taxonomy.js";
5
4
  export { parseMdast } from "../core/markdown.js";
6
5
  export interface ParsedDoc {
7
6
  terms: TermEntry[];
8
- frontmatter: Frontmatter | undefined;
9
- /** Body text without the front-matter (becomes the manifest's body). */
7
+ /** Body text: the whole source. */
10
8
  body: string;
11
9
  /** Source passed to parse; root position offsets use it. */
12
10
  source: string;
@@ -1,10 +1,7 @@
1
1
  import { visit } from "unist-util-visit";
2
- import { parse as parseYaml } from "yaml";
3
2
  import { parseFigureLink, parseFileEmbed } from "../core/file-embed.js";
4
- import { isLangTag } from "../core/language.js";
5
3
  import { contentLinks, embeddedImages, parseMdast } from "../core/markdown.js";
6
- import { parseDocLink } from "../core/routing.js";
7
- import { FM_OPTIONAL, FM_REQUIRED } from "../core/taxonomy.js";
4
+ import { isReferenceUrl, parseDocLink } from "../core/routing.js";
8
5
  import { parseTermReference } from "../core/term-reference.js";
9
6
  import { parseTextfileRange } from "../core/textfile.js";
10
7
  import { parseContentCode } from "./code-blocks.js";
@@ -30,34 +27,6 @@ const ALLOWED_TYPES = new Set([
30
27
  "blockquote",
31
28
  ]);
32
29
  const line = (n) => (n.position ? `L${n.position.start.line}` : "L?");
33
- const checkFrontmatter = (raw, errors) => {
34
- if (typeof raw !== "object" || raw == null || Array.isArray(raw)) {
35
- errors.push("front-matter: a YAML object is required");
36
- return undefined;
37
- }
38
- const fm = raw;
39
- const required = FM_REQUIRED;
40
- const allowed = [...FM_REQUIRED, ...FM_OPTIONAL];
41
- for (const key of Object.keys(fm)) {
42
- if (!allowed.includes(key)) {
43
- errors.push(`front-matter: unknown key "${key}" (allowed: ${allowed.join(", ")})`);
44
- }
45
- }
46
- for (const key of required) {
47
- if (typeof fm[key] !== "string" || fm[key] === "") {
48
- errors.push(`front-matter: "${key}" (string) is required`);
49
- }
50
- }
51
- if (fm.lang !== undefined && !(typeof fm.lang === "string" && isLangTag(fm.lang))) {
52
- errors.push('front-matter: "lang" must be a BCP 47 language tag (e.g. "en", "ja", "pt-BR")');
53
- }
54
- return errors.length === 0 ? fm : undefined;
55
- };
56
- const checkHeading = (n, errors) => {
57
- if (n.depth < 1 || n.depth > 3) {
58
- errors.push(`${line(n)}: only # / ## / ### headings are allowed (not h${n.depth})`);
59
- }
60
- };
61
30
  // Quotes retain their block structure even when nested inside list items.
62
31
  const checkListItem = (n, errors) => {
63
32
  for (const child of n.children) {
@@ -67,6 +36,8 @@ const checkListItem = (n, errors) => {
67
36
  }
68
37
  };
69
38
  const checkLink = (n, errors) => {
39
+ if (!isReferenceUrl(n.url))
40
+ errors.push(`${line(n)}: links require a local reference, HTTP(S) URL or email address`);
70
41
  try {
71
42
  parseDocLink(n.url);
72
43
  parseFigureLink(n.url);
@@ -87,22 +58,10 @@ export const parseDoc = (input, settings, file) => {
87
58
  const root = parseMdast(raw);
88
59
  const embeds = new Set(embeddedImages(root));
89
60
  const terms = [];
90
- const yamlNode = root.children[0];
91
- let frontmatter;
92
- let body = input;
93
- if (yamlNode?.type === "yaml") {
94
- try {
95
- frontmatter = checkFrontmatter(parseYaml(yamlNode.value), errors);
96
- }
97
- catch (e) {
98
- errors.push(`front-matter: YAML parse failed (${e instanceof Error ? e.message : e})`);
99
- }
100
- const end = yamlNode.position?.end.offset;
101
- body = end != null ? input.slice(end).replace(/^\n+/, "") : raw;
102
- }
103
- else {
104
- errors.push("front-matter (---) is required at the top");
105
- }
61
+ // Titles live in the manifest; a leading YAML block would otherwise render as stray text.
62
+ if (root.children[0]?.type === "yaml")
63
+ errors.push("front-matter (---) is not supported; set the title in dooc.yaml");
64
+ const body = input;
106
65
  visit(root, (node, _index, parent) => {
107
66
  if (node.type === "text" &&
108
67
  /(?:^|\n)[ \t]*:{2,}[a-z]+\b/.test(raw.slice(node.position?.start.offset, node.position?.end.offset)))
@@ -143,9 +102,6 @@ export const parseDoc = (input, settings, file) => {
143
102
  }
144
103
  break;
145
104
  }
146
- case "heading":
147
- checkHeading(node, errors);
148
- break;
149
105
  case "listItem":
150
106
  checkListItem(node, errors);
151
107
  break;
@@ -156,7 +112,7 @@ export const parseDoc = (input, settings, file) => {
156
112
  break;
157
113
  }
158
114
  });
159
- return { frontmatter, body, source: raw, root, errors, terms };
115
+ return { body, source: raw, root, errors, terms };
160
116
  };
161
117
  /**
162
118
  * Collect files referenced by Markdown links and embeds for validation and export.
@@ -1,6 +1,6 @@
1
- import { runInNewContext } from "node:vm";
2
1
  import { Helper } from "dxf";
3
2
  import { escapeHtml } from "../core/escape-html.js";
3
+ import { runInNewContext } from "./host.js";
4
4
  export const dxfSvg = (source) => {
5
5
  source = source.replace(/\r\n?/g, "\n").trim();
6
6
  if (source.includes("\0") ||