@puckeditor/plugin-ai 0.6.1-canary.e4418837 → 0.6.1-canary.ee6f7b13

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 CHANGED
@@ -759,8 +759,10 @@ var Modal = ({
759
759
  !hideButton && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: getClassName3("button"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
760
760
  Button,
761
761
  {
762
+ type: "button",
762
763
  variant: buttonVariant,
763
- onClick: () => {
764
+ onClick: (e2) => {
765
+ e2.stopPropagation();
764
766
  setVisible(!visible);
765
767
  },
766
768
  children: actionLabel
@@ -6405,13 +6407,7 @@ function ChatMessagePart({
6405
6407
  if (part.type === "text") {
6406
6408
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: cxMessage("text"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ChatMessageWrapper, { role, children: part.text }) });
6407
6409
  }
6408
- if (part.type === "tool-createPage") {
6409
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PuckTool, { ...part });
6410
- }
6411
- if (part.type === "tool-updatePage") {
6412
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PuckTool, { ...part });
6413
- }
6414
- if (part.type === "tool-userTool") {
6410
+ if (part.type.startsWith("tool-")) {
6415
6411
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PuckTool, { ...part });
6416
6412
  }
6417
6413
  return null;
package/dist/index.mjs CHANGED
@@ -522,7 +522,7 @@ import {
522
522
  import {
523
523
  DefaultChatTransport
524
524
  } from "ai";
525
- import { useCallback as useCallback4, useEffect as useEffect10, useMemo as useMemo4, useRef as useRef8, useState as useState14 } from "react";
525
+ import { useCallback as useCallback4, useEffect as useEffect10, useMemo as useMemo4, useRef as useRef9, useState as useState14 } from "react";
526
526
  import { ulid } from "ulid";
527
527
 
528
528
  // ../utils/lib/get-class-name-factory.ts
@@ -756,8 +756,10 @@ var Modal = ({
756
756
  !hideButton && /* @__PURE__ */ jsx3("div", { className: getClassName3("button"), children: /* @__PURE__ */ jsx3(
757
757
  Button,
758
758
  {
759
+ type: "button",
759
760
  variant: buttonVariant,
760
- onClick: () => {
761
+ onClick: (e2) => {
762
+ e2.stopPropagation();
761
763
  setVisible(!visible);
762
764
  },
763
765
  children: actionLabel
@@ -849,7 +851,7 @@ init_react_import();
849
851
  // ../platform-client/components/AutoForm/AutoForm.tsx
850
852
  init_react_import();
851
853
  import { AutoField, FieldLabel } from "@puckeditor/core";
852
- import { useEffect as useEffect5, useState as useState5 } from "react";
854
+ import { useEffect as useEffect5, useRef as useRef5, useState as useState5 } from "react";
853
855
 
854
856
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/AutoForm/AutoForm.module.css#css-module
855
857
  init_react_import();
@@ -901,7 +903,7 @@ import { useEffect as useEffect6, useState as useState6 } from "react";
901
903
  import { jsx as jsx11 } from "react/jsx-runtime";
902
904
 
903
905
  // ../platform-client/components/Code/Code.tsx
904
- import { useRef as useRef5, useState as useState7 } from "react";
906
+ import { useRef as useRef6, useState as useState7 } from "react";
905
907
  import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
906
908
  var getClassName9 = get_class_name_factory_default("Code", Code_module_default);
907
909
  var getClassNameTab = get_class_name_factory_default("Tab", Code_module_default);
@@ -6127,7 +6129,7 @@ init_react_import();
6127
6129
 
6128
6130
  // ../platform-client/components/Table/Table.tsx
6129
6131
  init_react_import();
6130
- import { useEffect as useEffect8, useMemo as useMemo3, useRef as useRef6, useState as useState11 } from "react";
6132
+ import { useEffect as useEffect8, useMemo as useMemo3, useRef as useRef7, useState as useState11 } from "react";
6131
6133
 
6132
6134
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Table/Table.module.css#css-module
6133
6135
  init_react_import();
@@ -6181,7 +6183,7 @@ var styles_module_default8 = { "Chat": "_Chat_1njo2_1", "Chat-inner": "_Chat-inn
6181
6183
  init_react_import();
6182
6184
  import {
6183
6185
  useEffect as useEffect9,
6184
- useRef as useRef7,
6186
+ useRef as useRef8,
6185
6187
  useState as useState13
6186
6188
  } from "react";
6187
6189
 
@@ -6207,9 +6209,9 @@ function PromptForm({
6207
6209
  maxRows = 5,
6208
6210
  value = ""
6209
6211
  }) {
6210
- const hasSetInitialPrompt = useRef7(false);
6212
+ const hasSetInitialPrompt = useRef8(false);
6211
6213
  const [prompt, setPrompt] = useState13(value);
6212
- const internalRef = useRef7(null);
6214
+ const internalRef = useRef8(null);
6213
6215
  useEffect9(() => {
6214
6216
  setPrompt(value);
6215
6217
  }, [setPrompt, value]);
@@ -6406,13 +6408,7 @@ function ChatMessagePart({
6406
6408
  if (part.type === "text") {
6407
6409
  return /* @__PURE__ */ jsx30("div", { className: cxMessage("text"), children: /* @__PURE__ */ jsx30(ChatMessageWrapper, { role, children: part.text }) });
6408
6410
  }
6409
- if (part.type === "tool-createPage") {
6410
- return /* @__PURE__ */ jsx30(PuckTool, { ...part });
6411
- }
6412
- if (part.type === "tool-updatePage") {
6413
- return /* @__PURE__ */ jsx30(PuckTool, { ...part });
6414
- }
6415
- if (part.type === "tool-userTool") {
6411
+ if (part.type.startsWith("tool-")) {
6416
6412
  return /* @__PURE__ */ jsx30(PuckTool, { ...part });
6417
6413
  }
6418
6414
  return null;
@@ -6654,9 +6650,9 @@ function Chat2({
6654
6650
  const { examplePrompts } = chat ?? {};
6655
6651
  const puckDispatch = usePuck((s2) => s2.dispatch);
6656
6652
  const getPuck = useGetPuck();
6657
- const localChatId = useRef8("");
6658
- const inputRef = useRef8(null);
6659
- const pluginRef = useRef8(null);
6653
+ const localChatId = useRef9("");
6654
+ const inputRef = useRef9(null);
6655
+ const pluginRef = useRef9(null);
6660
6656
  const [error, setError] = useState14();
6661
6657
  const [toolStatus, setToolStatus] = useState14({});
6662
6658
  const uploadScreenshot = useCallback4(
@@ -6957,7 +6953,7 @@ function isScrolledIntoView(el) {
6957
6953
 
6958
6954
  // src/components/ScrollTracking/ScrollTracking.tsx
6959
6955
  init_react_import();
6960
- import { useEffect as useEffect11, useRef as useRef9 } from "react";
6956
+ import { useEffect as useEffect11, useRef as useRef10 } from "react";
6961
6957
 
6962
6958
  // src/lib/scroll-into-view-local.ts
6963
6959
  init_react_import();
@@ -7027,8 +7023,8 @@ var ScrollTracking = ({
7027
7023
  children,
7028
7024
  trackingId
7029
7025
  }) => {
7030
- const followedRefs = useRef9([]);
7031
- const enabledRef = useRef9(false);
7026
+ const followedRefs = useRef10([]);
7027
+ const enabledRef = useRef10(false);
7032
7028
  useEffect11(() => {
7033
7029
  return subscribeToScrollTrackingEvents(({ id, enabled }) => {
7034
7030
  if (id !== trackingId) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puckeditor/plugin-ai",
3
- "version": "0.6.1-canary.e4418837",
3
+ "version": "0.6.1-canary.ee6f7b13",
4
4
  "author": "Chris Villa <chris@puckeditor.com>",
5
5
  "repository": "puckeditor/puck",
6
6
  "bugs": "https://github.com/puckeditor/puck/issues",