@softwear/latestcollectioncore 1.0.185 → 1.0.186

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
@@ -16,13 +16,13 @@ exports.genPDF = void 0;
16
16
  const jspdf_1 = require("jspdf");
17
17
  const date_fns_1 = require("date-fns");
18
18
  const deepCopy_1 = __importDefault(require("./deepCopy"));
19
- /** Measurement never advances jsPDF sheet count; rendering uses the active canvas page (1-based). */
19
+ /** Measurement uses context `currentPageNumber` (1-based). Rendering normalizes jsPDF’s internal 0-based page index to 1-based so overlap rules match `pageNumber` fields. */
20
20
  function getCurrentPageNumber(doc, context) {
21
21
  var _a;
22
22
  if (context.mode === 'measurement') {
23
23
  return (_a = context.currentPageNumber) !== null && _a !== void 0 ? _a : 1;
24
24
  }
25
- return doc.getCurrentPageInfo().pageNumber;
25
+ return doc.getCurrentPageInfo().pageNumber + 1;
26
26
  }
27
27
  // We have to declare some functions that will be called by other functions but also have to call those other functions
28
28
  // We overwrite the function definition as soon as those other functions have been declared
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softwear/latestcollectioncore",
3
- "version": "1.0.185",
3
+ "version": "1.0.186",
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
@@ -42,7 +42,7 @@ interface RenderContext {
42
42
  mode: RenderMode
43
43
  /** Total pages from measurement pass; used for field sources like `pageCount` / `page`. */
44
44
  pageCount?: number
45
- /** During measurement, logical printable page (starts at 1); incremented when {@link addPage} runs. In rendering use {@link getCurrentPageNumber} (jsPDF). */
45
+ /** During measurement, logical printable page (starts at 1); incremented when {@link addPage} runs. Rendering: see {@link getCurrentPageNumber} (1-based, matches pdf page fields). */
46
46
  currentPageNumber?: number
47
47
  measureOnly?: boolean // When true, skip drawing to measure bounds (for fillContainer rectangles)
48
48
  imageAssets?: Map<string, PdfImageAsset>
@@ -50,12 +50,12 @@ interface RenderContext {
50
50
  defaultFontFamily?: string
51
51
  }
52
52
 
53
- /** Measurement never advances jsPDF sheet count; rendering uses the active canvas page (1-based). */
53
+ /** Measurement uses context `currentPageNumber` (1-based). Rendering normalizes jsPDF’s internal 0-based page index to 1-based so overlap rules match `pageNumber` fields. */
54
54
  function getCurrentPageNumber(doc: jsPDF, context: RenderContext): number {
55
55
  if (context.mode === 'measurement') {
56
56
  return context.currentPageNumber ?? 1
57
57
  }
58
- return doc.getCurrentPageInfo().pageNumber
58
+ return doc.getCurrentPageInfo().pageNumber + 1
59
59
  }
60
60
 
61
61
  // We have to declare some functions that will be called by other functions but also have to call those other functions