@puckeditor/plugin-ai 0.6.1-canary.68e393d5 → 0.6.1-canary.78b4acae
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 +1 -7
- package/dist/index.mjs +14 -20
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6407,13 +6407,7 @@ function ChatMessagePart({
|
|
|
6407
6407
|
if (part.type === "text") {
|
|
6408
6408
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: cxMessage("text"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ChatMessageWrapper, { role, children: part.text }) });
|
|
6409
6409
|
}
|
|
6410
|
-
if (part.type
|
|
6411
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PuckTool, { ...part });
|
|
6412
|
-
}
|
|
6413
|
-
if (part.type === "tool-updatePage") {
|
|
6414
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PuckTool, { ...part });
|
|
6415
|
-
}
|
|
6416
|
-
if (part.type === "tool-userTool") {
|
|
6410
|
+
if (part.type.startsWith("tool-")) {
|
|
6417
6411
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PuckTool, { ...part });
|
|
6418
6412
|
}
|
|
6419
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
|
|
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
|
|
@@ -851,7 +851,7 @@ init_react_import();
|
|
|
851
851
|
// ../platform-client/components/AutoForm/AutoForm.tsx
|
|
852
852
|
init_react_import();
|
|
853
853
|
import { AutoField, FieldLabel } from "@puckeditor/core";
|
|
854
|
-
import { useEffect as useEffect5, useState as useState5 } from "react";
|
|
854
|
+
import { useEffect as useEffect5, useRef as useRef5, useState as useState5 } from "react";
|
|
855
855
|
|
|
856
856
|
// css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/AutoForm/AutoForm.module.css#css-module
|
|
857
857
|
init_react_import();
|
|
@@ -903,7 +903,7 @@ import { useEffect as useEffect6, useState as useState6 } from "react";
|
|
|
903
903
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
904
904
|
|
|
905
905
|
// ../platform-client/components/Code/Code.tsx
|
|
906
|
-
import { useRef as
|
|
906
|
+
import { useRef as useRef6, useState as useState7 } from "react";
|
|
907
907
|
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
908
908
|
var getClassName9 = get_class_name_factory_default("Code", Code_module_default);
|
|
909
909
|
var getClassNameTab = get_class_name_factory_default("Tab", Code_module_default);
|
|
@@ -6129,7 +6129,7 @@ init_react_import();
|
|
|
6129
6129
|
|
|
6130
6130
|
// ../platform-client/components/Table/Table.tsx
|
|
6131
6131
|
init_react_import();
|
|
6132
|
-
import { useEffect as useEffect8, useMemo as useMemo3, useRef as
|
|
6132
|
+
import { useEffect as useEffect8, useMemo as useMemo3, useRef as useRef7, useState as useState11 } from "react";
|
|
6133
6133
|
|
|
6134
6134
|
// css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Table/Table.module.css#css-module
|
|
6135
6135
|
init_react_import();
|
|
@@ -6183,7 +6183,7 @@ var styles_module_default8 = { "Chat": "_Chat_1njo2_1", "Chat-inner": "_Chat-inn
|
|
|
6183
6183
|
init_react_import();
|
|
6184
6184
|
import {
|
|
6185
6185
|
useEffect as useEffect9,
|
|
6186
|
-
useRef as
|
|
6186
|
+
useRef as useRef8,
|
|
6187
6187
|
useState as useState13
|
|
6188
6188
|
} from "react";
|
|
6189
6189
|
|
|
@@ -6209,9 +6209,9 @@ function PromptForm({
|
|
|
6209
6209
|
maxRows = 5,
|
|
6210
6210
|
value = ""
|
|
6211
6211
|
}) {
|
|
6212
|
-
const hasSetInitialPrompt =
|
|
6212
|
+
const hasSetInitialPrompt = useRef8(false);
|
|
6213
6213
|
const [prompt, setPrompt] = useState13(value);
|
|
6214
|
-
const internalRef =
|
|
6214
|
+
const internalRef = useRef8(null);
|
|
6215
6215
|
useEffect9(() => {
|
|
6216
6216
|
setPrompt(value);
|
|
6217
6217
|
}, [setPrompt, value]);
|
|
@@ -6408,13 +6408,7 @@ function ChatMessagePart({
|
|
|
6408
6408
|
if (part.type === "text") {
|
|
6409
6409
|
return /* @__PURE__ */ jsx30("div", { className: cxMessage("text"), children: /* @__PURE__ */ jsx30(ChatMessageWrapper, { role, children: part.text }) });
|
|
6410
6410
|
}
|
|
6411
|
-
if (part.type
|
|
6412
|
-
return /* @__PURE__ */ jsx30(PuckTool, { ...part });
|
|
6413
|
-
}
|
|
6414
|
-
if (part.type === "tool-updatePage") {
|
|
6415
|
-
return /* @__PURE__ */ jsx30(PuckTool, { ...part });
|
|
6416
|
-
}
|
|
6417
|
-
if (part.type === "tool-userTool") {
|
|
6411
|
+
if (part.type.startsWith("tool-")) {
|
|
6418
6412
|
return /* @__PURE__ */ jsx30(PuckTool, { ...part });
|
|
6419
6413
|
}
|
|
6420
6414
|
return null;
|
|
@@ -6656,9 +6650,9 @@ function Chat2({
|
|
|
6656
6650
|
const { examplePrompts } = chat ?? {};
|
|
6657
6651
|
const puckDispatch = usePuck((s2) => s2.dispatch);
|
|
6658
6652
|
const getPuck = useGetPuck();
|
|
6659
|
-
const localChatId =
|
|
6660
|
-
const inputRef =
|
|
6661
|
-
const pluginRef =
|
|
6653
|
+
const localChatId = useRef9("");
|
|
6654
|
+
const inputRef = useRef9(null);
|
|
6655
|
+
const pluginRef = useRef9(null);
|
|
6662
6656
|
const [error, setError] = useState14();
|
|
6663
6657
|
const [toolStatus, setToolStatus] = useState14({});
|
|
6664
6658
|
const uploadScreenshot = useCallback4(
|
|
@@ -6959,7 +6953,7 @@ function isScrolledIntoView(el) {
|
|
|
6959
6953
|
|
|
6960
6954
|
// src/components/ScrollTracking/ScrollTracking.tsx
|
|
6961
6955
|
init_react_import();
|
|
6962
|
-
import { useEffect as useEffect11, useRef as
|
|
6956
|
+
import { useEffect as useEffect11, useRef as useRef10 } from "react";
|
|
6963
6957
|
|
|
6964
6958
|
// src/lib/scroll-into-view-local.ts
|
|
6965
6959
|
init_react_import();
|
|
@@ -7029,8 +7023,8 @@ var ScrollTracking = ({
|
|
|
7029
7023
|
children,
|
|
7030
7024
|
trackingId
|
|
7031
7025
|
}) => {
|
|
7032
|
-
const followedRefs =
|
|
7033
|
-
const enabledRef =
|
|
7026
|
+
const followedRefs = useRef10([]);
|
|
7027
|
+
const enabledRef = useRef10(false);
|
|
7034
7028
|
useEffect11(() => {
|
|
7035
7029
|
return subscribeToScrollTrackingEvents(({ id, enabled }) => {
|
|
7036
7030
|
if (id !== trackingId) return;
|
package/package.json
CHANGED