postext 1.46.4 → 1.48.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 (353) hide show
  1. package/dist/__tests__/bundle/designOverflowPin.test.js +1 -1
  2. package/dist/__tests__/bundle/gridBreakRulesPin.test.js +2 -2
  3. package/dist/__tests__/bundle/shapingLanguagePin.test.js +3 -3
  4. package/dist/__tests__/bundle/taskBoxPin.test.js +1 -1
  5. package/dist/__tests__/bundle.test.js +1 -1
  6. package/dist/__tests__/codeBlocks.test.js +1 -1
  7. package/dist/__tests__/comics/config.test.js +20 -0
  8. package/dist/__tests__/comics/config.test.js.map +1 -1
  9. package/dist/__tests__/composed/cardShapes.test.d.ts +2 -0
  10. package/dist/__tests__/composed/cardShapes.test.d.ts.map +1 -0
  11. package/dist/__tests__/composed/cardShapes.test.js +82 -0
  12. package/dist/__tests__/composed/cardShapes.test.js.map +1 -0
  13. package/dist/__tests__/composed/connectors.test.d.ts +2 -0
  14. package/dist/__tests__/composed/connectors.test.d.ts.map +1 -0
  15. package/dist/__tests__/composed/connectors.test.js +349 -0
  16. package/dist/__tests__/composed/connectors.test.js.map +1 -0
  17. package/dist/__tests__/composed/decorationSidePoints.test.d.ts +2 -0
  18. package/dist/__tests__/composed/decorationSidePoints.test.d.ts.map +1 -0
  19. package/dist/__tests__/composed/decorationSidePoints.test.js +164 -0
  20. package/dist/__tests__/composed/decorationSidePoints.test.js.map +1 -0
  21. package/dist/__tests__/composed/fit.test.js +2 -1
  22. package/dist/__tests__/composed/fit.test.js.map +1 -1
  23. package/dist/__tests__/composed/fixtures/connectors.d.ts +33 -0
  24. package/dist/__tests__/composed/fixtures/connectors.d.ts.map +1 -0
  25. package/dist/__tests__/composed/fixtures/connectors.js +142 -0
  26. package/dist/__tests__/composed/fixtures/connectors.js.map +1 -0
  27. package/dist/__tests__/composed/fixtures/grid.d.ts +32 -0
  28. package/dist/__tests__/composed/fixtures/grid.d.ts.map +1 -0
  29. package/dist/__tests__/composed/fixtures/grid.js +53 -0
  30. package/dist/__tests__/composed/fixtures/grid.js.map +1 -0
  31. package/dist/__tests__/composed/fixtures/legendMap.d.ts +24 -0
  32. package/dist/__tests__/composed/fixtures/legendMap.d.ts.map +1 -0
  33. package/dist/__tests__/composed/fixtures/legendMap.js +117 -0
  34. package/dist/__tests__/composed/fixtures/legendMap.js.map +1 -0
  35. package/dist/__tests__/composed/fixtures/mapParts.d.ts +58 -0
  36. package/dist/__tests__/composed/fixtures/mapParts.d.ts.map +1 -0
  37. package/dist/__tests__/composed/fixtures/mapParts.js +192 -0
  38. package/dist/__tests__/composed/fixtures/mapParts.js.map +1 -0
  39. package/dist/__tests__/composed/fixtures/modules.d.ts +55 -0
  40. package/dist/__tests__/composed/fixtures/modules.d.ts.map +1 -0
  41. package/dist/__tests__/composed/fixtures/modules.js +123 -0
  42. package/dist/__tests__/composed/fixtures/modules.js.map +1 -0
  43. package/dist/__tests__/composed/grid.test.d.ts +2 -0
  44. package/dist/__tests__/composed/grid.test.d.ts.map +1 -0
  45. package/dist/__tests__/composed/grid.test.js +357 -0
  46. package/dist/__tests__/composed/grid.test.js.map +1 -0
  47. package/dist/__tests__/composed/groups.test.js +6 -3
  48. package/dist/__tests__/composed/groups.test.js.map +1 -1
  49. package/dist/__tests__/composed/labelLegend.test.d.ts +2 -0
  50. package/dist/__tests__/composed/labelLegend.test.d.ts.map +1 -0
  51. package/dist/__tests__/composed/labelLegend.test.js +268 -0
  52. package/dist/__tests__/composed/labelLegend.test.js.map +1 -0
  53. package/dist/__tests__/composed/labelsChecks.test.js.map +1 -1
  54. package/dist/__tests__/composed/leaders.test.d.ts +2 -0
  55. package/dist/__tests__/composed/leaders.test.d.ts.map +1 -0
  56. package/dist/__tests__/composed/leaders.test.js +372 -0
  57. package/dist/__tests__/composed/leaders.test.js.map +1 -0
  58. package/dist/__tests__/composed/modules.test.d.ts +2 -0
  59. package/dist/__tests__/composed/modules.test.d.ts.map +1 -0
  60. package/dist/__tests__/composed/modules.test.js +352 -0
  61. package/dist/__tests__/composed/modules.test.js.map +1 -0
  62. package/dist/__tests__/composed/overConnectors.test.d.ts +2 -0
  63. package/dist/__tests__/composed/overConnectors.test.d.ts.map +1 -0
  64. package/dist/__tests__/composed/overConnectors.test.js +232 -0
  65. package/dist/__tests__/composed/overConnectors.test.js.map +1 -0
  66. package/dist/__tests__/composed/overlap.test.d.ts +2 -0
  67. package/dist/__tests__/composed/overlap.test.d.ts.map +1 -0
  68. package/dist/__tests__/composed/overlap.test.js +339 -0
  69. package/dist/__tests__/composed/overlap.test.js.map +1 -0
  70. package/dist/__tests__/composed/viewerLeaf.test.d.ts +2 -0
  71. package/dist/__tests__/composed/viewerLeaf.test.d.ts.map +1 -0
  72. package/dist/__tests__/composed/viewerLeaf.test.js +106 -0
  73. package/dist/__tests__/composed/viewerLeaf.test.js.map +1 -0
  74. package/dist/__tests__/composedTemplates.test.js +1 -1
  75. package/dist/__tests__/design/boxShape.test.d.ts +2 -0
  76. package/dist/__tests__/design/boxShape.test.d.ts.map +1 -0
  77. package/dist/__tests__/design/boxShape.test.js +126 -0
  78. package/dist/__tests__/design/boxShape.test.js.map +1 -0
  79. package/dist/__tests__/design/boxShapePaint.test.d.ts +2 -0
  80. package/dist/__tests__/design/boxShapePaint.test.d.ts.map +1 -0
  81. package/dist/__tests__/design/boxShapePaint.test.js +130 -0
  82. package/dist/__tests__/design/boxShapePaint.test.js.map +1 -0
  83. package/dist/__tests__/design/openerBottomAnchor.test.js.map +1 -1
  84. package/dist/__tests__/design/pathBlock.test.d.ts +2 -0
  85. package/dist/__tests__/design/pathBlock.test.d.ts.map +1 -0
  86. package/dist/__tests__/design/pathBlock.test.js +194 -0
  87. package/dist/__tests__/design/pathBlock.test.js.map +1 -0
  88. package/dist/__tests__/design/pathElement.test.d.ts +2 -0
  89. package/dist/__tests__/design/pathElement.test.d.ts.map +1 -0
  90. package/dist/__tests__/design/pathElement.test.js +257 -0
  91. package/dist/__tests__/design/pathElement.test.js.map +1 -0
  92. package/dist/__tests__/design/svgPath.test.d.ts +2 -0
  93. package/dist/__tests__/design/svgPath.test.d.ts.map +1 -0
  94. package/dist/__tests__/design/svgPath.test.js +144 -0
  95. package/dist/__tests__/design/svgPath.test.js.map +1 -0
  96. package/dist/__tests__/exports.test.js +53 -0
  97. package/dist/__tests__/exports.test.js.map +1 -1
  98. package/dist/__tests__/fontUsage.test.js +46 -0
  99. package/dist/__tests__/fontUsage.test.js.map +1 -1
  100. package/dist/__tests__/hardBreaks.test.js +1 -1
  101. package/dist/__tests__/headingInlineMarks.test.js +1 -1
  102. package/dist/__tests__/labelGlyphPaint.test.d.ts +2 -0
  103. package/dist/__tests__/labelGlyphPaint.test.d.ts.map +1 -0
  104. package/dist/__tests__/labelGlyphPaint.test.js +86 -0
  105. package/dist/__tests__/labelGlyphPaint.test.js.map +1 -0
  106. package/dist/__tests__/mathSizeMigration.test.js +2 -2
  107. package/dist/__tests__/migrate/labelsOnPictures.test.js +1 -1
  108. package/dist/__tests__/migrate/labelsOnPictures.test.js.map +1 -1
  109. package/dist/__tests__/parse/containers.test.js +1 -1
  110. package/dist/__tests__/parse/containers.test.js.map +1 -1
  111. package/dist/__tests__/pipeline/calloutInlineResourceGap.test.js +1 -1
  112. package/dist/__tests__/pipeline/calloutLabelGlyph.test.d.ts +2 -0
  113. package/dist/__tests__/pipeline/calloutLabelGlyph.test.d.ts.map +1 -0
  114. package/dist/__tests__/pipeline/calloutLabelGlyph.test.js +198 -0
  115. package/dist/__tests__/pipeline/calloutLabelGlyph.test.js.map +1 -0
  116. package/dist/__tests__/pipeline/calloutShapes.test.d.ts +2 -0
  117. package/dist/__tests__/pipeline/calloutShapes.test.d.ts.map +1 -0
  118. package/dist/__tests__/pipeline/calloutShapes.test.js +159 -0
  119. package/dist/__tests__/pipeline/calloutShapes.test.js.map +1 -0
  120. package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.js +1 -1
  121. package/dist/__tests__/pipeline/colonListRoom.test.js +1 -1
  122. package/dist/__tests__/pipeline/compoundBreaks.test.js +1 -1
  123. package/dist/__tests__/pipeline/dashBreaks.test.js +1 -1
  124. package/dist/__tests__/pipeline/headingSplitOrphans.test.js +1 -1
  125. package/dist/__tests__/pipeline/inlineFigureSpace.test.js +1 -1
  126. package/dist/__tests__/pipeline/paragraphContainerTail.test.js +1 -1
  127. package/dist/__tests__/pipeline/raggedOptimal.test.js +1 -1
  128. package/dist/__tests__/prepareFonts.test.js +8 -6
  129. package/dist/__tests__/prepareFonts.test.js.map +1 -1
  130. package/dist/__tests__/verseLines.test.js +1 -1
  131. package/dist/bundle/configVersion.d.ts +12 -3
  132. package/dist/bundle/configVersion.d.ts.map +1 -1
  133. package/dist/bundle/configVersion.js +16 -5
  134. package/dist/bundle/configVersion.js.map +1 -1
  135. package/dist/canvas-backend/blockRender.js +3 -3
  136. package/dist/canvas-backend/blockRender.js.map +1 -1
  137. package/dist/canvas-backend/composed.d.ts +4 -2
  138. package/dist/canvas-backend/composed.d.ts.map +1 -1
  139. package/dist/canvas-backend/composed.js +12 -7
  140. package/dist/canvas-backend/composed.js.map +1 -1
  141. package/dist/canvas-backend/headerFooter.d.ts +17 -1
  142. package/dist/canvas-backend/headerFooter.d.ts.map +1 -1
  143. package/dist/canvas-backend/headerFooter.js +64 -1
  144. package/dist/canvas-backend/headerFooter.js.map +1 -1
  145. package/dist/canvas-backend/index.d.ts.map +1 -1
  146. package/dist/canvas-backend/index.js +7 -1
  147. package/dist/canvas-backend/index.js.map +1 -1
  148. package/dist/canvas-backend/renderResourceBlock.d.ts.map +1 -1
  149. package/dist/canvas-backend/renderResourceBlock.js +17 -6
  150. package/dist/canvas-backend/renderResourceBlock.js.map +1 -1
  151. package/dist/canvas-backend/swatch.d.ts +20 -1
  152. package/dist/canvas-backend/swatch.d.ts.map +1 -1
  153. package/dist/canvas-backend/swatch.js +51 -1
  154. package/dist/canvas-backend/swatch.js.map +1 -1
  155. package/dist/comics/fonts.d.ts +19 -0
  156. package/dist/comics/fonts.d.ts.map +1 -1
  157. package/dist/comics/fonts.js +70 -17
  158. package/dist/comics/fonts.js.map +1 -1
  159. package/dist/comics/layoutPage.d.ts.map +1 -1
  160. package/dist/comics/layoutPage.js +6 -1
  161. package/dist/comics/layoutPage.js.map +1 -1
  162. package/dist/composed/continuation.d.ts +10 -2
  163. package/dist/composed/continuation.d.ts.map +1 -1
  164. package/dist/composed/continuation.js +10 -2
  165. package/dist/composed/continuation.js.map +1 -1
  166. package/dist/composed/document.d.ts +45 -1
  167. package/dist/composed/document.d.ts.map +1 -1
  168. package/dist/composed/document.js +76 -17
  169. package/dist/composed/document.js.map +1 -1
  170. package/dist/composed/labelText.d.ts +9 -1
  171. package/dist/composed/labelText.d.ts.map +1 -1
  172. package/dist/composed/labelText.js +23 -1
  173. package/dist/composed/labelText.js.map +1 -1
  174. package/dist/composed/labels.d.ts +57 -3
  175. package/dist/composed/labels.d.ts.map +1 -1
  176. package/dist/composed/labels.js +261 -12
  177. package/dist/composed/labels.js.map +1 -1
  178. package/dist/composed/modules.d.ts +30 -0
  179. package/dist/composed/modules.d.ts.map +1 -0
  180. package/dist/composed/modules.js +194 -0
  181. package/dist/composed/modules.js.map +1 -0
  182. package/dist/composed/overlap.d.ts +52 -0
  183. package/dist/composed/overlap.d.ts.map +1 -0
  184. package/dist/composed/overlap.js +611 -0
  185. package/dist/composed/overlap.js.map +1 -0
  186. package/dist/composed/paint.d.ts +28 -5
  187. package/dist/composed/paint.d.ts.map +1 -1
  188. package/dist/composed/paint.js +26 -5
  189. package/dist/composed/paint.js.map +1 -1
  190. package/dist/composed/reflowLog.d.ts +6 -1
  191. package/dist/composed/reflowLog.d.ts.map +1 -1
  192. package/dist/composed/reflowLog.js +43 -0
  193. package/dist/composed/reflowLog.js.map +1 -1
  194. package/dist/composed/repeat.d.ts +66 -0
  195. package/dist/composed/repeat.d.ts.map +1 -0
  196. package/dist/composed/repeat.js +217 -0
  197. package/dist/composed/repeat.js.map +1 -0
  198. package/dist/composed/slotChecks.d.ts +1 -1
  199. package/dist/composed/slotChecks.d.ts.map +1 -1
  200. package/dist/composed/slotChecks.js +114 -8
  201. package/dist/composed/slotChecks.js.map +1 -1
  202. package/dist/composed/sourceMap.d.ts.map +1 -1
  203. package/dist/composed/sourceMap.js +16 -4
  204. package/dist/composed/sourceMap.js.map +1 -1
  205. package/dist/composed/spread.d.ts.map +1 -1
  206. package/dist/composed/spread.js +6 -2
  207. package/dist/composed/spread.js.map +1 -1
  208. package/dist/composed/templates.d.ts +22 -2
  209. package/dist/composed/templates.d.ts.map +1 -1
  210. package/dist/composed/templates.js +159 -9
  211. package/dist/composed/templates.js.map +1 -1
  212. package/dist/composed/types.d.ts +140 -7
  213. package/dist/composed/types.d.ts.map +1 -1
  214. package/dist/composed/validate.d.ts +1 -1
  215. package/dist/composed/validate.d.ts.map +1 -1
  216. package/dist/composed/validate.js +101 -4
  217. package/dist/composed/validate.js.map +1 -1
  218. package/dist/composed/wrap.d.ts.map +1 -1
  219. package/dist/composed/wrap.js +95 -17
  220. package/dist/composed/wrap.js.map +1 -1
  221. package/dist/configWarnings.d.ts +7 -1
  222. package/dist/configWarnings.d.ts.map +1 -1
  223. package/dist/configWarnings.js +275 -4
  224. package/dist/configWarnings.js.map +1 -1
  225. package/dist/contrast.d.ts.map +1 -1
  226. package/dist/contrast.js +8 -0
  227. package/dist/contrast.js.map +1 -1
  228. package/dist/defaults/calloutStyles.d.ts +10 -1
  229. package/dist/defaults/calloutStyles.d.ts.map +1 -1
  230. package/dist/defaults/calloutStyles.js +46 -7
  231. package/dist/defaults/calloutStyles.js.map +1 -1
  232. package/dist/defaults/comics.d.ts +2 -1
  233. package/dist/defaults/comics.d.ts.map +1 -1
  234. package/dist/defaults/comics.js +18 -3
  235. package/dist/defaults/comics.js.map +1 -1
  236. package/dist/defaults/headerFooter.d.ts.map +1 -1
  237. package/dist/defaults/headerFooter.js +38 -0
  238. package/dist/defaults/headerFooter.js.map +1 -1
  239. package/dist/design/boxShape.d.ts +101 -0
  240. package/dist/design/boxShape.d.ts.map +1 -0
  241. package/dist/design/boxShape.js +398 -0
  242. package/dist/design/boxShape.js.map +1 -0
  243. package/dist/design/connector.d.ts +75 -0
  244. package/dist/design/connector.d.ts.map +1 -0
  245. package/dist/design/connector.js +325 -0
  246. package/dist/design/connector.js.map +1 -0
  247. package/dist/design/layout.d.ts +56 -3
  248. package/dist/design/layout.d.ts.map +1 -1
  249. package/dist/design/layout.js +214 -12
  250. package/dist/design/layout.js.map +1 -1
  251. package/dist/design/logicalEdges.d.ts +7 -0
  252. package/dist/design/logicalEdges.d.ts.map +1 -1
  253. package/dist/design/logicalEdges.js +28 -0
  254. package/dist/design/logicalEdges.js.map +1 -1
  255. package/dist/design/pathBlock.d.ts +69 -0
  256. package/dist/design/pathBlock.d.ts.map +1 -0
  257. package/dist/design/pathBlock.js +286 -0
  258. package/dist/design/pathBlock.js.map +1 -0
  259. package/dist/design/svgPath.d.ts +48 -0
  260. package/dist/design/svgPath.d.ts.map +1 -0
  261. package/dist/design/svgPath.js +402 -0
  262. package/dist/design/svgPath.js.map +1 -0
  263. package/dist/fonts/usage.d.ts +5 -0
  264. package/dist/fonts/usage.d.ts.map +1 -1
  265. package/dist/fonts/usage.js +81 -11
  266. package/dist/fonts/usage.js.map +1 -1
  267. package/dist/html-backend.d.ts.map +1 -1
  268. package/dist/html-backend.js +127 -22
  269. package/dist/html-backend.js.map +1 -1
  270. package/dist/index.d.ts +19 -9
  271. package/dist/index.d.ts.map +1 -1
  272. package/dist/index.js +13 -5
  273. package/dist/index.js.map +1 -1
  274. package/dist/measure/cache.js +1 -1
  275. package/dist/measure/cache.js.map +1 -1
  276. package/dist/measure/inlineIcon.d.ts +34 -0
  277. package/dist/measure/inlineIcon.d.ts.map +1 -0
  278. package/dist/measure/inlineIcon.js +89 -0
  279. package/dist/measure/inlineIcon.js.map +1 -0
  280. package/dist/measure/rich.d.ts +2 -1
  281. package/dist/measure/rich.d.ts.map +1 -1
  282. package/dist/measure/rich.js +6 -0
  283. package/dist/measure/rich.js.map +1 -1
  284. package/dist/migrate/pageDesign.d.ts.map +1 -1
  285. package/dist/migrate/pageDesign.js +4 -2
  286. package/dist/migrate/pageDesign.js.map +1 -1
  287. package/dist/migrate/textToMarkdown.js +2 -0
  288. package/dist/migrate/textToMarkdown.js.map +1 -1
  289. package/dist/parse/blockParser.d.ts.map +1 -1
  290. package/dist/parse/blockParser.js +171 -20
  291. package/dist/parse/blockParser.js.map +1 -1
  292. package/dist/parse/index.d.ts +1 -1
  293. package/dist/parse/index.d.ts.map +1 -1
  294. package/dist/parse/index.js.map +1 -1
  295. package/dist/parse/inlineFormatting.d.ts +11 -3
  296. package/dist/parse/inlineFormatting.d.ts.map +1 -1
  297. package/dist/parse/inlineFormatting.js +63 -5
  298. package/dist/parse/inlineFormatting.js.map +1 -1
  299. package/dist/parse/inlineSnippet.d.ts +2 -1
  300. package/dist/parse/inlineSnippet.d.ts.map +1 -1
  301. package/dist/parse/inlineSnippet.js +3 -2
  302. package/dist/parse/inlineSnippet.js.map +1 -1
  303. package/dist/parse/sourceMapping.d.ts.map +1 -1
  304. package/dist/parse/sourceMapping.js +8 -1
  305. package/dist/parse/sourceMapping.js.map +1 -1
  306. package/dist/parse/types.d.ts +71 -1
  307. package/dist/parse/types.d.ts.map +1 -1
  308. package/dist/pipeline/build.d.ts.map +1 -1
  309. package/dist/pipeline/build.js +67 -13
  310. package/dist/pipeline/build.js.map +1 -1
  311. package/dist/pipeline/buildHelpers.d.ts +10 -0
  312. package/dist/pipeline/buildHelpers.d.ts.map +1 -1
  313. package/dist/pipeline/buildHelpers.js +17 -0
  314. package/dist/pipeline/buildHelpers.js.map +1 -1
  315. package/dist/pipeline/buildMeasurement.d.ts.map +1 -1
  316. package/dist/pipeline/buildMeasurement.js +23 -11
  317. package/dist/pipeline/buildMeasurement.js.map +1 -1
  318. package/dist/pipeline/calloutLayout.d.ts.map +1 -1
  319. package/dist/pipeline/calloutLayout.js +142 -32
  320. package/dist/pipeline/calloutLayout.js.map +1 -1
  321. package/dist/pipeline/composedLayout.d.ts +1 -33
  322. package/dist/pipeline/composedLayout.d.ts.map +1 -1
  323. package/dist/pipeline/composedLayout.js +526 -36
  324. package/dist/pipeline/composedLayout.js.map +1 -1
  325. package/dist/pipeline/config.d.ts.map +1 -1
  326. package/dist/pipeline/config.js +12 -0
  327. package/dist/pipeline/config.js.map +1 -1
  328. package/dist/pipeline/contentWarnings.d.ts.map +1 -1
  329. package/dist/pipeline/contentWarnings.js +46 -1
  330. package/dist/pipeline/contentWarnings.js.map +1 -1
  331. package/dist/pipeline/continuation.d.ts.map +1 -1
  332. package/dist/pipeline/continuation.js +3 -2
  333. package/dist/pipeline/continuation.js.map +1 -1
  334. package/dist/pipeline/headerFooter.d.ts +19 -1
  335. package/dist/pipeline/headerFooter.d.ts.map +1 -1
  336. package/dist/pipeline/headerFooter.js +169 -17
  337. package/dist/pipeline/headerFooter.js.map +1 -1
  338. package/dist/pipeline/partPalette.d.ts.map +1 -1
  339. package/dist/pipeline/partPalette.js +40 -1
  340. package/dist/pipeline/partPalette.js.map +1 -1
  341. package/dist/pipeline/resourceLayout.d.ts +1 -1
  342. package/dist/pipeline/resourceLayout.d.ts.map +1 -1
  343. package/dist/pipeline/resourceLayout.js +44 -15
  344. package/dist/pipeline/resourceLayout.js.map +1 -1
  345. package/dist/preflight.d.ts.map +1 -1
  346. package/dist/preflight.js +36 -1
  347. package/dist/preflight.js.map +1 -1
  348. package/dist/types.d.ts +319 -22
  349. package/dist/types.d.ts.map +1 -1
  350. package/dist/vdt.d.ts +392 -12
  351. package/dist/vdt.d.ts.map +1 -1
  352. package/dist/vdt.js.map +1 -1
  353. package/package.json +1 -1
