@anvia/react-ui 1.3.0 → 1.3.2
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/attachment/index.d.ts +3 -21
- package/dist/attachment/index.js +3 -12
- package/dist/attachment-By2pged3.js +91 -0
- package/dist/attachment-By2pged3.js.map +1 -0
- package/dist/chat/index.d.ts +3 -152
- package/dist/chat/index.js +3 -25
- package/dist/chat-Dgz8hsVT.js +1210 -0
- package/dist/chat-Dgz8hsVT.js.map +1 -0
- package/dist/completion/index.d.ts +3 -29
- package/dist/completion/index.js +3 -16
- package/dist/completion-DDTKoZRJ.js +124 -0
- package/dist/completion-DDTKoZRJ.js.map +1 -0
- package/dist/connection-DeNq8wHS.js +203 -0
- package/dist/connection-DeNq8wHS.js.map +1 -0
- package/dist/contexts-B4ijG24z.js +212 -0
- package/dist/contexts-B4ijG24z.js.map +1 -0
- package/dist/elements-D4vmkkF8.js +19 -0
- package/dist/elements-D4vmkkF8.js.map +1 -0
- package/dist/graph-explorer/index.d.ts +54 -73
- package/dist/graph-explorer/index.d.ts.map +1 -0
- package/dist/graph-explorer/index.js +181 -248
- package/dist/graph-explorer/index.js.map +1 -1
- package/dist/human-input/index.d.ts +3 -78
- package/dist/human-input/index.js +3 -21
- package/dist/human-input-CsCbZomZ.js +314 -0
- package/dist/human-input-CsCbZomZ.js.map +1 -0
- package/dist/image/index.d.ts +3 -40
- package/dist/image/index.js +3 -12
- package/dist/image-aCWm6hFe.js +303 -0
- package/dist/image-aCWm6hFe.js.map +1 -0
- package/dist/index-B1Qs2Cjv.d.ts +145 -0
- package/dist/index-B1Qs2Cjv.d.ts.map +1 -0
- package/dist/index-BCBVcl0D.d.ts +277 -0
- package/dist/index-BCBVcl0D.d.ts.map +1 -0
- package/dist/index-CE22tsua.d.ts +20 -0
- package/dist/index-CE22tsua.d.ts.map +1 -0
- package/dist/index-CGqtpc6b.d.ts +25 -0
- package/dist/index-CGqtpc6b.d.ts.map +1 -0
- package/dist/index-DqdyM0Jm.d.ts +7 -0
- package/dist/index-DqdyM0Jm.d.ts.map +1 -0
- package/dist/index-Mw3ltwSG.d.ts +318 -0
- package/dist/index-Mw3ltwSG.d.ts.map +1 -0
- package/dist/index.d.ts +7 -40
- package/dist/index.js +34 -118
- package/dist/index.js.map +1 -1
- package/dist/message/index.d.ts +3 -105
- package/dist/message/index.js +3 -20
- package/dist/message-CElFEKgL.js +783 -0
- package/dist/message-CElFEKgL.js.map +1 -0
- package/dist/primitives-xfE7zfwJ.js +15 -0
- package/dist/primitives-xfE7zfwJ.js.map +1 -0
- package/dist/refs-Djj9rSvB.js +10 -0
- package/dist/refs-Djj9rSvB.js.map +1 -0
- package/dist/sandbox-desktop/index.d.ts +100 -104
- package/dist/sandbox-desktop/index.d.ts.map +1 -0
- package/dist/sandbox-desktop/index.js +344 -342
- package/dist/sandbox-desktop/index.js.map +1 -1
- package/dist/sandbox-terminal/index.d.ts +52 -56
- package/dist/sandbox-terminal/index.d.ts.map +1 -0
- package/dist/sandbox-terminal/index.js +217 -208
- package/dist/sandbox-terminal/index.js.map +1 -1
- package/dist/selection-toolbar/index.d.ts +3 -21
- package/dist/selection-toolbar/index.js +3 -13
- package/dist/selection-toolbar-CIkOoM-7.js +171 -0
- package/dist/selection-toolbar-CIkOoM-7.js.map +1 -0
- package/dist/shared-BSYElFU2.d.ts +2 -0
- package/dist/shared.d.ts +4 -14
- package/dist/shared.js +1 -43
- package/dist/stream/index.d.ts +2 -22
- package/dist/stream/index.js +1 -8
- package/dist/stream-CAO0x8_1.js +298 -0
- package/dist/stream-CAO0x8_1.js.map +1 -0
- package/dist/thread-list/index.d.ts +3 -47
- package/dist/thread-list/index.js +3 -18
- package/dist/thread-list-xJbGXFrE.js +228 -0
- package/dist/thread-list-xJbGXFrE.js.map +1 -0
- package/dist/ticket-CoJHBpdF.d.ts +32 -0
- package/dist/ticket-CoJHBpdF.d.ts.map +1 -0
- package/dist/url-CiYZkDks.js +52 -0
- package/dist/url-CiYZkDks.js.map +1 -0
- package/dist/value-BGGrx72L.js +13 -0
- package/dist/value-BGGrx72L.js.map +1 -0
- package/package.json +22 -22
- package/dist/attachment/index.js.map +0 -1
- package/dist/attachment-mbjsroli.d.ts +0 -9
- package/dist/chat/index.js.map +0 -1
- package/dist/chat-PSj1Fo4W.d.ts +0 -88
- package/dist/chunk-22EZJUPM.js +0 -120
- package/dist/chunk-22EZJUPM.js.map +0 -1
- package/dist/chunk-5FZKTDZR.js +0 -201
- package/dist/chunk-5FZKTDZR.js.map +0 -1
- package/dist/chunk-6XOJFLX4.js +0 -22
- package/dist/chunk-6XOJFLX4.js.map +0 -1
- package/dist/chunk-CKA4CE26.js +0 -25
- package/dist/chunk-CKA4CE26.js.map +0 -1
- package/dist/chunk-DLBNFBXQ.js +0 -425
- package/dist/chunk-DLBNFBXQ.js.map +0 -1
- package/dist/chunk-E73S3SOF.js +0 -404
- package/dist/chunk-E73S3SOF.js.map +0 -1
- package/dist/chunk-F6AKBUO3.js +0 -380
- package/dist/chunk-F6AKBUO3.js.map +0 -1
- package/dist/chunk-HGOPGZNQ.js +0 -195
- package/dist/chunk-HGOPGZNQ.js.map +0 -1
- package/dist/chunk-KHB5CHAU.js +0 -220
- package/dist/chunk-KHB5CHAU.js.map +0 -1
- package/dist/chunk-LHABOAOP.js +0 -316
- package/dist/chunk-LHABOAOP.js.map +0 -1
- package/dist/chunk-N5XQU36W.js +0 -410
- package/dist/chunk-N5XQU36W.js.map +0 -1
- package/dist/chunk-T3ZFZ3NP.js +0 -30
- package/dist/chunk-T3ZFZ3NP.js.map +0 -1
- package/dist/chunk-T4IYUEPH.js +0 -1612
- package/dist/chunk-T4IYUEPH.js.map +0 -1
- package/dist/chunk-W2AHKMRS.js +0 -1092
- package/dist/chunk-W2AHKMRS.js.map +0 -1
- package/dist/completion/index.js.map +0 -1
- package/dist/completion-input-DHlwrhxB.d.ts +0 -24
- package/dist/composer-6iCSIq6L.d.ts +0 -111
- package/dist/human-input/index.js.map +0 -1
- package/dist/human-input-CkLrZ8IC.d.ts +0 -27
- package/dist/image/index.js.map +0 -1
- package/dist/image-VZv6Ddsn.d.ts +0 -14
- package/dist/message/index.js.map +0 -1
- package/dist/message-CNRnZQwU.d.ts +0 -14
- package/dist/render-CRKWam2v.d.ts +0 -8
- package/dist/selection-toolbar/index.js.map +0 -1
- package/dist/selection-toolbar-Cwjbuv5S.d.ts +0 -14
- package/dist/shared.js.map +0 -1
- package/dist/stream/index.js.map +0 -1
- package/dist/thread-Bz6-1zaJ.d.ts +0 -12
- package/dist/thread-list/index.js.map +0 -1
- package/dist/thread-list-On8db4XL.d.ts +0 -34
- package/dist/ticket-pexI1zIa.d.ts +0 -33
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { B as useOptionalAttachment, _ as useImage, g as InternalImageProvider } from "./contexts-B4ijG24z.js";
|
|
2
|
+
import { t as composeRefs } from "./refs-Djj9rSvB.js";
|
|
3
|
+
import { t as renderPrimitive } from "./primitives-xfE7zfwJ.js";
|
|
4
|
+
import { t as safeImageSrc } from "./url-CiYZkDks.js";
|
|
5
|
+
import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
6
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { createPortal } from "react-dom";
|
|
8
|
+
// src/image/parts.tsx
|
|
9
|
+
const ImageRoot = forwardRef(function ImageRoot({ attachment: attachmentProp, children, renderWhen = "image", ...props }, ref) {
|
|
10
|
+
const attachmentContext = useOptionalAttachment();
|
|
11
|
+
const attachment = attachmentProp ?? attachmentContext?.attachment;
|
|
12
|
+
const [zoomOpen, setZoomOpen] = useState(false);
|
|
13
|
+
if (attachment === void 0) throw new Error("ImagePrimitive.Root requires an attachment prop or AttachmentPrimitive context.");
|
|
14
|
+
const src = imageSource(attachment);
|
|
15
|
+
const isImage = isImageAttachment(attachment);
|
|
16
|
+
const value = useMemo(() => {
|
|
17
|
+
const context = {
|
|
18
|
+
attachment,
|
|
19
|
+
isImage,
|
|
20
|
+
zoomOpen,
|
|
21
|
+
setZoomOpen
|
|
22
|
+
};
|
|
23
|
+
if (src !== void 0) context.src = src;
|
|
24
|
+
if (attachment.name !== void 0) context.name = attachment.name;
|
|
25
|
+
if (attachment.mediaType !== void 0) context.mediaType = attachment.mediaType;
|
|
26
|
+
return context;
|
|
27
|
+
}, [
|
|
28
|
+
attachment,
|
|
29
|
+
isImage,
|
|
30
|
+
src,
|
|
31
|
+
zoomOpen
|
|
32
|
+
]);
|
|
33
|
+
if (!isImage && renderWhen !== "always") return null;
|
|
34
|
+
const renderedChildren = typeof children === "function" ? children(value) : children;
|
|
35
|
+
return /* @__PURE__ */ jsx(InternalImageProvider, {
|
|
36
|
+
value,
|
|
37
|
+
children: renderPrimitive("figure", {
|
|
38
|
+
...props,
|
|
39
|
+
children: renderedChildren ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ImagePreview, {}), /* @__PURE__ */ jsx(ImageName, {})] }),
|
|
40
|
+
"data-state": src === void 0 ? "unavailable" : "ready"
|
|
41
|
+
}, ref)
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
const ImagePreview = forwardRef(function ImagePreview({ alt, errorFallback, loadingFallback, ...props }, ref) {
|
|
45
|
+
const image = useImage();
|
|
46
|
+
const src = image.src;
|
|
47
|
+
const [state, setState] = useState(src === void 0 ? "error" : "loading");
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
setState(src === void 0 ? "error" : "loading");
|
|
50
|
+
}, [src]);
|
|
51
|
+
const fallback = state === "loading" ? loadingFallback ?? "Loading image" : state === "error" ? errorFallback ?? "Image unavailable" : null;
|
|
52
|
+
return renderPrimitive("div", {
|
|
53
|
+
...props,
|
|
54
|
+
children: src === void 0 ? fallback : /* @__PURE__ */ jsxs(Fragment$1, { children: [state === "ready" ? null : /* @__PURE__ */ jsx("span", { children: fallback }), /* @__PURE__ */ jsx("img", {
|
|
55
|
+
alt: alt ?? image.name ?? "Image",
|
|
56
|
+
hidden: state !== "ready",
|
|
57
|
+
onError: () => setState("error"),
|
|
58
|
+
onLoad: () => setState("ready"),
|
|
59
|
+
src
|
|
60
|
+
})] }),
|
|
61
|
+
"data-state": state
|
|
62
|
+
}, ref);
|
|
63
|
+
});
|
|
64
|
+
const ImageName = forwardRef(function ImageName(props, ref) {
|
|
65
|
+
const image = useImage();
|
|
66
|
+
return renderPrimitive("figcaption", {
|
|
67
|
+
...props,
|
|
68
|
+
children: props.children ?? image.name ?? image.mediaType ?? image.attachment.type
|
|
69
|
+
}, ref);
|
|
70
|
+
});
|
|
71
|
+
const ImageActions = forwardRef(function ImageActions(props, ref) {
|
|
72
|
+
return renderPrimitive("div", { ...props }, ref);
|
|
73
|
+
});
|
|
74
|
+
const ImageCopy = forwardRef(function ImageCopy({ onClick, ...props }, ref) {
|
|
75
|
+
const image = useImage();
|
|
76
|
+
const [copyState, setCopyState] = useState("idle");
|
|
77
|
+
const disabled = props.disabled ?? image.src === void 0;
|
|
78
|
+
const handleClick = useCallback(async (event) => {
|
|
79
|
+
onClick?.(event);
|
|
80
|
+
if (event.defaultPrevented || disabled || image.src === void 0) return;
|
|
81
|
+
try {
|
|
82
|
+
await copyImage(image);
|
|
83
|
+
setCopyState("done");
|
|
84
|
+
} catch {
|
|
85
|
+
setCopyState("error");
|
|
86
|
+
}
|
|
87
|
+
}, [
|
|
88
|
+
disabled,
|
|
89
|
+
image,
|
|
90
|
+
onClick
|
|
91
|
+
]);
|
|
92
|
+
return renderPrimitive("button", {
|
|
93
|
+
...props,
|
|
94
|
+
children: props.children ?? "Copy image",
|
|
95
|
+
disabled,
|
|
96
|
+
onClick: handleClick,
|
|
97
|
+
type: props.type ?? "button",
|
|
98
|
+
"data-state": copyState
|
|
99
|
+
}, ref);
|
|
100
|
+
});
|
|
101
|
+
const ImageDownload = forwardRef(function ImageDownload({ filename, onClick, ...props }, ref) {
|
|
102
|
+
const image = useImage();
|
|
103
|
+
const disabled = props.disabled ?? image.src === void 0;
|
|
104
|
+
const handleClick = useCallback(async (event) => {
|
|
105
|
+
onClick?.(event);
|
|
106
|
+
if (event.defaultPrevented || disabled || image.src === void 0) return;
|
|
107
|
+
try {
|
|
108
|
+
await downloadImage(image, filename);
|
|
109
|
+
} catch {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
}, [
|
|
113
|
+
disabled,
|
|
114
|
+
filename,
|
|
115
|
+
image,
|
|
116
|
+
onClick
|
|
117
|
+
]);
|
|
118
|
+
return renderPrimitive("button", {
|
|
119
|
+
...props,
|
|
120
|
+
children: props.children ?? "Download",
|
|
121
|
+
disabled,
|
|
122
|
+
onClick: handleClick,
|
|
123
|
+
type: props.type ?? "button",
|
|
124
|
+
"data-state": disabled ? "disabled" : "enabled"
|
|
125
|
+
}, ref);
|
|
126
|
+
});
|
|
127
|
+
const ImageZoomTrigger = forwardRef(function ImageZoomTrigger({ onClick, ...props }, ref) {
|
|
128
|
+
const image = useImage();
|
|
129
|
+
const disabled = props.disabled ?? image.src === void 0;
|
|
130
|
+
const handleClick = useCallback((event) => {
|
|
131
|
+
onClick?.(event);
|
|
132
|
+
if (event.defaultPrevented || disabled) return;
|
|
133
|
+
image.setZoomOpen(true);
|
|
134
|
+
}, [
|
|
135
|
+
disabled,
|
|
136
|
+
image,
|
|
137
|
+
onClick
|
|
138
|
+
]);
|
|
139
|
+
return renderPrimitive("button", {
|
|
140
|
+
...props,
|
|
141
|
+
children: props.children ?? "Open image",
|
|
142
|
+
disabled,
|
|
143
|
+
onClick: handleClick,
|
|
144
|
+
type: props.type ?? "button",
|
|
145
|
+
"data-state": disabled ? "disabled" : "enabled"
|
|
146
|
+
}, ref);
|
|
147
|
+
});
|
|
148
|
+
const ImageZoomOverlay = forwardRef(function ImageZoomOverlay({ container, onClick, onKeyDown, ...props }, ref) {
|
|
149
|
+
const image = useImage();
|
|
150
|
+
const portalContainer = container ?? globalThis.document?.body;
|
|
151
|
+
const overlayRef = useRef(null);
|
|
152
|
+
const composedRef = useMemo(() => composeRefs(overlayRef, ref), [ref]);
|
|
153
|
+
useEffect(() => {
|
|
154
|
+
if (!image.zoomOpen) return;
|
|
155
|
+
const document = globalThis.document;
|
|
156
|
+
if (document === void 0) return;
|
|
157
|
+
const handleKeyDown = (event) => {
|
|
158
|
+
if (event.key === "Escape") image.setZoomOpen(false);
|
|
159
|
+
};
|
|
160
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
161
|
+
return () => {
|
|
162
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
163
|
+
};
|
|
164
|
+
}, [image]);
|
|
165
|
+
useEffect(() => {
|
|
166
|
+
if (!image.zoomOpen) return;
|
|
167
|
+
const activeElement = globalThis.document?.activeElement;
|
|
168
|
+
const previousFocus = activeElement instanceof HTMLElement ? activeElement : void 0;
|
|
169
|
+
focusOverlay(overlayRef.current);
|
|
170
|
+
return () => {
|
|
171
|
+
if (previousFocus?.isConnected === true) previousFocus.focus();
|
|
172
|
+
};
|
|
173
|
+
}, [image.zoomOpen]);
|
|
174
|
+
const handleClick = useCallback((event) => {
|
|
175
|
+
onClick?.(event);
|
|
176
|
+
if (!event.defaultPrevented) image.setZoomOpen(false);
|
|
177
|
+
}, [image, onClick]);
|
|
178
|
+
const handleKeyDown = useCallback((event) => {
|
|
179
|
+
onKeyDown?.(event);
|
|
180
|
+
if (event.defaultPrevented) return;
|
|
181
|
+
if (event.key === "Escape") {
|
|
182
|
+
image.setZoomOpen(false);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (event.key === "Tab") trapOverlayFocus(event, overlayRef.current);
|
|
186
|
+
}, [image, onKeyDown]);
|
|
187
|
+
if (!image.zoomOpen || image.src === void 0 || portalContainer === void 0) return null;
|
|
188
|
+
const overlay = renderPrimitive("div", {
|
|
189
|
+
...props,
|
|
190
|
+
children: /* @__PURE__ */ jsx("img", {
|
|
191
|
+
alt: image.name ?? "Image",
|
|
192
|
+
src: image.src
|
|
193
|
+
}),
|
|
194
|
+
onClick: handleClick,
|
|
195
|
+
onKeyDown: handleKeyDown,
|
|
196
|
+
"aria-modal": props["aria-modal"] ?? true,
|
|
197
|
+
role: props.role ?? "dialog",
|
|
198
|
+
tabIndex: props.tabIndex ?? -1
|
|
199
|
+
}, composedRef);
|
|
200
|
+
return createPortal(overlay, portalContainer);
|
|
201
|
+
});
|
|
202
|
+
function isImageAttachment(attachment) {
|
|
203
|
+
return attachment.type === "image" || attachment.mediaType?.startsWith("image/") === true;
|
|
204
|
+
}
|
|
205
|
+
function imageSource(attachment) {
|
|
206
|
+
if (!isImageAttachment(attachment)) return safeImageSrc(attachment.url);
|
|
207
|
+
if (attachment.url !== void 0) return safeImageSrc(attachment.url);
|
|
208
|
+
if (attachment.data !== void 0 && attachment.mediaType !== void 0) return safeImageSrc(`data:${attachment.mediaType};base64,${attachment.data}`);
|
|
209
|
+
}
|
|
210
|
+
async function copyImage(image) {
|
|
211
|
+
if (image.src === void 0) throw new Error("Image source is unavailable.");
|
|
212
|
+
const clipboard = globalThis.navigator?.clipboard;
|
|
213
|
+
const ClipboardItemConstructor = globalThis.ClipboardItem;
|
|
214
|
+
if (clipboard?.write === void 0 || ClipboardItemConstructor === void 0) throw new Error("Clipboard image copy is unavailable.");
|
|
215
|
+
const blob = await imageBlob(image);
|
|
216
|
+
await clipboard.write([new ClipboardItemConstructor({ [blob.type]: blob })]);
|
|
217
|
+
}
|
|
218
|
+
async function imageBlob(image) {
|
|
219
|
+
if (image.attachment.data !== void 0) return base64ToBlob(image.attachment.data, image.attachment.mediaType ?? image.mediaType ?? "image/png");
|
|
220
|
+
if (image.src === void 0 || globalThis.fetch === void 0) throw new Error("Image source is unavailable.");
|
|
221
|
+
return (await fetch(image.src)).blob();
|
|
222
|
+
}
|
|
223
|
+
function base64ToBlob(data, mediaType) {
|
|
224
|
+
const binary = globalThis.atob(data);
|
|
225
|
+
const bytes = new Uint8Array(binary.length);
|
|
226
|
+
for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);
|
|
227
|
+
return new Blob([bytes], { type: mediaType });
|
|
228
|
+
}
|
|
229
|
+
async function downloadImage(image, filename) {
|
|
230
|
+
const document = globalThis.document;
|
|
231
|
+
const url = globalThis.URL;
|
|
232
|
+
if (image.src === void 0 || document === void 0 || url?.createObjectURL === void 0) return;
|
|
233
|
+
const blobUrl = url.createObjectURL(await imageBlob(image));
|
|
234
|
+
const link = document.createElement("a");
|
|
235
|
+
try {
|
|
236
|
+
link.href = blobUrl;
|
|
237
|
+
link.download = filename ?? image.name ?? defaultImageFilename(image);
|
|
238
|
+
link.rel = "noopener";
|
|
239
|
+
document.body.append(link);
|
|
240
|
+
link.click();
|
|
241
|
+
} finally {
|
|
242
|
+
link.remove();
|
|
243
|
+
url.revokeObjectURL(blobUrl);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
function defaultImageFilename(image) {
|
|
247
|
+
return `image.${image.mediaType?.split("/")[1]?.split(";")[0] ?? "png"}`;
|
|
248
|
+
}
|
|
249
|
+
function focusOverlay(overlay) {
|
|
250
|
+
if (overlay === null) return;
|
|
251
|
+
const [firstFocusable] = focusableElements(overlay);
|
|
252
|
+
(firstFocusable ?? overlay).focus();
|
|
253
|
+
}
|
|
254
|
+
function trapOverlayFocus(event, overlay) {
|
|
255
|
+
if (overlay === null) return;
|
|
256
|
+
const focusable = focusableElements(overlay);
|
|
257
|
+
if (focusable.length === 0) {
|
|
258
|
+
event.preventDefault();
|
|
259
|
+
overlay.focus();
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const firstFocusable = focusable[0];
|
|
263
|
+
const lastFocusable = focusable[focusable.length - 1];
|
|
264
|
+
const activeElement = globalThis.document?.activeElement;
|
|
265
|
+
if (event.shiftKey && activeElement === firstFocusable) {
|
|
266
|
+
event.preventDefault();
|
|
267
|
+
lastFocusable?.focus();
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
if (!event.shiftKey && activeElement === lastFocusable) {
|
|
271
|
+
event.preventDefault();
|
|
272
|
+
firstFocusable?.focus();
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
if (activeElement instanceof Node && !overlay.contains(activeElement)) {
|
|
276
|
+
event.preventDefault();
|
|
277
|
+
(event.shiftKey ? lastFocusable : firstFocusable)?.focus();
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
function focusableElements(container) {
|
|
281
|
+
return Array.from(container.querySelectorAll([
|
|
282
|
+
"a[href]",
|
|
283
|
+
"button:not(:disabled)",
|
|
284
|
+
"input:not(:disabled)",
|
|
285
|
+
"select:not(:disabled)",
|
|
286
|
+
"textarea:not(:disabled)",
|
|
287
|
+
"[tabindex]"
|
|
288
|
+
].join(","))).filter((element) => element.tabIndex >= 0 && element.getAttribute("aria-hidden") !== "true");
|
|
289
|
+
}
|
|
290
|
+
// src/image/index.ts
|
|
291
|
+
const ImagePrimitive = {
|
|
292
|
+
Root: ImageRoot,
|
|
293
|
+
Preview: ImagePreview,
|
|
294
|
+
Name: ImageName,
|
|
295
|
+
Actions: ImageActions,
|
|
296
|
+
Copy: ImageCopy,
|
|
297
|
+
Download: ImageDownload,
|
|
298
|
+
ZoomTrigger: ImageZoomTrigger,
|
|
299
|
+
ZoomOverlay: ImageZoomOverlay
|
|
300
|
+
};
|
|
301
|
+
export { ImagePrimitive as t };
|
|
302
|
+
|
|
303
|
+
//# sourceMappingURL=image-aCWm6hFe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-aCWm6hFe.js","names":[],"sources":["../src/image/parts.tsx","../src/image/index.ts"],"sourcesContent":["import type { UIAttachment } from \"@anvia/client\";\nimport {\n forwardRef,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport {\n type ImageContextValue,\n InternalImageProvider,\n useImage,\n useOptionalAttachment,\n} from \"../contexts\";\nimport { composeRefs, type PrimitiveProps, renderPrimitive } from \"../primitives\";\nimport { safeImageSrc } from \"../url\";\n\ntype ImageRootChildren = ReactNode | ((image: ImageContextValue) => ReactNode);\ntype ImageRenderWhen = \"image\" | \"always\";\n\ntype ImageRootProps = Omit<PrimitiveProps<\"figure\">, \"children\"> & {\n attachment?: UIAttachment;\n children?: ImageRootChildren;\n renderWhen?: ImageRenderWhen;\n};\n\nconst ImageRoot = forwardRef<HTMLElement, ImageRootProps>(function ImageRoot(\n { attachment: attachmentProp, children, renderWhen = \"image\", ...props },\n ref,\n) {\n const attachmentContext = useOptionalAttachment();\n const attachment = attachmentProp ?? attachmentContext?.attachment;\n const [zoomOpen, setZoomOpen] = useState(false);\n\n if (attachment === undefined) {\n throw new Error(\n \"ImagePrimitive.Root requires an attachment prop or AttachmentPrimitive context.\",\n );\n }\n\n const src = imageSource(attachment);\n const isImage = isImageAttachment(attachment);\n const value = useMemo<ImageContextValue>(() => {\n const context: ImageContextValue = {\n attachment,\n isImage,\n zoomOpen,\n setZoomOpen,\n };\n if (src !== undefined) context.src = src;\n if (attachment.name !== undefined) context.name = attachment.name;\n if (attachment.mediaType !== undefined) context.mediaType = attachment.mediaType;\n return context;\n }, [attachment, isImage, src, zoomOpen]);\n if (!isImage && renderWhen !== \"always\") {\n return null;\n }\n\n const renderedChildren = typeof children === \"function\" ? children(value) : children;\n\n return (\n <InternalImageProvider value={value}>\n {renderPrimitive(\n \"figure\",\n {\n ...props,\n children: renderedChildren ?? (\n <>\n <ImagePreview />\n <ImageName />\n </>\n ),\n \"data-state\": src === undefined ? \"unavailable\" : \"ready\",\n } as PrimitiveProps<\"figure\">,\n ref,\n )}\n </InternalImageProvider>\n );\n});\n\ntype ImagePreviewProps = Omit<PrimitiveProps<\"div\">, \"children\"> & {\n alt?: string;\n errorFallback?: ReactNode;\n loadingFallback?: ReactNode;\n};\n\nconst ImagePreview = forwardRef<HTMLDivElement, ImagePreviewProps>(function ImagePreview(\n { alt, errorFallback, loadingFallback, ...props },\n ref,\n) {\n const image = useImage();\n const src = image.src;\n const [state, setState] = useState<\"loading\" | \"ready\" | \"error\">(\n src === undefined ? \"error\" : \"loading\",\n );\n\n useEffect(() => {\n setState(src === undefined ? \"error\" : \"loading\");\n }, [src]);\n\n const fallback =\n state === \"loading\"\n ? (loadingFallback ?? \"Loading image\")\n : state === \"error\"\n ? (errorFallback ?? \"Image unavailable\")\n : null;\n\n return renderPrimitive(\n \"div\",\n {\n ...props,\n children:\n src === undefined ? (\n fallback\n ) : (\n <>\n {state === \"ready\" ? null : <span>{fallback}</span>}\n <img\n alt={alt ?? image.name ?? \"Image\"}\n hidden={state !== \"ready\"}\n onError={() => setState(\"error\")}\n onLoad={() => setState(\"ready\")}\n src={src}\n />\n </>\n ),\n \"data-state\": state,\n } as PrimitiveProps<\"div\">,\n ref,\n );\n});\n\nconst ImageName = forwardRef<HTMLElement, PrimitiveProps<\"figcaption\">>(\n function ImageName(props, ref) {\n const image = useImage();\n\n return renderPrimitive(\n \"figcaption\",\n {\n ...props,\n children: props.children ?? image.name ?? image.mediaType ?? image.attachment.type,\n } as PrimitiveProps<\"figcaption\">,\n ref,\n );\n },\n);\n\nconst ImageActions = forwardRef<HTMLDivElement, PrimitiveProps<\"div\">>(\n function ImageActions(props, ref) {\n return renderPrimitive(\n \"div\",\n {\n ...props,\n } as PrimitiveProps<\"div\">,\n ref,\n );\n },\n);\n\ntype ImageActionState = \"idle\" | \"done\" | \"error\";\n\nconst ImageCopy = forwardRef<HTMLButtonElement, PrimitiveProps<\"button\">>(function ImageCopy(\n { onClick, ...props },\n ref,\n) {\n const image = useImage();\n const [copyState, setCopyState] = useState<ImageActionState>(\"idle\");\n const disabled = props.disabled ?? image.src === undefined;\n\n const handleClick = useCallback(\n async (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (event.defaultPrevented || disabled || image.src === undefined) {\n return;\n }\n try {\n await copyImage(image);\n setCopyState(\"done\");\n } catch {\n setCopyState(\"error\");\n }\n },\n [disabled, image, onClick],\n );\n\n return renderPrimitive(\n \"button\",\n {\n ...props,\n children: props.children ?? \"Copy image\",\n disabled,\n onClick: handleClick,\n type: props.type ?? \"button\",\n \"data-state\": copyState,\n } as PrimitiveProps<\"button\">,\n ref,\n );\n});\n\ntype ImageDownloadProps = PrimitiveProps<\"button\"> & {\n filename?: string;\n};\n\nconst ImageDownload = forwardRef<HTMLButtonElement, ImageDownloadProps>(function ImageDownload(\n { filename, onClick, ...props },\n ref,\n) {\n const image = useImage();\n const disabled = props.disabled ?? image.src === undefined;\n\n const handleClick = useCallback(\n async (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (event.defaultPrevented || disabled || image.src === undefined) {\n return;\n }\n try {\n await downloadImage(image, filename);\n } catch {\n return;\n }\n },\n [disabled, filename, image, onClick],\n );\n\n return renderPrimitive(\n \"button\",\n {\n ...props,\n children: props.children ?? \"Download\",\n disabled,\n onClick: handleClick,\n type: props.type ?? \"button\",\n \"data-state\": disabled ? \"disabled\" : \"enabled\",\n } as PrimitiveProps<\"button\">,\n ref,\n );\n});\n\nconst ImageZoomTrigger = forwardRef<HTMLButtonElement, PrimitiveProps<\"button\">>(\n function ImageZoomTrigger({ onClick, ...props }, ref) {\n const image = useImage();\n const disabled = props.disabled ?? image.src === undefined;\n\n const handleClick = useCallback(\n (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (event.defaultPrevented || disabled) {\n return;\n }\n image.setZoomOpen(true);\n },\n [disabled, image, onClick],\n );\n\n return renderPrimitive(\n \"button\",\n {\n ...props,\n children: props.children ?? \"Open image\",\n disabled,\n onClick: handleClick,\n type: props.type ?? \"button\",\n \"data-state\": disabled ? \"disabled\" : \"enabled\",\n } as PrimitiveProps<\"button\">,\n ref,\n );\n },\n);\n\ntype ImageZoomOverlayProps = Omit<PrimitiveProps<\"div\">, \"children\"> & {\n container?: Element | DocumentFragment;\n};\n\nconst ImageZoomOverlay = forwardRef<HTMLDivElement, ImageZoomOverlayProps>(\n function ImageZoomOverlay({ container, onClick, onKeyDown, ...props }, ref) {\n const image = useImage();\n const portalContainer = container ?? globalThis.document?.body;\n const overlayRef = useRef<HTMLDivElement | null>(null);\n const composedRef = useMemo(() => composeRefs(overlayRef, ref), [ref]);\n\n useEffect(() => {\n if (!image.zoomOpen) {\n return;\n }\n const document = globalThis.document;\n if (document === undefined) {\n return;\n }\n const handleKeyDown = (event: globalThis.KeyboardEvent) => {\n if (event.key === \"Escape\") {\n image.setZoomOpen(false);\n }\n };\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown);\n };\n }, [image]);\n\n useEffect(() => {\n if (!image.zoomOpen) {\n return;\n }\n const activeElement = globalThis.document?.activeElement;\n const previousFocus = activeElement instanceof HTMLElement ? activeElement : undefined;\n focusOverlay(overlayRef.current);\n return () => {\n if (previousFocus?.isConnected === true) {\n previousFocus.focus();\n }\n };\n }, [image.zoomOpen]);\n\n const handleClick = useCallback(\n (event: MouseEvent<HTMLDivElement>) => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n image.setZoomOpen(false);\n }\n },\n [image, onClick],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented) {\n return;\n }\n if (event.key === \"Escape\") {\n image.setZoomOpen(false);\n return;\n }\n if (event.key === \"Tab\") {\n trapOverlayFocus(event, overlayRef.current);\n }\n },\n [image, onKeyDown],\n );\n\n if (!image.zoomOpen || image.src === undefined || portalContainer === undefined) {\n return null;\n }\n\n const overlay = renderPrimitive(\n \"div\",\n {\n ...props,\n children: <img alt={image.name ?? \"Image\"} src={image.src} />,\n onClick: handleClick,\n onKeyDown: handleKeyDown,\n \"aria-modal\": props[\"aria-modal\"] ?? true,\n role: props.role ?? \"dialog\",\n tabIndex: props.tabIndex ?? -1,\n } as PrimitiveProps<\"div\">,\n composedRef,\n );\n\n return createPortal(overlay, portalContainer);\n },\n);\n\nfunction isImageAttachment(attachment: UIAttachment): boolean {\n return attachment.type === \"image\" || attachment.mediaType?.startsWith(\"image/\") === true;\n}\n\nfunction imageSource(attachment: UIAttachment): string | undefined {\n if (!isImageAttachment(attachment)) {\n return safeImageSrc(attachment.url);\n }\n if (attachment.url !== undefined) {\n return safeImageSrc(attachment.url);\n }\n if (attachment.data !== undefined && attachment.mediaType !== undefined) {\n return safeImageSrc(`data:${attachment.mediaType};base64,${attachment.data}`);\n }\n return undefined;\n}\n\nasync function copyImage(image: ImageContextValue): Promise<void> {\n if (image.src === undefined) {\n throw new Error(\"Image source is unavailable.\");\n }\n const clipboard = globalThis.navigator?.clipboard as\n | (Clipboard & { write?: (items: ClipboardItem[]) => Promise<void> })\n | undefined;\n const ClipboardItemConstructor = globalThis.ClipboardItem;\n if (clipboard?.write === undefined || ClipboardItemConstructor === undefined) {\n throw new Error(\"Clipboard image copy is unavailable.\");\n }\n const blob = await imageBlob(image);\n await clipboard.write([new ClipboardItemConstructor({ [blob.type]: blob })]);\n}\n\nasync function imageBlob(image: ImageContextValue): Promise<Blob> {\n if (image.attachment.data !== undefined) {\n return base64ToBlob(\n image.attachment.data,\n image.attachment.mediaType ?? image.mediaType ?? \"image/png\",\n );\n }\n if (image.src === undefined || globalThis.fetch === undefined) {\n throw new Error(\"Image source is unavailable.\");\n }\n const response = await fetch(image.src);\n return response.blob();\n}\n\nfunction base64ToBlob(data: string, mediaType: string): Blob {\n const binary = globalThis.atob(data);\n const bytes = new Uint8Array(binary.length);\n for (let index = 0; index < binary.length; index += 1) {\n bytes[index] = binary.charCodeAt(index);\n }\n return new Blob([bytes], { type: mediaType });\n}\n\nasync function downloadImage(\n image: ImageContextValue,\n filename: string | undefined,\n): Promise<void> {\n const document = globalThis.document;\n const url = globalThis.URL;\n if (image.src === undefined || document === undefined || url?.createObjectURL === undefined) {\n return;\n }\n const blobUrl = url.createObjectURL(await imageBlob(image));\n const link = document.createElement(\"a\");\n try {\n link.href = blobUrl;\n link.download = filename ?? image.name ?? defaultImageFilename(image);\n link.rel = \"noopener\";\n document.body.append(link);\n link.click();\n } finally {\n link.remove();\n url.revokeObjectURL(blobUrl);\n }\n}\n\nfunction defaultImageFilename(image: ImageContextValue): string {\n const extension = image.mediaType?.split(\"/\")[1]?.split(\";\")[0] ?? \"png\";\n return `image.${extension}`;\n}\n\nfunction focusOverlay(overlay: HTMLDivElement | null): void {\n if (overlay === null) {\n return;\n }\n const [firstFocusable] = focusableElements(overlay);\n (firstFocusable ?? overlay).focus();\n}\n\nfunction trapOverlayFocus(\n event: KeyboardEvent<HTMLDivElement>,\n overlay: HTMLDivElement | null,\n): void {\n if (overlay === null) {\n return;\n }\n const focusable = focusableElements(overlay);\n if (focusable.length === 0) {\n event.preventDefault();\n overlay.focus();\n return;\n }\n\n const firstFocusable = focusable[0];\n const lastFocusable = focusable[focusable.length - 1];\n const activeElement = globalThis.document?.activeElement;\n if (event.shiftKey && activeElement === firstFocusable) {\n event.preventDefault();\n lastFocusable?.focus();\n return;\n }\n if (!event.shiftKey && activeElement === lastFocusable) {\n event.preventDefault();\n firstFocusable?.focus();\n return;\n }\n if (activeElement instanceof Node && !overlay.contains(activeElement)) {\n event.preventDefault();\n (event.shiftKey ? lastFocusable : firstFocusable)?.focus();\n }\n}\n\nfunction focusableElements(container: HTMLElement): HTMLElement[] {\n return Array.from(\n container.querySelectorAll<HTMLElement>(\n [\n \"a[href]\",\n \"button:not(:disabled)\",\n \"input:not(:disabled)\",\n \"select:not(:disabled)\",\n \"textarea:not(:disabled)\",\n \"[tabindex]\",\n ].join(\",\"),\n ),\n ).filter((element) => element.tabIndex >= 0 && element.getAttribute(\"aria-hidden\") !== \"true\");\n}\n\nexport {\n ImageActions,\n ImageCopy,\n ImageDownload,\n ImageName,\n ImagePreview,\n ImageRoot,\n ImageZoomOverlay,\n ImageZoomTrigger,\n};\n","import {\n ImageActions,\n ImageCopy,\n ImageDownload,\n ImageName,\n ImagePreview,\n ImageRoot,\n ImageZoomOverlay,\n ImageZoomTrigger,\n} from \"./parts\";\n\nexport const ImagePrimitive = {\n Root: ImageRoot,\n Preview: ImagePreview,\n Name: ImageName,\n Actions: ImageActions,\n Copy: ImageCopy,\n Download: ImageDownload,\n ZoomTrigger: ImageZoomTrigger,\n ZoomOverlay: ImageZoomOverlay,\n} as const;\n\nexport type { ImageContextValue } from \"../contexts\";\nexport { useImage } from \"../contexts\";\n"],"mappings":";;;;;;;;AAgCA,MAAM,YAAY,WAAwC,SAAS,UACjE,EAAE,YAAY,gBAAgB,UAAU,aAAa,SAAS,GAAG,SACjE,KACA;CACA,MAAM,oBAAoB,sBAAsB;CAChD,MAAM,aAAa,kBAAkB,mBAAmB;CACxD,MAAM,CAAC,UAAU,eAAe,SAAS,KAAK;CAE9C,IAAI,eAAe,KAAA,GACjB,MAAM,IAAI,MACR,iFACF;CAGF,MAAM,MAAM,YAAY,UAAU;CAClC,MAAM,UAAU,kBAAkB,UAAU;CAC5C,MAAM,QAAQ,cAAiC;EAC7C,MAAM,UAA6B;GACjC;GACA;GACA;GACA;EACF;EACA,IAAI,QAAQ,KAAA,GAAW,QAAQ,MAAM;EACrC,IAAI,WAAW,SAAS,KAAA,GAAW,QAAQ,OAAO,WAAW;EAC7D,IAAI,WAAW,cAAc,KAAA,GAAW,QAAQ,YAAY,WAAW;EACvE,OAAO;CACT,GAAG;EAAC;EAAY;EAAS;EAAK;CAAQ,CAAC;CACvC,IAAI,CAAC,WAAW,eAAe,UAC7B,OAAO;CAGT,MAAM,mBAAmB,OAAO,aAAa,aAAa,SAAS,KAAK,IAAI;CAE5E,OACE,oBAAC,uBAAD;EAA8B;EAC3B,UAAA,gBACC,UACA;GACE,GAAG;GACH,UAAU,oBACR,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,cAAD,CAAe,CAAA,GACf,oBAAC,WAAD,CAAY,CAAA,CACZ,EAAA,CAAA;GAEJ,cAAc,QAAQ,KAAA,IAAY,gBAAgB;EACpD,GACA,GACF;CACqB,CAAA;AAE3B,C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UAAU,WAAW,GAAG;EAC1B,MAAM,eAAe;EACrB,QAAQ,MAAM;EACd;CACF;CAEA,MAAM,iBAAiB,UAAU;CACjC,MAAM,gBAAgB,UAAU,UAAU,SAAS;CACnD,MAAM,gBAAgB,WAAW,UAAU;CAC3C,IAAI,MAAM,YAAY,kBAAkB,gBAAgB;EACtD,MAAM,eAAe;EACrB,eAAe,MAAM;EACrB;CACF;CACA,IAAI,CAAC,MAAM,YAAY,kBAAkB,eAAe;EACtD,MAAM,eAAe;EACrB,gBAAgB,MAAM;EACtB;CACF;CACA,IAAI,yBAAyB,QAAQ,CAAC,QAAQ,SAAS,aAAa,GAAG;EACrE,MAAM,eAAe;EACrB,CAAC,MAAM,WAAW,gBAAgB,eAAA,EAAiB,MAAM;CAC3D;AACF;AAEA,SAAS,kBAAkB,WAAuC;CAChE,OAAO,MAAM,KACX,UAAU,iBACR;EACE;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG,CACZ,CACF,CAAC,CAAC,QAAQ,YAAY,QAAQ,YAAY,KAAK,QAAQ,aAAa,aAAa,MAAM,MAAM;AAC/F;;AC/eA,MAAa,iBAAiB;CAC5B,MAAM;CACN,SAAS;CACT,MAAM;CACN,SAAS;CACT,MAAM;CACN,UAAU;CACV,aAAa;CACb,aAAa;AACf"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { F as ComposerTriggerDefinition, I as ComposerTriggerItem, P as ComposerQuote, j as ComposerEntity, nt as ChatController, z as ComposerTriggerState } from "./index-Mw3ltwSG.js";
|
|
2
|
+
import { t as PrimitiveProps } from "./index-DqdyM0Jm.js";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import { ChatSuggestion, UseChatStatus } from "@anvia/react";
|
|
5
|
+
import { ClientDataMap, ClientMetadata, UIAttachment, UIMessage } from "@anvia/client";
|
|
6
|
+
type ComposerSubmitMessageArgs<TData extends ClientDataMap = ClientDataMap> = {
|
|
7
|
+
input: string;
|
|
8
|
+
attachments: UIAttachment[];
|
|
9
|
+
entities: ComposerEntity[];
|
|
10
|
+
chat: ChatController<ClientMetadata, TData>;
|
|
11
|
+
quote?: ComposerQuote | undefined;
|
|
12
|
+
clear(): void;
|
|
13
|
+
};
|
|
14
|
+
type ComposerSubmitMessage<TData extends ClientDataMap = ClientDataMap> = (args: ComposerSubmitMessageArgs<TData>) => Promise<void> | void;
|
|
15
|
+
/** A mention token as the editor knows it; `range` is meaningful only in the saved message. */
|
|
16
|
+
type ComposerInputEntity = Omit<ComposerEntity, "range">;
|
|
17
|
+
type ComposerTriggerMenuChildren = ReactNode | ((trigger: ComposerTriggerState) => ReactNode);
|
|
18
|
+
type ComposerTriggerItemChildren = ReactNode | ((item: ComposerTriggerItem, trigger: ComposerTriggerState) => ReactNode);
|
|
19
|
+
type ComposerAttachmentsChildren = ReactNode | ((attachment: UIAttachment) => ReactNode);
|
|
20
|
+
declare const ComposerPrimitive: {
|
|
21
|
+
readonly Root: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref">, "asChild"> & {
|
|
22
|
+
asChild?: boolean;
|
|
23
|
+
} & {
|
|
24
|
+
attachments?: UIAttachment[];
|
|
25
|
+
defaultAttachments?: UIAttachment[];
|
|
26
|
+
defaultEntities?: ComposerEntity[];
|
|
27
|
+
defaultInput?: string;
|
|
28
|
+
defaultQuote?: ComposerQuote | undefined;
|
|
29
|
+
entities?: ComposerEntity[];
|
|
30
|
+
input?: string;
|
|
31
|
+
onAttachmentsChange?: (attachments: UIAttachment[]) => void;
|
|
32
|
+
onEntitiesChange?: (entities: ComposerEntity[]) => void;
|
|
33
|
+
onInputChange?: (input: string) => void;
|
|
34
|
+
onQuoteChange?: (quote: ComposerQuote | undefined) => void;
|
|
35
|
+
quote?: ComposerQuote | undefined;
|
|
36
|
+
submitMessage?: ComposerSubmitMessage;
|
|
37
|
+
triggers?: ComposerTriggerDefinition[];
|
|
38
|
+
} & import("react").RefAttributes<HTMLFormElement>>;
|
|
39
|
+
readonly Quote: import("react").ForwardRefExoticComponent<Omit<PrimitiveProps<"blockquote">, "children"> & {
|
|
40
|
+
children?: ReactNode | ((quote: ComposerQuote) => ReactNode);
|
|
41
|
+
} & import("react").RefAttributes<HTMLQuoteElement>>;
|
|
42
|
+
readonly ClearQuote: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "asChild"> & {
|
|
43
|
+
asChild?: boolean;
|
|
44
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
45
|
+
readonly Input: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "asChild"> & {
|
|
46
|
+
asChild?: boolean;
|
|
47
|
+
} & {
|
|
48
|
+
autoResize?: boolean;
|
|
49
|
+
disabled?: boolean | undefined;
|
|
50
|
+
maxRows?: number;
|
|
51
|
+
minRows?: number;
|
|
52
|
+
placeholder?: string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Customises how a mention token displays in the editor. The saved text and entities are
|
|
55
|
+
* unchanged. Return `null` or `undefined` to show the entity's text. Keep it a pure function of
|
|
56
|
+
* `entity`: a token re-renders only when its node changes, not when the function's closure does.
|
|
57
|
+
*/
|
|
58
|
+
renderEntity?: ((entity: ComposerInputEntity) => ReactNode) | undefined;
|
|
59
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
60
|
+
readonly TextareaInput: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref">, "asChild"> & {
|
|
61
|
+
asChild?: boolean;
|
|
62
|
+
} & {
|
|
63
|
+
autoResize?: boolean;
|
|
64
|
+
maxRows?: number;
|
|
65
|
+
minRows?: number;
|
|
66
|
+
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
67
|
+
readonly TriggerMenu: import("react").ForwardRefExoticComponent<Omit<PrimitiveProps<"div">, "children"> & {
|
|
68
|
+
children?: ComposerTriggerMenuChildren;
|
|
69
|
+
keepMounted?: boolean;
|
|
70
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
71
|
+
readonly TriggerItem: import("react").ForwardRefExoticComponent<Omit<PrimitiveProps<"button">, "children"> & {
|
|
72
|
+
children?: ComposerTriggerItemChildren;
|
|
73
|
+
index?: number | undefined;
|
|
74
|
+
item?: ComposerTriggerItem | undefined;
|
|
75
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
76
|
+
readonly Attachments: import("react").ForwardRefExoticComponent<Omit<PrimitiveProps<"div">, "children"> & {
|
|
77
|
+
children?: ComposerAttachmentsChildren;
|
|
78
|
+
keepMounted?: boolean;
|
|
79
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
80
|
+
readonly AddAttachment: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "asChild"> & {
|
|
81
|
+
asChild?: boolean;
|
|
82
|
+
} & {
|
|
83
|
+
accept?: string;
|
|
84
|
+
multiple?: boolean;
|
|
85
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
86
|
+
readonly AttachmentInput: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "asChild"> & {
|
|
87
|
+
asChild?: boolean;
|
|
88
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
89
|
+
readonly AttachmentDropzone: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "asChild"> & {
|
|
90
|
+
asChild?: boolean;
|
|
91
|
+
} & {
|
|
92
|
+
disabled?: boolean;
|
|
93
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
94
|
+
readonly Submit: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "asChild"> & {
|
|
95
|
+
asChild?: boolean;
|
|
96
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
97
|
+
readonly Stop: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "asChild"> & {
|
|
98
|
+
asChild?: boolean;
|
|
99
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
100
|
+
};
|
|
101
|
+
type ThreadMessagesChildren = ReactNode | ((message: UIMessage) => ReactNode);
|
|
102
|
+
type ThreadSuggestionChildren = ReactNode | ((suggestion: ChatSuggestion) => ReactNode);
|
|
103
|
+
declare const ThreadPrimitive: {
|
|
104
|
+
readonly Root: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "asChild"> & {
|
|
105
|
+
asChild?: boolean;
|
|
106
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
107
|
+
readonly Viewport: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "asChild"> & {
|
|
108
|
+
asChild?: boolean;
|
|
109
|
+
} & {
|
|
110
|
+
autoScroll?: boolean;
|
|
111
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
112
|
+
readonly ViewportFooter: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "asChild"> & {
|
|
113
|
+
asChild?: boolean;
|
|
114
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
115
|
+
readonly Messages: import("react").ForwardRefExoticComponent<Omit<PrimitiveProps<"div">, "children"> & {
|
|
116
|
+
children?: ThreadMessagesChildren;
|
|
117
|
+
keepMounted?: boolean;
|
|
118
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
119
|
+
readonly Empty: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "asChild"> & {
|
|
120
|
+
asChild?: boolean;
|
|
121
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
122
|
+
readonly Status: import("react").ForwardRefExoticComponent<Omit<PrimitiveProps<"div">, "children"> & {
|
|
123
|
+
children?: ReactNode | ((status: UseChatStatus) => ReactNode);
|
|
124
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
125
|
+
readonly Loading: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "asChild"> & {
|
|
126
|
+
asChild?: boolean;
|
|
127
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
128
|
+
readonly Error: import("react").ForwardRefExoticComponent<Omit<PrimitiveProps<"div">, "children"> & {
|
|
129
|
+
children?: ReactNode | ((error: unknown) => ReactNode);
|
|
130
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
131
|
+
readonly Suggestions: import("react").ForwardRefExoticComponent<Omit<PrimitiveProps<"div">, "children"> & {
|
|
132
|
+
children?: ThreadSuggestionChildren;
|
|
133
|
+
keepMounted?: boolean;
|
|
134
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
135
|
+
readonly Suggestion: import("react").ForwardRefExoticComponent<Omit<PrimitiveProps<"button">, "children"> & {
|
|
136
|
+
children?: ReactNode;
|
|
137
|
+
prompt?: string;
|
|
138
|
+
suggestion?: ChatSuggestion;
|
|
139
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
140
|
+
readonly ScrollToBottom: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "asChild"> & {
|
|
141
|
+
asChild?: boolean;
|
|
142
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
143
|
+
};
|
|
144
|
+
export { ComposerSubmitMessageArgs as a, ComposerSubmitMessage as i, ComposerInputEntity as n, ComposerPrimitive as r, ThreadPrimitive as t };
|
|
145
|
+
//# sourceMappingURL=index-B1Qs2Cjv.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-B1Qs2Cjv.d.ts","names":["ComposerTriggerItemValue"],"sources":["../src/chat/composer.tsx","../src/chat/thread.tsx"],"mappings":";;;;;KAiFY,0BAA0B,cAAc,gBAAgB;EAClE;EACA,aAAa;EACb,UAAU;EACV,MAAM,eAAe,gBAAgB;EACrC,QAAQ;EACR;;KAGU,sBAAsB,cAAc,gBAAgB,kBAC9D,MAAM,0BAA0B,WAC7B;;KAyVO,sBAAsB,KAAK;KAo7BlC,8BAA8B,cAAc,SAAS,yBAAyB;KA0D9E,8BACD,cACE,MAAMA,qBAA0B,SAAS,yBAAyB;KAyDnE,8BAA8B,cAAc,YAAY,iBAAiB;cAiPjE;;;;IA9oDG,cAAA;IACO,qBAAA;IACH,kBAAA;IACH;IACA,eAAA;IACJ,WAAA;IACH;IACc,uBAAC,aAAa;IACjB,oBAAC,UAAU;IACd,iBAAC;IACD,iBAAC,OAAO;IAChB,QAAA;IACQ,gBAAA;IACL,WAAA;;;IA+SA,WAAA,cAAc,OAAO,kBAAkB;;;;;;;;IA2DrC;IACF;IACD;IACA;IACI;;;;;;IAMC,iBAAE,QAAQ,wBAAwB;;;;;IA0JpC;IACH;IACA;;;IA8wBC,WAAA;IACG;;;IA2DH,WAAA;IACH;IACD,OAAAA;;;IAuDI,WAAA;IACG;;;;;IAuCL;IACE;;;;;;;;IAwFA;;;;;;;;;KCzkDR,yBAAyB,cAAc,SAAS,cAAc;KAC9D,2BAA2B,cAAc,YAAY,mBAAmB;cAwWhE;;;;;;;IApUE;;;;;;IAgKF,WAAA;IACG;;;;;;IAlEH,WAAA,cAAc,QAAQ,kBAAkB;;;;;;IAwCxC,WAAA,cAAc,mBAAmB;;;IA+DjC,WAAA;IACG;;;IAkCH,WAAA;IACF;IACI,aAAA"}
|