postext 1.15.1 → 1.16.1

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 (457) hide show
  1. package/dist/__tests__/arabic/harakatProfile.test.d.ts +2 -0
  2. package/dist/__tests__/arabic/harakatProfile.test.d.ts.map +1 -0
  3. package/dist/__tests__/arabic/harakatProfile.test.js +105 -0
  4. package/dist/__tests__/arabic/harakatProfile.test.js.map +1 -0
  5. package/dist/__tests__/bundleLocaleAndBytes.test.js +9 -9
  6. package/dist/__tests__/bundleLocaleAndBytes.test.js.map +1 -1
  7. package/dist/__tests__/chineseLocale.test.js +10 -5
  8. package/dist/__tests__/chineseLocale.test.js.map +1 -1
  9. package/dist/__tests__/cjk/annotationsRender.test.js +5 -2
  10. package/dist/__tests__/cjk/annotationsRender.test.js.map +1 -1
  11. package/dist/__tests__/cjk/chipLatinSpacing.test.d.ts +2 -0
  12. package/dist/__tests__/cjk/chipLatinSpacing.test.d.ts.map +1 -0
  13. package/dist/__tests__/cjk/chipLatinSpacing.test.js +137 -0
  14. package/dist/__tests__/cjk/chipLatinSpacing.test.js.map +1 -0
  15. package/dist/__tests__/cjk/chipTracking.test.d.ts +2 -0
  16. package/dist/__tests__/cjk/chipTracking.test.d.ts.map +1 -0
  17. package/dist/__tests__/cjk/chipTracking.test.js +56 -0
  18. package/dist/__tests__/cjk/chipTracking.test.js.map +1 -0
  19. package/dist/__tests__/cjk/japaneseHtml.test.d.ts +2 -0
  20. package/dist/__tests__/cjk/japaneseHtml.test.d.ts.map +1 -0
  21. package/dist/__tests__/cjk/japaneseHtml.test.js +163 -0
  22. package/dist/__tests__/cjk/japaneseHtml.test.js.map +1 -0
  23. package/dist/__tests__/cjk/japaneseMarks.test.d.ts +2 -0
  24. package/dist/__tests__/cjk/japaneseMarks.test.d.ts.map +1 -0
  25. package/dist/__tests__/cjk/japaneseMarks.test.js +289 -0
  26. package/dist/__tests__/cjk/japaneseMarks.test.js.map +1 -0
  27. package/dist/__tests__/cjk/japaneseMarksRender.test.d.ts +2 -0
  28. package/dist/__tests__/cjk/japaneseMarksRender.test.d.ts.map +1 -0
  29. package/dist/__tests__/cjk/japaneseMarksRender.test.js +161 -0
  30. package/dist/__tests__/cjk/japaneseMarksRender.test.js.map +1 -0
  31. package/dist/__tests__/cjk/japaneseRuby.test.d.ts +2 -0
  32. package/dist/__tests__/cjk/japaneseRuby.test.d.ts.map +1 -0
  33. package/dist/__tests__/cjk/japaneseRuby.test.js +457 -0
  34. package/dist/__tests__/cjk/japaneseRuby.test.js.map +1 -0
  35. package/dist/__tests__/cjk/japaneseSegmentLanguage.test.d.ts +2 -0
  36. package/dist/__tests__/cjk/japaneseSegmentLanguage.test.d.ts.map +1 -0
  37. package/dist/__tests__/cjk/japaneseSegmentLanguage.test.js +50 -0
  38. package/dist/__tests__/cjk/japaneseSegmentLanguage.test.js.map +1 -0
  39. package/dist/__tests__/cjk/japaneseSpacing.test.d.ts +2 -0
  40. package/dist/__tests__/cjk/japaneseSpacing.test.d.ts.map +1 -0
  41. package/dist/__tests__/cjk/japaneseSpacing.test.js +417 -0
  42. package/dist/__tests__/cjk/japaneseSpacing.test.js.map +1 -0
  43. package/dist/__tests__/cjk/kanbunKunten.test.d.ts +2 -0
  44. package/dist/__tests__/cjk/kanbunKunten.test.d.ts.map +1 -0
  45. package/dist/__tests__/cjk/kanbunKunten.test.js +230 -0
  46. package/dist/__tests__/cjk/kanbunKunten.test.js.map +1 -0
  47. package/dist/__tests__/cjk/kanbunKuntenRender.test.d.ts +2 -0
  48. package/dist/__tests__/cjk/kanbunKuntenRender.test.d.ts.map +1 -0
  49. package/dist/__tests__/cjk/kanbunKuntenRender.test.js +127 -0
  50. package/dist/__tests__/cjk/kanbunKuntenRender.test.js.map +1 -0
  51. package/dist/__tests__/cjk/keepAll.test.d.ts +2 -0
  52. package/dist/__tests__/cjk/keepAll.test.d.ts.map +1 -0
  53. package/dist/__tests__/cjk/keepAll.test.js +146 -0
  54. package/dist/__tests__/cjk/keepAll.test.js.map +1 -0
  55. package/dist/__tests__/cjk/kinsokuJa.test.d.ts +2 -0
  56. package/dist/__tests__/cjk/kinsokuJa.test.d.ts.map +1 -0
  57. package/dist/__tests__/cjk/kinsokuJa.test.js +388 -0
  58. package/dist/__tests__/cjk/kinsokuJa.test.js.map +1 -0
  59. package/dist/__tests__/cjk/kinsokuJaBuild.test.d.ts +2 -0
  60. package/dist/__tests__/cjk/kinsokuJaBuild.test.d.ts.map +1 -0
  61. package/dist/__tests__/cjk/kinsokuJaBuild.test.js +38 -0
  62. package/dist/__tests__/cjk/kinsokuJaBuild.test.js.map +1 -0
  63. package/dist/__tests__/cjk/resourceAnnotations.test.d.ts +2 -0
  64. package/dist/__tests__/cjk/resourceAnnotations.test.d.ts.map +1 -0
  65. package/dist/__tests__/cjk/resourceAnnotations.test.js +223 -0
  66. package/dist/__tests__/cjk/resourceAnnotations.test.js.map +1 -0
  67. package/dist/__tests__/defaults/cjk.test.js +10 -2
  68. package/dist/__tests__/defaults/cjk.test.js.map +1 -1
  69. package/dist/__tests__/exports.test.js +37 -0
  70. package/dist/__tests__/exports.test.js.map +1 -1
  71. package/dist/__tests__/headingLetterSpacing.test.js +2 -1
  72. package/dist/__tests__/headingLetterSpacing.test.js.map +1 -1
  73. package/dist/__tests__/indexChinese.test.js +1 -1
  74. package/dist/__tests__/indexJapanese.test.d.ts +2 -0
  75. package/dist/__tests__/indexJapanese.test.d.ts.map +1 -0
  76. package/dist/__tests__/indexJapanese.test.js +242 -0
  77. package/dist/__tests__/indexJapanese.test.js.map +1 -0
  78. package/dist/__tests__/japaneseCaptions.test.d.ts +2 -0
  79. package/dist/__tests__/japaneseCaptions.test.d.ts.map +1 -0
  80. package/dist/__tests__/japaneseCaptions.test.js +79 -0
  81. package/dist/__tests__/japaneseCaptions.test.js.map +1 -0
  82. package/dist/__tests__/japaneseHeadings.test.d.ts +2 -0
  83. package/dist/__tests__/japaneseHeadings.test.d.ts.map +1 -0
  84. package/dist/__tests__/japaneseHeadings.test.js +364 -0
  85. package/dist/__tests__/japaneseHeadings.test.js.map +1 -0
  86. package/dist/__tests__/japaneseLocale.test.d.ts +2 -0
  87. package/dist/__tests__/japaneseLocale.test.d.ts.map +1 -0
  88. package/dist/__tests__/japaneseLocale.test.js +201 -0
  89. package/dist/__tests__/japaneseLocale.test.js.map +1 -0
  90. package/dist/__tests__/japaneseNotes.test.d.ts +2 -0
  91. package/dist/__tests__/japaneseNotes.test.d.ts.map +1 -0
  92. package/dist/__tests__/japaneseNotes.test.js +336 -0
  93. package/dist/__tests__/japaneseNotes.test.js.map +1 -0
  94. package/dist/__tests__/japaneseNumbering.test.d.ts +2 -0
  95. package/dist/__tests__/japaneseNumbering.test.d.ts.map +1 -0
  96. package/dist/__tests__/japaneseNumbering.test.js +292 -0
  97. package/dist/__tests__/japaneseNumbering.test.js.map +1 -0
  98. package/dist/__tests__/parse/listNesting.test.d.ts +2 -0
  99. package/dist/__tests__/parse/listNesting.test.d.ts.map +1 -0
  100. package/dist/__tests__/parse/listNesting.test.js +142 -0
  101. package/dist/__tests__/parse/listNesting.test.js.map +1 -0
  102. package/dist/__tests__/pipeline/citationsJapanese.test.d.ts +2 -0
  103. package/dist/__tests__/pipeline/citationsJapanese.test.d.ts.map +1 -0
  104. package/dist/__tests__/pipeline/citationsJapanese.test.js +110 -0
  105. package/dist/__tests__/pipeline/citationsJapanese.test.js.map +1 -0
  106. package/dist/__tests__/pipeline/listNestingLayout.test.d.ts +2 -0
  107. package/dist/__tests__/pipeline/listNestingLayout.test.d.ts.map +1 -0
  108. package/dist/__tests__/pipeline/listNestingLayout.test.js +90 -0
  109. package/dist/__tests__/pipeline/listNestingLayout.test.js.map +1 -0
  110. package/dist/__tests__/pipeline/paragraphStyleFaces.test.js +2 -2
  111. package/dist/__tests__/pipeline/paragraphStyleFaces.test.js.map +1 -1
  112. package/dist/__tests__/pipeline/safeArea.test.d.ts +2 -0
  113. package/dist/__tests__/pipeline/safeArea.test.d.ts.map +1 -0
  114. package/dist/__tests__/pipeline/safeArea.test.js +207 -0
  115. package/dist/__tests__/pipeline/safeArea.test.js.map +1 -0
  116. package/dist/__tests__/vertical/compositionPaint.test.js +6 -5
  117. package/dist/__tests__/vertical/compositionPaint.test.js.map +1 -1
  118. package/dist/__tests__/vertical/japaneseVertical.test.d.ts +2 -0
  119. package/dist/__tests__/vertical/japaneseVertical.test.d.ts.map +1 -0
  120. package/dist/__tests__/vertical/japaneseVertical.test.js +247 -0
  121. package/dist/__tests__/vertical/japaneseVertical.test.js.map +1 -0
  122. package/dist/__tests__/vertical/verticalSpans.d.ts +2 -1
  123. package/dist/__tests__/vertical/verticalSpans.d.ts.map +1 -1
  124. package/dist/__tests__/vertical/verticalSpans.js +3 -2
  125. package/dist/__tests__/vertical/verticalSpans.js.map +1 -1
  126. package/dist/__tests__/video.test.d.ts +2 -0
  127. package/dist/__tests__/video.test.d.ts.map +1 -0
  128. package/dist/__tests__/video.test.js +305 -0
  129. package/dist/__tests__/video.test.js.map +1 -0
  130. package/dist/arabicMarks.d.ts +11 -1
  131. package/dist/arabicMarks.d.ts.map +1 -1
  132. package/dist/arabicMarks.js +72 -5
  133. package/dist/arabicMarks.js.map +1 -1
  134. package/dist/bundle/adapters.d.ts +6 -0
  135. package/dist/bundle/adapters.d.ts.map +1 -1
  136. package/dist/bundle/adapters.js +30 -0
  137. package/dist/bundle/adapters.js.map +1 -1
  138. package/dist/bundle/codec.d.ts.map +1 -1
  139. package/dist/bundle/codec.js +67 -3
  140. package/dist/bundle/codec.js.map +1 -1
  141. package/dist/bundle/index.d.ts +2 -2
  142. package/dist/bundle/index.d.ts.map +1 -1
  143. package/dist/bundle/index.js +2 -2
  144. package/dist/bundle/index.js.map +1 -1
  145. package/dist/bundle/manifest.d.ts +8 -0
  146. package/dist/bundle/manifest.d.ts.map +1 -1
  147. package/dist/bundle/manifest.js +48 -1
  148. package/dist/bundle/manifest.js.map +1 -1
  149. package/dist/bundle/types.d.ts +5 -0
  150. package/dist/bundle/types.d.ts.map +1 -1
  151. package/dist/bundle/zip.js +1 -1
  152. package/dist/bundle/zip.js.map +1 -1
  153. package/dist/canvas-backend/annotations.d.ts +20 -5
  154. package/dist/canvas-backend/annotations.d.ts.map +1 -1
  155. package/dist/canvas-backend/annotations.js +59 -6
  156. package/dist/canvas-backend/annotations.js.map +1 -1
  157. package/dist/canvas-backend/blockRender.d.ts.map +1 -1
  158. package/dist/canvas-backend/blockRender.js +29 -3
  159. package/dist/canvas-backend/blockRender.js.map +1 -1
  160. package/dist/canvas-backend/renderResourceBlock.d.ts +6 -1
  161. package/dist/canvas-backend/renderResourceBlock.d.ts.map +1 -1
  162. package/dist/canvas-backend/renderResourceBlock.js +124 -5
  163. package/dist/canvas-backend/renderResourceBlock.js.map +1 -1
  164. package/dist/canvas-backend/verticalText.d.ts +9 -4
  165. package/dist/canvas-backend/verticalText.d.ts.map +1 -1
  166. package/dist/canvas-backend/verticalText.js +20 -9
  167. package/dist/canvas-backend/verticalText.js.map +1 -1
  168. package/dist/chineseNumerals.d.ts +3 -2
  169. package/dist/chineseNumerals.d.ts.map +1 -1
  170. package/dist/chineseNumerals.js +11 -8
  171. package/dist/chineseNumerals.js.map +1 -1
  172. package/dist/citations/bibtex.d.ts.map +1 -1
  173. package/dist/citations/bibtex.js +4 -0
  174. package/dist/citations/bibtex.js.map +1 -1
  175. package/dist/citations/data.d.ts.map +1 -1
  176. package/dist/citations/data.js +6 -1
  177. package/dist/citations/data.js.map +1 -1
  178. package/dist/citations/types.d.ts +8 -0
  179. package/dist/citations/types.d.ts.map +1 -1
  180. package/dist/cjkMarks.d.ts +23 -14
  181. package/dist/cjkMarks.d.ts.map +1 -1
  182. package/dist/cjkMarks.js +251 -49
  183. package/dist/cjkMarks.js.map +1 -1
  184. package/dist/configWarnings.js +10 -4
  185. package/dist/configWarnings.js.map +1 -1
  186. package/dist/defaults/captionStyle.d.ts +19 -4
  187. package/dist/defaults/captionStyle.d.ts.map +1 -1
  188. package/dist/defaults/captionStyle.js +27 -8
  189. package/dist/defaults/captionStyle.js.map +1 -1
  190. package/dist/defaults/cjk.d.ts +64 -14
  191. package/dist/defaults/cjk.d.ts.map +1 -1
  192. package/dist/defaults/cjk.js +209 -29
  193. package/dist/defaults/cjk.js.map +1 -1
  194. package/dist/defaults/footnotes.d.ts +27 -4
  195. package/dist/defaults/footnotes.d.ts.map +1 -1
  196. package/dist/defaults/footnotes.js +95 -36
  197. package/dist/defaults/footnotes.js.map +1 -1
  198. package/dist/defaults/headings.d.ts +5 -0
  199. package/dist/defaults/headings.d.ts.map +1 -1
  200. package/dist/defaults/headings.js +46 -1
  201. package/dist/defaults/headings.js.map +1 -1
  202. package/dist/defaults/index.d.ts +4 -3
  203. package/dist/defaults/index.d.ts.map +1 -1
  204. package/dist/defaults/index.js +14 -5
  205. package/dist/defaults/index.js.map +1 -1
  206. package/dist/defaults/indexConfig.d.ts.map +1 -1
  207. package/dist/defaults/indexConfig.js +7 -4
  208. package/dist/defaults/indexConfig.js.map +1 -1
  209. package/dist/defaults/paragraphStyles.d.ts.map +1 -1
  210. package/dist/defaults/paragraphStyles.js +8 -0
  211. package/dist/defaults/paragraphStyles.js.map +1 -1
  212. package/dist/defaults/resourceTypes.d.ts +16 -3
  213. package/dist/defaults/resourceTypes.d.ts.map +1 -1
  214. package/dist/defaults/resourceTypes.js +56 -8
  215. package/dist/defaults/resourceTypes.js.map +1 -1
  216. package/dist/defaults/shared.d.ts.map +1 -1
  217. package/dist/defaults/shared.js +21 -0
  218. package/dist/defaults/shared.js.map +1 -1
  219. package/dist/defaults/tableStyle.d.ts.map +1 -1
  220. package/dist/defaults/tableStyle.js +4 -1
  221. package/dist/defaults/tableStyle.js.map +1 -1
  222. package/dist/defaults/videoStyle.d.ts +9 -0
  223. package/dist/defaults/videoStyle.d.ts.map +1 -0
  224. package/dist/defaults/videoStyle.js +130 -0
  225. package/dist/defaults/videoStyle.js.map +1 -0
  226. package/dist/design/placeholders.d.ts.map +1 -1
  227. package/dist/design/placeholders.js +5 -3
  228. package/dist/design/placeholders.js.map +1 -1
  229. package/dist/html-backend.d.ts +13 -0
  230. package/dist/html-backend.d.ts.map +1 -1
  231. package/dist/html-backend.js +233 -26
  232. package/dist/html-backend.js.map +1 -1
  233. package/dist/htmlAnnotations.d.ts +47 -9
  234. package/dist/htmlAnnotations.d.ts.map +1 -1
  235. package/dist/htmlAnnotations.js +89 -17
  236. package/dist/htmlAnnotations.js.map +1 -1
  237. package/dist/index.d.ts +13 -7
  238. package/dist/index.d.ts.map +1 -1
  239. package/dist/index.js +8 -4
  240. package/dist/index.js.map +1 -1
  241. package/dist/japaneseNumerals.d.ts +44 -0
  242. package/dist/japaneseNumerals.d.ts.map +1 -0
  243. package/dist/japaneseNumerals.js +100 -0
  244. package/dist/japaneseNumerals.js.map +1 -0
  245. package/dist/knuthPlass/richAdapter.d.ts +5 -1
  246. package/dist/knuthPlass/richAdapter.d.ts.map +1 -1
  247. package/dist/knuthPlass/richAdapter.js +2 -0
  248. package/dist/knuthPlass/richAdapter.js.map +1 -1
  249. package/dist/locale.d.ts +19 -12
  250. package/dist/locale.d.ts.map +1 -1
  251. package/dist/locale.js +24 -12
  252. package/dist/locale.js.map +1 -1
  253. package/dist/measure/cache.d.ts.map +1 -1
  254. package/dist/measure/cache.js +20 -9
  255. package/dist/measure/cache.js.map +1 -1
  256. package/dist/measure/canvas.d.ts +21 -0
  257. package/dist/measure/canvas.d.ts.map +1 -1
  258. package/dist/measure/canvas.js +82 -0
  259. package/dist/measure/canvas.js.map +1 -1
  260. package/dist/measure/cjk.d.ts +3 -1
  261. package/dist/measure/cjk.d.ts.map +1 -1
  262. package/dist/measure/cjk.js +4 -2
  263. package/dist/measure/cjk.js.map +1 -1
  264. package/dist/measure/cjkAnnotate.d.ts +62 -3
  265. package/dist/measure/cjkAnnotate.d.ts.map +1 -1
  266. package/dist/measure/cjkAnnotate.js +99 -2
  267. package/dist/measure/cjkAnnotate.js.map +1 -1
  268. package/dist/measure/cjkClasses.d.ts +93 -13
  269. package/dist/measure/cjkClasses.d.ts.map +1 -1
  270. package/dist/measure/cjkClasses.js +204 -14
  271. package/dist/measure/cjkClasses.js.map +1 -1
  272. package/dist/measure/cjkCompose.d.ts +10 -4
  273. package/dist/measure/cjkCompose.d.ts.map +1 -1
  274. package/dist/measure/cjkCompose.js +834 -85
  275. package/dist/measure/cjkCompose.js.map +1 -1
  276. package/dist/measure/cjkPunctuation.d.ts +73 -14
  277. package/dist/measure/cjkPunctuation.d.ts.map +1 -1
  278. package/dist/measure/cjkPunctuation.js +97 -21
  279. package/dist/measure/cjkPunctuation.js.map +1 -1
  280. package/dist/measure/plain.js +2 -2
  281. package/dist/measure/plain.js.map +1 -1
  282. package/dist/measure/rich.d.ts +12 -2
  283. package/dist/measure/rich.d.ts.map +1 -1
  284. package/dist/measure/rich.js +46 -8
  285. package/dist/measure/rich.js.map +1 -1
  286. package/dist/measure/rubyJis.d.ts +96 -0
  287. package/dist/measure/rubyJis.d.ts.map +1 -0
  288. package/dist/measure/rubyJis.js +245 -0
  289. package/dist/measure/rubyJis.js.map +1 -0
  290. package/dist/measure/types.d.ts +6 -1
  291. package/dist/measure/types.d.ts.map +1 -1
  292. package/dist/measure/types.js.map +1 -1
  293. package/dist/measure/vertical.d.ts +13 -5
  294. package/dist/measure/vertical.d.ts.map +1 -1
  295. package/dist/measure/vertical.js +16 -6
  296. package/dist/measure/vertical.js.map +1 -1
  297. package/dist/numberWords.d.ts +4 -3
  298. package/dist/numberWords.d.ts.map +1 -1
  299. package/dist/numberWords.js +15 -5
  300. package/dist/numberWords.js.map +1 -1
  301. package/dist/numbering.d.ts +24 -12
  302. package/dist/numbering.d.ts.map +1 -1
  303. package/dist/numbering.js +57 -11
  304. package/dist/numbering.js.map +1 -1
  305. package/dist/parse/annotations.d.ts +21 -18
  306. package/dist/parse/annotations.d.ts.map +1 -1
  307. package/dist/parse/annotations.js +140 -51
  308. package/dist/parse/annotations.js.map +1 -1
  309. package/dist/parse/blockParser.d.ts.map +1 -1
  310. package/dist/parse/blockParser.js +12 -1
  311. package/dist/parse/blockParser.js.map +1 -1
  312. package/dist/parse/index.d.ts +1 -1
  313. package/dist/parse/index.d.ts.map +1 -1
  314. package/dist/parse/index.js.map +1 -1
  315. package/dist/parse/indexMarks.d.ts.map +1 -1
  316. package/dist/parse/indexMarks.js +42 -0
  317. package/dist/parse/indexMarks.js.map +1 -1
  318. package/dist/parse/inlineFormatting.d.ts +4 -3
  319. package/dist/parse/inlineFormatting.d.ts.map +1 -1
  320. package/dist/parse/inlineFormatting.js +9 -8
  321. package/dist/parse/inlineFormatting.js.map +1 -1
  322. package/dist/parse/listNesting.d.ts +47 -0
  323. package/dist/parse/listNesting.d.ts.map +1 -0
  324. package/dist/parse/listNesting.js +65 -0
  325. package/dist/parse/listNesting.js.map +1 -0
  326. package/dist/parse/types.d.ts +93 -5
  327. package/dist/parse/types.d.ts.map +1 -1
  328. package/dist/pipeline/annotations.d.ts +25 -15
  329. package/dist/pipeline/annotations.d.ts.map +1 -1
  330. package/dist/pipeline/annotations.js +102 -16
  331. package/dist/pipeline/annotations.js.map +1 -1
  332. package/dist/pipeline/build.d.ts.map +1 -1
  333. package/dist/pipeline/build.js +284 -31
  334. package/dist/pipeline/build.js.map +1 -1
  335. package/dist/pipeline/buildBlockKind.d.ts +7 -0
  336. package/dist/pipeline/buildBlockKind.d.ts.map +1 -1
  337. package/dist/pipeline/buildBlockKind.js +25 -2
  338. package/dist/pipeline/buildBlockKind.js.map +1 -1
  339. package/dist/pipeline/buildHelpers.d.ts +2 -0
  340. package/dist/pipeline/buildHelpers.d.ts.map +1 -1
  341. package/dist/pipeline/buildHelpers.js +17 -0
  342. package/dist/pipeline/buildHelpers.js.map +1 -1
  343. package/dist/pipeline/buildMeasurement.d.ts +3 -0
  344. package/dist/pipeline/buildMeasurement.d.ts.map +1 -1
  345. package/dist/pipeline/buildMeasurement.js +1 -0
  346. package/dist/pipeline/buildMeasurement.js.map +1 -1
  347. package/dist/pipeline/calloutLayout.d.ts +2 -0
  348. package/dist/pipeline/calloutLayout.d.ts.map +1 -1
  349. package/dist/pipeline/calloutLayout.js +5 -5
  350. package/dist/pipeline/calloutLayout.js.map +1 -1
  351. package/dist/pipeline/citations.d.ts +1 -1
  352. package/dist/pipeline/citations.d.ts.map +1 -1
  353. package/dist/pipeline/citations.js +15 -7
  354. package/dist/pipeline/citations.js.map +1 -1
  355. package/dist/pipeline/columnBalancing.d.ts +22 -0
  356. package/dist/pipeline/columnBalancing.d.ts.map +1 -1
  357. package/dist/pipeline/columnBalancing.js +80 -3
  358. package/dist/pipeline/columnBalancing.js.map +1 -1
  359. package/dist/pipeline/config.d.ts.map +1 -1
  360. package/dist/pipeline/config.js +4 -3
  361. package/dist/pipeline/config.js.map +1 -1
  362. package/dist/pipeline/contentWarnings.d.ts.map +1 -1
  363. package/dist/pipeline/contentWarnings.js +19 -0
  364. package/dist/pipeline/contentWarnings.js.map +1 -1
  365. package/dist/pipeline/continuation.d.ts.map +1 -1
  366. package/dist/pipeline/continuation.js +3 -3
  367. package/dist/pipeline/continuation.js.map +1 -1
  368. package/dist/pipeline/crossRefs.d.ts.map +1 -1
  369. package/dist/pipeline/crossRefs.js +3 -0
  370. package/dist/pipeline/crossRefs.js.map +1 -1
  371. package/dist/pipeline/footnotes.d.ts +20 -12
  372. package/dist/pipeline/footnotes.d.ts.map +1 -1
  373. package/dist/pipeline/footnotes.js +62 -16
  374. package/dist/pipeline/footnotes.js.map +1 -1
  375. package/dist/pipeline/headingStyles.js +1 -1
  376. package/dist/pipeline/headingStyles.js.map +1 -1
  377. package/dist/pipeline/indexDirective.d.ts.map +1 -1
  378. package/dist/pipeline/indexDirective.js +89 -12
  379. package/dist/pipeline/indexDirective.js.map +1 -1
  380. package/dist/pipeline/indexGroups.d.ts +5 -3
  381. package/dist/pipeline/indexGroups.d.ts.map +1 -1
  382. package/dist/pipeline/indexGroups.js +9 -4
  383. package/dist/pipeline/indexGroups.js.map +1 -1
  384. package/dist/pipeline/indexJapanese.d.ts +75 -0
  385. package/dist/pipeline/indexJapanese.d.ts.map +1 -0
  386. package/dist/pipeline/indexJapanese.js +264 -0
  387. package/dist/pipeline/indexJapanese.js.map +1 -0
  388. package/dist/pipeline/lineSpan.d.ts +36 -0
  389. package/dist/pipeline/lineSpan.d.ts.map +1 -0
  390. package/dist/pipeline/lineSpan.js +36 -0
  391. package/dist/pipeline/lineSpan.js.map +1 -0
  392. package/dist/pipeline/lists.js +2 -2
  393. package/dist/pipeline/lists.js.map +1 -1
  394. package/dist/pipeline/measureContentBlock.d.ts +4 -0
  395. package/dist/pipeline/measureContentBlock.d.ts.map +1 -1
  396. package/dist/pipeline/measureContentBlock.js +57 -5
  397. package/dist/pipeline/measureContentBlock.js.map +1 -1
  398. package/dist/pipeline/outline.d.ts.map +1 -1
  399. package/dist/pipeline/outline.js +3 -1
  400. package/dist/pipeline/outline.js.map +1 -1
  401. package/dist/pipeline/paragraphContainers.d.ts +25 -2
  402. package/dist/pipeline/paragraphContainers.d.ts.map +1 -1
  403. package/dist/pipeline/paragraphContainers.js +82 -2
  404. package/dist/pipeline/paragraphContainers.js.map +1 -1
  405. package/dist/pipeline/parts.d.ts +2 -2
  406. package/dist/pipeline/parts.js +3 -3
  407. package/dist/pipeline/parts.js.map +1 -1
  408. package/dist/pipeline/placement.d.ts.map +1 -1
  409. package/dist/pipeline/placement.js +2 -2
  410. package/dist/pipeline/placement.js.map +1 -1
  411. package/dist/pipeline/resourceLayout.d.ts +6 -0
  412. package/dist/pipeline/resourceLayout.d.ts.map +1 -1
  413. package/dist/pipeline/resourceLayout.js +93 -17
  414. package/dist/pipeline/resourceLayout.js.map +1 -1
  415. package/dist/pipeline/resourceNumbering.d.ts +5 -2
  416. package/dist/pipeline/resourceNumbering.d.ts.map +1 -1
  417. package/dist/pipeline/resourceNumbering.js +12 -7
  418. package/dist/pipeline/resourceNumbering.js.map +1 -1
  419. package/dist/pipeline/safeArea.d.ts +29 -0
  420. package/dist/pipeline/safeArea.d.ts.map +1 -0
  421. package/dist/pipeline/safeArea.js +89 -0
  422. package/dist/pipeline/safeArea.js.map +1 -0
  423. package/dist/pipeline/styles.d.ts +16 -1
  424. package/dist/pipeline/styles.d.ts.map +1 -1
  425. package/dist/pipeline/styles.js +8 -1
  426. package/dist/pipeline/styles.js.map +1 -1
  427. package/dist/pipeline/verse.d.ts +3 -0
  428. package/dist/pipeline/verse.d.ts.map +1 -1
  429. package/dist/pipeline/verse.js +1 -1
  430. package/dist/pipeline/verse.js.map +1 -1
  431. package/dist/pipeline/verticalMetrics.d.ts.map +1 -1
  432. package/dist/pipeline/verticalMetrics.js +4 -0
  433. package/dist/pipeline/verticalMetrics.js.map +1 -1
  434. package/dist/pipeline/videoOverlay.d.ts +24 -0
  435. package/dist/pipeline/videoOverlay.d.ts.map +1 -0
  436. package/dist/pipeline/videoOverlay.js +134 -0
  437. package/dist/pipeline/videoOverlay.js.map +1 -0
  438. package/dist/types.d.ts +594 -50
  439. package/dist/types.d.ts.map +1 -1
  440. package/dist/uprightArabic.js +1 -1
  441. package/dist/uprightArabic.js.map +1 -1
  442. package/dist/vdt.d.ts +221 -17
  443. package/dist/vdt.d.ts.map +1 -1
  444. package/dist/vdt.js.map +1 -1
  445. package/dist/video/qr.d.ts +21 -0
  446. package/dist/video/qr.d.ts.map +1 -0
  447. package/dist/video/qr.js +326 -0
  448. package/dist/video/qr.js.map +1 -0
  449. package/dist/video/url.d.ts +62 -0
  450. package/dist/video/url.d.ts.map +1 -0
  451. package/dist/video/url.js +206 -0
  452. package/dist/video/url.js.map +1 -0
  453. package/dist/writingMode.d.ts +74 -20
  454. package/dist/writingMode.d.ts.map +1 -1
  455. package/dist/writingMode.js +146 -27
  456. package/dist/writingMode.js.map +1 -1
  457. package/package.json +1 -1
