agentic-ui-libs 1.0.0-beta.8 → 1.0.0-beta.9
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/features/md-editor/MDEditor.d.ts.map +1 -1
- package/dist/features/md-editor/components/AIRefinePanel.d.ts.map +1 -1
- package/dist/features/md-editor/components/SlashMenu.d.ts.map +1 -1
- package/dist/features/md-editor/components/VariableMenu.d.ts.map +1 -1
- package/dist/features/md-editor/utils/markdown.d.ts.map +1 -1
- package/dist/index.js +35 -13
- package/dist/ui-libs.umd.js +35 -13
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MDEditor.d.ts","sourceRoot":"","sources":["../../../src/features/md-editor/MDEditor.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EASZ,MAAM,SAAS,CAAC;AAiBjB,OAAO,wBAAwB,CAAC;AA4BhC,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"MDEditor.d.ts","sourceRoot":"","sources":["../../../src/features/md-editor/MDEditor.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EASZ,MAAM,SAAS,CAAC;AAiBjB,OAAO,wBAAwB,CAAC;AA4BhC,eAAO,MAAM,QAAQ,uGA0rCpB,CAAC;AAIF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AIRefinePanel.d.ts","sourceRoot":"","sources":["../../../../src/features/md-editor/components/AIRefinePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAoBjF,OAAO,KAAK,EACV,kBAAkB,EAOnB,MAAM,UAAU,CAAC;AAmClB,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"AIRefinePanel.d.ts","sourceRoot":"","sources":["../../../../src/features/md-editor/components/AIRefinePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAoBjF,OAAO,KAAK,EACV,kBAAkB,EAOnB,MAAM,UAAU,CAAC;AAmClB,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA8tCtD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlashMenu.d.ts","sourceRoot":"","sources":["../../../../src/features/md-editor/components/SlashMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoF,MAAM,OAAO,CAAC;AACzG,OAAO,KAAK,EAKV,cAAc,EACf,MAAM,UAAU,CAAC;AAwJlB,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAC;CAC9C;AAED,UAAU,sBAAuB,SAAQ,cAAc;IACrD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"SlashMenu.d.ts","sourceRoot":"","sources":["../../../../src/features/md-editor/components/SlashMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoF,MAAM,OAAO,CAAC;AACzG,OAAO,KAAK,EAKV,cAAc,EACf,MAAM,UAAU,CAAC;AAwJlB,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAC;CAC9C;AAED,UAAU,sBAAuB,SAAQ,cAAc;IACrD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,eAAO,MAAM,SAAS,6FAkmBrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VariableMenu.d.ts","sourceRoot":"","sources":["../../../../src/features/md-editor/components/VariableMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AACjF,OAAO,KAAK,EAAE,QAAQ,EAAgB,MAAM,UAAU,CAAC;AAcvD,UAAU,iBAAiB;IACzB,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvC,gBAAgB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC1B,eAAe,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC7B,eAAe,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC7B,gBAAgB,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qFAAqF;IACrF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,mEAAmE;IACnE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAWD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"VariableMenu.d.ts","sourceRoot":"","sources":["../../../../src/features/md-editor/components/VariableMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AACjF,OAAO,KAAK,EAAE,QAAQ,EAAgB,MAAM,UAAU,CAAC;AAcvD,UAAU,iBAAiB;IACzB,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvC,gBAAgB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC1B,eAAe,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC7B,eAAe,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC7B,gBAAgB,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qFAAqF;IACrF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,mEAAmE;IACnE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAWD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAgjBpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../../src/features/md-editor/utils/markdown.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,UAAU,CAAC;AAEpE;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAa9D;
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../../src/features/md-editor/utils/markdown.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,UAAU,CAAC;AAEpE;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAa9D;AAiJD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CA2QlE;AAmJD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,WAAW,CAOrE;AA+FD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG,cAAc,CAKtE"}
|
package/dist/index.js
CHANGED
|
@@ -67742,7 +67742,7 @@ ${code}
|
|
|
67742
67742
|
function inlineContentToMarkdown(content) {
|
|
67743
67743
|
if (!content || !Array.isArray(content)) return "";
|
|
67744
67744
|
return content.map((node) => {
|
|
67745
|
-
var _a;
|
|
67745
|
+
var _a, _b, _c, _d;
|
|
67746
67746
|
if (node.type === "text") {
|
|
67747
67747
|
let text = node.text || "";
|
|
67748
67748
|
const marks = node.marks || [];
|
|
@@ -67772,14 +67772,15 @@ function inlineContentToMarkdown(content) {
|
|
|
67772
67772
|
return text;
|
|
67773
67773
|
}
|
|
67774
67774
|
if (node.type === "variableChip") {
|
|
67775
|
-
const
|
|
67775
|
+
const variableType = (_b = node.attrs) == null ? void 0 : _b["variableType"];
|
|
67776
|
+
const path = (_c = node.attrs) == null ? void 0 : _c["path"];
|
|
67776
67777
|
if (variableType === "system" || variableType === "custom") {
|
|
67777
67778
|
return `{{${path}}}`;
|
|
67778
67779
|
}
|
|
67779
67780
|
return `{{${variableType}.${path}}}`;
|
|
67780
67781
|
}
|
|
67781
67782
|
if (node.type === "mentionChip") {
|
|
67782
|
-
const
|
|
67783
|
+
const name = (_d = node.attrs) == null ? void 0 : _d["name"];
|
|
67783
67784
|
return name || "";
|
|
67784
67785
|
}
|
|
67785
67786
|
return "";
|
|
@@ -69317,6 +69318,14 @@ const SlashMenu = forwardRef(
|
|
|
69317
69318
|
setSelectedIndex((prev) => findNextEnabledIndex(prev, 1));
|
|
69318
69319
|
return true;
|
|
69319
69320
|
}
|
|
69321
|
+
if (event.key === "Tab") {
|
|
69322
|
+
if (event.shiftKey) {
|
|
69323
|
+
setSelectedIndex((prev) => findNextEnabledIndex(prev, -1));
|
|
69324
|
+
} else {
|
|
69325
|
+
setSelectedIndex((prev) => findNextEnabledIndex(prev, 1));
|
|
69326
|
+
}
|
|
69327
|
+
return true;
|
|
69328
|
+
}
|
|
69320
69329
|
if (event.key === "Enter") {
|
|
69321
69330
|
const item = navigableItems[selectedIndex];
|
|
69322
69331
|
if (item && !("disabled" in item && item.disabled)) {
|
|
@@ -70152,14 +70161,20 @@ const VariableMenu = ({
|
|
|
70152
70161
|
}
|
|
70153
70162
|
break;
|
|
70154
70163
|
case "Tab":
|
|
70164
|
+
e3.preventDefault();
|
|
70165
|
+
e3.stopPropagation();
|
|
70155
70166
|
if (items.length > 0 && !("variables" in items[0])) {
|
|
70156
|
-
const
|
|
70157
|
-
if (
|
|
70158
|
-
|
|
70159
|
-
|
|
70160
|
-
handleItemClick(firstItem);
|
|
70167
|
+
const selectedItem = items[selectedIndex];
|
|
70168
|
+
if ((selectedItem == null ? void 0 : selectedItem.children) && selectedItem.children.length > 0) {
|
|
70169
|
+
handleItemClick(selectedItem);
|
|
70170
|
+
break;
|
|
70161
70171
|
}
|
|
70162
70172
|
}
|
|
70173
|
+
if (e3.shiftKey) {
|
|
70174
|
+
setSelectedIndex((prev) => Math.max(prev - 1, 0));
|
|
70175
|
+
} else {
|
|
70176
|
+
setSelectedIndex((prev) => Math.min(prev + 1, totalItems - 1));
|
|
70177
|
+
}
|
|
70163
70178
|
break;
|
|
70164
70179
|
}
|
|
70165
70180
|
};
|
|
@@ -71374,8 +71389,9 @@ const AIRefinePanel = ({
|
|
|
71374
71389
|
return lastAssistantIdx !== null && lastAssistantIdx > lastSystemIdx;
|
|
71375
71390
|
}, [messages, getLastAssistantMessageIndex]);
|
|
71376
71391
|
const handleRefine = useCallback(async (instruction, quickActionId) => {
|
|
71392
|
+
const safeInstruction = typeof instruction === "string" ? instruction : "";
|
|
71377
71393
|
const isCustomAction = !quickActionId || quickActionId === "custom";
|
|
71378
|
-
if (isCustomAction && !
|
|
71394
|
+
if (isCustomAction && !safeInstruction.trim()) return;
|
|
71379
71395
|
if (isLoading) return;
|
|
71380
71396
|
const textToRefine = getCurrentTextToRefine();
|
|
71381
71397
|
const currentRange = (currentContentState == null ? void 0 : currentContentState.selectionRange) || context.selectionRange;
|
|
@@ -71389,7 +71405,7 @@ const AIRefinePanel = ({
|
|
|
71389
71405
|
} else {
|
|
71390
71406
|
effectiveActionType = sessionActionType || "custom";
|
|
71391
71407
|
}
|
|
71392
|
-
const finalInstruction = effectiveActionType === "custom" ?
|
|
71408
|
+
const finalInstruction = effectiveActionType === "custom" ? safeInstruction : safeInstruction || "";
|
|
71393
71409
|
const userMessage = {
|
|
71394
71410
|
role: "user",
|
|
71395
71411
|
content: finalInstruction || `Apply ${effectiveActionType} action`,
|
|
@@ -71511,6 +71527,7 @@ const AIRefinePanel = ({
|
|
|
71511
71527
|
setMentionSearchQuery("");
|
|
71512
71528
|
}, []);
|
|
71513
71529
|
const handleKeyDown2 = (e3) => {
|
|
71530
|
+
var _a2;
|
|
71514
71531
|
if (showMentionMenu) {
|
|
71515
71532
|
const itemCount = selectedCategory ? filteredItems.length : mentionQuery ? searchResults.length : availableCategories.length;
|
|
71516
71533
|
if (e3.key === "ArrowDown") {
|
|
@@ -71552,7 +71569,8 @@ const AIRefinePanel = ({
|
|
|
71552
71569
|
}
|
|
71553
71570
|
if (e3.key === "Enter" && !e3.shiftKey) {
|
|
71554
71571
|
e3.preventDefault();
|
|
71555
|
-
|
|
71572
|
+
const currentValue = ((_a2 = inputRef.current) == null ? void 0 : _a2.value) ?? inputValue;
|
|
71573
|
+
handleRefine(currentValue);
|
|
71556
71574
|
}
|
|
71557
71575
|
};
|
|
71558
71576
|
const handleReplace = useCallback((content, messageIndex) => {
|
|
@@ -71952,7 +71970,11 @@ const AIRefinePanel = ({
|
|
|
71952
71970
|
"button",
|
|
71953
71971
|
{
|
|
71954
71972
|
className: `flex items-center justify-center w-[34px] h-[34px] rounded-lg bg-gradient-to-br from-violet-500 to-indigo-500 text-white cursor-pointer transition-all shrink-0 ${!inputValue.trim() || isLoading ? isDark ? "bg-gray-600 from-gray-600 to-gray-600 text-gray-500 cursor-not-allowed" : "bg-gray-200 from-gray-200 to-gray-200 text-gray-400 cursor-not-allowed" : "hover:scale-105 hover:shadow-lg hover:shadow-violet-500/40"}`,
|
|
71955
|
-
onClick: () =>
|
|
71973
|
+
onClick: () => {
|
|
71974
|
+
var _a2;
|
|
71975
|
+
const currentValue = ((_a2 = inputRef.current) == null ? void 0 : _a2.value) ?? inputValue;
|
|
71976
|
+
handleRefine(currentValue);
|
|
71977
|
+
},
|
|
71956
71978
|
disabled: !inputValue.trim() || isLoading,
|
|
71957
71979
|
title: "Send",
|
|
71958
71980
|
"data-id": "md-editor-ai-send-btn",
|
|
@@ -72791,7 +72813,7 @@ const MDEditor = forwardRef(
|
|
|
72791
72813
|
return;
|
|
72792
72814
|
}
|
|
72793
72815
|
if (aiRefineContext === null) {
|
|
72794
|
-
const fullContent = editor.
|
|
72816
|
+
const fullContent = editorJsonToMarkdown(editor.getJSON());
|
|
72795
72817
|
setAIRefineContext({
|
|
72796
72818
|
type: "whole",
|
|
72797
72819
|
originalText: fullContent,
|
package/dist/ui-libs.umd.js
CHANGED
|
@@ -67760,7 +67760,7 @@ ${code2}
|
|
|
67760
67760
|
function inlineContentToMarkdown(content) {
|
|
67761
67761
|
if (!content || !Array.isArray(content)) return "";
|
|
67762
67762
|
return content.map((node) => {
|
|
67763
|
-
var _a;
|
|
67763
|
+
var _a, _b, _c, _d;
|
|
67764
67764
|
if (node.type === "text") {
|
|
67765
67765
|
let text = node.text || "";
|
|
67766
67766
|
const marks = node.marks || [];
|
|
@@ -67790,14 +67790,15 @@ ${code2}
|
|
|
67790
67790
|
return text;
|
|
67791
67791
|
}
|
|
67792
67792
|
if (node.type === "variableChip") {
|
|
67793
|
-
const
|
|
67793
|
+
const variableType = (_b = node.attrs) == null ? void 0 : _b["variableType"];
|
|
67794
|
+
const path = (_c = node.attrs) == null ? void 0 : _c["path"];
|
|
67794
67795
|
if (variableType === "system" || variableType === "custom") {
|
|
67795
67796
|
return `{{${path}}}`;
|
|
67796
67797
|
}
|
|
67797
67798
|
return `{{${variableType}.${path}}}`;
|
|
67798
67799
|
}
|
|
67799
67800
|
if (node.type === "mentionChip") {
|
|
67800
|
-
const
|
|
67801
|
+
const name = (_d = node.attrs) == null ? void 0 : _d["name"];
|
|
67801
67802
|
return name || "";
|
|
67802
67803
|
}
|
|
67803
67804
|
return "";
|
|
@@ -69335,6 +69336,14 @@ ${code2}
|
|
|
69335
69336
|
setSelectedIndex((prev) => findNextEnabledIndex(prev, 1));
|
|
69336
69337
|
return true;
|
|
69337
69338
|
}
|
|
69339
|
+
if (event.key === "Tab") {
|
|
69340
|
+
if (event.shiftKey) {
|
|
69341
|
+
setSelectedIndex((prev) => findNextEnabledIndex(prev, -1));
|
|
69342
|
+
} else {
|
|
69343
|
+
setSelectedIndex((prev) => findNextEnabledIndex(prev, 1));
|
|
69344
|
+
}
|
|
69345
|
+
return true;
|
|
69346
|
+
}
|
|
69338
69347
|
if (event.key === "Enter") {
|
|
69339
69348
|
const item = navigableItems[selectedIndex];
|
|
69340
69349
|
if (item && !("disabled" in item && item.disabled)) {
|
|
@@ -70170,14 +70179,20 @@ ${code2}
|
|
|
70170
70179
|
}
|
|
70171
70180
|
break;
|
|
70172
70181
|
case "Tab":
|
|
70182
|
+
e.preventDefault();
|
|
70183
|
+
e.stopPropagation();
|
|
70173
70184
|
if (items.length > 0 && !("variables" in items[0])) {
|
|
70174
|
-
const
|
|
70175
|
-
if (
|
|
70176
|
-
|
|
70177
|
-
|
|
70178
|
-
handleItemClick(firstItem);
|
|
70185
|
+
const selectedItem = items[selectedIndex];
|
|
70186
|
+
if ((selectedItem == null ? void 0 : selectedItem.children) && selectedItem.children.length > 0) {
|
|
70187
|
+
handleItemClick(selectedItem);
|
|
70188
|
+
break;
|
|
70179
70189
|
}
|
|
70180
70190
|
}
|
|
70191
|
+
if (e.shiftKey) {
|
|
70192
|
+
setSelectedIndex((prev) => Math.max(prev - 1, 0));
|
|
70193
|
+
} else {
|
|
70194
|
+
setSelectedIndex((prev) => Math.min(prev + 1, totalItems - 1));
|
|
70195
|
+
}
|
|
70181
70196
|
break;
|
|
70182
70197
|
}
|
|
70183
70198
|
};
|
|
@@ -71392,8 +71407,9 @@ ${code2}
|
|
|
71392
71407
|
return lastAssistantIdx !== null && lastAssistantIdx > lastSystemIdx;
|
|
71393
71408
|
}, [messages, getLastAssistantMessageIndex]);
|
|
71394
71409
|
const handleRefine = React.useCallback(async (instruction, quickActionId) => {
|
|
71410
|
+
const safeInstruction = typeof instruction === "string" ? instruction : "";
|
|
71395
71411
|
const isCustomAction = !quickActionId || quickActionId === "custom";
|
|
71396
|
-
if (isCustomAction && !
|
|
71412
|
+
if (isCustomAction && !safeInstruction.trim()) return;
|
|
71397
71413
|
if (isLoading) return;
|
|
71398
71414
|
const textToRefine = getCurrentTextToRefine();
|
|
71399
71415
|
const currentRange = (currentContentState == null ? void 0 : currentContentState.selectionRange) || context.selectionRange;
|
|
@@ -71407,7 +71423,7 @@ ${code2}
|
|
|
71407
71423
|
} else {
|
|
71408
71424
|
effectiveActionType = sessionActionType || "custom";
|
|
71409
71425
|
}
|
|
71410
|
-
const finalInstruction = effectiveActionType === "custom" ?
|
|
71426
|
+
const finalInstruction = effectiveActionType === "custom" ? safeInstruction : safeInstruction || "";
|
|
71411
71427
|
const userMessage = {
|
|
71412
71428
|
role: "user",
|
|
71413
71429
|
content: finalInstruction || `Apply ${effectiveActionType} action`,
|
|
@@ -71529,6 +71545,7 @@ ${code2}
|
|
|
71529
71545
|
setMentionSearchQuery("");
|
|
71530
71546
|
}, []);
|
|
71531
71547
|
const handleKeyDown2 = (e) => {
|
|
71548
|
+
var _a2;
|
|
71532
71549
|
if (showMentionMenu) {
|
|
71533
71550
|
const itemCount = selectedCategory ? filteredItems.length : mentionQuery ? searchResults.length : availableCategories.length;
|
|
71534
71551
|
if (e.key === "ArrowDown") {
|
|
@@ -71570,7 +71587,8 @@ ${code2}
|
|
|
71570
71587
|
}
|
|
71571
71588
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
71572
71589
|
e.preventDefault();
|
|
71573
|
-
|
|
71590
|
+
const currentValue = ((_a2 = inputRef.current) == null ? void 0 : _a2.value) ?? inputValue;
|
|
71591
|
+
handleRefine(currentValue);
|
|
71574
71592
|
}
|
|
71575
71593
|
};
|
|
71576
71594
|
const handleReplace = React.useCallback((content, messageIndex) => {
|
|
@@ -71970,7 +71988,11 @@ ${code2}
|
|
|
71970
71988
|
"button",
|
|
71971
71989
|
{
|
|
71972
71990
|
className: `flex items-center justify-center w-[34px] h-[34px] rounded-lg bg-gradient-to-br from-violet-500 to-indigo-500 text-white cursor-pointer transition-all shrink-0 ${!inputValue.trim() || isLoading ? isDark ? "bg-gray-600 from-gray-600 to-gray-600 text-gray-500 cursor-not-allowed" : "bg-gray-200 from-gray-200 to-gray-200 text-gray-400 cursor-not-allowed" : "hover:scale-105 hover:shadow-lg hover:shadow-violet-500/40"}`,
|
|
71973
|
-
onClick: () =>
|
|
71991
|
+
onClick: () => {
|
|
71992
|
+
var _a2;
|
|
71993
|
+
const currentValue = ((_a2 = inputRef.current) == null ? void 0 : _a2.value) ?? inputValue;
|
|
71994
|
+
handleRefine(currentValue);
|
|
71995
|
+
},
|
|
71974
71996
|
disabled: !inputValue.trim() || isLoading,
|
|
71975
71997
|
title: "Send",
|
|
71976
71998
|
"data-id": "md-editor-ai-send-btn",
|
|
@@ -72809,7 +72831,7 @@ ${code2}
|
|
|
72809
72831
|
return;
|
|
72810
72832
|
}
|
|
72811
72833
|
if (aiRefineContext === null) {
|
|
72812
|
-
const fullContent = editor.
|
|
72834
|
+
const fullContent = editorJsonToMarkdown(editor.getJSON());
|
|
72813
72835
|
setAIRefineContext({
|
|
72814
72836
|
type: "whole",
|
|
72815
72837
|
originalText: fullContent,
|