@ezychat/web 0.1.50 → 0.1.52

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 (25) hide show
  1. package/dist-lib/chunks/{admin-Bn_TTlyR.js → admin-D4sSm-0v.js} +1 -2
  2. package/dist-lib/chunks/{admin-Pg8YjwbY.js → admin-Dr2p0vo4.js} +1 -2
  3. package/dist-lib/chunks/{app-3jWCMPbu.js → app-BXBt4xNx.js} +1 -2
  4. package/dist-lib/chunks/{app-Diwr0AD0.js → app-Zoharwle.js} +1 -2
  5. package/dist-lib/chunks/{auth-DJBQd10l.js → auth-C43vQHqn.js} +1 -2
  6. package/dist-lib/chunks/{auth-Cif_yktU.js → auth-DVxOXQ8z.js} +1 -2
  7. package/dist-lib/chunks/{common-BwLWsyiW.js → common-C66WoZaM.js} +9 -4
  8. package/dist-lib/chunks/{common-CDytP7HK.js → common-CEBPnKob.js} +9 -4
  9. package/dist-lib/chunks/{errors-BIyy5VTn.js → errors-DHAXUg11.js} +1 -2
  10. package/dist-lib/chunks/{errors-CEweqDjm.js → errors-HKWPs0ro.js} +1 -2
  11. package/dist-lib/chunks/{inbox-DtLIGOCo.js → inbox-B1klfpnJ.js} +21 -3
  12. package/dist-lib/chunks/{inbox-u9BCZ1IH.js → inbox-CXgOidy1.js} +21 -3
  13. package/dist-lib/chunks/{registerSW-Gn8zt2XY.js → registerSW-BFGyWjNK.js} +1 -2
  14. package/dist-lib/ezychat-web.css +1 -1
  15. package/dist-lib/index.js +6404 -6326
  16. package/dist-lib/types/api/queries.d.ts +51 -0
  17. package/dist-lib/types/components/app/UpgradeEnterprise.d.ts +14 -0
  18. package/dist-lib/types/i18n/resources.d.ts +25 -0
  19. package/dist-lib/types/inbox/MessageBubble.d.ts +5 -1
  20. package/dist-lib/types/inbox/MessageList.d.ts +5 -1
  21. package/dist-lib/types/inbox/ReactionBadges.d.ts +31 -0
  22. package/dist-lib/types/inbox/ReactionPicker.d.ts +26 -0
  23. package/dist-lib/types/inbox/useSwipeReply.d.ts +3 -1
  24. package/dist-lib/types/lib/links.d.ts +4 -0
  25. package/package.json +7 -7
