@botpress/webchat 2.3.1 → 2.3.2
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/.eslintrc.js +11 -0
- package/.turbo/turbo-build.log +16 -15
- package/dist/adapters/index.d.ts +1 -6
- package/dist/adapters/target.d.ts +1 -6
- package/dist/adapters/typings.d.ts +1 -6
- package/dist/adapters/webchat-to-target.d.ts +8 -0
- package/dist/adapters/webchat.d.ts +3 -1986
- package/dist/client/state-machine.d.ts +1 -1
- package/dist/client/types.d.ts +1 -0
- package/dist/components/MessageList/MessageList.d.ts +1 -1
- package/dist/components/renderers/Audio/Audio.d.ts +1 -0
- package/dist/components/renderers/Carousel/Carousel.d.ts +1 -0
- package/dist/components/renderers/File/File.d.ts +1 -0
- package/dist/components/renderers/Image/Image.d.ts +1 -0
- package/dist/components/renderers/Location/Location.d.ts +1 -0
- package/dist/components/renderers/Video/Video.d.ts +1 -0
- package/dist/gen/signals/index.d.ts +34 -34
- package/dist/gen/signals/messageCreated.z.d.ts +34 -34
- package/dist/index.js +67478 -25250
- package/dist/index.umd.cjs +172 -127
- package/dist/schemas/init.d.ts +14 -14
- package/dist/schemas/theme.d.ts +8 -8
- package/dist/stores/offlineStore.d.ts +1 -1
- package/dist/stores/webchatStore.d.ts +2 -2
- package/dist/types/block-type.d.ts +2 -0
- package/package.json +21 -22
- package/dist/adapters/adapters/messaging-to-target.d.ts +0 -184
- package/dist/adapters/adapters/messaging-to-webchat.d.ts +0 -5
- package/dist/adapters/adapters/webchat-to-messaging.d.ts +0 -223
- package/dist/adapters/adapters/webchat-to-target.d.ts +0 -197
- package/dist/adapters/messaging.d.ts +0 -1455
- package/dist/adapters/sdk.d.ts +0 -472
- package/dist/client/inner-client/event-emitter.d.ts +0 -10
- package/dist/client/inner-client/eventsource.d.ts +0 -22
- package/dist/client/inner-client/index.d.ts +0 -42
- package/dist/client/inner-client/signal-listener.d.ts +0 -47
- package/openapi.ts +0 -35
package/dist/schemas/init.d.ts
CHANGED
|
@@ -2380,7 +2380,7 @@ export declare const configPropsSchema: z.ZodObject<{
|
|
|
2380
2380
|
} | undefined;
|
|
2381
2381
|
}>>;
|
|
2382
2382
|
}, "strip", z.ZodTypeAny, {
|
|
2383
|
-
text: Partial<Record<"
|
|
2383
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
2384
2384
|
className?: string | undefined;
|
|
2385
2385
|
style?: import("react").CSSProperties | undefined;
|
|
2386
2386
|
} | undefined>>;
|
|
@@ -2491,7 +2491,7 @@ export declare const configPropsSchema: z.ZodObject<{
|
|
|
2491
2491
|
} | undefined;
|
|
2492
2492
|
} | undefined;
|
|
2493
2493
|
}, {
|
|
2494
|
-
text: Partial<Record<"
|
|
2494
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
2495
2495
|
className?: string | undefined;
|
|
2496
2496
|
style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2497
2497
|
} | undefined>>;
|
|
@@ -2622,7 +2622,7 @@ export declare const configPropsSchema: z.ZodObject<{
|
|
|
2622
2622
|
} | undefined;
|
|
2623
2623
|
} | undefined;
|
|
2624
2624
|
blocks?: {
|
|
2625
|
-
text: Partial<Record<"
|
|
2625
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
2626
2626
|
className?: string | undefined;
|
|
2627
2627
|
style?: import("react").CSSProperties | undefined;
|
|
2628
2628
|
} | undefined>>;
|
|
@@ -2753,7 +2753,7 @@ export declare const configPropsSchema: z.ZodObject<{
|
|
|
2753
2753
|
} | undefined;
|
|
2754
2754
|
} | undefined;
|
|
2755
2755
|
blocks?: {
|
|
2756
|
-
text: Partial<Record<"
|
|
2756
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
2757
2757
|
className?: string | undefined;
|
|
2758
2758
|
style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2759
2759
|
} | undefined>>;
|
|
@@ -3204,7 +3204,7 @@ export declare const configPropsSchema: z.ZodObject<{
|
|
|
3204
3204
|
} | undefined;
|
|
3205
3205
|
} | undefined;
|
|
3206
3206
|
blocks?: {
|
|
3207
|
-
text: Partial<Record<"
|
|
3207
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
3208
3208
|
className?: string | undefined;
|
|
3209
3209
|
style?: import("react").CSSProperties | undefined;
|
|
3210
3210
|
} | undefined>>;
|
|
@@ -3625,7 +3625,7 @@ export declare const configPropsSchema: z.ZodObject<{
|
|
|
3625
3625
|
} | undefined;
|
|
3626
3626
|
} | undefined;
|
|
3627
3627
|
blocks?: {
|
|
3628
|
-
text: Partial<Record<"
|
|
3628
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
3629
3629
|
className?: string | undefined;
|
|
3630
3630
|
style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
3631
3631
|
} | undefined>>;
|
|
@@ -4094,7 +4094,7 @@ export declare const configPropsSchema: z.ZodObject<{
|
|
|
4094
4094
|
} | undefined;
|
|
4095
4095
|
} | undefined;
|
|
4096
4096
|
blocks?: {
|
|
4097
|
-
text: Partial<Record<"
|
|
4097
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
4098
4098
|
className?: string | undefined;
|
|
4099
4099
|
style?: import("react").CSSProperties | undefined;
|
|
4100
4100
|
} | undefined>>;
|
|
@@ -6597,7 +6597,7 @@ export declare const initPropsSchema: z.ZodObject<{
|
|
|
6597
6597
|
} | undefined;
|
|
6598
6598
|
}>>;
|
|
6599
6599
|
}, "strip", z.ZodTypeAny, {
|
|
6600
|
-
text: Partial<Record<"
|
|
6600
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
6601
6601
|
className?: string | undefined;
|
|
6602
6602
|
style?: import("react").CSSProperties | undefined;
|
|
6603
6603
|
} | undefined>>;
|
|
@@ -6708,7 +6708,7 @@ export declare const initPropsSchema: z.ZodObject<{
|
|
|
6708
6708
|
} | undefined;
|
|
6709
6709
|
} | undefined;
|
|
6710
6710
|
}, {
|
|
6711
|
-
text: Partial<Record<"
|
|
6711
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
6712
6712
|
className?: string | undefined;
|
|
6713
6713
|
style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
6714
6714
|
} | undefined>>;
|
|
@@ -6839,7 +6839,7 @@ export declare const initPropsSchema: z.ZodObject<{
|
|
|
6839
6839
|
} | undefined;
|
|
6840
6840
|
} | undefined;
|
|
6841
6841
|
blocks?: {
|
|
6842
|
-
text: Partial<Record<"
|
|
6842
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
6843
6843
|
className?: string | undefined;
|
|
6844
6844
|
style?: import("react").CSSProperties | undefined;
|
|
6845
6845
|
} | undefined>>;
|
|
@@ -6970,7 +6970,7 @@ export declare const initPropsSchema: z.ZodObject<{
|
|
|
6970
6970
|
} | undefined;
|
|
6971
6971
|
} | undefined;
|
|
6972
6972
|
blocks?: {
|
|
6973
|
-
text: Partial<Record<"
|
|
6973
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
6974
6974
|
className?: string | undefined;
|
|
6975
6975
|
style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
6976
6976
|
} | undefined>>;
|
|
@@ -7421,7 +7421,7 @@ export declare const initPropsSchema: z.ZodObject<{
|
|
|
7421
7421
|
} | undefined;
|
|
7422
7422
|
} | undefined;
|
|
7423
7423
|
blocks?: {
|
|
7424
|
-
text: Partial<Record<"
|
|
7424
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
7425
7425
|
className?: string | undefined;
|
|
7426
7426
|
style?: import("react").CSSProperties | undefined;
|
|
7427
7427
|
} | undefined>>;
|
|
@@ -7842,7 +7842,7 @@ export declare const initPropsSchema: z.ZodObject<{
|
|
|
7842
7842
|
} | undefined;
|
|
7843
7843
|
} | undefined;
|
|
7844
7844
|
blocks?: {
|
|
7845
|
-
text: Partial<Record<"
|
|
7845
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
7846
7846
|
className?: string | undefined;
|
|
7847
7847
|
style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
7848
7848
|
} | undefined>>;
|
|
@@ -8320,7 +8320,7 @@ export declare const initPropsSchema: z.ZodObject<{
|
|
|
8320
8320
|
} | undefined;
|
|
8321
8321
|
} | undefined;
|
|
8322
8322
|
blocks?: {
|
|
8323
|
-
text: Partial<Record<"
|
|
8323
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
8324
8324
|
className?: string | undefined;
|
|
8325
8325
|
style?: import("react").CSSProperties | undefined;
|
|
8326
8326
|
} | undefined>>;
|
package/dist/schemas/theme.d.ts
CHANGED
|
@@ -524,7 +524,7 @@ export declare const blockThemeSchema: z.ZodObject<{
|
|
|
524
524
|
} | undefined;
|
|
525
525
|
}>>;
|
|
526
526
|
}, "strip", z.ZodTypeAny, {
|
|
527
|
-
text: Partial<Record<"
|
|
527
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
528
528
|
className?: string | undefined;
|
|
529
529
|
style?: CSSProperties | undefined;
|
|
530
530
|
} | undefined>>;
|
|
@@ -635,7 +635,7 @@ export declare const blockThemeSchema: z.ZodObject<{
|
|
|
635
635
|
} | undefined;
|
|
636
636
|
} | undefined;
|
|
637
637
|
}, {
|
|
638
|
-
text: Partial<Record<"
|
|
638
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
639
639
|
className?: string | undefined;
|
|
640
640
|
style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
641
641
|
} | undefined>>;
|
|
@@ -2988,7 +2988,7 @@ export declare const themeSchema: z.ZodObject<{
|
|
|
2988
2988
|
} | undefined;
|
|
2989
2989
|
}>>;
|
|
2990
2990
|
}, "strip", z.ZodTypeAny, {
|
|
2991
|
-
text: Partial<Record<"
|
|
2991
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
2992
2992
|
className?: string | undefined;
|
|
2993
2993
|
style?: CSSProperties | undefined;
|
|
2994
2994
|
} | undefined>>;
|
|
@@ -3099,7 +3099,7 @@ export declare const themeSchema: z.ZodObject<{
|
|
|
3099
3099
|
} | undefined;
|
|
3100
3100
|
} | undefined;
|
|
3101
3101
|
}, {
|
|
3102
|
-
text: Partial<Record<"
|
|
3102
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
3103
3103
|
className?: string | undefined;
|
|
3104
3104
|
style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
3105
3105
|
} | undefined>>;
|
|
@@ -3230,7 +3230,7 @@ export declare const themeSchema: z.ZodObject<{
|
|
|
3230
3230
|
} | undefined;
|
|
3231
3231
|
} | undefined;
|
|
3232
3232
|
blocks?: {
|
|
3233
|
-
text: Partial<Record<"
|
|
3233
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
3234
3234
|
className?: string | undefined;
|
|
3235
3235
|
style?: CSSProperties | undefined;
|
|
3236
3236
|
} | undefined>>;
|
|
@@ -3361,7 +3361,7 @@ export declare const themeSchema: z.ZodObject<{
|
|
|
3361
3361
|
} | undefined;
|
|
3362
3362
|
} | undefined;
|
|
3363
3363
|
blocks?: {
|
|
3364
|
-
text: Partial<Record<"
|
|
3364
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
3365
3365
|
className?: string | undefined;
|
|
3366
3366
|
style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
3367
3367
|
} | undefined>>;
|
|
@@ -3812,7 +3812,7 @@ export declare const themeSchema: z.ZodObject<{
|
|
|
3812
3812
|
} | undefined;
|
|
3813
3813
|
} | undefined;
|
|
3814
3814
|
blocks?: {
|
|
3815
|
-
text: Partial<Record<"
|
|
3815
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
3816
3816
|
className?: string | undefined;
|
|
3817
3817
|
style?: CSSProperties | undefined;
|
|
3818
3818
|
} | undefined>>;
|
|
@@ -4233,7 +4233,7 @@ export declare const themeSchema: z.ZodObject<{
|
|
|
4233
4233
|
} | undefined;
|
|
4234
4234
|
} | undefined;
|
|
4235
4235
|
blocks?: {
|
|
4236
|
-
text: Partial<Record<"
|
|
4236
|
+
text: Partial<Record<"link" | "text" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
|
|
4237
4237
|
className?: string | undefined;
|
|
4238
4238
|
style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
4239
4239
|
} | undefined>>;
|
|
@@ -17,7 +17,7 @@ type OfflineStore = {
|
|
|
17
17
|
};
|
|
18
18
|
export declare const useOfflineStore: import("zustand").UseBoundStore<Omit<Omit<import("zustand").StoreApi<OfflineStore>, "setState"> & {
|
|
19
19
|
setState<A extends string | {
|
|
20
|
-
type:
|
|
20
|
+
type: string;
|
|
21
21
|
}>(partial: OfflineStore | Partial<OfflineStore> | ((state: OfflineStore) => OfflineStore | Partial<OfflineStore>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
22
22
|
}, "persist"> & {
|
|
23
23
|
persist: {
|
|
@@ -50,11 +50,11 @@ export type WebchatState = WebchatProps & {
|
|
|
50
50
|
export type WebchatStore = ReturnType<typeof useCreateWebchatStore>;
|
|
51
51
|
export declare const WebchatContext: import("react").Context<(Omit<import("zustand").StoreApi<WebchatState>, "setState"> & {
|
|
52
52
|
setState<A extends string | {
|
|
53
|
-
type:
|
|
53
|
+
type: string;
|
|
54
54
|
}>(partial: WebchatState | Partial<WebchatState> | ((state: WebchatState) => WebchatState | Partial<WebchatState>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
55
55
|
}) | null>;
|
|
56
56
|
export declare const useCreateWebchatStore: (initProps?: Partial<WebchatProps>) => Omit<import("zustand").StoreApi<WebchatState>, "setState"> & {
|
|
57
57
|
setState<A extends string | {
|
|
58
|
-
type:
|
|
58
|
+
type: string;
|
|
59
59
|
}>(partial: WebchatState | Partial<WebchatState> | ((state: WebchatState) => WebchatState | Partial<WebchatState>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
60
60
|
};
|
|
@@ -3,6 +3,7 @@ import { target } from '../adapters';
|
|
|
3
3
|
export type BlockStyles = NonNullable<Theme['message']>['blocks'];
|
|
4
4
|
export type CommonBlockProps = Partial<Pick<MessageObject, 'direction' | 'timestamp' | 'sender'> & {
|
|
5
5
|
messageId: string;
|
|
6
|
+
metadata?: Record<string, any>;
|
|
6
7
|
}>;
|
|
7
8
|
export type AudioBlock = target.AudioMessage;
|
|
8
9
|
export type BubbleBlock = target.BubbleMessage;
|
|
@@ -28,6 +29,7 @@ export type MessageObject<T = BlockObject> = {
|
|
|
28
29
|
disableInput?: boolean;
|
|
29
30
|
sender: Sender;
|
|
30
31
|
timestamp: Date;
|
|
32
|
+
metadata?: Record<string, any>;
|
|
31
33
|
block: T;
|
|
32
34
|
};
|
|
33
35
|
export type BlockObjects = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/webchat",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.umd.cjs",
|
|
@@ -15,32 +15,32 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"check:type": "tsc --noEmit",
|
|
17
17
|
"build": "vite build",
|
|
18
|
-
"test": "vitest run"
|
|
19
|
-
"gen:client": "OUT_DIR=./src/gen es-node ./openapi"
|
|
18
|
+
"test": "vitest run"
|
|
20
19
|
},
|
|
21
20
|
"dependencies": {
|
|
21
|
+
"@bpinternal/webchat-http-client": "0.2.0",
|
|
22
22
|
"@floating-ui/react": "^0.25.4",
|
|
23
|
-
"@headlessui/react": "1.
|
|
23
|
+
"@headlessui/react": "^2.1.8",
|
|
24
24
|
"@heroicons/react": "^2.1.5",
|
|
25
25
|
"@radix-ui/react-avatar": "^1.0.3",
|
|
26
|
-
"@radix-ui/react-collapsible": "^1.
|
|
27
|
-
"@radix-ui/react-dialog": "^1.
|
|
28
|
-
"@radix-ui/react-scroll-area": "^1.0
|
|
26
|
+
"@radix-ui/react-collapsible": "^1.1.1",
|
|
27
|
+
"@radix-ui/react-dialog": "^1.1.2",
|
|
28
|
+
"@radix-ui/react-scroll-area": "^1.2.0",
|
|
29
29
|
"@redux-devtools/extension": "^3.3.0",
|
|
30
30
|
"@types/deep-equal": "^1.0.4",
|
|
31
|
-
"@types/qs": "^6.9.
|
|
31
|
+
"@types/qs": "^6.9.15",
|
|
32
32
|
"@types/react-scroll-to-bottom": "^4.2.5",
|
|
33
33
|
"@types/react-textarea-autosize": "^8.0.0",
|
|
34
34
|
"axios": "1.2.5",
|
|
35
|
-
"clsx": "^2.
|
|
35
|
+
"clsx": "^2.1.1",
|
|
36
36
|
"dayjs": "^1.11.10",
|
|
37
37
|
"deep-equal": "^2.2.3",
|
|
38
38
|
"embla-carousel-react": "8.0.0-rc11",
|
|
39
39
|
"event-source-polyfill": "^1.0.31",
|
|
40
40
|
"exponential-backoff": "^3.1.1",
|
|
41
|
-
"qs": "^6.
|
|
42
|
-
"react": "^18.
|
|
43
|
-
"react-dom": "^18.
|
|
41
|
+
"qs": "^6.12.1",
|
|
42
|
+
"react": "^18.3.1",
|
|
43
|
+
"react-dom": "^18.3.1",
|
|
44
44
|
"react-hot-toast": "^2.4.1",
|
|
45
45
|
"react-markdown": "^9.0.1",
|
|
46
46
|
"react-scroll-to-bottom": "^4.2.0",
|
|
@@ -50,25 +50,24 @@
|
|
|
50
50
|
"remark-gfm": "^4.0.0",
|
|
51
51
|
"theme-colors": "^0.1.0",
|
|
52
52
|
"uuid": "^9.0.1",
|
|
53
|
-
"zod": "^3.
|
|
53
|
+
"zod": "^3.22.4",
|
|
54
54
|
"zustand": "^4.4.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
57
|
+
"@repo/eslint-config": "workspace:*",
|
|
58
|
+
"@repo/typescript-config": "workspace:*",
|
|
59
59
|
"@types/dom-speech-recognition": "^0.0.4",
|
|
60
60
|
"@types/event-source-polyfill": "^1.0.2",
|
|
61
61
|
"@types/json-schema": "^7.0.15",
|
|
62
|
-
"@types/react": "
|
|
63
|
-
"@types/react-dom": "
|
|
62
|
+
"@types/react": "18.3.10",
|
|
63
|
+
"@types/react-dom": "18.3.1",
|
|
64
64
|
"@types/uuid": "^9.0.7",
|
|
65
65
|
"@types/web": "^0.0.115",
|
|
66
|
-
"@vitejs/plugin-react-swc": "^3.
|
|
67
|
-
"vite": "^4.
|
|
66
|
+
"@vitejs/plugin-react-swc": "^3.3.2",
|
|
67
|
+
"vite": "^5.4.8",
|
|
68
68
|
"vite-plugin-dts": "^3.5.4",
|
|
69
69
|
"vite-plugin-libcss": "^1.1.1",
|
|
70
|
-
"vite-plugin-svgr": "^
|
|
71
|
-
"vitest": "
|
|
72
|
-
"webchat-api": "workspace:*"
|
|
70
|
+
"vite-plugin-svgr": "^4.2.0",
|
|
71
|
+
"vitest": "1.6.0"
|
|
73
72
|
}
|
|
74
73
|
}
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import * as messaging from '../messaging';
|
|
2
|
-
import * as target from '../target';
|
|
3
|
-
import * as types from '../typings';
|
|
4
|
-
type WithBubble<T extends target.Message> = target.BubbleOf<T>;
|
|
5
|
-
export type MessagingToTargetAdapters = types.Adapter<messaging.Messages, target.AdaptersOutput>;
|
|
6
|
-
export declare const audioAdapter: ({ type, audio }: {
|
|
7
|
-
type: "audio";
|
|
8
|
-
audio: string;
|
|
9
|
-
className?: string | undefined;
|
|
10
|
-
avatarUrl?: string | undefined;
|
|
11
|
-
title?: string | undefined;
|
|
12
|
-
}) => {
|
|
13
|
-
payload: {
|
|
14
|
-
type: "audio";
|
|
15
|
-
url: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export declare const cardAdapter: (card: {
|
|
19
|
-
type: "card";
|
|
20
|
-
title: string;
|
|
21
|
-
actions: ({
|
|
22
|
-
text: string;
|
|
23
|
-
title: string;
|
|
24
|
-
action: "Say something";
|
|
25
|
-
} | {
|
|
26
|
-
title: string;
|
|
27
|
-
action: "Open URL";
|
|
28
|
-
url: string;
|
|
29
|
-
} | {
|
|
30
|
-
title: string;
|
|
31
|
-
action: "Postback";
|
|
32
|
-
payload: string;
|
|
33
|
-
})[];
|
|
34
|
-
className?: string | undefined;
|
|
35
|
-
avatarUrl?: string | undefined;
|
|
36
|
-
subtitle?: string | undefined;
|
|
37
|
-
image?: string | undefined;
|
|
38
|
-
}) => {
|
|
39
|
-
payload: WithBubble<target.ColumnMessage>;
|
|
40
|
-
};
|
|
41
|
-
export declare const carouselAdapter: ({ items }: {
|
|
42
|
-
type: "carousel";
|
|
43
|
-
items: {
|
|
44
|
-
type: "card";
|
|
45
|
-
title: string;
|
|
46
|
-
actions: ({
|
|
47
|
-
text: string;
|
|
48
|
-
title: string;
|
|
49
|
-
action: "Say something";
|
|
50
|
-
} | {
|
|
51
|
-
title: string;
|
|
52
|
-
action: "Open URL";
|
|
53
|
-
url: string;
|
|
54
|
-
} | {
|
|
55
|
-
title: string;
|
|
56
|
-
action: "Postback";
|
|
57
|
-
payload: string;
|
|
58
|
-
})[];
|
|
59
|
-
className?: string | undefined;
|
|
60
|
-
avatarUrl?: string | undefined;
|
|
61
|
-
subtitle?: string | undefined;
|
|
62
|
-
image?: string | undefined;
|
|
63
|
-
}[];
|
|
64
|
-
className?: string | undefined;
|
|
65
|
-
avatarUrl?: string | undefined;
|
|
66
|
-
}) => {
|
|
67
|
-
payload: {
|
|
68
|
-
type: "carousel";
|
|
69
|
-
blocks: target.ColumnMessage[];
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
export declare const choiceAdapter: (x: {
|
|
73
|
-
type: "single-choice";
|
|
74
|
-
text: string;
|
|
75
|
-
choices: {
|
|
76
|
-
value: string;
|
|
77
|
-
title: string;
|
|
78
|
-
}[];
|
|
79
|
-
className?: string | undefined;
|
|
80
|
-
avatarUrl?: string | undefined;
|
|
81
|
-
disableFreeText?: boolean | undefined;
|
|
82
|
-
}) => {
|
|
83
|
-
disableInput: boolean | undefined;
|
|
84
|
-
payload: target.Message;
|
|
85
|
-
};
|
|
86
|
-
export declare const dropdownAdapter: (x: {
|
|
87
|
-
type: "dropdown";
|
|
88
|
-
options: {
|
|
89
|
-
value: string;
|
|
90
|
-
label: string;
|
|
91
|
-
}[];
|
|
92
|
-
className?: string | undefined;
|
|
93
|
-
avatarUrl?: string | undefined;
|
|
94
|
-
message?: string | undefined;
|
|
95
|
-
allowCreation?: boolean | undefined;
|
|
96
|
-
placeholderText?: string | undefined;
|
|
97
|
-
allowMultiple?: boolean | undefined;
|
|
98
|
-
buttonText?: string | undefined;
|
|
99
|
-
width?: number | undefined;
|
|
100
|
-
displayInKeyboard?: boolean | undefined;
|
|
101
|
-
markdown?: boolean | undefined;
|
|
102
|
-
text?: string | undefined;
|
|
103
|
-
}) => {
|
|
104
|
-
disableInput: true;
|
|
105
|
-
payload: WithBubble<target.ColumnMessage>;
|
|
106
|
-
};
|
|
107
|
-
export declare const fileAdapter: ({ file, ...props }: {
|
|
108
|
-
type: "file";
|
|
109
|
-
file: string;
|
|
110
|
-
className?: string | undefined;
|
|
111
|
-
avatarUrl?: string | undefined;
|
|
112
|
-
title?: string | undefined;
|
|
113
|
-
}) => {
|
|
114
|
-
payload: {
|
|
115
|
-
type: "file";
|
|
116
|
-
className?: string | undefined;
|
|
117
|
-
avatarUrl?: string | undefined;
|
|
118
|
-
title?: string | undefined;
|
|
119
|
-
url: string;
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
export declare const imageAdapter: ({ type, image }: {
|
|
123
|
-
type: "image";
|
|
124
|
-
image: string;
|
|
125
|
-
className?: string | undefined;
|
|
126
|
-
avatarUrl?: string | undefined;
|
|
127
|
-
}) => {
|
|
128
|
-
payload: {
|
|
129
|
-
type: "image";
|
|
130
|
-
url: string;
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
|
-
export declare const locationAdapter: ({ type, latitude, longitude, title, address }: {
|
|
134
|
-
type: "location";
|
|
135
|
-
latitude: number;
|
|
136
|
-
longitude: number;
|
|
137
|
-
className?: string | undefined;
|
|
138
|
-
avatarUrl?: string | undefined;
|
|
139
|
-
address?: string | undefined;
|
|
140
|
-
title?: string | undefined;
|
|
141
|
-
}) => {
|
|
142
|
-
payload: {
|
|
143
|
-
type: "location";
|
|
144
|
-
latitude: number;
|
|
145
|
-
longitude: number;
|
|
146
|
-
title: string;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
export declare const quickReplyAdapter: ({ text, payload }: {
|
|
150
|
-
type: "quick_reply";
|
|
151
|
-
text: string;
|
|
152
|
-
payload?: string | undefined;
|
|
153
|
-
}) => {
|
|
154
|
-
payload: {
|
|
155
|
-
type: "text";
|
|
156
|
-
text: string;
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
export declare const textAdapter: ({ type, text }: {
|
|
160
|
-
type: "text";
|
|
161
|
-
text: string;
|
|
162
|
-
className?: string | undefined;
|
|
163
|
-
avatarUrl?: string | undefined;
|
|
164
|
-
markdown?: boolean | undefined;
|
|
165
|
-
}) => {
|
|
166
|
-
payload: WithBubble<{
|
|
167
|
-
type: "text";
|
|
168
|
-
text: string;
|
|
169
|
-
}>;
|
|
170
|
-
};
|
|
171
|
-
export declare const videoAdapter: ({ type, video }: {
|
|
172
|
-
type: "video";
|
|
173
|
-
video: string;
|
|
174
|
-
className?: string | undefined;
|
|
175
|
-
avatarUrl?: string | undefined;
|
|
176
|
-
title?: string | undefined;
|
|
177
|
-
}) => {
|
|
178
|
-
payload: {
|
|
179
|
-
type: "video";
|
|
180
|
-
url: string;
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
export declare const messageAdapter: (message: messaging.Message) => target.AdapterOutput;
|
|
184
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as webchat from '../webchat';
|
|
2
|
-
import * as messaging from '../messaging';
|
|
3
|
-
import * as types from '../typings';
|
|
4
|
-
export type MessagingToWebChatMessageAdapters = types.Adapter<messaging.Messages, webchat.Messages>;
|
|
5
|
-
export declare const messageAdapter: (message: messaging.Message) => webchat.Message;
|