@inkeep/cxkit-primitives 0.5.52 → 0.5.55
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/atoms/cmdk/index.cjs +1 -1
- package/dist/atoms/cmdk/index.js +56 -55
- package/dist/components/embedded-chat.cjs +2 -2
- package/dist/components/embedded-chat.js +661 -648
- package/dist/components/modal.cjs +1 -1
- package/dist/components/modal.js +12 -12
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/providers/base-events-provider.cjs +1 -1
- package/dist/providers/base-events-provider.js +1 -1
- package/dist/providers/user-provider.cjs +1 -1
- package/dist/providers/user-provider.js +21 -22
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),t=require("../atoms/dialog.cjs"),i=require("./factory.cjs"),c=require("../atoms/icons/custom-icon.cjs"),u=require("./modal/use-inkeep-modal.cjs"),s=require("./modal/modal-provider.cjs"),m=require("../utils/compose-event-handlers.cjs"),M=require("../hooks/use-media-query.cjs"),p=require("../utils/misc.cjs"),v=i.ikp(t.Root,{_id:"modal"}),C=e=>{const{onOpenChange:n,config:l,...a}=e,r=u.useInkeepModal(l);return o.jsx(s.ModalProvider,{modal:r,children:o.jsx(v,{open:r.isOpen,onOpenChange:m.composeEventHandlers(n,d=>r.setOpen(d)),...a})})},y=i.ikp(t.Overlay,{_id:"modal__Overlay"}),_=i.ikp(t.Content,{_id:"modal__Content","aria-describedby":void 0}),q=e=>{const n=M.useMediaQuery("(max-width: 768px)");return o.jsx(_,{"data-mobile":p.dataAttr(n),...e})},
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),t=require("../atoms/dialog.cjs"),i=require("./factory.cjs"),c=require("../atoms/icons/custom-icon.cjs"),u=require("./modal/use-inkeep-modal.cjs"),s=require("./modal/modal-provider.cjs"),m=require("../utils/compose-event-handlers.cjs"),M=require("../hooks/use-media-query.cjs"),p=require("../utils/misc.cjs"),v=i.ikp(t.Root,{_id:"modal"}),C=e=>{const{onOpenChange:n,config:l,...a}=e,r=u.useInkeepModal(l);return o.jsx(s.ModalProvider,{modal:r,children:o.jsx(v,{open:r.isOpen,onOpenChange:m.composeEventHandlers(n,d=>r.setOpen(d)),...a})})},y=i.ikp(t.Overlay,{_id:"modal__Overlay"}),_=i.ikp(t.Content,{_id:"modal__Content","aria-describedby":void 0}),q=e=>{const n=M.useMediaQuery("(max-width: 768px)");return o.jsx(_,{"data-mobile":p.dataAttr(n),tabIndex:-1,...e})},x=i.ikp(t.Close,{_id:"modal__Close",children:o.jsx(c.CustomIcon,{iconKey:"close"})}),O=e=>s.useModal()?o.jsx(x,{...e}):null;exports.Close=O;exports.Content=q;exports.Modal=C;exports.Overlay=y;
|
package/dist/components/modal.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import { Overlay as
|
|
4
|
-
import { ikp as
|
|
3
|
+
import { Overlay as d, Root as s, Content as m, Close as c } from "../atoms/dialog.js";
|
|
4
|
+
import { ikp as n } from "./factory.js";
|
|
5
5
|
import { CustomIcon as p } from "../atoms/icons/custom-icon.js";
|
|
6
6
|
import { useInkeepModal as C } from "./modal/use-inkeep-modal.js";
|
|
7
7
|
import { ModalProvider as M, useModal as f } from "./modal/modal-provider.js";
|
|
8
8
|
import { composeEventHandlers as u } from "../utils/compose-event-handlers.js";
|
|
9
9
|
import { useMediaQuery as v } from "../hooks/use-media-query.js";
|
|
10
10
|
import { dataAttr as _ } from "../utils/misc.js";
|
|
11
|
-
const O =
|
|
11
|
+
const O = n(s, {
|
|
12
12
|
_id: "modal"
|
|
13
13
|
}), E = (o) => {
|
|
14
|
-
const { onOpenChange: t, config: i, ...a } = o,
|
|
15
|
-
return /* @__PURE__ */ e(M, { modal:
|
|
14
|
+
const { onOpenChange: t, config: i, ...a } = o, r = C(i);
|
|
15
|
+
return /* @__PURE__ */ e(M, { modal: r, children: /* @__PURE__ */ e(
|
|
16
16
|
O,
|
|
17
17
|
{
|
|
18
|
-
open:
|
|
19
|
-
onOpenChange: u(t, (l) =>
|
|
18
|
+
open: r.isOpen,
|
|
19
|
+
onOpenChange: u(t, (l) => r.setOpen(l)),
|
|
20
20
|
...a
|
|
21
21
|
}
|
|
22
22
|
) });
|
|
23
|
-
}, H =
|
|
23
|
+
}, H = n(d, {
|
|
24
24
|
_id: "modal__Overlay"
|
|
25
|
-
}), y =
|
|
25
|
+
}), y = n(m, {
|
|
26
26
|
_id: "modal__Content",
|
|
27
27
|
"aria-describedby": void 0
|
|
28
28
|
}), K = (o) => {
|
|
29
29
|
const t = v("(max-width: 768px)");
|
|
30
|
-
return /* @__PURE__ */ e(y, { "data-mobile": _(t), ...o });
|
|
31
|
-
},
|
|
30
|
+
return /* @__PURE__ */ e(y, { "data-mobile": _(t), tabIndex: -1, ...o });
|
|
31
|
+
}, b = n(c, {
|
|
32
32
|
_id: "modal__Close",
|
|
33
33
|
children: /* @__PURE__ */ e(p, { iconKey: "close" })
|
|
34
|
-
}), Q = (o) => f() ? /* @__PURE__ */ e(
|
|
34
|
+
}), Q = (o) => f() ? /* @__PURE__ */ e(b, { ...o }) : null;
|
|
35
35
|
export {
|
|
36
36
|
Q as Close,
|
|
37
37
|
K as Content,
|
package/dist/index.d.cts
CHANGED
|
@@ -3363,11 +3363,11 @@ declare const PrimitiveBotHeadingName: ForwardRefExoticComponent< PolymorphicPro
|
|
|
3363
3363
|
|
|
3364
3364
|
declare type PrimitiveButtonProps = React_2.ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
3365
3365
|
|
|
3366
|
-
declare const PrimitiveChatAction: ForwardRefExoticComponent< PolymorphicProps & Omit<
|
|
3366
|
+
declare const PrimitiveChatAction: ForwardRefExoticComponent< PolymorphicProps & Omit<TooltipPrimitive.TooltipTriggerProps & RefAttributes<HTMLButtonElement>, "_id"> & Partial<Pick<TooltipPrimitive.TooltipTriggerProps & RefAttributes<HTMLButtonElement>, "_id">>>;
|
|
3367
3367
|
|
|
3368
3368
|
declare const PrimitiveChatActionFeedback: ForwardRefExoticComponent< PolymorphicProps & Omit<TooltipPrimitive.TooltipContentProps & RefAttributes<HTMLDivElement>, "_id"> & Partial<Pick<TooltipPrimitive.TooltipContentProps & RefAttributes<HTMLDivElement>, "_id">>>;
|
|
3369
3369
|
|
|
3370
|
-
declare const PrimitiveChatActionLabel: ForwardRefExoticComponent< PolymorphicProps & Omit<
|
|
3370
|
+
declare const PrimitiveChatActionLabel: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "_id">>>;
|
|
3371
3371
|
|
|
3372
3372
|
declare const PrimitiveChatButtonAvatarContent: ForwardRefExoticComponent< PolymorphicProps & Omit<AvatarPrimitive.AvatarProps & RefAttributes<HTMLSpanElement>, "_id"> & Partial<Pick<AvatarPrimitive.AvatarProps & RefAttributes<HTMLSpanElement>, "_id">>>;
|
|
3373
3373
|
|
|
@@ -4189,6 +4189,7 @@ export declare interface WidgetConfig extends InkeepConfig {
|
|
|
4189
4189
|
|
|
4190
4190
|
export declare type WidgetContextValue = {
|
|
4191
4191
|
setView: (view: ModalViewTypes) => void;
|
|
4192
|
+
view: ModalViewTypes;
|
|
4192
4193
|
};
|
|
4193
4194
|
|
|
4194
4195
|
export declare const WidgetProvider: React.FC<{
|
package/dist/index.d.ts
CHANGED
|
@@ -3363,11 +3363,11 @@ declare const PrimitiveBotHeadingName: ForwardRefExoticComponent< PolymorphicPro
|
|
|
3363
3363
|
|
|
3364
3364
|
declare type PrimitiveButtonProps = React_2.ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
3365
3365
|
|
|
3366
|
-
declare const PrimitiveChatAction: ForwardRefExoticComponent< PolymorphicProps & Omit<
|
|
3366
|
+
declare const PrimitiveChatAction: ForwardRefExoticComponent< PolymorphicProps & Omit<TooltipPrimitive.TooltipTriggerProps & RefAttributes<HTMLButtonElement>, "_id"> & Partial<Pick<TooltipPrimitive.TooltipTriggerProps & RefAttributes<HTMLButtonElement>, "_id">>>;
|
|
3367
3367
|
|
|
3368
3368
|
declare const PrimitiveChatActionFeedback: ForwardRefExoticComponent< PolymorphicProps & Omit<TooltipPrimitive.TooltipContentProps & RefAttributes<HTMLDivElement>, "_id"> & Partial<Pick<TooltipPrimitive.TooltipContentProps & RefAttributes<HTMLDivElement>, "_id">>>;
|
|
3369
3369
|
|
|
3370
|
-
declare const PrimitiveChatActionLabel: ForwardRefExoticComponent< PolymorphicProps & Omit<
|
|
3370
|
+
declare const PrimitiveChatActionLabel: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "_id">>>;
|
|
3371
3371
|
|
|
3372
3372
|
declare const PrimitiveChatButtonAvatarContent: ForwardRefExoticComponent< PolymorphicProps & Omit<AvatarPrimitive.AvatarProps & RefAttributes<HTMLSpanElement>, "_id"> & Partial<Pick<AvatarPrimitive.AvatarProps & RefAttributes<HTMLSpanElement>, "_id">>>;
|
|
3373
3373
|
|
|
@@ -4189,6 +4189,7 @@ export declare interface WidgetConfig extends InkeepConfig {
|
|
|
4189
4189
|
|
|
4190
4190
|
export declare type WidgetContextValue = {
|
|
4191
4191
|
setView: (view: ModalViewTypes) => void;
|
|
4192
|
+
view: ModalViewTypes;
|
|
4192
4193
|
};
|
|
4193
4194
|
|
|
4194
4195
|
export declare const WidgetProvider: React.FC<{
|
|
@@ -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"),f=require("./user-provider.cjs"),d=t.createContext(void 0),b=({children:e})=>{const{baseSettings:n,componentType:o}=B.useInkeepConfig(),{apiKey:r,analyticsApiBaseUrl:i,tags:c,privacyPreferences:E,env:g}=n,{userProperties:a}=f.useUser(),v=t.useMemo(()=>({widgetLibraryVersion:"0.5.
|
|
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"),f=require("./user-provider.cjs"),d=t.createContext(void 0),b=({children:e})=>{const{baseSettings:n,componentType:o}=B.useInkeepConfig(),{apiKey:r,analyticsApiBaseUrl:i,tags:c,privacyPreferences:E,env:g}=n,{userProperties:a}=f.useUser(),v=t.useMemo(()=>({widgetLibraryVersion:"0.5.55",componentType:o,tags:c}),[o,c]),u=!E.optOutAllAnalytics&&g!=="development",m={logEvent:t.useCallback(async l=>{const s={...v,...l.properties},p={eventName:l.eventName,properties:s,userProperties:a};if(u){if("conversation"in s&&!s.conversation?.id)return;y.logEvent(p,r,i)}n.onEvent?.(p)},[u,n,r,i,a,v])};return P.jsx(d.Provider,{value:m,children:e})},x=()=>{const e=t.useContext(d);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=b;exports.useBaseEvents=x;
|
|
@@ -7,7 +7,7 @@ import { useUser as b } from "./user-provider.js";
|
|
|
7
7
|
const u = x(void 0), U = ({ children: e }) => {
|
|
8
8
|
const { baseSettings: t, componentType: n } = C(), { apiKey: s, analyticsApiBaseUrl: r, tags: i, privacyPreferences: l, env: E } = t, { userProperties: a } = b(), c = g(
|
|
9
9
|
() => ({
|
|
10
|
-
widgetLibraryVersion: "0.5.
|
|
10
|
+
widgetLibraryVersion: "0.5.55",
|
|
11
11
|
componentType: n,
|
|
12
12
|
tags: i
|
|
13
13
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),r=require("react"),p=require("./config-provider.cjs"),a=require("../hooks/use-browser-storage.cjs"),O=require("../utils/generate-uid.cjs"),g=r.createContext(void 0),P=({children:t})=>{const{baseSettings:{userProperties:
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),r=require("react"),p=require("./config-provider.cjs"),a=require("../hooks/use-browser-storage.cjs"),O=require("../utils/generate-uid.cjs"),g=r.createContext(void 0),P=({children:t})=>{const{baseSettings:{userProperties:o,privacyPreferences:U}}=p.useInkeepConfig(),{optOutAllAnalytics:e,optOutAnalyticalCookies:n}=U,{browserStorage:u,setBrowserStorage:c}=a.useBrowserStorage(),d=r.useMemo(()=>a.passesBrowserStorageChecks(),[]),s=r.useMemo(()=>!e&&!n&&d,[e,n,d]),i=r.useMemo(()=>{const l=e?"ANONYMOUS":o.id?"ID_PROVIDED":s?"COOKIED":"ANONYMOUS",v=e?void 0:o.id||s&&u.userId||O.generateUid();return{identificationType:l,...e?{}:o,id:v}},[o,e,s,u.userId]);return r.useEffect(()=>{s?c("userId",i.id):c("userId",void 0)},[s,i.id]),S.jsx(g.Provider,{value:{userProperties:i},children:t})},f=()=>{const t=r.useContext(g);if(!t)throw new Error("useUser must be used within a UserProvider");return t};exports.UserProvider=P;exports.useUser=f;
|
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useMemo as i, useEffect as
|
|
4
|
-
import { useInkeepConfig as
|
|
5
|
-
import { useBrowserStorage as
|
|
2
|
+
import { jsx as U } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo as i, useEffect as C, createContext as O, useContext as g } from "react";
|
|
4
|
+
import { useInkeepConfig as l } from "./config-provider.js";
|
|
5
|
+
import { useBrowserStorage as v, passesBrowserStorageChecks as w } from "../hooks/use-browser-storage.js";
|
|
6
6
|
import { generateUid as I } from "../utils/generate-uid.js";
|
|
7
|
-
const a =
|
|
7
|
+
const a = O(void 0), b = ({ children: o }) => {
|
|
8
8
|
const {
|
|
9
|
-
baseSettings: { userProperties:
|
|
10
|
-
} =
|
|
9
|
+
baseSettings: { userProperties: s, privacyPreferences: p }
|
|
10
|
+
} = l(), { optOutAllAnalytics: e, optOutAnalyticalCookies: n } = p, { browserStorage: c, setBrowserStorage: u } = v(), d = i(() => w(), []), r = i(
|
|
11
11
|
() => !e && !n && d,
|
|
12
12
|
[e, n, d]
|
|
13
13
|
), t = i(() => {
|
|
14
|
-
const
|
|
14
|
+
const m = e ? "ANONYMOUS" : s.id ? "ID_PROVIDED" : r ? "COOKIED" : "ANONYMOUS", f = e ? void 0 : s.id || r && c.userId || I();
|
|
15
15
|
return {
|
|
16
|
-
identificationType:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
cohorts: e ? void 0 : r.cohorts
|
|
16
|
+
identificationType: m,
|
|
17
|
+
...e ? {} : s,
|
|
18
|
+
id: f
|
|
20
19
|
};
|
|
21
|
-
}, [
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
}, [
|
|
25
|
-
},
|
|
26
|
-
const
|
|
27
|
-
if (!
|
|
20
|
+
}, [s, e, r, c.userId]);
|
|
21
|
+
return C(() => {
|
|
22
|
+
r ? u("userId", t.id) : u("userId", void 0);
|
|
23
|
+
}, [r, t.id]), /* @__PURE__ */ U(a.Provider, { value: { userProperties: t }, children: o });
|
|
24
|
+
}, h = () => {
|
|
25
|
+
const o = g(a);
|
|
26
|
+
if (!o)
|
|
28
27
|
throw new Error("useUser must be used within a UserProvider");
|
|
29
|
-
return
|
|
28
|
+
return o;
|
|
30
29
|
};
|
|
31
30
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
b as UserProvider,
|
|
32
|
+
h as useUser
|
|
34
33
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/cxkit-primitives",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.55",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Inkeep, Inc. Customer License (IICL) v1.1",
|
|
6
6
|
"homepage": "",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"remark-gfm": "^4.0.1",
|
|
60
60
|
"unist-util-visit": "^5.0.0",
|
|
61
61
|
"use-sync-external-store": "^1.4.0",
|
|
62
|
-
"@inkeep/cxkit-color-mode": "0.5.
|
|
63
|
-
"@inkeep/cxkit-theme": "0.5.
|
|
64
|
-
"@inkeep/cxkit-types": "0.5.
|
|
62
|
+
"@inkeep/cxkit-color-mode": "0.5.55",
|
|
63
|
+
"@inkeep/cxkit-theme": "0.5.55",
|
|
64
|
+
"@inkeep/cxkit-types": "0.5.55"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@biomejs/biome": "1.9.4",
|