@ezychat/web 0.1.77 → 0.1.79

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 (52) hide show
  1. package/dist-lib/chunks/{admin-BKiB8_GE.js → admin-D4nMrYTV.js} +49 -6
  2. package/dist-lib/chunks/{admin-DM8CrZrZ.js → admin-SGy97Cay.js} +47 -6
  3. package/dist-lib/chunks/{common-BB_u0f7c.js → common-BE996sRJ.js} +26 -0
  4. package/dist-lib/chunks/{common-6IvDd1Hx.js → common-CBTam36M.js} +26 -0
  5. package/dist-lib/chunks/{inbox-C9xTxE6Y.js → inbox-RAdHANUD.js} +96 -5
  6. package/dist-lib/chunks/{inbox-D-koJMyr.js → inbox-iUbtLuDB.js} +96 -5
  7. package/dist-lib/ezychat-web.css +1 -1
  8. package/dist-lib/index.js +10485 -6680
  9. package/dist-lib/public/badge-96.png +0 -0
  10. package/dist-lib/sw.ts +2 -1
  11. package/dist-lib/types/admin/AgentScheduledTasksCard.d.ts +10 -0
  12. package/dist-lib/types/admin/MemberChatsField.d.ts +11 -0
  13. package/dist-lib/types/admin/NewChatSection.d.ts +7 -0
  14. package/dist-lib/types/admin/ScheduledRunsDialog.d.ts +12 -0
  15. package/dist-lib/types/admin/ScheduledTaskDialog.d.ts +18 -0
  16. package/dist-lib/types/admin/business-templates-data.d.ts +18 -0
  17. package/dist-lib/types/admin/business-templates.d.ts +3 -1
  18. package/dist-lib/types/admin/connectors/ConnectorDetailPage.d.ts +2 -1
  19. package/dist-lib/types/admin/connectors/ConnectorsGalleryPage.d.ts +2 -1
  20. package/dist-lib/types/admin/connectors/CreateSheetDialog.d.ts +29 -0
  21. package/dist-lib/types/admin/connectors/DriveSettingsCard.d.ts +14 -0
  22. package/dist-lib/types/admin/connectors/GoogleDriveAccountCard.d.ts +7 -0
  23. package/dist-lib/types/admin/connectors/SqlAccountCustomers.d.ts +4 -0
  24. package/dist-lib/types/admin/connectors/SqlAccountPage.d.ts +12 -0
  25. package/dist-lib/types/admin/connectors/SqlAccountSettings.d.ts +7 -0
  26. package/dist-lib/types/admin/connectors/catalog.d.ts +10 -7
  27. package/dist-lib/types/admin/connectors/connector-ui.d.ts +17 -1
  28. package/dist-lib/types/admin/connectors/google-connect.d.ts +5 -0
  29. package/dist-lib/types/admin/connectors/sheets-tabs.d.ts +4 -1
  30. package/dist-lib/types/admin/scheduled-format.d.ts +16 -0
  31. package/dist-lib/types/api/ai-templates.d.ts +24 -0
  32. package/dist-lib/types/api/ai.d.ts +8 -1
  33. package/dist-lib/types/api/connectors.d.ts +132 -0
  34. package/dist-lib/types/api/inbox-mutations.d.ts +2 -0
  35. package/dist-lib/types/api/message-changes.d.ts +10 -2
  36. package/dist-lib/types/api/new-chat.d.ts +55 -0
  37. package/dist-lib/types/api/queries.d.ts +63 -8
  38. package/dist-lib/types/api/scheduled-tasks.d.ts +145 -0
  39. package/dist-lib/types/api/sql-account.d.ts +105 -0
  40. package/dist-lib/types/api/templates.d.ts +5 -1
  41. package/dist-lib/types/askezy/AskEzyButton.d.ts +1 -1
  42. package/dist-lib/types/auth/chat-scope.d.ts +7 -0
  43. package/dist-lib/types/i18n/resources.d.ts +640 -0
  44. package/dist-lib/types/inbox/MessageBubble.d.ts +5 -1
  45. package/dist-lib/types/inbox/MessageList.d.ts +8 -1
  46. package/dist-lib/types/inbox/NewChatDialog.d.ts +2 -0
  47. package/dist-lib/types/inbox/ReplyWindow.d.ts +16 -0
  48. package/dist-lib/types/inbox/useDirectory.d.ts +3 -0
  49. package/dist-lib/types/inbox/useQuoteJump.d.ts +28 -0
  50. package/dist-lib/types/inbox/useSwipeReply.d.ts +1 -0
  51. package/dist-lib/types/lib/tips.d.ts +1 -1
  52. package/package.json +2 -2
@@ -23,6 +23,10 @@ export interface MessageBubbleProps {
23
23
  directory?: Directory;
24
24
  /** Direct chats: the customer's name as the header shows it (used in quotes). */
25
25
  contactName?: string;
26
+ /** Tap the quote to scroll to the original message (loads older pages when needed). */
27
+ onOpenQuote?(quotedId: string): void;
28
+ /** Briefly marks the bubble after a jump from a quote. */
29
+ highlighted?: boolean;
26
30
  /** Edit and delete (⋮ menu; under Reply in the press-and-hold bar on touch). */
27
31
  changes?: MessageChangeProps;
28
32
  }
