@inkeep/agents-ui 0.15.26 → 0.15.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +166 -174
- package/dist/primitives/atoms/dialog.cjs +1 -1
- package/dist/primitives/atoms/dialog.js +110 -106
- package/dist/primitives/atoms/file-upload.cjs +1 -0
- package/dist/primitives/atoms/file-upload.d.ts +35 -0
- package/dist/primitives/atoms/file-upload.js +45 -0
- package/dist/primitives/atoms/icons/built-in-icons.cjs +1 -1
- package/dist/primitives/atoms/icons/built-in-icons.d.ts +8 -1
- package/dist/primitives/atoms/icons/built-in-icons.js +86 -79
- package/dist/primitives/atoms/icons/collections/pi.cjs +1 -1
- package/dist/primitives/atoms/icons/collections/pi.d.ts +6 -0
- package/dist/primitives/atoms/icons/collections/pi.js +103 -13
- package/dist/primitives/atoms/icons/inkeep-default-icons.cjs +1 -1
- package/dist/primitives/atoms/icons/inkeep-default-icons.js +9 -1
- package/dist/primitives/components/embedded-chat/file-upload-input.cjs +1 -0
- package/dist/primitives/components/embedded-chat/file-upload-input.d.ts +68 -0
- package/dist/primitives/components/embedded-chat/file-upload-input.js +328 -0
- package/dist/primitives/components/embedded-chat/image-preview-modal.cjs +1 -0
- package/dist/primitives/components/embedded-chat/image-preview-modal.d.ts +15 -0
- package/dist/primitives/components/embedded-chat/image-preview-modal.js +71 -0
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.cjs +3 -3
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.d.ts +8 -6
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.js +277 -227
- package/dist/primitives/components/embedded-chat.cjs +4 -4
- package/dist/primitives/components/embedded-chat.d.ts +7 -116
- package/dist/primitives/components/embedded-chat.js +1082 -1484
- package/dist/primitives/components/embedded-search.d.ts +1 -1
- package/dist/primitives/hooks/index.cjs +1 -1
- package/dist/primitives/hooks/index.js +15 -14
- package/dist/primitives/hooks/use-initial-conversation.cjs +1 -0
- package/dist/primitives/hooks/use-initial-conversation.d.ts +16 -0
- package/dist/primitives/hooks/use-initial-conversation.js +31 -0
- package/dist/primitives/hooks/use-input-notification.cjs +1 -0
- package/dist/primitives/hooks/use-input-notification.d.ts +9 -0
- package/dist/primitives/hooks/use-input-notification.js +18 -0
- package/dist/primitives/hooks/use-scrolling-fades.cjs +1 -1
- package/dist/primitives/hooks/use-scrolling-fades.d.ts +1 -0
- package/dist/primitives/hooks/use-scrolling-fades.js +21 -5
- package/dist/primitives/index.cjs +1 -1
- package/dist/primitives/index.js +146 -154
- package/dist/primitives/providers/base-events-provider.cjs +1 -1
- package/dist/primitives/providers/base-events-provider.js +1 -1
- package/dist/primitives/providers/feedback-provider.cjs +1 -1
- package/dist/primitives/providers/feedback-provider.js +37 -38
- package/dist/primitives/providers/image-preview-provider.cjs +1 -0
- package/dist/primitives/providers/image-preview-provider.d.ts +15 -0
- package/dist/primitives/providers/image-preview-provider.js +23 -0
- package/dist/primitives/providers/index.cjs +1 -1
- package/dist/primitives/providers/index.d.ts +0 -3
- package/dist/primitives/providers/index.js +54 -63
- package/dist/primitives/utils/component-ids.cjs +1 -1
- package/dist/primitives/utils/component-ids.d.ts +54 -98
- package/dist/primitives/utils/component-ids.js +44 -66
- package/dist/primitives/utils/default-settings.cjs +1 -1
- package/dist/primitives/utils/default-settings.d.ts +0 -2
- package/dist/primitives/utils/default-settings.js +6 -8
- package/dist/react/embedded-chat.cjs +1 -1
- package/dist/react/embedded-chat.js +283 -287
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +166 -174
- package/dist/styled/components/chat-history.cjs +1 -1
- package/dist/styled/components/chat-history.d.ts +1 -1
- package/dist/styled/components/chat-history.js +31 -29
- package/dist/styled/components/embedded-chat/file-upload-input.cjs +1 -0
- package/dist/styled/components/embedded-chat/file-upload-input.d.ts +20 -0
- package/dist/styled/components/embedded-chat/file-upload-input.js +300 -0
- package/dist/styled/components/embedded-chat/image-preview-modal.cjs +1 -0
- package/dist/styled/components/embedded-chat/image-preview-modal.d.ts +11 -0
- package/dist/styled/components/embedded-chat/image-preview-modal.js +77 -0
- package/dist/styled/components/embedded-chat.cjs +1 -1
- package/dist/styled/components/embedded-chat.d.ts +4 -50
- package/dist/styled/components/embedded-chat.js +567 -1010
- package/dist/styled/components/message.cjs +1 -1
- package/dist/styled/components/message.js +89 -88
- package/dist/styled/components/ui/recipes/citation.d.ts +1 -1
- package/dist/styled/components/ui/recipes/index.cjs +1 -1
- package/dist/styled/components/ui/recipes/index.d.ts +0 -1
- package/dist/styled/components/ui/recipes/index.js +31 -33
- package/dist/styled/index.cjs +1 -1
- package/dist/styled/index.js +154 -162
- package/dist/styled/inkeep.css.cjs +241 -61
- package/dist/styled/inkeep.css.js +241 -61
- package/dist/types/config/ai.d.ts +8 -10
- package/dist/types/icons/built-in.d.ts +1 -1
- package/dist/types/icons/custom.d.ts +8 -0
- package/dist/types/index.d.ts +0 -1
- package/package.json +7 -6
- package/dist/primitives/providers/attachment-item-provider.cjs +0 -1
- package/dist/primitives/providers/attachment-item-provider.d.ts +0 -9
- package/dist/primitives/providers/attachment-item-provider.js +0 -13
- package/dist/primitives/providers/attachments-bar-provider.cjs +0 -1
- package/dist/primitives/providers/attachments-bar-provider.d.ts +0 -30
- package/dist/primitives/providers/attachments-bar-provider.js +0 -57
- package/dist/primitives/providers/message-attachments-provider.cjs +0 -1
- package/dist/primitives/providers/message-attachments-provider.d.ts +0 -13
- package/dist/primitives/providers/message-attachments-provider.js +0 -27
- package/dist/primitives/utils/get-message-metadata.d.ts +0 -8
- package/dist/styled/components/ui/recipes/attachment.cjs +0 -1
- package/dist/styled/components/ui/recipes/attachment.d.ts +0 -4
- package/dist/styled/components/ui/recipes/attachment.js +0 -28
- package/dist/types/config/settings/workflow.d.ts +0 -86
|
@@ -1,85 +1,85 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
2
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
3
|
+
import * as a from "react";
|
|
4
4
|
import { useEffect as I } from "react";
|
|
5
|
-
import { composeEventHandlers as
|
|
6
|
-
import { useComposedRefs as
|
|
5
|
+
import { composeEventHandlers as C } from "@radix-ui/primitive";
|
|
6
|
+
import { useComposedRefs as O } from "@radix-ui/react-compose-refs";
|
|
7
7
|
import { createContextScope as W } from "@radix-ui/react-context";
|
|
8
|
-
import { useId as
|
|
8
|
+
import { useId as _ } from "@radix-ui/react-id";
|
|
9
9
|
import { useControllableState as $ } from "@radix-ui/react-use-controllable-state";
|
|
10
10
|
import { DismissableLayer as j } from "@radix-ui/react-dismissable-layer";
|
|
11
11
|
import { trapFocus as q } from "@zag-js/focus-trap";
|
|
12
12
|
import { Portal as B } from "@radix-ui/react-portal";
|
|
13
|
-
import { Presence as
|
|
13
|
+
import { Presence as P } from "@radix-ui/react-presence";
|
|
14
14
|
import { Primitive as g } from "@radix-ui/react-primitive";
|
|
15
15
|
import { useFocusGuards as H } from "@radix-ui/react-focus-guards";
|
|
16
16
|
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
|
-
const
|
|
20
|
-
const { __scopeDialog: n, children: r, open: s, defaultOpen: e, onOpenChange:
|
|
19
|
+
const y = "Dialog", [v, Ro] = W(y), [z, l] = v(y), x = (o) => {
|
|
20
|
+
const { __scopeDialog: n, children: r, open: s, defaultOpen: e, onOpenChange: t, modal: i = !0 } = o, p = a.useRef(null), f = a.useRef(null), [m = !1, u] = $({
|
|
21
21
|
prop: s,
|
|
22
22
|
defaultProp: e ?? !1,
|
|
23
|
-
onChange:
|
|
23
|
+
onChange: t
|
|
24
24
|
});
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ c(
|
|
26
26
|
z,
|
|
27
27
|
{
|
|
28
28
|
scope: n,
|
|
29
29
|
triggerRef: p,
|
|
30
|
-
contentRef:
|
|
31
|
-
contentId:
|
|
32
|
-
titleId:
|
|
33
|
-
descriptionId:
|
|
30
|
+
contentRef: f,
|
|
31
|
+
contentId: _(),
|
|
32
|
+
titleId: _(),
|
|
33
|
+
descriptionId: _(),
|
|
34
34
|
open: m,
|
|
35
35
|
onOpenChange: u,
|
|
36
|
-
onOpenToggle:
|
|
37
|
-
modal:
|
|
36
|
+
onOpenToggle: a.useCallback(() => u((D) => !D), [u]),
|
|
37
|
+
modal: i,
|
|
38
38
|
children: r
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
41
|
};
|
|
42
|
-
x.displayName =
|
|
43
|
-
const N = "DialogTrigger", J =
|
|
44
|
-
(
|
|
45
|
-
const { __scopeDialog: r, ...s } =
|
|
46
|
-
return /* @__PURE__ */
|
|
42
|
+
x.displayName = y;
|
|
43
|
+
const N = "DialogTrigger", J = a.forwardRef(
|
|
44
|
+
(o, n) => {
|
|
45
|
+
const { __scopeDialog: r, ...s } = o, e = l(N, r), t = O(n, e.triggerRef);
|
|
46
|
+
return /* @__PURE__ */ c(
|
|
47
47
|
g.button,
|
|
48
48
|
{
|
|
49
49
|
type: "button",
|
|
50
50
|
"aria-haspopup": "dialog",
|
|
51
51
|
"aria-expanded": e.open,
|
|
52
52
|
"aria-controls": e.contentId,
|
|
53
|
-
"data-state":
|
|
53
|
+
"data-state": E(e.open),
|
|
54
54
|
...s,
|
|
55
|
-
ref:
|
|
56
|
-
onClick:
|
|
55
|
+
ref: t,
|
|
56
|
+
onClick: C(o.onClick, e.onOpenToggle)
|
|
57
57
|
}
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
60
|
);
|
|
61
61
|
J.displayName = N;
|
|
62
|
-
const
|
|
62
|
+
const h = "DialogPortal", [Q, w] = v(h, {
|
|
63
63
|
forceMount: void 0
|
|
64
|
-
}), T = (
|
|
65
|
-
const { __scopeDialog: n, forceMount: r, children: s, container: e } =
|
|
66
|
-
return /* @__PURE__ */
|
|
64
|
+
}), T = (o) => {
|
|
65
|
+
const { __scopeDialog: n, forceMount: r, children: s, container: e } = o, t = l(h, n);
|
|
66
|
+
return /* @__PURE__ */ c(Q, { scope: n, forceMount: r, children: a.Children.map(s, (i) => /* @__PURE__ */ c(P, { present: r || t.open, children: /* @__PURE__ */ c(B, { asChild: !0, container: e, children: i }) })) });
|
|
67
67
|
};
|
|
68
|
-
T.displayName =
|
|
69
|
-
const
|
|
70
|
-
(
|
|
71
|
-
const r = w(
|
|
72
|
-
return
|
|
68
|
+
T.displayName = h;
|
|
69
|
+
const R = "DialogOverlay", A = a.forwardRef(
|
|
70
|
+
(o, n) => {
|
|
71
|
+
const r = w(R, o.__scopeDialog), { forceMount: s = r.forceMount, ...e } = o, t = l(R, o.__scopeDialog);
|
|
72
|
+
return t.modal ? /* @__PURE__ */ c(P, { present: s || t.open, children: /* @__PURE__ */ c(U, { ...e, ref: n }) }) : null;
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
|
-
A.displayName =
|
|
76
|
-
const U =
|
|
77
|
-
(
|
|
78
|
-
const { __scopeDialog: r, ...s } =
|
|
75
|
+
A.displayName = R;
|
|
76
|
+
const U = a.forwardRef(
|
|
77
|
+
(o, n) => {
|
|
78
|
+
const { __scopeDialog: r, ...s } = o, e = l(R, r), t = Y();
|
|
79
79
|
return I(() => {
|
|
80
|
-
const
|
|
81
|
-
return V(
|
|
82
|
-
}, [
|
|
80
|
+
const i = t?.rootElement?.ownerDocument ?? document;
|
|
81
|
+
return V(i);
|
|
82
|
+
}, [t]), // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
83
83
|
// ie. when `Overlay` and `Content` are siblings
|
|
84
84
|
// <RemoveScroll
|
|
85
85
|
// as={Slot}
|
|
@@ -88,141 +88,145 @@ const U = c.forwardRef(
|
|
|
88
88
|
// gapMode="padding"
|
|
89
89
|
// removeScrollBar={true}
|
|
90
90
|
// >
|
|
91
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ c(
|
|
92
92
|
g.div,
|
|
93
93
|
{
|
|
94
|
-
"data-
|
|
94
|
+
"data-dialog-overlay": "",
|
|
95
|
+
"data-state": E(e.open),
|
|
95
96
|
...s,
|
|
96
97
|
ref: n,
|
|
97
98
|
style: { pointerEvents: "auto", ...s.style }
|
|
98
99
|
}
|
|
99
100
|
);
|
|
100
101
|
}
|
|
101
|
-
),
|
|
102
|
-
(
|
|
103
|
-
const r = w(
|
|
104
|
-
return /* @__PURE__ */
|
|
102
|
+
), d = "DialogContent", M = a.forwardRef(
|
|
103
|
+
(o, n) => {
|
|
104
|
+
const r = w(d, o.__scopeDialog), { forceMount: s = r.forceMount, ...e } = o, t = l(d, o.__scopeDialog);
|
|
105
|
+
return /* @__PURE__ */ c(P, { present: s || t.open, children: t.modal ? /* @__PURE__ */ c(X, { ...e, ref: n }) : /* @__PURE__ */ c(Z, { ...e, ref: n }) });
|
|
105
106
|
}
|
|
106
107
|
);
|
|
107
|
-
M.displayName =
|
|
108
|
-
const X =
|
|
109
|
-
(
|
|
110
|
-
const r = l(
|
|
111
|
-
return
|
|
112
|
-
const
|
|
113
|
-
if (
|
|
114
|
-
const
|
|
115
|
-
return K([
|
|
108
|
+
M.displayName = d;
|
|
109
|
+
const X = a.forwardRef(
|
|
110
|
+
(o, n) => {
|
|
111
|
+
const r = l(d, o.__scopeDialog), s = a.useRef(null), e = O(n, r.contentRef, s);
|
|
112
|
+
return a.useEffect(() => {
|
|
113
|
+
const t = s.current;
|
|
114
|
+
if (t) {
|
|
115
|
+
const i = document.querySelectorAll("[data-ikp-component]");
|
|
116
|
+
return K([t, ...Array.from(i)]);
|
|
116
117
|
}
|
|
117
|
-
}, []), /* @__PURE__ */
|
|
118
|
+
}, []), /* @__PURE__ */ c(
|
|
118
119
|
b,
|
|
119
120
|
{
|
|
120
|
-
...
|
|
121
|
+
...o,
|
|
121
122
|
ref: e,
|
|
122
123
|
trapFocus: r.open,
|
|
123
124
|
disableOutsidePointerEvents: !0,
|
|
124
|
-
onPointerDownOutside:
|
|
125
|
-
const
|
|
126
|
-
(
|
|
125
|
+
onPointerDownOutside: C(o.onPointerDownOutside, (t) => {
|
|
126
|
+
const i = t.detail.originalEvent, p = i.button === 0 && i.ctrlKey === !0;
|
|
127
|
+
(i.button === 2 || p) && t.preventDefault(), t.target.closest("[data-ikp-component]") && t.preventDefault();
|
|
127
128
|
}),
|
|
128
|
-
onFocusOutside:
|
|
129
|
-
|
|
130
|
-
(
|
|
129
|
+
onFocusOutside: C(
|
|
130
|
+
o.onFocusOutside,
|
|
131
|
+
(t) => t.preventDefault()
|
|
131
132
|
)
|
|
132
133
|
}
|
|
133
134
|
);
|
|
134
135
|
}
|
|
135
|
-
), Z =
|
|
136
|
-
(
|
|
137
|
-
const r = l(
|
|
138
|
-
return /* @__PURE__ */
|
|
136
|
+
), Z = a.forwardRef(
|
|
137
|
+
(o, n) => {
|
|
138
|
+
const r = l(d, o.__scopeDialog), s = a.useRef(!1), e = a.useRef(!1);
|
|
139
|
+
return /* @__PURE__ */ c(
|
|
139
140
|
b,
|
|
140
141
|
{
|
|
141
|
-
...
|
|
142
|
+
...o,
|
|
142
143
|
ref: n,
|
|
143
144
|
trapFocus: !1,
|
|
144
145
|
disableOutsidePointerEvents: !1,
|
|
145
|
-
onInteractOutside: (
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
r.triggerRef.current?.contains(
|
|
146
|
+
onInteractOutside: (t) => {
|
|
147
|
+
o.onInteractOutside?.(t), t.defaultPrevented || (s.current = !0, t.detail.originalEvent.type === "pointerdown" && (e.current = !0));
|
|
148
|
+
const i = t.target;
|
|
149
|
+
r.triggerRef.current?.contains(i) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && e.current && t.preventDefault();
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
);
|
|
152
153
|
}
|
|
153
|
-
), b =
|
|
154
|
-
(
|
|
155
|
-
const { __scopeDialog: r, trapFocus: s, onOpenAutoFocus: e, onCloseAutoFocus:
|
|
154
|
+
), b = a.forwardRef(
|
|
155
|
+
(o, n) => {
|
|
156
|
+
const { __scopeDialog: r, trapFocus: s, onOpenAutoFocus: e, onCloseAutoFocus: t, ...i } = o, p = l(d, r), f = a.useRef(null), m = O(n, f);
|
|
156
157
|
return H(), I(() => {
|
|
157
158
|
if (s)
|
|
158
|
-
return q(
|
|
159
|
+
return q(f.current, {
|
|
159
160
|
preventScroll: !0,
|
|
160
161
|
onActivate: e,
|
|
161
|
-
onDeactivate:
|
|
162
|
+
onDeactivate: t,
|
|
162
163
|
initialFocus: !1,
|
|
163
|
-
allowOutsideClick: (u) =>
|
|
164
|
+
allowOutsideClick: (u) => {
|
|
165
|
+
const D = u.composedPath?.()[0] ?? u.target;
|
|
166
|
+
return !!D.closest("[data-ikp-component]") || !!D.closest("[data-dialog-overlay]");
|
|
167
|
+
}
|
|
164
168
|
});
|
|
165
|
-
}, []), /* @__PURE__ */
|
|
169
|
+
}, []), /* @__PURE__ */ c(
|
|
166
170
|
j,
|
|
167
171
|
{
|
|
168
172
|
role: "dialog",
|
|
169
173
|
id: p.contentId,
|
|
170
174
|
"aria-describedby": p.descriptionId,
|
|
171
175
|
"aria-labelledby": p.titleId,
|
|
172
|
-
"data-state":
|
|
173
|
-
...
|
|
176
|
+
"data-state": E(p.open),
|
|
177
|
+
...i,
|
|
174
178
|
ref: m,
|
|
175
179
|
onDismiss: () => p.onOpenChange(!1)
|
|
176
180
|
}
|
|
177
181
|
);
|
|
178
182
|
}
|
|
179
|
-
), k = "DialogTitle", F =
|
|
180
|
-
(
|
|
181
|
-
const { __scopeDialog: r, ...s } =
|
|
182
|
-
return /* @__PURE__ */
|
|
183
|
+
), k = "DialogTitle", F = a.forwardRef(
|
|
184
|
+
(o, n) => {
|
|
185
|
+
const { __scopeDialog: r, ...s } = o, e = l(k, r);
|
|
186
|
+
return /* @__PURE__ */ c(g.h2, { id: e.titleId, ...s, ref: n });
|
|
183
187
|
}
|
|
184
188
|
);
|
|
185
189
|
F.displayName = k;
|
|
186
|
-
const S = "DialogDescription",
|
|
187
|
-
(
|
|
188
|
-
const { __scopeDialog: r, ...s } =
|
|
189
|
-
return /* @__PURE__ */
|
|
190
|
+
const S = "DialogDescription", oo = a.forwardRef(
|
|
191
|
+
(o, n) => {
|
|
192
|
+
const { __scopeDialog: r, ...s } = o, e = l(S, r);
|
|
193
|
+
return /* @__PURE__ */ c(g.p, { id: e.descriptionId, ...s, ref: n });
|
|
190
194
|
}
|
|
191
195
|
);
|
|
192
|
-
|
|
193
|
-
const L = "DialogClose", G =
|
|
194
|
-
(
|
|
195
|
-
const { __scopeDialog: r, ...s } =
|
|
196
|
-
return /* @__PURE__ */
|
|
196
|
+
oo.displayName = S;
|
|
197
|
+
const L = "DialogClose", G = a.forwardRef(
|
|
198
|
+
(o, n) => {
|
|
199
|
+
const { __scopeDialog: r, ...s } = o, e = l(L, r);
|
|
200
|
+
return /* @__PURE__ */ c(
|
|
197
201
|
g.button,
|
|
198
202
|
{
|
|
199
203
|
type: "button",
|
|
200
204
|
...s,
|
|
201
205
|
ref: n,
|
|
202
|
-
onClick:
|
|
206
|
+
onClick: C(o.onClick, () => e.onOpenChange(!1))
|
|
203
207
|
}
|
|
204
208
|
);
|
|
205
209
|
}
|
|
206
210
|
);
|
|
207
211
|
G.displayName = L;
|
|
208
|
-
function
|
|
209
|
-
return
|
|
212
|
+
function E(o) {
|
|
213
|
+
return o ? "open" : "closed";
|
|
210
214
|
}
|
|
211
|
-
const
|
|
215
|
+
const _o = x, Oo = T, Po = A, yo = M, ho = F, Eo = G;
|
|
212
216
|
export {
|
|
213
|
-
|
|
214
|
-
|
|
217
|
+
Eo as Close,
|
|
218
|
+
yo as Content,
|
|
215
219
|
x as Dialog,
|
|
216
220
|
G as DialogClose,
|
|
217
221
|
M as DialogContent,
|
|
218
|
-
|
|
222
|
+
oo as DialogDescription,
|
|
219
223
|
A as DialogOverlay,
|
|
220
224
|
T as DialogPortal,
|
|
221
225
|
F as DialogTitle,
|
|
222
226
|
J as DialogTrigger,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
227
|
+
Po as Overlay,
|
|
228
|
+
Oo as Portal,
|
|
229
|
+
_o as Root,
|
|
230
|
+
ho as Title,
|
|
231
|
+
Ro as createDialogScope
|
|
228
232
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),R=require("@zag-js/file-upload"),r=require("@zag-js/react"),i=require("react"),j=require("./shadow/context.cjs");function s(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const c=s(R),a=s(i),u=a.createContext(null);function x({children:e,accept:o,maxFiles:t,maxFileSize:n,preventDocumentDrop:l,acceptedFiles:d,onFileAccept:p,onFileChange:f,onFileReject:m}){const b=i.useId(),U=j.useShadow(),g=r.useMachine(c.machine,{id:b,accept:o,maxFiles:t,maxFileSize:n,preventDocumentDrop:l,acceptedFiles:d,getRootNode:()=>U?.shadowHost?.shadowRoot??document,onFileAccept:p,onFileChange:f,onFileReject:m}),h=c.connect(g,r.normalizeProps);return w.jsx(u.Provider,{value:h,children:e})}function F(){const e=a.useContext(u);if(!e)throw new Error("useFileUploadApi must be used within FileUploadRoot");return e}exports.FileUploadRoot=x;exports.useFileUploadApi=F;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File upload atom using @zag-js/file-upload.
|
|
3
|
+
* Manages file selection (click + drag-drop), validation, and previews.
|
|
4
|
+
* getRootNode supports Shadow DOM / iframe.
|
|
5
|
+
*
|
|
6
|
+
* Pattern mirrors atoms/combobox.tsx: useMachine inside a React component,
|
|
7
|
+
* context shared to child components via useFileUploadApi().
|
|
8
|
+
*/
|
|
9
|
+
import * as fileUpload from '@zag-js/file-upload';
|
|
10
|
+
import * as React from 'react';
|
|
11
|
+
export type FileUploadApi = fileUpload.Api;
|
|
12
|
+
export interface FileRejection {
|
|
13
|
+
file: File;
|
|
14
|
+
errors: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface FileUploadRootProps {
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
accept?: Record<string, string[]>;
|
|
19
|
+
maxFiles?: number;
|
|
20
|
+
maxFileSize?: number;
|
|
21
|
+
preventDocumentDrop?: boolean;
|
|
22
|
+
/** Controlled file list — when provided the machine syncs to this value. */
|
|
23
|
+
acceptedFiles?: File[];
|
|
24
|
+
onFileAccept?: (details: {
|
|
25
|
+
files: File[];
|
|
26
|
+
}) => void;
|
|
27
|
+
onFileChange?: (details: {
|
|
28
|
+
acceptedFiles: File[];
|
|
29
|
+
}) => void;
|
|
30
|
+
onFileReject?: (details: {
|
|
31
|
+
files: FileRejection[];
|
|
32
|
+
}) => void;
|
|
33
|
+
}
|
|
34
|
+
export declare function FileUploadRoot({ children, accept, maxFiles, maxFileSize, preventDocumentDrop, acceptedFiles, onFileAccept, onFileChange, onFileReject, }: FileUploadRootProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare function useFileUploadApi(): FileUploadApi;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as w } from "react/jsx-runtime";
|
|
3
|
+
import * as t from "@zag-js/file-upload";
|
|
4
|
+
import { useMachine as x, normalizeProps as U } from "@zag-js/react";
|
|
5
|
+
import * as e from "react";
|
|
6
|
+
import { useId as F } from "react";
|
|
7
|
+
import { useShadow as R } from "./shadow/context.js";
|
|
8
|
+
const i = e.createContext(null);
|
|
9
|
+
function b({
|
|
10
|
+
children: o,
|
|
11
|
+
accept: r,
|
|
12
|
+
maxFiles: n,
|
|
13
|
+
maxFileSize: s,
|
|
14
|
+
preventDocumentDrop: a,
|
|
15
|
+
acceptedFiles: c,
|
|
16
|
+
onFileAccept: p,
|
|
17
|
+
onFileChange: l,
|
|
18
|
+
onFileReject: d
|
|
19
|
+
}) {
|
|
20
|
+
const m = F(), u = R(), f = x(t.machine, {
|
|
21
|
+
id: m,
|
|
22
|
+
accept: r,
|
|
23
|
+
maxFiles: n,
|
|
24
|
+
maxFileSize: s,
|
|
25
|
+
preventDocumentDrop: a,
|
|
26
|
+
acceptedFiles: c,
|
|
27
|
+
getRootNode: () => u?.shadowHost?.shadowRoot ?? document,
|
|
28
|
+
onFileAccept: p,
|
|
29
|
+
onFileChange: l,
|
|
30
|
+
onFileReject: d
|
|
31
|
+
}), h = t.connect(
|
|
32
|
+
f,
|
|
33
|
+
U
|
|
34
|
+
);
|
|
35
|
+
return /* @__PURE__ */ w(i.Provider, { value: h, children: o });
|
|
36
|
+
}
|
|
37
|
+
function g() {
|
|
38
|
+
const o = e.useContext(i);
|
|
39
|
+
if (!o) throw new Error("useFileUploadApi must be used within FileUploadRoot");
|
|
40
|
+
return o;
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
b as FileUploadRoot,
|
|
44
|
+
g as useFileUploadApi
|
|
45
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./collections/gr.cjs"),n=require("./collections/bi.cjs"),i=require("./collections/pi.cjs"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./collections/gr.cjs"),n=require("./collections/bi.cjs"),i=require("./collections/pi.cjs"),l=require("./collections/fi.cjs"),o=require("./collections/io5.cjs"),e=require("lucide-react"),t={FaBook:e.BookText,FaGithub:o.IoLogoGithub,FaDatabase:e.Database,FaStackOverflow:o.IoLogoStackoverflow,FaChrome:o.IoLogoChrome,FaPhone:e.Phone,FaEnvelope:e.Mail,FaPencil:e.Pencil,FaBlog:r.GrBlog,FaSort:i.PiCaretUpDownFill,FaPenSquare:e.SquarePen,FaChevronRight:e.ChevronRight,FaChevronUp:e.ChevronUp,FaFilePdf:i.PiFilePdfFill,FaDiscourse:n.BiLogoDiscourse,FaDiscord:n.BiLogoDiscordAlt,FaSlack:o.IoLogoSlack,IoDocumentTextSharp:o.IoDocumentTextSharp,IoDocumentSharp:o.IoDocumentSharp,IoSend:o.IoSend,IoInformationCircleOutline:o.IoInformationCircleOutline,IoLinkOutline:o.IoLinkOutline,IoThumbsUpSharp:o.IoThumbsUpSharp,IoThumbsDownSharp:o.IoThumbsDownSharp,IoSearch:o.IoSearch,IoCopyOutline:o.IoCopyOutline,IoCopy:o.IoCopy,IoReturnDownBackOutline:o.IoReturnDownBackOutline,IoChevronForwardOutline:o.IoChevronForwardOutline,IoReturnDownForward:o.IoReturnDownForward,IoCloseOutline:o.IoCloseOutline,IoCheckmarkOutline:o.IoCheckmarkOutline,IoBookOutline:o.IoBookOutline,IoReaderOutline:o.IoReaderOutline,IoHelpBuoyOutline:o.IoHelpBuoyOutline,IoPeopleOutline:o.IoPeopleOutline,IoDocumentTextOutline:o.IoDocumentTextOutline,IoChatbubblesOutline:o.IoChatbubblesOutline,FaRegFilePdf:i.PiFilePdf,IoLogoDiscord:o.IoLogoDiscord,IoLogoGithub:o.IoLogoGithub,IoTerminal:o.IoTerminal,FaBriefcase:e.BriefcaseBusiness,IoPlayCircleOutline:o.IoPlayCircleOutline,IoPencilOutline:o.IoPencilOutline,IoCheckmarkDoneOutline:o.IoCheckmarkDoneOutline,IoHomeOutline:o.IoHomeOutline,IoMail:o.IoMail,IoOpenOutline:o.IoOpenOutline,FaTelegram:n.BiLogoTelegram,FaTable:e.Table,FaMagnifyingGlass:e.Search,LuArrowLeft:e.ArrowLeft,LuCircleCheck:e.CircleCheck,LuCommand:e.Command,LuCopy:e.Copy,LuCheck:e.Check,LuCornerDownLeft:e.CornerDownLeft,LuGlobe:e.Globe,LuHistory:e.History,LuPanelLeft:e.PanelLeft,LuLink:e.Link,LuRepeat:e.Repeat,LuThumbsDown:e.ThumbsDown,LuThumbsUp:e.ThumbsUp,LuUsers:e.Users,LuUser:e.User,LuArrowUpRight:e.ArrowUpRight,LuBookOpen:e.BookOpen,LuChevronDown:e.ChevronDown,LuLoaderCircle:e.LoaderCircle,FiEdit:l.FiEdit,LuSparkles:e.Sparkles,LuCornerDownRight:e.CornerDownRight,LuCalendar:e.Calendar,LuHeadset:e.Headset,LuSend:e.Send,LuPaperclip:e.Paperclip,PiFileCsv:i.PiFileCsv,PiFileText:i.PiFileText,PiFileHtml:i.PiFileHtml,PiFileMarkdown:i.PiFileMarkdown,PiFileLog:i.PiFileLog,PiFileJson:i.PiFileJson};exports.iconMap=t;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GrBlog as FaBlog } from './collections/gr';
|
|
2
2
|
import { BiLogoDiscordAlt as FaDiscord, BiLogoDiscourse as FaDiscourse, BiLogoTelegram as FaTelegram } from './collections/bi';
|
|
3
|
-
import { PiFilePdfFill as FaFilePdf, PiFilePdf as FaRegFilePdf, PiCaretUpDownFill as FaSort } from './collections/pi';
|
|
3
|
+
import { PiFilePdfFill as FaFilePdf, PiFilePdf as FaRegFilePdf, PiCaretUpDownFill as FaSort, PiFileText, PiFileCsv, PiFileHtml, PiFileMarkdown, PiFileLog, PiFileJson } from './collections/pi';
|
|
4
4
|
import { FiEdit } from './collections/fi';
|
|
5
5
|
import { IoBookOutline, IoChatbubblesOutline, IoCheckmarkDoneOutline, IoCheckmarkOutline, IoChevronForwardOutline, IoCloseOutline, IoCopy, IoCopyOutline, IoDocumentSharp, IoDocumentTextOutline, IoDocumentTextSharp, IoHelpBuoyOutline, IoHomeOutline, IoInformationCircleOutline, IoLinkOutline, IoLogoDiscord, IoLogoGithub, IoMail, IoOpenOutline, IoPencilOutline, IoPeopleOutline, IoPlayCircleOutline, IoReaderOutline, IoReturnDownBackOutline, IoReturnDownForward, IoSearch, IoSend, IoTerminal, IoThumbsDownSharp, IoThumbsUpSharp, IoLogoStackoverflow as FaStackOverflow, IoLogoChrome as FaChrome, IoLogoSlack as FaSlack } from './collections/io5';
|
|
6
6
|
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
@@ -83,4 +83,11 @@ export declare const iconMap: {
|
|
|
83
83
|
LuCalendar: ForwardRefExoticComponent<Omit< LucideProps, "ref"> & RefAttributes<SVGSVGElement>>;
|
|
84
84
|
LuHeadset: ForwardRefExoticComponent<Omit< LucideProps, "ref"> & RefAttributes<SVGSVGElement>>;
|
|
85
85
|
LuSend: ForwardRefExoticComponent<Omit< LucideProps, "ref"> & RefAttributes<SVGSVGElement>>;
|
|
86
|
+
LuPaperclip: ForwardRefExoticComponent<Omit< LucideProps, "ref"> & RefAttributes<SVGSVGElement>>;
|
|
87
|
+
PiFileCsv: typeof PiFileCsv;
|
|
88
|
+
PiFileText: typeof PiFileText;
|
|
89
|
+
PiFileHtml: typeof PiFileHtml;
|
|
90
|
+
PiFileMarkdown: typeof PiFileMarkdown;
|
|
91
|
+
PiFileLog: typeof PiFileLog;
|
|
92
|
+
PiFileJson: typeof PiFileJson;
|
|
86
93
|
};
|
|
@@ -1,89 +1,96 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { GrBlog as e } from "./collections/gr.js";
|
|
3
|
-
import { BiLogoTelegram as r, BiLogoDiscordAlt as
|
|
4
|
-
import { PiFilePdf as
|
|
5
|
-
import { FiEdit as
|
|
6
|
-
import { IoOpenOutline as
|
|
7
|
-
import { Send as
|
|
8
|
-
const
|
|
9
|
-
FaBook:
|
|
3
|
+
import { BiLogoTelegram as r, BiLogoDiscordAlt as i, BiLogoDiscourse as a } from "./collections/bi.js";
|
|
4
|
+
import { PiFileJson as n, PiFileLog as l, PiFileMarkdown as t, PiFileHtml as u, PiFileText as L, PiFileCsv as s, PiFilePdf as h, PiFilePdfFill as p, PiCaretUpDownFill as c } from "./collections/pi.js";
|
|
5
|
+
import { FiEdit as C } from "./collections/fi.js";
|
|
6
|
+
import { IoOpenOutline as F, IoMail as m, IoHomeOutline as I, IoCheckmarkDoneOutline as P, IoPencilOutline as k, IoPlayCircleOutline as d, IoTerminal as D, IoLogoGithub as o, IoLogoDiscord as f, IoChatbubblesOutline as g, IoDocumentTextOutline as O, IoPeopleOutline as w, IoHelpBuoyOutline as S, IoReaderOutline as b, IoBookOutline as B, IoCheckmarkOutline as T, IoCloseOutline as R, IoReturnDownForward as U, IoChevronForwardOutline as v, IoReturnDownBackOutline as y, IoCopy as H, IoCopyOutline as G, IoSearch as x, IoThumbsDownSharp as A, IoThumbsUpSharp as M, IoLinkOutline as q, IoInformationCircleOutline as E, IoSend as J, IoDocumentSharp as j, IoDocumentTextSharp as z, IoLogoSlack as K, IoLogoChrome as N, IoLogoStackoverflow as Q } from "./collections/io5.js";
|
|
7
|
+
import { Paperclip as V, Send as W, Headset as X, Calendar as Y, CornerDownRight as Z, Sparkles as _, LoaderCircle as $, ChevronDown as oo, BookOpen as eo, ArrowUpRight as ro, User as io, Users as ao, ThumbsUp as no, ThumbsDown as lo, Repeat as to, Link as uo, PanelLeft as Lo, History as so, Globe as ho, CornerDownLeft as po, Check as co, Copy as Co, Command as Fo, CircleCheck as mo, ArrowLeft as Io, Search as Po, Table as ko, BriefcaseBusiness as Do, ChevronUp as fo, ChevronRight as go, SquarePen as Oo, Pencil as wo, Mail as So, Phone as bo, Database as Bo, BookText as To } from "lucide-react";
|
|
8
|
+
const xo = {
|
|
9
|
+
FaBook: To,
|
|
10
10
|
FaGithub: o,
|
|
11
|
-
FaDatabase:
|
|
12
|
-
FaStackOverflow:
|
|
13
|
-
FaChrome:
|
|
14
|
-
FaPhone:
|
|
15
|
-
FaEnvelope:
|
|
16
|
-
FaPencil:
|
|
11
|
+
FaDatabase: Bo,
|
|
12
|
+
FaStackOverflow: Q,
|
|
13
|
+
FaChrome: N,
|
|
14
|
+
FaPhone: bo,
|
|
15
|
+
FaEnvelope: So,
|
|
16
|
+
FaPencil: wo,
|
|
17
17
|
FaBlog: e,
|
|
18
|
-
FaSort:
|
|
19
|
-
FaPenSquare:
|
|
20
|
-
FaChevronRight:
|
|
21
|
-
FaChevronUp:
|
|
22
|
-
FaFilePdf:
|
|
18
|
+
FaSort: c,
|
|
19
|
+
FaPenSquare: Oo,
|
|
20
|
+
FaChevronRight: go,
|
|
21
|
+
FaChevronUp: fo,
|
|
22
|
+
FaFilePdf: p,
|
|
23
23
|
FaDiscourse: a,
|
|
24
|
-
FaDiscord:
|
|
25
|
-
FaSlack:
|
|
26
|
-
IoDocumentTextSharp:
|
|
27
|
-
IoDocumentSharp:
|
|
28
|
-
IoSend:
|
|
29
|
-
IoInformationCircleOutline:
|
|
30
|
-
IoLinkOutline:
|
|
31
|
-
IoThumbsUpSharp:
|
|
32
|
-
IoThumbsDownSharp:
|
|
33
|
-
IoSearch:
|
|
34
|
-
IoCopyOutline:
|
|
35
|
-
IoCopy:
|
|
36
|
-
IoReturnDownBackOutline:
|
|
37
|
-
IoChevronForwardOutline:
|
|
38
|
-
IoReturnDownForward:
|
|
39
|
-
IoCloseOutline:
|
|
40
|
-
IoCheckmarkOutline:
|
|
41
|
-
IoBookOutline:
|
|
42
|
-
IoReaderOutline:
|
|
43
|
-
IoHelpBuoyOutline:
|
|
44
|
-
IoPeopleOutline:
|
|
45
|
-
IoDocumentTextOutline:
|
|
46
|
-
IoChatbubblesOutline:
|
|
47
|
-
FaRegFilePdf:
|
|
48
|
-
IoLogoDiscord:
|
|
24
|
+
FaDiscord: i,
|
|
25
|
+
FaSlack: K,
|
|
26
|
+
IoDocumentTextSharp: z,
|
|
27
|
+
IoDocumentSharp: j,
|
|
28
|
+
IoSend: J,
|
|
29
|
+
IoInformationCircleOutline: E,
|
|
30
|
+
IoLinkOutline: q,
|
|
31
|
+
IoThumbsUpSharp: M,
|
|
32
|
+
IoThumbsDownSharp: A,
|
|
33
|
+
IoSearch: x,
|
|
34
|
+
IoCopyOutline: G,
|
|
35
|
+
IoCopy: H,
|
|
36
|
+
IoReturnDownBackOutline: y,
|
|
37
|
+
IoChevronForwardOutline: v,
|
|
38
|
+
IoReturnDownForward: U,
|
|
39
|
+
IoCloseOutline: R,
|
|
40
|
+
IoCheckmarkOutline: T,
|
|
41
|
+
IoBookOutline: B,
|
|
42
|
+
IoReaderOutline: b,
|
|
43
|
+
IoHelpBuoyOutline: S,
|
|
44
|
+
IoPeopleOutline: w,
|
|
45
|
+
IoDocumentTextOutline: O,
|
|
46
|
+
IoChatbubblesOutline: g,
|
|
47
|
+
FaRegFilePdf: h,
|
|
48
|
+
IoLogoDiscord: f,
|
|
49
49
|
IoLogoGithub: o,
|
|
50
|
-
IoTerminal:
|
|
51
|
-
FaBriefcase:
|
|
52
|
-
IoPlayCircleOutline:
|
|
53
|
-
IoPencilOutline:
|
|
54
|
-
IoCheckmarkDoneOutline:
|
|
55
|
-
IoHomeOutline:
|
|
56
|
-
IoMail:
|
|
57
|
-
IoOpenOutline:
|
|
50
|
+
IoTerminal: D,
|
|
51
|
+
FaBriefcase: Do,
|
|
52
|
+
IoPlayCircleOutline: d,
|
|
53
|
+
IoPencilOutline: k,
|
|
54
|
+
IoCheckmarkDoneOutline: P,
|
|
55
|
+
IoHomeOutline: I,
|
|
56
|
+
IoMail: m,
|
|
57
|
+
IoOpenOutline: F,
|
|
58
58
|
FaTelegram: r,
|
|
59
|
-
FaTable:
|
|
60
|
-
FaMagnifyingGlass:
|
|
61
|
-
LuArrowLeft:
|
|
62
|
-
LuCircleCheck:
|
|
63
|
-
LuCommand:
|
|
64
|
-
LuCopy:
|
|
65
|
-
LuCheck:
|
|
66
|
-
LuCornerDownLeft:
|
|
67
|
-
LuGlobe:
|
|
68
|
-
LuHistory:
|
|
69
|
-
LuPanelLeft:
|
|
70
|
-
LuLink:
|
|
71
|
-
LuRepeat:
|
|
72
|
-
LuThumbsDown:
|
|
73
|
-
LuThumbsUp:
|
|
74
|
-
LuUsers:
|
|
75
|
-
LuUser:
|
|
76
|
-
LuArrowUpRight:
|
|
77
|
-
LuBookOpen:
|
|
78
|
-
LuChevronDown:
|
|
79
|
-
LuLoaderCircle:
|
|
80
|
-
FiEdit:
|
|
81
|
-
LuSparkles:
|
|
82
|
-
LuCornerDownRight:
|
|
83
|
-
LuCalendar:
|
|
84
|
-
LuHeadset:
|
|
85
|
-
LuSend:
|
|
59
|
+
FaTable: ko,
|
|
60
|
+
FaMagnifyingGlass: Po,
|
|
61
|
+
LuArrowLeft: Io,
|
|
62
|
+
LuCircleCheck: mo,
|
|
63
|
+
LuCommand: Fo,
|
|
64
|
+
LuCopy: Co,
|
|
65
|
+
LuCheck: co,
|
|
66
|
+
LuCornerDownLeft: po,
|
|
67
|
+
LuGlobe: ho,
|
|
68
|
+
LuHistory: so,
|
|
69
|
+
LuPanelLeft: Lo,
|
|
70
|
+
LuLink: uo,
|
|
71
|
+
LuRepeat: to,
|
|
72
|
+
LuThumbsDown: lo,
|
|
73
|
+
LuThumbsUp: no,
|
|
74
|
+
LuUsers: ao,
|
|
75
|
+
LuUser: io,
|
|
76
|
+
LuArrowUpRight: ro,
|
|
77
|
+
LuBookOpen: eo,
|
|
78
|
+
LuChevronDown: oo,
|
|
79
|
+
LuLoaderCircle: $,
|
|
80
|
+
FiEdit: C,
|
|
81
|
+
LuSparkles: _,
|
|
82
|
+
LuCornerDownRight: Z,
|
|
83
|
+
LuCalendar: Y,
|
|
84
|
+
LuHeadset: X,
|
|
85
|
+
LuSend: W,
|
|
86
|
+
LuPaperclip: V,
|
|
87
|
+
PiFileCsv: s,
|
|
88
|
+
PiFileText: L,
|
|
89
|
+
PiFileHtml: u,
|
|
90
|
+
PiFileMarkdown: t,
|
|
91
|
+
PiFileLog: l,
|
|
92
|
+
PiFileJson: n
|
|
86
93
|
};
|
|
87
94
|
export {
|
|
88
|
-
|
|
95
|
+
xo as iconMap
|
|
89
96
|
};
|