package/dist/types.d.ts CHANGED
@@ -117,7 +117,93 @@ export interface ResourceType {
117
117
  captionStyle?: CaptionStyleConfig;
118
118
  }
119
119
  /** The concrete payload kind a `Resource` carries. */
120
- export type ResourceKind = 'bitmap' | 'svg' | 'table';
120
+ export type ResourceKind = 'bitmap' | 'svg' | 'table' | 'video';
121
+ /** Where a video resource plays from (#454): a YouTube or Vimeo page, or a
122
+ * self-hosted file (an uploaded MP4 or WebM). */
123
+ export type VideoSource = 'youtube' | 'vimeo' | 'file';
124
+ /** What a video's player offers in the interactive outputs (the HTML viewer,
125
+ * EPUB). Set for the whole book in `videoStyle.player`, and per video in
126
+ * `Resource.video.player` (only the fields set there). The HTML5 player of
127
+ * a self-hosted file honours them all; the YouTube and Vimeo players honour
128
+ * what their embed parameters allow (see each field). */
129
+ export interface VideoPlayerOptions {
130
+ /** Show the player's controls. Default `true`. YouTube, Vimeo and
131
+ * HTML5. */
132
+ controls?: boolean;
133
+ /** Offer the browser's download button (HTML5 only: `controlslist=
134
+ * "nodownload"` when off). Default `true`. It hides the button; it is
135
+ * not copy protection. YouTube and Vimeo never offer a download. */
136
+ download?: boolean;
137
+ /** Offer full screen. Default `true`. YouTube (`fs=0`), Vimeo and HTML5
138
+ * (`nofullscreen`). */
139
+ fullscreen?: boolean;
140
+ /** Offer the playback speed menu. Default `true`. Vimeo (`speed=0`) and
141
+ * HTML5 (`noplaybackrate`, Chromium). */
142
+ playbackRate?: boolean;
143
+ /** Offer picture-in-picture. Default `true`. Vimeo (`pip=0`) and HTML5
144
+ * (`disablepictureinpicture`). */
145
+ pictureInPicture?: boolean;
146
+ /** Offer casting to another screen. Default `true`. HTML5
147
+ * (`disableremoteplayback`). */
148
+ remotePlayback?: boolean;
149
+ /** Start playing on its own (always muted, as browsers require). Default
150
+ * `false`. */
151
+ autoplay?: boolean;
152
+ /** Start muted. Default `false`. */
153
+ muted?: boolean;
154
+ /** Play again from the start at the end. Default `false`. */
155
+ loop?: boolean;
156
+ /** How much of a self-hosted file the browser loads before play:
157
+ * `'none'`, `'metadata'` (the default) or `'auto'`. HTML5 only. */
158
+ preload?: 'none' | 'metadata' | 'auto';
159
+ /** Privacy-enhanced embeds: YouTube from `youtube-nocookie.com`, Vimeo
160
+ * with `dnt=1` (no tracking cookies). Default `true`. */
161
+ privacy?: boolean;
162
+ }
163
+ export type ResolvedVideoPlayerOptions = Required<VideoPlayerOptions>;
164
+ /** The picture printed for a video: a frame of it (the platform's poster
165
+ * for YouTube and Vimeo, a chosen frame of a self-hosted file), stored
166
+ * out-of-band like a bitmap. */
167
+ export interface ResourceVideoPoster {
168
+ fileId: string;
169
+ format: string;
170
+ width: number;
171
+ height: number;
172
+ }
173
+ /** The payload of a `kind: 'video'` resource (#454). */
174
+ export interface ResourceVideo {
175
+ source: VideoSource;
176
+ /** YouTube or Vimeo: the video's address (any watch, short, Shorts or
177
+ * embed link). A self-hosted file: its production address, where the
178
+ * published book finds it — printed in the QR code, linked from the PDF,
179
+ * and played by the HTML and EPUB outputs when the file itself is not
180
+ * available to them. */
181
+ url?: string;
182
+ /** A self-hosted file: the uploaded video, stored out-of-band like a
183
+ * bitmap (part of a `.postext` bundle). */
184
+ fileId?: string;
185
+ /** A self-hosted file's format: `'mp4'` (the default), `'webm'`, `'ogv'`,
186
+ * `'mov'`. */
187
+ format?: string;
188
+ /** Frame size of the video in px, for its aspect ratio when there is no
189
+ * poster. */
190
+ width?: number;
191
+ height?: number;
192
+ /** Length in seconds (informative). */
193
+ duration?: number;
194
+ /** The poster frame. Without one a video is printed as a placeholder box
195
+ * in the video's aspect ratio (16:9 when unknown). */
196
+ poster?: ResourceVideoPoster;
197
+ /** The time in seconds of a self-hosted file's frame used as the poster
198
+ * (informative, kept so the frame can be picked again). */
199
+ posterTime?: number;
200
+ /** Play from `start` to `end` seconds. The printed link starts at
201
+ * `start` too. */
202
+ start?: number;
203
+ end?: number;
204
+ /** Player options of this video, laid over `videoStyle.player`. */
205
+ player?: VideoPlayerOptions;
206
+ }
121
207
  /** Horizontal alignment of a table cell's content. */
