@helpai/elements 0.33.0 → 0.34.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/index.mjs CHANGED
@@ -3455,13 +3455,15 @@ function initials(name) {
3455
3455
  // src/ui/agent-badge.tsx
3456
3456
  import { jsx as jsx4, jsxs as jsxs3 } from "preact/jsx-runtime";
3457
3457
  var p5 = BRAND.cssPrefix;
3458
- function AgentBadge({ agent }) {
3458
+ function AgentBadge({ agent, strings }) {
3459
3459
  const status = agent.status ?? "online";
3460
+ const name = localizeText(strings, agent.name);
3461
+ const title = agent.title ? localizeText(strings, agent.title) : null;
3460
3462
  return /* @__PURE__ */ jsxs3("div", { class: `${p5}-agent`, children: [
3461
- /* @__PURE__ */ jsx4("div", { class: `${p5}-agent-avatar`, "data-status": status, children: agent.avatar ? /* @__PURE__ */ jsx4("img", { src: agent.avatar, alt: "" }) : /* @__PURE__ */ jsx4("span", { children: initials(agent.name) }) }),
3463
+ /* @__PURE__ */ jsx4("div", { class: `${p5}-agent-avatar`, "data-status": status, children: agent.avatar ? /* @__PURE__ */ jsx4("img", { src: agent.avatar, alt: "" }) : /* @__PURE__ */ jsx4("span", { children: initials(name) }) }),
3462
3464
  /* @__PURE__ */ jsxs3("div", { class: `${p5}-agent-meta`, children: [
3463
- /* @__PURE__ */ jsx4("strong", { children: agent.name }),
3464
- agent.title ? /* @__PURE__ */ jsx4("span", { children: agent.title }) : null
3465
+ /* @__PURE__ */ jsx4("strong", { children: name }),
3466
+ title ? /* @__PURE__ */ jsx4("span", { children: title }) : null
3465
3467
  ] })
3466
3468
  ] });
3467
3469
  }
@@ -5698,7 +5700,7 @@ function PanelContent(props2) {
5698
5700
  children: /* @__PURE__ */ jsx20(BackIcon, {})
5699
5701
  }
5700
5702
  ) : null,
5701
- agent ? /* @__PURE__ */ jsx20(AgentBadge, { agent }) : /* @__PURE__ */ jsx20("h1", { children: s.panelTitle }),
5703
+ agent ? /* @__PURE__ */ jsx20(AgentBadge, { agent, strings: s }) : /* @__PURE__ */ jsx20("h1", { children: s.panelTitle }),
5702
5704
  /* @__PURE__ */ jsx20(HeaderActions, { panelProps: props2, variant: "chat" })
5703
5705
  ] }),
