@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.
Files changed (37) hide show
  1. package/dist-lib/chunks/{admin-Bw0RmdAy.js → admin-D4nMrYTV.js} +48 -5
  2. package/dist-lib/chunks/{admin-Vk_4QCBI.js → admin-SGy97Cay.js} +46 -5
  3. package/dist-lib/chunks/{inbox-g6IVD36a.js → inbox-BIHKs_xm.js} +182 -5
  4. package/dist-lib/chunks/{inbox-BP7OELj9.js → inbox-DaYVsh_k.js} +182 -5
  5. package/dist-lib/ezychat-web.css +1 -1
  6. package/dist-lib/index.js +9424 -7113
  7. package/dist-lib/public/badge-96.png +0 -0
  8. package/dist-lib/sw.ts +2 -1
  9. package/dist-lib/types/admin/AgentScheduledTasksCard.d.ts +10 -0
  10. package/dist-lib/types/admin/MemberChatsField.d.ts +11 -0
  11. package/dist-lib/types/admin/NewChatSection.d.ts +7 -0
  12. package/dist-lib/types/admin/ScheduledRunsDialog.d.ts +12 -0
  13. package/dist-lib/types/admin/ScheduledTaskDialog.d.ts +18 -0
  14. package/dist-lib/types/admin/scheduled-format.d.ts +16 -0
  15. package/dist-lib/types/api/ai.d.ts +5 -1
  16. package/dist-lib/types/api/forward.d.ts +76 -0
  17. package/dist-lib/types/api/inbox-mutations.d.ts +16 -0
  18. package/dist-lib/types/api/message-changes.d.ts +24 -2
  19. package/dist-lib/types/api/new-chat.d.ts +55 -0
  20. package/dist-lib/types/api/queries.d.ts +98 -8
  21. package/dist-lib/types/api/scheduled-tasks.d.ts +145 -0
  22. package/dist-lib/types/api/templates.d.ts +12 -1
  23. package/dist-lib/types/askezy/AskEzyButton.d.ts +1 -1
  24. package/dist-lib/types/auth/chat-scope.d.ts +7 -0
  25. package/dist-lib/types/i18n/resources.d.ts +339 -0
  26. package/dist-lib/types/inbox/Composer.d.ts +4 -1
  27. package/dist-lib/types/inbox/ForwardDialog.d.ts +11 -0
  28. package/dist-lib/types/inbox/MediaView.d.ts +3 -0
  29. package/dist-lib/types/inbox/MessageActions.d.ts +7 -2
  30. package/dist-lib/types/inbox/MessageBubble.d.ts +4 -0
  31. package/dist-lib/types/inbox/NewChatDialog.d.ts +2 -0
  32. package/dist-lib/types/inbox/ReactionPicker.d.ts +3 -1
  33. package/dist-lib/types/inbox/ReplyWindow.d.ts +16 -0
  34. package/dist-lib/types/inbox/message-changes.d.ts +12 -0
  35. package/dist-lib/types/inbox/useDirectory.d.ts +3 -0
  36. package/dist-lib/types/lib/file-transfer.d.ts +13 -1
  37. package/package.json +2 -2
