@docx-editor.dev/core 2.9.1 → 2.10.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 (94) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.js +1 -1
  3. package/dist/binding.cjs +1 -1
  4. package/dist/binding.d.cts +74 -10
  5. package/dist/binding.d.ts +74 -10
  6. package/dist/binding.js +1 -1
  7. package/dist/chunk-27APDXY2.js +2 -0
  8. package/dist/chunk-35MI6K7M.cjs +10 -0
  9. package/dist/chunk-4XL7SOWQ.cjs +2 -0
  10. package/dist/chunk-6K6QQVAZ.cjs +18 -0
  11. package/dist/chunk-7ZJL5AEY.cjs +1 -0
  12. package/dist/chunk-C6LK2BYA.cjs +2 -0
  13. package/dist/chunk-HBEBUCRM.cjs +5 -0
  14. package/dist/chunk-LG5K46OM.js +2 -0
  15. package/dist/chunk-LWADHMVV.js +5 -0
  16. package/dist/chunk-N725IUO7.js +18 -0
  17. package/dist/chunk-N7DBENH4.js +10 -0
  18. package/dist/chunk-NVGFWMCO.js +1 -0
  19. package/dist/chunk-SYTWKJPJ.cjs +18 -0
  20. package/dist/chunk-YI6JXF7U.js +18 -0
  21. package/dist/contracts/document.d.cts +6 -1
  22. package/dist/contracts/document.d.ts +6 -1
  23. package/dist/contracts/editor.d.cts +6 -6
  24. package/dist/contracts/editor.d.ts +6 -6
  25. package/dist/contracts/interaction.d.cts +6 -6
  26. package/dist/contracts/interaction.d.ts +6 -6
  27. package/dist/contracts/modules.d.cts +3 -4
  28. package/dist/contracts/modules.d.ts +3 -4
  29. package/dist/{custom-node-writes-QyVZdTUA.d.ts → custom-node-writes-BvpWCnW8.d.ts} +52 -5
  30. package/dist/{custom-node-writes-7ERv0f_X.d.cts → custom-node-writes-Db8H6Z3n.d.cts} +52 -5
  31. package/dist/{editor-PUlv5Pp7.d.ts → editor-C0my6Uta.d.ts} +35 -14
  32. package/dist/{editor-CojjwMmF.d.cts → editor-CwzY2Hcg.d.cts} +35 -14
  33. package/dist/editor.cjs +1 -1
  34. package/dist/editor.css +66 -461
  35. package/dist/editor.d.cts +20 -20
  36. package/dist/editor.d.ts +20 -20
  37. package/dist/editor.js +1 -1
  38. package/dist/{index-oN-v8DQ5.d.ts → index-kID8Ymkp.d.ts} +126 -20
  39. package/dist/{index-DGPSeLI0.d.cts → index-nLFwo_17.d.cts} +126 -20
  40. package/dist/index.cjs +1 -1
  41. package/dist/index.d.cts +13 -13
  42. package/dist/index.d.ts +13 -13
  43. package/dist/index.js +1 -1
  44. package/dist/layout.cjs +1 -1
  45. package/dist/layout.d.cts +357 -310
  46. package/dist/layout.d.ts +357 -310
  47. package/dist/layout.js +1 -1
  48. package/dist/output.cjs +1 -1
  49. package/dist/output.d.cts +6 -6
  50. package/dist/output.d.ts +6 -6
  51. package/dist/output.js +1 -1
  52. package/dist/{review-items-DpsqTHio.d.cts → review-items-CwixiHNe.d.cts} +1 -1
  53. package/dist/{review-items-D5SPFtsO.d.ts → review-items-Dw-8a6Ie.d.ts} +1 -1
  54. package/dist/{review-reads-CP106AHp.d.cts → review-reads-BqkiJTeR.d.cts} +1 -1
  55. package/dist/{review-reads-B2Ji3fVU.d.ts → review-reads-C0u-IKEA.d.ts} +1 -1
  56. package/dist/{semantic-cell-selection-DJPjBWzf.d.cts → semantic-cell-selection-DT9x9WLf.d.cts} +2 -2
  57. package/dist/{semantic-cell-selection-BWhVAk5B.d.ts → semantic-cell-selection-Utrf0lz7.d.ts} +2 -2
  58. package/dist/{semantic-interaction-BjOcDB06.d.cts → semantic-interaction-B6hFRQLy.d.ts} +21 -2
  59. package/dist/{semantic-interaction-Cca1-X_a.d.ts → semantic-interaction-Z0xKQcB4.d.cts} +21 -2
  60. package/dist/{semantic-paint-CufpIQFw.d.ts → semantic-paint-CQEOC0Od.d.cts} +2 -2
  61. package/dist/{semantic-paint-Ur7pAINj.d.cts → semantic-paint-quke354p.d.ts} +2 -2
  62. package/dist/{semantic-records-C3Z76KeN.d.cts → semantic-records-CMakzQ1X.d.cts} +36 -4
  63. package/dist/{semantic-records-Cc1MJrhM.d.ts → semantic-records-Do3-i5oB.d.ts} +36 -4
  64. package/dist/{shaped-measurer-CwlTPDJO.d.ts → shaped-measurer-BxwTUluj.d.ts} +1 -1
  65. package/dist/{shaped-measurer-CYSK20E2.d.cts → shaped-measurer-DzRwWrL5.d.cts} +1 -1
  66. package/dist/store.cjs +1 -1
  67. package/dist/store.d.cts +250 -134
  68. package/dist/store.d.ts +250 -134
  69. package/dist/store.js +1 -1
  70. package/dist/tree-op-revision-attribution-CN06Xshv.d.cts +24 -0
  71. package/dist/tree-op-revision-attribution-CN06Xshv.d.ts +24 -0
  72. package/dist/{tree-op-types-XMVsJSpe.d.ts → tree-op-types-BuOfCrkp.d.ts} +280 -32
  73. package/dist/{tree-op-types-B0-sCtw-.d.cts → tree-op-types-DSJYmf5b.d.cts} +280 -32
  74. package/dist/{tree-session-D945D43B.d.cts → tree-session-contract-ByWx8eew.d.cts} +44 -104
  75. package/dist/{tree-session-DBJgmdmc.d.ts → tree-session-contract-C1dfE9hy.d.ts} +44 -104
  76. package/dist/{tree-store-ClA-qng4.d.ts → tree-store-ASBtz7UB.d.ts} +1 -1
  77. package/dist/{tree-store-C6vc8E_2.d.cts → tree-store-CWOUMGN8.d.cts} +1 -1
  78. package/package.json +2 -2
  79. package/dist/chunk-5VC5HGJA.js +0 -2
  80. package/dist/chunk-A2JIBG75.js +0 -1
  81. package/dist/chunk-DKMKH77K.cjs +0 -5
  82. package/dist/chunk-FWUI7EXG.cjs +0 -15
  83. package/dist/chunk-GZWMLQJO.js +0 -18
  84. package/dist/chunk-IEXDXWTA.cjs +0 -1
  85. package/dist/chunk-IMMAG4QP.cjs +0 -10
  86. package/dist/chunk-JTSNJQFO.js +0 -15
  87. package/dist/chunk-KBCC66CI.js +0 -5
  88. package/dist/chunk-LJ6BY6IU.cjs +0 -18
  89. package/dist/chunk-QDBAXFIK.js +0 -2
  90. package/dist/chunk-RD266XSK.cjs +0 -2
  91. package/dist/chunk-VUJGPCPU.js +0 -10
  92. package/dist/chunk-XMHWBL3K.cjs +0 -2
  93. package/dist/image-resources-DQOiwOuE.d.cts +0 -203
  94. package/dist/image-resources-eZqD_-vC.d.ts +0 -203
