@hanzo/ui 8.27.42 → 8.27.43
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/chat/Chat.cjs +17 -2
- package/dist/chat/Chat.d.ts +12 -1
- package/dist/chat/Chat.d.ts.map +1 -1
- package/dist/chat/Chat.js +17 -2
- package/dist/chat/Chat.js.map +1 -1
- package/dist/gallery.html +1 -1
- package/dist/product/index.cjs +1 -0
- package/dist/product/index.d.ts +1 -0
- package/dist/product/index.d.ts.map +1 -1
- package/dist/product/index.js +1 -0
- package/dist/product/index.js.map +1 -1
- package/dist/product/useFileDrop.cjs +90 -0
- package/dist/product/useFileDrop.d.ts +6 -0
- package/dist/product/useFileDrop.d.ts.map +1 -0
- package/dist/product/useFileDrop.js +88 -0
- package/dist/product/useFileDrop.js.map +1 -0
- package/package.json +1 -1
package/dist/chat/Chat.cjs
CHANGED
|
@@ -40,6 +40,7 @@ const gui_1 = require("@hanzo/gui");
|
|
|
40
40
|
const react_1 = require("react");
|
|
41
41
|
const ink_1 = require("../backends/gui/ink.cjs");
|
|
42
42
|
const slot_1 = require("../backends/gui/slot.cjs");
|
|
43
|
+
const useFileDrop_1 = require("../product/useFileDrop.cjs");
|
|
43
44
|
const Composer_1 = require("./Composer.cjs");
|
|
44
45
|
const Message_1 = require("./Message.cjs");
|
|
45
46
|
const Parts_1 = require("./Parts.cjs");
|
|
@@ -62,8 +63,12 @@ const words_1 = require("./words.cjs");
|
|
|
62
63
|
* in exactly that direction: `Parts` reads `type` before it reads anything else.
|
|
63
64
|
*/
|
|
64
65
|
const draw = (said) => typeof said === 'string' || said == null ? ((0, ink_1.ink)((0, words_1.words)(said))) : ((0, jsx_runtime_1.jsx)(Parts_1.Parts, { parts: said }));
|
|
65
|
-
function Chat({ messages, streaming = false, send: onSend, stop: onStop, body, empty, composer, ...thread }) {
|
|
66
|
+
function Chat({ messages, streaming = false, send: onSend, stop: onStop, body, empty, composer, onFiles, ...thread }) {
|
|
66
67
|
const [draft, setDraft] = (0, react_1.useState)('');
|
|
68
|
+
// The ONE window-level drop, off the shared primitive. Enabled only when a
|
|
69
|
+
// host passed `onFiles` — a surface that cannot route a file leaves the
|
|
70
|
+
// window alone rather than swallowing the drop.
|
|
71
|
+
const { active: dropping } = (0, useFileDrop_1.useFileDrop)(onFiles ?? (() => { }), !!onFiles);
|
|
67
72
|
// Clearing here rather than in an effect on `messages` is what keeps a send
|
|
68
73
|
// from racing the answer: the draft is gone the moment it is sent, and a
|
|
69
74
|
// surface that rejects the turn does not get a cleared box back.
|
|
@@ -85,5 +90,15 @@ function Chat({ messages, streaming = false, send: onSend, stop: onStop, body, e
|
|
|
85
90
|
// from the composer lands on a `display: contents` wrapper or on the page,
|
|
86
91
|
// and then reports a component that is fine as broken, or one that is broken
|
|
87
92
|
// as fine.
|
|
88
|
-
return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { flex: 1, width: "100%", ...(0, slot_1.slot)('chat'), children: [messages.length === 0 && empty ? (empty) : ((0, jsx_runtime_1.jsx)(Thread_1.Thread, { flex: 1, ...thread, children: messages.map((turn, i) => ((0, jsx_runtime_1.jsx)(Message_1.Message, { role: turn.role, busy: streaming && i === last && turn.role === 'assistant', children: body ? body(turn) : draw(turn.content) }, turn.id))) })), (0, jsx_runtime_1.jsx)(Composer_1.Composer, { value: draft, onChange: setDraft, onSend: send, busy: streaming, ...(onStop ? { onStop } : {}), ...composer })
|
|
93
|
+
return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { flex: 1, width: "100%", ...(0, slot_1.slot)('chat'), children: [messages.length === 0 && empty ? (empty) : ((0, jsx_runtime_1.jsx)(Thread_1.Thread, { flex: 1, ...thread, children: messages.map((turn, i) => ((0, jsx_runtime_1.jsx)(Message_1.Message, { role: turn.role, busy: streaming && i === last && turn.role === 'assistant', children: body ? body(turn) : draw(turn.content) }, turn.id))) })), (0, jsx_runtime_1.jsx)(Composer_1.Composer, { value: draft, onChange: setDraft, onSend: send, busy: streaming, ...(onStop ? { onStop } : {}), ...composer }), dropping ? ((0, jsx_runtime_1.jsx)("div", { "aria-hidden": true, style: {
|
|
94
|
+
position: 'fixed',
|
|
95
|
+
inset: 0,
|
|
96
|
+
zIndex: 50,
|
|
97
|
+
display: 'flex',
|
|
98
|
+
alignItems: 'center',
|
|
99
|
+
justifyContent: 'center',
|
|
100
|
+
pointerEvents: 'none',
|
|
101
|
+
background: 'rgba(52, 211, 153, 0.08)',
|
|
102
|
+
border: '2px dashed #34d399',
|
|
103
|
+
}, children: (0, jsx_runtime_1.jsx)("span", { style: { fontSize: 15, fontWeight: 600, color: '#34d399' }, children: "Drop files to attach" }) })) : null] }));
|
|
89
104
|
}
|
package/dist/chat/Chat.d.ts
CHANGED
|
@@ -60,6 +60,17 @@ export interface ChatProps extends Omit<ThreadProps, 'children' | 'ref'> {
|
|
|
60
60
|
empty?: ReactNode;
|
|
61
61
|
/** The composer's own props — placeholder, hint, the send control, the field. */
|
|
62
62
|
composer?: Partial<ComposerProps>;
|
|
63
|
+
/**
|
|
64
|
+
* Route files dropped ANYWHERE in the window.
|
|
65
|
+
*
|
|
66
|
+
* Present, the surface lights a full-window overlay on a file drag and hands
|
|
67
|
+
* the dropped files here — the same window-level drop `@hanzo/chat` runs, off
|
|
68
|
+
* the one `useFileDrop` primitive, so a host gets "drop on any part of the
|
|
69
|
+
* interface" without writing a listener. Absent, the window is left untouched
|
|
70
|
+
* (the hook is disabled), because a drop with nowhere to go should not
|
|
71
|
+
* swallow the browser's own behaviour.
|
|
72
|
+
*/
|
|
73
|
+
onFiles?: (files: File[]) => void;
|
|
63
74
|
}
|
|
64
|
-
export declare function Chat({ messages, streaming, send: onSend, stop: onStop, body, empty, composer, ...thread }: ChatProps): import("react").JSX.Element;
|
|
75
|
+
export declare function Chat({ messages, streaming, send: onSend, stop: onStop, body, empty, composer, onFiles, ...thread }: ChatProps): import("react").JSX.Element;
|
|
65
76
|
//# sourceMappingURL=Chat.d.ts.map
|
package/dist/chat/Chat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../src/chat/Chat.tsx"],"names":[],"mappings":"AAoCA,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../src/chat/Chat.tsx"],"names":[],"mappings":"AAoCA,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAK7D,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,EAAW,KAAK,IAAI,EAAE,MAAM,WAAW,CAAA;AAE9C,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAS,KAAK,IAAI,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;;;GAOG;AACH,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,IAAI,CAAA;IACV;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,IAAI,CAAA;CACf;AAED,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,KAAK,CAAC;IACtE,sCAAsC;IACtC,QAAQ,EAAE,IAAI,EAAE,CAAA;IAChB,iFAAiF;IACjF,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;;;;;;;OAUG;IACH,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5B,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,IAAI,CAAA;IACjB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,SAAS,CAAA;IAChC,+DAA+D;IAC/D,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IACjC;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAA;CAClC;AAyBD,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,SAAiB,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,OAAO,EACP,GAAG,MAAM,EACV,EAAE,SAAS,+BA6EX"}
|
package/dist/chat/Chat.js
CHANGED
|
@@ -37,6 +37,7 @@ import { YStack } from '@hanzo/gui';
|
|
|
37
37
|
import { useCallback, useState } from 'react';
|
|
38
38
|
import { ink } from '../backends/gui/ink.js';
|
|
39
39
|
import { slot } from '../backends/gui/slot.js';
|
|
40
|
+
import { useFileDrop } from '../product/useFileDrop.js';
|
|
40
41
|
import { Composer } from './Composer.js';
|
|
41
42
|
import { Message } from './Message.js';
|
|
42
43
|
import { Parts } from './Parts.js';
|
|
@@ -59,8 +60,12 @@ import { words } from './words.js';
|
|
|
59
60
|
* in exactly that direction: `Parts` reads `type` before it reads anything else.
|
|
60
61
|
*/
|
|
61
62
|
const draw = (said) => typeof said === 'string' || said == null ? (ink(words(said))) : (_jsx(Parts, { parts: said }));
|
|
62
|
-
export function Chat({ messages, streaming = false, send: onSend, stop: onStop, body, empty, composer, ...thread }) {
|
|
63
|
+
export function Chat({ messages, streaming = false, send: onSend, stop: onStop, body, empty, composer, onFiles, ...thread }) {
|
|
63
64
|
const [draft, setDraft] = useState('');
|
|
65
|
+
// The ONE window-level drop, off the shared primitive. Enabled only when a
|
|
66
|
+
// host passed `onFiles` — a surface that cannot route a file leaves the
|
|
67
|
+
// window alone rather than swallowing the drop.
|
|
68
|
+
const { active: dropping } = useFileDrop(onFiles ?? (() => { }), !!onFiles);
|
|
64
69
|
// Clearing here rather than in an effect on `messages` is what keeps a send
|
|
65
70
|
// from racing the answer: the draft is gone the moment it is sent, and a
|
|
66
71
|
// surface that rejects the turn does not get a cleared box back.
|
|
@@ -82,6 +87,16 @@ export function Chat({ messages, streaming = false, send: onSend, stop: onStop,
|
|
|
82
87
|
// from the composer lands on a `display: contents` wrapper or on the page,
|
|
83
88
|
// and then reports a component that is fine as broken, or one that is broken
|
|
84
89
|
// as fine.
|
|
85
|
-
return (_jsxs(YStack, { flex: 1, width: "100%", ...slot('chat'), children: [messages.length === 0 && empty ? (empty) : (_jsx(Thread, { flex: 1, ...thread, children: messages.map((turn, i) => (_jsx(Message, { role: turn.role, busy: streaming && i === last && turn.role === 'assistant', children: body ? body(turn) : draw(turn.content) }, turn.id))) })), _jsx(Composer, { value: draft, onChange: setDraft, onSend: send, busy: streaming, ...(onStop ? { onStop } : {}), ...composer })
|
|
90
|
+
return (_jsxs(YStack, { flex: 1, width: "100%", ...slot('chat'), children: [messages.length === 0 && empty ? (empty) : (_jsx(Thread, { flex: 1, ...thread, children: messages.map((turn, i) => (_jsx(Message, { role: turn.role, busy: streaming && i === last && turn.role === 'assistant', children: body ? body(turn) : draw(turn.content) }, turn.id))) })), _jsx(Composer, { value: draft, onChange: setDraft, onSend: send, busy: streaming, ...(onStop ? { onStop } : {}), ...composer }), dropping ? (_jsx("div", { "aria-hidden": true, style: {
|
|
91
|
+
position: 'fixed',
|
|
92
|
+
inset: 0,
|
|
93
|
+
zIndex: 50,
|
|
94
|
+
display: 'flex',
|
|
95
|
+
alignItems: 'center',
|
|
96
|
+
justifyContent: 'center',
|
|
97
|
+
pointerEvents: 'none',
|
|
98
|
+
background: 'rgba(52, 211, 153, 0.08)',
|
|
99
|
+
border: '2px dashed #34d399',
|
|
100
|
+
}, children: _jsx("span", { style: { fontSize: 15, fontWeight: 600, color: '#34d399' }, children: "Drop files to attach" }) })) : null] }));
|
|
86
101
|
}
|
|
87
102
|
//# sourceMappingURL=Chat.js.map
|
package/dist/chat/Chat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chat.js","sourceRoot":"","sources":["../../src/chat/Chat.ts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AG,EAAE,KAAK,EAAE,SAAS,EAAE,qCAEzD,GACH,CACP,CAAC,CAAC,CAAC,IAAI,IACD,CACV,CAAA;AACH,CAAC"}
|
package/dist/gallery.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html lang="en" class="t_dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>@hanzo/ui 8.27.
|
|
1
|
+
<!doctype html><html lang="en" class="t_dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>@hanzo/ui 8.27.43</title><style>/* @hanzo/ui — generated by scripts/gen-css.mjs. Do not edit. */
|
|
2
2
|
:root { --hanzo-ui-styles: 1; }
|
|
3
3
|
/* Hanzo Design System — the entry point. Import THIS one file.
|
|
4
4
|
*
|
package/dist/product/index.cjs
CHANGED
|
@@ -147,6 +147,7 @@ __exportStar(require("./PageHeader.cjs"), exports);
|
|
|
147
147
|
__exportStar(require("./Palette.cjs"), exports);
|
|
148
148
|
__exportStar(require("./match.cjs"), exports);
|
|
149
149
|
__exportStar(require("./useCommandK.cjs"), exports);
|
|
150
|
+
__exportStar(require("./useFileDrop.cjs"), exports);
|
|
150
151
|
__exportStar(require("./PrimaryButton.cjs"), exports);
|
|
151
152
|
__exportStar(require("./ProductIcon.cjs"), exports);
|
|
152
153
|
__exportStar(require("./ProviderLogo.cjs"), exports);
|
package/dist/product/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export * from './PageHeader.js';
|
|
|
43
43
|
export * from './Palette.js';
|
|
44
44
|
export * from './match.js';
|
|
45
45
|
export * from './useCommandK.js';
|
|
46
|
+
export * from './useFileDrop.js';
|
|
46
47
|
export * from './PrimaryButton.js';
|
|
47
48
|
export * from './ProductIcon.js';
|
|
48
49
|
export * from './ProviderLogo.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/product/index.ts"],"names":[],"mappings":"AAaA,cAAc,U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
package/dist/product/index.js
CHANGED
|
@@ -103,6 +103,7 @@ export * from './PageHeader.js';
|
|
|
103
103
|
export * from './Palette.js';
|
|
104
104
|
export * from './match.js';
|
|
105
105
|
export * from './useCommandK.js';
|
|
106
|
+
export * from './useFileDrop.js';
|
|
106
107
|
export * from './PrimaryButton.js';
|
|
107
108
|
export * from './ProductIcon.js';
|
|
108
109
|
export * from './ProviderLogo.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/product/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;AAChF,iFAAiF;AACjF,gFAAgF;AAChF,wEAAwE;AACxE,EAAE;AACF,kFAAkF;AAClF,6EAA6E;AAE7E,kFAAkF;AAClF,gEAAgE;AAChE,cAAc,UAAU,CAAA;AAExB,2EAA2E;AAC3E,+EAA+E;AAC/E,4CAA4C;AAC5C,OAAO,EACL,MAAM,EACN,aAAa,EACb,SAAS,EACT,SAAS,IAAI,eAAe,EAC5B,QAAQ,EACR,OAAO,EACP,SAAS,EACT,UAAU,EACV,UAAU,EACV,KAAK,GACN,MAAM,UAAU,CAAA;AAEjB,6EAA6E;AAC7E,OAAO,EAAE,KAAK,IAAI,SAAS,EAAqB,MAAM,SAAS,CAAA;AAE/D,+EAA+E;AAC/E,8EAA8E;AAC9E,qCAAqC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,cAAc,mBAAmB,CAAA;AAEjC,gFAAgF;AAChF,iFAAiF;AACjF,4EAA4E;AAC5E,OAAO,EACL,UAAU,GAIX,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,KAAK,EACL,KAAK,EACL,GAAG,EACH,MAAM,EACN,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,IAAI,GAKL,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,UAAU,EACV,UAAU,EACV,OAAO,EACP,UAAU,GAMX,M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1,90 @@
|
|
|
1
|
+
'use client';"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useFileDrop = useFileDrop;
|
|
5
|
+
/**
|
|
6
|
+
* useFileDrop — the ONE window-level file drop.
|
|
7
|
+
*
|
|
8
|
+
* Files dropped anywhere in the window attach, not only on the composer box.
|
|
9
|
+
* The listener lives on `window`, filters for a real file drag (a
|
|
10
|
+
* `dataTransfer` that carries `Files` — a text selection or an in-page drag
|
|
11
|
+
* must not light the overlay), and hands the dropped files to `onFiles`.
|
|
12
|
+
* `active` is true while a file is over the window so a surface can light its
|
|
13
|
+
* own full-window overlay.
|
|
14
|
+
*
|
|
15
|
+
* The enter/leave depth counter is the whole reason this is a hook and not a
|
|
16
|
+
* bare `onDrop`: `dragleave` fires as the pointer crosses every child element,
|
|
17
|
+
* so a naive listener blanks the overlay mid-drag and it flickers. Counting
|
|
18
|
+
* enters against leaves keeps `active` true until the cursor actually leaves the
|
|
19
|
+
* window.
|
|
20
|
+
*
|
|
21
|
+
* Web-only. Native (expo) and desktop hosts have no HTML5 `dataTransfer` drop,
|
|
22
|
+
* so the effect no-ops where the events do not exist. One hook so the site and
|
|
23
|
+
* the chat client behave identically instead of each carrying its own listener
|
|
24
|
+
* that drifts — the same reason `useCommandK` exists.
|
|
25
|
+
*
|
|
26
|
+
* `enabled` gates the listeners for a shared surface that only wants the drop
|
|
27
|
+
* when its host can actually handle a file: a hook cannot be called
|
|
28
|
+
* conditionally, so a surface with no `onFiles` passes `enabled: false` and the
|
|
29
|
+
* window stays untouched rather than swallowing drops into a void.
|
|
30
|
+
*/
|
|
31
|
+
const react_1 = require("react");
|
|
32
|
+
function carriesFiles(e) {
|
|
33
|
+
const types = e.dataTransfer?.types;
|
|
34
|
+
if (!types)
|
|
35
|
+
return false;
|
|
36
|
+
// `types` is a readonly string[] in the DOM lib but a live list at runtime.
|
|
37
|
+
return Array.prototype.indexOf.call(types, 'Files') !== -1;
|
|
38
|
+
}
|
|
39
|
+
function useFileDrop(onFiles, enabled = true) {
|
|
40
|
+
const [active, setActive] = (0, react_1.useState)(false);
|
|
41
|
+
const depth = (0, react_1.useRef)(0);
|
|
42
|
+
const cb = (0, react_1.useRef)(onFiles);
|
|
43
|
+
cb.current = onFiles;
|
|
44
|
+
(0, react_1.useEffect)(() => {
|
|
45
|
+
if (!enabled || typeof window === 'undefined')
|
|
46
|
+
return;
|
|
47
|
+
const onDragEnter = (e) => {
|
|
48
|
+
if (!carriesFiles(e))
|
|
49
|
+
return;
|
|
50
|
+
e.preventDefault();
|
|
51
|
+
depth.current += 1;
|
|
52
|
+
setActive(true);
|
|
53
|
+
};
|
|
54
|
+
const onDragOver = (e) => {
|
|
55
|
+
if (!carriesFiles(e))
|
|
56
|
+
return;
|
|
57
|
+
e.preventDefault();
|
|
58
|
+
if (e.dataTransfer)
|
|
59
|
+
e.dataTransfer.dropEffect = 'copy';
|
|
60
|
+
};
|
|
61
|
+
const onDragLeave = (e) => {
|
|
62
|
+
if (!carriesFiles(e))
|
|
63
|
+
return;
|
|
64
|
+
depth.current = Math.max(0, depth.current - 1);
|
|
65
|
+
if (depth.current === 0)
|
|
66
|
+
setActive(false);
|
|
67
|
+
};
|
|
68
|
+
const onDrop = (e) => {
|
|
69
|
+
if (!carriesFiles(e))
|
|
70
|
+
return;
|
|
71
|
+
e.preventDefault();
|
|
72
|
+
depth.current = 0;
|
|
73
|
+
setActive(false);
|
|
74
|
+
const files = e.dataTransfer?.files;
|
|
75
|
+
if (files && files.length)
|
|
76
|
+
cb.current(Array.from(files));
|
|
77
|
+
};
|
|
78
|
+
window.addEventListener('dragenter', onDragEnter);
|
|
79
|
+
window.addEventListener('dragover', onDragOver);
|
|
80
|
+
window.addEventListener('dragleave', onDragLeave);
|
|
81
|
+
window.addEventListener('drop', onDrop);
|
|
82
|
+
return () => {
|
|
83
|
+
window.removeEventListener('dragenter', onDragEnter);
|
|
84
|
+
window.removeEventListener('dragover', onDragOver);
|
|
85
|
+
window.removeEventListener('dragleave', onDragLeave);
|
|
86
|
+
window.removeEventListener('drop', onDrop);
|
|
87
|
+
};
|
|
88
|
+
}, [enabled]);
|
|
89
|
+
return { active };
|
|
90
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFileDrop.d.ts","sourceRoot":"","sources":["../../src/product/useFileDrop.ts"],"names":[],"mappings":"AA8BA,MAAM,WAAW,QAAQ;IACvB,iDAAiD;IACjD,MAAM,EAAE,OAAO,CAAA;CAChB;AASD,wBAAgB,WAAW,CACzB,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,EAChC,OAAO,UAAO,GACb,QAAQ,CA+CV"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
/**
|
|
3
|
+
* useFileDrop — the ONE window-level file drop.
|
|
4
|
+
*
|
|
5
|
+
* Files dropped anywhere in the window attach, not only on the composer box.
|
|
6
|
+
* The listener lives on `window`, filters for a real file drag (a
|
|
7
|
+
* `dataTransfer` that carries `Files` — a text selection or an in-page drag
|
|
8
|
+
* must not light the overlay), and hands the dropped files to `onFiles`.
|
|
9
|
+
* `active` is true while a file is over the window so a surface can light its
|
|
10
|
+
* own full-window overlay.
|
|
11
|
+
*
|
|
12
|
+
* The enter/leave depth counter is the whole reason this is a hook and not a
|
|
13
|
+
* bare `onDrop`: `dragleave` fires as the pointer crosses every child element,
|
|
14
|
+
* so a naive listener blanks the overlay mid-drag and it flickers. Counting
|
|
15
|
+
* enters against leaves keeps `active` true until the cursor actually leaves the
|
|
16
|
+
* window.
|
|
17
|
+
*
|
|
18
|
+
* Web-only. Native (expo) and desktop hosts have no HTML5 `dataTransfer` drop,
|
|
19
|
+
* so the effect no-ops where the events do not exist. One hook so the site and
|
|
20
|
+
* the chat client behave identically instead of each carrying its own listener
|
|
21
|
+
* that drifts — the same reason `useCommandK` exists.
|
|
22
|
+
*
|
|
23
|
+
* `enabled` gates the listeners for a shared surface that only wants the drop
|
|
24
|
+
* when its host can actually handle a file: a hook cannot be called
|
|
25
|
+
* conditionally, so a surface with no `onFiles` passes `enabled: false` and the
|
|
26
|
+
* window stays untouched rather than swallowing drops into a void.
|
|
27
|
+
*/
|
|
28
|
+
import { useEffect, useRef, useState } from 'react';
|
|
29
|
+
function carriesFiles(e) {
|
|
30
|
+
const types = e.dataTransfer?.types;
|
|
31
|
+
if (!types)
|
|
32
|
+
return false;
|
|
33
|
+
// `types` is a readonly string[] in the DOM lib but a live list at runtime.
|
|
34
|
+
return Array.prototype.indexOf.call(types, 'Files') !== -1;
|
|
35
|
+
}
|
|
36
|
+
export function useFileDrop(onFiles, enabled = true) {
|
|
37
|
+
const [active, setActive] = useState(false);
|
|
38
|
+
const depth = useRef(0);
|
|
39
|
+
const cb = useRef(onFiles);
|
|
40
|
+
cb.current = onFiles;
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (!enabled || typeof window === 'undefined')
|
|
43
|
+
return;
|
|
44
|
+
const onDragEnter = (e) => {
|
|
45
|
+
if (!carriesFiles(e))
|
|
46
|
+
return;
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
depth.current += 1;
|
|
49
|
+
setActive(true);
|
|
50
|
+
};
|
|
51
|
+
const onDragOver = (e) => {
|
|
52
|
+
if (!carriesFiles(e))
|
|
53
|
+
return;
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
if (e.dataTransfer)
|
|
56
|
+
e.dataTransfer.dropEffect = 'copy';
|
|
57
|
+
};
|
|
58
|
+
const onDragLeave = (e) => {
|
|
59
|
+
if (!carriesFiles(e))
|
|
60
|
+
return;
|
|
61
|
+
depth.current = Math.max(0, depth.current - 1);
|
|
62
|
+
if (depth.current === 0)
|
|
63
|
+
setActive(false);
|
|
64
|
+
};
|
|
65
|
+
const onDrop = (e) => {
|
|
66
|
+
if (!carriesFiles(e))
|
|
67
|
+
return;
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
depth.current = 0;
|
|
70
|
+
setActive(false);
|
|
71
|
+
const files = e.dataTransfer?.files;
|
|
72
|
+
if (files && files.length)
|
|
73
|
+
cb.current(Array.from(files));
|
|
74
|
+
};
|
|
75
|
+
window.addEventListener('dragenter', onDragEnter);
|
|
76
|
+
window.addEventListener('dragover', onDragOver);
|
|
77
|
+
window.addEventListener('dragleave', onDragLeave);
|
|
78
|
+
window.addEventListener('drop', onDrop);
|
|
79
|
+
return () => {
|
|
80
|
+
window.removeEventListener('dragenter', onDragEnter);
|
|
81
|
+
window.removeEventListener('dragover', onDragOver);
|
|
82
|
+
window.removeEventListener('dragleave', onDragLeave);
|
|
83
|
+
window.removeEventListener('drop', onDrop);
|
|
84
|
+
};
|
|
85
|
+
}, [enabled]);
|
|
86
|
+
return { active };
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=useFileDrop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFileDrop.js","sourceRoot":"","sources":["../../src/product/useFileDrop.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAOnD,SAAS,YAAY,CAAC,CAAY;IAChC,MAAM,KAAK,GAAG,CAAC,CAAC,YAAY,EAAE,KAAK,CAAA;IACnC,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAA;IACxB,4EAA4E;IAC5E,OAAO,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;AAC5D,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,OAAgC,EAChC,OAAO,GAAG,IAAI;IAEd,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC3C,MAAM,KAAK,GAAG,MAAM,CAAC,C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,KAAK,GAAG,CAAC,CAAC,YAAY,EAAE,KAAK,CAAA;YACnC,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM;gBAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;QAC1D,CAAC,CAAA;QAED,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA;QACjD,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;QAC/C,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA;QACjD,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QACvC,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA;YACpD,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;YAClD,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA;YACpD,MAAM,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAC5C,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;IAEb,OAAO,EAAE,MAAM,EAAE,CAAA;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/ui",
|
|
3
|
-
"version": "8.27.
|
|
3
|
+
"version": "8.27.43",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Hanzo UI — the one canonical Hanzo component library, on @hanzo/gui + @hanzo/design. ONE substrate: every component renders through @hanzo/gui primitives, so the same import works on web, native (expo) and desktop (Tauri). Self-contained (theme.css), presentational, host-agnostic, clean-room.",
|
|
6
6
|
"exports": {
|