@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.
@@ -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 uiApiForEmit = useUiApi();
286
+ const uiApi = useUiApi();
287
287
  const shellChannels = useUiShellChannels();
288
288
  React.useEffect(() => {
289
- if (!uiApiForEmit || !shellChannels) return;
290
- shellChannels.viewport.emit(uiApiForEmit.viewport.get());
289
+ if (!uiApi || !shellChannels) return;
290
+ shellChannels.viewport.emit(uiApi.viewport.get());
291
291
  shellChannels.overlays.emit({ kind: "page", value: 0 });
292
- }, [renderFrameRevision, uiApiForEmit, shellChannels]);
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
- // Slice 4C rail-seam inversion: segments now come from the
1271
- // Layer-06 workflow facet. Layout facet no longer exposes
1272
- // `getAllScopeRailSegments` (methods removed in v40 / Slice 4C).
1273
- scopeRailSegments: props.workflowFacet?.getAllRailSegments() ?? [],
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 });