@@ -1,5 +1,60 @@
1
+ import { a as OoxmlNode, b as OoxmlElement, r as OoxmlDrawingNode, c as OoxmlPackage, p as OoxmlContentControlNode, q as OoxmlContentControlContentNode, s as OoxmlContentControlEndPropertiesNode, t as OoxmlContentControlPropertiesNode, O as OoxmlPart } from './ooxml-package-CdEy9ufK.js';
1
2
  import { ParagraphTabStop } from './contracts/types.js';
2
- import { a as OoxmlNode, b as OoxmlElement, r as OoxmlDrawingNode, p as OoxmlContentControlNode, q as OoxmlContentControlContentNode, s as OoxmlContentControlEndPropertiesNode, t as OoxmlContentControlPropertiesNode, O as OoxmlPart } from './ooxml-package-CdEy9ufK.js';
3
+ import { a as RevisionAttributionInput, R as RevisionAddress } from './tree-op-revision-attribution-CN06Xshv.js';
4
+
5
+ /**
6
+ * The engine's trust-boundary caps: recursion depth, element counts, and the rest.
7
+ *
8
+ * A caller may LOWER any of these but never raise or disable one — an override of `Infinity`,
9
+ * zero, a negative or `NaN` clamps into `(0, ceiling]` rather than turning the limit off. These
10
+ * are security ceilings, not performance budgets.
11
+ */
12
+ interface ResourceLimits {
13
+ /** Max nested-structure recursion (tables/shapes/SDT/groups). */
14
+ readonly maxRecursionDepth: number;
15
+ /** Max total parsed element count. */
16
+ readonly maxElementCount: number;
17
+ /** Max package part count. */
18
+ readonly maxPartCount: number;
19
+ /** Max total decompressed bytes (zip-bomb guard). */
20
+ readonly maxDecompressedBytes: number;
21
+ /** Max total compressed input bytes. */
22
+ readonly maxCompressedBytes: number;
23
+ /** Max decompressed:compressed ratio per entry. */
24
+ readonly maxCompressionRatio: number;
25
+ /** In-memory chunk budget for streaming/spooling. */
26
+ readonly maxChunkBytes: number;
27
+ /** Max pagination passes before non-convergence is declared. */
28
+ readonly maxPaginationPasses: number;
29
+ /** Max queued items in any bounded work queue. */
30
+ readonly maxQueueDepth: number;
31
+ }
32
+ /** Non-disableable hard ceilings: no resolved limit may exceed these. */
33
+ declare const HARD_CEILINGS: ResourceLimits;
34
+ /** Finite defaults, all <= their hard ceiling. */
35
+ declare const DEFAULT_LIMITS: ResourceLimits;
36
+ /**
37
+ * Resolve caller overrides into a frozen, always-finite limit set. Each value is
38
+ * `min(override>0 ? override : default, ceiling)`. Infinity/0/negative/NaN can
39
+ * never disable a limit — the hard ceiling always wins.
40
+ */
41
+ declare function resolveLimits(overrides?: Partial<ResourceLimits>): ResourceLimits;
42
+ /** Bounded image decode limits (typed-drawings-and-images task 4). */
43
+ /** Trust-boundary caps specific to image decoding and embedding. */
44
+ interface ImageResourceLimits {
45
+ readonly maxEncodedBytes: number;
46
+ readonly maxDecodedBytes: number;
47
+ readonly maxPixels: number;
48
+ readonly maxDimension: number;
49
+ readonly maxPolygonPoints: number;
50
+ readonly maxExternalRedirects: number;
51
+ }
52
+ /** Image caps nothing can raise past. A caller's override clamps into these. */
53
+ declare const IMAGE_RESOURCE_HARD_CEILINGS: ImageResourceLimits;
54
+ /** The image caps in force when a host configures none. Conservative and finite. */
55
+ declare const DEFAULT_IMAGE_RESOURCE_LIMITS: ImageResourceLimits;
56
+ /** Resolve caller overrides into frozen image limits; hard ceilings cannot be raised. */
57
+ declare function resolveImageResourceLimits(overrides?: Partial<ImageResourceLimits>): ImageResourceLimits;
3
58
 
