@docx-editor.dev/core 2.1.2 → 2.2.0

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 (76) hide show
  1. package/README.md +4 -5
  2. package/dist/automation.cjs +1 -1
  3. package/dist/automation.js +1 -1
  4. package/dist/binding.cjs +1 -1
  5. package/dist/binding.js +1 -1
  6. package/dist/chunk-5OSFUHGF.js +10 -0
  7. package/dist/chunk-C24AINST.js +12 -0
  8. package/dist/{chunk-O2WQY7IT.cjs → chunk-CY47CFM5.cjs} +5 -5
  9. package/dist/chunk-EUTHPVTG.cjs +2 -0
  10. package/dist/chunk-FJCBZ5BL.cjs +12 -0
  11. package/dist/{chunk-REZUWYB7.js → chunk-GRGRIDHF.js} +1 -1
  12. package/dist/{chunk-PC76F2HR.cjs → chunk-KZ5HPHW6.cjs} +1 -1
  13. package/dist/{chunk-TBBXCC7D.js → chunk-LVZSKP2F.js} +3 -3
  14. package/dist/{chunk-HBL3NNH5.cjs → chunk-MIUELYVA.cjs} +1 -1
  15. package/dist/chunk-MO7GAUO7.js +2 -0
  16. package/dist/chunk-NCGKMEKU.js +2 -0
  17. package/dist/chunk-PFTVNFMI.js +1 -0
  18. package/dist/chunk-QVGTZUEV.js +12 -0
  19. package/dist/chunk-T2LVH6D3.cjs +2 -0
  20. package/dist/chunk-UAOJHPQ4.cjs +10 -0
  21. package/dist/chunk-VXEF32A5.cjs +12 -0
  22. package/dist/contracts/editor.cjs +1 -1
  23. package/dist/contracts/editor.d.cts +3 -3
  24. package/dist/contracts/editor.d.ts +3 -3
  25. package/dist/contracts/editor.js +1 -1
  26. package/dist/contracts/interaction.d.cts +4 -4
  27. package/dist/contracts/interaction.d.ts +4 -4
  28. package/dist/{editor-BGBZn9c9.d.cts → editor-25RmHnxu.d.cts} +64 -2
  29. package/dist/{editor-DQRRxKMG.d.ts → editor-C8oaTHr3.d.ts} +64 -2
  30. package/dist/editor.cjs +1 -1
  31. package/dist/editor.css +86 -11
  32. package/dist/editor.d.cts +51 -11
  33. package/dist/editor.d.ts +51 -11
  34. package/dist/editor.js +1 -1
  35. package/dist/{index-DptRpcqa.d.cts → index-CiEakUbq.d.cts} +32 -5
  36. package/dist/{index-BzqHsd4Y.d.ts → index-gvw4VGE9.d.ts} +32 -5
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.d.cts +6 -6
  39. package/dist/index.d.ts +6 -6
  40. package/dist/index.js +1 -1
  41. package/dist/layout.cjs +1 -1
  42. package/dist/layout.d.cts +95 -61
  43. package/dist/layout.d.ts +95 -61
  44. package/dist/layout.js +1 -1
  45. package/dist/output.cjs +1 -1
  46. package/dist/output.d.cts +4 -101
  47. package/dist/output.d.ts +4 -101
  48. package/dist/output.js +1 -1
  49. package/dist/{semantic-cell-selection-DwLB71fF.d.cts → semantic-cell-selection-CI3loBKq.d.cts} +2 -2
  50. package/dist/{semantic-cell-selection-D_8RbPII.d.ts → semantic-cell-selection-Cx8P64j2.d.ts} +2 -2
  51. package/dist/{semantic-interaction-DqcEonqD.d.cts → semantic-interaction-B4HrJFQ2.d.cts} +1 -1
  52. package/dist/{semantic-interaction-CXH2wFqi.d.ts → semantic-interaction-unGpRNCk.d.ts} +1 -1
  53. package/dist/semantic-paint-BBNaqr1s.d.ts +133 -0
  54. package/dist/semantic-paint-DdGGra4m.d.cts +133 -0
  55. package/dist/{semantic-records-zTC0_1zi.d.ts → semantic-records-BC4bIKKL.d.ts} +28 -32
  56. package/dist/{semantic-records-COVFW5aS.d.cts → semantic-records-DC6V1U3T.d.cts} +28 -32
  57. package/dist/{shaped-measurer-CZXL-a6v.d.ts → shaped-measurer-ChSWkuAT.d.ts} +1 -1
  58. package/dist/{shaped-measurer-AFnFxoot.d.cts → shaped-measurer-SIqZp-Ty.d.cts} +1 -1
  59. package/dist/store.cjs +1 -1
  60. package/dist/store.d.cts +35 -14
  61. package/dist/store.d.ts +35 -14
  62. package/dist/store.js +1 -1
  63. package/package.json +2 -2
  64. package/dist/chunk-2DTQDAN7.js +0 -2
  65. package/dist/chunk-3HEU7MHP.js +0 -12
  66. package/dist/chunk-3JKQE4QJ.cjs +0 -2
  67. package/dist/chunk-6WIIHJFY.js +0 -1
  68. package/dist/chunk-BZK64YU3.cjs +0 -10
  69. package/dist/chunk-EDLUMMQN.cjs +0 -12
  70. package/dist/chunk-JQFDLZXQ.cjs +0 -2
  71. package/dist/chunk-QRAUDDVY.js +0 -2
  72. package/dist/chunk-STCITBJK.js +0 -12
  73. package/dist/chunk-TSXT537P.cjs +0 -12
  74. package/dist/chunk-Y7TA7TPF.js +0 -10
  75. package/dist/semantic-paint-drawings-B5Wk2so5.d.ts +0 -21
  76. package/dist/semantic-paint-drawings-x8g44lD_.d.cts +0 -21