122
208
  export type TableCellAlign = 'left' | 'center' | 'right';
123
209
  /** A cell's alignment as a table model writes it: a {@link TableCellAlign},
@@ -181,6 +267,15 @@ export interface TableModel {
181
267
  * length, or any non-positive weight falls back to an equal split. */
182
268
  columnWidths?: number[];
183
269
  }
270
+ /** A rectangle of a picture in fractions of its intrinsic size: `x` and
271
+ * `width` of its width, `y` and `height` of its height (0–1, top-left
272
+ * origin). */
273
+ export interface ResourceSafeArea {
274
+ x: number;
275
+ y: number;
276
+ width: number;
277
+ height: number;
278
+ }
184
279
  /** A user-managed resource instance. Binary payloads (bitmaps, SVGs) are
185
280
  * stored out-of-band (IndexedDB in the sandbox) and referenced by
186
281
  * `fileId`; table resources carry their model inline. */
@@ -250,6 +345,21 @@ export interface Resource {
250
345
  * the document. */
251
346
  direction?: 'ltr' | 'rtl';
252
347
  };
348
+ /** Present when `kind === 'video'`: a YouTube, Vimeo or self-hosted
349
+ * video, placed, captioned and numbered like a picture (its type is
350
+ * usually the built-in `video`, numbered on its own: Video 1.1), printed
351
+ * as its poster with the `videoStyle` overlays and played by the
352
+ * interactive outputs. */
353
+ video?: ResourceVideo;
354
+ /** The safe area of a bitmap or SVG: the rectangle of the picture that
355
+ * holds what matters (a person and part of the landscape). With one, the
356
+ * engine may show the picture at any aspect ratio between the whole
357
+ * picture and this rectangle, cropping what lies outside it, to make the
358
+ * figure taller or shorter where the page needs it (fill a column left
359
+ * short, fit the room left); the outer margins are cropped in proportion
360
+ * to their sizes and the safe area always stays in view. Without one the
361
+ * picture is always shown whole. Ignored for tables. */
362
+ safeArea?: ResourceSafeArea;
253
363
  /** Optional per-resource placement override. When unset, the resource's
254
364
  * type default (then `top` / `column`) applies. A `position` of `'top'` or
255
365
  * `'bottom'` floats the resource to a band on the page near its first
@@ -313,6 +423,10 @@ export interface OutlineIndexMark {
313
423
  /** The entry's levels, main term first. */
