@ezychat/web 0.1.67 → 0.1.69

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.
@@ -2,7 +2,8 @@ import type React from 'react';
2
2
  /**
3
3
  * Admin → Reports (design: docs/features/reports/design.md): how busy the WhatsApp numbers are
4
4
  * (busy days, busy times, new customers) and how fast the team and the AI answer, for 7, 30 or 90
5
- * days. Counted from this computer's database only; nothing is sent anywhere.
5
+ * days. Counted from this computer's database only; nothing is sent anywhere. With two or more
6
+ * WhatsApp numbers the admin sees them all together or picks one.
6
7
  */
7
8
  export declare function ReportsPage(): React.JSX.Element;
8
9
  /** The two hours in a row with the most messages from customers; null when there are none. */
@@ -3,8 +3,11 @@ import type { ReportPeriod } from '@ezychat/shared';
3
3
  /**
4
4
  * Admin → Reports → WhatsApp Safety (docs/features/whatsapp-safety/design.md): what reached the
5
5
  * team (dangerous files, scam messages), what the team did with it (risky downloads, blocks) and
6
- * whether the checks are set right (false alarms), for the same 7 / 30 / 90 days as the page.
6
+ * whether the checks are set right (false alarms), for the same 7 / 30 / 90 days and inbox as
7
+ * the page.
7
8
  */
8
- export declare function SafetyReportSection({ days }: {
9
+ export declare function SafetyReportSection({ days, inbox, }: {
9
10
  days: ReportPeriod;
11
+ /** The page's inbox choice; null = every inbox together. */
12
+ inbox?: number | null;
10
13
  }): React.JSX.Element | null;
@@ -26,6 +26,9 @@ export declare function useCreateInbox(): import("@tanstack/react-query").UseMut
26
26
  templates: boolean;
27
27
  needsPublicUrl: boolean;
28
28
  mentions?: boolean | undefined;
29
+ editMessage?: boolean | undefined;
30
+ deleteForEveryone?: boolean | undefined;
31
+ deleteForMe?: boolean | undefined;
29
32
  };
30
33
  memberIds?: number[] | undefined;
31
34
  }, Error, {
@@ -59,6 +62,9 @@ export declare function useUpdateInbox(): import("@tanstack/react-query").UseMut
59
62
  templates: boolean;
60
63
  needsPublicUrl: boolean;
61
64
  mentions?: boolean | undefined;
65
+ editMessage?: boolean | undefined;
66
+ deleteForEveryone?: boolean | undefined;
67
+ deleteForMe?: boolean | undefined;
62
68
  };
63
69
  memberIds?: number[] | undefined;