@@ -0,0 +1,145 @@
1
+ import { type ScheduledTaskPatch } from '@ezychat/shared';
2
+ /**
3
+ * Scheduled tasks of one AI agent (design docs/features/scheduled-tasks/design.md, admins only):
4
+ * the list with the pause reason, the limit and the business time zone, and its changes. Every
5
+ * change reads the list again, so the next run and the last result come from the server.
6
+ */
7
+ export declare const scheduledTasksKey: (agentId: number) => readonly ["scheduled-tasks", number];
8
+ export declare const scheduledRunsKey: (agentId: number, taskId: number) => readonly ["scheduled-tasks", number, "runs", number];
9
+ /** Read again every minute: the next run, the last result and the pause move by themselves. */
10
+ export declare const SCHEDULED_REFETCH_MS = 60000;
11
+ export declare function useScheduledTasks(agentId: number): import("@tanstack/react-query").UseQueryResult<{
12
+ tasks: {
13
+ chat: {
14
+ jid: string;
15
+ name: string;
16
+ type: "dm" | "group";
17
+ } | null;
18
+ nextRunAt: number | null;
19
+ lastRun: {
20
+ id: number;
21
+ at: number;
22
+ trigger: "schedule" | "run_now";
23
+ byUserName: string | null;
24
+ result: "failed" | "sent" | "skipped" | null;
25
+ reason: "window_closed" | "confidential_leak" | "ai_unavailable" | "lookup_failed" | "agent_off" | "ai_disconnected" | "wa_disconnected" | "access_closed" | "nothing_to_say" | "needs_team" | "missed" | "chat_gone" | "send_failed" | "interrupted" | null;
26
+ messageId: string | null;
27
+ } | null;
28
+ name: string;
29
+ enabled: boolean;
30
+ time: string;
31
+ dayRule: "custom" | "daily" | "weekdays";
32
+ days: number[];
33
+ chatJid: string;
34
+ instruction: string;
35
+ id: number;
36
+ agentId: number;
37
+ }[];
38
+ max: number;
39
+ paused: "agent_off" | "ai_disconnected" | "wa_disconnected" | "access_closed" | null;
40
+ timeZone: string;
41
+ inboxId: number | null;
42
+ }, Error>;
43
+ /** Adds a task (409 `scheduled_task_limit`, 400 `chat_not_in_inbox`). */
44
+ export declare function useCreateScheduledTask(agentId: number): import("@tanstack/react-query").UseMutationResult<{
45
+ chat: {
46
+ jid: string;
47
+ name: string;
48
+ type: "dm" | "group";
49
+ } | null;
50
+ nextRunAt: number | null;
51
+ lastRun: {
52
+ id: number;
53
+ at: number;
54
+ trigger: "schedule" | "run_now";
55
+ byUserName: string | null;
56
+ result: "failed" | "sent" | "skipped" | null;
57
+ reason: "window_closed" | "confidential_leak" | "ai_unavailable" | "lookup_failed" | "agent_off" | "ai_disconnected" | "wa_disconnected" | "access_closed" | "nothing_to_say" | "needs_team" | "missed" | "chat_gone" | "send_failed" | "interrupted" | null;
58
+ messageId: string | null;
59
+ } | null;
60
+ name: string;
61
+ enabled: boolean;
62
+ time: string;
63
+ dayRule: "custom" | "daily" | "weekdays";
64
+ days: number[];
65
+ chatJid: string;
66
+ instruction: string;
67
+ id: number;
68
+ agentId: number;
69
+ }, Error, {
70
+ name: string;
71
+ time: string;
72
+ dayRule: "custom" | "daily" | "weekdays";
73
+ chatJid: string;
74
+ instruction: string;
75
+ enabled?: boolean | undefined;
76
+ days?: number[] | undefined;
77
+ }, unknown>;
78
+ /** Changes a task; the row's on/off switch sends `{ enabled }` only. */
79
+ export declare function useUpdateScheduledTask(agentId: number): import("@tanstack/react-query").UseMutationResult<{
80
+ chat: {
81
+ jid: string;
82
+ name: string;
83
+ type: "dm" | "group";
84
+ } | null;
85
+ nextRunAt: number | null;
86
+ lastRun: {
87
+ id: number;
88
+ at: number;
89
+ trigger: "schedule" | "run_now";
90
+ byUserName: string | null;
91
+ result: "failed" | "sent" | "skipped" | null;
92
+ reason: "window_closed" | "confidential_leak" | "ai_unavailable" | "lookup_failed" | "agent_off" | "ai_disconnected" | "wa_disconnected" | "access_closed" | "nothing_to_say" | "needs_team" | "missed" | "chat_gone" | "send_failed" | "interrupted" | null;
93
+ messageId: string | null;
94
+ } | null;
95
+ name: string;
96
+ enabled: boolean;
97
+ time: string;
98
+ dayRule: "custom" | "daily" | "weekdays";
99
+ days: number[];
100
+ chatJid: string;
101
+ instruction: string;
102
+ id: number;
103
+ agentId: number;
104
+ }, Error, {
105
+ taskId: number;
106
+ patch: ScheduledTaskPatch;
107
+ }, unknown>;
108
+ export declare function useDeleteScheduledTask(agentId: number): import("@tanstack/react-query").UseMutationResult<unknown, Error, number, unknown>;
109
+ /** The task's last runs, newest first. */
110
+ export declare function useScheduledRuns(agentId: number, taskId: number): import("@tanstack/react-query").UseQueryResult<{
111
+ runs: {
112
+ id: number;
113
+ at: number;
114
+ trigger: "schedule" | "run_now";
115
+ byUserName: string | null;
116
+ result: "failed" | "sent" | "skipped" | null;
117
+ reason: "window_closed" | "confidential_leak" | "ai_unavailable" | "lookup_failed" | "agent_off" | "ai_disconnected" | "wa_disconnected" | "access_closed" | "nothing_to_say" | "needs_team" | "missed" | "chat_gone" | "send_failed" | "interrupted" | null;
118
+ messageId: string | null;
119
+ }[];
120
+ }, Error>;
121
+ /** Run now (429 `rate_limited`, 409 `scheduled_paused`): answers the run as recorded. */
122
+ export declare function useRunScheduledTask(agentId: number): import("@tanstack/react-query").UseMutationResult<{
123
+ run: {
124
+ id: number;
125
+ at: number;
126
+ trigger: "schedule" | "run_now";
127
+ byUserName: string | null;
128
+ result: "failed" | "sent" | "skipped" | null;
129
+ reason: "window_closed" | "confidential_leak" | "ai_unavailable" | "lookup_failed" | "agent_off" | "ai_disconnected" | "wa_disconnected" | "access_closed" | "nothing_to_say" | "needs_team" | "missed" | "chat_gone" | "send_failed" | "interrupted" | null;
130
+ messageId: string | null;
131
+ };
132
+ }, Error, number, unknown>;
133
+ /** Preview: one turn, nothing sent or stored. */
134
+ export declare function usePreviewScheduledTask(agentId: number): import("@tanstack/react-query").UseMutationResult<{
135
+ result: "sent" | "skipped";
136
+ text: string | null;
137
+ reason: "window_closed" | "confidential_leak" | "ai_unavailable" | "lookup_failed" | "agent_off" | "ai_disconnected" | "wa_disconnected" | "access_closed" | "nothing_to_say" | "needs_team" | "missed" | "chat_gone" | "send_failed" | "interrupted" | null;
138
+ lookups: {
139
+ title: string;
140
+ sourceLabel: string;
141
+ }[];
142
+ }, Error, {
143
+ chatJid: string;
144
+ instruction: string;
145
+ }, unknown>;
@@ -60,9 +60,20 @@ export declare function useSendTemplate(jid: string): import("@tanstack/react-qu
60
60
  language: string;
61
61
  } | null | undefined;