@@ -35,4 +39,4 @@ export declare function quotedPreview(q: Message, t: TFunction<'inbox'>): string
35
39
  export declare function StatusTicks({ status }: {
36
40
  status: Message['status'];
37
41
  }): 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;
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;
@@ -3,6 +3,7 @@ import type { Message } from '@ezychat/shared';
3
3
  import type { MessageChangeProps } from './message-changes';
4
4
  import type { TimelineItem } from './timeline';
5
5
  import type { Directory } from './useDirectory';
6
+ import type { JumpTarget } from './useQuoteJump';
6
7
  export interface MessageListProps {
7
8
  items: TimelineItem[];
8
9
  messagesById: Map<string, Message>;
@@ -23,6 +24,12 @@ export interface MessageListProps {
23
24
  contactName?: string;
24
25
  /** Edit and delete sent messages (rights per message, handlers). */
25
26
  changes?: MessageChangeProps;
27
+ /** Tap a quote: find and scroll to its original (see `useQuoteJump`). */
28
+ onOpenQuote?(quotedId: string): void;
29
+ /** Scroll to this message and highlight it briefly once it is rendered. */
30
+ jumpTo?: JumpTarget | null;
26
31
  footer?: React.ReactNode;
27
32
  }
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;
33
+ /** How long a message reached from a quote stays highlighted. */
34
+ export declare const HIGHLIGHT_MS = 1600;
35
+ export declare function MessageList({ items, messagesById, isGroup, directory, loading, hasOlder, loadingOlder, onLoadOlder, onRetry, retryingId, onReply, onReact, reactDisabledReason, contactName, changes, onOpenQuote, jumpTo, footer, }: MessageListProps): React.JSX.Element;
@@ -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;
@@ -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;
@@ -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?: {
@@ -0,0 +1,28 @@
1
+ import type { Message, MessageListResponse } from '@ezychat/shared';
2
+ /** Older pages loaded at most to reach a quoted message (50 each: 2,000 messages back). */
3
+ export declare const QUOTE_JUMP_MAX_PAGES = 40;
4
+ /** A request to scroll to a message; `seq` makes a second tap on the same quote scroll again. */
5
+ export interface JumpTarget {
6
+ id: string;
7
+ seq: number;
8
+ }
9
+ interface OlderPages {
10
+ hasNextPage: boolean;
11
+ fetchNextPage(): Promise<{
12
+ data?: {
13
+ pages: MessageListResponse[];
14
+ };
15
+ hasNextPage: boolean;
16
+ isError: boolean;
17
+ }>;
18
+ }
19
+ /**
20
+ * "Tap a quote to see the original", like WhatsApp: a loaded original is scrolled to at once;
21
+ * otherwise the server says whether it is stored in this chat and how far back, and older pages
22
+ * load (bounded) until it is there. Never matched by text, only by the stored message key.
23
+ */
24
+ export declare function useQuoteJump(jid: string, messagesById: Map<string, Message>, older: OlderPages): {
25
+ target: JumpTarget | null;
26
+ open(id: string): Promise<void>;
27
+ };
28
+ export {};
@@ -10,4 +10,5 @@ export declare const SWIPE_TRIGGER_PX = 56;
10
10
  export declare function useSwipeReply(onReply: (() => void) | undefined, onLongPress?: () => void): {
11
11
  offset: number;
12
12
  handlers: React.HTMLAttributes<HTMLElement>;
13
+ wasGesture: () => boolean;
13
14
  };
@@ -3,7 +3,7 @@
3
3
  * under `tips.<topic>` (`title`, `body`, `step1`…`stepN`, `action`); this file holds each tip's shape.
4
4
  * Design: docs/features/concept-tips/design.md.
5
5
  */
6
- export declare const TIP_TOPICS: readonly ["whatsappLink", "aiConnection", "apiKey", "claudeKey", "aiModel", "businessContext", "instructions", "handoff", "tryIt", "voice", "tunnel", "lan", "mcp", "accessToken", "connectors", "safetyAi", "autoBlock", "lockedFiles", "reportNumber", "usageStats"];
6
+ export declare const TIP_TOPICS: readonly ["whatsappLink", "aiConnection", "apiKey", "claudeKey", "aiModel", "businessContext", "instructions", "handoff", "tryIt", "voice", "tunnel", "lan", "mcp", "accessToken", "connectors", "safetyAi", "autoBlock", "lockedFiles", "driveFiles", "reportNumber", "sqlApiService", "sqlKeys", "sqlCustomerCode", "usageStats"];
7
7
  export type TipTopic = (typeof TIP_TOPICS)[number];
8
8
  /** The ezychat.ai guides a tip can link to (each exists in en, ms and zh). */
9
9
  export type TipGuide = 'getting-started' | 'set-up-ai-agent' | 'connect-cloudflare' | 'connect-ai-assistant';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ezychat/web",
3
- "version": "0.1.77",
3
+ "version": "0.1.79",
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.77",
43
+ "@ezychat/shared": "0.1.79",
44
44
  "@fontsource-variable/inter": "^5.3.0",
45
45
  "@tanstack/react-query": "^5.105.0",
46
46
  "@types/react": "^19.3.0",