postext 1.68.0 → 1.70.0

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 (599) hide show
  1. package/README.md +2 -1
  2. package/dist/__tests__/exports.test.js +3 -0
  3. package/dist/__tests__/exports.test.js.map +1 -1
  4. package/dist/composed/sourceMap/text.d.ts.map +1 -1
  5. package/dist/composed/sourceMap/text.js +1 -15
  6. package/dist/composed/sourceMap/text.js.map +1 -1
  7. package/dist/index.d.ts +4 -4
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +2 -0
  10. package/dist/index.js.map +1 -1
  11. package/dist/paint/displayList/blocks.d.ts +29 -0
  12. package/dist/paint/displayList/blocks.d.ts.map +1 -0
  13. package/dist/paint/displayList/blocks.js +257 -0
  14. package/dist/paint/displayList/blocks.js.map +1 -0
  15. package/dist/paint/displayList/comic.d.ts +8 -0
  16. package/dist/paint/displayList/comic.d.ts.map +1 -0
  17. package/dist/paint/displayList/comic.js +142 -0
  18. package/dist/paint/displayList/comic.js.map +1 -0
  19. package/dist/paint/displayList/design.d.ts +27 -0
  20. package/dist/paint/displayList/design.d.ts.map +1 -0
  21. package/dist/paint/displayList/design.js +190 -0
  22. package/dist/paint/displayList/design.js.map +1 -0
  23. package/dist/paint/displayList/displayList.test.d.ts +2 -0
  24. package/dist/paint/displayList/displayList.test.d.ts.map +1 -0
  25. package/dist/paint/displayList/displayList.test.js +256 -0
  26. package/dist/paint/displayList/displayList.test.js.map +1 -0
  27. package/dist/paint/displayList/eastAsian.test.d.ts +2 -0
  28. package/dist/paint/displayList/eastAsian.test.d.ts.map +1 -0
  29. package/dist/paint/displayList/eastAsian.test.js +112 -0
  30. package/dist/paint/displayList/eastAsian.test.js.map +1 -0
  31. package/dist/paint/displayList/frame.d.ts +49 -0
  32. package/dist/paint/displayList/frame.d.ts.map +1 -0
  33. package/dist/paint/displayList/frame.js +230 -0
  34. package/dist/paint/displayList/frame.js.map +1 -0
  35. package/dist/paint/displayList/frames.test.d.ts +2 -0
  36. package/dist/paint/displayList/frames.test.d.ts.map +1 -0
  37. package/dist/paint/displayList/frames.test.js +129 -0
  38. package/dist/paint/displayList/frames.test.js.map +1 -0
  39. package/dist/paint/displayList/index.d.ts +4 -0
  40. package/dist/paint/displayList/index.d.ts.map +1 -0
  41. package/dist/paint/displayList/index.js +5 -0
  42. package/dist/paint/displayList/index.js.map +1 -0
  43. package/dist/paint/displayList/inline.d.ts +19 -0
  44. package/dist/paint/displayList/inline.d.ts.map +1 -0
  45. package/dist/paint/displayList/inline.js +84 -0
  46. package/dist/paint/displayList/inline.js.map +1 -0
  47. package/dist/paint/displayList/lines.d.ts +60 -0
  48. package/dist/paint/displayList/lines.d.ts.map +1 -0
  49. package/dist/paint/displayList/lines.js +267 -0
  50. package/dist/paint/displayList/lines.js.map +1 -0
  51. package/dist/paint/displayList/overlays.d.ts +23 -0
  52. package/dist/paint/displayList/overlays.d.ts.map +1 -0
  53. package/dist/paint/displayList/overlays.js +99 -0
  54. package/dist/paint/displayList/overlays.js.map +1 -0
  55. package/dist/paint/displayList/overlays.test.d.ts +2 -0
  56. package/dist/paint/displayList/overlays.test.d.ts.map +1 -0
  57. package/dist/paint/displayList/overlays.test.js +241 -0
  58. package/dist/paint/displayList/overlays.test.js.map +1 -0
  59. package/dist/paint/displayList/page.d.ts +8 -0
  60. package/dist/paint/displayList/page.d.ts.map +1 -0
  61. package/dist/paint/displayList/page.js +157 -0
  62. package/dist/paint/displayList/page.js.map +1 -0
  63. package/dist/paint/displayList/resource.d.ts +6 -0
  64. package/dist/paint/displayList/resource.d.ts.map +1 -0
  65. package/dist/paint/displayList/resource.js +195 -0
  66. package/dist/paint/displayList/resource.js.map +1 -0
  67. package/dist/paint/displayList/review.test.d.ts +2 -0
  68. package/dist/paint/displayList/review.test.d.ts.map +1 -0
  69. package/dist/paint/displayList/review.test.js +185 -0
  70. package/dist/paint/displayList/review.test.js.map +1 -0
  71. package/dist/paint/displayList/source.d.ts +57 -0
  72. package/dist/paint/displayList/source.d.ts.map +1 -0
  73. package/dist/paint/displayList/source.js +263 -0
  74. package/dist/paint/displayList/source.js.map +1 -0
  75. package/dist/paint/displayList/source.test.d.ts +2 -0
  76. package/dist/paint/displayList/source.test.d.ts.map +1 -0
  77. package/dist/paint/displayList/source.test.js +37 -0
  78. package/dist/paint/displayList/source.test.js.map +1 -0
  79. package/dist/paint/displayList/types.d.ts +309 -0
  80. package/dist/paint/displayList/types.d.ts.map +1 -0
  81. package/dist/paint/displayList/types.js +7 -0
  82. package/dist/paint/displayList/types.js.map +1 -0
  83. package/dist/paint/segmentPlainLength.d.ts +9 -0
  84. package/dist/paint/segmentPlainLength.d.ts.map +1 -0
  85. package/dist/paint/segmentPlainLength.js +19 -0
  86. package/dist/paint/segmentPlainLength.js.map +1 -0
  87. package/dist/parse/sourceMapping.d.ts.map +1 -1
  88. package/dist/parse/sourceMapping.js +10 -4
  89. package/dist/parse/sourceMapping.js.map +1 -1
  90. package/dist/word/anchors/anchors.test.d.ts +2 -0
  91. package/dist/word/anchors/anchors.test.d.ts.map +1 -0
  92. package/dist/word/anchors/anchors.test.js +88 -0
  93. package/dist/word/anchors/anchors.test.js.map +1 -0
  94. package/dist/word/anchors/base64.d.ts +3 -0
  95. package/dist/word/anchors/base64.d.ts.map +1 -0
  96. package/dist/word/anchors/base64.js +47 -0
  97. package/dist/word/anchors/base64.js.map +1 -0
  98. package/dist/word/anchors/bookmarks.d.ts +11 -0
  99. package/dist/word/anchors/bookmarks.d.ts.map +1 -0
  100. package/dist/word/anchors/bookmarks.js +34 -0
  101. package/dist/word/anchors/bookmarks.js.map +1 -0
  102. package/dist/word/anchors/exportMap.d.ts +25 -0
  103. package/dist/word/anchors/exportMap.d.ts.map +1 -0
  104. package/dist/word/anchors/exportMap.js +131 -0
  105. package/dist/word/anchors/exportMap.js.map +1 -0
  106. package/dist/word/anchors/hash.d.ts +7 -0
  107. package/dist/word/anchors/hash.d.ts.map +1 -0
  108. package/dist/word/anchors/hash.js +39 -0
  109. package/dist/word/anchors/hash.js.map +1 -0
  110. package/dist/word/anchors/index.d.ts +7 -0
  111. package/dist/word/anchors/index.d.ts.map +1 -0
  112. package/dist/word/anchors/index.js +9 -0
  113. package/dist/word/anchors/index.js.map +1 -0
  114. package/dist/word/anchors/ommlHash.d.ts +8 -0
  115. package/dist/word/anchors/ommlHash.d.ts.map +1 -0
  116. package/dist/word/anchors/ommlHash.js +71 -0
  117. package/dist/word/anchors/ommlHash.js.map +1 -0
  118. package/dist/word/anchors/types.d.ts +87 -0
  119. package/dist/word/anchors/types.d.ts.map +1 -0
  120. package/dist/word/anchors/types.js +8 -0
  121. package/dist/word/anchors/types.js.map +1 -0
  122. package/dist/word/fonts/cmap.d.ts +13 -0
  123. package/dist/word/fonts/cmap.d.ts.map +1 -0
  124. package/dist/word/fonts/cmap.js +235 -0
  125. package/dist/word/fonts/cmap.js.map +1 -0
  126. package/dist/word/fonts/fonts.test.d.ts +2 -0
  127. package/dist/word/fonts/fonts.test.d.ts.map +1 -0
  128. package/dist/word/fonts/fonts.test.js +459 -0
  129. package/dist/word/fonts/fonts.test.js.map +1 -0
  130. package/dist/word/fonts/glyf.d.ts +21 -0
  131. package/dist/word/fonts/glyf.d.ts.map +1 -0
  132. package/dist/word/fonts/glyf.js +139 -0
  133. package/dist/word/fonts/glyf.js.map +1 -0
  134. package/dist/word/fonts/gsub.d.ts +8 -0
  135. package/dist/word/fonts/gsub.d.ts.map +1 -0
  136. package/dist/word/fonts/gsub.js +145 -0
  137. package/dist/word/fonts/gsub.js.map +1 -0
  138. package/dist/word/fonts/gsub.test.d.ts +2 -0
  139. package/dist/word/fonts/gsub.test.d.ts.map +1 -0
  140. package/dist/word/fonts/gsub.test.js +98 -0
  141. package/dist/word/fonts/gsub.test.js.map +1 -0
  142. package/dist/word/fonts/index.d.ts +6 -0
  143. package/dist/word/fonts/index.d.ts.map +1 -0
  144. package/dist/word/fonts/index.js +5 -0
  145. package/dist/word/fonts/index.js.map +1 -0
  146. package/dist/word/fonts/merge.d.ts +7 -0
  147. package/dist/word/fonts/merge.d.ts.map +1 -0
  148. package/dist/word/fonts/merge.js +222 -0
  149. package/dist/word/fonts/merge.js.map +1 -0
  150. package/dist/word/fonts/meta.d.ts +33 -0
  151. package/dist/word/fonts/meta.d.ts.map +1 -0
  152. package/dist/word/fonts/meta.js +206 -0
  153. package/dist/word/fonts/meta.js.map +1 -0
  154. package/dist/word/fonts/plan.d.ts +31 -0
  155. package/dist/word/fonts/plan.d.ts.map +1 -0
  156. package/dist/word/fonts/plan.js +275 -0
  157. package/dist/word/fonts/plan.js.map +1 -0
  158. package/dist/word/fonts/sfnt.d.ts +47 -0
  159. package/dist/word/fonts/sfnt.d.ts.map +1 -0
  160. package/dist/word/fonts/sfnt.js +202 -0
  161. package/dist/word/fonts/sfnt.js.map +1 -0
  162. package/dist/word/fonts/types.d.ts +54 -0
  163. package/dist/word/fonts/types.d.ts.map +1 -0
  164. package/dist/word/fonts/types.js +5 -0
  165. package/dist/word/fonts/types.js.map +1 -0
  166. package/dist/word/formatted/displayRoundTrip.test.d.ts +2 -0
  167. package/dist/word/formatted/displayRoundTrip.test.d.ts.map +1 -0
  168. package/dist/word/formatted/displayRoundTrip.test.js +99 -0
  169. package/dist/word/formatted/displayRoundTrip.test.js.map +1 -0
  170. package/dist/word/formatted/drawing.d.ts +61 -0
  171. package/dist/word/formatted/drawing.d.ts.map +1 -0
  172. package/dist/word/formatted/drawing.js +85 -0
  173. package/dist/word/formatted/drawing.js.map +1 -0
  174. package/dist/word/formatted/dump.test.d.ts +2 -0
  175. package/dist/word/formatted/dump.test.d.ts.map +1 -0
  176. package/dist/word/formatted/dump.test.js +31 -0
  177. package/dist/word/formatted/dump.test.js.map +1 -0
  178. package/dist/word/formatted/eastAsian.d.ts +68 -0
  179. package/dist/word/formatted/eastAsian.d.ts.map +1 -0
  180. package/dist/word/formatted/eastAsian.js +144 -0
  181. package/dist/word/formatted/eastAsian.js.map +1 -0
  182. package/dist/word/formatted/formatted.test-helper.d.ts +34 -0
  183. package/dist/word/formatted/formatted.test-helper.d.ts.map +1 -0
  184. package/dist/word/formatted/formatted.test-helper.js +138 -0
  185. package/dist/word/formatted/formatted.test-helper.js.map +1 -0
  186. package/dist/word/formatted/formatted.test.d.ts +2 -0
  187. package/dist/word/formatted/formatted.test.d.ts.map +1 -0
  188. package/dist/word/formatted/formatted.test.js +285 -0
  189. package/dist/word/formatted/formatted.test.js.map +1 -0
  190. package/dist/word/formatted/fragments.d.ts +30 -0
  191. package/dist/word/formatted/fragments.d.ts.map +1 -0
  192. package/dist/word/formatted/fragments.js +98 -0
  193. package/dist/word/formatted/fragments.js.map +1 -0
  194. package/dist/word/formatted/graphics.test.d.ts +2 -0
  195. package/dist/word/formatted/graphics.test.d.ts.map +1 -0
  196. package/dist/word/formatted/graphics.test.js +204 -0
  197. package/dist/word/formatted/graphics.test.js.map +1 -0
  198. package/dist/word/formatted/index.d.ts +8 -0
  199. package/dist/word/formatted/index.d.ts.map +1 -0
  200. package/dist/word/formatted/index.js +103 -0
  201. package/dist/word/formatted/index.js.map +1 -0
  202. package/dist/word/formatted/inline.test.d.ts +2 -0
  203. package/dist/word/formatted/inline.test.d.ts.map +1 -0
  204. package/dist/word/formatted/inline.test.js +154 -0
  205. package/dist/word/formatted/inline.test.js.map +1 -0
  206. package/dist/word/formatted/inlineShapes.d.ts +13 -0
  207. package/dist/word/formatted/inlineShapes.d.ts.map +1 -0
  208. package/dist/word/formatted/inlineShapes.js +79 -0
  209. package/dist/word/formatted/inlineShapes.js.map +1 -0
  210. package/dist/word/formatted/metrics.d.ts +54 -0
  211. package/dist/word/formatted/metrics.d.ts.map +1 -0
  212. package/dist/word/formatted/metrics.js +165 -0
  213. package/dist/word/formatted/metrics.js.map +1 -0
  214. package/dist/word/formatted/page.d.ts +16 -0
  215. package/dist/word/formatted/page.d.ts.map +1 -0
  216. package/dist/word/formatted/page.js +82 -0
  217. package/dist/word/formatted/page.js.map +1 -0
  218. package/dist/word/formatted/paragraphs.d.ts +98 -0
  219. package/dist/word/formatted/paragraphs.d.ts.map +1 -0
  220. package/dist/word/formatted/paragraphs.js +364 -0
  221. package/dist/word/formatted/paragraphs.js.map +1 -0
  222. package/dist/word/formatted/pictures.d.ts +27 -0
  223. package/dist/word/formatted/pictures.d.ts.map +1 -0
  224. package/dist/word/formatted/pictures.js +239 -0
  225. package/dist/word/formatted/pictures.js.map +1 -0
  226. package/dist/word/formatted/review.test.d.ts +2 -0
  227. package/dist/word/formatted/review.test.d.ts.map +1 -0
  228. package/dist/word/formatted/review.test.js +141 -0
  229. package/dist/word/formatted/review.test.js.map +1 -0
  230. package/dist/word/formatted/runs.d.ts +135 -0
  231. package/dist/word/formatted/runs.d.ts.map +1 -0
  232. package/dist/word/formatted/runs.js +433 -0
  233. package/dist/word/formatted/runs.js.map +1 -0
  234. package/dist/word/formatted/scripts.test.d.ts +2 -0
  235. package/dist/word/formatted/scripts.test.d.ts.map +1 -0
  236. package/dist/word/formatted/scripts.test.js +201 -0
  237. package/dist/word/formatted/scripts.test.js.map +1 -0
  238. package/dist/word/formatted/shapes.d.ts +29 -0
  239. package/dist/word/formatted/shapes.d.ts.map +1 -0
  240. package/dist/word/formatted/shapes.js +101 -0
  241. package/dist/word/formatted/shapes.js.map +1 -0
  242. package/dist/word/formatted/styles.d.ts +17 -0
  243. package/dist/word/formatted/styles.d.ts.map +1 -0
  244. package/dist/word/formatted/styles.js +91 -0
  245. package/dist/word/formatted/styles.js.map +1 -0
  246. package/dist/word/formatted/tables.d.ts +13 -0
  247. package/dist/word/formatted/tables.d.ts.map +1 -0
  248. package/dist/word/formatted/tables.js +159 -0
  249. package/dist/word/formatted/tables.js.map +1 -0
  250. package/dist/word/formatted/text.d.ts +32 -0
  251. package/dist/word/formatted/text.d.ts.map +1 -0
  252. package/dist/word/formatted/text.js +115 -0
  253. package/dist/word/formatted/text.js.map +1 -0
  254. package/dist/word/formatted/types.d.ts +68 -0
  255. package/dist/word/formatted/types.d.ts.map +1 -0
  256. package/dist/word/formatted/types.js +4 -0
  257. package/dist/word/formatted/types.js.map +1 -0
  258. package/dist/word/formatted/units.d.ts +23 -0
  259. package/dist/word/formatted/units.d.ts.map +1 -0
  260. package/dist/word/formatted/units.js +51 -0
  261. package/dist/word/formatted/units.js.map +1 -0
  262. package/dist/word/formatted/widths.test.d.ts +2 -0
  263. package/dist/word/formatted/widths.test.d.ts.map +1 -0
  264. package/dist/word/formatted/widths.test.js +327 -0
  265. package/dist/word/formatted/widths.test.js.map +1 -0
  266. package/dist/word/index.d.ts +13 -2
  267. package/dist/word/index.d.ts.map +1 -1
  268. package/dist/word/index.js +14 -5
  269. package/dist/word/index.js.map +1 -1
  270. package/dist/word/integration/corpus.known.test.d.ts +2 -0
  271. package/dist/word/integration/corpus.known.test.d.ts.map +1 -0
  272. package/dist/word/integration/corpus.known.test.js +42 -0
  273. package/dist/word/integration/corpus.known.test.js.map +1 -0
  274. package/dist/word/integration/corpus.test.d.ts +2 -0
  275. package/dist/word/integration/corpus.test.d.ts.map +1 -0
  276. package/dist/word/integration/corpus.test.js +352 -0
  277. package/dist/word/integration/corpus.test.js.map +1 -0
  278. package/dist/word/integration/formatted.test.d.ts +2 -0
  279. package/dist/word/integration/formatted.test.d.ts.map +1 -0
  280. package/dist/word/integration/formatted.test.js +125 -0
  281. package/dist/word/integration/formatted.test.js.map +1 -0
  282. package/dist/word/integration/integration.test-helper.d.ts +16 -0
  283. package/dist/word/integration/integration.test-helper.d.ts.map +1 -0
  284. package/dist/word/integration/integration.test-helper.js +48 -0
  285. package/dist/word/integration/integration.test-helper.js.map +1 -0
  286. package/dist/word/integration/sample.test-helper.d.ts +5 -0
  287. package/dist/word/integration/sample.test-helper.d.ts.map +1 -0
  288. package/dist/word/integration/sample.test-helper.js +48 -0
  289. package/dist/word/integration/sample.test-helper.js.map +1 -0
  290. package/dist/word/integration/semantic.test.d.ts +2 -0
  291. package/dist/word/integration/semantic.test.d.ts.map +1 -0
  292. package/dist/word/integration/semantic.test.js +111 -0
  293. package/dist/word/integration/semantic.test.js.map +1 -0
  294. package/dist/word/integration/wordEdit.test-helper.d.ts +14 -0
  295. package/dist/word/integration/wordEdit.test-helper.d.ts.map +1 -0
  296. package/dist/word/integration/wordEdit.test-helper.js +150 -0
  297. package/dist/word/integration/wordEdit.test-helper.js.map +1 -0
  298. package/dist/word/omml.d.ts.map +1 -1
  299. package/dist/word/omml.js +17 -5
  300. package/dist/word/omml.js.map +1 -1
  301. package/dist/word/omml.test.d.ts +2 -0
  302. package/dist/word/omml.test.d.ts.map +1 -0
  303. package/dist/word/omml.test.js +46 -0
  304. package/dist/word/omml.test.js.map +1 -0
  305. package/dist/word/ommlWrite/convert.d.ts +20 -0
  306. package/dist/word/ommlWrite/convert.d.ts.map +1 -0
  307. package/dist/word/ommlWrite/convert.js +311 -0
  308. package/dist/word/ommlWrite/convert.js.map +1 -0
  309. package/dist/word/ommlWrite/index.d.ts +25 -0
  310. package/dist/word/ommlWrite/index.d.ts.map +1 -0
  311. package/dist/word/ommlWrite/index.js +80 -0
  312. package/dist/word/ommlWrite/index.js.map +1 -0
  313. package/dist/word/ommlWrite/mml.d.ts +49 -0
  314. package/dist/word/ommlWrite/mml.d.ts.map +1 -0
  315. package/dist/word/ommlWrite/mml.js +73 -0
  316. package/dist/word/ommlWrite/mml.js.map +1 -0
  317. package/dist/word/ommlWrite/ommlWrite.test.d.ts +2 -0
  318. package/dist/word/ommlWrite/ommlWrite.test.d.ts.map +1 -0
  319. package/dist/word/ommlWrite/ommlWrite.test.js +230 -0
  320. package/dist/word/ommlWrite/ommlWrite.test.js.map +1 -0
  321. package/dist/word/ommlWrite/rows.d.ts +6 -0
  322. package/dist/word/ommlWrite/rows.d.ts.map +1 -0
  323. package/dist/word/ommlWrite/rows.js +216 -0
  324. package/dist/word/ommlWrite/rows.js.map +1 -0
  325. package/dist/word/ommlWrite/runs.d.ts +30 -0
  326. package/dist/word/ommlWrite/runs.d.ts.map +1 -0
  327. package/dist/word/ommlWrite/runs.js +122 -0
  328. package/dist/word/ommlWrite/runs.js.map +1 -0
  329. package/dist/word/ommlWrite/tables.d.ts +4 -0
  330. package/dist/word/ommlWrite/tables.d.ts.map +1 -0
  331. package/dist/word/ommlWrite/tables.js +50 -0
  332. package/dist/word/ommlWrite/tables.js.map +1 -0
  333. package/dist/word/ooxml/constants.d.ts +54 -0
  334. package/dist/word/ooxml/constants.d.ts.map +1 -0
  335. package/dist/word/ooxml/constants.js +85 -0
  336. package/dist/word/ooxml/constants.js.map +1 -0
  337. package/dist/word/ooxml/fonts.d.ts +16 -0
  338. package/dist/word/ooxml/fonts.d.ts.map +1 -0
  339. package/dist/word/ooxml/fonts.js +71 -0
  340. package/dist/word/ooxml/fonts.js.map +1 -0
  341. package/dist/word/ooxml/index.d.ts +7 -0
  342. package/dist/word/ooxml/index.d.ts.map +1 -0
  343. package/dist/word/ooxml/index.js +7 -0
  344. package/dist/word/ooxml/index.js.map +1 -0
  345. package/dist/word/ooxml/package.d.ts +21 -0
  346. package/dist/word/ooxml/package.d.ts.map +1 -0
  347. package/dist/word/ooxml/package.js +202 -0
  348. package/dist/word/ooxml/package.js.map +1 -0
  349. package/dist/word/ooxml/package.test.d.ts +2 -0
  350. package/dist/word/ooxml/package.test.d.ts.map +1 -0
  351. package/dist/word/ooxml/package.test.js +176 -0
  352. package/dist/word/ooxml/package.test.js.map +1 -0
  353. package/dist/word/ooxml/parts.d.ts +28 -0
  354. package/dist/word/ooxml/parts.d.ts.map +1 -0
  355. package/dist/word/ooxml/parts.js +172 -0
  356. package/dist/word/ooxml/parts.js.map +1 -0
  357. package/dist/word/ooxml/review.test.d.ts +2 -0
  358. package/dist/word/ooxml/review.test.d.ts.map +1 -0
  359. package/dist/word/ooxml/review.test.js +104 -0
  360. package/dist/word/ooxml/review.test.js.map +1 -0
  361. package/dist/word/ooxml/types.d.ts +85 -0
  362. package/dist/word/ooxml/types.d.ts.map +1 -0
  363. package/dist/word/ooxml/types.js +6 -0
  364. package/dist/word/ooxml/types.js.map +1 -0
  365. package/dist/word/ooxml/validate.d.ts +3 -0
  366. package/dist/word/ooxml/validate.d.ts.map +1 -0
  367. package/dist/word/ooxml/validate.js +122 -0
  368. package/dist/word/ooxml/validate.js.map +1 -0
  369. package/dist/word/ooxml/wellFormed.d.ts +3 -0
  370. package/dist/word/ooxml/wellFormed.d.ts.map +1 -0
  371. package/dist/word/ooxml/wellFormed.js +79 -0
  372. package/dist/word/ooxml/wellFormed.js.map +1 -0
  373. package/dist/word/roundtrip/added.d.ts +31 -0
  374. package/dist/word/roundtrip/added.d.ts.map +1 -0
  375. package/dist/word/roundtrip/added.js +199 -0
  376. package/dist/word/roundtrip/added.js.map +1 -0
  377. package/dist/word/roundtrip/added.test.d.ts +2 -0
  378. package/dist/word/roundtrip/added.test.d.ts.map +1 -0
  379. package/dist/word/roundtrip/added.test.js +59 -0
  380. package/dist/word/roundtrip/added.test.js.map +1 -0
  381. package/dist/word/roundtrip/apply.d.ts +11 -0
  382. package/dist/word/roundtrip/apply.d.ts.map +1 -0
  383. package/dist/word/roundtrip/apply.js +260 -0
  384. package/dist/word/roundtrip/apply.js.map +1 -0
  385. package/dist/word/roundtrip/blocks.d.ts +56 -0
  386. package/dist/word/roundtrip/blocks.d.ts.map +1 -0
  387. package/dist/word/roundtrip/blocks.js +145 -0
  388. package/dist/word/roundtrip/blocks.js.map +1 -0
  389. package/dist/word/roundtrip/corpus.test.d.ts +2 -0
  390. package/dist/word/roundtrip/corpus.test.d.ts.map +1 -0
  391. package/dist/word/roundtrip/corpus.test.js +54 -0
  392. package/dist/word/roundtrip/corpus.test.js.map +1 -0
  393. package/dist/word/roundtrip/diff.d.ts +15 -0
  394. package/dist/word/roundtrip/diff.d.ts.map +1 -0
  395. package/dist/word/roundtrip/diff.js +160 -0
  396. package/dist/word/roundtrip/diff.js.map +1 -0
  397. package/dist/word/roundtrip/diff.test.d.ts +2 -0
  398. package/dist/word/roundtrip/diff.test.d.ts.map +1 -0
  399. package/dist/word/roundtrip/diff.test.js +79 -0
  400. package/dist/word/roundtrip/diff.test.js.map +1 -0
  401. package/dist/word/roundtrip/edits.d.ts +34 -0
  402. package/dist/word/roundtrip/edits.d.ts.map +1 -0
  403. package/dist/word/roundtrip/edits.js +467 -0
  404. package/dist/word/roundtrip/edits.js.map +1 -0
  405. package/dist/word/roundtrip/fixture.test-helper.d.ts +62 -0
  406. package/dist/word/roundtrip/fixture.test-helper.d.ts.map +1 -0
  407. package/dist/word/roundtrip/fixture.test-helper.js +258 -0
  408. package/dist/word/roundtrip/fixture.test-helper.js.map +1 -0
  409. package/dist/word/roundtrip/formats.d.ts +6 -0
  410. package/dist/word/roundtrip/formats.d.ts.map +1 -0
  411. package/dist/word/roundtrip/formats.js +102 -0
  412. package/dist/word/roundtrip/formats.js.map +1 -0
  413. package/dist/word/roundtrip/formatted.test.d.ts +2 -0
  414. package/dist/word/roundtrip/formatted.test.d.ts.map +1 -0
  415. package/dist/word/roundtrip/formatted.test.js +93 -0
  416. package/dist/word/roundtrip/formatted.test.js.map +1 -0
  417. package/dist/word/roundtrip/holders.test.d.ts +2 -0
  418. package/dist/word/roundtrip/holders.test.d.ts.map +1 -0
  419. package/dist/word/roundtrip/holders.test.js +109 -0
  420. package/dist/word/roundtrip/holders.test.js.map +1 -0
  421. package/dist/word/roundtrip/index.d.ts +6 -0
  422. package/dist/word/roundtrip/index.d.ts.map +1 -0
  423. package/dist/word/roundtrip/index.js +9 -0
  424. package/dist/word/roundtrip/index.js.map +1 -0
  425. package/dist/word/roundtrip/markup.d.ts +35 -0
  426. package/dist/word/roundtrip/markup.d.ts.map +1 -0
  427. package/dist/word/roundtrip/markup.js +168 -0
  428. package/dist/word/roundtrip/markup.js.map +1 -0
  429. package/dist/word/roundtrip/math.d.ts +12 -0
  430. package/dist/word/roundtrip/math.d.ts.map +1 -0
  431. package/dist/word/roundtrip/math.js +47 -0
  432. package/dist/word/roundtrip/math.js.map +1 -0
  433. package/dist/word/roundtrip/math.test.d.ts +2 -0
  434. package/dist/word/roundtrip/math.test.d.ts.map +1 -0
  435. package/dist/word/roundtrip/math.test.js +63 -0
  436. package/dist/word/roundtrip/math.test.js.map +1 -0
  437. package/dist/word/roundtrip/merge.d.ts +21 -0
  438. package/dist/word/roundtrip/merge.d.ts.map +1 -0
  439. package/dist/word/roundtrip/merge.js +81 -0
  440. package/dist/word/roundtrip/merge.js.map +1 -0
  441. package/dist/word/roundtrip/paragraphs.test.d.ts +2 -0
  442. package/dist/word/roundtrip/paragraphs.test.d.ts.map +1 -0
  443. package/dist/word/roundtrip/paragraphs.test.js +44 -0
  444. package/dist/word/roundtrip/paragraphs.test.js.map +1 -0
  445. package/dist/word/roundtrip/read.d.ts +60 -0
  446. package/dist/word/roundtrip/read.d.ts.map +1 -0
  447. package/dist/word/roundtrip/read.js +247 -0
  448. package/dist/word/roundtrip/read.js.map +1 -0
  449. package/dist/word/roundtrip/review.test.d.ts +2 -0
  450. package/dist/word/roundtrip/review.test.d.ts.map +1 -0
  451. package/dist/word/roundtrip/review.test.js +76 -0
  452. package/dist/word/roundtrip/review.test.js.map +1 -0
  453. package/dist/word/roundtrip/semantic.test.d.ts +2 -0
  454. package/dist/word/roundtrip/semantic.test.d.ts.map +1 -0
  455. package/dist/word/roundtrip/semantic.test.js +121 -0
  456. package/dist/word/roundtrip/semantic.test.js.map +1 -0
  457. package/dist/word/roundtrip/targets.d.ts +26 -0
  458. package/dist/word/roundtrip/targets.d.ts.map +1 -0
  459. package/dist/word/roundtrip/targets.js +58 -0
  460. package/dist/word/roundtrip/targets.js.map +1 -0
  461. package/dist/word/roundtrip/types.d.ts +46 -0
  462. package/dist/word/roundtrip/types.d.ts.map +1 -0
  463. package/dist/word/roundtrip/types.js +4 -0
  464. package/dist/word/roundtrip/types.js.map +1 -0
  465. package/dist/word/roundtrip/walk.d.ts +66 -0
  466. package/dist/word/roundtrip/walk.d.ts.map +1 -0
  467. package/dist/word/roundtrip/walk.js +328 -0
  468. package/dist/word/roundtrip/walk.js.map +1 -0
  469. package/dist/word/roundtrip/writers.test.d.ts +2 -0
  470. package/dist/word/roundtrip/writers.test.d.ts.map +1 -0
  471. package/dist/word/roundtrip/writers.test.js +51 -0
  472. package/dist/word/roundtrip/writers.test.js.map +1 -0
  473. package/dist/word/semantic/atoms.d.ts +14 -0
  474. package/dist/word/semantic/atoms.d.ts.map +1 -0
  475. package/dist/word/semantic/atoms.js +85 -0
  476. package/dist/word/semantic/atoms.js.map +1 -0
  477. package/dist/word/semantic/blocks.d.ts +39 -0
  478. package/dist/word/semantic/blocks.d.ts.map +1 -0
  479. package/dist/word/semantic/blocks.js +260 -0
  480. package/dist/word/semantic/blocks.js.map +1 -0
  481. package/dist/word/semantic/chapter.d.ts +17 -0
  482. package/dist/word/semantic/chapter.d.ts.map +1 -0
  483. package/dist/word/semantic/chapter.js +56 -0
  484. package/dist/word/semantic/chapter.js.map +1 -0
  485. package/dist/word/semantic/constructs.test.d.ts +2 -0
  486. package/dist/word/semantic/constructs.test.d.ts.map +1 -0
  487. package/dist/word/semantic/constructs.test.js +267 -0
  488. package/dist/word/semantic/constructs.test.js.map +1 -0
  489. package/dist/word/semantic/containers.d.ts +8 -0
  490. package/dist/word/semantic/containers.d.ts.map +1 -0
  491. package/dist/word/semantic/containers.js +141 -0
  492. package/dist/word/semantic/containers.js.map +1 -0
  493. package/dist/word/semantic/context.d.ts +83 -0
  494. package/dist/word/semantic/context.d.ts.map +1 -0
  495. package/dist/word/semantic/context.js +9 -0
  496. package/dist/word/semantic/context.js.map +1 -0
  497. package/dist/word/semantic/corpus.test.d.ts +2 -0
  498. package/dist/word/semantic/corpus.test.d.ts.map +1 -0
  499. package/dist/word/semantic/corpus.test.js +80 -0
  500. package/dist/word/semantic/corpus.test.js.map +1 -0
  501. package/dist/word/semantic/engineNumbers.d.ts +31 -0
  502. package/dist/word/semantic/engineNumbers.d.ts.map +1 -0
  503. package/dist/word/semantic/engineNumbers.js +66 -0
  504. package/dist/word/semantic/engineNumbers.js.map +1 -0
  505. package/dist/word/semantic/figures.d.ts +8 -0
  506. package/dist/word/semantic/figures.d.ts.map +1 -0
  507. package/dist/word/semantic/figures.js +175 -0
  508. package/dist/word/semantic/figures.js.map +1 -0
  509. package/dist/word/semantic/fixtures/harness.d.ts +20 -0
  510. package/dist/word/semantic/fixtures/harness.d.ts.map +1 -0
  511. package/dist/word/semantic/fixtures/harness.js +89 -0
  512. package/dist/word/semantic/fixtures/harness.js.map +1 -0
  513. package/dist/word/semantic/fragments.d.ts +48 -0
  514. package/dist/word/semantic/fragments.d.ts.map +1 -0
  515. package/dist/word/semantic/fragments.js +109 -0
  516. package/dist/word/semantic/fragments.js.map +1 -0
  517. package/dist/word/semantic/index.d.ts +25 -0
  518. package/dist/word/semantic/index.d.ts.map +1 -0
  519. package/dist/word/semantic/index.js +141 -0
  520. package/dist/word/semantic/index.js.map +1 -0
  521. package/dist/word/semantic/inline.d.ts +34 -0
  522. package/dist/word/semantic/inline.d.ts.map +1 -0
  523. package/dist/word/semantic/inline.js +210 -0
  524. package/dist/word/semantic/inline.js.map +1 -0
  525. package/dist/word/semantic/inspect.d.ts +6 -0
  526. package/dist/word/semantic/inspect.d.ts.map +1 -0
  527. package/dist/word/semantic/inspect.js +102 -0
  528. package/dist/word/semantic/inspect.js.map +1 -0
  529. package/dist/word/semantic/marks.d.ts +30 -0
  530. package/dist/word/semantic/marks.d.ts.map +1 -0
  531. package/dist/word/semantic/marks.js +87 -0
  532. package/dist/word/semantic/marks.js.map +1 -0
  533. package/dist/word/semantic/numbering.d.ts +18 -0
  534. package/dist/word/semantic/numbering.d.ts.map +1 -0
  535. package/dist/word/semantic/numbering.js +93 -0
  536. package/dist/word/semantic/numbering.js.map +1 -0
  537. package/dist/word/semantic/numbers.test.d.ts +2 -0
  538. package/dist/word/semantic/numbers.test.d.ts.map +1 -0
  539. package/dist/word/semantic/numbers.test.js +53 -0
  540. package/dist/word/semantic/numbers.test.js.map +1 -0
  541. package/dist/word/semantic/raw.d.ts +8 -0
  542. package/dist/word/semantic/raw.d.ts.map +1 -0
  543. package/dist/word/semantic/raw.js +42 -0
  544. package/dist/word/semantic/raw.js.map +1 -0
  545. package/dist/word/semantic/review.test.d.ts +2 -0
  546. package/dist/word/semantic/review.test.d.ts.map +1 -0
  547. package/dist/word/semantic/review.test.js +88 -0
  548. package/dist/word/semantic/review.test.js.map +1 -0
  549. package/dist/word/semantic/sections.d.ts +25 -0
  550. package/dist/word/semantic/sections.d.ts.map +1 -0
  551. package/dist/word/semantic/sections.js +83 -0
  552. package/dist/word/semantic/sections.js.map +1 -0
  553. package/dist/word/semantic/snippet.d.ts +10 -0
  554. package/dist/word/semantic/snippet.d.ts.map +1 -0
  555. package/dist/word/semantic/snippet.js +34 -0
  556. package/dist/word/semantic/snippet.js.map +1 -0
  557. package/dist/word/semantic/styles.d.ts +66 -0
  558. package/dist/word/semantic/styles.d.ts.map +1 -0
  559. package/dist/word/semantic/styles.js +354 -0
  560. package/dist/word/semantic/styles.js.map +1 -0
  561. package/dist/word/semantic/tables.d.ts +4 -0
  562. package/dist/word/semantic/tables.d.ts.map +1 -0
  563. package/dist/word/semantic/tables.js +114 -0
  564. package/dist/word/semantic/tables.js.map +1 -0
  565. package/dist/word/semantic/types.d.ts +9 -0
  566. package/dist/word/semantic/types.d.ts.map +1 -0
  567. package/dist/word/semantic/types.js +3 -0
  568. package/dist/word/semantic/types.js.map +1 -0
  569. package/dist/word/semantic/wml.d.ts +104 -0
  570. package/dist/word/semantic/wml.d.ts.map +1 -0
  571. package/dist/word/semantic/wml.js +192 -0
  572. package/dist/word/semantic/wml.js.map +1 -0
  573. package/dist/word/word.test.js +31 -53
  574. package/dist/word/word.test.js.map +1 -1
  575. package/dist/word/xml.d.ts +16 -0
  576. package/dist/word/xml.d.ts.map +1 -1
  577. package/dist/word/xml.js +61 -15
  578. package/dist/word/xml.js.map +1 -1
  579. package/dist/word/xml.test.d.ts +2 -0
  580. package/dist/word/xml.test.d.ts.map +1 -0
  581. package/dist/word/xml.test.js +46 -0
  582. package/dist/word/xml.test.js.map +1 -0
  583. package/package.json +1 -1
  584. package/dist/word/toDocx/parse.d.ts +0 -46
  585. package/dist/word/toDocx/parse.d.ts.map +0 -1
  586. package/dist/word/toDocx/parse.js +0 -313
  587. package/dist/word/toDocx/parse.js.map +0 -1
  588. package/dist/word/toDocx/styles.d.ts +0 -63
  589. package/dist/word/toDocx/styles.d.ts.map +0 -1
  590. package/dist/word/toDocx/styles.js +0 -239
  591. package/dist/word/toDocx/styles.js.map +0 -1
  592. package/dist/word/toDocx/wordml.d.ts +0 -24
  593. package/dist/word/toDocx/wordml.d.ts.map +0 -1
  594. package/dist/word/toDocx/wordml.js +0 -114
  595. package/dist/word/toDocx/wordml.js.map +0 -1
  596. package/dist/word/toDocx.d.ts +0 -6
  597. package/dist/word/toDocx.d.ts.map +0 -1
  598. package/dist/word/toDocx.js +0 -157
  599. package/dist/word/toDocx.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review.test.js","sourceRoot":"","sources":["../../../src/word/semantic/review.test.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,2EAA2E;AAC3E,uEAAuE;AACvE,mCAAmC;AAEnC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACtF,MAAM,KAAK,GAAa,EAAE,EAAE,EAAE,IAAI,EAA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CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC5C,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACxD,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAC7G,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mEAAmE,EAAE,KAAK,IAAI,EAAE;QACjF,MAAM,EAAE,GAAG,gDAAgD,CAAC;QAC5D,MAAM,CAAC,GAAG,MAAM,UAAU,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAW,EAAE,CAAC,CAAC;QACtE,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC5C,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,oCAAoC,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { ResolvedConfig } from '../../vdt.js';