314
424
  path: string[];
315
425
  sort?: string;
426
+ /** The reading of the last level (`yomi="…"`), and the kana reading the
427
+ * ruby of the marked text gives it (see {@link IndexMark.rubyYomi}). */
428
+ yomi?: string;
429
+ rubyYomi?: string;
316
430
  see?: string;
317
431
  seeAlso?: string;
318
432
  main?: boolean;
@@ -530,9 +644,10 @@ export interface CutLinesConfig {
530
644
  markOffset?: Dimension;
531
645
  /** Stroke width of the marks. Default 0.25 pt. */
532
646
  markWidth?: Dimension;
533
- /** Colour of the marks on the canvas and in RGB or grayscale PDFs. A
534
- * CMYK PDF paints them in registration colour (the `/All`
535
- * separation), so they print on every plate. Default black. */
647
+ /** Colour of the marks on the canvas (the screen preview). A PDF
648
+ * always paints them in registration colour (the `/All` separation),
649
+ * whatever its colour space, so they print on every plate. Default
650
+ * black. */
536
651
  color?: ColorValue;
537
652
  }
538
653
  export type PageNumberFormat = 'decimal' | 'lower-roman' | 'upper-roman' | 'lower-alpha' | 'upper-alpha' | EastAsianNumeralStyle | ArabicNumeralStyle;
@@ -1459,6 +1574,101 @@ export interface ResolvedDiagramStyleConfig {
1459
1574
  singleInk: boolean;
1460
1575
  inkColor: ColorValue;
1461
1576
  }
1577
+ /** Where an overlay sits on a video's poster: the centre, a corner or the
1578
+ * middle of a side. The positions are physical: `top-right` is the top
1579
+ * right corner in a right-to-left book too. */
1580
+ export type VideoOverlayPosition = 'center' | 'top-left' | 'top' | 'top-right' | 'left' | 'right' | 'bottom-left' | 'bottom' | 'bottom-right';
1581
+ /** The mark printed on a video's poster to say it plays. */
1582
+ export interface VideoPlayMarkConfig {
1583
+ /** Print it. Default `true`. */
1584
+ enabled?: boolean;
1585
+ /** `'circle'` (a disc with a triangle, the default), `'rounded'` (a
1586
+ * rounded rectangle with a triangle) or `'triangle'` (the triangle
1587
+ * alone, outlined in the background colour). */
1588
+ shape?: 'circle' | 'rounded' | 'triangle';
1589
+ /** Default `'center'`. */
1590
+ position?: VideoOverlayPosition;
1591
+ /** Height of the mark (the disc's diameter). Default `12mm`; never more
1592
+ * than 40 % of the poster's shorter side. */
1593
+ size?: Dimension;
1594
+ /** Distance from the poster's edges when the mark sits at a side or a
1595
+ * corner. Default `4mm`. */
1596
+ inset?: Dimension;
1597
+ /** The triangle. Default white. */
1598
+ color?: ColorValue;
1599
+ /** The disc or rectangle behind it. Default the main palette colour. */
1600
+ background?: ColorValue;
1601
+ /** Opacity of the background, 0–1. Default `0.9`. */
1602
+ backgroundOpacity?: number;
1603
+ }
1604
+ /** The QR code printed on a video's poster, opening the video (its YouTube
1605
+ * or Vimeo page, or a self-hosted file's production address). */
1606
+ export interface VideoQrConfig {
1607
+ /** Print it. Default `true`. A video with no address (a self-hosted file
1608
+ * without `url`) prints none and raises `videoWithoutUrl`. */
1609
+ enabled?: boolean;
1610
+ /** Default `'bottom-right'`. */
1611
+ position?: VideoOverlayPosition;
1612
+ /** Side of the code with its quiet zone. Default `18mm`; never more than
1613
+ * 45 % of the poster's shorter side. Keep each module at least a third of
1614
+ * a millimetre for phone cameras. */
1615
+ size?: Dimension;
1616
+ /** Distance from the poster's edges. Default `3mm`. */
1617
+ inset?: Dimension;
1618
+ /** Error-correction level `'L'`, `'M'` (the default), `'Q'` or `'H'`;
1619
+ * raised automatically while the code stays the same size. */
1620
+ errorCorrection?: 'L' | 'M' | 'Q' | 'H';
1621
+ /** Light modules around the code, in modules. Default `2`. */
1622
+ quietZone?: number;
1623
+ /** Dark modules. Default black. */
1624
+ color?: ColorValue;
1625
+ /** The plate behind the code. Default white. */
1626
+ background?: ColorValue;
1627
+ /** Corner radius of the plate. Default `1mm`. */
1628
+ radius?: Dimension;
1629
+ }
1630
+ /** How video resources are printed and played (#454). */
1631
+ export interface VideoStyleConfig {
1632
+ playMark?: VideoPlayMarkConfig;
1633
+ qr?: VideoQrConfig;
1634
+ /** Make the poster a link to the video: a link annotation in the PDF, an
1635
+ * `<a>` around the poster in HTML and EPUB when they show the poster.
1636
+ * Default `true`. */
1637
+ linkPoster?: boolean;
1638
+ /** What the HTML output sets for a video: its player (`'player'`, the
1639
+ * default) or the printed poster with its overlays (`'poster'`). */
1640
+ html?: 'player' | 'poster';
1641
+ /** Player options for every video. */
1642
+ player?: VideoPlayerOptions;
1643
+ }
1644
+ export interface ResolvedVideoPlayMarkConfig {
1645
+ enabled: boolean;
1646
+ shape: 'circle' | 'rounded' | 'triangle';
1647
+ position: VideoOverlayPosition;
1648
+ size: Dimension;
1649
+ inset: Dimension;
1650
+ color: ColorValue;
1651
+ background: ColorValue;
1652
+ backgroundOpacity: number;
1653
+ }
1654
+ export interface ResolvedVideoQrConfig {
1655
+ enabled: boolean;
1656
+ position: VideoOverlayPosition;
1657
+ size: Dimension;
1658
+ inset: Dimension;
1659
+ errorCorrection: 'L' | 'M' | 'Q' | 'H';
1660
+ quietZone: number;
1661
+ color: ColorValue;
1662
+ background: ColorValue;
1663
+ radius: Dimension;
1664
+ }
1665
+ export interface ResolvedVideoStyleConfig {
1666
+ playMark: ResolvedVideoPlayMarkConfig;
1667
+ qr: ResolvedVideoQrConfig;
1668
+ linkPoster: boolean;
1669
+ html: 'player' | 'poster';
1670
+ player: ResolvedVideoPlayerOptions;
1671
+ }
1462
1672
  /** A named paragraph style, applied to the paragraphs inside a
1463
1673
  * `:::paragraphs{style="<id>"}` container. Every typographic field is
1464
1674
  * optional and inherits the body text when unset, so a style only needs to
@@ -1510,6 +1720,14 @@ export interface ParagraphStyleConfig {
1510
1720
  * `hangingIndent: 2.5em` sets the line at 1.5 em and its turnover at
1511
1721
  * 4 em. Default `0`; a negative value counts as `0`. */