62
62
  viaAssistant?: boolean | undefined;
63
+ forwarded?: {
64
+ manyTimes: boolean;
65
+ } | null | undefined;
66
+ mediaSize?: number | null | undefined;
67
+ mediaWidth?: number | null | undefined;
68
+ mediaHeight?: number | null | undefined;
69
+ mediaThumbUrl?: string | null | undefined;
70
+ scheduledTask?: {
71
+ id: number;
72
+ name: string | null;
73
+ } | null | undefined;
63
74
  transcript?: string | null | undefined;
64
75
  transcriptLang?: string | null | undefined;
65
- transcriptStatus?: "pending" | "failed" | "ok" | "too_long" | "unsupported" | "skipped" | null | undefined;
76
+ transcriptStatus?: "pending" | "failed" | "ok" | "skipped" | "too_long" | "unsupported" | null | undefined;
66
77
  senderProfile?: {
67
78
  chatJid: string;
68
79
  name: string;
@@ -5,4 +5,4 @@ export declare function AskEzyButton({ request, compact, variant, className, }:
5
5
  compact?: boolean;
6
6
  variant?: 'ghost' | 'outline';
7
7
  className?: string;
8
- }): import("react").JSX.Element;
8
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ import type { User } from '@ezychat/shared';
2
+ /**
3
+ * An agent limited to chosen chats (`User.chatScope === 'chosen'`): no Ask Ezy (it reads across
4
+ * chats) and no chat opened or started from a group member. The server refuses both anyway.
5
+ */
6
+ export declare function chosenChatsOnly(user: Pick<User, 'role' | 'chatScope'> | null | undefined): boolean;
7
+ export declare function useChosenChatsOnly(): boolean;
@@ -661,6 +661,10 @@ export declare const enResources: {
661
661
  resolvedTitle: string;
662
662
  resolvedDescription: string;
663
663
  tag: string;
664
+ chosen: {
665
+ title: string;
666
+ description: string;
667
+ };
664
668
  };
