puckeditor-plugin-ai 0.6.6 → 0.6.7
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.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +58 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +58 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -189,6 +189,11 @@ type AiSettings = {
|
|
|
189
189
|
urlContext: boolean;
|
|
190
190
|
googleSearch: boolean;
|
|
191
191
|
enterpriseWebSearch: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* When migrating from a page URL, run the full browser pipeline (DOM bundle + structured IR).
|
|
194
|
+
* Slower and uses more Worker time; leave off for screenshot-only + Vertex url_context.
|
|
195
|
+
*/
|
|
196
|
+
pageMigrationIr: boolean;
|
|
192
197
|
figmaToken: string;
|
|
193
198
|
};
|
|
194
199
|
type AiPluginProps = {
|
package/dist/index.d.ts
CHANGED
|
@@ -189,6 +189,11 @@ type AiSettings = {
|
|
|
189
189
|
urlContext: boolean;
|
|
190
190
|
googleSearch: boolean;
|
|
191
191
|
enterpriseWebSearch: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* When migrating from a page URL, run the full browser pipeline (DOM bundle + structured IR).
|
|
194
|
+
* Slower and uses more Worker time; leave off for screenshot-only + Vertex url_context.
|
|
195
|
+
*/
|
|
196
|
+
pageMigrationIr: boolean;
|
|
192
197
|
figmaToken: string;
|
|
193
198
|
};
|
|
194
199
|
type AiPluginProps = {
|
package/dist/index.js
CHANGED
|
@@ -345,6 +345,7 @@ var DEFAULT_AI_SETTINGS = {
|
|
|
345
345
|
urlContext: false,
|
|
346
346
|
googleSearch: false,
|
|
347
347
|
enterpriseWebSearch: false,
|
|
348
|
+
pageMigrationIr: false,
|
|
348
349
|
figmaToken: ""
|
|
349
350
|
};
|
|
350
351
|
var AI_SETTINGS_STORAGE_KEY = "puck-ai-settings";
|
|
@@ -606,14 +607,32 @@ function FileMessagePart({
|
|
|
606
607
|
}
|
|
607
608
|
);
|
|
608
609
|
}
|
|
609
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "puck-ai-chat-message-file puck-ai-chat-message-file--document", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "puck-ai-chat-message-file puck-ai-chat-message-file--document", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
611
|
+
"a",
|
|
612
|
+
{
|
|
613
|
+
href: part.url,
|
|
614
|
+
target: "_blank",
|
|
615
|
+
rel: "noopener noreferrer",
|
|
616
|
+
download: part.filename,
|
|
617
|
+
children: (_b = part.filename) != null ? _b : part.mediaType
|
|
618
|
+
}
|
|
619
|
+
) });
|
|
610
620
|
}
|
|
611
|
-
function ReasoningMessagePart({
|
|
621
|
+
function ReasoningMessagePart({
|
|
622
|
+
part
|
|
623
|
+
}) {
|
|
612
624
|
const streaming = part.state === "streaming";
|
|
613
625
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", { className: "puck-ai-chat-message-reasoning", open: streaming, children: [
|
|
614
626
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("summary", { className: "puck-ai-chat-message-reasoning-summary", children: [
|
|
615
627
|
"Reasoning",
|
|
616
|
-
streaming ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
628
|
+
streaming ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
629
|
+
"span",
|
|
630
|
+
{
|
|
631
|
+
className: "puck-ai-chat-message-reasoning-streaming",
|
|
632
|
+
"aria-live": "polite",
|
|
633
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Loader, { size: 12 })
|
|
634
|
+
}
|
|
635
|
+
) : null
|
|
617
636
|
] }),
|
|
618
637
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "puck-ai-chat-message-reasoning-body", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_markdown.default, { children: part.text }) })
|
|
619
638
|
] });
|
|
@@ -674,7 +693,8 @@ function DataMessagePart({ part }) {
|
|
|
674
693
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "puck-ai-chat-message-data-summary", children: [
|
|
675
694
|
"Tokens: in ",
|
|
676
695
|
(_b = (_a = d.tokenUsage) == null ? void 0 : _a.inputTokens) != null ? _b : "\u2014",
|
|
677
|
-
" \xB7 out
|
|
696
|
+
" \xB7 out",
|
|
697
|
+
" ",
|
|
678
698
|
(_d = (_c = d.tokenUsage) == null ? void 0 : _c.outputTokens) != null ? _d : "\u2014",
|
|
679
699
|
d.totalCost !== void 0 ? ` \xB7 cost ${d.totalCost}` : ""
|
|
680
700
|
] });
|
|
@@ -1251,6 +1271,27 @@ function SettingsPanel({
|
|
|
1251
1271
|
}
|
|
1252
1272
|
)
|
|
1253
1273
|
] }),
|
|
1274
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "puck-ai-settings-row", children: [
|
|
1275
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1276
|
+
"label",
|
|
1277
|
+
{
|
|
1278
|
+
className: "puck-ai-settings-label",
|
|
1279
|
+
htmlFor: "puck-ai-page-migration-ir",
|
|
1280
|
+
children: [
|
|
1281
|
+
"Page migration IR",
|
|
1282
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "puck-ai-settings-hint", children: "Full DOM bundle + structured plan when a source URL is captured (slower; screenshot-only when off)" })
|
|
1283
|
+
]
|
|
1284
|
+
}
|
|
1285
|
+
),
|
|
1286
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1287
|
+
Toggle,
|
|
1288
|
+
{
|
|
1289
|
+
id: "puck-ai-page-migration-ir",
|
|
1290
|
+
checked: settings.pageMigrationIr,
|
|
1291
|
+
onChange: (v) => onChange({ pageMigrationIr: v })
|
|
1292
|
+
}
|
|
1293
|
+
)
|
|
1294
|
+
] }),
|
|
1254
1295
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "puck-ai-settings-row", children: [
|
|
1255
1296
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1256
1297
|
"label",
|
|
@@ -1346,10 +1387,17 @@ function SettingsPanel({
|
|
|
1346
1387
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "puck-ai-settings-section", children: [
|
|
1347
1388
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "puck-ai-settings-section-title", children: "Chat" }),
|
|
1348
1389
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "puck-ai-settings-row puck-ai-settings-row--column", children: [
|
|
1349
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1350
|
-
"
|
|
1351
|
-
|
|
1352
|
-
|
|
1390
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1391
|
+
"label",
|
|
1392
|
+
{
|
|
1393
|
+
className: "puck-ai-settings-label",
|
|
1394
|
+
htmlFor: "puck-ai-clear-chat",
|
|
1395
|
+
children: [
|
|
1396
|
+
"Clear chat history",
|
|
1397
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "puck-ai-settings-hint", children: "Remove all messages and reset the conversation context for this session." })
|
|
1398
|
+
]
|
|
1399
|
+
}
|
|
1400
|
+
),
|
|
1353
1401
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1354
1402
|
"button",
|
|
1355
1403
|
{
|
|
@@ -1498,6 +1546,8 @@ function Chat({
|
|
|
1498
1546
|
if (currentSettings.thinkingLevel !== "none")
|
|
1499
1547
|
geminiConfig.thinkingLevel = currentSettings.thinkingLevel;
|
|
1500
1548
|
if (currentSettings.urlContext) geminiConfig.urlContext = true;
|
|
1549
|
+
if (currentSettings.pageMigrationIr)
|
|
1550
|
+
geminiConfig.pageMigrationIr = true;
|
|
1501
1551
|
if (currentSettings.googleSearch) geminiConfig.googleSearch = true;
|
|
1502
1552
|
if (currentSettings.enterpriseWebSearch)
|
|
1503
1553
|
geminiConfig.enterpriseWebSearch = true;
|