@webless/agent 0.10.0 → 0.10.1
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-6OCODDRO.js → chunk-ZYTNNMZS.js} +65 -61
- package/dist/{chunk-6OCODDRO.js.map → chunk-ZYTNNMZS.js.map} +1 -1
- package/dist/embed.cjs +65 -61
- package/dist/embed.cjs.map +1 -1
- package/dist/embed.css +27 -8
- package/dist/embed.css.map +1 -1
- package/dist/embed.js +1 -1
- package/dist/react.cjs +67 -63
- package/dist/react.cjs.map +1 -1
- package/dist/react.css +27 -8
- package/dist/react.css.map +1 -1
- package/dist/react.js +1 -1
- package/package.json +1 -1
|
@@ -4298,8 +4298,7 @@ function workSummary(steps, failed, brandLabel) {
|
|
|
4298
4298
|
)}`;
|
|
4299
4299
|
const active = [...steps].reverse().find((step) => step.state === "active");
|
|
4300
4300
|
if (active?.kind === "search") return "Searching this site";
|
|
4301
|
-
if (active)
|
|
4302
|
-
return brandLabel ? `${brandLabel} is choosing the best way to help` : "Choosing the best way to help";
|
|
4301
|
+
if (active) return "Reviewing your details to find the best approach";
|
|
4303
4302
|
if (failed) return "Couldn\u2019t complete this request";
|
|
4304
4303
|
const hasError = steps.some((step) => step.state === "error");
|
|
4305
4304
|
const specialists = steps.filter(
|
|
@@ -4408,7 +4407,7 @@ function AgentActivityBubble({
|
|
|
4408
4407
|
}
|
|
4409
4408
|
),
|
|
4410
4409
|
workSummary(steps, failed, brandLabel),
|
|
4411
|
-
active ? "
|
|
4410
|
+
active ? "..." : ""
|
|
4412
4411
|
] }),
|
|
4413
4412
|
!active ? /* @__PURE__ */ jsxs2("div", { className: "agent-activity-bubble__details", children: [
|
|
4414
4413
|
/* @__PURE__ */ jsx2(
|
|
@@ -6771,6 +6770,7 @@ function AgentRail({
|
|
|
6771
6770
|
}
|
|
6772
6771
|
|
|
6773
6772
|
// src/react/components/AssistEdgeTab/AssistEdgeTab.tsx
|
|
6773
|
+
import { useState as useState10 } from "react";
|
|
6774
6774
|
import { Fragment as Fragment5, jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
6775
6775
|
function ChatSparkIcon() {
|
|
6776
6776
|
return /* @__PURE__ */ jsxs17(
|
|
@@ -6845,16 +6845,35 @@ function ChatSparkIcon() {
|
|
|
6845
6845
|
}
|
|
6846
6846
|
);
|
|
6847
6847
|
}
|
|
6848
|
-
function TabMarkIcon({
|
|
6849
|
-
|
|
6850
|
-
|
|
6848
|
+
function TabMarkIcon({
|
|
6849
|
+
customIconUrl,
|
|
6850
|
+
logoUrl
|
|
6851
|
+
}) {
|
|
6852
|
+
const custom = customIconUrl?.trim();
|
|
6853
|
+
const logo = logoUrl?.trim();
|
|
6854
|
+
const [customFailed, setCustomFailed] = useState10(false);
|
|
6855
|
+
const [logoFailed, setLogoFailed] = useState10(false);
|
|
6856
|
+
if (custom && !customFailed) {
|
|
6851
6857
|
return /* @__PURE__ */ jsx18(
|
|
6852
6858
|
"img",
|
|
6853
6859
|
{
|
|
6854
6860
|
alt: "",
|
|
6855
6861
|
"aria-hidden": true,
|
|
6856
6862
|
className: "assist-edge-tab__custom-icon",
|
|
6857
|
-
src:
|
|
6863
|
+
src: custom,
|
|
6864
|
+
onError: () => setCustomFailed(true)
|
|
6865
|
+
}
|
|
6866
|
+
);
|
|
6867
|
+
}
|
|
6868
|
+
if (logo && !logoFailed) {
|
|
6869
|
+
return /* @__PURE__ */ jsx18(
|
|
6870
|
+
"img",
|
|
6871
|
+
{
|
|
6872
|
+
alt: "",
|
|
6873
|
+
"aria-hidden": true,
|
|
6874
|
+
className: "assist-edge-tab__logo",
|
|
6875
|
+
src: logo,
|
|
6876
|
+
onError: () => setLogoFailed(true)
|
|
6858
6877
|
}
|
|
6859
6878
|
);
|
|
6860
6879
|
}
|
|
@@ -6917,13 +6936,14 @@ function AssistEdgeTab({
|
|
|
6917
6936
|
const visibleLabel = label?.trim() || copy.label;
|
|
6918
6937
|
const visibleSubLabel = subLabel?.trim() || "";
|
|
6919
6938
|
const pill = mobile || side === "bottom";
|
|
6939
|
+
const chromeScheme = pill ? "light" : resolvedColorScheme;
|
|
6920
6940
|
const ariaLabel = visibleSubLabel ? `Open ${visibleLabel} \u2014 ${visibleSubLabel}` : `Open ${visibleLabel}`;
|
|
6921
6941
|
const alignment = along < 50 ? "start" : along > 50 ? "end" : "center";
|
|
6922
|
-
const
|
|
6923
|
-
const
|
|
6924
|
-
const
|
|
6925
|
-
const
|
|
6926
|
-
const
|
|
6942
|
+
const resolvedBrandColor = brandColor ?? (chromeScheme === "dark" ? defaultDarkAgentRailTheme.brand : void 0);
|
|
6943
|
+
const resolvedBorderColor = chromeScheme === "dark" ? defaultDarkAgentRailTheme.border : borderColor;
|
|
6944
|
+
const resolvedSurfaceColor = chromeScheme === "dark" ? defaultDarkAgentRailTheme.surface : surfaceColor;
|
|
6945
|
+
const resolvedTextColor = chromeScheme === "dark" ? defaultDarkAgentRailTheme.text : textColor;
|
|
6946
|
+
const markSourceKey = `${customIconUrl?.trim() ?? ""}|${logoUrl?.trim() ?? ""}`;
|
|
6927
6947
|
const style = {
|
|
6928
6948
|
"--tab-along": `${along}%`,
|
|
6929
6949
|
"--tab-inset": `${inset}px`,
|
|
@@ -6931,16 +6951,16 @@ function AssistEdgeTab({
|
|
|
6931
6951
|
...brandForeground ? { "--as-visitor-text": brandForeground } : {},
|
|
6932
6952
|
...resolvedBorderColor ? { "--as-border": resolvedBorderColor } : {},
|
|
6933
6953
|
...fontFamily ? { "--as-font-display": fontFamily } : {},
|
|
6934
|
-
...resolvedSurfaceColor ? { "--as-surface": resolvedSurfaceColor } : {},
|
|
6935
|
-
|
|
6936
|
-
colorScheme:
|
|
6954
|
+
...pill ? { "--as-surface": "#ffffff", "--as-text": "#171717" } : resolvedSurfaceColor ? { "--as-surface": resolvedSurfaceColor } : {},
|
|
6955
|
+
...!pill && resolvedTextColor ? { "--as-text": resolvedTextColor } : {},
|
|
6956
|
+
colorScheme: chromeScheme
|
|
6937
6957
|
};
|
|
6938
6958
|
return /* @__PURE__ */ jsxs17(
|
|
6939
6959
|
"button",
|
|
6940
6960
|
{
|
|
6941
6961
|
type: "button",
|
|
6942
6962
|
className: `assist-edge-tab assist-edge-tab--${variant} assist-edge-tab--${side} assist-edge-tab--align-${alignment}${mobile ? " assist-edge-tab--mobile" : ""}${visible ? " is-visible" : ""}`,
|
|
6943
|
-
"data-color-scheme":
|
|
6963
|
+
"data-color-scheme": chromeScheme,
|
|
6944
6964
|
style,
|
|
6945
6965
|
"aria-label": ariaLabel,
|
|
6946
6966
|
"aria-hidden": !visible,
|
|
@@ -6956,18 +6976,14 @@ function AssistEdgeTab({
|
|
|
6956
6976
|
children: [
|
|
6957
6977
|
/* @__PURE__ */ jsx18("span", { className: "assist-edge-tab__wash assist-edge-tab__wash--light" }),
|
|
6958
6978
|
/* @__PURE__ */ jsx18("span", { className: "assist-edge-tab__wash assist-edge-tab__wash--cool" }),
|
|
6959
|
-
/* @__PURE__ */ jsx18(
|
|
6960
|
-
|
|
6961
|
-
"img",
|
|
6979
|
+
/* @__PURE__ */ jsx18(
|
|
6980
|
+
TabMarkIcon,
|
|
6962
6981
|
{
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
}
|
|
6969
|
-
}
|
|
6970
|
-
) : null
|
|
6982
|
+
customIconUrl,
|
|
6983
|
+
logoUrl
|
|
6984
|
+
},
|
|
6985
|
+
markSourceKey
|
|
6986
|
+
)
|
|
6971
6987
|
]
|
|
6972
6988
|
}
|
|
6973
6989
|
),
|
|
@@ -6976,20 +6992,14 @@ function AssistEdgeTab({
|
|
|
6976
6992
|
visibleSubLabel ? /* @__PURE__ */ jsx18("span", { className: "assist-edge-tab__sublabel", children: visibleSubLabel }) : null
|
|
6977
6993
|
] })
|
|
6978
6994
|
] }) : variant === "outline" ? /* @__PURE__ */ jsxs17(Fragment5, { children: [
|
|
6979
|
-
/* @__PURE__ */
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
onError: (event) => {
|
|
6988
|
-
event.currentTarget.hidden = true;
|
|
6989
|
-
}
|
|
6990
|
-
}
|
|
6991
|
-
) : null
|
|
6992
|
-
] }),
|
|
6995
|
+
/* @__PURE__ */ jsx18("span", { className: "assist-edge-tab__mark", "aria-hidden": "true", children: /* @__PURE__ */ jsx18(
|
|
6996
|
+
TabMarkIcon,
|
|
6997
|
+
{
|
|
6998
|
+
customIconUrl,
|
|
6999
|
+
logoUrl
|
|
7000
|
+
},
|
|
7001
|
+
markSourceKey
|
|
7002
|
+
) }),
|
|
6993
7003
|
/* @__PURE__ */ jsx18("span", { className: "assist-edge-tab__label", children: visibleLabel }),
|
|
6994
7004
|
/* @__PURE__ */ jsx18(ChevronDownIcon2, {})
|
|
6995
7005
|
] }) : null,
|
|
@@ -6999,20 +7009,14 @@ function AssistEdgeTab({
|
|
|
6999
7009
|
/* @__PURE__ */ jsx18(DragDots, {})
|
|
7000
7010
|
] }) : null,
|
|
7001
7011
|
!pill && variant === "fill" ? /* @__PURE__ */ jsxs17(Fragment5, { children: [
|
|
7002
|
-
/* @__PURE__ */
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
onError: (event) => {
|
|
7011
|
-
event.currentTarget.hidden = true;
|
|
7012
|
-
}
|
|
7013
|
-
}
|
|
7014
|
-
) : null
|
|
7015
|
-
] }),
|
|
7012
|
+
/* @__PURE__ */ jsx18("span", { className: "assist-edge-tab__mark", "aria-hidden": "true", children: /* @__PURE__ */ jsx18(
|
|
7013
|
+
TabMarkIcon,
|
|
7014
|
+
{
|
|
7015
|
+
customIconUrl,
|
|
7016
|
+
logoUrl
|
|
7017
|
+
},
|
|
7018
|
+
markSourceKey
|
|
7019
|
+
) }),
|
|
7016
7020
|
/* @__PURE__ */ jsx18("span", { className: "assist-edge-tab__label", children: visibleLabel }),
|
|
7017
7021
|
/* @__PURE__ */ jsx18(ChevronLeftIcon, {})
|
|
7018
7022
|
] }) : null
|
|
@@ -7078,7 +7082,7 @@ function sendAgentAnswerFeedback(eventUrl, event) {
|
|
|
7078
7082
|
}
|
|
7079
7083
|
|
|
7080
7084
|
// src/react/components/AgentWidget/AgentWidget.tsx
|
|
7081
|
-
import { useEffect as useEffect9, useRef as useRef7, useState as
|
|
7085
|
+
import { useEffect as useEffect9, useRef as useRef7, useState as useState12 } from "react";
|
|
7082
7086
|
|
|
7083
7087
|
// src/react/page-shift.ts
|
|
7084
7088
|
import { useEffect as useEffect7 } from "react";
|
|
@@ -7161,9 +7165,9 @@ function usePageShift(input) {
|
|
|
7161
7165
|
}
|
|
7162
7166
|
|
|
7163
7167
|
// src/react/hooks/useIsMobile.ts
|
|
7164
|
-
import { useEffect as useEffect8, useState as
|
|
7168
|
+
import { useEffect as useEffect8, useState as useState11 } from "react";
|
|
7165
7169
|
function useIsMobile(breakpoint = 767) {
|
|
7166
|
-
const [isMobile, setIsMobile] =
|
|
7170
|
+
const [isMobile, setIsMobile] = useState11(
|
|
7167
7171
|
() => typeof window !== "undefined" && window.matchMedia(`(max-width: ${breakpoint}px)`).matches
|
|
7168
7172
|
);
|
|
7169
7173
|
useEffect8(() => {
|
|
@@ -7197,8 +7201,8 @@ function AgentWidget({
|
|
|
7197
7201
|
const isMobile = useIsMobile();
|
|
7198
7202
|
const placement = normalizeAgentPlacement(placementInput);
|
|
7199
7203
|
const railSlotRef = useRef7(null);
|
|
7200
|
-
const [railCollapsed, setRailCollapsed] =
|
|
7201
|
-
const [railExpanded, setRailExpanded] =
|
|
7204
|
+
const [railCollapsed, setRailCollapsed] = useState12(defaultCollapsed);
|
|
7205
|
+
const [railExpanded, setRailExpanded] = useState12(false);
|
|
7202
7206
|
const pageShiftActive = shouldApplyPageShift({
|
|
7203
7207
|
pageShift,
|
|
7204
7208
|
isMobile,
|
|
@@ -7430,4 +7434,4 @@ export {
|
|
|
7430
7434
|
sendAgentAnswerFeedback,
|
|
7431
7435
|
AgentWidget
|
|
7432
7436
|
};
|
|
7433
|
-
//# sourceMappingURL=chunk-
|
|
7437
|
+
//# sourceMappingURL=chunk-ZYTNNMZS.js.map
|