@webless/agent 0.10.2 → 0.10.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.
- package/dist/{chunk-Q7H4RRS4.js → chunk-74CSWSC5.js} +39 -30
- package/dist/chunk-74CSWSC5.js.map +1 -0
- package/dist/embed.cjs +38 -29
- package/dist/embed.cjs.map +1 -1
- package/dist/embed.css +86 -130
- package/dist/embed.css.map +1 -1
- package/dist/embed.js +1 -1
- package/dist/react.cjs +38 -29
- package/dist/react.cjs.map +1 -1
- package/dist/react.css +86 -130
- package/dist/react.css.map +1 -1
- package/dist/react.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-Q7H4RRS4.js.map +0 -1
package/dist/embed.js
CHANGED
package/dist/react.cjs
CHANGED
|
@@ -3788,6 +3788,7 @@ function joinLabels(labels) {
|
|
|
3788
3788
|
if (labels.length === 2) return `${labels[0]} and ${labels[1]}`;
|
|
3789
3789
|
return `${labels.slice(0, -1).join(", ")} and ${labels.at(-1) ?? ""}`;
|
|
3790
3790
|
}
|
|
3791
|
+
var AGENT_SOFT_REVIEW_STATUS = "Reviewing your details to find the best approach";
|
|
3791
3792
|
function workSummary(steps, failed, brandLabel) {
|
|
3792
3793
|
const activeTool = [...steps].reverse().find(
|
|
3793
3794
|
(step) => step.kind === "tool" && step.state === "active"
|
|
@@ -3802,7 +3803,7 @@ function workSummary(steps, failed, brandLabel) {
|
|
|
3802
3803
|
)}`;
|
|
3803
3804
|
const active = [...steps].reverse().find((step) => step.state === "active");
|
|
3804
3805
|
if (active?.kind === "search") return "Searching this site";
|
|
3805
|
-
if (active) return
|
|
3806
|
+
if (active) return AGENT_SOFT_REVIEW_STATUS;
|
|
3806
3807
|
if (failed) return "Couldn\u2019t complete this request";
|
|
3807
3808
|
const hasError = steps.some((step) => step.state === "error");
|
|
3808
3809
|
const specialists = steps.filter(
|
|
@@ -3896,23 +3897,32 @@ function AgentActivityBubble({
|
|
|
3896
3897
|
onRetryStep
|
|
3897
3898
|
}) {
|
|
3898
3899
|
const active = steps.some((step) => step.state === "active");
|
|
3900
|
+
const statusText = workSummary(steps, failed, brandLabel);
|
|
3901
|
+
const softReview = statusText === AGENT_SOFT_REVIEW_STATUS;
|
|
3899
3902
|
const receiptId = steps.map((step) => step.id).join(":");
|
|
3900
3903
|
const [expandedReceiptId, setExpandedReceiptId] = (0, import_react5.useState)(
|
|
3901
3904
|
null
|
|
3902
3905
|
);
|
|
3903
3906
|
const detailsOpen = !active && expandedReceiptId === receiptId;
|
|
3904
3907
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", { className: "agent-activity-bubble", children: [
|
|
3905
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
{
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3908
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
3909
|
+
"p",
|
|
3910
|
+
{
|
|
3911
|
+
className: `agent-activity-bubble__status${softReview ? " agent-activity-bubble__status--soft" : ""}`,
|
|
3912
|
+
"aria-live": "polite",
|
|
3913
|
+
children: [
|
|
3914
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
3915
|
+
"span",
|
|
3916
|
+
{
|
|
3917
|
+
className: `agent-activity-bubble__pulse${active ? " is-active" : failed ? " is-error" : ""}`,
|
|
3918
|
+
"aria-hidden": "true"
|
|
3919
|
+
}
|
|
3920
|
+
),
|
|
3921
|
+
statusText,
|
|
3922
|
+
active ? "..." : ""
|
|
3923
|
+
]
|
|
3924
|
+
}
|
|
3925
|
+
),
|
|
3916
3926
|
!active ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "agent-activity-bubble__details", children: [
|
|
3917
3927
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
3918
3928
|
"button",
|
|
@@ -4134,7 +4144,6 @@ function Composer({
|
|
|
4134
4144
|
if (form && form.id !== draft.form?.id) setDraft(createDraft(form));
|
|
4135
4145
|
const savedForm = allowFormResume && !draft.submitted ? draft.form : null;
|
|
4136
4146
|
const activeForm = !disabled && draft.expanded ? savedForm : null;
|
|
4137
|
-
const hasDraft = Object.values(draft.values).some((value2) => value2.trim());
|
|
4138
4147
|
const canSend = !disabled && Boolean(value.trim() || activeForm);
|
|
4139
4148
|
(0, import_react8.useEffect)(() => {
|
|
4140
4149
|
if (activeForm) firstFieldRef.current?.focus();
|
|
@@ -4250,14 +4259,14 @@ function Composer({
|
|
|
4250
4259
|
onSubmit: handleSubmit,
|
|
4251
4260
|
children: [
|
|
4252
4261
|
savedForm ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "composer__resume", children: [
|
|
4253
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children:
|
|
4262
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "Share your details and we'll reach out shortly" }),
|
|
4254
4263
|
!activeForm ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4255
4264
|
"button",
|
|
4256
4265
|
{
|
|
4257
4266
|
type: "button",
|
|
4258
4267
|
disabled,
|
|
4259
4268
|
onClick: () => setDraft((current) => ({ ...current, expanded: true })),
|
|
4260
|
-
children:
|
|
4269
|
+
children: "Request follow-up"
|
|
4261
4270
|
}
|
|
4262
4271
|
) : null
|
|
4263
4272
|
] }) : null,
|
|
@@ -7065,7 +7074,11 @@ function AssistEdgeTab({
|
|
|
7065
7074
|
...brandForeground ? { "--as-visitor-text": brandForeground } : {},
|
|
7066
7075
|
...resolvedBorderColor ? { "--as-border": resolvedBorderColor } : {},
|
|
7067
7076
|
...fontFamily ? { "--as-font-display": fontFamily } : {},
|
|
7068
|
-
...pill ? {
|
|
7077
|
+
...pill ? {
|
|
7078
|
+
"--as-surface": "#ffffff",
|
|
7079
|
+
"--as-text": "#171717",
|
|
7080
|
+
backgroundColor: "#ffffff"
|
|
7081
|
+
} : resolvedSurfaceColor ? { "--as-surface": resolvedSurfaceColor } : {},
|
|
7069
7082
|
...!pill && resolvedTextColor ? { "--as-text": resolvedTextColor } : {},
|
|
7070
7083
|
colorScheme: chromeScheme
|
|
7071
7084
|
};
|
|
@@ -7082,23 +7095,19 @@ function AssistEdgeTab({
|
|
|
7082
7095
|
onClick: onOpen,
|
|
7083
7096
|
children: [
|
|
7084
7097
|
pill ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
7085
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.
|
|
7098
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7086
7099
|
"span",
|
|
7087
7100
|
{
|
|
7088
7101
|
className: `assist-edge-tab__mark assist-edge-tab__mark--chip${mobile ? " assist-edge-tab__mark--mobile" : ""}`,
|
|
7089
7102
|
"aria-hidden": "true",
|
|
7090
|
-
children:
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
},
|
|
7099
|
-
markSourceKey
|
|
7100
|
-
)
|
|
7101
|
-
]
|
|
7103
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7104
|
+
TabMarkIcon,
|
|
7105
|
+
{
|
|
7106
|
+
customIconUrl,
|
|
7107
|
+
logoUrl
|
|
7108
|
+
},
|
|
7109
|
+
markSourceKey
|
|
7110
|
+
)
|
|
7102
7111
|
}
|
|
7103
7112
|
),
|
|
7104
7113
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "assist-edge-tab__text", children: [
|