@robylon/web-react-sdk 2.0.0-alpha.10 → 2.0.0-alpha.11
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/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/constants/iframeActions.d.ts +2 -1
- package/dist/cjs/types/utils/launcherInfo.d.ts +1 -2
- package/dist/cjs/types/utils/url.d.ts +1 -0
- package/dist/cjs/types/utils/urlChangeEvents.d.ts +5 -0
- package/dist/cjs/types/utils/urlChangeMessage.d.ts +16 -0
- package/dist/cjs/types/vanilla/components/ChatbotIframe.d.ts +2 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/constants/iframeActions.d.ts +2 -1
- package/dist/esm/types/utils/launcherInfo.d.ts +1 -2
- package/dist/esm/types/utils/url.d.ts +1 -0
- package/dist/esm/types/utils/urlChangeEvents.d.ts +5 -0
- package/dist/esm/types/utils/urlChangeMessage.d.ts +16 -0
- package/dist/esm/types/vanilla/components/ChatbotIframe.d.ts +2 -0
- package/dist/umd/robylon-chatbot.js +1 -1
- package/dist/umd/robylon-chatbot.js.map +1 -1
- package/dist/umd/types/constants/iframeActions.d.ts +2 -1
- package/dist/umd/types/utils/launcherInfo.d.ts +1 -2
- package/dist/umd/types/utils/url.d.ts +1 -0
- package/dist/umd/types/utils/urlChangeEvents.d.ts +5 -0
- package/dist/umd/types/utils/urlChangeMessage.d.ts +16 -0
- package/dist/umd/types/vanilla/components/ChatbotIframe.d.ts +2 -0
- package/package.json +1 -1
|
@@ -6,5 +6,6 @@ export declare enum IframeAction {
|
|
|
6
6
|
I_CLICKED_PROACTIVE_BUBBLE = "i_clicked_proactive_bubble",
|
|
7
7
|
CAPTURED_SESSION_DATA = "capturedSessionData",
|
|
8
8
|
UPDATE_USER_PROFILE = "updateUserProfile",
|
|
9
|
-
OPENED_IFRAME_EVENT = "openedIframe"
|
|
9
|
+
OPENED_IFRAME_EVENT = "openedIframe",
|
|
10
|
+
I_CHANGED_URL = "i_changed_url"
|
|
10
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SystemInfo } from "./systemInfo";
|
|
2
|
-
interface LauncherInfo {
|
|
2
|
+
export interface LauncherInfo {
|
|
3
3
|
current_page_url: string;
|
|
4
4
|
browser_language: string;
|
|
5
5
|
browser_version: string;
|
|
@@ -8,4 +8,3 @@ interface LauncherInfo {
|
|
|
8
8
|
system_info?: SystemInfo;
|
|
9
9
|
}
|
|
10
10
|
export declare const getLauncherInfo: () => LauncherInfo;
|
|
11
|
-
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ConditionType, DisplayAttributesType } from "src/types";
|
|
2
2
|
type UrlChangeListener = (href: string) => void;
|
|
3
3
|
export declare const getCurrentHref: () => string;
|
|
4
|
+
export declare const getPreviousHref: () => string;
|
|
4
5
|
export declare const buildLocationKey: () => string;
|
|
5
6
|
export declare const subscribeToUrlChanges: (cb: UrlChangeListener) => (() => void);
|
|
6
7
|
export declare const initUrlObserver: () => void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IframeAction } from "../constants/iframeActions";
|
|
2
|
+
import { UrlChangeEvent } from "./urlChangeEvents";
|
|
3
|
+
export declare const getIframePageContext: (prevUrl?: string) => {
|
|
4
|
+
prev_url: string;
|
|
5
|
+
current_url: string;
|
|
6
|
+
launcher_info: import("./launcherInfo").LauncherInfo;
|
|
7
|
+
};
|
|
8
|
+
export declare const buildUrlChangeIframePayload: (event: UrlChangeEvent) => {
|
|
9
|
+
domain: string;
|
|
10
|
+
action: IframeAction;
|
|
11
|
+
data: {
|
|
12
|
+
prev_url: string;
|
|
13
|
+
current_url: string;
|
|
14
|
+
launcher_info: import("./launcherInfo").LauncherInfo;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -42,6 +42,7 @@ export declare class ChatbotIframe {
|
|
|
42
42
|
private overridesPayloadCache;
|
|
43
43
|
private proactiveDataSentInRegistration;
|
|
44
44
|
private openedDueToProactive;
|
|
45
|
+
private urlUnsubscribe;
|
|
45
46
|
private buildOverridesPayload;
|
|
46
47
|
private hasUserProvidedOverrides;
|
|
47
48
|
/**
|
|
@@ -70,6 +71,7 @@ export declare class ChatbotIframe {
|
|
|
70
71
|
* Sets up event listeners
|
|
71
72
|
*/
|
|
72
73
|
private setupEventListeners;
|
|
74
|
+
private sendUrlChangeToIframe;
|
|
73
75
|
/**
|
|
74
76
|
* Handles messages from the iframe
|
|
75
77
|
*/
|