@helpai/elements 0.7.3 → 0.7.4

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, L as Link, S as ServerConfig, b as SiteConfig, c as StartSessionResponse, W as WidgetConfig, d as WidgetConfigPartial, e as WidgetSettings, f as WidgetSettingsPartial } from './deployment-DhWwzofY.js';
1
+ export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, L as Link, S as ServerConfig, b as SiteConfig, c as StartSessionResponse, W as WidgetConfig, d as WidgetConfigPartial, e as WidgetSettings, f as WidgetSettingsPartial } from './deployment-Clv1qhOa.js';
2
2
  import 'zod';
3
3
 
4
4
  /**
package/index.mjs CHANGED
@@ -925,9 +925,6 @@ function uuid7() {
925
925
  const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
926
926
  return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
927
927
  }
928
- function cryptoId(prefix = "id") {
929
- return `${prefix}_${uuid7().replaceAll("-", "").slice(0, 16)}`;
930
- }
931
928
  function fillRandom(view) {
932
929
  if (typeof crypto !== "undefined" && typeof crypto.getRandomValues === "function") {
933
930
  crypto.getRandomValues(view);
@@ -2848,7 +2845,7 @@ function toFile(entry) {
2848
2845
  function toLocalAttachment(file) {
2849
2846
  return {
2850
2847
  file,
2851
- id: cryptoId("att"),
2848
+ id: uuid7(),
2852
2849
  mediaType: file.type || "application/octet-stream",
2853
2850
  name: file.name || "pasted-file",
2854
2851
  previewUrl: URL.createObjectURL(file),
package/package.json CHANGED
@@ -80,5 +80,5 @@
80
80
  ],
81
81
  "type": "module",
82
82
  "types": "./index.d.ts",
83
- "version": "0.7.3"
83
+ "version": "0.7.4"
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, L as Link, P as PAGE_AREA_SUGGESTIONS, g as PageContext, S as ServerConfig, b as SiteConfig, c as StartSessionResponse, U as UserContext, W as WidgetConfig, d as WidgetConfigPartial, e as WidgetSettings, f as WidgetSettingsPartial, h as assetSchema, i as blocksConfigSchema, j as connectionConfigPartialSchema, k as connectionConfigSchema, l as cssColorSchema, m as cssLengthSchema, n as endpointsSchema, o as linkSchema, p as localeSchema, q as pageContextSchema, s as serverConfigSchema, r as siteConfigSchema, t as startSessionResponseSchema, u as userContextSchema, v as uuid7Schema, w as widgetConfigPartialSchema, x as widgetConfigSchema, y as widgetSettingsPartialSchema, z as widgetSettingsSchema } from './deployment-DhWwzofY.js';
1
+ export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, E as Endpoints, L as Link, P as PAGE_AREA_SUGGESTIONS, g as PageContext, S as ServerConfig, b as SiteConfig, c as StartSessionResponse, U as UserContext, W as WidgetConfig, d as WidgetConfigPartial, e as WidgetSettings, f as WidgetSettingsPartial, h as assetSchema, i as blocksConfigSchema, j as connectionConfigPartialSchema, k as connectionConfigSchema, l as cssColorSchema, m as cssLengthSchema, n as endpointsSchema, o as linkSchema, p as localeSchema, q as pageContextSchema, s as serverConfigSchema, r as siteConfigSchema, t as startSessionResponseSchema, u as userContextSchema, v as uuid7Schema, w as widgetConfigPartialSchema, x as widgetConfigSchema, y as widgetSettingsPartialSchema, z as widgetSettingsSchema } from './deployment-Clv1qhOa.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";
59
60
  expanded: "expanded";
60
61
  auto: "auto";
61
- normal: "normal";
62
62
  }>>;
63
63
  autoSizeBreakpoint: z.ZodDefault<z.ZodNumber>;
64
64
  }, z.core.$loose>>;
@@ -148,9 +148,9 @@ declare const launcherSizeSchema: z.ZodEnum<{
148
148
  }>;
149
149
  type LauncherSize = z.infer<typeof launcherSizeSchema>;
150
150
  declare const calloutShapeSchema: z.ZodEnum<{
151
- callout: "callout";
152
151
  pill: "pill";
153
152
  bubble: "bubble";
153
+ callout: "callout";
154
154
  }>;
155
155
  type CalloutShape = z.infer<typeof calloutShapeSchema>;
156
156
  declare const calloutPositionSchema: z.ZodEnum<{
@@ -162,9 +162,9 @@ type CalloutPosition = z.infer<typeof calloutPositionSchema>;
162
162
  declare const launcherCalloutSchema: z.ZodObject<{
163
163
  text: z.ZodDefault<z.ZodString>;
164
164
  shape: z.ZodDefault<z.ZodEnum<{
165
- callout: "callout";
166
165
  pill: "pill";
167
166
  bubble: "bubble";
167
+ callout: "callout";
168
168
  }>>;
169
169
  position: z.ZodDefault<z.ZodEnum<{
170
170
  auto: "auto";
@@ -195,9 +195,9 @@ declare const launcherOptionsSchema: z.ZodObject<{
195
195
  callout: z.ZodOptional<z.ZodObject<{
196
196
  text: z.ZodDefault<z.ZodString>;
197
197
  shape: z.ZodDefault<z.ZodEnum<{
198
- callout: "callout";
199
198
  pill: "pill";
200
199
  bubble: "bubble";
200
+ callout: "callout";
201
201
  }>>;
202
202
  position: z.ZodDefault<z.ZodEnum<{
203
203
  auto: "auto";
@@ -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";
243
244
  expanded: "expanded";
244
245
  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";
272
273
  expanded: "expanded";
273
274
  auto: "auto";
274
- normal: "normal";
275
275
  }>>;
276
276
  autoSizeBreakpoint: z.ZodDefault<z.ZodNumber>;
277
277
  }, z.core.$loose>;
@@ -321,38 +321,38 @@ type FeatureFlags = z.infer<typeof featureFlagsSchema>;
321
321
  */
