@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.
- package/README.md +88 -0
- package/cjs/index.cjs +11842 -0
- package/cjs/index.cjs.map +1 -0
- package/esm/index.mjs +11704 -0
- package/esm/index.mjs.map +1 -0
- package/lib/WhatsAppInbox.context.d.ts +70 -0
- package/lib/component-props.d.ts +138 -0
- package/lib/components/WhatsAppAttachmentPreview/WhatsAppAttachmentPreview.d.ts +8 -0
- package/lib/components/WhatsAppAttachmentPreview/WhatsAppAttachmentPreview.types.d.ts +33 -0
- package/lib/components/WhatsAppAttachmentPreview/WhatsAppAttachmentPreview.vue.d.ts +19 -0
- package/lib/components/WhatsAppAttachmentPreview/index.d.ts +1 -0
- package/lib/components/WhatsAppComposer/WhatsAppComposer.d.ts +10 -0
- package/lib/components/WhatsAppComposer/WhatsAppComposer.types.d.ts +173 -0
- package/lib/components/WhatsAppComposer/WhatsAppComposer.vue.d.ts +52 -0
- package/lib/components/WhatsAppComposer/index.d.ts +1 -0
- package/lib/components/WhatsAppContactPanel/WhatsAppContactPanel.d.ts +9 -0
- package/lib/components/WhatsAppContactPanel/WhatsAppContactPanel.types.d.ts +40 -0
- package/lib/components/WhatsAppContactPanel/WhatsAppContactPanel.vue.d.ts +19 -0
- package/lib/components/WhatsAppContactPanel/index.d.ts +1 -0
- package/lib/components/WhatsAppConversation/WhatsAppConversation.d.ts +10 -0
- package/lib/components/WhatsAppConversation/WhatsAppConversation.types.d.ts +163 -0
- package/lib/components/WhatsAppConversation/WhatsAppConversation.vue.d.ts +69 -0
- package/lib/components/WhatsAppConversation/index.d.ts +1 -0
- package/lib/components/WhatsAppConversationHeader/WhatsAppConversationHeader.d.ts +9 -0
- package/lib/components/WhatsAppConversationHeader/WhatsAppConversationHeader.types.d.ts +57 -0
- package/lib/components/WhatsAppConversationHeader/WhatsAppConversationHeader.vue.d.ts +23 -0
- package/lib/components/WhatsAppConversationHeader/index.d.ts +1 -0
- package/lib/components/WhatsAppConversationList/WhatsAppConversationList.d.ts +9 -0
- package/lib/components/WhatsAppConversationList/WhatsAppConversationList.types.d.ts +113 -0
- package/lib/components/WhatsAppConversationList/WhatsAppConversationList.vue.d.ts +35 -0
- package/lib/components/WhatsAppConversationList/index.d.ts +1 -0
- package/lib/components/WhatsAppConversationListItem/WhatsAppConversationListItem.d.ts +9 -0
- package/lib/components/WhatsAppConversationListItem/WhatsAppConversationListItem.types.d.ts +56 -0
- package/lib/components/WhatsAppConversationListItem/WhatsAppConversationListItem.vue.d.ts +21 -0
- package/lib/components/WhatsAppConversationListItem/index.d.ts +1 -0
- package/lib/components/WhatsAppEmojiPicker/WhatsAppEmojiPicker.d.ts +9 -0
- package/lib/components/WhatsAppEmojiPicker/WhatsAppEmojiPicker.types.d.ts +91 -0
- package/lib/components/WhatsAppEmojiPicker/WhatsAppEmojiPicker.vue.d.ts +31 -0
- package/lib/components/WhatsAppEmojiPicker/index.d.ts +1 -0
- package/lib/components/WhatsAppInbox/WhatsAppInbox.d.ts +10 -0
- package/lib/components/WhatsAppInbox/WhatsAppInbox.types.d.ts +135 -0
- package/lib/components/WhatsAppInbox/WhatsAppInbox.vue.d.ts +84 -0
- package/lib/components/WhatsAppInbox/index.d.ts +1 -0
- package/lib/components/WhatsAppInboxDrawer/WhatsAppInboxDrawer.d.ts +9 -0
- package/lib/components/WhatsAppInboxDrawer/WhatsAppInboxDrawer.types.d.ts +52 -0
- package/lib/components/WhatsAppInboxDrawer/WhatsAppInboxDrawer.vue.d.ts +24 -0
- package/lib/components/WhatsAppInboxDrawer/index.d.ts +1 -0
- package/lib/components/WhatsAppInboxModal/WhatsAppInboxModal.d.ts +9 -0
- package/lib/components/WhatsAppInboxModal/WhatsAppInboxModal.types.d.ts +52 -0
- package/lib/components/WhatsAppInboxModal/WhatsAppInboxModal.vue.d.ts +28 -0
- package/lib/components/WhatsAppInboxModal/index.d.ts +1 -0
- package/lib/components/WhatsAppInboxProvider/WhatsAppInboxProvider.d.ts +16 -0
- package/lib/components/WhatsAppInboxProvider/WhatsAppInboxProvider.types.d.ts +16 -0
- package/lib/components/WhatsAppInboxProvider/WhatsAppInboxProvider.vue.d.ts +11 -0
- package/lib/components/WhatsAppInboxProvider/index.d.ts +1 -0
- package/lib/components/WhatsAppInteractiveMessageEditor/WhatsAppInteractiveMessageEditor.d.ts +8 -0
- package/lib/components/WhatsAppInteractiveMessageEditor/WhatsAppInteractiveMessageEditor.types.d.ts +49 -0
- package/lib/components/WhatsAppInteractiveMessageEditor/WhatsAppInteractiveMessageEditor.vue.d.ts +27 -0
- package/lib/components/WhatsAppInteractiveMessageEditor/index.d.ts +1 -0
- package/lib/components/WhatsAppMediaAttachment/WhatsAppMediaAttachment.d.ts +8 -0
- package/lib/components/WhatsAppMediaAttachment/WhatsAppMediaAttachment.types.d.ts +41 -0
- package/lib/components/WhatsAppMediaAttachment/WhatsAppMediaAttachment.vue.d.ts +19 -0
- package/lib/components/WhatsAppMediaAttachment/index.d.ts +1 -0
- package/lib/components/WhatsAppMessage/WhatsAppMessage.d.ts +9 -0
- package/lib/components/WhatsAppMessage/WhatsAppMessage.types.d.ts +46 -0
- package/lib/components/WhatsAppMessage/WhatsAppMessage.vue.d.ts +25 -0
- package/lib/components/WhatsAppMessage/index.d.ts +1 -0
- package/lib/components/WhatsAppMessageBubble/WhatsAppMessageBubble.d.ts +9 -0
- package/lib/components/WhatsAppMessageBubble/WhatsAppMessageBubble.types.d.ts +77 -0
- package/lib/components/WhatsAppMessageBubble/WhatsAppMessageBubble.vue.d.ts +22 -0
- package/lib/components/WhatsAppMessageBubble/index.d.ts +1 -0
- package/lib/components/WhatsAppMessageList/WhatsAppMessageList.d.ts +10 -0
- package/lib/components/WhatsAppMessageList/WhatsAppMessageList.types.d.ts +94 -0
- package/lib/components/WhatsAppMessageList/WhatsAppMessageList.vue.d.ts +39 -0
- package/lib/components/WhatsAppMessageList/index.d.ts +1 -0
- package/lib/components/WhatsAppMessageStatus/WhatsAppMessageStatus.d.ts +7 -0
- package/lib/components/WhatsAppMessageStatus/WhatsAppMessageStatus.types.d.ts +30 -0
- package/lib/components/WhatsAppMessageStatus/WhatsAppMessageStatus.vue.d.ts +24 -0
- package/lib/components/WhatsAppMessageStatus/index.d.ts +1 -0
- package/lib/components/WhatsAppMessagingWindowNotice/WhatsAppMessagingWindowNotice.d.ts +9 -0
- package/lib/components/WhatsAppMessagingWindowNotice/WhatsAppMessagingWindowNotice.types.d.ts +55 -0
- package/lib/components/WhatsAppMessagingWindowNotice/WhatsAppMessagingWindowNotice.vue.d.ts +18 -0
- package/lib/components/WhatsAppMessagingWindowNotice/index.d.ts +1 -0
- package/lib/components/WhatsAppTemplatePreview/WhatsAppTemplatePreview.d.ts +7 -0
- package/lib/components/WhatsAppTemplatePreview/WhatsAppTemplatePreview.types.d.ts +36 -0
- package/lib/components/WhatsAppTemplatePreview/WhatsAppTemplatePreview.vue.d.ts +12 -0
- package/lib/components/WhatsAppTemplatePreview/index.d.ts +1 -0
- package/lib/components/WhatsAppTemplateSelector/WhatsAppTemplateSelector.d.ts +9 -0
- package/lib/components/WhatsAppTemplateSelector/WhatsAppTemplateSelector.types.d.ts +106 -0
- package/lib/components/WhatsAppTemplateSelector/WhatsAppTemplateSelector.vue.d.ts +33 -0
- package/lib/components/WhatsAppTemplateSelector/index.d.ts +1 -0
- package/lib/emoji/emoji-data.d.ts +27 -0
- package/lib/emoji/emoji-filter.d.ts +49 -0
- package/lib/emoji/index.d.ts +4 -0
- package/lib/icons/WhatsAppIcon.vue.d.ts +14 -0
- package/lib/icons/icon-paths.d.ts +43 -0
- package/lib/icons/index.d.ts +3 -0
- package/lib/index.d.mts +29 -0
- package/lib/index.d.ts +29 -0
- package/lib/labels.d.ts +184 -0
- package/lib/types.d.ts +777 -0
- package/lib/utils/capabilities.d.ts +14 -0
- package/lib/utils/format.d.ts +27 -0
- package/lib/utils/index.d.ts +9 -0
- package/lib/utils/media.d.ts +45 -0
- package/lib/utils/messages.d.ts +48 -0
- package/lib/utils/phone.d.ts +18 -0
- package/lib/utils/templates.d.ts +65 -0
- package/package.json +46 -0
- package/styles.css +1504 -0
- package/styles.layer.css +1506 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type WhatsAppInboxLabels, type WhatsAppInboxLabelsOverride } from './labels';
|
|
2
|
+
import type { WhatsAppConversationData, WhatsAppResolvedCapabilities, WhatsAppTimestamp } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Date, time and size formatting used across the inbox.
|
|
5
|
+
*
|
|
6
|
+
* Every formatter is replaceable for applications that use another date library or timezone.
|
|
7
|
+
*/
|
|
8
|
+
export interface WhatsAppInboxFormatters {
|
|
9
|
+
/** Time shown under a message bubble. */
|
|
10
|
+
messageTime: (value: WhatsAppTimestamp, locale: string | undefined) => string;
|
|
11
|
+
/** Full date and time, used for tooltips and screen-reader text. */
|
|
12
|
+
fullTimestamp: (value: WhatsAppTimestamp, locale: string | undefined) => string;
|
|
13
|
+
/** Day divider label in the message list. */
|
|
14
|
+
dayLabel: (value: WhatsAppTimestamp, locale: string | undefined, labels: WhatsAppInboxLabels) => string;
|
|
15
|
+
/** Timestamp column of a conversation list item. */
|
|
16
|
+
conversationTime: (value: WhatsAppTimestamp | undefined, locale: string | undefined, labels: WhatsAppInboxLabels) => string;
|
|
17
|
+
/** Human readable file size. */
|
|
18
|
+
fileSize: (bytes: number | undefined) => string;
|
|
19
|
+
}
|
|
20
|
+
/** Built-in `Intl` based formatters. */
|
|
21
|
+
export declare const DEFAULT_WHATSAPP_INBOX_FORMATTERS: WhatsAppInboxFormatters;
|
|
22
|
+
/** Shared configuration published by `WhatsAppInboxProvider`. */
|
|
23
|
+
export interface WhatsAppInboxConfigSource {
|
|
24
|
+
readonly labels: WhatsAppInboxLabelsOverride | undefined;
|
|
25
|
+
readonly locale: string | undefined;
|
|
26
|
+
readonly formatters: Partial<WhatsAppInboxFormatters> | undefined;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Resolved configuration, as every component consumes it.
|
|
30
|
+
*
|
|
31
|
+
* `labels` is already merged, and each formatter is bound to the resolved locale and labels, so
|
|
32
|
+
* a component calls `config.messageTime(value)` without threading either through.
|
|
33
|
+
*/
|
|
34
|
+
export interface WhatsAppInboxConfig {
|
|
35
|
+
readonly labels: WhatsAppInboxLabels;
|
|
36
|
+
readonly locale: string | undefined;
|
|
37
|
+
messageTime: (value: WhatsAppTimestamp) => string;
|
|
38
|
+
fullTimestamp: (value: WhatsAppTimestamp) => string;
|
|
39
|
+
dayLabel: (value: WhatsAppTimestamp) => string;
|
|
40
|
+
conversationTime: (value: WhatsAppTimestamp | undefined) => string;
|
|
41
|
+
fileSize: (bytes: number | undefined) => string;
|
|
42
|
+
}
|
|
43
|
+
/** Publishes shared inbox configuration to every component below. */
|
|
44
|
+
export declare function provideWhatsAppInboxConfig(value: WhatsAppInboxConfigSource): void;
|
|
45
|
+
/**
|
|
46
|
+
* Reads the inbox configuration, merging a component's own `labels` and `locale` over it.
|
|
47
|
+
*
|
|
48
|
+
* Components outside a `WhatsAppInboxProvider` use the English defaults.
|
|
49
|
+
*/
|
|
50
|
+
export declare function useWhatsAppInboxConfig(labelsOverride?: () => WhatsAppInboxLabelsOverride | undefined, localeOverride?: () => string | undefined): WhatsAppInboxConfig;
|
|
51
|
+
/**
|
|
52
|
+
* The conversation the surrounding `WhatsAppConversation` is showing.
|
|
53
|
+
*
|
|
54
|
+
* Lets a consumer build a custom layout out of the primitives without re-passing the
|
|
55
|
+
* conversation and its capabilities to each one. Every consumer of this context still accepts
|
|
56
|
+
* the same values as props, and props always win.
|
|
57
|
+
*/
|
|
58
|
+
export interface WhatsAppConversationContextValue {
|
|
59
|
+
readonly conversation: WhatsAppConversationData | undefined;
|
|
60
|
+
readonly conversationId: string | undefined;
|
|
61
|
+
readonly capabilities: WhatsAppResolvedCapabilities;
|
|
62
|
+
}
|
|
63
|
+
export declare function provideWhatsAppConversationContext(value: WhatsAppConversationContextValue): void;
|
|
64
|
+
/** Reads the surrounding conversation, or `undefined` outside a `WhatsAppConversation`. */
|
|
65
|
+
export declare function useWhatsAppConversationContext(): WhatsAppConversationContextValue | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Resolves the capabilities a component should apply: its own prop when set, the surrounding
|
|
68
|
+
* conversation's otherwise.
|
|
69
|
+
*/
|
|
70
|
+
export declare function useResolvedCapabilities(ownCapabilities: () => WhatsAppConversationData['capabilities'] | undefined, hasOwnCapabilities?: () => boolean): import("vue").ComputedRef<WhatsAppResolvedCapabilities>;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { VNodeChild } from 'vue';
|
|
2
|
+
import type { EmitsToProps } from '@mantine-vue/core';
|
|
3
|
+
import type { WhatsAppAttachment, WhatsAppContact, WhatsAppConversationSummary, WhatsAppMessageData, WhatsAppTemplate, WhatsAppUpload } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Props forwarded to a component the inbox renders internally, plus the `on*` listeners for its
|
|
6
|
+
* events so a nested object can subscribe to them.
|
|
7
|
+
*
|
|
8
|
+
* `rootRef` is dropped because it only makes sense on an element the consumer owns, and because
|
|
9
|
+
* the factory narrows it to a concrete element type a `Partial<…Props>` cannot satisfy.
|
|
10
|
+
*/
|
|
11
|
+
export type ForwardedProps<Props, Emits = Record<never, never>> = Partial<Omit<Props, 'rootRef'>> & EmitsToProps<Emits>;
|
|
12
|
+
/**
|
|
13
|
+
* Replaces the rendering of one message.
|
|
14
|
+
*
|
|
15
|
+
* The counterpart of the `message` slot. Returning `undefined` uses the built-in renderer.
|
|
16
|
+
*/
|
|
17
|
+
export type RenderMessage = (message: WhatsAppMessageData) => VNodeChild | undefined;
|
|
18
|
+
/** Replaces the content of one message bubble, keeping the bubble, footer and status. */
|
|
19
|
+
export type RenderMessageContent = (message: WhatsAppMessageData) => VNodeChild | undefined;
|
|
20
|
+
/** Scoped slots that mirror the message render props. Slots take precedence over the props. */
|
|
21
|
+
export interface WhatsAppMessageSlots {
|
|
22
|
+
/** Replaces a message entirely, bubble included. Takes precedence over `renderMessage`. */
|
|
23
|
+
message?: (props: {
|
|
24
|
+
message: WhatsAppMessageData;
|
|
25
|
+
}) => VNodeChild;
|
|
26
|
+
/** Replaces the content inside a bubble. Takes precedence over `renderMessageContent`. */
|
|
27
|
+
messageContent?: (props: {
|
|
28
|
+
message: WhatsAppMessageData;
|
|
29
|
+
}) => VNodeChild;
|
|
30
|
+
/** Appended inside the bubble, under the content and before the timestamp row. */
|
|
31
|
+
messageFooter?: (props: {
|
|
32
|
+
message: WhatsAppMessageData;
|
|
33
|
+
}) => VNodeChild;
|
|
34
|
+
/** Replaces the media renderer of a received attachment. */
|
|
35
|
+
mediaAttachment?: (props: {
|
|
36
|
+
attachment: WhatsAppAttachment;
|
|
37
|
+
message: WhatsAppMessageData;
|
|
38
|
+
}) => VNodeChild;
|
|
39
|
+
}
|
|
40
|
+
/** The `renderMessage` / `renderMessageContent` pair passed down to each message. */
|
|
41
|
+
export interface MessageRenderers {
|
|
42
|
+
/**
|
|
43
|
+
* Replaces the rendering of a message, bubble included. Returning `undefined` falls back to the
|
|
44
|
+
* built-in renderer. Can also be set with the `message` slot, which takes precedence.
|
|
45
|
+
*/
|
|
46
|
+
renderMessage?: RenderMessage;
|
|
47
|
+
/**
|
|
48
|
+
* Replaces the content inside a message bubble, keeping the bubble, timestamp and delivery
|
|
49
|
+
* state. Can also be set with the `messageContent` slot, which takes precedence.
|
|
50
|
+
*/
|
|
51
|
+
renderMessageContent?: RenderMessageContent;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Folds the message scoped slots into the equivalent render props, so a list forwards one object
|
|
55
|
+
* to every message instead of re-declaring the slots at each call site.
|
|
56
|
+
*/
|
|
57
|
+
export declare function resolveMessageRenderers(props: MessageRenderers, slots: WhatsAppMessageSlots): MessageRenderers;
|
|
58
|
+
/** Slot props of the conversation list item slots. */
|
|
59
|
+
export interface WhatsAppConversationItemSlotProps {
|
|
60
|
+
conversation: WhatsAppConversationSummary;
|
|
61
|
+
selected: boolean;
|
|
62
|
+
}
|
|
63
|
+
/** Slots shared by the conversation list and the full inbox. */
|
|
64
|
+
export interface WhatsAppConversationListSlots {
|
|
65
|
+
/** Replaces a whole conversation list item. */
|
|
66
|
+
conversationItem?: (props: WhatsAppConversationItemSlotProps) => VNodeChild;
|
|
67
|
+
/** Replaces the avatar of a list item. */
|
|
68
|
+
conversationAvatar?: (props: WhatsAppConversationItemSlotProps) => VNodeChild;
|
|
69
|
+
/** Replaces the last-message preview of a list item. */
|
|
70
|
+
conversationPreview?: (props: WhatsAppConversationItemSlotProps) => VNodeChild;
|
|
71
|
+
/** Rendered above the search field. */
|
|
72
|
+
listHeader?: () => VNodeChild;
|
|
73
|
+
/** Rendered under the list, after the load-more control. */
|
|
74
|
+
listFooter?: () => VNodeChild;
|
|
75
|
+
/** Replaces the empty state of the list. */
|
|
76
|
+
emptyInbox?: () => VNodeChild;
|
|
77
|
+
/** Replaces the loading state of the list. */
|
|
78
|
+
loadingInbox?: () => VNodeChild;
|
|
79
|
+
/** Replaces the error state of the list. */
|
|
80
|
+
errorInbox?: (props: {
|
|
81
|
+
error: string;
|
|
82
|
+
}) => VNodeChild;
|
|
83
|
+
/** Rendered next to the search field, for custom filter controls. */
|
|
84
|
+
filters?: () => VNodeChild;
|
|
85
|
+
}
|
|
86
|
+
/** Slots of the conversation view, shared with the inbox, modal and drawer. */
|
|
87
|
+
export interface WhatsAppConversationSlots extends WhatsAppMessageSlots {
|
|
88
|
+
/** Replaces the conversation header. */
|
|
89
|
+
conversationHeader?: (props: {
|
|
90
|
+
conversation: WhatsAppConversationSummary | undefined;
|
|
91
|
+
}) => VNodeChild;
|
|
92
|
+
/** Rendered at the end of the conversation header, before the contact panel toggle. */
|
|
93
|
+
headerActions?: (props: {
|
|
94
|
+
conversation: WhatsAppConversationSummary | undefined;
|
|
95
|
+
}) => VNodeChild;
|
|
96
|
+
/** Replaces the empty state shown when the conversation has no messages. */
|
|
97
|
+
emptyConversation?: () => VNodeChild;
|
|
98
|
+
/** Replaces the loading state of the message history. */
|
|
99
|
+
loadingMessages?: () => VNodeChild;
|
|
100
|
+
/** Replaces the error state of the message history. */
|
|
101
|
+
errorMessages?: (props: {
|
|
102
|
+
error: string;
|
|
103
|
+
}) => VNodeChild;
|
|
104
|
+
/** Rendered before the composer input, after the attachment control. */
|
|
105
|
+
composerPrefix?: () => VNodeChild;
|
|
106
|
+
/** Rendered after the composer input, before the send control. */
|
|
107
|
+
composerSuffix?: () => VNodeChild;
|
|
108
|
+
/** Replaces the composer action row. */
|
|
109
|
+
composerActions?: () => VNodeChild;
|
|
110
|
+
/** Emoji picker rendered in the composer emoji popover. */
|
|
111
|
+
emojiPicker?: (props: {
|
|
112
|
+
insert: (emoji: string) => void;
|
|
113
|
+
close: () => void;
|
|
114
|
+
}) => VNodeChild;
|
|
115
|
+
/** Replaces the preview of one staged attachment. */
|
|
116
|
+
attachmentPreview?: (props: {
|
|
117
|
+
upload: WhatsAppUpload;
|
|
118
|
+
}) => VNodeChild;
|
|
119
|
+
/** Replaces the preview of a template inside the template selector. */
|
|
120
|
+
templatePreview?: (props: {
|
|
121
|
+
template: WhatsAppTemplate;
|
|
122
|
+
}) => VNodeChild;
|
|
123
|
+
}
|
|
124
|
+
/** Slots of the contact panel. */
|
|
125
|
+
export interface WhatsAppContactPanelSlots {
|
|
126
|
+
/** Rendered above the built-in contact fields. */
|
|
127
|
+
contactPanelHeader?: (props: {
|
|
128
|
+
contact: WhatsAppContact;
|
|
129
|
+
}) => VNodeChild;
|
|
130
|
+
/** Replaces the whole contact panel body. */
|
|
131
|
+
contactPanel?: (props: {
|
|
132
|
+
contact: WhatsAppContact;
|
|
133
|
+
}) => VNodeChild;
|
|
134
|
+
/** Rendered under the built-in contact fields. */
|
|
135
|
+
contactPanelFooter?: (props: {
|
|
136
|
+
contact: WhatsAppContact;
|
|
137
|
+
}) => VNodeChild;
|
|
138
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const WhatsAppAttachmentPreview: import("@mantine-vue/core").MantineComponent<{
|
|
2
|
+
props: Omit<import("./WhatsAppAttachmentPreview.types").WhatsAppAttachmentPreviewProps, "rootRef">;
|
|
3
|
+
emits: import("./WhatsAppAttachmentPreview.types").WhatsAppAttachmentPreviewEmits;
|
|
4
|
+
ref: HTMLDivElement;
|
|
5
|
+
element: "div";
|
|
6
|
+
stylesNames: import("./WhatsAppAttachmentPreview.types").WhatsAppAttachmentPreviewStylesNames;
|
|
7
|
+
}>;
|
|
8
|
+
export type { WhatsAppAttachmentPreviewEmits, WhatsAppAttachmentPreviewFactory, WhatsAppAttachmentPreviewOwnProps, WhatsAppAttachmentPreviewProps, WhatsAppAttachmentPreviewStylesNames, } from './WhatsAppAttachmentPreview.types';
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { WhatsAppUpload } from '../../types';
|
|
5
|
+
export type WhatsAppAttachmentPreviewStylesNames = 'attachmentPreviewRoot' | 'attachmentPreviewThumb' | 'attachmentPreviewThumbImage' | 'attachmentPreviewBody' | 'attachmentPreviewName' | 'attachmentPreviewMeta' | 'attachmentPreviewProgress' | 'attachmentPreviewError' | 'attachmentPreviewActions';
|
|
6
|
+
export interface WhatsAppAttachmentPreviewOwnProps extends StylesApiProps<WhatsAppAttachmentPreviewFactory> {
|
|
7
|
+
/** Upload to preview. Its `status` decides which actions are offered. */
|
|
8
|
+
upload: WhatsAppUpload;
|
|
9
|
+
/**
|
|
10
|
+
* Renders the remove action.
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
withRemove?: boolean;
|
|
14
|
+
/** Label overrides. */
|
|
15
|
+
labels?: WhatsAppInboxLabelsOverride;
|
|
16
|
+
}
|
|
17
|
+
export interface WhatsAppAttachmentPreviewProps extends Omit<BoxProps, keyof WhatsAppAttachmentPreviewOwnProps>, WhatsAppAttachmentPreviewOwnProps {
|
|
18
|
+
}
|
|
19
|
+
export interface WhatsAppAttachmentPreviewEmits {
|
|
20
|
+
/** Emitted when the attachment should be dropped from the composer. */
|
|
21
|
+
remove: [upload: WhatsAppUpload];
|
|
22
|
+
/** Emitted when a failed upload should be retried by the consumer. */
|
|
23
|
+
retry: [upload: WhatsAppUpload];
|
|
24
|
+
/** Emitted when an in-flight upload should be aborted by the consumer. */
|
|
25
|
+
cancel: [upload: WhatsAppUpload];
|
|
26
|
+
}
|
|
27
|
+
export type WhatsAppAttachmentPreviewFactory = Factory<{
|
|
28
|
+
props: Omit<WhatsAppAttachmentPreviewProps, 'rootRef'>;
|
|
29
|
+
emits: WhatsAppAttachmentPreviewEmits;
|
|
30
|
+
ref: HTMLDivElement;
|
|
31
|
+
element: 'div';
|
|
32
|
+
stylesNames: WhatsAppAttachmentPreviewStylesNames;
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { WhatsAppAttachmentPreviewOwnProps } from './WhatsAppAttachmentPreview.types';
|
|
2
|
+
import type { WhatsAppIconName } from '../../icons';
|
|
3
|
+
import type { WhatsAppMediaType } from '../../types';
|
|
4
|
+
declare const defaultProps: {
|
|
5
|
+
readonly withRemove: true;
|
|
6
|
+
};
|
|
7
|
+
declare const UPLOAD_ICONS: Record<WhatsAppMediaType, WhatsAppIconName>;
|
|
8
|
+
export { defaultProps, UPLOAD_ICONS };
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<WhatsAppAttachmentPreviewOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
remove: (upload: import("../..").WhatsAppUpload) => any;
|
|
13
|
+
cancel: (upload: import("../..").WhatsAppUpload) => any;
|
|
14
|
+
retry: (upload: import("../..").WhatsAppUpload) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<WhatsAppAttachmentPreviewOwnProps> & Readonly<{
|
|
16
|
+
onRemove?: ((upload: import("../..").WhatsAppUpload) => any) | undefined;
|
|
17
|
+
onCancel?: ((upload: import("../..").WhatsAppUpload) => any) | undefined;
|
|
18
|
+
onRetry?: ((upload: import("../..").WhatsAppUpload) => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WhatsAppAttachmentPreview';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const WhatsAppComposer: import("@mantine-vue/core").MantineComponent<{
|
|
2
|
+
props: Omit<import("./WhatsAppComposer.types").WhatsAppComposerProps, "rootRef">;
|
|
3
|
+
slots: import("./WhatsAppComposer.types").WhatsAppComposerSlots;
|
|
4
|
+
emits: import("./WhatsAppComposer.types").WhatsAppComposerEmits;
|
|
5
|
+
exposed: import("./WhatsAppComposer.types").WhatsAppComposerExposed;
|
|
6
|
+
ref: HTMLDivElement;
|
|
7
|
+
element: "div";
|
|
8
|
+
stylesNames: import("./WhatsAppComposer.types").WhatsAppComposerStylesNames;
|
|
9
|
+
}>;
|
|
10
|
+
export type { WhatsAppComposerEmits, WhatsAppComposerExposed, WhatsAppComposerFactory, WhatsAppComposerOwnProps, WhatsAppComposerProps, WhatsAppComposerSlots, WhatsAppComposerStylesNames, } from './WhatsAppComposer.types';
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import type { VNodeChild } from 'vue';
|
|
2
|
+
import type { BoxProps, Factory, ModalProps } from '@mantine-vue/core';
|
|
3
|
+
import type { StylesApiProps } from '@mantine-vue/core/styles-api';
|
|
4
|
+
import type { ForwardedProps } from '../../component-props';
|
|
5
|
+
import type { WhatsAppInboxLabelsOverride } from '../../labels';
|
|
6
|
+
import type { WhatsAppAttachmentsAddPayload, WhatsAppConversationCapabilities, WhatsAppMessageReference, WhatsAppOutgoingMessage, WhatsAppRejectedFile, WhatsAppTemplate, WhatsAppUpload } from '../../types';
|
|
7
|
+
import type { WhatsAppAttachmentPreviewStylesNames } from '../WhatsAppAttachmentPreview';
|
|
8
|
+
import type { WhatsAppEmojiPickerProps, WhatsAppEmojiPickerStylesNames } from '../WhatsAppEmojiPicker';
|
|
9
|
+
import type { WhatsAppInteractiveMessageEditorStylesNames } from '../WhatsAppInteractiveMessageEditor';
|
|
10
|
+
import type { WhatsAppMessagingWindowNoticeStylesNames } from '../WhatsAppMessagingWindowNotice';
|
|
11
|
+
import type { WhatsAppTemplateSelectorStylesNames } from '../WhatsAppTemplateSelector';
|
|
12
|
+
export type WhatsAppComposerStylesNames = 'composerRoot' | 'composerNotice' | 'composerReply' | 'composerReplyBody' | 'composerReplyAuthor' | 'composerReplyText' | 'composerAttachments' | 'composerError' | 'composerInputRow' | 'composerInput' | 'composerActions' | 'composerAction' | 'composerSend' | 'composerFooter' | 'composerCount' | WhatsAppAttachmentPreviewStylesNames | WhatsAppEmojiPickerStylesNames | WhatsAppMessagingWindowNoticeStylesNames | WhatsAppTemplateSelectorStylesNames | WhatsAppInteractiveMessageEditorStylesNames;
|
|
13
|
+
export interface WhatsAppComposerSlots {
|
|
14
|
+
/** Rendered before the text input, after the attachment control. */
|
|
15
|
+
composerPrefix?: () => VNodeChild;
|
|
16
|
+
/** Rendered after the text input, before the send control. */
|
|
17
|
+
composerSuffix?: () => VNodeChild;
|
|
18
|
+
/** Replaces the whole action row, send control included. */
|
|
19
|
+
composerActions?: () => VNodeChild;
|
|
20
|
+
/**
|
|
21
|
+
* Replaces the built-in emoji picker inside the popover.
|
|
22
|
+
*
|
|
23
|
+
* Supplying it takes precedence over `withEmojiPicker`, so a consumer with their own picker –
|
|
24
|
+
* a fuller catalogue, skin tones, localized names – drops it in without turning anything off.
|
|
25
|
+
*/
|
|
26
|
+
emojiPicker?: (props: {
|
|
27
|
+
insert: (emoji: string) => void;
|
|
28
|
+
close: () => void;
|
|
29
|
+
}) => VNodeChild;
|
|
30
|
+
/** Replaces the preview of one staged attachment. */
|
|
31
|
+
attachmentPreview?: (props: {
|
|
32
|
+
upload: WhatsAppUpload;
|
|
33
|
+
}) => VNodeChild;
|
|
34
|
+
/** Replaces the preview shown inside the template selector. */
|
|
35
|
+
templatePreview?: (props: {
|
|
36
|
+
template: WhatsAppTemplate;
|
|
37
|
+
}) => VNodeChild;
|
|
38
|
+
}
|
|
39
|
+
export interface WhatsAppComposerOwnProps extends StylesApiProps<WhatsAppComposerFactory> {
|
|
40
|
+
/** Conversation the message is sent to. Included in every outgoing payload. */
|
|
41
|
+
conversationId?: string;
|
|
42
|
+
/** Controlled draft text. */
|
|
43
|
+
modelValue?: string;
|
|
44
|
+
/** Uncontrolled initial draft text. */
|
|
45
|
+
defaultValue?: string;
|
|
46
|
+
/**
|
|
47
|
+
* What may be sent in this conversation. Falls back to the surrounding
|
|
48
|
+
* `WhatsAppConversation`, and then to the defaults.
|
|
49
|
+
*/
|
|
50
|
+
capabilities?: WhatsAppConversationCapabilities;
|
|
51
|
+
/** Attachments staged in the composer, with the upload state the consumer reports. */
|
|
52
|
+
uploads?: WhatsAppUpload[];
|
|
53
|
+
/** Approved templates offered by the template selector. */
|
|
54
|
+
templates?: WhatsAppTemplate[];
|
|
55
|
+
/** Whether the template list is loading. */
|
|
56
|
+
templatesLoading?: boolean;
|
|
57
|
+
/** Failure of the last template load. */
|
|
58
|
+
templatesError?: string | null;
|
|
59
|
+
/** Controlled opened state of the template selector. */
|
|
60
|
+
templatesOpened?: boolean;
|
|
61
|
+
/** Controlled opened state of the interactive message editor. */
|
|
62
|
+
interactiveOpened?: boolean;
|
|
63
|
+
/** Whether a send is in flight. Disables the send control and shows a loader. */
|
|
64
|
+
sending?: boolean;
|
|
65
|
+
/** Disables every control, whatever the capabilities say. */
|
|
66
|
+
disabled?: boolean;
|
|
67
|
+
/** Failure of the last send, rendered above the input with a retry action. */
|
|
68
|
+
error?: string | null;
|
|
69
|
+
/** Message the draft replies to. Rendered as a quote above the input. */
|
|
70
|
+
replyTo?: WhatsAppMessageReference | null;
|
|
71
|
+
/** Overrides the input placeholder. */
|
|
72
|
+
placeholder?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Sends the draft when Enter is pressed. Shift+Enter always inserts a newline.
|
|
75
|
+
* @default true
|
|
76
|
+
*/
|
|
77
|
+
sendOnEnter?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Smallest number of visible rows of the input.
|
|
80
|
+
* @default 1
|
|
81
|
+
*/
|
|
82
|
+
minRows?: number;
|
|
83
|
+
/**
|
|
84
|
+
* Largest number of visible rows before the input scrolls.
|
|
85
|
+
* @default 6
|
|
86
|
+
*/
|
|
87
|
+
maxRows?: number;
|
|
88
|
+
/** Focuses the input on mount. */
|
|
89
|
+
autofocus?: boolean;
|
|
90
|
+
/** Forces the attachment control on or off, overriding the capabilities. */
|
|
91
|
+
withAttachments?: boolean;
|
|
92
|
+
/** Forces the template control on or off, overriding the capabilities. */
|
|
93
|
+
withTemplates?: boolean;
|
|
94
|
+
/** Forces the emoji control on or off, overriding the capabilities. */
|
|
95
|
+
withEmoji?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Renders the built-in `WhatsAppEmojiPicker` inside the emoji popover. Turn it off to supply
|
|
98
|
+
* your own through the `emojiPicker` slot; with neither, the emoji control stays hidden rather
|
|
99
|
+
* than opening an empty popover.
|
|
100
|
+
* @default true
|
|
101
|
+
*/
|
|
102
|
+
withEmojiPicker?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Props passed to the built-in picker: category and emoji allow-lists, block-lists, size and
|
|
105
|
+
* the recently-used list.
|
|
106
|
+
*/
|
|
107
|
+
emojiPickerProps?: ForwardedProps<WhatsAppEmojiPickerProps>;
|
|
108
|
+
/** Forces the interactive control on or off, overriding the capabilities. */
|
|
109
|
+
withInteractive?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Renders the remaining character count when the capabilities define a maximum length.
|
|
112
|
+
* @default true
|
|
113
|
+
*/
|
|
114
|
+
withCharacterCount?: boolean;
|
|
115
|
+
/** Props passed to the `Modal` that holds the template selector. */
|
|
116
|
+
templateModalProps?: ForwardedProps<ModalProps>;
|
|
117
|
+
/** Props passed to the `Modal` that holds the interactive message editor. */
|
|
118
|
+
interactiveModalProps?: ForwardedProps<ModalProps>;
|
|
119
|
+
/** Label overrides. */
|
|
120
|
+
labels?: WhatsAppInboxLabelsOverride;
|
|
121
|
+
}
|
|
122
|
+
export interface WhatsAppComposerProps extends Omit<BoxProps, keyof WhatsAppComposerOwnProps>, WhatsAppComposerOwnProps {
|
|
123
|
+
}
|
|
124
|
+
export interface WhatsAppComposerEmits {
|
|
125
|
+
/** Emitted whenever the draft text changes. */
|
|
126
|
+
'update:modelValue': [value: string];
|
|
127
|
+
/** Emitted whenever the draft text changes, for typing indicators. */
|
|
128
|
+
typing: [value: string];
|
|
129
|
+
/** Emitted when the opened state of the template selector changes. */
|
|
130
|
+
'update:templatesOpened': [opened: boolean];
|
|
131
|
+
/** Emitted when the opened state of the interactive editor changes. */
|
|
132
|
+
'update:interactiveOpened': [opened: boolean];
|
|
133
|
+
/** Emitted when the reply target is cleared. */
|
|
134
|
+
'update:replyTo': [replyTo: WhatsAppMessageReference | null];
|
|
135
|
+
/**
|
|
136
|
+
* Emitted when a message should be sent. The payload is a discriminated union on `kind`, so
|
|
137
|
+
* the consumer's handler can switch over it exhaustively.
|
|
138
|
+
*/
|
|
139
|
+
send: [payload: WhatsAppOutgoingMessage];
|
|
140
|
+
/** Emitted with the files that passed validation, for the consumer to upload. */
|
|
141
|
+
attachmentsAdd: [payload: WhatsAppAttachmentsAddPayload];
|
|
142
|
+
/** Emitted when files were refused by the configured constraints. */
|
|
143
|
+
attachmentsReject: [rejected: WhatsAppRejectedFile[]];
|
|
144
|
+
/** Emitted when a staged attachment should be dropped. */
|
|
145
|
+
attachmentRemove: [upload: WhatsAppUpload];
|
|
146
|
+
/** Emitted when a failed upload should be retried. */
|
|
147
|
+
attachmentRetry: [upload: WhatsAppUpload];
|
|
148
|
+
/** Emitted when an in-flight upload should be aborted. */
|
|
149
|
+
attachmentCancel: [upload: WhatsAppUpload];
|
|
150
|
+
/** Emitted when the composer refuses to send, with the reason shown to the user. */
|
|
151
|
+
validationError: [message: string];
|
|
152
|
+
/** Emitted when the retry action of a send error is used. */
|
|
153
|
+
retrySend: [];
|
|
154
|
+
/** Emitted when the retry action of a template load error is used. */
|
|
155
|
+
templatesRetryLoad: [];
|
|
156
|
+
}
|
|
157
|
+
export interface WhatsAppComposerExposed {
|
|
158
|
+
/** Moves focus to the text input. */
|
|
159
|
+
focus: () => void;
|
|
160
|
+
/** Inserts text at the caret, as the emoji picker does. */
|
|
161
|
+
insert: (text: string) => void;
|
|
162
|
+
/** Opens the template selector. */
|
|
163
|
+
openTemplates: () => void;
|
|
164
|
+
}
|
|
165
|
+
export type WhatsAppComposerFactory = Factory<{
|
|
166
|
+
props: Omit<WhatsAppComposerProps, 'rootRef'>;
|
|
167
|
+
slots: WhatsAppComposerSlots;
|
|
168
|
+
emits: WhatsAppComposerEmits;
|
|
169
|
+
exposed: WhatsAppComposerExposed;
|
|
170
|
+
ref: HTMLDivElement;
|
|
171
|
+
element: 'div';
|
|
172
|
+
stylesNames: WhatsAppComposerStylesNames;
|
|
173
|
+
}>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { WhatsAppOutgoingMessage, WhatsAppUpload } from '../../types';
|
|
2
|
+
import type { WhatsAppComposerOwnProps, WhatsAppComposerSlots } from './WhatsAppComposer.types';
|
|
3
|
+
declare const defaultProps: {
|
|
4
|
+
readonly sendOnEnter: true;
|
|
5
|
+
readonly withEmojiPicker: true;
|
|
6
|
+
readonly minRows: 1;
|
|
7
|
+
readonly maxRows: 6;
|
|
8
|
+
readonly withCharacterCount: true;
|
|
9
|
+
};
|
|
10
|
+
export { defaultProps };
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<WhatsAppComposerOwnProps, {
|
|
14
|
+
focus: () => void;
|
|
15
|
+
insert: (value: string) => void;
|
|
16
|
+
openTemplates: () => void;
|
|
17
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
send: (payload: WhatsAppOutgoingMessage) => any;
|
|
19
|
+
"update:modelValue": (value: string) => any;
|
|
20
|
+
validationError: (message: string) => any;
|
|
21
|
+
retrySend: () => any;
|
|
22
|
+
typing: (value: string) => any;
|
|
23
|
+
"update:templatesOpened": (opened: boolean) => any;
|
|
24
|
+
"update:interactiveOpened": (opened: boolean) => any;
|
|
25
|
+
"update:replyTo": (replyTo: import("../..").WhatsAppMessageReference | null) => any;
|
|
26
|
+
attachmentsAdd: (payload: import("../..").WhatsAppAttachmentsAddPayload) => any;
|
|
27
|
+
attachmentsReject: (rejected: import("../..").WhatsAppRejectedFile[]) => any;
|
|
28
|
+
attachmentRemove: (upload: WhatsAppUpload) => any;
|
|
29
|
+
attachmentRetry: (upload: WhatsAppUpload) => any;
|
|
30
|
+
attachmentCancel: (upload: WhatsAppUpload) => any;
|
|
31
|
+
templatesRetryLoad: () => any;
|
|
32
|
+
}, string, import("vue").PublicProps, Readonly<WhatsAppComposerOwnProps> & Readonly<{
|
|
33
|
+
onSend?: ((payload: WhatsAppOutgoingMessage) => any) | undefined;
|
|
34
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
35
|
+
onValidationError?: ((message: string) => any) | undefined;
|
|
36
|
+
onRetrySend?: (() => any) | undefined;
|
|
37
|
+
onTyping?: ((value: string) => any) | undefined;
|
|
38
|
+
"onUpdate:templatesOpened"?: ((opened: boolean) => any) | undefined;
|
|
39
|
+
"onUpdate:interactiveOpened"?: ((opened: boolean) => any) | undefined;
|
|
40
|
+
"onUpdate:replyTo"?: ((replyTo: import("../..").WhatsAppMessageReference | null) => any) | undefined;
|
|
41
|
+
onAttachmentsAdd?: ((payload: import("../..").WhatsAppAttachmentsAddPayload) => any) | undefined;
|
|
42
|
+
onAttachmentsReject?: ((rejected: import("../..").WhatsAppRejectedFile[]) => any) | undefined;
|
|
43
|
+
onAttachmentRemove?: ((upload: WhatsAppUpload) => any) | undefined;
|
|
44
|
+
onAttachmentRetry?: ((upload: WhatsAppUpload) => any) | undefined;
|
|
45
|
+
onAttachmentCancel?: ((upload: WhatsAppUpload) => any) | undefined;
|
|
46
|
+
onTemplatesRetryLoad?: (() => any) | undefined;
|
|
47
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, WhatsAppComposerSlots>;
|
|
48
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
49
|
+
new (): {
|
|
50
|
+
$slots: S;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WhatsAppComposer';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const WhatsAppContactPanel: import("@mantine-vue/core").MantineComponent<{
|
|
2
|
+
props: Omit<import("./WhatsAppContactPanel.types").WhatsAppContactPanelProps, "rootRef">;
|
|
3
|
+
slots: import("../../component-props.js").WhatsAppContactPanelSlots;
|
|
4
|
+
emits: import("./WhatsAppContactPanel.types").WhatsAppContactPanelEmits;
|
|
5
|
+
ref: HTMLElement;
|
|
6
|
+
element: "aside";
|
|
7
|
+
stylesNames: import("./WhatsAppContactPanel.types").WhatsAppContactPanelStylesNames;
|
|
8
|
+
}>;
|
|
9
|
+
export type { WhatsAppContactPanelEmits, WhatsAppContactPanelFactory, WhatsAppContactPanelOwnProps, WhatsAppContactPanelProps, WhatsAppContactPanelStylesNames, } from './WhatsAppContactPanel.types';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { BoxProps, Factory } from '@mantine-vue/core';
|
|
2
|
+
import type { StylesApiProps } from '@mantine-vue/core/styles-api';
|
|
3
|
+
import type { WhatsAppContactPanelSlots } from '../../component-props';
|
|
4
|
+
import type { WhatsAppInboxLabelsOverride } from '../../labels';
|
|
5
|
+
import type { WhatsAppContact, WhatsAppConversationSummary } from '../../types';
|
|
6
|
+
export type WhatsAppContactPanelStylesNames = 'contactPanelRoot' | 'contactPanelHeader' | 'contactPanelTitle' | 'contactPanelBody' | 'contactPanelIdentity' | 'contactPanelName' | 'contactPanelPhone' | 'contactPanelField' | 'contactPanelFieldLabel' | 'contactPanelFieldValue' | 'contactPanelTags' | 'contactPanelFooter' | 'contactPanelEmpty';
|
|
7
|
+
export interface WhatsAppContactPanelOwnProps extends StylesApiProps<WhatsAppContactPanelFactory> {
|
|
8
|
+
/** Contact to describe. Falls back to the contact of `conversation`. */
|
|
9
|
+
contact?: WhatsAppContact;
|
|
10
|
+
/** Conversation the contact belongs to, used for the status and assignee rows. */
|
|
11
|
+
conversation?: WhatsAppConversationSummary;
|
|
12
|
+
/**
|
|
13
|
+
* Renders the close control in the panel header.
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
withCloseButton?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Renders the panel title.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
withHeader?: boolean;
|
|
22
|
+
/** Overrides the panel title. */
|
|
23
|
+
title?: string;
|
|
24
|
+
/** Label overrides. */
|
|
25
|
+
labels?: WhatsAppInboxLabelsOverride;
|
|
26
|
+
}
|
|
27
|
+
export interface WhatsAppContactPanelProps extends Omit<BoxProps, keyof WhatsAppContactPanelOwnProps>, WhatsAppContactPanelOwnProps {
|
|
28
|
+
}
|
|
29
|
+
export interface WhatsAppContactPanelEmits {
|
|
30
|
+
/** Emitted when the close control is used. */
|
|
31
|
+
close: [];
|
|
32
|
+
}
|
|
33
|
+
export type WhatsAppContactPanelFactory = Factory<{
|
|
34
|
+
props: Omit<WhatsAppContactPanelProps, 'rootRef'>;
|
|
35
|
+
slots: WhatsAppContactPanelSlots;
|
|
36
|
+
emits: WhatsAppContactPanelEmits;
|
|
37
|
+
ref: HTMLElement;
|
|
38
|
+
element: 'aside';
|
|
39
|
+
stylesNames: WhatsAppContactPanelStylesNames;
|
|
40
|
+
}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { WhatsAppContactPanelSlots } from '../../component-props';
|
|
2
|
+
import type { WhatsAppContactPanelOwnProps } from './WhatsAppContactPanel.types';
|
|
3
|
+
declare const defaultProps: {
|
|
4
|
+
readonly withCloseButton: false;
|
|
5
|
+
readonly withHeader: true;
|
|
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<WhatsAppContactPanelOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
close: () => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<WhatsAppContactPanelOwnProps> & Readonly<{
|
|
13
|
+
onClose?: (() => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, WhatsAppContactPanelSlots>;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WhatsAppContactPanel';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const WhatsAppConversation: import("@mantine-vue/core").MantineComponent<{
|
|
2
|
+
props: Omit<import("./WhatsAppConversation.types").WhatsAppConversationProps, "rootRef">;
|
|
3
|
+
slots: import("../../component-props.js").WhatsAppConversationSlots;
|
|
4
|
+
emits: import("./WhatsAppConversation.types").WhatsAppConversationEmits;
|
|
5
|
+
exposed: import("./WhatsAppConversation.types").WhatsAppConversationExposed;
|
|
6
|
+
ref: HTMLDivElement;
|
|
7
|
+
element: "div";
|
|
8
|
+
stylesNames: import("./WhatsAppConversation.types").WhatsAppConversationStylesNames;
|
|
9
|
+
}>;
|
|
10
|
+
export type { WhatsAppConversationEmits, WhatsAppConversationExposed, WhatsAppConversationFactory, WhatsAppConversationOwnProps, WhatsAppConversationProps, WhatsAppConversationStylesNames, } from './WhatsAppConversation.types';
|