4
59
  /** The relationship namespace `r:id` lives in. */
5
60
  declare const OFFICE_RELATIONSHIP_NAMESPACE_URI = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
@@ -328,6 +383,151 @@ declare function projectDrawing(drawing: OoxmlDrawingNode, context: Readonly<{
328
383
  resolveRelationship?: RelationshipTargetResolver;
329
384
  }>): DrawingProjection | null;
330
385
 
386
+ /** Opaque handle — bytes are reachable only through {@link mintValidatedImageBytes}. */
387
+ interface ValidatedImageBytesHandle {
388
+ readonly registryId: number;
389
+ readonly resourceKey: string;
390
+ readonly contentId: string;
391
+ readonly generation: number;
392
+ }
393
+
394
+ /**
395
+ * Raster media the decode port measures and any authoring path may write.
396
+ *
397
+ * BMP and WebP are here for the same reason the other three are: an `<img>` decodes them
398
+ * natively, so they need a signature and a structural header and nothing else. BMP is what
399
+ * older documents carry; WebP is what current Word writes.
400
+ */
401
+ type SupportedImageMime = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/bmp' | 'image/webp';
402
+ /**
403
+ * Vector media painted straight from validated bytes. An `<img>` renders SVG in the
404
+ * browser's secure static mode — no script, no external subresource loads — so there is
405
+ * no decode step and no raster buffer sized by a file-supplied number.
406
+ */
407
+ type VectorImageMime = 'image/svg+xml';
408
+ /** Every mime the painter can hand to an `<img>`. */
409
+ type RenderableImageMime = SupportedImageMime | VectorImageMime;
410
+ /**
411
+ * Media kept in the package byte-for-byte that the painter cannot hand to an `<img>`.
412
+ * A decode port may rasterize it; without one it paints as a labelled placeholder.
413
+ */
414
+ type PreservedImageMime = 'image/tiff' | 'image/x-emf' | 'image/x-wmf';
415
+ /**
416
+ * What is known about one embedded image: validated, refused, or still decoding.
417
+ *
418
+ * Content type is a CLAIM. Signature sniffing, structural header validation and the decode port
419
+ * are authoritative, and bytes that fail them never enter public state.
420
+ */
421
+ type ImageResourceState = {
422
+ readonly kind: 'ready';
423
+ readonly partName: string;
424
+ readonly contentId: string;
425
+ readonly resourceKey: string;
426
+ readonly validatedHandle: ValidatedImageBytesHandle;
427
+ readonly mime: RenderableImageMime;
428
+ readonly pixelWidth: number;
429
+ readonly pixelHeight: number;
430
+ readonly dpiX: number;
431
+ readonly dpiY: number;
432
+ } | {
433
+ readonly kind: 'unrenderable';
434
+ readonly partName: string | null;
435
+ readonly mime: RenderableImageMime | PreservedImageMime | 'unknown';
436
+ readonly reason: 'unsupported-format' | 'non-picture-graphic' | 'signature-mismatch' | 'decode-failed' | 'resource-limit';
437
+ } | {
438
+ readonly kind: 'external';
439
+ readonly relationshipId: string;
440
+ readonly sinkSafe: boolean;
441
+ } | {
442
+ readonly kind: 'missing';
443
+ readonly relationshipId: string;
444
+ } | {
445
+ readonly kind: 'pending';
446
+ readonly resourceKey: string;
447
+ };
448
+ /**
449
+ * The injected image decoder.
450
+ *
451
+ * A port rather than a direct `Image`/`createImageBitmap` call, so a worker or server runtime
452
+ * supplies its own and the engine never reaches for a browser global.
453
+ */
454
+ interface ImageDecodePort {
455
+ decode(bytes: Uint8Array, mime: SupportedImageMime, limits: ImageResourceLimits): Promise<Readonly<{
456
+ pixelWidth: number;
457
+ pixelHeight: number;
458
+ dpiX: number;
459
+ dpiY: number;
460
+ }>>;
461
+ /**
462
+ * Optional conversion of media an `<img>` cannot render (EMF/WMF metafiles, TIFF) into a
463
+ * renderable raster. The returned bytes are untrusted and re-enter the full raster
464
+ * validation path (sniff, header, pixel caps, decode) before they can become a ready
465
+ * resource. A null return declines the format and keeps the labelled placeholder; so does
466
+ * a throw, as `decode-failed`.
467
+ */
468
+ convertPreserved?(bytes: Uint8Array, mime: PreservedImageMime, limits: ImageResourceLimits): Promise<Readonly<{
469
+ bytes: Uint8Array;
470
+ mime: SupportedImageMime;
471
+ }> | null>;
472
+ }
473
+ /** Resolves a relationship id to a validated image resource, or reports why it could not. */
474
+ interface ImageResourceLookup {
475
+ readonly resolveEmbedded: (ownerPartName: string, relationshipId: string) => Promise<ImageResourceState>;
476
+ readonly resolveLinked: (ownerPartName: string, relationshipId: string) => ImageResourceState;
477
+ readonly resolveForProjection: (projection: DrawingProjection) => Promise<ImageResourceState>;
478
+ readonly liveReferenceCount: (partName: string) => number;
479
+ readonly dispose: () => void;
480
+ }
481
+ /** Maximum prefix inspected for SVG root detection (exported for bounded-scan tests). */
482
+ declare const MAX_SVG_SNIFF_BYTES = 512;
483
+ /** A raster header that passed structural validation: its real MIME type and pixel extent. */
484
+ interface ValidatedRasterHeader {
485
+ readonly pixelWidth: number;
486
+ readonly pixelHeight: number;
487
+ }
488
+ /** Bounded scan for an `<svg` document root (optional `<?xml` prolog only). */
489
+ declare function hasBoundedSvgRoot(bytes: Uint8Array): boolean;
490
+ /** Signature sniffing — authoritative over declared content type. */
491
+ declare function sniffImageMime(bytes: Uint8Array): RenderableImageMime | PreservedImageMime | 'unknown';
492
+ /** Structural PNG IHDR validation before decode. */
493
+ declare function validatePngHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
494
+ /** Structural GIF logical screen descriptor validation before decode. */
495
+ declare function validateGifHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
496
+ /** Bounded JPEG marker scan through the first supported SOF marker. */
497
+ declare function validateJpegHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
498
+ /**
499
+ * Intrinsic size of an SVG, resolved the way a browser sizes one: absolute `width`/`height`
500
+ * first, then `viewBox` for the missing axis or ratio, then the CSS 300x150 default.
501
+ *
502
+ * This is metadata for insert and reset-to-natural-size only. Layout uses the authored
503
+ * `wp:extent` and the browser rasterizes into that box, so nothing here sizes an allocation
504
+ * and an out-of-range value is clamped rather than refused.
505
+ */
506
+ declare function resolveSvgIntrinsicSize(bytes: Uint8Array, limits: ImageResourceLimits): ValidatedRasterHeader | null;
507
+ /**
508
+ * Validate a raster image's header structurally and report its real MIME type and extent.
509
+ *
510
+ * Content type is a CLAIM; this is what makes it a fact. A file declaring `image/png` over JPEG
511
+ * bytes is caught here rather than at decode.
512
+ */
513
+ declare function validateRasterHeader(bytes: Uint8Array, mime: SupportedImageMime): ValidatedRasterHeader | null;
514
+ /** Package-wide live drawing references to a media part name. */
515
+ declare function liveDrawingReferenceCount(pkg: OoxmlPackage, partName: string): number;
516
+ /** How the image cache decodes, and what it will spend doing so. */
517
+ interface CreateImageResourceCacheOptions {
518
+ readonly limits?: Partial<ImageResourceLimits>;
519
+ readonly decodePort: ImageDecodePort;
520
+ }
521
+ /**
522
+ * Derived cache for one immutable package snapshot. Registry identity is
523
+ * `(package snapshot, decodePort object, normalized limits)` — the first caller
524
+ * never imposes its decoder or limits on later callers with different options.
525
+ */
526
+ declare function imageResourceLookupFor(pkg: OoxmlPackage, options: CreateImageResourceCacheOptions): ImageResourceLookup;
527
+ /** @deprecated Prefer {@link imageResourceLookupFor} — registry binds cache to package identity. */
528
+ /** Build the per-document image cache. Validated bytes only; refusals are remembered too. */
529
+ declare function createImageResourceCache(initialPkg: OoxmlPackage, options: CreateImageResourceCacheOptions): ImageResourceLookup;
530
+
331
531
  /** How deep controls may nest before a walk stops descending. Shared by every lane. */