@@ -0,0 +1,133 @@
1
+ import { C as ContentControlBoundaryRecord, S as SemanticLayout } from './semantic-records-BC4bIKKL.js';
2
+ import { V as ValidatedImageBytesHandle, R as RenderableImageMime } from './image-resources-C_YnqPhn.js';
3
+
4
+ /** Host port for safe blob URLs — only called for {@link ImageResourceState.kind} `ready`. */
5
+ interface PaintImageUrlPort {
6
+ create(handle: ValidatedImageBytesHandle, mime: RenderableImageMime): string;
7
+ revoke(url: string): void;
8
+ }
9
+ /** Localized refusal labels; adapters supply i18n-backed implementations. */
10
+ interface DrawingPaintStrings {
11
+ readonly unsupportedFormat: (format: string) => string;
12
+ readonly nonPictureGraphic: (kind: string) => string;
13
+ readonly missingResource: string;
14
+ readonly externalResource: string;
15
+ readonly invalidResource: string;
16
+ readonly contentMismatch: string;
17
+ readonly decodeFailed: string;
18
+ readonly resourceLimit: string;
19
+ readonly pendingResource: string;
20
+ }
21
+
22
+ /**
23
+ * When a field's result is drawn on its grey block, following Word's own View option.
24
+ *
25
+ * `when-selected` is Word's default and the reason the option exists at all: a document dense
26
+ * with cross-references turns largely grey under `always`, and under `never` a reader cannot
27
+ * tell computed text from typed text at all.
28
+ */
29
+ type FieldShadingMode = 'never' | 'when-selected' | 'always';
30
+ /** Word's default: shaded only while the caret is inside the field. */
31
+ declare const DEFAULT_FIELD_SHADING: FieldShadingMode;
32
+ /**
33
+ * How a layout is painted into DOM. Every field is optional.
34
+ *
35
+ * The painted pages ARE the editable surface, so everything here is presentation-only — nothing
36
+ * set through these options is ever serialised back into the document.
37
+ */
38
+ interface PaintOptions {
39
+ /** Points to CSS pixels. 96/72 renders a point as a CSS point at 100% zoom. */
40
+ readonly scale?: number;
41
+ /** Generated paragraphs that paint as non-editable navigation surfaces. */
42
+ readonly readOnlyParagraphIds?: ReadonlySet<string>;
43
+ /**
44
+ * Empty-TOC begin paragraphs that paint subtle identifiable furniture. Paint-only — never
45
+ * serialised into the document.
46
+ */
47
+ readonly emptyTocPlaceholderIds?: ReadonlySet<string>;
48
+ /** Marks painted pages as presentational, so assistive tech reads the editable projection. */
49
+ readonly ariaHidden?: boolean;
50
+ /**
51
+ * Page indices to build in detail (task 9.4).
52
+ *
53
+ * Omitted means all of them. A page left out keeps its size and position but no content,
54
+ * so the document's height and page count are unchanged and scrolling to it reveals it
55
+ * instead of reflowing everything underneath.
56
+ */
57
+ readonly materialize?: ReadonlySet<number>;
58
+ /**
59
+ * Family-alias lookup for fonts the host registered on behalf of THIS document (see
60
+ * {@link PaintContext.fontAlias}). Painted runs emit the alias ahead of the declared
61
+ * family, so a file can never shadow a family name the host page uses.
62
+ */
63
+ readonly fontAlias?: (family: string) => string | undefined;
64
+ /** See {@link PaintContext.defaultFontFamily}. */
65
+ readonly defaultFontFamily?: string;
66
+ /** See {@link PaintContext.fieldShading}. */
67
+ readonly fieldShading?: FieldShadingMode;
68
+ /** See {@link PaintContext.shadeFormFields}. */
69
+ readonly shadeFormFields?: boolean;
70
+ /**
71
+ * Relationship id of the header/footer story currently open for editing.
72
+ *
73
+ * When set, the matching `[data-docx-hf]` container is editable and every body
74
+ * `.docx-page-content` box is inert; all other furniture stays read-only.
75
+ */
76
+ readonly activeHeaderFooterRId?: string;
77
+ /**
78
+ * Sheet that hosts the active visual occurrence of a shared furniture part.
79
+ *
80
+ * Required with {@link activeHeaderFooterRId} so only one painted copy receives
81
+ * `data-docx-hf-active` / the engine caret when the same rId appears on many pages.
82
+ */
83
+ readonly activeHeaderFooterPageIndex?: number;
84
+ /**
85
+ * On-demand content-control boundary chrome (show-all and/or caret-entry).
86
+ *
87
+ * Furniture only — never contributes layout records or changes page geometry. Omitted or
88
+ * empty means no control chrome is painted. Folded into the paint-reuse key so a toggle
89
+ * rebuilds furniture without a layout pass.
90
+ */
91
+ readonly contentControlChrome?: {
92
+ readonly showAll?: boolean;
93
+ /** Control ids whose boundaries are visible because the caret is inside them. */
94
+ readonly activeIds?: ReadonlySet<string>;
95
+ /**
96
+ * Control ids whose boundaries are visible because the pointer is over them.
97
+ * Used for TOC hover chrome without projecting a persistent caret-active state.
98
+ *
99
+ * Deliberately OUTSIDE the paint-reuse key: hover must never rebuild a page. The
100
+ * surface toggles `data-hover` / `data-boundary-visible` on the painted chrome it
101
+ * already has, and this set only tells a page that rebuilds for some OTHER reason
102
+ * which of its controls is currently under the pointer.
103
+ */
104
+ readonly hoverIds?: ReadonlySet<string>;
105
+ /**
106
+ * Control ids whose boundary furniture is painted by something else.
107
+ *
108
+ * An empty TOC paints its own placeholder box on the begin paragraph, so drawing the
109
+ * control boundary as well left two rounded rectangles (of different heights) plus a
110
+ * label chip stacked over one empty region.
111
+ */
112
+ readonly suppressedIds?: ReadonlySet<string>;
113
+ /** Checkbox control ids whose canonical `w14:checked` state is on. */
114
+ readonly checkedIds?: ReadonlySet<string>;
115
+ /** Non-SDT structured regions that intentionally reuse content-control chrome. */
116
+ readonly additionalBoundaries?: readonly ContentControlBoundaryRecord[];
117
+ /** Control ids that represent TOC regions (hover-only chrome; never caret-sticky). */
118
+ readonly tocControlIds?: ReadonlySet<string>;
119
+ };
120
+ readonly drawingStrings?: DrawingPaintStrings;
121
+ readonly imageUrlPort?: PaintImageUrlPort;
122
+ }
123
+
124
+ /**
125
+ * Paint a whole layout into a container, reusing the pages that did not change.
126
+ *
127
+ * The DOM is built with `createElement` and `textContent` only — no file-derived string is
128
+ * ever parsed as markup — and stray children (nothing this module painted) are removed, so
129
+ * the container's content is always exactly the painted pages.
130
+ */
131
+ declare function paintSemanticLayout(container: HTMLElement, layout: SemanticLayout, options?: PaintOptions): void;
132
+
133
+ export { DEFAULT_FIELD_SHADING as D, type FieldShadingMode as F, type PaintOptions as P, type DrawingPaintStrings as a, paintSemanticLayout as p };
@@ -0,0 +1,133 @@
1
+ import { C as ContentControlBoundaryRecord, S as SemanticLayout } from './semantic-records-DC6V1U3T.cjs';
2
+ import { V as ValidatedImageBytesHandle, R as RenderableImageMime } from './image-resources-DwpNnTg3.cjs';
3
+
4
+ /** Host port for safe blob URLs — only called for {@link ImageResourceState.kind} `ready`. */
5
+ interface PaintImageUrlPort {
6
+ create(handle: ValidatedImageBytesHandle, mime: RenderableImageMime): string;
7
+ revoke(url: string): void;
8
+ }
9
+ /** Localized refusal labels; adapters supply i18n-backed implementations. */
10
+ interface DrawingPaintStrings {
11
+ readonly unsupportedFormat: (format: string) => string;
12
+ readonly nonPictureGraphic: (kind: string) => string;
13
+ readonly missingResource: string;
14
+ readonly externalResource: string;
15
+ readonly invalidResource: string;
16
+ readonly contentMismatch: string;
17
+ readonly decodeFailed: string;
18
+ readonly resourceLimit: string;
19
+ readonly pendingResource: string;
20
+ }
21
+
22
+ /**
23
+ * When a field's result is drawn on its grey block, following Word's own View option.
24
+ *
25
+ * `when-selected` is Word's default and the reason the option exists at all: a document dense
26
+ * with cross-references turns largely grey under `always`, and under `never` a reader cannot
27
+ * tell computed text from typed text at all.
28
+ */
29
+ type FieldShadingMode = 'never' | 'when-selected' | 'always';
30
+ /** Word's default: shaded only while the caret is inside the field. */
31
+ declare const DEFAULT_FIELD_SHADING: FieldShadingMode;
32
+ /**
33
+ * How a layout is painted into DOM. Every field is optional.
34
+ *
35
+ * The painted pages ARE the editable surface, so everything here is presentation-only — nothing
36
+ * set through these options is ever serialised back into the document.
37
+ */
38
+ interface PaintOptions {
39
+ /** Points to CSS pixels. 96/72 renders a point as a CSS point at 100% zoom. */
40
+ readonly scale?: number;
41
+ /** Generated paragraphs that paint as non-editable navigation surfaces. */
42
+ readonly readOnlyParagraphIds?: ReadonlySet<string>;
43
+ /**
44
+ * Empty-TOC begin paragraphs that paint subtle identifiable furniture. Paint-only — never
45
+ * serialised into the document.
46
+ */
47
+ readonly emptyTocPlaceholderIds?: ReadonlySet<string>;
48
+ /** Marks painted pages as presentational, so assistive tech reads the editable projection. */
49
+ readonly ariaHidden?: boolean;
50
+ /**
51
+ * Page indices to build in detail (task 9.4).
52
+ *
53
+ * Omitted means all of them. A page left out keeps its size and position but no content,
54
+ * so the document's height and page count are unchanged and scrolling to it reveals it
55
+ * instead of reflowing everything underneath.
56
+ */
57
+ readonly materialize?: ReadonlySet<number>;
58
+ /**
59
+ * Family-alias lookup for fonts the host registered on behalf of THIS document (see
60
+ * {@link PaintContext.fontAlias}). Painted runs emit the alias ahead of the declared
61
+ * family, so a file can never shadow a family name the host page uses.
62
+ */
63
+ readonly fontAlias?: (family: string) => string | undefined;
64
+ /** See {@link PaintContext.defaultFontFamily}. */
65
+ readonly defaultFontFamily?: string;
66
+ /** See {@link PaintContext.fieldShading}. */
67
+ readonly fieldShading?: FieldShadingMode;
68
+ /** See {@link PaintContext.shadeFormFields}. */
69
+ readonly shadeFormFields?: boolean;
70
+ /**
71
+ * Relationship id of the header/footer story currently open for editing.
72
+ *
73
+ * When set, the matching `[data-docx-hf]` container is editable and every body
74
+ * `.docx-page-content` box is inert; all other furniture stays read-only.
75
+ */
76
+ readonly activeHeaderFooterRId?: string;
77
+ /**
78
+ * Sheet that hosts the active visual occurrence of a shared furniture part.
79
+ *
80
+ * Required with {@link activeHeaderFooterRId} so only one painted copy receives
81
+ * `data-docx-hf-active` / the engine caret when the same rId appears on many pages.
82
+ */
83
+ readonly activeHeaderFooterPageIndex?: number;
84
+ /**
85
+ * On-demand content-control boundary chrome (show-all and/or caret-entry).
86
+ *
87
+ * Furniture only — never contributes layout records or changes page geometry. Omitted or
88
+ * empty means no control chrome is painted. Folded into the paint-reuse key so a toggle
89
+ * rebuilds furniture without a layout pass.
90
+ */
91
+ readonly contentControlChrome?: {
92
+ readonly showAll?: boolean;
93
+ /** Control ids whose boundaries are visible because the caret is inside them. */
94
+ readonly activeIds?: ReadonlySet<string>;
95
+ /**
96
+ * Control ids whose boundaries are visible because the pointer is over them.
97
+ * Used for TOC hover chrome without projecting a persistent caret-active state.
98
+ *
99
+ * Deliberately OUTSIDE the paint-reuse key: hover must never rebuild a page. The
100
+ * surface toggles `data-hover` / `data-boundary-visible` on the painted chrome it
101
+ * already has, and this set only tells a page that rebuilds for some OTHER reason
102
+ * which of its controls is currently under the pointer.
103
+ */
104
+ readonly hoverIds?: ReadonlySet<string>;
105
+ /**
106
+ * Control ids whose boundary furniture is painted by something else.
107
+ *
108
+ * An empty TOC paints its own placeholder box on the begin paragraph, so drawing the
109
+ * control boundary as well left two rounded rectangles (of different heights) plus a
110
+ * label chip stacked over one empty region.
111
+ */
112
+ readonly suppressedIds?: ReadonlySet<string>;
113
+ /** Checkbox control ids whose canonical `w14:checked` state is on. */
114
+ readonly checkedIds?: ReadonlySet<string>;
115
+ /** Non-SDT structured regions that intentionally reuse content-control chrome. */
116
+ readonly additionalBoundaries?: readonly ContentControlBoundaryRecord[];
117
+ /** Control ids that represent TOC regions (hover-only chrome; never caret-sticky). */
118
+ readonly tocControlIds?: ReadonlySet<string>;
119
+ };
120
+ readonly drawingStrings?: DrawingPaintStrings;
121
+ readonly imageUrlPort?: PaintImageUrlPort;
122
+ }
123
+
124
+ /**
125
+ * Paint a whole layout into a container, reusing the pages that did not change.
126
+ *
127
+ * The DOM is built with `createElement` and `textContent` only — no file-derived string is
128
+ * ever parsed as markup — and stray children (nothing this module painted) are removed, so
129
+ * the container's content is always exactly the painted pages.
130
+ */
131
+ declare function paintSemanticLayout(container: HTMLElement, layout: SemanticLayout, options?: PaintOptions): void;
132
+
133
+ export { DEFAULT_FIELD_SHADING as D, type FieldShadingMode as F, type PaintOptions as P, type DrawingPaintStrings as a, paintSemanticLayout as p };
@@ -1,7 +1,7 @@
1
1
  import { O as OoxmlProperty, j as DrawingAccessibility, S as SourceCrop, k as DrawingTransform, V as VectorShapeProjection, f as DrawingHorizontalReferenceFrame, g as DrawingVerticalReferenceFrame, b as ImageWrapTarget, D as DrawingProjection, l as TableBorderStyle } from './tree-op-types-DWLCllG7.js';