1512
1722
  indent?: Dimension;
1723
+ /** Indent of every line from the side lines end on (the right of an
1724
+ * English paragraph, the foot of a vertical line), `em` being the
1725
+ * style's own size: the measure narrows by it and lines set flush to the
1726
+ * end (`textAlign: 'end'`) stop that far short of it. A date or a
1727
+ * signature raised N characters off the foot of a Japanese letter (地から
1728
+ * N字上げ) is `textAlign: 'end'` with `endIndent: 'Nem'`; 地付き is the
1729
+ * same at `0`. Default `0`; a negative value counts as `0`. */
1730
+ endIndent?: Dimension;
1513
1731
  /** Defaults to the body first-line indent. Ignored when
1514
1732
  * {@link hangingIndent} is non-zero. */
1515
1733
  firstLineIndent?: Dimension;
@@ -1540,6 +1758,11 @@ export interface ParagraphStyleConfig {
1540
1758
  * is longer (`ß` → `SS`) is left as it is. Maths is left alone. Default
1541
1759
  * `'none'`. */
1542
1760
  textTransform?: ParagraphTextTransform;
1761
+ /** Where CJK lines of the paragraphs break between characters (see
1762
+ * {@link CjkWordBreak}): `'keep-all'` only at spaces and next to
1763
+ * punctuation (phrase-spaced kana text, 分かち書き), `'normal'` between
1764
+ * any two characters. Unset: the document's `cjk.wordBreak`. */
1765
+ wordBreak?: CjkWordBreak;
1543
1766
  }
1544
1767
  export type ParagraphTextTransform = 'none' | 'uppercase';
