@helpai/elements 0.36.0 → 0.36.2

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-CNCSLVdz.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
  /**
package/index.mjs CHANGED
@@ -4163,7 +4163,7 @@ function themeIcon(mode) {
4163
4163
  return /* @__PURE__ */ jsx9(ThemeAutoIcon, {});
4164
4164
  }
4165
4165
  function localeCode(locale) {
4166
- return (locale.split("-")[0] || locale).toUpperCase();
4166
+ return (locale.split("-")[0] ?? locale).toUpperCase();
4167
4167
  }
4168
4168
  function HeaderActions({ panelProps, variant }) {
4169
4169
  const { options, panelSize, feedback, onClose, onClear, onExpand, onFullscreen, onPopOut, onSoundToggle } = panelProps;
@@ -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(() => {
package/package.json CHANGED
@@ -80,5 +80,5 @@
80
80
  ],
81
81
  "type": "module",
82
82
  "types": "./index.d.ts",
83
- "version": "0.36.0"
83
+ "version": "0.36.2"
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-CNCSLVdz.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
  /**
@@ -56,9 +56,9 @@ declare const presentationSchema: z.ZodObject<{
56
56
  inset: z.ZodOptional<z.ZodString>;
57
57
  initialSize: z.ZodDefault<z.ZodEnum<{
58
58
  fullscreen: "fullscreen";
59
- normal: "normal";
60
59
  expanded: "expanded";
61
60
  auto: "auto";
61
+ normal: "normal";
62
62
  }>>;
63
63
  autoSizeBreakpoint: z.ZodDefault<z.ZodNumber>;
64
64
  }, z.core.$loose>>;
@@ -240,9 +240,9 @@ type LauncherOptions = z.infer<typeof launcherOptionsSchema>;
240
240
 
241
241
  declare const initialSizeSchema: z.ZodEnum<{
242
242
  fullscreen: "fullscreen";
243
- normal: "normal";
244
243
  expanded: "expanded";
245
244
  auto: "auto";
245
+ normal: "normal";
246
246
  }>;
247
247
  declare const resizeOptionsSchema: z.ZodObject<{
248
248
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -269,9 +269,9 @@ declare const sizeOptionsSchema: z.ZodObject<{
269
269
  inset: z.ZodOptional<z.ZodString>;
270
270
  initialSize: z.ZodDefault<z.ZodEnum<{
271
271
  fullscreen: "fullscreen";
272
- normal: "normal";
273
272
  expanded: "expanded";
274
273
  auto: "auto";
274
+ normal: "normal";
275
275
  }>>;
276
276
  autoSizeBreakpoint: z.ZodDefault<z.ZodNumber>;
277
277
  }, z.core.$loose>;
@@ -323,43 +323,43 @@ type FeatureFlags = z.infer<typeof featureFlagsSchema>;
323
323
  */
324
324
 
325
325
  declare const actionNameSchema: z.ZodEnum<{
326
+ close: "close";
326
327
  expand: "expand";
327
328
  fullscreen: "fullscreen";
328
329
  popOut: "popOut";
329
- close: "close";
330
- language: "language";
330
+ clear: "clear";
331
331
  theme: "theme";
332
+ language: "language";
332
333
  textSize: "textSize";
333
334
  history: "history";
334
- clear: "clear";
335
335
  sound: "sound";
336
336
  }>;
337
337
  type ActionName = z.infer<typeof actionNameSchema>;
338
338
  declare const headerActionsSchema: z.ZodArray<z.ZodEnum<{
339
+ close: "close";
339
340
  expand: "expand";
340
341
  fullscreen: "fullscreen";
341
342
  popOut: "popOut";
342
- close: "close";
343
- language: "language";
343
+ clear: "clear";
344
344
  theme: "theme";
345
+ language: "language";
345
346
  textSize: "textSize";
346
347
  history: "history";
347
- clear: "clear";
348
348
  sound: "sound";
349
349
  }>>;
350
350
  type HeaderActions = z.infer<typeof headerActionsSchema>;
351
351
  /** Section wrapper — `actions` list wrapped under `header` in the dashboard form. */
352
352
  declare const headerSchema: z.ZodObject<{
353
353
  actions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
354
+ close: "close";
354
355
  expand: "expand";
355
356
  fullscreen: "fullscreen";
356
357
  popOut: "popOut";
357
- close: "close";
358
- language: "language";
358
+ clear: "clear";
359
359
  theme: "theme";
360
+ language: "language";
360
361
  textSize: "textSize";
361
362
  history: "history";
362
- clear: "clear";
363
363
  sound: "sound";
364
364
  }>>>;
365
365
  }, z.core.$loose>;
@@ -375,33 +375,33 @@ type HeaderOptions = z.infer<typeof headerSchema>;
375
375
  */
376
376
 
377
377
  declare const feedbackEventSchema: z.ZodEnum<{
378
+ voiceStart: "voiceStart";
379
+ voiceStop: "voiceStop";
378
380
  error: "error";
379
381
  messageReceived: "messageReceived";
380
382
  messageSent: "messageSent";
381
- voiceStart: "voiceStart";
382
- voiceStop: "voiceStop";
383
383
  }>;
384
384
  type FeedbackEvent = z.infer<typeof feedbackEventSchema>;
385
385
  declare const soundOptionsSchema: z.ZodObject<{
386
386
  enabled: z.ZodDefault<z.ZodBoolean>;
387
387
  volume: z.ZodDefault<z.ZodNumber>;
388
388
  events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
389
+ voiceStart: "voiceStart";
390
+ voiceStop: "voiceStop";
389
391
  error: "error";
390
392
  messageReceived: "messageReceived";
391
393
  messageSent: "messageSent";
392
- voiceStart: "voiceStart";
393
- voiceStop: "voiceStop";
394
394
  }> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
395
395
  }, z.core.$loose>;