322
322
 
323
323
  declare const actionNameSchema: z.ZodEnum<{
324
- close: "close";
325
324
  expand: "expand";
326
325
  fullscreen: "fullscreen";
327
326
  popOut: "popOut";
328
- clear: "clear";
329
- theme: "theme";
327
+ close: "close";
330
328
  language: "language";
329
+ theme: "theme";
331
330
  history: "history";
331
+ clear: "clear";
332
332
  sound: "sound";
333
333
  }>;
334
334
  type ActionName = z.infer<typeof actionNameSchema>;
335
335
  declare const headerActionsSchema: z.ZodObject<{
336
336
  main: z.ZodDefault<z.ZodArray<z.ZodEnum<{
337
- close: "close";
338
337
  expand: "expand";
339
338
  fullscreen: "fullscreen";
340
339
  popOut: "popOut";
341
- clear: "clear";
342
- theme: "theme";
340
+ close: "close";
343
341
  language: "language";
342
+ theme: "theme";
344
343
  history: "history";
344
+ clear: "clear";
345
345
  sound: "sound";
346
346
  }>>>;
347
347
  overflow: z.ZodDefault<z.ZodArray<z.ZodEnum<{
348
- close: "close";
349
348
  expand: "expand";
350
349
  fullscreen: "fullscreen";
351
350
  popOut: "popOut";
352
- clear: "clear";
353
- theme: "theme";
351
+ close: "close";
354
352
  language: "language";
353
+ theme: "theme";
355
354
  history: "history";
355
+ clear: "clear";
356
356
  sound: "sound";
357
357
  }>>>;
358
358
  }, z.core.$loose>;
@@ -361,25 +361,25 @@ type HeaderActions = z.infer<typeof headerActionsSchema>;
361
361
  declare const headerSchema: z.ZodObject<{
362
362
  actions: z.ZodOptional<z.ZodObject<{
363
363
  main: z.ZodDefault<z.ZodArray<z.ZodEnum<{
364
- close: "close";
365
364
  expand: "expand";
366
365
  fullscreen: "fullscreen";
367
366
  popOut: "popOut";
368
- clear: "clear";
369
- theme: "theme";
367
+ close: "close";
370
368
  language: "language";
369
+ theme: "theme";
371
370
  history: "history";
371
+ clear: "clear";
372
372
  sound: "sound";
373
373
  }>>>;
374
374
  overflow: z.ZodDefault<z.ZodArray<z.ZodEnum<{
375
- close: "close";
376
375
  expand: "expand";
377
376
  fullscreen: "fullscreen";
378
377
  popOut: "popOut";
379
- clear: "clear";
380
- theme: "theme";
378
+ close: "close";
381
379
  language: "language";
380
+ theme: "theme";
382
381
  history: "history";
382
+ clear: "clear";
383
383
  sound: "sound";
384
384
  }>>>;
385
385
  }, z.core.$loose>>;
@@ -396,33 +396,33 @@ type HeaderOptions = z.infer<typeof headerSchema>;
396
396
  */
397
397
 
398
398
  declare const feedbackEventSchema: z.ZodEnum<{
399
- voiceStart: "voiceStart";
400
- voiceStop: "voiceStop";
401
399
  error: "error";
402
400
  messageReceived: "messageReceived";
403
401
  messageSent: "messageSent";
402
+ voiceStart: "voiceStart";
403
+ voiceStop: "voiceStop";
404
404
  }>;
405
405
  type FeedbackEvent = z.infer<typeof feedbackEventSchema>;
406
406
  declare const soundOptionsSchema: z.ZodObject<{
407
407
  enabled: z.ZodDefault<z.ZodBoolean>;
408
408
  volume: z.ZodDefault<z.ZodNumber>;
409
409
  events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
410
- voiceStart: "voiceStart";
411
- voiceStop: "voiceStop";
412
410
  error: "error";
413
411
  messageReceived: "messageReceived";
414
412
  messageSent: "messageSent";
413
+ voiceStart: "voiceStart";
414
+ voiceStop: "voiceStop";
415
415
  }> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
416
416
  }, z.core.$loose>;
417
417
  type SoundOptions = z.infer<typeof soundOptionsSchema>;
