@botpress/webchat 0.5.1 → 1.0.1
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/dist/App.d.ts +10 -0
- package/dist/Utils/colors.d.ts +18 -0
- package/dist/Utils/eventEmitter.d.ts +12 -0
- package/dist/Utils/index.d.ts +2 -0
- package/dist/client/MessagingClient.d.ts +27 -0
- package/dist/client/adapters/Audio.d.ts +19 -0
- package/dist/client/adapters/Card.d.ts +188 -0
- package/dist/client/adapters/Carousel.d.ts +147 -0
- package/dist/client/adapters/Choice.d.ts +45 -0
- package/dist/client/adapters/Dropdown.d.ts +46 -0
- package/dist/client/adapters/File.d.ts +19 -0
- package/dist/client/adapters/Image.d.ts +19 -0
- package/dist/client/adapters/Location.d.ts +27 -0
- package/dist/client/adapters/Message.d.ts +433 -0
- package/dist/client/adapters/Text.d.ts +20 -0
- package/dist/client/adapters/Utils.d.ts +5 -0
- package/dist/client/adapters/Video.d.ts +19 -0
- package/dist/client/adapters/Voice.d.ts +15 -0
- package/dist/client/adapters/index.d.ts +12 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/components/Avatar.d.ts +6 -0
- package/dist/components/Block.d.ts +4 -0
- package/dist/components/Composer.d.ts +12 -14
- package/dist/components/Container.d.ts +2 -12
- package/dist/components/Header.d.ts +36 -26
- package/dist/components/LoadingIndicator.d.ts +2 -0
- package/dist/components/Message.d.ts +7 -0
- package/dist/components/MessageList.d.ts +2 -0
- package/dist/components/Modal.d.ts +17 -0
- package/dist/components/RestartConversation.d.ts +5 -0
- package/dist/components/Webchat.d.ts +6 -0
- package/dist/components/dev-tools/DevTools.d.ts +1 -0
- package/dist/components/dev-tools/configuration.d.ts +2 -0
- package/dist/components/dev-tools/helpers.d.ts +5 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/renderers/Audio.d.ts +3 -0
- package/dist/components/renderers/Bubble.d.ts +5 -0
- package/dist/components/renderers/Button.d.ts +4 -0
- package/dist/components/renderers/Carousel.d.ts +3 -0
- package/dist/components/renderers/Column.d.ts +5 -0
- package/dist/components/renderers/Dropdown.d.ts +5 -0
- package/dist/components/renderers/File.d.ts +3 -0
- package/dist/components/renderers/Image.d.ts +3 -0
- package/dist/components/renderers/Location.d.ts +3 -0
- package/dist/components/renderers/Row.d.ts +5 -0
- package/dist/components/renderers/Text.d.ts +4 -0
- package/dist/components/renderers/Video.d.ts +3 -0
- package/dist/components/renderers/index.d.ts +2 -0
- package/dist/contexts/ComposerContext.d.ts +8 -0
- package/dist/contexts/MessageContext.d.ts +8 -0
- package/dist/contexts/ModalContext.d.ts +14 -0
- package/dist/contexts/WebchatContext.d.ts +56 -0
- package/dist/contexts/index.d.ts +4 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/useImageSize.d.ts +2 -0
- package/dist/hooks/useRefresh.d.ts +10 -0
- package/dist/hooks/useWebchatStore.d.ts +30 -0
- package/dist/index.d.ts +3 -17
- package/dist/index.js +43569 -48
- package/dist/index.umd.cjs +702 -0
- package/dist/main.d.ts +11 -13
- package/dist/providers/ModalProvider.d.ts +8 -0
- package/dist/providers/WebchatProvider.d.ts +13 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/theme.d.ts +3371 -0
- package/dist/services/clipboard.d.ts +1 -0
- package/dist/services/images.d.ts +2 -0
- package/dist/services/index.d.ts +3 -0
- package/dist/services/toast.d.ts +17 -0
- package/dist/themes/dawn.d.ts +2 -0
- package/dist/themes/duskTheme.d.ts +2 -0
- package/dist/themes/eggplant.d.ts +2 -0
- package/dist/themes/galaxy.d.ts +2 -0
- package/dist/themes/index.d.ts +6 -0
- package/dist/themes/midnight.d.ts +2 -0
- package/dist/themes/prism.d.ts +2 -0
- package/dist/twind.config.d.ts +9 -0
- package/dist/types/block-type.d.ts +93 -0
- package/dist/types/image.d.ts +11 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +61 -49
- package/README.md +0 -41
- package/assets/fonts/roboto/roboto.woff2 +0 -0
- package/assets/fonts/roboto/roboto500.woff2 +0 -0
- package/assets/fonts/roboto.css +0 -128
- package/assets/notification.mp3 +0 -0
- package/dist/components/Composer.js +0 -118
- package/dist/components/Container.js +0 -62
- package/dist/components/ConversationList.d.ts +0 -10
- package/dist/components/ConversationList.js +0 -41
- package/dist/components/Footer.d.ts +0 -3
- package/dist/components/Footer.js +0 -21
- package/dist/components/Header.js +0 -181
- package/dist/components/VoiceRecorder.d.ts +0 -10
- package/dist/components/VoiceRecorder.js +0 -137
- package/dist/components/common/Avatar/index.d.ts +0 -9
- package/dist/components/common/Avatar/index.js +0 -13
- package/dist/components/common/BotInfo/index.d.ts +0 -10
- package/dist/components/common/BotInfo/index.js +0 -107
- package/dist/components/common/BotInfo/style.scss +0 -88
- package/dist/components/common/ConfirmDialog/index.d.ts +0 -11
- package/dist/components/common/ConfirmDialog/index.js +0 -78
- package/dist/components/common/ConfirmDialog/style.module.scss +0 -48
- package/dist/components/common/Dialog/index.d.ts +0 -17
- package/dist/components/common/Dialog/index.js +0 -57
- package/dist/components/common/Dialog/style.module.scss +0 -29
- package/dist/components/common/ToolTip/index.d.ts +0 -10
- package/dist/components/common/ToolTip/index.js +0 -163
- package/dist/components/common/ToolTip/style.module.scss +0 -108
- package/dist/components/common/ToolTip/utils.d.ts +0 -15
- package/dist/components/common/ToolTip/utils.js +0 -78
- package/dist/components/common/variables.scss +0 -38
- package/dist/components/messages/InlineFeedback.d.ts +0 -11
- package/dist/components/messages/InlineFeedback.js +0 -56
- package/dist/components/messages/Message.d.ts +0 -11
- package/dist/components/messages/Message.js +0 -106
- package/dist/components/messages/MessageGroup.d.ts +0 -23
- package/dist/components/messages/MessageGroup.js +0 -63
- package/dist/components/messages/MessageList.d.ts +0 -10
- package/dist/components/messages/MessageList.js +0 -148
- package/dist/core/api.d.ts +0 -23
- package/dist/core/api.js +0 -117
- package/dist/core/constants.d.ts +0 -14
- package/dist/core/constants.js +0 -29
- package/dist/core/socket.d.ts +0 -14
- package/dist/core/socket.js +0 -57
- package/dist/declaration.d.ts +0 -2
- package/dist/declaration.js +0 -1
- package/dist/fonts/roboto.d.ts +0 -4
- package/dist/fonts/roboto.js +0 -9
- package/dist/globals.d.ts +0 -7
- package/dist/globals.js +0 -2
- package/dist/icons/Add.d.ts +0 -6
- package/dist/icons/Add.js +0 -10
- package/dist/icons/Cancel.d.ts +0 -5
- package/dist/icons/Cancel.js +0 -10
- package/dist/icons/Chat.d.ts +0 -6
- package/dist/icons/Chat.js +0 -9
- package/dist/icons/Close.d.ts +0 -3
- package/dist/icons/Close.js +0 -10
- package/dist/icons/Delete.d.ts +0 -3
- package/dist/icons/Delete.js +0 -11
- package/dist/icons/Download.d.ts +0 -3
- package/dist/icons/Download.js +0 -10
- package/dist/icons/Email.d.ts +0 -3
- package/dist/icons/Email.js +0 -8
- package/dist/icons/Information.d.ts +0 -3
- package/dist/icons/Information.js +0 -12
- package/dist/icons/List.d.ts +0 -3
- package/dist/icons/List.js +0 -15
- package/dist/icons/Microphone.d.ts +0 -5
- package/dist/icons/Microphone.js +0 -12
- package/dist/icons/Phone.d.ts +0 -3
- package/dist/icons/Phone.js +0 -8
- package/dist/icons/Reload.d.ts +0 -3
- package/dist/icons/Reload.js +0 -10
- package/dist/icons/ThumbsDown.d.ts +0 -3
- package/dist/icons/ThumbsDown.js +0 -11
- package/dist/icons/ThumbsUp.d.ts +0 -3
- package/dist/icons/ThumbsUp.js +0 -11
- package/dist/icons/Website.d.ts +0 -3
- package/dist/icons/Website.js +0 -8
- package/dist/main.js +0 -336
- package/dist/store/composer.d.ts +0 -17
- package/dist/store/composer.js +0 -98
- package/dist/store/index.d.ts +0 -89
- package/dist/store/index.js +0 -604
- package/dist/store/view.d.ts +0 -61
- package/dist/store/view.js +0 -365
- package/dist/translations/ar.json +0 -30
- package/dist/translations/de.json +0 -32
- package/dist/translations/en.json +0 -40
- package/dist/translations/es.json +0 -19
- package/dist/translations/fr.json +0 -40
- package/dist/translations/index.d.ts +0 -9
- package/dist/translations/index.js +0 -95
- package/dist/translations/it.json +0 -38
- package/dist/translations/pt.json +0 -19
- package/dist/translations/ru.json +0 -24
- package/dist/translations/uk.json +0 -24
- package/dist/typings.d.ts +0 -410
- package/dist/typings.js +0 -2
- package/dist/utils/analytics.d.ts +0 -5
- package/dist/utils/analytics.js +0 -37
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.js +0 -27
- package/dist/utils/storage.d.ts +0 -16
- package/dist/utils/storage.js +0 -129
- package/dist/utils/webchatEvents.d.ts +0 -2
- package/dist/utils/webchatEvents.js +0 -14
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const MessageContentSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"text">;
|
|
4
|
+
text: z.ZodString;
|
|
5
|
+
markdown: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
text: string;
|
|
8
|
+
type: "text";
|
|
9
|
+
markdown?: boolean | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
text: string;
|
|
12
|
+
type: "text";
|
|
13
|
+
markdown?: boolean | undefined;
|
|
14
|
+
}>, import("./Utils.ts").WithBubble<import("../../index.ts").TextBlock>, {
|
|
15
|
+
text: string;
|
|
16
|
+
type: "text";
|
|
17
|
+
markdown?: boolean | undefined;
|
|
18
|
+
}>, z.ZodEffects<z.ZodObject<{
|
|
19
|
+
type: z.ZodLiteral<"image">;
|
|
20
|
+
image: z.ZodString;
|
|
21
|
+
title: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
image: string;
|
|
24
|
+
type: "image";
|
|
25
|
+
title?: string | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
image: string;
|
|
28
|
+
type: "image";
|
|
29
|
+
title?: string | undefined;
|
|
30
|
+
}>, import("../../index.ts").ImageBlock, {
|
|
31
|
+
image: string;
|
|
32
|
+
type: "image";
|
|
33
|
+
title?: string | undefined;
|
|
34
|
+
}>, z.ZodEffects<z.ZodObject<{
|
|
35
|
+
type: z.ZodLiteral<"audio">;
|
|
36
|
+
audio: z.ZodString;
|
|
37
|
+
title: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
audio: string;
|
|
40
|
+
type: "audio";
|
|
41
|
+
title?: string | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
audio: string;
|
|
44
|
+
type: "audio";
|
|
45
|
+
title?: string | undefined;
|
|
46
|
+
}>, import("../../index.ts").AudioBlock, {
|
|
47
|
+
audio: string;
|
|
48
|
+
type: "audio";
|
|
49
|
+
title?: string | undefined;
|
|
50
|
+
}>, z.ZodEffects<z.ZodObject<{
|
|
51
|
+
type: z.ZodLiteral<"video">;
|
|
52
|
+
video: z.ZodString;
|
|
53
|
+
title: z.ZodOptional<z.ZodString>;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
video: string;
|
|
56
|
+
type: "video";
|
|
57
|
+
title?: string | undefined;
|
|
58
|
+
}, {
|
|
59
|
+
video: string;
|
|
60
|
+
type: "video";
|
|
61
|
+
title?: string | undefined;
|
|
62
|
+
}>, import("../../index.ts").VideoBlock, {
|
|
63
|
+
video: string;
|
|
64
|
+
type: "video";
|
|
65
|
+
title?: string | undefined;
|
|
66
|
+
}>, z.ZodEffects<z.ZodObject<{
|
|
67
|
+
type: z.ZodLiteral<"carousel">;
|
|
68
|
+
items: z.ZodArray<z.ZodEffects<z.ZodObject<Omit<{
|
|
69
|
+
type: z.ZodLiteral<"card">;
|
|
70
|
+
title: z.ZodOptional<z.ZodString>;
|
|
71
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
72
|
+
image: z.ZodOptional<z.ZodString>;
|
|
73
|
+
actions: z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
74
|
+
title: z.ZodString;
|
|
75
|
+
action: z.ZodLiteral<"Say something">;
|
|
76
|
+
text: z.ZodString;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
title: string;
|
|
79
|
+
text: string;
|
|
80
|
+
action: "Say something";
|
|
81
|
+
}, {
|
|
82
|
+
title: string;
|
|
83
|
+
text: string;
|
|
84
|
+
action: "Say something";
|
|
85
|
+
}>, import("../../index.ts").ButtonBlock, {
|
|
86
|
+
title: string;
|
|
87
|
+
text: string;
|
|
88
|
+
action: "Say something";
|
|
89
|
+
}>, z.ZodEffects<z.ZodObject<{
|
|
90
|
+
title: z.ZodString;
|
|
91
|
+
action: z.ZodLiteral<"Open URL">;
|
|
92
|
+
url: z.ZodString;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
title: string;
|
|
95
|
+
url: string;
|
|
96
|
+
action: "Open URL";
|
|
97
|
+
}, {
|
|
98
|
+
title: string;
|
|
99
|
+
url: string;
|
|
100
|
+
action: "Open URL";
|
|
101
|
+
}>, import("../../index.ts").ButtonBlock, {
|
|
102
|
+
title: string;
|
|
103
|
+
url: string;
|
|
104
|
+
action: "Open URL";
|
|
105
|
+
}>, z.ZodEffects<z.ZodObject<{
|
|
106
|
+
title: z.ZodString;
|
|
107
|
+
action: z.ZodLiteral<"Postback">;
|
|
108
|
+
payload: z.ZodString;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
title: string;
|
|
111
|
+
action: "Postback";
|
|
112
|
+
payload: string;
|
|
113
|
+
}, {
|
|
114
|
+
title: string;
|
|
115
|
+
action: "Postback";
|
|
116
|
+
payload: string;
|
|
117
|
+
}>, import("../../index.ts").ButtonBlock, {
|
|
118
|
+
title: string;
|
|
119
|
+
action: "Postback";
|
|
120
|
+
payload: string;
|
|
121
|
+
}>]>, "many">;
|
|
122
|
+
}, "type">, "strip", z.ZodTypeAny, {
|
|
123
|
+
actions: import("../../index.ts").ButtonBlock[];
|
|
124
|
+
title?: string | undefined;
|
|
125
|
+
image?: string | undefined;
|
|
126
|
+
subtitle?: string | undefined;
|
|
127
|
+
}, {
|
|
128
|
+
actions: ({
|
|
129
|
+
title: string;
|
|
130
|
+
text: string;
|
|
131
|
+
action: "Say something";
|
|
132
|
+
} | {
|
|
133
|
+
title: string;
|
|
134
|
+
url: string;
|
|
135
|
+
action: "Open URL";
|
|
136
|
+
} | {
|
|
137
|
+
title: string;
|
|
138
|
+
action: "Postback";
|
|
139
|
+
payload: string;
|
|
140
|
+
})[];
|
|
141
|
+
title?: string | undefined;
|
|
142
|
+
image?: string | undefined;
|
|
143
|
+
subtitle?: string | undefined;
|
|
144
|
+
}>, import("./Card").CardBlockType, {
|
|
145
|
+
actions: ({
|
|
146
|
+
title: string;
|
|
147
|
+
text: string;
|
|
148
|
+
action: "Say something";
|
|
149
|
+
} | {
|
|
150
|
+
title: string;
|
|
151
|
+
url: string;
|
|
152
|
+
action: "Open URL";
|
|
153
|
+
} | {
|
|
154
|
+
title: string;
|
|
155
|
+
action: "Postback";
|
|
156
|
+
payload: string;
|
|
157
|
+
})[];
|
|
158
|
+
title?: string | undefined;
|
|
159
|
+
image?: string | undefined;
|
|
160
|
+
subtitle?: string | undefined;
|
|
161
|
+
}>, "many">;
|
|
162
|
+
}, "strip", z.ZodTypeAny, {
|
|
163
|
+
type: "carousel";
|
|
164
|
+
items: import("./Card").CardBlockType[];
|
|
165
|
+
}, {
|
|
166
|
+
type: "carousel";
|
|
167
|
+
items: {
|
|
168
|
+
actions: ({
|
|
169
|
+
title: string;
|
|
170
|
+
text: string;
|
|
171
|
+
action: "Say something";
|
|
172
|
+
} | {
|
|
173
|
+
title: string;
|
|
174
|
+
url: string;
|
|
175
|
+
action: "Open URL";
|
|
176
|
+
} | {
|
|
177
|
+
title: string;
|
|
178
|
+
action: "Postback";
|
|
179
|
+
payload: string;
|
|
180
|
+
})[];
|
|
181
|
+
title?: string | undefined;
|
|
182
|
+
image?: string | undefined;
|
|
183
|
+
subtitle?: string | undefined;
|
|
184
|
+
}[];
|
|
185
|
+
}>, {
|
|
186
|
+
blocks: import("./Card").CardBlockType[];
|
|
187
|
+
} & Omit<import("../../index.ts").CarouselBlock, "blocks">, {
|
|
188
|
+
type: "carousel";
|
|
189
|
+
items: {
|
|
190
|
+
actions: ({
|
|
191
|
+
title: string;
|
|
192
|
+
text: string;
|
|
193
|
+
action: "Say something";
|
|
194
|
+
} | {
|
|
195
|
+
title: string;
|
|
196
|
+
url: string;
|
|
197
|
+
action: "Open URL";
|
|
198
|
+
} | {
|
|
199
|
+
title: string;
|
|
200
|
+
action: "Postback";
|
|
201
|
+
payload: string;
|
|
202
|
+
})[];
|
|
203
|
+
title?: string | undefined;
|
|
204
|
+
image?: string | undefined;
|
|
205
|
+
subtitle?: string | undefined;
|
|
206
|
+
}[];
|
|
207
|
+
}>, z.ZodEffects<z.ZodObject<{
|
|
208
|
+
type: z.ZodLiteral<"card">;
|
|
209
|
+
title: z.ZodOptional<z.ZodString>;
|
|
210
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
211
|
+
image: z.ZodOptional<z.ZodString>;
|
|
212
|
+
actions: z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
213
|
+
title: z.ZodString;
|
|
214
|
+
action: z.ZodLiteral<"Say something">;
|
|
215
|
+
text: z.ZodString;
|
|
216
|
+
}, "strip", z.ZodTypeAny, {
|
|
217
|
+
title: string;
|
|
218
|
+
text: string;
|
|
219
|
+
action: "Say something";
|
|
220
|
+
}, {
|
|
221
|
+
title: string;
|
|
222
|
+
text: string;
|
|
223
|
+
action: "Say something";
|
|
224
|
+
}>, import("../../index.ts").ButtonBlock, {
|
|
225
|
+
title: string;
|
|
226
|
+
text: string;
|
|
227
|
+
action: "Say something";
|
|
228
|
+
}>, z.ZodEffects<z.ZodObject<{
|
|
229
|
+
title: z.ZodString;
|
|
230
|
+
action: z.ZodLiteral<"Open URL">;
|
|
231
|
+
url: z.ZodString;
|
|
232
|
+
}, "strip", z.ZodTypeAny, {
|
|
233
|
+
title: string;
|
|
234
|
+
url: string;
|
|
235
|
+
action: "Open URL";
|
|
236
|
+
}, {
|
|
237
|
+
title: string;
|
|
238
|
+
url: string;
|
|
239
|
+
action: "Open URL";
|
|
240
|
+
}>, import("../../index.ts").ButtonBlock, {
|
|
241
|
+
title: string;
|
|
242
|
+
url: string;
|
|
243
|
+
action: "Open URL";
|
|
244
|
+
}>, z.ZodEffects<z.ZodObject<{
|
|
245
|
+
title: z.ZodString;
|
|
246
|
+
action: z.ZodLiteral<"Postback">;
|
|
247
|
+
payload: z.ZodString;
|
|
248
|
+
}, "strip", z.ZodTypeAny, {
|
|
249
|
+
title: string;
|
|
250
|
+
action: "Postback";
|
|
251
|
+
payload: string;
|
|
252
|
+
}, {
|
|
253
|
+
title: string;
|
|
254
|
+
action: "Postback";
|
|
255
|
+
payload: string;
|
|
256
|
+
}>, import("../../index.ts").ButtonBlock, {
|
|
257
|
+
title: string;
|
|
258
|
+
action: "Postback";
|
|
259
|
+
payload: string;
|
|
260
|
+
}>]>, "many">;
|
|
261
|
+
}, "strip", z.ZodTypeAny, {
|
|
262
|
+
type: "card";
|
|
263
|
+
actions: import("../../index.ts").ButtonBlock[];
|
|
264
|
+
title?: string | undefined;
|
|
265
|
+
subtitle?: string | undefined;
|
|
266
|
+
image?: string | undefined;
|
|
267
|
+
}, {
|
|
268
|
+
type: "card";
|
|
269
|
+
actions: ({
|
|
270
|
+
title: string;
|
|
271
|
+
text: string;
|
|
272
|
+
action: "Say something";
|
|
273
|
+
} | {
|
|
274
|
+
title: string;
|
|
275
|
+
url: string;
|
|
276
|
+
action: "Open URL";
|
|
277
|
+
} | {
|
|
278
|
+
title: string;
|
|
279
|
+
action: "Postback";
|
|
280
|
+
payload: string;
|
|
281
|
+
})[];
|
|
282
|
+
title?: string | undefined;
|
|
283
|
+
subtitle?: string | undefined;
|
|
284
|
+
image?: string | undefined;
|
|
285
|
+
}>, import("./Utils.ts").WithBubble<import("./Card").CardBlockType>, {
|
|
286
|
+
type: "card";
|
|
287
|
+
actions: ({
|
|
288
|
+
title: string;
|
|
289
|
+
text: string;
|
|
290
|
+
action: "Say something";
|
|
291
|
+
} | {
|
|
292
|
+
title: string;
|
|
293
|
+
url: string;
|
|
294
|
+
action: "Open URL";
|
|
295
|
+
} | {
|
|
296
|
+
title: string;
|
|
297
|
+
action: "Postback";
|
|
298
|
+
payload: string;
|
|
299
|
+
})[];
|
|
300
|
+
title?: string | undefined;
|
|
301
|
+
subtitle?: string | undefined;
|
|
302
|
+
image?: string | undefined;
|
|
303
|
+
}>, z.ZodEffects<z.ZodObject<{
|
|
304
|
+
type: z.ZodLiteral<"location">;
|
|
305
|
+
latitude: z.ZodNumber;
|
|
306
|
+
longitude: z.ZodNumber;
|
|
307
|
+
address: z.ZodOptional<z.ZodString>;
|
|
308
|
+
title: z.ZodOptional<z.ZodString>;
|
|
309
|
+
}, "strip", z.ZodTypeAny, {
|
|
310
|
+
type: "location";
|
|
311
|
+
latitude: number;
|
|
312
|
+
longitude: number;
|
|
313
|
+
address?: string | undefined;
|
|
314
|
+
title?: string | undefined;
|
|
315
|
+
}, {
|
|
316
|
+
type: "location";
|
|
317
|
+
latitude: number;
|
|
318
|
+
longitude: number;
|
|
319
|
+
address?: string | undefined;
|
|
320
|
+
title?: string | undefined;
|
|
321
|
+
}>, import("../../index.ts").LocationBlock, {
|
|
322
|
+
type: "location";
|
|
323
|
+
latitude: number;
|
|
324
|
+
longitude: number;
|
|
325
|
+
address?: string | undefined;
|
|
326
|
+
title?: string | undefined;
|
|
327
|
+
}>, z.ZodEffects<z.ZodObject<{
|
|
328
|
+
type: z.ZodLiteral<"file">;
|
|
329
|
+
file: z.ZodString;
|
|
330
|
+
title: z.ZodOptional<z.ZodString>;
|
|
331
|
+
}, "strip", z.ZodTypeAny, {
|
|
332
|
+
type: "file";
|
|
333
|
+
file: string;
|
|
334
|
+
title?: string | undefined;
|
|
335
|
+
}, {
|
|
336
|
+
type: "file";
|
|
337
|
+
file: string;
|
|
338
|
+
title?: string | undefined;
|
|
339
|
+
}>, import("../../index.ts").FileBlock, {
|
|
340
|
+
type: "file";
|
|
341
|
+
file: string;
|
|
342
|
+
title?: string | undefined;
|
|
343
|
+
}>, z.ZodEffects<z.ZodObject<{
|
|
344
|
+
type: z.ZodLiteral<"voice">;
|
|
345
|
+
audio: z.ZodString;
|
|
346
|
+
}, "strip", z.ZodTypeAny, {
|
|
347
|
+
audio: string;
|
|
348
|
+
type: "voice";
|
|
349
|
+
}, {
|
|
350
|
+
audio: string;
|
|
351
|
+
type: "voice";
|
|
352
|
+
}>, import("../../index.ts").AudioBlock, {
|
|
353
|
+
audio: string;
|
|
354
|
+
type: "voice";
|
|
355
|
+
}>, z.ZodEffects<z.ZodObject<{
|
|
356
|
+
type: z.ZodLiteral<"single-choice">;
|
|
357
|
+
text: z.ZodString;
|
|
358
|
+
choices: z.ZodArray<z.ZodObject<{
|
|
359
|
+
title: z.ZodString;
|
|
360
|
+
value: z.ZodString;
|
|
361
|
+
}, "strip", z.ZodTypeAny, {
|
|
362
|
+
title: string;
|
|
363
|
+
value: string;
|
|
364
|
+
}, {
|
|
365
|
+
title: string;
|
|
366
|
+
value: string;
|
|
367
|
+
}>, "many">;
|
|
368
|
+
}, "strip", z.ZodTypeAny, {
|
|
369
|
+
text: string;
|
|
370
|
+
type: "single-choice";
|
|
371
|
+
choices: {
|
|
372
|
+
title: string;
|
|
373
|
+
value: string;
|
|
374
|
+
}[];
|
|
375
|
+
}, {
|
|
376
|
+
text: string;
|
|
377
|
+
type: "single-choice";
|
|
378
|
+
choices: {
|
|
379
|
+
title: string;
|
|
380
|
+
value: string;
|
|
381
|
+
}[];
|
|
382
|
+
}>, import("./Utils.ts").WithBubble<{
|
|
383
|
+
blocks: (import("../../index.ts").TextBlock | ({
|
|
384
|
+
blocks: import("../../index.ts").ButtonBlock[];
|
|
385
|
+
} & Omit<import("../../index.ts").RowBlock, "blocks">))[];
|
|
386
|
+
} & Omit<import("../../index.ts").ColumnBlock, "blocks">>, {
|
|
387
|
+
text: string;
|
|
388
|
+
type: "single-choice";
|
|
389
|
+
choices: {
|
|
390
|
+
title: string;
|
|
391
|
+
value: string;
|
|
392
|
+
}[];
|
|
393
|
+
}>, z.ZodEffects<z.ZodObject<{
|
|
394
|
+
type: z.ZodLiteral<"dropdown">;
|
|
395
|
+
text: z.ZodOptional<z.ZodString>;
|
|
396
|
+
message: z.ZodOptional<z.ZodString>;
|
|
397
|
+
options: z.ZodArray<z.ZodObject<{
|
|
398
|
+
label: z.ZodString;
|
|
399
|
+
value: z.ZodString;
|
|
400
|
+
}, "strip", z.ZodTypeAny, {
|
|
401
|
+
label: string;
|
|
402
|
+
value: string;
|
|
403
|
+
}, {
|
|
404
|
+
label: string;
|
|
405
|
+
value: string;
|
|
406
|
+
}>, "many">;
|
|
407
|
+
}, "strip", z.ZodTypeAny, {
|
|
408
|
+
options: {
|
|
409
|
+
label: string;
|
|
410
|
+
value: string;
|
|
411
|
+
}[];
|
|
412
|
+
type: "dropdown";
|
|
413
|
+
text?: string | undefined;
|
|
414
|
+
message?: string | undefined;
|
|
415
|
+
}, {
|
|
416
|
+
options: {
|
|
417
|
+
label: string;
|
|
418
|
+
value: string;
|
|
419
|
+
}[];
|
|
420
|
+
type: "dropdown";
|
|
421
|
+
text?: string | undefined;
|
|
422
|
+
message?: string | undefined;
|
|
423
|
+
}>, import("./Utils.ts").WithBubble<{
|
|
424
|
+
blocks: (import("../../index.ts").DropdownBlock | import("../../index.ts").TextBlock)[];
|
|
425
|
+
} & Omit<import("../../index.ts").ColumnBlock, "blocks">>, {
|
|
426
|
+
options: {
|
|
427
|
+
label: string;
|
|
428
|
+
value: string;
|
|
429
|
+
}[];
|
|
430
|
+
type: "dropdown";
|
|
431
|
+
text?: string | undefined;
|
|
432
|
+
message?: string | undefined;
|
|
433
|
+
}>]>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { TextBlock } from '../../types';
|
|
3
|
+
import { WithBubble } from './Utils';
|
|
4
|
+
export declare const TextSchema: z.ZodEffects<z.ZodObject<{
|
|
5
|
+
type: z.ZodLiteral<"text">;
|
|
6
|
+
text: z.ZodString;
|
|
7
|
+
markdown: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
text: string;
|
|
10
|
+
type: "text";
|
|
11
|
+
markdown?: boolean | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
text: string;
|
|
14
|
+
type: "text";
|
|
15
|
+
markdown?: boolean | undefined;
|
|
16
|
+
}>, WithBubble<TextBlock>, {
|
|
17
|
+
text: string;
|
|
18
|
+
type: "text";
|
|
19
|
+
markdown?: boolean | undefined;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { VideoBlock } from '../../types';
|
|
3
|
+
export declare const VideoSchema: z.ZodEffects<z.ZodObject<{
|
|
4
|
+
type: z.ZodLiteral<"video">;
|
|
5
|
+
video: z.ZodString;
|
|
6
|
+
title: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
video: string;
|
|
9
|
+
type: "video";
|
|
10
|
+
title?: string | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
video: string;
|
|
13
|
+
type: "video";
|
|
14
|
+
title?: string | undefined;
|
|
15
|
+
}>, VideoBlock, {
|
|
16
|
+
video: string;
|
|
17
|
+
type: "video";
|
|
18
|
+
title?: string | undefined;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AudioBlock } from '../../types';
|
|
3
|
+
export declare const VoiceSchema: z.ZodEffects<z.ZodObject<{
|
|
4
|
+
type: z.ZodLiteral<"voice">;
|
|
5
|
+
audio: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
audio: string;
|
|
8
|
+
type: "voice";
|
|
9
|
+
}, {
|
|
10
|
+
audio: string;
|
|
11
|
+
type: "voice";
|
|
12
|
+
}>, AudioBlock, {
|
|
13
|
+
audio: string;
|
|
14
|
+
type: "voice";
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './Audio';
|
|
2
|
+
export * from './Card';
|
|
3
|
+
export * from './Carousel';
|
|
4
|
+
export * from './Choice';
|
|
5
|
+
export * from './File';
|
|
6
|
+
export * from './Image';
|
|
7
|
+
export * from './Location';
|
|
8
|
+
export * from './Message';
|
|
9
|
+
export * from './Text';
|
|
10
|
+
export * from './Utils';
|
|
11
|
+
export * from './Video';
|
|
12
|
+
export * from './Voice';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
3
|
+
declare const Avatar: import("react").ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
4
|
+
declare const AvatarImage: import("react").ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & import("react").RefAttributes<HTMLImageElement>, "ref"> & import("react").RefAttributes<HTMLImageElement>>;
|
|
5
|
+
declare const AvatarFallback: import("react").ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
6
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BlockMap, CommonBlockProps } from '../types';
|
|
2
|
+
export declare const Block: <T extends "button" | "audio" | "video" | "image" | "text" | "row" | "location" | "column" | "file" | "bubble" | "carousel" | "dropdown">({ block, styles, ...props }: {
|
|
3
|
+
block: BlockMap[T];
|
|
4
|
+
} & CommonBlockProps) => JSX.Element;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
declare const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
composerHidden?: boolean;
|
|
14
|
-
} & WrappedComponentProps & Pick<StoreDef, 'botName' | 'composerPlaceholder' | 'intl' | 'focusedArea' | 'sendMessage' | 'sendVoiceMessage' | 'focusPrevious' | 'focusNext' | 'recallHistory' | 'setFocus' | 'updateMessage' | 'message' | 'enableVoiceComposer' | 'currentConversation' | 'preferredLanguage'>;
|
|
1
|
+
import { ComponentProps, FC } from 'react';
|
|
2
|
+
import { type StyleOptions } from '../contexts';
|
|
3
|
+
import { Theme } from '../schemas';
|
|
4
|
+
declare const Composer: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
5
|
+
declare const ComposerInput: import("react").MemoExoticComponent<({ ...props }: ComponentProps<'textarea'>) => JSX.Element>;
|
|
6
|
+
type ComposerButtonStyle = NonNullable<Theme['composer']>['button'];
|
|
7
|
+
type ComposerButtonProps = {
|
|
8
|
+
icon?: FC<StyleOptions>;
|
|
9
|
+
styles?: ComposerButtonStyle;
|
|
10
|
+
} & ComponentProps<'button'>;
|
|
11
|
+
declare const ComposerButton: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<ComposerButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>>;
|
|
12
|
+
export { Composer, ComposerInput, ComposerButton };
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import { RootStore, StoreDef } from '../store';
|
|
4
|
-
declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<ContainerProps, "intl"> & {
|
|
5
|
-
forwardedRef?: React.Ref<any> | undefined;
|
|
6
|
-
} & React.RefAttributes<any>> & {
|
|
7
|
-
WrappedComponent: React.ComponentType<ContainerProps>;
|
|
8
|
-
} & import("mobx-react").IWrappedComponent<unknown>;
|
|
9
|
-
export default _default;
|
|
10
|
-
declare type ContainerProps = {
|
|
11
|
-
store?: RootStore;
|
|
12
|
-
} & WrappedComponentProps & Pick<StoreDef, 'config' | 'botName' | 'isFullscreen' | 'isConversationsDisplayed' | 'isBotInfoDisplayed' | 'sideTransition' | 'isInitialized' | 'dimensions' | 'isPoweredByDisplayed' | 'rtl'>;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Container: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,26 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import { ComponentProps, FC, ReactNode } from 'react';
|
|
2
|
+
import { StyleOptions } from '../contexts';
|
|
3
|
+
type HeaderProps = {
|
|
4
|
+
defaultOpen?: boolean;
|
|
5
|
+
open?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
onOpenChange?(open: boolean): void;
|
|
8
|
+
} & ComponentProps<'div'>;
|
|
9
|
+
type ContentProps = {
|
|
10
|
+
asChild?: true | undefined;
|
|
11
|
+
} & ComponentProps<'button'>;
|
|
12
|
+
type ExpandedContentProps = {
|
|
13
|
+
asChild?: true | undefined;
|
|
14
|
+
forceMount?: true | undefined;
|
|
15
|
+
} & ComponentProps<'div'>;
|
|
16
|
+
type DescriptionItemProps = {
|
|
17
|
+
title?: ReactNode;
|
|
18
|
+
icon?: FC<StyleOptions>;
|
|
19
|
+
link?: string;
|
|
20
|
+
};
|
|
21
|
+
declare const HeaderNamespace: import("react").NamedExoticComponent<Omit<HeaderProps, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
22
|
+
readonly type: import("react").ForwardRefExoticComponent<Omit<HeaderProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
23
|
+
} & {
|
|
24
|
+
Content: import("react").ForwardRefExoticComponent<Omit<ContentProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
25
|
+
ExpandedContent: import("react").ForwardRefExoticComponent<Omit<ExpandedContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
|
+
Avatar: import("react").ForwardRefExoticComponent<{
|
|
27
|
+
src?: string | undefined;
|
|
28
|
+
} & {
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
} & import("react").RefAttributes<HTMLSpanElement>>;
|
|
31
|
+
Description: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
32
|
+
Title: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
33
|
+
Actions: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
34
|
+
DescriptionItem: ({ icon, title, link, ...props }: DescriptionItemProps) => JSX.Element | null;
|
|
35
|
+
};
|
|
36
|
+
export { HeaderNamespace as Header };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import type { MessageObject } from '../types';
|
|
3
|
+
type MessageProps = {
|
|
4
|
+
scroll: () => void;
|
|
5
|
+
} & Partial<MessageObject> & ComponentProps<'div'>;
|
|
6
|
+
export declare const Message: import("react").ForwardRefExoticComponent<Omit<MessageProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as Dialog from '@radix-ui/react-dialog';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export declare function Modal({ open, onOpenChange, children, }: {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
onOpenChange?: (open: boolean) => void;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}): JSX.Element;
|
|
8
|
+
export declare namespace Modal {
|
|
9
|
+
var Button: import("react").ForwardRefExoticComponent<Dialog.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
var Close: import("react").ForwardRefExoticComponent<Dialog.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
var Content: typeof ModalContent;
|
|
12
|
+
}
|
|
13
|
+
declare function ModalContent({ title, children }: {
|
|
14
|
+
title: string;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}): JSX.Element;
|
|
17
|
+
export {};
|