@helpai/elements 0.35.0 → 0.36.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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, H as HandshakeResponse, L as Link, S as ServerConfig, b as SiteConfig, W as WidgetConfig, c as WidgetConfigPartial, d as WidgetSettings, e as WidgetSettingsPartial } from './deployment-DRGLrW2j.js';
1
+ export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, H as HandshakeResponse, L as Link, S as ServerConfig, b as SiteConfig, W as WidgetConfig, c as WidgetConfigPartial, d as WidgetSettings, e as WidgetSettingsPartial } from './deployment-CrsbcoCF.js';
2
2
  import 'zod';
3
3
 
4
4
  /**
@@ -663,7 +663,12 @@ interface ModuleAvatar {
663
663
  }
664
664
  /** The Home status card. */
665
665
  interface ModuleStatus {
666
- text: string;
666
+ /**
667
+ * Status line. An i18n key or a literal (resolved via `localizeText`).
668
+ * Omit to use the built-in generic `homeStatus` string — so a deployment can
669
+ * show a localized status without authoring copy or a custom key per locale.
670
+ */
671
+ text?: string;
667
672
  /**
668
673
  * Status severity → status-icon colour. Free text; `operational` (default),
669
674
  * `degraded`, and `down` are styled, any other value uses the operational style.
package/index.mjs CHANGED
@@ -5185,6 +5185,7 @@ function MessageList({
5185
5185
  if (!el) return;
5186
5186
  if (messages.value.length === 0) return;
5187
5187
  hasHydratedRef.current = true;
5188
+ if (!messages.value.some((m) => m.role === "user")) return;
5188
5189
  const pinNow = () => pinBottom(el);
5189
5190
  pinNow();
5190
5191
  const resizeObs = new ResizeObserver(pinNow);
@@ -5241,6 +5242,7 @@ function MessageList({
5241
5242
  useLayoutEffect(() => {
5242
5243
  const el = ref.current;
5243
5244
  if (!el || !activeFormId || detachedRef.current) return;
5245
+ if (!messages.value.some((m) => m.role === "user")) return;
5244
5246
  pinBottom(el);
5245
5247
  }, [activeFormId]);
5246
5248
  useEffect8(() => {
@@ -6273,6 +6275,7 @@ function HomeRoot(props2) {
6273
6275
  const greeting = resolveGreeting(props2);
6274
6276
  const avatars = config.userAvatars ?? [];
6275
6277
  const status = config.status;
6278
+ const statusText = status?.text ? localizeText(strings, status.text) : strings.homeStatus;
6276
6279
  const contentTitle = config.contentBlockTitle ? localizeText(strings, config.contentBlockTitle) : strings.homeContentTitle;
6277
6280
  return /* @__PURE__ */ jsx29("div", { class: `${p25}-module ${p25}-home`, "data-testid": TID.homeView, children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-scroll`, children: [
6278
6281
  /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-hero`, children: [
@@ -6307,10 +6310,10 @@ function HomeRoot(props2) {
6307
6310
  status ? /* @__PURE__ */ jsx29(
6308
6311
  HomeCard,
6309
6312
  {
6310
- onClick: status.url ? () => nav.push({ kind: "iframe", url: status.url, title: localizeText(strings, status.text) }) : void 0,
6313
+ onClick: status.url ? () => nav.push({ kind: "iframe", url: status.url, title: statusText }) : void 0,
6311
6314
  children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-status`, "data-level": status.level ?? "operational", children: [
6312
6315
  /* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx29(StatusOkIcon, {}) }),
6313
- /* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-text`, children: localizeText(strings, status.text) })
6316
+ /* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-text`, children: statusText })
6314
6317
  ] })
6315
6318
  }
6316
6319
  ) : null,
package/package.json CHANGED
@@ -80,5 +80,5 @@
80
80
  ],
81
81
  "type": "module",
82
82
  "types": "./index.d.ts",
83
- "version": "0.35.0"
83
+ "version": "0.36.1"
84
84
  }
package/schema.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, E as Endpoints, H as HandshakeResponse, L as Link, P as PAGE_AREA_SUGGESTIONS, f as PageContext, S as ServerConfig, b as SiteConfig, U as UserContext, W as WidgetConfig, c as WidgetConfigPartial, d as WidgetSettings, e as WidgetSettingsPartial, g as assetSchema, h as blocksConfigSchema, i as connectionConfigPartialSchema, j as connectionConfigSchema, k as cssColorSchema, l as cssLengthSchema, m as endpointsSchema, n as handshakeResponseSchema, o as linkSchema, p as localeSchema, q as pageContextSchema, s as serverConfigSchema, r as siteConfigSchema, u as userContextSchema, t as uuid7Schema, w as widgetConfigPartialSchema, v as widgetConfigSchema, x as widgetSettingsPartialSchema, y as widgetSettingsSchema } from './deployment-DRGLrW2j.js';
1
+ export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, E as Endpoints, H as HandshakeResponse, L as Link, P as PAGE_AREA_SUGGESTIONS, f as PageContext, S as ServerConfig, b as SiteConfig, U as UserContext, W as WidgetConfig, c as WidgetConfigPartial, d as WidgetSettings, e as WidgetSettingsPartial, g as assetSchema, h as blocksConfigSchema, i as connectionConfigPartialSchema, j as connectionConfigSchema, k as cssColorSchema, l as cssLengthSchema, m as endpointsSchema, n as handshakeResponseSchema, o as linkSchema, p as localeSchema, q as pageContextSchema, s as serverConfigSchema, r as siteConfigSchema, u as userContextSchema, t as uuid7Schema, w as widgetConfigPartialSchema, v as widgetConfigSchema, x as widgetSettingsPartialSchema, y as widgetSettingsSchema } from './deployment-CrsbcoCF.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  /**
@@ -886,7 +886,7 @@ declare const moduleSchema: z.ZodObject<{
886
886
  showSearchBar: z.ZodOptional<z.ZodBoolean>;
887
887
  showRecentConversations: z.ZodOptional<z.ZodBoolean>;
888
888
  status: z.ZodOptional<z.ZodObject<{
889
- text: z.ZodString;
889
+ text: z.ZodOptional<z.ZodString>;
890
890
  level: z.ZodOptional<z.ZodString>;
891
891
  url: z.ZodOptional<z.ZodString>;
892
892
  }, z.core.$strip>>;
@@ -914,7 +914,7 @@ declare const modulesSchema: z.ZodArray<z.ZodObject<{
914
914
  showSearchBar: z.ZodOptional<z.ZodBoolean>;
915
915
  showRecentConversations: z.ZodOptional<z.ZodBoolean>;
916
916
  status: z.ZodOptional<z.ZodObject<{
917
- text: z.ZodString;
917
+ text: z.ZodOptional<z.ZodString>;
918
918
  level: z.ZodOptional<z.ZodString>;
919
919
  url: z.ZodOptional<z.ZodString>;
920
920
  }, z.core.$strip>>;
package/schema.json CHANGED
@@ -1882,6 +1882,7 @@
1882
1882
  "type": "object",
1883
1883
  "properties": {
1884
1884
  "text": {
1885
+ "description": "`home` — status line; an i18n key or a literal (resolved via `localizeText`). Omit to use the built-in generic `homeStatus` string (localized, no custom key needed).",
1885
1886
  "type": "string",
1886
1887
  "minLength": 1,
1887
1888
  "maxLength": 120
@@ -1902,9 +1903,6 @@
1902
1903
  "maxLength": 2048
1903
1904
  }
1904
1905
  },
1905
- "required": [
1906
- "text"
1907
- ],
1908
1906
  "additionalProperties": false
1909
1907
  },
1910
1908
  "contentBlockTitle": {
@@ -3287,6 +3285,7 @@
3287
3285
  "type": "object",
3288
3286
  "properties": {
3289
3287
  "text": {
3288
+ "description": "`home` — status line; an i18n key or a literal (resolved via `localizeText`). Omit to use the built-in generic `homeStatus` string (localized, no custom key needed).",
3290
3289
  "type": "string",
3291
3290
  "minLength": 1,
3292
3291
  "maxLength": 120
@@ -3307,9 +3306,6 @@
3307
3306
  "maxLength": 2048
3308
3307
  }
3309
3308
  },
3310
- "required": [
3311
- "text"
3312
- ],
3313
3309
  "additionalProperties": false
3314
3310
  },
3315
3311
  "contentBlockTitle": {
package/schema.mjs CHANGED
@@ -559,7 +559,9 @@ var moduleSchema = z14.object({
559
559
  showSearchBar: z14.boolean().optional().describe("`home` \u2014 show the 'Search for help' bar (default true)."),
560
560
  showRecentConversations: z14.boolean().optional().describe("`home` \u2014 show the visitor's most recent conversation card (default true)."),
561
561
  status: z14.object({
562
- text: z14.string().min(1).max(120),
562
+ text: z14.string().min(1).max(120).optional().describe(
563
+ "`home` \u2014 status line; an i18n key or a literal (resolved via `localizeText`). Omit to use the built-in generic `homeStatus` string (localized, no custom key needed)."
564
+ ),
563
565
  level: z14.string().max(40).optional().describe(
564
566
  "`home` \u2014 status severity, drives the status icon colour. Free text; `operational` (green, default), `degraded` (amber), and `down` (red) are styled, any other value falls back to the operational style."
565
567
  ).meta({ examples: ["operational", "degraded", "down"] }),
package/web-component.mjs CHANGED
@@ -5144,6 +5144,7 @@ function MessageList({
5144
5144
  if (!el) return;
5145
5145
  if (messages.value.length === 0) return;
5146
5146
  hasHydratedRef.current = true;
5147
+ if (!messages.value.some((m) => m.role === "user")) return;
5147
5148
  const pinNow = () => pinBottom(el);
5148
5149
  pinNow();
5149
5150
  const resizeObs = new ResizeObserver(pinNow);
@@ -5200,6 +5201,7 @@ function MessageList({
5200
5201
  useLayoutEffect(() => {
5201
5202
  const el = ref.current;
5202
5203
  if (!el || !activeFormId || detachedRef.current) return;
5204
+ if (!messages.value.some((m) => m.role === "user")) return;
5203
5205
  pinBottom(el);
5204
5206
  }, [activeFormId]);
5205
5207
  useEffect8(() => {
@@ -6232,6 +6234,7 @@ function HomeRoot(props2) {
6232
6234
  const greeting = resolveGreeting(props2);
6233
6235
  const avatars = config.userAvatars ?? [];
6234
6236
  const status = config.status;
6237
+ const statusText = status?.text ? localizeText(strings, status.text) : strings.homeStatus;
6235
6238
  const contentTitle = config.contentBlockTitle ? localizeText(strings, config.contentBlockTitle) : strings.homeContentTitle;
6236
6239
  return /* @__PURE__ */ jsx29("div", { class: `${p25}-module ${p25}-home`, "data-testid": TID.homeView, children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-scroll`, children: [
6237
6240
  /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-hero`, children: [
@@ -6266,10 +6269,10 @@ function HomeRoot(props2) {
6266
6269
  status ? /* @__PURE__ */ jsx29(
6267
6270
  HomeCard,
6268
6271
  {
6269
- onClick: status.url ? () => nav.push({ kind: "iframe", url: status.url, title: localizeText(strings, status.text) }) : void 0,
6272
+ onClick: status.url ? () => nav.push({ kind: "iframe", url: status.url, title: statusText }) : void 0,
6270
6273
  children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-status`, "data-level": status.level ?? "operational", children: [
6271
6274
  /* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx29(StatusOkIcon, {}) }),
6272
- /* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-text`, children: localizeText(strings, status.text) })
6275
+ /* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-text`, children: statusText })
6273
6276
  ] })
6274
6277
  }
6275
6278
  ) : null,