@helpai/elements 0.47.1 → 0.48.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
@@ -30,7 +30,7 @@ var BRAND = {
30
30
  };
31
31
 
32
32
  // src/core/version.ts
33
- var ELEMENTS_VERSION = true ? "0.47.1" : "0.0.0-dev";
33
+ var ELEMENTS_VERSION = true ? "0.48.0" : "0.0.0-dev";
34
34
  var ELEMENTS_VERSION_PARAM = "_ev";
35
35
 
36
36
  // src/i18n/strings.ts
@@ -348,7 +348,7 @@ var STRINGS_AR = {
348
348
  textSizeNormal: "\u0639\u0627\u062F\u064A",
349
349
  textSizeLarge: "\u0643\u0628\u064A\u0631",
350
350
  loading: "\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",
351
- thinking: "\u064A\u0641\u0643\u0631\u2026",
351
+ thinking: "\u064A\u0641\u0643\u0651\u0631\u2026",
352
352
  thoughts: "\u0627\u0644\u0623\u0641\u0643\u0627\u0631",
353
353
  usedTool: "\u0623\u062F\u0627\u0629 \u0645\u064F\u0633\u062A\u062E\u062F\u064E\u0645\u0629",
354
354
  toolResult: "\u0627\u0644\u0646\u062A\u064A\u062C\u0629",
@@ -405,7 +405,7 @@ var STRINGS_AR = {
405
405
  inputResponse: "\u0627\u0644\u0625\u062C\u0627\u0628\u0629",
406
406
  inputYourAnswer: "\u0625\u062C\u0627\u0628\u062A\u0643",
407
407
  inputSubmit: "\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",
408
- inputSubmitHint: "Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter \u0644\u0633\u0637\u0631 \u062C\u062F\u064A\u062F",
408
+ inputSubmitHint: "\u0627\u0636\u063A\u0637 Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter \u0644\u0633\u0637\u0631 \u062C\u062F\u064A\u062F",
409
409
  inputSkip: "\u062A\u062E\u0637\u064D\u0651",
410
410
  inputSubmitted: "\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",
411
411
  respFreeText: "\u0646\u0635 \u062D\u0631",
@@ -424,10 +424,141 @@ var STRINGS_AR = {
424
424
  statusDenied: "\u0645\u0631\u0641\u0648\u0636",
425
425
  statusError: "\u062E\u0637\u0623"
426
426
  };
427
+ var STRINGS_ES = {
428
+ attach: "Adjuntar archivos",
429
+ attachmentMimeRejected: "Tipo de archivo no admitido",
430
+ attachmentTooLarge: "El archivo es demasiado grande",
431
+ attachmentTooMany: "Se alcanz\xF3 el l\xEDmite de adjuntos",
432
+ conversationClosed: "Esta conversaci\xF3n est\xE1 cerrada",
433
+ conversationLoading: "Cargando conversaci\xF3n\u2026",
434
+ close: "Cerrar",
435
+ collapse: "Contraer",
436
+ collapseSidebar: "Contraer la barra lateral",
437
+ composerPlaceholder: "Escribe un mensaje\u2026",
438
+ dateLastWeek: "\xDAltimos 7 d\xEDas",
439
+ dateOlder: "Anteriores",
440
+ dateToday: "Hoy",
441
+ dateYesterday: "Ayer",
442
+ dropZone: "Suelta los archivos para adjuntarlos",
443
+ errorGeneric: "Algo sali\xF3 mal",
444
+ errorRateLimited: "Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",
445
+ errorRetry: "Reintentar",
446
+ expand: "Ampliar",
447
+ expandSidebar: "Expandir la barra lateral",
448
+ exitFullscreen: "Salir de pantalla completa",
449
+ fullscreen: "Pantalla completa",
450
+ history: "Historial",
451
+ historyBack: "Volver al chat",
452
+ historyEmpty: "A\xFAn no tienes conversaciones",
453
+ historyContinue: "Continuar la conversaci\xF3n",
454
+ historyLoading: "Cargando tus conversaciones\u2026",
455
+ historyTitle: "Historial de conversaciones",
456
+ language: "Idioma",
457
+ launcherOpen: "Abrir el chat",
458
+ launcherLabel: "Chatea con nosotros",
459
+ micStart: "Iniciar entrada de voz",
460
+ micStop: "Detener entrada de voz",
461
+ micUnsupported: "Este navegador no admite la entrada de voz",
462
+ moreActions: "M\xE1s acciones",
463
+ newConversation: "Nueva conversaci\xF3n",
464
+ panelTitle: "Chat",
465
+ resizeHandle: "Arrastra para cambiar el tama\xF1o",
466
+ scrollToBottom: "Ir a lo m\xE1s reciente",
467
+ send: "Enviar",
468
+ soundOff: "Sonido desactivado",
469
+ soundOn: "Sonido activado",
470
+ startNewConversation: "Iniciar una conversaci\xF3n nueva",
471
+ stop: "Detener",
472
+ theme: "Tema",
473
+ themeAuto: "Autom\xE1tico",
474
+ themeDark: "Oscuro",
475
+ themeLight: "Claro",
476
+ textSize: "Tama\xF1o del texto",
477
+ textSizeSmall: "Peque\xF1o",
478
+ textSizeNormal: "Normal",
479
+ textSizeLarge: "Grande",
480
+ loading: "Cargando\u2026",
481
+ thinking: "Pensando\u2026",
482
+ thoughts: "Razonamiento",
483
+ usedTool: "Herramienta usada",
484
+ toolResult: "Resultado",
485
+ sources: "Fuentes",
486
+ // ── Messenger modules ──────────────────────────────────────────
487
+ tabHome: "Inicio",
488
+ tabConversations: "Conversaciones",
489
+ tabHelp: "Ayuda",
490
+ tabNews: "Novedades",
491
+ modulesEmpty: "A\xFAn no hay nada aqu\xED",
492
+ moduleBack: "Atr\xE1s",
493
+ contentLoading: "Cargando\u2026",
494
+ homeGreeting: "\xBFC\xF3mo podemos ayudarte?",
495
+ homeGreetingNamed: "Hola, {name} \u{1F44B}",
496
+ homeGreetingLead: "\xBFC\xF3mo podemos ayudarte?",
497
+ homeSearchPlaceholder: "Buscar ayuda",
498
+ homeContentTitle: "Art\xEDculos populares",
499
+ homeStatus: "Estado",
500
+ helpTitle: "Ayuda",
501
+ helpSearchPlaceholder: "Buscar ayuda",
502
+ helpEmpty: "A\xFAn no hay art\xEDculos de ayuda",
503
+ helpLoading: "Cargando la ayuda\u2026",
504
+ helpSearchEmpty: "No se encontraron resultados",
505
+ newsTitle: "Novedades",
506
+ newsEmpty: "A\xFAn no hay novedades",
507
+ newsLoading: "Cargando novedades\u2026",
508
+ newsBack: "Volver a novedades",
509
+ newsPublishedAt: "Publicado el {date}",
510
+ // ── Forms + human-in-the-loop (forms / ask-input / approval) ────
511
+ formSubmit: "Enviar",
512
+ formSkip: "Quiz\xE1 m\xE1s tarde",
513
+ formSubmitted: "Completado",
514
+ formSkipped: "Quiz\xE1 m\xE1s tarde",
515
+ formFillOut: "Completar",
516
+ formRequired: "Este campo es obligatorio",
517
+ formInvalidEmail: "Introduce un correo electr\xF3nico v\xE1lido",
518
+ formInvalidTel: "Introduce un n\xFAmero de tel\xE9fono v\xE1lido",
519
+ formInvalidUrl: "Introduce una URL v\xE1lida",
520
+ formInvalidNumber: "Introduce un n\xFAmero v\xE1lido",
521
+ formTooShort: "Demasiado corto (m\xEDn. {min} caracteres)",
522
+ formTooLong: "Demasiado largo (m\xE1x. {max} caracteres)",
523
+ formNumberTooSmall: "Debe ser al menos {min}",
524
+ formNumberTooLarge: "Debe ser como m\xE1ximo {max}",
525
+ formPatternMismatch: "Respeta el formato solicitado",
526
+ formChooseAtLeast: "Elige al menos {min}",
527
+ formChooseAtMost: "Elige como m\xE1ximo {max}",
528
+ formOther: "Otro",
529
+ formOtherPlaceholder: "Escribe tu respuesta\u2026",
530
+ inputRequired: "Entrada requerida",
531
+ inputBadge: "Entrada",
532
+ inputAnswered: "Respondido",
533
+ inputSkipped: "Omitido",
534
+ inputQuestion: "Pregunta",
535
+ inputResponse: "Respuesta",
536
+ inputYourAnswer: "Tu respuesta",
537
+ inputSubmit: "Enviar respuesta",
538
+ inputSubmitHint: "Enter para enviar \xB7 May\xFAs+Enter para una nueva l\xEDnea",
539
+ inputSkip: "Omitir",
540
+ inputSubmitted: "Respuesta enviada",
541
+ respFreeText: "Texto libre",
542
+ respSingleChoice: "Opci\xF3n \xFAnica",
543
+ respMultiChoice: "Opci\xF3n m\xFAltiple",
544
+ respConfirmation: "Confirmaci\xF3n",
545
+ approvalRequired: "Aprobaci\xF3n requerida",
546
+ approve: "Aprobar",
547
+ reject: "Rechazar",
548
+ approved: "Aprobado",
549
+ rejected: "Rechazado",
550
+ approvalReason: "A\xF1ade un motivo (opcional)",
551
+ stepNoLongerActive: "Esta solicitud ya no est\xE1 activa.",
552
+ toolParameters: "Par\xE1metros",
553
+ statusCompleted: "Completado",
554
+ statusDenied: "Denegado",
555
+ statusError: "Error"
556
+ };
427
557
  var BUILTIN_STRINGS = {
428
558
  en: STRINGS_EN,
429
559
  fr: STRINGS_FR,
430
- ar: STRINGS_AR
560
+ ar: STRINGS_AR,
561
+ es: STRINGS_ES
431
562
  };
432
563
  function resolveStrings(locale, override) {
433
564
  const tag = primaryTag(locale);
@@ -7190,9 +7321,6 @@ var p35 = BRAND.cssPrefix;
7190
7321
  function makeLocalizedWelcome(w, strings) {
7191
7322
  return makeInstantWelcomeMessage({ ...w, text: localizeText(strings, w.text) });
7192
7323
  }
7193
- function firstText(m) {
7194
- return m.partsSig.value.find((pt) => pt.kind === "text")?.textSig.value ?? "";
7195
- }
7196
7324
  function allToolPartsSettled(msg) {
7197
7325
  const tools = msg.partsSig.value.filter((pt) => pt.kind === "tool");
7198
7326
  return tools.length > 0 && tools.every((pt) => {
@@ -7386,9 +7514,7 @@ function App({ options, hostElement, bus }) {
7386
7514
  (n) => n !== void 0
7387
7515
  );
7388
7516
  const welcomeAnchor = (timelineStamps.length ? Math.min(...timelineStamps) : Date.now()) - 1;
7389
- const welcomeKey = (role, text) => `${role}|${text}`;
7390
- const loadedKeys = new Set(loaded.map((m) => welcomeKey(m.role, firstText(m))));
7391
- const welcomeRows = (welcomeRef.current?.messages ?? []).filter((w) => !loadedKeys.has(welcomeKey(w.role, localizeText(stringsRef.current, w.text)))).map((w) => {
7517
+ const welcomeRows = (welcomeRef.current?.messages ?? []).map((w) => {
7392
7518
  const row = makeLocalizedWelcome(w, stringsRef.current);
7393
7519
  row.createdAt = welcomeAnchor;
7394
7520
  return row;
package/package.json CHANGED
@@ -80,5 +80,5 @@
80
80
  ],
81
81
  "type": "module",
82
82
  "types": "./index.d.ts",
83
- "version": "0.47.1"
83
+ "version": "0.48.0"
84
84
  }
package/web-component.mjs CHANGED
@@ -344,7 +344,7 @@ var STRINGS_AR = {
344
344
  textSizeNormal: "\u0639\u0627\u062F\u064A",
345
345
  textSizeLarge: "\u0643\u0628\u064A\u0631",
346
346
  loading: "\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",
347
- thinking: "\u064A\u0641\u0643\u0631\u2026",
347
+ thinking: "\u064A\u0641\u0643\u0651\u0631\u2026",
348
348
  thoughts: "\u0627\u0644\u0623\u0641\u0643\u0627\u0631",
349
349
  usedTool: "\u0623\u062F\u0627\u0629 \u0645\u064F\u0633\u062A\u062E\u062F\u064E\u0645\u0629",
350
350
  toolResult: "\u0627\u0644\u0646\u062A\u064A\u062C\u0629",
@@ -401,7 +401,7 @@ var STRINGS_AR = {
401
401
  inputResponse: "\u0627\u0644\u0625\u062C\u0627\u0628\u0629",
402
402
  inputYourAnswer: "\u0625\u062C\u0627\u0628\u062A\u0643",
403
403
  inputSubmit: "\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",
404
- inputSubmitHint: "Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter \u0644\u0633\u0637\u0631 \u062C\u062F\u064A\u062F",
404
+ inputSubmitHint: "\u0627\u0636\u063A\u0637 Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter \u0644\u0633\u0637\u0631 \u062C\u062F\u064A\u062F",
405
405
  inputSkip: "\u062A\u062E\u0637\u064D\u0651",
406
406
  inputSubmitted: "\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",
407
407
  respFreeText: "\u0646\u0635 \u062D\u0631",
@@ -420,10 +420,141 @@ var STRINGS_AR = {
420
420
  statusDenied: "\u0645\u0631\u0641\u0648\u0636",
421
421
  statusError: "\u062E\u0637\u0623"
422
422
  };
423
+ var STRINGS_ES = {
424
+ attach: "Adjuntar archivos",
425
+ attachmentMimeRejected: "Tipo de archivo no admitido",
426
+ attachmentTooLarge: "El archivo es demasiado grande",
427
+ attachmentTooMany: "Se alcanz\xF3 el l\xEDmite de adjuntos",
428
+ conversationClosed: "Esta conversaci\xF3n est\xE1 cerrada",
429
+ conversationLoading: "Cargando conversaci\xF3n\u2026",
430
+ close: "Cerrar",
431
+ collapse: "Contraer",
432
+ collapseSidebar: "Contraer la barra lateral",
433
+ composerPlaceholder: "Escribe un mensaje\u2026",
434
+ dateLastWeek: "\xDAltimos 7 d\xEDas",
435
+ dateOlder: "Anteriores",
436
+ dateToday: "Hoy",
437
+ dateYesterday: "Ayer",
438
+ dropZone: "Suelta los archivos para adjuntarlos",
439
+ errorGeneric: "Algo sali\xF3 mal",
440
+ errorRateLimited: "Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",
441
+ errorRetry: "Reintentar",
442
+ expand: "Ampliar",
443
+ expandSidebar: "Expandir la barra lateral",
444
+ exitFullscreen: "Salir de pantalla completa",
445
+ fullscreen: "Pantalla completa",
446
+ history: "Historial",
447
+ historyBack: "Volver al chat",
448
+ historyEmpty: "A\xFAn no tienes conversaciones",
449
+ historyContinue: "Continuar la conversaci\xF3n",
450
+ historyLoading: "Cargando tus conversaciones\u2026",
451
+ historyTitle: "Historial de conversaciones",
452
+ language: "Idioma",
453
+ launcherOpen: "Abrir el chat",
454
+ launcherLabel: "Chatea con nosotros",
455
+ micStart: "Iniciar entrada de voz",
456
+ micStop: "Detener entrada de voz",
457
+ micUnsupported: "Este navegador no admite la entrada de voz",
458
+ moreActions: "M\xE1s acciones",
459
+ newConversation: "Nueva conversaci\xF3n",
460
+ panelTitle: "Chat",
461
+ resizeHandle: "Arrastra para cambiar el tama\xF1o",
462
+ scrollToBottom: "Ir a lo m\xE1s reciente",
463
+ send: "Enviar",
464
+ soundOff: "Sonido desactivado",
465
+ soundOn: "Sonido activado",
466
+ startNewConversation: "Iniciar una conversaci\xF3n nueva",
467
+ stop: "Detener",
468
+ theme: "Tema",
469
+ themeAuto: "Autom\xE1tico",
470
+ themeDark: "Oscuro",
471
+ themeLight: "Claro",
472
+ textSize: "Tama\xF1o del texto",
473
+ textSizeSmall: "Peque\xF1o",
474
+ textSizeNormal: "Normal",
475
+ textSizeLarge: "Grande",
476
+ loading: "Cargando\u2026",
477
+ thinking: "Pensando\u2026",
478
+ thoughts: "Razonamiento",
479
+ usedTool: "Herramienta usada",
480
+ toolResult: "Resultado",
481
+ sources: "Fuentes",
482
+ // ── Messenger modules ──────────────────────────────────────────
483
+ tabHome: "Inicio",
484
+ tabConversations: "Conversaciones",
485
+ tabHelp: "Ayuda",
486
+ tabNews: "Novedades",
487
+ modulesEmpty: "A\xFAn no hay nada aqu\xED",
488
+ moduleBack: "Atr\xE1s",
489
+ contentLoading: "Cargando\u2026",
490
+ homeGreeting: "\xBFC\xF3mo podemos ayudarte?",
491
+ homeGreetingNamed: "Hola, {name} \u{1F44B}",
492
+ homeGreetingLead: "\xBFC\xF3mo podemos ayudarte?",
493
+ homeSearchPlaceholder: "Buscar ayuda",
494
+ homeContentTitle: "Art\xEDculos populares",
495
+ homeStatus: "Estado",
496
+ helpTitle: "Ayuda",
497
+ helpSearchPlaceholder: "Buscar ayuda",
498
+ helpEmpty: "A\xFAn no hay art\xEDculos de ayuda",
499
+ helpLoading: "Cargando la ayuda\u2026",
500
+ helpSearchEmpty: "No se encontraron resultados",
501
+ newsTitle: "Novedades",
502
+ newsEmpty: "A\xFAn no hay novedades",
503
+ newsLoading: "Cargando novedades\u2026",
504
+ newsBack: "Volver a novedades",
505
+ newsPublishedAt: "Publicado el {date}",
506
+ // ── Forms + human-in-the-loop (forms / ask-input / approval) ────
507
+ formSubmit: "Enviar",
508
+ formSkip: "Quiz\xE1 m\xE1s tarde",
509
+ formSubmitted: "Completado",
510
+ formSkipped: "Quiz\xE1 m\xE1s tarde",
511
+ formFillOut: "Completar",
512
+ formRequired: "Este campo es obligatorio",
513
+ formInvalidEmail: "Introduce un correo electr\xF3nico v\xE1lido",
514
+ formInvalidTel: "Introduce un n\xFAmero de tel\xE9fono v\xE1lido",
515
+ formInvalidUrl: "Introduce una URL v\xE1lida",
516
+ formInvalidNumber: "Introduce un n\xFAmero v\xE1lido",
517
+ formTooShort: "Demasiado corto (m\xEDn. {min} caracteres)",
518
+ formTooLong: "Demasiado largo (m\xE1x. {max} caracteres)",
519
+ formNumberTooSmall: "Debe ser al menos {min}",
520
+ formNumberTooLarge: "Debe ser como m\xE1ximo {max}",
521
+ formPatternMismatch: "Respeta el formato solicitado",
522
+ formChooseAtLeast: "Elige al menos {min}",
523
+ formChooseAtMost: "Elige como m\xE1ximo {max}",
524
+ formOther: "Otro",
525
+ formOtherPlaceholder: "Escribe tu respuesta\u2026",
526
+ inputRequired: "Entrada requerida",
527
+ inputBadge: "Entrada",
528
+ inputAnswered: "Respondido",
529
+ inputSkipped: "Omitido",
530
+ inputQuestion: "Pregunta",
531
+ inputResponse: "Respuesta",
532
+ inputYourAnswer: "Tu respuesta",
533
+ inputSubmit: "Enviar respuesta",
534
+ inputSubmitHint: "Enter para enviar \xB7 May\xFAs+Enter para una nueva l\xEDnea",
535
+ inputSkip: "Omitir",
536
+ inputSubmitted: "Respuesta enviada",
537
+ respFreeText: "Texto libre",
538
+ respSingleChoice: "Opci\xF3n \xFAnica",
539
+ respMultiChoice: "Opci\xF3n m\xFAltiple",
540
+ respConfirmation: "Confirmaci\xF3n",
541
+ approvalRequired: "Aprobaci\xF3n requerida",
542
+ approve: "Aprobar",
543
+ reject: "Rechazar",
544
+ approved: "Aprobado",
545
+ rejected: "Rechazado",
546
+ approvalReason: "A\xF1ade un motivo (opcional)",
547
+ stepNoLongerActive: "Esta solicitud ya no est\xE1 activa.",
548
+ toolParameters: "Par\xE1metros",
549
+ statusCompleted: "Completado",
550
+ statusDenied: "Denegado",
551
+ statusError: "Error"
552
+ };
423
553
  var BUILTIN_STRINGS = {
424
554
  en: STRINGS_EN,
425
555
  fr: STRINGS_FR,
426
- ar: STRINGS_AR
556
+ ar: STRINGS_AR,
557
+ es: STRINGS_ES
427
558
  };
428
559
  function resolveStrings(locale, override) {
429
560
  const tag = primaryTag(locale);
@@ -1604,7 +1735,7 @@ function createAuth(opts) {
1604
1735
  }
1605
1736
 
1606
1737
  // src/core/version.ts
1607
- var ELEMENTS_VERSION = true ? "0.47.1" : "0.0.0-dev";
1738
+ var ELEMENTS_VERSION = true ? "0.48.0" : "0.0.0-dev";
1608
1739
  var ELEMENTS_VERSION_PARAM = "_ev";
1609
1740
 
1610
1741
  // src/stream/types.ts
@@ -7149,9 +7280,6 @@ var p35 = BRAND.cssPrefix;
7149
7280
  function makeLocalizedWelcome(w, strings) {
7150
7281
  return makeInstantWelcomeMessage({ ...w, text: localizeText(strings, w.text) });
7151
7282
  }
7152
- function firstText(m) {
7153
- return m.partsSig.value.find((pt) => pt.kind === "text")?.textSig.value ?? "";
7154
- }
7155
7283
  function allToolPartsSettled(msg) {
7156
7284
  const tools = msg.partsSig.value.filter((pt) => pt.kind === "tool");
7157
7285
  return tools.length > 0 && tools.every((pt) => {
@@ -7345,9 +7473,7 @@ function App({ options, hostElement, bus }) {
7345
7473
  (n) => n !== void 0
7346
7474
  );
7347
7475
  const welcomeAnchor = (timelineStamps.length ? Math.min(...timelineStamps) : Date.now()) - 1;
7348
- const welcomeKey = (role, text) => `${role}|${text}`;
7349
- const loadedKeys = new Set(loaded.map((m) => welcomeKey(m.role, firstText(m))));
7350
- const welcomeRows = (welcomeRef.current?.messages ?? []).filter((w) => !loadedKeys.has(welcomeKey(w.role, localizeText(stringsRef.current, w.text)))).map((w) => {
7476
+ const welcomeRows = (welcomeRef.current?.messages ?? []).map((w) => {
7351
7477
  const row = makeLocalizedWelcome(w, stringsRef.current);
7352
7478
  row.createdAt = welcomeAnchor;
7353
7479
  return row;