@docx-editor.dev/core 2.4.1 → 2.6.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.
- package/THIRD_PARTY_NOTICES.md +39 -1
- package/dist/automation.cjs +1 -1
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.cts +8 -8
- package/dist/binding.d.ts +8 -8
- package/dist/binding.js +1 -1
- package/dist/chunk-4GQXAXTZ.js +5 -0
- package/dist/chunk-DGUHCJPF.cjs +18 -0
- package/dist/chunk-DY3QVCWC.cjs +10 -0
- package/dist/chunk-E7BXJ4BF.js +1 -0
- package/dist/chunk-F7Z6PWAZ.cjs +2 -0
- package/dist/chunk-IJ4V3LGV.cjs +2 -0
- package/dist/chunk-JEMP5YI5.cjs +15 -0
- package/dist/{chunk-YMIMLEX4.cjs → chunk-JZXK4DKV.cjs} +1 -1
- package/dist/chunk-NIGGABAA.js +15 -0
- package/dist/chunk-OPKOTVQQ.js +18 -0
- package/dist/{chunk-GOEBQ26R.js → chunk-PSZH2VXP.js} +1 -1
- package/dist/chunk-R75OLPL6.js +10 -0
- package/dist/chunk-SFMAIFEN.cjs +2 -0
- package/dist/chunk-SKWYEZCO.cjs +5 -0
- package/dist/chunk-SMRD66T5.js +2 -0
- package/dist/chunk-UVIUNAQ6.js +2 -0
- package/dist/chunk-WAVN7MAT.js +2 -0
- package/dist/chunk-WU7PUTVA.js +2 -0
- package/dist/{chunk-OHJQ7GPZ.cjs → chunk-YMYCPY5Y.cjs} +1 -1
- package/dist/contracts/editor.cjs +1 -1
- package/dist/contracts/editor.d.cts +8 -8
- package/dist/contracts/editor.d.ts +8 -8
- package/dist/contracts/editor.js +1 -1
- package/dist/contracts/interaction.d.cts +7 -7
- package/dist/contracts/interaction.d.ts +7 -7
- package/dist/contracts/modules.d.cts +4 -4
- package/dist/contracts/modules.d.ts +4 -4
- package/dist/contracts/types.d.cts +3 -1
- package/dist/contracts/types.d.ts +3 -1
- package/dist/{custom-node-writes-C5YRoPcc.d.cts → custom-node-writes-D9G3GKQ7.d.cts} +18 -3
- package/dist/{custom-node-writes-BkMgMXxs.d.ts → custom-node-writes-tJw8U9MO.d.ts} +18 -3
- package/dist/dist-YFULGVS3.js +2 -0
- package/dist/{editor-DYvC9CZs.d.cts → editor-BZEJL3vv.d.cts} +50 -19
- package/dist/{editor-D1qHfzOt.d.ts → editor-D2zOJztO.d.ts} +50 -19
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +407 -38
- package/dist/editor.d.cts +38 -22
- package/dist/editor.d.ts +38 -22
- package/dist/editor.js +1 -1
- package/dist/harfbuzz.wasm +0 -0
- package/dist/{image-resources-DXvPZvXD.d.cts → image-resources-BaHz4QAd.d.cts} +1 -1
- package/dist/{image-resources-BG9DLyW7.d.ts → image-resources-Cl5_cNi9.d.ts} +1 -1
- package/dist/{index-DpY3WZuP.d.ts → index-D8L8WrNF.d.ts} +178 -23
- package/dist/{index-Bb-QAg_f.d.cts → index-_xF7n_z0.d.cts} +178 -23
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.cts +159 -47
- package/dist/layout.d.ts +159 -47
- package/dist/layout.js +1 -1
- package/dist/node-module-shim-TTKTT66I.js +1 -0
- package/dist/output.cjs +1 -1
- package/dist/output.d.cts +20 -6
- package/dist/output.d.ts +20 -6
- package/dist/output.js +1 -1
- package/dist/{review-reads-CxgN62yp.d.cts → review-reads-Dr0CpW6u.d.cts} +25 -1
- package/dist/{review-reads-CQmU9Lcl.d.ts → review-reads-HDvoQXK2.d.ts} +25 -1
- package/dist/{review-support-DgXTIYBW.d.ts → review-support-D4ZBdUXa.d.ts} +46 -2
- package/dist/{review-support-BJ-YjGmD.d.cts → review-support-T-riLz4Y.d.cts} +46 -2
- package/dist/{revision-projection-DHAkcD_L.d.ts → revision-projection-UKqvPa4-.d.ts} +53 -2
- package/dist/{revision-projection-72ZApe-g.d.cts → revision-projection-WzlQGBJx.d.cts} +53 -2
- package/dist/{semantic-cell-selection-DZtyMXkH.d.ts → semantic-cell-selection-B5vfPz4Q.d.ts} +7 -4
- package/dist/{semantic-cell-selection--ezfezTe.d.cts → semantic-cell-selection-BTQFpN0S.d.cts} +7 -4
- package/dist/{semantic-interaction-DrgbgKg6.d.ts → semantic-interaction-CDNEU_Tx.d.cts} +2 -30
- package/dist/{semantic-interaction-2yxdv7q0.d.cts → semantic-interaction-lvpzZRpA.d.ts} +2 -30
- package/dist/{semantic-paint-BedBxkyY.d.ts → semantic-paint-BBPL3u5w.d.ts} +111 -3
- package/dist/{semantic-paint-BYjE0Xbl.d.cts → semantic-paint-IjbL-4CT.d.cts} +111 -3
- package/dist/{semantic-records-CR5hTqMK.d.ts → semantic-records-CdQvpUj1.d.ts} +106 -8
- package/dist/{semantic-records-DSD8WENa.d.cts → semantic-records-DEOs3_tE.d.cts} +106 -8
- package/dist/{shaped-measurer-CBOTJTV_.d.cts → shaped-measurer-C2SJAjV0.d.cts} +1 -1
- package/dist/{shaped-measurer-BL8g4AcW.d.ts → shaped-measurer-l4o5ITJ0.d.ts} +1 -1
- package/dist/store.cjs +1 -1
- package/dist/store.d.cts +38 -15
- package/dist/store.d.ts +38 -15
- package/dist/store.js +1 -1
- package/dist/{tree-op-types-EZXbR8bW.d.cts → tree-op-types-CUCwPWjT.d.cts} +1 -1
- package/dist/{tree-op-types-8a6xyRCN.d.ts → tree-op-types-D0fTNBVW.d.ts} +1 -1
- package/dist/{tree-session-SucW0znF.d.ts → tree-session-CH1oA75f.d.ts} +64 -42
- package/dist/{tree-session-DrMm8Cj2.d.cts → tree-session-b7bggR-S.d.cts} +64 -42
- package/dist/{tree-store-UYrGKF_Q.d.cts → tree-store-BqgeCa1Q.d.cts} +29 -2
- package/dist/{tree-store-BoM6eXaL.d.ts → tree-store-CIKASRHk.d.ts} +29 -2
- package/licenses/HarfBuzz-COPYING.txt +42 -0
- package/package.json +6 -4
- package/dist/chunk-33F6TRXO.js +0 -2
- package/dist/chunk-4WWEDTTE.js +0 -2
- package/dist/chunk-BS554B6D.cjs +0 -2
- package/dist/chunk-DQ5HGUWG.cjs +0 -12
- package/dist/chunk-EQO762XH.cjs +0 -10
- package/dist/chunk-F6WNPYOM.js +0 -2
- package/dist/chunk-FL4GWK76.js +0 -12
- package/dist/chunk-GWG5IVVX.cjs +0 -5
- package/dist/chunk-IZIL6BAW.cjs +0 -12
- package/dist/chunk-LIJPSHRA.js +0 -5
- package/dist/chunk-MHDO6HLI.cjs +0 -2
- package/dist/chunk-SG7OH2EK.js +0 -12
- package/dist/chunk-TCX3PVWR.js +0 -10
- package/dist/chunk-YTYKNA6X.cjs +0 -2
- package/dist/chunk-ZACHY6OS.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { e as OoxmlPart, a as OoxmlElement } from './ooxml-tree-BU0e3DVi.js';
|
|
2
|
-
import { R as RevisionAddress } from './tree-op-types-
|
|
2
|
+
import { R as RevisionAddress } from './tree-op-types-D0fTNBVW.js';
|
|
3
3
|
|
|
4
4
|
/** The `w15` namespace: `commentsExtended.xml` — thread parent and resolved state. */
|
|
5
5
|
declare const W15_NAMESPACE_URI = "http://schemas.microsoft.com/office/word/2012/wordml";
|
|
@@ -101,12 +101,29 @@ interface ReviewRevisionItem {
|
|
|
101
101
|
/** The words a replacement removes. Empty for every other kind. */
|
|
102
102
|
readonly replacedText: string;
|
|
103
103
|
readonly revisionKind: ReviewRevisionKind;
|
|
104
|
+
/**
|
|
105
|
+
* WHICH decision a `paragraphMark` records, absent for every other kind.
|
|
106
|
+
*
|
|
107
|
+
* `EG_ParaRPrTrackChanges` is `ins? del? moveFrom? moveTo?`, and the four say opposite
|
|
108
|
+
* things about one break. Without this a card called a deleted break an inserted one, which
|
|
109
|
+
* is the reverse of what Accept on that card does.
|
|
110
|
+
*/
|
|
111
|
+
readonly markDirection?: 'insert' | 'delete' | 'moveFrom' | 'moveTo';
|
|
104
112
|
readonly author: string;
|
|
105
113
|
readonly date?: string;
|
|
106
114
|
/** Text the revision covers, for the card summary. Empty for changes with no characters. */
|
|
107
115
|
readonly text: string;
|
|
108
116
|
/** Every site this decision touches, in document order. */
|
|
109
117
|
readonly ranges: readonly ReviewRange[];
|
|
118
|
+
/**
|
|
119
|
+
* How deeply this change is NESTED inside other changes, 0 for an unenclosed one.
|
|
120
|
+
*
|
|
121
|
+
* `w:ins` wrapping `w:del` is content one reviewer added and another struck. Both stay
|
|
122
|
+
* pending, so both are cards, over one identical range — and a range then cannot say which
|
|
123
|
+
* change a caret is in. Word treats the innermost as the operative one, so it wins the caret
|
|
124
|
+
* and the change enclosing it stays listed and reachable.
|
|
125
|
+
*/
|
|
126
|
+
readonly nesting: number;
|
|
110
127
|
/**
|
|
111
128
|
* How many leading `ranges` are the STRUCK half of a replacement.
|
|
112
129
|
*
|
|
@@ -321,8 +338,28 @@ interface ReviewParagraphAnchor {
|
|
|
321
338
|
readonly box: {
|
|
322
339
|
readonly y: number;
|
|
323
340
|
};
|
|
341
|
+
/**
|
|
342
|
+
* Present on a real line. A merged fragment's join line carries spans from two
|
|
343
|
+
* paragraphs, and its `range` can only name one of them, so the OTHER paragraph's extent
|
|
344
|
+
* on that line is readable here and nowhere else.
|
|
345
|
+
*/
|
|
346
|
+
readonly spans?: readonly {
|
|
347
|
+
readonly range: {
|
|
348
|
+
readonly paragraphId: string;
|
|
349
|
+
readonly end: number;
|
|
350
|
+
};
|
|
351
|
+
}[];
|
|
324
352
|
}[];
|
|
325
353
|
}
|
|
354
|
+
/**
|
|
355
|
+
* The y of the line a position sits on, measured from the anchor's own origin.
|
|
356
|
+
*
|
|
357
|
+
* An ordinary line answers from its own range, exactly as it always did. On a merged
|
|
358
|
+
* fragment's join line the range names one of the two paragraphs, so an offset compared
|
|
359
|
+
* against it either overshot — putting a card in the absorbed half beside the wrong line —
|
|
360
|
+
* or matched the first line every time.
|
|
361
|
+
*/
|
|
362
|
+
declare function anchorLineY(anchor: ReviewParagraphAnchor, paragraphId: string, offset: number): number;
|
|
326
363
|
/**
|
|
327
364
|
* Paragraph id to its place on the page, in ONE pass over the layout.
|
|
328
365
|
*
|
|
@@ -350,6 +387,13 @@ declare function reviewAnchorIndex<TPage extends {
|
|
|
350
387
|
readonly box: {
|
|
351
388
|
readonly y: number;
|
|
352
389
|
};
|
|
390
|
+
/** Present on a real line; a merged one carries spans from more than one paragraph. */
|
|
391
|
+
readonly spans?: readonly {
|
|
392
|
+
readonly range: {
|
|
393
|
+
readonly paragraphId: string;
|
|
394
|
+
readonly end: number;
|
|
395
|
+
};
|
|
396
|
+
}[];
|
|
353
397
|
}[];
|
|
354
398
|
}[]): Map<string, ReviewParagraphAnchor>;
|
|
355
399
|
/**
|
|
@@ -367,4 +411,4 @@ declare function reviewItemGeometry(item: ReviewItem, index: ReadonlyMap<string,
|
|
|
367
411
|
readonly y: number;
|
|
368
412
|
} | null;
|
|
369
413
|
|
|
370
|
-
export { type CommentRecord as C, type ReviewModelInput as R, W15_NAMESPACE_URI as W, type ReviewItem as a, type ReviewRevisionItem as b, type ReviewCommentItem as c, type ReviewCustomItem as d, type ReviewPosition as e, type ReviewRange as f, type ReviewRevisionKind as g, type CommentAnchor as h, type CommentPosition as i, type CommentThreadState as j, type ReviewParagraphAnchor as k, activeReviewItem as l,
|
|
414
|
+
export { type CommentRecord as C, type ReviewModelInput as R, W15_NAMESPACE_URI as W, type ReviewItem as a, type ReviewRevisionItem as b, type ReviewCommentItem as c, type ReviewCustomItem as d, type ReviewPosition as e, type ReviewRange as f, type ReviewRevisionKind as g, type CommentAnchor as h, type CommentPosition as i, type CommentThreadState as j, type ReviewParagraphAnchor as k, activeReviewItem as l, anchorLineY as m, commentBodyText as n, commentInitials as o, firstReviewRange as p, reviewItemGeometry as q, reviewAnchorIndex as r, reviewItemKey as s, reviewItemPositionRank as t, reviewItemRanges as u, reviewItemsAt as v, reviewThreadRootOf as w };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { e as OoxmlPart, a as OoxmlElement } from './ooxml-tree-BU0e3DVi.cjs';
|
|
2
|
-
import { R as RevisionAddress } from './tree-op-types-
|
|
2
|
+
import { R as RevisionAddress } from './tree-op-types-CUCwPWjT.cjs';
|
|
3
3
|
|
|
4
4
|
/** The `w15` namespace: `commentsExtended.xml` — thread parent and resolved state. */
|
|
5
5
|
declare const W15_NAMESPACE_URI = "http://schemas.microsoft.com/office/word/2012/wordml";
|
|
@@ -101,12 +101,29 @@ interface ReviewRevisionItem {
|
|
|
101
101
|
/** The words a replacement removes. Empty for every other kind. */
|
|
102
102
|
readonly replacedText: string;
|
|
103
103
|
readonly revisionKind: ReviewRevisionKind;
|
|
104
|
+
/**
|
|
105
|
+
* WHICH decision a `paragraphMark` records, absent for every other kind.
|
|
106
|
+
*
|
|
107
|
+
* `EG_ParaRPrTrackChanges` is `ins? del? moveFrom? moveTo?`, and the four say opposite
|
|
108
|
+
* things about one break. Without this a card called a deleted break an inserted one, which
|
|
109
|
+
* is the reverse of what Accept on that card does.
|
|
110
|
+
*/
|
|
111
|
+
readonly markDirection?: 'insert' | 'delete' | 'moveFrom' | 'moveTo';
|
|
104
112
|
readonly author: string;
|
|
105
113
|
readonly date?: string;
|
|
106
114
|
/** Text the revision covers, for the card summary. Empty for changes with no characters. */
|
|
107
115
|
readonly text: string;
|
|
108
116
|
/** Every site this decision touches, in document order. */
|
|
109
117
|
readonly ranges: readonly ReviewRange[];
|
|
118
|
+
/**
|
|
119
|
+
* How deeply this change is NESTED inside other changes, 0 for an unenclosed one.
|
|
120
|
+
*
|
|
121
|
+
* `w:ins` wrapping `w:del` is content one reviewer added and another struck. Both stay
|
|
122
|
+
* pending, so both are cards, over one identical range — and a range then cannot say which
|
|
123
|
+
* change a caret is in. Word treats the innermost as the operative one, so it wins the caret
|
|
124
|
+
* and the change enclosing it stays listed and reachable.
|
|
125
|
+
*/
|
|
126
|
+
readonly nesting: number;
|
|
110
127
|
/**
|
|
111
128
|
* How many leading `ranges` are the STRUCK half of a replacement.
|
|
112
129
|
*
|
|
@@ -321,8 +338,28 @@ interface ReviewParagraphAnchor {
|
|
|
321
338
|
readonly box: {
|
|
322
339
|
readonly y: number;
|
|
323
340
|
};
|
|
341
|
+
/**
|
|
342
|
+
* Present on a real line. A merged fragment's join line carries spans from two
|
|
343
|
+
* paragraphs, and its `range` can only name one of them, so the OTHER paragraph's extent
|
|
344
|
+
* on that line is readable here and nowhere else.
|
|
345
|
+
*/
|
|
346
|
+
readonly spans?: readonly {
|
|
347
|
+
readonly range: {
|
|
348
|
+
readonly paragraphId: string;
|
|
349
|
+
readonly end: number;
|
|
350
|
+
};
|
|
351
|
+
}[];
|
|
324
352
|
}[];
|
|
325
353
|
}
|
|
354
|
+
/**
|
|
355
|
+
* The y of the line a position sits on, measured from the anchor's own origin.
|
|
356
|
+
*
|
|
357
|
+
* An ordinary line answers from its own range, exactly as it always did. On a merged
|
|
358
|
+
* fragment's join line the range names one of the two paragraphs, so an offset compared
|
|
359
|
+
* against it either overshot — putting a card in the absorbed half beside the wrong line —
|
|
360
|
+
* or matched the first line every time.
|
|
361
|
+
*/
|
|
362
|
+
declare function anchorLineY(anchor: ReviewParagraphAnchor, paragraphId: string, offset: number): number;
|
|
326
363
|
/**
|
|
327
364
|
* Paragraph id to its place on the page, in ONE pass over the layout.
|
|
328
365
|
*
|
|
@@ -350,6 +387,13 @@ declare function reviewAnchorIndex<TPage extends {
|
|
|
350
387
|
readonly box: {
|
|
351
388
|
readonly y: number;
|
|
352
389
|
};
|
|
390
|
+
/** Present on a real line; a merged one carries spans from more than one paragraph. */
|
|
391
|
+
readonly spans?: readonly {
|
|
392
|
+
readonly range: {
|
|
393
|
+
readonly paragraphId: string;
|
|
394
|
+
readonly end: number;
|
|
395
|
+
};
|
|
396
|
+
}[];
|
|
353
397
|
}[];
|
|
354
398
|
}[]): Map<string, ReviewParagraphAnchor>;
|
|
355
399
|
/**
|
|
@@ -367,4 +411,4 @@ declare function reviewItemGeometry(item: ReviewItem, index: ReadonlyMap<string,
|
|
|
367
411
|
readonly y: number;
|
|
368
412
|
} | null;
|
|
369
413
|
|
|
370
|
-
export { type CommentRecord as C, type ReviewModelInput as R, W15_NAMESPACE_URI as W, type ReviewItem as a, type ReviewRevisionItem as b, type ReviewCommentItem as c, type ReviewCustomItem as d, type ReviewPosition as e, type ReviewRange as f, type ReviewRevisionKind as g, type CommentAnchor as h, type CommentPosition as i, type CommentThreadState as j, type ReviewParagraphAnchor as k, activeReviewItem as l,
|
|
414
|
+
export { type CommentRecord as C, type ReviewModelInput as R, W15_NAMESPACE_URI as W, type ReviewItem as a, type ReviewRevisionItem as b, type ReviewCommentItem as c, type ReviewCustomItem as d, type ReviewPosition as e, type ReviewRange as f, type ReviewRevisionKind as g, type CommentAnchor as h, type CommentPosition as i, type CommentThreadState as j, type ReviewParagraphAnchor as k, activeReviewItem as l, anchorLineY as m, commentBodyText as n, commentInitials as o, firstReviewRange as p, reviewItemGeometry as q, reviewAnchorIndex as r, reviewItemKey as s, reviewItemPositionRank as t, reviewItemRanges as u, reviewItemsAt as v, reviewThreadRootOf as w };
|
|
@@ -53,16 +53,67 @@ declare const DEFAULT_REVISION_DISPLAY_MODE: RevisionDisplayMode;
|
|
|
53
53
|
*/
|
|
54
54
|
declare function revisionsVisible(revisions: readonly RevisionAttribution[], mode: RevisionDisplayMode): boolean;
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* Every revision on a paragraph's own MARK, from `w:pPr/w:rPr/w:ins|w:del|w:moveFrom|w:moveTo`.
|
|
57
|
+
*
|
|
58
|
+
* All four members of `EG_ParaRPrTrackChanges`. A moved paragraph carries `w:moveFrom` on the
|
|
59
|
+
* mark of the copy it left and `w:moveTo` on the mark of the copy it arrived at, so a move
|
|
60
|
+
* that spans whole paragraphs is recorded here and nowhere else.
|
|
57
61
|
*
|
|
58
62
|
* `EG_ParaRPrTrackChanges` records that the pilcrow itself was inserted or deleted, which is how
|
|
59
63
|
* Word writes a paragraph split or merge. It is not content — there is no text to decorate — so
|
|
60
64
|
* a surface shows it as a mark of its own beside the paragraph, the way Word draws a struck-
|
|
61
65
|
* through ¶.
|
|
62
66
|
*
|
|
67
|
+
* A LIST, because the group is `ins? del? moveFrom? moveTo?` and the first two can both be
|
|
68
|
+
* there: that pair is what Word writes when a second author proposes removing a mark the first
|
|
69
|
+
* proposed adding, and it is what this engine's own writer emits (`tree-op-tracked.ts`).
|
|
70
|
+
* Answering with the first one hid the second author's decision from the PAGE. The review pane
|
|
71
|
+
* walks the tree itself and always listed both, which is the worse shape of the two: a card
|
|
72
|
+
* offering a decision the reader could see no sign of.
|
|
73
|
+
*
|
|
74
|
+
* Ordered as the file orders them, which is the order the group declares.
|
|
75
|
+
*
|
|
63
76
|
* Property-position `w:ins`/`w:del` stay `generic` in the tree deliberately, so this reads them
|
|
64
77
|
* by name rather than by kind.
|
|
65
78
|
*/
|
|
79
|
+
declare function paragraphMarkRevisionsOf(paragraph: OoxmlNode): readonly RevisionAttribution[];
|
|
80
|
+
/**
|
|
81
|
+
* The tracked FORMAT change on a paragraph's own mark, from `w:pPr/w:rPr/w:rPrChange`.
|
|
82
|
+
*
|
|
83
|
+
* `CT_ParaRPr` ends with it (§17.13.5.32), and Word writes it when a user changes the mark's
|
|
84
|
+
* own run properties with tracking on. It reaches the fragment rather than a span because it
|
|
85
|
+
* decorates no characters, and it is not in `props`: a fragment's `props` carry the mark's
|
|
86
|
+
* `w:rPr` by NAME only, with none of its children.
|
|
87
|
+
*
|
|
88
|
+
* Note that `w:rPrChange/w:rPr` is `CT_ParaRPrOriginal`, which may carry its own revision
|
|
89
|
+
* marks. Those describe the mark as it WAS and must not be read as live ones, which is why
|
|
90
|
+
* this reads the change element's own attributes and never descends into it.
|
|
91
|
+
*/
|
|
92
|
+
declare function paragraphMarkFormatRevisionOf(paragraph: OoxmlNode): RevisionAttribution | null;
|
|
93
|
+
/**
|
|
94
|
+
* The single decision a one-field reader sees.
|
|
95
|
+
*
|
|
96
|
+
* A DELETION wins when a mark carries both, for the reason paint draws it that way: a break
|
|
97
|
+
* proposed and then unproposed ends up removed, so that is the decision a reader who can only
|
|
98
|
+
* see one must see. One function decides it, so the deprecated field, the deprecated function
|
|
99
|
+
* and the painted glyph cannot answer differently.
|
|
100
|
+
*/
|
|
101
|
+
declare function shownMarkRevision(revisions: readonly RevisionAttribution[]): RevisionAttribution | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Does this decision, taken, remove the paragraph mark?
|
|
104
|
+
*
|
|
105
|
+
* A deletion does, and so does a `moveFrom`: the copy the paragraph moved OUT of goes away
|
|
106
|
+
* when the move is accepted. `insert` and `moveTo` are the other half of each pair, and they
|
|
107
|
+
* keep the break. Paint, the change bar and the resolved views all ask this one question, so
|
|
108
|
+
* a `moveFrom` cannot end up struck through in the margin and blue on the glyph.
|
|
109
|
+
*/
|
|
110
|
+
declare function markRevisionRemovesMark(revision: RevisionAttribution): boolean;
|
|
111
|
+
/**
|
|
112
|
+
* The one decision on a paragraph's mark that a single-field reader sees.
|
|
113
|
+
*
|
|
114
|
+
* @deprecated Reads one of the revisions a mark can carry. Use {@link paragraphMarkRevisionsOf},
|
|
115
|
+
* which answers with all of them.
|
|
116
|
+
*/
|
|
66
117
|
declare function paragraphMarkRevisionOf(paragraph: OoxmlNode): RevisionAttribution | null;
|
|
67
118
|
/**
|
|
68
119
|
* The tracked FORMAT change on a property list, from `w:rPrChange` or `w:pPrChange`.
|
|
@@ -81,4 +132,4 @@ declare function formatRevisionOf(properties: readonly {
|
|
|
81
132
|
/** True when this stack of revisions marks its content as deleted from the live document. */
|
|
82
133
|
declare function revisionsAreDeletion(revisions: readonly RevisionAttribution[]): boolean;
|
|
83
134
|
|
|
84
|
-
export { DEFAULT_REVISION_DISPLAY_MODE as D, type RevisionDisplayMode as R, type RevisionAttribution as a, type RevisionKind as b,
|
|
135
|
+
export { DEFAULT_REVISION_DISPLAY_MODE as D, type RevisionDisplayMode as R, type RevisionAttribution as a, type RevisionKind as b, paragraphMarkRevisionOf as c, paragraphMarkRevisionsOf as d, revisionsVisible as e, formatRevisionOf as f, markRevisionRemovesMark as m, paragraphMarkFormatRevisionOf as p, revisionsAreDeletion as r, shownMarkRevision as s };
|
|
@@ -53,16 +53,67 @@ declare const DEFAULT_REVISION_DISPLAY_MODE: RevisionDisplayMode;
|
|
|
53
53
|
*/
|
|
54
54
|
declare function revisionsVisible(revisions: readonly RevisionAttribution[], mode: RevisionDisplayMode): boolean;
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* Every revision on a paragraph's own MARK, from `w:pPr/w:rPr/w:ins|w:del|w:moveFrom|w:moveTo`.
|
|
57
|
+
*
|
|
58
|
+
* All four members of `EG_ParaRPrTrackChanges`. A moved paragraph carries `w:moveFrom` on the
|
|
59
|
+
* mark of the copy it left and `w:moveTo` on the mark of the copy it arrived at, so a move
|
|
60
|
+
* that spans whole paragraphs is recorded here and nowhere else.
|
|
57
61
|
*
|
|
58
62
|
* `EG_ParaRPrTrackChanges` records that the pilcrow itself was inserted or deleted, which is how
|
|
59
63
|
* Word writes a paragraph split or merge. It is not content — there is no text to decorate — so
|
|
60
64
|
* a surface shows it as a mark of its own beside the paragraph, the way Word draws a struck-
|
|
61
65
|
* through ¶.
|
|
62
66
|
*
|
|
67
|
+
* A LIST, because the group is `ins? del? moveFrom? moveTo?` and the first two can both be
|
|
68
|
+
* there: that pair is what Word writes when a second author proposes removing a mark the first
|
|
69
|
+
* proposed adding, and it is what this engine's own writer emits (`tree-op-tracked.ts`).
|
|
70
|
+
* Answering with the first one hid the second author's decision from the PAGE. The review pane
|
|
71
|
+
* walks the tree itself and always listed both, which is the worse shape of the two: a card
|
|
72
|
+
* offering a decision the reader could see no sign of.
|
|
73
|
+
*
|
|
74
|
+
* Ordered as the file orders them, which is the order the group declares.
|
|
75
|
+
*
|
|
63
76
|
* Property-position `w:ins`/`w:del` stay `generic` in the tree deliberately, so this reads them
|
|
64
77
|
* by name rather than by kind.
|
|
65
78
|
*/
|
|
79
|
+
declare function paragraphMarkRevisionsOf(paragraph: OoxmlNode): readonly RevisionAttribution[];
|
|
80
|
+
/**
|
|
81
|
+
* The tracked FORMAT change on a paragraph's own mark, from `w:pPr/w:rPr/w:rPrChange`.
|
|
82
|
+
*
|
|
83
|
+
* `CT_ParaRPr` ends with it (§17.13.5.32), and Word writes it when a user changes the mark's
|
|
84
|
+
* own run properties with tracking on. It reaches the fragment rather than a span because it
|
|
85
|
+
* decorates no characters, and it is not in `props`: a fragment's `props` carry the mark's
|
|
86
|
+
* `w:rPr` by NAME only, with none of its children.
|
|
87
|
+
*
|
|
88
|
+
* Note that `w:rPrChange/w:rPr` is `CT_ParaRPrOriginal`, which may carry its own revision
|
|
89
|
+
* marks. Those describe the mark as it WAS and must not be read as live ones, which is why
|
|
90
|
+
* this reads the change element's own attributes and never descends into it.
|
|
91
|
+
*/
|
|
92
|
+
declare function paragraphMarkFormatRevisionOf(paragraph: OoxmlNode): RevisionAttribution | null;
|
|
93
|
+
/**
|
|
94
|
+
* The single decision a one-field reader sees.
|
|
95
|
+
*
|
|
96
|
+
* A DELETION wins when a mark carries both, for the reason paint draws it that way: a break
|
|
97
|
+
* proposed and then unproposed ends up removed, so that is the decision a reader who can only
|
|
98
|
+
* see one must see. One function decides it, so the deprecated field, the deprecated function
|
|
99
|
+
* and the painted glyph cannot answer differently.
|
|
100
|
+
*/
|
|
101
|
+
declare function shownMarkRevision(revisions: readonly RevisionAttribution[]): RevisionAttribution | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Does this decision, taken, remove the paragraph mark?
|
|
104
|
+
*
|
|
105
|
+
* A deletion does, and so does a `moveFrom`: the copy the paragraph moved OUT of goes away
|
|
106
|
+
* when the move is accepted. `insert` and `moveTo` are the other half of each pair, and they
|
|
107
|
+
* keep the break. Paint, the change bar and the resolved views all ask this one question, so
|
|
108
|
+
* a `moveFrom` cannot end up struck through in the margin and blue on the glyph.
|
|
109
|
+
*/
|
|
110
|
+
declare function markRevisionRemovesMark(revision: RevisionAttribution): boolean;
|
|
111
|
+
/**
|
|
112
|
+
* The one decision on a paragraph's mark that a single-field reader sees.
|
|
113
|
+
*
|
|
114
|
+
* @deprecated Reads one of the revisions a mark can carry. Use {@link paragraphMarkRevisionsOf},
|
|
115
|
+
* which answers with all of them.
|
|
116
|
+
*/
|
|
66
117
|
declare function paragraphMarkRevisionOf(paragraph: OoxmlNode): RevisionAttribution | null;
|
|
67
118
|
/**
|
|
68
119
|
* The tracked FORMAT change on a property list, from `w:rPrChange` or `w:pPrChange`.
|
|
@@ -81,4 +132,4 @@ declare function formatRevisionOf(properties: readonly {
|
|
|
81
132
|
/** True when this stack of revisions marks its content as deleted from the live document. */
|
|
82
133
|
declare function revisionsAreDeletion(revisions: readonly RevisionAttribution[]): boolean;
|
|
83
134
|
|
|
84
|
-
export { DEFAULT_REVISION_DISPLAY_MODE as D, type RevisionDisplayMode as R, type RevisionAttribution as a, type RevisionKind as b,
|
|
135
|
+
export { DEFAULT_REVISION_DISPLAY_MODE as D, type RevisionDisplayMode as R, type RevisionAttribution as a, type RevisionKind as b, paragraphMarkRevisionOf as c, paragraphMarkRevisionsOf as d, revisionsVisible as e, formatRevisionOf as f, markRevisionRemovesMark as m, paragraphMarkFormatRevisionOf as p, revisionsAreDeletion as r, shownMarkRevision as s };
|
package/dist/{semantic-cell-selection-DZtyMXkH.d.ts → semantic-cell-selection-B5vfPz4Q.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { e as OoxmlPart, a as OoxmlElement, O as OoxmlNode } from './ooxml-tree-BU0e3DVi.js';
|
|
2
|
-
import { P as PageGeometry, I as InlineDrawingRecord, A as AnchoredDrawingRecord, T as TextMeasurer, L as LineRecord,
|
|
3
|
-
import { R as RevisionDisplayMode } from './revision-projection-
|
|
4
|
-
import { S as SemanticPosition, C as CaretGeometry, a as SemanticSelection } from './semantic-interaction-
|
|
2
|
+
import { P as PageGeometry, I as InlineDrawingRecord, A as AnchoredDrawingRecord, T as TextMeasurer, L as LineRecord, a as StyleSpanRecord, S as SemanticLayout, C as ContentControlBoundaryRecord, b as TableRowFragmentRecord, c as TableCellFragmentRecord } from './semantic-records-CdQvpUj1.js';
|
|
3
|
+
import { R as RevisionDisplayMode } from './revision-projection-UKqvPa4-.js';
|
|
4
|
+
import { S as SemanticPosition, C as CaretGeometry, a as SemanticSelection } from './semantic-interaction-lvpzZRpA.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Hard ceiling on sections enumerated from a document (matches write-path
|
|
@@ -320,7 +320,10 @@ declare function spanOffsetX(span: StyleSpanRecord, offset: number, measurer: Te
|
|
|
320
320
|
* - otherwise the run BEFORE the offset wins — the run a keystroke would continue —
|
|
321
321
|
* except at the start of the line, where there is nothing before it.
|
|
322
322
|
*/
|
|
323
|
-
declare function caretBoxOnLine(line: LineRecord, offset: number, measurer: TextMeasurer | undefined
|
|
323
|
+
declare function caretBoxOnLine(line: LineRecord, offset: number, measurer: TextMeasurer | undefined, segment?: {
|
|
324
|
+
readonly spans: readonly StyleSpanRecord[];
|
|
325
|
+
readonly drawings: readonly InlineDrawingRecord[];
|
|
326
|
+
} | null): {
|
|
324
327
|
x: number;
|
|
325
328
|
y: number;
|
|
326
329
|
height: number;
|
package/dist/{semantic-cell-selection--ezfezTe.d.cts → semantic-cell-selection-BTQFpN0S.d.cts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { e as OoxmlPart, a as OoxmlElement, O as OoxmlNode } from './ooxml-tree-BU0e3DVi.cjs';
|
|
2
|
-
import { P as PageGeometry, I as InlineDrawingRecord, A as AnchoredDrawingRecord, T as TextMeasurer, L as LineRecord,
|
|
3
|
-
import { R as RevisionDisplayMode } from './revision-projection-
|
|
4
|
-
import { S as SemanticPosition, C as CaretGeometry, a as SemanticSelection } from './semantic-interaction-
|
|
2
|
+
import { P as PageGeometry, I as InlineDrawingRecord, A as AnchoredDrawingRecord, T as TextMeasurer, L as LineRecord, a as StyleSpanRecord, S as SemanticLayout, C as ContentControlBoundaryRecord, b as TableRowFragmentRecord, c as TableCellFragmentRecord } from './semantic-records-DEOs3_tE.cjs';
|
|
3
|
+
import { R as RevisionDisplayMode } from './revision-projection-WzlQGBJx.cjs';
|
|
4
|
+
import { S as SemanticPosition, C as CaretGeometry, a as SemanticSelection } from './semantic-interaction-CDNEU_Tx.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Hard ceiling on sections enumerated from a document (matches write-path
|
|
@@ -320,7 +320,10 @@ declare function spanOffsetX(span: StyleSpanRecord, offset: number, measurer: Te
|
|
|
320
320
|
* - otherwise the run BEFORE the offset wins — the run a keystroke would continue —
|
|
321
321
|
* except at the start of the line, where there is nothing before it.
|
|
322
322
|
*/
|
|
323
|
-
declare function caretBoxOnLine(line: LineRecord, offset: number, measurer: TextMeasurer | undefined
|
|
323
|
+
declare function caretBoxOnLine(line: LineRecord, offset: number, measurer: TextMeasurer | undefined, segment?: {
|
|
324
|
+
readonly spans: readonly StyleSpanRecord[];
|
|
325
|
+
readonly drawings: readonly InlineDrawingRecord[];
|
|
326
|
+
} | null): {
|
|
324
327
|
x: number;
|
|
325
328
|
y: number;
|
|
326
329
|
height: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TextMeasurer, S as SemanticLayout, B as BlockFragmentRecord, C as ContentControlBoundaryRecord, a as StyleSpanRecord } from './semantic-records-
|
|
1
|
+
import { T as TextMeasurer, S as SemanticLayout, B as BlockFragmentRecord, C as ContentControlBoundaryRecord, a as StyleSpanRecord } from './semantic-records-DEOs3_tE.cjs';
|
|
2
2
|
|
|
3
3
|
/** A caret position in the model. */
|
|
4
4
|
interface SemanticPosition {
|
|
@@ -87,34 +87,6 @@ declare function contentControlAtSemantic(layout: SemanticLayout, point: {
|
|
|
87
87
|
}): ContentControlBoundaryRecord | null;
|
|
88
88
|
/** Layout-published content-control boundaries in document order. */
|
|
89
89
|
declare function contentControlsInLayout(layout: SemanticLayout): readonly ContentControlBoundaryRecord[];
|
|
90
|
-
/** The rectangles covering a selection, one per line it spans. */
|
|
91
|
-
declare function selectionRects(layout: SemanticLayout, selection: SemanticSelection): SelectionRect[];
|
|
92
|
-
/** A model range to highlight, and the key the caller knows it by. */
|
|
93
|
-
interface KeyedRange {
|
|
94
|
-
readonly key: string;
|
|
95
|
-
readonly from: SemanticPosition;
|
|
96
|
-
readonly to: SemanticPosition;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Rectangles for MANY ranges in ONE pass over the lines.
|
|
100
|
-
*
|
|
101
|
-
* Not `selectionRects` in a loop. That walks every page, fragment and line per range, and a
|
|
102
|
-
* contract with two hundred comments would re-walk the whole document two hundred times on
|
|
103
|
-
* every layout — the highlight would cost more than the layout it decorates. One pass tests
|
|
104
|
-
* each line against every range instead, which is the same work a single selection does.
|
|
105
|
-
*/
|
|
106
|
-
declare function keyedRangeRects(layout: SemanticLayout, ranges: readonly KeyedRange[],
|
|
107
|
-
/**
|
|
108
|
-
* Pages to measure, or every page when absent.
|
|
109
|
-
*
|
|
110
|
-
* A band that is not on screen is not painted, so measuring it is pure cost — and it is
|
|
111
|
-
* cost paid per keystroke, because an edit republishes the layout. Bounding this to the
|
|
112
|
-
* materialized pages is what keeps typing in a heavily reviewed document as fast as
|
|
113
|
-
* typing in a clean one.
|
|
114
|
-
*/
|
|
115
|
-
pages?: ReadonlySet<number>): Map<string, SelectionRect[]>;
|
|
116
|
-
/** Paragraph ids in document order, deduplicated across fragments. */
|
|
117
|
-
declare function documentOrder(layout: SemanticLayout): string[];
|
|
118
90
|
/**
|
|
119
91
|
* One caret movement, in Word's own vocabulary.
|
|
120
92
|
*
|
|
@@ -152,4 +124,4 @@ declare function compositionAnchor(layout: SemanticLayout, position: SemanticPos
|
|
|
152
124
|
/** The style spans a selection touches, for reporting active formatting. */
|
|
153
125
|
declare function spansInSelection(layout: SemanticLayout, selection: SemanticSelection): StyleSpanRecord[];
|
|
154
126
|
|
|
155
|
-
export { type CaretGeometry as C, type
|
|
127
|
+
export { type CaretGeometry as C, type MoveCaretOptions as M, type NavigationCommand as N, type SemanticPosition as S, type SemanticSelection as a, type SelectionRect as b, type CaretAtOptions as c, caretAt as d, caretStops as e, caretStopsForBlocks as f, compositionAnchor as g, contentControlAtSemantic as h, contentControlsInLayout as i, hitTestSemantic as j, moveCaret as m, paragraphTextFromLayout as p, spansInSelection as s };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TextMeasurer, S as SemanticLayout, B as BlockFragmentRecord, C as ContentControlBoundaryRecord, a as StyleSpanRecord } from './semantic-records-
|
|
1
|
+
import { T as TextMeasurer, S as SemanticLayout, B as BlockFragmentRecord, C as ContentControlBoundaryRecord, a as StyleSpanRecord } from './semantic-records-CdQvpUj1.js';
|
|
2
2
|
|
|
3
3
|
/** A caret position in the model. */
|
|
4
4
|
interface SemanticPosition {
|
|
@@ -87,34 +87,6 @@ declare function contentControlAtSemantic(layout: SemanticLayout, point: {
|
|
|
87
87
|
}): ContentControlBoundaryRecord | null;
|
|
88
88
|
/** Layout-published content-control boundaries in document order. */
|
|
89
89
|
declare function contentControlsInLayout(layout: SemanticLayout): readonly ContentControlBoundaryRecord[];
|
|
90
|
-
/** The rectangles covering a selection, one per line it spans. */
|
|
91
|
-
declare function selectionRects(layout: SemanticLayout, selection: SemanticSelection): SelectionRect[];
|
|
92
|
-
/** A model range to highlight, and the key the caller knows it by. */
|
|
93
|
-
interface KeyedRange {
|
|
94
|
-
readonly key: string;
|
|
95
|
-
readonly from: SemanticPosition;
|
|
96
|
-
readonly to: SemanticPosition;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Rectangles for MANY ranges in ONE pass over the lines.
|
|
100
|
-
*
|
|
101
|
-
* Not `selectionRects` in a loop. That walks every page, fragment and line per range, and a
|
|
102
|
-
* contract with two hundred comments would re-walk the whole document two hundred times on
|
|
103
|
-
* every layout — the highlight would cost more than the layout it decorates. One pass tests
|
|
104
|
-
* each line against every range instead, which is the same work a single selection does.
|
|
105
|
-
*/
|
|
106
|
-
declare function keyedRangeRects(layout: SemanticLayout, ranges: readonly KeyedRange[],
|
|
107
|
-
/**
|
|
108
|
-
* Pages to measure, or every page when absent.
|
|
109
|
-
*
|
|
110
|
-
* A band that is not on screen is not painted, so measuring it is pure cost — and it is
|
|
111
|
-
* cost paid per keystroke, because an edit republishes the layout. Bounding this to the
|
|
112
|
-
* materialized pages is what keeps typing in a heavily reviewed document as fast as
|
|
113
|
-
* typing in a clean one.
|
|
114
|
-
*/
|
|
115
|
-
pages?: ReadonlySet<number>): Map<string, SelectionRect[]>;
|
|
116
|
-
/** Paragraph ids in document order, deduplicated across fragments. */
|
|
117
|
-
declare function documentOrder(layout: SemanticLayout): string[];
|
|
118
90
|
/**
|
|
119
91
|
* One caret movement, in Word's own vocabulary.
|
|
120
92
|
*
|
|
@@ -152,4 +124,4 @@ declare function compositionAnchor(layout: SemanticLayout, position: SemanticPos
|
|
|
152
124
|
/** The style spans a selection touches, for reporting active formatting. */
|
|
153
125
|
declare function spansInSelection(layout: SemanticLayout, selection: SemanticSelection): StyleSpanRecord[];
|
|
154
126
|
|
|
155
|
-
export { type CaretGeometry as C, type
|
|
127
|
+
export { type CaretGeometry as C, type MoveCaretOptions as M, type NavigationCommand as N, type SemanticPosition as S, type SemanticSelection as a, type SelectionRect as b, type CaretAtOptions as c, caretAt as d, caretStops as e, caretStopsForBlocks as f, compositionAnchor as g, contentControlAtSemantic as h, contentControlsInLayout as i, hitTestSemantic as j, moveCaret as m, paragraphTextFromLayout as p, spansInSelection as s };
|
|
@@ -1,5 +1,98 @@
|
|
|
1
|
-
import { C as ContentControlBoundaryRecord, S as SemanticLayout } from './semantic-records-
|
|
2
|
-
import { V as ValidatedImageBytesHandle, R as RenderableImageMime } from './image-resources-
|
|
1
|
+
import { C as ContentControlBoundaryRecord, S as SemanticLayout } from './semantic-records-CdQvpUj1.js';
|
|
2
|
+
import { V as ValidatedImageBytesHandle, R as RenderableImageMime } from './image-resources-Cl5_cNi9.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Everything a host can say about ONE author's presentation. Every field is optional and
|
|
6
|
+
* every field is presentation-only — nothing here is ever serialised into the document.
|
|
7
|
+
*
|
|
8
|
+
* Deliberately about the PAINTED DOCUMENT (which only the painter can style) plus the
|
|
9
|
+
* author's identity data. Review-card DESIGN is not configured here: the review chrome
|
|
10
|
+
* follows `color` as its accent automatically, and everything further is composition —
|
|
11
|
+
* a custom card reading this style through the review surface's `useReviewAuthor`, or
|
|
12
|
+
* CSS on the cards' `data-review-author`/`data-review-author-slot` hooks.
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
interface RevisionAuthorStyle {
|
|
17
|
+
/**
|
|
18
|
+
* Ink and decoration colour of this author's changes in the document — and the accent
|
|
19
|
+
* the review chrome keys on (avatar disc, card variable, marker).
|
|
20
|
+
*/
|
|
21
|
+
color?: string;
|
|
22
|
+
/** Background wash behind this author's changes in the document. */
|
|
23
|
+
background?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Class names added to every painted span of this author's changes, for styling the
|
|
26
|
+
* typed fields do not cover. Keep the rules metric-safe (outlines, shadows, accents):
|
|
27
|
+
* the engine measures the text it paints, and a class that resizes glyphs drifts the
|
|
28
|
+
* page from its layout.
|
|
29
|
+
*/
|
|
30
|
+
spanClassName?: string;
|
|
31
|
+
/** Avatar image for this author; the packaged card renders it in place of initials. */
|
|
32
|
+
avatarUrl?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Per-author style assignments.
|
|
36
|
+
*
|
|
37
|
+
* Keys match `w:author` exactly; a value is a CSS colour or a full
|
|
38
|
+
* {@link RevisionAuthorStyle}. `others` says what authors WITHOUT an entry take: the
|
|
39
|
+
* `--doc-review-author-N` ramp by default, or `'kind'` to leave them on the kind colours —
|
|
40
|
+
* which is how "highlight these reviewers, leave everyone else green and red" is said.
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
interface RevisionAuthorAssignments {
|
|
45
|
+
/** Authors without an entry: the ramp (default), or the `'kind'` colours. */
|
|
46
|
+
readonly others?: 'kind' | 'author';
|
|
47
|
+
readonly authors: Readonly<Record<string, string | RevisionAuthorStyle>>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* How painted tracked changes are coloured.
|
|
51
|
+
*
|
|
52
|
+
* - `'author'` (the DEFAULT) — every change takes its author's colour from the
|
|
53
|
+
* `--doc-review-author-N` ramp, assigned by order of first appearance in the document.
|
|
54
|
+
* Word's own default, and the reason it is this engine's: a paragraph three people
|
|
55
|
+
* edited has to read as three people. Restyle a slot under `.docx-editor` to change the
|
|
56
|
+
* ramp.
|
|
57
|
+
* - `'kind'` — insertions and deletions take the two kind colours
|
|
58
|
+
* (`--doc-revision-insertion` / `--doc-revision-deletion`), so "added" and "removed" are
|
|
59
|
+
* what a reader tells apart at a glance, whoever proposed them.
|
|
60
|
+
* - {@link RevisionAuthorAssignments} — style the named authors; `others` decides whether
|
|
61
|
+
* the rest take the ramp (the default) or the kind colours.
|
|
62
|
+
*
|
|
63
|
+
* Presentation only: nothing here is ever serialised into the document.
|
|
64
|
+
*
|
|
65
|
+
* @public
|
|
66
|
+
*/
|
|
67
|
+
type RevisionStyles = 'kind' | 'author' | RevisionAuthorAssignments;
|
|
68
|
+
/**
|
|
69
|
+
* One document author, resolved: who, which ramp slot, and what they draw in.
|
|
70
|
+
*
|
|
71
|
+
* @public
|
|
72
|
+
*/
|
|
73
|
+
interface ReviewAuthorInfo {
|
|
74
|
+
/** The `w:author` string, exactly as the file carries it. */
|
|
75
|
+
readonly author: string;
|
|
76
|
+
/**
|
|
77
|
+
* Rank by order of first appearance — an UNBOUNDED index, not a ramp slot.
|
|
78
|
+
*
|
|
79
|
+
* The ramp defines {@link REVIEW_AUTHOR_SLOTS} colours and every DOM hook wraps into it,
|
|
80
|
+
* so the ninth author ranks 8 here and carries `data-review-author-slot="0"`. Building a
|
|
81
|
+
* selector from this value needs the same wrap: `slot % 8`.
|
|
82
|
+
*/
|
|
83
|
+
readonly slot: number;
|
|
84
|
+
/**
|
|
85
|
+
* The colour this author is DRAWN IN by the review chrome — their declared colour, or
|
|
86
|
+
* their ramp slot's token.
|
|
87
|
+
*
|
|
88
|
+
* Not necessarily what the document paints. `'kind'`, and `others: 'kind'` for an author
|
|
89
|
+
* with no declaration, colour the painted text by insertion/deletion instead, while the
|
|
90
|
+
* cards keep the per-author accent this reports.
|
|
91
|
+
*/
|
|
92
|
+
readonly color: string;
|
|
93
|
+
/** The host-supplied style, normalised; absent when the author rides the ramp. */
|
|
94
|
+
readonly style?: RevisionAuthorStyle;
|
|
95
|
+
}
|
|
3
96
|
|
|
4
97
|
/** Host port for safe blob URLs — only called for {@link ImageResourceState.kind} `ready`. */
|
|
5
98
|
interface PaintImageUrlPort {
|
|
@@ -67,6 +160,12 @@ interface PaintOptions {
|
|
|
67
160
|
readonly fieldShading?: FieldShadingMode;
|
|
68
161
|
/** See {@link PaintContext.shadeFormFields}. */
|
|
69
162
|
readonly shadeFormFields?: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* How tracked changes are coloured: by AUTHOR through the `--doc-review-author-N`
|
|
165
|
+
* ramp (the default, as in Word), by kind, or by author with host-pinned colours.
|
|
166
|
+
* See {@link RevisionStyles}.
|
|
167
|
+
*/
|
|
168
|
+
readonly revisionStyles?: RevisionStyles;
|
|
70
169
|
/**
|
|
71
170
|
* Relationship id of the header/footer story currently open for editing.
|
|
72
171
|
*
|
|
@@ -116,6 +215,15 @@ interface PaintOptions {
|
|
|
116
215
|
readonly additionalBoundaries?: readonly ContentControlBoundaryRecord[];
|
|
117
216
|
/** Control ids that represent TOC regions (hover-only chrome; never caret-sticky). */
|
|
118
217
|
readonly tocControlIds?: ReadonlySet<string>;
|
|
218
|
+
/**
|
|
219
|
+
* No control may be written right now — viewing mode, or a protected document.
|
|
220
|
+
*
|
|
221
|
+
* The widget is a `<button>` the ENGINE paints, and a click on it commits a tree op, so
|
|
222
|
+
* an enabled-looking checkbox on a read-only document is not a cosmetic lie: it is the
|
|
223
|
+
* write itself. Disabling it here also stops the pointer lane, which already skips a
|
|
224
|
+
* widget carrying `data-disabled-reason`.
|
|
225
|
+
*/
|
|
226
|
+
readonly readOnly?: boolean;
|
|
119
227
|
};
|
|
120
228
|
readonly drawingStrings?: DrawingPaintStrings;
|
|
121
229
|
readonly imageUrlPort?: PaintImageUrlPort;
|
|
@@ -130,4 +238,4 @@ interface PaintOptions {
|
|
|
130
238
|
*/
|
|
131
239
|
declare function paintSemanticLayout(container: HTMLElement, layout: SemanticLayout, options?: PaintOptions): void;
|
|
132
240
|
|
|
133
|
-
export { DEFAULT_FIELD_SHADING as D, type FieldShadingMode as F, type PaintOptions as P, type
|
|
241
|
+
export { DEFAULT_FIELD_SHADING as D, type FieldShadingMode as F, type PaintOptions as P, type ReviewAuthorInfo as R, type RevisionAuthorAssignments as a, type RevisionAuthorStyle as b, type RevisionStyles as c, type DrawingPaintStrings as d, paintSemanticLayout as p };
|