332
532
  declare const MAX_CONTENT_CONTROL_NESTING = 32;
333
533
  /** Cap on controls one walk reports, so a hostile file cannot make a read unbounded. */
@@ -649,32 +849,7 @@ interface OoxmlProperty {
649
849
  readonly localName: string;
650
850
  readonly attributes?: Readonly<Record<string, string>>;
651
851
  }
652
- /**
653
- * The identity of one revision WITHIN a part: `@w:id`, `@w:author` and `@w:date` together.
654
- *
655
- * `@w:id` is not unique and not author-scoped, so `(part, id)` alone would merge two authors'
656
- * distinct revisions; and one logical revision — a tracked row insertion — is deliberately
657
- * many elements sharing an id, which a uniqueness rule could not express at all.
658
- */
659
- /**
660
- * How a tracked change is addressed: its numeric id plus the PART it lives in.
661
- *
662
- * Both, always — `@w:id` is unique only within a part, so an id alone names two revisions in any
663
- * package with a header or a comments part.
664
- */
665
- interface RevisionAddress {
666
- readonly id: string;
667
- readonly author: string;
668
- /** Absent when the file wrote no `@w:date`; part of the identity either way. */
669
- readonly date?: string;
670
- }
671
- /** Who a tracked edit is attributed to. `CT_TrackChange` requires an author. */
672
- /** The author and timestamp a tracked edit is recorded under. */
673
- interface RevisionAttributionInput {
674
- readonly author: string;
675
- /** ISO-8601. Omitted writes no `@w:date`. */
676
- readonly date?: string;
677
- }
852
+
678
853
  /**
679
854
  * Every mutation the store accepts, as one JSON-safe discriminated union.
680
855
  *
@@ -815,14 +990,20 @@ type TreeDocOp = {
815
990
  readonly op: 'insertTab';
816
991
  readonly paragraphId: string;
817
992
  readonly offset: number;
993
+ /** Write this as a TRACKED insertion, on the same terms as `insertText`. */
994
+ readonly revision?: RevisionAttributionInput;
818
995
  } | {
819
996
  readonly op: 'insertHardBreak';
820
997
  readonly paragraphId: string;
821
998
  readonly offset: number;
999
+ /** Write this as a TRACKED insertion, on the same terms as `insertText`. */
1000
+ readonly revision?: RevisionAttributionInput;
822
1001
  } | {
823
1002
  readonly op: 'insertPageBreak';
824
1003
  readonly paragraphId: string;
825
1004
  readonly offset: number;
1005
+ /** Write this as a TRACKED insertion, on the same terms as `insertText`. */
1006
+ readonly revision?: RevisionAttributionInput;
826
1007
  } | {
827
1008
  /**
828
1009
  * Insert an allowlisted page-number complex field at a UTF-16 offset.
@@ -834,6 +1015,14 @@ type TreeDocOp = {
834
1015
  readonly paragraphId: string;
835
1016
  readonly offset: number;
836
1017
  readonly field: 'PAGE' | 'NUMPAGES' | 'SECTIONPAGES' | 'PAGE_X_OF_Y';
1018
+ /**
1019
+ * Write this as a TRACKED insertion, on the same terms as `insertText`.
1020
+ *
1021
+ * The whole field — every `w:fldChar`, the instruction, the `PAGE_X_OF_Y` literal —
1022
+ * goes into ONE `w:ins`, because the field is one proposal: rejecting it must take
1023
+ * the complete atom back, never leave a `begin` standing without its `end`.
1024
+ */
1025
+ readonly revision?: RevisionAttributionInput;
837
1026
  } | {
838
1027
  /**
839
1028
  * Move a numbered paragraph to another `w:numPr/w:ilvl`.
@@ -863,6 +1052,8 @@ type TreeDocOp = {
863
1052
  readonly op: 'setParagraphMarkProperties';
864
1053
  readonly paragraphId: string;
865
1054
  readonly properties: readonly OoxmlProperty[];
1055
+ /** Record this as a TRACKED format change (`w:pPr/w:rPr/w:rPrChange`, §17.13.5.31). */
1056
+ readonly revision?: RevisionAttributionInput;
866
1057
  } | {
867
1058
  readonly op: 'setListNumbering';
868
1059
  readonly paragraphId: string;
@@ -895,6 +1086,16 @@ type TreeDocOp = {
895
1086
  readonly op: 'splitParagraph';
896
1087
  readonly paragraphId: string;
897
1088
  readonly offset: number;
1089
+ /**
1090
+ * The `w:pStyle` the MINTED tail takes, instead of the head's own.
1091
+ *
1092
+ * A split otherwise clones the whole `w:pPr`, which is right for every property but
1093
+ * the style when the caller is an Enter at the end of a paragraph: Word gives that
1094
+ * new paragraph the style's `w:next`, so a heading is followed by body text rather
1095
+ * than by a second heading. `null` authors no `w:pStyle` at all, which is what the
1096
+ * document's default style is spelled as. Omit to clone the head's style unchanged.
1097
+ */
1098
+ readonly tailStyleId?: string | null;
898
1099
  } | {
899
1100
  /**
900
1101
  * Split one `w:p` at MANY offsets in a single op.
@@ -930,6 +1131,11 @@ type TreeDocOp = {
930
1131
  readonly start: number;
931
1132
  readonly end: number;
932
1133
  readonly properties: readonly OoxmlProperty[];
1134
+ /**
1135
+ * Record this as a TRACKED format change: each run keeps its new `w:rPr` and gains a
1136
+ * `w:rPrChange` (§17.13.5.30) holding the properties it had, so Reject restores them.
1137
+ */
1138
+ readonly revision?: RevisionAttributionInput;
933
1139
  /**
934
1140
  * When set, format only these runs (field result ownership). Offset range still
935
1141
  * gates the edit and drives edge splits; without this, multi-run field results that
@@ -940,6 +1146,8 @@ type TreeDocOp = {
940
1146
  readonly op: 'setParagraphProperties';
941
1147
  readonly paragraphId: string;
942
1148
  readonly properties: readonly OoxmlProperty[];
1149
+ /** Record this as a TRACKED format change (`w:pPrChange`, §17.13.5.29). */
1150
+ readonly revision?: RevisionAttributionInput;
943
1151
  } | {
944
1152
  /**
945
1153
  * Set page-setup fields — page size, orientation, margins — on every targeted
@@ -969,11 +1177,20 @@ type TreeDocOp = {
969
1177
  /**
970
1178
  * End a section AT this paragraph: mint a `w:pPr/w:sectPr` cloning the governing
971
1179
  * section's effective page setup, so the blocks up to and including this paragraph
972
- * become their own section (a next-page section break). The paragraph must not
973
- * already carry one.
1180
+ * become their own section. The paragraph must not already carry one.
974
1181
  */
975
1182
  readonly op: 'setSectionMark';
976
1183
  readonly paragraphId: string;
1184
+ /**
1185
+ * Where the section that STARTS after this mark begins — Word's Breaks menu.
1186
+ *
1187
+ * `w:type` states how a section starts relative to the previous one (§17.6.22), so it
1188
+ * is written on the section FOLLOWING the mark, never on the minted one, which keeps
1189
+ * the cloned type because it starts where the section it was cut from did. `'nextPage'`
1190
+ * clears `w:type` (absent IS nextPage), so a next-page break inside a continuous
1191
+ * section really starts a page. Omitted leaves the following section untouched.
1192
+ */
1193
+ readonly breakType?: 'nextPage' | 'continuous';
977
1194
  } | {
978
1195
  /**
979
1196
  * Wrap `[start, end)` of a paragraph in a `w:hyperlink`.
@@ -1255,6 +1472,13 @@ type TreeDocOp = {
1255
1472
  readonly noteKind: 'footnote' | 'endnote';
1256
1473
  readonly paragraphId: string;
1257
1474
  readonly offset: number;
1475
+ /**
1476
+ * Write the citing REFERENCE as a tracked insertion (`w:ins` around the reference
1477
+ * run), on the same terms as `insertText`. The note body itself is not revision
1478
+ * markup: rejecting the reference removes it, and the body cascade sweeps the
1479
+ * orphaned note exactly as an untracked reference deletion does.
1480
+ */
1481
+ readonly revision?: RevisionAttributionInput;
1258
1482
  } | {
1259
1483
  /**
1260
1484
  * Delete a note body and every matching reference (body, HF, other notes).
@@ -1345,11 +1569,29 @@ type TreeDocOp = {
1345
1569
  readonly position?: string;
1346
1570
  readonly numStart?: number;
1347
1571
  };
1572
+ } | {
1573
+ /**
1574
+ * Insert clipboard-fragment blocks at a paragraph position, atomically.
1575
+ *
1576
+ * Blocks only — resources (styles, numbering, media, rels, note parts) merge through
1577
+ * the package-edit path in the same transaction, and the whole commit is promoted to
1578
+ * a package undo unit. A merged edge paragraph takes the properties of the paragraph
1579
+ * mark that ends it: the fragment's first mark leading, the host's original mark
1580
+ * trailing. Nodes receive fresh ids at apply.
1581
+ */
1582
+ readonly op: 'insertFragment';
1583
+ readonly paragraphId: string;
1584
+ readonly offset: number;
1585
+ readonly blocks: readonly OoxmlNode[];
1586
+ /** True when the fragment's last paragraph mark travelled (its paragraph stays whole). */
1587
+ readonly lastMarkCovered?: boolean;
1348
1588
  } | {
1349
1589
  readonly op: 'insertDrawing';
1350
1590
  readonly paragraphId: string;
1351
1591
  readonly offset: number;
1352
1592
  readonly drawing: OoxmlDrawingNode;
1593
+ /** Present in suggesting mode: the drawing's run goes into a `w:ins` as one proposal. */
1594
+ readonly revision?: RevisionAttributionInput;
1353
1595
  } | {
1354
1596
  readonly op: 'replaceDrawingResource';
1355
1597
  readonly drawingNodeId: string;
@@ -1430,7 +1672,7 @@ type DrawingTreeDocOp = Extract<TreeDocOp, {
1430
1672
  /** Just the `op` discriminants, for dispatch tables and validation. */
1431
1673
  type TreeDocOpKind = TreeDocOp['op'];
1432
1674
  /** Every {@link TreeDocOpKind}, for validation and exhaustiveness checks. */
1433
- declare const TREE_DOC_OP_KINDS: readonly ["replaceStoryBlocks", "insertText", "deleteText", "setParagraphMarkRevision", "proposeParagraphMerge", "insertCommentMarker", "acceptRevision", "rejectRevision", "acceptAllRevisions", "rejectAllRevisions", "insertTab", "insertHardBreak", "insertPageBreak", "insertPageField", "setListLevel", "setListNumbering", "setParagraphTabStops", "setParagraphMarkProperties", "splitParagraph", "splitParagraphMany", "joinParagraphs", "setRunProperties", "setParagraphProperties", "setSectionProperties", "setSectionMark", "insertHyperlink", "setHyperlinkTarget", "removeHyperlink", "setMathEquation", "removeMathEquation", "setContentControlValue", "removeContentControl", "insertInlineContentControl", "addRepeatingSectionItem", "removeRepeatingSectionItem", "deleteBlock", "insertTable", "insertTableRow", "deleteTableRow", "insertTableColumn", "deleteTableColumn", "setTableColumnWidths", "setTableRightEdgeWidth", "setTableRowHeight", "setTableCellBorders", "setTableCellFill", "setTableCellVerticalAlignment", "createHeaderFooter", "deleteHeaderFooter", "linkToPrevious", "unlinkFromPrevious", "setSectionFurnitureOptions", "insertNote", "deleteNote", "convertNote", "convertAllNotes", "setNoteProperties", "setContentControlProperties", "insertContentControl", "insertDrawing", "replaceDrawingResource", "deleteDrawing", "resizeDrawing", "cropDrawing", "positionDrawing", "setDrawingWrap", "setDrawingMetadata", "setDrawingLocks", "transformDrawing", "insertToc", "replaceTocResult", "rewriteTocPageNumbers"];
1675
+ declare const TREE_DOC_OP_KINDS: readonly ["replaceStoryBlocks", "insertText", "deleteText", "setParagraphMarkRevision", "proposeParagraphMerge", "insertCommentMarker", "acceptRevision", "rejectRevision", "acceptAllRevisions", "rejectAllRevisions", "insertTab", "insertHardBreak", "insertPageBreak", "insertPageField", "setListLevel", "setListNumbering", "setParagraphTabStops", "setParagraphMarkProperties", "splitParagraph", "splitParagraphMany", "joinParagraphs", "setRunProperties", "setParagraphProperties", "setSectionProperties", "setSectionMark", "insertHyperlink", "setHyperlinkTarget", "removeHyperlink", "setMathEquation", "removeMathEquation", "setContentControlValue", "removeContentControl", "insertInlineContentControl", "addRepeatingSectionItem", "removeRepeatingSectionItem", "deleteBlock", "insertTable", "insertTableRow", "deleteTableRow", "insertTableColumn", "deleteTableColumn", "setTableColumnWidths", "setTableRightEdgeWidth", "setTableRowHeight", "setTableCellBorders", "setTableCellFill", "setTableCellVerticalAlignment", "createHeaderFooter", "deleteHeaderFooter", "linkToPrevious", "unlinkFromPrevious", "setSectionFurnitureOptions", "insertNote", "deleteNote", "convertNote", "convertAllNotes", "setNoteProperties", "setContentControlProperties", "insertContentControl", "insertFragment", "insertDrawing", "replaceDrawingResource", "deleteDrawing", "resizeDrawing", "cropDrawing", "positionDrawing", "setDrawingWrap", "setDrawingMetadata", "setDrawingLocks", "transformDrawing", "insertToc", "replaceTocResult", "rewriteTocPageNumbers"];
1434
1676
  /**
1435
1677
  * How far a committed op can reach, so layout can scope its work (task 5.2).
1436
1678
  *
@@ -1553,7 +1795,13 @@ type TreeOpRejection = 'unknown-op' | 'unknown-paragraph' | 'not-a-paragraph' |
1553
1795
  /** Suggesting-mode drawing deletion is not implemented in this change. */
1554
1796
  | 'trackedDrawingDeletionUnsupported'
1555
1797
  /** Hyperlink target creation or change needs an OPC relationship in a package transaction. */
1556
- | 'packageTransactionRequired';
1798
+ | 'packageTransactionRequired'
1799
+ /** A clipboard fragment block nests deeper than the recursion cap. */
1800
+ | 'fragment-too-deep'
1801
+ /** A clipboard fragment block is not a paragraph, table, or content control subtree. */
1802
+ | 'fragment-invalid-block'
1803
+ /** A clipboard fragment exceeds its block or node budget. */
1804
+ | 'fragment-resource-budget';
1557
1805
  /** Whether an op applied, with the effect it produced or the reason it was refused. */
1558
1806
  type TreeOpResult = {
1559
1807
  readonly ok: true;
@@ -1565,4 +1813,4 @@ type TreeOpResult = {
1565
1813
  readonly detail?: string;
1566
1814
  };
1567
1815
 
1568
- export { contentControlPropertiesOf as $, ACCEPTED_PARAGRAPH_PROPERTIES as A, type HyperlinkKind as B, type ContentControlKind as C, type DrawingProjection as D, type HyperlinkTarget as E, MAX_CONTENT_CONTROL_NESTING as F, OFFICE_RELATIONSHIP_NAMESPACE_URI as G, HYPERLINK_RELATIONSHIP_TYPE as H, type ImpactClass as I, type RelationshipTargetResolver as J, TABLE_BORDER_STYLES as K, TREE_DOC_OP_KINDS as L, MAX_CONTENT_CONTROLS_PER_PART as M, type TabStopWrite as N, type OoxmlProperty as O, type TreeDocOpKind as P, type TreeOpEffect as Q, type RevisionAddress as R, type SourceCrop as S, type TreeDocOp as T, allocateContentControlId as U, type VectorShapeProjection as V, contentControlContentChildren as W, contentControlContentNodeOf as X, contentControlEndPropertiesNodeOf as Y, contentControlLevelOf as Z, contentControlPropertiesNodeOf as _, type TreeOpRejection as a, contentControlTextOf as a0, contentControlsIn as a1, findContentControl as a2, flattenContentControls as a3, hyperlinkAnchorOf as a4, hyperlinkRelationshipIdOf as a5, hyperlinkTargetOf as a6, isContentControlContentNode as a7, isContentControlNode as a8, isContentControlWrapper as a9, isHyperlinkNode as aa, lockForbidsEdit as ab, lockForbidsRemoval as ac, orderedContentControlProperties as ad, parseContentControlId as ae, projectDrawing as af, resolveContentControlLock as ag, type ImageWrapTarget as b, type DrawingKind as c, type DrawingPositionInput as d, type DrawingLocks as e, type DrawingHorizontalReferenceFrame as f, type DrawingVerticalReferenceFrame as g, type DrawingTreeDocOp as h, type TreeDocColorValue as i, IMAGE_WRAP_TARGETS as j, type DrawingAccessibility as k, type DrawingTransform as l, type TableBorderStyle as m, type ContentControlLevel as n, type ContentControlLock as o, type ContentControlDataBinding as p, type TreeOpResult as q, ACCEPTED_RUN_PROPERTIES as r, CONTENT_CONTROL_ID_MAX as s, CONTENT_CONTROL_PROPERTY_ORDER as t, type ContentControlCheckbox as u, type ContentControlCheckboxState as v, type ContentControlDateFormat as w, type ContentControlEntry as x, type ContentControlListItem as y, type ContentControlProperties as z };
1816
+ export { type HyperlinkTarget as $, type ContentControlDataBinding as A, type ResourceLimits as B, type ContentControlKind as C, type DrawingKind as D, type TreeOpResult as E, ACCEPTED_PARAGRAPH_PROPERTIES as F, ACCEPTED_RUN_PROPERTIES as G, CONTENT_CONTROL_ID_MAX as H, type ImpactClass as I, CONTENT_CONTROL_PROPERTY_ORDER as J, type ContentControlCheckbox as K, type ContentControlCheckboxState as L, type ContentControlDateFormat as M, type ContentControlEntry as N, type OoxmlProperty as O, type PreservedImageMime as P, type ContentControlListItem as Q, type RenderableImageMime as R, type SourceCrop as S, type TreeDocOp as T, type ContentControlProperties as U, type ValidatedImageBytesHandle as V, type CreateImageResourceCacheOptions as W, DEFAULT_LIMITS as X, HARD_CEILINGS as Y, HYPERLINK_RELATIONSHIP_TYPE as Z, type HyperlinkKind as _, type TreeOpRejection as a, IMAGE_RESOURCE_HARD_CEILINGS as a0, type ImageResourceLookup as a1, MAX_CONTENT_CONTROLS_PER_PART as a2, MAX_CONTENT_CONTROL_NESTING as a3, MAX_SVG_SNIFF_BYTES as a4, OFFICE_RELATIONSHIP_NAMESPACE_URI as a5, type RelationshipTargetResolver as a6, TABLE_BORDER_STYLES as a7, TREE_DOC_OP_KINDS as a8, type TabStopWrite as a9, lockForbidsRemoval as aA, orderedContentControlProperties as aB, parseContentControlId as aC, projectDrawing as aD, resolveContentControlLock as aE, resolveLimits as aF, validateGifHeader as aG, validateJpegHeader as aH, validatePngHeader as aI, type TreeDocOpKind as aa, type TreeOpEffect as ab, type ValidatedRasterHeader as ac, allocateContentControlId as ad, contentControlContentChildren as ae, contentControlContentNodeOf as af, contentControlEndPropertiesNodeOf as ag, contentControlLevelOf as ah, contentControlPropertiesNodeOf as ai, contentControlPropertiesOf as aj, contentControlTextOf as ak, contentControlsIn as al, createImageResourceCache as am, findContentControl as an, flattenContentControls as ao, hasBoundedSvgRoot as ap, hyperlinkAnchorOf as aq, hyperlinkRelationshipIdOf as ar, hyperlinkTargetOf as as, imageResourceLookupFor as at, isContentControlContentNode as au, isContentControlNode as av, isContentControlWrapper as aw, isHyperlinkNode as ax, liveDrawingReferenceCount as ay, lockForbidsEdit as az, type ImageWrapTarget as b, type SupportedImageMime as c, type DrawingPositionInput as d, type DrawingLocks as e, type ImageResourceState as f, type DrawingHorizontalReferenceFrame as g, type DrawingVerticalReferenceFrame as h, type VectorImageMime as i, type ImageDecodePort as j, type DrawingTreeDocOp as k, type TreeDocColorValue as l, DEFAULT_IMAGE_RESOURCE_LIMITS as m, IMAGE_WRAP_TARGETS as n, type ImageResourceLimits as o, resolveSvgIntrinsicSize as p, type DrawingAccessibility as q, resolveImageResourceLimits as r, sniffImageMime as s, type DrawingTransform as t, type VectorShapeProjection as u, validateRasterHeader as v, type DrawingProjection as w, type TableBorderStyle as x, type ContentControlLevel as y, type ContentControlLock as z };