@inkeep/cxkit-primitives 0.5.95 → 0.5.96

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,87 +1,90 @@
1
1
  "use client";
2
- import { jsx as j } from "react/jsx-runtime";
3
- import { useRef as b, useEffect as P, useCallback as w, createContext as B, useContext as O } from "react";
4
- import { logConversation as K } from "../atoms/api/analytics/conversation.js";
5
- import { useInkeepConfig as L } from "./config-provider.js";
6
- import { useInkeepConversation as R } from "./conversation-provider.js";
7
- import { useUser as V } from "./user-provider.js";
8
- import { useBaseEvents as _ } from "./base-events-provider.js";
9
- import { generateUid as $ } from "../utils/generate-uid.js";
10
- const I = B(void 0), Q = ({ children: r }) => {
11
- const { baseSettings: k, aiChatSettings: A } = L(), {
12
- apiKey: d,
2
+ import { jsx as B } from "react/jsx-runtime";
3
+ import { useRef as b, useEffect as P, useCallback as w, createContext as O, useContext as K } from "react";
4
+ import { logConversation as M } from "../atoms/api/analytics/conversation.js";
5
+ import { useInkeepConfig as R } from "./config-provider.js";
6
+ import { useInkeepConversation as V } from "./conversation-provider.js";
7
+ import { useUser as _ } from "./user-provider.js";
8
+ import { useBaseEvents as $ } from "./base-events-provider.js";
9
+ import { generateUid as q } from "../utils/generate-uid.js";
10
+ const I = O(void 0), X = ({ children: i }) => {
11
+ const { baseSettings: k, aiChatSettings: A } = R(), {
12
+ apiKey: h,
13
13
  analyticsApiBaseUrl: f,
14
- tags: h,
15
- privacyPreferences: { optOutAllAnalytics: i },
16
- env: a,
17
- analyticsProperties: c
18
- } = k, { conversationVisibility: m } = A, { userProperties: E } = V(), { logEvent: g } = _(), { conversation: v, setConversation: S, chatId: u, isSharedChat: l, setExternalChatId: y } = R(), s = b(v), p = b(l ? u : void 0);
14
+ tags: m,
15
+ privacyPreferences: { optOutAllAnalytics: a },
16
+ env: c,
17
+ analyticsProperties: v
18
+ } = k, { conversationVisibility: g } = A, { userProperties: E } = _(), { logEvent: y } = $(), { conversation: u, setConversation: L, chatId: l, isSharedChat: d, setExternalChatId: x } = V(), n = b(u), p = b(d ? l : void 0);
19
19
  P(() => {
20
- s.current = v;
21
- }, [v]), P(() => {
22
- p.current = l ? u : void 0;
23
- }, [u, l]);
20
+ n.current = u;
21
+ }, [u]), P(() => {
22
+ p.current = d ? l : void 0;
23
+ }, [l, d]);
24
24
  const C = w(
25
- async (n) => {
26
- const t = s.current;
27
- p.current && (t.id = "", y(void 0), p.current = void 0);
28
- const e = !i && a !== "development";
29
- let o = Object.assign({}, t, { messages: n });
25
+ async (o) => {
26
+ const t = n.current;
27
+ p.current && (t.id = "", x(void 0), p.current = void 0);
28
+ const e = !a && c !== "development";
29
+ let r = Object.assign({}, t, { messages: o });
30
30
  if (e) {
31
- const x = await K(
31
+ const s = await M(
32
32
  t.id,
33
33
  {
34
- messages: n,
35
- tags: h,
34
+ messages: o,
35
+ tags: m,
36
36
  userProperties: E,
37
- properties: c,
38
- visibility: m
37
+ properties: v,
38
+ visibility: g
39
39
  },
40
- d,
40
+ h,
41
41
  f
42
42
  );
43
- x && (o = x);
43
+ s && (r = s);
44
44
  } else
45
- o.id = "conv_" + $(16);
46
- return o;
45
+ r.id = "conv_" + q(16);
46
+ return r;
47
47
  },
48
48
  [
49
49
  f,
50
- d,
51
50
  h,
51
+ m,
52
52
  E,
53
- i,
54
53
  a,
55
54
  c,
56
- y,
57
- m
55
+ v,
56
+ x,
57
+ g
58
58
  ]
59
- ), U = {
59
+ ), S = {
60
60
  logEvent: w(
61
- async (n, t) => {
62
- let e = s.current;
63
- t && (e = await C(t), S(e), s.current = e);
64
- const o = {
65
- ...n,
61
+ async (o, t) => {
62
+ let e = n.current;
63
+ if (t) {
64
+ const s = n.current.messages || [];
65
+ (t.length !== s.length || t.some((U, j) => U.id !== s[j]?.id)) && (e = await C(t), L(e), n.current = e);
66
+ }
67
+ const r = {
68
+ ...o,
66
69
  properties: {
67
70
  conversation: e,
68
- ...n.properties
71
+ ...o.properties
69
72
  }
70
73
  };
71
- g(o);
74
+ y(r);
72
75
  },
73
- [g, C, i, a, c]
76
+ [y, C, a, c, v]
74
77
  ),
75
78
  logConversation: C
76
79
  };
77
- return /* @__PURE__ */ j(I.Provider, { value: U, children: r });
78
- }, T = () => {
79
- const r = O(I);
80
- if (!r)
80
+ return /* @__PURE__ */ B(I.Provider, { value: S, children: i });
81
+ }, Y = () => {
82
+ const i = K(I);
83
+ if (!i)
81
84
  throw new Error("useChatEvents must be used within a ChatEventsProvider");
82
- return r;
85
+ return i;
83
86
  };
84
87
  export {
85
- Q as ChatEventsProvider,
86
- T as useChatEvents
88
+ X as ChatEventsProvider,
89
+ Y as useChatEvents
87
90
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),s=require("react"),w=require("react-hook-form"),x=require("./conversation-provider.cjs"),P=require("../components/modal/modal-provider.cjs"),M=require("../utils/form.cjs"),H="root.serverError",h=s.createContext(void 0);function S(){const[t,n]=s.useState(null),[v,u]=s.useState(!1),{conversation:i}=x.useInkeepConversation(),F=P.useModal(),C=e=>{n(e)},a=()=>{n(null),u(!1),t?.buttons.close?.action==="close_modal"&&F?.setOpen(!1)},c=s.useMemo(()=>t?.fields.map(e=>{const o={...e};return"_type"in e&&e._type==="include_chat_session"&&(o.inputType="checkbox",i.id?(o.isHidden=e.isHidden,o.isRequired=e.isRequired):(o.isHidden=!0,o.isRequired=!1)),o}),[t?.fields,i.id]),m=c?.find(e=>"_type"in e&&e._type==="include_chat_session"),r=s.useMemo(()=>M.getFormDefaultValues(c),[c]),{control:b,handleSubmit:p,formState:{errors:d,isSubmitting:E},setError:R,reset:l}=w.useForm({defaultValues:r});s.useEffect(()=>{r&&l(r)},[l,r]);const q=p(async e=>{const _=i.id&&m&&e[m.name]?i:null;try{await t?.buttons.submit.onSubmit({values:e,conversation:_}),u(!0),t?.successView||a()}catch(f){R(H,{message:f instanceof Error?f.message:"Something went wrong."})}}),y=d?.root?.serverError;return{form:t,openForm:C,closeForm:a,handleSubmit:q,isSuccess:v,isSubmitting:E,formError:y,fields:c,errors:d,control:b,defaultValues:r}}const V=({children:t})=>{const n=S();return g.jsx(h.Provider,{value:n,children:t})},j=()=>{const t=s.useContext(h);if(!t)throw new Error("useChatForm must be used within a ChatFormProvider");return t};exports.ChatFormProvider=V;exports.useChatForm=j;exports.useChatFormState=S;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react/jsx-runtime"),s=require("react"),H=require("react-hook-form"),O=require("./conversation-provider.cjs"),M=require("../components/modal/modal-provider.cjs"),T=require("../utils/form.cjs"),V=require("./chat-events-provider.cjs"),j="root.serverError",S=s.createContext(void 0);function g(){const[t,i]=s.useState(null),[a,u]=s.useState(null),[C,l]=s.useState(!1),{conversation:r}=O.useInkeepConversation(),F=M.useModal(),{logEvent:b}=V.useChatEvents(),E=(e,o)=>{i(e),u(o||null)},m=()=>{i(null),u(null),l(!1),t?.buttons.close?.action==="close_modal"&&F?.setOpen(!1)},c=s.useMemo(()=>t?.fields.map(e=>{const o={...e};return"_type"in e&&e._type==="include_chat_session"&&(o.inputType="checkbox",r.id?(o.isHidden=e.isHidden,o.isRequired=e.isRequired):(o.isHidden=!0,o.isRequired=!1)),o}),[t?.fields,r.id]),d=c?.find(e=>"_type"in e&&e._type==="include_chat_session"),n=s.useMemo(()=>T.getFormDefaultValues(c),[c]),{control:_,handleSubmit:q,formState:{errors:f,isSubmitting:y},setError:R,reset:p}=H.useForm({defaultValues:n});s.useEffect(()=>{n&&p(n)},[p,n]);const P=q(async e=>{const v=r.id&&d&&e[d.name]?r:null;try{await t?.buttons.submit.onSubmit({values:e,conversation:v}),a&&b({eventName:"user_escalation_indicated",properties:{escalationType:"support_form",getHelpOptionName:a.name,conversation:v||r}}),l(!0),t?.successView||m()}catch(h){R(j,{message:h instanceof Error?h.message:"Something went wrong."})}}),w=f?.root?.serverError;return{form:t,openForm:E,closeForm:m,handleSubmit:P,isSuccess:C,isSubmitting:y,formError:w,fields:c,errors:f,control:_,defaultValues:n}}const k=({children:t})=>{const i=g();return x.jsx(S.Provider,{value:i,children:t})},N=()=>{const t=s.useContext(S);if(!t)throw new Error("useChatForm must be used within a ChatFormProvider");return t};exports.ChatFormProvider=k;exports.useChatForm=N;exports.useChatFormState=g;
@@ -1,66 +1,74 @@
1
1
  "use client";
2
- import { jsx as y } from "react/jsx-runtime";
3
- import { useState as f, useMemo as p, useEffect as g, createContext as V, useContext as q } from "react";
4
- import { useForm as H } from "react-hook-form";
5
- import { useInkeepConversation as M } from "./conversation-provider.js";
6
- import { useModal as P } from "../components/modal/modal-provider.js";
2
+ import { jsx as O } from "react/jsx-runtime";
3
+ import { useState as c, useMemo as S, useEffect as V, createContext as q, useContext as M } from "react";
4
+ import { useForm as N } from "react-hook-form";
5
+ import { useInkeepConversation as P } from "./conversation-provider.js";
6
+ import { useModal as T } from "../components/modal/modal-provider.js";
7
7
  import { getFormDefaultValues as k } from "../utils/form.js";
8
- const I = "root.serverError", h = V(void 0);
9
- function O() {
10
- const [t, r] = f(null), [S, c] = f(!1), { conversation: n } = M(), b = P(), v = (e) => {
11
- r(e);
12
- }, u = () => {
13
- r(null), c(!1), t?.buttons.close?.action === "close_modal" && b?.setOpen(!1);
14
- }, i = p(() => t?.fields.map((e) => {
8
+ import { useChatEvents as G } from "./chat-events-provider.js";
9
+ const I = "root.serverError", g = q(void 0);
10
+ function j() {
11
+ const [t, r] = c(null), [a, u] = c(null), [C, m] = c(!1), { conversation: s } = P(), E = T(), { logEvent: b } = G(), F = (e, o) => {
12
+ r(e), u(o || null);
13
+ }, l = () => {
14
+ r(null), u(null), m(!1), t?.buttons.close?.action === "close_modal" && E?.setOpen(!1);
15
+ }, i = S(() => t?.fields.map((e) => {
15
16
  const o = { ...e };
16
- return "_type" in e && e._type === "include_chat_session" && (o.inputType = "checkbox", n.id ? (o.isHidden = e.isHidden, o.isRequired = e.isRequired) : (o.isHidden = !0, o.isRequired = !1)), o;
17
- }), [t?.fields, n.id]), a = i?.find((e) => "_type" in e && e._type === "include_chat_session"), s = p(() => k(i), [i]), {
18
- control: C,
19
- handleSubmit: F,
20
- formState: { errors: m, isSubmitting: E },
21
- setError: _,
22
- reset: l
23
- } = H({
24
- defaultValues: s
17
+ return "_type" in e && e._type === "include_chat_session" && (o.inputType = "checkbox", s.id ? (o.isHidden = e.isHidden, o.isRequired = e.isRequired) : (o.isHidden = !0, o.isRequired = !1)), o;
18
+ }), [t?.fields, s.id]), p = i?.find((e) => "_type" in e && e._type === "include_chat_session"), n = S(() => k(i), [i]), {
19
+ control: _,
20
+ handleSubmit: y,
21
+ formState: { errors: d, isSubmitting: R },
22
+ setError: w,
23
+ reset: f
24
+ } = N({
25
+ defaultValues: n
25
26
  });
26
- g(() => {
27
- s && l(s);
28
- }, [l, s]);
29
- const R = F(async (e) => {
30
- const x = n.id && a && e[a.name] ? n : null;
27
+ V(() => {
28
+ n && f(n);
29
+ }, [f, n]);
30
+ const x = y(async (e) => {
31
+ const h = s.id && p && e[p.name] ? s : null;
31
32
  try {
32
- await t?.buttons.submit.onSubmit({ values: e, conversation: x }), c(!0), t?.successView || u();
33
- } catch (d) {
34
- _(I, {
35
- message: d instanceof Error ? d.message : "Something went wrong."
33
+ await t?.buttons.submit.onSubmit({ values: e, conversation: h }), a && b({
34
+ eventName: "user_escalation_indicated",
35
+ properties: {
36
+ escalationType: "support_form",
37
+ getHelpOptionName: a.name,
38
+ conversation: h || s
39
+ }
40
+ }), m(!0), t?.successView || l();
41
+ } catch (v) {
42
+ w(I, {
43
+ message: v instanceof Error ? v.message : "Something went wrong."
36
44
  });
37
45
  }
38
- }), w = m?.root?.serverError;
46
+ }), H = d?.root?.serverError;
39
47
  return {
40
48
  form: t,
41
- openForm: v,
42
- closeForm: u,
43
- handleSubmit: R,
44
- isSuccess: S,
45
- isSubmitting: E,
46
- formError: w,
49
+ openForm: F,
50
+ closeForm: l,
51
+ handleSubmit: x,
52
+ isSuccess: C,
53
+ isSubmitting: R,
54
+ formError: H,
47
55
  fields: i,
48
- errors: m,
49
- control: C,
50
- defaultValues: s
56
+ errors: d,
57
+ control: _,
58
+ defaultValues: n
51
59
  };
52
60
  }
53
- const G = ({ children: t }) => {
54
- const r = O();
55
- return /* @__PURE__ */ y(h.Provider, { value: r, children: t });
56
- }, J = () => {
57
- const t = q(h);
61
+ const U = ({ children: t }) => {
62
+ const r = j();
63
+ return /* @__PURE__ */ O(g.Provider, { value: r, children: t });
64
+ }, W = () => {
65
+ const t = M(g);
58
66
  if (!t)
59
67
  throw new Error("useChatForm must be used within a ChatFormProvider");
60
68
  return t;
61
69
  };
62
70
  export {
63
- G as ChatFormProvider,
64
- J as useChatForm,
65
- O as useChatFormState
71
+ U as ChatFormProvider,
72
+ W as useChatForm,
73
+ j as useChatFormState
66
74
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),n=require("react"),M=require("../atoms/api/analytics/feedback.cjs"),S=require("../components/embedded-chat/chat-provider.cjs"),l=require("../utils/misc.cjs"),E=require("./config-provider.cjs"),j=require("./conversation-provider.cjs"),I=require("./chat-events-provider.cjs"),R=require("./user-provider.cjs"),f=n.createContext(void 0);function U(){const{baseSettings:e}=E.useInkeepConfig(),{apiKey:s,analyticsApiBaseUrl:o,analyticsProperties:b}=e,[g,p]=n.useState(null),[F,P]=n.useState({}),{conversation:k}=j.useInkeepConversation(),{messages:r,selectedWorkflow:C}=S.useChat(),{userProperties:m}=R.useUser(),{logEvent:h}=I.useChatEvents(),c=n.useCallback(async(t,i,a=[])=>{const u=await M.submitFeedback({type:i,messageId:t,reasons:a,apiKey:s,apiUrl:o,userProperties:m,properties:b});u&&P(d=>({...d,[t]:{type:u.type,reasons:u.reasons}}));const v=r.findIndex(d=>d.id===t),w=r[v],x={conversationId:k.id,question:l.getMessageContent(r[v-1]),answer:l.getMessageContent(w),messageId:t,reasons:a,workflowId:C?.id};h({eventName:i==="positive"?"assistant_positive_feedback_submitted":"assistant_negative_feedback_submitted",properties:x})},[r,k]),q=n.useCallback(async t=>{c(t,"positive")},[c]),y=n.useCallback(async(t,i)=>{const a=A(i);c(t,"negative",a)},[c]);return{feedback:F,currentFeedback:g,setCurrentFeedback:p,submitPositiveFeedback:q,submitNegativeFeedback:y}}const N=({children:e})=>{const s=U();return _.jsx(f.Provider,{value:s,children:e})},$=()=>{const e=n.useContext(f);if(!e)throw new Error("useFeedback must be used within a FeedbackProvider");return e};function A(e){const s=[];for(const o in e)e[o]==="on"&&s.push({label:o,details:e[`${o}:description`]||""});return s.length>0?s:[]}exports.FeedbackProvider=N;exports.useMessageFeedback=$;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react/jsx-runtime"),n=require("react"),M=require("../atoms/api/analytics/feedback.cjs"),S=require("../components/embedded-chat/chat-provider.cjs"),p=require("../utils/misc.cjs"),E=require("./config-provider.cjs"),j=require("./conversation-provider.cjs"),I=require("./chat-events-provider.cjs"),N=require("./user-provider.cjs"),f=n.createContext(void 0);function R(){const{baseSettings:e}=E.useInkeepConfig(),{apiKey:s,analyticsApiBaseUrl:o,analyticsProperties:v}=e,[g,F]=n.useState(null),[P,C]=n.useState({}),{conversation:u}=j.useInkeepConversation(),{messages:c,selectedWorkflow:m}=S.useChat(),{userProperties:h}=N.useUser(),{logEvent:k}=I.useChatEvents(),i=n.useCallback(async(t,r,a=[])=>{const d=await M.submitFeedback({type:r,messageId:t,reasons:a,apiKey:s,apiUrl:o,userProperties:h,properties:v});d&&C(b=>({...b,[t]:{type:d.type,reasons:d.reasons}}));const l=c.findIndex(b=>b.id===t),w=c[l],_={conversationId:u.id,question:p.getMessageContent(c[l-1]),answer:p.getMessageContent(w),messageId:t,reasons:a,workflowId:m?.id};k({eventName:r==="positive"?"assistant_positive_feedback_submitted":"assistant_negative_feedback_submitted",properties:_}),r==="negative"&&k({eventName:"user_escalation_indicated",properties:{escalationType:"downvote",conversation:u}})},[c,u]),q=n.useCallback(async t=>{i(t,"positive")},[i]),y=n.useCallback(async(t,r)=>{const a=$(r);i(t,"negative",a)},[i]);return{feedback:P,currentFeedback:g,setCurrentFeedback:F,submitPositiveFeedback:q,submitNegativeFeedback:y}}const U=({children:e})=>{const s=R();return x.jsx(f.Provider,{value:s,children:e})},T=()=>{const e=n.useContext(f);if(!e)throw new Error("useFeedback must be used within a FeedbackProvider");return e};function $(e){const s=[];for(const o in e)e[o]==="on"&&s.push({label:o,details:e[`${o}:description`]||""});return s.length>0?s:[]}exports.FeedbackProvider=U;exports.useMessageFeedback=T;
@@ -1,69 +1,75 @@
1
1
  "use client";
2
2
  import { jsx as I } from "react/jsx-runtime";
3
- import { createContext as U, useContext as M, useState as k, useCallback as u } from "react";
4
- import { submitFeedback as N } from "../atoms/api/analytics/feedback.js";
3
+ import { createContext as N, useContext as U, useState as f, useCallback as p } from "react";
4
+ import { submitFeedback as M } from "../atoms/api/analytics/feedback.js";
5
5
  import { useChat as S } from "../components/embedded-chat/chat-provider.js";
6
- import { getMessageContent as f } from "../utils/misc.js";
6
+ import { getMessageContent as v } from "../utils/misc.js";
7
7
  import { useInkeepConfig as j } from "./config-provider.js";
8
8
  import { useInkeepConversation as q } from "./conversation-provider.js";
9
9
  import { useChatEvents as A } from "./chat-events-provider.js";
10
10
  import { useUser as B } from "./user-provider.js";
11
- const v = U(void 0);
11
+ const l = N(void 0);
12
12
  function K() {
13
- const { baseSettings: e } = j(), { apiKey: s, analyticsApiBaseUrl: o, analyticsProperties: b } = e, [l, F] = k(null), [g, C] = k({}), { conversation: m } = q(), { messages: n, selectedWorkflow: h } = S(), { userProperties: w } = B(), { logEvent: y } = A(), r = u(
14
- async (t, i, c = []) => {
15
- const a = await N({
16
- type: i,
13
+ const { baseSettings: e } = j(), { apiKey: s, analyticsApiBaseUrl: o, analyticsProperties: m } = e, [F, g] = f(null), [C, w] = f({}), { conversation: c } = q(), { messages: r, selectedWorkflow: h } = S(), { userProperties: y } = B(), { logEvent: b } = A(), i = p(
14
+ async (t, n, a = []) => {
15
+ const d = await M({
16
+ type: n,
17
17
  messageId: t,
18
- reasons: c,
18
+ reasons: a,
19
19
  apiKey: s,
20
20
  apiUrl: o,
21
- userProperties: w,
22
- properties: b
21
+ userProperties: y,
22
+ properties: m
23
23
  });
24
- a && C((d) => ({
25
- ...d,
26
- [t]: { type: a.type, reasons: a.reasons }
24
+ d && w((u) => ({
25
+ ...u,
26
+ [t]: { type: d.type, reasons: d.reasons }
27
27
  }));
28
- const p = n.findIndex((d) => d.id === t), _ = n[p], E = {
29
- conversationId: m.id,
30
- question: f(n[p - 1]),
31
- answer: f(_),
28
+ const k = r.findIndex((u) => u.id === t), P = r[k], E = {
29
+ conversationId: c.id,
30
+ question: v(r[k - 1]),
31
+ answer: v(P),
32
32
  messageId: t,
33
- reasons: c,
33
+ reasons: a,
34
34
  workflowId: h?.id
35
35
  };
36
- y({
37
- eventName: i === "positive" ? "assistant_positive_feedback_submitted" : "assistant_negative_feedback_submitted",
36
+ b({
37
+ eventName: n === "positive" ? "assistant_positive_feedback_submitted" : "assistant_negative_feedback_submitted",
38
38
  properties: E
39
+ }), n === "negative" && b({
40
+ eventName: "user_escalation_indicated",
41
+ properties: {
42
+ escalationType: "downvote",
43
+ conversation: c
44
+ }
39
45
  });
40
46
  },
41
- [n, m]
42
- ), x = u(
47
+ [r, c]
48
+ ), _ = p(
43
49
  async (t) => {
44
- r(t, "positive");
50
+ i(t, "positive");
45
51
  },
46
- [r]
47
- ), P = u(
48
- async (t, i) => {
49
- const c = R(i);
50
- r(t, "negative", c);
52
+ [i]
53
+ ), x = p(
54
+ async (t, n) => {
55
+ const a = R(n);
56
+ i(t, "negative", a);
51
57
  },
52
- [r]
58
+ [i]
53
59
  );
54
60
  return {
55
- feedback: g,
56
- currentFeedback: l,
57
- setCurrentFeedback: F,
58
- submitPositiveFeedback: x,
59
- submitNegativeFeedback: P
61
+ feedback: C,
62
+ currentFeedback: F,
63
+ setCurrentFeedback: g,
64
+ submitPositiveFeedback: _,
65
+ submitNegativeFeedback: x
60
66
  };
61
67
  }
62
- const Q = ({ children: e }) => {
68
+ const O = ({ children: e }) => {
63
69
  const s = K();
64
- return /* @__PURE__ */ I(v.Provider, { value: s, children: e });
65
- }, T = () => {
66
- const e = M(v);
70
+ return /* @__PURE__ */ I(l.Provider, { value: s, children: e });
71
+ }, Q = () => {
72
+ const e = U(l);
67
73
  if (!e)
68
74
  throw new Error("useFeedback must be used within a FeedbackProvider");
69
75
  return e;
@@ -78,6 +84,6 @@ function R(e) {
78
84
  return s.length > 0 ? s : [];
79
85
  }
80
86
  export {
81
- Q as FeedbackProvider,
82
- T as useMessageFeedback
87
+ O as FeedbackProvider,
88
+ Q as useMessageFeedback
83
89
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/cxkit-primitives",
3
- "version": "0.5.95",
3
+ "version": "0.5.96",
4
4
  "description": "",
5
5
  "license": "Inkeep, Inc. Customer License (IICL) v1.1",
6
6
  "homepage": "",
@@ -67,9 +67,9 @@
67
67
  "remark-gfm": "^4.0.1",
68
68
  "unist-util-visit": "^5.0.0",
69
69
  "use-sync-external-store": "^1.4.0",
70
- "@inkeep/cxkit-color-mode": "^0.5.95",
71
- "@inkeep/cxkit-theme": "0.5.95",
72
- "@inkeep/cxkit-types": "0.5.95"
70
+ "@inkeep/cxkit-color-mode": "^0.5.96",
71
+ "@inkeep/cxkit-theme": "0.5.96",
72
+ "@inkeep/cxkit-types": "0.5.96"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@biomejs/biome": "1.9.4",