@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,49 @@
1
+ import type { BoxProps, Factory } from '@mantine-vue/core';
2
+ import type { StylesApiProps } from '@mantine-vue/core/styles-api';
3
+ import type { WhatsAppInboxLabelsOverride } from '../../labels';
4
+ import type { WhatsAppInteractiveContent, WhatsAppInteractiveType } from '../../types';
5
+ export type WhatsAppInteractiveMessageEditorStylesNames = 'interactiveEditorRoot' | 'interactiveEditorSection' | 'interactiveEditorSectionTitle' | 'interactiveEditorRow' | 'interactiveEditorItem' | 'interactiveEditorFooter';
6
+ export interface WhatsAppInteractiveMessageEditorOwnProps extends StylesApiProps<WhatsAppInteractiveMessageEditorFactory> {
7
+ /** Controlled draft. Always a well-formed `WhatsAppInteractiveContent`. */
8
+ modelValue?: WhatsAppInteractiveContent;
9
+ /** Uncontrolled initial draft. */
10
+ defaultValue?: WhatsAppInteractiveContent;
11
+ /**
12
+ * Interactive types the provider supports, from the conversation capabilities. The type
13
+ * selector is hidden when only one is available, and the editor renders nothing when the
14
+ * list is empty.
15
+ * @default ['button']
16
+ */
17
+ interactiveTypes?: WhatsAppInteractiveType[];
18
+ /**
19
+ * Largest number of reply buttons a message may carry.
20
+ * @default 3
21
+ */
22
+ maxButtons?: number;
23
+ /**
24
+ * Largest number of rows a list section may carry.
25
+ * @default 10
26
+ */
27
+ maxRowsPerSection?: number;
28
+ /** Disables every control. */
29
+ disabled?: boolean;
30
+ /** Label overrides. */
31
+ labels?: WhatsAppInboxLabelsOverride;
32
+ }
33
+ export interface WhatsAppInteractiveMessageEditorProps extends Omit<BoxProps, keyof WhatsAppInteractiveMessageEditorOwnProps>, WhatsAppInteractiveMessageEditorOwnProps {
34
+ }
35
+ export interface WhatsAppInteractiveMessageEditorEmits {
36
+ /** Emitted whenever the draft changes. */
37
+ 'update:modelValue': [value: WhatsAppInteractiveContent];
38
+ /** Emitted when the draft passes validation and should be sent. */
39
+ submit: [value: WhatsAppInteractiveContent];
40
+ /** Emitted when the cancel action is used. */
41
+ cancel: [];
42
+ }
43
+ export type WhatsAppInteractiveMessageEditorFactory = Factory<{
44
+ props: Omit<WhatsAppInteractiveMessageEditorProps, 'rootRef'>;
45
+ emits: WhatsAppInteractiveMessageEditorEmits;
46
+ ref: HTMLDivElement;
47
+ element: 'div';
48
+ stylesNames: WhatsAppInteractiveMessageEditorStylesNames;
49
+ }>;
@@ -0,0 +1,27 @@
1
+ import type { WhatsAppInteractiveMessageEditorOwnProps } from './WhatsAppInteractiveMessageEditor.types';
2
+ import type { WhatsAppInteractiveContent, WhatsAppInteractiveType } from '../../types';
3
+ declare const defaultProps: {
4
+ readonly maxButtons: 3;
5
+ readonly maxRowsPerSection: 10;
6
+ readonly disabled: false;
7
+ };
8
+ /**
9
+ * A fresh, well-formed draft of the given type.
10
+ *
11
+ * The draft is always a valid `WhatsAppInteractiveContent`, never a loose bag of fields: the
12
+ * `v-model` a consumer binds is the same discriminated union the message would be sent with, so
13
+ * there is nothing to translate on submit.
14
+ */
15
+ declare function createInteractiveDraft(type: WhatsAppInteractiveType, previous?: WhatsAppInteractiveContent): WhatsAppInteractiveContent;
16
+ export { createInteractiveDraft, defaultProps };
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;
19
+ declare const __VLS_export: import("vue").DefineComponent<WhatsAppInteractiveMessageEditorOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ cancel: () => any;
21
+ submit: (value: WhatsAppInteractiveContent) => any;
22
+ "update:modelValue": (value: WhatsAppInteractiveContent) => any;
23
+ }, string, import("vue").PublicProps, Readonly<WhatsAppInteractiveMessageEditorOwnProps> & Readonly<{
24
+ onCancel?: (() => any) | undefined;
25
+ onSubmit?: ((value: WhatsAppInteractiveContent) => any) | undefined;
26
+ "onUpdate:modelValue"?: ((value: WhatsAppInteractiveContent) => any) | undefined;
27
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1 @@
1
+ export * from './WhatsAppInteractiveMessageEditor';
@@ -0,0 +1,8 @@
1
+ export declare const WhatsAppMediaAttachment: import("@mantine-vue/core").MantineComponent<{
2
+ props: Omit<import("./WhatsAppMediaAttachment.types").WhatsAppMediaAttachmentProps, "rootRef">;
3
+ emits: import("./WhatsAppMediaAttachment.types").WhatsAppMediaAttachmentEmits;
4
+ ref: HTMLDivElement;
5
+ element: "div";
6
+ stylesNames: import("./WhatsAppMediaAttachment.types").WhatsAppMediaAttachmentStylesNames;
7
+ }>;
8
+ export type { WhatsAppMediaAttachmentEmits, WhatsAppMediaAttachmentFactory, WhatsAppMediaAttachmentOwnProps, WhatsAppMediaAttachmentProps, WhatsAppMediaAttachmentStylesNames, } from './WhatsAppMediaAttachment.types';
@@ -0,0 +1,41 @@
1
+ import type { BoxProps, Factory } from '@mantine-vue/core';
2
+ import type { StylesApiProps } from '@mantine-vue/core/styles-api';
3
+ import type { WhatsAppInboxLabelsOverride } from '../../labels';
4
+ import type { WhatsAppAttachment, WhatsAppMessageDirection } from '../../types';
5
+ export type WhatsAppMediaAttachmentStylesNames = 'mediaRoot' | 'mediaImage' | 'mediaVideo' | 'mediaAudio' | 'mediaImageControl' | 'mediaDocument' | 'mediaDocumentIcon' | 'mediaDocumentBody' | 'mediaDocumentName' | 'mediaDocumentMeta' | 'mediaAction' | 'mediaFallback';
6
+ export interface WhatsAppMediaAttachmentOwnProps extends StylesApiProps<WhatsAppMediaAttachmentFactory> {
7
+ /** Attachment to render. `mediaType` picks the renderer. */
8
+ attachment: WhatsAppAttachment;
9
+ /** Direction of the message the attachment belongs to, used for the document styling. */
10
+ direction?: WhatsAppMessageDirection;
11
+ /**
12
+ * Whether the download action is rendered for documents and media.
13
+ * @default true
14
+ */
15
+ withDownload?: boolean;
16
+ /**
17
+ * Whether images and videos render their own player or preview.
18
+ * Turn this off to render a compact document-style row for every media type.
19
+ * @default true
20
+ */
21
+ withPreview?: boolean;
22
+ /** Largest width of an image or video, any valid CSS length. */
23
+ maxWidth?: string | number;
24
+ /** Label overrides. */
25
+ labels?: WhatsAppInboxLabelsOverride;
26
+ }
27
+ export interface WhatsAppMediaAttachmentProps extends Omit<BoxProps, keyof WhatsAppMediaAttachmentOwnProps>, WhatsAppMediaAttachmentOwnProps {
28
+ }
29
+ export interface WhatsAppMediaAttachmentEmits {
30
+ /** Emitted when the download action is used. The default link behaviour still runs. */
31
+ download: [attachment: WhatsAppAttachment];
32
+ /** Emitted when an image or a sticker is activated, for consumers with a lightbox. */
33
+ preview: [attachment: WhatsAppAttachment];
34
+ }
35
+ export type WhatsAppMediaAttachmentFactory = Factory<{
36
+ props: Omit<WhatsAppMediaAttachmentProps, 'rootRef'>;
37
+ emits: WhatsAppMediaAttachmentEmits;
38
+ ref: HTMLDivElement;
39
+ element: 'div';
40
+ stylesNames: WhatsAppMediaAttachmentStylesNames;
41
+ }>;
@@ -0,0 +1,19 @@
1
+ import type { WhatsAppMediaAttachmentOwnProps } from './WhatsAppMediaAttachment.types';
2
+ import type { WhatsAppIconName } from '../../icons';
3
+ import type { WhatsAppMediaType } from '../../types';
4
+ declare const defaultProps: {
5
+ readonly withDownload: true;
6
+ readonly withPreview: true;
7
+ };
8
+ declare const MEDIA_ICONS: Record<WhatsAppMediaType, WhatsAppIconName>;
9
+ declare const varsResolver: (theme: import("@mantine-vue/core").MantineTheme, props: any, ctx: Record<string, any>) => Record<string, Record<string, string | undefined>>;
10
+ export { defaultProps, MEDIA_ICONS, varsResolver };
11
+ declare const _default: typeof __VLS_export;
12
+ export default _default;
13
+ declare const __VLS_export: import("vue").DefineComponent<WhatsAppMediaAttachmentOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ preview: (attachment: import("../..").WhatsAppAttachment) => any;
15
+ download: (attachment: import("../..").WhatsAppAttachment) => any;
16
+ }, string, import("vue").PublicProps, Readonly<WhatsAppMediaAttachmentOwnProps> & Readonly<{
17
+ onPreview?: ((attachment: import("../..").WhatsAppAttachment) => any) | undefined;
18
+ onDownload?: ((attachment: import("../..").WhatsAppAttachment) => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1 @@
1
+ export * from './WhatsAppMediaAttachment';
@@ -0,0 +1,9 @@
1
+ export declare const WhatsAppMessage: import("@mantine-vue/core").MantineComponent<{
2
+ props: Omit<import("./WhatsAppMessage.types").WhatsAppMessageProps, "rootRef">;
3
+ slots: import("../../component-props.js").WhatsAppMessageSlots;
4
+ emits: import("./WhatsAppMessage.types").WhatsAppMessageEmits;
5
+ ref: HTMLDivElement;
6
+ element: "div";
7
+ stylesNames: import("./WhatsAppMessage.types").WhatsAppMessageStylesNames;
8
+ }>;
9
+ export type { WhatsAppMessageEmits, WhatsAppMessageFactory, WhatsAppMessageOwnProps, WhatsAppMessageProps, WhatsAppMessageStylesNames, } from './WhatsAppMessage.types';
@@ -0,0 +1,46 @@
1
+ import type { BoxProps, Factory } from '@mantine-vue/core';
2
+ import type { StylesApiProps } from '@mantine-vue/core/styles-api';
3
+ import type { MessageRenderers, WhatsAppMessageSlots } from '../../component-props';
4
+ import type { WhatsAppInboxLabelsOverride } from '../../labels';
5
+ import type { WhatsAppAttachment, WhatsAppMessageData } from '../../types';
6
+ import type { WhatsAppMediaAttachmentStylesNames } from '../WhatsAppMediaAttachment';
7
+ import type { WhatsAppMessageBubbleStylesNames } from '../WhatsAppMessageBubble';
8
+ import type { WhatsAppTemplatePreviewStylesNames } from '../WhatsAppTemplatePreview';
9
+ export type WhatsAppMessageStylesNames = 'messageRoot' | 'messageInteractive' | 'messageInteractiveBody' | 'messageInteractiveFooter' | 'messageInteractiveButtons' | 'messageInteractiveButton' | 'messageInteractiveReply' | 'messageCaption' | 'messageLocation' | 'messageLocationName' | 'messageLocationAddress' | 'messageContactCard' | 'messageContactName' | 'messageContactDetail' | 'messageUnsupported' | WhatsAppMessageBubbleStylesNames | WhatsAppMediaAttachmentStylesNames | WhatsAppTemplatePreviewStylesNames;
10
+ export interface WhatsAppMessageOwnProps extends StylesApiProps<WhatsAppMessageFactory>, MessageRenderers {
11
+ /** Message to render. Its `type` picks the content renderer. */
12
+ message: WhatsAppMessageData;
13
+ /**
14
+ * Whether a failed message offers a retry action. Comes from the conversation capabilities
15
+ * when the message is rendered inside a `WhatsAppConversation`.
16
+ * @default true
17
+ */
18
+ withRetry?: boolean;
19
+ /**
20
+ * Draws the bubble tail. Turned off for the middle of a run of messages from the same side.
21
+ * @default true
22
+ */
23
+ withTail?: boolean;
24
+ /** Largest width of the bubble, any valid CSS length. */
25
+ maxWidth?: string | number;
26
+ /** Label overrides. */
27
+ labels?: WhatsAppInboxLabelsOverride;
28
+ }
29
+ export interface WhatsAppMessageProps extends Omit<BoxProps, keyof WhatsAppMessageOwnProps>, WhatsAppMessageOwnProps {
30
+ }
31
+ export interface WhatsAppMessageEmits {
32
+ /** Emitted when the retry action of a failed message is used. */
33
+ retry: [message: WhatsAppMessageData];
34
+ /** Emitted when the download action of an attachment is used. */
35
+ mediaDownload: [attachment: WhatsAppAttachment, message: WhatsAppMessageData];
36
+ /** Emitted when an image or sticker is activated, for consumers with a lightbox. */
37
+ mediaPreview: [attachment: WhatsAppAttachment, message: WhatsAppMessageData];
38
+ }
39
+ export type WhatsAppMessageFactory = Factory<{
40
+ props: Omit<WhatsAppMessageProps, 'rootRef'>;
41
+ slots: WhatsAppMessageSlots;
42
+ emits: WhatsAppMessageEmits;
43
+ ref: HTMLDivElement;
44
+ element: 'div';
45
+ stylesNames: WhatsAppMessageStylesNames;
46
+ }>;
@@ -0,0 +1,25 @@
1
+ import type { WhatsAppMessageSlots } from '../../component-props';
2
+ import type { WhatsAppAttachment } from '../../types';
3
+ import type { WhatsAppMessageOwnProps } from './WhatsAppMessage.types';
4
+ declare const defaultProps: {
5
+ readonly withRetry: true;
6
+ readonly withTail: true;
7
+ };
8
+ declare const MEDIA_TYPES: readonly ["image", "video", "audio", "document", "sticker"];
9
+ export { defaultProps, MEDIA_TYPES };
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
12
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<WhatsAppMessageOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ retry: (message: import("../..").WhatsAppMessageData) => any;
14
+ mediaDownload: (attachment: WhatsAppAttachment, message: import("../..").WhatsAppMessageData) => any;
15
+ mediaPreview: (attachment: WhatsAppAttachment, message: import("../..").WhatsAppMessageData) => any;
16
+ }, string, import("vue").PublicProps, Readonly<WhatsAppMessageOwnProps> & Readonly<{
17
+ onRetry?: ((message: import("../..").WhatsAppMessageData) => any) | undefined;
18
+ onMediaDownload?: ((attachment: WhatsAppAttachment, message: import("../..").WhatsAppMessageData) => any) | undefined;
19
+ onMediaPreview?: ((attachment: WhatsAppAttachment, message: import("../..").WhatsAppMessageData) => any) | undefined;
20
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, WhatsAppMessageSlots>;
21
+ type __VLS_WithSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -0,0 +1 @@
1
+ export * from './WhatsAppMessage';
@@ -0,0 +1,9 @@
1
+ export declare const WhatsAppMessageBubble: import("@mantine-vue/core").MantineComponent<{
2
+ props: Omit<import("./WhatsAppMessageBubble.types").WhatsAppMessageBubbleProps, "rootRef">;
3
+ slots: import("./WhatsAppMessageBubble.types").WhatsAppMessageBubbleSlots;
4
+ emits: import("./WhatsAppMessageBubble.types").WhatsAppMessageBubbleEmits;
5
+ ref: HTMLDivElement;
6
+ element: "div";
7
+ stylesNames: import("./WhatsAppMessageBubble.types").WhatsAppMessageBubbleStylesNames;
8
+ }>;
9
+ export type { WhatsAppMessageBubbleEmits, WhatsAppMessageBubbleFactory, WhatsAppMessageBubbleOwnProps, WhatsAppMessageBubbleProps, WhatsAppMessageBubbleSlots, WhatsAppMessageBubbleStylesNames, WhatsAppMessageBubbleVariant, } from './WhatsAppMessageBubble.types';
@@ -0,0 +1,77 @@
1
+ import type { VNodeChild } from 'vue';
2
+ import type { BoxProps, Factory, MantineRadius } from '@mantine-vue/core';
3
+ import type { StylesApiProps } from '@mantine-vue/core/styles-api';
4
+ import type { WhatsAppInboxLabelsOverride } from '../../labels';
5
+ import type { WhatsAppMessageAuthor, WhatsAppMessageDirection, WhatsAppMessageError, WhatsAppMessageReference, WhatsAppDeliveryStatus, WhatsAppReaction, WhatsAppTimestamp } from '../../types';
6
+ export type WhatsAppMessageBubbleStylesNames = 'bubbleRoot' | 'bubble' | 'bubbleAuthor' | 'bubbleQuote' | 'bubbleQuoteAuthor' | 'bubbleQuoteText' | 'bubbleForwarded' | 'bubbleContent' | 'bubbleFooter' | 'bubbleTime' | 'bubbleStatus' | 'bubbleError' | 'bubbleErrorText' | 'bubbleRetry' | 'bubbleReactions' | 'bubbleReaction' | 'systemMessage';
7
+ /** How the bubble is laid out. `system` renders centred text without a bubble. */
8
+ export type WhatsAppMessageBubbleVariant = 'bubble' | 'system';
9
+ export interface WhatsAppMessageBubbleOwnProps extends StylesApiProps<WhatsAppMessageBubbleFactory> {
10
+ /** Side the bubble is aligned to and colour it uses. */
11
+ direction: WhatsAppMessageDirection;
12
+ /**
13
+ * Layout of the bubble.
14
+ * @default 'bubble'
15
+ */
16
+ variant?: WhatsAppMessageBubbleVariant;
17
+ /** Delivery state rendered in the footer. */
18
+ status?: WhatsAppDeliveryStatus;
19
+ /** Time rendered in the footer. */
20
+ timestamp?: WhatsAppTimestamp;
21
+ /** Agent who sent the message, rendered above the content in shared inboxes. */
22
+ author?: WhatsAppMessageAuthor;
23
+ /** Quoted message rendered above the content. */
24
+ replyTo?: WhatsAppMessageReference;
25
+ /** Renders the forwarded marker. */
26
+ forwarded?: boolean;
27
+ /** Failure details rendered under the bubble, with a retry action when retryable. */
28
+ error?: WhatsAppMessageError;
29
+ /**
30
+ * Whether the retry action may be rendered at all. Comes from the conversation capabilities.
31
+ * @default true
32
+ */
33
+ withRetry?: boolean;
34
+ /** Reactions rendered under the bubble. */
35
+ reactions?: WhatsAppReaction[];
36
+ /**
37
+ * Draws the small tail on the first bubble of a run.
38
+ * @default true
39
+ */
40
+ withTail?: boolean;
41
+ /**
42
+ * Key of `theme.radius` or any valid CSS value to set `border-radius`.
43
+ * @default 'lg'
44
+ */
45
+ radius?: MantineRadius;
46
+ /**
47
+ * Largest width of the bubble, any valid CSS length.
48
+ * @default '75%'
49
+ */
50
+ maxWidth?: string | number;
51
+ /** Label overrides. */
52
+ labels?: WhatsAppInboxLabelsOverride;
53
+ }
54
+ export interface WhatsAppMessageBubbleProps extends Omit<BoxProps, keyof WhatsAppMessageBubbleOwnProps>, WhatsAppMessageBubbleOwnProps {
55
+ }
56
+ export interface WhatsAppMessageBubbleSlots {
57
+ /** Content of the bubble. */
58
+ default?: () => VNodeChild;
59
+ /** Rendered inside the bubble, between the content and the timestamp row. */
60
+ footer?: () => VNodeChild;
61
+ /** Replaces the quoted message block. */
62
+ quote?: (props: {
63
+ replyTo: WhatsAppMessageReference;
64
+ }) => VNodeChild;
65
+ }
66
+ export interface WhatsAppMessageBubbleEmits {
67
+ /** Emitted when the retry action of a failed message is used. */
68
+ retry: [];
69
+ }
70
+ export type WhatsAppMessageBubbleFactory = Factory<{
71
+ props: Omit<WhatsAppMessageBubbleProps, 'rootRef'>;
72
+ slots: WhatsAppMessageBubbleSlots;
73
+ emits: WhatsAppMessageBubbleEmits;
74
+ ref: HTMLDivElement;
75
+ element: 'div';
76
+ stylesNames: WhatsAppMessageBubbleStylesNames;
77
+ }>;
@@ -0,0 +1,22 @@
1
+ import type { WhatsAppMessageBubbleOwnProps, WhatsAppMessageBubbleSlots } from './WhatsAppMessageBubble.types';
2
+ declare const defaultProps: {
3
+ readonly variant: "bubble";
4
+ readonly withTail: true;
5
+ readonly withRetry: true;
6
+ readonly radius: "lg";
7
+ readonly maxWidth: "75%";
8
+ };
9
+ declare const varsResolver: (theme: import("@mantine-vue/core").MantineTheme, props: any, ctx: Record<string, any>) => Record<string, Record<string, string | undefined>>;
10
+ export { defaultProps, varsResolver };
11
+ declare const _default: typeof __VLS_export;
12
+ export default _default;
13
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<WhatsAppMessageBubbleOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ retry: () => any;
15
+ }, string, import("vue").PublicProps, Readonly<WhatsAppMessageBubbleOwnProps> & Readonly<{
16
+ onRetry?: (() => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, WhatsAppMessageBubbleSlots>;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1 @@
1
+ export * from './WhatsAppMessageBubble';
@@ -0,0 +1,10 @@
1
+ export declare const WhatsAppMessageList: import("@mantine-vue/core").MantineComponent<{
2
+ props: Omit<import("./WhatsAppMessageList.types").WhatsAppMessageListProps, "rootRef">;
3
+ slots: import("./WhatsAppMessageList.types").WhatsAppMessageListSlots;
4
+ emits: import("./WhatsAppMessageList.types").WhatsAppMessageListEmits;
5
+ exposed: import("./WhatsAppMessageList.types").WhatsAppMessageListExposed;
6
+ ref: HTMLDivElement;
7
+ element: "div";
8
+ stylesNames: import("./WhatsAppMessageList.types").WhatsAppMessageListStylesNames;
9
+ }>;
10
+ export type { WhatsAppMessageListEmits, WhatsAppMessageListExposed, WhatsAppMessageListFactory, WhatsAppMessageListOwnProps, WhatsAppMessageListProps, WhatsAppMessageListSlots, WhatsAppMessageListStylesNames, } from './WhatsAppMessageList.types';
@@ -0,0 +1,94 @@
1
+ import type { BoxProps, Factory } from '@mantine-vue/core';
2
+ import type { StylesApiProps } from '@mantine-vue/core/styles-api';
3
+ import type { MessageRenderers, WhatsAppMessageSlots } from '../../component-props';
4
+ import type { WhatsAppInboxLabelsOverride } from '../../labels';
5
+ import type { WhatsAppAttachment, WhatsAppLoadMorePayload, WhatsAppMessageData, WhatsAppPaginationState } from '../../types';
6
+ import type { WhatsAppMessageStylesNames } from '../WhatsAppMessage';
7
+ export type WhatsAppMessageListStylesNames = 'messageListRoot' | 'messageListScrollArea' | 'messageListContent' | 'messageListItems' | 'messageListGroup' | 'messageListGroupItems' | 'messageListItem' | 'messageListDayDivider' | 'messageListDayLabel' | 'messageListLoadOlder' | 'messageListState' | 'messageListScrollToBottom' | WhatsAppMessageStylesNames;
8
+ export interface WhatsAppMessageListSlots extends WhatsAppMessageSlots {
9
+ /** Replaces the empty state. */
10
+ emptyConversation?: () => import('vue').VNodeChild;
11
+ /** Replaces the initial loading state. */
12
+ loadingMessages?: () => import('vue').VNodeChild;
13
+ /** Replaces the error state. */
14
+ errorMessages?: (props: {
15
+ error: string;
16
+ }) => import('vue').VNodeChild;
17
+ }
18
+ export interface WhatsAppMessageListOwnProps extends StylesApiProps<WhatsAppMessageListFactory>, MessageRenderers {
19
+ /** Messages to render, in display order. The list never reorders them. */
20
+ messages?: WhatsAppMessageData[];
21
+ /**
22
+ * Conversation the messages belong to. Changing it resets the scroll position and the
23
+ * pending-messages counter, which is what makes switching conversations feel instant.
24
+ */
25
+ conversationId?: string;
26
+ /** Whether the initial message load is in flight. */
27
+ loading?: boolean;
28
+ /** Failure of the last load. Renders the error state with a retry action. */
29
+ error?: string | null;
30
+ /** Cursor state of the older-messages pagination. */
31
+ pagination?: WhatsAppPaginationState;
32
+ /**
33
+ * Whether failed messages offer a retry action. Falls back to the conversation capabilities.
34
+ */
35
+ withRetry?: boolean;
36
+ /**
37
+ * Renders a date divider before the first message of each day.
38
+ * @default true
39
+ */
40
+ withDayDividers?: boolean;
41
+ /**
42
+ * Scrolls to the newest message when one arrives, but only while the user is already at the
43
+ * bottom. Reading older messages is never interrupted.
44
+ * @default true
45
+ */
46
+ autoScroll?: boolean;
47
+ /**
48
+ * Distance in pixels from the bottom that still counts as "at the bottom".
49
+ * @default 80
50
+ */
51
+ autoScrollThreshold?: number;
52
+ /**
53
+ * Distance in pixels from the top at which `loadOlder` is emitted.
54
+ * @default 120
55
+ */
56
+ loadOlderThreshold?: number;
57
+ /** Largest width of a message bubble, any valid CSS length. */
58
+ bubbleMaxWidth?: string | number;
59
+ /** Props passed to the viewport element of the underlying `ScrollArea`. */
60
+ viewportProps?: Record<string, any>;
61
+ /** Label overrides. */
62
+ labels?: WhatsAppInboxLabelsOverride;
63
+ }
64
+ export interface WhatsAppMessageListProps extends Omit<BoxProps, keyof WhatsAppMessageListOwnProps>, WhatsAppMessageListOwnProps {
65
+ }
66
+ export interface WhatsAppMessageListEmits {
67
+ /** Emitted when the user scrolls near the top and older messages should be fetched. */
68
+ loadOlder: [payload: WhatsAppLoadMorePayload];
69
+ /** Emitted when the retry action of the error state is used. */
70
+ retryLoad: [];
71
+ /** Emitted when the retry action of a failed message is used. */
72
+ retryMessage: [message: WhatsAppMessageData];
73
+ /** Emitted when the download action of an attachment is used. */
74
+ mediaDownload: [attachment: WhatsAppAttachment, message: WhatsAppMessageData];
75
+ /** Emitted when an image or sticker is activated. */
76
+ mediaPreview: [attachment: WhatsAppAttachment, message: WhatsAppMessageData];
77
+ /** Emitted when the user reaches or leaves the bottom of the history. */
78
+ atBottomChange: [atBottom: boolean];
79
+ }
80
+ export interface WhatsAppMessageListExposed {
81
+ /** Scrolls the history to the newest message. */
82
+ scrollToBottom: (behavior?: ScrollBehavior) => void;
83
+ /** The scrollable viewport, for consumers that plug in their own virtualization. */
84
+ getViewport: () => HTMLElement | null;
85
+ }
86
+ export type WhatsAppMessageListFactory = Factory<{
87
+ props: Omit<WhatsAppMessageListProps, 'rootRef'>;
88
+ slots: WhatsAppMessageListSlots;
89
+ emits: WhatsAppMessageListEmits;
90
+ exposed: WhatsAppMessageListExposed;
91
+ ref: HTMLDivElement;
92
+ element: 'div';
93
+ stylesNames: WhatsAppMessageListStylesNames;
94
+ }>;
@@ -0,0 +1,39 @@
1
+ import type { WhatsAppMessageData } from '../../types';
2
+ import type { WhatsAppMessageListOwnProps, WhatsAppMessageListSlots } from './WhatsAppMessageList.types';
3
+ declare const defaultProps: {
4
+ readonly withDayDividers: true;
5
+ readonly autoScroll: true;
6
+ readonly autoScrollThreshold: 80;
7
+ readonly loadOlderThreshold: 120;
8
+ };
9
+ /**
10
+ * Marks the `ScrollArea` viewport so the list can find it again without depending on Mantine
11
+ * static classes, which a consumer can turn off.
12
+ */
13
+ declare const VIEWPORT_ATTRIBUTE = "data-whatsapp-message-viewport";
14
+ export { defaultProps, VIEWPORT_ATTRIBUTE };
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
17
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<WhatsAppMessageListOwnProps, {
18
+ scrollToBottom: (behavior?: ScrollBehavior) => void;
19
+ getViewport: () => HTMLElement | null;
20
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
+ retryLoad: () => any;
22
+ mediaDownload: (attachment: import("../..").WhatsAppAttachment, message: WhatsAppMessageData) => any;
23
+ mediaPreview: (attachment: import("../..").WhatsAppAttachment, message: WhatsAppMessageData) => any;
24
+ loadOlder: (payload: import("../..").WhatsAppLoadMorePayload) => any;
25
+ retryMessage: (message: WhatsAppMessageData) => any;
26
+ atBottomChange: (atBottom: boolean) => any;
27
+ }, string, import("vue").PublicProps, Readonly<WhatsAppMessageListOwnProps> & Readonly<{
28
+ onRetryLoad?: (() => any) | undefined;
29
+ onMediaDownload?: ((attachment: import("../..").WhatsAppAttachment, message: WhatsAppMessageData) => any) | undefined;
30
+ onMediaPreview?: ((attachment: import("../..").WhatsAppAttachment, message: WhatsAppMessageData) => any) | undefined;
31
+ onLoadOlder?: ((payload: import("../..").WhatsAppLoadMorePayload) => any) | undefined;
32
+ onRetryMessage?: ((message: WhatsAppMessageData) => any) | undefined;
33
+ onAtBottomChange?: ((atBottom: boolean) => any) | undefined;
34
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, WhatsAppMessageListSlots>;
35
+ type __VLS_WithSlots<T, S> = T & {
36
+ new (): {
37
+ $slots: S;
38
+ };
39
+ };
@@ -0,0 +1 @@
1
+ export * from './WhatsAppMessageList';
@@ -0,0 +1,7 @@
1
+ export declare const WhatsAppMessageStatus: import("@mantine-vue/core").MantineComponent<{
2
+ props: Omit<import("./WhatsAppMessageStatus.types").WhatsAppMessageStatusProps, "rootRef">;
3
+ ref: HTMLSpanElement;
4
+ element: "span";
5
+ stylesNames: import("./WhatsAppMessageStatus.types").WhatsAppMessageStatusStylesNames;
6
+ }>;
7
+ export type { WhatsAppMessageStatusFactory, WhatsAppMessageStatusOwnProps, WhatsAppMessageStatusProps, WhatsAppMessageStatusStylesNames, } from './WhatsAppMessageStatus.types';
@@ -0,0 +1,30 @@
1
+ import type { BoxProps, Factory } from '@mantine-vue/core';
2
+ import type { StylesApiProps } from '@mantine-vue/core/styles-api';
3
+ import type { WhatsAppInboxLabelsOverride } from '../../labels';
4
+ import type { WhatsAppDeliveryStatus as WhatsAppMessageStatusValue } from '../../types';
5
+ export type WhatsAppMessageStatusStylesNames = 'statusRoot' | 'statusIcon' | 'statusLabel';
6
+ export interface WhatsAppMessageStatusOwnProps extends StylesApiProps<WhatsAppMessageStatusFactory> {
7
+ /** Delivery state to render. Nothing is rendered when it is not set. */
8
+ status?: WhatsAppMessageStatusValue;
9
+ /**
10
+ * Also renders the state as text next to the icon. The text is always available to screen
11
+ * readers, so this only controls whether it is visible.
12
+ * @default false
13
+ */
14
+ withLabel?: boolean;
15
+ /**
16
+ * Icon size, any valid CSS length.
17
+ * @default '1em'
18
+ */
19
+ size?: string | number;
20
+ /** Label overrides, used for the state names. */
21
+ labels?: WhatsAppInboxLabelsOverride;
22
+ }
23
+ export interface WhatsAppMessageStatusProps extends Omit<BoxProps, keyof WhatsAppMessageStatusOwnProps>, WhatsAppMessageStatusOwnProps {
24
+ }
25
+ export type WhatsAppMessageStatusFactory = Factory<{
26
+ props: Omit<WhatsAppMessageStatusProps, 'rootRef'>;
27
+ ref: HTMLSpanElement;
28
+ element: 'span';
29
+ stylesNames: WhatsAppMessageStatusStylesNames;
30
+ }>;
@@ -0,0 +1,24 @@
1
+ import type { WhatsAppMessageStatusOwnProps } from './WhatsAppMessageStatus.types';
2
+ import type { WhatsAppIconName } from '../../icons';
3
+ import type { WhatsAppDeliveryStatus as WhatsAppMessageStatusValue } from '../../types';
4
+ declare const defaultProps: {
5
+ readonly withLabel: false;
6
+ readonly size: "1em";
7
+ };
8
+ /**
9
+ * Each state gets its own glyph, not only its own colour: WhatsApp's own single/double tick
10
+ * distinction is the accessible part of the indicator, and the blue of `read` is decoration on
11
+ * top of it.
12
+ */
13
+ declare const STATUS_ICONS: Record<WhatsAppMessageStatusValue, WhatsAppIconName>;
14
+ declare const STATUS_LABEL_KEYS: {
15
+ readonly pending: "statusPending";
16
+ readonly sent: "statusSent";
17
+ readonly delivered: "statusDelivered";
18
+ readonly read: "statusRead";
19
+ readonly failed: "statusFailed";
20
+ };
21
+ export { defaultProps, STATUS_ICONS, STATUS_LABEL_KEYS };
22
+ declare const _default: typeof __VLS_export;
23
+ export default _default;
24
+ declare const __VLS_export: import("vue").DefineComponent<WhatsAppMessageStatusOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<WhatsAppMessageStatusOwnProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1 @@
1
+ export * from './WhatsAppMessageStatus';
@@ -0,0 +1,9 @@
1
+ export declare const WhatsAppMessagingWindowNotice: import("@mantine-vue/core").MantineComponent<{
2
+ props: Omit<import("./WhatsAppMessagingWindowNotice.types").WhatsAppMessagingWindowNoticeProps, "rootRef">;
3
+ slots: import("./WhatsAppMessagingWindowNotice.types").WhatsAppMessagingWindowNoticeSlots;
4
+ emits: import("./WhatsAppMessagingWindowNotice.types").WhatsAppMessagingWindowNoticeEmits;
5
+ ref: HTMLDivElement;
6
+ element: "div";
7
+ stylesNames: import("./WhatsAppMessagingWindowNotice.types").WhatsAppMessagingWindowNoticeStylesNames;
8
+ }>;
9
+ export type { WhatsAppMessagingWindowNoticeEmits, WhatsAppMessagingWindowNoticeFactory, WhatsAppMessagingWindowNoticeOwnProps, WhatsAppMessagingWindowNoticeProps, WhatsAppMessagingWindowNoticeSlots, WhatsAppMessagingWindowNoticeStylesNames, } from './WhatsAppMessagingWindowNotice.types';