@@ -198,6 +198,14 @@ export declare function useMessages(jid: string | null | undefined): import("@ta
198
198
  error: string | null;
199
199
  timestamp: number;
200
200
  clientId: string | null;
201
+ reactions: {
202
+ emoji: string;
203
+ senderJid: string | null;
204
+ fromMe: boolean;
205
+ at: number;
206
+ sentByUserId: number | null;
207
+ senderName?: string | null | undefined;
208
+ }[];
201
209
  voiceNote?: boolean | undefined;
202
210
  viaAssistant?: boolean | undefined;
203
211
  transcript?: string | null | undefined;
@@ -237,6 +245,14 @@ export declare function useSendText(jid: string): import("@tanstack/react-query"
237
245
  error: string | null;
238
246
  timestamp: number;
239
247
  clientId: string | null;
248
+ reactions: {
249
+ emoji: string;
250
+ senderJid: string | null;
251
+ fromMe: boolean;
252
+ at: number;
253
+ sentByUserId: number | null;
254
+ senderName?: string | null | undefined;
255
+ }[];
240
256
  voiceNote?: boolean | undefined;
241
257
  viaAssistant?: boolean | undefined;
242
258
  transcript?: string | null | undefined;
@@ -276,6 +292,14 @@ export declare function useSendMedia(jid: string): import("@tanstack/react-query
276
292
  error: string | null;
277
293
  timestamp: number;
278
294
  clientId: string | null;
295
+ reactions: {
296
+ emoji: string;
297
+ senderJid: string | null;
298
+ fromMe: boolean;
299
+ at: number;
300
+ sentByUserId: number | null;
301
+ senderName?: string | null | undefined;
302
+ }[];
279
303
  voiceNote?: boolean | undefined;
280
304
  viaAssistant?: boolean | undefined;
281
305
  transcript?: string | null | undefined;
@@ -304,6 +328,14 @@ export declare function useRetryMessage(): import("@tanstack/react-query").UseMu
304
328
  error: string | null;
305
329
  timestamp: number;
306
330
  clientId: string | null;
331
+ reactions: {
332
+ emoji: string;
333
+ senderJid: string | null;
334
+ fromMe: boolean;
335
+ at: number;
336
+ sentByUserId: number | null;
337
+ senderName?: string | null | undefined;
338
+ }[];
307
339
  voiceNote?: boolean | undefined;
308
340
  viaAssistant?: boolean | undefined;
309
341
  transcript?: string | null | undefined;
@@ -314,6 +346,25 @@ export declare function useRetryMessage(): import("@tanstack/react-query").UseMu
314
346
  name: string;
315
347
  } | null | undefined;
316
348
  }, Error, string, unknown>;
349
+ /**
350
+ * The linked number reacts to a message (`emoji` '' removes the reaction). The answer carries the
351
+ * message's reactions; the `message:reactions` event brings the same list to every teammate.
352
+ */
353
+ export declare function useSendReaction(): import("@tanstack/react-query").UseMutationResult<{
354
+ messageId: string;
355
+ reactions: {
356
+ emoji: string;
357
+ senderJid: string | null;
358
+ fromMe: boolean;
359
+ at: number;
360
+ sentByUserId: number | null;
361
+ senderName?: string | null | undefined;
362
+ }[];
363
+ }, Error, {
364
+ chatJid: string;
365
+ messageId: string;
366
+ emoji: string;
367
+ }, unknown>;
317
368
  export declare function usePatchChat(jid: string): import("@tanstack/react-query").UseMutationResult<{
318
369
  jid: string;
319
370
  inboxId: number;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The "Upgrade to Enterprise" address, or null when the product hides it: Lite links
3
+ * ezychat.ai/#enterprise, another product passes `createInboxApp({ links: { upgrade: null } })`.
4
+ */
5
+ export declare function useUpgradeUrl(): string | null;
6
+ /** An outline button that opens the Enterprise page in the browser; nothing when hidden. */
7
+ export declare function UpgradeButton({ className }: {
8
+ className?: string;
9
+ }): import("react").JSX.Element | null;
10
+ /** A quiet row under a Lite limit: why Enterprise helps, and the upgrade button. */
11
+ export declare function UpgradeNote({ reason, className, }: {
12
+ reason: 'agents' | 'numbers';
13
+ className?: string;
14
+ }): import("react").JSX.Element | null;
@@ -79,6 +79,12 @@ export declare const enResources: {
79
79
  checkAgain: string;
80
80
  checking: string;
81
81
  };
82
+ upgrade: {
83
+ cta: string;
84
+ agents: string;
85
+ numbers: string;
86
+ about: string;
87
+ };
82
88
  };
83
89
  app: {
84
90
  about: {
@@ -580,6 +586,24 @@ export declare const enResources: {
580
586
  };
581
587
  reply: string;
582
588
  viaAssistant: string;
589
+ reactions: {
590
+ label: string;
591
+ title: string;
592
+ fromPhone: string;
593
+ add: string;
594
+ reactWith: string;
595
+ more: string;
596
+ back: string;
597
+ removeHint: string;
598
+ removeYours: string;
599
+ replacesTeammate: string;
600
+ notConnected: string;
601
+ notSent: string;
602
+ fromYou: string;
603
+ fromTeammate: string;
604
+ remove: string;
605
+ fromTeammateUnknown: string;
606
+ };
583
607
  };
584
608
  media: {
585
609
  types: {
@@ -712,6 +736,7 @@ export declare const enResources: {
712
736
  cancel: string;
713
737
  saveFailed: string;
714
738
  noName: string;
739
+ nameFromWhatsapp: string;
715
740
  whatsappName: string;
716
741
  updatedBy: string;
717
742
  updated: string;
@@ -13,6 +13,10 @@ export interface MessageBubbleProps {
13
13
  retrying?: boolean;
14
14
  /** Start a reply that quotes this message (hover button, swipe right or long-press on touch). */
15
15
  onReply?(m: Message): void;
16
+ /** React as the linked number ('' removes): 🙂 button, or press and hold on touch. */
17
+ onReact?(m: Message, emoji: string): void;
18
+ /** Why reacting is not possible now (WhatsApp not connected): the bar shows it, disabled. */
19
+ reactDisabledReason?: string | null;
16
20
  onMediaLoad?(): void;
17
21
  /** Team directory, for "Updated by" in a group sender's profile popover. */
18
22
  directory?: Directory;
@@ -28,4 +32,4 @@ export declare function quotedPreview(q: Message, t: TFunction<'inbox'>): string
28
32
  export declare function StatusTicks({ status }: {
29
33
  status: Message['status'];
30
34
  }): React.JSX.Element;
31
- export declare function MessageBubble({ message: m, showSender, outboundLabel, quoted, onRetry, retrying, onMediaLoad, directory, onReply, contactName, }: MessageBubbleProps): 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;
@@ -14,8 +14,12 @@ export interface MessageListProps {
14
14
  onRetry(m: Message): void;
15
15
  retryingId: string | null;
16
16
  onReply?(m: Message): void;
17
+ /** React as the linked number ('' removes); offered wherever a reply is. */
18
+ onReact?(m: Message, emoji: string): void;
19
+ /** Why reacting is not possible now (WhatsApp not connected); null when it is. */
20
+ reactDisabledReason?: string | null;
17
21
  /** Direct chats: the customer's display name, for quotes. */
18
22
  contactName?: string;
19
23
  footer?: React.ReactNode;
20
24
  }
21
- export declare function MessageList({ items, messagesById, isGroup, directory, loading, hasOlder, loadingOlder, onLoadOlder, onRetry, retryingId, onReply, contactName, footer, }: MessageListProps): React.JSX.Element;
25
+ export declare function MessageList({ items, messagesById, isGroup, directory, loading, hasOlder, loadingOlder, onLoadOlder, onRetry, retryingId, onReply, onReact, reactDisabledReason, contactName, footer, }: MessageListProps): React.JSX.Element;
@@ -0,0 +1,31 @@
1
+ import type { TFunction } from 'i18next';
2
+ import type { MessageReaction } from '@ezychat/shared';
3
+ /** Distinct emojis shown in the badge; the popover lists every reaction. */
4
+ export declare const BADGE_EMOJIS = 3;
5
+ export interface ReactionGroup {
6
+ emoji: string;
7
+ reactions: MessageReaction[];
8
+ }
9
+ /** One group per emoji: the most used first, then the one used first. */
10
+ export declare function groupReactions(reactions: MessageReaction[]): ReactionGroup[];
11
+ /**
12
+ * Who reacted, named like the rest of the conversation: the server's name (customer profile,
13
+ * contact, WhatsApp name), else the direct chat's name, else the phone number. Never inferred.
14
+ */
15
+ export declare function reactorName(r: MessageReaction, t: TFunction<'inbox'>, contactName?: string, teamName?: string | null): string;
16
+ export interface ReactionBadgesProps {
17
+ reactions: MessageReaction[];
18
+ /** Outbound bubble: the badge sits under its right corner, else under the left one. */
19
+ out: boolean;
20
+ /** Direct chats: the customer's name as the header shows it. */
21
+ contactName?: string;
22
+ /** Who sent the linked number's reaction (see `reactorName`). */
23
+ teamName?: string | null;
24
+ /** Removes the linked number's reaction from the list. */
25
+ onRemoveMine?(): void;
26
+ }
27
+ /**
28
+ * Emoji reactions under a bubble's corner, as WhatsApp shows them: the emojis (most used first)
29
+ * and the total when more than one person reacted. Tap or click lists who reacted with what.
30
+ */
31
+ export declare function ReactionBadges({ reactions, out, contactName, teamName, onRemoveMine, }: ReactionBadgesProps): import("react").JSX.Element | null;
@@ -0,0 +1,26 @@
1
+ /** The bar's emojis, as on WhatsApp. */
2
+ export declare const QUICK_REACTIONS: readonly ["👍", "❤️", "😂", "😮", "😢", "🙏"];
3
+ /** "+" opens these: common reactions in a business chat, no emoji library. */
4
+ export declare const MORE_REACTIONS: readonly ["👍", "❤️", "😂", "😮", "😢", "🙏", "👏", "🙌", "🔥", "🎉", "💯", "✅", "👌", "🤝", "💪", "😊", "😍", "🥰", "😁", "🤣", "😅", "😉", "🤔", "😎", "😴", "😭", "😡", "😱", "🥲", "🙈", "👀", "💐", "🎂", "☕", "🍜", "🚚", "📦", "💰", "⭐", "❌"];
5
+ export interface ReactionPickerProps {
6
+ /** Outbound bubble: the bar opens towards the left. */
7
+ out: boolean;
8
+ /** The linked number's current reaction to this message, '' when there is none. */
9
+ current: string;
10
+ /** The teammate who sent that reaction, when it was not the signed-in user or the phone. */
11
+ currentBy?: string | null;
12
+ open: boolean;
13
+ onOpenChange(open: boolean): void;
14
+ /** '' removes the linked number's reaction. */
15
+ onReact(emoji: string): void;
16
+ /** Why the team cannot react now (WhatsApp is not connected), else null. */
17
+ disabledReason: string | null;
18
+ /** Touch screens open the bar by press-and-hold, so it offers Reply as well. */
19
+ onReply?(): void;
20
+ }
21
+ /**
22
+ * The 🙂 button next to a message and its emoji bar. WhatsApp keeps one
23
+ * reaction per number, so the whole team shares the linked number's reaction: a new emoji replaces
24
+ * it, the same emoji again removes it.
25
+ */
26
+ export declare function ReactionPicker({ out, current, currentBy, open, onOpenChange, onReact, disabledReason, onReply, }: ReactionPickerProps): import("react").JSX.Element;
@@ -4,8 +4,10 @@ export declare const SWIPE_TRIGGER_PX = 56;
4
4
  /**
5
5
  * Touch gestures that start a reply, like WhatsApp: swipe the message right, or press and hold.
6
6
  * Mouse and pen are ignored (desktop uses the Reply button). Vertical movement keeps scrolling.
7
+ * With `onLongPress`, press-and-hold calls it instead (the reaction bar,
8
+ * which offers Reply too).
7
9
  */
8
- export declare function useSwipeReply(onReply: (() => void) | undefined): {
10
+ export declare function useSwipeReply(onReply: (() => void) | undefined, onLongPress?: () => void): {
9
11
  offset: number;
10
12
  handlers: React.HTMLAttributes<HTMLElement>;
11
13
  };
@@ -27,7 +27,11 @@ export interface AppLinks {
27
27
  feedback: (locale: string, version: string | null) => string;
28
28
  /** Support email address (mailto link where there is no report-issue page). */
29
29
  supportEmail: string | null;
30
+ /** "Upgrade to Enterprise" page (Lite's limits, account menu, About); null hides every upgrade link. */
31
+ upgrade: string | null;
30
32
  }
33
+ /** The EzyChat Enterprise section of the website. */
34
+ export declare const ENTERPRISE_UPGRADE_URL = "https://ezychat.ai/#enterprise";
31
35
  /** Lite's links: GitHub repository and issues, feedback on ezychat.ai. */
32
36
  export declare const LITE_APP_LINKS: Readonly<AppLinks>;
33
37
  /** Lite's links with the given overrides (an explicit `null` hides that link). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ezychat/web",
3
- "version": "0.1.50",
3
+ "version": "0.1.52",
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,15 +40,15 @@
40
40
  "build:lib": "node ../../scripts/build-web-lib.mjs"
41
41
  },
42
42
  "dependencies": {
43
- "@ezychat/shared": "0.1.50",
43
+ "@ezychat/shared": "0.1.52",
44
44
  "@fontsource-variable/inter": "^5.3.0",
45
- "@tanstack/react-query": "^5.104.4",
45
+ "@tanstack/react-query": "^5.104.5",
46
46
  "@types/react": "^19.3.0",
47
47
  "@types/react-dom": "^19.3.0",
48
48
  "class-variance-authority": "^0.7.1",
49
49
  "clsx": "^2.1.1",
50
50
  "cmdk": "^1.1.1",
51
- "cn": "^0.4.0",
51
+ "cn": "^0.5.0",
52
52
  "date-fns": "^4.4.0",
53
53
  "i18next": "^26.5.2",
54
54
  "lucide-react": "^1.59.0",
@@ -56,8 +56,8 @@
56
56
  "opus-recorder": "8.0.5",
57
57
  "qrcode.react": "^4.2.0",
58
58
  "radix-ui": "^1.8.1",
59
- "react": "^19.3.0",
60
- "react-dom": "^19.3.0",
59
+ "react": "^19.3.1",
60
+ "react-dom": "^19.3.1",
61
61
  "react-i18next": "^17.0.15",
62
62
  "react-router-dom": "^7.18.4",
63
63
  "socket.io-client": "^4.8.4",
@@ -75,7 +75,7 @@
75
75
  "@vitejs/plugin-react": "^6.1.2",
76
76
  "jsdom": "^30.1.3",
77
77
  "tailwindcss": "^4.3.3",
78
- "vite": "^8.3.4",
78
+ "vite": "^8.3.5",
79
79
  "vite-plugin-pwa": "^2.0.0",
80
80
  "workbox-precaching": "^7.4.1",
81
81
  "workbox-window": "^7.4.1"