64
70
  }, Error, {
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Edit and delete sent messages (design docs/features/message-edit-delete/design.md). The answer
3
+ * carries the changed message; `message:updated` brings the same message to every teammate.
4
+ */
5
+ export declare const messageEditsKey: (id: string) => readonly ["message-edits", string];
6
+ /** Earlier versions of a message (and, for admins, the original of a deleted one). */
7
+ export declare function useMessageEdits(id: string, enabled: boolean): import("@tanstack/react-query").UseQueryResult<{
8
+ messageId: string;
9
+ edits: {
10
+ previousBody: string | null;
11
+ at: number;
12
+ by: "phone" | "team" | "sender";
13
+ userId: number | null;
14
+ }[];
15
+ original: string | null;
16
+ }, Error>;
17
+ export declare function useEditMessage(): import("@tanstack/react-query").UseMutationResult<{
18
+ id: string;
19
+ chatJid: string;
20
+ senderJid: string | null;
21
+ senderName: string | null;
22
+ fromMe: boolean;
23
+ sentByUserId: number | null;
24
+ type: "text" | "image" | "video" | "audio" | "document" | "sticker" | "system";
25
+ body: string | null;
26
+ mediaUrl: string | null;
27
+ mediaMime: string | null;
28
+ mediaName: string | null;
29
+ mediaStatus: "none" | "pending" | "failed" | "ok";
30
+ quotedId: string | null;
31
+ status: "pending" | "failed" | "sent" | "delivered" | "read";
32
+ error: string | null;
33
+ timestamp: number;
34
+ clientId: string | null;
35
+ reactions: {
36
+ emoji: string;
37
+ senderJid: string | null;
38
+ fromMe: boolean;
39
+ at: number;
40
+ sentByUserId: number | null;
41
+ senderName?: string | null | undefined;
42
+ }[];
43
+ voiceNote?: boolean | undefined;
44
+ template?: {
45
+ name: string;
46
+ language: string;
47
+ } | null | undefined;
48
+ viaAssistant?: boolean | undefined;
49
+ transcript?: string | null | undefined;
50
+ transcriptLang?: string | null | undefined;
51
+ transcriptStatus?: "pending" | "failed" | "ok" | "too_long" | "unsupported" | "skipped" | null | undefined;
52
+ senderProfile?: {
53
+ chatJid: string;
54
+ name: string;
55
+ } | null | undefined;
56
+ safety?: {
57
+ itemId: number;
58
+ level: "none" | "warning" | "high";
59
+ rules: ("exeInZip" | "executable" | "doubleExtension" | "scamNumber" | "cantInspect" | "macroFile" | "unlockCodeInMessage" | "openOnComputer" | "lookalikeLink" | "financeUrgency" | "firstFile")[];
60
+ aiReason: string | null;
61
+ locked: boolean;
62
+ deletedBy: string | null;
63
+ status: "open" | "safe" | "reported" | "blocked" | "cleared";
64
+ } | null | undefined;
65
+ editedAt?: number | null | undefined;
66
+ editCount?: number | undefined;
67
+ deletedAt?: number | null | undefined;
68
+ deletedBy?: "phone" | "team" | "sender" | "group_admin" | null | undefined;
69
+ deletedByUserId?: number | null | undefined;
70
+ hidden?: boolean | undefined;
71
+ }, Error, {
72
+ id: string;
73
+ text: string;
74
+ }, unknown>;
75
+ export declare function useDeleteMessage(): import("@tanstack/react-query").UseMutationResult<{
76
+ id: string;
77
+ chatJid: string;
78
+ senderJid: string | null;
79
+ senderName: string | null;
80
+ fromMe: boolean;
81
+ sentByUserId: number | null;
82
+ type: "text" | "image" | "video" | "audio" | "document" | "sticker" | "system";
83
+ body: string | null;
84
+ mediaUrl: string | null;
85
+ mediaMime: string | null;
86
+ mediaName: string | null;
87
+ mediaStatus: "none" | "pending" | "failed" | "ok";
88
+ quotedId: string | null;
89
+ status: "pending" | "failed" | "sent" | "delivered" | "read";
90
+ error: string | null;
91
+ timestamp: number;
92
+ clientId: string | null;
93
+ reactions: {
94
+ emoji: string;
95
+ senderJid: string | null;
96
+ fromMe: boolean;
97
+ at: number;
98
+ sentByUserId: number | null;
99
+ senderName?: string | null | undefined;
100
+ }[];
101
+ voiceNote?: boolean | undefined;
102
+ template?: {
103
+ name: string;
104
+ language: string;
105
+ } | null | undefined;
106
+ viaAssistant?: boolean | undefined;
107
+ transcript?: string | null | undefined;
108
+ transcriptLang?: string | null | undefined;
109
+ transcriptStatus?: "pending" | "failed" | "ok" | "too_long" | "unsupported" | "skipped" | null | undefined;
110
+ senderProfile?: {
111
+ chatJid: string;
112
+ name: string;
113
+ } | null | undefined;
114
+ safety?: {
115
+ itemId: number;
116
+ level: "none" | "warning" | "high";
117
+ rules: ("exeInZip" | "executable" | "doubleExtension" | "scamNumber" | "cantInspect" | "macroFile" | "unlockCodeInMessage" | "openOnComputer" | "lookalikeLink" | "financeUrgency" | "firstFile")[];
118
+ aiReason: string | null;
119
+ locked: boolean;
120
+ deletedBy: string | null;
121
+ status: "open" | "safe" | "reported" | "blocked" | "cleared";
122
+ } | null | undefined;
123
+ editedAt?: number | null | undefined;
124
+ editCount?: number | undefined;
125
+ deletedAt?: number | null | undefined;
126
+ deletedBy?: "phone" | "team" | "sender" | "group_admin" | null | undefined;
127
+ deletedByUserId?: number | null | undefined;
128
+ hidden?: boolean | undefined;
129
+ }, Error, {
130
+ id: string;
131
+ scope: "everyone" | "me";
132
+ }, unknown>;
@@ -15,7 +15,7 @@ export declare const qk: {
15
15
  chats: (f: ChatFilters) => readonly ["chats", ChatFilters];
16
16
  chatsAll: readonly ["chats"];
17
17
  openChatCount: readonly ["open-chat-count"];
18
- report: (days: number) => readonly ["report", number];
18
+ report: (days: number, inbox?: number | null) => readonly ["report", number, number | null];
19
19
  chat: (jid: string) => readonly ["chat", string];
20
20
  messages: (jid: string) => readonly ["messages", string];
21
21
  notes: (jid: string) => readonly ["notes", string];
@@ -45,7 +45,7 @@ export type MessagesData = InfiniteData<MessageListResponse, string | null>;
45
45
  export declare function patchSenderProfilesInCache(qc: QueryClient, chat: Chat): void;
46
46
  /** Same URL the server builds for a message's media (`mediaUrlFor` in messages/repo.ts). */
47
47
  export declare function mediaUrlFor(id: string): string;
48
- /** Insert or replace a message in the messages cache of its chat. */
48
+ /** Insert or replace a message in the messages cache of its chat ("Delete for me": remove it). */
49
49
  export declare function upsertMessageInCache(qc: QueryClient, m: Message): void;
50
50
  /** Patch a message (located by id, or by clientId / `local-<clientId>`) in a chat's messages cache. */
51
51
  export declare function patchMessageInCache(qc: QueryClient, chatJid: string, match: {
@@ -176,8 +176,10 @@ export declare function useChat(jid: string | null | undefined): import("@tansta
176
176
  }[];
177
177
  }, Error>;
178
178
  /** Admin → Reports for the last 7, 30 or 90 days (admins only). */
179
- export declare function useReport(days: ReportPeriod): import("@tanstack/react-query").UseQueryResult<{
179
+ /** `inbox` null = every inbox together. */
180
+ export declare function useReport(days: ReportPeriod, inbox?: number | null): import("@tanstack/react-query").UseQueryResult<{
180
181
  days: 7 | 30 | 90;
182
+ inboxId: number | null;
181
183
  timeZone: string;
182
184
  firstDate: string | null;
183
185
  linkedDate: string | null;
@@ -289,6 +291,12 @@ export declare function useMessages(jid: string | null | undefined): import("@ta
289
291
  deletedBy: string | null;
290
292
  status: "open" | "safe" | "reported" | "blocked" | "cleared";
291
293
  } | null | undefined;
294
+ editedAt?: number | null | undefined;
295
+ editCount?: number | undefined;
296
+ deletedAt?: number | null | undefined;
297
+ deletedBy?: "phone" | "team" | "sender" | "group_admin" | null | undefined;
298
+ deletedByUserId?: number | null | undefined;
299
+ hidden?: boolean | undefined;
292
300
  }[];
293
301
  nextBefore: string | null;
294
302
  }, unknown>, Error>;
@@ -353,6 +361,12 @@ export declare function useSendText(jid: string): import("@tanstack/react-query"
353
361
  deletedBy: string | null;
354
362
  status: "open" | "safe" | "reported" | "blocked" | "cleared";
355
363
  } | null | undefined;
364
+ editedAt?: number | null | undefined;
365
+ editCount?: number | undefined;
366
+ deletedAt?: number | null | undefined;
367
+ deletedBy?: "phone" | "team" | "sender" | "group_admin" | null | undefined;
368
+ deletedByUserId?: number | null | undefined;
369
+ hidden?: boolean | undefined;
356
370
  }, Error, SendTextInput, {
357
371
  clientId: string;
358
372
  }>;
@@ -413,6 +427,12 @@ export declare function useSendMedia(jid: string): import("@tanstack/react-query
413
427
  deletedBy: string | null;
414
428
  status: "open" | "safe" | "reported" | "blocked" | "cleared";
415
429
  } | null | undefined;
430
+ editedAt?: number | null | undefined;
431
+ editCount?: number | undefined;
432
+ deletedAt?: number | null | undefined;
433
+ deletedBy?: "phone" | "team" | "sender" | "group_admin" | null | undefined;
434
+ deletedByUserId?: number | null | undefined;
435
+ hidden?: boolean | undefined;
416
436
  }, Error, SendMediaInput, void>;
417
437
  export declare function useRetryMessage(): import("@tanstack/react-query").UseMutationResult<{
418
438
  id: string;
@@ -462,6 +482,12 @@ export declare function useRetryMessage(): import("@tanstack/react-query").UseMu
462
482
  deletedBy: string | null;
463
483
  status: "open" | "safe" | "reported" | "blocked" | "cleared";
464
484
  } | null | undefined;
485
+ editedAt?: number | null | undefined;
486
+ editCount?: number | undefined;
487
+ deletedAt?: number | null | undefined;
488
+ deletedBy?: "phone" | "team" | "sender" | "group_admin" | null | undefined;
489
+ deletedByUserId?: number | null | undefined;
490
+ hidden?: boolean | undefined;
465
491
  }, Error, string, unknown>;
