@ezychat/web 0.1.78 → 0.1.80
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-Bw0RmdAy.js → admin-D4nMrYTV.js} +48 -5
- package/dist-lib/chunks/{admin-Vk_4QCBI.js → admin-SGy97Cay.js} +46 -5
- package/dist-lib/chunks/{inbox-g6IVD36a.js → inbox-BIHKs_xm.js} +182 -5
- package/dist-lib/chunks/{inbox-BP7OELj9.js → inbox-DaYVsh_k.js} +182 -5
- package/dist-lib/ezychat-web.css +1 -1
- package/dist-lib/index.js +9424 -7113
- package/dist-lib/public/badge-96.png +0 -0
- package/dist-lib/sw.ts +2 -1
- package/dist-lib/types/admin/AgentScheduledTasksCard.d.ts +10 -0
- package/dist-lib/types/admin/MemberChatsField.d.ts +11 -0
- package/dist-lib/types/admin/NewChatSection.d.ts +7 -0
- package/dist-lib/types/admin/ScheduledRunsDialog.d.ts +12 -0
- package/dist-lib/types/admin/ScheduledTaskDialog.d.ts +18 -0
- package/dist-lib/types/admin/scheduled-format.d.ts +16 -0
- package/dist-lib/types/api/ai.d.ts +5 -1
- package/dist-lib/types/api/forward.d.ts +76 -0
- package/dist-lib/types/api/inbox-mutations.d.ts +16 -0
- package/dist-lib/types/api/message-changes.d.ts +24 -2
- package/dist-lib/types/api/new-chat.d.ts +55 -0
- package/dist-lib/types/api/queries.d.ts +98 -8
- package/dist-lib/types/api/scheduled-tasks.d.ts +145 -0
- package/dist-lib/types/api/templates.d.ts +12 -1
- package/dist-lib/types/askezy/AskEzyButton.d.ts +1 -1
- package/dist-lib/types/auth/chat-scope.d.ts +7 -0
- package/dist-lib/types/i18n/resources.d.ts +339 -0
- package/dist-lib/types/inbox/Composer.d.ts +4 -1
- package/dist-lib/types/inbox/ForwardDialog.d.ts +11 -0
- package/dist-lib/types/inbox/MediaView.d.ts +3 -0
- package/dist-lib/types/inbox/MessageActions.d.ts +7 -2
- package/dist-lib/types/inbox/MessageBubble.d.ts +4 -0
- package/dist-lib/types/inbox/NewChatDialog.d.ts +2 -0
- package/dist-lib/types/inbox/ReactionPicker.d.ts +3 -1
- package/dist-lib/types/inbox/ReplyWindow.d.ts +16 -0
- package/dist-lib/types/inbox/message-changes.d.ts +12 -0
- package/dist-lib/types/inbox/useDirectory.d.ts +3 -0
- package/dist-lib/types/lib/file-transfer.d.ts +13 -1
- package/package.json +2 -2
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { MessageTemplate } from '@ezychat/shared';
|
|
1
3
|
/** Meta's page where a WhatsApp Business Account creates and manages its message templates. */
|
|
2
4
|
export declare const TEMPLATES_MANAGER_URL = "https://business.facebook.com/wa/manage/message-templates/";
|
|
3
5
|
/** The 24-hour customer-service window of a Business API chat: a quiet line above the composer. */
|
|
@@ -13,6 +15,7 @@ export declare function WindowClosedPanel({ jid, inboxId, customerName, disabled
|
|
|
13
15
|
/** WhatsApp is offline: nothing can be sent. */
|
|
14
16
|
disabled?: boolean;
|
|
15
17
|
}>): import("react").JSX.Element;
|
|
18
|
+
export declare const templateKey: (tpl: Pick<MessageTemplate, "name" | "language">) => string;
|
|
16
19
|
/** The body with each {{n}} replaced by its value; an empty value keeps its placeholder. */
|
|
17
20
|
export declare function fillTemplate(body: string, values: readonly string[]): string;
|
|
18
21
|
/** Pick an approved template, fill its variables and see the message before sending it. */
|
|
@@ -23,3 +26,16 @@ export declare function TemplateDialog({ open, jid, inboxId, customerName, onClo
|
|
|
23
26
|
customerName: string;
|
|
24
27
|
onClose(): void;
|
|
25
28
|
}>): import("react").JSX.Element;
|
|
29
|
+
/**
|
|
30
|
+
* The template list (sendable ones selectable), the variable boxes and the live preview: shared by the
|
|
31
|
+
* reply-window dialog and New chat's template step.
|
|
32
|
+
*/
|
|
33
|
+
export declare function TemplateFields({ templates, selected, values, submitted, syncButton, onChoose, onValues, }: Readonly<{
|
|
34
|
+
templates: readonly MessageTemplate[];
|
|
35
|
+
selected: MessageTemplate | null;
|
|
36
|
+
values: readonly string[];
|
|
37
|
+
submitted: boolean;
|
|
38
|
+
syncButton?: ReactNode;
|
|
39
|
+
onChoose(tpl: MessageTemplate): void;
|
|
40
|
+
onValues(values: string[]): void;
|
|
41
|
+
}>): import("react").JSX.Element;
|
|
@@ -26,6 +26,16 @@ export declare function messageRights(m: Message, user: {
|
|
|
26
26
|
} | null, caps: Pick<InboxCapabilities, 'editMessage' | 'deleteForEveryone' | 'deleteForMe'>, now: number): MessageRights;
|
|
27
27
|
/** Anything to offer in the message's menu. */
|
|
28
28
|
export declare function hasActions(r: MessageRights): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* A message that may be forwarded (the server's rule): one WhatsApp has (not `local-`, not pending
|
|
31
|
+
* or failed), not a system line, not deleted for everyone or hidden for the team.
|
|
32
|
+
*/
|
|
33
|
+
export declare function forwardable(m: Message): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Forward stays in the menu but disabled for a file WhatsApp Safety rated High (locked, released or
|
|
36
|
+
* deleted), admins too: the server refuses it the same way (409 `safety_locked`).
|
|
37
|
+
*/
|
|
38
|
+
export declare function forwardLocked(m: Message): boolean;
|
|
29
39
|
/** Handlers and rights the conversation gives each bubble. */
|
|
30
40
|
export interface MessageChangeProps {
|
|
31
41
|
rightsOf(m: Message): MessageRights;
|
|
@@ -33,6 +43,8 @@ export interface MessageChangeProps {
|
|
|
33
43
|
disabledReason: string | null;
|
|
34
44
|
onEdit(m: Message): void;
|
|
35
45
|
onDelete(m: Message): void;
|
|
46
|
+
/** Forward a copy to other chats (⋮ menu first item; under Reply in the press-and-hold bar). */
|
|
47
|
+
onForward?(m: Message): void;
|
|
36
48
|
/** Admins may read the original of a deleted message. */
|
|
37
49
|
isAdmin: boolean;
|
|
38
50
|
}
|
|
@@ -7,6 +7,8 @@ import { type DirectoryUser } from '../api/queries';
|
|
|
7
7
|
*/
|
|
8
8
|
export type DirectoryEntry = Omit<DirectoryUser, 'inboxIds'> & {
|
|
9
9
|
inboxIds?: DirectoryUser['inboxIds'];
|
|
10
|
+
/** 'chosen': an agent limited to chosen chats (`chatJids`, as far as the viewer may know them). */
|
|
11
|
+
chatScope?: User['chatScope'];
|
|
10
12
|
};
|
|
11
13
|
/**
|
|
12
14
|
* The member may open chats of this inbox (admins and the AI member open every inbox). A row without
|
|
@@ -26,6 +28,7 @@ export interface Directory {
|
|
|
26
28
|
*/
|
|
27
29
|
assignableFor(inboxId: number, opts?: {
|
|
28
30
|
direct?: boolean;
|
|
31
|
+
chatJid?: string;
|
|
29
32
|
}): DirectoryEntry[];
|
|
30
33
|
/** Display name for a user id ("You" for the current user when `youLabel`). */
|
|
31
34
|
nameOf(id: number | null | undefined, opts?: {
|
|
@@ -10,9 +10,21 @@ export declare function filesFromTransfer(dt: Pick<DataTransfer, 'files'> | null
|
|
|
10
10
|
export type RejectedFile = {
|
|
11
11
|
file: File;
|
|
12
12
|
reason: 'too_large' | 'empty' | 'too_many';
|
|
13
|
+
/** The limit a `too_large` file went over, in bytes. */
|
|
14
|
+
limit?: number;
|
|
13
15
|
};
|
|
16
|
+
/** What a chat's WhatsApp number takes, per kind of file (`InboxCapabilities.mediaLimits`). */
|
|
17
|
+
export type MediaLimits = Partial<Record<'video' | 'image' | 'audio' | 'document', number>>;
|
|
18
|
+
/**
|
|
19
|
+
* The largest file of this type the chat's number takes: the app's upload limit, lowered by the
|
|
20
|
+
* number's own limit for images, audio and documents. A video is checked against the document
|
|
21
|
+
* limit only: above the video limit the server answers `too_large_as_video` (it may go as a file).
|
|
22
|
+
*/
|
|
23
|
+
export declare function uploadLimitFor(mime: string, limits?: MediaLimits | null): number;
|
|
24
|
+
/** A video above the number's video limit (it can still go as a file, up to the document limit). */
|
|
25
|
+
export declare function videoNeedsFile(file: File, limits?: MediaLimits | null): boolean;
|
|
14
26
|
/** 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): {
|
|
27
|
+
export declare function checkAttachments(files: readonly File[], alreadyQueued: number, limits?: MediaLimits | null): {
|
|
16
28
|
accepted: File[];
|
|
17
29
|
rejected: RejectedFile[];
|
|
18
30
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ezychat/web",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.80",
|
|
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.80",
|
|
44
44
|
"@fontsource-variable/inter": "^5.3.0",
|
|
45
45
|
"@tanstack/react-query": "^5.105.0",
|
|
46
46
|
"@types/react": "^19.3.0",
|