@inkeep/agents-ui 0.15.19 → 0.15.20
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 i=require("react/jsx-runtime"),P=require("react"),m=require("@radix-ui/primitive"),O=require("@radix-ui/react-compose-refs"),H=require("@radix-ui/react-context"),R=require("@radix-ui/react-id"),W=require("@radix-ui/react-use-controllable-state"),z=require("@radix-ui/react-dismissable-layer"),B=require("@zag-js/focus-trap"),K=require("@radix-ui/react-portal"),_=require("@radix-ui/react-presence"),g=require("@radix-ui/react-primitive"),U=require("@radix-ui/react-focus-guards"),V=require("aria-hidden"),Y=require("@zag-js/remove-scroll"),$=require("./shadow/context.cjs");function J(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:()=>e[o]})}}return n.default=e,Object.freeze(n)}const c=J(P),x="Dialog",[w,Q]=H.createContextScope(x),[X,l]=w(x),y=e=>{const{__scopeDialog:n,children:o,open:s,defaultOpen:r,onOpenChange:t,modal:a=!0}=e,u=c.useRef(null),f=c.useRef(null),[D=!1,d]=W.useControllableState({prop:s,defaultProp:r??!1,onChange:t});return i.jsx(X,{scope:n,triggerRef:u,contentRef:f,contentId:R.useId(),titleId:R.useId(),descriptionId:R.useId(),open:D,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(N=>!N),[d]),modal:a,children:o})};y.displayName=x;const M="DialogTrigger",q=c.forwardRef((e,n)=>{const{__scopeDialog:o,...s}=e,r=l(M,o),t=O.useComposedRefs(n,r.triggerRef);return i.jsx(g.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":T(r.open),...s,ref:t,onClick:m.composeEventHandlers(e.onClick,r.onOpenToggle)})});q.displayName=M;const v="DialogPortal",[Z,S]=w(v,{forceMount:void 0}),E=e=>{const{__scopeDialog:n,forceMount:o,children:s,container:r}=e,t=l(v,n);return i.jsx(Z,{scope:n,forceMount:o,children:c.Children.map(s,a=>i.jsx(_.Presence,{present:o||t.open,children:i.jsx(K.Portal,{asChild:!0,container:r,children:a})}))})};E.displayName=v;const C="DialogOverlay",I=c.forwardRef((e,n)=>{const o=S(C,e.__scopeDialog),{forceMount:s=o.forceMount,...r}=e,t=l(C,e.__scopeDialog);return t.modal?i.jsx(_.Presence,{present:s||t.open,children:i.jsx(ee,{...r,ref:n})}):null});I.displayName=C;const ee=c.forwardRef((e,n)=>{const{__scopeDialog:o,...s}=e,r=l(C,o),t=$.useShadow();return P.useEffect(()=>{t
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),P=require("react"),m=require("@radix-ui/primitive"),O=require("@radix-ui/react-compose-refs"),H=require("@radix-ui/react-context"),R=require("@radix-ui/react-id"),W=require("@radix-ui/react-use-controllable-state"),z=require("@radix-ui/react-dismissable-layer"),B=require("@zag-js/focus-trap"),K=require("@radix-ui/react-portal"),_=require("@radix-ui/react-presence"),g=require("@radix-ui/react-primitive"),U=require("@radix-ui/react-focus-guards"),V=require("aria-hidden"),Y=require("@zag-js/remove-scroll"),$=require("./shadow/context.cjs");function J(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:()=>e[o]})}}return n.default=e,Object.freeze(n)}const c=J(P),x="Dialog",[w,Q]=H.createContextScope(x),[X,l]=w(x),y=e=>{const{__scopeDialog:n,children:o,open:s,defaultOpen:r,onOpenChange:t,modal:a=!0}=e,u=c.useRef(null),f=c.useRef(null),[D=!1,d]=W.useControllableState({prop:s,defaultProp:r??!1,onChange:t});return i.jsx(X,{scope:n,triggerRef:u,contentRef:f,contentId:R.useId(),titleId:R.useId(),descriptionId:R.useId(),open:D,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(N=>!N),[d]),modal:a,children:o})};y.displayName=x;const M="DialogTrigger",q=c.forwardRef((e,n)=>{const{__scopeDialog:o,...s}=e,r=l(M,o),t=O.useComposedRefs(n,r.triggerRef);return i.jsx(g.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":T(r.open),...s,ref:t,onClick:m.composeEventHandlers(e.onClick,r.onOpenToggle)})});q.displayName=M;const v="DialogPortal",[Z,S]=w(v,{forceMount:void 0}),E=e=>{const{__scopeDialog:n,forceMount:o,children:s,container:r}=e,t=l(v,n);return i.jsx(Z,{scope:n,forceMount:o,children:c.Children.map(s,a=>i.jsx(_.Presence,{present:o||t.open,children:i.jsx(K.Portal,{asChild:!0,container:r,children:a})}))})};E.displayName=v;const C="DialogOverlay",I=c.forwardRef((e,n)=>{const o=S(C,e.__scopeDialog),{forceMount:s=o.forceMount,...r}=e,t=l(C,e.__scopeDialog);return t.modal?i.jsx(_.Presence,{present:s||t.open,children:i.jsx(ee,{...r,ref:n})}):null});I.displayName=C;const ee=c.forwardRef((e,n)=>{const{__scopeDialog:o,...s}=e,r=l(C,o),t=$.useShadow();return P.useEffect(()=>{const a=t?.rootElement?.ownerDocument??document;return Y.preventBodyScroll(a)},[t]),i.jsx(g.Primitive.div,{"data-state":T(r.open),...s,ref:n,style:{pointerEvents:"auto",...s.style}})}),p="DialogContent",h=c.forwardRef((e,n)=>{const o=S(p,e.__scopeDialog),{forceMount:s=o.forceMount,...r}=e,t=l(p,e.__scopeDialog);return i.jsx(_.Presence,{present:s||t.open,children:t.modal?i.jsx(te,{...r,ref:n}):i.jsx(oe,{...r,ref:n})})});h.displayName=p;const te=c.forwardRef((e,n)=>{const o=l(p,e.__scopeDialog),s=c.useRef(null),r=O.useComposedRefs(n,o.contentRef,s);return c.useEffect(()=>{const t=s.current;if(t){const a=document.querySelectorAll("[data-ikp-component]");return V.hideOthers([t,...Array.from(a)])}},[]),i.jsx(k,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:!0,onPointerDownOutside:m.composeEventHandlers(e.onPointerDownOutside,t=>{const a=t.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0;(a.button===2||u)&&t.preventDefault(),t.target.closest("[data-ikp-component]")&&t.preventDefault()}),onFocusOutside:m.composeEventHandlers(e.onFocusOutside,t=>t.preventDefault())})}),oe=c.forwardRef((e,n)=>{const o=l(p,e.__scopeDialog),s=c.useRef(!1),r=c.useRef(!1);return i.jsx(k,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(s.current=!0,t.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=t.target;o.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type==="focusin"&&r.current&&t.preventDefault()}})}),k=c.forwardRef((e,n)=>{const{__scopeDialog:o,trapFocus:s,onOpenAutoFocus:r,onCloseAutoFocus:t,...a}=e,u=l(p,o),f=c.useRef(null),D=O.useComposedRefs(n,f);return U.useFocusGuards(),P.useEffect(()=>{if(s)return B.trapFocus(f.current,{preventScroll:!0,onActivate:r,onDeactivate:t,initialFocus:!1,allowOutsideClick:d=>!!d.target.closest("[data-ikp-component]")})},[]),i.jsx(z.DismissableLayer,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":T(u.open),...a,ref:D,onDismiss:()=>u.onOpenChange(!1)})}),A="DialogTitle",b=c.forwardRef((e,n)=>{const{__scopeDialog:o,...s}=e,r=l(A,o);return i.jsx(g.Primitive.h2,{id:r.titleId,...s,ref:n})});b.displayName=A;const F="DialogDescription",L=c.forwardRef((e,n)=>{const{__scopeDialog:o,...s}=e,r=l(F,o);return i.jsx(g.Primitive.p,{id:r.descriptionId,...s,ref:n})});L.displayName=F;const G="DialogClose",j=c.forwardRef((e,n)=>{const{__scopeDialog:o,...s}=e,r=l(G,o);return i.jsx(g.Primitive.button,{type:"button",...s,ref:n,onClick:m.composeEventHandlers(e.onClick,()=>r.onOpenChange(!1))})});j.displayName=G;function T(e){return e?"open":"closed"}const ne=y,re=E,se=I,ce=h,ie=b,ae=j;exports.Close=ae;exports.Content=ce;exports.Dialog=y;exports.DialogClose=j;exports.DialogContent=h;exports.DialogDescription=L;exports.DialogOverlay=I;exports.DialogPortal=E;exports.DialogTitle=b;exports.DialogTrigger=q;exports.Overlay=se;exports.Portal=re;exports.Root=ne;exports.Title=ie;exports.createDialogScope=Q;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import * as c from "react";
|
|
4
4
|
import { useEffect as I } from "react";
|
|
5
5
|
import { composeEventHandlers as D } from "@radix-ui/primitive";
|
|
6
6
|
import { useComposedRefs as _ } from "@radix-ui/react-compose-refs";
|
|
@@ -17,12 +17,12 @@ import { hideOthers as K } from "aria-hidden";
|
|
|
17
17
|
import { preventBodyScroll as V } from "@zag-js/remove-scroll";
|
|
18
18
|
import { useShadow as Y } from "./shadow/context.js";
|
|
19
19
|
const P = "Dialog", [v, Ct] = W(P), [z, l] = v(P), x = (t) => {
|
|
20
|
-
const { __scopeDialog: n, children: r, open: s, defaultOpen: e, onOpenChange: o, modal: a = !0 } = t, p =
|
|
20
|
+
const { __scopeDialog: n, children: r, open: s, defaultOpen: e, onOpenChange: o, modal: a = !0 } = t, p = c.useRef(null), d = c.useRef(null), [m = !1, u] = $({
|
|
21
21
|
prop: s,
|
|
22
22
|
defaultProp: e ?? !1,
|
|
23
23
|
onChange: o
|
|
24
24
|
});
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ i(
|
|
26
26
|
z,
|
|
27
27
|
{
|
|
28
28
|
scope: n,
|
|
@@ -32,18 +32,18 @@ const P = "Dialog", [v, Ct] = W(P), [z, l] = v(P), x = (t) => {
|
|
|
32
32
|
titleId: R(),
|
|
33
33
|
descriptionId: R(),
|
|
34
34
|
open: m,
|
|
35
|
-
onOpenChange:
|
|
36
|
-
onOpenToggle:
|
|
35
|
+
onOpenChange: u,
|
|
36
|
+
onOpenToggle: c.useCallback(() => u((E) => !E), [u]),
|
|
37
37
|
modal: a,
|
|
38
38
|
children: r
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
41
|
};
|
|
42
42
|
x.displayName = P;
|
|
43
|
-
const N = "DialogTrigger", J =
|
|
43
|
+
const N = "DialogTrigger", J = c.forwardRef(
|
|
44
44
|
(t, n) => {
|
|
45
45
|
const { __scopeDialog: r, ...s } = t, e = l(N, r), o = _(n, e.triggerRef);
|
|
46
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ i(
|
|
47
47
|
g.button,
|
|
48
48
|
{
|
|
49
49
|
type: "button",
|
|
@@ -63,21 +63,22 @@ const y = "DialogPortal", [Q, w] = v(y, {
|
|
|
63
63
|
forceMount: void 0
|
|
64
64
|
}), T = (t) => {
|
|
65
65
|
const { __scopeDialog: n, forceMount: r, children: s, container: e } = t, o = l(y, n);
|
|
66
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */ i(Q, { scope: n, forceMount: r, children: c.Children.map(s, (a) => /* @__PURE__ */ i(O, { present: r || o.open, children: /* @__PURE__ */ i(B, { asChild: !0, container: e, children: a }) })) });
|
|
67
67
|
};
|
|
68
68
|
T.displayName = y;
|
|
69
|
-
const C = "DialogOverlay", A =
|
|
69
|
+
const C = "DialogOverlay", A = c.forwardRef(
|
|
70
70
|
(t, n) => {
|
|
71
71
|
const r = w(C, t.__scopeDialog), { forceMount: s = r.forceMount, ...e } = t, o = l(C, t.__scopeDialog);
|
|
72
|
-
return o.modal ? /* @__PURE__ */
|
|
72
|
+
return o.modal ? /* @__PURE__ */ i(O, { present: s || o.open, children: /* @__PURE__ */ i(U, { ...e, ref: n }) }) : null;
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
75
|
A.displayName = C;
|
|
76
|
-
const U =
|
|
76
|
+
const U = c.forwardRef(
|
|
77
77
|
(t, n) => {
|
|
78
78
|
const { __scopeDialog: r, ...s } = t, e = l(C, r), o = Y();
|
|
79
79
|
return I(() => {
|
|
80
|
-
|
|
80
|
+
const a = o?.rootElement?.ownerDocument ?? document;
|
|
81
|
+
return V(a);
|
|
81
82
|
}, [o]), // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
82
83
|
// ie. when `Overlay` and `Content` are siblings
|
|
83
84
|
// <RemoveScroll
|
|
@@ -87,7 +88,7 @@ const U = i.forwardRef(
|
|
|
87
88
|
// gapMode="padding"
|
|
88
89
|
// removeScrollBar={true}
|
|
89
90
|
// >
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ i(
|
|
91
92
|
g.div,
|
|
92
93
|
{
|
|
93
94
|
"data-state": h(e.open),
|
|
@@ -97,23 +98,23 @@ const U = i.forwardRef(
|
|
|
97
98
|
}
|
|
98
99
|
);
|
|
99
100
|
}
|
|
100
|
-
),
|
|
101
|
+
), f = "DialogContent", M = c.forwardRef(
|
|
101
102
|
(t, n) => {
|
|
102
|
-
const r = w(
|
|
103
|
-
return /* @__PURE__ */
|
|
103
|
+
const r = w(f, t.__scopeDialog), { forceMount: s = r.forceMount, ...e } = t, o = l(f, t.__scopeDialog);
|
|
104
|
+
return /* @__PURE__ */ i(O, { present: s || o.open, children: o.modal ? /* @__PURE__ */ i(X, { ...e, ref: n }) : /* @__PURE__ */ i(Z, { ...e, ref: n }) });
|
|
104
105
|
}
|
|
105
106
|
);
|
|
106
|
-
M.displayName =
|
|
107
|
-
const X =
|
|
107
|
+
M.displayName = f;
|
|
108
|
+
const X = c.forwardRef(
|
|
108
109
|
(t, n) => {
|
|
109
|
-
const r = l(
|
|
110
|
-
return
|
|
110
|
+
const r = l(f, t.__scopeDialog), s = c.useRef(null), e = _(n, r.contentRef, s);
|
|
111
|
+
return c.useEffect(() => {
|
|
111
112
|
const o = s.current;
|
|
112
113
|
if (o) {
|
|
113
114
|
const a = document.querySelectorAll("[data-ikp-component]");
|
|
114
115
|
return K([o, ...Array.from(a)]);
|
|
115
116
|
}
|
|
116
|
-
}, []), /* @__PURE__ */
|
|
117
|
+
}, []), /* @__PURE__ */ i(
|
|
117
118
|
b,
|
|
118
119
|
{
|
|
119
120
|
...t,
|
|
@@ -131,10 +132,10 @@ const X = i.forwardRef(
|
|
|
131
132
|
}
|
|
132
133
|
);
|
|
133
134
|
}
|
|
134
|
-
), Z =
|
|
135
|
+
), Z = c.forwardRef(
|
|
135
136
|
(t, n) => {
|
|
136
|
-
const r = l(
|
|
137
|
-
return /* @__PURE__ */
|
|
137
|
+
const r = l(f, t.__scopeDialog), s = c.useRef(!1), e = c.useRef(!1);
|
|
138
|
+
return /* @__PURE__ */ i(
|
|
138
139
|
b,
|
|
139
140
|
{
|
|
140
141
|
...t,
|
|
@@ -149,9 +150,9 @@ const X = i.forwardRef(
|
|
|
149
150
|
}
|
|
150
151
|
);
|
|
151
152
|
}
|
|
152
|
-
), b =
|
|
153
|
+
), b = c.forwardRef(
|
|
153
154
|
(t, n) => {
|
|
154
|
-
const { __scopeDialog: r, trapFocus: s, onOpenAutoFocus: e, onCloseAutoFocus: o, ...a } = t, p = l(
|
|
155
|
+
const { __scopeDialog: r, trapFocus: s, onOpenAutoFocus: e, onCloseAutoFocus: o, ...a } = t, p = l(f, r), d = c.useRef(null), m = _(n, d);
|
|
155
156
|
return H(), I(() => {
|
|
156
157
|
if (s)
|
|
157
158
|
return q(d.current, {
|
|
@@ -159,9 +160,9 @@ const X = i.forwardRef(
|
|
|
159
160
|
onActivate: e,
|
|
160
161
|
onDeactivate: o,
|
|
161
162
|
initialFocus: !1,
|
|
162
|
-
allowOutsideClick: (
|
|
163
|
+
allowOutsideClick: (u) => !!u.target.closest("[data-ikp-component]")
|
|
163
164
|
});
|
|
164
|
-
}, []), /* @__PURE__ */
|
|
165
|
+
}, []), /* @__PURE__ */ i(
|
|
165
166
|
j,
|
|
166
167
|
{
|
|
167
168
|
role: "dialog",
|
|
@@ -175,24 +176,24 @@ const X = i.forwardRef(
|
|
|
175
176
|
}
|
|
176
177
|
);
|
|
177
178
|
}
|
|
178
|
-
), k = "DialogTitle", F =
|
|
179
|
+
), k = "DialogTitle", F = c.forwardRef(
|
|
179
180
|
(t, n) => {
|
|
180
181
|
const { __scopeDialog: r, ...s } = t, e = l(k, r);
|
|
181
|
-
return /* @__PURE__ */
|
|
182
|
+
return /* @__PURE__ */ i(g.h2, { id: e.titleId, ...s, ref: n });
|
|
182
183
|
}
|
|
183
184
|
);
|
|
184
185
|
F.displayName = k;
|
|
185
|
-
const S = "DialogDescription", tt =
|
|
186
|
+
const S = "DialogDescription", tt = c.forwardRef(
|
|
186
187
|
(t, n) => {
|
|
187
188
|
const { __scopeDialog: r, ...s } = t, e = l(S, r);
|
|
188
|
-
return /* @__PURE__ */
|
|
189
|
+
return /* @__PURE__ */ i(g.p, { id: e.descriptionId, ...s, ref: n });
|
|
189
190
|
}
|
|
190
191
|
);
|
|
191
192
|
tt.displayName = S;
|
|
192
|
-
const L = "DialogClose", G =
|
|
193
|
+
const L = "DialogClose", G = c.forwardRef(
|
|
193
194
|
(t, n) => {
|
|
194
195
|
const { __scopeDialog: r, ...s } = t, e = l(L, r);
|
|
195
|
-
return /* @__PURE__ */
|
|
196
|
+
return /* @__PURE__ */ i(
|
|
196
197
|
g.button,
|
|
197
198
|
{
|
|
198
199
|
type: "button",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),t=require("react"),l=require("./config-provider.cjs"),a=t.createContext(void 0),p=({children:e})=>{const{baseSettings:s,componentType:n}=l.useInkeepConfig(),{tags:o,analyticsProperties:r}=s,i=t.useMemo(()=>({widgetLibraryVersion:"0.15.
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),t=require("react"),l=require("./config-provider.cjs"),a=t.createContext(void 0),p=({children:e})=>{const{baseSettings:s,componentType:n}=l.useInkeepConfig(),{tags:o,analyticsProperties:r}=s,i=t.useMemo(()=>({widgetLibraryVersion:"0.15.20",componentType:n,tags:o}),[n,o]),u={logEvent:t.useCallback(async c=>{const v={...i,...c.properties,...r},d={eventName:c.eventName,properties:v};return s.onEvent?.(d)},[s,i,r])};return E.jsx(a.Provider,{value:u,children:e})},g=()=>{const e=t.useContext(a);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=p;exports.useBaseEvents=g;
|
|
@@ -5,7 +5,7 @@ import { useInkeepConfig as g } from "./config-provider.js";
|
|
|
5
5
|
const a = d(void 0), P = ({ children: e }) => {
|
|
6
6
|
const { baseSettings: t, componentType: o } = g(), { tags: s, analyticsProperties: n } = t, r = u(
|
|
7
7
|
() => ({
|
|
8
|
-
widgetLibraryVersion: "0.15.
|
|
8
|
+
widgetLibraryVersion: "0.15.20",
|
|
9
9
|
componentType: o,
|
|
10
10
|
tags: s
|
|
11
11
|
}),
|