@parhelia/core 0.3.12767 → 0.3.12769
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/editor/FieldListField.js +4 -2
- package/dist/editor/FieldListField.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentEditHistoryButton.js +1 -1
- package/dist/editor/ai/terminal/components/AgentModeSelector.js +2 -2
- package/dist/editor/ai/terminal/components/AgentModeSelector.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentProfileSwitcher.js +10 -4
- package/dist/editor/ai/terminal/components/AgentProfileSwitcher.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.js +9 -14
- package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentSettingsPopover.js +1 -1
- package/dist/editor/ai/terminal/components/ContextInfoBar.js +1 -5
- package/dist/editor/ai/terminal/components/ContextInfoBar.js.map +1 -1
- package/dist/editor/bridge/protocol.d.ts +6 -0
- package/dist/editor/bridge/protocol.js.map +1 -1
- package/dist/editor/client/EditorShell.js +34 -7
- package/dist/editor/client/EditorShell.js.map +1 -1
- package/dist/editor/client/editContext.d.ts +4 -1
- package/dist/editor/client/editContext.js.map +1 -1
- package/dist/editor/client/hooks/useSocketMessageHandler.d.ts +1 -0
- package/dist/editor/client/hooks/useSocketMessageHandler.js +15 -5
- package/dist/editor/client/hooks/useSocketMessageHandler.js.map +1 -1
- package/dist/editor/client/operations.d.ts +1 -1
- package/dist/editor/client/operations.js +61 -54
- package/dist/editor/client/operations.js.map +1 -1
- package/dist/editor/client/suggestedEditFieldQueue.d.ts +2 -0
- package/dist/editor/client/suggestedEditFieldQueue.js +16 -0
- package/dist/editor/client/suggestedEditFieldQueue.js.map +1 -0
- package/dist/editor/commands/deleteVersionCommand.js +1 -1
- package/dist/editor/commands/deleteVersionCommand.js.map +1 -1
- package/dist/editor/field-types/richtext/components/ReactSlate.js +14 -1
- package/dist/editor/field-types/richtext/components/ReactSlate.js.map +1 -1
- package/dist/editor/menubar/VersionSelector.js +0 -1
- package/dist/editor/menubar/VersionSelector.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/EditControls.js +1 -2
- package/dist/editor/menubar/toolbar-sections/EditControls.js.map +1 -1
- package/dist/editor/page-editor-chrome/PageEditorChrome.js +1 -1
- package/dist/editor/page-editor-chrome/PageEditorChrome.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +12 -9
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -1
- package/dist/editor/page-editor-chrome/SuggestionHighlightings.js +136 -33
- package/dist/editor/page-editor-chrome/SuggestionHighlightings.js.map +1 -1
- package/dist/editor/page-editor-chrome/SuggestionVariantSwitcher.d.ts +6 -0
- package/dist/editor/page-editor-chrome/SuggestionVariantSwitcher.js +23 -0
- package/dist/editor/page-editor-chrome/SuggestionVariantSwitcher.js.map +1 -0
- package/dist/editor/page-editor-chrome/overlay/geometry.d.ts +8 -1
- package/dist/editor/page-editor-chrome/overlay/geometry.js +30 -0
- package/dist/editor/page-editor-chrome/overlay/geometry.js.map +1 -1
- package/dist/editor/page-viewer/EditorForm.js +6 -1
- package/dist/editor/page-viewer/EditorForm.js.map +1 -1
- package/dist/editor/page-viewer/MiniMap.js +1 -1
- package/dist/editor/page-viewer/MiniMap.js.map +1 -1
- package/dist/editor/page-viewer/PageViewerFrame.js +75 -46
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
- package/dist/editor/personalization/PersonalizationPanel.js +93 -29
- package/dist/editor/personalization/PersonalizationPanel.js.map +1 -1
- package/dist/editor/reviews/SuggestedEdit.js +30 -64
- package/dist/editor/reviews/SuggestedEdit.js.map +1 -1
- package/dist/editor/reviews/SuggestionDisplayPopover.js +76 -57
- package/dist/editor/reviews/SuggestionDisplayPopover.js.map +1 -1
- package/dist/editor/reviews/applySuggestedEditActions.d.ts +21 -0
- package/dist/editor/reviews/applySuggestedEditActions.js +242 -0
- package/dist/editor/reviews/applySuggestedEditActions.js.map +1 -0
- package/dist/editor/reviews/feedbackScrollTarget.d.ts +3 -0
- package/dist/editor/reviews/feedbackScrollTarget.js +20 -2
- package/dist/editor/reviews/feedbackScrollTarget.js.map +1 -1
- package/dist/editor/reviews/openCommentsFeedback.js +0 -3
- package/dist/editor/reviews/openCommentsFeedback.js.map +1 -1
- package/dist/editor/reviews/suggestedEditState.js +12 -1
- package/dist/editor/reviews/suggestedEditState.js.map +1 -1
- package/dist/editor/reviews/suggestionDisplayValue.d.ts +38 -1
- package/dist/editor/reviews/suggestionDisplayValue.js +99 -21
- package/dist/editor/reviews/suggestionDisplayValue.js.map +1 -1
- package/dist/editor/reviews/suggestionPatch.d.ts +10 -0
- package/dist/editor/reviews/suggestionPatch.js +17 -0
- package/dist/editor/reviews/suggestionPatch.js.map +1 -0
- package/dist/editor/services/suggestedEditsService.d.ts +17 -5
- package/dist/editor/services/suggestedEditsService.js +23 -5
- package/dist/editor/services/suggestedEditsService.js.map +1 -1
- package/dist/editor/sidebar/DictionaryEditor.js +8 -8
- package/dist/editor/sidebar/DictionaryEditor.js.map +1 -1
- package/dist/editor/ui/SharedFolderSelectorDialog.js +17 -3
- package/dist/editor/ui/SharedFolderSelectorDialog.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ import { useBridgeInlineEditing, } from "../page-editor-chrome/useBridgeInlineEd
|
|
|
10
10
|
import { createBridgeInlineEditSessionCoordinator, } from "./bridgeInlineEditSession";
|
|
11
11
|
import { getInlineAiAnchorFromBridgeToolbar, getVisibleBridgeToolbarRect, waitForVisibleBridgeToolbarRect, } from "../page-editor-chrome/bridgeInlineFormatToolbarLayout";
|
|
12
12
|
import { IFRAME_OVERLAY_BRIDGE_DRAG_GESTURE_EVENT, IFRAME_OVERLAY_BRIDGE_GEOMETRY_EVENT, IFRAME_OVERLAY_BRIDGE_SCROLL_EVENT, IframeOverlayProvider, } from "../page-editor-chrome/overlay/IframeOverlayProvider";
|
|
13
|
+
import { projectBridgeGeometryToScroll } from "../page-editor-chrome/overlay/geometry";
|
|
13
14
|
import { CANVAS_REFRESH_COMPLETED_EVENT, DEVICE_CHANGE_EVENT, useViewportChangeSignal, } from "./pageViewContext";
|
|
14
15
|
import uuid from "react-uuid";
|
|
15
16
|
import { cn } from "../../lib/utils";
|
|
@@ -30,7 +31,7 @@ import { toSitecoreDate } from "../utils/sitecoreDate";
|
|
|
30
31
|
import { pickVersionAtDate } from "../utils/versionAtDate";
|
|
31
32
|
import { BridgeClient } from "../bridge/BridgeClient";
|
|
32
33
|
import { beginPerfTrace, isPerfTraceActive, isPerfTraceEnabled, perfTraceStep, } from "../perfTrace";
|
|
33
|
-
import { getPendingFieldSuggestions, getSuggestionDisplayValue, } from "../reviews/suggestionDisplayValue";
|
|
34
|
+
import { getPendingFieldSuggestions, getSuggestionSelectionKey, getSuggestionDisplayValue, } from "../reviews/suggestionDisplayValue";
|
|
34
35
|
import { buildBridgeFieldPatchPayload, buildBridgeFieldPatchSignature, buildRemoteCaretFieldPatches, getBridgeFieldPatchValue, hasRemoteCaretDraftForField, isBridgePatchableTextField, isSuggestionPreviewPatchSignature, } from "./bridgeFieldPatch";
|
|
35
36
|
import { bridgeSelectionMatchesInteraction, resolveBridgeTextCompletionInput, } from "./bridgeTextCompletion";
|
|
36
37
|
import { logFieldValueDiagnostic, summarizeField, summarizeFieldDescriptor, summarizeFieldValue, } from "../fieldValueDiagnostics";
|
|
@@ -658,6 +659,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
658
659
|
// skipped entirely: the bridge learns the mode via setEditorMode, and a
|
|
659
660
|
// needless refresh would drop scroll position and inline-edit state.
|
|
660
661
|
const lastRenderSignatureRef = useRef(undefined);
|
|
662
|
+
const lastRenderModeRef = useRef(editContext.mode);
|
|
661
663
|
// Set when a canvas refresh (bridge patch or full reload) has been requested
|
|
662
664
|
// and its result has not landed yet. While in flight, bridgeGeometry still
|
|
663
665
|
// describes the PRE-refresh DOM — a moved component is still measured at its
|
|
@@ -810,6 +812,19 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
810
812
|
setBridgeGeometryRevision((revision) => revision + 1);
|
|
811
813
|
});
|
|
812
814
|
}, []);
|
|
815
|
+
const projectCurrentBridgeGeometryToScroll = useCallback((scroll) => {
|
|
816
|
+
const activeContext = pageViewContextRef.current;
|
|
817
|
+
const currentGeometry = activeContext?.bridgeGeometry;
|
|
818
|
+
const projectedGeometry = projectBridgeGeometryToScroll(currentGeometry, scroll);
|
|
819
|
+
if (!activeContext ||
|
|
820
|
+
!projectedGeometry ||
|
|
821
|
+
projectedGeometry === currentGeometry) {
|
|
822
|
+
return;
|
|
823
|
+
}
|
|
824
|
+
activeContext.bridgeGeometry = projectedGeometry;
|
|
825
|
+
activeContext.setBridgeGeometry(projectedGeometry);
|
|
826
|
+
scheduleBridgeGeometryRevision();
|
|
827
|
+
}, [scheduleBridgeGeometryRevision]);
|
|
813
828
|
const scheduleBridgeDomRevision = useCallback(() => {
|
|
814
829
|
if (bridgeDomRevisionRafRef.current != null)
|
|
815
830
|
return;
|
|
@@ -1014,8 +1029,13 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1014
1029
|
fieldsContextRef,
|
|
1015
1030
|
]);
|
|
1016
1031
|
const getBridgePatchDisplayValue = useCallback(({ field, structureField, itemDescriptor, preferRepositoryValue, }) => {
|
|
1017
|
-
const showSuggestions = editContext.mode === "suggestions"
|
|
1032
|
+
const showSuggestions = editContext.mode === "suggestions";
|
|
1018
1033
|
const repositoryValue = getBridgeFieldPatchValue(field);
|
|
1034
|
+
const selectionKey = getSuggestionSelectionKey({
|
|
1035
|
+
itemId: itemDescriptor.id,
|
|
1036
|
+
language: itemDescriptor.language,
|
|
1037
|
+
fieldId: field.id || structureField.fieldId,
|
|
1038
|
+
});
|
|
1019
1039
|
const display = getSuggestionDisplayValue({
|
|
1020
1040
|
repositoryValue,
|
|
1021
1041
|
modifiedFields: preferRepositoryValue
|
|
@@ -1028,12 +1048,14 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1028
1048
|
language: itemDescriptor.language,
|
|
1029
1049
|
version: itemDescriptor.version,
|
|
1030
1050
|
pageItemId: pageViewContext.pageItemDescriptor?.id,
|
|
1051
|
+
pageItemLanguage: pageViewContext.pageItemDescriptor?.language,
|
|
1031
1052
|
pageItemVersion: pageViewContext.pageItemDescriptor?.version,
|
|
1032
1053
|
},
|
|
1033
1054
|
mode: showSuggestions ? "suggestions" : "baseline",
|
|
1055
|
+
selectedVariantId: editContext.suggestionVariantSelection[selectionKey],
|
|
1034
1056
|
});
|
|
1035
1057
|
const result = {
|
|
1036
|
-
value: showSuggestions ? display.
|
|
1058
|
+
value: showSuggestions ? display.selectedValue : display.baselineValue,
|
|
1037
1059
|
source: showSuggestions && display.hasSuggestions
|
|
1038
1060
|
? "suggestion-preview"
|
|
1039
1061
|
: "real",
|
|
@@ -1061,8 +1083,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1061
1083
|
return result;
|
|
1062
1084
|
}, [
|
|
1063
1085
|
editContext.mode,
|
|
1064
|
-
editContext.showSuggestedEdits,
|
|
1065
1086
|
editContext.suggestedEdits,
|
|
1087
|
+
editContext.suggestionVariantSelection,
|
|
1066
1088
|
fieldsContext?.modifiedFields,
|
|
1067
1089
|
pageViewContext.pageItemDescriptor,
|
|
1068
1090
|
]);
|
|
@@ -1821,9 +1843,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1821
1843
|
let items = [];
|
|
1822
1844
|
try {
|
|
1823
1845
|
const field = await resolveBridgeFieldDescriptor(effectiveInteraction);
|
|
1824
|
-
const canLoadFieldButtons = !!field &&
|
|
1825
|
-
!editor.readonly &&
|
|
1826
|
-
!editor.user?.isLimitedPreviewUser;
|
|
1846
|
+
const canLoadFieldButtons = !!field && !editor.readonly && !editor.user?.isLimitedPreviewUser;
|
|
1827
1847
|
const fieldButtons = canLoadFieldButtons
|
|
1828
1848
|
? await loadFieldButtons(field)
|
|
1829
1849
|
: [];
|
|
@@ -1970,6 +1990,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1970
1990
|
return;
|
|
1971
1991
|
lastX = scroll.x;
|
|
1972
1992
|
lastY = scroll.y;
|
|
1993
|
+
latestBridgeScrollRef.current = scroll;
|
|
1994
|
+
projectCurrentBridgeGeometryToScroll(scroll);
|
|
1973
1995
|
dispatchBridgeOverlayScroll(iframe, scroll, getBridgeGeometryScrollScale(pageViewContextRef.current?.bridgeGeometry));
|
|
1974
1996
|
};
|
|
1975
1997
|
iframeDocument.addEventListener("scroll", handleScroll, {
|
|
@@ -1992,7 +2014,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1992
2014
|
detach?.();
|
|
1993
2015
|
directOverlayScrollSyncRef.current = false;
|
|
1994
2016
|
};
|
|
1995
|
-
}, [iframeElement, loadedIframeSrc]);
|
|
2017
|
+
}, [iframeElement, loadedIframeSrc, projectCurrentBridgeGeometryToScroll]);
|
|
1996
2018
|
useEffect(() => {
|
|
1997
2019
|
const iframe = iframeElement;
|
|
1998
2020
|
if (!iframe)
|
|
@@ -2050,8 +2072,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2050
2072
|
mode: editContextRef.current?.mode ?? "edit",
|
|
2051
2073
|
readOnly: editContextRef.current?.readonly ?? true,
|
|
2052
2074
|
suggestionsCursorActive: !activeBridgeInlineEditRef.current &&
|
|
2053
|
-
|
|
2054
|
-
!!editContextRef.current?.showSuggestedEdits),
|
|
2075
|
+
editContextRef.current?.mode === "suggestions",
|
|
2055
2076
|
selectedComponentIds: editContextRef.current?.getSelection() ?? [],
|
|
2056
2077
|
featureFlags: {
|
|
2057
2078
|
crossOriginBridge: true,
|
|
@@ -2102,19 +2123,22 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2102
2123
|
transportMs: Date.now() - event.timestamp,
|
|
2103
2124
|
});
|
|
2104
2125
|
}
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
// same-origin listener already applied; prefer the live position.
|
|
2111
|
-
const overlayScroll = (directOverlayScrollSyncRef.current
|
|
2126
|
+
// Geometry replies race the iframe's synchronous scroll event. A
|
|
2127
|
+
// reply measured before the scroll must not replace the projected
|
|
2128
|
+
// rects with a stale snapshot while the overlay layer is already
|
|
2129
|
+
// positioned at the live scroll offset.
|
|
2130
|
+
const liveScroll = (directOverlayScrollSyncRef.current
|
|
2112
2131
|
? getIframeWindowScroll(iframe)
|
|
2113
2132
|
: undefined) ?? event.payload.geometry.scroll;
|
|
2114
|
-
|
|
2115
|
-
|
|
2133
|
+
const geometry = projectBridgeGeometryToScroll(event.payload.geometry, liveScroll) ?? event.payload.geometry;
|
|
2134
|
+
latestBridgeScrollRef.current = geometry.scroll;
|
|
2135
|
+
pageViewContext.bridgeGeometry = geometry;
|
|
2136
|
+
pageViewContext.setBridgeGeometry(geometry);
|
|
2137
|
+
scheduleBridgeGeometryRevision();
|
|
2138
|
+
dispatchBridgeOverlayScroll(iframe, geometry.scroll, getBridgeGeometryScrollScale(geometry));
|
|
2139
|
+
dispatchBridgeOverlayGeometry(iframe, geometry, geometry.scroll);
|
|
2116
2140
|
if (shouldTrackMinimapScroll()) {
|
|
2117
|
-
scrollHandlerRef.current(
|
|
2141
|
+
scrollHandlerRef.current(geometry.scroll.y);
|
|
2118
2142
|
}
|
|
2119
2143
|
break;
|
|
2120
2144
|
}
|
|
@@ -2160,20 +2184,25 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2160
2184
|
pageViewContext.setBridgeStructure(event.payload.structure);
|
|
2161
2185
|
}
|
|
2162
2186
|
if (event.payload.geometry) {
|
|
2163
|
-
|
|
2164
|
-
pageViewContext.bridgeGeometry = event.payload.geometry;
|
|
2165
|
-
pageViewContext.setBridgeGeometry(event.payload.geometry);
|
|
2166
|
-
scheduleBridgeGeometryRevision();
|
|
2167
|
-
const overlayScroll = (directOverlayScrollSyncRef.current
|
|
2187
|
+
const liveScroll = (directOverlayScrollSyncRef.current
|
|
2168
2188
|
? getIframeWindowScroll(iframe)
|
|
2169
2189
|
: undefined) ?? event.payload.geometry.scroll;
|
|
2170
|
-
|
|
2171
|
-
|
|
2190
|
+
const geometry = projectBridgeGeometryToScroll(event.payload.geometry, liveScroll) ?? event.payload.geometry;
|
|
2191
|
+
latestBridgeScrollRef.current = geometry.scroll;
|
|
2192
|
+
pageViewContext.bridgeGeometry = geometry;
|
|
2193
|
+
pageViewContext.setBridgeGeometry(geometry);
|
|
2194
|
+
scheduleBridgeGeometryRevision();
|
|
2195
|
+
dispatchBridgeOverlayScroll(iframe, geometry.scroll, getBridgeGeometryScrollScale(geometry));
|
|
2196
|
+
dispatchBridgeOverlayGeometry(iframe, geometry, geometry.scroll);
|
|
2172
2197
|
if (shouldTrackMinimapScroll()) {
|
|
2173
|
-
scrollHandlerRef.current(
|
|
2198
|
+
scrollHandlerRef.current(geometry.scroll.y);
|
|
2174
2199
|
}
|
|
2175
2200
|
}
|
|
2176
|
-
|
|
2201
|
+
const replayedScrollIsNewerThanCapture = event.payload.scrollIntentApplied &&
|
|
2202
|
+
(typeof event.payload.scrollIntentTimestamp !== "number" ||
|
|
2203
|
+
event.payload.scrollIntentTimestamp >=
|
|
2204
|
+
pendingRefreshScrollCapturedAtRef.current);
|
|
2205
|
+
if (replayedScrollIsNewerThanCapture) {
|
|
2177
2206
|
// The host already replayed a scroll issued during the refresh
|
|
2178
2207
|
// (e.g. a minimap navigation) — restoring the pre-refresh
|
|
2179
2208
|
// position now would clobber that newer intent.
|
|
@@ -2299,6 +2328,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2299
2328
|
break;
|
|
2300
2329
|
case "scrollChanged":
|
|
2301
2330
|
latestBridgeScrollRef.current = event.payload.scroll;
|
|
2331
|
+
projectCurrentBridgeGeometryToScroll(event.payload.scroll);
|
|
2302
2332
|
// With the direct same-origin listener active, this message is a
|
|
2303
2333
|
// late echo of a scroll the overlay already applied; re-dispatching
|
|
2304
2334
|
// it would briefly drag the overlay back to a stale position.
|
|
@@ -2502,7 +2532,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2502
2532
|
const field = loadedItem.fields.find((candidate) => fieldIdentifierMatches(candidate, structureField.fieldId));
|
|
2503
2533
|
if (!field)
|
|
2504
2534
|
continue;
|
|
2505
|
-
const showSuggestions = editContext.mode === "suggestions"
|
|
2535
|
+
const showSuggestions = editContext.mode === "suggestions";
|
|
2506
2536
|
const dirtyModifiedField = findModifiedBridgeField({
|
|
2507
2537
|
modifiedFields: fieldsContext?.modifiedFields,
|
|
2508
2538
|
structureField,
|
|
@@ -2523,9 +2553,12 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2523
2553
|
language: itemDescriptor.language,
|
|
2524
2554
|
version: itemDescriptor.version,
|
|
2525
2555
|
pageItemId: pageViewContextRef.current?.pageItemDescriptor?.id,
|
|
2556
|
+
pageItemLanguage: pageViewContextRef.current?.pageItemDescriptor?.language,
|
|
2526
2557
|
pageItemVersion: pageViewContextRef.current?.pageItemDescriptor?.version,
|
|
2527
2558
|
}).length > 0);
|
|
2528
|
-
if (!showSuggestions &&
|
|
2559
|
+
if (!showSuggestions &&
|
|
2560
|
+
!dirtyModifiedField &&
|
|
2561
|
+
!needsSuggestionRestore) {
|
|
2529
2562
|
continue;
|
|
2530
2563
|
}
|
|
2531
2564
|
const patch = buildBridgeFieldPatch({
|
|
@@ -2551,7 +2584,6 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2551
2584
|
editContext.itemsRepository,
|
|
2552
2585
|
editContext.itemsRepository.revision,
|
|
2553
2586
|
editContext.mode,
|
|
2554
|
-
editContext.showSuggestedEdits,
|
|
2555
2587
|
editContext.suggestedEdits,
|
|
2556
2588
|
fieldsContext?.modifiedFields,
|
|
2557
2589
|
bridgeDomRevision,
|
|
@@ -2792,14 +2824,18 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2792
2824
|
const signatureUrl = new URL(renderUrl.toString());
|
|
2793
2825
|
signatureUrl.searchParams.delete("edit_rev");
|
|
2794
2826
|
const renderSignature = `${signatureUrl.toString()}|rev:${editContext.revision}`;
|
|
2827
|
+
const modeChanged = lastRenderModeRef.current !== editContext.mode;
|
|
2828
|
+
lastRenderModeRef.current = editContext.mode;
|
|
2795
2829
|
// Only skip when a live bridge confirms the last refresh actually reached
|
|
2796
|
-
// the host
|
|
2797
|
-
//
|
|
2798
|
-
//
|
|
2830
|
+
// the host, or when the only meaningful trigger is an edit/suggestions
|
|
2831
|
+
// mode change. Mode is delivered by setEditorMode and cannot change the
|
|
2832
|
+
// server-rendered URL/revision; reloading during a transient bridge
|
|
2833
|
+
// disconnect would needlessly reset iframe scroll. Before the first bridge
|
|
2834
|
+
// connection, identical non-mode re-runs still use the recovery path.
|
|
2799
2835
|
if (!shouldUseIframeSrcReload &&
|
|
2800
2836
|
!versionChanged &&
|
|
2801
2837
|
lastRenderSignatureRef.current === renderSignature &&
|
|
2802
|
-
bridgeClientRef.current?.supportsCapability("refresh")) {
|
|
2838
|
+
(modeChanged || bridgeClientRef.current?.supportsCapability("refresh"))) {
|
|
2803
2839
|
setCurrentItemDescriptor(pageItemDescriptor);
|
|
2804
2840
|
return;
|
|
2805
2841
|
}
|
|
@@ -3101,15 +3137,9 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3101
3137
|
bridge?.sendCommand("setEditorMode", {
|
|
3102
3138
|
mode: editContext.mode,
|
|
3103
3139
|
readOnly: editContext.readonly,
|
|
3104
|
-
suggestionsCursorActive: !isBridgeInlineEditing &&
|
|
3105
|
-
(editContext.mode === "suggestions" || editContext.showSuggestedEdits),
|
|
3140
|
+
suggestionsCursorActive: !isBridgeInlineEditing && editContext.mode === "suggestions",
|
|
3106
3141
|
});
|
|
3107
|
-
}, [
|
|
3108
|
-
editContext.mode,
|
|
3109
|
-
editContext.readonly,
|
|
3110
|
-
editContext.showSuggestedEdits,
|
|
3111
|
-
isBridgeInlineEditing,
|
|
3112
|
-
]);
|
|
3142
|
+
}, [editContext.mode, editContext.readonly, isBridgeInlineEditing]);
|
|
3113
3143
|
useEffect(() => {
|
|
3114
3144
|
const previousMode = previousBridgeInlineEditModeRef.current;
|
|
3115
3145
|
previousBridgeInlineEditModeRef.current = editContext.mode;
|
|
@@ -3187,8 +3217,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3187
3217
|
const fullscreenPageTitle = pageViewContext.page?.item?.displayName?.trim() ||
|
|
3188
3218
|
pageViewContext.page?.item?.name?.trim() ||
|
|
3189
3219
|
"Page";
|
|
3190
|
-
const showSuggestionsCursor = !isBridgeInlineEditing &&
|
|
3191
|
-
(editContext.mode === "suggestions" || editContext.showSuggestedEdits);
|
|
3220
|
+
const showSuggestionsCursor = !isBridgeInlineEditing && editContext.mode === "suggestions";
|
|
3192
3221
|
return (_jsxs("div", { className: cn("relative flex h-full w-full flex-col items-center select-none", className, editContext.showAgentsPanel && !editContext.currentWizardId && "pr-0"), children: [!pageViewContext.fullscreen && (_jsx(EditorWarnings, { item: pageViewContext.page?.item })), slotCloseButton && (_jsx("div", { className: "absolute top-3 right-3 z-50", children: slotCloseButton })), pageViewContext.fullscreen && (_jsxs("div", { className: "border-neutral-grey-15 relative z-40 flex h-11 w-full shrink-0 items-center justify-center border-b bg-white px-28 text-center shadow-sm", "data-testid": "fullscreen-page-title-bar", children: [_jsx("div", { className: "text-neutral-grey-100 max-w-full truncate text-sm font-medium", title: fullscreenPageTitle, "data-testid": "fullscreen-page-title", children: fullscreenPageTitle }), _jsx("div", { className: "absolute top-1/2 right-3 -translate-y-1/2", children: _jsx(FullscreenControls, { device: pageViewContext.device, setDevice: (device) => pageViewContext.setDevice(device), canExit: !editContext.configuration.forceFullscreen, onExit: () => editContext.setFullscreen(false) }) })] })), pageViewContext.device !== "desktop" && (_jsx(DeviceToolbar, { pageViewContext: pageViewContext, configuration: editContext.configuration })), _jsxs("div", { className: "relative flex min-h-0 flex-1 transition-[width] duration-300 ease-in-out select-none motion-reduce:transition-none", "data-testid": "page-viewer-viewport", style: {
|
|
3193
3222
|
width: deviceWidth,
|
|
3194
3223
|
}, children: [_jsxs("div", { className: "relative h-full w-full overflow-visible", onMouseLeave: () => {
|