@helpai/elements 0.59.4 → 0.59.6

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
@@ -29,7 +29,7 @@ var BRAND = {
29
29
  };
30
30
 
31
31
  // src/core/version.ts
32
- var ELEMENTS_VERSION = true ? "0.59.4" : "0.0.0-dev";
32
+ var ELEMENTS_VERSION = true ? "0.59.6" : "0.0.0-dev";
33
33
  var ELEMENTS_VERSION_PARAM = "_ev";
34
34
 
35
35
  // src/i18n/strings.ts
@@ -4521,7 +4521,9 @@ function Composer({ options, transport, feedback, bus, isStreaming, onSend, onSt
4521
4521
  return;
4522
4522
  }
4523
4523
  el.style.height = "auto";
4524
- el.style.height = `${Math.min(Math.max(el.scrollHeight, 40), 160)}px`;
4524
+ const halfLine = parseFloat(getComputedStyle(el).fontSize) * 0.7;
4525
+ const measured = Math.min(el.scrollHeight, 160);
4526
+ el.style.height = `${measured < 40 + halfLine ? 40 : measured}px`;
4525
4527
  }, [text]);
4526
4528
  const attsRef = useRef2(atts);
4527
4529
  attsRef.current = atts;
package/loader.js CHANGED
@@ -1,10 +1,10 @@
1
- // GA-style async loader stub. Template: HelpAI and https://cdn.help.ai/elements.js are
1
+ // GA-style async loader stub. Template: HelpAI and https://cdn.help.ai/elements/latest/elements.js are
2
2
  // Substituted at build time (see scripts/build-brand.mjs).
3
3
  //
4
4
  // Usage:
5
5
  //
6
6
  // <script>
7
- // !function(w,d){w.HelpAI=w.HelpAI||function(){(w.HelpAI.q=w.HelpAI.q||[]).push(arguments)};var s=d.createElement("script");s.async=1;s.src="https://cdn.help.ai/elements.js";d.head.appendChild(s)}(window,document);
7
+ // !function(w,d){w.HelpAI=w.HelpAI||function(){(w.HelpAI.q=w.HelpAI.q||[]).push(arguments)};var s=d.createElement("script");s.async=1;s.src="https://cdn.help.ai/elements/latest/elements.js";d.head.appendChild(s)}(window,document);
8
8
  // HelpAI('init', { publicKey: 'agent_pk_xxxx' });
9
9
  // </script>
10
10
 
@@ -16,6 +16,6 @@
16
16
  };
17
17
  var s = d.createElement("script");
18
18
  s.async = 1;
19
- s.src = "https://cdn.help.ai/elements.js";
19
+ s.src = "https://cdn.help.ai/elements/latest/elements.js";
20
20
  d.head.appendChild(s);
21
21
  })(window, document);
package/loader.min.js CHANGED
@@ -1 +1 @@
1
- (function(e,p){e.HelpAI=e.HelpAI||function(){(e.HelpAI.q=e.HelpAI.q||[]).push(arguments)};var n=p.createElement("script");n.async=1,n.src="https://cdn.help.ai/elements.js",p.head.appendChild(n)})(window,document);
1
+ (function(e,t){e.HelpAI=e.HelpAI||function(){(e.HelpAI.q=e.HelpAI.q||[]).push(arguments)};var n=t.createElement("script");n.async=1,n.src="https://cdn.help.ai/elements/latest/elements.js",t.head.appendChild(n)})(window,document);
package/package.json CHANGED
@@ -80,5 +80,5 @@
80
80
  ],
81
81
  "type": "module",
82
82
  "types": "./index.d.ts",
83
- "version": "0.59.4"
83
+ "version": "0.59.6"
84
84
  }
package/web-component.mjs CHANGED
@@ -1929,7 +1929,7 @@ function createAuth(opts) {
1929
1929
  }
1930
1930
 
1931
1931
  // src/core/version.ts
1932
- var ELEMENTS_VERSION = true ? "0.59.4" : "0.0.0-dev";
1932
+ var ELEMENTS_VERSION = true ? "0.59.6" : "0.0.0-dev";
1933
1933
  var ELEMENTS_VERSION_PARAM = "_ev";
1934
1934
 
1935
1935
  // src/stream/types.ts
@@ -4480,7 +4480,9 @@ function Composer({ options, transport, feedback, bus, isStreaming, onSend, onSt
4480
4480
  return;
4481
4481
  }
4482
4482
  el.style.height = "auto";
4483
- el.style.height = `${Math.min(Math.max(el.scrollHeight, 40), 160)}px`;
4483
+ const halfLine = parseFloat(getComputedStyle(el).fontSize) * 0.7;
4484
+ const measured = Math.min(el.scrollHeight, 160);
4485
+ el.style.height = `${measured < 40 + halfLine ? 40 : measured}px`;
4484
4486
  }, [text]);
4485
4487
  const attsRef = useRef2(atts);
4486
4488
  attsRef.current = atts;