@@ -116,7 +116,7 @@ export const Pagination = Extension.create({
116116 shouldUpdate = true ;
117117 if ( isDebugging ) console . debug ( '🚀 UPDATE DECORATIONS' )
118118 if ( isForceUpdate ) shouldUpdate = true ;
119-
119+
120120 return {
121121 ...oldState ,
122122 isReadyToInit : shouldInitialize ,
@@ -160,10 +160,10 @@ export const Pagination = Extension.create({
160160/**
161161 * Get the correct header or footer ID based on the current page number and section type
162162 * Consider wether or not we need to alternate odd/even pages or if we have a title page
163- *
164- * @param {Number } currentPageNumber
165- * @param {String } sectionType
166- * @param {Editor } editor
163+ *
164+ * @param {Number } currentPageNumber
165+ * @param {String } sectionType
166+ * @param {Editor } editor
167167 * @returns {String|null } The header or footer ID
168168 */
169169const getHeaderFooterId = ( currentPageNumber , sectionType , editor , node = null ) => {
@@ -288,7 +288,7 @@ const calculatePageBreaks = (view, editor, sectionData) => {
288288 // Clean up
289289 tempView . destroy ( ) ;
290290 document . body . removeChild ( tempContainer ) ;
291-
291+
292292 // Return a list of page break decorations
293293 return DecorationSet . create ( view . state . doc , decorations ) ;
294294} ;
@@ -336,10 +336,10 @@ function generateInternalPageBreaks(doc, view, editor, sectionData) {
336336 doc . descendants ( ( node , pos ) => {
337337 let currentNode = node ;
338338 let currentPos = pos ;
339-
339+
340340 coords = view ?. coordsAtPos ( currentPos ) ;
341341 if ( ! coords ) return ;
342-
342+
343343 let shouldAddPageBreak = coords . bottom > pageHeightThreshold ;
344344 let isHardBreakNode = currentNode . type . name === 'hardBreak' ;
345345
@@ -507,10 +507,10 @@ function createHeader(pageMargins, pageSize, sectionData, headerId, editor) {
507507 }
508508
509509 const data = editor . converter . headers [ headerId ] ;
510- const editorSection = createHeaderFooterEditor ( {
511- editor,
512- data,
513- editorContainer,
510+ const editorSection = createHeaderFooterEditor ( {
511+ editor,
512+ data,
513+ editorContainer,
514514 appendToBody : false ,
515515 sectionId : headerId ,
516516 type : 'header' ,
@@ -534,7 +534,7 @@ function createHeader(pageMargins, pageSize, sectionData, headerId, editor) {
534534 if ( isDebugging ) editorContainer . style . backgroundColor = '#00aaaa55' ;
535535
536536 editorContainer . addEventListener ( 'dblclick' , ( ) => onHeaderFooterDblClick ( editor , editorSection ) ) ;
537-
537+
538538 return {
539539 section : editorContainer ,
540540 headerHeight : headerHeight ,
@@ -582,10 +582,10 @@ function createFooter(pageMargins, pageSize, sectionData, footerId, editor, curr
582582 }
583583
584584 const data = editor . converter . footers [ footerId ] ;
585- const editorSection = createHeaderFooterEditor ( {
586- editor,
587- data,
588- editorContainer,
585+ const editorSection = createHeaderFooterEditor ( {
586+ editor,
587+ data,
588+ editorContainer,
589589 appendToBody : false ,
590590 sectionId : footerId ,
591591 type : 'footer' ,
@@ -631,7 +631,7 @@ const onHeaderFooterDblClick = (editor, currentFocusedSectionEditor) => {
631631
632632/**
633633 * Combine header and footer into a page break element
634- * @param {Object } param0
634+ * @param {Object } param0
635635 * @param {Editor } param0.editor The editor instance
636636 * @param {HTMLElement } param0.header The header element
637637 * @param {HTMLElement } param0.footer The footer element
@@ -651,7 +651,7 @@ function createPageBreak({ editor, header, footer, footerBottom = null, isFirstH
651651 if ( isFirstHeader ) innerDiv . style . borderRadius = '8px 8px 0 0' ;
652652 else if ( isLastFooter ) innerDiv . style . borderRadius = '0 0 8px 8px' ;
653653 paginationDiv . appendChild ( innerDiv ) ;
654-
654+
655655 if ( footer ) {
656656 innerDiv . appendChild ( footer . section ) ;
657657 sectionHeight += footer . footerHeight ;
@@ -688,14 +688,14 @@ function createPageBreak({ editor, header, footer, footerBottom = null, isFirstH
688688 paginationDiv . style . position = 'absolute' ;
689689 paginationDiv . style . bottom = footerBottom + 'px' ;
690690 }
691-
691+
692692 return paginationDiv ;
693693}
694694
695695/**
696696 * Get the actual break coordinates for a page split based on the approximate position (pos)
697697 * and the calculated threshold (which accounts for 'scale')
698- *
698+ *
699699 * Since we know the node at pos extends past the threshold, we iterate
700700 * backwards through all positions from there to find the exact break point
701701 * @param {EditorView } view The current editor view
0 commit comments