@botpress/webchat 1.0.27 → 1.0.29

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.
@@ -9,12 +9,12 @@ export type Sender = {
9
9
  name: string;
10
10
  avatar?: string;
11
11
  };
12
- export type MessageObject = {
12
+ export type MessageObject<T = BlockObject> = {
13
13
  direction: 'incoming' | 'outgoing' | 'system';
14
14
  disableInput?: boolean;
15
15
  sender: Sender;
16
16
  timestamp: Date;
17
- block: BlockObject;
17
+ block: T;
18
18
  };
19
19
  export type ButtonBlock = {
20
20
  type: 'button';
@@ -0,0 +1,16 @@
1
+ type DescriptionItem = {
2
+ title: string;
3
+ link?: string;
4
+ };
5
+ export type Configuration = {
6
+ composerPlaceholder?: string;
7
+ botName?: string;
8
+ botAvatar?: string;
9
+ botDescription?: string;
10
+ website?: DescriptionItem;
11
+ email?: DescriptionItem;
12
+ phone?: DescriptionItem;
13
+ privacyPolicy?: DescriptionItem;
14
+ termsOfService?: DescriptionItem;
15
+ };
16
+ export {};
@@ -1,2 +1,3 @@
1
1
  export * from './block-type';
2
2
  export * from './image';
3
+ export * from './configuration';
@@ -0,0 +1,8 @@
1
+ import { OpUnitType } from 'dayjs';
2
+ import { MessageObject } from '../types';
3
+ /**
4
+ * @param interval - The interval to check for date differences (default is 'day')
5
+ * @returns Array of message objects with system date messages inserted at every change of date more than the `interval`
6
+ * */
7
+ export declare function withDateSystemMessages(messages: MessageObject[], interval?: OpUnitType): MessageObject[];
8
+ export declare function humanizeTimestamp(timestamp: Date, long?: boolean): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -177,9 +177,67 @@ export declare function withBaseTheme(theme: Theme): {
177
177
  } | undefined;
178
178
  } | undefined;
179
179
  } | undefined;
180
+ fab?: {
181
+ icon?: {
182
+ className?: string | undefined;
183
+ style?: import("react").CSSProperties | undefined;
184
+ } | undefined;
185
+ container?: {
186
+ className?: string | undefined;
187
+ style?: import("react").CSSProperties | undefined;
188
+ } | undefined;
189
+ } | undefined;
180
190
  messageList?: {
181
- className?: string | undefined;
182
- style?: import("react").CSSProperties | undefined;
191
+ container?: {
192
+ className?: string | undefined;
193
+ style?: import("react").CSSProperties | undefined;
194
+ } | undefined;
195
+ marquee?: {
196
+ content?: {
197
+ className?: string | undefined;
198
+ style?: import("react").CSSProperties | undefined;
199
+ } | undefined;
200
+ title?: {
201
+ className?: string | undefined;
202
+ style?: import("react").CSSProperties | undefined;
203
+ } | undefined;
204
+ description?: {
205
+ className?: string | undefined;
206
+ style?: import("react").CSSProperties | undefined;
207
+ } | undefined;
208
+ avatar?: {
209
+ container?: {
210
+ className?: string | undefined;
211
+ style?: import("react").CSSProperties | undefined;
212
+ } | undefined;
213
+ image?: {
214
+ className?: string | undefined;
215
+ style?: import("react").CSSProperties | undefined;
216
+ } | undefined;
217
+ fallback?: {
218
+ className?: string | undefined;
219
+ style?: import("react").CSSProperties | undefined;
220
+ } | undefined;
221
+ } | undefined;
222
+ container?: {
223
+ className?: string | undefined;
224
+ style?: import("react").CSSProperties | undefined;
225
+ } | undefined;
226
+ } | undefined;
227
+ scrollDownButton?: {
228
+ container?: {
229
+ className?: string | undefined;
230
+ style?: import("react").CSSProperties | undefined;
231
+ } | undefined;
232
+ button?: {
233
+ className?: string | undefined;
234
+ style?: import("react").CSSProperties | undefined;
235
+ } | undefined;
236
+ icon?: {
237
+ className?: string | undefined;
238
+ style?: import("react").CSSProperties | undefined;
239
+ } | undefined;
240
+ } | undefined;
183
241
  } | undefined;
184
242
  message?: {
185
243
  container?: {
@@ -201,7 +259,7 @@ export declare function withBaseTheme(theme: Theme): {
201
259
  } | undefined;
202
260
  } | undefined;
203
261
  blocks?: {
204
- text: Partial<Record<"link" | "pre" | "text" | "bold" | "lineBreak" | "italic" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "orderedList" | "unorderedList" | "listItem", {
262
+ text: Partial<Record<"text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "link" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
205
263
  className?: string | undefined;
206
264
  style?: import("react").CSSProperties | undefined;
207
265
  } | undefined>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botpress/webchat",
3
- "version": "1.0.27",
3
+ "version": "1.0.29",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.umd.cjs",
@@ -16,11 +16,14 @@
16
16
  "type:check": "tsc --noEmit",
17
17
  "dev": "vite --debug --log-level info",
18
18
  "build": "pnpm type:check && vite build",
19
+ "inspect-build": "vite build --sourcemap && npx source-map-explorer dist/index.js --no-border-checks",
19
20
  "bundle": "vite build",
20
21
  "lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
21
- "preview": "vite preview"
22
+ "preview": "vite preview",
23
+ "test": "vitest"
22
24
  },
23
25
  "dependencies": {
26
+ "@botpress/chat": "^0.0.2",
24
27
  "@botpress/messaging-socket": "^1.2.0",
25
28
  "@floating-ui/react": "^0.25.4",
26
29
  "@headlessui/react": "1.7.11",
@@ -31,15 +34,11 @@
31
34
  "@radix-ui/react-dialog": "^1.0.4",
32
35
  "@radix-ui/react-icons": "^1.3.0",
33
36
  "@tailwindcss/container-queries": "^0.1.1",
34
- "@types/color-convert": "^2.0.1",
35
- "@types/lodash": "^4.14.199",
36
- "@types/uuid": "^9.0.3",
37
- "@botpress/chat": "^0.0.1",
38
37
  "classnames": "^2.3.2",
39
38
  "clsx": "^2.0.0",
40
39
  "color-convert": "^2.0.1",
40
+ "dayjs": "^1.11.10",
41
41
  "embla-carousel-react": "8.0.0-rc11",
42
- "google-map-react": "^2.2.1",
43
42
  "lodash": "^4.17.21",
44
43
  "react": "^18.2.0",
45
44
  "react-colorful": "^5.6.1",
@@ -55,6 +54,9 @@
55
54
  "zustand": "^4.4.1"
56
55
  },
57
56
  "devDependencies": {
57
+ "@types/color-convert": "^2.0.1",
58
+ "@types/lodash": "^4.14.199",
59
+ "@types/uuid": "^9.0.3",
58
60
  "@twind/core": "^1.1.3",
59
61
  "@twind/intellisense": "^1.1.3",
60
62
  "@twind/preset-autoprefix": "^1.0.7",
@@ -68,6 +70,7 @@
68
70
  "tailwindcss": "^3.3.2",
69
71
  "typescript": "^5.0.2",
70
72
  "vite": "^4.3.9",
71
- "vite-plugin-dts": "^3.5.4"
73
+ "vite-plugin-dts": "^3.5.4",
74
+ "vitest": "^0.34.6"
72
75
  }
73
76
  }