@inkeep/cxkit-primitives 0.5.25 → 0.5.29

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.
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),S=require("../../providers/config-provider.cjs"),T=require("../../utils/transform-source/index.cjs"),v=(e,o)=>{const{baseSettings:{transformSource:r,organizationDisplayName:s},searchSettings:{tabs:u,searchQueryParamKey:p,shouldOpenLinksInNewTab:g}}=S.useInkeepConfig();return w.useMemo(()=>{const R=u.length>0?u:["All"],n={},y=new Set,i=R.map(t=>typeof t=="string"?t:t[0]);for(const t of i)n[t]=[];for(const t of e){const a=t.url||"";if(y.has(a))continue;y.add(a);const d=I(a,o,p),c=T.transformInkeepSource({title:t.title,url:d,description:k(t),type:O(t.rootRecord.__typename),tag:D(t),breadcrumbs:t.rootRecord.pathBreadcrumbs??[],contentType:t.rootRecord.contentType},"searchResultItem",{organizationDisplayName:s,tabs:u,transformSource:r}),l={...c,id:t.id,isExternal:c.shouldOpenInNewTab!==void 0?c.shouldOpenInNewTab:g},m=l.tabs||[];for(const f of m){const b=typeof f=="string"?f:f[0];if(!i.includes(b)){console.warn(`Tab "${b}" found in item but not configured in tabs`);continue}n[b].push(l)}i.includes("All")&&n.All.push(l)}for(const t of Object.keys(n)){const a=R.find(c=>typeof c=="string"?c===t:c[0]===t),d=typeof a=="object"?a[1]?.isAlwaysVisible===!0:!1;n[t].length===0&&!d&&delete n[t]}return n},[e,r,s,u,o,p,g])};function I(e,o,r){try{const s=new URL(e);return s.searchParams.set(r,o),s.toString()}catch{return e}}const k=e=>{switch(e.rootRecord.__typename){case"DocumentationRecord":{const o=h(e.pathHeadings?.at(-1)?.content||""),r=h(e.content?.content||"");return e.preview||r||o}case"GitHubIssueRecord":case"StackOverflowRecord":case"DiscourseRecord":return e.rootRecord.body;default:return e.preview}},D=e=>{switch(e.rootRecord.__typename){case"StackOverflowRecord":return e.rootRecord.markedAsCorrectAnswer?"Resolved":void 0;case"GitHubIssueRecord":return e.rootRecord.state==="CLOSED"?"Closed":void 0}},h=e=>{const o=/(https?:\/\/\S+)/g;return e.replace(o,r=>{const s=r.split("/");return s.length>3?`...${s.slice(-2).join("/")}`:r})},O=e=>{switch(e){case"DocumentationRecord":return"documentation";case"GitHubIssueRecord":return"github_issue";case"DiscourseRecord":return"discourse";case"DiscordRecord":return"discord";case"StackOverflowRecord":return"stackoverflow";case"SlackEntry":return"slack_message";default:return"site"}};exports.useTransformResults=v;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),S=require("../../providers/config-provider.cjs"),T=require("../../utils/transform-source/index.cjs"),v=(e,o)=>{const{baseSettings:{transformSource:r,organizationDisplayName:s},searchSettings:{tabs:u,searchQueryParamKey:i,shouldOpenLinksInNewTab:g}}=S.useInkeepConfig();return w.useMemo(()=>{const R=u.length>0?u:["All"],n={},y=new Set,d=R.map(t=>typeof t=="string"?t:t[0]);for(const t of d)n[t]=[];for(const t of e){const c=t.url||"";if(y.has(c))continue;y.add(c);const l=i?I(c,o,i):c,a=T.transformInkeepSource({title:t.title,url:l,description:k(t),type:O(t.rootRecord.__typename),tag:D(t),breadcrumbs:t.rootRecord.pathBreadcrumbs??[],contentType:t.rootRecord.contentType},"searchResultItem",{organizationDisplayName:s,tabs:u,transformSource:r}),f={...a,id:t.id,isExternal:a.shouldOpenInNewTab!==void 0?a.shouldOpenInNewTab:g},m=f.tabs||[];for(const b of m){const p=typeof b=="string"?b:b[0];if(!d.includes(p)){console.warn(`Tab "${p}" found in item but not configured in tabs`);continue}n[p].push(f)}d.includes("All")&&n.All.push(f)}for(const t of Object.keys(n)){const c=R.find(a=>typeof a=="string"?a===t:a[0]===t),l=typeof c=="object"?c[1]?.isAlwaysVisible===!0:!1;n[t].length===0&&!l&&delete n[t]}return n},[e,r,s,u,o,i,g])};function I(e,o,r){try{const s=new URL(e);return s.searchParams.set(r,o),s.toString()}catch{return e}}const k=e=>{switch(e.rootRecord.__typename){case"DocumentationRecord":{const o=h(e.pathHeadings?.at(-1)?.content||""),r=h(e.content?.content||"");return e.preview||r||o}case"GitHubIssueRecord":case"StackOverflowRecord":case"DiscourseRecord":return e.rootRecord.body;default:return e.preview}},D=e=>{switch(e.rootRecord.__typename){case"StackOverflowRecord":return e.rootRecord.markedAsCorrectAnswer?"Resolved":void 0;case"GitHubIssueRecord":return e.rootRecord.state==="CLOSED"?"Closed":void 0}},h=e=>{const o=/(https?:\/\/\S+)/g;return e.replace(o,r=>{const s=r.split("/");return s.length>3?`...${s.slice(-2).join("/")}`:r})},O=e=>{switch(e){case"DocumentationRecord":return"documentation";case"GitHubIssueRecord":return"github_issue";case"DiscourseRecord":return"discourse";case"DiscordRecord":return"discord";case"StackOverflowRecord":return"stackoverflow";case"SlackEntry":return"slack_message";default:return"site"}};exports.useTransformResults=v;
@@ -5,20 +5,20 @@ import { transformInkeepSource as I } from "../../utils/transform-source/index.j
5
5
  const N = (e, r) => {
6
6
  const {
7
7
  baseSettings: { transformSource: o, organizationDisplayName: s },
8
- searchSettings: { tabs: u, searchQueryParamKey: b, shouldOpenLinksInNewTab: g }
8
+ searchSettings: { tabs: u, searchQueryParamKey: i, shouldOpenLinksInNewTab: g }
9
9
  } = S();
10
10
  return w(() => {
11
- const m = u.length > 0 ? u : ["All"], n = {}, R = /* @__PURE__ */ new Set(), i = m.map((t) => typeof t == "string" ? t : t[0]);
12
- for (const t of i)
11
+ const m = u.length > 0 ? u : ["All"], n = {}, R = /* @__PURE__ */ new Set(), d = m.map((t) => typeof t == "string" ? t : t[0]);
12
+ for (const t of d)
13
13
  n[t] = [];
14
14
  for (const t of e) {
15
- const a = t.url || "";
16
- if (R.has(a)) continue;
17
- R.add(a);
18
- const d = T(a, r, b), c = I(
15
+ const c = t.url || "";
16
+ if (R.has(c)) continue;
17
+ R.add(c);
18
+ const l = i ? T(c, r, i) : c, a = I(
19
19
  {
20
20
  title: t.title,
21
- url: d,
21
+ url: l,
22
22
  description: k(t),
23
23
  type: D(t.rootRecord.__typename),
24
24
  tag: v(t),
@@ -27,24 +27,24 @@ const N = (e, r) => {
27
27
  },
28
28
  "searchResultItem",
29
29
  { organizationDisplayName: s, tabs: u, transformSource: o }
30
- ), l = {
31
- ...c,
30
+ ), f = {
31
+ ...a,
32
32
  id: t.id,
33
- isExternal: c.shouldOpenInNewTab !== void 0 ? c.shouldOpenInNewTab : g
34
- }, y = l.tabs || [];
35
- for (const f of y) {
36
- const p = typeof f == "string" ? f : f[0];
37
- if (!i.includes(p)) {
38
- console.warn(`Tab "${p}" found in item but not configured in tabs`);
33
+ isExternal: a.shouldOpenInNewTab !== void 0 ? a.shouldOpenInNewTab : g
34
+ }, y = f.tabs || [];
35
+ for (const p of y) {
36
+ const b = typeof p == "string" ? p : p[0];
37
+ if (!d.includes(b)) {
38
+ console.warn(`Tab "${b}" found in item but not configured in tabs`);
39
39
  continue;
40
40
  }
41
- n[p].push(l);
41
+ n[b].push(f);
42
42
  }
43
- i.includes("All") && n.All.push(l);
43
+ d.includes("All") && n.All.push(f);
44
44
  }
45
45
  for (const t of Object.keys(n)) {
46
- const a = m.find((c) => typeof c == "string" ? c === t : c[0] === t), d = typeof a == "object" ? a[1]?.isAlwaysVisible === !0 : !1;
47
- n[t].length === 0 && !d && delete n[t];
46
+ const c = m.find((a) => typeof a == "string" ? a === t : a[0] === t), l = typeof c == "object" ? c[1]?.isAlwaysVisible === !0 : !1;
47
+ n[t].length === 0 && !l && delete n[t];
48
48
  }
49
49
  return n;
50
50
  }, [
@@ -53,7 +53,7 @@ const N = (e, r) => {
53
53
  s,
54
54
  u,
55
55
  r,
56
- b,
56
+ i,
57
57
  g
58
58
  ]);
59
59
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),X=require("../../providers/config-provider.cjs"),Y=require("../../hooks/use-media-query.cjs"),Z=require("./search-query.graphql.cjs"),ee=require("./transform-results.cjs"),te=require("../../providers/search-events-provider.cjs"),se=require("../../hooks/use-instant-update.cjs"),re=require("../../utils/graphql-client.cjs"),ne=()=>{const{baseSettings:N,searchSettings:O}=X.useInkeepConfig(),{apiKey:S,aiApiBaseUrl:x,userAuthToken:l,filters:R}=N,{maxResults:Q,placeholder:q,defaultQuery:B,debounceTimeMs:C,onQueryChange:H,searchFunctionsRef:$,tabs:i,filters:T}=O,{logEvent:k}=te.useSearchEvents(),[c,v]=t.useState(B),E=t.useRef(null),[M,w]=t.useState(!1),[z,h]=t.useState(null),[D,a]=t.useState("NONE"),K=t.useCallback(e=>{a(e)},[]),[f,d]=t.useState([]),s=ee.useTransformResults(f,c),I=typeof i?.[0]=="string"?i[0]:i[0][0],[y,A]=t.useState(I),{disableTransition:P,disabled:W}=se.useInstantUpdate(),G=t.useCallback(e=>{P(),A(e);const r=s[e][0].id;a(r)},[s,P]);t.useEffect(()=>{let e=y in s?y:Object.keys(s)[0];if(!s[e]?.length){const n=Object.keys(s).find(u=>s[u]?.length);n?e=n:e=I}if(!e)return;A(e);const r=s[e]?.[0];r&&a(r.id)},[s]);const b=Y.useMediaQuery("(max-width: 768px)"),o=t.useRef({}),m=t.useRef(null),g=t.useRef(null);t.useImperativeHandle($,()=>({updateQuery(e){v(e)},focusInput:()=>{E.current?.focus()}}));const U=`${x}/graphql`,_=t.useMemo(()=>({Authorization:`Bearer ${S}`,"Content-Type":"application/json",...l?{"User-Token":l}:{}}),[S,l]),j=t.useCallback(async e=>{m.current&&m.current.abort();const r=new AbortController;m.current=r;try{w(!0),h(null);const u=(await re.graphqlRequest(U,Z.default,{searchInput:e},_))?.search.searchHits;o.current[e.searchQuery]=u,d(u)}catch(n){if(n.name==="AbortError")return;h("Failed to fetch search results. Please try again.")}w(!1)},[U,_]),F=t.useCallback(e=>{const r=o.current[e.searchQuery];k({eventName:"search_query_response_received",properties:{searchQuery:e.searchQuery,totalResults:r?.length}})},[]),L=t.useCallback(e=>{if(g.current&&window.clearTimeout(g.current),!e.searchQuery){d([]),h(null);return}g.current=window.setTimeout(()=>{k({eventName:"search_query_submitted",properties:{searchQuery:e.searchQuery}}),o.current[e.searchQuery]?(d(o.current[e.searchQuery]),F(e)):j(e).then(()=>{F(e)})},C)},[C,j]),p=t.useMemo(()=>({searchQuery:c,filters:{...R,...T,limit:Q}}),[c,Q,R,T]);t.useEffect(()=>{H?.(p.searchQuery),L(p)},[L,p]);const J=t.useCallback(e=>v(e.target.value),[]),V=t.useMemo(()=>q||(b?"Search...":"Search for anything..."),[q,b]);return{results:s,resultsList:f,hasContent:f.length>0||M,loading:M,error:z,query:c,onInput:J,placeholder:V,tab:y,onTabChange:G,selectedItem:D,setSelectedItem:a,onSelectedItemChange:K,transitionsDisabled:W,inputRef:E,isMobile:b}};exports.useInkeepSearch=ne;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),Y=require("../../providers/config-provider.cjs"),Z=require("../../hooks/use-media-query.cjs"),ee=require("./search-query.graphql.cjs"),te=require("./transform-results.cjs"),se=require("../../providers/search-events-provider.cjs"),re=require("../../hooks/use-instant-update.cjs"),ne=require("../../utils/graphql-client.cjs"),ae=()=>{const{baseSettings:O,searchSettings:x}=Y.useInkeepConfig(),{apiKey:R,aiApiBaseUrl:B,userAuthToken:l,filters:Q}=O,{maxResults:q,placeholder:C,defaultQuery:H,debounceTimeMs:T,onQueryChange:$,searchFunctionsRef:z,tabs:i,filters:k}=x,{logEvent:v}=se.useSearchEvents(),[a,E]=t.useState(H),M=t.useRef(null),[w,h]=t.useState(!1),[D,f]=t.useState(null),[K,c]=t.useState("NONE"),W=t.useCallback(e=>{c(e)},[]),[d,y]=t.useState([]),s=te.useTransformResults(d,a),I=typeof i?.[0]=="string"?i[0]:i[0][0],[b,A]=t.useState(I),{disableTransition:P,disabled:G}=re.useInstantUpdate(),J=t.useCallback(e=>{P(),A(e);const r=s[e][0].id;c(r)},[s,P]);t.useEffect(()=>{let e=b in s?b:Object.keys(s)[0];if(!s[e]?.length){const n=Object.keys(s).find(u=>s[u]?.length);n?e=n:e=I}if(!e)return;A(e);const r=s[e]?.[0];r&&c(r.id)},[s]);const g=Z.useMediaQuery("(max-width: 768px)"),o=t.useRef({}),m=t.useRef(null),p=t.useRef(null);t.useImperativeHandle(z,()=>({updateQuery(e){E(e)},focusInput:()=>{M.current?.focus()}}));const U=`${B}/graphql`,_=t.useMemo(()=>({Authorization:`Bearer ${R}`,"Content-Type":"application/json",...l?{"User-Token":l}:{}}),[R,l]),j=t.useCallback(async e=>{const r=new AbortController;m.current=r;try{f(null);const u=(await ne.graphqlRequest(U,ee.default,{searchInput:e},_,r.signal))?.search.searchHits;o.current[e.searchQuery]=u,y(u)}catch(n){if(n.name==="AbortError")return;f("Failed to fetch search results. Please try again.")}finally{h(!1)}},[U,_]),F=t.useCallback(e=>{const r=o.current[e.searchQuery];v({eventName:"search_query_response_received",properties:{searchQuery:e.searchQuery,totalResults:r?.length}})},[]),L=()=>{m.current&&(m.current.abort(),h(!1))},N=t.useCallback(e=>{if(p.current&&window.clearTimeout(p.current),!e.searchQuery){L(),y([]),f(null);return}p.current=window.setTimeout(()=>{L(),v({eventName:"search_query_submitted",properties:{searchQuery:e.searchQuery}}),o.current[e.searchQuery]?(y(o.current[e.searchQuery]),F(e)):(h(!0),j(e).then(()=>{F(e)}))},T)},[T,j]),S=t.useMemo(()=>({searchQuery:a,filters:{...Q,...k,limit:q}}),[a,q,Q,k]);t.useEffect(()=>{$?.(S.searchQuery),N(S)},[N,S]);const V=t.useCallback(e=>E(e.target.value),[]),X=t.useMemo(()=>C||(g?"Search...":"Search for anything..."),[C,g]);return{results:s,resultsList:d,hasContent:d.length>0||w,loading:w,error:D,query:a,onInput:V,placeholder:X,tab:b,onTabChange:J,selectedItem:K,setSelectedItem:c,onSelectedItemChange:W,transitionsDisabled:G,inputRef:M,isMobile:g}};exports.useInkeepSearch=ae;
@@ -1,25 +1,25 @@
1
1
  "use client";
2
- import { useState as s, useRef as l, useCallback as n, useEffect as H, useImperativeHandle as te, useMemo as T } from "react";
3
- import { useInkeepConfig as re } from "../../providers/config-provider.js";
4
- import { useMediaQuery as se } from "../../hooks/use-media-query.js";
5
- import ne from "./search-query.graphql.js";
6
- import { useTransformResults as oe } from "./transform-results.js";
7
- import { useSearchEvents as ce } from "../../providers/search-events-provider.js";
8
- import { useInstantUpdate as ae } from "../../hooks/use-instant-update.js";
9
- import { graphqlRequest as ie } from "../../utils/graphql-client.js";
10
- const be = () => {
11
- const { baseSettings: P, searchSettings: $ } = re(), { apiKey: S, aiApiBaseUrl: z, userAuthToken: h, filters: C } = P, {
12
- maxResults: v,
13
- placeholder: k,
14
- defaultQuery: D,
15
- debounceTimeMs: w,
16
- onQueryChange: K,
17
- searchFunctionsRef: W,
2
+ import { useState as s, useRef as u, useCallback as n, useEffect as P, useImperativeHandle as re, useMemo as S } from "react";
3
+ import { useInkeepConfig as se } from "../../providers/config-provider.js";
4
+ import { useMediaQuery as ne } from "../../hooks/use-media-query.js";
5
+ import oe from "./search-query.graphql.js";
6
+ import { useTransformResults as ce } from "./transform-results.js";
7
+ import { useSearchEvents as ae } from "../../providers/search-events-provider.js";
8
+ import { useInstantUpdate as ie } from "../../hooks/use-instant-update.js";
9
+ import { graphqlRequest as le } from "../../utils/graphql-client.js";
10
+ const ge = () => {
11
+ const { baseSettings: $, searchSettings: z } = se(), { apiKey: C, aiApiBaseUrl: D, userAuthToken: h, filters: v } = $, {
12
+ maxResults: k,
13
+ placeholder: w,
14
+ defaultQuery: K,
15
+ debounceTimeMs: q,
16
+ onQueryChange: W,
17
+ searchFunctionsRef: G,
18
18
  tabs: f,
19
- filters: q
20
- } = $, { logEvent: E } = ce(), [c, A] = s(D), I = l(null), [_, x] = s(!1), [G, m] = s(null), [J, a] = s("NONE"), V = n((e) => {
19
+ filters: E
20
+ } = z, { logEvent: A } = ae(), [c, I] = s(K), _ = u(null), [x, m] = s(!1), [J, d] = s(null), [V, a] = s("NONE"), X = n((e) => {
21
21
  a(e);
22
- }, []), [d, p] = s([]), t = oe(d, c), F = typeof f?.[0] == "string" ? f[0] : f[0][0], [y, L] = s(F), { disableTransition: M, disabled: X } = ae(), Y = n(
22
+ }, []), [y, p] = s([]), t = ce(y, c), F = typeof f?.[0] == "string" ? f[0] : f[0][0], [b, L] = s(F), { disableTransition: M, disabled: Y } = ie(), Z = n(
23
23
  (e) => {
24
24
  M(), L(e);
25
25
  const r = t[e][0].id;
@@ -27,10 +27,10 @@ const be = () => {
27
27
  },
28
28
  [t, M]
29
29
  );
30
- H(() => {
31
- let e = y in t ? y : Object.keys(t)[0];
30
+ P(() => {
31
+ let e = b in t ? b : Object.keys(t)[0];
32
32
  if (!t[e]?.length) {
33
- const o = Object.keys(t).find((u) => t[u]?.length);
33
+ const o = Object.keys(t).find((l) => t[l]?.length);
34
34
  o ? e = o : e = F;
35
35
  }
36
36
  if (!e) return;
@@ -38,106 +38,114 @@ const be = () => {
38
38
  const r = t[e]?.[0];
39
39
  r && a(r.id);
40
40
  }, [t]);
41
- const b = se("(max-width: 768px)"), i = l({}), g = l(null), Q = l(null);
42
- te(W, () => ({
41
+ const g = ne("(max-width: 768px)"), i = u({}), Q = u(null), R = u(null);
42
+ re(G, () => ({
43
43
  updateQuery(e) {
44
- A(e);
44
+ I(e);
45
45
  },
46
46
  focusInput: () => {
47
- I.current?.focus();
47
+ _.current?.focus();
48
48
  }
49
49
  }));
50
- const N = `${z}/graphql`, U = T(
50
+ const N = `${D}/graphql`, U = S(
51
51
  () => ({
52
- Authorization: `Bearer ${S}`,
52
+ Authorization: `Bearer ${C}`,
53
53
  "Content-Type": "application/json",
54
54
  ...h ? { "User-Token": h } : {}
55
55
  }),
56
- [S, h]
56
+ [C, h]
57
57
  ), j = n(
58
58
  async (e) => {
59
- g.current && g.current.abort();
60
59
  const r = new AbortController();
61
- g.current = r;
60
+ Q.current = r;
62
61
  try {
63
- x(!0), m(null);
64
- const u = (await ie(N, ne, { searchInput: e }, U))?.search.searchHits;
65
- i.current[e.searchQuery] = u, p(u);
62
+ d(null);
63
+ const l = (await le(
64
+ N,
65
+ oe,
66
+ { searchInput: e },
67
+ U,
68
+ r.signal
69
+ ))?.search.searchHits;
70
+ i.current[e.searchQuery] = l, p(l);
66
71
  } catch (o) {
67
72
  if (o.name === "AbortError")
68
73
  return;
69
- m("Failed to fetch search results. Please try again.");
74
+ d("Failed to fetch search results. Please try again.");
75
+ } finally {
76
+ m(!1);
70
77
  }
71
- x(!1);
72
78
  },
73
79
  [N, U]
74
80
  ), O = n((e) => {
75
81
  const r = i.current[e.searchQuery];
76
- E({
82
+ A({
77
83
  eventName: "search_query_response_received",
78
84
  properties: {
79
85
  searchQuery: e.searchQuery,
80
86
  totalResults: r?.length
81
87
  }
82
88
  });
83
- }, []), B = n(
89
+ }, []), B = () => {
90
+ Q.current && (Q.current.abort(), m(!1));
91
+ }, H = n(
84
92
  (e) => {
85
- if (Q.current && window.clearTimeout(Q.current), !e.searchQuery) {
86
- p([]), m(null);
93
+ if (R.current && window.clearTimeout(R.current), !e.searchQuery) {
94
+ B(), p([]), d(null);
87
95
  return;
88
96
  }
89
- Q.current = window.setTimeout(() => {
90
- E({
97
+ R.current = window.setTimeout(() => {
98
+ B(), A({
91
99
  eventName: "search_query_submitted",
92
100
  properties: {
93
101
  searchQuery: e.searchQuery
94
102
  }
95
- }), i.current[e.searchQuery] ? (p(i.current[e.searchQuery]), O(e)) : j(e).then(() => {
103
+ }), i.current[e.searchQuery] ? (p(i.current[e.searchQuery]), O(e)) : (m(!0), j(e).then(() => {
96
104
  O(e);
97
- });
98
- }, w);
105
+ }));
106
+ }, q);
99
107
  },
100
- [w, j]
101
- ), R = T(
108
+ [q, j]
109
+ ), T = S(
102
110
  () => ({
103
111
  searchQuery: c,
104
112
  filters: {
105
- ...C,
106
- ...q,
107
- limit: v
113
+ ...v,
114
+ ...E,
115
+ limit: k
108
116
  }
109
117
  }),
110
- [c, v, C, q]
118
+ [c, k, v, E]
111
119
  );
112
- H(() => {
113
- K?.(R.searchQuery), B(R);
114
- }, [B, R]);
115
- const Z = n(
116
- (e) => A(e.target.value),
120
+ P(() => {
121
+ W?.(T.searchQuery), H(T);
122
+ }, [H, T]);
123
+ const ee = n(
124
+ (e) => I(e.target.value),
117
125
  []
118
- ), ee = T(
119
- () => k || (b ? "Search..." : "Search for anything..."),
120
- [k, b]
126
+ ), te = S(
127
+ () => w || (g ? "Search..." : "Search for anything..."),
128
+ [w, g]
121
129
  );
122
130
  return {
123
131
  results: t,
124
- resultsList: d,
125
- hasContent: d.length > 0 || _,
126
- loading: _,
127
- error: G,
132
+ resultsList: y,
133
+ hasContent: y.length > 0 || x,
134
+ loading: x,
135
+ error: J,
128
136
  query: c,
129
- onInput: Z,
130
- placeholder: ee,
131
- tab: y,
132
- onTabChange: Y,
133
- selectedItem: J,
137
+ onInput: ee,
138
+ placeholder: te,
139
+ tab: b,
140
+ onTabChange: Z,
141
+ selectedItem: V,
134
142
  setSelectedItem: a,
135
- onSelectedItemChange: V,
136
- transitionsDisabled: X,
137
- inputRef: I,
138
- isMobile: b
143
+ onSelectedItemChange: X,
144
+ transitionsDisabled: Y,
145
+ inputRef: _,
146
+ isMobile: g
139
147
  };
140
148
  };
141
149
  export {
142
- be as useInkeepSearch
150
+ ge as useInkeepSearch
143
151
  };
package/dist/index.d.cts CHANGED
@@ -98,11 +98,11 @@ export declare const aiChatComponentIds: {
98
98
  aiChatDisclaimerContent: "aiChatDisclaimerContent";
99
99
  aiChatDisclaimerText: "aiChatDisclaimerText";
100
100
  aiChatDisclaimerArrow: "aiChatDisclaimerArrow";
101
- aiChatQuickQuestions: "aiChatQuickQuestions";
102
- aiChatQuickQuestionsLabel: "aiChatQuickQuestionsLabel";
103
- aiChatQuickQuestionsList: "aiChatQuickQuestionsList";
104
- aiChatQuickQuestion: "aiChatQuickQuestion";
105
- aiChatQuickQuestionButton: "aiChatQuickQuestionButton";
101
+ aiChatExampleQuestions: "aiChatExampleQuestions";
102
+ aiChatExampleQuestionsLabel: "aiChatExampleQuestionsLabel";
103
+ aiChatExampleQuestionsList: "aiChatExampleQuestionsList";
104
+ aiChatExampleQuestion: "aiChatExampleQuestion";
105
+ aiChatExampleQuestionButton: "aiChatExampleQuestionButton";
106
106
  aiChatWorkflows: "aiChatWorkflows";
107
107
  aiChatWorkflowsLabel: "aiChatWorkflowsLabel";
108
108
  aiChatWorkflowsList: "aiChatWorkflowsList";
@@ -564,11 +564,11 @@ export declare const componentIDs: {
564
564
  aiChatDisclaimerContent: "aiChatDisclaimerContent";
565
565
  aiChatDisclaimerText: "aiChatDisclaimerText";
566
566
  aiChatDisclaimerArrow: "aiChatDisclaimerArrow";
567
- aiChatQuickQuestions: "aiChatQuickQuestions";
568
- aiChatQuickQuestionsLabel: "aiChatQuickQuestionsLabel";
569
- aiChatQuickQuestionsList: "aiChatQuickQuestionsList";
570
- aiChatQuickQuestion: "aiChatQuickQuestion";
571
- aiChatQuickQuestionButton: "aiChatQuickQuestionButton";
567
+ aiChatExampleQuestions: "aiChatExampleQuestions";
568
+ aiChatExampleQuestionsLabel: "aiChatExampleQuestionsLabel";
569
+ aiChatExampleQuestionsList: "aiChatExampleQuestionsList";
570
+ aiChatExampleQuestion: "aiChatExampleQuestion";
571
+ aiChatExampleQuestionButton: "aiChatExampleQuestionButton";
572
572
  aiChatWorkflows: "aiChatWorkflows";
573
573
  aiChatWorkflowsLabel: "aiChatWorkflowsLabel";
574
574
  aiChatWorkflowsList: "aiChatWorkflowsList";
@@ -1015,7 +1015,6 @@ declare const defaultInkeepSearchSettings: {
1015
1015
  defaultQuery: string;
1016
1016
  debounceTimeMs: number;
1017
1017
  tabs: string[];
1018
- searchQueryParamKey: string;
1019
1018
  placeholder: string;
1020
1019
  };
1021
1020
 
@@ -1175,13 +1174,13 @@ export declare namespace EmbeddedChatPrimitive {
1175
1174
  EmbeddedChatPrimitiveDisclaimerContent,
1176
1175
  EmbeddedChatPrimitiveDisclaimerText,
1177
1176
  EmbeddedChatPrimitiveDisclaimerArrow,
1178
- EmbeddedChatPrimitiveQuickQuestions,
1179
- EmbeddedChatPrimitiveQuickQuestionsLabel,
1180
- EmbeddedChatPrimitiveQuickQuestionsListProps,
1181
- EmbeddedChatPrimitiveQuickQuestionsList,
1182
- EmbeddedChatPrimitiveQuickQuestion,
1183
- EmbeddedChatPrimitiveQuickQuestionButtonProps,
1184
- EmbeddedChatPrimitiveQuickQuestionButton,
1177
+ EmbeddedChatPrimitiveExampleQuestions,
1178
+ EmbeddedChatPrimitiveExampleQuestionsLabel,
1179
+ EmbeddedChatPrimitiveExampleQuestionsListProps,
1180
+ EmbeddedChatPrimitiveExampleQuestionsList,
1181
+ EmbeddedChatPrimitiveExampleQuestion,
1182
+ EmbeddedChatPrimitiveExampleQuestionButtonProps,
1183
+ EmbeddedChatPrimitiveExampleQuestionButton,
1185
1184
  EmbeddedChatPrimitiveWorkflows,
1186
1185
  EmbeddedChatPrimitiveWorkflowsLabel,
1187
1186
  EmbeddedChatPrimitiveWorkflowsListProps,
@@ -1377,11 +1376,11 @@ export declare namespace EmbeddedChatPrimitive {
1377
1376
  EmbeddedChatPrimitiveDisclaimerContent as DisclaimerContent,
1378
1377
  EmbeddedChatPrimitiveDisclaimerText as DisclaimerText,
1379
1378
  EmbeddedChatPrimitiveDisclaimerArrow as DisclaimerArrow,
1380
- EmbeddedChatPrimitiveQuickQuestions as QuickQuestions,
1381
- EmbeddedChatPrimitiveQuickQuestionsLabel as QuickQuestionsLabel,
1382
- EmbeddedChatPrimitiveQuickQuestionsList as QuickQuestionsList,
1383
- EmbeddedChatPrimitiveQuickQuestion as QuickQuestion,
1384
- EmbeddedChatPrimitiveQuickQuestionButton as QuickQuestionButton,
1379
+ EmbeddedChatPrimitiveExampleQuestions as ExampleQuestions,
1380
+ EmbeddedChatPrimitiveExampleQuestionsLabel as ExampleQuestionsLabel,
1381
+ EmbeddedChatPrimitiveExampleQuestionsList as ExampleQuestionsList,
1382
+ EmbeddedChatPrimitiveExampleQuestion as ExampleQuestion,
1383
+ EmbeddedChatPrimitiveExampleQuestionButton as ExampleQuestionButton,
1385
1384
  EmbeddedChatPrimitiveWorkflows as Workflows,
1386
1385
  EmbeddedChatPrimitiveWorkflowsLabel as WorkflowsLabel,
1387
1386
  EmbeddedChatPrimitiveWorkflowsList as WorkflowsList,
@@ -1666,6 +1665,24 @@ declare const EmbeddedChatPrimitiveDisclaimerText: MemoExoticComponent<(props: O
1666
1665
 
1667
1666
  declare const EmbeddedChatPrimitiveDisclaimerTrigger: ForwardRefExoticComponent< PolymorphicProps & Omit<HoverCardPrimitive.HoverCardTriggerProps & RefAttributes<HTMLAnchorElement>, "children" | "_id"> & Partial<Pick<HoverCardPrimitive.HoverCardTriggerProps & RefAttributes<HTMLAnchorElement>, "children" | "_id">>>;
1668
1667
 
1668
+ declare const EmbeddedChatPrimitiveExampleQuestion: ForwardRefExoticComponent<Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
1669
+
1670
+ declare const EmbeddedChatPrimitiveExampleQuestionButton: (props: EmbeddedChatPrimitiveExampleQuestionButtonProps) => JSX.Element;
1671
+
1672
+ declare interface EmbeddedChatPrimitiveExampleQuestionButtonProps extends ComponentPropsWithRef<'button'> {
1673
+ question: string;
1674
+ }
1675
+
1676
+ declare const EmbeddedChatPrimitiveExampleQuestions: (props: ComponentPropsWithRef<"div">) => JSX.Element | null;
1677
+
1678
+ declare const EmbeddedChatPrimitiveExampleQuestionsLabel: MemoExoticComponent<(props: ComponentPropsWithRef<"h3">) => JSX.Element>;
1679
+
1680
+ declare const EmbeddedChatPrimitiveExampleQuestionsList: MemoExoticComponent<(props: EmbeddedChatPrimitiveExampleQuestionsListProps) => JSX.Element>;
1681
+
1682
+ declare interface EmbeddedChatPrimitiveExampleQuestionsListProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
1683
+ children: React.ReactNode | ((questions: string[]) => React.ReactNode);
1684
+ }
1685
+
1669
1686
  declare const EmbeddedChatPrimitiveFeedbackForm: (props: ComponentPropsWithRef<typeof PrimitiveFeedbackForm>) => JSX.Element;
1670
1687
 
1671
1688
  declare const EmbeddedChatPrimitiveFeedbackItem: (props: EmbeddedChatPrimitiveFeedbackItemProps) => JSX.Element;
@@ -1942,24 +1959,6 @@ declare interface EmbeddedChatPrimitiveMessageWrapperProps extends ComponentProp
1942
1959
  message: Partial<Message>;
1943
1960
  }
1944
1961
 
1945
- declare const EmbeddedChatPrimitiveQuickQuestion: ForwardRefExoticComponent<Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
1946
-
1947
- declare const EmbeddedChatPrimitiveQuickQuestionButton: (props: EmbeddedChatPrimitiveQuickQuestionButtonProps) => JSX.Element;
1948
-
1949
- declare interface EmbeddedChatPrimitiveQuickQuestionButtonProps extends ComponentPropsWithRef<'button'> {
1950
- question: string;
1951
- }
1952
-
1953
- declare const EmbeddedChatPrimitiveQuickQuestions: (props: ComponentPropsWithRef<"div">) => JSX.Element | null;
1954
-
1955
- declare const EmbeddedChatPrimitiveQuickQuestionsLabel: MemoExoticComponent<(props: ComponentPropsWithRef<"h3">) => JSX.Element>;
1956
-
1957
- declare const EmbeddedChatPrimitiveQuickQuestionsList: MemoExoticComponent<(props: EmbeddedChatPrimitiveQuickQuestionsListProps) => JSX.Element>;
1958
-
1959
- declare interface EmbeddedChatPrimitiveQuickQuestionsListProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
1960
- children: React.ReactNode | ((questions: string[]) => React.ReactNode);
1961
- }
1962
-
1963
1962
  declare const EmbeddedChatPrimitiveRoot: (props: ComponentPropsWithRef<typeof PrimitiveRoot>) => JSX.Element | null;
1964
1963
 
1965
1964
  declare const EmbeddedChatPrimitiveSendButton: (props: ComponentPropsWithRef<typeof SendButton>) => JSX.Element;
package/dist/index.d.ts CHANGED
@@ -98,11 +98,11 @@ export declare const aiChatComponentIds: {
98
98
  aiChatDisclaimerContent: "aiChatDisclaimerContent";
99
99
  aiChatDisclaimerText: "aiChatDisclaimerText";
100
100
  aiChatDisclaimerArrow: "aiChatDisclaimerArrow";
101
- aiChatQuickQuestions: "aiChatQuickQuestions";
102
- aiChatQuickQuestionsLabel: "aiChatQuickQuestionsLabel";
103
- aiChatQuickQuestionsList: "aiChatQuickQuestionsList";
104
- aiChatQuickQuestion: "aiChatQuickQuestion";
105
- aiChatQuickQuestionButton: "aiChatQuickQuestionButton";
101
+ aiChatExampleQuestions: "aiChatExampleQuestions";
102
+ aiChatExampleQuestionsLabel: "aiChatExampleQuestionsLabel";
103
+ aiChatExampleQuestionsList: "aiChatExampleQuestionsList";
104
+ aiChatExampleQuestion: "aiChatExampleQuestion";
105
+ aiChatExampleQuestionButton: "aiChatExampleQuestionButton";
106
106
  aiChatWorkflows: "aiChatWorkflows";
107
107
  aiChatWorkflowsLabel: "aiChatWorkflowsLabel";
108
108
  aiChatWorkflowsList: "aiChatWorkflowsList";
@@ -564,11 +564,11 @@ export declare const componentIDs: {
564
564
  aiChatDisclaimerContent: "aiChatDisclaimerContent";
565
565
  aiChatDisclaimerText: "aiChatDisclaimerText";
566
566
  aiChatDisclaimerArrow: "aiChatDisclaimerArrow";
567
- aiChatQuickQuestions: "aiChatQuickQuestions";
568
- aiChatQuickQuestionsLabel: "aiChatQuickQuestionsLabel";
569
- aiChatQuickQuestionsList: "aiChatQuickQuestionsList";
570
- aiChatQuickQuestion: "aiChatQuickQuestion";
571
- aiChatQuickQuestionButton: "aiChatQuickQuestionButton";
567
+ aiChatExampleQuestions: "aiChatExampleQuestions";
568
+ aiChatExampleQuestionsLabel: "aiChatExampleQuestionsLabel";
569
+ aiChatExampleQuestionsList: "aiChatExampleQuestionsList";
570
+ aiChatExampleQuestion: "aiChatExampleQuestion";
571
+ aiChatExampleQuestionButton: "aiChatExampleQuestionButton";
572
572
  aiChatWorkflows: "aiChatWorkflows";
573
573
  aiChatWorkflowsLabel: "aiChatWorkflowsLabel";
574
574
  aiChatWorkflowsList: "aiChatWorkflowsList";
@@ -1015,7 +1015,6 @@ declare const defaultInkeepSearchSettings: {
1015
1015
  defaultQuery: string;
1016
1016
  debounceTimeMs: number;
1017
1017
  tabs: string[];
1018
- searchQueryParamKey: string;
1019
1018
  placeholder: string;
1020
1019
  };
1021
1020
 
@@ -1175,13 +1174,13 @@ export declare namespace EmbeddedChatPrimitive {
1175
1174
  EmbeddedChatPrimitiveDisclaimerContent,
1176
1175
  EmbeddedChatPrimitiveDisclaimerText,
1177
1176
  EmbeddedChatPrimitiveDisclaimerArrow,
1178
- EmbeddedChatPrimitiveQuickQuestions,
1179
- EmbeddedChatPrimitiveQuickQuestionsLabel,
1180
- EmbeddedChatPrimitiveQuickQuestionsListProps,
1181
- EmbeddedChatPrimitiveQuickQuestionsList,
1182
- EmbeddedChatPrimitiveQuickQuestion,
1183
- EmbeddedChatPrimitiveQuickQuestionButtonProps,
1184
- EmbeddedChatPrimitiveQuickQuestionButton,
1177
+ EmbeddedChatPrimitiveExampleQuestions,
1178
+ EmbeddedChatPrimitiveExampleQuestionsLabel,
1179
+ EmbeddedChatPrimitiveExampleQuestionsListProps,
1180
+ EmbeddedChatPrimitiveExampleQuestionsList,
1181
+ EmbeddedChatPrimitiveExampleQuestion,
1182
+ EmbeddedChatPrimitiveExampleQuestionButtonProps,
1183
+ EmbeddedChatPrimitiveExampleQuestionButton,
1185
1184
  EmbeddedChatPrimitiveWorkflows,
1186
1185
  EmbeddedChatPrimitiveWorkflowsLabel,
1187
1186
  EmbeddedChatPrimitiveWorkflowsListProps,
@@ -1377,11 +1376,11 @@ export declare namespace EmbeddedChatPrimitive {
1377
1376
  EmbeddedChatPrimitiveDisclaimerContent as DisclaimerContent,
1378
1377
  EmbeddedChatPrimitiveDisclaimerText as DisclaimerText,
1379
1378
  EmbeddedChatPrimitiveDisclaimerArrow as DisclaimerArrow,
1380
- EmbeddedChatPrimitiveQuickQuestions as QuickQuestions,
1381
- EmbeddedChatPrimitiveQuickQuestionsLabel as QuickQuestionsLabel,
1382
- EmbeddedChatPrimitiveQuickQuestionsList as QuickQuestionsList,
1383
- EmbeddedChatPrimitiveQuickQuestion as QuickQuestion,
1384
- EmbeddedChatPrimitiveQuickQuestionButton as QuickQuestionButton,
1379
+ EmbeddedChatPrimitiveExampleQuestions as ExampleQuestions,
1380
+ EmbeddedChatPrimitiveExampleQuestionsLabel as ExampleQuestionsLabel,
1381
+ EmbeddedChatPrimitiveExampleQuestionsList as ExampleQuestionsList,
1382
+ EmbeddedChatPrimitiveExampleQuestion as ExampleQuestion,
1383
+ EmbeddedChatPrimitiveExampleQuestionButton as ExampleQuestionButton,
1385
1384
  EmbeddedChatPrimitiveWorkflows as Workflows,
1386
1385
  EmbeddedChatPrimitiveWorkflowsLabel as WorkflowsLabel,
1387
1386
  EmbeddedChatPrimitiveWorkflowsList as WorkflowsList,
@@ -1666,6 +1665,24 @@ declare const EmbeddedChatPrimitiveDisclaimerText: MemoExoticComponent<(props: O
1666
1665
 
1667
1666
  declare const EmbeddedChatPrimitiveDisclaimerTrigger: ForwardRefExoticComponent< PolymorphicProps & Omit<HoverCardPrimitive.HoverCardTriggerProps & RefAttributes<HTMLAnchorElement>, "children" | "_id"> & Partial<Pick<HoverCardPrimitive.HoverCardTriggerProps & RefAttributes<HTMLAnchorElement>, "children" | "_id">>>;
1668
1667
 
1668
+ declare const EmbeddedChatPrimitiveExampleQuestion: ForwardRefExoticComponent<Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
1669
+
1670
+ declare const EmbeddedChatPrimitiveExampleQuestionButton: (props: EmbeddedChatPrimitiveExampleQuestionButtonProps) => JSX.Element;
1671
+
1672
+ declare interface EmbeddedChatPrimitiveExampleQuestionButtonProps extends ComponentPropsWithRef<'button'> {
1673
+ question: string;
1674
+ }
1675
+
1676
+ declare const EmbeddedChatPrimitiveExampleQuestions: (props: ComponentPropsWithRef<"div">) => JSX.Element | null;
1677
+
1678
+ declare const EmbeddedChatPrimitiveExampleQuestionsLabel: MemoExoticComponent<(props: ComponentPropsWithRef<"h3">) => JSX.Element>;
1679
+
1680
+ declare const EmbeddedChatPrimitiveExampleQuestionsList: MemoExoticComponent<(props: EmbeddedChatPrimitiveExampleQuestionsListProps) => JSX.Element>;
1681
+
1682
+ declare interface EmbeddedChatPrimitiveExampleQuestionsListProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
1683
+ children: React.ReactNode | ((questions: string[]) => React.ReactNode);
1684
+ }
1685
+
1669
1686
  declare const EmbeddedChatPrimitiveFeedbackForm: (props: ComponentPropsWithRef<typeof PrimitiveFeedbackForm>) => JSX.Element;
1670
1687
 
1671
1688
  declare const EmbeddedChatPrimitiveFeedbackItem: (props: EmbeddedChatPrimitiveFeedbackItemProps) => JSX.Element;
@@ -1942,24 +1959,6 @@ declare interface EmbeddedChatPrimitiveMessageWrapperProps extends ComponentProp
1942
1959
  message: Partial<Message>;
1943
1960
  }
1944
1961
 
1945
- declare const EmbeddedChatPrimitiveQuickQuestion: ForwardRefExoticComponent<Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
1946
-
1947
- declare const EmbeddedChatPrimitiveQuickQuestionButton: (props: EmbeddedChatPrimitiveQuickQuestionButtonProps) => JSX.Element;
1948
-
1949
- declare interface EmbeddedChatPrimitiveQuickQuestionButtonProps extends ComponentPropsWithRef<'button'> {
1950
- question: string;
1951
- }
1952
-
1953
- declare const EmbeddedChatPrimitiveQuickQuestions: (props: ComponentPropsWithRef<"div">) => JSX.Element | null;
1954
-
1955
- declare const EmbeddedChatPrimitiveQuickQuestionsLabel: MemoExoticComponent<(props: ComponentPropsWithRef<"h3">) => JSX.Element>;
1956
-
1957
- declare const EmbeddedChatPrimitiveQuickQuestionsList: MemoExoticComponent<(props: EmbeddedChatPrimitiveQuickQuestionsListProps) => JSX.Element>;
1958
-
1959
- declare interface EmbeddedChatPrimitiveQuickQuestionsListProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
1960
- children: React.ReactNode | ((questions: string[]) => React.ReactNode);
1961
- }
1962
-
1963
1962
  declare const EmbeddedChatPrimitiveRoot: (props: ComponentPropsWithRef<typeof PrimitiveRoot>) => JSX.Element | null;
1964
1963
 
1965
1964
  declare const EmbeddedChatPrimitiveSendButton: (props: ComponentPropsWithRef<typeof SendButton>) => JSX.Element;
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react/jsx-runtime"),t=require("react"),y=require("../atoms/api/analytics/events.cjs"),B=require("./config-provider.cjs"),b=require("./user-provider.cjs"),p=t.createContext(void 0),f=({children:e})=>{const{baseSettings:s,componentType:n}=B.useInkeepConfig(),{apiKey:o,analyticsApiBaseUrl:r,tags:i,privacyPreferences:d,env:E}=s,{userProperties:c}=b.useUser(),a=t.useMemo(()=>({widgetLibraryVersion:"0.5.25",componentType:n,tags:i}),[n,i]),u=!d.optOutAllAnalytics&&E!=="development",g={logEvent:t.useCallback(async v=>{const m={...a,...v.properties},l={eventName:v.eventName,properties:m,userProperties:c};u&&y.logEvent(l,o,r),s.onEvent?.(l)},[u,s,o,r,c,a])};return P.jsx(p.Provider,{value:g,children:e})},x=()=>{const e=t.useContext(p);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=f;exports.useBaseEvents=x;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react/jsx-runtime"),t=require("react"),y=require("../atoms/api/analytics/events.cjs"),B=require("./config-provider.cjs"),b=require("./user-provider.cjs"),p=t.createContext(void 0),f=({children:e})=>{const{baseSettings:s,componentType:n}=B.useInkeepConfig(),{apiKey:o,analyticsApiBaseUrl:r,tags:i,privacyPreferences:d,env:E}=s,{userProperties:c}=b.useUser(),a=t.useMemo(()=>({widgetLibraryVersion:"0.5.29",componentType:n,tags:i}),[n,i]),u=!d.optOutAllAnalytics&&E!=="development",g={logEvent:t.useCallback(async v=>{const m={...a,...v.properties},l={eventName:v.eventName,properties:m,userProperties:c};u&&y.logEvent(l,o,r),s.onEvent?.(l)},[u,s,o,r,c,a])};return P.jsx(p.Provider,{value:g,children:e})},x=()=>{const e=t.useContext(p);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=f;exports.useBaseEvents=x;
@@ -7,7 +7,7 @@ import { useUser as b } from "./user-provider.js";
7
7
  const m = x(void 0), U = ({ children: e }) => {
8
8
  const { baseSettings: t, componentType: o } = C(), { apiKey: n, analyticsApiBaseUrl: s, tags: r, privacyPreferences: u, env: l } = t, { userProperties: i } = b(), a = d(
9
9
  () => ({
10
- widgetLibraryVersion: "0.5.25",
10
+ widgetLibraryVersion: "0.5.29",
11
11
  componentType: o,
12
12
  tags: r
13
13
  }),