466
492
  /**
467
493
  * The linked number reacts to a message (`emoji` '' removes the reaction). The answer carries the
@@ -749,6 +775,9 @@ export declare function useInboxes(opts?: {
749
775
  templates: boolean;
750
776
  needsPublicUrl: boolean;
751
777
  mentions?: boolean | undefined;
778
+ editMessage?: boolean | undefined;
779
+ deleteForEveryone?: boolean | undefined;
780
+ deleteForMe?: boolean | undefined;
752
781
  };
753
782
  memberIds?: number[] | undefined;
754
783
  }[];
@@ -6,7 +6,7 @@ import { type ReportPeriod, type SafetyAction, type SafetyActionBody } from '@ez
6
6
  export declare const safetyKeys: {
7
7
  state: readonly ["safety"];
8
8
  chat: (jid: string) => readonly ["safety", "chat", string];
9
- report: (days: ReportPeriod) => readonly ["safety", "report", 7 | 30 | 90];
9
+ report: (days: ReportPeriod, inbox?: number | null) => readonly ["safety", "report", 7 | 30 | 90, number | null];
10
10
  };
11
11
  export declare function useSafety(): import("@tanstack/react-query").UseQueryResult<{
12
12
  settings: {
@@ -79,8 +79,10 @@ export declare function useSafetyChat(jid: string): import("@tanstack/react-quer
79
79
  maybeHacked: boolean;
80
80
  itemId: number | null;
81
81
  }, Error>;
82
- export declare function useSafetyReport(days: ReportPeriod): import("@tanstack/react-query").UseQueryResult<{
82
+ /** `inbox` null = every inbox together. */
83
+ export declare function useSafetyReport(days: ReportPeriod, inbox?: number | null): import("@tanstack/react-query").UseQueryResult<{
83
84
  days: 7 | 30 | 90;
85
+ inboxId: number | null;
84
86
  enabled: boolean;
85
87
  totals: {
86
88
  dangerousFiles: number;
@@ -76,6 +76,12 @@ export declare function useSendTemplate(jid: string): import("@tanstack/react-qu
76
76
  deletedBy: string | null;
77
77
  status: "open" | "safe" | "reported" | "blocked" | "cleared";
78
78
  } | null | undefined;
79
+ editedAt?: number | null | undefined;
80
+ editCount?: number | undefined;
81
+ deletedAt?: number | null | undefined;
82
+ deletedBy?: "phone" | "team" | "sender" | "group_admin" | null | undefined;
83
+ deletedByUserId?: number | null | undefined;
84
+ hidden?: boolean | undefined;
79
85
  }, Error, {
80
86
  name: string;
81
87
  language: string;
@@ -810,6 +810,37 @@ export declare const enResources: {
810
810
  failed: string;
811
811
  imageFailed: string;
812
812
  };
813
+ change: {
814
+ more: string;
815
+ edit: string;
816
+ delete: string;
817
+ editWindow: string;
818
+ deleteWindow: string;
819
+ editTitle: string;
820
+ editCaption: string;
821
+ editHint: string;
822
+ editKeys: string;
823
+ save: string;
824
+ deleteTitle: string;
825
+ forEveryone: string;
826
+ forMe: string;
827
+ forEveryoneHint: string;
828
+ forMeHint: string;
829
+ notConnected: string;
830
+ edited: string;
831
+ historyTitle: string;
832
+ historyFailed: string;
833
+ editedBy: string;
834
+ byTeam: string;
835
+ byPhone: string;
836
+ deletedBy: string;
837
+ deletedFromPhone: string;
838
+ deletedByGroupAdmin: string;
839
+ deletedQuote: string;
840
+ showOriginal: string;
841
+ hideOriginal: string;
842
+ noText: string;
843
+ };
813
844
  };
814
845
  media: {
815
846
  types: {
@@ -3486,6 +3517,7 @@ export declare const enResources: {
3486
3517
  newInbox: string;
3487
3518
  sameInbox: string;
3488
3519
  noNumber: string;
3520
+ service: string;
3489
3521
  };
3490
3522
  tile: {
3491
3523
  chats: string;
@@ -3510,6 +3542,21 @@ export declare const enResources: {
3510
3542
  title: string;
3511
3543
  body: string;
3512
3544
  };
3545
+ protected: {
3546
+ title: string;
3547
+ ask: string;
3548
+ moves: string;
3549
+ allow: string;
3550
+ allowAgain: string;
3551
+ waitingTitle: string;
3552
+ waitingBody: string;
3553
+ declined: string;
3554
+ failed: string;
3555
+ byHand: string;
3556
+ step1: string;
3557
+ step2: string;
3558
+ step3: string;
3559
+ };
3513
3560
  check: {
3514
3561
  title: string;
3515
3562
  liteRunning: string;
@@ -3626,6 +3673,7 @@ export declare const enResources: {
3626
3673
  bring: string;
3627
3674
  bringChats: string;
3628
3675
  bringTeam: string;
3676
+ bringAll: string;
3629
3677
  new: string;
3630
3678
  newAccount: string;
3631
3679
  newQr: string;
@@ -0,0 +1,39 @@
1
+ import type { Message } from '@ezychat/shared';
2
+ import { type MessageRights } from './message-changes';
3
+ import type { Directory } from './useDirectory';
4
+ /**
5
+ * The ⋮ button next to a message (hover or focus on desktop, like Reply; touch screens reach the
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.
8
+ */
9
+ export declare function MessageMoreMenu({ rights, disabledReason, onEdit, onDelete, }: {
10
+ rights: MessageRights;
11
+ disabledReason: string | null;
12
+ onEdit(): void;
13
+ onDelete(): void;
14
+ }): import("react").JSX.Element | null;
15
+ /** Edit a sent text or caption. WhatsApp shows the customer "Edited". */
16
+ export declare function EditMessageDialog({ message, onClose, }: {
17
+ /** The message being edited; null closes the dialog. */
18
+ message: Message | null;
19
+ onClose(): void;
20
+ }): import("react").JSX.Element;
21
+ /** One confirmation with the delete choices this user has for this message. */
22
+ export declare function DeleteMessageDialog({ message, rights, onClose, }: {
23
+ message: Message | null;
24
+ rights: MessageRights;
25
+ onClose(): void;
26
+ }): import("react").JSX.Element;
27
+ /** "Edited" before the time; opens the earlier versions, oldest first. */
28
+ export declare function EditedLabel({ message, directory, contactName, }: {
29
+ message: Message;
30
+ directory?: Directory;
31
+ contactName?: string;
32
+ }): import("react").JSX.Element;
33
+ /** The body of a message deleted for everyone; admins may reveal the original. */
34
+ export declare function DeletedBody({ message: m, isAdmin, directory, contactName, }: {
35
+ message: Message;
36
+ isAdmin: boolean;
37
+ directory?: Directory;
38
+ contactName?: string;
39
+ }): import("react").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import type React from 'react';
2
2
  import type { TFunction } from 'i18next';
3
3
  import type { Message } from '@ezychat/shared';
4
+ import { type MessageChangeProps } from './message-changes';
4
5
  import type { Directory } from './useDirectory';
5
6
  export interface MessageBubbleProps {
6
7
  message: Message;
@@ -22,6 +23,8 @@ export interface MessageBubbleProps {
22
23
  directory?: Directory;
23
24
  /** Direct chats: the customer's name as the header shows it (used in quotes). */
24
25
  contactName?: string;
26
+ /** Edit and delete (⋮ menu; under Reply in the press-and-hold bar on touch). */
27
+ changes?: MessageChangeProps;
25
28
  }
26
29
  /**
27
30
  * Who wrote a quoted message. In a direct chat the customer is named like the chat header
@@ -32,4 +35,4 @@ export declare function quotedPreview(q: Message, t: TFunction<'inbox'>): string
32
35
  export declare function StatusTicks({ status }: {
33
36
  status: Message['status'];
34
37
  }): React.JSX.Element;
35
- export declare function MessageBubble({ message: m, showSender, outboundLabel, quoted, onRetry, retrying, onMediaLoad, directory, onReply, onReact, reactDisabledReason, contactName, }: MessageBubbleProps): React.JSX.Element;
38
+ export declare function MessageBubble({ message: m, showSender, outboundLabel, quoted, onRetry, retrying, onMediaLoad, directory, onReply, onReact, reactDisabledReason, contactName, changes, }: MessageBubbleProps): React.JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import type React from 'react';
2
2
  import type { Message } from '@ezychat/shared';
3
+ import type { MessageChangeProps } from './message-changes';
3
4
  import type { TimelineItem } from './timeline';
4
5
  import type { Directory } from './useDirectory';
5
6
  export interface MessageListProps {
@@ -20,6 +21,8 @@ export interface MessageListProps {
20
21
  reactDisabledReason?: string | null;
21
22
  /** Direct chats: the customer's display name, for quotes. */
22
23
  contactName?: string;
24
+ /** Edit and delete sent messages (rights per message, handlers). */
25
+ changes?: MessageChangeProps;
23
26
  footer?: React.ReactNode;
24
27
  }
25
- export declare function MessageList({ items, messagesById, isGroup, directory, loading, hasOlder, loadingOlder, onLoadOlder, onRetry, retryingId, onReply, onReact, reactDisabledReason, contactName, footer, }: MessageListProps): React.JSX.Element;
28
+ export declare function MessageList({ items, messagesById, isGroup, directory, loading, hasOlder, loadingOlder, onLoadOlder, onRetry, retryingId, onReply, onReact, reactDisabledReason, contactName, changes, footer, }: MessageListProps): React.JSX.Element;
@@ -19,10 +19,13 @@ export interface ReactionPickerProps {
19
19
  onReply?(): void;
20
20
  /** …and Copy text, for a message with text. */
21
21
  onCopy?(): void;
22
+ /** …and Edit / Delete, when the signed-in user may change the message now. */
23
+ onEdit?(): void;
24
+ onDelete?(): void;
22
25
  }
23
26
  /**
24
27
  * The 🙂 button next to a message and its emoji bar. WhatsApp keeps one
25
28
  * reaction per number, so the whole team shares the linked number's reaction: a new emoji replaces
26
29
  * it, the same emoji again removes it.
27
30
  */
28
- export declare function ReactionPicker({ out, current, currentBy, open, onOpenChange, onReact, disabledReason, onReply, onCopy, }: ReactionPickerProps): import("react").JSX.Element;
31
+ export declare function ReactionPicker({ out, current, currentBy, open, onOpenChange, onReact, disabledReason, onReply, onCopy, onEdit, onDelete, }: ReactionPickerProps): import("react").JSX.Element;
@@ -0,0 +1,38 @@
1
+ import type { InboxCapabilities, Message } from '@ezychat/shared';
2
+ /** WhatsApp lets the sender edit a message for 15 minutes (the server checks it too). */
3
+ export declare const EDIT_WINDOW_MS: number;
4
+ /** WhatsApp lets the sender delete a message for everyone for about 2 days. */
5
+ export declare const DELETE_WINDOW_MS: number;
6
+ /** What the signed-in user may do with one message now. */
7
+ export interface MessageRights {
8
+ canEdit: boolean;
9
+ /** Edit is shown but disabled: the 15 minutes are over. */
10
+ editWindowClosed: boolean;
11
+ canDeleteForEveryone: boolean;
12
+ /** Delete for everyone is not offered any more: the 2 days are over. */
13
+ deleteWindowClosed: boolean;
14
+ canDeleteForMe: boolean;
15
+ }
16
+ export declare const NO_RIGHTS: MessageRights;
17
+ /**
18
+ * The same rules as the server: only on a connection that can (linked phone), only messages the
19
+ * team sent, by the teammate who sent it or an admin (messages from the phone or the AI agent:
20
+ * admins only); text and captions only, within 15 minutes; delete for everyone within 2 days;
21
+ * delete for me (hidden for the team) for admins, any message.
22
+ */
23
+ export declare function messageRights(m: Message, user: {
24
+ id: number;
25
+ role: string;
26
+ } | null, caps: Pick<InboxCapabilities, 'editMessage' | 'deleteForEveryone' | 'deleteForMe'>, now: number): MessageRights;
27
+ /** Anything to offer in the message's menu. */
28
+ export declare function hasActions(r: MessageRights): boolean;
29
+ /** Handlers and rights the conversation gives each bubble. */
30
+ export interface MessageChangeProps {
31
+ rightsOf(m: Message): MessageRights;
32
+ /** WhatsApp is not connected: every change waits. */
33
+ disabledReason: string | null;
34
+ onEdit(m: Message): void;
35
+ onDelete(m: Message): void;
36
+ /** Admins may read the original of a deleted message. */
37
+ isAdmin: boolean;
38
+ }
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
- import type { DesktopLiteImportBridge, LiteImportState, LiteTeamChoice, LiteUser, User } from '@ezychat/shared';
2
+ import type { DesktopLiteImportBridge, LiteImportMode, LiteImportState, LiteTeamChoice, LiteUser, User } from '@ezychat/shared';
3
3
  export type Act = (call: () => Promise<LiteImportState>, failMessage: string) => Promise<boolean>;
4
4
  interface StepProps {
5
5
  state: LiteImportState;
@@ -7,6 +7,15 @@ interface StepProps {
7
7
  act: Act;
8
8
  busy: boolean;
9
9
  }
10
+ /**
11
+ * Lite runs as an OS service and its data folder is locked to it (phase 'protected', confirmed mock
12
+ * round 4): "Allow" frees it with one admin prompt (Lite's own "Remove service"), then the normal flow
13
+ * starts at Found. Nothing of Lite's data is known here, so the figure shows no number.
14
+ */
15
+ export declare function ProtectedStep({ state, bridge, act, busy, mode, cancel, }: StepProps & {
16
+ mode: LiteImportMode;
17
+ cancel: ReactNode;
18
+ }): import("react").JSX.Element;
10
19
  /** What was found: the figure, summary tiles, and that Lite's data stays. */
11
20
  export declare function FoundStep({ state, onContinue, cancel, }: {
12
21
  state: LiteImportState;
@@ -24,10 +24,14 @@ export declare function IconLine({ icon: I, tone, children, }: {
24
24
  tone?: string;
25
25
  children: ReactNode;
26
26
  }): import("react").JSX.Element;
27
- /** The figure: EzyChat Lite → this product, with what happens to the number. */
28
- export declare function MoveFigure({ number, mode }: {
27
+ /**
28
+ * The figure: EzyChat Lite → this product, with what happens to the number. `service`: Lite's data is
29
+ * still locked to its OS service, so the number is not known yet.
30
+ */
31
+ export declare function MoveFigure({ number, mode, service, }: {
29
32
  number: string | null;
30
33
  mode: LiteImportMode;
34
+ service?: boolean;
31
35
  }): import("react").JSX.Element;
32
36
  /** The import steps the desktop reports, each with its state. */
33
37
  export declare function StepList({ steps }: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ezychat/web",
3
- "version": "0.1.67",
3
+ "version": "0.1.69",
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.67",
43
+ "@ezychat/shared": "0.1.69",
44
44
  "@fontsource-variable/inter": "^5.3.0",
45
45
  "@tanstack/react-query": "^5.105.0",
46
46
  "@types/react": "^19.3.0",