@agent-native/core-corpus 0.203.1 → 0.203.2-nightly-20261007213109
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/corpus/README.md +1 -1
- package/corpus/templates/clips/changelog/2026-10-07-clips-keeps-settings-at-its-full-size-while-a-recording-is-a.md +6 -0
- package/corpus/templates/clips/desktop/src/app.tsx +17 -10
- package/corpus/templates/clips/desktop/src/lib/popover-sizing.ts +17 -0
- package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +0 -3
- package/corpus/templates/content/app/components/editor/DocumentBlockFields.tsx +13 -6
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +207 -173
- package/corpus/templates/content/app/components/editor/DocumentEditorSkeleton.tsx +15 -2
- package/corpus/templates/content/app/components/editor/PageDraftRecovery.tsx +16 -4
- package/corpus/templates/content/app/components/editor/VisualEditor.tsx +16 -1
- package/corpus/templates/content/app/components/editor/WidgetLoadDiagnostic.tsx +103 -0
- package/corpus/templates/content/app/hooks/use-content-spaces.ts +4 -3
- package/corpus/templates/content/app/hooks/use-document-properties.ts +5 -2
- package/corpus/templates/content/app/hooks/use-documents.ts +3 -0
- package/corpus/templates/content/app/i18n-data.ts +8 -0
- package/corpus/templates/content/changelog/2026-10-07-chatgpt-widgets-identify-a-stalled-content-editor-instead-of.md +6 -0
- package/corpus/templates/content/changelog/2026-10-07-chatgpt-widgets-open-document-content-without-a-cookie-sessi.md +6 -0
- package/corpus/templates/content/changelog/2026-10-07-content-documents-now-open-in-chatgpt-widgets-with-their-ful.md +6 -0
- package/corpus/templates/design/CHANGELOG.md +1 -0
- package/corpus/templates/design/changelog/2026-10-07-design-waitlist-signups-work-from-make-real-and-design-systems.md +6 -0
- package/corpus/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +34 -44
- package/corpus/templates/factory/.agents/skills/review-latest-feedback/references/reproduction-and-verification.md +46 -0
- package/corpus/templates/factory/.agents/skills/review-prs/SKILL.md +5 -3
- package/corpus/templates/slides/actions/add-slide.ts +10 -0
- package/corpus/templates/slides/actions/create-deck.ts +16 -4
- package/corpus/templates/slides/actions/update-slide.ts +4 -0
- package/corpus/templates/slides/app/hooks/use-deck-access-reload.ts +66 -0
- package/corpus/templates/slides/app/lib/create-deck-generation.ts +1 -0
- package/corpus/templates/slides/app/lib/generation-lifecycle.ts +24 -0
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +42 -70
- package/corpus/templates/slides/app/pages/Index.tsx +9 -0
- package/corpus/templates/slides/changelog/2026-10-02-opening-a-deck-you-no-longer-have-access-to-no-longer-floods.md +6 -0
- package/corpus/templates/slides/server/lib/generation-completion.ts +13 -1
- package/corpus/templates/slides/shared/generation-timing.ts +19 -0
- package/package.json +1 -1
package/corpus/README.md
CHANGED
|
@@ -137,6 +137,7 @@ import {
|
|
|
137
137
|
MACOS_UPDATE_RESTART_MESSAGE,
|
|
138
138
|
} from "./lib/permissions";
|
|
139
139
|
import { isMacPlatform, isWindowsPlatform } from "./lib/platform";
|
|
140
|
+
import { getPopoverAutoSizeOptions } from "./lib/popover-sizing";
|
|
140
141
|
import {
|
|
141
142
|
changeRecordFirstFiles,
|
|
142
143
|
effectiveLocalRecordingMode,
|
|
@@ -939,7 +940,10 @@ function measurePopoverHeight(el: HTMLElement): number {
|
|
|
939
940
|
|
|
940
941
|
function usePopoverAutoSize(
|
|
941
942
|
ref: RefObject<HTMLElement | null>,
|
|
942
|
-
options: {
|
|
943
|
+
options: {
|
|
944
|
+
disabled: boolean;
|
|
945
|
+
width: number;
|
|
946
|
+
},
|
|
943
947
|
): void {
|
|
944
948
|
const { disabled, width } = options;
|
|
945
949
|
|
|
@@ -2928,15 +2932,18 @@ export function App({
|
|
|
2928
2932
|
setPopoverView,
|
|
2929
2933
|
appRef,
|
|
2930
2934
|
);
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2935
|
+
const popoverLayoutView =
|
|
2936
|
+
popoverView === "settings"
|
|
2937
|
+
? "settings"
|
|
2938
|
+
: popoverView === "memory"
|
|
2939
|
+
? "memory"
|
|
2940
|
+
: "recorder";
|
|
2941
|
+
const popoverAutoSizeOptions = getPopoverAutoSizeOptions(
|
|
2942
|
+
popoverLayoutView,
|
|
2943
|
+
popoverVisible,
|
|
2944
|
+
recordingStartPending,
|
|
2945
|
+
);
|
|
2946
|
+
usePopoverAutoSize(appRef, popoverAutoSizeOptions);
|
|
2940
2947
|
|
|
2941
2948
|
const loadPendingUploads = useCallback(async () => {
|
|
2942
2949
|
const sequence = ++recoveryLookupSequence.current;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type PopoverAutoSizeView = "recorder" | "memory" | "settings";
|
|
2
|
+
|
|
3
|
+
export function getPopoverAutoSizeOptions(
|
|
4
|
+
view: PopoverAutoSizeView,
|
|
5
|
+
popoverVisible: boolean,
|
|
6
|
+
recordingStartPending: boolean,
|
|
7
|
+
): {
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
width: number;
|
|
10
|
+
} {
|
|
11
|
+
const isSettings = view === "settings";
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
disabled: !isSettings && (!popoverVisible || recordingStartPending),
|
|
15
|
+
width: isSettings ? 720 : view === "memory" ? 440 : 320,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -1458,9 +1458,6 @@ pub async fn resize_popover(app: AppHandle, height: f64, width: Option<f64>) ->
|
|
|
1458
1458
|
if voice_woken {
|
|
1459
1459
|
return Ok(());
|
|
1460
1460
|
}
|
|
1461
|
-
if is_recording_active(&app) {
|
|
1462
|
-
return Ok(());
|
|
1463
|
-
}
|
|
1464
1461
|
if let Some(w) = app.get_webview_window("popover") {
|
|
1465
1462
|
let tray_center = app
|
|
1466
1463
|
.try_state::<TrayAnchor>()
|
|
@@ -51,6 +51,7 @@ interface DocumentBlockFieldsProps {
|
|
|
51
51
|
databaseId: string | null;
|
|
52
52
|
databaseDocumentId: string | null;
|
|
53
53
|
canEdit: boolean;
|
|
54
|
+
usePagePropertiesOnly?: boolean;
|
|
54
55
|
suggesting?: boolean;
|
|
55
56
|
enteringSuggestion?: boolean;
|
|
56
57
|
onPrimaryFieldAvailabilityChange?: (
|
|
@@ -276,6 +277,7 @@ export function DocumentBlockFields({
|
|
|
276
277
|
databaseId,
|
|
277
278
|
databaseDocumentId,
|
|
278
279
|
canEdit,
|
|
280
|
+
usePagePropertiesOnly = false,
|
|
279
281
|
suggesting = false,
|
|
280
282
|
enteringSuggestion = false,
|
|
281
283
|
onPrimaryFieldAvailabilityChange,
|
|
@@ -288,21 +290,26 @@ export function DocumentBlockFields({
|
|
|
288
290
|
() => documentPropertiesPlaceholder(documentId, databaseId, pageProperties),
|
|
289
291
|
[databaseId, documentId, pageProperties],
|
|
290
292
|
);
|
|
291
|
-
const query = useDocumentProperties(documentId, databaseId, {
|
|
293
|
+
const query = useDocumentProperties(documentId, databaseId, {
|
|
294
|
+
enabled: !usePagePropertiesOnly,
|
|
295
|
+
placeholder,
|
|
296
|
+
});
|
|
297
|
+
const propertiesData = usePagePropertiesOnly ? placeholder : query.data;
|
|
298
|
+
const hasQueryError = !usePagePropertiesOnly && query.isError;
|
|
292
299
|
const canEditFields =
|
|
293
300
|
canEdit &&
|
|
294
|
-
|
|
301
|
+
propertiesData?.canEditValues === true &&
|
|
295
302
|
databaseId !== null &&
|
|
296
303
|
databaseDocumentId !== null;
|
|
297
|
-
const properties =
|
|
304
|
+
const properties = propertiesData?.properties ?? [];
|
|
298
305
|
const blockFields = useMemo(
|
|
299
306
|
() => blockFieldsFromProperties(properties),
|
|
300
307
|
[properties],
|
|
301
308
|
);
|
|
302
309
|
|
|
303
|
-
const loaded = isLoadedForDocument(documentId, databaseId,
|
|
310
|
+
const loaded = isLoadedForDocument(documentId, databaseId, propertiesData);
|
|
304
311
|
const state = blockFieldsRenderState({ loaded, blockFields });
|
|
305
|
-
const primaryAvailable = !
|
|
312
|
+
const primaryAvailable = !hasQueryError && primaryBlocksFieldAvailable(state);
|
|
306
313
|
const scope = `${documentId}:${databaseId ?? ""}:${databaseDocumentId ?? ""}`;
|
|
307
314
|
useLayoutEffect(() => {
|
|
308
315
|
onPrimaryFieldAvailabilityChange?.(scope, primaryAvailable);
|
|
@@ -310,7 +317,7 @@ export function DocumentBlockFields({
|
|
|
310
317
|
|
|
311
318
|
// A failed property read is not an empty field list. Rendering the editor in
|
|
312
319
|
// that state could bind the body before we know which storage target owns it.
|
|
313
|
-
if (
|
|
320
|
+
if (hasQueryError) {
|
|
314
321
|
return (
|
|
315
322
|
<div
|
|
316
323
|
className={cn(BLOCK_FIELDS_GRID, "gap-1")}
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
useDbSync,
|
|
16
16
|
useSession,
|
|
17
17
|
} from "@agent-native/core/client/hooks";
|
|
18
|
+
import { isEmbedMcpChatBridgeActive } from "@agent-native/core/client/host";
|
|
18
19
|
import { useT } from "@agent-native/core/client/i18n";
|
|
19
20
|
import {
|
|
20
21
|
useCreateResourceSuggestionProposal,
|
|
@@ -301,6 +302,7 @@ import type {
|
|
|
301
302
|
VisualEditorSelectionController,
|
|
302
303
|
VisualEditorSelectionSnapshot,
|
|
303
304
|
} from "./VisualEditor";
|
|
305
|
+
import { WidgetVisualEditorBoundary } from "./WidgetLoadDiagnostic";
|
|
304
306
|
|
|
305
307
|
const NO_COMMENT_THREADS: CommentThread[] = [];
|
|
306
308
|
|
|
@@ -1285,6 +1287,8 @@ export function PageEditorSurface({
|
|
|
1285
1287
|
focusTitle = false,
|
|
1286
1288
|
onTitleFocused,
|
|
1287
1289
|
}: PageEditorSurfaceProps) {
|
|
1290
|
+
const t = useT();
|
|
1291
|
+
const widgetBridgeActive = isEmbedMcpChatBridgeActive();
|
|
1288
1292
|
const {
|
|
1289
1293
|
query: documentQuery,
|
|
1290
1294
|
fetchedForThisOpen,
|
|
@@ -1376,6 +1380,7 @@ export function PageEditorSurface({
|
|
|
1376
1380
|
host === "page" &&
|
|
1377
1381
|
!viewId &&
|
|
1378
1382
|
!!document &&
|
|
1383
|
+
document.mcpDirectoryWidgetReadOnly !== true &&
|
|
1379
1384
|
!document.database &&
|
|
1380
1385
|
!isError &&
|
|
1381
1386
|
fetchedForThisOpen &&
|
|
@@ -1450,6 +1455,14 @@ export function PageEditorSurface({
|
|
|
1450
1455
|
? readDocumentShapeHint(document)
|
|
1451
1456
|
: readPageShapeHint(documentId)
|
|
1452
1457
|
}
|
|
1458
|
+
stalledLoad={
|
|
1459
|
+
widgetBridgeActive
|
|
1460
|
+
? {
|
|
1461
|
+
stage: t("editor.widgetDocumentLoadStage"),
|
|
1462
|
+
action: "get-document",
|
|
1463
|
+
}
|
|
1464
|
+
: undefined
|
|
1465
|
+
}
|
|
1453
1466
|
/>
|
|
1454
1467
|
);
|
|
1455
1468
|
}
|
|
@@ -2443,17 +2456,21 @@ function PageEditorSessionBody({
|
|
|
2443
2456
|
document.mcpDirectoryWidgetReadOnly === true;
|
|
2444
2457
|
const canEdit = document.canEdit === true && !mcpDirectoryWidgetReadOnly;
|
|
2445
2458
|
const canEditRef = useRef(canEdit);
|
|
2446
|
-
const contentSpacesQuery = useContentSpaces(
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2459
|
+
const contentSpacesQuery = useContentSpaces({
|
|
2460
|
+
enabled: !mcpDirectoryWidgetReadOnly,
|
|
2461
|
+
});
|
|
2462
|
+
const contentSpacesData = mcpDirectoryWidgetReadOnly
|
|
2463
|
+
? undefined
|
|
2464
|
+
: contentSpacesQuery.data;
|
|
2465
|
+
const contentSpaces = contentSpacesData?.spaces ?? [];
|
|
2466
|
+
const localWorkspaceMode = contentSpacesData?.sourceMode === "local-files";
|
|
2450
2467
|
const localDocumentsQuery = useDocuments({ enabled: localWorkspaceMode });
|
|
2451
2468
|
const localDocuments = useMemo<Document[]>(
|
|
2452
2469
|
() => (localWorkspaceMode ? (localDocumentsQuery.data ?? []) : []),
|
|
2453
2470
|
[localDocumentsQuery.data, localWorkspaceMode],
|
|
2454
2471
|
);
|
|
2455
2472
|
const navigationContextQuery = useContentNavigationContext(
|
|
2456
|
-
host === "page" ? documentId : null,
|
|
2473
|
+
host === "page" && !mcpDirectoryWidgetReadOnly ? documentId : null,
|
|
2457
2474
|
);
|
|
2458
2475
|
const navigationPath = useMemo(
|
|
2459
2476
|
() =>
|
|
@@ -2483,7 +2500,7 @@ function PageEditorSessionBody({
|
|
|
2483
2500
|
const decideSuggestionProposal = useDecideResourceSuggestionProposal();
|
|
2484
2501
|
const suggestionsQuery = useResourceSuggestions(
|
|
2485
2502
|
{ resourceType: "document", resourceId: documentId },
|
|
2486
|
-
{ enabled: !isLocalFileDocument },
|
|
2503
|
+
{ enabled: !isLocalFileDocument && !mcpDirectoryWidgetReadOnly },
|
|
2487
2504
|
);
|
|
2488
2505
|
const [isSuggesting, setIsSuggesting] = useState(false);
|
|
2489
2506
|
const [isStartingSuggestion, setIsStartingSuggestion] = useState(false);
|
|
@@ -6872,7 +6889,9 @@ function PageEditorSessionBody({
|
|
|
6872
6889
|
isLoading: commentsLoading,
|
|
6873
6890
|
isFetching: commentsFetching,
|
|
6874
6891
|
isError: commentsError,
|
|
6875
|
-
} = useComments(
|
|
6892
|
+
} = useComments(
|
|
6893
|
+
!isLocalFileDocument && !mcpDirectoryWidgetReadOnly ? documentId : null,
|
|
6894
|
+
);
|
|
6876
6895
|
const commentAi = useCommentAiRequests(documentId, {
|
|
6877
6896
|
enabled: !isLocalFileDocument && canComment,
|
|
6878
6897
|
});
|
|
@@ -7573,14 +7592,14 @@ function PageEditorSessionBody({
|
|
|
7573
7592
|
currentDocumentId: document.id,
|
|
7574
7593
|
currentParentId: document.parentId,
|
|
7575
7594
|
currentDatabaseSystemRole: document.database?.systemRole ?? null,
|
|
7576
|
-
catalogDocumentId:
|
|
7595
|
+
catalogDocumentId: contentSpacesData?.catalogDocumentId ?? null,
|
|
7577
7596
|
workspacesTitle: t("sidebar.workspaces"),
|
|
7578
7597
|
},
|
|
7579
7598
|
navigationPath,
|
|
7580
7599
|
),
|
|
7581
7600
|
[
|
|
7582
7601
|
contentSpaces,
|
|
7583
|
-
|
|
7602
|
+
contentSpacesData?.catalogDocumentId,
|
|
7584
7603
|
document,
|
|
7585
7604
|
localDocuments,
|
|
7586
7605
|
localWorkspaceMode,
|
|
@@ -8700,56 +8719,7 @@ function PageEditorSessionBody({
|
|
|
8700
8719
|
{t("editor.suggestionFormattingUnsupported")}
|
|
8701
8720
|
</div>
|
|
8702
8721
|
) : null}
|
|
8703
|
-
<
|
|
8704
|
-
onEscape={handleEditorEscape}
|
|
8705
|
-
acceptedDecisionReadback={
|
|
8706
|
-
!isSuggesting &&
|
|
8707
|
-
pendingSuggestionDecision?.decision ===
|
|
8708
|
-
"accepted" &&
|
|
8709
|
-
pendingSuggestionDecision.readbackContent !== null
|
|
8710
|
-
? {
|
|
8711
|
-
id: pendingSuggestionDecision.suggestion.id,
|
|
8712
|
-
content:
|
|
8713
|
-
pendingSuggestionDecision.readbackContent,
|
|
8714
|
-
}
|
|
8715
|
-
: null
|
|
8716
|
-
}
|
|
8717
|
-
onAcceptedDecisionRendered={
|
|
8718
|
-
handleAcceptedDecisionRendered
|
|
8719
|
-
}
|
|
8720
|
-
onAcceptedDecisionReadbackOutdated={
|
|
8721
|
-
handleAcceptedDecisionReadbackOutdated
|
|
8722
|
-
}
|
|
8723
|
-
contentResetKey={
|
|
8724
|
-
pendingSuggestionDecision
|
|
8725
|
-
? `${pendingSuggestionDecision.suggestion.id}:${pendingSuggestionDecision.decision}:${pendingSuggestionDecision.optimistic ? "optimistic" : "canonical"}`
|
|
8726
|
-
: pendingProposalDecision
|
|
8727
|
-
? `proposal:${pendingProposalDecision.generation}:${pendingProposalDecision.readbackContent === null ? "pending" : "readback"}`
|
|
8728
|
-
: null
|
|
8729
|
-
}
|
|
8730
|
-
proposalDecisionReadback={
|
|
8731
|
-
(!isSuggesting ||
|
|
8732
|
-
!pendingProposalDecision?.accepted) &&
|
|
8733
|
-
pendingProposalDecision?.readbackContent !==
|
|
8734
|
-
null &&
|
|
8735
|
-
pendingProposalDecision?.readbackContent !==
|
|
8736
|
-
undefined
|
|
8737
|
-
? {
|
|
8738
|
-
generation:
|
|
8739
|
-
pendingProposalDecision.generation,
|
|
8740
|
-
content:
|
|
8741
|
-
pendingProposalDecision.readbackContent,
|
|
8742
|
-
beforeContent:
|
|
8743
|
-
pendingProposalDecision.beforeContent,
|
|
8744
|
-
}
|
|
8745
|
-
: null
|
|
8746
|
-
}
|
|
8747
|
-
onProposalDecisionRendered={
|
|
8748
|
-
handleProposalDecisionRendered
|
|
8749
|
-
}
|
|
8750
|
-
onProposalDecisionReadbackOutdated={
|
|
8751
|
-
handleProposalDecisionReadbackOutdated
|
|
8752
|
-
}
|
|
8722
|
+
<WidgetVisualEditorBoundary
|
|
8753
8723
|
key={`${visualEditorInstanceKey({
|
|
8754
8724
|
documentId,
|
|
8755
8725
|
documentUpdatedAt:
|
|
@@ -8760,120 +8730,183 @@ function PageEditorSessionBody({
|
|
|
8760
8730
|
hasYDoc: Boolean(ydoc),
|
|
8761
8731
|
localFileSyncRevision,
|
|
8762
8732
|
})}:${isSuggesting ? "suggesting" : "canonical"}`}
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
|
|
8784
|
-
|
|
8785
|
-
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
|
|
8806
|
-
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
|
|
8836
|
-
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
8861
|
-
|
|
8862
|
-
|
|
8863
|
-
|
|
8864
|
-
|
|
8865
|
-
|
|
8866
|
-
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
|
|
8733
|
+
active={mcpDirectoryWidgetReadOnly}
|
|
8734
|
+
stage={t("editor.widgetEditorInitStage")}
|
|
8735
|
+
action="VisualEditor"
|
|
8736
|
+
>
|
|
8737
|
+
<VisualEditor
|
|
8738
|
+
onEscape={handleEditorEscape}
|
|
8739
|
+
acceptedDecisionReadback={
|
|
8740
|
+
!isSuggesting &&
|
|
8741
|
+
pendingSuggestionDecision?.decision ===
|
|
8742
|
+
"accepted" &&
|
|
8743
|
+
pendingSuggestionDecision.readbackContent !==
|
|
8744
|
+
null
|
|
8745
|
+
? {
|
|
8746
|
+
id: pendingSuggestionDecision.suggestion
|
|
8747
|
+
.id,
|
|
8748
|
+
content:
|
|
8749
|
+
pendingSuggestionDecision.readbackContent,
|
|
8750
|
+
}
|
|
8751
|
+
: null
|
|
8752
|
+
}
|
|
8753
|
+
onAcceptedDecisionRendered={
|
|
8754
|
+
handleAcceptedDecisionRendered
|
|
8755
|
+
}
|
|
8756
|
+
onAcceptedDecisionReadbackOutdated={
|
|
8757
|
+
handleAcceptedDecisionReadbackOutdated
|
|
8758
|
+
}
|
|
8759
|
+
contentResetKey={
|
|
8760
|
+
pendingSuggestionDecision
|
|
8761
|
+
? `${pendingSuggestionDecision.suggestion.id}:${pendingSuggestionDecision.decision}:${pendingSuggestionDecision.optimistic ? "optimistic" : "canonical"}`
|
|
8762
|
+
: pendingProposalDecision
|
|
8763
|
+
? `proposal:${pendingProposalDecision.generation}:${pendingProposalDecision.readbackContent === null ? "pending" : "readback"}`
|
|
8764
|
+
: null
|
|
8765
|
+
}
|
|
8766
|
+
proposalDecisionReadback={
|
|
8767
|
+
(!isSuggesting ||
|
|
8768
|
+
!pendingProposalDecision?.accepted) &&
|
|
8769
|
+
pendingProposalDecision?.readbackContent !==
|
|
8770
|
+
null &&
|
|
8771
|
+
pendingProposalDecision?.readbackContent !==
|
|
8772
|
+
undefined
|
|
8773
|
+
? {
|
|
8774
|
+
generation:
|
|
8775
|
+
pendingProposalDecision.generation,
|
|
8776
|
+
content:
|
|
8777
|
+
pendingProposalDecision.readbackContent,
|
|
8778
|
+
beforeContent:
|
|
8779
|
+
pendingProposalDecision.beforeContent,
|
|
8780
|
+
}
|
|
8781
|
+
: null
|
|
8782
|
+
}
|
|
8783
|
+
onProposalDecisionRendered={
|
|
8784
|
+
handleProposalDecisionRendered
|
|
8785
|
+
}
|
|
8786
|
+
onProposalDecisionReadbackOutdated={
|
|
8787
|
+
handleProposalDecisionReadbackOutdated
|
|
8788
|
+
}
|
|
8789
|
+
documentId={documentId}
|
|
8790
|
+
contentSpaceId={document.spaceId ?? undefined}
|
|
8791
|
+
widgetLoadDiagnosticsActive={
|
|
8792
|
+
mcpDirectoryWidgetReadOnly
|
|
8793
|
+
}
|
|
8794
|
+
content={
|
|
8795
|
+
isLocalFileDocument
|
|
8796
|
+
? localContent
|
|
8797
|
+
: (pendingSuggestionDecisionContent ??
|
|
8798
|
+
(isSuggesting
|
|
8799
|
+
? suggestionDraft
|
|
8800
|
+
: document.content))
|
|
8801
|
+
}
|
|
8802
|
+
contentUpdatedAt={
|
|
8803
|
+
isLocalFileDocument
|
|
8804
|
+
? (localContentUpdatedAt ??
|
|
8805
|
+
document.updatedAt)
|
|
8806
|
+
: suggestionEditorIsolation.contentUpdatedAt
|
|
8807
|
+
}
|
|
8808
|
+
contentRevision={
|
|
8809
|
+
isLocalFileDocument ||
|
|
8810
|
+
!suggestionEditorIsolation.reconcileCanonical
|
|
8811
|
+
? null
|
|
8812
|
+
: (document.revision ?? null)
|
|
8813
|
+
}
|
|
8814
|
+
acknowledgedLocalSnapshot={
|
|
8815
|
+
acknowledgedLocalSnapshot
|
|
8816
|
+
}
|
|
8817
|
+
onBaseAwareReconcile={
|
|
8818
|
+
suggestionEditorIsolation.reconcileCanonical
|
|
8819
|
+
? handleBaseAwareReconcile
|
|
8820
|
+
: undefined
|
|
8821
|
+
}
|
|
8822
|
+
onRemoteSnapshotChange={
|
|
8823
|
+
suggestionEditorIsolation.reconcileCanonical
|
|
8824
|
+
? handleRemoteSnapshotChange
|
|
8825
|
+
: undefined
|
|
8826
|
+
}
|
|
8827
|
+
collabContentRevision={
|
|
8828
|
+
isLocalFileDocument || isSuggesting
|
|
8829
|
+
? null
|
|
8830
|
+
: document.collabContentRevision
|
|
8831
|
+
}
|
|
8832
|
+
requestCollabSync={requestCollabSync}
|
|
8833
|
+
onChange={
|
|
8834
|
+
isSuggesting
|
|
8835
|
+
? handleSuggestionDraftChange
|
|
8836
|
+
: handleContentChange
|
|
8837
|
+
}
|
|
8838
|
+
onSaveContent={
|
|
8839
|
+
suggestionEditorIsolation.persistCanonical
|
|
8840
|
+
? handleImmediateContentChange
|
|
8841
|
+
: undefined
|
|
8842
|
+
}
|
|
8843
|
+
ydoc={
|
|
8844
|
+
suggestionEditorIsolation.bindCanonicalYDoc
|
|
8845
|
+
? ydoc
|
|
8846
|
+
: null
|
|
8847
|
+
}
|
|
8848
|
+
collabSynced={
|
|
8849
|
+
collabEditorEnabled ? collabSynced : true
|
|
8850
|
+
}
|
|
8851
|
+
awareness={collabEditorEnabled ? awareness : null}
|
|
8852
|
+
user={currentUser}
|
|
8853
|
+
editable={
|
|
8854
|
+
suggestionEditorIsolation.editable &&
|
|
8855
|
+
!isStartingSuggestion &&
|
|
8856
|
+
!isSubmittingSuggestions &&
|
|
8857
|
+
!pendingSuggestionDecision &&
|
|
8858
|
+
!pendingProposalDecision
|
|
8859
|
+
}
|
|
8860
|
+
suggesting={isSuggesting}
|
|
8861
|
+
localFileMode={isLocalFileDocument}
|
|
8862
|
+
localFilePath={
|
|
8863
|
+
isLocalFileDocument
|
|
8864
|
+
? document.source?.path
|
|
8865
|
+
: null
|
|
8866
|
+
}
|
|
8867
|
+
onComment={canComment ? handleComment : undefined}
|
|
8868
|
+
commentThreads={editorCommentThreads}
|
|
8869
|
+
activeThreadId={selectedThreadId}
|
|
8870
|
+
hoveredThreadId={hoveredThreadId}
|
|
8871
|
+
pendingHighlight={pendingComment?.range ?? null}
|
|
8872
|
+
onActivateThread={
|
|
8873
|
+
!isLocalFileDocument
|
|
8874
|
+
? activateCommentThread
|
|
8875
|
+
: undefined
|
|
8876
|
+
}
|
|
8877
|
+
suggestions={visualSuggestions}
|
|
8878
|
+
activeSuggestionId={
|
|
8879
|
+
hoveredSuggestionId ??
|
|
8880
|
+
editingSuggestionId ??
|
|
8881
|
+
selectedSuggestionId
|
|
8882
|
+
}
|
|
8883
|
+
onActivateSuggestion={activateInlineSuggestion}
|
|
8884
|
+
onHoverSuggestion={setHoveredSuggestionId}
|
|
8885
|
+
onSuggestionReplacementIntent={
|
|
8886
|
+
isSuggesting
|
|
8887
|
+
? handleSuggestionReplacementIntent
|
|
8888
|
+
: undefined
|
|
8889
|
+
}
|
|
8890
|
+
initialSelection={suggestionInitialSelection}
|
|
8891
|
+
onSuggestionAnchorsChange={
|
|
8892
|
+
handleSuggestionAnchorsChange
|
|
8893
|
+
}
|
|
8894
|
+
showCommentIndicators={showCommentIndicators}
|
|
8895
|
+
onJoinTitle={joinFirstBodyBlockToTitle}
|
|
8896
|
+
onOpenNotionPageLink={handleOpenNotionPageLink}
|
|
8897
|
+
notionPageId={document.notionPageId}
|
|
8898
|
+
onHistoryControllerChange={
|
|
8899
|
+
handleHistoryControllerChange
|
|
8900
|
+
}
|
|
8901
|
+
onHistoryStateChange={handleHistoryStateChange}
|
|
8902
|
+
onSelectionControllerChange={
|
|
8903
|
+
handleSelectionControllerChange
|
|
8904
|
+
}
|
|
8905
|
+
onPersistenceControllerChange={
|
|
8906
|
+
handlePersistenceControllerChange
|
|
8907
|
+
}
|
|
8908
|
+
/>
|
|
8909
|
+
</WidgetVisualEditorBoundary>
|
|
8877
8910
|
</>
|
|
8878
8911
|
);
|
|
8879
8912
|
const primaryEditorWithStarter = (
|
|
@@ -8911,6 +8944,7 @@ function PageEditorSessionBody({
|
|
|
8911
8944
|
document.databaseMembership.databaseDocumentId
|
|
8912
8945
|
}
|
|
8913
8946
|
canEdit={editorCanEdit}
|
|
8947
|
+
usePagePropertiesOnly={mcpDirectoryWidgetReadOnly}
|
|
8914
8948
|
suggesting={isSuggesting || isStartingSuggestion}
|
|
8915
8949
|
enteringSuggestion={isStartingSuggestion}
|
|
8916
8950
|
onPrimaryFieldAvailabilityChange={
|