@beyondwork/docx-react-component 1.0.104 → 1.0.105
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/package.json +1 -1
- package/src/api/public-types.ts +3 -0
- package/src/api/v3/ai/_pe2-evidence.ts +153 -0
- package/src/api/v3/ai/bundle.ts +13 -5
- package/src/api/v3/ai/inspect.ts +7 -1
- package/src/api/v3/ai/replacement.ts +113 -0
- package/src/api/v3/ui/_types.ts +86 -0
- package/src/api/v3/ui/index.ts +5 -0
- package/src/api/v3/ui/overlays.ts +104 -0
- package/src/model/layout/index.ts +3 -0
- package/src/model/layout/page-graph-types.ts +89 -0
- package/src/model/layout/runtime-page-graph-types.ts +13 -0
- package/src/runtime/event-refresh-hints.ts +33 -6
- package/src/runtime/geometry/geometry-facet.ts +9 -1
- package/src/runtime/geometry/geometry-index.ts +388 -11
- package/src/runtime/geometry/geometry-types.ts +6 -0
- package/src/runtime/geometry/object-handles.ts +7 -4
- package/src/runtime/layout/layout-engine-instance.ts +2 -0
- package/src/runtime/layout/layout-engine-version.ts +29 -1
- package/src/runtime/layout/page-graph.ts +695 -10
- package/src/runtime/layout/project-block-fragments.ts +101 -1
- package/src/runtime/layout/public-facet.ts +152 -0
- package/src/runtime/prerender/graph-canonicalize.ts +14 -0
- package/src/ui/ui-controller-factory.ts +11 -0
|
@@ -107,6 +107,7 @@ export interface RuntimeLayoutDivergence {
|
|
|
107
107
|
message: string;
|
|
108
108
|
regionKinds?: RuntimePageRegion["kind"][];
|
|
109
109
|
fragmentIds?: string[];
|
|
110
|
+
objectIds?: string[];
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
export interface RuntimePageFrame {
|
|
@@ -117,10 +118,90 @@ export interface RuntimePageFrame {
|
|
|
117
118
|
displayPageNumber: number;
|
|
118
119
|
physicalBoundsTwips: RuntimeTwipsRect;
|
|
119
120
|
regions: RuntimeResolvedRegions;
|
|
121
|
+
pageLocalStories: RuntimePageLocalStoryInstance[];
|
|
120
122
|
divergenceIds: string[];
|
|
121
123
|
signature: string;
|
|
122
124
|
}
|
|
123
125
|
|
|
126
|
+
export interface RuntimePageLocalStoryInstance {
|
|
127
|
+
instanceId: string;
|
|
128
|
+
storyKey: string;
|
|
129
|
+
pageId: string;
|
|
130
|
+
kind: "header" | "footer";
|
|
131
|
+
variant: "default" | "first" | "even" | "odd";
|
|
132
|
+
relationshipId: string;
|
|
133
|
+
sectionIndex?: number;
|
|
134
|
+
resolvedFields: RuntimeResolvedStoryField[];
|
|
135
|
+
anchoredObjects: RuntimeStoryAnchoredObject[];
|
|
136
|
+
measuredFrameHeightTwips: number;
|
|
137
|
+
signature: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface RuntimeResolvedStoryField {
|
|
141
|
+
fieldId: string;
|
|
142
|
+
family: string;
|
|
143
|
+
displayText: string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface RuntimeStoryAnchoredObject {
|
|
147
|
+
objectId: string;
|
|
148
|
+
sourceType:
|
|
149
|
+
| "image"
|
|
150
|
+
| "drawing-frame"
|
|
151
|
+
| "chart-preview"
|
|
152
|
+
| "smartart-preview"
|
|
153
|
+
| "shape"
|
|
154
|
+
| "wordart"
|
|
155
|
+
| "vml-shape"
|
|
156
|
+
| "ole-embed"
|
|
157
|
+
| "opaque-inline";
|
|
158
|
+
display: "inline" | "floating" | "unknown";
|
|
159
|
+
extentTwips?: {
|
|
160
|
+
widthTwips: number;
|
|
161
|
+
heightTwips: number;
|
|
162
|
+
};
|
|
163
|
+
relationshipIds?: readonly string[];
|
|
164
|
+
preserveOnly: boolean;
|
|
165
|
+
divergenceIds: string[];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export type RuntimeLayoutContinuationCursor =
|
|
169
|
+
| RuntimeParagraphContinuationCursor
|
|
170
|
+
| RuntimeTableContinuationCursor;
|
|
171
|
+
|
|
172
|
+
export interface RuntimeParagraphContinuationCursor {
|
|
173
|
+
kind: "paragraph";
|
|
174
|
+
sequenceIndex: number;
|
|
175
|
+
sliceCount: number;
|
|
176
|
+
lineRange: {
|
|
177
|
+
from: number;
|
|
178
|
+
to: number;
|
|
179
|
+
totalLines: number;
|
|
180
|
+
};
|
|
181
|
+
continuesFromPreviousPage: boolean;
|
|
182
|
+
continuesToNextPage: boolean;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface RuntimeTableContinuationCursor {
|
|
186
|
+
kind: "table";
|
|
187
|
+
sequenceIndex: number;
|
|
188
|
+
sliceCount: number;
|
|
189
|
+
rowRange: {
|
|
190
|
+
from: number;
|
|
191
|
+
to: number;
|
|
192
|
+
totalRows: number;
|
|
193
|
+
};
|
|
194
|
+
continuesFromPreviousPage: boolean;
|
|
195
|
+
continuesToNextPage: boolean;
|
|
196
|
+
repeatedHeaderRowIndexes: readonly number[];
|
|
197
|
+
verticalMergeCarry: readonly RuntimeTableVerticalMergeCarry[];
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export interface RuntimeTableVerticalMergeCarry {
|
|
201
|
+
columnIndex: number;
|
|
202
|
+
restartRowIndex: number;
|
|
203
|
+
}
|
|
204
|
+
|
|
124
205
|
// ---------------------------------------------------------------------------
|
|
125
206
|
// Fragment types
|
|
126
207
|
// ---------------------------------------------------------------------------
|
|
@@ -176,6 +257,14 @@ export interface RuntimeBlockFragment {
|
|
|
176
257
|
to: number;
|
|
177
258
|
totalRows: number;
|
|
178
259
|
};
|
|
260
|
+
/**
|
|
261
|
+
* PE2 Slice 3 — typed continuation cursor for fragments that render a
|
|
262
|
+
* logical block over multiple page/column frames. Existing slice fields
|
|
263
|
+
* remain for compatibility; this cursor makes repeated-header,
|
|
264
|
+
* line/row-range, and vertical-merge carry explicit for debug/render
|
|
265
|
+
* consumers without reading DOM or canonical tables again.
|
|
266
|
+
*/
|
|
267
|
+
continuation?: RuntimeLayoutContinuationCursor;
|
|
179
268
|
/**
|
|
180
269
|
* Slice 5 — opaque style-chain ref derived from the block's `styleId`.
|
|
181
270
|
* Used by `analyzeStylesChange` to bound invalidation to the first page
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
* layer (`src/runtime/layout/page-graph.ts`).
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import type {
|
|
18
|
+
FooterDocument,
|
|
19
|
+
HeaderDocument,
|
|
20
|
+
} from "../canonical-document.ts";
|
|
17
21
|
import type {
|
|
18
22
|
RuntimeBlockFragment,
|
|
19
23
|
RuntimeLayoutDivergence,
|
|
@@ -115,4 +119,13 @@ export interface BuildPageGraphInput {
|
|
|
115
119
|
* `page-${revision}-${index}` pageId in advance.
|
|
116
120
|
*/
|
|
117
121
|
noteAllocationsByPageIndex?: ReadonlyMap<number, RuntimeNoteAllocation[]>;
|
|
122
|
+
/**
|
|
123
|
+
* Optional canonical header/footer parts. When present, `buildPageGraph`
|
|
124
|
+
* resolves page-instance fields inside page-local header/footer story
|
|
125
|
+
* records without making render/UI consumers re-walk subparts.
|
|
126
|
+
*/
|
|
127
|
+
subParts?: {
|
|
128
|
+
headers?: ReadonlyArray<HeaderDocument>;
|
|
129
|
+
footers?: ReadonlyArray<FooterDocument>;
|
|
130
|
+
};
|
|
118
131
|
}
|
|
@@ -26,7 +26,6 @@ export function describeEventImpact(
|
|
|
26
26
|
case "workflow_overlay_changed":
|
|
27
27
|
case "workflow_active_work_item_changed":
|
|
28
28
|
case "workflow_shared_state_changed":
|
|
29
|
-
case "workflow_visibility_policy_changed":
|
|
30
29
|
case "workflow_markup_mode_policy_changed":
|
|
31
30
|
return {
|
|
32
31
|
invalidate: [
|
|
@@ -40,9 +39,27 @@ export function describeEventImpact(
|
|
|
40
39
|
staleTargets: ["anchors"],
|
|
41
40
|
changeKinds: ["workflow"],
|
|
42
41
|
};
|
|
42
|
+
case "workflow_visibility_policy_changed":
|
|
43
|
+
return {
|
|
44
|
+
invalidate: [
|
|
45
|
+
"workflowScope",
|
|
46
|
+
"workflowMarkup",
|
|
47
|
+
"reviewWork",
|
|
48
|
+
"chunks",
|
|
49
|
+
"contextAnalytics",
|
|
50
|
+
],
|
|
51
|
+
staleTargets: ["none"],
|
|
52
|
+
changeKinds: ["workflow"],
|
|
53
|
+
};
|
|
43
54
|
case "workflow_metadata_changed":
|
|
44
55
|
return {
|
|
45
|
-
invalidate: [
|
|
56
|
+
invalidate: [
|
|
57
|
+
"workflowMarkup",
|
|
58
|
+
"locations",
|
|
59
|
+
"reviewWork",
|
|
60
|
+
"chunks",
|
|
61
|
+
"contextAnalytics",
|
|
62
|
+
],
|
|
46
63
|
staleTargets: ["anchors"],
|
|
47
64
|
changeKinds: ["workflow"],
|
|
48
65
|
};
|
|
@@ -50,10 +67,6 @@ export function describeEventImpact(
|
|
|
50
67
|
case "change_accepted":
|
|
51
68
|
case "change_rejected":
|
|
52
69
|
case "suggestion_authored":
|
|
53
|
-
case "suggestion_updated":
|
|
54
|
-
case "comment_added":
|
|
55
|
-
case "comment_resolved":
|
|
56
|
-
case "comments_changed":
|
|
57
70
|
return {
|
|
58
71
|
invalidate: [
|
|
59
72
|
"render",
|
|
@@ -72,6 +85,20 @@ export function describeEventImpact(
|
|
|
72
85
|
staleTargets: ["search_results", "anchors"],
|
|
73
86
|
changeKinds: ["content", "review", "structure"],
|
|
74
87
|
};
|
|
88
|
+
case "suggestion_updated":
|
|
89
|
+
return {
|
|
90
|
+
invalidate: ["trackedChanges", "reviewWork", "chunks", "contextAnalytics"],
|
|
91
|
+
staleTargets: ["none"],
|
|
92
|
+
changeKinds: ["review"],
|
|
93
|
+
};
|
|
94
|
+
case "comment_added":
|
|
95
|
+
case "comment_resolved":
|
|
96
|
+
case "comments_changed":
|
|
97
|
+
return {
|
|
98
|
+
invalidate: ["comments", "reviewWork", "chunks", "contextAnalytics"],
|
|
99
|
+
staleTargets: ["none"],
|
|
100
|
+
changeKinds: ["review"],
|
|
101
|
+
};
|
|
75
102
|
case "warning_added":
|
|
76
103
|
case "warning_cleared":
|
|
77
104
|
case "error":
|
|
@@ -259,7 +259,15 @@ export function createGeometryFacet(
|
|
|
259
259
|
getGeometryCoverage() {
|
|
260
260
|
const kernel = input.renderKernel?.();
|
|
261
261
|
if (!kernel) return createUnavailableGeometryCoverage();
|
|
262
|
-
|
|
262
|
+
const frame = kernel.getRenderFrame();
|
|
263
|
+
const canonicalDocument = input.getCanonicalDocument?.() ?? null;
|
|
264
|
+
if (canonicalDocument) {
|
|
265
|
+
return (
|
|
266
|
+
projectGeometryIndexFromFrame(frame, { canonicalDocument })?.coverage ??
|
|
267
|
+
createUnavailableGeometryCoverage()
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
return summarizeGeometryCoverageFromFrame(frame);
|
|
263
271
|
},
|
|
264
272
|
|
|
265
273
|
hitTest(point) {
|