@docx-editor.dev/core 0.0.1 → 2.0.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.
Files changed (116) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +92 -2
  3. package/THIRD_PARTY_NOTICES.md +18 -0
  4. package/dist/automation.cjs +1 -0
  5. package/dist/automation.d.cts +74 -0
  6. package/dist/automation.d.ts +74 -0
  7. package/dist/automation.js +1 -0
  8. package/dist/binding.cjs +1 -0
  9. package/dist/binding.d.cts +82 -0
  10. package/dist/binding.d.ts +82 -0
  11. package/dist/binding.js +1 -0
  12. package/dist/chunk-5KSCB2OZ.js +2 -0
  13. package/dist/chunk-BSC44TIT.js +5 -0
  14. package/dist/chunk-DLPL5DAG.js +12 -0
  15. package/dist/chunk-DOEIARE2.js +2 -0
  16. package/dist/chunk-G7YCQBZE.cjs +5 -0
  17. package/dist/chunk-HBL3NNH5.cjs +1 -0
  18. package/dist/chunk-HR7K3W6A.js +1 -0
  19. package/dist/chunk-HVAV2JSN.js +11 -0
  20. package/dist/chunk-MYH2HCUJ.cjs +2 -0
  21. package/dist/chunk-NSM75TN6.cjs +1 -0
  22. package/dist/chunk-PHDVKUWZ.js +1 -0
  23. package/dist/chunk-QADYGK5L.cjs +12 -0
  24. package/dist/chunk-REZUWYB7.js +1 -0
  25. package/dist/chunk-RNBHTPW7.js +10 -0
  26. package/dist/chunk-UD2ZXLFI.cjs +2 -0
  27. package/dist/chunk-VYAVK2AH.cjs +1 -0
  28. package/dist/chunk-YUK46A2N.cjs +11 -0
  29. package/dist/chunk-ZMIX42J7.cjs +10 -0
  30. package/dist/chunk-ZT55Q52J.cjs +2 -0
  31. package/dist/chunk-ZUALAR4M.js +2 -0
  32. package/dist/content-control-walk-CbTqHq6O.d.cts +56 -0
  33. package/dist/content-control-walk-D06GijR0.d.ts +56 -0
  34. package/dist/contracts/document.cjs +1 -0
  35. package/dist/contracts/document.d.cts +246 -0
  36. package/dist/contracts/document.d.ts +246 -0
  37. package/dist/contracts/document.js +0 -0
  38. package/dist/contracts/editor.cjs +1 -0
  39. package/dist/contracts/editor.d.cts +11 -0
  40. package/dist/contracts/editor.d.ts +11 -0
  41. package/dist/contracts/editor.js +1 -0
  42. package/dist/contracts/interaction.cjs +1 -0
  43. package/dist/contracts/interaction.d.cts +11 -0
  44. package/dist/contracts/interaction.d.ts +11 -0
  45. package/dist/contracts/interaction.js +0 -0
  46. package/dist/contracts/modules.cjs +1 -0
  47. package/dist/contracts/modules.d.cts +90 -0
  48. package/dist/contracts/modules.d.ts +90 -0
  49. package/dist/contracts/modules.js +1 -0
  50. package/dist/contracts/types.cjs +1 -0
  51. package/dist/contracts/types.d.cts +452 -0
  52. package/dist/contracts/types.d.ts +452 -0
  53. package/dist/contracts/types.js +0 -0
  54. package/dist/editor-C1QRi1v4.d.ts +1671 -0
  55. package/dist/editor-D0UDock4.d.cts +1671 -0
  56. package/dist/editor.cjs +1 -0
  57. package/dist/editor.css +6017 -0
  58. package/dist/editor.d.cts +271 -0
  59. package/dist/editor.d.ts +271 -0
  60. package/dist/editor.js +1 -0
  61. package/dist/hf-references-BdjsQNE_.d.ts +71 -0
  62. package/dist/hf-references-CgEOSw3i.d.cts +71 -0
  63. package/dist/image-resources-BJnTpG66.d.ts +195 -0
  64. package/dist/image-resources-BpIydXtU.d.cts +195 -0
  65. package/dist/index-CrW-IxXt.d.cts +2515 -0
  66. package/dist/index-ZqBEOrTV.d.ts +2515 -0
  67. package/dist/index.cjs +1 -0
  68. package/dist/index.d.cts +22 -0
  69. package/dist/index.d.ts +22 -0
  70. package/dist/index.js +1 -0
  71. package/dist/layout.cjs +1 -0
  72. package/dist/layout.d.cts +2316 -0
  73. package/dist/layout.d.ts +2316 -0
  74. package/dist/layout.js +1 -0
  75. package/dist/note-nodes-BPSTVDMr.d.ts +108 -0
  76. package/dist/note-nodes-C6DLxlvj.d.cts +108 -0
  77. package/dist/note-properties-CnmCoory.d.cts +68 -0
  78. package/dist/note-properties-m75hmP70.d.ts +68 -0
  79. package/dist/ooxml-package-CR5us6ad.d.cts +354 -0
  80. package/dist/ooxml-package-D_CtywTW.d.ts +354 -0
  81. package/dist/ooxml-tree-BU0e3DVi.d.cts +871 -0
  82. package/dist/ooxml-tree-BU0e3DVi.d.ts +871 -0
  83. package/dist/output.cjs +1 -0
  84. package/dist/output.d.cts +158 -0
  85. package/dist/output.d.ts +158 -0
  86. package/dist/output.js +1 -0
  87. package/dist/protocol-CAkOBBGE.d.cts +1201 -0
  88. package/dist/protocol-oxHaWmt4.d.ts +1201 -0
  89. package/dist/review-support-DS8DYX2a.d.cts +326 -0
  90. package/dist/review-support-Fy3vdIea.d.ts +326 -0
  91. package/dist/revision-projection-72ZApe-g.d.cts +84 -0
  92. package/dist/revision-projection-DHAkcD_L.d.ts +84 -0
  93. package/dist/semantic-cell-selection-CZjBSmMv.d.cts +427 -0
  94. package/dist/semantic-cell-selection-DsmHmLJ5.d.ts +427 -0
  95. package/dist/semantic-interaction-D-Dszxrn.d.cts +187 -0
  96. package/dist/semantic-interaction-Dy-dCUFF.d.ts +187 -0
  97. package/dist/semantic-paint-drawings-BA3z9jl8.d.ts +21 -0
  98. package/dist/semantic-paint-drawings-D7qbB0E2.d.cts +21 -0
  99. package/dist/semantic-records-CJR3BvHs.d.cts +1432 -0
  100. package/dist/semantic-records-CWodBJsz.d.ts +1432 -0
  101. package/dist/shaped-measurer-B-TAtcQU.d.ts +613 -0
  102. package/dist/shaped-measurer-CNIT_svZ.d.cts +613 -0
  103. package/dist/store.cjs +1 -0
  104. package/dist/store.d.cts +2247 -0
  105. package/dist/store.d.ts +2247 -0
  106. package/dist/store.js +1 -0
  107. package/dist/tree-op-types-CwOeiaQ8.d.ts +1431 -0
  108. package/dist/tree-op-types-DMiW6nIH.d.cts +1431 -0
  109. package/dist/tree-package-store-D5S7VKs5.d.ts +708 -0
  110. package/dist/tree-package-store-DOKMtCnh.d.cts +708 -0
  111. package/dist/tree-session-CiUel5Kz.d.ts +542 -0
  112. package/dist/tree-session-D47_imvR.d.cts +542 -0
  113. package/dist/tree-store-CxifqwIv.d.cts +273 -0
  114. package/dist/tree-store-hLtjeyWE.d.ts +273 -0
  115. package/package.json +105 -8
  116. package/index.js +0 -1
