@docx-editor.dev/core 2.27.0 → 2.29.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/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +76 -16
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +31 -12
- package/dist/binding.js +1 -1
- package/dist/{index-CkQVRJtJ.d.ts → chrome-print-CAs51cpq.d.ts} +248 -115
- package/dist/chunk-236O4YQW.js +2 -0
- package/dist/chunk-4HENIAFG.js +1 -0
- package/dist/chunk-6JPL6ZAS.cjs +5 -0
- package/dist/chunk-6ZQP4HQ7.js +3 -0
- package/dist/{chunk-2GK7YQB2.cjs → chunk-7WQ7AAHW.cjs} +1 -1
- package/dist/chunk-BCXH4BXB.js +5 -0
- package/dist/chunk-BY2ACZZ6.cjs +1 -0
- package/dist/chunk-CAJEXXVG.cjs +4 -0
- package/dist/chunk-CPWLFPWC.js +30 -0
- package/dist/chunk-D7ZMDMPX.cjs +3 -0
- package/dist/chunk-DOHF6FA7.cjs +30 -0
- package/dist/chunk-DVX32P2P.js +27 -0
- package/dist/chunk-E4LOMDNL.js +1 -0
- package/dist/chunk-EKLM7NWB.cjs +7 -0
- package/dist/chunk-G3K63G7P.cjs +27 -0
- package/dist/chunk-G4HOFIKJ.js +1 -0
- package/dist/chunk-JLVBDYVQ.cjs +2 -0
- package/dist/chunk-LQX36Z5P.js +7 -0
- package/dist/chunk-LSZ6KPKK.js +1 -0
- package/dist/chunk-MM5QBMTE.cjs +1 -0
- package/dist/chunk-OMCG63ZF.js +1 -0
- package/dist/chunk-OSFOJTHU.cjs +18 -0
- package/dist/chunk-RCLZXP3B.js +2 -0
- package/dist/chunk-T6K2QYNZ.cjs +2 -0
- package/dist/chunk-TRGAVV2Y.js +4 -0
- package/dist/chunk-U4JZVSOE.js +2 -0
- package/dist/chunk-UHHYFIDT.cjs +1 -0
- package/dist/chunk-V3N4SOAK.cjs +1 -0
- package/dist/chunk-W35WTWAO.cjs +1 -0
- package/dist/chunk-YQ5G6LC7.js +18 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +42 -6
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.cjs +1 -1
- package/dist/collaboration.d.ts +99 -7
- package/dist/collaboration.js +1 -1
- package/dist/contracts/document.d.ts +18 -3
- package/dist/contracts/editor.d.ts +19 -10
- package/dist/contracts/interaction.d.ts +31 -2
- package/dist/contracts/modules.cjs +1 -1
- package/dist/contracts/modules.d.ts +56 -8
- package/dist/contracts/modules.js +1 -1
- package/dist/contracts/types.d.ts +11 -2
- package/dist/{custom-node-writes-Vzpq9I8_.d.ts → custom-node-writes-Bn6uciLb.d.ts} +2 -2
- package/dist/diagnostic-context-B8M79cfK.d.ts +30 -0
- package/dist/diagnostic-hints-BeVjfNOv.d.ts +113 -0
- package/dist/{document-protection-9zpIHWTE.d.ts → document-protection-CUb55pl_.d.ts} +2 -2
- package/dist/{editor-B3OBYNrF.d.ts → editor-CZQZmTIU.d.ts} +770 -141
- package/dist/{editor-scope-OHPwVQ5l.d.ts → editor-scope-7o9xweiJ.d.ts} +1 -1
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +5 -5
- package/dist/editor.d.ts +439 -33
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +23 -14
- package/dist/export.js +2 -2
- package/dist/failure-NS2lsya4.d.ts +115 -0
- package/dist/{font-resolver-DN0xNOf_.d.ts → font-resolver-lSBLirLR.d.ts} +3 -3
- package/dist/{headless-document-view-ICYqNkQ1.d.ts → headless-document-view-pp3q7wIh.d.ts} +2 -2
- package/dist/{image-resources-BDFxcu7W.d.ts → image-resources-tXLQShoC.d.ts} +10 -10
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +92 -20
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-BvZD_VKP.d.ts → layout-shaping-BD-dF_rn.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +168 -79
- package/dist/layout.js +1 -1
- package/dist/{note-properties-CkAk7g-n.d.ts → note-properties-qQUjO1GQ.d.ts} +3 -3
- package/dist/{omml-equation-DuczgG5o.d.ts → omml-equation-BUbU0utM.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +18 -9
- package/dist/output.js +1 -1
- package/dist/{protocol-aKYr8r3u.d.ts → protocol-DYzzz2ej.d.ts} +44 -4
- package/dist/{review-paragraph-order-Ddj5d6rp.d.ts → review-paragraph-order-CN_0l2Cb.d.ts} +5 -2
- package/dist/{semantic-cell-selection-DoqYCz_F.d.ts → semantic-cell-selection-eYag3P47.d.ts} +8 -213
- package/dist/{semantic-interaction-G0bjmmmk.d.ts → semantic-interaction-kR_QB845.d.ts} +25 -34
- package/dist/{semantic-paint-CsMzF8-O.d.ts → semantic-paint-ZayFF3tD.d.ts} +17 -5
- package/dist/{semantic-record-queries-1du6lQqS.d.ts → semantic-record-queries-Bsgth6lv.d.ts} +1 -1
- package/dist/{semantic-records-B9OolWGN.d.ts → semantic-records-DQmumPgL.d.ts} +1367 -884
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +1611 -1586
- package/dist/store.js +1 -1
- package/dist/{tree-package-fragment-DYZIk1rY.d.ts → tree-package-store-CovjNARF.d.ts} +157 -137
- package/dist/{tree-session-contract-DQVJOOkv.d.ts → tree-session-contract-CZVAGl51.d.ts} +8 -6
- package/dist/{types-barrel-BFKR8Pzp.d.ts → types-barrel-DuC5QBNC.d.ts} +352 -231
- package/package.json +3 -3
- package/dist/chunk-4KZ6L5YF.cjs +0 -15
- package/dist/chunk-55AT3MOU.cjs +0 -25
- package/dist/chunk-6ZQMII6V.js +0 -1
- package/dist/chunk-7IGCWG4H.js +0 -2
- package/dist/chunk-7MYITTAH.js +0 -5
- package/dist/chunk-AVKVRU7Z.cjs +0 -5
- package/dist/chunk-CWRBFNK5.cjs +0 -5
- package/dist/chunk-DGPA3TST.cjs +0 -27
- package/dist/chunk-DNXVNQEO.js +0 -1
- package/dist/chunk-FQN4KSFL.cjs +0 -7
- package/dist/chunk-GVUOWHTO.cjs +0 -1
- package/dist/chunk-GWQJ5774.js +0 -5
- package/dist/chunk-HAQ72KD7.js +0 -1
- package/dist/chunk-HO5XFO32.cjs +0 -3
- package/dist/chunk-IGR23DV2.js +0 -1
- package/dist/chunk-JSIX2EOH.js +0 -3
- package/dist/chunk-K246T47S.cjs +0 -1
- package/dist/chunk-KAXOGCGA.js +0 -1
- package/dist/chunk-LZLTN5A3.cjs +0 -1
- package/dist/chunk-NBCVVZOM.cjs +0 -1
- package/dist/chunk-O5INAWZQ.js +0 -1
- package/dist/chunk-OHAXVTWG.cjs +0 -1
- package/dist/chunk-S74GRBNE.js +0 -7
- package/dist/chunk-UBLUVNZR.js +0 -27
- package/dist/chunk-UMRSBLO7.js +0 -15
- package/dist/chunk-VIPMGGUT.js +0 -25
- package/dist/chunk-WG4KMSX2.cjs +0 -2
- package/dist/chunk-WRLKVNNR.cjs +0 -1
- package/dist/chunk-ZU7IVN6G.js +0 -2
- package/dist/failure-BIPVQbRm.d.ts +0 -65
- package/dist/revision-projection-CSNFudZY.d.ts +0 -242
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as HeaderFooterVariant, N as NoteKind } from './tree-package-
|
|
1
|
+
import { aw as AutomationTableMutation, a9 as RevisionBatchResult, a8 as RevisionAuthorResult } from './types-barrel-DuC5QBNC.js';
|
|
2
|
+
import { c as HeaderFooterVariant, N as NoteKind } from './tree-package-store-CovjNARF.js';
|
|
3
3
|
|
|
4
4
|
/** Word's shape types, as `Word.ShapeType` spells them. */
|
|
5
5
|
type AutomationShapeType = 'TextBox' | 'GeometricShape' | 'Picture' | 'Group' | 'Canvas' | 'Unsupported';
|
|
@@ -25,6 +25,11 @@ interface AutomationInlinePictureWrite {
|
|
|
25
25
|
|
|
26
26
|
/** Alignment as this protocol publishes it. `Mixed`/`Unknown` are read-only answers. */
|
|
27
27
|
type AutomationAlignment = 'Mixed' | 'Unknown' | 'Left' | 'Centered' | 'Right' | 'Justified';
|
|
28
|
+
/**
|
|
29
|
+
* A paragraph's base direction (`w:bidi`) as this protocol publishes it: the direction the
|
|
30
|
+
* paragraph reads in, after its style cascade.
|
|
31
|
+
*/
|
|
32
|
+
type AutomationReadingOrder = 'LeftToRight' | 'RightToLeft';
|
|
28
33
|
/**
|
|
29
34
|
* What a range agrees about its characters' formatting.
|
|
30
35
|
*
|
|
@@ -78,6 +83,8 @@ interface AutomationParagraphFormatRead {
|
|
|
78
83
|
readonly spaceBefore: number | null;
|
|
79
84
|
readonly spaceAfter: number | null;
|
|
80
85
|
readonly widowControl: boolean | null;
|
|
86
|
+
/** The direction the paragraph reads in: its own `w:bidi` if any, else the style cascade's. */
|
|
87
|
+
readonly readingOrder: AutomationReadingOrder;
|
|
81
88
|
}
|
|
82
89
|
/**
|
|
83
90
|
* A paragraph-property write. Every field optional; omitted means "leave alone".
|
|
@@ -103,6 +110,12 @@ interface AutomationParagraphFormatWrite {
|
|
|
103
110
|
readonly spaceBefore?: number;
|
|
104
111
|
readonly spaceAfter?: number;
|
|
105
112
|
readonly widowControl?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* The direction the paragraph should read in. Nothing is written when it already does. Else the
|
|
115
|
+
* paragraph's own `w:bidi` is removed when that alone set the other direction, or stated:
|
|
116
|
+
* `<w:bidi/>`, or `<w:bidi w:val="0"/>` over a right-to-left style.
|
|
117
|
+
*/
|
|
118
|
+
readonly readingOrder?: AutomationReadingOrder;
|
|
106
119
|
}
|
|
107
120
|
|
|
108
121
|
declare const MEMBERS: {
|
|
@@ -984,6 +997,19 @@ type AutomationOperation = AutomationAuthoringOperation | {
|
|
|
984
997
|
readonly action: 'accept' | 'reject';
|
|
985
998
|
readonly revisions?: readonly AutomationHandle[];
|
|
986
999
|
}
|
|
1000
|
+
/**
|
|
1001
|
+
* Attribute pending decisions in one story to another author, keeping them pending. Omit
|
|
1002
|
+
* revisions to select every canonical decision. `date` is `xsd:dateTime`; omitted keeps each.
|
|
1003
|
+
*/
|
|
1004
|
+
| {
|
|
1005
|
+
readonly op: 'setRevisionAuthorBatch';
|
|
1006
|
+
readonly body: AutomationHandle;
|
|
1007
|
+
readonly author: string;
|
|
1008
|
+
readonly date?: string;
|
|
1009
|
+
readonly revisions?: readonly AutomationHandle[];
|
|
1010
|
+
/** Keep only changes these authors made. Not allowed with `revisions`. */
|
|
1011
|
+
readonly authors?: readonly string[];
|
|
1012
|
+
}
|
|
987
1013
|
/** Word's name for the kind of change: `Insert`, `Delete`, `Replace`, `Property`, … */
|
|
988
1014
|
| {
|
|
989
1015
|
readonly op: 'getRevisionType';
|
|
@@ -1329,7 +1355,11 @@ interface AutomationCapabilities {
|
|
|
1329
1355
|
* `stale-revision` must not retry an `invalid-handle`.
|
|
1330
1356
|
*/
|
|
1331
1357
|
type AutomationErrorCode =
|
|
1332
|
-
/**
|
|
1358
|
+
/**
|
|
1359
|
+
* Nothing was applied because the request was built from an older read: `expectedRevision`
|
|
1360
|
+
* did not match the host's current revision, or an endpoint's `readAt` names a position
|
|
1361
|
+
* that moved since. Read again before retrying; resending the same endpoints fails again.
|
|
1362
|
+
*/
|
|
1333
1363
|
'stale-revision'
|
|
1334
1364
|
/** A handle this host never minted, or one naming a different kind of object. */
|
|
1335
1365
|
| 'invalid-handle'
|
|
@@ -1406,6 +1436,13 @@ interface AutomationEndpoint {
|
|
|
1406
1436
|
*/
|
|
1407
1437
|
readonly paragraph: AutomationHandle;
|
|
1408
1438
|
readonly offset: number;
|
|
1439
|
+
/**
|
|
1440
|
+
* The host revision this endpoint was read at. Hosts stamp every endpoint they answer with
|
|
1441
|
+
* it; send it back unchanged. An endpoint whose paragraph text changed since then is refused
|
|
1442
|
+
* with `stale-revision` instead of addressing whatever text now sits at its offset. Omit it
|
|
1443
|
+
* for an endpoint built by hand, which the host then takes as current.
|
|
1444
|
+
*/
|
|
1445
|
+
readonly readAt?: number;
|
|
1409
1446
|
}
|
|
1410
1447
|
/** A stretch of a story between two endpoints, in reading order. */
|
|
1411
1448
|
interface AutomationSpan {
|
|
@@ -1416,6 +1453,9 @@ interface AutomationSpan {
|
|
|
1416
1453
|
type AutomationValue = {
|
|
1417
1454
|
readonly kind: 'revisionBatch';
|
|
1418
1455
|
readonly result: RevisionBatchResult;
|
|
1456
|
+
} | {
|
|
1457
|
+
readonly kind: 'revisionAuthors';
|
|
1458
|
+
readonly result: RevisionAuthorResult;
|
|
1419
1459
|
} | {
|
|
1420
1460
|
readonly kind: 'field';
|
|
1421
1461
|
readonly field: {
|
|
@@ -1608,4 +1648,4 @@ interface AutomationHost {
|
|
|
1608
1648
|
dispose(): void;
|
|
1609
1649
|
}
|
|
1610
1650
|
|
|
1611
|
-
export type { AutomationOperation as A, AutomationPoint as B,
|
|
1651
|
+
export type { AutomationOperation as A, AutomationPoint as B, AutomationReadingOrder as C, AutomationSaveResult as D, AutomationSearchOptions as E, AutomationSelectionMode as F, AutomationSpan as G, AutomationSpanRef as H, AutomationTextProjection as I, AutomationUnsubscribe as J, AutomationValue as K, AutomationCapabilities as a, AutomationHost as b, AutomationAlignment as c, AutomationBatchRequest as d, AutomationBatchResponse as e, AutomationChangeEvent as f, AutomationContentControlLock as g, AutomationContentControlRangeLocation as h, AutomationContentControlScope as i, AutomationContentControlSubtype as j, AutomationContentControlValue as k, AutomationError as l, AutomationErrorCode as m, AutomationFontRead as n, AutomationFontWrite as o, AutomationHandle as p, AutomationHandleRef as q, AutomationObjectKind as r, AutomationOperationKind as s, AutomationOperationResult as t, AutomationPageOrientation as u, AutomationPageSetupRead as v, AutomationPageSetupWrite as w, AutomationParagraphFormatRead as x, AutomationParagraphFormatWrite as y, AutomationParagraphRef as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as OoxmlNode,
|
|
1
|
+
import { N as OoxmlNode, ak as OoxmlElement, al as OoxmlContentControlNode, V as OoxmlGenericElementNode, am as OoxmlContentControlContentNode, C as CommentRecord, O as OoxmlPart } from './types-barrel-DuC5QBNC.js';
|
|
2
2
|
|
|
3
3
|
/** Nested content-control wrappers deeper than this stop flattening; content stays preserved. */
|
|
4
4
|
declare const MAX_CONTENT_CONTROL_NESTING = 32;
|
|
@@ -63,7 +63,10 @@ declare function walkParagraphInline(children: readonly OoxmlNode[], depth: numb
|
|
|
63
63
|
* run walk.
|
|
64
64
|
*/
|
|
65
65
|
declare function commentBodyText(comment: CommentRecord): string;
|
|
66
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* Author initials for an avatar, from `@w:initials` or the name, at most three characters.
|
|
68
|
+
* Characters are code points, so a surrogate pair is never split.
|
|
69
|
+
*/
|
|
67
70
|
declare function commentInitials(comment: CommentRecord): string;
|
|
68
71
|
|
|
69
72
|
/**
|
package/dist/{semantic-cell-selection-DoqYCz_F.d.ts → semantic-cell-selection-eYag3P47.d.ts}
RENAMED
|
@@ -1,212 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { f as SectionPageBorders, I as InlineDrawingRecord, A as AnchoredDrawingRecord, T as TextMeasurer, L as LineRecord, e as StyleSpanRecord, S as SemanticLayout, C as ContentControlBoundaryRecord, g as TableRowFragmentRecord, h as TableCellFragmentRecord } from './semantic-records-B9OolWGN.js';
|
|
4
|
-
import { S as SemanticPosition, C as CaretGeometry, a as SemanticSelection } from './semantic-interaction-G0bjmmmk.js';
|
|
5
|
-
|
|
6
|
-
/** Page geometry, in points. */
|
|
7
|
-
interface PageGeometry {
|
|
8
|
-
readonly width: number;
|
|
9
|
-
readonly height: number;
|
|
10
|
-
readonly margin: {
|
|
11
|
-
readonly top: number;
|
|
12
|
-
readonly right: number;
|
|
13
|
-
readonly bottom: number;
|
|
14
|
-
readonly left: number;
|
|
15
|
-
};
|
|
16
|
-
/** `w:pgMar/@header` — sheet edge to header top, in points. Defaults to 36 (720 twips). */
|
|
17
|
-
readonly headerDistance?: number;
|
|
18
|
-
/** `w:pgMar/@footer` — sheet edge to footer bottom, in points. Defaults to 36. */
|
|
19
|
-
readonly footerDistance?: number;
|
|
20
|
-
}
|
|
21
|
-
/** US Letter with one-inch margins, in points. */
|
|
22
|
-
declare const DEFAULT_PAGE_GEOMETRY: PageGeometry;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Hard ceiling on sections enumerated from a document (matches write-path
|
|
26
|
-
* `MAX_SECTIONS` in note/hf lifecycle). Hostile packages with unbounded `w:sectPr`
|
|
27
|
-
* marks fail closed here rather than amplifying layout props arrays.
|
|
28
|
-
*/
|
|
29
|
-
declare const MAX_DOCUMENT_SECTIONS = 4096;
|
|
30
|
-
/** A section's margins in twips, including the header and footer reserve bands. */
|
|
31
|
-
interface SectionMargins {
|
|
32
|
-
readonly topTwips: number;
|
|
33
|
-
readonly rightTwips: number;
|
|
34
|
-
readonly bottomTwips: number;
|
|
35
|
-
readonly leftTwips: number;
|
|
36
|
-
readonly headerTwips: number;
|
|
37
|
-
readonly footerTwips: number;
|
|
38
|
-
readonly gutterTwips: number;
|
|
39
|
-
}
|
|
40
|
-
/** One explicit `w:col`: its width and the gap after it. */
|
|
41
|
-
interface SectionColumnDefinition {
|
|
42
|
-
readonly widthTwips: number;
|
|
43
|
-
/** Space after this column; zero on the final column. */
|
|
44
|
-
readonly gapTwips: number;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* A section's column layout.
|
|
48
|
-
*
|
|
49
|
-
* Equal-width and explicit-width columns are one type because a file may declare `w:num` with no
|
|
50
|
-
* `w:col` children at all, and layout must handle both without branching at every use site.
|
|
51
|
-
*/
|
|
52
|
-
interface SectionColumns {
|
|
53
|
-
readonly count: number;
|
|
54
|
-
/** Shared gap for equal-width columns and fallback gap for incomplete explicit definitions. */
|
|
55
|
-
readonly gapTwips: number;
|
|
56
|
-
readonly equalWidth?: boolean;
|
|
57
|
-
readonly separator?: boolean;
|
|
58
|
-
/** Authored `w:col` geometry when `equalWidth` is false. */
|
|
59
|
-
readonly definitions?: readonly SectionColumnDefinition[];
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* How this section is placed relative to the previous one (ECMA-376 17.6.22,
|
|
63
|
-
* `ST_SectionMark`).
|
|
64
|
-
*
|
|
65
|
-
* All five schema values are read. `nextColumn` paginates like `nextPage` for now: in a
|
|
66
|
-
* single-column section that IS Word's behaviour, and multi-column flow is not modelled,
|
|
67
|
-
* so collapsing it at the parse boundary would only hide the authored value from a
|
|
68
|
-
* consumer that asks.
|
|
69
|
-
*/
|
|
70
|
-
type SectionBreakType = 'nextPage' | 'continuous' | 'evenPage' | 'oddPage' | 'nextColumn';
|
|
71
|
-
/**
|
|
72
|
-
* Authored `w:pgNumType` (ECMA-376 CT_PageNumber).
|
|
73
|
-
*
|
|
74
|
-
* Distinguishes three states via {@link SectionProperties.pageNumbering}:
|
|
75
|
-
* - element absent → `undefined` (Word defaults; no empty element to re-emit)
|
|
76
|
-
* - empty `<w:pgNumType/>` → `{}` (present, no authored attrs; must round-trip empty)
|
|
77
|
-
* - attributes set → only those keys appear (never invent schema defaults like `fmt=decimal`)
|
|
78
|
-
*
|
|
79
|
-
* `chapStyle` / `chapSep` are preserved for consumers; PAGE projection does not yet compose
|
|
80
|
-
* chapter numbers (heading outline resolution is out of this slice).
|
|
81
|
-
*/
|
|
82
|
-
interface SectionPageNumbering {
|
|
83
|
-
/** Authored `@w:start` when present and in range; otherwise omitted. */
|
|
84
|
-
readonly start?: number;
|
|
85
|
-
/** Authored `@w:fmt` (ST_NumberFormat) when present; otherwise omitted. */
|
|
86
|
-
readonly fmt?: string;
|
|
87
|
-
/** Authored `@w:chapStyle` outline level when present and in range. */
|
|
88
|
-
readonly chapStyle?: number;
|
|
89
|
-
/** Authored `@w:chapSep` when present (hyphen / period / colon / emDash / enDash). */
|
|
90
|
-
readonly chapSep?: string;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* One section's resolved `w:sectPr`, as layout needs it.
|
|
94
|
-
*
|
|
95
|
-
* Resolved, not raw: defaults the file omitted are filled in here (an absent `w:type` is
|
|
96
|
-
* `nextPage`), so layout never has to know which attributes were authored and which were
|
|
97
|
-
* inherited.
|
|
98
|
-
*/
|
|
99
|
-
interface SectionProperties {
|
|
100
|
-
/** Active document grid line pitch: line-unit paragraph margins and line snapping. */
|
|
101
|
-
readonly gridLinePitchTwips?: number;
|
|
102
|
-
readonly pageSize: {
|
|
103
|
-
readonly widthTwips: number;
|
|
104
|
-
readonly heightTwips: number;
|
|
105
|
-
};
|
|
106
|
-
readonly margins: SectionMargins;
|
|
107
|
-
readonly columns: SectionColumns;
|
|
108
|
-
readonly landscape: boolean;
|
|
109
|
-
readonly titlePage: boolean;
|
|
110
|
-
/** Absent `w:type` defaults to `nextPage`. */
|
|
111
|
-
readonly breakType: SectionBreakType;
|
|
112
|
-
/**
|
|
113
|
-
* Authored page-number type. Absent when `w:pgNumType` is missing; empty object when the
|
|
114
|
-
* element is present with no attributes (comprehensive-fixture shape).
|
|
115
|
-
*/
|
|
116
|
-
readonly pageNumbering?: SectionPageNumbering;
|
|
117
|
-
/**
|
|
118
|
-
* Resolved `w:pgBorders` (§17.6.10). Absent when the section declares none, or when every
|
|
119
|
-
* edge it declares is off or an art border — see {@link parsePageBorders}.
|
|
120
|
-
*/
|
|
121
|
-
readonly pageBorders?: SectionPageBorders;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* One section of the body story: contiguous top-level blocks plus the properties that end it.
|
|
125
|
-
*
|
|
126
|
-
* `blockStart` / `blockEndExclusive` index into `storyBlocks(part)`.
|
|
127
|
-
*/
|
|
128
|
-
interface DocumentSection {
|
|
129
|
-
readonly index: number;
|
|
130
|
-
readonly properties: SectionProperties;
|
|
131
|
-
readonly blockStart: number;
|
|
132
|
-
readonly blockEndExclusive: number;
|
|
133
|
-
}
|
|
134
|
-
/** US Letter, portrait, one-inch margins: Word's own default when a section says nothing. */
|
|
135
|
-
declare const DEFAULT_SECTION_PROPERTIES: SectionProperties;
|
|
136
|
-
/**
|
|
137
|
-
* Parse authored `w:pgNumType` without inventing schema defaults.
|
|
138
|
-
*
|
|
139
|
-
* Returns `undefined` when the element is absent. An empty element yields `{}` so callers
|
|
140
|
-
* can tell "present but unauthored" from "missing" and serialization can re-emit empty.
|
|
141
|
-
* Hostile / out-of-range attribute values are dropped rather than clamped into meaning.
|
|
142
|
-
*/
|
|
143
|
-
declare function parsePageNumbering(sectPr: OoxmlNode): SectionPageNumbering | undefined;
|
|
144
|
-
/** Parse one `w:sectPr` into geometry/break properties (null reads as Word's defaults). */
|
|
145
|
-
declare function parseSectionProperties(sectPr: OoxmlNode | null | undefined): SectionProperties;
|
|
146
|
-
/** `w:sectPr` nested under a paragraph's `w:pPr`, if present. */
|
|
147
|
-
declare function paragraphSectionNode(paragraph: OoxmlElement): OoxmlElement | undefined;
|
|
148
|
-
/**
|
|
149
|
-
* The section properties a part declares, or Word's defaults where it says nothing.
|
|
150
|
-
*
|
|
151
|
-
* Returns the FINAL section (body-level `w:sectPr`, else the last paragraph-level one).
|
|
152
|
-
* Multi-section geometry belongs to `enumerateDocumentSections`; chrome that needs "the
|
|
153
|
-
* document's page" still reads the last section, which is what Word's body-level sectPr is.
|
|
154
|
-
*/
|
|
155
|
-
declare function readSectionProperties(part: OoxmlPart): SectionProperties;
|
|
156
|
-
/**
|
|
157
|
-
* Split the body story into sections.
|
|
158
|
-
*
|
|
159
|
-
* A paragraph carrying `w:pPr/w:sectPr` ends the current section (that paragraph is IN the
|
|
160
|
-
* section being ended). The body-level `w:sectPr` ends the final section. A document with
|
|
161
|
-
* neither yields one section of Word defaults covering every block.
|
|
162
|
-
*
|
|
163
|
-
* Enumeration is capped at {@link MAX_DOCUMENT_SECTIONS}. Further paragraph-level section
|
|
164
|
-
* breaks are ignored and remaining blocks fold into the last accepted section (fail closed).
|
|
165
|
-
*
|
|
166
|
-
* `displayMode` MUST match the one the caller passes to `storyBlocks`. `blockStart` /
|
|
167
|
-
* `blockEndExclusive` are indices into that list, and the list changes shape with the mode:
|
|
168
|
-
* the proposed view drops a paragraph whose mark and content a revision both removed. Slicing
|
|
169
|
-
* a filtered list with indices counted over an unfiltered one puts body text under another
|
|
170
|
-
* section's page geometry — the wrong paper size, the wrong margins, the wrong header.
|
|
171
|
-
*/
|
|
172
|
-
declare function enumerateDocumentSections(part: OoxmlPart, displayMode?: RevisionDisplayMode, authorFilter?: RevisionAuthorFilter): DocumentSection[];
|
|
173
|
-
/**
|
|
174
|
-
* Canonical section index behind each section in a revision-projected body.
|
|
175
|
-
*
|
|
176
|
-
* A removed paragraph mark can collapse an entire section. The projected section keeps the
|
|
177
|
-
* surviving paragraph's geometry, while package APIs such as header/footer resolution remain
|
|
178
|
-
* indexed over the canonical tree. This bridge prevents those two index spaces from being
|
|
179
|
-
* paired positionally.
|
|
180
|
-
*/
|
|
181
|
-
declare function projectedSectionSourceIndexes(part: OoxmlPart, displayMode?: RevisionDisplayMode, authorFilter?: RevisionAuthorFilter): readonly number[];
|
|
182
|
-
/**
|
|
183
|
-
* Every section in a document, with a flag saying whether the list was cut short.
|
|
184
|
-
*
|
|
185
|
-
* `truncated` is reported rather than silent: section count comes from a file, so a crafted
|
|
186
|
-
* document declaring thousands of paragraph-level `w:sectPr` marks is bounded, and a reader
|
|
187
|
-
* should be able to tell that happened.
|
|
188
|
-
*/
|
|
189
|
-
interface DocumentSectionsEnumeration {
|
|
190
|
-
readonly sections: DocumentSection[];
|
|
191
|
-
/** True when paragraph-level sectPr marks beyond {@link MAX_DOCUMENT_SECTIONS} were dropped. */
|
|
192
|
-
readonly truncated: boolean;
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Like {@link enumerateDocumentSections}, but reports whether the section bound clipped
|
|
196
|
-
* hostile input. Prefer the plain enumerator for normal layout; use this when a caller
|
|
197
|
-
* needs a named fail-closed diagnostic.
|
|
198
|
-
*/
|
|
199
|
-
declare function enumerateDocumentSectionsBounded(part: OoxmlPart, displayMode?: RevisionDisplayMode, authorFilter?: RevisionAuthorFilter): DocumentSectionsEnumeration;
|
|
200
|
-
/**
|
|
201
|
-
* Section properties as the geometry layout paginates against.
|
|
202
|
-
*
|
|
203
|
-
* The gutter is added to the LEFT margin: it is binding allowance, extra space on the inner
|
|
204
|
-
* edge, and folding it into the content width instead would silently narrow every line.
|
|
205
|
-
*
|
|
206
|
-
* Top and bottom keep the authored sign of `w:pgMar`: a negative value is an exact inset that
|
|
207
|
-
* header and footer height never moves. Read them through `page-body-margins.ts`.
|
|
208
|
-
*/
|
|
209
|
-
declare function geometryOfSection(section: SectionProperties): PageGeometry;
|
|
1
|
+
import { S as SemanticPosition, C as CaretGeometry, a as SemanticSelection } from './semantic-interaction-kR_QB845.js';
|
|
2
|
+
import { I as InlineDrawingRecord, A as AnchoredDrawingRecord, T as TextMeasurer, L as LineRecord, g as StyleSpanRecord, S as SemanticLayout, C as ContentControlBoundaryRecord, h as TableRowFragmentRecord, i as TableCellFragmentRecord } from './semantic-records-DQmumPgL.js';
|
|
210
3
|
|
|
211
4
|
/** A point in the coordinate space named by the function taking it. */
|
|
212
5
|
interface HitPoint {
|
|
@@ -310,8 +103,10 @@ declare function hitTestSheet(layout: SemanticLayout, point: HitPoint, options?:
|
|
|
310
103
|
*/
|
|
311
104
|
declare function contentControlAtPoint(layout: SemanticLayout, pageIndex: number, point: HitPoint): ContentControlBoundaryRecord | null;
|
|
312
105
|
/**
|
|
313
|
-
* Logical line end, excluding
|
|
314
|
-
*
|
|
106
|
+
* Logical line end, excluding a hard break, whose following position belongs to the next line.
|
|
107
|
+
* Trailing spaces of a soft wrap stay on the line: the end is after them, where End puts the
|
|
108
|
+
* caret, and the caret shows on this line through its line affinity. Page breaks are excluded
|
|
109
|
+
* even on the paragraph's last line.
|
|
315
110
|
*/
|
|
316
111
|
declare function lineEndOffset(layout: SemanticLayout, line: LineRecord): number;
|
|
317
112
|
/**
|
|
@@ -458,5 +253,5 @@ interface TableCellContext {
|
|
|
458
253
|
*/
|
|
459
254
|
declare function tableContextAt(layout: SemanticLayout, paragraphId: string): TableCellContext | null;
|
|
460
255
|
|
|
461
|
-
export {
|
|
462
|
-
export type { CellSelection as C, HitPoint as H,
|
|
256
|
+
export { DEFAULT_VERTICAL_WEIGHT as D, caretBoxOnLine as e, cellSelectionBetween as f, cellSelectionRects as g, cellSelectionText as h, contentControlAtPoint as i, findDrawingOverlayFrameInLayout as j, hitTestPage as k, hitTestSheet as l, isFurniturePoint as m, lineEndOffset as n, paragraphsInCells as o, pageAtY as p, spansInCells as q, spanOffsetX as s, tableContextAt as t };
|
|
257
|
+
export type { CellSelection as C, HitPoint as H, PlacedCell as P, SemanticHit as S, TableCellAddress as T, DrawingOverlayFrame as a, HitTestOptions as b, SemanticHitDrawing as c, TableCellContext as d };
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
import { T as TextMeasurer, S as SemanticLayout, B as BlockFragmentRecord, C as ContentControlBoundaryRecord,
|
|
1
|
+
import { T as TextMeasurer, S as SemanticLayout, B as BlockFragmentRecord, C as ContentControlBoundaryRecord, g as StyleSpanRecord } from './semantic-records-DQmumPgL.js';
|
|
2
|
+
|
|
3
|
+
/** How `moveCaret` resolves a motion. */
|
|
4
|
+
interface MoveCaretOptions {
|
|
5
|
+
/** Precomputed active-story stops; body navigation keeps the indexed default. */
|
|
6
|
+
readonly stops?: readonly CaretGeometry[];
|
|
7
|
+
readonly measurer?: TextMeasurer;
|
|
8
|
+
/**
|
|
9
|
+
* The line the caret shows on (its line affinity), for an offset that ends one wrapped line
|
|
10
|
+
* and starts the next. Home, End, Up, and Down then start from that line. A line that does
|
|
11
|
+
* not hold the offset is ignored, and the default line for the offset applies.
|
|
12
|
+
*/
|
|
13
|
+
readonly lineId?: string;
|
|
14
|
+
}
|
|
2
15
|
|
|
3
16
|
/** A caret position in the model. */
|
|
4
17
|
interface SemanticPosition {
|
|
@@ -56,35 +69,12 @@ interface CaretAtOptions {
|
|
|
56
69
|
* (shared header/footer copies).
|
|
57
70
|
*/
|
|
58
71
|
readonly preferredPageIndex?: number;
|
|
72
|
+
/** Prefer this visual line when one model boundary has several painted occurrences. */
|
|
73
|
+
readonly preferredLineId?: string;
|
|
59
74
|
}
|
|
60
75
|
/** Geometry for one model position, or null when it is not laid out. */
|
|
61
76
|
declare function caretAt(layout: SemanticLayout, position: SemanticPosition, measurerOrOptions?: TextMeasurer | CaretAtOptions): CaretGeometry | null;
|
|
62
|
-
|
|
63
|
-
* The caret position nearest a point, in PAGE-CONTENT coordinates.
|
|
64
|
-
*
|
|
65
|
-
* Never returns null for a point inside the document: a click in the margin, past the end of
|
|
66
|
-
* a line, or below the last line still has an obvious intended caret, and refusing to answer
|
|
67
|
-
* would make those clicks do nothing.
|
|
68
|
-
*
|
|
69
|
-
* The rules live in `semantic-hit-test.ts`, which answers with the cell address and the
|
|
70
|
-
* on-glyphs flag a pointer controller needs too; this keeps the geometry-only shape for
|
|
71
|
-
* callers that want nothing else.
|
|
72
|
-
*/
|
|
73
|
-
declare function hitTestSemantic(layout: SemanticLayout, point: {
|
|
74
|
-
readonly x: number;
|
|
75
|
-
readonly y: number;
|
|
76
|
-
readonly pageIndex?: number;
|
|
77
|
-
}): CaretGeometry | null;
|
|
78
|
-
/**
|
|
79
|
-
* Innermost content-control boundary at a page-content point, or null outside every control.
|
|
80
|
-
*
|
|
81
|
-
* Prefers the deepest nesting depth when nested boundaries share geometry.
|
|
82
|
-
*/
|
|
83
|
-
declare function contentControlAtSemantic(layout: SemanticLayout, point: {
|
|
84
|
-
readonly x: number;
|
|
85
|
-
readonly y: number;
|
|
86
|
-
readonly pageIndex?: number;
|
|
87
|
-
}): ContentControlBoundaryRecord | null;
|
|
77
|
+
|
|
88
78
|
/** Layout-published content-control boundaries in document order. */
|
|
89
79
|
declare function contentControlsInLayout(layout: SemanticLayout): readonly ContentControlBoundaryRecord[];
|
|
90
80
|
/**
|
|
@@ -104,16 +94,17 @@ type NavigationCommand = 'left' | 'right' | 'up' | 'down' | 'wordLeft' | 'wordRi
|
|
|
104
94
|
declare function paragraphTextFromLayout(layout: SemanticLayout, paragraphId: string): string;
|
|
105
95
|
/** Visible deletion boundaries split words without changing canonical text offsets. */
|
|
106
96
|
declare function deletedTextBoundaries(layout: SemanticLayout, paragraphId: string): ReadonlySet<number>;
|
|
107
|
-
|
|
108
|
-
interface MoveCaretOptions {
|
|
109
|
-
/** Precomputed active-story stops; body navigation keeps the indexed default. */
|
|
110
|
-
readonly stops?: readonly CaretGeometry[];
|
|
111
|
-
readonly measurer?: TextMeasurer;
|
|
112
|
-
}
|
|
97
|
+
|
|
113
98
|
/** Move a caret; vertical movement carries a desired X through shorter lines. */
|
|
114
99
|
declare function moveCaret(layout: SemanticLayout, position: SemanticPosition, command: NavigationCommand, desiredX?: number | null, options?: MoveCaretOptions): {
|
|
115
100
|
position: SemanticPosition;
|
|
116
101
|
desiredX: number | null;
|
|
102
|
+
/**
|
|
103
|
+
* The line the caret shows on after the motion, when it is not the default line for the
|
|
104
|
+
* position (End at a wrap shows on the upper line). Pass it back as
|
|
105
|
+
* {@link MoveCaretOptions.lineId} and as `CaretAtOptions.preferredLineId`.
|
|
106
|
+
*/
|
|
107
|
+
lineId?: string;
|
|
117
108
|
} | null;
|
|
118
109
|
/**
|
|
119
110
|
* The anchor an IME composition is attached to.
|
|
@@ -140,5 +131,5 @@ declare function spansInSelection(layout: SemanticLayout, selection: SemanticSel
|
|
|
140
131
|
*/
|
|
141
132
|
order: readonly string[]): StyleSpanRecord[];
|
|
142
133
|
|
|
143
|
-
export { caretAt as d, caretStops as e, caretStopsForBlocks as f, compositionAnchor as g,
|
|
134
|
+
export { caretAt as d, caretStops as e, caretStopsForBlocks as f, compositionAnchor as g, contentControlsInLayout as h, deletedTextBoundaries as i, moveCaret as m, paragraphTextFromLayout as p, spansInSelection as s };
|
|
144
135
|
export type { CaretGeometry as C, MoveCaretOptions as M, NavigationCommand as N, SemanticPosition as S, SemanticSelection as a, SelectionRect as b, CaretAtOptions as c };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { V as ValidatedImageBytesHandle, R as RenderableImageMime } from './image-resources-BDFxcu7W.js';
|
|
1
|
+
import { c as PageRecord, q as ResolvedRevisionMarkup, C as ContentControlBoundaryRecord, S as SemanticLayout } from './semantic-records-DQmumPgL.js';
|
|
2
|
+
import { S as SemanticRootStoryKind } from './semantic-record-queries-Bsgth6lv.js';
|
|
3
|
+
import { V as ValidatedImageBytesHandle, R as RenderableImageMime } from './image-resources-tXLQShoC.js';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Everything a host can say about ONE author's presentation. Every field is optional and
|
|
@@ -137,6 +136,17 @@ interface DrawingPaintStrings {
|
|
|
137
136
|
readonly pendingResource: string;
|
|
138
137
|
}
|
|
139
138
|
|
|
139
|
+
/** Localized break labels; adapters supply i18n-backed implementations. */
|
|
140
|
+
interface BreakMarkStrings {
|
|
141
|
+
readonly pageBreak: string;
|
|
142
|
+
readonly columnBreak: string;
|
|
143
|
+
readonly sectionBreakContinuous: string;
|
|
144
|
+
readonly sectionBreakNextPage: string;
|
|
145
|
+
readonly sectionBreakEvenPage: string;
|
|
146
|
+
readonly sectionBreakOddPage: string;
|
|
147
|
+
readonly sectionBreakNextColumn: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
140
150
|
/** Which bars a paint draws. @public */
|
|
141
151
|
type ChangeBarsMode = 'all-markup' | 'simple-markup' | 'none';
|
|
142
152
|
/** Which story a bar stands beside; the header-editing chrome dims every other story's. */
|
|
@@ -220,6 +230,8 @@ interface PaintOptions {
|
|
|
220
230
|
readonly fieldShading?: FieldShadingMode;
|
|
221
231
|
/** Paint paragraph-end and manual-line-break furniture. Tracked marks also follow Show/Hide. */
|
|
222
232
|
readonly showParagraphMarks?: boolean;
|
|
233
|
+
/** Localized labels for the break furniture paragraph marks show (defaults to English). */
|
|
234
|
+
readonly breakMarkStrings?: BreakMarkStrings;
|
|
223
235
|
/** See {@link PaintContext.shadeFormFields}. */
|
|
224
236
|
readonly shadeFormFields?: boolean;
|
|
225
237
|
/**
|
|
@@ -323,4 +335,4 @@ interface PaintOptions {
|
|
|
323
335
|
declare function paintSemanticLayout(container: HTMLElement, layout: SemanticLayout, options?: PaintOptions): void;
|
|
324
336
|
|
|
325
337
|
export { DEFAULT_FIELD_SHADING as D, collectPageChangeBars as e, paintSemanticLayout as p };
|
|
326
|
-
export type { ChangeBarsMode as C, FieldShadingMode as F, PageChangeBars as P, ReviewAuthorInfo as R, PaintOptions as a, RevisionAuthorAssignments as b, RevisionAuthorStyle as c, RevisionStyles as d, DrawingPaintStrings as f };
|
|
338
|
+
export type { BreakMarkStrings as B, ChangeBarsMode as C, FieldShadingMode as F, PageChangeBars as P, ReviewAuthorInfo as R, PaintOptions as a, RevisionAuthorAssignments as b, RevisionAuthorStyle as c, RevisionStyles as d, DrawingPaintStrings as f };
|
package/dist/{semantic-record-queries-1du6lQqS.d.ts → semantic-record-queries-Bsgth6lv.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as InlineDrawingRecord, A as AnchoredDrawingRecord, P as ParagraphFragmentRecord, L as LineRecord,
|
|
1
|
+
import { I as InlineDrawingRecord, A as AnchoredDrawingRecord, P as ParagraphFragmentRecord, L as LineRecord, c as PageRecord, N as NoteAreaRecord, d as LayoutBox, H as HeaderFooterStoryRecord, e as NoteStoryRecord, B as BlockFragmentRecord, S as SemanticLayout, C as ContentControlBoundaryRecord, f as ContentControlLock } from './semantic-records-DQmumPgL.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Depth-first paragraph fragments of one page, in reading order.
|