@mantine-vue/whatsapp-inbox 3.2.0

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 (111) hide show
  1. package/README.md +88 -0
  2. package/cjs/index.cjs +11842 -0
  3. package/cjs/index.cjs.map +1 -0
  4. package/esm/index.mjs +11704 -0
  5. package/esm/index.mjs.map +1 -0
  6. package/lib/WhatsAppInbox.context.d.ts +70 -0
  7. package/lib/component-props.d.ts +138 -0
  8. package/lib/components/WhatsAppAttachmentPreview/WhatsAppAttachmentPreview.d.ts +8 -0
  9. package/lib/components/WhatsAppAttachmentPreview/WhatsAppAttachmentPreview.types.d.ts +33 -0
  10. package/lib/components/WhatsAppAttachmentPreview/WhatsAppAttachmentPreview.vue.d.ts +19 -0
  11. package/lib/components/WhatsAppAttachmentPreview/index.d.ts +1 -0
  12. package/lib/components/WhatsAppComposer/WhatsAppComposer.d.ts +10 -0
  13. package/lib/components/WhatsAppComposer/WhatsAppComposer.types.d.ts +173 -0
  14. package/lib/components/WhatsAppComposer/WhatsAppComposer.vue.d.ts +52 -0
  15. package/lib/components/WhatsAppComposer/index.d.ts +1 -0
  16. package/lib/components/WhatsAppContactPanel/WhatsAppContactPanel.d.ts +9 -0
  17. package/lib/components/WhatsAppContactPanel/WhatsAppContactPanel.types.d.ts +40 -0
  18. package/lib/components/WhatsAppContactPanel/WhatsAppContactPanel.vue.d.ts +19 -0
  19. package/lib/components/WhatsAppContactPanel/index.d.ts +1 -0
  20. package/lib/components/WhatsAppConversation/WhatsAppConversation.d.ts +10 -0
  21. package/lib/components/WhatsAppConversation/WhatsAppConversation.types.d.ts +163 -0
  22. package/lib/components/WhatsAppConversation/WhatsAppConversation.vue.d.ts +69 -0
  23. package/lib/components/WhatsAppConversation/index.d.ts +1 -0
  24. package/lib/components/WhatsAppConversationHeader/WhatsAppConversationHeader.d.ts +9 -0
  25. package/lib/components/WhatsAppConversationHeader/WhatsAppConversationHeader.types.d.ts +57 -0
  26. package/lib/components/WhatsAppConversationHeader/WhatsAppConversationHeader.vue.d.ts +23 -0
  27. package/lib/components/WhatsAppConversationHeader/index.d.ts +1 -0
  28. package/lib/components/WhatsAppConversationList/WhatsAppConversationList.d.ts +9 -0
  29. package/lib/components/WhatsAppConversationList/WhatsAppConversationList.types.d.ts +113 -0
  30. package/lib/components/WhatsAppConversationList/WhatsAppConversationList.vue.d.ts +35 -0
  31. package/lib/components/WhatsAppConversationList/index.d.ts +1 -0
  32. package/lib/components/WhatsAppConversationListItem/WhatsAppConversationListItem.d.ts +9 -0
  33. package/lib/components/WhatsAppConversationListItem/WhatsAppConversationListItem.types.d.ts +56 -0
  34. package/lib/components/WhatsAppConversationListItem/WhatsAppConversationListItem.vue.d.ts +21 -0
  35. package/lib/components/WhatsAppConversationListItem/index.d.ts +1 -0
  36. package/lib/components/WhatsAppEmojiPicker/WhatsAppEmojiPicker.d.ts +9 -0
  37. package/lib/components/WhatsAppEmojiPicker/WhatsAppEmojiPicker.types.d.ts +91 -0
  38. package/lib/components/WhatsAppEmojiPicker/WhatsAppEmojiPicker.vue.d.ts +31 -0
  39. package/lib/components/WhatsAppEmojiPicker/index.d.ts +1 -0
  40. package/lib/components/WhatsAppInbox/WhatsAppInbox.d.ts +10 -0
  41. package/lib/components/WhatsAppInbox/WhatsAppInbox.types.d.ts +135 -0
  42. package/lib/components/WhatsAppInbox/WhatsAppInbox.vue.d.ts +84 -0
  43. package/lib/components/WhatsAppInbox/index.d.ts +1 -0
  44. package/lib/components/WhatsAppInboxDrawer/WhatsAppInboxDrawer.d.ts +9 -0
  45. package/lib/components/WhatsAppInboxDrawer/WhatsAppInboxDrawer.types.d.ts +52 -0
  46. package/lib/components/WhatsAppInboxDrawer/WhatsAppInboxDrawer.vue.d.ts +24 -0
  47. package/lib/components/WhatsAppInboxDrawer/index.d.ts +1 -0
  48. package/lib/components/WhatsAppInboxModal/WhatsAppInboxModal.d.ts +9 -0
  49. package/lib/components/WhatsAppInboxModal/WhatsAppInboxModal.types.d.ts +52 -0
  50. package/lib/components/WhatsAppInboxModal/WhatsAppInboxModal.vue.d.ts +28 -0
  51. package/lib/components/WhatsAppInboxModal/index.d.ts +1 -0
  52. package/lib/components/WhatsAppInboxProvider/WhatsAppInboxProvider.d.ts +16 -0
  53. package/lib/components/WhatsAppInboxProvider/WhatsAppInboxProvider.types.d.ts +16 -0
  54. package/lib/components/WhatsAppInboxProvider/WhatsAppInboxProvider.vue.d.ts +11 -0
  55. package/lib/components/WhatsAppInboxProvider/index.d.ts +1 -0
  56. package/lib/components/WhatsAppInteractiveMessageEditor/WhatsAppInteractiveMessageEditor.d.ts +8 -0
  57. package/lib/components/WhatsAppInteractiveMessageEditor/WhatsAppInteractiveMessageEditor.types.d.ts +49 -0
  58. package/lib/components/WhatsAppInteractiveMessageEditor/WhatsAppInteractiveMessageEditor.vue.d.ts +27 -0
  59. package/lib/components/WhatsAppInteractiveMessageEditor/index.d.ts +1 -0
  60. package/lib/components/WhatsAppMediaAttachment/WhatsAppMediaAttachment.d.ts +8 -0
  61. package/lib/components/WhatsAppMediaAttachment/WhatsAppMediaAttachment.types.d.ts +41 -0
  62. package/lib/components/WhatsAppMediaAttachment/WhatsAppMediaAttachment.vue.d.ts +19 -0
  63. package/lib/components/WhatsAppMediaAttachment/index.d.ts +1 -0
  64. package/lib/components/WhatsAppMessage/WhatsAppMessage.d.ts +9 -0
  65. package/lib/components/WhatsAppMessage/WhatsAppMessage.types.d.ts +46 -0
  66. package/lib/components/WhatsAppMessage/WhatsAppMessage.vue.d.ts +25 -0
  67. package/lib/components/WhatsAppMessage/index.d.ts +1 -0
  68. package/lib/components/WhatsAppMessageBubble/WhatsAppMessageBubble.d.ts +9 -0
  69. package/lib/components/WhatsAppMessageBubble/WhatsAppMessageBubble.types.d.ts +77 -0
  70. package/lib/components/WhatsAppMessageBubble/WhatsAppMessageBubble.vue.d.ts +22 -0
  71. package/lib/components/WhatsAppMessageBubble/index.d.ts +1 -0
  72. package/lib/components/WhatsAppMessageList/WhatsAppMessageList.d.ts +10 -0
  73. package/lib/components/WhatsAppMessageList/WhatsAppMessageList.types.d.ts +94 -0
  74. package/lib/components/WhatsAppMessageList/WhatsAppMessageList.vue.d.ts +39 -0
  75. package/lib/components/WhatsAppMessageList/index.d.ts +1 -0
  76. package/lib/components/WhatsAppMessageStatus/WhatsAppMessageStatus.d.ts +7 -0
  77. package/lib/components/WhatsAppMessageStatus/WhatsAppMessageStatus.types.d.ts +30 -0
  78. package/lib/components/WhatsAppMessageStatus/WhatsAppMessageStatus.vue.d.ts +24 -0
  79. package/lib/components/WhatsAppMessageStatus/index.d.ts +1 -0
  80. package/lib/components/WhatsAppMessagingWindowNotice/WhatsAppMessagingWindowNotice.d.ts +9 -0
  81. package/lib/components/WhatsAppMessagingWindowNotice/WhatsAppMessagingWindowNotice.types.d.ts +55 -0
  82. package/lib/components/WhatsAppMessagingWindowNotice/WhatsAppMessagingWindowNotice.vue.d.ts +18 -0
  83. package/lib/components/WhatsAppMessagingWindowNotice/index.d.ts +1 -0
  84. package/lib/components/WhatsAppTemplatePreview/WhatsAppTemplatePreview.d.ts +7 -0
  85. package/lib/components/WhatsAppTemplatePreview/WhatsAppTemplatePreview.types.d.ts +36 -0
  86. package/lib/components/WhatsAppTemplatePreview/WhatsAppTemplatePreview.vue.d.ts +12 -0
  87. package/lib/components/WhatsAppTemplatePreview/index.d.ts +1 -0
  88. package/lib/components/WhatsAppTemplateSelector/WhatsAppTemplateSelector.d.ts +9 -0
  89. package/lib/components/WhatsAppTemplateSelector/WhatsAppTemplateSelector.types.d.ts +106 -0
  90. package/lib/components/WhatsAppTemplateSelector/WhatsAppTemplateSelector.vue.d.ts +33 -0
  91. package/lib/components/WhatsAppTemplateSelector/index.d.ts +1 -0
  92. package/lib/emoji/emoji-data.d.ts +27 -0
  93. package/lib/emoji/emoji-filter.d.ts +49 -0
  94. package/lib/emoji/index.d.ts +4 -0
  95. package/lib/icons/WhatsAppIcon.vue.d.ts +14 -0
  96. package/lib/icons/icon-paths.d.ts +43 -0
  97. package/lib/icons/index.d.ts +3 -0
  98. package/lib/index.d.mts +29 -0
  99. package/lib/index.d.ts +29 -0
  100. package/lib/labels.d.ts +184 -0
  101. package/lib/types.d.ts +777 -0
  102. package/lib/utils/capabilities.d.ts +14 -0
  103. package/lib/utils/format.d.ts +27 -0
  104. package/lib/utils/index.d.ts +9 -0
  105. package/lib/utils/media.d.ts +45 -0
  106. package/lib/utils/messages.d.ts +48 -0
  107. package/lib/utils/phone.d.ts +18 -0
  108. package/lib/utils/templates.d.ts +65 -0
  109. package/package.json +46 -0
  110. package/styles.css +1504 -0
  111. package/styles.layer.css +1506 -0