418
418
  declare const hapticsOptionsSchema: z.ZodObject<{
419
419
  enabled: z.ZodDefault<z.ZodBoolean>;
420
420
  events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
421
- voiceStart: "voiceStart";
422
- voiceStop: "voiceStop";
423
421
  error: "error";
424
422
  messageReceived: "messageReceived";
425
423
  messageSent: "messageSent";
424
+ voiceStart: "voiceStart";
425
+ voiceStop: "voiceStop";
426
426
  }> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
427
427
  }, z.core.$loose>;
428
428
  type HapticsOptions = z.infer<typeof hapticsOptionsSchema>;
@@ -431,21 +431,21 @@ declare const feedbackSchema: z.ZodObject<{
431
431
  enabled: z.ZodDefault<z.ZodBoolean>;
432
432
  volume: z.ZodDefault<z.ZodNumber>;
433
433
  events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
434
- voiceStart: "voiceStart";
435
- voiceStop: "voiceStop";
436
434
  error: "error";
437
435
  messageReceived: "messageReceived";
438
436
  messageSent: "messageSent";
437
+ voiceStart: "voiceStart";
438
+ voiceStop: "voiceStop";
439
439
  }> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
440
440
  }, z.core.$loose>>;
441
441
  haptics: z.ZodOptional<z.ZodObject<{
442
442
  enabled: z.ZodDefault<z.ZodBoolean>;
443
443
  events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
444
- voiceStart: "voiceStart";
445
- voiceStop: "voiceStop";
446
444
  error: "error";
447
445
  messageReceived: "messageReceived";
448
446
  messageSent: "messageSent";
447
+ voiceStart: "voiceStart";
448
+ voiceStop: "voiceStop";
449
449
  }> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
450
450
  }, z.core.$loose>>;
451
451
  }, z.core.$loose>;
@@ -607,18 +607,18 @@ type I18nOptions = z.infer<typeof i18nSchema>;
607
607
  */
608
608
 
609
609
  declare const moduleLayoutSchema: z.ZodEnum<{
610
- home: "home";
611
610
  chat: "chat";
612
611
  help: "help";
612
+ home: "home";
613
613
  news: "news";
614
614
  }>;
615
615
  type ModuleLayout = z.infer<typeof moduleLayoutSchema>;
616
616
  declare const moduleSchema: z.ZodObject<{
617
617
  label: z.ZodString;
618
618
  layout: z.ZodEnum<{
619
- home: "home";
620
619
  chat: "chat";
621
620
  help: "help";
621
+ home: "home";
622
622
  news: "news";
623
623
  }>;
624
624
  contentTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -644,9 +644,9 @@ type ModuleOptions = z.infer<typeof moduleSchema>;
644
644
  declare const modulesSchema: z.ZodArray<z.ZodObject<{
645
645
  label: z.ZodString;
646
646
  layout: z.ZodEnum<{
647
- home: "home";
648
647
  chat: "chat";
649
648
  help: "help";
649
+ home: "home";
650
650
  news: "news";
651
651
  }>;
652
652
  contentTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
package/schema.mjs CHANGED
@@ -14,7 +14,7 @@ var linkSchema = z.object({
14
14
  var cssLengthSchema = z.string().min(1).max(120).describe("Any CSS length \u2014 `640px`, `80vh`, `calc(100vh - 64px)`, etc. Validated only for size, not syntax.");
15
15
  var cssColorSchema = z.string().min(1).max(120).describe("Any CSS colour \u2014 hex, `rgb()`, `hsl()`, `oklch()`, a named colour, or a `var(--token)`.");
16
16
  var localeSchema = z.string().min(1).max(35).describe("BCP-47 locale tag (e.g. `en`, `fr-CA`, `zh-Hant-HK`).");
17
- var uuid7Schema = z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i).describe("UUID v7 (RFC 9562) \u2014 used by the backend for visitor / session / deployment ids.");
17
+ var uuid7Schema = z.uuidv7().describe("UUID v7 (RFC 9562) \u2014 the single id format for visitor / session / message / file / content ids.");
18
18
 
19
19
  // src/schema/widget.ts
20
20
  import { z as z15 } from "zod";
package/web-component.mjs CHANGED
@@ -989,9 +989,6 @@ function uuid7() {
989
989
  const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
990
990
  return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
991
991
  }
992
- function cryptoId(prefix = "id") {
993
- return `${prefix}_${uuid7().replaceAll("-", "").slice(0, 16)}`;
994
- }
995
992
  function fillRandom(view) {
996
993
  if (typeof crypto !== "undefined" && typeof crypto.getRandomValues === "function") {
997
994
  crypto.getRandomValues(view);
@@ -2912,7 +2909,7 @@ function toFile(entry) {
2912
2909
  function toLocalAttachment(file) {
2913
2910
  return {
2914
2911
  file,
2915
- id: cryptoId("att"),
2912
+ id: uuid7(),
2916
2913
  mediaType: file.type || "application/octet-stream",
2917
2914
  name: file.name || "pasted-file",
2918
2915
  previewUrl: URL.createObjectURL(file),