@eshal-bot/chat-widget 0.1.76 → 0.1.78

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.
@@ -91901,6 +91901,14 @@
91901
91901
  })]
91902
91902
  });
91903
91903
  }
91904
+ const hasLongLabels = data.some(d => {
91905
+ var _d$label;
91906
+ return String((_d$label = d.label) !== null && _d$label !== void 0 ? _d$label : '').length > 10;
91907
+ });
91908
+ const xAngle = hasLongLabels ? -35 : 0;
91909
+ const xAnchor = hasLongLabels ? 'end' : 'middle';
91910
+ const bottomMargin = hasLongLabels ? 48 : 20;
91911
+ const chartHeight = hasLongLabels ? 250 : 220;
91904
91912
  return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
91905
91913
  style: {
91906
91914
  borderRadius: 8,
@@ -91920,7 +91928,7 @@
91920
91928
  children: props.title
91921
91929
  }), /*#__PURE__*/jsxRuntimeExports.jsx("div", {
91922
91930
  style: {
91923
- height: 220,
91931
+ height: chartHeight,
91924
91932
  width: '100%'
91925
91933
  },
91926
91934
  children: /*#__PURE__*/jsxRuntimeExports.jsx(ResponsiveContainer, {
@@ -91929,10 +91937,10 @@
91929
91937
  children: /*#__PURE__*/jsxRuntimeExports.jsxs(BarChart, {
91930
91938
  data: data,
91931
91939
  margin: {
91932
- top: 8,
91940
+ top: 16,
91933
91941
  right: 12,
91934
91942
  left: 12,
91935
- bottom: 20
91943
+ bottom: bottomMargin
91936
91944
  },
91937
91945
  children: [/*#__PURE__*/jsxRuntimeExports.jsx(CartesianGrid, {
91938
91946
  strokeDasharray: "3 3",
@@ -91943,9 +91951,13 @@
91943
91951
  fontSize: 11,
91944
91952
  fill: labelColor
91945
91953
  },
91946
- angle: 0,
91947
- textAnchor: "middle",
91954
+ angle: xAngle,
91955
+ textAnchor: xAnchor,
91948
91956
  interval: 0,
91957
+ tickFormatter: v => {
91958
+ const s = String(v !== null && v !== void 0 ? v : '');
91959
+ return s.replace(/[_\-]+/g, ' ').replace(/\b\w/g, c => c.toUpperCase());
91960
+ },
91949
91961
  label: props.xAxisLabel ? {
91950
91962
  value: props.xAxisLabel,
91951
91963
  position: 'insideBottom',
@@ -91980,7 +91992,13 @@
91980
91992
  dataKey: "value",
91981
91993
  name: seriesName,
91982
91994
  fill: "#3b82f6",
91983
- radius: [2, 2, 0, 0]
91995
+ radius: [2, 2, 0, 0],
91996
+ label: {
91997
+ position: 'top',
91998
+ fill: labelColor,
91999
+ fontSize: 10,
92000
+ formatter: v => currency ? formatCurrencyCompact(v) : formatCompactNumber(v)
92001
+ }
91984
92002
  })]
91985
92003
  })
91986
92004
  })
@@ -96447,7 +96465,10 @@
96447
96465
  try {
96448
96466
  const parsed = JSON.parse(xhr.responseText);
96449
96467
  resolve({
96450
- url: typeof (parsed === null || parsed === void 0 ? void 0 : parsed.url) === "string" ? parsed.url : undefined
96468
+ url: typeof (parsed === null || parsed === void 0 ? void 0 : parsed.url) === "string" ? parsed.url : undefined,
96469
+ // 2026-07-04 — surface server-side storageKey so the caller
96470
+ // can persist it in preference to presign's key.
96471
+ storageKey: typeof (parsed === null || parsed === void 0 ? void 0 : parsed.storageKey) === "string" ? parsed.storageKey : undefined
96451
96472
  });
96452
96473
  } catch (_unused) {
96453
96474
  resolve({});
@@ -96588,6 +96609,11 @@
96588
96609
  // ingest hits `if not url: skip` and the file is never
96589
96610
  // extracted into the retrieval union.
96590
96611
  let uploadedReadUrl;
96612
+ // 2026-07-04 — see agent-sdk useFileUpload for full context.
96613
+ // `/multipart` re-runs buildAttachmentStorageKey → fresh UUID,
96614
+ // so presign's key and multipart's save key diverge. Persist
96615
+ // the multipart-returned key so the file's serve URL resolves.
96616
+ let uploadedStorageKey;
96591
96617
  try {
96592
96618
  if (presign.useMultipart) {
96593
96619
  const multipartResp = await postMultipartWithProgress({
@@ -96601,6 +96627,7 @@
96601
96627
  registerXhr: xhr => inflightRef.current.set(attachmentId, xhr)
96602
96628
  });
96603
96629
  uploadedReadUrl = multipartResp.url;
96630
+ uploadedStorageKey = multipartResp.storageKey;
96604
96631
  } else if (presign.uploadUrl) {
96605
96632
  await putWithProgress({
96606
96633
  url: presign.uploadUrl,
@@ -96623,7 +96650,7 @@
96623
96650
  patchAttachment(attachmentId, _objectSpread2({
96624
96651
  status: "ready",
96625
96652
  progress: 100,
96626
- storageKey: presign.storageKey
96653
+ storageKey: uploadedStorageKey || presign.storageKey
96627
96654
  }, uploadedReadUrl ? {
96628
96655
  url: uploadedReadUrl
96629
96656
  } : {}));