@@ -0,0 +1,163 @@
1
+ import type { BoxProps, Factory } from '@mantine-vue/core';
2
+ import type { StylesApiProps } from '@mantine-vue/core/styles-api';
3
+ import type { ForwardedProps, MessageRenderers, WhatsAppConversationSlots } from '../../component-props';
4
+ import type { WhatsAppInboxLabelsOverride } from '../../labels';
5
+ import type { WhatsAppAttachment, WhatsAppAttachmentsAddPayload, WhatsAppConversationData, WhatsAppConversationCapabilities, WhatsAppDraftBehavior, WhatsAppLoadMorePayload, WhatsAppMessageData, WhatsAppMessageReference, WhatsAppOutgoingMessage, WhatsAppPaginationState, WhatsAppRejectedFile, WhatsAppTemplate, WhatsAppUpload } from '../../types';
6
+ import type { WhatsAppComposerProps, WhatsAppComposerStylesNames } from '../WhatsAppComposer';
7
+ import type { WhatsAppConversationHeaderProps, WhatsAppConversationHeaderStylesNames } from '../WhatsAppConversationHeader';
8
+ import type { WhatsAppMessageListProps, WhatsAppMessageListStylesNames } from '../WhatsAppMessageList';
9
+ export type WhatsAppConversationStylesNames = 'conversationRoot' | 'conversationState' | WhatsAppConversationHeaderStylesNames | WhatsAppMessageListStylesNames | WhatsAppComposerStylesNames;
10
+ export interface WhatsAppConversationOwnProps extends StylesApiProps<WhatsAppConversationFactory>, MessageRenderers {
11
+ /** Conversation to show. Its `capabilities` drive the composer unless overridden. */
12
+ conversation?: WhatsAppConversationData;
13
+ /**
14
+ * Conversation the outgoing payloads are addressed to. Falls back to `conversation.id`, and
15
+ * is what makes the modal usable with nothing but an id and a message list.
16
+ */
17
+ conversationId?: string;
18
+ /** Overrides the capabilities of `conversation`. */
19
+ capabilities?: WhatsAppConversationCapabilities;
20
+ /** Messages of the conversation, in display order. */
21
+ messages?: WhatsAppMessageData[];
22
+ /** Whether the initial message load is in flight. */
23
+ messagesLoading?: boolean;
24
+ /** Failure of the last message load. */
25
+ messagesError?: string | null;
26
+ /** Cursor state of the older-messages pagination. */
27
+ messagesPagination?: WhatsAppPaginationState;
28
+ /** Attachments staged in the composer. */
29
+ uploads?: WhatsAppUpload[];
30
+ /** Approved templates offered by the composer. */
31
+ templates?: WhatsAppTemplate[];
32
+ /** Whether the template list is loading. */
33
+ templatesLoading?: boolean;
34
+ /** Failure of the last template load. */
35
+ templatesError?: string | null;
36
+ /**
37
+ * Controlled composer draft for a single conversation. When set it wins over `drafts`, which
38
+ * is what the modal and drawer use: they only ever show one conversation.
39
+ */
40
+ draft?: string;
41
+ /**
42
+ * Controlled drafts, keyed by conversation id. This is how an unsent message survives a switch
43
+ * to another conversation and is restored on return.
44
+ */
45
+ drafts?: Record<string, string>;
46
+ /** Uncontrolled initial drafts, keyed by conversation id. */
47
+ defaultDrafts?: Record<string, string>;
48
+ /**
49
+ * What happens to an unsent draft when the conversation changes.
50
+ *
51
+ * `preserve` keeps one draft per conversation and restores it on return. `reset` drops the
52
+ * draft of the conversation being left. Ignored while `draft` is controlled, since the
53
+ * consumer owns the value in that case.
54
+ *
55
+ * @default 'preserve'
56
+ */
57
+ draftBehavior?: WhatsAppDraftBehavior;
58
+ /** Whether a send is in flight. */
59
+ sending?: boolean;
60
+ /** Failure of the last send. */
61
+ sendError?: string | null;
62
+ /** Message the draft replies to. */
63
+ replyTo?: WhatsAppMessageReference | null;
64
+ /**
65
+ * Renders the conversation header.
66
+ * @default true
67
+ */
68
+ withHeader?: boolean;
69
+ /**
70
+ * Renders the composer.
71
+ * @default true
72
+ */
73
+ withComposer?: boolean;
74
+ /**
75
+ * Renders the back control in the header.
76
+ * @default false
77
+ */
78
+ withBack?: boolean;
79
+ /**
80
+ * Renders the contact panel toggle in the header.
81
+ * @default false
82
+ */
83
+ withContactToggle?: boolean;
84
+ /** Whether the contact panel is open, for the header toggle. */
85
+ contactPanelOpened?: boolean;
86
+ /**
87
+ * Moves focus to the composer when the conversation changes, so typing can start immediately
88
+ * after picking a conversation with the keyboard.
89
+ * @default true
90
+ */
91
+ focusComposerOnChange?: boolean;
92
+ /** Props passed to the underlying `WhatsAppConversationHeader`. */
93
+ headerProps?: ForwardedProps<WhatsAppConversationHeaderProps>;
94
+ /** Props passed to the underlying `WhatsAppMessageList`. */
95
+ messageListProps?: ForwardedProps<WhatsAppMessageListProps>;
96
+ /** Props passed to the underlying `WhatsAppComposer`. */
97
+ composerProps?: ForwardedProps<WhatsAppComposerProps>;
98
+ /** Label overrides. */
99
+ labels?: WhatsAppInboxLabelsOverride;
100
+ }
101
+ export interface WhatsAppConversationProps extends Omit<BoxProps, keyof WhatsAppConversationOwnProps>, WhatsAppConversationOwnProps {
102
+ }
103
+ export interface WhatsAppConversationEmits {
104
+ /** Emitted when the composer draft changes. */
105
+ 'update:draft': [draft: string];
106
+ /** Emitted with the full draft map whenever a draft changes or is dropped. */
107
+ 'update:drafts': [drafts: Record<string, string>];
108
+ /** Emitted when the reply target changes. */
109
+ 'update:replyTo': [replyTo: WhatsAppMessageReference | null];
110
+ /** Emitted whenever the draft changes, for typing indicators. */
111
+ typing: [value: string];
112
+ /** Emitted when a message should be sent. */
113
+ send: [payload: WhatsAppOutgoingMessage];
114
+ /** Emitted with the files that passed validation, for the consumer to upload. */
115
+ attachmentsAdd: [payload: WhatsAppAttachmentsAddPayload];
116
+ /** Emitted when files were refused by the configured constraints. */
117
+ attachmentsReject: [rejected: WhatsAppRejectedFile[]];
118
+ /** Emitted when a staged attachment should be dropped. */
119
+ attachmentRemove: [upload: WhatsAppUpload];
120
+ /** Emitted when a failed upload should be retried. */
121
+ attachmentRetry: [upload: WhatsAppUpload];
122
+ /** Emitted when an in-flight upload should be aborted. */
123
+ attachmentCancel: [upload: WhatsAppUpload];
124
+ /** Emitted when the composer refuses to send. */
125
+ validationError: [message: string];
126
+ /** Emitted when the retry action of a send error is used. */
127
+ retrySend: [];
128
+ /** Emitted when the retry action of a template load error is used. */
129
+ templatesRetryLoad: [];
130
+ /** Emitted when older messages should be fetched. */
131
+ loadOlderMessages: [payload: WhatsAppLoadMorePayload];
132
+ /** Emitted when the retry action of the message-history error state is used. */
133
+ retryLoadMessages: [];
134
+ /** Emitted when the retry action of a failed message is used. */
135
+ retryMessage: [message: WhatsAppMessageData];
136
+ /** Emitted when the download action of an attachment is used. */
137
+ mediaDownload: [attachment: WhatsAppAttachment, message: WhatsAppMessageData];
138
+ /** Emitted when an image or sticker is activated. */
139
+ mediaPreview: [attachment: WhatsAppAttachment, message: WhatsAppMessageData];
140
+ /** Emitted when the header back control is used. */
141
+ back: [];
142
+ /** Emitted when the contact panel toggle is used. */
143
+ toggleContactPanel: [opened: boolean];
144
+ /** Emitted when the header contact is activated. */
145
+ contactClick: [conversation: WhatsAppConversationData];
146
+ /** Emitted when the user reaches or leaves the bottom of the history. */
147
+ atBottomChange: [atBottom: boolean];
148
+ }
149
+ export interface WhatsAppConversationExposed {
150
+ /** Moves focus to the composer input. */
151
+ focusComposer: () => void;
152
+ /** Scrolls the history to the newest message. */
153
+ scrollToBottom: (behavior?: ScrollBehavior) => void;
154
+ }
155
+ export type WhatsAppConversationFactory = Factory<{
156
+ props: Omit<WhatsAppConversationProps, 'rootRef'>;
157
+ slots: WhatsAppConversationSlots;
158
+ emits: WhatsAppConversationEmits;
159
+ exposed: WhatsAppConversationExposed;
160
+ ref: HTMLDivElement;
161
+ element: 'div';
162
+ stylesNames: WhatsAppConversationStylesNames;
163
+ }>;
@@ -0,0 +1,69 @@
1
+ import type { WhatsAppConversationSlots } from '../../component-props';
2
+ import type { WhatsAppAttachment, WhatsAppMessageData, WhatsAppOutgoingMessage } from '../../types';
3
+ import type { WhatsAppConversationOwnProps } from './WhatsAppConversation.types';
4
+ declare const defaultProps: {
5
+ readonly draftBehavior: "preserve";
6
+ readonly withHeader: true;
7
+ readonly withComposer: true;
8
+ readonly withBack: false;
9
+ readonly withContactToggle: false;
10
+ readonly focusComposerOnChange: true;
11
+ };
12
+ export { defaultProps };
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
15
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<WhatsAppConversationOwnProps, {
16
+ focusComposer: () => void;
17
+ scrollToBottom: (behavior?: ScrollBehavior) => void;
18
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
19
+ send: (payload: WhatsAppOutgoingMessage) => any;
20
+ validationError: (message: string) => any;
21
+ loadOlderMessages: (payload: import("../..").WhatsAppLoadMorePayload) => any;
22
+ retrySend: () => any;
23
+ typing: (value: string) => any;
24
+ back: () => any;
25
+ "update:replyTo": (replyTo: import("../..").WhatsAppMessageReference | null) => any;
26
+ attachmentsAdd: (payload: import("../..").WhatsAppAttachmentsAddPayload) => any;
27
+ attachmentsReject: (rejected: import("../..").WhatsAppRejectedFile[]) => any;
28
+ attachmentRemove: (upload: import("../..").WhatsAppUpload) => any;
29
+ attachmentRetry: (upload: import("../..").WhatsAppUpload) => any;
30
+ attachmentCancel: (upload: import("../..").WhatsAppUpload) => any;
31
+ templatesRetryLoad: () => any;
32
+ toggleContactPanel: (opened: boolean) => any;
33
+ contactClick: (conversation: import("../..").WhatsAppConversationData) => any;
34
+ mediaDownload: (attachment: WhatsAppAttachment, message: WhatsAppMessageData) => any;
35
+ mediaPreview: (attachment: WhatsAppAttachment, message: WhatsAppMessageData) => any;
36
+ retryMessage: (message: WhatsAppMessageData) => any;
37
+ atBottomChange: (atBottom: boolean) => any;
38
+ "update:draft": (draft: string) => any;
39
+ "update:drafts": (drafts: Record<string, string>) => any;
40
+ retryLoadMessages: () => any;
41
+ }, string, import("vue").PublicProps, Readonly<WhatsAppConversationOwnProps> & Readonly<{
42
+ onSend?: ((payload: WhatsAppOutgoingMessage) => any) | undefined;
43
+ onValidationError?: ((message: string) => any) | undefined;
44
+ onLoadOlderMessages?: ((payload: import("../..").WhatsAppLoadMorePayload) => any) | undefined;
45
+ onRetrySend?: (() => any) | undefined;
46
+ onTyping?: ((value: string) => any) | undefined;
47
+ onBack?: (() => any) | undefined;
48
+ "onUpdate:replyTo"?: ((replyTo: import("../..").WhatsAppMessageReference | null) => any) | undefined;
49
+ onAttachmentsAdd?: ((payload: import("../..").WhatsAppAttachmentsAddPayload) => any) | undefined;
50
+ onAttachmentsReject?: ((rejected: import("../..").WhatsAppRejectedFile[]) => any) | undefined;
51
+ onAttachmentRemove?: ((upload: import("../..").WhatsAppUpload) => any) | undefined;
52
+ onAttachmentRetry?: ((upload: import("../..").WhatsAppUpload) => any) | undefined;
53
+ onAttachmentCancel?: ((upload: import("../..").WhatsAppUpload) => any) | undefined;
54
+ onTemplatesRetryLoad?: (() => any) | undefined;
55
+ onToggleContactPanel?: ((opened: boolean) => any) | undefined;
56
+ onContactClick?: ((conversation: import("../..").WhatsAppConversationData) => any) | undefined;
57
+ onMediaDownload?: ((attachment: WhatsAppAttachment, message: WhatsAppMessageData) => any) | undefined;
58
+ onMediaPreview?: ((attachment: WhatsAppAttachment, message: WhatsAppMessageData) => any) | undefined;
59
+ onRetryMessage?: ((message: WhatsAppMessageData) => any) | undefined;
60
+ onAtBottomChange?: ((atBottom: boolean) => any) | undefined;
61
+ "onUpdate:draft"?: ((draft: string) => any) | undefined;
62
+ "onUpdate:drafts"?: ((drafts: Record<string, string>) => any) | undefined;
63
+ onRetryLoadMessages?: (() => any) | undefined;
64
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, WhatsAppConversationSlots>;
65
+ type __VLS_WithSlots<T, S> = T & {
66
+ new (): {
67
+ $slots: S;
68
+ };
69
+ };
@@ -0,0 +1 @@
1
+ export * from './WhatsAppConversation';
@@ -0,0 +1,9 @@
1
+ export declare const WhatsAppConversationHeader: import("@mantine-vue/core").MantineComponent<{
2
+ props: Omit<import("./WhatsAppConversationHeader.types").WhatsAppConversationHeaderProps, "rootRef">;
3
+ slots: import("./WhatsAppConversationHeader.types").WhatsAppConversationHeaderSlots;
4
+ emits: import("./WhatsAppConversationHeader.types").WhatsAppConversationHeaderEmits;
5
+ ref: HTMLElement;
6
+ element: "header";
7
+ stylesNames: import("./WhatsAppConversationHeader.types").WhatsAppConversationHeaderStylesNames;
8
+ }>;
9
+ export type { WhatsAppConversationHeaderEmits, WhatsAppConversationHeaderFactory, WhatsAppConversationHeaderOwnProps, WhatsAppConversationHeaderProps, WhatsAppConversationHeaderSlots, WhatsAppConversationHeaderStylesNames, } from './WhatsAppConversationHeader.types';
@@ -0,0 +1,57 @@
1
+ import type { VNodeChild } from 'vue';
2
+ import type { BoxProps, Factory } from '@mantine-vue/core';
3
+ import type { StylesApiProps } from '@mantine-vue/core/styles-api';
4
+ import type { WhatsAppInboxLabelsOverride } from '../../labels';
5
+ import type { WhatsAppConversationSummary } from '../../types';
6
+ export type WhatsAppConversationHeaderStylesNames = 'conversationHeaderRoot' | 'conversationHeaderBack' | 'conversationHeaderAvatar' | 'conversationHeaderBody' | 'conversationHeaderName' | 'conversationHeaderSubtitle' | 'conversationHeaderActions';
7
+ export interface WhatsAppConversationHeaderSlots {
8
+ /** Replaces the whole header content. */
9
+ default?: (props: {
10
+ conversation: WhatsAppConversationSummary | undefined;
11
+ }) => VNodeChild;
12
+ /** Rendered at the end of the header, before the contact panel toggle. */
13
+ headerActions?: (props: {
14
+ conversation: WhatsAppConversationSummary | undefined;
15
+ }) => VNodeChild;
16
+ }
17
+ export interface WhatsAppConversationHeaderOwnProps extends StylesApiProps<WhatsAppConversationHeaderFactory> {
18
+ /** Conversation being shown. */
19
+ conversation?: WhatsAppConversationSummary;
20
+ /**
21
+ * Renders the back control, used by the narrow layout and by the drawer.
22
+ * @default false
23
+ */
24
+ withBack?: boolean;
25
+ /**
26
+ * Renders the control that toggles the contact panel.
27
+ * @default false
28
+ */
29
+ withContactToggle?: boolean;
30
+ /** Whether the contact panel is open, used for the toggle aria-expanded state. */
31
+ contactPanelOpened?: boolean;
32
+ /**
33
+ * Text under the contact name. Falls back to the phone number, which is what makes two
34
+ * contacts with the same name distinguishable.
35
+ */
36
+ subtitle?: string;
37
+ /** Label overrides. */
38
+ labels?: WhatsAppInboxLabelsOverride;
39
+ }
40
+ export interface WhatsAppConversationHeaderProps extends Omit<BoxProps, keyof WhatsAppConversationHeaderOwnProps>, WhatsAppConversationHeaderOwnProps {
41
+ }
42
+ export interface WhatsAppConversationHeaderEmits {
43
+ /** Emitted when the back control is used. */
44
+ back: [];
45
+ /** Emitted when the contact panel toggle is used, with the state it should move to. */
46
+ toggleContactPanel: [opened: boolean];
47
+ /** Emitted when the contact name or avatar is activated. */
48
+ contactClick: [conversation: WhatsAppConversationSummary];
49
+ }
50
+ export type WhatsAppConversationHeaderFactory = Factory<{
51
+ props: Omit<WhatsAppConversationHeaderProps, 'rootRef'>;
52
+ slots: WhatsAppConversationHeaderSlots;
53
+ emits: WhatsAppConversationHeaderEmits;
54
+ ref: HTMLElement;
55
+ element: 'header';
56
+ stylesNames: WhatsAppConversationHeaderStylesNames;
57
+ }>;
@@ -0,0 +1,23 @@
1
+ import type { WhatsAppConversationHeaderOwnProps, WhatsAppConversationHeaderSlots } from './WhatsAppConversationHeader.types';
2
+ declare const defaultProps: {
3
+ readonly withBack: false;
4
+ readonly withContactToggle: false;
5
+ readonly contactPanelOpened: false;
6
+ };
7
+ export { defaultProps };
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
10
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<WhatsAppConversationHeaderOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ back: () => any;
12
+ toggleContactPanel: (opened: boolean) => any;
13
+ contactClick: (conversation: import("../..").WhatsAppConversationSummary) => any;
14
+ }, string, import("vue").PublicProps, Readonly<WhatsAppConversationHeaderOwnProps> & Readonly<{
15
+ onBack?: (() => any) | undefined;
16
+ onToggleContactPanel?: ((opened: boolean) => any) | undefined;
17
+ onContactClick?: ((conversation: import("../..").WhatsAppConversationSummary) => any) | undefined;
18
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, WhatsAppConversationHeaderSlots>;
19
+ type __VLS_WithSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -0,0 +1 @@
1
+ export * from './WhatsAppConversationHeader';
@@ -0,0 +1,9 @@
1
+ export declare const WhatsAppConversationList: import("@mantine-vue/core").MantineComponent<{
2
+ props: Omit<import("./WhatsAppConversationList.types").WhatsAppConversationListProps, "rootRef">;
3
+ slots: import("../../component-props.js").WhatsAppConversationListSlots;
4
+ emits: import("./WhatsAppConversationList.types").WhatsAppConversationListEmits;
5
+ ref: HTMLDivElement;
6
+ element: "div";
7
+ stylesNames: import("./WhatsAppConversationList.types").WhatsAppConversationListStylesNames;
8
+ }>;
9
+ export type { WhatsAppConversationListEmits, WhatsAppConversationListFactory, WhatsAppConversationListOwnProps, WhatsAppConversationListProps, WhatsAppConversationListStylesNames, WhatsAppConversationOrder, } from './WhatsAppConversationList.types';
@@ -0,0 +1,113 @@
1
+ import type { BoxProps, Factory } from '@mantine-vue/core';
2
+ import type { StylesApiProps } from '@mantine-vue/core/styles-api';
3
+ import type { WhatsAppConversationListSlots } from '../../component-props';
4
+ import type { WhatsAppInboxLabelsOverride } from '../../labels';
5
+ import type { WhatsAppConversationSummary, WhatsAppInboxFilters, WhatsAppInboxFiltersConfig, WhatsAppLoadMorePayload, WhatsAppNewConversationPayload, WhatsAppPaginationState } from '../../types';
6
+ import type { WhatsAppConversationListItemStylesNames } from '../WhatsAppConversationListItem';
7
+ export type WhatsAppConversationListStylesNames = 'conversationListRoot' | 'conversationListHeader' | 'conversationListTitleRow' | 'conversationListTitle' | 'conversationListNewButton' | 'newConversationForm' | 'newConversationActions' | 'conversationListSearch' | 'conversationListFilters' | 'conversationListScrollArea' | 'conversationListItems' | 'conversationListItemWrapper' | 'conversationListState' | 'conversationListLoadMore' | 'conversationListFooter' | WhatsAppConversationListItemStylesNames;
8
+ /**
9
+ * Order the list renders conversations in.
10
+ *
11
+ * `none` keeps the array exactly as supplied, which is the default: a backend that already
12
+ * sorted by relevance, priority or a custom queue must not be silently reordered by the UI.
13
+ */
14
+ export type WhatsAppConversationOrder = 'none' | 'activity';
15
+ export interface WhatsAppConversationListOwnProps extends StylesApiProps<WhatsAppConversationListFactory> {
16
+ /** Conversations to render. */
17
+ conversations?: WhatsAppConversationSummary[];
18
+ /** Controlled id of the selected conversation. */
19
+ selectedConversationId?: string | null;
20
+ /** Uncontrolled initial selection. */
21
+ defaultSelectedConversationId?: string | null;
22
+ /** Controlled filter state. */
23
+ filters?: WhatsAppInboxFilters;
24
+ /** Uncontrolled initial filter state. */
25
+ defaultFilters?: WhatsAppInboxFilters;
26
+ /**
27
+ * Which filter controls are rendered. Controls whose options are not supplied stay hidden, so
28
+ * a backend that cannot answer a filter never shows it.
29
+ */
30
+ filtersConfig?: WhatsAppInboxFiltersConfig;
31
+ /** Whether the initial load is in flight. */
32
+ loading?: boolean;
33
+ /** Failure of the last load. Renders the error state with a retry action. */
34
+ error?: string | null;
35
+ /** Cursor state of the pagination. */
36
+ pagination?: WhatsAppPaginationState;
37
+ /**
38
+ * Display order of the supplied array.
39
+ * @default 'none'
40
+ */
41
+ order?: WhatsAppConversationOrder;
42
+ /**
43
+ * Renders the title and the filter controls.
44
+ * @default true
45
+ */
46
+ withHeader?: boolean;
47
+ /**
48
+ * Emits `loadMore` when the user scrolls near the end of the list. Turn it off to rely on the
49
+ * explicit load-more control alone.
50
+ * @default true
51
+ */
52
+ withInfiniteScroll?: boolean;
53
+ /**
54
+ * Distance in pixels from the end at which `loadMore` is emitted.
55
+ * @default 160
56
+ */
57
+ loadMoreThreshold?: number;
58
+ /** Title rendered above the search field. Falls back to the label. */
59
+ title?: string;
60
+ /**
61
+ * Renders the control that starts a conversation with a number that is not in the list yet.
62
+ * @default false
63
+ */
64
+ withNewConversation?: boolean;
65
+ /** Controlled opened state of the new-conversation form. */
66
+ newConversationOpened?: boolean;
67
+ /** Whether the consumer is still creating or looking up the conversation. */
68
+ newConversationCreating?: boolean;
69
+ /**
70
+ * Failure of the last attempt, rendered inside the form. Use it for backend rules the
71
+ * frontend cannot check, such as an opt-in that is missing.
72
+ */
73
+ newConversationError?: string | null;
74
+ /**
75
+ * Validates the phone number before `newConversation` is emitted. Return an error message to
76
+ * reject it, or `null` to accept.
77
+ *
78
+ * Defaults to a permissive digit-count check: the authoritative rules belong to the provider,
79
+ * and a frontend that guessed at national formats would reject numbers the backend accepts.
80
+ */
81
+ validatePhoneNumber?: (phoneNumber: string) => string | null;
82
+ /** Label overrides. */
83
+ labels?: WhatsAppInboxLabelsOverride;
84
+ }
85
+ export interface WhatsAppConversationListProps extends Omit<BoxProps, keyof WhatsAppConversationListOwnProps>, WhatsAppConversationListOwnProps {
86
+ }
87
+ export interface WhatsAppConversationListEmits {
88
+ /** Emitted when the selected conversation changes. */
89
+ 'update:selectedConversationId': [conversationId: string | null];
90
+ /** Emitted when any filter changes. */
91
+ 'update:filters': [filters: WhatsAppInboxFilters];
92
+ /** Emitted when a conversation is picked, with the full record. */
93
+ select: [conversation: WhatsAppConversationSummary];
94
+ /** Emitted when the next page should be fetched. */
95
+ loadMore: [payload: WhatsAppLoadMorePayload];
96
+ /** Emitted when the retry action of the error state is used. */
97
+ retryLoad: [];
98
+ /** Emitted when the opened state of the new-conversation form changes. */
99
+ 'update:newConversationOpened': [opened: boolean];
100
+ /**
101
+ * Emitted when the user submits a phone number to start a conversation with. Create or look up
102
+ * the conversation, then select it by updating `selectedConversationId`.
103
+ */
104
+ newConversation: [payload: WhatsAppNewConversationPayload];
105
+ }
106
+ export type WhatsAppConversationListFactory = Factory<{
107
+ props: Omit<WhatsAppConversationListProps, 'rootRef'>;
108
+ slots: WhatsAppConversationListSlots;
109
+ emits: WhatsAppConversationListEmits;
110
+ ref: HTMLDivElement;
111
+ element: 'div';
112
+ stylesNames: WhatsAppConversationListStylesNames;
113
+ }>;
@@ -0,0 +1,35 @@
1
+ import type { WhatsAppConversationListSlots } from '../../component-props';
2
+ import type { WhatsAppConversationSummary, WhatsAppInboxFilters } from '../../types';
3
+ import type { WhatsAppConversationListOwnProps } from './WhatsAppConversationList.types';
4
+ declare const defaultProps: {
5
+ readonly order: "none";
6
+ readonly withHeader: true;
7
+ readonly withInfiniteScroll: true;
8
+ readonly withNewConversation: false;
9
+ readonly loadMoreThreshold: 160;
10
+ };
11
+ export { defaultProps };
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
14
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<WhatsAppConversationListOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ select: (conversation: WhatsAppConversationSummary) => any;
16
+ newConversation: (payload: import("../..").WhatsAppNewConversationPayload) => any;
17
+ retryLoad: () => any;
18
+ "update:selectedConversationId": (conversationId: string | null) => any;
19
+ "update:filters": (filters: WhatsAppInboxFilters) => any;
20
+ loadMore: (payload: import("../..").WhatsAppLoadMorePayload) => any;
21
+ "update:newConversationOpened": (opened: boolean) => any;
22
+ }, string, import("vue").PublicProps, Readonly<WhatsAppConversationListOwnProps> & Readonly<{
23
+ onSelect?: ((conversation: WhatsAppConversationSummary) => any) | undefined;
24
+ onNewConversation?: ((payload: import("../..").WhatsAppNewConversationPayload) => any) | undefined;
25
+ onRetryLoad?: (() => any) | undefined;
26
+ "onUpdate:selectedConversationId"?: ((conversationId: string | null) => any) | undefined;
27
+ "onUpdate:filters"?: ((filters: WhatsAppInboxFilters) => any) | undefined;
28
+ onLoadMore?: ((payload: import("../..").WhatsAppLoadMorePayload) => any) | undefined;
29
+ "onUpdate:newConversationOpened"?: ((opened: boolean) => any) | undefined;
30
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, WhatsAppConversationListSlots>;
31
+ type __VLS_WithSlots<T, S> = T & {
32
+ new (): {
33
+ $slots: S;
34
+ };
35
+ };
@@ -0,0 +1 @@
1
+ export * from './WhatsAppConversationList';
@@ -0,0 +1,9 @@
1
+ export declare const WhatsAppConversationListItem: import("@mantine-vue/core").MantineComponent<{
2
+ props: Omit<import("./WhatsAppConversationListItem.types").WhatsAppConversationListItemProps, "rootRef">;
3
+ slots: import("./WhatsAppConversationListItem.types").WhatsAppConversationListItemSlots;
4
+ emits: import("./WhatsAppConversationListItem.types").WhatsAppConversationListItemEmits;
5
+ ref: HTMLButtonElement;
6
+ element: "button";
7
+ stylesNames: import("./WhatsAppConversationListItem.types").WhatsAppConversationListItemStylesNames;
8
+ }>;
9
+ export type { WhatsAppConversationListItemEmits, WhatsAppConversationListItemFactory, WhatsAppConversationListItemOwnProps, WhatsAppConversationListItemProps, WhatsAppConversationListItemSlots, WhatsAppConversationListItemStylesNames, } from './WhatsAppConversationListItem.types';
@@ -0,0 +1,56 @@
1
+ import type { VNodeChild } from 'vue';
2
+ import type { BoxProps, Factory } from '@mantine-vue/core';
3
+ import type { StylesApiProps } from '@mantine-vue/core/styles-api';
4
+ import type { WhatsAppConversationItemSlotProps } from '../../component-props';
5
+ import type { WhatsAppInboxLabelsOverride } from '../../labels';
6
+ import type { WhatsAppConversationSummary } from '../../types';
7
+ import type { WhatsAppMessageStatusStylesNames } from '../WhatsAppMessageStatus';
8
+ export type WhatsAppConversationListItemStylesNames = 'conversationItemRoot' | 'conversationItemAvatar' | 'conversationItemBody' | 'conversationItemTopRow' | 'conversationItemName' | 'conversationItemTime' | 'conversationItemBottomRow' | 'conversationItemPreview' | 'conversationItemPreviewText' | 'conversationItemIndicators' | 'conversationItemUnread' | 'conversationItemLabels' | 'conversationItemPhone' | WhatsAppMessageStatusStylesNames;
9
+ export interface WhatsAppConversationListItemSlots {
10
+ /** Replaces the avatar. */
11
+ conversationAvatar?: (props: WhatsAppConversationItemSlotProps) => VNodeChild;
12
+ /** Replaces the last-message preview line. */
13
+ conversationPreview?: (props: WhatsAppConversationItemSlotProps) => VNodeChild;
14
+ }
15
+ export interface WhatsAppConversationListItemOwnProps extends StylesApiProps<WhatsAppConversationListItemFactory> {
16
+ /** Conversation to render. */
17
+ conversation: WhatsAppConversationSummary;
18
+ /** Whether the conversation is the selected one. */
19
+ selected?: boolean;
20
+ /**
21
+ * Renders the unread badge when `unreadCount` is above zero.
22
+ * @default true
23
+ */
24
+ withUnreadBadge?: boolean;
25
+ /**
26
+ * Renders the delivery state of the last outbound message before the preview text.
27
+ * @default true
28
+ */
29
+ withStatus?: boolean;
30
+ /**
31
+ * Renders the phone number under the contact name.
32
+ * @default true
33
+ */
34
+ withPhoneNumber?: boolean;
35
+ /**
36
+ * Renders the conversation labels as badges.
37
+ * @default true
38
+ */
39
+ withLabels?: boolean;
40
+ /** Label overrides. */
41
+ labels?: WhatsAppInboxLabelsOverride;
42
+ }
43
+ export interface WhatsAppConversationListItemProps extends Omit<BoxProps, keyof WhatsAppConversationListItemOwnProps>, WhatsAppConversationListItemOwnProps {
44
+ }
45
+ export interface WhatsAppConversationListItemEmits {
46
+ /** Emitted when the item is activated by click or keyboard. */
47
+ select: [conversation: WhatsAppConversationSummary];
48
+ }
49
+ export type WhatsAppConversationListItemFactory = Factory<{
50
+ props: Omit<WhatsAppConversationListItemProps, 'rootRef'>;
51
+ slots: WhatsAppConversationListItemSlots;
52
+ emits: WhatsAppConversationListItemEmits;
53
+ ref: HTMLButtonElement;
54
+ element: 'button';
55
+ stylesNames: WhatsAppConversationListItemStylesNames;
56
+ }>;
@@ -0,0 +1,21 @@
1
+ import type { WhatsAppConversationListItemOwnProps, WhatsAppConversationListItemSlots } from './WhatsAppConversationListItem.types';
2
+ declare const defaultProps: {
3
+ readonly selected: false;
4
+ readonly withUnreadBadge: true;
5
+ readonly withStatus: true;
6
+ readonly withPhoneNumber: true;
7
+ readonly withLabels: true;
8
+ };
9
+ export { defaultProps };
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
12
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<WhatsAppConversationListItemOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ select: (conversation: import("../..").WhatsAppConversationSummary) => any;
14
+ }, string, import("vue").PublicProps, Readonly<WhatsAppConversationListItemOwnProps> & Readonly<{
15
+ onSelect?: ((conversation: import("../..").WhatsAppConversationSummary) => any) | undefined;
16
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, WhatsAppConversationListItemSlots>;
17
+ type __VLS_WithSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
@@ -0,0 +1 @@
1
+ export * from './WhatsAppConversationListItem';
@@ -0,0 +1,9 @@
1
+ export declare const WhatsAppEmojiPicker: import("@mantine-vue/core").MantineComponent<{
2
+ props: Omit<import("./WhatsAppEmojiPicker.types").WhatsAppEmojiPickerProps, "rootRef">;
3
+ slots: import("./WhatsAppEmojiPicker.types").WhatsAppEmojiPickerSlots;
4
+ emits: import("./WhatsAppEmojiPicker.types").WhatsAppEmojiPickerEmits;
5
+ ref: HTMLDivElement;
6
+ element: "div";
7
+ stylesNames: import("./WhatsAppEmojiPicker.types").WhatsAppEmojiPickerStylesNames;
8
+ }>;
9
+ export type { WhatsAppEmojiPickerEmits, WhatsAppEmojiPickerFactory, WhatsAppEmojiPickerOwnProps, WhatsAppEmojiPickerProps, WhatsAppEmojiPickerSlots, WhatsAppEmojiPickerStylesNames, } from './WhatsAppEmojiPicker.types';