396
396
  type SoundOptions = z.infer<typeof soundOptionsSchema>;
397
397
  declare const hapticsOptionsSchema: z.ZodObject<{
398
398
  enabled: z.ZodDefault<z.ZodBoolean>;
399
399
  events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
400
+ voiceStart: "voiceStart";
401
+ voiceStop: "voiceStop";
400
402
  error: "error";
401
403
  messageReceived: "messageReceived";
402
404
  messageSent: "messageSent";
403
- voiceStart: "voiceStart";
404
- voiceStop: "voiceStop";
405
405
  }> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
406
406
  }, z.core.$loose>;
407
407
  type HapticsOptions = z.infer<typeof hapticsOptionsSchema>;
@@ -410,21 +410,21 @@ declare const feedbackSchema: z.ZodObject<{
410
410
  enabled: z.ZodDefault<z.ZodBoolean>;
411
411
  volume: z.ZodDefault<z.ZodNumber>;
412
412
  events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
413
+ voiceStart: "voiceStart";
414
+ voiceStop: "voiceStop";
413
415
  error: "error";
414
416
  messageReceived: "messageReceived";
415
417
  messageSent: "messageSent";
416
- voiceStart: "voiceStart";
417
- voiceStop: "voiceStop";
418
418
  }> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
419
419
  }, z.core.$loose>>;
420
420
  haptics: z.ZodOptional<z.ZodObject<{
421
421
  enabled: z.ZodDefault<z.ZodBoolean>;
422
422
  events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
423
+ voiceStart: "voiceStart";
424
+ voiceStop: "voiceStop";
423
425
  error: "error";
424
426
  messageReceived: "messageReceived";
425
427
  messageSent: "messageSent";
426
- voiceStart: "voiceStart";
427
- voiceStop: "voiceStop";
428
428
  }> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
429
429
  }, z.core.$loose>>;
430
430
  }, z.core.$loose>;
@@ -859,18 +859,18 @@ type I18nOptions = z.infer<typeof i18nSchema>;
859
859
  */
860
860
 
861
861
  declare const moduleLayoutSchema: z.ZodEnum<{
862
+ home: "home";
862
863
  chat: "chat";
863
864
  help: "help";
864
- home: "home";
865
865
  news: "news";
866
866
  }>;
867
867
  type ModuleLayout = z.infer<typeof moduleLayoutSchema>;
868
868
  declare const moduleSchema: z.ZodObject<{
869
869
  label: z.ZodString;
870
870
  layout: z.ZodEnum<{
871
+ home: "home";
871
872
  chat: "chat";
872
873
  help: "help";
873
- home: "home";
874
874
  news: "news";
875
875
  }>;
876
876
  contentTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -896,9 +896,9 @@ type ModuleOptions = z.infer<typeof moduleSchema>;
896
896
  declare const modulesSchema: z.ZodArray<z.ZodObject<{
897
897
  label: z.ZodString;
898
898
  layout: z.ZodEnum<{
899
+ home: "home";
899
900
  chat: "chat";
900
901
  help: "help";
901
- home: "home";
902
902
  news: "news";
903
903
  }>;
904
904
  contentTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
package/web-component.mjs CHANGED
@@ -4122,7 +4122,7 @@ function themeIcon(mode) {
4122
4122
  return /* @__PURE__ */ jsx9(ThemeAutoIcon, {});
4123
4123
  }
4124
4124
  function localeCode(locale) {
4125
- return (locale.split("-")[0] || locale).toUpperCase();
4125
+ return (locale.split("-")[0] ?? locale).toUpperCase();
4126
4126
  }
4127
4127
  function HeaderActions({ panelProps, variant }) {
4128
4128
  const { options, panelSize, feedback, onClose, onClear, onExpand, onFullscreen, onPopOut, onSoundToggle } = panelProps;
@@ -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(() => {