5704
5706
  view === "history" ? /* @__PURE__ */ jsx20(
@@ -6237,7 +6239,7 @@ var p25 = BRAND.cssPrefix;
6237
6239
  var log14 = logger.scope("home");
6238
6240
  function resolveGreeting(props2) {
6239
6241
  const name = props2.options.userContext?.name;
6240
- const fromConfig = props2.config.greetingText;
6242
+ const fromConfig = props2.config.greetingText ? localizeText(props2.strings, props2.config.greetingText) : void 0;
6241
6243
  if (fromConfig) {
6242
6244
  const title = name ? fromConfig.replace("{name}", name) : fromConfig.replace(/\s*\{name\}\s*/, " ").trim();
6243
6245
  return { title, subtitle: props2.strings.homeGreetingLead };
@@ -6303,10 +6305,10 @@ function HomeRoot(props2) {
6303
6305
  status ? /* @__PURE__ */ jsx29(
6304
6306
  HomeCard,
6305
6307
  {
6306
- onClick: status.url ? () => nav.push({ kind: "iframe", url: status.url, title: status.text }) : void 0,
6308
+ onClick: status.url ? () => nav.push({ kind: "iframe", url: status.url, title: localizeText(strings, status.text) }) : void 0,
6307
6309
  children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-status`, "data-level": status.level ?? "operational", children: [
6308
6310
  /* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx29(StatusOkIcon, {}) }),
6309
- /* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-text`, children: status.text })
6311
+ /* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-text`, children: localizeText(strings, status.text) })
6310
6312
  ] })
6311
6313
  }
6312
6314
  ) : null,
package/package.json CHANGED
@@ -80,5 +80,5 @@
80
80
  ],
81
81
  "type": "module",
82
82
  "types": "./index.d.ts",
83
- "version": "0.33.0"
83
+ "version": "0.34.0"
84
84
  }
package/web-component.mjs CHANGED
@@ -3414,13 +3414,15 @@ function initials(name) {
3414
3414
  // src/ui/agent-badge.tsx
3415
3415
  import { jsx as jsx4, jsxs as jsxs3 } from "preact/jsx-runtime";
3416
3416
  var p5 = BRAND.cssPrefix;
3417
- function AgentBadge({ agent }) {
3417
+ function AgentBadge({ agent, strings }) {
3418
3418
  const status = agent.status ?? "online";
3419
+ const name = localizeText(strings, agent.name);
3420
+ const title = agent.title ? localizeText(strings, agent.title) : null;
3419
3421
  return /* @__PURE__ */ jsxs3("div", { class: `${p5}-agent`, children: [
3420
- /* @__PURE__ */ jsx4("div", { class: `${p5}-agent-avatar`, "data-status": status, children: agent.avatar ? /* @__PURE__ */ jsx4("img", { src: agent.avatar, alt: "" }) : /* @__PURE__ */ jsx4("span", { children: initials(agent.name) }) }),
3422
+ /* @__PURE__ */ jsx4("div", { class: `${p5}-agent-avatar`, "data-status": status, children: agent.avatar ? /* @__PURE__ */ jsx4("img", { src: agent.avatar, alt: "" }) : /* @__PURE__ */ jsx4("span", { children: initials(name) }) }),
3421
3423
  /* @__PURE__ */ jsxs3("div", { class: `${p5}-agent-meta`, children: [
3422
- /* @__PURE__ */ jsx4("strong", { children: agent.name }),
3423
- agent.title ? /* @__PURE__ */ jsx4("span", { children: agent.title }) : null
3424
+ /* @__PURE__ */ jsx4("strong", { children: name }),
3425
+ title ? /* @__PURE__ */ jsx4("span", { children: title }) : null
3424
3426
  ] })
3425
3427
  ] });
3426
3428
  }
@@ -5657,7 +5659,7 @@ function PanelContent(props2) {
5657
5659
  children: /* @__PURE__ */ jsx20(BackIcon, {})
5658
5660
  }
5659
5661
  ) : null,
5660
- agent ? /* @__PURE__ */ jsx20(AgentBadge, { agent }) : /* @__PURE__ */ jsx20("h1", { children: s.panelTitle }),
5662
+ agent ? /* @__PURE__ */ jsx20(AgentBadge, { agent, strings: s }) : /* @__PURE__ */ jsx20("h1", { children: s.panelTitle }),
5661
5663
  /* @__PURE__ */ jsx20(HeaderActions, { panelProps: props2, variant: "chat" })
5662
5664
  ] }),
5663
5665
  view === "history" ? /* @__PURE__ */ jsx20(
@@ -6196,7 +6198,7 @@ var p25 = BRAND.cssPrefix;
6196
6198
  var log13 = logger.scope("home");
6197
6199
  function resolveGreeting(props2) {
6198
6200
  const name = props2.options.userContext?.name;
6199
- const fromConfig = props2.config.greetingText;
6201
+ const fromConfig = props2.config.greetingText ? localizeText(props2.strings, props2.config.greetingText) : void 0;
6200
6202
  if (fromConfig) {
6201
6203
  const title = name ? fromConfig.replace("{name}", name) : fromConfig.replace(/\s*\{name\}\s*/, " ").trim();
6202
6204
  return { title, subtitle: props2.strings.homeGreetingLead };
@@ -6262,10 +6264,10 @@ function HomeRoot(props2) {
6262
6264
  status ? /* @__PURE__ */ jsx29(
6263
6265
  HomeCard,
6264
6266
  {
6265
- onClick: status.url ? () => nav.push({ kind: "iframe", url: status.url, title: status.text }) : void 0,
6267
+ onClick: status.url ? () => nav.push({ kind: "iframe", url: status.url, title: localizeText(strings, status.text) }) : void 0,
6266
6268
  children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-status`, "data-level": status.level ?? "operational", children: [
6267
6269
  /* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx29(StatusOkIcon, {}) }),
6268
- /* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-text`, children: status.text })
6270
+ /* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-text`, children: localizeText(strings, status.text) })
6269
6271
  ] })
6270
6272
  }
6271
6273
  ) : null,