package/dist/layout.js ADDED
@@ -0,0 +1 @@
1
+ export{Gb as AUTO_PREFERRED_WIDTH,Ib as CELL_PAD,$ as COMPOUND_BORDER_MIN_GAP_PT,_ as COMPOUND_BORDER_MIN_STROKE_PT,fd as DEFAULT_CANVAS_FONT_STACK,Kb as DEFAULT_CELL_MARGINS,Q as DEFAULT_PAGE_GEOMETRY,Ya as DEFAULT_REVISION_DISPLAY_MODE,bb as DEFAULT_RUN_STYLE,xc as DEFAULT_SECTION_PROPERTIES,Ba as DEFAULT_TAB_INTERVAL_PT,Aa as DEFAULT_TAB_INTERVAL_TWIPS,_b as DEFAULT_VERTICAL_WEIGHT,Rb as EMPTY_NUMBERING_INDEX,Da as EMPTY_TAB_STOPS,p as GRAPHEME_SEGMENTER_LOCALE,g as HARFBUZZ_SHAPING_LIBRARY,j as HarfBuzzShapingError,ea as MAX_BORDER_SPACE_PT,da as MAX_BORDER_WIDTH_PT,wc as MAX_DOCUMENT_SECTIONS,Wc as MAX_EACH_PAGE_MARK_CANDIDATES,Ob as MAX_LVL_OVERRIDES,Ma as MAX_LVL_TEXT_LENGTH,La as MAX_MARKER_TEXT_LENGTH,Ic as MAX_NOTES_LAID_OUT,Jc as MAX_NOTE_FRAGMENTS,Vc as MAX_NOTE_OVERFLOW_PAGES,Uc as MAX_NOTE_REFLOW_ATTEMPTS,Nb as MAX_NUMBERING_DEFINITIONS,ca as MAX_PARAGRAPH_SPACING_PT,nb as MAX_STYLE_BASED_ON_DEPTH,ob as MAX_STYLE_DEFINITIONS,yb as MAX_TABLE_BORDER_STROKES,Hb as MAX_TABLE_NESTING,oc as MAX_TABLE_ROW_FRAGMENTS,Jb as MAX_TABLE_ROW_HEIGHT_PT,za as MAX_TAB_POSITION_TWIPS,ya as MAX_TAB_STOPS,ga as PARAGRAPH_BORDER_SIDES,P as ResolvedCache,fa as SINGLE_LINE_SPACING,Ca as TAB_LEADER_GLYPH,pc as TablePaginationError,n as UnsupportedScriptError,E as WORD_SEGMENTER_LOCALE,sa as appliedSpaceBefore,ja as applyLineSpacing,$c as attachNotesToLayout,gb as baselineShiftPtOf,Fb as borderExtentPt,Cb as borderWeight,pa as bottomBorderExtentPt,H as boundedFallbackWordSegments,Pb as buildNumberingIndex,Yc as buildPageRefIndex,qb as buildStyleCascadeTable,N as captureOperationSnapshot,pd as caretAt,hc as caretBoxOnLine,nd as caretStops,od as caretStopsForBlocks,rb as cascadeParagraphFormatting,tb as cascadeRunProperties,sb as cascadedBottomBorder,ma as cascadedParagraphBorders,Ea as cascadedTabStops,Bd as cellSelectionBetween,Ed as cellSelectionRects,Fd as cellSelectionText,Na as clampListValue,ra as collapsedSpaceBefore,zd as compositionAnchor,aa as computeDoubleBorderMetricsPt,_c as computeFootnoteReserves,ec as contentControlAtPoint,rd as contentControlAtSemantic,jd as contentControlBoundaries,sd as contentControlsInLayout,X as contentControlsOfLayout,I as createBoundedFallbackWordBoundary,J as createDefaultWordBoundary,dd as createFixedMeasurer,m as createHarfBuzzTextShaper,G as createIntlWordBoundary,md as createLayoutScheduler,cd as createLayoutSession,Sb as createListCounterState,jb as createParagraphLayoutCache,kd as createShapedMeasurer,e as createShapedRun,b as createShapingEnvironment,Pc as defaultNoteSeparatorRuleStyle,Ha as defaultTabIntervalFromSettings,Fc as deriveNoteDisplayMarks,Gc as deriveNoteDisplayMarksResolved,db as displayText,vd as documentOrder,xb as effectiveBorderSide,Z as effectiveContentControlLock,uc as emptyTocPlaceholderParagraphIds,vc as emptyTocSuppressedResultParagraphIds,Cc as enumerateDocumentSections,Dc as enumerateDocumentSectionsBounded,Va as expandLvlText,Zc as filterRefsOnPage,ic as findDrawingOverlayFrameInLayout,Mc as findSeparatorNote,a as fixedPoint,Oa as formatDecimal,Pa as formatDecimalZero,Ta as formatLowerLetter,Ra as formatLowerRoman,Ua as formatNumFmt,hb as formatPageNumber,$a as formatRevisionOf,Sa as formatUpperLetter,Qa as formatUpperRoman,Xc as fragmentOwnsAtomOffset,V as fragmentsOfParagraph,Ec as geometryOfSection,s as graphemeBoundaryEpoch,w as graphemeCount,y as graphemeOffsetToUtf16,O as guardOperationSnapshot,k as harfBuzzFontValidator,bc as hitTestPage,qd as hitTestSemantic,dc as hitTestSheet,h as initializeHarfBuzz,r as intlGraphemeBoundary,gd as isCanvasMeasurementAvailable,C as isCumulativeGeometryTrustedFromLineOrigin,ac as isFurniturePoint,B as isGeometryTrustedCaretOffset,i as isHarfBuzzInitialized,q as isIntlSegmenterAvailable,F as isIntlWordSegmenterAvailable,Qc as isMarkerOnlySeparatorNote,pb as isValidStyleId,A as isWholeGraphemeHorizontalBoundary,o as itemizeScriptFontSlots,ud as keyedRangeRects,bd as layoutHeaderFooterStory,Oc as layoutNoteById,Rc as layoutNoteSeparator,Nc as layoutNoteStory,ed as layoutSemanticDocument,W as lineAtPosition,fc as lineEndOffset,T as linesOf,Zb as listMarkerBox,eb as measureDisplayText,Vb as mergeListIndent,yd as moveCaret,Ia as nextTabDestination,Lc as normalNotesOf,Hc as noteDisplayMarkMap,Kc as noteLineIdPrefix,Wa as noteMarkKey,Tc as noteSeparatorAreaBox,rc as noteStoryBlocks,$b as pageAtY,ld as pagesToMaterialize,oa as paragraphBorderExtentPt,na as paragraphBorderStrokeWidthPt,la as paragraphBorders,qa as paragraphBordersFingerprint,ba as paragraphBreaksBefore,ka as paragraphContextualSpacing,R as paragraphFragmentsOf,S as paragraphFragmentsOfBlocks,ib as paragraphLayoutKey,ia as paragraphLineSpacing,vb as paragraphMarkDeleted,_a as paragraphMarkRevisionOf,Ac as paragraphSectionNode,wa as paragraphShading,xa as paragraphShadingBox,ha as paragraphSpacing,Fa as paragraphTabStops,wd as paragraphTextFromLayout,Cd as paragraphsInCells,yc as parsePageNumbering,zc as parseSectionProperties,Xa as projectedNoteMarkText,ad as provisionalNoteMarks,zb as readBorderSide,Bb as readCellBorders,Tb as readNumPr,Bc as readSectionProperties,Ab as readTableBorders,Mb as readTableStructure,v as resetGraphemeBoundary,Db as resolveBorderConflict,id as resolveDefaultSurfaceMeasurer,K as resolveDefaultWordBoundary,Qb as resolveNumberingLevel,ua as resolveOoxmlShadingFill,ub as resolveParagraphLayoutInputs,cb as resolveRunStyle,Xb as resolveStoryListItems,ta as resolveStrictHexFill,Eb as resolveTableCellBorderGrid,wb as revisionRemovesParagraph,ab as revisionsAreDeletion,Za as revisionsVisible,l as roundFontUnitToFixedPoint,fb as runStylesEqual,t as segmentGraphemes,L as segmentWords,td as selectionRects,D as semanticHorizontalBoundaries,u as setGraphemeBoundary,va as shadingFillFromElement,z as shapedHorizontalBoundaries,f as shapedRunComparatorInputs,d as shapingEnvironmentFingerprint,c as shapingEnvironmentFingerprintInputs,gc as spanOffsetX,Dd as spansInCells,Ad as spansInSelection,qc as storyBlocks,Sc as syntheticSeparatorBox,Ja as tabAdvanceWidth,Ka as tabStopsFingerprint,Gd as tableContextAt,Lb as tableOriginX,tc as tocFieldChromeParagraphIds,hd as tryCreateCanvasMeasurer,Y as unionLayoutBoxes,x as utf16OffsetToGrapheme,Wb as walkStoryParagraphs,Ga as withDefaultTabInterval,Ub as withNumberingStyleLinks,Yb as withResolvedListItems,xd as wordBoundary,M as wordSegmentsToGraphemeRecords}from'./chunk-HVAV2JSN.js';export{a as W15_NAMESPACE_URI,j as activeReviewItem,c as commentBodyText,d as commentInitials,g as firstReviewRange,e as paragraphOrderOfPart,l as reviewAnchorIndex,m as reviewItemGeometry,b as reviewItemKey,h as reviewItemPositionRank,f as reviewItemRanges,i as reviewItemsAt,k as reviewThreadRootOf}from'./chunk-ZUALAR4M.js';import'./chunk-DOEIARE2.js';export{d as FontResolutionError,c as HARD_MAX_AGGREGATE_FONT_BYTES,a as HARD_MAX_FONT_BYTES,b as HARD_MAX_FONT_SOURCES,Hb as MAX_SDT_NESTING,Le as MAX_TABLE_COLUMNS,j as boundedStructuralFontValidator,Mb as collectFlowBlocks,Lb as contentControlContentChildren,k as createFontResourceSnapshot,e as fontRequestKey,Ib as isContentControl,Jb as isContentControlContent,i as sha256FontBytes}from'./chunk-RNBHTPW7.js';
@@ -0,0 +1,108 @@
1
+ import { O as OoxmlNode, f as OoxmlParagraphNode, g as OoxmlNoteNode, h as OoxmlContinuationSeparatorNode, i as OoxmlEndnotesNode, j as OoxmlFootnotesNode, k as OoxmlNoteRefNode, l as OoxmlNoteReferenceNode, m as OoxmlSeparatorNode } from './ooxml-tree-BU0e3DVi.js';
2
+
3
+ /** UTF-16 placeholder for one atomic note unit in `paragraphTextOf` / segments. */
4
+ declare const NOTE_ATOM_CHAR = "\uFFFC";
5
+ /** Signed 32-bit Word-compatible note id range (positive allocation only). */
6
+ declare const NOTE_ID_MIN = 1;
7
+ /** Largest note id Word accepts — signed 32-bit. */
8
+ declare const NOTE_ID_MAX = 2147483647;
9
+ /** Reserved separator / continuation ids — never allocated for normal notes. */
10
+ declare const NOTE_SEPARATOR_ID = -1;
11
+ /** Reserved id of the continuation-separator entry. Never allocated to a real note. */
12
+ declare const NOTE_CONTINUATION_SEPARATOR_ID = 0;
13
+ /** Which notes part a note lives in. Decides both placement and numbering rules. */
14
+ type NoteKind = 'footnote' | 'endnote';
15
+ /** Authored `ST_FtnEdn` including explicit `normal`. Absent means Word default (normal). */
16
+ /**
17
+ * What a note entry IS.
18
+ *
19
+ * Only `normal` is a note a reader sees. The others are the furniture Word stores in the same
20
+ * part — the rules and notices drawn around the note area — reached by reserved ids.
21
+ */
22
+ type NoteType = 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice';
23
+ /** Parse a signed decimal note id; reject non-integers and out-of-int32 values. */
24
+ declare function parseNoteId(raw: string | undefined): number | null;
25
+ /**
26
+ * Canonical `EditorScope { kind: 'note'; id }` encoding.
27
+ *
28
+ * Footnote id `1` and endnote id `1` coexist, so the kind is part of the string:
29
+ * `footnote:2` / `endnote:-1`. Do not invent a parallel scope union arm.
30
+ */
31
+ declare function formatNoteScopeId(noteKind: NoteKind, noteId: number): string;
32
+ /**
33
+ * Parse {@link formatNoteScopeId}. Returns `null` for malformed / out-of-range ids.
34
+ */
35
+ declare function parseNoteScopeId(id: string): {
36
+ readonly noteKind: NoteKind;
37
+ readonly noteId: number;
38
+ } | null;
39
+ /** Whether a node is a `w:footnotes` part root. */
40
+ declare function isFootnotesNode(node: OoxmlNode): node is OoxmlFootnotesNode;
41
+ /** Whether a node is a `w:endnotes` part root. */
42
+ declare function isEndnotesNode(node: OoxmlNode): node is OoxmlEndnotesNode;
43
+ /** Whether a node is a `w:footnote` or `w:endnote` body. */
44
+ declare function isNoteNode(node: OoxmlNode): node is OoxmlNoteNode;
45
+ /** Whether a node is a body-side `w:footnoteReference` / `w:endnoteReference`. */
46
+ declare function isNoteReferenceNode(node: OoxmlNode): node is OoxmlNoteReferenceNode;
47
+ /** Whether a node is the `w:footnoteRef` / `w:endnoteRef` mark inside a note's own body. */
48
+ declare function isNoteRefNode(node: OoxmlNode): node is OoxmlNoteRefNode;
49
+ /** Whether a node is the `w:separator` rule drawn above the note area. */
50
+ declare function isSeparatorNode(node: OoxmlNode): node is OoxmlSeparatorNode;
51
+ /** Whether a node is the `w:continuationSeparator` rule used on continuation pages. */
52
+ declare function isContinuationSeparatorNode(node: OoxmlNode): node is OoxmlContinuationSeparatorNode;
53
+ /** Typed or generic `w:footnote` / `w:endnote`. */
54
+ declare function noteKindOf(node: OoxmlNode): NoteKind | null;
55
+ /** Authored `@w:id` on a note or noteReference when parseable. */
56
+ declare function noteIdOf(node: OoxmlNode): number | null;
57
+ /** Authored `@w:type` (`ST_FtnEdn`) when present and schema-legal; else `undefined`. */
58
+ declare function noteTypeOf(node: OoxmlNode): NoteType | undefined;
59
+ /** Whether a note is a normal (body) note — absent type and explicit `normal` both count. */
60
+ declare function isNormalNote(node: OoxmlNode): boolean;
61
+ /** Typed or generic footnote/endnote reference kind. */
62
+ declare function noteReferenceKindOf(node: OoxmlNode): NoteKind | null;
63
+ /** Typed or generic `w:footnoteRef` / `w:endnoteRef`. */
64
+ declare function noteRefKindOf(node: OoxmlNode): NoteKind | null;
65
+ /**
66
+ * Read `@w:customMarkFollows` on a note reference.
67
+ * Returns `undefined` when absent; otherwise the OOXML on/off interpretation.
68
+ */
69
+ declare function customMarkFollows(node: OoxmlNode): boolean | undefined;
70
+ /** Model text contributed by one atomic note unit. */
71
+ declare function noteAtomText(): typeof NOTE_ATOM_CHAR;
72
+ /**
73
+ * True when a run-inner node is a typed note atom that contributes one UTF-16 unit.
74
+ * Demoted/malformed known locals stay generic and contribute nothing.
75
+ */
76
+ declare function isNoteAtomNode(node: OoxmlNode): boolean;
77
+ /**
78
+ * One atomic note span inside a paragraph for caret / delete / selection.
79
+ *
80
+ * Each typed note atom is a single-node span (`removeNodeIds` = that node).
81
+ */
82
+ interface AtomicNoteSpan {
83
+ readonly kind: 'noteReference' | 'noteRef' | 'separator' | 'continuationSeparator';
84
+ readonly node: OoxmlNode;
85
+ readonly runId: string;
86
+ readonly removeNodeIds: readonly string[];
87
+ }
88
+ /**
89
+ * Collect typed note atoms in document order (one segment each).
90
+ *
91
+ * Walks the same paragraph-inline surface as `segmentsOf` / `walkParagraphInline`:
92
+ * hyperlinks and content controls flatten; only direct run children contribute atoms.
93
+ * A demoted run-inner SDT husk stays opaque — no phantom addressable hit.
94
+ */
95
+ declare function atomicNoteSpansOf(paragraph: OoxmlParagraphNode): readonly AtomicNoteSpan[];
96
+ /** Cap on notes scanned when allocating / indexing a notes part. */
97
+ declare const MAX_NOTES_PER_PART = 10000;
98
+ /**
99
+ * Allocate the next positive signed 32-bit note id for a notes-part root.
100
+ * Seeds from `max(existing)+1`; never returns ≤0; `null` on exhaustion.
101
+ */
102
+ declare function allocateNoteId(notesRoot: OoxmlNode): number | null;
103
+ /** Collect note bodies from a footnotes/endnotes root, bounded. */
104
+ declare function notesOf(root: OoxmlNode): readonly OoxmlNoteNode[];
105
+ /** Find a typed note by id inside a notes-part root. */
106
+ declare function findNoteById(root: OoxmlNode, noteId: number): OoxmlNoteNode | undefined;
107
+
108
+ export { type AtomicNoteSpan as A, notesOf as B, parseNoteId as C, parseNoteScopeId as D, MAX_NOTES_PER_PART as M, type NoteKind as N, NOTE_ATOM_CHAR as a, NOTE_CONTINUATION_SEPARATOR_ID as b, NOTE_ID_MAX as c, NOTE_ID_MIN as d, NOTE_SEPARATOR_ID as e, type NoteType as f, allocateNoteId as g, atomicNoteSpansOf as h, customMarkFollows as i, findNoteById as j, formatNoteScopeId as k, isContinuationSeparatorNode as l, isEndnotesNode as m, noteTypeOf as n, isFootnotesNode as o, isNormalNote as p, isNoteAtomNode as q, isNoteNode as r, isNoteRefNode as s, isNoteReferenceNode as t, isSeparatorNode as u, noteAtomText as v, noteIdOf as w, noteKindOf as x, noteRefKindOf as y, noteReferenceKindOf as z };
@@ -0,0 +1,108 @@
1
+ import { O as OoxmlNode, f as OoxmlParagraphNode, g as OoxmlNoteNode, h as OoxmlContinuationSeparatorNode, i as OoxmlEndnotesNode, j as OoxmlFootnotesNode, k as OoxmlNoteRefNode, l as OoxmlNoteReferenceNode, m as OoxmlSeparatorNode } from './ooxml-tree-BU0e3DVi.cjs';
2
+
3
+ /** UTF-16 placeholder for one atomic note unit in `paragraphTextOf` / segments. */
4
+ declare const NOTE_ATOM_CHAR = "\uFFFC";
5
+ /** Signed 32-bit Word-compatible note id range (positive allocation only). */
6
+ declare const NOTE_ID_MIN = 1;
7
+ /** Largest note id Word accepts — signed 32-bit. */
8
+ declare const NOTE_ID_MAX = 2147483647;
9
+ /** Reserved separator / continuation ids — never allocated for normal notes. */
10
+ declare const NOTE_SEPARATOR_ID = -1;
11
+ /** Reserved id of the continuation-separator entry. Never allocated to a real note. */
12
+ declare const NOTE_CONTINUATION_SEPARATOR_ID = 0;
13
+ /** Which notes part a note lives in. Decides both placement and numbering rules. */
14
+ type NoteKind = 'footnote' | 'endnote';
15
+ /** Authored `ST_FtnEdn` including explicit `normal`. Absent means Word default (normal). */
16
+ /**
17
+ * What a note entry IS.
18
+ *
19
+ * Only `normal` is a note a reader sees. The others are the furniture Word stores in the same
20
+ * part — the rules and notices drawn around the note area — reached by reserved ids.
21
+ */
22
+ type NoteType = 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice';
23
+ /** Parse a signed decimal note id; reject non-integers and out-of-int32 values. */
24
+ declare function parseNoteId(raw: string | undefined): number | null;
25
+ /**
26
+ * Canonical `EditorScope { kind: 'note'; id }` encoding.
27
+ *
28
+ * Footnote id `1` and endnote id `1` coexist, so the kind is part of the string:
29
+ * `footnote:2` / `endnote:-1`. Do not invent a parallel scope union arm.
30
+ */
31
+ declare function formatNoteScopeId(noteKind: NoteKind, noteId: number): string;
32
+ /**
33
+ * Parse {@link formatNoteScopeId}. Returns `null` for malformed / out-of-range ids.
34
+ */
35
+ declare function parseNoteScopeId(id: string): {
36
+ readonly noteKind: NoteKind;
37
+ readonly noteId: number;
38
+ } | null;
39
+ /** Whether a node is a `w:footnotes` part root. */
40
+ declare function isFootnotesNode(node: OoxmlNode): node is OoxmlFootnotesNode;
41
+ /** Whether a node is a `w:endnotes` part root. */
42
+ declare function isEndnotesNode(node: OoxmlNode): node is OoxmlEndnotesNode;
43
+ /** Whether a node is a `w:footnote` or `w:endnote` body. */
44
+ declare function isNoteNode(node: OoxmlNode): node is OoxmlNoteNode;
45
+ /** Whether a node is a body-side `w:footnoteReference` / `w:endnoteReference`. */
46
+ declare function isNoteReferenceNode(node: OoxmlNode): node is OoxmlNoteReferenceNode;
47
+ /** Whether a node is the `w:footnoteRef` / `w:endnoteRef` mark inside a note's own body. */
48
+ declare function isNoteRefNode(node: OoxmlNode): node is OoxmlNoteRefNode;
49
+ /** Whether a node is the `w:separator` rule drawn above the note area. */
50
+ declare function isSeparatorNode(node: OoxmlNode): node is OoxmlSeparatorNode;
51
+ /** Whether a node is the `w:continuationSeparator` rule used on continuation pages. */
52
+ declare function isContinuationSeparatorNode(node: OoxmlNode): node is OoxmlContinuationSeparatorNode;
53
+ /** Typed or generic `w:footnote` / `w:endnote`. */
54
+ declare function noteKindOf(node: OoxmlNode): NoteKind | null;
55
+ /** Authored `@w:id` on a note or noteReference when parseable. */
56
+ declare function noteIdOf(node: OoxmlNode): number | null;
57
+ /** Authored `@w:type` (`ST_FtnEdn`) when present and schema-legal; else `undefined`. */
58
+ declare function noteTypeOf(node: OoxmlNode): NoteType | undefined;
59
+ /** Whether a note is a normal (body) note — absent type and explicit `normal` both count. */
60
+ declare function isNormalNote(node: OoxmlNode): boolean;
61
+ /** Typed or generic footnote/endnote reference kind. */
62
+ declare function noteReferenceKindOf(node: OoxmlNode): NoteKind | null;
63
+ /** Typed or generic `w:footnoteRef` / `w:endnoteRef`. */
64
+ declare function noteRefKindOf(node: OoxmlNode): NoteKind | null;
65
+ /**
66
+ * Read `@w:customMarkFollows` on a note reference.
67
+ * Returns `undefined` when absent; otherwise the OOXML on/off interpretation.
68
+ */
69
+ declare function customMarkFollows(node: OoxmlNode): boolean | undefined;
70
+ /** Model text contributed by one atomic note unit. */
71
+ declare function noteAtomText(): typeof NOTE_ATOM_CHAR;
72
+ /**
73
+ * True when a run-inner node is a typed note atom that contributes one UTF-16 unit.
74
+ * Demoted/malformed known locals stay generic and contribute nothing.
75
+ */
76
+ declare function isNoteAtomNode(node: OoxmlNode): boolean;
77
+ /**
78
+ * One atomic note span inside a paragraph for caret / delete / selection.
79
+ *
80
+ * Each typed note atom is a single-node span (`removeNodeIds` = that node).
81
+ */
82
+ interface AtomicNoteSpan {
83
+ readonly kind: 'noteReference' | 'noteRef' | 'separator' | 'continuationSeparator';
84
+ readonly node: OoxmlNode;
85
+ readonly runId: string;
86
+ readonly removeNodeIds: readonly string[];
87
+ }
88
+ /**
89
+ * Collect typed note atoms in document order (one segment each).
90
+ *
91
+ * Walks the same paragraph-inline surface as `segmentsOf` / `walkParagraphInline`:
92
+ * hyperlinks and content controls flatten; only direct run children contribute atoms.
93
+ * A demoted run-inner SDT husk stays opaque — no phantom addressable hit.
94
+ */
95
+ declare function atomicNoteSpansOf(paragraph: OoxmlParagraphNode): readonly AtomicNoteSpan[];
96
+ /** Cap on notes scanned when allocating / indexing a notes part. */
97
+ declare const MAX_NOTES_PER_PART = 10000;
98
+ /**
99
+ * Allocate the next positive signed 32-bit note id for a notes-part root.
100
+ * Seeds from `max(existing)+1`; never returns ≤0; `null` on exhaustion.
101
+ */
102
+ declare function allocateNoteId(notesRoot: OoxmlNode): number | null;
103
+ /** Collect note bodies from a footnotes/endnotes root, bounded. */
104
+ declare function notesOf(root: OoxmlNode): readonly OoxmlNoteNode[];
105
+ /** Find a typed note by id inside a notes-part root. */
106
+ declare function findNoteById(root: OoxmlNode, noteId: number): OoxmlNoteNode | undefined;
107
+
108
+ export { type AtomicNoteSpan as A, notesOf as B, parseNoteId as C, parseNoteScopeId as D, MAX_NOTES_PER_PART as M, type NoteKind as N, NOTE_ATOM_CHAR as a, NOTE_CONTINUATION_SEPARATOR_ID as b, NOTE_ID_MAX as c, NOTE_ID_MIN as d, NOTE_SEPARATOR_ID as e, type NoteType as f, allocateNoteId as g, atomicNoteSpansOf as h, customMarkFollows as i, findNoteById as j, formatNoteScopeId as k, isContinuationSeparatorNode as l, isEndnotesNode as m, noteTypeOf as n, isFootnotesNode as o, isNormalNote as p, isNoteAtomNode as q, isNoteNode as r, isNoteRefNode as s, isNoteReferenceNode as t, isSeparatorNode as u, noteAtomText as v, noteIdOf as w, noteKindOf as x, noteRefKindOf as y, noteReferenceKindOf as z };
@@ -0,0 +1,68 @@
1
+ import { e as OoxmlPart, O as OoxmlNode } from './ooxml-tree-BU0e3DVi.cjs';
2
+ import { O as OoxmlPackage } from './ooxml-package-CR5us6ad.cjs';
3
+
4
+ /** `w:pos` — where a section's footnotes are laid out. */
5
+ type FootnotePosition = 'pageBottom' | 'beneathText' | 'sectEnd' | 'docEnd';
6
+ /** `w:pos` for endnotes — only the two document-level placements are legal. */
7
+ type EndnotePosition = 'sectEnd' | 'docEnd';
8
+ /** `w:numRestart` — when note numbering starts over. `eachPage` needs the reference's page. */
9
+ type NoteNumRestart = 'continuous' | 'eachSect' | 'eachPage';
10
+ /** Authored subset — only keys present in the file appear. */
11
+ interface AuthoredNoteProperties {
12
+ readonly pos?: string;
13
+ readonly numFmt?: string;
14
+ readonly numStart?: number;
15
+ readonly numRestart?: string;
16
+ }
17
+ /** Fully resolved footnote properties (defaults filled). */
18
+ interface ResolvedFootnoteProperties {
19
+ readonly pos: FootnotePosition;
20
+ readonly numFmt: string;
21
+ readonly numStart: number;
22
+ readonly numRestart: NoteNumRestart;
23
+ }
24
+ /** Fully resolved endnote properties (defaults filled). */
25
+ interface ResolvedEndnoteProperties {
26
+ readonly pos: EndnotePosition;
27
+ readonly numFmt: string;
28
+ readonly numStart: number;
29
+ readonly numRestart: NoteNumRestart;
30
+ }
31
+ /** Word's own footnote defaults, applied where a section declares no `w:footnotePr`. */
32
+ declare const DEFAULT_FOOTNOTE_PROPERTIES: ResolvedFootnoteProperties;
33
+ /**
34
+ * Word-compatible defaults. ECMA-376 says omitted endnote `numFmt` is decimal;
35
+ * MS-OE376 / MS-OI29500 document that Word’s default is `lowerRoman` instead.
36
+ * Resolved (not authored) — unedited packages still invent nothing on save.
37
+ */
38
+ declare const DEFAULT_ENDNOTE_PROPERTIES: ResolvedEndnoteProperties;
39
+ /** Parse authored CT_FtnProps / CT_EdnProps without inventing defaults. */
40
+ declare function parseAuthoredNoteProperties(propsNode: OoxmlNode | null | undefined): AuthoredNoteProperties | undefined;
41
+ /** Authored footnotePr on a sectPr node. */
42
+ declare function authoredFootnotePropertiesFromSectPr(sectPr: OoxmlNode | null | undefined): AuthoredNoteProperties | undefined;
43
+ /** Authored endnotePr on a sectPr node. */
44
+ declare function authoredEndnotePropertiesFromSectPr(sectPr: OoxmlNode | null | undefined): AuthoredNoteProperties | undefined;
45
+ /** Locate settings.xml via the main document relationship when present. */
46
+ declare function settingsPartOf(pkg: OoxmlPackage): OoxmlPart | null;
47
+ /** Authored document-level footnotePr from settings. */
48
+ declare function authoredDocumentFootnoteProperties(settings: OoxmlPart | null | undefined): AuthoredNoteProperties | undefined;
49
+ /** Authored document-level endnotePr from settings. */
50
+ declare function authoredDocumentEndnoteProperties(settings: OoxmlPart | null | undefined): AuthoredNoteProperties | undefined;
51
+ /**
52
+ * Resolve footnote properties: section → document → defaults.
53
+ * Illegal position strings fall through to the next layer / default.
54
+ */
55
+ declare function resolveFootnoteProperties(section?: AuthoredNoteProperties, document?: AuthoredNoteProperties): ResolvedFootnoteProperties;
56
+ /**
57
+ * Resolve endnote properties: section → document → defaults.
58
+ * `pageBottom` is never a legal endnote position — falls back.
59
+ */
60
+ declare function resolveEndnoteProperties(section?: AuthoredNoteProperties, document?: AuthoredNoteProperties): ResolvedEndnoteProperties;
61
+ /** Validate an authored endnote position write — refuse `pageBottom`. */
62
+ declare function isLegalEndnotePosition(pos: string): pos is EndnotePosition;
63
+ /** Validate an authored footnote position write. */
64
+ declare function isLegalFootnotePosition(pos: string): pos is FootnotePosition;
65
+ /** Whether a file-supplied string is a legal `w:numRestart` value. Narrows the type. */
66
+ declare function isLegalNumRestart(value: string): value is NoteNumRestart;
67
+
68
+ export { type AuthoredNoteProperties as A, DEFAULT_ENDNOTE_PROPERTIES as D, type EndnotePosition as E, type FootnotePosition as F, type NoteNumRestart as N, type ResolvedFootnoteProperties as R, type ResolvedEndnoteProperties as a, DEFAULT_FOOTNOTE_PROPERTIES as b, authoredDocumentEndnoteProperties as c, authoredDocumentFootnoteProperties as d, authoredEndnotePropertiesFromSectPr as e, authoredFootnotePropertiesFromSectPr as f, isLegalFootnotePosition as g, isLegalNumRestart as h, isLegalEndnotePosition as i, resolveFootnoteProperties as j, parseAuthoredNoteProperties as p, resolveEndnoteProperties as r, settingsPartOf as s };
@@ -0,0 +1,68 @@
1
+ import { e as OoxmlPart, O as OoxmlNode } from './ooxml-tree-BU0e3DVi.js';
2
+ import { O as OoxmlPackage } from './ooxml-package-D_CtywTW.js';
3
+
4
+ /** `w:pos` — where a section's footnotes are laid out. */
5
+ type FootnotePosition = 'pageBottom' | 'beneathText' | 'sectEnd' | 'docEnd';
6
+ /** `w:pos` for endnotes — only the two document-level placements are legal. */
7
+ type EndnotePosition = 'sectEnd' | 'docEnd';
8
+ /** `w:numRestart` — when note numbering starts over. `eachPage` needs the reference's page. */
9
+ type NoteNumRestart = 'continuous' | 'eachSect' | 'eachPage';
10
+ /** Authored subset — only keys present in the file appear. */
11
+ interface AuthoredNoteProperties {
12
+ readonly pos?: string;
13
+ readonly numFmt?: string;
14
+ readonly numStart?: number;
15
+ readonly numRestart?: string;
16
+ }
17
+ /** Fully resolved footnote properties (defaults filled). */
18
+ interface ResolvedFootnoteProperties {
19
+ readonly pos: FootnotePosition;
20
+ readonly numFmt: string;
21
+ readonly numStart: number;
22
+ readonly numRestart: NoteNumRestart;
23
+ }
24
+ /** Fully resolved endnote properties (defaults filled). */
25
+ interface ResolvedEndnoteProperties {
26
+ readonly pos: EndnotePosition;
27
+ readonly numFmt: string;
28
+ readonly numStart: number;
29
+ readonly numRestart: NoteNumRestart;
30
+ }
31
+ /** Word's own footnote defaults, applied where a section declares no `w:footnotePr`. */
32
+ declare const DEFAULT_FOOTNOTE_PROPERTIES: ResolvedFootnoteProperties;
33
+ /**
34
+ * Word-compatible defaults. ECMA-376 says omitted endnote `numFmt` is decimal;
35
+ * MS-OE376 / MS-OI29500 document that Word’s default is `lowerRoman` instead.
36
+ * Resolved (not authored) — unedited packages still invent nothing on save.
37
+ */
38
+ declare const DEFAULT_ENDNOTE_PROPERTIES: ResolvedEndnoteProperties;
39
+ /** Parse authored CT_FtnProps / CT_EdnProps without inventing defaults. */
40
+ declare function parseAuthoredNoteProperties(propsNode: OoxmlNode | null | undefined): AuthoredNoteProperties | undefined;
41
+ /** Authored footnotePr on a sectPr node. */
42
+ declare function authoredFootnotePropertiesFromSectPr(sectPr: OoxmlNode | null | undefined): AuthoredNoteProperties | undefined;
43
+ /** Authored endnotePr on a sectPr node. */
44
+ declare function authoredEndnotePropertiesFromSectPr(sectPr: OoxmlNode | null | undefined): AuthoredNoteProperties | undefined;
45
+ /** Locate settings.xml via the main document relationship when present. */
46
+ declare function settingsPartOf(pkg: OoxmlPackage): OoxmlPart | null;
47
+ /** Authored document-level footnotePr from settings. */
48
+ declare function authoredDocumentFootnoteProperties(settings: OoxmlPart | null | undefined): AuthoredNoteProperties | undefined;
49
+ /** Authored document-level endnotePr from settings. */
50
+ declare function authoredDocumentEndnoteProperties(settings: OoxmlPart | null | undefined): AuthoredNoteProperties | undefined;
51
+ /**
52
+ * Resolve footnote properties: section → document → defaults.
53
+ * Illegal position strings fall through to the next layer / default.
54
+ */
55
+ declare function resolveFootnoteProperties(section?: AuthoredNoteProperties, document?: AuthoredNoteProperties): ResolvedFootnoteProperties;
56
+ /**
57
+ * Resolve endnote properties: section → document → defaults.
58
+ * `pageBottom` is never a legal endnote position — falls back.
59
+ */
60
+ declare function resolveEndnoteProperties(section?: AuthoredNoteProperties, document?: AuthoredNoteProperties): ResolvedEndnoteProperties;
61
+ /** Validate an authored endnote position write — refuse `pageBottom`. */
62
+ declare function isLegalEndnotePosition(pos: string): pos is EndnotePosition;
63
+ /** Validate an authored footnote position write. */
64
+ declare function isLegalFootnotePosition(pos: string): pos is FootnotePosition;
65
+ /** Whether a file-supplied string is a legal `w:numRestart` value. Narrows the type. */
66
+ declare function isLegalNumRestart(value: string): value is NoteNumRestart;
67
+
68
+ export { type AuthoredNoteProperties as A, DEFAULT_ENDNOTE_PROPERTIES as D, type EndnotePosition as E, type FootnotePosition as F, type NoteNumRestart as N, type ResolvedFootnoteProperties as R, type ResolvedEndnoteProperties as a, DEFAULT_FOOTNOTE_PROPERTIES as b, authoredDocumentEndnoteProperties as c, authoredDocumentFootnoteProperties as d, authoredEndnotePropertiesFromSectPr as e, authoredFootnotePropertiesFromSectPr as f, isLegalFootnotePosition as g, isLegalNumRestart as h, isLegalEndnotePosition as i, resolveFootnoteProperties as j, parseAuthoredNoteProperties as p, resolveEndnoteProperties as r, settingsPartOf as s };