@docyrus/ui-pro-ai-assistant 0.4.1 → 0.4.2
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/index.js +12 -18
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -5695,24 +5695,15 @@ function ShowAdvancedDataTable({
|
|
|
5695
5695
|
const [open, setOpen] = useState(true);
|
|
5696
5696
|
const containerRef = useRef(null);
|
|
5697
5697
|
const tableRef = useRef(null);
|
|
5698
|
-
const parsedData = useMemo(() => {
|
|
5699
|
-
if (!data) return [];
|
|
5698
|
+
const { parsedData, parseError } = useMemo(() => {
|
|
5699
|
+
if (state !== "output-available" || !data) return { parsedData: [], parseError: null };
|
|
5700
5700
|
try {
|
|
5701
5701
|
const parsed = JSON.parse(data);
|
|
5702
|
-
return Array.isArray(parsed) ? parsed : [];
|
|
5703
|
-
} catch {
|
|
5704
|
-
return null;
|
|
5705
|
-
}
|
|
5706
|
-
}, [data]);
|
|
5707
|
-
const parseError = useMemo(() => {
|
|
5708
|
-
if (!data) return null;
|
|
5709
|
-
try {
|
|
5710
|
-
JSON.parse(data);
|
|
5711
|
-
return null;
|
|
5702
|
+
return { parsedData: Array.isArray(parsed) ? parsed : [], parseError: null };
|
|
5712
5703
|
} catch (e) {
|
|
5713
|
-
return e.message;
|
|
5704
|
+
return { parsedData: null, parseError: e.message };
|
|
5714
5705
|
}
|
|
5715
|
-
}, [data]);
|
|
5706
|
+
}, [data, state]);
|
|
5716
5707
|
const vtableColumns = useMemo(() => {
|
|
5717
5708
|
return columns.map((col) => {
|
|
5718
5709
|
const field = col.field ?? col.name ?? "";
|
|
@@ -5752,7 +5743,9 @@ function ShowAdvancedDataTable({
|
|
|
5752
5743
|
defaultHeaderRowHeight,
|
|
5753
5744
|
defaultColWidth,
|
|
5754
5745
|
widthMode: "standard",
|
|
5755
|
-
|
|
5746
|
+
canvasHeight: "auto",
|
|
5747
|
+
maxCanvasHeight: height,
|
|
5748
|
+
heightMode: "autoHeight",
|
|
5756
5749
|
animationAppear: false
|
|
5757
5750
|
};
|
|
5758
5751
|
if (enableTree) {
|
|
@@ -5854,14 +5847,14 @@ function ShowAdvancedDataTable({
|
|
|
5854
5847
|
}
|
|
5855
5848
|
),
|
|
5856
5849
|
/* @__PURE__ */ jsxs("div", { className: cn("p-4", !open && "hidden"), children: [
|
|
5857
|
-
state !== "output-available" &&
|
|
5858
|
-
parseError && /* @__PURE__ */ jsxs("div", { className: "text-sm text-destructive bg-destructive/10 border border-destructive/20 rounded-lg p-3", children: [
|
|
5850
|
+
state !== "output-available" && /* @__PURE__ */ jsx("div", { className: "w-full h-[200px] rounded-lg bg-muted/30 animate-pulse" }),
|
|
5851
|
+
state === "output-available" && parseError && /* @__PURE__ */ jsxs("div", { className: "text-sm text-destructive bg-destructive/10 border border-destructive/20 rounded-lg p-3", children: [
|
|
5859
5852
|
/* @__PURE__ */ jsx("div", { className: "font-medium", children: "Error parsing data" }),
|
|
5860
5853
|
/* @__PURE__ */ jsx("div", { className: "text-xs mt-1", children: parseError })
|
|
5861
5854
|
] }),
|
|
5862
5855
|
errorText && !parseError && /* @__PURE__ */ jsx("div", { className: "text-sm text-destructive bg-destructive/10 border border-destructive/20 rounded-lg p-3", children: errorText }),
|
|
5863
5856
|
state === "output-available" && !parseError && parsedData && parsedData.length === 0 && /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground text-center py-6", children: "No data to display" }),
|
|
5864
|
-
/* @__PURE__ */ jsx("div", { ref: containerRef, className: "w-full rounded-lg"
|
|
5857
|
+
/* @__PURE__ */ jsx("div", { ref: containerRef, className: "w-full rounded-lg" }),
|
|
5865
5858
|
state === "output-available" && parsedData && parsedData.length > 0 && /* @__PURE__ */ jsxs("div", { className: "text-xs text-muted-foreground mt-2", children: [
|
|
5866
5859
|
parsedData.length,
|
|
5867
5860
|
" ",
|
|
@@ -24969,6 +24962,7 @@ var DocyAssistant = ({
|
|
|
24969
24962
|
} = useChat$1({
|
|
24970
24963
|
id: `docy-assistant:${activeAgentId}`,
|
|
24971
24964
|
transport,
|
|
24965
|
+
experimental_throttle: 80,
|
|
24972
24966
|
sendAutomaticallyWhen: lastAssistantMessageIsCompleteWithToolCalls,
|
|
24973
24967
|
onFinish: (message, options3) => {
|
|
24974
24968
|
const { usage, finishReason } = options3 || {};
|