@softwear/latestcollectioncore 1.0.181 → 1.0.182

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.
package/dist/reports.js CHANGED
@@ -405,9 +405,24 @@ function addPage(originX, originY, doc, layout, rootPrintBuffer, paperSize, opti
405
405
  originY = containerChain[0].object.y;
406
406
  absoluteLowerRightHandSide.x = originX / 10;
407
407
  absoluteLowerRightHandSide.y = originY / 10;
408
- containerChain.forEach((link) => {
408
+ containerChain.forEach((link, linkIdx) => {
409
+ var _a;
410
+ const chainChild = (_a = containerChain[linkIdx + 1]) === null || _a === void 0 ? void 0 : _a.object;
409
411
  link.object.children.forEach((child) => {
410
- if (!child.snapToBottom && (child.type != 'container' || containerRedrawsAfterContinuationPage(child))) {
412
+ if (child.snapToBottom)
413
+ return;
414
+ // Advance past bound repeat containers on the overflow path (they are not redrawn here; the
415
+ // innermost link draws their leaves). Without this, nested x/y offsets are lost on page 2+.
416
+ if (child.type === 'container' &&
417
+ chainChild &&
418
+ child === chainChild &&
419
+ !containerRedrawsAfterContinuationPage(child)) {
420
+ const c = child;
421
+ originX += c.x;
422
+ originY += c.y;
423
+ return;
424
+ }
425
+ if (child.type != 'container' || containerRedrawsAfterContinuationPage(child)) {
411
426
  const childLowerRightHandSide = addObjectToPDF(originX, originY, doc, child, link.printBuffer, paperSize, layout, options, rootPrintBuffer, [], context);
412
427
  absoluteLowerRightHandSide.x = Math.max(absoluteLowerRightHandSide.x, childLowerRightHandSide.x);
413
428
  absoluteLowerRightHandSide.y = Math.max(absoluteLowerRightHandSide.y, childLowerRightHandSide.y);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softwear/latestcollectioncore",
3
- "version": "1.0.181",
3
+ "version": "1.0.182",
4
4
  "description": "Core functions for LatestCollections applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/reports.ts CHANGED
@@ -477,9 +477,24 @@ function addPage(
477
477
  originY = containerChain[0].object.y
478
478
  absoluteLowerRightHandSide.x = originX / 10
479
479
  absoluteLowerRightHandSide.y = originY / 10
480
- containerChain.forEach((link) => {
480
+ containerChain.forEach((link, linkIdx) => {
481
+ const chainChild = containerChain[linkIdx + 1]?.object
481
482
  link.object.children.forEach((child) => {
482
- if (!child.snapToBottom && (child.type != 'container' || containerRedrawsAfterContinuationPage(child))) {
483
+ if (child.snapToBottom) return
484
+ // Advance past bound repeat containers on the overflow path (they are not redrawn here; the
485
+ // innermost link draws their leaves). Without this, nested x/y offsets are lost on page 2+.
486
+ if (
487
+ child.type === 'container' &&
488
+ chainChild &&
489
+ child === chainChild &&
490
+ !containerRedrawsAfterContinuationPage(child)
491
+ ) {
492
+ const c = child as ContainerLayoutObject
493
+ originX += c.x
494
+ originY += c.y
495
+ return
496
+ }
497
+ if (child.type != 'container' || containerRedrawsAfterContinuationPage(child)) {
483
498
  const childLowerRightHandSide = addObjectToPDF(originX, originY, doc, child, link.printBuffer, paperSize, layout, options, rootPrintBuffer, [], context)
484
499
  absoluteLowerRightHandSide.x = Math.max(absoluteLowerRightHandSide.x, childLowerRightHandSide.x)
485
500
  absoluteLowerRightHandSide.y = Math.max(absoluteLowerRightHandSide.y, childLowerRightHandSide.y)
@@ -243,8 +243,8 @@ describe('genPDF', () => {
243
243
  {
244
244
  type: 'container',
245
245
  name: 'rows',
246
- x: 0,
247
- y: 0,
246
+ x: 30,
247
+ y: 40,
248
248
  width: 1800,
249
249
  height: 120,
250
250
  active: true,