docxodus 3.8.0 → 3.8.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.
@@ -67,6 +67,7 @@ var DocxodusPagination = (() => {
67
67
  * @param options - Pagination options
68
68
  */
69
69
  constructor(staging, container, options = {}) {
70
+ this.pendingFootnoteContinuation = null;
70
71
  this.stagingElement = typeof staging === "string" ? document.getElementById(staging) : staging;
71
72
  this.containerElement = typeof container === "string" ? document.getElementById(container) : container;
72
73
  if (!this.stagingElement) {
@@ -217,9 +218,13 @@ var DocxodusPagination = (() => {
217
218
  /**
218
219
  * Measures the height of footnotes for given IDs (in points).
219
220
  * Creates a temporary container to measure the footnotes.
221
+ * @param footnoteIds - IDs of footnotes to measure
222
+ * @param contentWidth - Width for measurement
223
+ * @param continuation - Optional continuation content to include first
220
224
  */
221
- measureFootnotesHeight(footnoteIds, contentWidth) {
222
- if (footnoteIds.length === 0 || this.footnoteRegistry.size === 0) {
225
+ measureFootnotesHeight(footnoteIds, contentWidth, continuation) {
226
+ const hasContinuation = continuation && continuation.remainingElements.length > 0;
227
+ if (footnoteIds.length === 0 && !hasContinuation || this.footnoteRegistry.size === 0) {
223
228
  return 0;
224
229
  }
225
230
  const measureContainer = document.createElement("div");
@@ -229,6 +234,14 @@ var DocxodusPagination = (() => {
229
234
  measureContainer.style.left = "-9999px";
230
235
  const hr = document.createElement("hr");
231
236
  measureContainer.appendChild(hr);
237
+ if (hasContinuation) {
238
+ const contWrapper = document.createElement("div");
239
+ contWrapper.className = "footnote-continuation";
240
+ for (const el of continuation.remainingElements) {
241
+ contWrapper.appendChild(el.cloneNode(true));
242
+ }
243
+ measureContainer.appendChild(contWrapper);
244
+ }
232
245
  for (const id of footnoteIds) {
233
246
  const footnote = this.footnoteRegistry.get(id);
234
247
  if (footnote) {
@@ -242,12 +255,109 @@ var DocxodusPagination = (() => {
242
255
  return heightPt;
243
256
  }
244
257
  /**
245
- * Adds footnotes to a page container.
258
+ * Measures the height of just the continuation content (in points).
246
259
  */
247
- addPageFootnotes(pageBox, footnoteIds, dims) {
248
- if (footnoteIds.length === 0 || this.footnoteRegistry.size === 0) {
260
+ measureContinuationHeight(continuation, contentWidth) {
261
+ if (!continuation || continuation.remainingElements.length === 0) {
262
+ return 0;
263
+ }
264
+ const measureContainer = document.createElement("div");
265
+ measureContainer.style.position = "absolute";
266
+ measureContainer.style.visibility = "hidden";
267
+ measureContainer.style.width = `${contentWidth}pt`;
268
+ measureContainer.style.left = "-9999px";
269
+ const hr = document.createElement("hr");
270
+ measureContainer.appendChild(hr);
271
+ for (const el of continuation.remainingElements) {
272
+ measureContainer.appendChild(el.cloneNode(true));
273
+ }
274
+ this.stagingElement.appendChild(measureContainer);
275
+ const rect = measureContainer.getBoundingClientRect();
276
+ const heightPt = pxToPt(rect.height);
277
+ this.stagingElement.removeChild(measureContainer);
278
+ return heightPt;
279
+ }
280
+ /**
281
+ * Splits a footnote element into parts that fit within the available height.
282
+ * Returns the elements that fit and the elements that need to continue.
283
+ */
284
+ splitFootnoteToFit(footnoteElement, availableHeightPt, contentWidth) {
285
+ const footnoteContent = footnoteElement.querySelector(".footnote-content");
286
+ if (!footnoteContent) {
287
+ return { fits: [footnoteElement.cloneNode(true)], overflow: [] };
288
+ }
289
+ const children = Array.from(footnoteContent.children);
290
+ if (children.length <= 1) {
291
+ return { fits: [footnoteElement.cloneNode(true)], overflow: [] };
292
+ }
293
+ const fits = [];
294
+ const overflow = [];
295
+ let currentHeight = 0;
296
+ const hrMeasure = document.createElement("div");
297
+ hrMeasure.style.position = "absolute";
298
+ hrMeasure.style.visibility = "hidden";
299
+ hrMeasure.style.width = `${contentWidth}pt`;
300
+ hrMeasure.style.left = "-9999px";
301
+ const hr = document.createElement("hr");
302
+ hrMeasure.appendChild(hr);
303
+ this.stagingElement.appendChild(hrMeasure);
304
+ const hrHeight = pxToPt(hrMeasure.getBoundingClientRect().height);
305
+ this.stagingElement.removeChild(hrMeasure);
306
+ currentHeight = hrHeight;
307
+ const footnoteNumber = footnoteElement.querySelector(".footnote-number");
308
+ for (let i = 0; i < children.length; i++) {
309
+ const child = children[i];
310
+ const measureContainer = document.createElement("div");
311
+ measureContainer.style.position = "absolute";
312
+ measureContainer.style.visibility = "hidden";
313
+ measureContainer.style.width = `${contentWidth}pt`;
314
+ measureContainer.style.left = "-9999px";
315
+ measureContainer.appendChild(child.cloneNode(true));
316
+ this.stagingElement.appendChild(measureContainer);
317
+ const childHeight = pxToPt(measureContainer.getBoundingClientRect().height);
318
+ this.stagingElement.removeChild(measureContainer);
319
+ if (currentHeight + childHeight <= availableHeightPt) {
320
+ fits.push(child.cloneNode(true));
321
+ currentHeight += childHeight;
322
+ } else {
323
+ for (let j = i; j < children.length; j++) {
324
+ overflow.push(children[j].cloneNode(true));
325
+ }
326
+ break;
327
+ }
328
+ }
329
+ return { fits, overflow };
330
+ }
331
+ /**
332
+ * Measures a single footnote's height.
333
+ */
334
+ measureSingleFootnoteHeight(footnoteId, contentWidth) {
335
+ const footnote = this.footnoteRegistry.get(footnoteId);
336
+ if (!footnote) return 0;
337
+ const measureContainer = document.createElement("div");
338
+ measureContainer.style.position = "absolute";
339
+ measureContainer.style.visibility = "hidden";
340
+ measureContainer.style.width = `${contentWidth}pt`;
341
+ measureContainer.style.left = "-9999px";
342
+ measureContainer.appendChild(footnote.cloneNode(true));
343
+ this.stagingElement.appendChild(measureContainer);
344
+ const rect = measureContainer.getBoundingClientRect();
345
+ const heightPt = pxToPt(rect.height);
346
+ this.stagingElement.removeChild(measureContainer);
347
+ return heightPt;
348
+ }
349
+ /**
350
+ * Adds footnotes to a page container, including continuation content.
351
+ */
352
+ addPageFootnotes(pageBox, footnoteIds, dims, continuation, partialFootnotes) {
353
+ const hasContinuation = continuation && continuation.remainingElements.length > 0;
354
+ if (footnoteIds.length === 0 && !hasContinuation) {
249
355
  return;
250
356
  }
357
+ if (this.footnoteRegistry.size === 0 && !hasContinuation) {
358
+ return;
359
+ }
360
+ const partialFootnoteIds = new Set(partialFootnotes?.map((p) => p.footnoteId) || []);
251
361
  const footnotesDiv = document.createElement("div");
252
362
  footnotesDiv.className = `${this.cssPrefix}footnotes`;
253
363
  footnotesDiv.style.position = "absolute";
@@ -257,10 +367,39 @@ var DocxodusPagination = (() => {
257
367
  footnotesDiv.style.boxSizing = "border-box";
258
368
  const hr = document.createElement("hr");
259
369
  footnotesDiv.appendChild(hr);
370
+ if (hasContinuation) {
371
+ const contWrapper = document.createElement("div");
372
+ contWrapper.className = "footnote-continuation";
373
+ for (const el of continuation.remainingElements) {
374
+ contWrapper.appendChild(el.cloneNode(true));
375
+ }
376
+ footnotesDiv.appendChild(contWrapper);
377
+ }
260
378
  for (const id of footnoteIds) {
261
- const footnote = this.footnoteRegistry.get(id);
262
- if (footnote) {
263
- footnotesDiv.appendChild(footnote.cloneNode(true));
379
+ const partial = partialFootnotes?.find((p) => p.footnoteId === id);
380
+ if (partial) {
381
+ const footnote = this.footnoteRegistry.get(id);
382
+ if (footnote) {
383
+ const partialDiv = document.createElement("div");
384
+ partialDiv.className = "footnote-item";
385
+ partialDiv.dataset.footnoteId = id;
386
+ const numberSpan = footnote.querySelector(".footnote-number");
387
+ if (numberSpan) {
388
+ partialDiv.appendChild(numberSpan.cloneNode(true));
389
+ }
390
+ const contentSpan = document.createElement("span");
391
+ contentSpan.className = "footnote-content";
392
+ for (const el of partial.fittingElements) {
393
+ contentSpan.appendChild(el.cloneNode(true));
394
+ }
395
+ partialDiv.appendChild(contentSpan);
396
+ footnotesDiv.appendChild(partialDiv);
397
+ }
398
+ } else {
399
+ const footnote = this.footnoteRegistry.get(id);
400
+ if (footnote) {
401
+ footnotesDiv.appendChild(footnote.cloneNode(true));
402
+ }
264
403
  }
265
404
  }
266
405
  pageBox.appendChild(footnotesDiv);
@@ -296,6 +435,7 @@ var DocxodusPagination = (() => {
296
435
  /**
297
436
  * Flows measured blocks into page containers.
298
437
  * Implements a single-pass, forward-only algorithm that is compatible with future lazy loading.
438
+ * Supports footnote continuation - long footnotes can split across pages.
299
439
  */
300
440
  flowToPages(blocks, dims, startPageNumber, sectionIndex) {
301
441
  const pages = [];
@@ -306,15 +446,23 @@ var DocxodusPagination = (() => {
306
446
  let prevMarginBottomPt = 0;
307
447
  let currentFootnoteIds = [];
308
448
  let currentFootnoteHeight = 0;
449
+ let currentContinuation = this.pendingFootnoteContinuation;
450
+ let nextPageContinuation = null;
451
+ let currentPartialFootnotes = [];
452
+ if (currentContinuation && currentContinuation.remainingElements.length > 0) {
453
+ currentFootnoteHeight = this.measureContinuationHeight(currentContinuation, dims.contentWidth);
454
+ }
309
455
  const finishPage = () => {
310
- if (currentContent.length === 0) return;
456
+ if (currentContent.length === 0 && !currentContinuation) return;
311
457
  const page = this.createPage(
312
458
  dims,
313
459
  pageNumber,
314
460
  sectionIndex,
315
461
  currentContent,
316
462
  pageInSection,
317
- currentFootnoteIds
463
+ currentFootnoteIds,
464
+ currentContinuation,
465
+ currentPartialFootnotes.length > 0 ? currentPartialFootnotes : void 0
318
466
  );
319
467
  pages.push(page);
320
468
  pageNumber++;
@@ -323,7 +471,14 @@ var DocxodusPagination = (() => {
323
471
  remainingHeight = dims.contentHeight;
324
472
  prevMarginBottomPt = 0;
325
473
  currentFootnoteIds = [];
326
- currentFootnoteHeight = 0;
474
+ currentPartialFootnotes = [];
475
+ currentContinuation = nextPageContinuation;
476
+ nextPageContinuation = null;
477
+ if (currentContinuation && currentContinuation.remainingElements.length > 0) {
478
+ currentFootnoteHeight = this.measureContinuationHeight(currentContinuation, dims.contentWidth);
479
+ } else {
480
+ currentFootnoteHeight = 0;
481
+ }
327
482
  };
328
483
  for (let i = 0; i < blocks.length; i++) {
329
484
  const block = blocks[i];
@@ -340,7 +495,11 @@ var DocxodusPagination = (() => {
340
495
  let additionalFootnoteHeight = 0;
341
496
  if (newFootnoteIds.length > 0 && this.footnoteRegistry.size > 0) {
342
497
  const combinedFootnoteIds = [...currentFootnoteIds, ...newFootnoteIds];
343
- const totalFootnoteHeight = this.measureFootnotesHeight(combinedFootnoteIds, dims.contentWidth);
498
+ const totalFootnoteHeight = this.measureFootnotesHeight(
499
+ combinedFootnoteIds,
500
+ dims.contentWidth,
501
+ currentContinuation
502
+ );
344
503
  additionalFootnoteHeight = totalFootnoteHeight - currentFootnoteHeight;
345
504
  }
346
505
  const isFirstOnPage = currentContent.length === 0;
@@ -363,15 +522,69 @@ var DocxodusPagination = (() => {
363
522
  currentFootnoteIds.push(...newFootnoteIds);
364
523
  currentFootnoteHeight += additionalFootnoteHeight;
365
524
  }
366
- } else if (block.heightPt + block.marginTopPt + block.marginBottomPt + additionalFootnoteHeight <= dims.contentHeight) {
367
- finishPage();
368
- const newPageFootnoteHeight = blockFootnoteIds.length > 0 ? this.measureFootnotesHeight(blockFootnoteIds, dims.contentWidth) : 0;
369
- const newPageSpace = block.marginTopPt + block.heightPt + block.marginBottomPt;
370
- currentContent.push(block.element.cloneNode(true));
371
- remainingHeight = dims.contentHeight - newPageSpace;
372
- prevMarginBottomPt = block.marginBottomPt;
373
- currentFootnoteIds = [...blockFootnoteIds];
374
- currentFootnoteHeight = newPageFootnoteHeight;
525
+ } else if (block.heightPt + block.marginTopPt + block.marginBottomPt <= dims.contentHeight) {
526
+ const blockSpaceWithoutFootnotes = effectiveMarginTop + block.heightPt + block.marginBottomPt;
527
+ if (newFootnoteIds.length > 0 && blockSpaceWithoutFootnotes <= effectiveRemainingHeight) {
528
+ currentContent.push(block.element.cloneNode(true));
529
+ remainingHeight -= effectiveMarginTop + block.heightPt + block.marginBottomPt;
530
+ prevMarginBottomPt = block.marginBottomPt;
531
+ const spaceForFootnotes = remainingHeight - currentFootnoteHeight;
532
+ for (const footnoteId of newFootnoteIds) {
533
+ const footnote = this.footnoteRegistry.get(footnoteId);
534
+ if (!footnote) continue;
535
+ const footnoteHeight = this.measureSingleFootnoteHeight(footnoteId, dims.contentWidth);
536
+ if (footnoteHeight <= spaceForFootnotes - currentFootnoteHeight) {
537
+ currentFootnoteIds.push(footnoteId);
538
+ currentFootnoteHeight += footnoteHeight;
539
+ } else {
540
+ const availableForThisFootnote = spaceForFootnotes;
541
+ if (availableForThisFootnote > 20) {
542
+ const { fits, overflow } = this.splitFootnoteToFit(
543
+ footnote,
544
+ availableForThisFootnote,
545
+ dims.contentWidth
546
+ );
547
+ if (fits.length > 0) {
548
+ currentFootnoteIds.push(footnoteId);
549
+ currentPartialFootnotes.push({
550
+ footnoteId,
551
+ fittingElements: fits
552
+ });
553
+ nextPageContinuation = {
554
+ footnoteId,
555
+ remainingElements: overflow
556
+ };
557
+ currentFootnoteHeight = spaceForFootnotes;
558
+ } else {
559
+ nextPageContinuation = {
560
+ footnoteId,
561
+ remainingElements: Array.from(footnote.querySelectorAll(".footnote-content > *")).map((el) => el.cloneNode(true))
562
+ };
563
+ if (nextPageContinuation.remainingElements.length === 0) {
564
+ nextPageContinuation.remainingElements = [footnote.cloneNode(true)];
565
+ }
566
+ }
567
+ } else {
568
+ nextPageContinuation = {
569
+ footnoteId,
570
+ remainingElements: Array.from(footnote.querySelectorAll(".footnote-content > *")).map((el) => el.cloneNode(true))
571
+ };
572
+ if (nextPageContinuation.remainingElements.length === 0) {
573
+ nextPageContinuation.remainingElements = [footnote.cloneNode(true)];
574
+ }
575
+ }
576
+ }
577
+ }
578
+ } else {
579
+ finishPage();
580
+ const newPageFootnoteHeight = blockFootnoteIds.length > 0 ? this.measureFootnotesHeight(blockFootnoteIds, dims.contentWidth, currentContinuation) : currentContinuation ? this.measureContinuationHeight(currentContinuation, dims.contentWidth) : 0;
581
+ const newPageSpace = block.marginTopPt + block.heightPt + block.marginBottomPt;
582
+ currentContent.push(block.element.cloneNode(true));
583
+ remainingHeight = dims.contentHeight - newPageSpace;
584
+ prevMarginBottomPt = block.marginBottomPt;
585
+ currentFootnoteIds = [...blockFootnoteIds];
586
+ currentFootnoteHeight = newPageFootnoteHeight;
587
+ }
375
588
  } else {
376
589
  if (currentContent.length > 0) {
377
590
  finishPage();
@@ -382,12 +595,13 @@ var DocxodusPagination = (() => {
382
595
  }
383
596
  }
384
597
  finishPage();
598
+ this.pendingFootnoteContinuation = nextPageContinuation;
385
599
  return pages;
386
600
  }
387
601
  /**
388
602
  * Creates a page container element.
389
603
  */
390
- createPage(dims, pageNumber, sectionIndex, content, pageInSection, footnoteIds = []) {
604
+ createPage(dims, pageNumber, sectionIndex, content, pageInSection, footnoteIds = [], continuation, partialFootnotes) {
391
605
  const pageBox = document.createElement("div");
392
606
  pageBox.className = `${this.cssPrefix}box`;
393
607
  pageBox.style.width = `${dims.pageWidth}pt`;
@@ -441,8 +655,9 @@ var DocxodusPagination = (() => {
441
655
  contentArea.appendChild(el);
442
656
  }
443
657
  pageBox.appendChild(contentArea);
444
- if (footnoteIds.length > 0) {
445
- this.addPageFootnotes(pageBox, footnoteIds, dims);
658
+ const hasContinuation = continuation && continuation.remainingElements.length > 0;
659
+ if (footnoteIds.length > 0 || hasContinuation) {
660
+ this.addPageFootnotes(pageBox, footnoteIds, dims, continuation, partialFootnotes);
446
661
  }
447
662
  const footerSource = this.selectFooter(sectionIndex, pageInSection, pageNumber);
448
663
  if (footerSource) {
@@ -123,6 +123,7 @@ export declare class PaginationEngine {
123
123
  private pageGap;
124
124
  private hfRegistry;
125
125
  private footnoteRegistry;
126
+ private pendingFootnoteContinuation;
126
127
  /**
127
128
  * Creates a new pagination engine.
128
129
  *
@@ -156,10 +157,26 @@ export declare class PaginationEngine {
156
157
  /**
157
158
  * Measures the height of footnotes for given IDs (in points).
158
159
  * Creates a temporary container to measure the footnotes.
160
+ * @param footnoteIds - IDs of footnotes to measure
161
+ * @param contentWidth - Width for measurement
162
+ * @param continuation - Optional continuation content to include first
159
163
  */
160
164
  private measureFootnotesHeight;
161
165
  /**
162
- * Adds footnotes to a page container.
166
+ * Measures the height of just the continuation content (in points).
167
+ */
168
+ private measureContinuationHeight;
169
+ /**
170
+ * Splits a footnote element into parts that fit within the available height.
171
+ * Returns the elements that fit and the elements that need to continue.
172
+ */
173
+ private splitFootnoteToFit;
174
+ /**
175
+ * Measures a single footnote's height.
176
+ */
177
+ private measureSingleFootnoteHeight;
178
+ /**
179
+ * Adds footnotes to a page container, including continuation content.
163
180
  */
164
181
  private addPageFootnotes;
165
182
  /**
@@ -173,6 +190,7 @@ export declare class PaginationEngine {
173
190
  /**
174
191
  * Flows measured blocks into page containers.
175
192
  * Implements a single-pass, forward-only algorithm that is compatible with future lazy loading.
193
+ * Supports footnote continuation - long footnotes can split across pages.
176
194
  */
177
195
  private flowToPages;
178
196
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,aAAa,EAAE,MAAM,CAAC;IACtB,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,wBAAwB;IACxB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,uBAAuB;IACvB,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,uDAAuD;IACvD,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,wBAAwB;IACxB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,uBAAuB;IACv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OAEG;IACH,OAAO,CAAC,yBAAyB;IA6CjC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAmB7B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAY3B;;;;;;OAMG;IACH,OAAO,CAAC,sBAAsB;IAoD9B;;OAEG;IACH,OAAO,CAAC,yBAAyB;IA+BjC;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAoE1B;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAmBnC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAgFxB;;OAEG;IACH,OAAO,CAAC,YAAY;IAsBpB;;OAEG;IACH,OAAO,CAAC,YAAY;IAsBpB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAsPnB;;OAEG;IACH,OAAO,CAAC,UAAU;CAkInB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,WAAW,GAAG,MAAM,EAC/B,OAAO,GAAE,iBAAsB,GAC9B,gBAAgB,CAgClB"}
@@ -58,6 +58,7 @@ export class PaginationEngine {
58
58
  * @param options - Pagination options
59
59
  */
60
60
  constructor(staging, container, options = {}) {
61
+ this.pendingFootnoteContinuation = null;
61
62
  this.stagingElement =
62
63
  typeof staging === "string"
63
64
  ? document.getElementById(staging)
@@ -231,9 +232,13 @@ export class PaginationEngine {
231
232
  /**
232
233
  * Measures the height of footnotes for given IDs (in points).
233
234
  * Creates a temporary container to measure the footnotes.
235
+ * @param footnoteIds - IDs of footnotes to measure
236
+ * @param contentWidth - Width for measurement
237
+ * @param continuation - Optional continuation content to include first
234
238
  */
235
- measureFootnotesHeight(footnoteIds, contentWidth) {
236
- if (footnoteIds.length === 0 || this.footnoteRegistry.size === 0) {
239
+ measureFootnotesHeight(footnoteIds, contentWidth, continuation) {
240
+ const hasContinuation = continuation && continuation.remainingElements.length > 0;
241
+ if ((footnoteIds.length === 0 && !hasContinuation) || this.footnoteRegistry.size === 0) {
237
242
  return 0;
238
243
  }
239
244
  // Create a temporary measurement container
@@ -245,6 +250,15 @@ export class PaginationEngine {
245
250
  // Add separator line (same as will be rendered)
246
251
  const hr = document.createElement("hr");
247
252
  measureContainer.appendChild(hr);
253
+ // Add continuation content first (if any)
254
+ if (hasContinuation) {
255
+ const contWrapper = document.createElement("div");
256
+ contWrapper.className = "footnote-continuation";
257
+ for (const el of continuation.remainingElements) {
258
+ contWrapper.appendChild(el.cloneNode(true));
259
+ }
260
+ measureContainer.appendChild(contWrapper);
261
+ }
248
262
  // Add footnotes
249
263
  for (const id of footnoteIds) {
250
264
  const footnote = this.footnoteRegistry.get(id);
@@ -262,12 +276,121 @@ export class PaginationEngine {
262
276
  return heightPt;
263
277
  }
264
278
  /**
265
- * Adds footnotes to a page container.
279
+ * Measures the height of just the continuation content (in points).
280
+ */
281
+ measureContinuationHeight(continuation, contentWidth) {
282
+ if (!continuation || continuation.remainingElements.length === 0) {
283
+ return 0;
284
+ }
285
+ const measureContainer = document.createElement("div");
286
+ measureContainer.style.position = "absolute";
287
+ measureContainer.style.visibility = "hidden";
288
+ measureContainer.style.width = `${contentWidth}pt`;
289
+ measureContainer.style.left = "-9999px";
290
+ // Add separator line
291
+ const hr = document.createElement("hr");
292
+ measureContainer.appendChild(hr);
293
+ // Add continuation content
294
+ for (const el of continuation.remainingElements) {
295
+ measureContainer.appendChild(el.cloneNode(true));
296
+ }
297
+ this.stagingElement.appendChild(measureContainer);
298
+ const rect = measureContainer.getBoundingClientRect();
299
+ const heightPt = pxToPt(rect.height);
300
+ this.stagingElement.removeChild(measureContainer);
301
+ return heightPt;
302
+ }
303
+ /**
304
+ * Splits a footnote element into parts that fit within the available height.
305
+ * Returns the elements that fit and the elements that need to continue.
266
306
  */
267
- addPageFootnotes(pageBox, footnoteIds, dims) {
268
- if (footnoteIds.length === 0 || this.footnoteRegistry.size === 0) {
307
+ splitFootnoteToFit(footnoteElement, availableHeightPt, contentWidth) {
308
+ // Get child elements (paragraphs) of the footnote content
309
+ const footnoteContent = footnoteElement.querySelector(".footnote-content");
310
+ if (!footnoteContent) {
311
+ // No content structure, can't split - return whole footnote
312
+ return { fits: [footnoteElement.cloneNode(true)], overflow: [] };
313
+ }
314
+ const children = Array.from(footnoteContent.children);
315
+ if (children.length <= 1) {
316
+ // Single paragraph, can't split at paragraph level
317
+ return { fits: [footnoteElement.cloneNode(true)], overflow: [] };
318
+ }
319
+ const fits = [];
320
+ const overflow = [];
321
+ let currentHeight = 0;
322
+ // Measure separator line height
323
+ const hrMeasure = document.createElement("div");
324
+ hrMeasure.style.position = "absolute";
325
+ hrMeasure.style.visibility = "hidden";
326
+ hrMeasure.style.width = `${contentWidth}pt`;
327
+ hrMeasure.style.left = "-9999px";
328
+ const hr = document.createElement("hr");
329
+ hrMeasure.appendChild(hr);
330
+ this.stagingElement.appendChild(hrMeasure);
331
+ const hrHeight = pxToPt(hrMeasure.getBoundingClientRect().height);
332
+ this.stagingElement.removeChild(hrMeasure);
333
+ currentHeight = hrHeight;
334
+ // Also account for footnote number
335
+ const footnoteNumber = footnoteElement.querySelector(".footnote-number");
336
+ for (let i = 0; i < children.length; i++) {
337
+ const child = children[i];
338
+ // Measure this element
339
+ const measureContainer = document.createElement("div");
340
+ measureContainer.style.position = "absolute";
341
+ measureContainer.style.visibility = "hidden";
342
+ measureContainer.style.width = `${contentWidth}pt`;
343
+ measureContainer.style.left = "-9999px";
344
+ measureContainer.appendChild(child.cloneNode(true));
345
+ this.stagingElement.appendChild(measureContainer);
346
+ const childHeight = pxToPt(measureContainer.getBoundingClientRect().height);
347
+ this.stagingElement.removeChild(measureContainer);
348
+ if (currentHeight + childHeight <= availableHeightPt) {
349
+ fits.push(child.cloneNode(true));
350
+ currentHeight += childHeight;
351
+ }
352
+ else {
353
+ // This and remaining elements overflow
354
+ for (let j = i; j < children.length; j++) {
355
+ overflow.push(children[j].cloneNode(true));
356
+ }
357
+ break;
358
+ }
359
+ }
360
+ return { fits, overflow };
361
+ }
362
+ /**
363
+ * Measures a single footnote's height.
364
+ */
365
+ measureSingleFootnoteHeight(footnoteId, contentWidth) {
366
+ const footnote = this.footnoteRegistry.get(footnoteId);
367
+ if (!footnote)
368
+ return 0;
369
+ const measureContainer = document.createElement("div");
370
+ measureContainer.style.position = "absolute";
371
+ measureContainer.style.visibility = "hidden";
372
+ measureContainer.style.width = `${contentWidth}pt`;
373
+ measureContainer.style.left = "-9999px";
374
+ measureContainer.appendChild(footnote.cloneNode(true));
375
+ this.stagingElement.appendChild(measureContainer);
376
+ const rect = measureContainer.getBoundingClientRect();
377
+ const heightPt = pxToPt(rect.height);
378
+ this.stagingElement.removeChild(measureContainer);
379
+ return heightPt;
380
+ }
381
+ /**
382
+ * Adds footnotes to a page container, including continuation content.
383
+ */
384
+ addPageFootnotes(pageBox, footnoteIds, dims, continuation, partialFootnotes) {
385
+ const hasContinuation = continuation && continuation.remainingElements.length > 0;
386
+ if (footnoteIds.length === 0 && !hasContinuation) {
387
+ return;
388
+ }
389
+ if (this.footnoteRegistry.size === 0 && !hasContinuation) {
269
390
  return;
270
391
  }
392
+ // Create a set of partial footnote IDs for quick lookup
393
+ const partialFootnoteIds = new Set(partialFootnotes?.map(p => p.footnoteId) || []);
271
394
  const footnotesDiv = document.createElement("div");
272
395
  footnotesDiv.className = `${this.cssPrefix}footnotes`;
273
396
  footnotesDiv.style.position = "absolute";
@@ -278,11 +401,47 @@ export class PaginationEngine {
278
401
  // Add separator line
279
402
  const hr = document.createElement("hr");
280
403
  footnotesDiv.appendChild(hr);
404
+ // Add continuation content first (if any)
405
+ if (hasContinuation) {
406
+ const contWrapper = document.createElement("div");
407
+ contWrapper.className = "footnote-continuation";
408
+ for (const el of continuation.remainingElements) {
409
+ contWrapper.appendChild(el.cloneNode(true));
410
+ }
411
+ footnotesDiv.appendChild(contWrapper);
412
+ }
281
413
  // Clone footnotes in order of appearance
282
414
  for (const id of footnoteIds) {
283
- const footnote = this.footnoteRegistry.get(id);
284
- if (footnote) {
285
- footnotesDiv.appendChild(footnote.cloneNode(true));
415
+ // Check if this is a partial footnote
416
+ const partial = partialFootnotes?.find(p => p.footnoteId === id);
417
+ if (partial) {
418
+ // Render partial footnote (only the fitting elements)
419
+ const footnote = this.footnoteRegistry.get(id);
420
+ if (footnote) {
421
+ const partialDiv = document.createElement("div");
422
+ partialDiv.className = "footnote-item";
423
+ partialDiv.dataset.footnoteId = id;
424
+ // Add footnote number
425
+ const numberSpan = footnote.querySelector(".footnote-number");
426
+ if (numberSpan) {
427
+ partialDiv.appendChild(numberSpan.cloneNode(true));
428
+ }
429
+ // Add only the fitting content
430
+ const contentSpan = document.createElement("span");
431
+ contentSpan.className = "footnote-content";
432
+ for (const el of partial.fittingElements) {
433
+ contentSpan.appendChild(el.cloneNode(true));
434
+ }
435
+ partialDiv.appendChild(contentSpan);
436
+ footnotesDiv.appendChild(partialDiv);
437
+ }
438
+ }
439
+ else {
440
+ // Render full footnote from registry
441
+ const footnote = this.footnoteRegistry.get(id);
442
+ if (footnote) {
443
+ footnotesDiv.appendChild(footnote.cloneNode(true));
444
+ }
286
445
  }
287
446
  }
288
447
  pageBox.appendChild(footnotesDiv);
@@ -326,6 +485,7 @@ export class PaginationEngine {
326
485
  /**
327
486
  * Flows measured blocks into page containers.
328
487
  * Implements a single-pass, forward-only algorithm that is compatible with future lazy loading.
488
+ * Supports footnote continuation - long footnotes can split across pages.
329
489
  */
330
490
  flowToPages(blocks, dims, startPageNumber, sectionIndex) {
331
491
  const pages = [];
@@ -340,10 +500,20 @@ export class PaginationEngine {
340
500
  let currentFootnoteIds = [];
341
501
  // Track height consumed by footnotes on current page
342
502
  let currentFootnoteHeight = 0;
503
+ // Track footnote continuation for current page (from previous page)
504
+ let currentContinuation = this.pendingFootnoteContinuation;
505
+ // Track any new continuation that will carry to next page
506
+ let nextPageContinuation = null;
507
+ // Track partial footnotes for current page (footnotes that were split)
508
+ let currentPartialFootnotes = [];
509
+ // Account for any continuation from previous section/page
510
+ if (currentContinuation && currentContinuation.remainingElements.length > 0) {
511
+ currentFootnoteHeight = this.measureContinuationHeight(currentContinuation, dims.contentWidth);
512
+ }
343
513
  const finishPage = () => {
344
- if (currentContent.length === 0)
514
+ if (currentContent.length === 0 && !currentContinuation)
345
515
  return;
346
- const page = this.createPage(dims, pageNumber, sectionIndex, currentContent, pageInSection, currentFootnoteIds);
516
+ const page = this.createPage(dims, pageNumber, sectionIndex, currentContent, pageInSection, currentFootnoteIds, currentContinuation, currentPartialFootnotes.length > 0 ? currentPartialFootnotes : undefined);
347
517
  pages.push(page);
348
518
  pageNumber++;
349
519
  pageInSection++;
@@ -351,7 +521,17 @@ export class PaginationEngine {
351
521
  remainingHeight = dims.contentHeight;
352
522
  prevMarginBottomPt = 0; // Reset margin tracking for new page
353
523
  currentFootnoteIds = []; // Reset footnotes for new page
354
- currentFootnoteHeight = 0;
524
+ currentPartialFootnotes = []; // Reset partial footnotes for new page
525
+ // Carry over continuation to next page
526
+ currentContinuation = nextPageContinuation;
527
+ nextPageContinuation = null;
528
+ // Account for continuation height on new page
529
+ if (currentContinuation && currentContinuation.remainingElements.length > 0) {
530
+ currentFootnoteHeight = this.measureContinuationHeight(currentContinuation, dims.contentWidth);
531
+ }
532
+ else {
533
+ currentFootnoteHeight = 0;
534
+ }
355
535
  };
356
536
  for (let i = 0; i < blocks.length; i++) {
357
537
  const block = blocks[i];
@@ -373,8 +553,9 @@ export class PaginationEngine {
373
553
  let additionalFootnoteHeight = 0;
374
554
  if (newFootnoteIds.length > 0 && this.footnoteRegistry.size > 0) {
375
555
  // Measure the combined height of all footnotes that would be on this page
556
+ // (including any continuation)
376
557
  const combinedFootnoteIds = [...currentFootnoteIds, ...newFootnoteIds];
377
- const totalFootnoteHeight = this.measureFootnotesHeight(combinedFootnoteIds, dims.contentWidth);
558
+ const totalFootnoteHeight = this.measureFootnotesHeight(combinedFootnoteIds, dims.contentWidth, currentContinuation);
378
559
  additionalFootnoteHeight = totalFootnoteHeight - currentFootnoteHeight;
379
560
  }
380
561
  // Calculate the effective height this block will consume
@@ -409,20 +590,93 @@ export class PaginationEngine {
409
590
  currentFootnoteHeight += additionalFootnoteHeight;
410
591
  }
411
592
  }
412
- else if (block.heightPt + block.marginTopPt + block.marginBottomPt + additionalFootnoteHeight <= dims.contentHeight) {
413
- // Block doesn't fit but will fit on a new page
414
- finishPage();
415
- // On new page, recalculate footnote height for just this block's footnotes
416
- const newPageFootnoteHeight = blockFootnoteIds.length > 0
417
- ? this.measureFootnotesHeight(blockFootnoteIds, dims.contentWidth)
418
- : 0;
419
- // Include full top margin
420
- const newPageSpace = block.marginTopPt + block.heightPt + block.marginBottomPt;
421
- currentContent.push(block.element.cloneNode(true));
422
- remainingHeight = dims.contentHeight - newPageSpace;
423
- prevMarginBottomPt = block.marginBottomPt;
424
- currentFootnoteIds = [...blockFootnoteIds];
425
- currentFootnoteHeight = newPageFootnoteHeight;
593
+ else if (block.heightPt + block.marginTopPt + block.marginBottomPt <= dims.contentHeight) {
594
+ // Block doesn't fit but will fit on a new page (even with footnotes)
595
+ // Check if we need to split any footnotes on the current page first
596
+ // Try to fit the block with partial footnotes using footnote continuation
597
+ const blockSpaceWithoutFootnotes = effectiveMarginTop + block.heightPt + block.marginBottomPt;
598
+ if (newFootnoteIds.length > 0 && blockSpaceWithoutFootnotes <= effectiveRemainingHeight) {
599
+ // Block itself fits, but footnotes don't - try footnote continuation
600
+ currentContent.push(block.element.cloneNode(true));
601
+ remainingHeight -= (effectiveMarginTop + block.heightPt + block.marginBottomPt);
602
+ prevMarginBottomPt = block.marginBottomPt;
603
+ // Calculate space available for footnotes
604
+ const spaceForFootnotes = remainingHeight - currentFootnoteHeight;
605
+ // Try to fit as much of each new footnote as possible
606
+ for (const footnoteId of newFootnoteIds) {
607
+ const footnote = this.footnoteRegistry.get(footnoteId);
608
+ if (!footnote)
609
+ continue;
610
+ const footnoteHeight = this.measureSingleFootnoteHeight(footnoteId, dims.contentWidth);
611
+ if (footnoteHeight <= spaceForFootnotes - currentFootnoteHeight) {
612
+ // Whole footnote fits
613
+ currentFootnoteIds.push(footnoteId);
614
+ currentFootnoteHeight += footnoteHeight;
615
+ }
616
+ else {
617
+ // Footnote needs to be split - try to fit part of it
618
+ const availableForThisFootnote = spaceForFootnotes;
619
+ if (availableForThisFootnote > 20) { // Minimum space to start a footnote (roughly 1 line + separator)
620
+ const { fits, overflow } = this.splitFootnoteToFit(footnote, availableForThisFootnote, dims.contentWidth);
621
+ if (fits.length > 0) {
622
+ // Add partial footnote to current page
623
+ currentFootnoteIds.push(footnoteId);
624
+ // Track this as a partial footnote so we only render the fitting part
625
+ currentPartialFootnotes.push({
626
+ footnoteId,
627
+ fittingElements: fits
628
+ });
629
+ // Store overflow for next page
630
+ nextPageContinuation = {
631
+ footnoteId,
632
+ remainingElements: overflow
633
+ };
634
+ // Update height (approximate - we've added some content)
635
+ currentFootnoteHeight = spaceForFootnotes;
636
+ }
637
+ else {
638
+ // Nothing fits, entire footnote continues to next page
639
+ nextPageContinuation = {
640
+ footnoteId,
641
+ remainingElements: Array.from(footnote.querySelectorAll(".footnote-content > *"))
642
+ .map(el => el.cloneNode(true))
643
+ };
644
+ // If no content elements found, use the whole footnote
645
+ if (nextPageContinuation.remainingElements.length === 0) {
646
+ nextPageContinuation.remainingElements = [footnote.cloneNode(true)];
647
+ }
648
+ }
649
+ }
650
+ else {
651
+ // Not enough space to start footnote - continue whole thing
652
+ nextPageContinuation = {
653
+ footnoteId,
654
+ remainingElements: Array.from(footnote.querySelectorAll(".footnote-content > *"))
655
+ .map(el => el.cloneNode(true))
656
+ };
657
+ if (nextPageContinuation.remainingElements.length === 0) {
658
+ nextPageContinuation.remainingElements = [footnote.cloneNode(true)];
659
+ }
660
+ }
661
+ }
662
+ }
663
+ }
664
+ else {
665
+ // Block itself doesn't fit - start new page
666
+ finishPage();
667
+ // On new page, recalculate footnote height for just this block's footnotes
668
+ // (plus any continuation from previous page)
669
+ const newPageFootnoteHeight = blockFootnoteIds.length > 0
670
+ ? this.measureFootnotesHeight(blockFootnoteIds, dims.contentWidth, currentContinuation)
671
+ : (currentContinuation ? this.measureContinuationHeight(currentContinuation, dims.contentWidth) : 0);
672
+ // Include full top margin
673
+ const newPageSpace = block.marginTopPt + block.heightPt + block.marginBottomPt;
674
+ currentContent.push(block.element.cloneNode(true));
675
+ remainingHeight = dims.contentHeight - newPageSpace;
676
+ prevMarginBottomPt = block.marginBottomPt;
677
+ currentFootnoteIds = [...blockFootnoteIds];
678
+ currentFootnoteHeight = newPageFootnoteHeight;
679
+ }
426
680
  }
427
681
  else {
428
682
  // Block is taller than a page - add it and let it overflow
@@ -437,12 +691,14 @@ export class PaginationEngine {
437
691
  }
438
692
  // Finish last page
439
693
  finishPage();
694
+ // Store any remaining continuation for next section
695
+ this.pendingFootnoteContinuation = nextPageContinuation;
440
696
  return pages;
441
697
  }
442
698
  /**
443
699
  * Creates a page container element.
444
700
  */
445
- createPage(dims, pageNumber, sectionIndex, content, pageInSection, footnoteIds = []) {
701
+ createPage(dims, pageNumber, sectionIndex, content, pageInSection, footnoteIds = [], continuation, partialFootnotes) {
446
702
  // Create page box at full size, then scale the entire box
447
703
  // This ensures proper clipping and consistent scaling of all elements
448
704
  const pageBox = document.createElement("div");
@@ -511,9 +767,10 @@ export class PaginationEngine {
511
767
  contentArea.appendChild(el);
512
768
  }
513
769
  pageBox.appendChild(contentArea);
514
- // Add footnotes if any references appear on this page
515
- if (footnoteIds.length > 0) {
516
- this.addPageFootnotes(pageBox, footnoteIds, dims);
770
+ // Add footnotes if any references appear on this page (or continuation from previous)
771
+ const hasContinuation = continuation && continuation.remainingElements.length > 0;
772
+ if (footnoteIds.length > 0 || hasContinuation) {
773
+ this.addPageFootnotes(pageBox, footnoteIds, dims, continuation, partialFootnotes);
517
774
  }
518
775
  // Add footer if available for this section/page
519
776
  const footerSource = this.selectFooter(sectionIndex, pageInSection, pageNumber);
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.js","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":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C/C,MAAM,OAAO,GAAG,WAAW,CAAC,aAAa,CAAc,qBAAqB,CAAC;QAC3E,WAAW,CAAC,aAAa,CAAc,IAAI,SAAS,SAAS,CAAC,CAAC;IACjE,MAAM,aAAa,GAAG,WAAW,CAAC,aAAa,CAAc,uBAAuB,CAAC;QACnF,WAAW,CAAC,aAAa,CAAc,IAAI,SAAS,WAAW,CAAC,CAAC;IAEnE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,sGAAsG,CACvG,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;IACrE,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC3B,CAAC"}
Binary file
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "mainAssemblyName": "DocxodusWasm.dll",
3
3
  "resources": {
4
- "hash": "sha256-P32xSIvA3tYByp2MpFMtks8DzXj+JZkm9OJj8VGEzOE=",
4
+ "hash": "sha256-RxzAbbsN5S15Hyo0OI+2N+bdwmHFby0/QxLF4Ifsfgc=",
5
5
  "jsModuleNative": {
6
6
  "dotnet.native.js": "sha256-YLwjs9CPwrZG7YKULjmqr5bYsmhxwcWJOhQNM4bG6Gc="
7
7
  },
@@ -17,8 +17,8 @@
17
17
  "assembly": {
18
18
  "DocumentFormat.OpenXml.wasm": "sha256-edAN2rIA7QQ8K5qp1o5QXplt8M80fEiVmuMgT/MBmLM=",
19
19
  "DocumentFormat.OpenXml.Framework.wasm": "sha256-CFdrD1dSpnkcOk0gxZcKb2T5p+q2ck9ivs+TOML6Jmw=",
20
- "Docxodus.wasm": "sha256-dz1pKwjvSqtjV6Ol4pB7LMny6xgHPUw3U/ruXt0ayAw=",
21
- "DocxodusWasm.wasm": "sha256-iwUdChc7ew6Xv4XER/NAlFUHkIqyIeuhWB0LKgAn3zM=",
20
+ "Docxodus.wasm": "sha256-OvZl/9HSRpL+1JEJwO0mgaE0j65ablClKKCv9Jd7QoY=",
21
+ "DocxodusWasm.wasm": "sha256-Z25cMxmJXbqKUF/HAmC1MgLELIeCNbdSFxOZc2gIRNs=",
22
22
  "SkiaSharp.wasm": "sha256-U6RbqUVBn8Vx8qpghJC5+r/DC1NSBY+EIRDxP8o6dsk=",
23
23
  "System.Collections.Concurrent.wasm": "sha256-xXJbJWNeQ2DSYvAGUoUHjF9y4Iajv2ed0eACOxWD19U=",
24
24
  "System.Collections.wasm": "sha256-mNLhFaXT8X16KYjUVNFYwcdw0h3BUjgD427TR5IWVKU=",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docxodus",
3
- "version": "3.8.0",
3
+ "version": "3.8.1",
4
4
  "description": "DOCX document comparison and HTML conversion in the browser using WebAssembly",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",