@ada-support/embed2 1.4.2 → 1.4.3
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/npm-entry/client/store/actions/index.d.ts +1 -1
- package/dist/npm-entry/common/lib/channel.d.ts +2 -2
- package/dist/npm-entry/common/types/events.d.ts +2 -2
- package/dist/npm-entry/common/types/modules.d.ts +1 -1
- package/dist/npm-entry/frames/lib/safe-storage/index.d.ts +2 -2
- package/dist/npm-entry/index.js +21 -21
- package/dist/npm-entry/services/persistence/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import type { MessagePayload } from "common/types/events";
|
|
|
4
4
|
import type { DirectDispatch } from "common/types/store";
|
|
5
5
|
import type { StoreState } from "common/types/store-state";
|
|
6
6
|
export declare const actions: {
|
|
7
|
-
[key in ActionCreators]: ({ currentState, payload, dispatch }: {
|
|
7
|
+
[key in ActionCreators]: ({ currentState, payload, dispatch, }: {
|
|
8
8
|
payload?: MessagePayload;
|
|
9
9
|
currentState: StoreState;
|
|
10
10
|
dispatch: DirectDispatch;
|
|
@@ -63,8 +63,8 @@ export interface EmbedResponsePayloadByEvent {
|
|
|
63
63
|
SET_DEVICE_TOKEN_RESPONSE: unknown;
|
|
64
64
|
}
|
|
65
65
|
export declare type EmbedResponseEvent = keyof EmbedResponsePayloadByEvent;
|
|
66
|
-
export declare type EmbedEvent =
|
|
67
|
-
export declare type PayloadByEvent =
|
|
66
|
+
export declare type EmbedEvent = EmbedRequestEvent | EmbedResponseEvent;
|
|
67
|
+
export declare type PayloadByEvent = EmbedRequestPayloadByEvent & EmbedResponsePayloadByEvent;
|
|
68
68
|
export declare abstract class Channel {
|
|
69
69
|
protected abstract trackedListeners: Set<Refhandler>;
|
|
70
70
|
protected abstract trackedTimeouts: Set<number>;
|
|
@@ -18,10 +18,10 @@ export interface PublishEventPayload<K extends AdaEventKey> {
|
|
|
18
18
|
eventKey: K;
|
|
19
19
|
data: AdaEventDataKeyedByEvent[K];
|
|
20
20
|
}
|
|
21
|
-
export interface AdaCustomEvent<E extends
|
|
21
|
+
export interface AdaCustomEvent<E extends EmbedEvent | string = string> {
|
|
22
22
|
type: E;
|
|
23
23
|
payload?: E extends keyof PayloadByEvent ? PayloadByEvent[E] : unknown;
|
|
24
24
|
id?: string;
|
|
25
25
|
status?: FetchEventStatusType;
|
|
26
26
|
}
|
|
27
|
-
export declare type Refhandler<E extends
|
|
27
|
+
export declare type Refhandler<E extends EmbedRequestEvent | string = string> = (handleEvent: MessageEvent | CustomEventInit<AdaCustomEvent<E>>) => void;
|
|
@@ -5,4 +5,4 @@ export declare const INTRO_IFRAME = "intro";
|
|
|
5
5
|
export declare const BUTTON_IFRAME = "button";
|
|
6
6
|
export declare const MASK_IFRAME = "drawer-mask";
|
|
7
7
|
export declare const XSTORAGE_IFRAME = "x-storage";
|
|
8
|
-
export declare type Module =
|
|
8
|
+
export declare type Module = typeof CHAT_IFRAME | typeof ENTRY_SCRIPT | typeof EMBED_SCRIPT | typeof INTRO_IFRAME | typeof BUTTON_IFRAME | typeof MASK_IFRAME | typeof XSTORAGE_IFRAME;
|
|
@@ -14,10 +14,10 @@ export interface StorageValueByKey {
|
|
|
14
14
|
[ZD_PREVIOUS_TAGS_STORAGE_KEY]: string;
|
|
15
15
|
[ZD_MESSAGING_EXTERNAL_USER_ID_STORAGE_KEY]: string;
|
|
16
16
|
[ZD_MESSAGING_CHATTER_CREATED_STORAGE_KEY]: string;
|
|
17
|
-
|
|
17
|
+
liveChatPending: boolean;
|
|
18
18
|
"ada-embed_is-drawer-open": boolean;
|
|
19
19
|
"[handle]_marketing_campaigns_shown": string;
|
|
20
|
-
|
|
20
|
+
test: string;
|
|
21
21
|
}
|
|
22
22
|
export declare type StorageKey = keyof StorageValueByKey;
|
|
23
23
|
/**
|
package/dist/npm-entry/index.js
CHANGED
|
@@ -15811,7 +15811,7 @@ const client = new error_tracker_BrowserClient({
|
|
|
15811
15811
|
},
|
|
15812
15812
|
|
|
15813
15813
|
environment: "production",
|
|
15814
|
-
release: "1.4.
|
|
15814
|
+
release: "1.4.3-2730999",
|
|
15815
15815
|
sampleRate: 0.25,
|
|
15816
15816
|
autoSessionTracking: false,
|
|
15817
15817
|
// Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
|
|
@@ -16384,15 +16384,15 @@ function httpRequest(obj) {
|
|
|
16384
16384
|
const isProduction = "production" === "production";
|
|
16385
16385
|
;// CONCATENATED MODULE: ./src/common/helpers/url/constants.ts
|
|
16386
16386
|
const ports = {
|
|
16387
|
-
|
|
16388
|
-
|
|
16389
|
-
|
|
16390
|
-
|
|
16387
|
+
localhost: {
|
|
16388
|
+
api: 8000,
|
|
16389
|
+
chat: 8002,
|
|
16390
|
+
default: 9001
|
|
16391
16391
|
},
|
|
16392
|
-
|
|
16393
|
-
|
|
16394
|
-
|
|
16395
|
-
|
|
16392
|
+
e2ereference: {
|
|
16393
|
+
api: 8000,
|
|
16394
|
+
chat: 8002,
|
|
16395
|
+
default: 9001
|
|
16396
16396
|
}
|
|
16397
16397
|
};
|
|
16398
16398
|
;// CONCATENATED MODULE: ./src/common/helpers/url/index.ts
|
|
@@ -16432,7 +16432,7 @@ function getEmbedURL(_ref) {
|
|
|
16432
16432
|
host = "http://".concat(window.location.hostname, ":9001");
|
|
16433
16433
|
}
|
|
16434
16434
|
|
|
16435
|
-
return "".concat(host, "/embed/").concat(frameName, "/").concat("
|
|
16435
|
+
return "".concat(host, "/embed/").concat(frameName, "/").concat("2730999", "/index.html");
|
|
16436
16436
|
}
|
|
16437
16437
|
|
|
16438
16438
|
function constructQueryString(query) {
|
|
@@ -17613,8 +17613,8 @@ const popStateListener = dispatchEvent.bind(undefined, "locationchange");
|
|
|
17613
17613
|
*/
|
|
17614
17614
|
|
|
17615
17615
|
function bindLocationChangeOverrides() {
|
|
17616
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17617
|
-
|
|
17616
|
+
window.history.pushState = (f => // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17617
|
+
function pushState() {
|
|
17618
17618
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
17619
17619
|
args[_key] = arguments[_key];
|
|
17620
17620
|
}
|
|
@@ -17623,10 +17623,10 @@ function bindLocationChangeOverrides() {
|
|
|
17623
17623
|
dispatchEvent("pushstate");
|
|
17624
17624
|
dispatchEvent("locationchange");
|
|
17625
17625
|
return ret;
|
|
17626
|
-
})(window.history.pushState);
|
|
17626
|
+
})(window.history.pushState);
|
|
17627
17627
|
|
|
17628
|
-
|
|
17629
|
-
|
|
17628
|
+
window.history.replaceState = (f => // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17629
|
+
function replaceState() {
|
|
17630
17630
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
17631
17631
|
args[_key2] = arguments[_key2];
|
|
17632
17632
|
}
|
|
@@ -18299,9 +18299,9 @@ async function log(message, extra, options) {
|
|
|
18299
18299
|
service: "embed",
|
|
18300
18300
|
env: "production",
|
|
18301
18301
|
embedVersion: 2,
|
|
18302
|
-
version: "1.4.
|
|
18302
|
+
version: "1.4.3",
|
|
18303
18303
|
isNpm: true,
|
|
18304
|
-
commitHash: "
|
|
18304
|
+
commitHash: "2730999"
|
|
18305
18305
|
}))
|
|
18306
18306
|
});
|
|
18307
18307
|
}
|
|
@@ -18529,7 +18529,7 @@ class ButtonFrame extends d {
|
|
|
18529
18529
|
let styles = "\n position: fixed;\n bottom: ".concat(buttonPosition, "px;\n ").concat(getAlignment(adaSettings), ": ").concat(buttonPosition, "px;\n z-index: 10000;\n height: ").concat(buttonSizeWithBuffer, "px;\n width: ").concat(buttonSizeWithBuffer, "px;\n overflow: hidden;\n visibility: ").concat(this.isShown ? "visible" : "hidden", ";\n opacity: ").concat(this.isShown ? "1" : "0", ";\n transition: visibility 200ms ease, opacity 200ms ease;\n ");
|
|
18530
18530
|
|
|
18531
18531
|
if (client.features.chat_ui_v2) {
|
|
18532
|
-
styles += "\n transform: translate(0, 10%);\n transition: visibility 250ms ease, opacity 250ms ease, transform 250ms ease;\n ".concat(getAlignment(adaSettings), ": 0;\n bottom: 0;\n
|
|
18532
|
+
styles += "\n transform: translate(0, 10%);\n transition: visibility 250ms ease, opacity 250ms ease, transform 250ms ease;\n ".concat(getAlignment(adaSettings), ": 0;\n bottom: 0;\n\n ").concat(this.isShown ? "transform: translate(0, 0);" : "", "\n ");
|
|
18533
18533
|
|
|
18534
18534
|
if (buttonStyle === "text") {
|
|
18535
18535
|
styles += "\n width: ".concat(frameWidth, "px;\n height: ").concat(textFrameHeight, "px;\n ");
|
|
@@ -18743,7 +18743,7 @@ class ChatFrame extends d {
|
|
|
18743
18743
|
const hostPageUrlParams = new (url_default())(window.location.href).searchParams;
|
|
18744
18744
|
const smsToken = hostPageUrlParams.get("adaSMSToken");
|
|
18745
18745
|
const queryParams = {
|
|
18746
|
-
embedVersion: "
|
|
18746
|
+
embedVersion: "2730999".slice(0, 7),
|
|
18747
18747
|
greeting,
|
|
18748
18748
|
language,
|
|
18749
18749
|
skipGreeting,
|
|
@@ -19001,7 +19001,7 @@ class ChatFrame extends d {
|
|
|
19001
19001
|
clearTimeout(this.chatRenderTimeout);
|
|
19002
19002
|
this.channel.isConnected = true;
|
|
19003
19003
|
setConnectionState({
|
|
19004
|
-
|
|
19004
|
+
chat: ConnectionState.Done
|
|
19005
19005
|
});
|
|
19006
19006
|
break;
|
|
19007
19007
|
}
|
|
@@ -20924,7 +20924,7 @@ class Embed {
|
|
|
20924
20924
|
|
|
20925
20925
|
}
|
|
20926
20926
|
|
|
20927
|
-
_defineProperty(Embed, "embed2Version", "
|
|
20927
|
+
_defineProperty(Embed, "embed2Version", "2730999");
|
|
20928
20928
|
;// CONCATENATED MODULE: ./src/common/helpers/startup.ts
|
|
20929
20929
|
|
|
20930
20930
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare type PersistenceKey =
|
|
1
|
+
declare type PersistenceKey = "ada-embed_chat-manifest-cache" | "ada-embed_chat-assigned-version";
|
|
2
2
|
export declare const persistence: {
|
|
3
3
|
get: (item: PersistenceKey) => string;
|
|
4
4
|
set: (item: PersistenceKey, value: string) => void;
|