@archbee/app-widget 1.1.25 → 1.1.27
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 +1 -0
- package/index.esm.js +457 -311
- package/package.json +1 -1
- package/src/lib/main.d.ts +13 -20
- package/src/lib/scripts/initScripts.d.ts +1 -1
- package/src/lib/scripts/render.d.ts +1 -1
- package/src/lib/types.d.ts +5 -4
package/package.json
CHANGED
package/src/lib/main.d.ts
CHANGED
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { AbWidgetData, AbWidgetRef } from './types';
|
|
3
|
+
type CommonWidgetData = Omit<AbWidgetData, 'spaceId' | 'isOpen' | 'eventType' | 'collectionId' | 'onRenderFinish' | 'hasExecuted'>;
|
|
4
|
+
export declare const ArchbeeAppWidget: import("react").ForwardRefExoticComponent<{
|
|
3
5
|
spaceId: string;
|
|
4
|
-
docId?: string;
|
|
5
|
-
jwt?: string;
|
|
6
|
-
className?: string;
|
|
7
|
-
shareableToken?: string;
|
|
8
|
-
widgetType: WidgetType;
|
|
9
|
-
bubble?: BubbleType;
|
|
10
|
-
blockId?: string;
|
|
11
6
|
user?: {
|
|
12
|
-
id: string;
|
|
13
|
-
email?: string;
|
|
14
|
-
first_name?: string;
|
|
15
|
-
last_name?: string;
|
|
16
|
-
profile_image_url?: string;
|
|
17
7
|
[key: string]: any;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
8
|
+
id: string;
|
|
9
|
+
email?: string | undefined;
|
|
10
|
+
first_name?: string | undefined;
|
|
11
|
+
last_name?: string | undefined;
|
|
12
|
+
profile_image_url?: string | undefined;
|
|
13
|
+
} | undefined;
|
|
14
|
+
onWidgetOpen?: Function | undefined;
|
|
15
|
+
onWidgetClose?: Function | undefined;
|
|
16
|
+
} & CommonWidgetData & HTMLAttributes<HTMLDivElement> & {
|
|
24
17
|
children?: import("react").ReactNode;
|
|
25
18
|
} & import("react").RefAttributes<AbWidgetRef>>;
|
|
26
19
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { BubbleType, LoadingStrategy } from '../types';
|
|
2
2
|
export declare const initScripts: () => void;
|
|
3
3
|
export declare const initJsScripts: (loadingStrategy: LoadingStrategy) => void;
|
|
4
|
-
export declare const createArchbeeWidget: (spaceId: string, jwt?: string, shareableToken?: string, loadingStrategy?: LoadingStrategy, bubble?: BubbleType) => any;
|
|
4
|
+
export declare const createArchbeeWidget: (spaceId: string, jwt?: string, shareableToken?: string, loadingStrategy?: LoadingStrategy, bubble?: BubbleType, bubblePlaceholder?: string, anchor?: string) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const render: (component: JSX.Element, cb?: Function) => void;
|
|
1
|
+
export declare const render: (component: JSX.Element, createContainer: Function, cb?: Function) => void;
|
package/src/lib/types.d.ts
CHANGED
|
@@ -18,14 +18,15 @@ export interface AbWidgetData {
|
|
|
18
18
|
docId?: string;
|
|
19
19
|
blockId?: string;
|
|
20
20
|
isOpen: boolean;
|
|
21
|
-
selector: string;
|
|
22
|
-
origin?: string;
|
|
23
21
|
onRenderFinish?: Function;
|
|
24
22
|
hasExecuted: boolean;
|
|
25
23
|
jwt?: string;
|
|
26
24
|
shareableToken?: string;
|
|
27
25
|
widgetType?: WidgetType;
|
|
28
26
|
bubble?: BubbleType;
|
|
27
|
+
bubblePlaceholder?: string;
|
|
28
|
+
anchor?: string;
|
|
29
|
+
loadingStrategy?: LoadingStrategy;
|
|
29
30
|
}
|
|
30
31
|
type AbWidgetActionType = 'ab-doc-open' | 'ab-doc-close';
|
|
31
32
|
export interface AbWidgetAction {
|
|
@@ -34,11 +35,11 @@ export interface AbWidgetAction {
|
|
|
34
35
|
metadata: any;
|
|
35
36
|
}
|
|
36
37
|
export interface AbWidgetOpenAction extends AbWidgetAction {
|
|
37
|
-
type:
|
|
38
|
+
type: AbWidgetActionType;
|
|
38
39
|
metadata: AbWidgetData;
|
|
39
40
|
}
|
|
40
41
|
export interface AbWidgetCloseAction extends AbWidgetAction {
|
|
41
|
-
type:
|
|
42
|
+
type: AbWidgetActionType;
|
|
42
43
|
metadata: undefined;
|
|
43
44
|
}
|
|
44
45
|
export type BubbleType = 'ask' | 'invisible';
|