@webless/agent 0.7.5 → 0.9.0
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/README.md +49 -2
- package/dist/chunk-5BCSXCLT.js +297 -0
- package/dist/chunk-5BCSXCLT.js.map +1 -0
- package/dist/{chunk-CD6TKXGT.js → chunk-QMTI5646.js} +69 -40
- package/dist/chunk-QMTI5646.js.map +1 -0
- package/dist/embed.cjs +62 -39
- package/dist/embed.cjs.map +1 -1
- package/dist/embed.css +98 -0
- package/dist/embed.css.map +1 -1
- package/dist/embed.js +1 -1
- package/dist/index.d.cts +3 -180
- package/dist/index.d.ts +3 -180
- package/dist/index.js +9 -288
- package/dist/index.js.map +1 -1
- package/dist/presentation.cjs +850 -0
- package/dist/presentation.cjs.map +1 -0
- package/dist/presentation.d.cts +160 -0
- package/dist/presentation.d.ts +160 -0
- package/dist/presentation.js +549 -0
- package/dist/presentation.js.map +1 -0
- package/dist/react.cjs +218 -39
- package/dist/react.cjs.map +1 -1
- package/dist/react.css +98 -0
- package/dist/react.css.map +1 -1
- package/dist/react.d.cts +26 -3
- package/dist/react.d.ts +26 -3
- package/dist/react.js +163 -2
- package/dist/react.js.map +1 -1
- package/dist/types-ohWeTG9i.d.cts +181 -0
- package/dist/types-ohWeTG9i.d.ts +181 -0
- package/package.json +7 -2
- package/dist/chunk-CD6TKXGT.js.map +0 -1
package/dist/embed.cjs
CHANGED
|
@@ -3580,6 +3580,48 @@ var defaultDarkAgentRailTheme = {
|
|
|
3580
3580
|
danger: "#ff8da1"
|
|
3581
3581
|
};
|
|
3582
3582
|
|
|
3583
|
+
// src/react/lib/agent-theme.ts
|
|
3584
|
+
function agentThemeStyle(theme, resolvedColorScheme) {
|
|
3585
|
+
const brandedTheme = { ...defaultAgentRailTheme, ...theme };
|
|
3586
|
+
const resolvedTheme = resolvedColorScheme === "dark" ? {
|
|
3587
|
+
...brandedTheme,
|
|
3588
|
+
brand: theme?.brand ?? defaultDarkAgentRailTheme.brand,
|
|
3589
|
+
brandDeep: theme?.brandDeep ?? defaultDarkAgentRailTheme.brandDeep,
|
|
3590
|
+
brandSoft: theme?.brandSoft ?? `color-mix(in srgb, ${theme?.brand ?? defaultDarkAgentRailTheme.brand} 18%, ${defaultDarkAgentRailTheme.surface})`,
|
|
3591
|
+
border: theme?.border ?? defaultDarkAgentRailTheme.border,
|
|
3592
|
+
danger: theme?.danger ?? defaultDarkAgentRailTheme.danger,
|
|
3593
|
+
onBrand: theme?.onBrand ?? defaultDarkAgentRailTheme.onBrand,
|
|
3594
|
+
success: theme?.success ?? defaultDarkAgentRailTheme.success,
|
|
3595
|
+
surface: theme?.surface ?? defaultDarkAgentRailTheme.surface,
|
|
3596
|
+
surfaceMuted: theme?.surfaceMuted ?? defaultDarkAgentRailTheme.surfaceMuted,
|
|
3597
|
+
text: theme?.text ?? defaultDarkAgentRailTheme.text,
|
|
3598
|
+
textMuted: theme?.textMuted ?? defaultDarkAgentRailTheme.textMuted,
|
|
3599
|
+
textSubtle: theme?.textSubtle ?? defaultDarkAgentRailTheme.textSubtle,
|
|
3600
|
+
visitorBubble: theme?.visitorBubble ?? theme?.brand ?? defaultDarkAgentRailTheme.visitorBubble
|
|
3601
|
+
} : brandedTheme;
|
|
3602
|
+
return {
|
|
3603
|
+
"--rail-width": resolvedTheme.railMaxWidth,
|
|
3604
|
+
"--as-rail-max-width": resolvedTheme.railMaxWidth,
|
|
3605
|
+
"--as-brand": resolvedTheme.brand,
|
|
3606
|
+
"--as-brand-soft": resolvedTheme.brandSoft,
|
|
3607
|
+
"--as-brand-deep": resolvedTheme.brandDeep,
|
|
3608
|
+
"--as-surface": resolvedTheme.surface,
|
|
3609
|
+
"--as-surface-muted": resolvedTheme.surfaceMuted,
|
|
3610
|
+
"--as-text": resolvedTheme.text,
|
|
3611
|
+
"--as-text-muted": resolvedTheme.textMuted,
|
|
3612
|
+
"--as-text-subtle": resolvedTheme.textSubtle,
|
|
3613
|
+
"--as-border": resolvedTheme.border,
|
|
3614
|
+
"--as-visitor-bubble": resolvedTheme.visitorBubble,
|
|
3615
|
+
"--as-visitor-text": resolvedTheme.visitorText,
|
|
3616
|
+
"--as-on-brand": resolvedTheme.onBrand,
|
|
3617
|
+
"--as-success": resolvedTheme.success,
|
|
3618
|
+
"--as-danger": resolvedTheme.danger,
|
|
3619
|
+
"--as-font-body": resolvedTheme.fontBody,
|
|
3620
|
+
"--as-font-display": resolvedTheme.fontDisplay,
|
|
3621
|
+
colorScheme: resolvedColorScheme
|
|
3622
|
+
};
|
|
3623
|
+
}
|
|
3624
|
+
|
|
3583
3625
|
// src/react/hooks/useAgentColorScheme.ts
|
|
3584
3626
|
var import_react4 = require("react");
|
|
3585
3627
|
var DARK_MODE_QUERY = "(prefers-color-scheme: dark)";
|
|
@@ -4327,7 +4369,23 @@ function calendarCells(year, month) {
|
|
|
4327
4369
|
function BookingCardLoader() {
|
|
4328
4370
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("section", { className: "booking-card", "aria-label": "Book a meeting", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "booking-card__loading", role: "status", children: "Finding available times\u2026" }) });
|
|
4329
4371
|
}
|
|
4330
|
-
function BookingCard({
|
|
4372
|
+
function BookingCard(props) {
|
|
4373
|
+
if (!props.readOnly) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(InteractiveBookingCard, { ...props });
|
|
4374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "booking-card", "aria-label": "Recorded available times", children: [
|
|
4375
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "booking-card__title", children: "Available times offered" }),
|
|
4376
|
+
props.offer.slots.length ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { children: props.offer.slots.map((slot, index) => {
|
|
4377
|
+
const eventType = props.offer.eventTypes.find(
|
|
4378
|
+
(item) => item.uri === slot.eventTypeUri
|
|
4379
|
+
);
|
|
4380
|
+
const label = Number.isFinite(Date.parse(slot.startTime)) ? formatSlotLabel(slot.startTime) : "Time unavailable";
|
|
4381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("li", { children: [
|
|
4382
|
+
eventType ? `${eventType.name} \xB7 ` : "",
|
|
4383
|
+
label
|
|
4384
|
+
] }, `${slot.eventTypeUri ?? ""}:${slot.startTime}:${index}`);
|
|
4385
|
+
}) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: "No available times were recorded." })
|
|
4386
|
+
] });
|
|
4387
|
+
}
|
|
4388
|
+
function InteractiveBookingCard({
|
|
4331
4389
|
disabled = false,
|
|
4332
4390
|
offer,
|
|
4333
4391
|
onBook
|
|
@@ -4693,6 +4751,7 @@ function MessageBubble({
|
|
|
4693
4751
|
message,
|
|
4694
4752
|
brandLogoUrl,
|
|
4695
4753
|
bookingDisabled = false,
|
|
4754
|
+
bookingReadOnly = false,
|
|
4696
4755
|
offer,
|
|
4697
4756
|
onBook
|
|
4698
4757
|
}) {
|
|
@@ -4759,6 +4818,7 @@ function MessageBubble({
|
|
|
4759
4818
|
BookingCard,
|
|
4760
4819
|
{
|
|
4761
4820
|
disabled: bookingDisabled,
|
|
4821
|
+
readOnly: bookingReadOnly,
|
|
4762
4822
|
offer: nextOffer,
|
|
4763
4823
|
onBook
|
|
4764
4824
|
},
|
|
@@ -6188,44 +6248,7 @@ function AgentRail({
|
|
|
6188
6248
|
const [failedLogoUrl, setFailedLogoUrl] = (0, import_react14.useState)(null);
|
|
6189
6249
|
const showBrandLogo = Boolean(resolvedBrandLogoUrl) && failedLogoUrl !== resolvedBrandLogoUrl;
|
|
6190
6250
|
const resolvedColorScheme = useAgentColorScheme(colorScheme);
|
|
6191
|
-
const
|
|
6192
|
-
const resolvedTheme = resolvedColorScheme === "dark" ? {
|
|
6193
|
-
...brandedTheme,
|
|
6194
|
-
brand: theme?.brand ?? defaultDarkAgentRailTheme.brand,
|
|
6195
|
-
brandDeep: theme?.brandDeep ?? defaultDarkAgentRailTheme.brandDeep,
|
|
6196
|
-
brandSoft: theme?.brandSoft ?? `color-mix(in srgb, ${theme?.brand ?? defaultDarkAgentRailTheme.brand} 18%, ${defaultDarkAgentRailTheme.surface})`,
|
|
6197
|
-
border: theme?.border ?? defaultDarkAgentRailTheme.border,
|
|
6198
|
-
danger: theme?.danger ?? defaultDarkAgentRailTheme.danger,
|
|
6199
|
-
onBrand: theme?.onBrand ?? defaultDarkAgentRailTheme.onBrand,
|
|
6200
|
-
success: theme?.success ?? defaultDarkAgentRailTheme.success,
|
|
6201
|
-
surface: theme?.surface ?? defaultDarkAgentRailTheme.surface,
|
|
6202
|
-
surfaceMuted: theme?.surfaceMuted ?? defaultDarkAgentRailTheme.surfaceMuted,
|
|
6203
|
-
text: theme?.text ?? defaultDarkAgentRailTheme.text,
|
|
6204
|
-
textMuted: theme?.textMuted ?? defaultDarkAgentRailTheme.textMuted,
|
|
6205
|
-
textSubtle: theme?.textSubtle ?? defaultDarkAgentRailTheme.textSubtle,
|
|
6206
|
-
visitorBubble: theme?.visitorBubble ?? theme?.brand ?? defaultDarkAgentRailTheme.visitorBubble
|
|
6207
|
-
} : brandedTheme;
|
|
6208
|
-
const railStyle = {
|
|
6209
|
-
"--rail-width": resolvedTheme.railMaxWidth,
|
|
6210
|
-
"--as-rail-max-width": resolvedTheme.railMaxWidth,
|
|
6211
|
-
"--as-brand": resolvedTheme.brand,
|
|
6212
|
-
"--as-brand-soft": resolvedTheme.brandSoft,
|
|
6213
|
-
"--as-brand-deep": resolvedTheme.brandDeep,
|
|
6214
|
-
"--as-surface": resolvedTheme.surface,
|
|
6215
|
-
"--as-surface-muted": resolvedTheme.surfaceMuted,
|
|
6216
|
-
"--as-text": resolvedTheme.text,
|
|
6217
|
-
"--as-text-muted": resolvedTheme.textMuted,
|
|
6218
|
-
"--as-text-subtle": resolvedTheme.textSubtle,
|
|
6219
|
-
"--as-border": resolvedTheme.border,
|
|
6220
|
-
"--as-visitor-bubble": resolvedTheme.visitorBubble,
|
|
6221
|
-
"--as-visitor-text": resolvedTheme.visitorText,
|
|
6222
|
-
"--as-on-brand": resolvedTheme.onBrand,
|
|
6223
|
-
"--as-success": resolvedTheme.success,
|
|
6224
|
-
"--as-danger": resolvedTheme.danger,
|
|
6225
|
-
"--as-font-body": resolvedTheme.fontBody,
|
|
6226
|
-
"--as-font-display": resolvedTheme.fontDisplay,
|
|
6227
|
-
colorScheme: resolvedColorScheme
|
|
6228
|
-
};
|
|
6251
|
+
const railStyle = agentThemeStyle(theme, resolvedColorScheme);
|
|
6229
6252
|
const pendingInputRequests = (state.pendingInputs ?? []).filter(
|
|
6230
6253
|
(request) => shouldRenderVisitorInputCard(request) && (!state.pendingOffer || request.kind === "tool-approval")
|
|
6231
6254
|
);
|