@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
@@ -0,0 +1,4 @@
1
+ import type { FigureEntry } from "../engine/core/content-types.js";
2
+ export declare const deferredFigureHtml: (fig: FigureEntry, cls?: string, label?: string) => string;
3
+ /** Delegated so previews inserted by navigation or HMR use the same loading state. */
4
+ export declare function mountFigurePreviews(request?: (url: string, init?: RequestInit, workspace?: string) => Promise<Response>): void;
@@ -1,5 +1,5 @@
1
- import { escapeHtml } from "../core/escape-html.js";
2
- import { figureFrameHtml } from "../core/figure-frame.js";
1
+ import { escapeHtml } from "../engine/core/escape-html.js";
2
+ import { figureFrameHtml } from "../engine/core/figure-frame.js";
3
3
  export const deferredFigureHtml = (fig, cls = "fig-frame", label) => {
4
4
  if (fig.markup.length <= 100_000)
5
5
  return figureFrameHtml(fig, cls, label);
@@ -9,7 +9,7 @@ export const deferredFigureHtml = (fig, cls = "fig-frame", label) => {
9
9
  return `<div class="figure-placeholder" data-figure-preview="${escapeHtml(url)}"><span>${escapeHtml(label || fig.title || fig.file)}</span><button type="button" data-i18n="Load preview">Load preview</button><span role="status"></span></div>`;
10
10
  };
11
11
  /** Delegated so previews inserted by navigation or HMR use the same loading state. */
12
- export function mountFigurePreviews() {
12
+ export function mountFigurePreviews(request = fetch) {
13
13
  document.addEventListener("click", async (event) => {
14
14
  const button = event.target instanceof Element
15
15
  ? event.target.closest("[data-figure-preview] > button")
@@ -24,7 +24,7 @@ export function mountFigurePreviews() {
24
24
  host.setAttribute("aria-busy", "true");
25
25
  status.textContent = translate("Loading");
26
26
  try {
27
- const response = await fetch(url);
27
+ const response = await request(url, undefined, host.closest("[data-workspace]")?.dataset.workspace);
28
28
  if (!response.ok)
29
29
  throw new Error(translate("Preview unavailable"));
30
30
  const html = await response.text();
@@ -1,4 +1,4 @@
1
- import type { PreviewSettings } from "../core/previewers.js";
1
+ import type { PreviewSettings } from "../engine/core/previewers.js";
2
2
  export interface FileReference {
3
3
  line: number;
4
4
  file: string;
@@ -1,7 +1,7 @@
1
1
  import { visit } from "unist-util-visit";
2
- import { parseFileEmbed } from "../core/file-embed.js";
3
- import { contentLinks, embeddedImages, parseMdast } from "../core/markdown.js";
4
- import { parseTermReference } from "../core/term-reference.js";
2
+ import { parseFileEmbed } from "../engine/core/file-embed.js";
3
+ import { contentLinks, embeddedImages, parseMdast } from "../engine/core/markdown.js";
4
+ import { parseTermReference } from "../engine/core/term-reference.js";
5
5
  /** Use the compiler's Markdown grammar so examples, escapes and URL encodings agree. */
6
6
  export const fileReferences = (body, settings) => {
7
7
  const root = parseMdast(body);
@@ -1,4 +1,4 @@
1
- import type { ProjectFont } from "../compiler/fonts.js";
1
+ import type { ProjectFont } from "../engine/compiler/fonts.js";
2
2
  import type { createFontSettings } from "./font-settings.js";
3
3
  /** Self-contained because published viewers embed this function directly. */
4
4
  export declare const mountFontPickers: (createSettings: typeof createFontSettings, registered: readonly ProjectFont[]) => Promise<void>;
@@ -1,4 +1,4 @@
1
- import type { ProjectFont } from "../compiler/fonts.js";
1
+ import type { ProjectFont } from "../engine/compiler/fonts.js";
2
2
  /** Self-contained because published viewers embed this function directly. */
3
3
  export declare const createFontSettings: (registered: readonly ProjectFont[]) => {
4
4
  fonts: Map<string, FontFace>;
@@ -1,24 +1,43 @@
1
+ const fitWorkspaceLabel = (input, label) => {
2
+ input.title = label;
3
+ input.value = label;
4
+ const context = document.createElement("canvas").getContext("2d");
5
+ if (!context)
6
+ return;
7
+ const style = getComputedStyle(input);
8
+ context.font = style.font;
9
+ const width = input.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);
10
+ const characters = [...label];
11
+ if (context.measureText(label).width > width) {
12
+ while (characters.length && context.measureText(`${characters.join("")}...`).width > width)
13
+ characters.pop();
14
+ input.value = `${characters.join("")}...`;
15
+ }
16
+ };
1
17
  /** Keep the native select as the value and change-event source. */
2
18
  export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-lang, #ui-language")) => {
3
19
  const disposers = [];
4
20
  for (const select of selects) {
5
21
  const translations = select.id === "fm-lang";
22
+ const workspace = select.hasAttribute("data-workspace-pane");
6
23
  const trigger = select
7
24
  .closest(".fm-language")
8
25
  ?.querySelector("[data-language-open]");
9
26
  const wrapper = document.createElement("div");
10
- wrapper.className = "language-select";
27
+ wrapper.className = `language-select${workspace ? " workspace-select" : ""}`;
11
28
  const popup = document.createElement("div");
12
- popup.className = "language-picker";
29
+ popup.className = `language-picker${workspace ? " workspace-picker" : ""}`;
13
30
  popup.id = `${select.id}-picker`;
14
31
  popup.popover = "manual";
15
32
  const input = document.createElement("input");
16
33
  input.type = "text";
17
- input.className = "language-select-input";
34
+ input.className = `language-select-input${workspace ? " workspace-picker-input" : ""}`;
35
+ if (workspace)
36
+ input.id = `${select.id}-input`;
18
37
  input.autocomplete = "off";
19
38
  input.spellcheck = false;
20
39
  input.setAttribute("role", "combobox");
21
- input.setAttribute("aria-autocomplete", "list");
40
+ input.setAttribute("aria-autocomplete", workspace ? "none" : "list");
22
41
  input.setAttribute("aria-haspopup", "listbox");
23
42
  input.setAttribute("aria-expanded", "false");
24
43
  const list = document.createElement("div");
@@ -44,11 +63,14 @@ export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-l
44
63
  const selectedText = () => select.selectedOptions[0]?.text ?? "";
45
64
  const position = () => {
46
65
  const rect = input.getBoundingClientRect();
66
+ const width = workspace
67
+ ? Math.min(Math.max(rect.width, 280), innerWidth - 16)
68
+ : rect.width;
47
69
  const below = innerHeight - rect.bottom;
48
70
  const above = below < 240 && rect.top > below;
49
71
  Object.assign(popup.style, {
50
- width: `${rect.width}px`,
51
- left: `${rect.left}px`,
72
+ width: `${width}px`,
73
+ left: `${workspace ? Math.max(8, Math.min(rect.left + (rect.width - width) / 2, innerWidth - width - 8)) : rect.left}px`,
52
74
  maxHeight: `${Math.max(80, Math.min(360, (above ? rect.top : below) - 12))}px`,
53
75
  top: above ? "auto" : `${rect.bottom + 4}px`,
54
76
  bottom: above ? `${innerHeight - rect.top + 4}px` : "auto",
@@ -70,12 +92,16 @@ export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-l
70
92
  input.removeAttribute("aria-activedescendant");
71
93
  };
72
94
  const render = () => {
95
+ const highlighted = workspace && isOpen()
96
+ ? list.querySelector('[data-active="true"]')?.dataset.value
97
+ : undefined;
73
98
  const words = query.normalize("NFKC").toLowerCase().trim().split(/\s+/).filter(Boolean);
74
99
  const fragment = document.createDocumentFragment();
75
100
  let selected = 0;
101
+ let preserved;
76
102
  let count = 0;
77
103
  for (const [i, option] of [...select.options].entries()) {
78
- if (option.disabled ||
104
+ if ((!workspace && option.disabled) ||
79
105
  !words.every((word) => option.text.normalize("NFKC").toLowerCase().includes(word)))
80
106
  continue;
81
107
  const item = document.createElement("button");
@@ -84,6 +110,25 @@ export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-l
84
110
  item.id = `${select.id}-option-${i}`;
85
111
  item.dataset.value = option.value;
86
112
  item.textContent = item.title = option.text;
113
+ if (workspace) {
114
+ item.dataset.change = option.dataset.change ?? "";
115
+ if (option.dataset.create)
116
+ item.dataset.create = option.dataset.create;
117
+ item.setAttribute("aria-disabled", String(select.disabled || option.disabled));
118
+ if (option.disabled) {
119
+ const reason = option.dataset.unavailable || option.title || option.text;
120
+ item.dataset.unavailable = item.title = reason;
121
+ item.setAttribute("aria-description", reason);
122
+ const label = document.createElement("span");
123
+ label.textContent = option.text;
124
+ const info = document.createElement("span");
125
+ info.className = "workspace-unavailable-icon";
126
+ info.setAttribute("aria-hidden", "true");
127
+ info.innerHTML =
128
+ '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><circle cx="10" cy="10" r="7"/><path d="M10 9v5M10 6.5h.01"/></svg>';
129
+ item.replaceChildren(label, info);
130
+ }
131
+ }
87
132
  item.disabled = select.disabled;
88
133
  item.setAttribute("role", "option");
89
134
  item.setAttribute("aria-selected", translations ? (option.dataset.added ?? "false") : String(option.selected));
@@ -102,26 +147,44 @@ export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-l
102
147
  }
103
148
  if (option.selected)
104
149
  selected = count;
150
+ if (option.value === highlighted)
151
+ preserved = count;
105
152
  fragment.append(item);
106
153
  count++;
107
154
  }
108
155
  list.replaceChildren(fragment);
109
156
  empty.hidden = count > 0;
110
157
  empty.textContent = t("No results");
111
- highlight(selected);
158
+ highlight(preserved ?? selected);
112
159
  };
113
160
  const sync = () => {
114
161
  input.title = selectedText();
115
- input.readOnly = select.disabled;
162
+ input.readOnly = workspace || select.disabled;
163
+ if (workspace) {
164
+ wrapper.dataset.workspacePane = input.dataset.workspacePane =
165
+ select.dataset.workspacePane;
166
+ wrapper.dataset.active = input.dataset.active = select.dataset.active;
167
+ input.setAttribute("aria-current", String(select.dataset.active === "true"));
168
+ input.dataset.change = select.selectedOptions[0]?.dataset.change ?? "";
169
+ input.setAttribute("aria-description", selectedText());
170
+ if (select.disabled && isOpen())
171
+ popup.hidePopover();
172
+ }
116
173
  if (trigger)
117
174
  trigger.disabled = select.disabled;
118
175
  input.setAttribute("aria-disabled", String(select.disabled));
119
- input.placeholder = select.dataset.placeholder ?? t("Search languages");
176
+ input.placeholder = workspace
177
+ ? ""
178
+ : (select.dataset.placeholder ?? t("Search languages"));
120
179
  input.setAttribute("aria-label", select.getAttribute("aria-label") ?? t("Language"));
121
180
  if (translations)
122
181
  input.setAttribute("aria-description", t("Enter to edit; Ctrl+Enter to add or remove translation"));
123
- if (!isOpen() || !query)
124
- input.value = selectedText();
182
+ if (!isOpen() || !query) {
183
+ if (workspace)
184
+ fitWorkspaceLabel(input, selectedText());
185
+ else
186
+ input.value = selectedText();
187
+ }
125
188
  if (isOpen())
126
189
  render();
127
190
  };
@@ -135,13 +198,19 @@ export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-l
135
198
  }
136
199
  else {
137
200
  query = "";
138
- input.value = selectedText();
201
+ if (workspace)
202
+ fitWorkspaceLabel(input, selectedText());
203
+ else
204
+ input.value = selectedText();
139
205
  input.removeAttribute("aria-activedescendant");
140
206
  }
141
207
  });
142
208
  const choose = (item) => {
143
209
  if (!item || select.disabled)
144
210
  return;
211
+ if (workspace &&
212
+ ![...select.options].some((option) => option.value === item.dataset.value && !option.disabled))
213
+ return;
145
214
  select.value = item.dataset.value ?? "";
146
215
  if (!translations)
147
216
  popup.hidePopover();
@@ -156,15 +225,23 @@ export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-l
156
225
  const open = () => {
157
226
  if (isOpen() || select.disabled)
158
227
  return;
228
+ select.dispatchEvent(new Event("docs:picker-open"));
159
229
  popup.showPopover();
160
- input.select();
230
+ if (!workspace)
231
+ input.select();
161
232
  };
162
- input.addEventListener("focus", open);
233
+ if (!workspace)
234
+ input.addEventListener("focus", open);
163
235
  trigger?.addEventListener("click", () => {
164
236
  input.focus();
165
237
  open();
166
238
  });
167
- input.addEventListener("click", open);
239
+ input.addEventListener("click", () => {
240
+ if (workspace && isOpen())
241
+ popup.hidePopover();
242
+ else
243
+ open();
244
+ });
168
245
  input.addEventListener("input", () => {
169
246
  query = input.value;
170
247
  if (isOpen())
@@ -182,7 +259,11 @@ export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-l
182
259
  else
183
260
  open();
184
261
  }
185
- else if (event.key === "Enter" && isOpen()) {
262
+ else if (workspace && isOpen() && ["Home", "End"].includes(event.key)) {
263
+ event.preventDefault();
264
+ highlight(event.key === "Home" ? 0 : list.children.length - 1);
265
+ }
266
+ else if ((event.key === "Enter" || (workspace && event.key === " ")) && isOpen()) {
186
267
  event.preventDefault();
187
268
  const item = list.querySelector('[data-active="true"]');
188
269
  if (translations && event.ctrlKey)
@@ -190,10 +271,15 @@ export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-l
190
271
  else
191
272
  choose(item);
192
273
  }
274
+ else if (workspace && (event.key === "Enter" || event.key === " ")) {
275
+ event.preventDefault();
276
+ open();
277
+ }
193
278
  else if (event.key === "Escape" && isOpen()) {
194
279
  event.preventDefault();
195
280
  popup.hidePopover();
196
- input.select();
281
+ if (!workspace)
282
+ input.select();
197
283
  }
198
284
  });
199
285
  list.addEventListener("pointerdown", (event) => event.preventDefault());
@@ -220,10 +306,17 @@ export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-l
220
306
  };
221
307
  document.addEventListener("pointerdown", outside);
222
308
  const resize = new ResizeObserver(() => {
309
+ if (workspace)
310
+ fitWorkspaceLabel(input, selectedText());
223
311
  if (isOpen())
224
312
  position();
225
313
  });
226
314
  resize.observe(input);
315
+ const reposition = () => {
316
+ if (isOpen())
317
+ position();
318
+ };
319
+ window.addEventListener("resize", reposition);
227
320
  select.addEventListener("change", sync);
228
321
  const observer = new MutationObserver(sync);
229
322
  observer.observe(select, {
@@ -236,6 +329,7 @@ export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-l
236
329
  document.removeEventListener("pointerdown", outside);
237
330
  document.removeEventListener("docs:ui-language", sync);
238
331
  select.removeEventListener("change", sync);
332
+ window.removeEventListener("resize", reposition);
239
333
  resize.disconnect();
240
334
  observer.disconnect();
241
335
  wrapper.replaceWith(select);
@@ -269,6 +269,9 @@
269
269
  "Switch branch": "Switch branch",
270
270
  "New branch": "New branch",
271
271
  "Create branch": "Create branch",
272
+ "Commit {manifest} before creating a branch.": "Commit {manifest} before creating a branch.",
273
+ "This branch does not contain {manifest} at the same path.": "This branch does not contain {manifest} at the same path.",
274
+ "New branches start from the latest commit. Unsaved changes stay in the current workspace.": "New branches start from the latest commit. Unsaved changes stay in the current workspace.",
272
275
  "Changes": "Changes",
273
276
  "Git uses saved files.": "Git uses saved files.",
274
277
  "Stage": "Stage",
@@ -291,7 +294,7 @@
291
294
  "Stash · empty": "Stash · empty",
292
295
  "Restore stash": "Restore stash",
293
296
  "Stash changes": "Stash changes",
294
- "Statics": "Statics",
297
+ "Library": "Library",
295
298
  "Subformats": "Subformats",
296
299
  "Expand card": "Expand card",
297
300
  "Collapse card": "Collapse card",
@@ -336,6 +339,7 @@
336
339
  "Provided by viewer": "Provided by viewer",
337
340
  "Added": "Added",
338
341
  "Modified": "Modified",
342
+ "Relations": "Relations",
339
343
  "Add subformat…": "Add subformat…",
340
344
  "Delete": "Delete",
341
345
  "Delete subformat {ext} and its sidebar page? Records and schema files will be kept.": "Delete subformat {ext} and its sidebar page? Records and schema files will be kept.",
@@ -400,5 +404,15 @@
400
404
  "Clear": "Clear",
401
405
  "Enter a valid date (YYYY-MM-DD).": "Enter a valid date (YYYY-MM-DD).",
402
406
  "Load preview": "Load preview",
403
- "Preview unavailable": "Preview unavailable"
407
+ "Preview unavailable": "Preview unavailable",
408
+ "History": "History",
409
+ "Snapshot message": "Snapshot message",
410
+ "Restore": "Restore",
411
+ "No snapshots yet": "No snapshots yet",
412
+ "Save snapshot": "Save snapshot",
413
+ "Restore every file to this snapshot?": "Restore every file to this snapshot?",
414
+ "Your name": "Your name",
415
+ "Email (optional)": "Email (optional)",
416
+ "Shared workspace": "Shared workspace",
417
+ "Join": "Join"
404
418
  }
@@ -269,6 +269,9 @@
269
269
  "Switch branch": "切り替え",
270
270
  "New branch": "新しいブランチ",
271
271
  "Create branch": "ブランチを作成",
272
+ "Commit {manifest} before creating a branch.": "ブランチを作成する前に、{manifest} をコミットしてください。",
273
+ "This branch does not contain {manifest} at the same path.": "このブランチには、同じ場所に {manifest} がありません。",
274
+ "New branches start from the latest commit. Unsaved changes stay in the current workspace.": "新しいブランチは最新のコミットから作成します。未保存の変更は現在のワークスペースに保持されます。",
272
275
  "Changes": "変更",
273
276
  "Git uses saved files.": "保存済みファイルの変更を表示しています。",
274
277
  "Stage": "ステージ",
@@ -291,7 +294,7 @@
291
294
  "Stash · empty": "Stash · 空",
292
295
  "Restore stash": "stashを復元",
293
296
  "Stash changes": "変更をstashへ退避",
294
- "Statics": "Statics",
297
+ "Library": "ライブラリ",
295
298
  "Subformats": "Subformats",
296
299
  "Expand card": "カードを展開",
297
300
  "Collapse card": "カードを折りたたむ",
@@ -336,6 +339,7 @@
336
339
  "Provided by viewer": "開発用プラグイン",
337
340
  "Added": "新規",
338
341
  "Modified": "変更",
342
+ "Relations": "関係図",
339
343
  "Add subformat…": "subformatを追加…",
340
344
  "Delete": "削除",
341
345
  "Delete subformat {ext} and its sidebar page? Records and schema files will be kept.": "subformat {ext} とサイドバーのページを削除しますか? レコードとスキーマファイルは保持されます。",
@@ -400,5 +404,15 @@
400
404
  "Clear": "クリア",
401
405
  "Enter a valid date (YYYY-MM-DD).": "有効な日付を入力してください(YYYY-MM-DD)。",
402
406
  "Load preview": "プレビューを読み込む",
403
- "Preview unavailable": "プレビューを読み込めません"
407
+ "Preview unavailable": "プレビューを読み込めません",
408
+ "History": "履歴",
409
+ "Snapshot message": "スナップショットの説明",
410
+ "Restore": "復元",
411
+ "No snapshots yet": "スナップショットはまだありません",
412
+ "Save snapshot": "スナップショットを保存",
413
+ "Restore every file to this snapshot?": "すべてのファイルをこのスナップショットの状態に戻しますか?",
414
+ "Your name": "名前",
415
+ "Email (optional)": "メールアドレス(任意)",
416
+ "Shared workspace": "共有ワークスペース",
417
+ "Join": "参加"
404
418
  }
@@ -269,6 +269,9 @@
269
269
  "Switch branch": "切换分支",
270
270
  "New branch": "新分支",
271
271
  "Create branch": "创建分支",
272
+ "Commit {manifest} before creating a branch.": "创建分支前,请先提交 {manifest}。",
273
+ "This branch does not contain {manifest} at the same path.": "此分支的相同路径下没有 {manifest}。",
274
+ "New branches start from the latest commit. Unsaved changes stay in the current workspace.": "新分支从最新提交创建。未保存的更改会保留在当前工作区。",
272
275
  "Changes": "更改",
273
276
  "Git uses saved files.": "显示已保存文件的更改。",
274
277
  "Stage": "暂存",
@@ -291,7 +294,7 @@
291
294
  "Stash · empty": "Stash · 空",
292
295
  "Restore stash": "恢复 stash",
293
296
  "Stash changes": "暂存更改",
294
- "Statics": "Statics",
297
+ "Library": "资料库",
295
298
  "Subformats": "Subformats",
296
299
  "Expand card": "展开卡片",
297
300
  "Collapse card": "折叠卡片",
@@ -336,6 +339,7 @@
336
339
  "Provided by viewer": "由查看器提供",
337
340
  "Added": "新增",
338
341
  "Modified": "修改",
342
+ "Relations": "关系图",
339
343
  "Add subformat…": "添加子格式…",
340
344
  "Delete": "删除",
341
345
  "Delete subformat {ext} and its sidebar page? Records and schema files will be kept.": "删除子格式 {ext} 及其侧边栏页面?记录和模式文件将保留。",
@@ -400,5 +404,15 @@
400
404
  "Clear": "清除",
401
405
  "Enter a valid date (YYYY-MM-DD).": "请输入有效日期(YYYY-MM-DD)。",
402
406
  "Load preview": "加载预览",
403
- "Preview unavailable": "无法加载预览"
407
+ "Preview unavailable": "无法加载预览",
408
+ "History": "历史",
409
+ "Snapshot message": "快照说明",
410
+ "Restore": "恢复",
411
+ "No snapshots yet": "暂无快照",
412
+ "Save snapshot": "保存快照",
413
+ "Restore every file to this snapshot?": "将所有文件恢复到此快照的状态吗?",
414
+ "Your name": "您的姓名",
415
+ "Email (optional)": "电子邮件(可选)",
416
+ "Shared workspace": "共享工作区",
417
+ "Join": "加入"
404
418
  }
@@ -68,4 +68,6 @@ export const focusNavTree = (root) => {
68
68
  item.classList.add("open");
69
69
  current?.querySelector(":scope > .nav-row")?.scrollIntoView({ block: "nearest" });
70
70
  }
71
+ for (const item of items)
72
+ item.querySelector(":scope > .nav-row > .nav-tree-toggle")?.setAttribute("aria-expanded", String(item.classList.contains("open")));
71
73
  };
@@ -1,6 +1,6 @@
1
- import { escapeHtml } from "../core/escape-html.js";
2
- import { parseMdast } from "../core/markdown.js";
3
1
  import { pluginLink, } from "../plugins/blocks.js";
2
+ import { escapeHtml } from "../engine/core/escape-html.js";
3
+ import { parseMdast } from "../engine/core/markdown.js";
4
4
  const link = (url, html) => pluginLink(url)
5
5
  ? `<a href="${escapeHtml(url)}" target="_blank" rel="noopener noreferrer">${html}</a>`
6
6
  : html;
@@ -3,7 +3,8 @@ export const mountPanelResize = () => {
3
3
  const sidebar = document.getElementById("sidebar");
4
4
  const editor = document.getElementById("panel");
5
5
  const closed = () => document.body.classList.contains("sidebar-closed");
6
- const contentWidth = () => Math.min(240, Math.max(0, window.innerWidth - (closed() ? 52 : 200) - (editor ? 320 : 0)));
6
+ const split = () => !!document.querySelector("#preview-panes.split");
7
+ const contentWidth = () => Math.min(split() ? 480 : 240, Math.max(0, window.innerWidth - (closed() ? 52 : 200) - (editor ? 320 : 0)));
7
8
  const panels = [
8
9
  {
9
10
  element: sidebar,
@@ -36,7 +37,10 @@ export const mountPanelResize = () => {
36
37
  /* Width persistence is optional. */
37
38
  }
38
39
  const property = options.direction === 1 ? "--sidebar-width" : "--panel-width";
39
- const requested = () => preferred ?? (options.direction === 1 ? 260 : Math.min(760, window.innerWidth * 0.52));
40
+ const requested = () => preferred ??
41
+ (options.direction === 1
42
+ ? 260
43
+ : Math.min(split() ? 480 : 760, window.innerWidth * (split() ? 0.34 : 0.52)));
40
44
  if (options.direction === 1 && closed())
41
45
  element.style.setProperty(property, `${requested()}px`);
42
46
  const apply = (width) => {
@@ -112,6 +116,11 @@ export const mountPanelResize = () => {
112
116
  return [{ ...options, element, apply, requested, persist, property }];
113
117
  });
114
118
  const layout = () => {
119
+ if (editor && window.innerWidth <= 820) {
120
+ const left = panels.find((panel) => panel.direction === 1);
121
+ left?.element.style.setProperty(left.property, `${Math.min(left.requested(), window.innerWidth - 52)}px`);
122
+ return;
123
+ }
115
124
  // On a smaller viewport, make room for the navigation before clamping both panels.
116
125
  const right = panels.find((panel) => panel.direction === -1);
117
126
  if (right) {
@@ -125,8 +134,11 @@ export const mountPanelResize = () => {
125
134
  }
126
135
  };
127
136
  window.addEventListener("resize", layout);
137
+ document.addEventListener("docs:panes-changed", layout);
128
138
  document.getElementById("sidebar-toggle")?.addEventListener("click", layout);
129
139
  window.addEventListener("keydown", (event) => {
140
+ if (editor && window.innerWidth <= 820)
141
+ return;
130
142
  if (event.defaultPrevented || !(event.ctrlKey || event.metaKey) || !event.altKey)
131
143
  return;
132
144
  if (event.key !== "ArrowLeft" && event.key !== "ArrowRight")
@@ -0,0 +1,2 @@
1
+ /** Self-contained for standalone HTML; data URLs use the browser's native download behavior. */
2
+ export declare const mountResourceDownloads: (request?: (url: string, init?: RequestInit, workspace?: string) => Promise<Response>) => void;
@@ -0,0 +1,43 @@
1
+ /** Self-contained for standalone HTML; data URLs use the browser's native download behavior. */
2
+ export const mountResourceDownloads = (request = fetch) => {
3
+ document.addEventListener("click", async (event) => {
4
+ const link = event.target instanceof Element
5
+ ? event.target.closest("a[data-resource-download]")
6
+ : null;
7
+ if (!link || !/^https?:/.test(link.href))
8
+ return;
9
+ event.preventDefault();
10
+ if (link.getAttribute("aria-busy") === "true")
11
+ return;
12
+ const status = link.parentElement?.querySelector("[role=status]") ?? document.createElement("span");
13
+ status.setAttribute("role", "status");
14
+ status.textContent = "Downloading…";
15
+ link.after(status);
16
+ link.setAttribute("aria-busy", "true");
17
+ try {
18
+ const response = await request(link.href, {
19
+ credentials: "omit",
20
+ referrerPolicy: "no-referrer",
21
+ signal: AbortSignal.timeout(30000),
22
+ }, link.closest("[data-workspace]")?.dataset.workspace);
23
+ if (!response.ok)
24
+ throw new Error();
25
+ const url = URL.createObjectURL(await response.blob());
26
+ const download = document.createElement("a");
27
+ download.href = url;
28
+ download.download = link.download;
29
+ document.body.append(download);
30
+ download.click();
31
+ download.remove();
32
+ setTimeout(() => URL.revokeObjectURL(url), 60000);
33
+ status.textContent = "";
34
+ }
35
+ catch {
36
+ status.textContent =
37
+ "Download failed. Check your connection and the source's download permissions, then try again.";
38
+ }
39
+ finally {
40
+ link.removeAttribute("aria-busy");
41
+ }
42
+ });
43
+ };
@@ -1,4 +1,5 @@
1
- import { type SubformatCollection } from "../core/subformats.js";
1
+ import type { SchemaModel } from "../engine/core/schema-graph.js";
2
+ import { type SubformatCollection } from "../engine/core/subformats.js";
2
3
  interface SourceLocation {
3
4
  file: string;
4
5
  line: number;
@@ -21,11 +22,17 @@ export interface ResourceIndex {
21
22
  }[];
22
23
  urlPreviews: ResourceIndex["urls"];
23
24
  subformats: SubformatCollection[];
25
+ /** Schema references between subformats, drawn like a schemath diagram. */
26
+ relations?: SchemaModel;
24
27
  errors: string[];
25
28
  }
26
29
  /** Index authored content, including files not referenced by any document. */
27
30
  export declare const resourceIndex: (root: string, files: readonly string[], domains?: readonly string[]) => ResourceIndex;
28
31
  export type ResourceView = "files" | "codeblocks" | "urls" | "url-previews";
29
32
  export declare const resourceTabs: (view: ResourceView) => string;
30
- export declare const resourceLibraryHtml: (index: ResourceIndex, view: Exclude<ResourceView, "files"> | "subformats", pageTitle?: string) => string;
33
+ export declare const resourceLibraryHtml: (index: ResourceIndex, view: Exclude<ResourceView, "files"> | "subformats", pageTitle?: string,
34
+ /** Library page: use each format's preview without the format picker. */
35
+ page?: boolean) => string;
36
+ /** A Library view shown as a site page: one block format, `urls` or `url-previews`. */
37
+ export declare const libraryPageHtml: (index: ResourceIndex, view: string, title: string) => string;
31
38
  export {};