agentic-ui-libs 1.0.0-beta.10 → 1.0.0-beta.11
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.
|
@@ -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,uGA4rCpB,CAAC;AAIF,eAAe,QAAQ,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,
|
|
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,CAsC9D;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
|
@@ -67667,12 +67667,30 @@ const TableHeader = Node$1.create({
|
|
|
67667
67667
|
function editorJsonToMarkdown(json) {
|
|
67668
67668
|
if (!json || !json.content) return "";
|
|
67669
67669
|
const lines = [];
|
|
67670
|
+
const inlineNodes = [];
|
|
67670
67671
|
for (const node of json.content) {
|
|
67672
|
+
if (node.type === "text" || node.type === "variableChip" || node.type === "mentionChip") {
|
|
67673
|
+
inlineNodes.push(node);
|
|
67674
|
+
continue;
|
|
67675
|
+
}
|
|
67676
|
+
if (inlineNodes.length > 0) {
|
|
67677
|
+
const inlineText = inlineContentToMarkdown(inlineNodes);
|
|
67678
|
+
if (inlineText) {
|
|
67679
|
+
lines.push(inlineText);
|
|
67680
|
+
}
|
|
67681
|
+
inlineNodes.length = 0;
|
|
67682
|
+
}
|
|
67671
67683
|
const line = nodeToMarkdown(node);
|
|
67672
67684
|
if (line !== null) {
|
|
67673
67685
|
lines.push(line);
|
|
67674
67686
|
}
|
|
67675
67687
|
}
|
|
67688
|
+
if (inlineNodes.length > 0) {
|
|
67689
|
+
const inlineText = inlineContentToMarkdown(inlineNodes);
|
|
67690
|
+
if (inlineText) {
|
|
67691
|
+
lines.push(inlineText);
|
|
67692
|
+
}
|
|
67693
|
+
}
|
|
67676
67694
|
return lines.join("\n\n");
|
|
67677
67695
|
}
|
|
67678
67696
|
function nodeToMarkdown(node) {
|
|
@@ -71689,7 +71707,7 @@ const AIRefinePanel = ({
|
|
|
71689
71707
|
className: `flex items-start gap-2 p-2.5 my-2 rounded-lg border animate-[ai-new-selection-in_0.3s_ease-out] ${isDark ? "bg-white/5 border-white/10" : "bg-black/[0.03] border-black/5"}`,
|
|
71690
71708
|
children: [
|
|
71691
71709
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `shrink-0 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide rounded-md ${isDark ? "text-violet-400 bg-violet-500/20" : "text-violet-600 bg-violet-500/10"}`, children: "Selection" }),
|
|
71692
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `text-xs leading-relaxed
|
|
71710
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `text-xs leading-relaxed break-words line-clamp-4 ${isDark ? "text-gray-300" : "text-gray-600"}`, children: message.newSelectionText })
|
|
71693
71711
|
]
|
|
71694
71712
|
},
|
|
71695
71713
|
index
|
|
@@ -72563,7 +72581,7 @@ const MDEditor = forwardRef(
|
|
|
72563
72581
|
const { from: from2, to } = aiRefineContext.selectionRange;
|
|
72564
72582
|
const parsedContent = markdownToEditorJson(refinedText);
|
|
72565
72583
|
editor2.chain().focus().deleteRange({ from: from2, to }).insertContentAt(from2, parsedContent.content || refinedText).run();
|
|
72566
|
-
const newTo =
|
|
72584
|
+
const newTo = editor2.state.selection.to;
|
|
72567
72585
|
setAIRefineContext((prev) => prev ? {
|
|
72568
72586
|
...prev,
|
|
72569
72587
|
originalText: refinedText,
|
package/dist/ui-libs.umd.js
CHANGED
|
@@ -67685,12 +67685,30 @@ img.ProseMirror-separator {
|
|
|
67685
67685
|
function editorJsonToMarkdown(json) {
|
|
67686
67686
|
if (!json || !json.content) return "";
|
|
67687
67687
|
const lines = [];
|
|
67688
|
+
const inlineNodes = [];
|
|
67688
67689
|
for (const node of json.content) {
|
|
67690
|
+
if (node.type === "text" || node.type === "variableChip" || node.type === "mentionChip") {
|
|
67691
|
+
inlineNodes.push(node);
|
|
67692
|
+
continue;
|
|
67693
|
+
}
|
|
67694
|
+
if (inlineNodes.length > 0) {
|
|
67695
|
+
const inlineText = inlineContentToMarkdown(inlineNodes);
|
|
67696
|
+
if (inlineText) {
|
|
67697
|
+
lines.push(inlineText);
|
|
67698
|
+
}
|
|
67699
|
+
inlineNodes.length = 0;
|
|
67700
|
+
}
|
|
67689
67701
|
const line = nodeToMarkdown(node);
|
|
67690
67702
|
if (line !== null) {
|
|
67691
67703
|
lines.push(line);
|
|
67692
67704
|
}
|
|
67693
67705
|
}
|
|
67706
|
+
if (inlineNodes.length > 0) {
|
|
67707
|
+
const inlineText = inlineContentToMarkdown(inlineNodes);
|
|
67708
|
+
if (inlineText) {
|
|
67709
|
+
lines.push(inlineText);
|
|
67710
|
+
}
|
|
67711
|
+
}
|
|
67694
67712
|
return lines.join("\n\n");
|
|
67695
67713
|
}
|
|
67696
67714
|
function nodeToMarkdown(node) {
|
|
@@ -71707,7 +71725,7 @@ ${code2}
|
|
|
71707
71725
|
className: `flex items-start gap-2 p-2.5 my-2 rounded-lg border animate-[ai-new-selection-in_0.3s_ease-out] ${isDark ? "bg-white/5 border-white/10" : "bg-black/[0.03] border-black/5"}`,
|
|
71708
71726
|
children: [
|
|
71709
71727
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `shrink-0 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide rounded-md ${isDark ? "text-violet-400 bg-violet-500/20" : "text-violet-600 bg-violet-500/10"}`, children: "Selection" }),
|
|
71710
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `text-xs leading-relaxed
|
|
71728
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `text-xs leading-relaxed break-words line-clamp-4 ${isDark ? "text-gray-300" : "text-gray-600"}`, children: message.newSelectionText })
|
|
71711
71729
|
]
|
|
71712
71730
|
},
|
|
71713
71731
|
index
|
|
@@ -72581,7 +72599,7 @@ ${code2}
|
|
|
72581
72599
|
const { from, to } = aiRefineContext.selectionRange;
|
|
72582
72600
|
const parsedContent = markdownToEditorJson(refinedText);
|
|
72583
72601
|
editor2.chain().focus().deleteRange({ from, to }).insertContentAt(from, parsedContent.content || refinedText).run();
|
|
72584
|
-
const newTo =
|
|
72602
|
+
const newTo = editor2.state.selection.to;
|
|
72585
72603
|
setAIRefineContext((prev) => prev ? {
|
|
72586
72604
|
...prev,
|
|
72587
72605
|
originalText: refinedText,
|