@docyrus/ui-pro-ai-assistant 0.6.2 → 0.6.3

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.
@@ -4,5 +4,5 @@ interface MermaidDiagramProps {
4
4
  mermaidNotation: string;
5
5
  state?: string;
6
6
  }
7
- export declare function MermaidDiagram({ title, description, mermaidNotation, state }: MermaidDiagramProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function MermaidDiagram({ title, description, mermaidNotation }: MermaidDiagramProps): import("react/jsx-runtime").JSX.Element;
8
8
  export {};
package/dist/index.js CHANGED
@@ -12410,10 +12410,16 @@ function MermaidRender({ content, className }) {
12410
12410
  setZoom(1);
12411
12411
  setPan({ x: 0, y: 0 });
12412
12412
  };
12413
- const onWheel = useCallback((e) => {
12414
- e.preventDefault();
12415
- const delta = e.deltaY > 0 ? -0.1 : 0.1;
12416
- setZoom((z) => Math.min(Math.max(z + delta, 0.2), 4));
12413
+ useEffect(() => {
12414
+ const el = containerRef.current;
12415
+ if (!el) return;
12416
+ const handleWheel = (e) => {
12417
+ e.preventDefault();
12418
+ const delta = e.deltaY > 0 ? -0.1 : 0.1;
12419
+ setZoom((z) => Math.min(Math.max(z + delta, 0.2), 4));
12420
+ };
12421
+ el.addEventListener("wheel", handleWheel, { passive: false });
12422
+ return () => el.removeEventListener("wheel", handleWheel);
12417
12423
  }, []);
12418
12424
  const onMouseDown = useCallback((e) => {
12419
12425
  isDragging.current = true;
@@ -12438,7 +12444,6 @@ function MermaidRender({ content, className }) {
12438
12444
  "bg-[radial-gradient(circle,_#94a3b8_1px,_transparent_1px)] bg-[size:22px_22px] bg-slate-50",
12439
12445
  className
12440
12446
  ),
12441
- onWheel,
12442
12447
  onMouseDown,
12443
12448
  onMouseMove,
12444
12449
  onMouseUp,
@@ -12465,11 +12470,10 @@ function MermaidRender({ content, className }) {
12465
12470
  function MermaidDiagram({
12466
12471
  title,
12467
12472
  description,
12468
- mermaidNotation,
12469
- state
12473
+ mermaidNotation
12470
12474
  }) {
12471
12475
  const [modalOpen, setModalOpen] = useState(false);
12472
- if (state !== "output-available") {
12476
+ if (!mermaidNotation) {
12473
12477
  return /* @__PURE__ */ jsx("div", { className: "w-full h-[400px] rounded-lg border bg-muted/30 animate-pulse" });
12474
12478
  }
12475
12479
  return /* @__PURE__ */ jsxs(Fragment, { children: [