@beyondwork/docx-react-component 1.0.93 → 1.0.95
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/v3/ai/replacement.ts +3 -3
- package/src/api/v3/runtime/formatting.ts +3 -3
- package/src/core/commands/formatting-commands.ts +146 -3
- package/src/core/state/text-transaction.ts +6 -3
- package/src/runtime/document-runtime.ts +3 -0
- package/src/runtime/scopes/semantic-scope-types.ts +9 -0
- package/src/ui/WordReviewEditor.tsx +9 -14
- package/src/ui/editor-shell-view.tsx +4 -1
- package/src/ui-tailwind/chrome/tw-display-mode-selector.tsx +109 -42
- package/src/ui-tailwind/chrome-overlay/tw-chrome-overlay.tsx +30 -5
- package/src/ui-tailwind/chrome-overlay/tw-scope-rail-layer.tsx +46 -15
- package/src/ui-tailwind/editor-surface/pm-state-from-snapshot.ts +1 -7
- package/src/ui-tailwind/review-workspace/use-scope-card-state.ts +34 -12
- package/src/ui-tailwind/toolbar/tw-role-action-region.tsx +78 -16
- package/src/ui-tailwind/toolbar/tw-toolbar-icon-button.tsx +4 -0
- package/src/ui-tailwind/toolbar/tw-toolbar.tsx +389 -109
- package/src/ui-tailwind/tw-review-workspace.tsx +20 -8
|
@@ -283,13 +283,20 @@ export function TwReviewWorkspace(inputProps: TwReviewWorkspaceProps) {
|
|
|
283
283
|
// changed, re-read any attached anchors" marker. Per-query
|
|
284
284
|
// invalidation fan-out is a Phase Q follow-up — the geometry
|
|
285
285
|
// facet does not yet expose per-kind invalidation events.
|
|
286
|
-
const
|
|
286
|
+
const uiApi = useUiApi();
|
|
287
287
|
const shellChannels = useUiShellChannels();
|
|
288
288
|
React.useEffect(() => {
|
|
289
|
-
if (!
|
|
290
|
-
shellChannels.viewport.emit(
|
|
289
|
+
if (!uiApi || !shellChannels) return;
|
|
290
|
+
shellChannels.viewport.emit(uiApi.viewport.get());
|
|
291
291
|
shellChannels.overlays.emit({ kind: "page", value: 0 });
|
|
292
|
-
}, [renderFrameRevision,
|
|
292
|
+
}, [renderFrameRevision, uiApi, shellChannels]);
|
|
293
|
+
const scopeRailSegments = useMemo(
|
|
294
|
+
() =>
|
|
295
|
+
uiApi?.scope.rail().segments ??
|
|
296
|
+
props.workflowFacet?.getAllRailSegments() ??
|
|
297
|
+
[],
|
|
298
|
+
[uiApi, props.workflowFacet, renderFrameRevision],
|
|
299
|
+
);
|
|
293
300
|
const headings = props.documentNavigation?.headings ?? [];
|
|
294
301
|
const headerVariant = snapshot.pageLayout?.headerVariants[0]?.variant ?? "default";
|
|
295
302
|
const footerVariant = snapshot.pageLayout?.footerVariants[0]?.variant ?? "default";
|
|
@@ -372,6 +379,10 @@ export function TwReviewWorkspace(inputProps: TwReviewWorkspaceProps) {
|
|
|
372
379
|
snapshot.readOnly ||
|
|
373
380
|
snapshot.activeStory.kind !== "main" ||
|
|
374
381
|
effectiveSelectionMode !== "edit";
|
|
382
|
+
const hasEditableSelectionTarget =
|
|
383
|
+
viewState.isFocused &&
|
|
384
|
+
viewState.selection.activeRange.kind === "range" &&
|
|
385
|
+
viewState.activeObjectFrame === null;
|
|
375
386
|
const hasSidebarPanelAccess = Boolean(
|
|
376
387
|
props.onReviewSidebarTrackedChanges || props.onReviewSidebarComments,
|
|
377
388
|
);
|
|
@@ -749,6 +760,7 @@ export function TwReviewWorkspace(inputProps: TwReviewWorkspaceProps) {
|
|
|
749
760
|
interactionPolicy={toolbarInteractionPolicy}
|
|
750
761
|
scopedChromePolicy={scopedChromePolicy}
|
|
751
762
|
compactMode={responsiveChrome.isNarrow}
|
|
763
|
+
hasEditableSelectionTarget={hasEditableSelectionTarget}
|
|
752
764
|
onOpenHealthRail={() => {
|
|
753
765
|
setReviewRailOpen(true);
|
|
754
766
|
props.onActiveRailTabChange?.("health");
|
|
@@ -1267,10 +1279,10 @@ export function TwReviewWorkspace(inputProps: TwReviewWorkspaceProps) {
|
|
|
1267
1279
|
onRejectRevision: props.onRejectRevision,
|
|
1268
1280
|
onAcceptAllChanges: props.onAcceptAllChanges,
|
|
1269
1281
|
onRejectAllChanges: props.onRejectAllChanges,
|
|
1270
|
-
//
|
|
1271
|
-
//
|
|
1272
|
-
//
|
|
1273
|
-
scopeRailSegments
|
|
1282
|
+
// Layer 11 closeout: mounted workspace chrome reads scope
|
|
1283
|
+
// rail data through `api.ui.scope.rail()`, with the workflow
|
|
1284
|
+
// facet retained as the no-provider fallback.
|
|
1285
|
+
scopeRailSegments,
|
|
1274
1286
|
activeScopeId,
|
|
1275
1287
|
onOpenScope: (segment) => {
|
|
1276
1288
|
handleScopeStripeClick({ scopeId: segment.scopeId });
|