mirror of
https://github.com/bitbaum/chatkit.git
synced 2026-12-04 13:27:28 +01:00
* feat(composer): Camera / Photos / Files sheet instead of one mixed file input On Android the paperclip opened a chooser of capture apps (Camera, Camera, Recorder, "Photos & Videos") with no way to the file browser: one input with a mixed accept (image/*,text/*,audio/*) is answered that way. Attaching a screenshot to Loki was effectively impossible from a phone. - AttachMenu: on a touch screen the paperclip opens a bottom sheet with three sources, each its own input (ATTACH_SOURCE_INPUT is the SSOT): Camera captures, Photos opens the system photo picker, Files has no accept and opens the real document browser. With a mouse it opens the dialog directly. - isTextFile: Files takes anything, so what can be read inline is decided after the pick. A PDF gets a sentence instead of being pasted as bytes. - The sheet is portalled to <body> so a composer inside a transformed or clipped panel still gets a full-screen sheet. react-dom becomes a peer. - Tests: unit (sources, text detection), SSR (one input per source), browser (sheet on a phone, 44px targets, Escape, Photos picker accept, PDF note, direct dialog with a mouse). CHROMIUM_PATH lets the browser suite run against a preinstalled Chromium. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BWXjqiHm8jFta4FXuc7Tck * refactor(attach): the sheet is a native <dialog>, not a portal showModal() renders in the top layer, so a composer inside a transformed or clipped panel still gets a full-screen sheet without react-dom, and the browser supplies Escape, the focus trap and focus restore. react-dom is no longer a peer. A tap on the backdrop closes it (browser-tested). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BWXjqiHm8jFta4FXuc7Tck --------- Co-authored-by: Claude <noreply@anthropic.com>
24 lines
3.0 KiB
JavaScript
24 lines
3.0 KiB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
/**
|
|
* The handful of icons a chat needs, inline — so installing chatkit never
|
|
* drags an icon library into an app that uses a different one. Paths follow
|
|
* Lucide (ISC), stroke = currentColor, so they take the button's colour.
|
|
*/
|
|
function Svg(props) {
|
|
return (_jsx("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", ...props }));
|
|
}
|
|
export const IconArrowUp = () => (_jsxs(Svg, { children: [_jsx("path", { d: "m5 12 7-7 7 7" }), _jsx("path", { d: "M12 19V5" })] }));
|
|
export const IconArrowDown = () => (_jsxs(Svg, { children: [_jsx("path", { d: "M12 5v14" }), _jsx("path", { d: "m19 12-7 7-7-7" })] }));
|
|
export const IconMic = () => (_jsxs(Svg, { children: [_jsx("path", { d: "M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z" }), _jsx("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }), _jsx("path", { d: "M12 19v3" })] }));
|
|
export const IconCheck = () => (_jsx(Svg, { children: _jsx("path", { d: "M20 6 9 17l-5-5" }) }));
|
|
export const IconX = () => (_jsxs(Svg, { children: [_jsx("path", { d: "M18 6 6 18" }), _jsx("path", { d: "m6 6 12 12" })] }));
|
|
export const IconStop = () => (_jsx(Svg, { fill: "currentColor", stroke: "none", children: _jsx("rect", { x: "6", y: "6", width: "12", height: "12", rx: "2" }) }));
|
|
export const IconSpinner = () => (_jsx(Svg, { className: "ck-spin", children: _jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }));
|
|
export const IconCopy = () => (_jsxs(Svg, { children: [_jsx("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2" }), _jsx("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })] }));
|
|
export const IconRetry = () => (_jsxs(Svg, { children: [_jsx("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), _jsx("path", { d: "M3 3v5h5" })] }));
|
|
export const IconPaperclip = () => (_jsx(Svg, { children: _jsx("path", { d: "m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48" }) }));
|
|
export const IconFile = () => (_jsxs(Svg, { children: [_jsx("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }), _jsx("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" })] }));
|
|
export const IconCamera = () => (_jsxs(Svg, { children: [_jsx("path", { d: "M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z" }), _jsx("circle", { cx: "12", cy: "13", r: "3" })] }));
|
|
export const IconImage = () => (_jsxs(Svg, { children: [_jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2" }), _jsx("circle", { cx: "9", cy: "9", r: "2" }), _jsx("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })] }));
|
|
export const IconFileUp = () => (_jsxs(Svg, { children: [_jsx("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }), _jsx("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }), _jsx("path", { d: "M12 12v6" }), _jsx("path", { d: "m15 15-3-3-3 3" })] }));
|
|
//# sourceMappingURL=icons.js.map
|