2
2
  import { O as OoxmlNode, o as OoxmlDrawingNode, a as OoxmlElement } from './ooxml-tree-BU0e3DVi.js';
3
- import { I as ImageResourceState } from './image-resources-C_YnqPhn.js';
4
3
  import { a as RevisionAttribution } from './revision-projection-DHAkcD_L.js';
4
+ import { I as ImageResourceState } from './image-resources-C_YnqPhn.js';
5
5
 
6
6
  /** Whether a paragraph must start a new page (`w:pageBreakBefore`). */
7
7
  declare function paragraphBreaksBefore(props: readonly OoxmlProperty[]): boolean;
@@ -562,42 +562,26 @@ interface AnchoredDrawingRecord extends Omit<InlineDrawingRecord, 'kind' | 'base
562
562
  }
563
563
 
564
564
  /**
565
- * Page-field evaluation context for furniture projection.
565
+ * What a piece says about the FIELD result it came from, for Word's shading.
566
566
  *
567
- * `pageNumber` is the displayed PAGE value after section `w:pgNumType/@w:start` (1-based).
568
- * `pageCount` is document NUMPAGES. `sectionPageCount` is SECTIONPAGES for the attached
569
- * section. `format` is the authored `w:pgNumType/@w:fmt` applied only to PAGE.
567
+ * Carried from layout rather than decided at paint time because only the walk knows an atom was
568
+ * a field at all — by paint the result is just text. Whether the shading is actually drawn is a
569
+ * view decision made downstream, so this states the fact and nothing about the appearance.
570
570
  */