2
+ import type { WriterContext } from './context.js';
3
+ import { type Units } from './wml.js';
4
+ export interface PageGeometry {
5
+ widthTw: number;
6
+ heightTw: number;
7
+ margins: {
8
+ top: number;
9
+ right: number;
10
+ bottom: number;
11
+ left: number;
12
+ };
13
+ /** `w:cols` element. */
14
+ cols: string;
15
+ /** Text area width, twips. */
16
+ textTwips: number;
17
+ /** Width of one (the main) column, px. */
18
+ columnPx: number;
19
+ mirror: boolean;
20
+ }
21
+ export declare function pageGeometry(r: ResolvedConfig, u: Units): PageGeometry;
22
+ /** The `w:sectPr` that closes chapter `index` (its headers and footers
23
+ * registered in the context). */
24
+ export declare function sectionXml(ctx: WriterContext, geo: PageGeometry, index: number, title: string | undefined): string;
25
+ //# sourceMappingURL=sections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sections.d.ts","sourceRoot":"","sources":["../../../src/word/semantic/sections.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAgC,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AAEpE,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACtE,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,KAAK,GAAG,YAAY,CAkCtE;AAED;kCACkC;AAClC,wBAAgB,UAAU,CAAC,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAsClH"}
@@ -0,0 +1,83 @@
1
+ // Sections of the semantic .docx (#1390): page size and margins from the
2
+ // config, the column layout (`w:cols`, unequal widths for column-and-a-
3
+ // half), one section per chapter starting on a new (or odd) page, and a
4
+ // running head and page number when the book's design has them.
5
+ import { layoutColumnCount } from '../../defaults/layout.js';
6
+ import { STYLE } from './styles.js';
7
+ import { fieldRuns, pPr, px, textRuns } from './wml.js';
8
+ export function pageGeometry(r, u) {
9
+ const tw = (v) => Math.round((v * 1440) / u.dpi);
10
+ const page = r.page;
11
+ const W = px(u, page.width);
12
+ const H = px(u, page.height);
13
+ const m = { top: px(u, page.margins.top), right: px(u, page.margins.right), bottom: px(u, page.margins.bottom), left: px(u, page.margins.left) };
14
+ const text = Math.max(1, W - m.left - m.right);
15
+ const gutter = px(u, r.layout.gutterWidth);
16
+ let cols = '<w:cols w:space="720"/>';
17
+ let columnPx = text;
18
+ const type = r.layout.layoutType;
19
+ if (type === 'double' || type === 'multiple') {
20
+ const n = type === 'double' ? 2 : Math.max(1, layoutColumnCount(r.layout));
21
+ if (n > 1) {
22
+ columnPx = (text - gutter * (n - 1)) / n;
23
+ cols = `<w:cols w:num="${n}" w:space="${tw(gutter)}"/>`;
24
+ }
25
+ }
26
+ else if (type === 'oneAndHalf') {
27
+ const side = Math.max(1, ((text - gutter) * Math.min(99, Math.max(1, r.layout.sideColumnPercent))) / 100);
28
+ const main = Math.max(1, text - gutter - side);
29
+ columnPx = main;
30
+ const sideFirst = r.layout.sideColumnSide === 'left' || r.layout.sideColumnSide === 'inner';
31
+ const [a, b] = sideFirst ? [side, main] : [main, side];
32
+ cols = `<w:cols w:num="2" w:equalWidth="0" w:space="${tw(gutter)}"><w:col w:w="${tw(a)}" w:space="${tw(gutter)}"/><w:col w:w="${tw(b)}"/></w:cols>`;
33
+ }
34
+ return {
35
+ widthTw: tw(W),
36
+ heightTw: tw(H),
37
+ margins: { top: tw(m.top), right: tw(m.right), bottom: tw(m.bottom), left: tw(m.left) },
38
+ cols,
39
+ textTwips: tw(text),
40
+ columnPx,
41
+ mirror: !!page.margins.mirror,
42
+ };
43
+ }
44
+ /** The `w:sectPr` that closes chapter `index` (its headers and footers
45
+ * registered in the context). */
46
+ export function sectionXml(ctx, geo, index, title) {
47
+ const r = ctx.resolved;
48
+ const level1 = r.headings.levels.find((l) => l.level === 1);
49
+ const titlePg = !!level1?.breakBefore.enabled;
50
+ let refs = '';
51
+ if (r.header.elements.length) {
52
+ const id = `h${index}`;
53
+ ctx.headers[id] = `<w:p>${pPr({ style: STYLE.header })}${textRuns(title ?? '', '')}</w:p>`;
54
+ refs += `<w:headerReference w:type="default" r:id="${ctx.pkg.headerRel(id)}"/>`;
55
+ if (titlePg) {
56
+ ctx.headers.first = `<w:p>${pPr({ style: STYLE.header })}</w:p>`;
57
+ refs += `<w:headerReference w:type="first" r:id="${ctx.pkg.headerRel('first')}"/>`;
58
+ }
59
+ }
60
+ if (r.footer.elements.length) {
61
+ ctx.footers.page = `<w:p>${pPr({ style: STYLE.footer })}${fieldRuns('PAGE', '1')}</w:p>`;
62
+ refs += `<w:footerReference w:type="default" r:id="${ctx.pkg.footerRel('page')}"/>`;
63
+ if (titlePg) {
64
+ ctx.footers.first = `<w:p>${pPr({ style: STYLE.footer })}</w:p>`;
65
+ refs += `<w:footerReference w:type="first" r:id="${ctx.pkg.footerRel('first')}"/>`;
66
+ }
67
+ }
68
+ const parity = level1?.breakBefore.parity ?? 'any';
69
+ const start = index === 0 ? '' : `<w:type w:val="${parity === 'odd' || parity === 'always-odd' ? 'oddPage' : parity === 'even' || parity === 'always-even' ? 'evenPage' : 'nextPage'}"/>`;
70
+ const orient = geo.widthTw > geo.heightTw ? ' w:orient="landscape"' : '';
71
+ const m = geo.margins;
72
+ const header = Math.round(m.top / 2);
73
+ const footer = Math.round(m.bottom / 2);
74
+ return (`<w:sectPr>${refs}${start}` +
75
+ `<w:pgSz w:w="${geo.widthTw}" w:h="${geo.heightTw}"${orient}/>` +
76
+ `<w:pgMar w:top="${m.top}" w:right="${m.right}" w:bottom="${m.bottom}" w:left="${m.left}" w:header="${header}" w:footer="${footer}" w:gutter="0"/>` +
77
+ geo.cols +
78
+ (titlePg && refs ? '<w:titlePg/>' : '') +
79
+ (r.layout.writingMode === 'vertical-rl' ? '<w:textDirection w:val="tbRl"/>' : '') +
80
+ (r.direction === 'rtl' ? '<w:bidi/>' : '') +
81
+ '<w:docGrid w:linePitch="360"/></w:sectPr>');
82
+ }
83
+ //# sourceMappingURL=sections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sections.js","sourceRoot":"","sources":["../../../src/word/semantic/sections.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wEAAwE;AACxE,wEAAwE;AACxE,gEAAgE;AAGhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAc,MAAM,UAAU,CAAC;AAepE,MAAM,UAAU,YAAY,CAAC,CAAiB,EAAE,CAAQ;IACtD,MAAM,EAAE,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACjE,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC;IACpB,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7B,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI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AC,EAAE,CAAC;QACvC,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,EAAE,CAAC;QACjF,CAAC,CAAC,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,2CAA2C,CAC5C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { FragmentTarget } from '../anchors/types.js';
2
+ import { type WriterContext } from './context.js';
3
+ /**
4
+ * The runs of a snippet wrapped in its fragment's bookmark. `content` is
5
+ * the text as written; `base` its offset in `src` (the chapter Markdown
6
+ * for a figure's own words, 0 for a resource field, where `src` is the
7
+ * field itself).
8
+ */
9
+ export declare function snippetRuns(ctx: WriterContext, content: string, src: string, base: number, target: FragmentTarget, role: string): string;
10
+ //# sourceMappingURL=snippet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snippet.d.ts","sourceRoot":"","sources":["../../../src/word/semantic/snippet.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAK3D;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAgBxI"}
@@ -0,0 +1,34 @@
1
+ // Inline Markdown held outside the chapter text (#1390): a resource's
2
+ // caption, note and table cells, or a figure's own caption in the
3
+ // chapter. Parsed with the engine's snippet parser and mapped to the
4
+ // field it came from (or to the chapter, for a figure's own words).
5
+ import { mapInlineSnippet } from '../../parse/inlineSnippet.js';
6
+ import { blockId } from './context.js';
7
+ import { renderInline } from './inline.js';
8
+ const INLINE_CODE = /(?<!\\)`([^`\n]+?)`/g;
9
+ /**
10
+ * The runs of a snippet wrapped in its fragment's bookmark. `content` is
11
+ * the text as written; `base` its offset in `src` (the chapter Markdown
12
+ * for a figure's own words, 0 for a resource field, where `src` is the
13
+ * field itself).
14
+ */
15
+ export function snippetRuns(ctx, content, src, base, target, role) {
16
+ if (!content.trim())
17
+ return '';
18
+ const m = mapInlineSnippet(content);
19
+ const inlineCode = [];
20
+ INLINE_CODE.lastIndex = 0;
21
+ for (let x = INLINE_CODE.exec(content); x; x = INLINE_CODE.exec(content))
22
+ inlineCode.push({ start: base + x.index + 1, end: base + x.index + 1 + x[1].length });
23
+ const { xml, frag } = renderInline(ctx, {
24
+ text: m.text,
25
+ spans: m.spans,
26
+ sourceMap: m.sourceMap.map((o) => (o < 0 ? -1 : o + base)),
27
+ src,
28
+ toSrc: (o) => o + base,
29
+ end: base + content.length,
30
+ inlineCode,
31
+ });
32
+ return ctx.log.wrap(xml, frag, { block: blockId(ctx), target, range: [base, base + content.length], role });
33
+ }
34
+ //# sourceMappingURL=snippet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snippet.js","sourceRoot":"","sources":["../../../src/word/semantic/snippet.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,kEAAkE;AAClE,qEAAqE;AACrE,oEAAoE;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAsB,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,GAAkB,EAAE,OAAe,EAAE,GAAW,EAAE,IAAY,EAAE,MAAsB,EAAE,IAAY;IAC9H,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,CAAC;IAC/B,MAAM,CAAC,GAAG,gBAAg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
+ import type { ResolvedCalloutStyleConfig } from '../../types.js';
3
+ import type { WordFontPlan } from '../fonts/types.js';
4
+ import { type RunProps, type Units } from './wml.js';
5
+ /** Style ids the writer uses by name. */
6
+ export declare const STYLE: {
7
+ readonly normal: "Normal";
8
+ readonly quote: "Quote";
9
+ readonly caption: "Caption";
10
+ readonly list: "ListParagraph";
11
+ readonly footnoteText: "FootnoteText";
12
+ readonly footnoteRef: "FootnoteReference";
13
+ readonly hyperlink: "Hyperlink";
14
+ readonly header: "Header";
15
+ readonly footer: "Footer";
16
+ readonly source: "PostextSource";
17
+ readonly sourceChar: "PostextSourceChar";
18
+ readonly reference: "PostextReference";
19
+ readonly mark: "PostextMark";
20
+ readonly chip: "PostextChip";
21
+ readonly code: "PostextCode";
22
+ readonly codeChar: "PostextCodeChar";
23
+ readonly math: "PostextEquation";
24
+ readonly figure: "PostextFigure";
25
+ readonly verse: "PostextVerse";
26
+ readonly part: "PostextPart";
27
+ readonly boxTitle: "PostextBoxTitle";
28
+ };
29
+ export declare class StyleRegistry {
30
+ readonly resolved: ResolvedConfig;
31
+ private readonly units;
32
+ private readonly plan?;
33
+ private readonly defs;
34
+ private readonly byKey;
35
+ readonly bodyPx: number;
36
+ constructor(resolved: ResolvedConfig, units: Units, plan?: WordFontPlan | undefined);
37
+ /** Font of a family stack at a weight/style, through the font plan. */
38
+ font(stack: string | undefined, weight?: number, italic?: boolean): RunProps;
39
+ private add;
40
+ /** A unique style id for a key (config ids may collide once slugged). */
41
+ private idFor;
42
+ private builtins;
43
+ /** A paragraph style for table header cells: their bold and italic go
44
+ * in a style, not on the runs, so the importer does not read them as
45
+ * emphasis the user added. */
46
+ tableHeader(bold: boolean, italic: boolean): string;
47
+ private headingProps;
48
+ private headingLevel;
49
+ /** The style of a heading: its level's, or the named heading style's
50
+ * (a style per name and level, based on the level's). */
51
+ heading(level: number, styleName?: string): string;
52
+ /** The Word style of a named paragraph style (`:::paragraphs{style}`). */
53
+ paragraphStyle(name: string): string | undefined;
54
+ private paragraphDef;
55
+ /** The box style named by a callout's `type`. */
56
+ callout(type: string | undefined): ResolvedCalloutStyleConfig | undefined;
57
+ /** Body and title paragraph styles of a box style. */
58
+ calloutStyles(style: ResolvedCalloutStyleConfig | undefined): {
59
+ body: string;
60
+ title: string;
61
+ };
62
+ docDefaults(lang: string | undefined): string;
63
+ /** The `w:style` elements (after `w:docDefaults`). */
64
+ xml(): string;
65
+ }
66
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/word/semantic/styles.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,0BAA0B,EAAuE,MAAM,gBAAgB,CAAC;AAEtI,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,EAAqE,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AAExH,yCAAyC;AACzC,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;CAsBR,CAAC;AAkBX,qBAAa,aAAa;IAMtB,QAAQ,CAAC,QAAQ,EAAE,cAAc;IACjC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;IAPxB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA+B;IACpD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA6B;IACnD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAGb,QAAQ,EAAE,cAAc,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,CAAC,EAAE,YAAY,YAAA;IAMtC,uEAAuE;IACvE,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,SAAM,EAAE,MAAM,UAAQ,GAAG,QAAQ;IAQvE,OAAO,CAAC,GAAG;IAKX,yEAAyE;IACzE,OAAO,CAAC,KAAK;IASb,OAAO,CAAC,QAAQ;IAmGhB;;mCAE+B;IAC/B,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM;IAMnD,OAAO,CAAC,YAAY;IA0BpB,OAAO,CAAC,YAAY;IAMpB;8DAC0D;IAC1D,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM;IAkBlD,0EAA0E;IAC1E,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAQhD,OAAO,CAAC,YAAY;IA2BpB,iDAAiD;IACjD,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,0BAA0B,GAAG,SAAS;IAKzE,sDAAsD;IACtD,aAAa,CAAC,KAAK,EAAE,0BAA0B,GAAG,SAAS,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;IAgD7F,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM;IAK7C,sDAAsD;IACtD,GAAG,IAAI,MAAM;CAed"}
@@ -0,0 +1,354 @@
1
+ // styles.xml of the semantic .docx (#1390): the book's design read from the
2
+ // resolved config — body text, heading levels and named heading styles,
3
+ // paragraph styles, box styles, quotes, captions, code, footnotes — as
4
+ // Word styles, with the real font families of the font plan when the
5
+ // export embeds fonts.
6
+ import { resolvedCodeStyle } from '../../defaults/text/codeStyle.js';
7
+ import { wordFontFor } from '../fonts/plan.js';
8
+ import { escapeAttr } from '../xml.js';
9
+ import { firstFamily, halfPoints, hex, pPr, px, rPr, twips } from './wml.js';
10
+ /** Style ids the writer uses by name. */
11
+ export const STYLE = {
12
+ normal: 'Normal',
13
+ quote: 'Quote',
14
+ caption: 'Caption',
15
+ list: 'ListParagraph',
16
+ footnoteText: 'FootnoteText',
17
+ footnoteRef: 'FootnoteReference',
18
+ hyperlink: 'Hyperlink',
19
+ header: 'Header',
20
+ footer: 'Footer',
21
+ source: 'PostextSource',
22
+ sourceChar: 'PostextSourceChar',
23
+ reference: 'PostextReference',
24
+ mark: 'PostextMark',
25
+ chip: 'PostextChip',
26
+ code: 'PostextCode',
27
+ codeChar: 'PostextCodeChar',
28
+ math: 'PostextEquation',
29
+ figure: 'PostextFigure',
30
+ verse: 'PostextVerse',
31
+ part: 'PostextPart',
32
+ boxTitle: 'PostextBoxTitle',
33
+ };
34
+ const JC = { left: 'left', justify: 'both', center: 'center', right: 'right' };
35
+ const slug = (s) => s.replace(/[^A-Za-z0-9]/g, '') || 'X';
36
+ export class StyleRegistry {
37
+ resolved;
38
+ units;
39
+ plan;
40
+ defs = new Map();
41
+ byKey = new Map();
42
+ bodyPx;
43
+ constructor(resolved, units, plan) {
44
+ this.resolved = resolved;
45
+ this.units = units;
46
+ this.plan = plan;
47
+ this.bodyPx = units.basePx;
48
+ this.builtins();
49
+ }
50
+ /** Font of a family stack at a weight/style, through the font plan. */
51
+ font(stack, weight = 400, italic = false) {
52
+ const family = firstFamily(stack);
53
+ if (!family)
54
+ return {};
55
+ if (!this.plan)
56
+ return { font: family, ...(weight >= 600 ? { b: true } : {}), ...(italic ? { i: true } : {}) };
57
+ const ref = wordFontFor(this.plan, `${italic ? 'italic ' : ''}${weight} 16px "${family}"`);
58
+ return { font: ref.family, ...(ref.bold ? { b: true } : {}), ...(ref.italic ? { i: true } : {}) };
59
+ }
60
+ add(id, def) {
61
+ if (!this.defs.has(id))
62
+ this.defs.set(id, def);
63
+ return id;
64
+ }
65
+ /** A unique style id for a key (config ids may collide once slugged). */
66
+ idFor(key, prefix, name) {
67
+ const known = this.byKey.get(key);
68
+ if (known)
69
+ return { id: known, fresh: false };
70
+ let id = prefix + slug(name);
71
+ for (let n = 2; this.defs.has(id); n++)
72
+ id = `${prefix}${slug(name)}${n}`;
73
+ this.byKey.set(key, id);
74
+ return { id, fresh: true };
75
+ }
76
+ builtins() {
77
+ const r = this.resolved;
78
+ const u = this.units;
79
+ const body = r.bodyText;
80
+ const bodyPx = px(u, body.fontSize);
81
+ const line = twips(u, body.lineHeight, bodyPx);
82
+ const after = body.paragraphSpacing === false ? 0 : body.paragraphSpacing === true ? line : twips(u, body.paragraphSpacing, bodyPx);
83
+ this.add(STYLE.normal, {
84
+ type: 'paragraph',
85
+ name: 'Normal',
86
+ isDefault: true,
87
+ pPr: {
88
+ before: 0,
89
+ after,
90
+ line: { twips: line, rule: 'atLeast' },
91
+ ind: { firstLine: twips(u, body.firstLineIndent, bodyPx) },
92
+ jc: JC[body.textAlign],
93
+ bidi: r.direction === 'rtl' || undefined,
94
+ },
95
+ rPr: { ...this.font(body.fontFamily, body.fontWeight), color: hex(body.color), sz: halfPoints(u, body.fontSize) },
96
+ });
97
+ for (const level of r.headings.levels)
98
+ this.headingLevel(level);
99
+ const bq = body.blockquote;
100
+ this.add(STYLE.quote, {
101
+ type: 'paragraph',
102
+ name: 'Quote',
103
+ basedOn: STYLE.normal,
104
+ pPr: { ind: { left: twips(u, bq.indent, bodyPx), right: twips(u, bq.indent, bodyPx), firstLine: bq.firstLineIndent ? twips(u, bq.firstLineIndent, bodyPx) : undefined } },
105
+ rPr: { i: bq.italic, color: hex(bq.color) },
106
+ });
107
+ const cap = r.captionStyle;
108
+ this.add(STYLE.caption, {
109
+ type: 'paragraph',
110
+ name: 'caption',
111
+ basedOn: STYLE.normal,
112
+ next: STYLE.normal,
113
+ pPr: { before: twips(u, cap.gap, px(u, cap.fontSize)), ind: { firstLine: 0 }, jc: JC[cap.align] },
114
+ rPr: { ...this.font(cap.fontFamily), color: hex(cap.color), sz: halfPoints(u, cap.fontSize) },
115
+ });
116
+ const lists = r.unorderedLists;
117
+ this.add(STYLE.list, {
118
+ type: 'paragraph',
119
+ name: 'List Paragraph',
120
+ basedOn: STYLE.normal,
121
+ pPr: { after: twips(u, lists.itemSpacing, bodyPx), contextualSpacing: true, ind: { firstLine: 0 } },
122
+ });
123
+ const fn = r.footnotes;
124
+ const fnPx = px(u, fn.fontSize);
125
+ this.add(STYLE.footnoteText, {
126
+ type: 'paragraph',
127
+ name: 'footnote text',
128
+ basedOn: STYLE.normal,
129
+ pPr: { after: twips(u, fn.spaceBetween, fnPx), line: { twips: twips(u, fn.lineHeight, fnPx), rule: 'atLeast' }, ind: { firstLine: 0 }, jc: fn.textAlign ? JC[fn.textAlign] : undefined },
130
+ rPr: { color: hex(fn.color), sz: halfPoints(u, fn.fontSize) },
131
+ });
132
+ this.add(STYLE.footnoteRef, { type: 'character', name: 'footnote reference', rPr: { vertAlign: 'superscript' } });
133
+ this.add(STYLE.hyperlink, { type: 'character', name: 'Hyperlink', rPr: { color: hex(body.referenceColor), u: true } });
134
+ const small = { sz: Math.max(2, Math.round(halfPoints(u, body.fontSize) * 0.85)) };
135
+ this.add(STYLE.header, { type: 'paragraph', name: 'header', basedOn: STYLE.normal, pPr: { ind: { firstLine: 0 }, jc: 'center' }, rPr: small });
136
+ this.add(STYLE.footer, { type: 'paragraph', name: 'footer', basedOn: STYLE.normal, pPr: { ind: { firstLine: 0 }, jc: 'center' }, rPr: small });
137
+ const mono = { font: 'Consolas' };
138
+ this.add(STYLE.source, {
139
+ type: 'paragraph',
140
+ name: 'Postext Source',
141
+ custom: true,
142
+ basedOn: STYLE.normal,
143
+ pPr: { shd: 'EDEDED', before: 0, after: 0, line: { twips: 240, rule: 'auto' }, ind: { firstLine: 0 }, jc: 'left' },
144
+ rPr: { ...mono, color: '595959', sz: Math.max(16, small.sz) },
145
+ });
146
+ this.add(STYLE.sourceChar, { type: 'character', name: 'Postext Source Char', custom: true, rPr: { ...mono, color: '595959', shd: 'EDEDED' } });
147
+ this.add(STYLE.reference, { type: 'character', name: 'Postext Reference', custom: true, rPr: { color: hex(body.referenceColor), b: body.referenceBold || undefined, i: body.referenceItalic || undefined } });
148
+ this.add(STYLE.mark, { type: 'character', name: 'Postext Mark', custom: true, rPr: { highlight: 'yellow' } });
149
+ this.add(STYLE.chip, { type: 'character', name: 'Postext Chip', custom: true, rPr: { shd: 'E7E6E6' } });
150
+ const code = resolvedCodeStyle(r);
151
+ const codePx = px(u, code.fontSize, bodyPx);
152
+ this.add(STYLE.code, {
153
+ type: 'paragraph',
154
+ name: 'Postext Code',
155
+ custom: true,
156
+ basedOn: STYLE.normal,
157
+ pPr: {
158
+ shd: code.backgroundEnabled ? hex(code.background) : undefined,
159
+ before: twips(u, code.marginTop, bodyPx),
160
+ after: twips(u, code.marginBottom, bodyPx),
161
+ line: code.lineHeight ? { twips: twips(u, code.lineHeight, codePx), rule: 'atLeast' } : undefined,
162
+ ind: { firstLine: 0 },
163
+ jc: 'left',
164
+ },
165
+ rPr: { ...this.font(code.fontFamily, code.fontWeight), color: hex(code.color), sz: halfPoints(u, code.fontSize, bodyPx) },
166
+ });
167
+ const inline = code.inline;
168
+ this.add(STYLE.codeChar, { type: 'character', name: 'Postext Code Char', custom: true, rPr: { ...this.font(inline ? code.fontFamily : undefined), ...(inline ? {} : { font: firstFamily(code.fontFamily) }) } });
169
+ this.add(STYLE.math, { type: 'paragraph', name: 'Postext Equation', custom: true, basedOn: STYLE.normal, pPr: { ind: { firstLine: 0 }, jc: 'center' } });
170
+ this.add(STYLE.figure, { type: 'paragraph', name: 'Postext Figure', custom: true, basedOn: STYLE.normal, pPr: { keepNext: true, ind: { firstLine: 0 }, jc: 'center' } });
171
+ this.add(STYLE.verse, { type: 'paragraph', name: 'Postext Verse', custom: true, basedOn: STYLE.normal, pPr: { ind: { left: twips(u, bq.indent, bodyPx), firstLine: 0 }, jc: 'left' } });
172
+ this.add(STYLE.part, { type: 'paragraph', name: 'Postext Part', custom: true, basedOn: STYLE.normal, pPr: { pageBreakBefore: true, keepNext: true, ind: { firstLine: 0 }, jc: 'center', outlineLvl: 0 }, rPr: { b: true, sz: halfPoints(u, body.fontSize) * 2 } });
173
+ this.add(STYLE.boxTitle, { type: 'paragraph', name: 'Postext Box Title', custom: true, basedOn: STYLE.normal, pPr: { keepNext: true, ind: { firstLine: 0 } }, rPr: { b: true } });
174
+ }
175
+ /** A paragraph style for table header cells: their bold and italic go
176
+ * in a style, not on the runs, so the importer does not read them as
177
+ * emphasis the user added. */
178
+ tableHeader(bold, italic) {
179
+ const { id, fresh } = this.idFor(`th:${bold ? 'b' : ''}${italic ? 'i' : ''}`, 'PostextTableHeader', `${bold ? 'B' : ''}${italic ? 'I' : ''}`);
180
+ if (fresh)
181
+ this.add(id, { type: 'paragraph', name: `Postext Table Header${id.slice('PostextTableHeader'.length)}`, custom: true, basedOn: STYLE.normal, rPr: { b: bold || undefined, i: italic || undefined } });
182
+ return id;
183
+ }
184
+ headingProps(level, align) {
185
+ const u = this.units;
186
+ const size = px(u, level.fontSize, this.bodyPx);
187
+ return {
188
+ pPr: {
189
+ keepNext: true,
190
+ keepLines: true,
191
+ before: twips(u, level.marginTop, size),
192
+ after: twips(u, level.marginBottom, size),
193
+ line: { twips: twips(u, level.lineHeight, size), rule: 'atLeast' },
194
+ ind: { left: level.indent ? twips(u, level.indent, size) : undefined, firstLine: level.firstLineIndent ? twips(u, level.firstLineIndent, size) : 0 },
195
+ jc: JC[align],
196
+ outlineLvl: Math.min(8, Math.max(0, level.level - 1)),
197
+ },
198
+ rPr: {
199
+ ...this.font(level.fontFamily, level.fontWeight, level.italic),
200
+ b: level.fontWeight >= 600,
201
+ i: level.italic,
202
+ caps: level.textTransform === 'uppercase' || undefined,
203
+ color: hex(level.color),
204
+ spacing: level.letterSpacing.value ? twips(u, level.letterSpacing, size) : undefined,
205
+ sz: halfPoints(u, level.fontSize, this.bodyPx),
206
+ },
207
+ };
208
+ }
209
+ headingLevel(level) {
210
+ if (level.level < 1 || level.level > 6)
211
+ return;
212
+ const { pPr: p, rPr: r } = this.headingProps(level, this.resolved.headings.textAlign);
213
+ this.add(`Heading${level.level}`, { type: 'paragraph', name: `heading ${level.level}`, basedOn: STYLE.normal, next: STYLE.normal, pPr: p, rPr: r });
214
+ }
215
+ /** The style of a heading: its level's, or the named heading style's
216
+ * (a style per name and level, based on the level's). */
217
+ heading(level, styleName) {
218
+ const lv = Math.min(6, Math.max(1, level));
219
+ const base = `Heading${lv}`;
220
+ if (!styleName)
221
+ return base;
222
+ const hs = this.resolved.headingStyles.find((s) => s.id === styleName || s.name === styleName);
223
+ if (!hs)
224
+ return base;
225
+ const { id, fresh } = this.idFor(`heading:${hs.id}:${lv}`, 'PostextHeading', `${hs.id}${lv}`);
226
+ if (fresh) {
227
+ const levelConfig = this.resolved.headings.levels.find((l) => l.level === lv);
228
+ if (levelConfig) {
229
+ const merged = { ...levelConfig, ...hs.overrides };
230
+ const { pPr: p, rPr: r } = this.headingProps(merged, this.resolved.headings.textAlign);
231
+ this.add(id, { type: 'paragraph', name: `Heading ${lv}: ${hs.name || hs.id}`, custom: true, basedOn: base, next: STYLE.normal, pPr: p, rPr: r });
232
+ }
233
+ else
234
+ this.add(id, { type: 'paragraph', name: `Heading ${lv}: ${hs.name || hs.id}`, custom: true, basedOn: base });
235
+ }
236
+ return id;
237
+ }
238
+ /** The Word style of a named paragraph style (`:::paragraphs{style}`). */
239
+ paragraphStyle(name) {
240
+ const ps = this.resolved.paragraphStyles.find((s) => s.id === name || s.name === name);
241
+ if (!ps)
242
+ return undefined;
243
+ const { id, fresh } = this.idFor(`para:${ps.id}`, 'PostextPara', ps.id);
244
+ if (fresh)
245
+ this.add(id, this.paragraphDef(ps));
246
+ return id;
247
+ }
248
+ paragraphDef(ps) {
249
+ const u = this.units;
250
+ const size = px(u, ps.fontSize, this.bodyPx);
251
+ return {
252
+ type: 'paragraph',
253
+ name: ps.name || ps.id,
254
+ custom: true,
255
+ basedOn: STYLE.normal,
256
+ pPr: {
257
+ before: twips(u, ps.marginTop, size),
258
+ after: twips(u, ps.spaceBetween, size),
259
+ line: { twips: twips(u, ps.lineHeight, size), rule: 'atLeast' },
260
+ ind: { left: twips(u, ps.indent, size), right: ps.endIndent ? twips(u, ps.endIndent, size) : undefined, firstLine: twips(u, ps.firstLineIndent, size), hanging: twips(u, ps.hangingIndent, size) || undefined },
261
+ jc: JC[ps.textAlign],
262
+ },
263
+ rPr: {
264
+ ...this.font(ps.fontFamily, ps.fontWeight, ps.italic),
265
+ i: ps.italic,
266
+ smallCaps: ps.smallCaps || undefined,
267
+ caps: ps.textTransform === 'uppercase' || undefined,
268
+ color: hex(ps.color),
269
+ spacing: ps.letterSpacing ? twips(u, ps.letterSpacing, size) : undefined,
270
+ sz: halfPoints(u, ps.fontSize, this.bodyPx),
271
+ },
272
+ };
273
+ }
274
+ /** The box style named by a callout's `type`. */
275
+ callout(type) {
276
+ const styles = this.resolved.calloutStyles;
277
+ return styles.find((s) => s.id === type) ?? styles.find((s) => s.name === type) ?? (type ? undefined : styles[0]);
278
+ }
279
+ /** Body and title paragraph styles of a box style. */
280
+ calloutStyles(style) {
281
+ if (!style)
282
+ return { body: STYLE.normal, title: STYLE.boxTitle };
283
+ const u = this.units;
284
+ const b = style.body;
285
+ const t = style.titleStyle;
286
+ const body = this.idFor(`box:${style.id}`, 'PostextBox', style.id);
287
+ if (body.fresh) {
288
+ const size = px(u, b.fontSize, this.bodyPx);
289
+ const after = b.paragraphSpacing === false ? 0 : b.paragraphSpacing === true ? twips(u, b.lineHeight, size) : twips(u, b.paragraphSpacing, size);
290
+ this.add(body.id, {
291
+ type: 'paragraph',
292
+ name: `Box: ${style.name || style.id}`,
293
+ custom: true,
294
+ basedOn: STYLE.normal,
295
+ pPr: { after, line: { twips: twips(u, b.lineHeight, size), rule: 'atLeast' }, ind: { firstLine: twips(u, b.firstLineIndent, size) }, jc: b.textAlign === 'justify' ? 'both' : 'left' },
296
+ rPr: {
297
+ ...this.font(b.fontFamily, b.fontWeight, b.italic),
298
+ i: b.italic,
299
+ smallCaps: b.smallCaps || undefined,
300
+ color: hex(b.color),
301
+ spacing: b.letterSpacing ? twips(u, b.letterSpacing, size) : undefined,
302
+ sz: halfPoints(u, b.fontSize, this.bodyPx),
303
+ },
304
+ });
305
+ }
306
+ const title = this.idFor(`boxTitle:${style.id}`, 'PostextBoxTitle', style.id);
307
+ if (title.fresh) {
308
+ const size = px(u, t.fontSize, this.bodyPx);
309
+ this.add(title.id, {
310
+ type: 'paragraph',
311
+ name: `Box title: ${style.name || style.id}`,
312
+ custom: true,
313
+ basedOn: STYLE.boxTitle,
314
+ pPr: { after: twips(u, t.gap, size), line: { twips: twips(u, t.lineHeight, size), rule: 'atLeast' }, ind: { left: twips(u, t.indent, size), firstLine: 0 } },
315
+ rPr: {
316
+ ...this.font(t.fontFamily, t.fontWeight, t.italic),
317
+ b: t.fontWeight >= 600,
318
+ i: t.italic,
319
+ caps: t.textTransform === 'uppercase' || undefined,
320
+ color: hex(t.color),
321
+ spacing: t.letterSpacing.value ? twips(u, t.letterSpacing, size) : undefined,
322
+ sz: halfPoints(u, t.fontSize, this.bodyPx),
323
+ },
324
+ });
325
+ }
326
+ return { body: body.id, title: title.id };
327
+ }
328
+ docDefaults(lang) {
329
+ const l = lang ? `<w:lang w:val="${escapeAttr(lang)}" w:eastAsia="${escapeAttr(lang)}" w:bidi="${escapeAttr(lang)}"/>` : '';
330
+ return `<w:docDefaults><w:rPrDefault><w:rPr>${l}</w:rPr></w:rPrDefault><w:pPrDefault><w:pPr/></w:pPrDefault></w:docDefaults>`;
331
+ }
332
+ /** The `w:style` elements (after `w:docDefaults`). */
333
+ xml() {
334
+ let out = '';
335
+ for (const [id, d] of this.defs) {
336
+ const attrs = `w:type="${d.type}"${d.isDefault ? ' w:default="1"' : ''} w:styleId="${escapeAttr(id)}"${d.custom ? ' w:customStyle="1"' : ''}`;
337
+ let inner = `<w:name w:val="${escapeAttr(d.name)}"/>`;
338
+ if (d.basedOn)
339
+ inner += `<w:basedOn w:val="${d.basedOn}"/>`;
340
+ if (d.next)
341
+ inner += `<w:next w:val="${d.next}"/>`;
342
+ if (d.semiHidden)
343
+ inner += '<w:semiHidden/>';
344
+ inner += '<w:qFormat/>';
345
+ if (d.type === 'paragraph' && d.pPr)
346
+ inner += pPr(d.pPr);
347
+ if (d.rPr)
348
+ inner += rPr(d.rPr);
349
+ out += `<w:style ${attrs}>${inner}</w:style>`;
350
+ }
351
+ return out;
352
+ }
353
+ }
354
+ //# sourceMappingURL=styles.js.map