665
669
  };
666
670
  chatListItem: {
@@ -793,6 +797,7 @@ export declare const enResources: {
793
797
  unavailable: string;
794
798
  unavailableHint: string;
795
799
  };
800
+ sentAsFile: string;
796
801
  };
797
802
  quickReplies: {
798
803
  title: string;
@@ -1011,6 +1016,13 @@ export declare const enResources: {
1011
1016
  hideOriginal: string;
1012
1017
  noText: string;
1013
1018
  };
1019
+ scheduled: string;
1020
+ scheduledNamed: string;
1021
+ uploadErrors: {
1022
+ too_large: string;
1023
+ too_large_as_video: string;
1024
+ too_large_for_whatsapp: string;
1025
+ };
1014
1026
  };
1015
1027
  media: {
1016
1028
  types: {
@@ -1237,6 +1249,7 @@ export declare const enResources: {
1237
1249
  start: string;
1238
1250
  startFailed: string;
1239
1251
  listLabel: string;
1252
+ chosenChatsOnly: string;
1240
1253
  };
1241
1254
  gettingStarted: {
1242
1255
  title: string;
@@ -1643,6 +1656,172 @@ export declare const enResources: {
1643
1656
  tipTitle: string;
1644
1657
  tipBody: string;
1645
1658
  };
1659
+ newChat: {
1660
+ button: string;
1661
+ title: string;
1662
+ description: string;
1663
+ from: string;
1664
+ businessApi: string;
1665
+ phone: string;
1666
+ phonePlaceholder: string;
1667
+ phoneHint: string;
1668
+ phoneInvalid: string;
1669
+ willMessage: string;
1670
+ name: string;
1671
+ nameHint: string;
1672
+ banTitle: string;
1673
+ banBody: string;
1674
+ apiTitle: string;
1675
+ apiBody: string;
1676
+ usage: string;
1677
+ start: string;
1678
+ checking: string;
1679
+ next: string;
1680
+ preparing: string;
1681
+ existingTitle: string;
1682
+ existingBody: string;
1683
+ openChat: string;
1684
+ back: string;
1685
+ templateTitle: string;
1686
+ templateDescription: string;
1687
+ paidNote: string;
1688
+ sendTemplate: string;
1689
+ sending: string;
1690
+ createdToast: string;
1691
+ sentToast: string;
1692
+ problems: {
1693
+ not_on_whatsapp: {
1694
+ title: string;
1695
+ body: string;
1696
+ };
1697
+ own_number: {
1698
+ title: string;
1699
+ body: string;
1700
+ };
1701
+ wa_disconnected: {
1702
+ title: string;
1703
+ body: string;
1704
+ };
1705
+ new_chat_daily_limit: {
1706
+ title: string;
1707
+ body: string;
1708
+ };
1709
+ new_chat_hourly_limit: {
1710
+ title: string;
1711
+ body: string;
1712
+ };
1713
+ template_failed: {
1714
+ title: string;
1715
+ body: string;
1716
+ };
1717
+ new_chat_not_allowed: {
1718
+ title: string;
1719
+ body: string;
1720
+ };
1721
+ other: {
1722
+ title: string;
1723
+ body: string;
1724
+ };
1725
+ invalid_number: {
1726
+ title: string;
1727
+ body: string;
1728
+ };
1729
+ new_chat_unsupported: {
1730
+ title: string;
1731
+ body: string;
1732
+ };
1733
+ };
1734
+ usageNoLimit: string;
1735
+ };
1736
+ forward: {
1737
+ action: string;
1738
+ lockedReason: string;
1739
+ forwarded: string;
1740
+ forwardedMany: string;
1741
+ title: string;
1742
+ description: string;
1743
+ manyTimesNote: string;
1744
+ count: string;
1745
+ full: string;
1746
+ remove: string;
1747
+ search: string;
1748
+ listLabel: string;
1749
+ loading: string;
1750
+ emptyTitle: string;
1751
+ emptyQuery: string;
1752
+ emptyNone: string;
1753
+ windowClosedRow: string;
1754
+ otherInbox: string;
1755
+ cancel: string;
1756
+ send: string;
1757
+ sendCount_one: string;
1758
+ sendCount_other: string;
1759
+ sending: string;
1760
+ sentOne: string;
1761
+ sentMany_one: string;
1762
+ sentMany_other: string;
1763
+ openChat: string;
1764
+ problems: {
1765
+ wa_disconnected: {
1766
+ title: string;
1767
+ body: string;
1768
+ };
1769
+ window_closed: {
1770
+ title: string;
1771
+ body: string;
1772
+ };
1773
+ safety_locked: {
1774
+ title: string;
1775
+ body: string;
1776
+ };
1777
+ rate_limited: {
1778
+ title: string;
1779
+ body: string;
1780
+ };
1781
+ media_unavailable: {
1782
+ title: string;
1783
+ body: string;
1784
+ };
1785
+ message_deleted: {
1786
+ title: string;
1787
+ body: string;
1788
+ };
1789
+ other: {
1790
+ title: string;
1791
+ body: string;
1792
+ };
1793
+ too_large_as_video: {
1794
+ title: string;
1795
+ body: string;
1796
+ };
1797
+ too_large_for_whatsapp: {
1798
+ title: string;
1799
+ body: string;
1800
+ };
1801
+ message_not_sent: {
1802
+ title: string;
1803
+ body: string;
1804
+ };
1805
+ inbox_removed: {
1806
+ title: string;
1807
+ body: string;
1808
+ };
1809
+ forward_many_times: {
1810
+ title: string;
1811
+ body: string;
1812
+ };
1813
+ };
1814
+ largeNote: string;
1815
+ sendAs: string;
1816
+ asVideo: string;
1817
+ asFile: string;
1818
+ sendAsHint: string;
1819
+ videoTooBig: string;
1820
+ tooBigRow: string;
1821
+ sendingLarge: string;
1822
+ thisNumber: string;
1823
+ loadFailed: string;
1824
+ };
1646
1825
  };
1647
1826
  admin: {
1648
1827
  title: string;
@@ -1864,6 +2043,9 @@ export declare const enResources: {
1864
2043
  safetyBlock: string;
1865
2044
  safetyUnblock: string;
1866
2045
  safetyAutoBlock: string;
2046
+ chatNewNumber: string;
2047
+ settingsNewChatStaff: string;
2048
+ settingsNewChatDailyLimit: string;
1867
2049
  };
1868
2050
  fields: {
1869
2051
  chat: string;
@@ -1909,6 +2091,9 @@ export declare const enResources: {
1909
2091
  agent: string;
1910
2092
  preset: string;
1911
2093
  internal: string;
2094
+ startedBy: string;
2095
+ before: string;
2096
+ after: string;
1912
2097
  };
1913
2098
  reasons: {
1914
2099
  rateLimited: string;
@@ -3029,6 +3214,123 @@ export declare const enResources: {
3029
3214
  offHint: string;
3030
3215
  saveFailed: string;
3031
3216
  };
3217
+ scheduled: {
3218
+ title: string;
3219
+ description: string;
3220
+ add: string;
3221
+ empty: {
3222
+ title: string;
3223
+ body: string;
3224
+ };
3225
+ total: string;
3226
+ limitReached: string;
3227
+ showAll: string;
3228
+ showFewer: string;
3229
+ safety: string;
3230
+ noInbox: string;
3231
+ scheduleLine: string;
3232
+ days: {
3233
+ daily: string;
3234
+ weekdays: string;
3235
+ custom: string;
3236
+ };
3237
+ off: string;
3238
+ pausedShort: string;
3239
+ next: string;
3240
+ chatGone: string;
3241
+ lastRun: string;
3242
+ switchLabel: string;
3243
+ actions: string;
3244
+ edit: string;
3245
+ runNow: string;
3246
+ history: string;
3247
+ delete: string;
3248
+ deleteTitle: string;
3249
+ deleteBody: string;
3250
+ added: string;
3251
+ saved: string;
3252
+ saveFailed: string;
3253
+ result: {
3254
+ sent: string;
3255
+ skipped: string;
3256
+ failed: string;
3257
+ running: string;
3258
+ };
3259
+ reason: {
3260
+ nothing_to_say: string;
3261
+ needs_team: string;
3262
+ agent_off: string;
3263
+ ai_disconnected: string;
3264
+ wa_disconnected: string;
3265
+ access_closed: string;
3266
+ window_closed: string;
3267
+ missed: string;
3268
+ chat_gone: string;
3269
+ confidential_leak: string;
3270
+ ai_unavailable: string;
3271
+ lookup_failed: string;
3272
+ send_failed: string;
3273
+ interrupted: string;
3274
+ };
3275
+ paused: {
3276
+ title: string;
3277
+ agent_off: string;
3278
+ ai_disconnected: string;
3279
+ wa_disconnected: string;
3280
+ access_closed: string;
3281
+ };
3282
+ form: {
3283
+ addTitle: string;
3284
+ editTitle: string;
3285
+ description: string;
3286
+ name: string;
3287
+ namePlaceholder: string;
3288
+ nameRequired: string;
3289
+ chat: string;
3290
+ chatPlaceholder: string;
3291
+ chatSearch: string;
3292
+ chatNone: string;
3293
+ chatLoading: string;
3294
+ chatHint: string;
3295
+ chatRequired: string;
3296
+ chatNotInInbox: string;
3297
+ groups: string;
3298
+ people: string;
3299
+ when: string;
3300
+ time: string;
3301
+ timeZone: string;
3302
+ days: string;
3303
+ daysRequired: string;
3304
+ instruction: string;
3305
+ instructionPlaceholder: string;
3306
+ instructionHint: string;
3307
+ instructionRequired: string;
3308
+ preview: string;
3309
+ save: string;
3310
+ create: string;
3311
+ };
3312
+ preview: {
3313
+ title: string;
3314
+ lookedUp: string;
3315
+ wouldSend: string;
3316
+ wouldSkip: string;
3317
+ nothingSent: string;
3318
+ failed: string;
3319
+ };
3320
+ runNowTitle: string;
3321
+ runNowBody: string;
3322
+ runNowLimit: string;
3323
+ runNowSent: string;
3324
+ runNowSkipped: string;
3325
+ runNowFailed: string;
3326
+ openChat: string;
3327
+ openChatNamed: string;
3328
+ historyTitle: string;
3329
+ historyBody: string;
3330
+ historyEmpty: string;
3331
+ byRunNow: string;
3332
+ byRunNowUnknown: string;
3333
+ };
3032
3334
  };
3033
3335
  enrichment: {
3034
3336
  title: string;
@@ -4499,6 +4801,43 @@ export declare const enResources: {
4499
4801
  };
4500
4802
  };
4501
4803
  };
4804
+ limitedChats: {
4805
+ label: string;
4806
+ all: {
4807
+ title: string;
4808
+ hint: string;
4809
+ };
4810
+ chosen: {
4811
+ title: string;
4812
+ hint: string;
4813
+ };
4814
+ count_one: string;
4815
+ count_other: string;
4816
+ none: string;
4817
+ chosenLabel: string;
4818
+ remove: string;
4819
+ add: string;
4820
+ addLabel: string;
4821
+ addPlaceholder: string;
4822
+ noMatch: string;
4823
+ note_zero: string;
4824
+ note_one: string;
4825
+ note_other: string;
4826
+ };
4827
+ newChat: {
4828
+ title: string;
4829
+ description: string;
4830
+ staff: string;
4831
+ staffOn: string;
4832
+ staffOff: string;
4833
+ limitLabel: string;
4834
+ limitUnit: string;
4835
+ limitInvalid: string;
4836
+ limitHint: string;
4837
+ limitNone: string;
4838
+ limitBanTitle: string;
4839
+ limitBanBody: string;
4840
+ };
4502
4841
  };
4503
4842
  errors: {
4504
4843
  generic: string;
@@ -1,5 +1,6 @@
1
1
  import type React from 'react';
2
2
  import { type GroupMember, type QuickReply, type ReplyPhraseListItem, type FixEnglishStatus } from '@ezychat/shared';
3
+ import { type MediaLimits } from '../lib/file-transfer';
3
4
  /** Lets the conversation hand files dropped anywhere on it to the composer. */
4
5
  export interface ComposerHandle {
5
6
  addFiles(files: readonly File[]): void;
@@ -65,6 +66,8 @@ export interface ComposerProps {
65
66
  error: boolean;
66
67
  onOpen(): void;
67
68
  } | null;
69
+ /** What this chat's WhatsApp number takes per kind of file (bytes); absent = the upload limit. */
70
+ mediaLimits?: MediaLimits | null;
68
71
  /**
69
72
  * Fix English (docs/features/grammar-fix/design.md): spelling and grammar marks in this chat
70
73
  * (any chat type; null or a status with both checks off = nothing shown).
@@ -79,4 +82,4 @@ export interface ComposerProps {
79
82
  onAddWord(word: string): Promise<unknown>;
80
83
  } | null;
81
84
  }
82
- export declare function Composer({ quickReplies, onSend, onAttach, onVoiceNote, onTyping, confirmSend, disabled, placeholder, replyTo, onCancelReply, aiSuggest, askEzy, fixEnglish, mentions, ref, }: ComposerProps): React.JSX.Element;
85
+ export declare function Composer({ quickReplies, onSend, onAttach, onVoiceNote, onTyping, confirmSend, disabled, placeholder, replyTo, onCancelReply, aiSuggest, askEzy, fixEnglish, mentions, mediaLimits, ref, }: ComposerProps): React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { type Message } from '@ezychat/shared';
2
+ /** Server refusals shown as a banner. */
3
+ export type ForwardProblem = 'wa_disconnected' | 'window_closed' | 'safety_locked' | 'rate_limited' | 'media_unavailable' | 'message_deleted' | 'message_not_sent' | 'inbox_removed' | 'forward_many_times' | 'too_large_as_video' | 'too_large_for_whatsapp' | 'other';
4
+ /** The banner for a refused forward: the server's code, or `other`. */
5
+ export declare function forwardProblemOf(err: unknown): ForwardProblem;
6
+ export declare function ForwardDialog({ message, sourceInboxId, onClose, }: Readonly<{
7
+ message: Message;
8
+ /** The inbox of the chat the message is in (for the "own number" note). */
9
+ sourceInboxId: number;
10
+ onClose(): void;
11
+ }>): import("react").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import type React from 'react';
2
+ import { type CSSProperties } from 'react';
2
3
  import type { Message } from '@ezychat/shared';
3
4
  export interface MediaViewProps {
4
5
  message: Message;
@@ -7,5 +8,7 @@ export interface MediaViewProps {
7
8
  }
8
9
  /** The file name a media file gets when dragged or saved out of the app. */
9
10
  export declare function mediaFileName(m: Pick<Message, 'id' | 'type' | 'mediaName' | 'mediaMime'>): string;
11
+ /** The space an image takes in the chat, so nothing moves when its file arrives; undefined when its size is not known. */
12
+ export declare function imageBox(width: number | null | undefined, height: number | null | undefined): CSSProperties | undefined;
10
13
  /** Renders the media part of a message (image, sticker, video, audio, document). */
11
14
  export declare function MediaView({ message: m, onLoad }: MediaViewProps): React.JSX.Element;
@@ -4,13 +4,18 @@ import type { Directory } from './useDirectory';
4
4
  /**
5
5
  * The ⋮ button next to a message (hover or focus on desktop, like Reply; touch screens reach the
6
6
  * same actions from the press-and-hold bar). Shown only when the user may do something with the
7
- * message; Edit stays visible, disabled, once its 15 minutes are over.
7
+ * message: Forward first (every message that can be forwarded), then Edit and Delete. Edit stays
8
+ * visible, disabled, once its 15 minutes are over; Forward stays visible, disabled, for a file
9
+ * WhatsApp Safety locked.
8
10
  */
9
- export declare function MessageMoreMenu({ rights, disabledReason, onEdit, onDelete, }: {
11
+ export declare function MessageMoreMenu({ rights, disabledReason, onEdit, onDelete, onForward, forwardLocked, }: {
10
12
  rights: MessageRights;
11
13
  disabledReason: string | null;
12
14
  onEdit(): void;
13
15
  onDelete(): void;
16
+ /** Set when the message can be forwarded. */
17
+ onForward?(): void;
18
+ forwardLocked?: boolean;
14
19
  }): import("react").JSX.Element | null;
15
20
  /** Edit a sent text or caption. WhatsApp shows the customer "Edited". */
16
21
  export declare function EditMessageDialog({ message, onClose, }: {
@@ -40,3 +40,7 @@ export declare function StatusTicks({ status }: {
40
40
  status: Message['status'];
41
41
  }): React.JSX.Element;
42
42
  export declare function MessageBubble({ message: m, showSender, outboundLabel, quoted, onRetry, retrying, onMediaLoad, directory, onReply, onReact, reactDisabledReason, contactName, changes, onOpenQuote, highlighted, }: MessageBubbleProps): React.JSX.Element;
43
+ /** From this size a file shows that it is still uploading, and Forward warns before sending it. */
44
+ export declare const LARGE_FILE_BYTES: number;
45
+ /** Why a message was not sent, in plain words. */
46
+ export declare function failedReason(error: string | null, t: TFunction<['inbox', 'common']>): string;
@@ -0,0 +1,2 @@
1
+ /** The header button: only for people who may start a new chat. */
2
+ export declare function NewChatButton(): import("react").JSX.Element | null;
@@ -17,6 +17,8 @@ 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 Forward, for a message that can be forwarded now. */
21
+ onForward?(): void;
20
22
  /** …and Copy text, for a message with text. */
21
23
  onCopy?(): void;
22
24
  /** …and Edit / Delete, when the signed-in user may change the message now. */
@@ -28,4 +30,4 @@ export interface ReactionPickerProps {
28
30
  * reaction per number, so the whole team shares the linked number's reaction: a new emoji replaces
29
31
  * it, the same emoji again removes it.
30
32
  */
31
- export declare function ReactionPicker({ out, current, currentBy, open, onOpenChange, onReact, disabledReason, onReply, onCopy, onEdit, onDelete, }: ReactionPickerProps): import("react").JSX.Element;
33
+ export declare function ReactionPicker({ out, current, currentBy, open, onOpenChange, onReact, disabledReason, onReply, onForward, onCopy, onEdit, onDelete, }: ReactionPickerProps): import("react").JSX.Element;