@ezychat/web 0.1.60 → 0.1.62
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-lib/chunks/admin-C53MA04L.js +896 -0
- package/dist-lib/chunks/admin-CwbMAJHw.js +897 -0
- package/dist-lib/chunks/{inbox-B0UJDCp0.js → inbox-BSvakhw6.js} +46 -4
- package/dist-lib/chunks/{inbox-42E4FML_.js → inbox-C6YZJKZX.js} +46 -4
- package/dist-lib/ezychat-web.css +1 -1
- package/dist-lib/index.js +9615 -8813
- package/dist-lib/types/admin/AgentGroupsCard.d.ts +16 -0
- package/dist-lib/types/admin/connectors/connector-ui.d.ts +11 -0
- package/dist-lib/types/api/ai-groups.d.ts +53 -0
- package/dist-lib/types/api/ai.d.ts +11 -5
- package/dist-lib/types/api/connector-list.d.ts +12 -0
- package/dist-lib/types/components/app/FileDropZone.d.ts +17 -0
- package/dist-lib/types/i18n/resources.d.ts +76 -0
- package/dist-lib/types/inbox/Composer.d.ts +12 -3
- package/dist-lib/types/inbox/ConversationHeader.d.ts +4 -2
- package/dist-lib/types/inbox/GroupAiRow.d.ts +16 -0
- package/dist-lib/types/inbox/GroupPanel.d.ts +3 -1
- package/dist-lib/types/inbox/MediaView.d.ts +4 -1
- package/dist-lib/types/inbox/ReactionPicker.d.ts +3 -1
- package/dist-lib/types/lib/clipboard.d.ts +11 -0
- package/dist-lib/types/lib/file-transfer.d.ts +42 -0
- package/package.json +2 -2
- package/dist-lib/chunks/admin-DPSjgyl3.js +0 -869
- package/dist-lib/chunks/admin-DiuGyOP6.js +0 -868
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Lite's only inbox keeps the name migration 014 gave inbox 1 (a product name, never translated). */
|
|
2
|
+
export declare const LITE_INBOX_NAME = "WhatsApp";
|
|
3
|
+
/**
|
|
4
|
+
* Agent page → Groups (design docs/features/ai-groups/design.md): the agent's "Answer in groups
|
|
5
|
+
* (when tagged or quoted)" switch and, when on, the groups of the agent's inbox, each with its own
|
|
6
|
+
* switch (new groups start off) and a link to the group chat. The same per-group switch is in the
|
|
7
|
+
* group's info panel.
|
|
8
|
+
*/
|
|
9
|
+
export declare function AgentGroupsCard({ agentId, name, agentEnabled, inboxName, }: Readonly<{
|
|
10
|
+
agentId: number;
|
|
11
|
+
name: string;
|
|
12
|
+
/** The agent's saved on/off. */
|
|
13
|
+
agentEnabled: boolean;
|
|
14
|
+
/** The name of the agent's inbox; null = the agent answers no inbox. */
|
|
15
|
+
inboxName: string | null;
|
|
16
|
+
}>): import("react").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type LucideIcon } from 'lucide-react';
|
|
2
|
+
import { type ConnectorEntry } from '@ezychat/shared';
|
|
2
3
|
import type { ConnectorStatus } from './catalog';
|
|
3
4
|
/** Connector pages that web extensions provide, by catalog id (the first extension wins). */
|
|
4
5
|
export declare function useConnectorLinks(): Partial<Record<string, string>>;
|
|
@@ -6,6 +7,16 @@ export declare function useConnectorLinks(): Partial<Record<string, string>>;
|
|
|
6
7
|
export declare function ConnectorStatusBadge({ status }: {
|
|
7
8
|
status: ConnectorStatus;
|
|
8
9
|
}): import("react").JSX.Element | null;
|
|
10
|
+
/** "Beta" next to the status on cards and page headers, when the connector list marks the entry. */
|
|
11
|
+
export declare function BetaBadge({ show }: Readonly<{
|
|
12
|
+
show: boolean;
|
|
13
|
+
}>): import("react").JSX.Element | null;
|
|
14
|
+
/** The entry's notice from the connector list, above Connect; titled Beta for a beta entry. */
|
|
15
|
+
export declare function ConnectorNotice({ entry }: Readonly<{
|
|
16
|
+
entry: ConnectorEntry | null;
|
|
17
|
+
}>): import("react").JSX.Element | null;
|
|
18
|
+
/** The connector list's entry for one of the app's own connectors (e.g. its Beta mark and notice). */
|
|
19
|
+
export declare function useBuiltinEntry(builtinId: string): ConnectorEntry | null;
|
|
9
20
|
/**
|
|
10
21
|
* The connector's icon in a calm tile: the icon file from the connector list (served by the
|
|
11
22
|
* server, checked against the list's hash) or a Lucide icon (no brand logos in the app).
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI agents in WhatsApp groups (design docs/features/ai-groups/design.md): the agent's "Answer in
|
|
3
|
+
* groups" switch with the groups of its inbox (admins), and each group's own switch.
|
|
4
|
+
*/
|
|
5
|
+
export declare const aiGroupsKey: readonly ["ai-groups"];
|
|
6
|
+
export declare const agentGroupsKey: (agentId: number) => readonly ["ai-groups", "agent", number];
|
|
7
|
+
export declare const groupChatAiKey: (jid: string) => readonly ["ai-groups", "chat", string];
|
|
8
|
+
export declare function useAgentGroups(agentId: number): import("@tanstack/react-query").UseQueryResult<{
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
inboxName: string | null;
|
|
11
|
+
groups: {
|
|
12
|
+
jid: string;
|
|
13
|
+
name: string;
|
|
14
|
+
memberCount: number | null;
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
paused: boolean;
|
|
17
|
+
}[];
|
|
18
|
+
loopGuard: number;
|
|
19
|
+
}, Error>;
|
|
20
|
+
export declare function useSetAnswerInGroups(agentId: number): import("@tanstack/react-query").UseMutationResult<{
|
|
21
|
+
enabled: boolean;
|
|
22
|
+
inboxName: string | null;
|
|
23
|
+
groups: {
|
|
24
|
+
jid: string;
|
|
25
|
+
name: string;
|
|
26
|
+
memberCount: number | null;
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
paused: boolean;
|
|
29
|
+
}[];
|
|
30
|
+
loopGuard: number;
|
|
31
|
+
}, Error, boolean, unknown>;
|
|
32
|
+
/** Whether the AI answers tags and quotes in this group (anyone who may open the chat). */
|
|
33
|
+
export declare function useGroupChatAi(jid: string | null): import("@tanstack/react-query").UseQueryResult<{
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
agentId: number | null;
|
|
36
|
+
agentName: string | null;
|
|
37
|
+
agentEnabled: boolean;
|
|
38
|
+
agentAnswersGroups: boolean;
|
|
39
|
+
paused: boolean;
|
|
40
|
+
}, Error>;
|
|
41
|
+
/** Admins: switch one group on or off (Group info and the agent page list). */
|
|
42
|
+
export declare function useSetGroupChatAi(): import("@tanstack/react-query").UseMutationResult<{
|
|
43
|
+
enabled: boolean;
|
|
44
|
+
agentId: number | null;
|
|
45
|
+
agentName: string | null;
|
|
46
|
+
agentEnabled: boolean;
|
|
47
|
+
agentAnswersGroups: boolean;
|
|
48
|
+
paused: boolean;
|
|
49
|
+
}, Error, {
|
|
50
|
+
enabled: boolean;
|
|
51
|
+
} & {
|
|
52
|
+
jid: string;
|
|
53
|
+
}, unknown>;
|
|
@@ -19,9 +19,9 @@ export declare function useAiMember(): import("@tanstack/react-query").UseQueryR
|
|
|
19
19
|
inboxIds?: number[] | undefined;
|
|
20
20
|
} | null;
|
|
21
21
|
settings: {
|
|
22
|
+
enabled: boolean;
|
|
22
23
|
displayName: string;
|
|
23
24
|
mode: "api" | "chatgpt" | "claude";
|
|
24
|
-
enabled: boolean;
|
|
25
25
|
model: string;
|
|
26
26
|
instructions: string;
|
|
27
27
|
handoffRules?: string | undefined;
|
|
@@ -105,6 +105,11 @@ export declare function useAiTry(): import("@tanstack/react-query").UseMutationR
|
|
|
105
105
|
start?: string | undefined;
|
|
106
106
|
end?: string | undefined;
|
|
107
107
|
} | undefined;
|
|
108
|
+
group?: {
|
|
109
|
+
kind: "paused" | "answered" | "handover";
|
|
110
|
+
member: string | null;
|
|
111
|
+
quoted?: boolean | undefined;
|
|
112
|
+
} | undefined;
|
|
108
113
|
notRun?: boolean | undefined;
|
|
109
114
|
}[] | undefined;
|
|
110
115
|
}, Error, {
|
|
@@ -115,6 +120,7 @@ export declare function useAiTry(): import("@tanstack/react-query").UseMutationR
|
|
|
115
120
|
handoffRules?: string | undefined;
|
|
116
121
|
};
|
|
117
122
|
agentId?: number | undefined;
|
|
123
|
+
group?: boolean | undefined;
|
|
118
124
|
}, unknown>;
|
|
119
125
|
/**
|
|
120
126
|
* Edit with AI: a suggested rewrite of one box; nothing is saved (the page's Save does that).
|
|
@@ -181,9 +187,9 @@ export declare function useAiMemberAction(): import("@tanstack/react-query").Use
|
|
|
181
187
|
inboxIds?: number[] | undefined;
|
|
182
188
|
} | null;
|
|
183
189
|
settings: {
|
|
190
|
+
enabled: boolean;
|
|
184
191
|
displayName: string;
|
|
185
192
|
mode: "api" | "chatgpt" | "claude";
|
|
186
|
-
enabled: boolean;
|
|
187
193
|
model: string;
|
|
188
194
|
instructions: string;
|
|
189
195
|
handoffRules?: string | undefined;
|
|
@@ -263,9 +269,9 @@ export declare function useAiAgent(agentId: number | null): import("@tanstack/re
|
|
|
263
269
|
documentCount: number;
|
|
264
270
|
};
|
|
265
271
|
settings: {
|
|
272
|
+
enabled: boolean;
|
|
266
273
|
displayName: string;
|
|
267
274
|
mode: "api" | "chatgpt" | "claude";
|
|
268
|
-
enabled: boolean;
|
|
269
275
|
model: string;
|
|
270
276
|
instructions: string;
|
|
271
277
|
handoffRules?: string | undefined;
|
|
@@ -350,9 +356,9 @@ export declare function useAiAgentAction(agentId: number | null): import("@tanst
|
|
|
350
356
|
documentCount: number;
|
|
351
357
|
};
|
|
352
358
|
settings: {
|
|
359
|
+
enabled: boolean;
|
|
353
360
|
displayName: string;
|
|
354
361
|
mode: "api" | "chatgpt" | "claude";
|
|
355
|
-
enabled: boolean;
|
|
356
362
|
model: string;
|
|
357
363
|
instructions: string;
|
|
358
364
|
handoffRules?: string | undefined;
|
|
@@ -383,9 +389,9 @@ export declare function useAddAgentText(): import("@tanstack/react-query").UseMu
|
|
|
383
389
|
documentCount: number;
|
|
384
390
|
};
|
|
385
391
|
settings: {
|
|
392
|
+
enabled: boolean;
|
|
386
393
|
displayName: string;
|
|
387
394
|
mode: "api" | "chatgpt" | "claude";
|
|
388
|
-
enabled: boolean;
|
|
389
395
|
model: string;
|
|
390
396
|
instructions: string;
|
|
391
397
|
handoffRules?: string | undefined;
|
|
@@ -159,6 +159,12 @@ export declare function useConnectorGallery(enabled?: boolean): import("@tanstac
|
|
|
159
159
|
ms?: string | undefined;
|
|
160
160
|
'zh-CN'?: string | undefined;
|
|
161
161
|
} | undefined;
|
|
162
|
+
stage?: "beta" | undefined;
|
|
163
|
+
notice?: {
|
|
164
|
+
en: string;
|
|
165
|
+
ms?: string | undefined;
|
|
166
|
+
'zh-CN'?: string | undefined;
|
|
167
|
+
} | undefined;
|
|
162
168
|
};
|
|
163
169
|
fit: "ok" | "enterprise" | "needsUpdate";
|
|
164
170
|
delisted: boolean;
|
|
@@ -324,6 +330,12 @@ export declare function useRefreshConnectorList(): import("@tanstack/react-query
|
|
|
324
330
|
ms?: string | undefined;
|
|
325
331
|
'zh-CN'?: string | undefined;
|
|
326
332
|
} | undefined;
|
|
333
|
+
stage?: "beta" | undefined;
|
|
334
|
+
notice?: {
|
|
335
|
+
en: string;
|
|
336
|
+
ms?: string | undefined;
|
|
337
|
+
'zh-CN'?: string | undefined;
|
|
338
|
+
} | undefined;
|
|
327
339
|
};
|
|
328
340
|
fit: "ok" | "enterprise" | "needsUpdate";
|
|
329
341
|
delisted: boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export interface FileDropZoneProps extends React.ComponentPropsWithoutRef<'section'> {
|
|
3
|
+
/** False: the drop is refused with a note (sending is blocked, or the reply window is closed). */
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
onFiles(files: File[]): void;
|
|
6
|
+
/** The element to render (a conversation is a `section`). */
|
|
7
|
+
as?: 'section' | 'div';
|
|
8
|
+
/** Overlay texts; default to the conversation's ("Drop files to send them in this chat"). */
|
|
9
|
+
title?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
blockedText?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A drop target for files dragged from the desktop (the conversation, Business context): they show
|
|
15
|
+
* an overlay and, when dropped, go to `onFiles`. Text or links dragged inside the page are left alone.
|
|
16
|
+
*/
|
|
17
|
+
export declare function FileDropZone({ enabled, onFiles, as: Tag, title, hint, blockedText, className, children, ...rest }: Readonly<FileDropZoneProps>): React.JSX.Element;
|
|
@@ -482,6 +482,19 @@ export declare const enResources: {
|
|
|
482
482
|
completionStatus: string;
|
|
483
483
|
unavailable: string;
|
|
484
484
|
};
|
|
485
|
+
files: {
|
|
486
|
+
title_one: string;
|
|
487
|
+
title_other: string;
|
|
488
|
+
clear: string;
|
|
489
|
+
remove: string;
|
|
490
|
+
caption: string;
|
|
491
|
+
too_large: string;
|
|
492
|
+
empty: string;
|
|
493
|
+
too_many: string;
|
|
494
|
+
drop: string;
|
|
495
|
+
dropHint: string;
|
|
496
|
+
dropBlocked: string;
|
|
497
|
+
};
|
|
485
498
|
};
|
|
486
499
|
quickReplies: {
|
|
487
500
|
title: string;
|
|
@@ -588,6 +601,12 @@ export declare const enResources: {
|
|
|
588
601
|
calendarChecked: string;
|
|
589
602
|
calendarBooked: string;
|
|
590
603
|
calendarBookedNoTime: string;
|
|
604
|
+
aiGroupAnswered: string;
|
|
605
|
+
aiGroupQuoted: string;
|
|
606
|
+
aiGroupHandover: string;
|
|
607
|
+
aiGroupHandoverNoReason: string;
|
|
608
|
+
aiGroupPaused: string;
|
|
609
|
+
aiGroupMember: string;
|
|
591
610
|
};
|
|
592
611
|
messageList: {
|
|
593
612
|
label: string;
|
|
@@ -647,6 +666,14 @@ export declare const enResources: {
|
|
|
647
666
|
fromTeammateUnknown: string;
|
|
648
667
|
};
|
|
649
668
|
template: string;
|
|
669
|
+
copy: {
|
|
670
|
+
text: string;
|
|
671
|
+
image: string;
|
|
672
|
+
done: string;
|
|
673
|
+
imageDone: string;
|
|
674
|
+
failed: string;
|
|
675
|
+
imageFailed: string;
|
|
676
|
+
};
|
|
650
677
|
};
|
|
651
678
|
media: {
|
|
652
679
|
types: {
|
|
@@ -914,6 +941,22 @@ export declare const enResources: {
|
|
|
914
941
|
sync: string;
|
|
915
942
|
synced: string;
|
|
916
943
|
};
|
|
944
|
+
aiGroups: {
|
|
945
|
+
badge: string;
|
|
946
|
+
badgePaused: string;
|
|
947
|
+
info: {
|
|
948
|
+
title: string;
|
|
949
|
+
hint: string;
|
|
950
|
+
noAgent: string;
|
|
951
|
+
agentDisabled: string;
|
|
952
|
+
agentOff: string;
|
|
953
|
+
openAgent: string;
|
|
954
|
+
readOnly: string;
|
|
955
|
+
on: string;
|
|
956
|
+
off: string;
|
|
957
|
+
paused: string;
|
|
958
|
+
};
|
|
959
|
+
};
|
|
917
960
|
};
|
|
918
961
|
admin: {
|
|
919
962
|
title: string;
|
|
@@ -1843,6 +1886,8 @@ export declare const enResources: {
|
|
|
1843
1886
|
markCustomerFor: string;
|
|
1844
1887
|
markedInternal: string;
|
|
1845
1888
|
markedCustomer: string;
|
|
1889
|
+
drop: string;
|
|
1890
|
+
dropHint: string;
|
|
1846
1891
|
};
|
|
1847
1892
|
defaults: {
|
|
1848
1893
|
sales: {
|
|
@@ -2371,6 +2416,7 @@ export declare const enResources: {
|
|
|
2371
2416
|
enterprise: string;
|
|
2372
2417
|
needsUpdate: string;
|
|
2373
2418
|
delisted: string;
|
|
2419
|
+
beta: string;
|
|
2374
2420
|
};
|
|
2375
2421
|
yours: string;
|
|
2376
2422
|
more: string;
|
|
@@ -2823,6 +2869,36 @@ export declare const enResources: {
|
|
|
2823
2869
|
colReplyTime: string;
|
|
2824
2870
|
hourRange: string;
|
|
2825
2871
|
};
|
|
2872
|
+
aiGroups: {
|
|
2873
|
+
title: string;
|
|
2874
|
+
description: string;
|
|
2875
|
+
switch: string;
|
|
2876
|
+
switchHint: string;
|
|
2877
|
+
offSummary_one: string;
|
|
2878
|
+
offSummary_other: string;
|
|
2879
|
+
listLabel: string;
|
|
2880
|
+
noneOn: string;
|
|
2881
|
+
noGroups: string;
|
|
2882
|
+
noInbox: string;
|
|
2883
|
+
loopGuard: string;
|
|
2884
|
+
lookupsOnly: string;
|
|
2885
|
+
agentOff: string;
|
|
2886
|
+
members_one: string;
|
|
2887
|
+
members_other: string;
|
|
2888
|
+
answers: string;
|
|
2889
|
+
off: string;
|
|
2890
|
+
paused: string;
|
|
2891
|
+
answerIn: string;
|
|
2892
|
+
openGroup: string;
|
|
2893
|
+
saveFailed: string;
|
|
2894
|
+
try: {
|
|
2895
|
+
group: string;
|
|
2896
|
+
groupHint: string;
|
|
2897
|
+
inGroup: string;
|
|
2898
|
+
lookupsOnly: string;
|
|
2899
|
+
notSent: string;
|
|
2900
|
+
};
|
|
2901
|
+
};
|
|
2826
2902
|
};
|
|
2827
2903
|
errors: {
|
|
2828
2904
|
generic: string;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { type QuickReply, type ReplyPhraseListItem } from '@ezychat/shared';
|
|
3
|
+
/** Lets the conversation hand files dropped anywhere on it to the composer. */
|
|
4
|
+
export interface ComposerHandle {
|
|
5
|
+
addFiles(files: readonly File[]): void;
|
|
6
|
+
}
|
|
3
7
|
export interface ComposerProps {
|
|
4
8
|
quickReplies: QuickReply[];
|
|
5
9
|
onSend(text: string): void;
|
|
6
|
-
/**
|
|
7
|
-
|
|
10
|
+
/**
|
|
11
|
+
* One file to send, with the caption (the typed text goes with the first file). Files picked,
|
|
12
|
+
* pasted or dropped wait in the tray until Send; they are sent one after another, in order:
|
|
13
|
+
* resolve when this one is handed over. `index` is the file's place in that send (0 = first).
|
|
14
|
+
*/
|
|
15
|
+
onAttach(file: File, caption?: string, index?: number): void | Promise<void>;
|
|
8
16
|
/**
|
|
9
17
|
* Mic button (shown while the box is empty): a recorded Ogg/Opus voice note with the clientId it
|
|
10
18
|
* keeps across retries. Resolve once it is uploaded; reject to keep it in Review.
|
|
@@ -30,6 +38,7 @@ export interface ComposerProps {
|
|
|
30
38
|
* AI reply suggestions in this chat (direct chats only; null = off). `unavailable` shows the
|
|
31
39
|
* button disabled. The chips clear when `lastCustomerMessageId` changes (a new customer message).
|
|
32
40
|
*/
|
|
41
|
+
ref?: React.Ref<ComposerHandle>;
|
|
33
42
|
aiSuggest?: {
|
|
34
43
|
chatJid: string;
|
|
35
44
|
lastCustomerMessageId: string | null;
|
|
@@ -39,4 +48,4 @@ export interface ComposerProps {
|
|
|
39
48
|
phrases?: readonly ReplyPhraseListItem[];
|
|
40
49
|
} | null;
|
|
41
50
|
}
|
|
42
|
-
export declare function Composer({ quickReplies, onSend, onAttach, onVoiceNote, onTyping, confirmSend, disabled, placeholder, replyTo, onCancelReply, aiSuggest, }: ComposerProps): React.JSX.Element;
|
|
51
|
+
export declare function Composer({ quickReplies, onSend, onAttach, onVoiceNote, onTyping, confirmSend, disabled, placeholder, replyTo, onCancelReply, aiSuggest, ref, }: ComposerProps): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Chat, Inbox } from '@ezychat/shared';
|
|
1
|
+
import type { AiGroupChat, Chat, Inbox } from '@ezychat/shared';
|
|
2
2
|
import type { Directory } from './useDirectory';
|
|
3
3
|
export interface ConversationHeaderProps {
|
|
4
4
|
chat: Chat;
|
|
@@ -22,6 +22,8 @@ export interface ConversationHeaderProps {
|
|
|
22
22
|
memberCount?: number | null;
|
|
23
23
|
/** The chat's inbox, only while the user sees two or more inboxes (replies leave from it). */
|
|
24
24
|
inbox?: Pick<Inbox, 'name' | 'tone'>;
|
|
25
|
+
/** Group chats: whether the AI agent answers when tagged or quoted (the header badge). */
|
|
26
|
+
groupAi?: AiGroupChat | null;
|
|
25
27
|
busy?: boolean;
|
|
26
28
|
}
|
|
27
|
-
export declare function ConversationHeader({ chat, directory, onBack, onAssign, onToggleStatus, notesOpen, notesCount, onToggleNotes, showCustomer, customerOpen, onToggleCustomer, onOpenInfo, memberCount, inbox, busy, }: ConversationHeaderProps): import("react").JSX.Element;
|
|
29
|
+
export declare function ConversationHeader({ chat, directory, onBack, onAssign, onToggleStatus, notesOpen, notesCount, onToggleNotes, showCustomer, customerOpen, onToggleCustomer, onOpenInfo, memberCount, inbox, groupAi, busy, }: ConversationHeaderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AiGroupChat } from '@ezychat/shared';
|
|
2
|
+
/** The AI answers tags and quotes in this group now (its switch and the agent's are both on). */
|
|
3
|
+
export declare const groupAiActive: (ai: AiGroupChat | null | undefined) => boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Group info → "AI agent answers when tagged or quoted". Admins switch it; agents see the state.
|
|
6
|
+
* Disabled with a hint while the agent's "Answer in groups" is off. Hidden when the server does not
|
|
7
|
+
* answer (an older server, or no access).
|
|
8
|
+
*/
|
|
9
|
+
export declare function GroupAiRow({ jid, isAdmin }: Readonly<{
|
|
10
|
+
jid: string;
|
|
11
|
+
isAdmin: boolean;
|
|
12
|
+
}>): import("react").JSX.Element | null;
|
|
13
|
+
/** Chat header badge on a group where the AI answers when tagged or quoted (or is paused there). */
|
|
14
|
+
export declare function GroupAiBadge({ ai }: Readonly<{
|
|
15
|
+
ai: AiGroupChat | null | undefined;
|
|
16
|
+
}>): import("react").JSX.Element | null;
|
|
@@ -7,6 +7,8 @@ export interface GroupPanelProps {
|
|
|
7
7
|
jid: string;
|
|
8
8
|
open: boolean;
|
|
9
9
|
onClose(): void;
|
|
10
|
+
/** Admins switch whether the AI agent answers in this group; agents see the state. */
|
|
11
|
+
isAdmin?: boolean;
|
|
10
12
|
}
|
|
11
13
|
type T = ReturnType<typeof useTranslation<'inbox'>>['t'];
|
|
12
14
|
/** What the team can call a member: our name for them, else their number, else their WhatsApp ID. */
|
|
@@ -15,5 +17,5 @@ export declare function memberLabel(m: GroupMember, t: T): string;
|
|
|
15
17
|
* Group info: the members of a WhatsApp group (read from WhatsApp, view-only), with search, an
|
|
16
18
|
* admins filter and per-member details. Side panel on >= lg, full-height Sheet below.
|
|
17
19
|
*/
|
|
18
|
-
export declare function GroupPanel({ jid, open, onClose }: GroupPanelProps): React.JSX.Element | null;
|
|
20
|
+
export declare function GroupPanel({ jid, open, onClose, isAdmin }: GroupPanelProps): React.JSX.Element | null;
|
|
19
21
|
export {};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import type React from 'react';
|
|
1
2
|
import type { Message } from '@ezychat/shared';
|
|
2
3
|
export interface MediaViewProps {
|
|
3
4
|
message: Message;
|
|
4
5
|
/** Fired when an image/video finishes loading (lets the list keep its scroll anchored). */
|
|
5
6
|
onLoad?(): void;
|
|
6
7
|
}
|
|
8
|
+
/** The file name a media file gets when dragged or saved out of the app. */
|
|
9
|
+
export declare function mediaFileName(m: Pick<Message, 'id' | 'type' | 'mediaName' | 'mediaMime'>): string;
|
|
7
10
|
/** Renders the media part of a message (image, sticker, video, audio, document). */
|
|
8
|
-
export declare function MediaView({ message: m, onLoad }: MediaViewProps):
|
|
11
|
+
export declare function MediaView({ message: m, onLoad }: MediaViewProps): React.JSX.Element;
|
|
@@ -17,10 +17,12 @@ export interface ReactionPickerProps {
|
|
|
17
17
|
disabledReason: string | null;
|
|
18
18
|
/** Touch screens open the bar by press-and-hold, so it offers Reply as well. */
|
|
19
19
|
onReply?(): void;
|
|
20
|
+
/** …and Copy text, for a message with text. */
|
|
21
|
+
onCopy?(): void;
|
|
20
22
|
}
|
|
21
23
|
/**
|
|
22
24
|
* The 🙂 button next to a message and its emoji bar. WhatsApp keeps one
|
|
23
25
|
* reaction per number, so the whole team shares the linked number's reaction: a new emoji replaces
|
|
24
26
|
* it, the same emoji again removes it.
|
|
25
27
|
*/
|
|
26
|
-
export declare function ReactionPicker({ out, current, currentBy, open, onOpenChange, onReact, disabledReason, onReply, }: ReactionPickerProps): import("react").JSX.Element;
|
|
28
|
+
export declare function ReactionPicker({ out, current, currentBy, open, onOpenChange, onReact, disabledReason, onReply, onCopy, }: ReactionPickerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copies text. The async Clipboard API needs a secure context (localhost, the tunnel's https); a
|
|
3
|
+
* LAN address over http falls back to the older selection copy, which still works there.
|
|
4
|
+
*/
|
|
5
|
+
export declare function copyText(text: string): Promise<void>;
|
|
6
|
+
/** Images go on the clipboard only through the async API (secure context, ClipboardItem). */
|
|
7
|
+
export declare function canCopyImage(): boolean;
|
|
8
|
+
/** Browsers accept only PNG images on the clipboard: other types are redrawn as PNG. */
|
|
9
|
+
export declare function toPngBlob(blob: Blob): Promise<Blob>;
|
|
10
|
+
/** Copies the image at `url` (a same-origin media link). */
|
|
11
|
+
export declare function copyImageFromUrl(url: string): Promise<void>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** Files one send takes at most, as WhatsApp's own picker. */
|
|
2
|
+
export declare const MAX_ATTACHMENTS = 10;
|
|
3
|
+
/** A drag that carries files from the OS (not text or a link from inside the page). */
|
|
4
|
+
export declare function hasFiles(dt: Pick<DataTransfer, 'types'> | null | undefined): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* The files of a drop or paste. A screenshot pasted from the clipboard has no useful name
|
|
7
|
+
* ("image.png" or none), so it is named after the time it was pasted.
|
|
8
|
+
*/
|
|
9
|
+
export declare function filesFromTransfer(dt: Pick<DataTransfer, 'files'> | null | undefined, now?: () => Date): File[];
|
|
10
|
+
export type RejectedFile = {
|
|
11
|
+
file: File;
|
|
12
|
+
reason: 'too_large' | 'empty' | 'too_many';
|
|
13
|
+
};
|
|
14
|
+
/** Splits files into the ones that can be sent and the ones refused before any upload. */
|
|
15
|
+
export declare function checkAttachments(files: readonly File[], alreadyQueued: number): {
|
|
16
|
+
accepted: File[];
|
|
17
|
+
rejected: RejectedFile[];
|
|
18
|
+
};
|
|
19
|
+
/** "1.2 MB" style size for the attachment tray. */
|
|
20
|
+
export declare function formatBytes(n: number): string;
|
|
21
|
+
/** The sender chose the type: only a plain `type/subtype` goes into the drag, else a neutral one. */
|
|
22
|
+
export declare function safeMime(mime: string | null): string;
|
|
23
|
+
/**
|
|
24
|
+
* The sender chose the name: no control characters, nothing a desktop forbids in a file name
|
|
25
|
+
* (`<>:"/\|?*`; a colon would also end the drag's name field early) and no leading dots.
|
|
26
|
+
*/
|
|
27
|
+
export declare function safeFileName(name: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Lets a media file be dragged out of the app onto the desktop or a folder (Chromium browsers and
|
|
30
|
+
* the desktop app): the `DownloadURL` drag type is `mime:name:absolute-url`, saved like a download.
|
|
31
|
+
*/
|
|
32
|
+
export declare function setDownloadDrag(dt: DataTransfer, file: {
|
|
33
|
+
url: string;
|
|
34
|
+
name: string;
|
|
35
|
+
mime: string | null;
|
|
36
|
+
}): void;
|
|
37
|
+
/**
|
|
38
|
+
* A file dropped where nothing takes it would make the browser open it in place of the app (or,
|
|
39
|
+
* in the desktop window, try to navigate to it). Refuse such drops page-wide; drop zones call
|
|
40
|
+
* `preventDefault` first and keep working. Returns the uninstall function.
|
|
41
|
+
*/
|
|
42
|
+
export declare function installFileDropGuard(target?: Window): () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ezychat/web",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.62",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "EzyChat core: the team inbox web app (React) as a library, with createInboxApp and its extension API.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"build:lib": "node ../../scripts/build-web-lib.mjs"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@ezychat/shared": "0.1.
|
|
43
|
+
"@ezychat/shared": "0.1.62",
|
|
44
44
|
"@fontsource-variable/inter": "^5.3.0",
|
|
45
45
|
"@tanstack/react-query": "^5.104.5",
|
|
46
46
|
"@types/react": "^19.3.0",
|