@athenaintel/react 0.10.2 → 0.10.3

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/dist/index.js CHANGED
@@ -24957,6 +24957,7 @@ function AthenaWithThreadList({
24957
24957
  linkClicks,
24958
24958
  citationLinks
24959
24959
  }) {
24960
+ var _a2;
24960
24961
  const adapter = useAthenaThreadListAdapter({
24961
24962
  backendUrl,
24962
24963
  apiKey,
@@ -24999,15 +25000,17 @@ function AthenaWithThreadList({
24999
25000
  adapter
25000
25001
  });
25001
25002
  const handleRefresh = useCallback(() => {
25002
- var _a2;
25003
- const core = (_a2 = runtime == null ? void 0 : runtime._core) == null ? void 0 : _a2.threads;
25003
+ var _a3;
25004
+ const core = (_a3 = runtime == null ? void 0 : runtime._core) == null ? void 0 : _a3.threads;
25004
25005
  if (core) {
25005
25006
  core._loadThreadsPromise = void 0;
25006
25007
  core.__internal_load();
25007
25008
  }
25008
25009
  }, [runtime]);
25009
25010
  const previousAuthRefreshKeyRef = useRef(null);
25010
- const authRefreshKey = `${backendUrl}::${apiKey ?? ""}::${token ?? ""}`;
25011
+ const authContext = useContext(AthenaAuthContext);
25012
+ const authUserId = ((_a2 = authContext == null ? void 0 : authContext.user) == null ? void 0 : _a2.userId) ?? "";
25013
+ const authRefreshKey = `${backendUrl}::${apiKey ?? ""}::${authUserId}`;
25011
25014
  useEffect(() => {
25012
25015
  const previousAuthRefreshKey = previousAuthRefreshKeyRef.current;
25013
25016
  previousAuthRefreshKeyRef.current = authRefreshKey;
@@ -64826,11 +64829,24 @@ function highlightSql(code2) {
64826
64829
  i += str.length;
64827
64830
  continue;
64828
64831
  }
64832
+ if (code2.slice(i, i + 2) === "/*") {
64833
+ const end = code2.indexOf("*/", i + 2);
64834
+ const str = end >= 0 ? code2.slice(i, end + 2) : code2.slice(i);
64835
+ result += `<span style="color:var(--aui-syn-comment, #6a9955)">${escapeHtml(str)}</span>`;
64836
+ i += str.length;
64837
+ continue;
64838
+ }
64829
64839
  if (code2[i] === "'" || code2[i] === '"') {
64830
64840
  const q = code2[i];
64831
64841
  let j = i + 1;
64832
- while (j < code2.length && code2[j] !== q) {
64833
- if (code2[j] === "\\") j++;
64842
+ while (j < code2.length) {
64843
+ if (code2[j] === q) {
64844
+ if (j + 1 < code2.length && code2[j + 1] === q) {
64845
+ j += 2;
64846
+ continue;
64847
+ }
64848
+ break;
64849
+ }
64834
64850
  j++;
64835
64851
  }
64836
64852
  const str = code2.slice(i, j + 1);
@@ -64979,9 +64995,11 @@ const RunSqlToolUIImpl = ({
64979
64995
  i
64980
64996
  )) })
64981
64997
  ] }) }),
64982
- parsed.rows.length > 50 && /* @__PURE__ */ jsxs("div", { className: "border-t border-border/30 px-4 py-1.5 text-[10px] text-muted-foreground", children: [
64983
- "Showing first 50 of ",
64984
- parsed.rows.length,
64998
+ (parsed.rows.length > 50 || parsed.rowCount !== null && parsed.rowCount > parsed.rows.length) && /* @__PURE__ */ jsxs("div", { className: "border-t border-border/30 px-4 py-1.5 text-[10px] text-muted-foreground", children: [
64999
+ "Showing first ",
65000
+ Math.min(50, parsed.rows.length),
65001
+ " of ",
65002
+ parsed.rowCount ?? parsed.rows.length,
64985
65003
  " rows"
64986
65004
  ] })
64987
65005
  ] }),