571
- interface FieldPageContext {
572
- readonly pageNumber: number;
573
- readonly pageCount: number;
574
- /** SECTIONPAGES; defaults to `pageCount` when omitted (single-section callers). */
575
- readonly sectionPageCount?: number;
576
- /** Authored ST_NumberFormat for PAGE; absent → decimal. */
577
- readonly format?: string;
571
+ interface FieldAtomMarker {
572
+ /**
573
+ * A legacy form field: `w:fldChar/w:ffData` (FORMTEXT, FORMCHECKBOX, FORMDROPDOWN).
574
+ *
575
+ * Word shades these on a different rule from ordinary fields — always, unless the document
576
+ * turns it off — because they mark the blanks somebody is meant to fill in.
577
+ */
578
+ readonly formField: boolean;
578
579
  }
579
580
  /** A half-open model-offset range, in the paragraph's own UTF-16 offset space. */
580
581
  interface ModelRange {
581
582
  readonly start: number;
582
583
  readonly end: number;
583
584
  }
584
- /**
585
- * How layout turns a typed `w:hyperlink` node into the sanitized record spans carry.
586
- *
587
- * Injected rather than computed here because resolving `r:id` needs the PACKAGE's
588
- * relationships and this module only ever sees one part's tree. `null` means the caller
589
- * declined to project — the runs still measure and paint, they simply carry no link, which is
590
- * the right degradation: text is never lost for want of a target.
591
- */
592
- type HyperlinkProjector = (link: OoxmlNode) => SpanLinkRecord | null;
593
- /**
594
- * Format a displayed PAGE value through the shared ST_NumberFormat resolver.
595
- *
596
- * Unknown / script-specific formats fall back to decimal (same convention as list markers).
597
- * `none` / `bullet` are meaningless for page numbers and also fall back to decimal so a
598
- * hostile fmt cannot blank the furniture.
599
- */
600
- declare function formatPageNumber(value: number, format: string | undefined): string;
601
585
 
602
586
  /** Test-only mutable counters; omitted by production call sites. Not package-public. */
603
587
  interface TableBorderGridResolveWork {
@@ -908,11 +892,23 @@ interface StyleSpanRecord {
908
892
  * could disagree with what was painted, and the card would point at the wrong text.
909
893
  */
910
894
  readonly revisions?: readonly RevisionAttribution[];
895
+ /**
896
+ * Present when this span is a field's displayed RESULT, for the shading Word draws under one.
897
+ *
898
+ * `projected` cannot answer this: it is also set for note marks and inline drawings, so it
899
+ * says "layout owns these glyphs" rather than "this is a field". Word shades legacy form
900
+ * fields on a different rule from ordinary ones, which is why the marker distinguishes them.
901
+ *
902
+ * States the FACT, never the appearance — whether shading is drawn is a view decision, made
903
+ * downstream from a host option and the document's own `w:doNotShadeFormData`. Deciding it
904
+ * here would put the caret into layout's cache key and repaginate on every arrow press.
905
+ */
906
+ readonly fieldAtom?: FieldAtomMarker;
911
907
  /**
912
908
  * Live PAGE/NUMPAGES/SECTIONPAGES projection (layout-time evaluated text).
913
909
  *
914
- * Not model-editable until typed fields land: paint treats these as atomic furniture and
915
- * selection mapping refuses them the way it refuses markers.
910
+ * Computed substitutions are not model-editable: paint treats these as atomic furniture
911
+ * and selection mapping refuses them the way it refuses markers.
916
912
  */
917
913
  readonly projected?: boolean;
918
914
  /**
@@ -1502,4 +1498,4 @@ declare function unionLayoutBoxes(boxes: readonly LayoutBox[]): LayoutBox | null
1502
1498
  /** Collapse raw + ancestor locks into one `ST_Lock` vocabulary value. */
1503
1499
  declare function effectiveContentControlLock(locks: readonly ContentControlLock[]): ContentControlLock;
1504
1500
 
1505
- export { type ParagraphBorderStrokeRecord as $, type AnchoredDrawingRecord as A, type BlockFragmentRecord as B, type ContentControlBoundaryRecord as C, type DrawingPoint as D, DEFAULT_TAB_INTERVAL_TWIPS as E, type FieldPageContext as F, EMPTY_TAB_STOPS as G, type HyperlinkProjector as H, type InlineDrawingRecord as I, type HeaderFooterStoryRecord as J, type LineSpacingRule as K, type LineRecord as L, type ModelRange as M, type ListMarkerRecord as N, MAX_BORDER_SPACE_PT as O, type PageGeometry as P, MAX_BORDER_WIDTH_PT as Q, type ResolvedRunStyle as R, type SemanticLayout as S, type TextMeasurer as T, MAX_PARAGRAPH_SPACING_PT as U, MAX_TABLE_BORDER_STROKES as V, MAX_TAB_POSITION_TWIPS as W, MAX_TAB_STOPS as X, PARAGRAPH_BORDER_SIDES as Y, type ParagraphAutoSpacingContext as Z, type ParagraphBorderSide as _, type StyleSpanRecord as a, type ParagraphBottomBorderRecord as a0, type ParagraphIndent as a1, type ResolvedCellBorders as a2, type ResolvedTableBorderEdge as a3, type ResolvedTableBorderEdgeSegment as a4, type ResolvedUnderline as a5, SINGLE_LINE_SPACING as a6, type SourceRange as a7, type SpanLinkRecord as a8, TAB_LEADER_GLYPH as a9, nextTabDestination as aA, paragraphBorderExtentPt as aB, paragraphBorderStrokeWidthPt as aC, paragraphBorders as aD, paragraphBordersFingerprint as aE, paragraphBreaksBefore as aF, paragraphContextualSpacing as aG, paragraphFragmentsOf as aH, paragraphFragmentsOfBlocks as aI, paragraphLineSpacing as aJ, paragraphSpacing as aK, paragraphTabStops as aL, readBorderSide as aM, readCellBorders as aN, readTableBorders as aO, resolveBorderConflict as aP, resolveRunStyle as aQ, resolveTableCellBorderGrid as aR, runStylesEqual as aS, tabAdvanceWidth as aT, tabStopsFingerprint as aU, unionLayoutBoxes as aV, withDefaultTabInterval as aW, type TabAlignment as aa, type TabDestination as ab, type TabLeader as ac, type TabStop as ad, type TableBorderSideName as ae, type TableBorderStrokeRecord as af, type TableFragmentRecord as ag, type VerticalAlign as ah, appliedSpaceBefore as ai, applyLineSpacing as aj, baselineShiftPtOf as ak, borderExtentPt as al, borderWeight as am, bottomBorderExtentPt as an, cascadedParagraphBorders as ao, cascadedTabStops as ap, collapsedSpaceBefore as aq, contentControlsOfLayout as ar, defaultTabIntervalFromSettings as as, displayText as at, effectiveContentControlLock as au, formatPageNumber as av, fragmentsOfParagraph as aw, lineAtPosition as ax, linesOf as ay, measureDisplayText as az, type TableRowFragmentRecord as b, type TableCellFragmentRecord as c, type LayoutBox as d, type DrawingInsets as e, type ThemeFonts as f, type ParagraphSpacing as g, type ParagraphLineSpacing as h, type ParagraphBorderEdge as i, type ParagraphBorders as j, type ResolvedTabStops as k, type TableBorderSide as l, type InlineDrawingLayoutContext as m, type PageRecord as n, type ParagraphFragmentRecord as o, type CellBorderBox as p, type TableBorderBox as q, AUTO_PARAGRAPH_SPACING_PT as r, type BorderGridGeometry as s, type ContentControlGeometryFragment as t, type ContentControlLevel as u, type ContentControlLock as v, type ContentControlMappedType as w, DEFAULT_PAGE_GEOMETRY as x, DEFAULT_RUN_STYLE as y, DEFAULT_TAB_INTERVAL_PT as z };
1501
+ export { type ParagraphBorderStrokeRecord as $, type AnchoredDrawingRecord as A, type BlockFragmentRecord as B, type ContentControlBoundaryRecord as C, type DrawingPoint as D, DEFAULT_TAB_INTERVAL_PT as E, DEFAULT_TAB_INTERVAL_TWIPS as F, EMPTY_TAB_STOPS as G, type FieldAtomMarker as H, type InlineDrawingRecord as I, type HeaderFooterStoryRecord as J, type LineSpacingRule as K, type LineRecord as L, type ModelRange as M, type ListMarkerRecord as N, MAX_BORDER_SPACE_PT as O, type PageGeometry as P, MAX_BORDER_WIDTH_PT as Q, type ResolvedRunStyle as R, type SemanticLayout as S, type TextMeasurer as T, MAX_PARAGRAPH_SPACING_PT as U, MAX_TABLE_BORDER_STROKES as V, MAX_TAB_POSITION_TWIPS as W, MAX_TAB_STOPS as X, PARAGRAPH_BORDER_SIDES as Y, type ParagraphAutoSpacingContext as Z, type ParagraphBorderSide as _, type StyleSpanRecord as a, type ParagraphBottomBorderRecord as a0, type ParagraphIndent as a1, type ResolvedCellBorders as a2, type ResolvedTableBorderEdge as a3, type ResolvedTableBorderEdgeSegment as a4, type ResolvedUnderline as a5, SINGLE_LINE_SPACING as a6, type SourceRange as a7, TAB_LEADER_GLYPH as a8, type TabAlignment as a9, paragraphBorderStrokeWidthPt as aA, paragraphBorders as aB, paragraphBordersFingerprint as aC, paragraphBreaksBefore as aD, paragraphContextualSpacing as aE, paragraphFragmentsOf as aF, paragraphFragmentsOfBlocks as aG, paragraphLineSpacing as aH, paragraphSpacing as aI, paragraphTabStops as aJ, readBorderSide as aK, readCellBorders as aL, readTableBorders as aM, resolveBorderConflict as aN, resolveRunStyle as aO, resolveTableCellBorderGrid as aP, runStylesEqual as aQ, tabAdvanceWidth as aR, tabStopsFingerprint as aS, unionLayoutBoxes as aT, withDefaultTabInterval as aU, type TabDestination as aa, type TabLeader as ab, type TabStop as ac, type TableBorderSideName as ad, type TableBorderStrokeRecord as ae, type TableFragmentRecord as af, type VerticalAlign as ag, appliedSpaceBefore as ah, applyLineSpacing as ai, baselineShiftPtOf as aj, borderExtentPt as ak, borderWeight as al, bottomBorderExtentPt as am, cascadedParagraphBorders as an, cascadedTabStops as ao, collapsedSpaceBefore as ap, contentControlsOfLayout as aq, defaultTabIntervalFromSettings as ar, displayText as as, effectiveContentControlLock as at, fragmentsOfParagraph as au, lineAtPosition as av, linesOf as aw, measureDisplayText as ax, nextTabDestination as ay, paragraphBorderExtentPt as az, type TableRowFragmentRecord as b, type TableCellFragmentRecord as c, type SpanLinkRecord as d, type LayoutBox as e, type DrawingInsets as f, type ThemeFonts as g, type ParagraphSpacing as h, type ParagraphLineSpacing as i, type ParagraphBorderEdge as j, type ParagraphBorders as k, type ResolvedTabStops as l, type TableBorderSide as m, type InlineDrawingLayoutContext as n, type PageRecord as o, type ParagraphFragmentRecord as p, type CellBorderBox as q, type TableBorderBox as r, AUTO_PARAGRAPH_SPACING_PT as s, type BorderGridGeometry as t, type ContentControlGeometryFragment as u, type ContentControlLevel as v, type ContentControlLock as w, type ContentControlMappedType as x, DEFAULT_PAGE_GEOMETRY as y, DEFAULT_RUN_STYLE as z };
@@ -1,7 +1,7 @@
1
1
  import { O as OoxmlProperty, j as DrawingAccessibility, S as SourceCrop, k as DrawingTransform, V as VectorShapeProjection, f as DrawingHorizontalReferenceFrame, g as DrawingVerticalReferenceFrame, b as ImageWrapTarget, D as DrawingProjection, l as TableBorderStyle } from './tree-op-types-UOXlRUqQ.cjs';
2
2
  import { O as OoxmlNode, o as OoxmlDrawingNode, a as OoxmlElement } from './ooxml-tree-BU0e3DVi.cjs';
3
- import { I as ImageResourceState } from './image-resources-DwpNnTg3.cjs';
4
3
  import { a as RevisionAttribution } from './revision-projection-72ZApe-g.cjs';
4
+ import { I as ImageResourceState } from './image-resources-DwpNnTg3.cjs';
5
5
 
6
6
  /** Whether a paragraph must start a new page (`w:pageBreakBefore`). */
7
7
  declare function paragraphBreaksBefore(props: readonly OoxmlProperty[]): boolean;
@@ -562,42 +562,26 @@ interface AnchoredDrawingRecord extends Omit<InlineDrawingRecord, 'kind' | 'base
562
562
  }
563
563
 
564
564
  /**
565
- * Page-field evaluation context for furniture projection.
565
+ * What a piece says about the FIELD result it came from, for Word's shading.
566
566
  *
567
- * `pageNumber` is the displayed PAGE value after section `w:pgNumType/@w:start` (1-based).
568
- * `pageCount` is document NUMPAGES. `sectionPageCount` is SECTIONPAGES for the attached
569
- * section. `format` is the authored `w:pgNumType/@w:fmt` applied only to PAGE.
567
+ * Carried from layout rather than decided at paint time because only the walk knows an atom was
568
+ * a field at all — by paint the result is just text. Whether the shading is actually drawn is a
569
+ * view decision made downstream, so this states the fact and nothing about the appearance.
570
570
  */
571
- interface FieldPageContext {
572
- readonly pageNumber: number;
573
- readonly pageCount: number;
574
- /** SECTIONPAGES; defaults to `pageCount` when omitted (single-section callers). */
575
- readonly sectionPageCount?: number;
576
- /** Authored ST_NumberFormat for PAGE; absent → decimal. */
577
- readonly format?: string;
571
+ interface FieldAtomMarker {
572
+ /**
573
+ * A legacy form field: `w:fldChar/w:ffData` (FORMTEXT, FORMCHECKBOX, FORMDROPDOWN).
574
+ *
575
+ * Word shades these on a different rule from ordinary fields — always, unless the document
576
+ * turns it off — because they mark the blanks somebody is meant to fill in.
577
+ */
578
+ readonly formField: boolean;
578
579
  }
579
580
  /** A half-open model-offset range, in the paragraph's own UTF-16 offset space. */
580
581
  interface ModelRange {
581
582
  readonly start: number;
582
583
  readonly end: number;
583
584
  }
584
- /**
585
- * How layout turns a typed `w:hyperlink` node into the sanitized record spans carry.
586
- *
587
- * Injected rather than computed here because resolving `r:id` needs the PACKAGE's
588
- * relationships and this module only ever sees one part's tree. `null` means the caller
589
- * declined to project — the runs still measure and paint, they simply carry no link, which is
590
- * the right degradation: text is never lost for want of a target.
591
- */
592
- type HyperlinkProjector = (link: OoxmlNode) => SpanLinkRecord | null;
593
- /**
594
- * Format a displayed PAGE value through the shared ST_NumberFormat resolver.
595
- *
596
- * Unknown / script-specific formats fall back to decimal (same convention as list markers).
597
- * `none` / `bullet` are meaningless for page numbers and also fall back to decimal so a
598
- * hostile fmt cannot blank the furniture.
599
- */
600
- declare function formatPageNumber(value: number, format: string | undefined): string;
601
585
 
602
586
  /** Test-only mutable counters; omitted by production call sites. Not package-public. */
603
587
  interface TableBorderGridResolveWork {
@@ -908,11 +892,23 @@ interface StyleSpanRecord {
908
892
  * could disagree with what was painted, and the card would point at the wrong text.
909
893
  */
910
894
  readonly revisions?: readonly RevisionAttribution[];
895
+ /**
896
+ * Present when this span is a field's displayed RESULT, for the shading Word draws under one.
897
+ *
898
+ * `projected` cannot answer this: it is also set for note marks and inline drawings, so it
899
+ * says "layout owns these glyphs" rather than "this is a field". Word shades legacy form
900
+ * fields on a different rule from ordinary ones, which is why the marker distinguishes them.
901
+ *
902
+ * States the FACT, never the appearance — whether shading is drawn is a view decision, made
903
+ * downstream from a host option and the document's own `w:doNotShadeFormData`. Deciding it
904
+ * here would put the caret into layout's cache key and repaginate on every arrow press.
905
+ */
906
+ readonly fieldAtom?: FieldAtomMarker;
911
907
  /**
912
908
  * Live PAGE/NUMPAGES/SECTIONPAGES projection (layout-time evaluated text).
913
909
  *
914
- * Not model-editable until typed fields land: paint treats these as atomic furniture and
915
- * selection mapping refuses them the way it refuses markers.
910
+ * Computed substitutions are not model-editable: paint treats these as atomic furniture
911
+ * and selection mapping refuses them the way it refuses markers.
916
912
  */
917
913
  readonly projected?: boolean;
918
914
  /**
@@ -1502,4 +1498,4 @@ declare function unionLayoutBoxes(boxes: readonly LayoutBox[]): LayoutBox | null
1502
1498
  /** Collapse raw + ancestor locks into one `ST_Lock` vocabulary value. */
1503
1499
  declare function effectiveContentControlLock(locks: readonly ContentControlLock[]): ContentControlLock;
1504
1500
 
1505
- export { type ParagraphBorderStrokeRecord as $, type AnchoredDrawingRecord as A, type BlockFragmentRecord as B, type ContentControlBoundaryRecord as C, type DrawingPoint as D, DEFAULT_TAB_INTERVAL_TWIPS as E, type FieldPageContext as F, EMPTY_TAB_STOPS as G, type HyperlinkProjector as H, type InlineDrawingRecord as I, type HeaderFooterStoryRecord as J, type LineSpacingRule as K, type LineRecord as L, type ModelRange as M, type ListMarkerRecord as N, MAX_BORDER_SPACE_PT as O, type PageGeometry as P, MAX_BORDER_WIDTH_PT as Q, type ResolvedRunStyle as R, type SemanticLayout as S, type TextMeasurer as T, MAX_PARAGRAPH_SPACING_PT as U, MAX_TABLE_BORDER_STROKES as V, MAX_TAB_POSITION_TWIPS as W, MAX_TAB_STOPS as X, PARAGRAPH_BORDER_SIDES as Y, type ParagraphAutoSpacingContext as Z, type ParagraphBorderSide as _, type StyleSpanRecord as a, type ParagraphBottomBorderRecord as a0, type ParagraphIndent as a1, type ResolvedCellBorders as a2, type ResolvedTableBorderEdge as a3, type ResolvedTableBorderEdgeSegment as a4, type ResolvedUnderline as a5, SINGLE_LINE_SPACING as a6, type SourceRange as a7, type SpanLinkRecord as a8, TAB_LEADER_GLYPH as a9, nextTabDestination as aA, paragraphBorderExtentPt as aB, paragraphBorderStrokeWidthPt as aC, paragraphBorders as aD, paragraphBordersFingerprint as aE, paragraphBreaksBefore as aF, paragraphContextualSpacing as aG, paragraphFragmentsOf as aH, paragraphFragmentsOfBlocks as aI, paragraphLineSpacing as aJ, paragraphSpacing as aK, paragraphTabStops as aL, readBorderSide as aM, readCellBorders as aN, readTableBorders as aO, resolveBorderConflict as aP, resolveRunStyle as aQ, resolveTableCellBorderGrid as aR, runStylesEqual as aS, tabAdvanceWidth as aT, tabStopsFingerprint as aU, unionLayoutBoxes as aV, withDefaultTabInterval as aW, type TabAlignment as aa, type TabDestination as ab, type TabLeader as ac, type TabStop as ad, type TableBorderSideName as ae, type TableBorderStrokeRecord as af, type TableFragmentRecord as ag, type VerticalAlign as ah, appliedSpaceBefore as ai, applyLineSpacing as aj, baselineShiftPtOf as ak, borderExtentPt as al, borderWeight as am, bottomBorderExtentPt as an, cascadedParagraphBorders as ao, cascadedTabStops as ap, collapsedSpaceBefore as aq, contentControlsOfLayout as ar, defaultTabIntervalFromSettings as as, displayText as at, effectiveContentControlLock as au, formatPageNumber as av, fragmentsOfParagraph as aw, lineAtPosition as ax, linesOf as ay, measureDisplayText as az, type TableRowFragmentRecord as b, type TableCellFragmentRecord as c, type LayoutBox as d, type DrawingInsets as e, type ThemeFonts as f, type ParagraphSpacing as g, type ParagraphLineSpacing as h, type ParagraphBorderEdge as i, type ParagraphBorders as j, type ResolvedTabStops as k, type TableBorderSide as l, type InlineDrawingLayoutContext as m, type PageRecord as n, type ParagraphFragmentRecord as o, type CellBorderBox as p, type TableBorderBox as q, AUTO_PARAGRAPH_SPACING_PT as r, type BorderGridGeometry as s, type ContentControlGeometryFragment as t, type ContentControlLevel as u, type ContentControlLock as v, type ContentControlMappedType as w, DEFAULT_PAGE_GEOMETRY as x, DEFAULT_RUN_STYLE as y, DEFAULT_TAB_INTERVAL_PT as z };
1501
+ export { type ParagraphBorderStrokeRecord as $, type AnchoredDrawingRecord as A, type BlockFragmentRecord as B, type ContentControlBoundaryRecord as C, type DrawingPoint as D, DEFAULT_TAB_INTERVAL_PT as E, DEFAULT_TAB_INTERVAL_TWIPS as F, EMPTY_TAB_STOPS as G, type FieldAtomMarker as H, type InlineDrawingRecord as I, type HeaderFooterStoryRecord as J, type LineSpacingRule as K, type LineRecord as L, type ModelRange as M, type ListMarkerRecord as N, MAX_BORDER_SPACE_PT as O, type PageGeometry as P, MAX_BORDER_WIDTH_PT as Q, type ResolvedRunStyle as R, type SemanticLayout as S, type TextMeasurer as T, MAX_PARAGRAPH_SPACING_PT as U, MAX_TABLE_BORDER_STROKES as V, MAX_TAB_POSITION_TWIPS as W, MAX_TAB_STOPS as X, PARAGRAPH_BORDER_SIDES as Y, type ParagraphAutoSpacingContext as Z, type ParagraphBorderSide as _, type StyleSpanRecord as a, type ParagraphBottomBorderRecord as a0, type ParagraphIndent as a1, type ResolvedCellBorders as a2, type ResolvedTableBorderEdge as a3, type ResolvedTableBorderEdgeSegment as a4, type ResolvedUnderline as a5, SINGLE_LINE_SPACING as a6, type SourceRange as a7, TAB_LEADER_GLYPH as a8, type TabAlignment as a9, paragraphBorderStrokeWidthPt as aA, paragraphBorders as aB, paragraphBordersFingerprint as aC, paragraphBreaksBefore as aD, paragraphContextualSpacing as aE, paragraphFragmentsOf as aF, paragraphFragmentsOfBlocks as aG, paragraphLineSpacing as aH, paragraphSpacing as aI, paragraphTabStops as aJ, readBorderSide as aK, readCellBorders as aL, readTableBorders as aM, resolveBorderConflict as aN, resolveRunStyle as aO, resolveTableCellBorderGrid as aP, runStylesEqual as aQ, tabAdvanceWidth as aR, tabStopsFingerprint as aS, unionLayoutBoxes as aT, withDefaultTabInterval as aU, type TabDestination as aa, type TabLeader as ab, type TabStop as ac, type TableBorderSideName as ad, type TableBorderStrokeRecord as ae, type TableFragmentRecord as af, type VerticalAlign as ag, appliedSpaceBefore as ah, applyLineSpacing as ai, baselineShiftPtOf as aj, borderExtentPt as ak, borderWeight as al, bottomBorderExtentPt as am, cascadedParagraphBorders as an, cascadedTabStops as ao, collapsedSpaceBefore as ap, contentControlsOfLayout as aq, defaultTabIntervalFromSettings as ar, displayText as as, effectiveContentControlLock as at, fragmentsOfParagraph as au, lineAtPosition as av, linesOf as aw, measureDisplayText as ax, nextTabDestination as ay, paragraphBorderExtentPt as az, type TableRowFragmentRecord as b, type TableCellFragmentRecord as c, type SpanLinkRecord as d, type LayoutBox as e, type DrawingInsets as f, type ThemeFonts as g, type ParagraphSpacing as h, type ParagraphLineSpacing as i, type ParagraphBorderEdge as j, type ParagraphBorders as k, type ResolvedTabStops as l, type TableBorderSide as m, type InlineDrawingLayoutContext as n, type PageRecord as o, type ParagraphFragmentRecord as p, type CellBorderBox as q, type TableBorderBox as r, AUTO_PARAGRAPH_SPACING_PT as s, type BorderGridGeometry as t, type ContentControlGeometryFragment as u, type ContentControlLevel as v, type ContentControlLock as w, type ContentControlMappedType as x, DEFAULT_PAGE_GEOMETRY as y, DEFAULT_RUN_STYLE as z };
@@ -1,4 +1,4 @@
1
- import { R as ResolvedRunStyle, T as TextMeasurer } from './semantic-records-zTC0_1zi.js';
1
+ import { R as ResolvedRunStyle, T as TextMeasurer } from './semantic-records-BC4bIKKL.js';
2
2
 
3
3
  /**
4
4
  * A face, as something asks for it: family plus the two axes this engine admits.
@@ -1,4 +1,4 @@
1
- import { R as ResolvedRunStyle, T as TextMeasurer } from './semantic-records-COVFW5aS.cjs';
1
+ import { R as ResolvedRunStyle, T as TextMeasurer } from './semantic-records-DC6V1U3T.cjs';
2
2
 
3
3
  /**
4
4
  * A face, as something asks for it: family plus the two axes this engine admits.