@@ -0,0 +1,232 @@
1
+ /**
2
+ * Connectors painted over the frames (#1076): a connector with an end at a
3
+ * picture's anchor (a pointer into a map) is painted after every frame of
4
+ * the page, in every backend and in the source map, while the rest of the
5
+ * decoration stays one paint item under the frames. `over` overrides the
6
+ * default either way. The fixture is the parts of a map of #1057, its map
7
+ * frame at the default layer.
8
+ */
9
+ import { describe, it, expect } from 'vitest';
10
+ import { buildDocument } from '../../pipeline/build';
11
+ import { createMeasurementCache } from '../../measure';
12
+ import { renderToHtmlIndexed } from '../../html-backend';
13
+ import { renderPageToCanvas } from '../../index';
14
+ import { collectConfigWarnings } from '../../configWarnings';
15
+ import { sourceAt } from '../../composed/sourceMap';
16
+ import { composedPaintOrder, composedReadingOrder, decorationOver, decorationUnder } from '../../composed/paint';
17
+ import { flowRectToPage } from '../../vdt';
18
+ import { mapPartsFixture } from './fixtures/mapParts';
19
+ class StubCtx {
20
+ font = '';
21
+ measureText(s) {
22
+ const m = /(\d+(?:\.\d+)?)px/.exec(this.font);
23
+ const em = m ? Number(m[1]) : 10;
24
+ return { width: [...s].length * em * 0.5 };
25
+ }
26
+ }
27
+ globalThis.OffscreenCanvas = class {
28
+ getContext() {
29
+ return new StubCtx();
30
+ }
31
+ };
32
+ const MM = 300 / 25.4;
33
+ const mm = (value) => ({ value, unit: 'mm' });
34
+ const CONNECTORS = ['a-titulo', 'a-leyenda', 'a-escala'];
35
+ /** The map-parts book, its templates patched by `patch`. */
36
+ const build = (locale, patch = (t) => t) => {
37
+ const f = mapPartsFixture(locale);
38
+ const config = { ...f.config, pageTemplates: f.config.pageTemplates.map((t) => patch(t)) };
39
+ return buildDocument({ markdown: f.markdown, resources: f.resources }, config, createMeasurementCache());
40
+ };
41
+ /** The map frame under the decoration, as #1057's fixture had it. */
42
+ const mapUnder = (t) => ({ ...t, frames: (t.frames ?? []).map((f) => (f.name === 'mapa' ? { ...f, layer: -1 } : f)) });
43
+ /** Every connector of the template with `over` set. */
44
+ const withOver = (over) => (t) => ({
45
+ ...t,
46
+ decoration: { elements: (t.decoration?.elements ?? []).map((e) => ('kind' in e && e.kind === 'connector' ? { ...e, over } : e)) },
47
+ });
48
+ const composedPage = (doc) => doc.pages.find((p) => p.composed);
49
+ const pathOf = (page, id) => page.composed.decoration.blocks.find((x) => x.elementId === id);
50
+ const pointsOf = (b) => b.subpaths.flat().filter((c) => c.op !== 'Z').map((c) => ({ x: c.x, y: c.y }));
51
+ const order = (page) => composedPaintOrder(page).map((i) => (i.kind === 'frame' ? i.frame.name : i.kind));
52
+ const configPath = (i) => `/pageTemplates/0/decoration/elements/${i}`;
53
+ /** A canvas that records the strokes' starts and the words it fills. */
54
+ function recordCanvas() {
55
+ const ops = [];
56
+ const ctx = new Proxy({ font: '', fillStyle: '#000000' }, {
57
+ get(target, key) {
58
+ if (key === 'fillText')
59
+ return (text) => ops.push(`text:${text}`);
60
+ if (key === 'moveTo')
61
+ return (x, y) => ops.push(`move:${Math.round(x)},${Math.round(y)}`);
62
+ if (key === 'measureText')
63
+ return (s) => ({ width: [...s].length * 7 });
64
+ if (key in target)
65
+ return target[key];
66
+ return () => undefined;
67
+ },
68
+ set(target, key, value) { target[key] = value; return true; },
69
+ });
70
+ return { ops, canvas: { width: 0, height: 0, getContext: () => ctx } };
71
+ }
72
+ describe('connectors into a picture paint over the frames (#1076)', () => {
73
+ it('a connector with an anchor end is marked over; the paint order ends with the over item', () => {
74
+ const page = composedPage(build('en'));
75
+ expect(page.composed.frames.find((f) => f.name === 'mapa').layer).toBe(1);
76
+ for (const id of CONNECTORS)
77
+ expect(pathOf(page, id).over).toBe(true);
78
+ const o = order(page);
79
+ expect(o.at(-1)).toBe('over');
80
+ // Every frame (the map among them) is painted before it.
81
+ expect(o.indexOf('mapa')).toBeLessThan(o.indexOf('over'));
82
+ expect(o.filter((k) => k === 'decoration')).toHaveLength(1);
83
+ // The decoration item holds what is not over; the over item the rest.
84
+ const deco = page.composed.decoration;
85
+ expect(decorationUnder(deco).blocks.some((b) => b.kind === 'path' && b.over)).toBe(false);
86
+ expect(decorationOver(deco).blocks.map((b) => b.elementId)).toEqual([...CONNECTORS]);
87
+ // Read with the decoration, before the frames.
88
+ expect(composedReadingOrder(composedPaintOrder(page)).slice(0, 2).map((i) => i.kind)).toEqual(['decoration', 'over']);
89
+ });
90
+ it('draws the same lines as the map frame under the decoration (layer -1) did', () => {
91
+ const now = composedPage(build('en'));
92
+ const before = composedPage(build('en', mapUnder));
93
+ for (const id of CONNECTORS)
94
+ expect(pathOf(now, id).subpaths).toEqual(pathOf(before, id).subpaths);
95
+ // With the map under the decoration the connectors are still painted
96
+ // after every frame.
97
+ const o = order(before);
98
+ expect(o.indexOf('mapa')).toBeLessThan(o.indexOf('decoration'));
99
+ expect(o.at(-1)).toBe('over');
100
+ });
101
+ it('over: false keeps an anchored connector with the decoration, under the frames', () => {
102
+ const page = composedPage(build('en', withOver(false)));
103
+ for (const id of CONNECTORS)
104
+ expect(pathOf(page, id).over).toBeUndefined();
105
+ expect(order(page)).not.toContain('over');
106
+ // Nothing is copied: the decoration paints as one slot.
107
+ expect(decorationUnder(page.composed.decoration)).toBe(page.composed.decoration);
108
+ expect(decorationOver(page.composed.decoration)).toBeUndefined();
109
+ });
110
+ it('on the canvas: each pointer is stroked after the notes\' words and the map', () => {
111
+ for (const locale of ['en', 'ar']) {
112
+ const doc = build(locale);
113
+ const page = composedPage(doc);
114
+ const { ops, canvas } = recordCanvas();
115
+ renderPageToCanvas(page, doc, canvas);
116
+ // The last word of the frames (the folio, painted after the page, aside).
117
+ const lastWord = ops.reduce((at, o, i) => (o.startsWith('text:') && !/^text:[\d\u0660-\u0669]+$/.test(o) ? i : at), -1);
118
+ for (const id of CONNECTORS) {
119
+ const p = pointsOf(pathOf(page, id))[0];
120
+ const at = ops.lastIndexOf(`move:${Math.round(p.x)},${Math.round(p.y)}`);
121
+ expect(at, `${locale} ${id}`).toBeGreaterThan(lastWord);
122
+ }
123
+ }
124
+ // Under the frames when over is false: before the notes' words.
125
+ const doc = build('en', withOver(false));
126
+ const page = composedPage(doc);
127
+ const { ops, canvas } = recordCanvas();
128
+ renderPageToCanvas(page, doc, canvas);
129
+ const p = pointsOf(pathOf(page, 'a-titulo'))[0];
130
+ const at = ops.indexOf(`move:${Math.round(p.x)},${Math.round(p.y)}`);
131
+ expect(at).toBeGreaterThan(-1);
132
+ expect(at).toBeLessThan(ops.findIndex((o) => o.startsWith('text:')));
133
+ });
134
+ it('in HTML: the over part in a box of its own above every frame; through a flow frame after the rest', () => {
135
+ const htmlOf = (doc) => renderToHtmlIndexed(doc).pages[composedPage(doc).index].innerHtml;
136
+ const html = htmlOf(build('en'));
137
+ const over = /class="pt-frame-decoration pt-frame-decoration-over" style="[^"]*z-index:(\d+);/.exec(html);
138
+ expect(over).not.toBeNull();
139
+ const frames = [...html.matchAll(/class="pt-frame[^"]*" data-frame-id="[^"]*" data-layer="-?\d+"[^>]*z-index:(\d+)/g)].map((m) => Number(m[1]));
140
+ expect(frames.length).toBeGreaterThan(0);
141
+ expect(Number(over[1])).toBeGreaterThan(Math.max(...frames));
142
+ // Every pointer is drawn in it, and none under the frames: the
143
+ // fixture's decoration holds nothing else, so no box is written there.
144
+ expect((html.slice(over.index).match(/stroke="#2e4a5c"/g) ?? []).length).toBe(CONNECTORS.length);
145
+ expect(html.indexOf('stroke="#2e4a5c"')).toBeGreaterThan(over.index);
146
+ expect(html).not.toMatch(/class="pt-frame-decoration" /);
147
+ // With over: false they are in the decoration's box, under the frames.
148
+ const under = htmlOf(build('en', withOver(false)));
149
+ const deco = /class="pt-frame-decoration" style="[^"]*z-index:(\d+);">/.exec(under);
150
+ expect(deco).not.toBeNull();
151
+ expect(Number(deco[1])).toBe(1);
152
+ expect(under).not.toContain('pt-frame-decoration-over');
153
+ // Right to left: the frames are written in the mirrored flow, the
154
+ // decoration on the sheet after it, the pointers last.
155
+ const rtl = htmlOf(build('ar'));
156
+ expect(rtl).not.toContain('pt-frame-decoration-over');
157
+ const flowEnd = rtl.lastIndexOf('pt-frame');
158
+ const strokes = [...rtl.matchAll(/stroke="#2e4a5c"/g)].map((m) => m.index);
159
+ expect(strokes.length).toBe(CONNECTORS.length);
160
+ for (const s of strokes)
161
+ expect(s).toBeGreaterThan(flowEnd);
162
+ });
163
+ it('the source map answers the connector on its ink inside the map frame', () => {
164
+ const doc = build('en');
165
+ const page = composedPage(doc);
166
+ const path = pathOf(page, 'a-titulo');
167
+ const end = pointsOf(path).at(-1);
168
+ const map = flowRectToPage(page, page.composed.frames.find((f) => f.name === 'mapa').rect);
169
+ const p = { x: end.x - 3, y: end.y };
170
+ expect(p.x).toBeGreaterThan(map.x);
171
+ const hit = sourceAt(doc, page.index, p.x, p.y);
172
+ expect(hit.some((e) => e.source?.path === configPath(0))).toBe(true);
173
+ // Under the frames, the map answers there.
174
+ const under = build('en', withOver(false));
175
+ const q = composedPage(under);
176
+ const hitUnder = sourceAt(under, q.index, p.x, p.y);
177
+ expect(hitUnder.some((e) => e.source?.path === configPath(0))).toBe(false);
178
+ });
179
+ it('frameCovered does not read connectors: none for pointers over the map or a line over a note', () => {
180
+ const doc = build('en');
181
+ expect(doc.contentWarnings?.filter((w) => w.kind === 'frameCovered') ?? []).toEqual([]);
182
+ // A straight line forced over, across the words of the notes.
183
+ const across = build('en', (t) => ({
184
+ ...t,
185
+ decoration: { elements: [{ kind: 'connector', id: 'x', routing: 'straight', over: true, from: { to: '#n1', side: 'top' }, to: { to: '#n3', side: 'bottom' } }] },
186
+ }));
187
+ expect(pathOf(composedPage(across), 'x').over).toBe(true);
188
+ expect(across.contentWarnings?.filter((w) => w.kind === 'frameCovered') ?? []).toEqual([]);
189
+ });
190
+ });
191
+ describe('plain connectors stay under the frames (#1076)', () => {
192
+ const two = {
193
+ id: 'dos',
194
+ header: false,
195
+ frames: [
196
+ { name: 'izq', width: mm(40), height: mm(20), placement: { anchor: { to: 'container', edge: 'top-left' } } },
197
+ { name: 'der', width: mm(40), height: mm(20), placement: { anchor: { to: 'container', edge: 'top-left' }, offset: { x: mm(100), y: mm(60) } } },
198
+ ],
199
+ decoration: { elements: [{ kind: 'box', id: 'band', style: { backgroundColor: { hex: '#eeeeee', model: 'hex' } }, placement: { anchor: { to: 'container', edge: 'top-left' }, size: { width: mm(20), height: mm(20) } } }] },
200
+ };
201
+ const md = '::::page{template="dos"}\n:::frame{slot="izq"}\nLeft\n:::\n:::frame{slot="der"}\nRight\n:::\n::::\n';
202
+ const page = (c) => {
203
+ const t = { ...two, decoration: { elements: [...two.decoration.elements, { kind: 'connector', id: 'c', from: { to: '#izq' }, to: { to: '#der' }, ...c }] } };
204
+ return composedPage(buildDocument({ markdown: md }, { pageTemplates: [t] }, createMeasurementCache()));
205
+ };
206
+ it('frame to frame: no over mark, no over item', () => {
207
+ const p = page({});
208
+ expect(pathOf(p, 'c').over).toBeUndefined();
209
+ expect(order(p)).toEqual(['decoration', 'izq', 'der']);
210
+ });
211
+ it('over: true paints a plain connector after the frames; the box stays under them', () => {
212
+ const p = page({ over: true });
213
+ expect(order(p)).toEqual(['decoration', 'izq', 'der', 'over']);
214
+ expect(decorationUnder(p.composed.decoration).blocks.map((b) => b.elementId)).toEqual(['band']);
215
+ expect(decorationOver(p.composed.decoration).blocks.map((b) => b.elementId)).toEqual(['c']);
216
+ const pts = pointsOf(pathOf(p, 'c'));
217
+ expect(pts.length).toBeGreaterThan(1);
218
+ expect(Math.abs(pts[0].x - pts[1].x) + Math.abs(pts[0].y - pts[1].y)).toBeGreaterThan(MM);
219
+ });
220
+ it('a non-boolean over is unknownConfigValue, read as its default', () => {
221
+ const config = { pageTemplates: [{ ...two, decoration: { elements: [
222
+ { kind: 'connector', id: 'c', from: { to: '#izq' }, to: { to: '#der' }, over: 'yes' },
223
+ { kind: 'connector', id: 'd', from: { to: '#izq' }, to: { to: '#der', anchor: 'x' }, over: 1 },
224
+ ] } }] };
225
+ const w = collectConfigWarnings(config).filter((x) => x.kind === 'unknownConfigValue' && x.path.endsWith('.over'));
226
+ expect(w).toEqual([
227
+ expect.objectContaining({ path: 'pageTemplates[0].decoration.elements[0].over', value: 'yes', used: 'false' }),
228
+ expect.objectContaining({ path: 'pageTemplates[0].decoration.elements[1].over', value: '1', used: 'true' }),
229
+ ]);
230
+ });
231
+ });
232
+ //# sourceMappingURL=overConnectors.test.js.map
@@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,MAAM,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;yBAC/F,EAAE,EAAE,CAAC,EAA8B,CAAC;QACrC,MAAM,CAAC,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,oBAAoB,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACnH,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YAChB,MAAM,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,8CAA8C,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;YAC9G,MAAM,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,8CAA8C,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;SAC5G,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=overlap.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlap.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/composed/overlap.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,339 @@
1
+ /**
2
+ * The overlap checks of composed pages (#1053, DESIGN §12.10): ink of a
3
+ * frame under a frame painted over it (`frameCovered`) and ink past the
4
+ * trim, the bleed or the box a frame is anchored inside
5
+ * (`frameOutsideArea`). The fixture (`fixtures/overlap/`) holds the two
6
+ * cases a real textbook's port passed `check` with: a caption clipped under
7
+ * a picture frame on a higher layer, and a tab label under a cut-out photo;
8
+ * besides, a note anchored inside a card that runs past its foot, and a
9
+ * strap of text below the trim.
10
+ */
11
+ // @ts-expect-error -- a Node built-in: the package compiles without @types/node.
12
+ import { readFileSync as readFile } from 'node:fs';
13
+ import { describe, it, expect } from 'vitest';
14
+ import { buildDocument } from '../../pipeline/build';
15
+ import { createMeasurementCache } from '../../measure';
16
+ import { formatWarning } from '../../pipeline/contentWarnings';
17
+ import { composedReflowLog } from '../../composed/reflowLog';
18
+ import { validatePageTemplates } from '../../composed/validate';
19
+ class StubCtx {
20
+ font = '';
21
+ measureText(s) {
22
+ return { width: s.length * 7 };
23
+ }
24
+ }
25
+ globalThis.OffscreenCanvas = class {
26
+ getContext() {
27
+ return new StubCtx();
28
+ }
29
+ };
30
+ const readFileSync = readFile;
31
+ const DIR = new URL('./fixtures/overlap/', import.meta.url);
32
+ const CONFIG = JSON.parse(readFileSync(new URL('config.json', DIR), 'utf8'));
33
+ const MARKDOWN = readFileSync(new URL('overlap.md', DIR), 'utf8');
34
+ /** The fixture's pictures at their pixel sizes, 300 ppi (as the command
35
+ * line reads a folder of pictures). */
36
+ const RESOURCES = [['chart', 1200, 600], ['photo', 900, 600], ['cutout', 720, 720]].map(([id, width, height]) => ({
37
+ id,
38
+ typeId: 'pic',
39
+ kind: 'bitmap',
40
+ caption: '',
41
+ createdAt: 0,
42
+ updatedAt: 0,
43
+ bitmap: { fileId: `${id}.png`, format: 'png', width, height, resolution: 300 },
44
+ }));
45
+ const mm = (value) => ({ value, unit: 'mm' });
46
+ const template = () => structuredClone(CONFIG.pageTemplates[0]);
47
+ /** The fixture with frames changed by `patch` (by name). */
48
+ const withFrames = (patch, base = template()) => ({
49
+ ...base,
50
+ frames: base.frames.map((f) => (patch[f.name] ? { ...f, ...patch[f.name] } : f)),
51
+ });
52
+ const build = (tpl = template(), markdown = MARKDOWN, extra = {}) => buildDocument({ markdown, resources: RESOURCES }, { ...CONFIG, ...extra, pageTemplates: [tpl] }, createMeasurementCache());
53
+ const covered = (doc) => (doc.contentWarnings ?? []).filter((w) => w.kind === 'frameCovered');
54
+ const outside = (doc) => (doc.contentWarnings ?? []).filter((w) => w.kind === 'frameOutsideArea');
55
+ const pair = (doc, frame, by) => covered(doc).find((w) => w.frame === frame && w.coveredBy === by);
56
+ /** `tpl` with a proposal applied as the Sandbox applies it: a value set at
57
+ * its path (`/pageTemplates/0/frames/<i>/<key>[/<key>]`), a move added to
58
+ * the frame's placement offset. */
59
+ const applyProposal = (tpl, p) => {
60
+ const out = structuredClone(tpl);
61
+ if (p.kind === 'move') {
62
+ const f = out.frames.find((x) => x.name === p.frame);
63
+ const off = f.placement.offset ?? {};
64
+ const v = (d) => d?.value ?? 0;
65
+ f.placement = { ...f.placement, offset: { x: mm(v(off.x) + p.dxMm), y: mm(v(off.y) + p.dyMm) } };
66
+ return out;
67
+ }
68
+ const [, , , , index, ...keys] = p.path.split('/');
69
+ let node = out.frames[Number(index)];
70
+ for (const k of keys.slice(0, -1))
71
+ node = (node[k] ??= {});
72
+ node[keys[keys.length - 1]] = p.value;
73
+ return out;
74
+ };
75
+ describe('frameCovered (#1053)', () => {
76
+ const doc = build();
77
+ it('reports a caption clipped under a picture frame on a higher layer', () => {
78
+ const w = pair(doc, 'figure', 'photo');
79
+ expect(w).toMatchObject({ template: 'overlaps', fenceIndex: 0, pageIndex: 0, locale: 'en', configPath: '/pageTemplates/0/frames/0', coveredByPath: '/pageTemplates/0/frames/1' });
80
+ expect(w.text).toMatch(/^Rainfall in the four seasons/);
81
+ expect(w.overlapMm2).toBeGreaterThan(10);
82
+ expect(w.sourceStart).toBeGreaterThan(0);
83
+ // Painting the photo under the figure would hide the photo under the
84
+ // chart: not proposed. A caption does not run round a pushing frame:
85
+ // no exclude either. The photo is anchored inside the figure, which it
86
+ // fills from the chart to the caption: every move off the caption
87
+ // takes it out of the figure (#1075), so none is proposed.
88
+ expect(w.proposals).toEqual([]);
89
+ });
90
+ it('reports a tab label under a cut-out photo', () => {
91
+ const w = pair(doc, 'card', 'cutout');
92
+ expect(w.text).toMatch(/^Field notes/);
93
+ expect(w.coveredByPath).toBe('/pageTemplates/0/frames/3');
94
+ const move = w.proposals.find((p) => p.kind === 'move');
95
+ expect(move).toMatchObject({ kind: 'move', frame: 'cutout' });
96
+ });
97
+ it('reports nothing else on the fixture: the note sits clear of the card text, the strap over nothing', () => {
98
+ expect(covered(doc).map((w) => `${w.frame}<${w.coveredBy}`).sort()).toEqual(['card<cutout', 'figure<photo']);
99
+ });
100
+ it('the proposed move uncovers the tab', () => {
101
+ const w = pair(doc, 'card', 'cutout');
102
+ const move = w.proposals.find((p) => p.kind === 'move');
103
+ const cut = template().frames.find((f) => f.name === 'cutout');
104
+ const off = cut.placement.offset;
105
+ const moved = withFrames({ cutout: { placement: { ...cut.placement, offset: { x: mm(off.x.value + move.dxMm), y: mm(off.y.value + move.dyMm) } } } });
106
+ expect(pair(build(moved), 'card', 'cutout')).toBeUndefined();
107
+ });
108
+ it('the move off the tab goes right, not up onto the caption (#1075)', () => {
109
+ // 8.6 mm up takes the cut-out off the tab and puts it on the figure's
110
+ // caption; past the caption is further than 13 mm to the right.
111
+ const move = pair(doc, 'card', 'cutout').proposals.find((p) => p.kind === 'move');
112
+ expect(move).toMatchObject({ dyMm: 0 });
113
+ expect(move.dxMm).toBeGreaterThan(8.6);
114
+ });
115
+ describe('where a move lands (#1075)', () => {
116
+ // A column of text down the page's left, a note beside it and a photo
117
+ // over the column's head. Up and left take the photo past the trim, down
118
+ // runs the length of the column: the way out is to the right, past the
119
+ // note.
120
+ const tpl = {
121
+ id: 'overlaps',
122
+ frames: [
123
+ { name: 'column', width: mm(40), height: mm(215), placement: { anchor: { to: 'container', edge: 'top-left' } } },
124
+ { name: 'note', style: 'sticky', width: mm(40), height: mm(40), placement: { anchor: { to: 'container', edge: 'top-left' }, offset: { x: mm(45) } } },
125
+ { name: 'photo', layer: 2, width: mm(30), placement: { anchor: { to: 'container', edge: 'top-left' }, offset: { x: mm(5) } } },
126
+ ],
127
+ };
128
+ const md = [
129
+ '::::page{template="overlaps"}',
130
+ ':::frame{slot="column"}',
131
+ 'The mill keeps a record of each season. '.repeat(60),
132
+ ':::',
133
+ '',
134
+ ':::frame{slot="note"}',
135
+ 'Ask at the mill for the record of the last ten years. '.repeat(8),
136
+ ':::',
137
+ '',
138
+ '::resource{id="cutout" slot="photo"}',
139
+ '::::',
140
+ '',
141
+ ].join('\n');
142
+ it('goes on past a frame it would land on', () => {
143
+ const doc = build(tpl, md);
144
+ const w = pair(doc, 'column', 'photo');
145
+ const move = w.proposals.find((p) => p.kind === 'move');
146
+ // Some 35 mm takes it off the column's lines and onto the note's;
147
+ // past them (the note's padding is fill, not covered) it is 78 mm.
148
+ expect(move.dyMm).toBe(0);
149
+ expect(move.dxMm).toBeGreaterThan(75);
150
+ expect(move.dxMm).toBeLessThan(82);
151
+ const fixed = build(applyProposal(tpl, move), md);
152
+ expect(covered(fixed)).toEqual([]);
153
+ expect(outside(fixed).filter((x) => x.frame === 'photo')).toEqual([]);
154
+ });
155
+ it('proposes no move where every way out is blocked', () => {
156
+ // The note as wide as the rest of the page: past it the photo runs
157
+ // past the trim.
158
+ const wide = withFrames({ note: { width: mm(115) } }, tpl);
159
+ const w = pair(build(wide, md), 'column', 'photo');
160
+ expect(w.proposals.map((p) => p.kind)).toEqual(['layer', 'exclude']);
161
+ });
162
+ it('proposes no move of a frame the covered one is anchored to', () => {
163
+ // The column hangs from the photo: they move together.
164
+ const hung = withFrames({ column: { placement: { anchor: { to: '#photo', edge: 'top-left' }, offset: { x: mm(-5) } } } }, tpl);
165
+ const w = pair(build(hung, md), 'column', 'photo');
166
+ expect(w.proposals.some((p) => p.kind === 'move')).toBe(false);
167
+ });
168
+ });
169
+ it('applying any offered fix clears its warning and raises no other (#1075)', () => {
170
+ const before = new Set(covered(doc).map((w) => `${w.frame}<${w.coveredBy}`));
171
+ const outBefore = new Set(outside(doc).map((w) => w.frame));
172
+ const offered = [...covered(doc), ...outside(doc)].flatMap((w) => w.proposals.map((p) => ({ w, p })));
173
+ expect(offered.filter((x) => x.p.kind === 'move').length).toBeGreaterThanOrEqual(2);
174
+ for (const { w, p } of offered) {
175
+ const fixed = build(applyProposal(template(), p));
176
+ const after = covered(fixed).map((x) => `${x.frame}<${x.coveredBy}`);
177
+ expect(after.filter((k) => !before.has(k)), `${w.kind} ${w.frame} ${JSON.stringify(p)}`).toEqual([]);
178
+ if (w.kind === 'frameCovered')
179
+ expect(after).not.toContain(`${w.frame}<${w.coveredBy}`);
180
+ if (p.kind === 'move') {
181
+ // A move also keeps every frame where it was inside.
182
+ expect(outside(fixed).map((x) => x.frame).filter((f) => !outBefore.has(f))).toEqual([]);
183
+ if (w.kind === 'frameOutsideArea')
184
+ expect(outside(fixed).filter((x) => x.frame === w.frame && x.past === w.past)).toEqual([]);
185
+ }
186
+ }
187
+ });
188
+ it('proposes exclude: push for body text under a picture, and a layer swap where the text lies on nothing opaque', () => {
189
+ const tpl = {
190
+ id: 'overlaps',
191
+ frames: [
192
+ { name: 'text', width: mm(120), placement: { anchor: { to: 'container', edge: 'top-left' } } },
193
+ { name: 'photo', layer: 2, width: mm(40), placement: { anchor: { to: 'container', edge: 'top-left' }, offset: { x: mm(30), y: mm(2) } } },
194
+ ],
195
+ };
196
+ const md = `::::page{template="overlaps"}\n:::frame{slot="text"}\n${'The mill keeps a record of each season. '.repeat(30)}\n:::\n\n::resource{id="photo" slot="photo"}\n::::\n`;
197
+ const w = pair(build(tpl, md), 'text', 'photo');
198
+ expect(w.proposals.map((p) => p.kind)).toEqual(['layer', 'exclude', 'move']);
199
+ expect(w.proposals[0]).toEqual({ kind: 'layer', path: '/pageTemplates/0/frames/1/layer', value: 0 });
200
+ expect(w.proposals[1]).toEqual({ kind: 'exclude', path: '/pageTemplates/0/frames/1/exclude', value: 'push' });
201
+ // Pushing, the photo sends the lines round it: nothing is covered.
202
+ const pushed = build(withFrames({ photo: { exclude: 'push' } }, tpl), md);
203
+ expect(pair(pushed, 'text', 'photo')).toBeUndefined();
204
+ // Under the text, the photo hides nothing.
205
+ const lowered = build(withFrames({ photo: { layer: 0 } }, tpl), md);
206
+ expect(covered(lowered)).toEqual([]);
207
+ });
208
+ it("a frame with no fill and no picture covers nothing between its lines", () => {
209
+ // A frameless frame over the card's text, painted after it, its one
210
+ // word at its foot, below the card's lines.
211
+ const tpl = template();
212
+ tpl.frames.push({ name: 'veil', layer: 3, width: mm(60), height: mm(30), verticalAlign: 'bottom', placement: { anchor: { to: '#card', edge: 'top-left' }, offset: { y: mm(8) } } });
213
+ const md = MARKDOWN.replace('\n::::', '\n\n:::frame{slot="veil"}\nWet\n:::\n::::');
214
+ const d = build(tpl, md);
215
+ expect(d.pages[0].composed.frames.find((f) => f.name === 'veil').blockIds.length).toBeGreaterThan(0);
216
+ expect(covered(d).filter((w) => w.coveredBy === 'veil')).toEqual([]);
217
+ // Given a fill, it hides the card's lines.
218
+ tpl.frames[tpl.frames.length - 1] = { ...tpl.frames[tpl.frames.length - 1], style: 'sticky' };
219
+ const filled = pair(build(tpl, md), 'card', 'veil');
220
+ expect(filled?.text).toMatch(/river/);
221
+ });
222
+ it("overlap: 'allow' on either frame silences the pair", () => {
223
+ expect(pair(build(withFrames({ photo: { overlap: 'allow' } })), 'figure', 'photo')).toBeUndefined();
224
+ expect(pair(build(withFrames({ figure: { overlap: 'allow' } })), 'figure', 'photo')).toBeUndefined();
225
+ // The other pair still reports.
226
+ expect(pair(build(withFrames({ photo: { overlap: 'allow' } })), 'card', 'cutout')).toBeDefined();
227
+ });
228
+ it('is written for the command line, and the reflow log names it', () => {
229
+ const w = pair(doc, 'card', 'cutout');
230
+ const text = formatWarning(w);
231
+ expect(text).toContain('Frame "card" of template "overlaps" (en) lies under frame "cutout"');
232
+ expect(text).toContain('"Field notes');
233
+ expect(text).toContain("overlap: 'allow'");
234
+ const lines = composedReflowLog(doc)[0].lines;
235
+ expect(lines).toEqual(expect.arrayContaining([expect.stringMatching(/^figure lies under photo \([\d.]+ mm²\)$/), expect.stringMatching(/^card lies under cutout/)]));
236
+ });
237
+ });
238
+ describe('frameOutsideArea (#1053)', () => {
239
+ const doc = build();
240
+ it('reports a frame anchored inside a box that runs past it, with fixes', () => {
241
+ const w = outside(doc).find((x) => x.frame === 'note');
242
+ expect(w).toMatchObject({ past: 'frame', target: 'card', configPath: '/pageTemplates/0/frames/4', pageIndex: 0, locale: 'en' });
243
+ expect(w.sides.bottom).toBeGreaterThan(10);
244
+ expect(w.excessMm).toBe(w.sides.bottom);
245
+ const kinds = w.proposals.map((p) => p.kind);
246
+ // (Taller than the card, it is not brought in by a move.)
247
+ expect(kinds).toEqual(['maxHeight', 'continueNextPage', 'minHeight']);
248
+ const max = w.proposals[0];
249
+ expect(max.path).toBe('/pageTemplates/0/frames/4/maxHeight');
250
+ const min = w.proposals[2];
251
+ expect(min).toMatchObject({ path: '/pageTemplates/0/frames/2/minHeight', frame: 'card' });
252
+ // The card raised to the proposed minimum holds the note.
253
+ expect(outside(build(withFrames({ card: { minHeight: min.value } }))).filter((x) => x.frame === 'note')).toEqual([]);
254
+ // Held to the proposed maximum it is inside too.
255
+ expect(outside(build(withFrames({ note: { height: max.value } }))).filter((x) => x.frame === 'note')).toEqual([]);
256
+ });
257
+ it('reports text past the trim', () => {
258
+ const w = outside(doc).find((x) => x.frame === 'strap');
259
+ expect(w).toMatchObject({ past: 'trim', configPath: '/pageTemplates/0/frames/5' });
260
+ expect(w.sides.bottom).toBeGreaterThan(0.3);
261
+ // Held by its foot, a smaller height would not bring it in: moved up it is.
262
+ expect(w.proposals).toEqual([{ kind: 'move', frame: 'strap', dxMm: 0, dyMm: -w.sides.bottom }]);
263
+ const strap = template().frames.find((f) => f.name === 'strap');
264
+ const up = withFrames({ strap: { placement: { ...strap.placement, offset: { x: mm(20), y: mm(14 - w.sides.bottom - 0.5) } } } });
265
+ expect(outside(build(up)).filter((x) => x.frame === 'strap')).toEqual([]);
266
+ expect(formatWarning(w)).toContain('runs');
267
+ expect(formatWarning(w)).toContain('past the trim');
268
+ });
269
+ it('a fill or a picture may run into the bleed; past it, it is reported', () => {
270
+ const band = (y) => ({
271
+ id: 'overlaps',
272
+ frames: [{ name: 'band', style: 'sticky', width: mm(240), height: mm(30), placement: { anchor: { to: 'page', edge: 'top-left' }, offset: { x: mm(-3), y: mm(y) } } }],
273
+ });
274
+ const md = '::::page{template="overlaps"}\n:::frame{slot="band"}\nBand\n:::\n::::\n';
275
+ // 240 mm on a 200 mm sheet from 3 mm left of the trim: 37 mm past its
276
+ // right edge, with no bleed.
277
+ const w = outside(build(band(0), md)).find((x) => x.frame === 'band');
278
+ expect(w).toMatchObject({ past: 'bleed' });
279
+ expect(w.sides.left).toBeCloseTo(3, 0);
280
+ expect(w.sides.right).toBeCloseTo(37, 0);
281
+ });
282
+ it("does not report a frame placed by an element edge or whose anchor point lies outside the box", () => {
283
+ expect(outside(doc).filter((x) => x.frame === 'cutout' || x.frame === 'photo' || x.frame === 'card' || x.frame === 'figure')).toEqual([]);
284
+ });
285
+ it("overlap: 'allow' silences it", () => {
286
+ expect(outside(build(withFrames({ note: { overlap: 'allow' } }))).filter((x) => x.frame === 'note')).toEqual([]);
287
+ expect(outside(build(withFrames({ strap: { overlap: 'allow' } }))).filter((x) => x.frame === 'strap')).toEqual([]);
288
+ });
289
+ it('the reflow log names it', () => {
290
+ const lines = composedReflowLog(doc)[0].lines;
291
+ expect(lines).toEqual(expect.arrayContaining([expect.stringMatching(/^note runs [\d.]+ mm past card$/), expect.stringMatching(/^strap runs [\d.]+ mm past the trim$/)]));
292
+ });
293
+ });
294
+ describe('the overlap checks on a spread (#1053)', () => {
295
+ const spread = {
296
+ id: 'sheet',
297
+ spread: true,
298
+ gutter: mm(10),
299
+ frames: [
300
+ { name: 'left', width: mm(120), placement: { anchor: { to: 'container', edge: 'top-left' } } },
301
+ { name: 'right', width: mm(120), placement: { anchor: { to: 'container', edge: 'top-right' } } },
302
+ { name: 'stamp', layer: 2, width: mm(30), placement: { anchor: { to: 'container', edge: 'top-right' }, offset: { x: mm(-20), y: mm(2) } } },
303
+ ],
304
+ };
305
+ const md = [
306
+ '::::page{template="sheet" spread}',
307
+ ':::frame{slot="left"}',
308
+ 'The left page holds the first half of the walk along the river.',
309
+ ':::',
310
+ '',
311
+ ':::frame{slot="right"}',
312
+ `${'The right page holds the second half, past the mill and the bridge. '.repeat(6)}`,
313
+ ':::',
314
+ '',
315
+ '::resource{id="cutout" slot="stamp"}',
316
+ '::::',
317
+ '',
318
+ ].join('\n');
319
+ it('reads the warning on the page that holds the covered frame, and checks the facing copies of nothing', () => {
320
+ const doc = build(spread, md);
321
+ const ws = covered(doc);
322
+ expect(ws.map((w) => `${w.frame}<${w.coveredBy}`)).toEqual(['right<stamp']);
323
+ const pages = doc.pages.filter((p) => p.composed?.spread);
324
+ expect(pages).toHaveLength(2);
325
+ // The right frame is on the second page of the sheet.
326
+ const holder = pages.find((p) => p.composed.frames.some((f) => f.name === 'right' && f.blockIds.length > 0));
327
+ expect(ws[0].pageIndex).toBe(holder.index);
328
+ expect(holder.composed.log.some((e) => e.kind === 'covered' && e.frame === 'right')).toBe(true);
329
+ });
330
+ });
331
+ describe('FrameConfig.overlap (#1053)', () => {
332
+ it("is 'check' or 'allow'; any other word is reported", () => {
333
+ const tpl = withFrames({ photo: { overlap: 'sometimes' } });
334
+ const ws = validatePageTemplates({ ...CONFIG, pageTemplates: [tpl] });
335
+ expect(ws).toEqual([expect.objectContaining({ kind: 'unknownConfigValue', path: '/pageTemplates/0/frames/1/overlap', value: 'sometimes', used: 'check' })]);
336
+ expect(validatePageTemplates({ ...CONFIG, pageTemplates: [withFrames({ photo: { overlap: 'allow' } })] })).toEqual([]);
337
+ });
338
+ });
339
+ //# sourceMappingURL=overlap.test.js.map