@helpai/elements 0.59.3 → 0.59.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/web-component.mjs CHANGED
@@ -1010,9 +1010,7 @@ var DEFAULT_ATTACHMENTS = {
1010
1010
  accept: "*/*"
1011
1011
  };
1012
1012
  var DEFAULT_FEATURES = {
1013
- files: true,
1014
- voice: "local",
1015
- disableHumanInLoop: false
1013
+ voice: "local"
1016
1014
  };
1017
1015
  var DEFAULT_FORMS = { list: [], byTrigger: {} };
1018
1016
  var DEFAULT_TRACKING = {
@@ -1087,12 +1085,11 @@ function resolveOptions(rawOpts) {
1087
1085
  showReasoning: behavior.showReasoning ?? false,
1088
1086
  showToolCalls: behavior.showToolCalls ?? false,
1089
1087
  showSources: behavior.showSources ?? false,
1090
- scrollFade: behavior.scrollFade ?? true,
1091
1088
  enableMessageFeedback: !(behavior.disableMessageFeedback ?? false),
1092
1089
  features: {
1093
- files: opts.features?.files ?? DEFAULT_FEATURES.files,
1094
1090
  voice: opts.features?.voice ?? DEFAULT_FEATURES.voice,
1095
- disableHumanInLoop: opts.features?.disableHumanInLoop ?? false,
1091
+ fileUpload: !(opts.features?.disableFileUpload ?? false),
1092
+ humanInLoop: !(opts.features?.disableHumanInLoop ?? false),
1096
1093
  tools: opts.features?.tools
1097
1094
  },
1098
1095
  forms: resolveForms(opts.forms, locale),
@@ -1206,9 +1203,9 @@ function resolveModules(overrides) {
1206
1203
  if (m.layout === "home") {
1207
1204
  resolved.brandName = m.brandName;
1208
1205
  resolved.greetingText = m.greetingText;
1209
- resolved.hideGreeting = m.hideGreeting ?? false;
1210
- resolved.hideSearchBar = m.hideSearchBar ?? false;
1211
- resolved.hideRecentConversations = m.hideRecentConversations ?? false;
1206
+ resolved.showGreeting = !(m.hideGreeting ?? false);
1207
+ resolved.showSearchBar = !(m.hideSearchBar ?? false);
1208
+ resolved.showRecentConversations = !(m.hideRecentConversations ?? false);
1212
1209
  if (m.userAvatars && m.userAvatars.length > 0) resolved.userAvatars = m.userAvatars;
1213
1210
  if (m.status) resolved.status = m.status;
1214
1211
  resolved.contentBlockTitle = m.contentBlockTitle;
@@ -1417,7 +1414,6 @@ var BEHAVIOR_ATTRS = [
1417
1414
  ["show-reasoning", "showReasoning", boolAttr],
1418
1415
  ["show-tool-calls", "showToolCalls", boolAttr],
1419
1416
  ["show-sources", "showSources", boolAttr],
1420
- ["scroll-fade", "scrollFade", boolAttr],
1421
1417
  ["disable-message-feedback", "disableMessageFeedback", boolAttr]
1422
1418
  ];
1423
1419
  var I18N_ATTRS = [["locale", "locale"]];
@@ -1430,7 +1426,7 @@ var LAUNCHER_ATTRS = [
1430
1426
  ["launcher-hidden", "hidden", boolAttr]
1431
1427
  ];
1432
1428
  var FEATURE_ATTRS = [
1433
- ["features-files", "files", boolAttr],
1429
+ ["features-disable-file-upload", "disableFileUpload", boolAttr],
1434
1430
  ["features-voice", "voice", (v) => v],
1435
1431
  ["features-tools", "tools", csv]
1436
1432
  ];
@@ -1933,7 +1929,7 @@ function createAuth(opts) {
1933
1929
  }
1934
1930
 
1935
1931
  // src/core/version.ts
1936
- var ELEMENTS_VERSION = true ? "0.59.3" : "0.0.0-dev";
1932
+ var ELEMENTS_VERSION = true ? "0.59.4" : "0.0.0-dev";
1937
1933
  var ELEMENTS_VERSION_PARAM = "_ev";
1938
1934
 
1939
1935
  // src/stream/types.ts
@@ -4459,7 +4455,7 @@ function Composer({ options, transport, feedback, bus, isStreaming, onSend, onSt
4459
4455
  const [voiceOn, setVoiceOn] = useState2(false);
4460
4456
  const taRef = useRef2(null);
4461
4457
  const fileRef = useRef2(null);
4462
- const filesEnabled = options.features.files;
4458
+ const fileUploadEnabled = options.features.fileUpload;
4463
4459
  const voiceMode = options.features.voice;
4464
4460
  const [voice, setVoice] = useState2(
4465
4461
  () => createVoice(voiceMode, options.locale, (blob, type) => transport.transcribe(blob, type))
@@ -4516,7 +4512,7 @@ function Composer({ options, transport, feedback, bus, isStreaming, onSend, onSt
4516
4512
  "input, textarea, [contenteditable]:not([contenteditable='false'])"
4517
4513
  );
4518
4514
  if (editable && editable !== ta) return;
4519
- if (filesEnabled) {
4515
+ if (fileUploadEnabled) {
4520
4516
  const result = ingest(data.items, attsRef.current, options.attachments);
4521
4517
  if (result.accepted.length > 0) {
4522
4518
  e.preventDefault();
@@ -4535,7 +4531,7 @@ function Composer({ options, transport, feedback, bus, isStreaming, onSend, onSt
4535
4531
  };
4536
4532
  panel.addEventListener("paste", onPaste);
4537
4533
  return () => panel.removeEventListener("paste", onPaste);
4538
- }, [filesEnabled, options.attachments, p7]);
4534
+ }, [fileUploadEnabled, options.attachments, p7]);
4539
4535
  const send = () => {
4540
4536
  const trimmed = text.trim();
4541
4537
  if (!trimmed && atts.length === 0) return;
@@ -4605,7 +4601,7 @@ function Composer({ options, transport, feedback, bus, isStreaming, onSend, onSt
4605
4601
  atts.length > 0 ? /* @__PURE__ */ jsx6("div", { class: `${p7}-attachments`, children: atts.map((a) => /* @__PURE__ */ jsx6(AttachmentChip, { attachment: a, onRemove: () => removeAtt(a.id) }, a.id)) }) : null,
4606
4602
  /* @__PURE__ */ jsxs5("div", { class: `${p7}-composer-row`, children: [
4607
4603
  /* @__PURE__ */ jsxs5("div", { class: `${p7}-composer-actions`, children: [
4608
- filesEnabled ? /* @__PURE__ */ jsx6(
4604
+ fileUploadEnabled ? /* @__PURE__ */ jsx6(
4609
4605
  "button",
4610
4606
  {
4611
4607
  type: "button",
@@ -6362,7 +6358,6 @@ function MessageList({
6362
6358
  showReasoning,
6363
6359
  showToolCalls,
6364
6360
  showSources,
6365
- scrollFade,
6366
6361
  enableMessageFeedback,
6367
6362
  onFeedback,
6368
6363
  loading,
@@ -6383,7 +6378,6 @@ function MessageList({
6383
6378
  const inInteractionGrace = () => interactingRef.current || performance.now() - interactionEndedAtRef.current < INTERACTION_GRACE_MS;
6384
6379
  const autoPinAtRef = useRef5(0);
6385
6380
  const syncFade = (el) => {
6386
- if (!scrollFade) return;
6387
6381
  const overflowing = el.scrollHeight - el.clientHeight > 1;
6388
6382
  el.dataset.fadeTop = overflowing && el.scrollTop > 1 ? "true" : "false";
6389
6383
  el.dataset.fadeBottom = overflowing && el.scrollHeight - el.scrollTop - el.clientHeight > 1 ? "true" : "false";
@@ -6629,21 +6623,11 @@ function MessageList({
6629
6623
  rows.push(markerRow(marker));
6630
6624
  }
6631
6625
  return /* @__PURE__ */ jsxs16("div", { class: `${p18}-list-wrap`, children: [
6632
- /* @__PURE__ */ jsxs16(
6633
- "div",
6634
- {
6635
- ref,
6636
- class: `${p18}-list${scrollFade ? ` ${p18}-list--fade` : ""}`,
6637
- role: "log",
6638
- "aria-live": "polite",
6639
- "aria-relevant": "additions text",
6640
- children: [
6641
- loading && messages.value.length === 0 ? /* @__PURE__ */ jsx20("div", { class: `${p18}-list-loading`, role: "status", children: strings.conversationLoading }) : null,
6642
- rows,
6643
- form && !inlineForm ? /* @__PURE__ */ jsx20(FormGate, { form: form.form, strings, onSubmit: form.onSubmit, onSkip: form.onSkip }) : null
6644
- ]
6645
- }
6646
- ),
6626
+ /* @__PURE__ */ jsxs16("div", { ref, class: `${p18}-list ${p18}-list--fade`, role: "log", "aria-live": "polite", "aria-relevant": "additions text", children: [
6627
+ loading && messages.value.length === 0 ? /* @__PURE__ */ jsx20("div", { class: `${p18}-list-loading`, role: "status", children: strings.conversationLoading }) : null,
6628
+ rows,
6629
+ form && !inlineForm ? /* @__PURE__ */ jsx20(FormGate, { form: form.form, strings, onSubmit: form.onSubmit, onSkip: form.onSkip }) : null
6630
+ ] }),
6647
6631
  showJump ? /* @__PURE__ */ jsx20(
6648
6632
  "button",
6649
6633
  {
@@ -7012,7 +6996,6 @@ function PanelContent(props2) {
7012
6996
  showReasoning: options.showReasoning,
7013
6997
  showToolCalls: options.showToolCalls,
7014
6998
  showSources: options.showSources,
7015
- scrollFade: options.scrollFade,
7016
6999
  enableMessageFeedback: options.enableMessageFeedback,
7017
7000
  onFeedback: onMessageFeedback,
7018
7001
  loading: loadingMessages,
@@ -7559,13 +7542,13 @@ function HomeRoot(props2) {
7559
7542
  const [content, setContent] = useState12([]);
7560
7543
  const tagsKey = config.contentTags?.join(",");
7561
7544
  useEffect11(() => {
7562
- if (config.hideRecentConversations) return;
7545
+ if (config.showRecentConversations === false) return;
7563
7546
  let cancelled = false;
7564
7547
  transport.listConversations({ limit: 1 }).then((res) => !cancelled && setRecent(res.conversations?.[0] ?? null)).catch((err) => !cancelled && log13.warn("listConversations (home) failed", { err }));
7565
7548
  return () => {
7566
7549
  cancelled = true;
7567
7550
  };
7568
- }, [transport, config.hideRecentConversations]);
7551
+ }, [transport, config.showRecentConversations]);
7569
7552
  useEffect11(() => {
7570
7553
  if (!config.contentTags?.length) return;
7571
7554
  let cancelled = false;
@@ -7593,13 +7576,13 @@ function HomeRoot(props2) {
7593
7576
  /* @__PURE__ */ jsx32(HeaderActions, { panelProps, variant: "plain" })
7594
7577
  ] })
7595
7578
  ] }),
7596
- !config.hideGreeting ? /* @__PURE__ */ jsxs26(Fragment7, { children: [
7579
+ config.showGreeting !== false ? /* @__PURE__ */ jsxs26(Fragment7, { children: [
7597
7580
  /* @__PURE__ */ jsx32("h1", { class: `${p28}-home-greeting`, "data-testid": TID.homeGreeting, children: greeting.title }),
7598
7581
  greeting.subtitle ? /* @__PURE__ */ jsx32("p", { class: `${p28}-home-lead`, children: greeting.subtitle }) : null
7599
7582
  ] }) : null
7600
7583
  ] }),
7601
7584
  /* @__PURE__ */ jsxs26("div", { class: `${p28}-home-cards`, children: [
7602
- !config.hideSearchBar ? /* @__PURE__ */ jsx32(
7585
+ config.showSearchBar !== false ? /* @__PURE__ */ jsx32(
7603
7586
  HomeSearchButton,
7604
7587
  {
7605
7588
  placeholder: strings.homeSearchPlaceholder,
@@ -8752,12 +8735,12 @@ function App({ options, hostElement, bus }) {
8752
8735
  );
8753
8736
  const toolInteraction = useMemo3(
8754
8737
  () => ({
8755
- humanInLoop: !options.features.disableHumanInLoop,
8738
+ humanInLoop: options.features.humanInLoop,
8756
8739
  onResult: handleToolResult,
8757
8740
  onDecision: handleToolDecision,
8758
8741
  onEdit: handleToolEdit
8759
8742
  }),
8760
- [options.features.disableHumanInLoop, handleToolResult, handleToolDecision, handleToolEdit]
8743
+ [options.features.humanInLoop, handleToolResult, handleToolDecision, handleToolEdit]
8761
8744
  );
8762
8745
  const userMessageCount = () => messagesSig.value.reduce((n, m) => n + (m.role === "user" ? 1 : 0), 0);
8763
8746
  const effectiveForms = options.forms.list.length > 0 ? options.forms : remoteForms ?? options.forms;