1545
1768
  export interface ResolvedParagraphStyleConfig {
@@ -1559,6 +1782,8 @@ export interface ResolvedParagraphStyleConfig {
1559
1782
  smallCaps: boolean;
1560
1783
  hyphenation: boolean;
1561
1784
  indent: Dimension;
1785
+ /** Absent when the style sets none (or `0`). */
1786
+ endIndent?: Dimension;
1562
1787
  firstLineIndent: Dimension;
1563
1788
  hangingIndent: Dimension;
1564
1789
  spaceBetween: Dimension;
@@ -1566,6 +1791,8 @@ export interface ResolvedParagraphStyleConfig {
1566
1791
  marginBottom: Dimension;
1567
1792
  snapToGrid: boolean;
1568
1793
  textTransform: ParagraphTextTransform;
1794
+ /** Absent when the style sets none (the document's `cjk.wordBreak`). */
1795
+ wordBreak?: CjkWordBreak;
1569
1796
  }
1570
1797
  /** Horizontal extent of a callout: its column, or the full content width. */
1571
1798
  /** `'side'` sets the box in the float-only side column of a `oneAndHalf`
@@ -2300,6 +2527,31 @@ export interface HeadingLevelConfig {
2300
2527
  * a half above its text while an H3 stays on the grid. A heading style
2301
2528
  * may set it too. */
2302
2529
  snapToGrid?: boolean;
2530
+ /** 行取り (gyōdori, JLReq §4.1.6): the heading takes exactly this many
2531
+ * lines of the body grid (N × the body line pitch), its text centred in
2532
+ * them, in place of its `marginTop` and `marginBottom` — "3行取り" is
2533
+ * `lineSpan: 3`. The band starts on the grid when the heading snaps to it
2534
+ * (`snapToGrid`), keeps its lines at the head of a column and after
2535
+ * another heading, and holds its text centred across the line in
2536
+ * vertical text too. A heading whose lines need more room than N body
2537
+ * lines takes the next whole number of lines. Not read by a heading set
2538
+ * as a page opener (`span: 'page'`) or from its `advancedDesign`, nor
2539
+ * inside a box. Unset (default): the margins apply. */
2540
+ lineSpan?: number;
2541
+ /** Indent of the heading's lines from the side lines start on (字下げ:
2542
+ * the top of a vertical line, the left of an English one), in which `em`
2543
+ * is the BODY size, as Japanese books count a heading's indent in body
2544
+ * characters (JLReq §4.1.3: 4, 6 and 8 字 for the levels of a vertical
2545
+ * book). The measure narrows by it; a centred heading centres in what is
2546
+ * left. Default `0`. */
2547
+ indent?: Dimension;
2548
+ /** 字取り (jidori, JLReq §3.7.3, §4.1): a heading shorter than this many
2549
+ * of its own characters is spaced out evenly to fill exactly that width
2550
+ * (`jidori: 3` sets 序章 as 序 章). Applies to a heading that fits one
2551
+ * line; a longer title is set as it is. A heading overrides it with
2552
+ * `{jidori=N}` (`{jidori=0}` turns it off). Unset (default): no
2553
+ * spacing. */
2554
+ jidori?: number;
2303
2555
  }
2304
2556
  export type HeadingTextTransform = 'none' | 'uppercase';
2305
2557
  export interface ResolvedHeadingLevelConfig {
@@ -2329,6 +2581,12 @@ export interface ResolvedHeadingLevelConfig {
2329
2581
  hidden: boolean;
2330
2582
  /** The level's own value, else `headings.snapToGrid`. */
2331
2583
  snapToGrid: boolean;
2584
+ /** Absent unless set (see {@link HeadingLevelConfig.lineSpan}). */
2585
+ lineSpan?: number;
2586
+ /** Absent unless set (see {@link HeadingLevelConfig.indent}). */
2587
+ indent?: Dimension;
2588
+ /** Absent unless set (see {@link HeadingLevelConfig.jidori}). */
2589
+ jidori?: number;
2332
2590
  }
2333
2591
  export interface HeadingsConfig {
2334
2592
  fontFamily?: string;
@@ -2345,6 +2603,12 @@ export interface HeadingsConfig {
2345
2603
  * rule too: the cut is taken lower (or dropped) rather than leave a
2346
2604
  * heading closing a column while its text opens the next. Default true. */
2347
2605
  keepWithNext?: boolean;
2606
+ /** With {@link keepWithNext} on, let a heading close the last column of an
2607
+ * even page all the same: its text opens the facing odd page, which the
2608
+ * reader sees beside it in the same spread (JLReq §4.1.7 b allows it in
2609
+ * vertical books; the spread is the same in a left-bound book). Default
2610
+ * `false`. */
2611
+ keepWithNextSpread?: boolean;
2348
2612
  /** How a paragraph that does not fit under a heading at a column's foot
2349
2613
  * is split, when pushing it whole would leave the heading behind
2350
2614
  * (`keepWithNext`):
@@ -2480,6 +2744,8 @@ export interface ResolvedHeadingsConfig {
2480
2744
  marginTop: Dimension;
2481
2745
  marginBottom: Dimension;
2482
2746
  keepWithNext: boolean;
2747
+ /** Present (`true`) only when set. */
2748
+ keepWithNextSpread?: boolean;
2483
2749
  keepWithNextSplit: KeepWithNextSplit;
2484
2750
  snapToGrid: boolean;
2485
2751
  inlineMarks: boolean;
@@ -2974,22 +3240,42 @@ export interface ResolvedMathConfig {
2974
3240
  * - `'column'`: at the foot of the column that holds the line citing the
2975
3241
  * note, under a separator rule, above the column's bottom float band. In
2976
3242
  * a one-column layout that is the foot of the page;
2977
- * - `'chapterEnd'`: every note of the chapter after its last block. */
2978
- export type FootnotePlacement = 'column' | 'chapterEnd';
3243
+ * - `'chapterEnd'`: every note of the chapter after its last block;
3244
+ * - `'spread'`: sidenotes (傍注) of a vertical book (JLReq §4.2.6): the
3245
+ * notes cited on both pages of a spread are set at the fore-edge end of
3246
+ * its odd page (the left page of a right-bound book: the foot of the
3247
+ * flow, after its last line), under a rule. A note that does not fit
3248
+ * there stays on the even page, at its own fore-edge end; one cited too
3249
+ * late on the odd page goes, with its line, to the next spread. In a
3250
+ * horizontal document the notes are set as `'column'` notes and a
3251
+ * configuration warning (`footnoteSpreadHorizontal`) says so. */
3252
+ export type FootnotePlacement = 'column' | 'chapterEnd' | 'spread';
2979
3253
  /** When the note numbers start again at 1: at each chapter (a heading
2980
3254
  * that opens a page, `breakBefore`, and the start of each document of a
2981
3255
  * book), never within the document, on every page (`'page'`, the usual
2982
- * 页下注 of a Chinese book) or in every column (`'column'`, for books that
2983
- * set their notes column by column). `'page'` and `'column'` count the
2984
- * notes where the layout sets them, so they apply to notes at the column
2985
- * foot only: with `placement: 'chapterEnd'` they number by chapter. */
2986
- export type FootnoteNumbering = 'chapter' | 'document' | 'page' | 'column';
3256
+ * 页下注 of a Chinese book), in every column (`'column'`, for books that
3257
+ * set their notes column by column) or on every spread (`'spread'`, the
3258
+ * sidenotes of a Japanese book). `'page'`, `'column'` and `'spread'`
3259
+ * count the notes where the layout sets them, so they apply to notes at
3260
+ * the column foot or on the spread only: with `placement: 'chapterEnd'`
3261
+ * they number by chapter. */
3262
+ export type FootnoteNumbering = 'chapter' | 'document' | 'page' | 'column' | 'spread';
2987
3263
  /** How the marker in the text is set:
2988
3264
  * - `'superscript'`: raised and reduced, as a superscript (`text¹`);
2989
3265
  * - `'inline'`: on the baseline at `markerSize` (`text①`), centred in its
2990
3266
  * cell in vertical text — how Chinese books set circled markers;
3267
+ * - `'side'`: the interlinear marker of Japanese books (合印, JLReq
3268
+ * §4.2.3): small (`markerSize`, default 0.6 em) in the line gap beside
3269
+ * the word it marks, on the side ruby takes (right of a vertical line,
3270
+ * over a horizontal one), its end flush with the end of the word's last
3271
+ * character. It takes no room in the line, and the leading must hold it
3272
+ * as it holds ruby;
3273
+ * - `'right'`: the inline marker of Japanese vertical text (行右小書き):
3274
+ * reduced (`markerSize`, default 0.7 em) and set flush with the right
3275
+ * side of the line, taking its advance. In horizontal text it is a
3276
+ * superscript;
2991
3277
  * - `'auto'`: inline for `circled-decimal` numbers, else superscript. */
2992
- export type FootnoteMarkerPosition = 'auto' | 'superscript' | 'inline';
3278
+ export type FootnoteMarkerPosition = 'auto' | 'superscript' | 'inline' | 'side' | 'right';
2993
3279
  /** The rule set between the text and the notes of a column. */
2994
3280
  export interface FootnoteSeparatorConfig {
2995
3281
  /** Draw the rule. Default `true`. With `false` the space stays. */
@@ -3131,10 +3417,20 @@ export interface ResolvedCrossRefsConfig {
3131
3417
  page: string;
3132
3418
  defaultStyle: 'default' | 'number' | 'title' | 'page';
3133
3419
  }
3420
+ /** Footnotes. A Japanese document (`locale: 'ja'`) resolves the fields it
3421
+ * leaves unset after JLReq §4.2: a vertical one sets endnotes after each
3422
+ * chapter (後注: `placement: 'chapterEnd'`, numbered by chapter) with
3423
+ * `(1)` markers at the right of the line (`markerPosition: 'right'`,
3424
+ * `markerTemplate: '({n})'`, the digits upright by `cjk.uprightDigits`),
3425
+ * the notes hung 2 note-ems with a full em after the number; a
3426
+ * horizontal one sets them at the column foot numbered per page, with
3427
+ * superscript markers and a rule ⅓ of the measure. `placement: 'spread'`
3428
+ * numbers per spread unless `numbering` says otherwise. Every other
3429
+ * document resolves the defaults given on each field. */
3134
3430
  export interface FootnotesConfig {
3135
3431
  /** Default `'column'`. */
3136
3432
  placement?: FootnotePlacement;
3137
- /** Default `'chapter'`. */
3433
+ /** Default `'chapter'` (`'spread'` with `placement: 'spread'`). */
3138
3434
  numbering?: FootnoteNumbering;
3139
3435
  /** How the numbers are written, in any spelling of a number format
3140
3436
  * (`decimal`, `lower-roman`, `circled-decimal` / `①`, `cjk-decimal`…, see
@@ -3145,8 +3441,9 @@ export interface FootnotesConfig {
3145
3441
  * that opens the note itself follows it too: raised, or set at the size
3146
3442
  * of the note text. */
3147
3443
  markerPosition?: FootnoteMarkerPosition;
3148
- /** Size of an inline marker in the text, `em` of the text around it.
3149
- * Default `1em`. No effect on a superscript marker. */
3444
+ /** Size of an inline, side or right marker in the text, `em` of the
3445
+ * text around it. Default `1em` (`0.6em` for a side marker, `0.7em` for
3446
+ * a right one). No effect on a superscript marker. */
3150
3447
  markerSize?: Dimension;
3151
3448
  /** How a note's number is written, `{n}` standing for it in its number
3152
3449
  * format and the document's digits: `'({n})'` sets the parentheses of
@@ -3179,6 +3476,11 @@ export interface FootnotesConfig {
3179
3476
  /** Indent of the turnover lines of a note, so they align past its
3180
3477
  * number. Default `0` (the lines run flush under the number). */
3181
3478
  hangingIndent?: Dimension;
3479
+ /** The space between a note's number and its text: an en space (`'en'`,
3480
+ * the default) or a full em of the note size (`'em'`, an ideographic
3481
+ * space in CJK text: JLReq §4.2.4 sets one note-em after the number).
3482
+ * It never stretches or breaks. */
3483
+ numberGap?: 'en' | 'em';
3182
3484
  /** Space between two notes. Default `0`. */
3183
3485
  spaceBetween?: Dimension;
3184
3486
  /** Space between the last line of text and the separator rule (or the
@@ -3194,7 +3496,7 @@ export interface ResolvedFootnotesConfig {
3194
3496
  numbering: FootnoteNumbering;
3195
3497
  numberFormat: NumberFormatStyle;
3196
3498
  /** `'auto'` resolved against the number format. */
3197
- markerPosition: 'superscript' | 'inline';
3499
+ markerPosition: 'superscript' | 'inline' | 'side' | 'right';
3198
3500
  markerSize: Dimension;
3199
3501
  /** Set when it is not `'{n}'` (and holds `{n}`). */
3200
3502
  markerTemplate?: string;
@@ -3207,17 +3509,21 @@ export interface ResolvedFootnotesConfig {
3207
3509
  color?: ColorValue;
3208
3510
  textAlign?: TextAlign;
3209
3511
  hangingIndent: Dimension;
3512
+ /** Set when it is `'em'`. */
3513
+ numberGap?: 'em';
3210
3514
  spaceBetween: Dimension;
3211
3515
  spaceAbove: Dimension;
3212
3516
  spaceBelowRule: Dimension;
3213
3517
  separator: ResolvedFootnoteSeparatorConfig;
3214
3518
  }
3215
- /** The conventions Chinese text follows, after the regions clreq
3519
+ /** The conventions CJK text follows. Chinese, after the regions clreq
3216
3520
  * describes: `mainland` (China and Singapore: simplified characters,
3217
- * GB/T 15834—2011), `taiwan` and `hongkong` (traditional characters). */
3218
- export type CjkRegion = 'mainland' | 'taiwan' | 'hongkong';
3219
- /** How strictly lines of CJK text avoid starting or ending with a mark
3220
- * (clreq §6.1.1):
3521
+ * GB/T 15834—2011), `taiwan` and `hongkong` (traditional characters).
3522
+ * Japanese: `japan` (JIS X 4051, W3C JLReq), which every `ja` tag
3523
+ * resolves to. */
3524
+ export type CjkRegion = 'mainland' | 'taiwan' | 'hongkong' | 'japan';
3525
+ /** How strictly lines of CJK text avoid starting or ending with a mark.
3526
+ * The Chinese levels (clreq §6.1.1):
3221
3527
  * - `none`: a line may break between any two characters (Taiwan and Hong
3222
3528
  * Kong newspapers);
3223
3529
  * - `basic`: no line starts with a pause or stop mark (、,;:。!?), a
@@ -3228,10 +3534,25 @@ export type CjkRegion = 'mainland' | 'taiwan' | 'hongkong';
3228
3534
  * 15834—2011 §5.1.9);
3229
3535
  * - `strict`: `gb`, and no line starts with a two-em dash (——) or an
3230
3536
  * ellipsis (……).
3537
+ * The Japanese levels (kinsoku shori, JLReq §3.1.7–§3.1.10 and Appendix
3538
+ * C.3, JIS X 4051). At each no line starts with a closing bracket or
3539
+ * quote, 、,。. or a closing warichu bracket, and none ends with an
3540
+ * opening one; a line may start with ―― or …… (never break inside them,
3541
+ * nor inside ‥‥ or 〳〵); the solidus has no rule:
3542
+ * - `ja-very-strict` (JIS X 4051's default): no line starts with a small
3543
+ * kana (ぁ っ ゃ ァ ッ ョ ㇰ…), the prolonged sound mark ー, an iteration
3544
+ * mark (々 ゝ ゞ ヽ ヾ 〻), a hyphen (‐ ゠ 〜 ~ –), ?! or a middle dot
3545
+ * (・ : ;);
3546
+ * - `ja-strict`: `ja-very-strict`, but a small kana, ー and 々 may start a
3547
+ * line (JLReq's convention for general books);
3548
+ * - `ja-loose` (newspapers): only the marks named first stay off the line
3549
+ * start; hyphens, ?!, middle dots and every iteration mark may open a
3550
+ * line, and a currency sign or a unit may stand at a line end or start
3551
+ * away from a number.
3231
3552
  * At every level —— and …… never split, a number keeps its signs and its
3232
3553
  * unit (¥5,999, 50%), a Latin word stays whole unless it is wider than the
3233
3554
  * line, and a footnote marker stays with the character it follows. */
3234
- export type CjkLineBreak = 'none' | 'basic' | 'gb' | 'strict';
3555
+ export type CjkLineBreak = 'none' | 'basic' | 'gb' | 'strict' | 'ja-very-strict' | 'ja-strict' | 'ja-loose';
3235
3556
  /** East Asian typography: how Chinese, Japanese and Korean text is
3236
3557
  * composed. Every field is optional; `'auto'` follows the region of the
3237
3558
  * document language (`locale`). A paragraph is composed this way when it
@@ -3241,33 +3562,72 @@ export interface CjkConfig {
3241
3562
  /** The regional conventions to follow. `'auto'` (the default) reads them
3242
3563
  * from `locale`: `zh`, `zh-Hans`, `zh-CN` and `zh-SG` → `mainland`;
3243
3564
  * `zh-Hant` and `zh-TW` → `taiwan`; `zh-HK` and `zh-MO` → `hongkong`;
3244
- * any other language → `mainland`. */
3565
+ * `ja` and every `ja-*` tag → `japan`; any other language →
3566
+ * `mainland`. */
3245
3567
  region?: 'auto' | CjkRegion;
3246
3568
  /** Where lines may break (see {@link CjkLineBreak}). `'auto'` (the
3247
- * default): `gb` for the mainland, `basic` for Taiwan and Hong Kong. */
3569
+ * default): `gb` for the mainland, `basic` for Taiwan and Hong Kong,
3570
+ * `ja-very-strict` for Japan. */
3248
3571
  lineBreak?: 'auto' | CjkLineBreak;
3249
3572
  /** How wide the full-width marks are set (see
3250
3573
  * {@link CjkPunctuationWidth}). `'auto'` (the default): `kaiming` for
3251
- * the mainland, `fullwidth` for Taiwan and Hong Kong. */
3574
+ * the mainland, `fullwidth` for Taiwan, Hong Kong and Japan (JLReq
3575
+ * §3.1.2: 、。 inside a Japanese line keep their whole em). Japanese
3576
+ * full-width text follows JLReq throughout: ・:; take a quarter em
3577
+ * on each side, ?! none, 、 and ・ between kanji numerals none
3578
+ * (二、三日, 三・一四); a line that takes one more character gives up
3579
+ * the half em at its end first, then the blank of 、・「」 inside it,
3580
+ * never the half em after a 。 (JLReq §3.8.3); a justified line is
3581
+ * never spread inside a bracket or next to 、。・?!. */
3252
3582
  punctuationWidth?: 'auto' | CjkPunctuationWidth;
3253
3583
  /** Two marks that meet (`。」`, `》(`, `:“`) give up the half em of
3254
3584
  * blank between them, so the pair takes 1.5 em instead of 2 (clreq
3255
- * §6.3.2.2). `'auto'` (the default): on for the mainland and Hong
3256
- * Kong, off for Taiwan. */
3585
+ * §6.3.2.2, JLReq §3.1.4). `'auto'` (the default): on for the
3586
+ * mainland, Hong Kong and Japan, off for Taiwan. */
3257
3587
  compressAdjacent?: 'auto' | boolean;
3258
3588
  /** An opening bracket or quote that starts a line gives up its leading
3259
3589
  * half em, so its ink lines up with the text edge, and a closing one
3260
- * that ends a line its trailing half (clreq §6.3.2.3). `'auto'` (the
3261
- * default): on for the mainland and Hong Kong, off for Taiwan. */
3590
+ * that ends a line its trailing half (clreq §6.3.2.3, JLReq §3.1.5).
3591
+ * Japanese full-width text keeps the half em after a closing mark at
3592
+ * the end of a line: it is the first blank the line gives up, all of
3593
+ * it, when it takes in one more character (JLReq §3.8.3). `'auto'` (the
3594
+ * default): on for the mainland, Hong Kong and Japan, off for
3595
+ * Taiwan. */
3262
3596
  trimLineStart?: 'auto' | boolean;
3263
3597
  /** Whether a pause or stop mark may hang past the end of the line
3264
- * (clreq §6.1.3). `'none'` (the default): never. `'allow'`: one of
3265
- * 、,。. (on the mainland also ;:?!) hangs when it would otherwise
3266
- * open the next line and compressing the line cannot take it in; never
3267
- * in horizontal Taiwan and Hong Kong text. `'force'`: such a mark hangs
3598
+ * (clreq §6.1.3; ぶら下げ, JLReq §2.5.1, §3.8.2). `'none'`: never.
3599
+ * `'allow'`: one of 、,。. (on the mainland also ;:?!) hangs when it
3600
+ * would otherwise open the next line and compressing the line cannot
3601
+ * take it in; never in horizontal Taiwan and Hong Kong text (Japan:
3602
+ * 、,。. only, in both writing modes). `'force'`: such a mark hangs
3268
3603
  * whenever it ends a line (but the paragraph's last). Never after or
3269
- * before another mark. */
3270
- hangingPunctuation?: CjkHangingPunctuation;
3604
+ * before another mark. `'auto'` (the default): `'allow'` for Japan,
3605
+ * where many books hang 、。 (bunko in particular), `'none'` for the
3606
+ * Chinese regions. */
3607
+ hangingPunctuation?: 'auto' | CjkHangingPunctuation;
3608
+ /** The full-width space after ? and ! (JLReq §3.1.6): one em of blank
3609
+ * after a ? or ! that ends a sentence inside a paragraph, none when a
3610
+ * closing bracket or another ?! follows it, at the end of the
3611
+ * paragraph or at the end of a line (it does not carry over to the next
3612
+ * line). A space the author typed after the mark (U+3000 or a word
3613
+ * space) is replaced, not added to. The space neither stretches nor
3614
+ * shrinks when the line is justified. `'auto'` (the default): on for
3615
+ * Japan, off for the Chinese regions, whose ?! take no space. */
3616
+ spaceAfterQuestion?: 'auto' | boolean;
3617
+ /** Where an opening bracket that starts a paragraph is set (JLReq
3618
+ * §3.1.5, 起こしの括弧), see {@link CjkParagraphStartBracket}. Applies
3619
+ * to a paragraph with a first-line indent (`bodyText.firstLineIndent`)
3620
+ * that opens with 「『(〔 and the other opening brackets and quotes.
3621
+ * `'auto'` (the default): `'half'` for Japan (pattern ③, the
3622
+ * convention of literary books), and for the Chinese regions the
3623
+ * bracket is set as at any line start (`trimLineStart`). */
3624
+ paragraphStartBracket?: 'auto' | CjkParagraphStartBracket;
3625
+ /** Where a line of CJK text may break between characters (see
3626
+ * {@link CjkWordBreak}): `'keep-all'` breaks only at the spaces between
3627
+ * phrases, for kana text written with spaces (分かち書き: primers,
3628
+ * picture books) and Korean. Default `'normal'`. A paragraph style may
3629
+ * set its own (`ParagraphStyleConfig.wordBreak`). */
3630
+ wordBreak?: CjkWordBreak;
3271
3631
  /** The space set between a Han character (or kana) and a Latin letter or
3272
3632
  * a European digit next to it (`用 iPhone 拍照`), in em of the CJK
3273
3633
  * text's size or any length. Default `{ value: 0.25, unit: 'em' }`; `0`
@@ -3294,18 +3654,32 @@ export interface CjkConfig {
3294
3654
  * letters inside the same emphasis keep their italics; `'italic'` slants
3295
3655
  * them as any text (a CJK face has no italic, so the slant is
3296
3656
  * synthesised). `'auto'` (the default): `'dots'` when the document
3297
- * language (`locale`) is Chinese, `'italic'` otherwise (#193). */
3657
+ * language (`locale`) is Chinese or Japanese (傍点: Japanese has no
3658
+ * italics either), `'italic'` otherwise (#193). */
3298
3659
  emphasis?: 'auto' | CjkEmphasis;
3660
+ /** The emphasis mark `:dots[…]` and `*…*` (under `emphasis: 'dots'`)
3661
+ * set when the directive does not say: its shape, fill and side (see
3662
+ * {@link CjkEmphasisMarkConfig}). A `:dots[…]{style fill pos}`
3663
+ * attribute wins over it. */
3664
+ emphasisMark?: CjkEmphasisMarkConfig;
3299
3665
  /** What a book title marked `:book[…]` prints (#193): `'brackets'` sets
3300
- * 《》 around it (〈〉 for a title inside another), as text the lines
3301
- * are broken with; `'wavy'` draws the wavy book-title line (书名号甲式)
3302
- * under it (left of it in vertical text); `'none'` prints the bare
3303
- * title. `'auto'` (the default): brackets for the mainland, the wavy
3304
- * line for Taiwan and Hong Kong (`region`). */
3666
+ * the brackets of `bookTitleBrackets` around it (《》 on the mainland,
3667
+ * 『』 in Japan), as text the lines are broken with; `'wavy'` draws the
3668
+ * wavy book-title line (书名号甲式) under it (left of it in vertical
3669
+ * text); `'none'` prints the bare title. `'auto'` (the default):
3670
+ * brackets for the mainland and Japan, the wavy line for Taiwan and
3671
+ * Hong Kong (`region`). */
3305
3672
  bookTitleMark?: 'auto' | CjkBookTitleMark;
3306
- /** Colour of the emphasis dots and of the proper-name and book-title
3307
- * lines. Unset: the colour of the text they mark (#193). The default of
3308
- * the ruby and warichu colours too. */
3673
+ /** The brackets `bookTitleMark: 'brackets'` sets around a book title:
3674
+ * the outermost title's pair first, then the pair of a title inside it
3675
+ * (a title deeper still takes the last pair). `'auto'` (the default):
3676
+ * 《》 then 〈〉 for Chinese (GB/T 15834—2011), 『』 then 「」 for Japan
3677
+ * (『』 for a book, 「」 for an article or a chapter named inside its
3678
+ * title). */
3679
+ bookTitleBrackets?: 'auto' | CjkBracketPair[];
3680
+ /** Colour of the emphasis dots, of the proper-name and book-title lines
3681
+ * and of side lines (`:sideline[…]`). Unset: the colour of the text
3682
+ * they mark (#193). The default of the ruby and warichu colours too. */
3309
3683
  annotationColor?: ColorValue;
3310
3684
  /** Ruby: how readings (pinyin, zhuyin) set with `:ruby[…]{rt="…"}` or
3311
3685
  * `{紅樓|hóng|lóu}` look (see {@link CjkRubyConfig}, #194). */
@@ -3313,11 +3687,47 @@ export interface CjkConfig {
3313
3687
  /** Warichu (双行夹注): how the two-row notes of `:warichu[…]` look (see
3314
3688
  * {@link CjkWarichuConfig}, #195). */
3315
3689
  warichu?: CjkWarichuConfig;
3690
+ /** Kanbun reading marks (訓点): how the 返り点 and 送り仮名 of
3691
+ * `:kunten[字]{kaeri okuri tate}` look and where they go (see
3692
+ * {@link CjkKuntenConfig}, #430). */
3693
+ kunten?: CjkKuntenConfig;
3316
3694
  }
3317
3695
  /** See {@link CjkConfig.emphasis}. */
3318
3696
  export type CjkEmphasis = 'italic' | 'dots';
3319
3697
  /** See {@link CjkConfig.bookTitleMark}. */
3320
3698
  export type CjkBookTitleMark = 'brackets' | 'wavy' | 'none';
3699
+ /** An opening and a closing bracket (`『` `』`), set at the text size. */
3700
+ export interface CjkBracketPair {
3701
+ open: string;
3702
+ close: string;
3703
+ }
3704
+ /** The shape of an emphasis mark: a dot ●, a circle ○, a sesame ﹅. */
3705
+ export type CjkEmphasisMarkStyle = 'dot' | 'circle' | 'sesame';
3706
+ /** `cjk.emphasisMark`: the emphasis mark set on each character (着重号,
3707
+ * 傍点). Every field is optional; `'auto'` follows the region. */
3708
+ export interface CjkEmphasisMarkConfig {
3709
+ /** `'auto'` (the default): the sesame ﹅ in Japan, in horizontal and
3710
+ * vertical text alike (JLReq §3.3.9, the Aozora 傍点; CSS keeps a
3711
+ * circle for horizontal `filled`, which literary books do not); the
3712
+ * dot elsewhere (着重号, GB/T 15834—2011). */
3713
+ style?: 'auto' | CjkEmphasisMarkStyle;
3714
+ /** `'auto'` (the default): filled, open for a circle. */
3715
+ fill?: 'auto' | 'filled' | 'open';
3716
+ /** Which side of the text, in its flow: `over` is above horizontal
3717
+ * text and right of vertical text, `under` below it and to its left.
3718
+ * `'auto'` (the default): over in Japan (JLReq §3.3.9: right of
3719
+ * vertical text, above horizontal text); for Chinese under horizontal
3720
+ * text and right of vertical text (clreq). */
3721
+ position?: 'auto' | 'over' | 'under';
3722
+ }
3723
+ /** `cjk.emphasisMark` resolved: the shape, and the fill and side when the
3724
+ * region or the author sets one (`'auto'`: a circle open, anything else
3725
+ * filled; under horizontal text, right of vertical text). */
3726
+ export interface ResolvedCjkEmphasisMarkConfig {
3727
+ style: CjkEmphasisMarkStyle;
3728
+ fill: 'auto' | 'filled' | 'open';
3729
+ position: 'auto' | 'over' | 'under';
3730
+ }
3321
3731
  /** Where a ruby reading goes: over the base (in vertical text: to its
3322
3732
  * right), under it (to its left), or right of each character inside the
3323
3733
  * line (zhuyin in horizontal text; the same as `over` in vertical text). */
@@ -3342,7 +3752,47 @@ export interface CjkRubyConfig {
3342
3752
  * right of each character, anything else (pinyin) over the base in
3343
3753
  * horizontal text and right of it in vertical text. */
3344
3754
  position?: 'auto' | CjkRubyPosition;
3345
- }
3755
+ /** What a reading longer than its base may run onto (肩掛け, JLReq
3756
+ * §3.3.8) before the base is spread (see {@link CjkRubyOverhang}).
3757
+ * `'auto'` (the default): `kana` in Japan (`region`); elsewhere a
3758
+ * quarter of the ruby em onto any neighbour without a reading
3759
+ * (clreq). */
3760
+ overhang?: 'auto' | CjkRubyOverhang;
3761
+ /** Where a reading sits on its base (see {@link CjkRubyAlign}).
3762
+ * `'auto'` (the default): `jis` in Japan; elsewhere centred, as
3763
+ * `center`. */
3764
+ align?: 'auto' | CjkRubyAlign;
3765
+ /** Small kana in readings (ゃゅょっ…): `keep` (the default) paints them
3766
+ * as written, as modern books do; `full` paints them full size
3767
+ * (がつこう for がっこう), as letterpress books did (JLReq §3.3.3
3768
+ * note). The text read and copied keeps the small kana. */
3769
+ smallKana?: 'keep' | 'full';
3770
+ }
3771
+ /** What a ruby reading longer than its base may run onto, past the
3772
+ * base's edge, before the base is spread (JLReq §3.3.8):
3773
+ * - `none`: nothing; the base is spread to the reading;
3774
+ * - `kana`: up to one ruby character (half an em of the text) onto
3775
+ * hiragana, katakana, small kana and ー, onto the blank of a mark (the
3776
+ * half em after 、。」 before the reading, an ideographic space, a
3777
+ * middle dot's quarter, …… and ――), at most half a ruby character
3778
+ * onto an opening bracket; never onto kanji, Latin text or another
3779
+ * base; two readings never share a kana from both sides (the later one
3780
+ * keeps to its base);
3781
+ * - `any`: up to half a ruby character onto any neighbour without a
3782
+ * reading.
3783
+ * Never past the line's start or end: a reading at a line edge is set
3784
+ * flush with it and its base moves in. */
3785
+ export type CjkRubyOverhang = 'none' | 'kana' | 'any';
3786
+ /** Where a ruby reading sits on its base (JIS X 4051 §12, JLReq §3.3.6):
3787
+ * - `center`: centred; a longer reading centred over its base, which is
3788
+ * centred in the box the reading needs;
3789
+ * - `jis`: a shorter reading spread 1:2:1 (half a unit before the first
3790
+ * character and after the last, one between characters; `ruby-align:
3791
+ * space-around`), or flush with both ends of the base (`space-between`)
3792
+ * when the half unit would exceed one ruby character; a longer reading
3793
+ * set solid over a base spread 1:2:1;
3794
+ * - `start`: from the base's start (肩付き, a vertical-text practice). */
3795
+ export type CjkRubyAlign = 'center' | 'jis' | 'start';
3346
3796
  /** `cjk.warichu`: the look of warichu notes (双行夹注). */
3347
3797
  export interface CjkWarichuConfig {
3348
3798
  /** Size of the note's characters, in em of the text (or any length);
@@ -3353,16 +3803,53 @@ export interface CjkWarichuConfig {
3353
3803
  * vermilion). Unset: `cjk.annotationColor`, else the text colour. */
3354
3804
  color?: ColorValue;
3355
3805
  /** Brackets set at the text size before the first row and after the
3356
- * last one (`〔` `〕`, `(` `)`). Default: none. A note's own
3357
- * `open` / `close` attributes win. */
3806
+ * last one (`〔` `〕`, `(` `)`). Default: none, but `(` `)` for
3807
+ * Japan (`region`; JLReq §3.4.2). An empty string sets none. A note's
3808
+ * own `open` / `close` attributes win. */
3358
3809
  open?: string;
3359
3810
  close?: string;
3360
3811
  }
3812
+ /** Where the 返り点 of a kanbun text go (see {@link CjkKuntenConfig}):
3813
+ * - `inline` (JIS X 4051 §5.5): right after their character, in the
3814
+ * left half of a vertical line (the lower half of a horizontal one),
3815
+ * taking their own advance; a 竪点 takes half an em between the two
3816
+ * characters it joins, and 送り仮名 longer than the room beside their
3817
+ * character push the next one on (§5.6.4);
3818
+ * - `interlinear`: in the line gap left of the character's lower half
3819
+ * (under it in horizontal text), taking no advance, as many school
3820
+ * editions set them; the characters keep an even pitch and 送り仮名 run
3821
+ * on beside the next character. */
3822
+ export type CjkKuntenPlacement = 'inline' | 'interlinear';
3823
+ /** `cjk.kunten`: the look of kanbun reading marks (`:kunten[…]`). */
3824
+ export interface CjkKuntenConfig {
3825
+ /** Size of the 返り点 and 送り仮名, in em of the text (or any length).
3826
+ * Default `{ value: 0.5, unit: 'em' }` (JIS X 4051 §5.5, §5.6). */
3827
+ fontSize?: Dimension;
3828
+ /** Colour of the marks. Unset: `cjk.annotationColor`, else the text
3829
+ * colour. */
3830
+ color?: ColorValue;
3831
+ /** Where the 返り点 go (see {@link CjkKuntenPlacement}). Default
3832
+ * `inline`. */
3833
+ placement?: CjkKuntenPlacement;
3834
+ }
3835
+ export interface ResolvedCjkKuntenConfig {
3836
+ fontSize: Dimension;
3837
+ color?: ColorValue;
3838
+ placement: CjkKuntenPlacement;
3839
+ }
3361
3840
  export interface ResolvedCjkRubyConfig {
3362
3841
  fontFamily?: string;
3363
3842
  fontSize: Dimension;
3364
3843
  color?: ColorValue;
3365
3844
  position: 'auto' | CjkRubyPosition;
3845
+ /** Set only when it is not clreq's quarter em (Japan, or set): absent,
3846
+ * a longer reading passes its base by a quarter of the ruby em onto a
3847
+ * neighbour without a reading. */
3848
+ overhang?: CjkRubyOverhang;
3849
+ /** Set only when it is not the plain centring (Japan, or set). */
3850
+ align?: CjkRubyAlign;
3851
+ /** Set only when on. */
3852
+ smallKana?: 'full';
3366
3853
  }
3367
3854
  export interface ResolvedCjkWarichuConfig {
3368
3855
  fontSize: Dimension;
@@ -3386,6 +3873,31 @@ export interface ResolvedCjkWarichuConfig {
3386
3873
  export type CjkPunctuationWidth = 'fullwidth' | 'kaiming' | 'lineEndHalf' | 'halfwidth';
3387
3874
  /** See {@link CjkConfig.hangingPunctuation}. */
3388
3875
  export type CjkHangingPunctuation = 'none' | 'allow' | 'force';
3876
+ /** An opening bracket at the start of an indented paragraph (JLReq
3877
+ * §3.1.5, with an indent of one em):
3878
+ * - `indent` (pattern ①, JIS X 4051's default): the indent, then the
3879
+ * bracket without the half em of blank before its glyph; the text
3880
+ * after it starts at 1.5 em;
3881
+ * - `half` (pattern ③, most literary publishers): the bracket's glyph
3882
+ * sits in the second half of the indent, so the text after it starts
3883
+ * where the indent ends; with a one-em indent it reads as the bracket
3884
+ * filling the indent cell with its half em of blank;
3885
+ * - `flush` (天付き): no indent; the bracket's glyph at the start of the
3886
+ * line.
3887
+ * A bracket that opens a later line of the paragraph follows
3888
+ * `trimLineStart`. */
3889
+ export type CjkParagraphStartBracket = 'indent' | 'half' | 'flush';
3890
+ /** Where a line of CJK text may break between two characters (CSS
3891
+ * `word-break`):
3892
+ * - `normal`: between any two characters, as `cjk.lineBreak` allows;
3893
+ * - `keep-all`: only at a space (U+0020, U+3000), at a zero-width space,
3894
+ * and next to punctuation where `cjk.lineBreak` allows it (after 、。」,
3895
+ * before 「); never between two letters (kana, kanji, hangul, Latin).
3896
+ * The text is written with a space between phrases (分かち書き in
3897
+ * picture books and first readers set in kana, Korean 어절), and lines
3898
+ * break only there; kinsoku still applies. A phrase longer than the
3899
+ * line is broken inside it anyway, where `normal` would break it. */
3900
+ export type CjkWordBreak = 'normal' | 'keep-all';
3389
3901
  /** The character grid of `cjk.grid`: the type area is derived from the
3390
3902
  * body size, not authored as margins. Each column is `charsPerLine` ems
3391
3903
  * wide and holds `linesPerPage` lines of the body's line height; with two
@@ -3421,14 +3933,26 @@ export interface ResolvedCjkConfig {
3421
3933
  compressAdjacent: boolean;
3422
3934
  trimLineStart: boolean;
3423
3935
  hangingPunctuation: CjkHangingPunctuation;
3936
+ /** Set (true) only when on: absent, ?! take no space after them. */
3937
+ spaceAfterQuestion?: true;
3938
+ /** Set only when it differs from a line start: absent, a bracket that
3939
+ * opens a paragraph is set as at any line start. */
3940
+ paragraphStartBracket?: CjkParagraphStartBracket;
3941
+ /** Set only when `'keep-all'`: absent, lines break between any two
3942
+ * characters (`normal`). */
3943
+ wordBreak?: 'keep-all';
3424
3944
  latinSpacing: Dimension;
3425
3945
  uprightDigits: 0 | 2 | 3 | 4;
3426
3946
  grid: ResolvedCjkGridConfig;
3427
3947
  emphasis: CjkEmphasis;
3948
+ emphasisMark: ResolvedCjkEmphasisMarkConfig;
3428
3949
  bookTitleMark: CjkBookTitleMark;
3950
+ /** At least one pair. */
3951
+ bookTitleBrackets: CjkBracketPair[];
3429
3952
  annotationColor?: ColorValue;
3430
3953
  ruby: ResolvedCjkRubyConfig;
3431
3954
  warichu: ResolvedCjkWarichuConfig;
3955
+ kunten: ResolvedCjkKuntenConfig;
3432
3956
  }
3433
3957
  export type PdfColorSpace = 'rgb' | 'cmyk' | 'grayscale';
3434
3958
  /** How postext-pdf writes the file. Layout ignores it; the VDT carries it
@@ -4255,11 +4779,26 @@ export interface IndexConfig {
4255
4779
  * for 重阳);
4256
4780
  * - `'stroke'`: under the stroke count of its first character (一畫,
4257
4781
  * 二畫 …; 一画 … in Simplified Chinese);
4782
+ * - `'gojuon'` (五十音, #425): under the gojūon row of the first kana of
4783
+ * the entry's reading (あ行 か行 さ行 た行 な行 は行 ま行 や行 ら行
4784
+ * わ行); see below for the order;
4785
+ * - `'kana'`: under the first kana of the reading itself (か for が,
4786
+ * カ and ヵ);
4258
4787
  * - `'none'`: no heads; symbols, numbers and words are set apart by the
4259
4788
  * groups' `marginTop` only;
4260
4789
  * - `'auto'` (default): `'pinyin'` in Simplified Chinese (`zh`,
4261
4790
  * `zh-Hans`, `zh-CN`), `'stroke'` in Traditional Chinese (`zh-Hant`,
4262
- * `zh-TW`, `zh-HK`), `'letter'` in any other language.
4791
+ * `zh-TW`, `zh-HK`), `'gojuon'` in Japanese (`ja`, `ja-JP`),
4792
+ * `'letter'` in any other language.
4793
+ *
4794
+ * A Japanese index (or one grouped by `gojuon` or `kana`) sorts by the
4795
+ * entries' readings in JIS X 4061 order: symbols, digits, Latin (under
4796
+ * their letters), then the kana rows; katakana file as hiragana, small
4797
+ * kana as large, voiced as plain (清 < 濁 < 半濁 break the ties), ー as
4798
+ * the vowel before it. The reading is the mark's `yomi` (alias
4799
+ * `reading`), else the kana ruby of the marked text, else `sort`; an
4800
+ * entry with a kanji and no reading raises `indexReadingMissing` and
4801
+ * files after the kana, with no head.
4263
4802
  *
4264
4803
  * The entries sort in the collation the heads come from (a
4265
4804
  * `zh-Hant` index grouped by pinyin sorts by pinyin). A browser without
@@ -4276,7 +4815,7 @@ export interface IndexConfig {
4276
4815
  ignoreArticle?: boolean;
4277
4816
  }
4278
4817
  /** See {@link IndexConfig.groupBy}. */
4279
- export type IndexGroupBy = 'auto' | 'letter' | 'pinyin' | 'stroke' | 'none';
4818
+ export type IndexGroupBy = 'auto' | 'letter' | 'pinyin' | 'stroke' | 'gojuon' | 'kana' | 'none';
4280
4819
  export interface ResolvedIndexConfig {
4281
4820
  fontFamily: string;
4282
4821
  fontSize: Dimension;
@@ -4331,6 +4870,9 @@ export interface PostextConfig {
4331
4870
  captionStyle?: CaptionStyleConfig;
4332
4871
  /** Styling for embedded SVG diagrams (single-ink reproduction). */
4333
4872
  diagramStyle?: DiagramStyleConfig;
4873
+ /** How video resources are printed (poster overlays: play mark, QR
4874
+ * code) and played (player options). */
4875
+ videoStyle?: VideoStyleConfig;
4334
4876
  /** Named paragraph styles for `:::paragraphs{style="…"}` containers. */
4335
4877
  paragraphStyles?: ParagraphStyleConfig[];
4336
4878
  /** Named callout styles for `:::callout{type="…"}` containers. Defaults
@@ -4418,7 +4960,9 @@ export interface PostextConfig {
4418
4960
  customFonts?: CustomFontFamily[];
4419
4961
  /** User-definable resource categories (figures, tables, etc.) that drive
4420
4962
  * typed numbering, caption prefixes, and inline references. Defaults to
4421
- * the built-in 'figure' and 'table' types when unset, localised to the
4963
+ * the built-in 'figure', 'table' and 'video' types when unset (a list
4964
+ * with no 'video' type still numbers video resources typed `video` with
4965
+ * the built-in one), localised to the
4422
4966
  * document language (`defaultResourceTypes(locale)`, where the language is
4423
4967
  * {@link locale}, else `bodyText.hyphenation.locale`, else English). */
4424
4968
  resourceTypes?: ResourceType[];