@agent-native/toolkit 0.210.2 → 0.211.0-nightly-20261020183616
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/app/agentkit/react/components.d.ts.map +1 -1
- package/dist/app/agentkit/react/components.js +46 -7
- package/dist/app/agentkit/react/components.js.map +1 -1
- package/dist/app/chat/AgentSidebar.d.ts.map +1 -1
- package/dist/app/chat/AgentSidebar.js +5 -3
- package/dist/app/chat/AgentSidebar.js.map +1 -1
- package/dist/app/resources/McpIntegrationDialog.d.ts.map +1 -1
- package/dist/app/resources/McpIntegrationDialog.js +3 -2
- package/dist/app/resources/McpIntegrationDialog.js.map +1 -1
- package/dist/app/review/ReviewCommentComposer.d.ts.map +1 -1
- package/dist/app/review/ReviewCommentComposer.js +21 -2
- package/dist/app/review/ReviewCommentComposer.js.map +1 -1
- package/dist/app/review/ReviewThreadPanel.d.ts.map +1 -1
- package/dist/app/review/ReviewThreadPanel.js +27 -5
- package/dist/app/review/ReviewThreadPanel.js.map +1 -1
- package/dist/composer/PromptComposer.d.ts.map +1 -1
- package/dist/composer/PromptComposer.js +23 -12
- package/dist/composer/PromptComposer.js.map +1 -1
- package/dist/editor/DragHandle.d.ts +1 -0
- package/dist/editor/DragHandle.d.ts.map +1 -1
- package/dist/editor/DragHandle.js +13 -6
- package/dist/editor/DragHandle.js.map +1 -1
- package/package.json +4 -4
- package/src/app/agentkit/react/components.interaction.spec.tsx +85 -0
- package/src/app/agentkit/react/components.tsx +45 -8
- package/src/app/chat/AgentSidebar.spec.tsx +56 -6
- package/src/app/chat/AgentSidebar.tsx +7 -5
- package/src/app/resources/McpIntegrationDialog.spec.tsx +51 -1
- package/src/app/resources/McpIntegrationDialog.tsx +3 -2
- package/src/app/review/ReviewCommentComposer.tsx +18 -1
- package/src/app/review/ReviewThreadPanel.spec.tsx +170 -7
- package/src/app/review/ReviewThreadPanel.tsx +34 -4
- package/src/composer/PromptComposer.autofocus.spec.tsx +73 -0
- package/src/composer/PromptComposer.tsx +24 -14
- package/src/composer/TiptapComposer.spec.ts +6 -0
- package/src/editor/DragHandle.spec.ts +45 -0
- package/src/editor/DragHandle.ts +15 -6
package/src/editor/DragHandle.ts
CHANGED
|
@@ -11,6 +11,15 @@ import { type EditorView } from "@tiptap/pm/view";
|
|
|
11
11
|
|
|
12
12
|
export const DEFAULT_DRAG_HANDLE_WRAPPER_SELECTOR = ".visual-editor-wrapper";
|
|
13
13
|
|
|
14
|
+
// The block menu and drag act while focus is outside the editor. Apps that
|
|
15
|
+
// skip unfocused changes nobody marked as the user's (Content's collaborative
|
|
16
|
+
// save) would drop these edits without it. Not "drop": that runs paste rules.
|
|
17
|
+
export const DRAG_HANDLE_UI_EVENT = "dragHandle";
|
|
18
|
+
|
|
19
|
+
function markUserAction(tr: Transaction) {
|
|
20
|
+
return tr.setMeta("uiEvent", DRAG_HANDLE_UI_EVENT);
|
|
21
|
+
}
|
|
22
|
+
|
|
14
23
|
export interface DragHandleOptions {
|
|
15
24
|
wrapperSelector: string;
|
|
16
25
|
getDragTransferData?: (context: {
|
|
@@ -610,7 +619,7 @@ export const DragHandle = Extension.create<DragHandleOptions>({
|
|
|
610
619
|
bias,
|
|
611
620
|
),
|
|
612
621
|
);
|
|
613
|
-
view.dispatch(tr.scrollIntoView());
|
|
622
|
+
view.dispatch(markUserAction(tr).scrollIntoView());
|
|
614
623
|
view.focus();
|
|
615
624
|
};
|
|
616
625
|
|
|
@@ -623,7 +632,7 @@ export const DragHandle = Extension.create<DragHandleOptions>({
|
|
|
623
632
|
|
|
624
633
|
try {
|
|
625
634
|
tr.setSelection(NodeSelection.create(tr.doc, insertPos));
|
|
626
|
-
resolved.view.dispatch(tr.scrollIntoView());
|
|
635
|
+
resolved.view.dispatch(markUserAction(tr).scrollIntoView());
|
|
627
636
|
resolved.view.focus();
|
|
628
637
|
} catch {
|
|
629
638
|
focusSelectionNear(resolved.view, tr, insertPos, 1);
|
|
@@ -659,7 +668,7 @@ export const DragHandle = Extension.create<DragHandleOptions>({
|
|
|
659
668
|
const paragraphNode = paragraph.createAndFill() ?? paragraph.create();
|
|
660
669
|
const tr = resolved.view.state.tr.insert(insertPos, paragraphNode);
|
|
661
670
|
tr.setSelection(TextSelection.create(tr.doc, insertPos + 1));
|
|
662
|
-
resolved.view.dispatch(tr.scrollIntoView());
|
|
671
|
+
resolved.view.dispatch(markUserAction(tr).scrollIntoView());
|
|
663
672
|
resolved.view.focus();
|
|
664
673
|
};
|
|
665
674
|
|
|
@@ -1106,7 +1115,7 @@ export const DragHandle = Extension.create<DragHandleOptions>({
|
|
|
1106
1115
|
.delete(sourceStart, sourceEnd)
|
|
1107
1116
|
.insert(insertPos, sourceNode);
|
|
1108
1117
|
|
|
1109
|
-
session.view.dispatch(tr.scrollIntoView());
|
|
1118
|
+
session.view.dispatch(markUserAction(tr).scrollIntoView());
|
|
1110
1119
|
dropCommitted = true;
|
|
1111
1120
|
} else {
|
|
1112
1121
|
try {
|
|
@@ -1123,13 +1132,13 @@ export const DragHandle = Extension.create<DragHandleOptions>({
|
|
|
1123
1132
|
dropPos,
|
|
1124
1133
|
targetNode,
|
|
1125
1134
|
);
|
|
1126
|
-
target.view.dispatch(insertTr.scrollIntoView());
|
|
1135
|
+
target.view.dispatch(markUserAction(insertTr).scrollIntoView());
|
|
1127
1136
|
|
|
1128
1137
|
const deleteTr = session.view.state.tr.delete(
|
|
1129
1138
|
sourceStart,
|
|
1130
1139
|
sourceEnd,
|
|
1131
1140
|
);
|
|
1132
|
-
session.view.dispatch(deleteTr);
|
|
1141
|
+
session.view.dispatch(markUserAction(deleteTr));
|
|
1133
1142
|
dropCommitted = true;
|
|
1134
1143
|
} catch {
|
|
1135
1144
|
// If the target schema cannot accept this node, leave the
|