@beyondwork/docx-react-component 1.0.106 → 1.0.108
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 +19 -5
- package/src/api/geometry-overlay-rects.ts +5 -0
- package/src/api/package-version.ts +1 -1
- package/src/api/page-anchor-id.ts +5 -0
- package/src/api/public-types.ts +16 -9
- package/src/api/table-node-specs.ts +6 -0
- package/src/api/v3/_create.ts +2 -1
- package/src/api/v3/_page-anchor-id.ts +52 -0
- package/src/api/v3/_runtime-handle.ts +92 -1
- package/src/api/v3/ai/_audit-time.ts +5 -0
- package/src/api/v3/ai/_pe2-evidence.ts +38 -0
- package/src/api/v3/ai/attach.ts +7 -2
- package/src/api/v3/ai/replacement.ts +101 -18
- package/src/api/v3/ai/resolve.ts +2 -2
- package/src/api/v3/ai/review.ts +177 -3
- package/src/api/v3/index.ts +1 -0
- package/src/api/v3/runtime/collab.ts +462 -0
- package/src/api/v3/runtime/document.ts +503 -20
- package/src/api/v3/runtime/geometry.ts +97 -0
- package/src/api/v3/runtime/layout.ts +744 -0
- package/src/api/v3/runtime/perf-probe.ts +14 -0
- package/src/api/v3/runtime/viewport.ts +9 -8
- package/src/api/v3/ui/_types.ts +149 -55
- package/src/api/v3/ui/chrome-preset-model.ts +5 -5
- package/src/api/v3/ui/debug.ts +115 -2
- package/src/api/v3/ui/index.ts +13 -0
- package/src/api/v3/ui/overlays.ts +0 -8
- package/src/api/v3/ui/surface.ts +56 -0
- package/src/api/v3/ui/viewport.ts +22 -9
- package/src/core/commands/image-commands.ts +1 -0
- package/src/core/commands/index.ts +6 -0
- package/src/core/schema/text-schema.ts +43 -5
- package/src/core/selection/mapping.ts +8 -1
- package/src/core/selection/review-anchors.ts +5 -1
- package/src/core/state/text-transaction.ts +8 -2
- package/src/io/export/serialize-revisions.ts +149 -1
- package/src/io/normalize/normalize-text.ts +6 -0
- package/src/io/ooxml/parse-bookmark-references.ts +55 -0
- package/src/io/ooxml/parse-fields.ts +24 -2
- package/src/io/ooxml/parse-headers-footers.ts +38 -5
- package/src/io/ooxml/parse-main-document.ts +153 -9
- package/src/io/ooxml/parse-numbering.ts +20 -0
- package/src/io/ooxml/parse-revisions.ts +19 -8
- package/src/io/opc/package-reader.ts +98 -8
- package/src/model/anchor.ts +4 -3
- package/src/model/canonical-document.ts +220 -2
- package/src/model/canonical-hash.ts +221 -0
- package/src/model/canonical-layout-inputs.ts +245 -6
- package/src/model/layout/index.ts +1 -0
- package/src/model/layout/page-graph-types.ts +118 -1
- package/src/model/review/revision-types.ts +14 -3
- package/src/preservation/store.ts +20 -4
- package/src/review/README.md +1 -1
- package/src/review/store/revision-actions.ts +14 -2
- package/src/runtime/collab/event-types.ts +67 -1
- package/src/runtime/collab/runtime-collab-sync.ts +177 -5
- package/src/runtime/diagnostics/layout-guard-warning.ts +18 -0
- package/src/runtime/document-heading-outline.ts +147 -0
- package/src/runtime/document-navigation.ts +8 -243
- package/src/runtime/document-runtime.ts +240 -97
- package/src/runtime/edit-dispatch/dispatch-text-command.ts +11 -0
- package/src/runtime/formatting/layout-inputs.ts +38 -5
- package/src/runtime/formatting/numbering/geometry.ts +28 -2
- package/src/runtime/geometry/adjacent-geometry-intake.ts +835 -0
- package/src/runtime/geometry/caret-geometry.ts +5 -6
- package/src/runtime/geometry/geometry-facet.ts +60 -10
- package/src/runtime/geometry/geometry-index.ts +591 -20
- package/src/runtime/geometry/geometry-types.ts +59 -0
- package/src/runtime/geometry/hit-test.ts +11 -1
- package/src/runtime/geometry/overlay-rects.ts +5 -3
- package/src/runtime/geometry/project-anchors.ts +1 -1
- package/src/runtime/geometry/word-layout-v2-line-intake.ts +323 -0
- package/src/runtime/layout/index.ts +6 -0
- package/src/runtime/layout/layout-engine-instance.ts +6 -1
- package/src/runtime/layout/layout-engine-version.ts +181 -16
- package/src/runtime/layout/layout-facet-types.ts +6 -0
- package/src/runtime/layout/page-graph.ts +21 -4
- package/src/runtime/layout/paginated-layout-engine.ts +139 -15
- package/src/runtime/layout/project-block-fragments.ts +265 -7
- package/src/runtime/layout/public-facet.ts +78 -24
- package/src/runtime/layout/table-row-continuation-contract.ts +107 -0
- package/src/runtime/layout/table-row-split.ts +92 -35
- package/src/runtime/prerender/cache-envelope.ts +2 -2
- package/src/runtime/prerender/cache-key.ts +5 -4
- package/src/runtime/prerender/customxml-cache.ts +0 -1
- package/src/runtime/render/render-kernel.ts +1 -1
- package/src/runtime/revision-runtime.ts +112 -10
- package/src/runtime/scopes/_scope-dependencies.ts +1 -0
- package/src/runtime/scopes/action-validation.ts +22 -2
- package/src/runtime/scopes/capabilities.ts +316 -0
- package/src/runtime/scopes/compile-scope-bundle.ts +14 -0
- package/src/runtime/scopes/compiler-service.ts +108 -4
- package/src/runtime/scopes/content-control-evidence.ts +79 -0
- package/src/runtime/scopes/create-issue.ts +5 -5
- package/src/runtime/scopes/evidence.ts +91 -0
- package/src/runtime/scopes/formatting/apply.ts +2 -0
- package/src/runtime/scopes/geometry-evidence.ts +130 -0
- package/src/runtime/scopes/index.ts +54 -0
- package/src/runtime/scopes/issue-lifecycle.ts +224 -0
- package/src/runtime/scopes/layout-evidence.ts +374 -0
- package/src/runtime/scopes/multi-paragraph-refusal.ts +37 -0
- package/src/runtime/scopes/preservation-boundary.ts +7 -1
- package/src/runtime/scopes/replacement/apply.ts +97 -34
- package/src/runtime/scopes/scope-kinds/paragraph.ts +108 -12
- package/src/runtime/scopes/semantic-scope-types.ts +242 -3
- package/src/runtime/scopes/visualization.ts +28 -0
- package/src/runtime/surface-projection.ts +44 -5
- package/src/runtime/telemetry/perf-probe.ts +216 -0
- package/src/runtime/virtualized-rendering.ts +36 -1
- package/src/runtime/workflow/ai-issue-lifecycle.ts +253 -0
- package/src/runtime/workflow/coordinator.ts +39 -11
- package/src/runtime/workflow/derived-scope-resolver.ts +63 -9
- package/src/runtime/workflow/index.ts +3 -0
- package/src/runtime/workflow/overlay-lane-types.ts +58 -0
- package/src/runtime/workflow/overlay-lanes.ts +168 -10
- package/src/runtime/workflow/overlay-store.ts +2 -2
- package/src/runtime/workflow/redline-posture-calibration.ts +257 -0
- package/src/runtime/workflow/word-field-matrix-calibration.ts +231 -0
- package/src/session/_sync-legacy.ts +17 -27
- package/src/session/import/loader.ts +6 -4
- package/src/session/import/source-package-evidence.ts +186 -2
- package/src/session/index.ts +5 -6
- package/src/session/session.ts +30 -56
- package/src/session/types.ts +8 -13
- package/src/shell/session-bootstrap.ts +155 -81
- package/src/ui/WordReviewEditor.tsx +520 -12
- package/src/ui/editor-shell-view.tsx +14 -4
- package/src/ui/editor-surface-controller.tsx +5 -3
- package/src/ui/headless/selection-tool-resolver.ts +1 -2
- package/src/ui/presence-overlay-lane.ts +0 -1
- package/src/ui/ui-controller-factory.ts +7 -0
- package/src/ui-tailwind/chrome/build-context-menu-entries.ts +5 -1
- package/src/ui-tailwind/chrome/editor-action-registry.ts +105 -5
- package/src/ui-tailwind/chrome/editor-actions-to-palette.ts +7 -0
- package/src/ui-tailwind/chrome/layer-debug-contracts.ts +208 -0
- package/src/ui-tailwind/chrome/resolve-target-kind.ts +13 -0
- package/src/ui-tailwind/chrome/tw-alert-banner.tsx +11 -3
- package/src/ui-tailwind/chrome/tw-command-palette.tsx +36 -6
- package/src/ui-tailwind/chrome/tw-context-menu.tsx +6 -1
- package/src/ui-tailwind/chrome/tw-display-mode-selector.tsx +42 -109
- package/src/ui-tailwind/chrome/tw-inline-find-bar.tsx +26 -6
- package/src/ui-tailwind/chrome/tw-navigation-command-bar.tsx +328 -0
- package/src/ui-tailwind/chrome/tw-object-context-toolbar.tsx +8 -4
- package/src/ui-tailwind/chrome/tw-runtime-repl-dialog.tsx +129 -1
- package/src/ui-tailwind/chrome/tw-selection-tool-host.tsx +19 -5
- package/src/ui-tailwind/chrome/tw-selection-tool-structure.tsx +5 -1
- package/src/ui-tailwind/chrome/tw-workspace-chrome-host.tsx +28 -12
- package/src/ui-tailwind/chrome-overlay/tw-chrome-overlay.tsx +30 -3
- package/src/ui-tailwind/chrome-overlay/tw-object-selection-overlay.tsx +116 -10
- package/src/ui-tailwind/chrome-overlay/tw-page-stack-overlay-layer.tsx +223 -94
- package/src/ui-tailwind/chrome-overlay/tw-presence-overlay-lane.tsx +157 -0
- package/src/ui-tailwind/chrome-overlay/tw-review-overlay-lane-markers.tsx +259 -0
- package/src/ui-tailwind/chrome-overlay/tw-scope-card-layer.tsx +5 -2
- package/src/ui-tailwind/chrome-overlay/tw-substrate-overlay-lanes.tsx +314 -0
- package/src/ui-tailwind/debug/README.md +4 -1
- package/src/ui-tailwind/debug/layer11-consumer-readiness.ts +272 -0
- package/src/ui-tailwind/debug/layer11-word-field-matrix-evidence.ts +160 -0
- package/src/ui-tailwind/editor-surface/perf-probe.ts +14 -215
- package/src/ui-tailwind/editor-surface/pm-decorations.ts +42 -0
- package/src/ui-tailwind/editor-surface/pm-position-map.ts +38 -2
- package/src/ui-tailwind/editor-surface/pm-schema.ts +14 -4
- package/src/ui-tailwind/editor-surface/pm-state-from-snapshot.ts +34 -5
- package/src/ui-tailwind/editor-surface/runtime-decoration-plugin.ts +9 -19
- package/src/ui-tailwind/editor-surface/surface-build-keys.ts +2 -2
- package/src/ui-tailwind/editor-surface/tw-page-block-view.helpers.ts +145 -0
- package/src/ui-tailwind/editor-surface/tw-page-block-view.tsx +16 -11
- package/src/ui-tailwind/editor-surface/tw-prosemirror-surface.tsx +8 -10
- package/src/ui-tailwind/editor-surface/tw-table-node-view.tsx +3 -0
- package/src/ui-tailwind/page-stack/tw-page-chrome-entry.tsx +4 -2
- package/src/ui-tailwind/page-stack/tw-page-stack-chrome-layer.tsx +60 -20
- package/src/ui-tailwind/page-stack/tw-region-block-renderer.tsx +16 -11
- package/src/ui-tailwind/review/tw-health-panel.tsx +36 -17
- package/src/ui-tailwind/review/tw-review-rail.tsx +7 -4
- package/src/ui-tailwind/review-workspace/diagnostics-visibility.ts +44 -0
- package/src/ui-tailwind/review-workspace/page-shell-metrics.ts +11 -0
- package/src/ui-tailwind/review-workspace/tw-review-workspace-rail.tsx +16 -1
- package/src/ui-tailwind/review-workspace/types.ts +26 -12
- package/src/ui-tailwind/review-workspace/use-diagnostics-signal.ts +40 -11
- package/src/ui-tailwind/review-workspace/use-layout-facet-render-signal.ts +2 -1
- package/src/ui-tailwind/review-workspace/use-page-markers.ts +15 -26
- package/src/ui-tailwind/review-workspace/use-scope-card-state.ts +35 -18
- package/src/ui-tailwind/review-workspace/use-selection-toolbar-placement.ts +41 -32
- package/src/ui-tailwind/review-workspace/use-status-bar-page-facts.ts +2 -1
- package/src/ui-tailwind/review-workspace/use-workspace-side-effects.ts +2 -1
- package/src/ui-tailwind/status/tw-status-bar.tsx +6 -5
- package/src/ui-tailwind/toolbar/tw-role-action-region.tsx +52 -80
- package/src/ui-tailwind/toolbar/tw-shell-header.tsx +12 -48
- package/src/ui-tailwind/toolbar/tw-toolbar-icon-button.tsx +9 -4
- package/src/ui-tailwind/toolbar/tw-toolbar.tsx +328 -361
- package/src/ui-tailwind/tw-review-workspace.tsx +152 -286
|
@@ -113,13 +113,12 @@ export function resolveSelectionRects(
|
|
|
113
113
|
if (lo === hi) {
|
|
114
114
|
const caret = resolveCaretGeometry(frame, lo, range.story);
|
|
115
115
|
if (!caret) return [];
|
|
116
|
-
// Caret rect for a collapsed range is an exact anchor-index
|
|
117
|
-
//
|
|
116
|
+
// Caret rect position for a collapsed range is an exact anchor-index
|
|
117
|
+
// read. The placeholder-grade metadata on `CaretGeometry` (direction,
|
|
118
118
|
// baseline) applies to the caret as a whole, not to the rect's
|
|
119
|
-
// position
|
|
120
|
-
//
|
|
121
|
-
|
|
122
|
-
return [caret.rect];
|
|
119
|
+
// position, so make the rect precision explicit for downstream
|
|
120
|
+
// compositor consumers.
|
|
121
|
+
return [{ ...caret.rect, precision: "exact" }];
|
|
123
122
|
}
|
|
124
123
|
|
|
125
124
|
const lineRects = resolveLineSelectionRects(frame, lo, hi, range.story);
|
|
@@ -29,7 +29,7 @@ import type {
|
|
|
29
29
|
PublicPageRegion,
|
|
30
30
|
WordReviewEditorLayoutFacet,
|
|
31
31
|
} from "../layout/public-facet.ts";
|
|
32
|
-
import type { RenderKernel } from "../render/index.ts";
|
|
32
|
+
import type { RenderFrame, RenderKernel } from "../render/index.ts";
|
|
33
33
|
import { resolveScope } from "../workflow/scope-resolver.ts";
|
|
34
34
|
import type { ScopeRailSegment } from "../workflow/rail/compose.ts";
|
|
35
35
|
import type {
|
|
@@ -246,28 +246,78 @@ export function createGeometryFacet(
|
|
|
246
246
|
): GeometryFacet {
|
|
247
247
|
const { layoutFacet } = input;
|
|
248
248
|
const viewport = input.viewport ?? createViewport();
|
|
249
|
+
let geometryIndexCache:
|
|
250
|
+
| {
|
|
251
|
+
readonly revision: number;
|
|
252
|
+
readonly frame: RenderFrame;
|
|
253
|
+
readonly canonicalDocument:
|
|
254
|
+
| CanonicalDocument
|
|
255
|
+
| CanonicalDocumentEnvelope
|
|
256
|
+
| null;
|
|
257
|
+
readonly index: GeometryIndex | null;
|
|
258
|
+
}
|
|
259
|
+
| null = null;
|
|
260
|
+
|
|
261
|
+
const getCachedGeometryIndexForFrame = (
|
|
262
|
+
frame: RenderFrame,
|
|
263
|
+
canonicalDocument: CanonicalDocument | CanonicalDocumentEnvelope | null,
|
|
264
|
+
): GeometryIndex | null => {
|
|
265
|
+
if (
|
|
266
|
+
geometryIndexCache &&
|
|
267
|
+
geometryIndexCache.revision === frame.revision &&
|
|
268
|
+
geometryIndexCache.frame === frame &&
|
|
269
|
+
geometryIndexCache.canonicalDocument === canonicalDocument
|
|
270
|
+
) {
|
|
271
|
+
return geometryIndexCache.index;
|
|
272
|
+
}
|
|
273
|
+
const index = projectGeometryIndexFromFrame(frame, { canonicalDocument });
|
|
274
|
+
geometryIndexCache = {
|
|
275
|
+
revision: frame.revision,
|
|
276
|
+
frame,
|
|
277
|
+
canonicalDocument,
|
|
278
|
+
index,
|
|
279
|
+
};
|
|
280
|
+
return index;
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
const getCachedGeometryIndex = (): GeometryIndex | null => {
|
|
284
|
+
const kernel = input.renderKernel?.();
|
|
285
|
+
if (!kernel) {
|
|
286
|
+
geometryIndexCache = null;
|
|
287
|
+
return null;
|
|
288
|
+
}
|
|
289
|
+
return getCachedGeometryIndexForFrame(
|
|
290
|
+
kernel.getRenderFrame(),
|
|
291
|
+
input.getCanonicalDocument?.() ?? null,
|
|
292
|
+
);
|
|
293
|
+
};
|
|
249
294
|
|
|
250
295
|
return {
|
|
251
296
|
getGeometryIndex() {
|
|
252
|
-
|
|
253
|
-
if (!kernel) return null;
|
|
254
|
-
return projectGeometryIndexFromFrame(kernel.getRenderFrame(), {
|
|
255
|
-
canonicalDocument: input.getCanonicalDocument?.() ?? null,
|
|
256
|
-
});
|
|
297
|
+
return getCachedGeometryIndex();
|
|
257
298
|
},
|
|
258
299
|
|
|
259
300
|
getGeometryCoverage() {
|
|
260
301
|
const kernel = input.renderKernel?.();
|
|
261
|
-
if (!kernel)
|
|
302
|
+
if (!kernel) {
|
|
303
|
+
geometryIndexCache = null;
|
|
304
|
+
return createUnavailableGeometryCoverage();
|
|
305
|
+
}
|
|
262
306
|
const frame = kernel.getRenderFrame();
|
|
263
307
|
const canonicalDocument = input.getCanonicalDocument?.() ?? null;
|
|
264
|
-
if (
|
|
308
|
+
if (
|
|
309
|
+
geometryIndexCache &&
|
|
310
|
+
geometryIndexCache.revision === frame.revision &&
|
|
311
|
+
geometryIndexCache.frame === frame &&
|
|
312
|
+
geometryIndexCache.canonicalDocument === canonicalDocument
|
|
313
|
+
) {
|
|
265
314
|
return (
|
|
266
|
-
|
|
315
|
+
geometryIndexCache.index?.coverage ??
|
|
267
316
|
createUnavailableGeometryCoverage()
|
|
268
317
|
);
|
|
269
318
|
}
|
|
270
|
-
|
|
319
|
+
const index = getCachedGeometryIndexForFrame(frame, canonicalDocument);
|
|
320
|
+
return index?.coverage ?? summarizeGeometryCoverageFromFrame(frame);
|
|
271
321
|
},
|
|
272
322
|
|
|
273
323
|
hitTest(point) {
|