@ada-support/embed2 1.0.70-dev.1 → 1.0.70
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/index.js +23 -30
- package/package.json +7 -6
- package/dist/npm-entry/businessEvents/TriggerConditionEvaluator.d.ts +0 -3
- package/dist/npm-entry/campaigns/TriggerConditionEvaluator.d.ts +0 -4
- package/dist/npm-entry/frames/components/x-storage/index.d.ts +0 -12
- package/dist/npm-entry/frames/helpers/frame-init.d.ts +0 -3
- package/dist/npm-entry/frames/lib/error-tracker.d.ts +0 -6
- package/dist/npm-entry/frames/lib/frame-fc.d.ts +0 -3
- package/dist/npm-entry/frames/lib/store-proxy.d.ts +0 -2
- package/dist/npm-entry/index-npm.d.ts +0 -2
package/dist/npm-entry/index.js
CHANGED
|
@@ -8788,7 +8788,7 @@ var client = new error_tracker_BrowserClient({
|
|
|
8788
8788
|
return event;
|
|
8789
8789
|
},
|
|
8790
8790
|
environment: "production",
|
|
8791
|
-
release: "1.0.70-
|
|
8791
|
+
release: "1.0.70-7c705f4",
|
|
8792
8792
|
sampleRate: 0.25,
|
|
8793
8793
|
autoSessionTracking: false,
|
|
8794
8794
|
// Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
|
|
@@ -9490,7 +9490,7 @@ function getEmbedURL(_ref) {
|
|
|
9490
9490
|
polyfillVersionString = "legacy";
|
|
9491
9491
|
}
|
|
9492
9492
|
|
|
9493
|
-
return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "
|
|
9493
|
+
return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "7c705f4", "/index.html");
|
|
9494
9494
|
}
|
|
9495
9495
|
/**
|
|
9496
9496
|
* Generate the Chat / API URL
|
|
@@ -11519,12 +11519,14 @@ function ButtonFrame_mapStateToProps(storeState) {
|
|
|
11519
11519
|
var _client$chat_button, _client$ui_settings, _client$ui_settings$e;
|
|
11520
11520
|
|
|
11521
11521
|
var client = storeState.client,
|
|
11522
|
-
isDrawerOpen = storeState.isDrawerOpen
|
|
11522
|
+
isDrawerOpen = storeState.isDrawerOpen,
|
|
11523
|
+
language = storeState.language;
|
|
11523
11524
|
return {
|
|
11524
11525
|
buttonSize: client === null || client === void 0 ? void 0 : (_client$chat_button = client.chat_button) === null || _client$chat_button === void 0 ? void 0 : _client$chat_button.size,
|
|
11525
11526
|
buttonStyle: client === null || client === void 0 ? void 0 : (_client$ui_settings = client.ui_settings) === null || _client$ui_settings === void 0 ? void 0 : (_client$ui_settings$e = _client$ui_settings.embed) === null || _client$ui_settings$e === void 0 ? void 0 : _client$ui_settings$e.style,
|
|
11526
11527
|
client: client,
|
|
11527
|
-
isDrawerOpen: isDrawerOpen
|
|
11528
|
+
isDrawerOpen: isDrawerOpen,
|
|
11529
|
+
language: language
|
|
11528
11530
|
};
|
|
11529
11531
|
}
|
|
11530
11532
|
|
|
@@ -12321,7 +12323,8 @@ function ChatFrame_mapStateToProps(storeState) {
|
|
|
12321
12323
|
testMode = storeState.testMode,
|
|
12322
12324
|
client = storeState.client,
|
|
12323
12325
|
chatDimensions = storeState.chatDimensions,
|
|
12324
|
-
drawerHasBeenOpened = storeState.drawerHasBeenOpened
|
|
12326
|
+
drawerHasBeenOpened = storeState.drawerHasBeenOpened,
|
|
12327
|
+
chatterInLiveChat = storeState.chatterInLiveChat;
|
|
12325
12328
|
return {
|
|
12326
12329
|
handle: handle,
|
|
12327
12330
|
domain: domain,
|
|
@@ -12335,7 +12338,8 @@ function ChatFrame_mapStateToProps(storeState) {
|
|
|
12335
12338
|
testMode: testMode,
|
|
12336
12339
|
client: client,
|
|
12337
12340
|
chatDimensions: chatDimensions,
|
|
12338
|
-
drawerHasBeenOpened: drawerHasBeenOpened
|
|
12341
|
+
drawerHasBeenOpened: drawerHasBeenOpened,
|
|
12342
|
+
chatterInLiveChat: chatterInLiveChat
|
|
12339
12343
|
};
|
|
12340
12344
|
}
|
|
12341
12345
|
|
|
@@ -12437,6 +12441,7 @@ function IntroFrame_mapStateToProps(storeState) {
|
|
|
12437
12441
|
introDimensions = storeState.introDimensions,
|
|
12438
12442
|
isIntroShown = storeState.isIntroShown,
|
|
12439
12443
|
isDrawerOpen = storeState.isDrawerOpen,
|
|
12444
|
+
language = storeState.language,
|
|
12440
12445
|
adaSettings = storeState.adaSettings;
|
|
12441
12446
|
return {
|
|
12442
12447
|
client: client,
|
|
@@ -12444,6 +12449,7 @@ function IntroFrame_mapStateToProps(storeState) {
|
|
|
12444
12449
|
introDimensions: introDimensions,
|
|
12445
12450
|
isIntroShown: isIntroShown,
|
|
12446
12451
|
isDrawerOpen: isDrawerOpen,
|
|
12452
|
+
language: language,
|
|
12447
12453
|
adaSettings: adaSettings
|
|
12448
12454
|
};
|
|
12449
12455
|
}
|
|
@@ -12983,7 +12989,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12983
12989
|
}, {
|
|
12984
12990
|
key: "triggerCampaign",
|
|
12985
12991
|
value: function triggerCampaign(params) {
|
|
12986
|
-
var _client$marketing_cam
|
|
12992
|
+
var _client$marketing_cam;
|
|
12987
12993
|
|
|
12988
12994
|
var _this$props7 = this.props,
|
|
12989
12995
|
client = _this$props7.client,
|
|
@@ -12992,14 +12998,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12992
12998
|
var chatHasBeenRendered = this.state.chatHasBeenRendered;
|
|
12993
12999
|
var campaignKey = params.campaignKey,
|
|
12994
13000
|
ignoreStatus = params.ignoreStatus,
|
|
12995
|
-
ignoreFrequency = params.ignoreFrequency;
|
|
12996
|
-
(0,services_logger/* log */.cM)("triggerCampaign called", {
|
|
12997
|
-
clientHandle: client === null || client === void 0 ? void 0 : client.handle,
|
|
12998
|
-
campaignKey: campaignKey,
|
|
12999
|
-
isDrawerOpen: isDrawerOpen
|
|
13000
|
-
}, {
|
|
13001
|
-
sampleRate: (client === null || client === void 0 ? void 0 : client.handle) === "tsi-cocoon" ? 1 : 0
|
|
13002
|
-
}); // Don't allow sending campaigns when chat is open, it would interrupt the conversation
|
|
13001
|
+
ignoreFrequency = params.ignoreFrequency; // Don't allow sending campaigns when chat is open, it would interrupt the conversation
|
|
13003
13002
|
|
|
13004
13003
|
if (isDrawerOpen) {
|
|
13005
13004
|
return;
|
|
@@ -13011,15 +13010,11 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13011
13010
|
|
|
13012
13011
|
if (!campaign) {
|
|
13013
13012
|
throw new errors/* AdaEmbedError */.S("Could not find campaign with key: ".concat(campaignKey));
|
|
13014
|
-
}
|
|
13013
|
+
} // we were using the null coalescing (??) operator but it yielded incorrect behaviour.
|
|
13014
|
+
// we are not sure why, but switching to using a ternary fixes the behaviour
|
|
13015
13015
|
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
clientHandle: client === null || client === void 0 ? void 0 : client.handle,
|
|
13019
|
-
followUpResponseId: followUpResponseId
|
|
13020
|
-
}, {
|
|
13021
|
-
sampleRate: (client === null || client === void 0 ? void 0 : client.handle) === "tsi-cocoon" ? 1 : 0
|
|
13022
|
-
});
|
|
13016
|
+
|
|
13017
|
+
var followUpResponseId = campaign.follow_up_response_id ? campaign.follow_up_response_id : campaign.response_id;
|
|
13023
13018
|
setState({
|
|
13024
13019
|
latestCampaignKey: campaignKey,
|
|
13025
13020
|
hasChatOpenedAfterProactiveMessagesShown: false,
|
|
@@ -14353,9 +14348,9 @@ window.__AdaEmbedConstructor = Embed;
|
|
|
14353
14348
|
/* harmony export */ "yv": function() { return /* binding */ isProduction; },
|
|
14354
14349
|
/* harmony export */ "Mk": function() { return /* binding */ embed2Version; }
|
|
14355
14350
|
/* harmony export */ });
|
|
14356
|
-
var isModern = new RegExp("((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(15|(1[6-9]|[2-9]\\d|\\d{3,}))[_.]\\d+(?:[_.]\\d+)?)|((Chromium|Chrome)\\/(
|
|
14351
|
+
var isModern = new RegExp("((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(15|(1[6-9]|[2-9]\\d|\\d{3,}))[_.]\\d+(?:[_.]\\d+)?)|((Chromium|Chrome)\\/(97|(9[8-9]|\\d{3,}))\\.\\d+(?:\\.\\d+)?)|(Version\\/(15|(1[6-9]|[2-9]\\d|\\d{3,}))\\.\\d+(?:\\.\\d+)? Safari\\/)|(Firefox\\/(96|(9[7-9]|\\d{3,}))\\.\\d+\\.\\d+)|(Firefox\\/(96|(9[7-9]|\\d{3,}))\\.\\d+(pre|[ab]\\d+[a-z]*)?)").test(navigator.userAgent);
|
|
14357
14352
|
var isProduction = "production" === "production";
|
|
14358
|
-
var embed2Version = "
|
|
14353
|
+
var embed2Version = "7c705f4";
|
|
14359
14354
|
|
|
14360
14355
|
/***/ }),
|
|
14361
14356
|
|
|
@@ -14703,7 +14698,7 @@ function _log() {
|
|
|
14703
14698
|
embedVersion: 2,
|
|
14704
14699
|
version: "1.0.70",
|
|
14705
14700
|
isNpm: true,
|
|
14706
|
-
commitHash: "
|
|
14701
|
+
commitHash: "7c705f4"
|
|
14707
14702
|
}))
|
|
14708
14703
|
});
|
|
14709
14704
|
|
|
@@ -25644,7 +25639,7 @@ function _loadEmbed() {
|
|
|
25644
25639
|
polyfillVersionString = "legacy";
|
|
25645
25640
|
}
|
|
25646
25641
|
|
|
25647
|
-
embedScriptSource = concat_default()(_context17 = concat_default()(_context18 = "".concat(host, "/embed/")).call(_context18, polyfillVersionString, "/client/")).call(_context17, "
|
|
25642
|
+
embedScriptSource = concat_default()(_context17 = concat_default()(_context18 = "".concat(host, "/embed/")).call(_context18, polyfillVersionString, "/client/")).call(_context17, "7c705f4", "/index.js");
|
|
25648
25643
|
}
|
|
25649
25644
|
|
|
25650
25645
|
clientScriptExists = Boolean( true || // The client script is bundled with npm module
|
|
@@ -26210,9 +26205,7 @@ function createEmbedObject() {
|
|
|
26210
26205
|
}
|
|
26211
26206
|
;// CONCATENATED MODULE: ./src/index-npm.ts
|
|
26212
26207
|
|
|
26213
|
-
Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 5265));
|
|
26214
|
-
// eslint-disable-next-line import/no-default-export
|
|
26215
|
-
|
|
26208
|
+
Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 5265));
|
|
26216
26209
|
/* harmony default export */ var index_npm = (createEmbedObject());
|
|
26217
26210
|
}();
|
|
26218
26211
|
module.exports = __webpack_exports__;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ada-support/embed2",
|
|
3
|
-
"version": "1.0.70
|
|
3
|
+
"version": "1.0.70",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/npm-entry",
|
|
6
6
|
"typings": "dist/npm-entry/index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build:modern": "NODE_ENV=production BROWSERSLIST_ENV=modern npx webpack --config webpack.prod.ts",
|
|
11
11
|
"build:npm-types": "tsc --project tsconfig.npm.json --declaration --outDir dist/npm-entry --emitDeclarationOnly --allowJs false --checkJs false",
|
|
12
12
|
"build:npm": "./npm-build.sh",
|
|
13
|
-
"lint": "tsc --noEmit --strict false && ./node_modules/.bin/eslint --report-unused-disable-directives --ext .js,.jsx,.ts,.tsx . --max-warnings
|
|
13
|
+
"lint": "tsc --noEmit --strict false && ./node_modules/.bin/eslint --report-unused-disable-directives --ext .js,.jsx,.ts,.tsx . --max-warnings 74",
|
|
14
14
|
"lint:fix": "yarn lint --fix",
|
|
15
15
|
"deploy-legacy": "TS_NODE_PROJECT=wp.tsconfig.json NODE_ENV=production BROWSERSLIST_ENV=legacy npx webpack --config webpack.prod.ts",
|
|
16
16
|
"deploy-modern": "TS_NODE_PROJECT=wp.tsconfig.json NODE_ENV=production BROWSERSLIST_ENV=modern npx webpack --config webpack.prod.ts",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"enzyme-adapter-preact-pure": "^2.2.0",
|
|
73
73
|
"eslint": "^8.8.0",
|
|
74
74
|
"eslint-plugin-chai-friendly": "^0.7.2",
|
|
75
|
-
"eslint-plugin-compat": "^
|
|
75
|
+
"eslint-plugin-compat": "^3.13.0",
|
|
76
76
|
"eslint-plugin-cypress": "^2.11.3",
|
|
77
77
|
"eslint-plugin-sonarjs": "^0.11.0",
|
|
78
78
|
"husky": "^7.0.0",
|
|
@@ -81,10 +81,11 @@
|
|
|
81
81
|
"lint-staged": "^11.2.3",
|
|
82
82
|
"npm-run-all": "^4.1.5",
|
|
83
83
|
"start-server-and-test": "^1.14.0",
|
|
84
|
-
"testcafe": "^1.18.
|
|
85
|
-
"testcafe-browser-provider-lambdatest": "^2.0.
|
|
84
|
+
"testcafe": "^1.18.2",
|
|
85
|
+
"testcafe-browser-provider-lambdatest": "^2.0.10",
|
|
86
86
|
"ts-node": "^10.2.1",
|
|
87
87
|
"tsconfig-paths": "^3.11.0",
|
|
88
|
+
"typescript-eslint-language-service": "^4.1.5",
|
|
88
89
|
"webpack-bundle-analyzer": "^4.5.0",
|
|
89
90
|
"webpack-dev-server": "^4.3.1"
|
|
90
91
|
},
|
|
@@ -111,7 +112,7 @@
|
|
|
111
112
|
"lodash.debounce": "^4.0.8",
|
|
112
113
|
"lodash.memoize": "^4.1.2",
|
|
113
114
|
"preact": "10.4.5",
|
|
114
|
-
"typescript": "^4.
|
|
115
|
+
"typescript": "^4.5.5",
|
|
115
116
|
"uniqid": "^5.3.0",
|
|
116
117
|
"webpack": "^5.67.0",
|
|
117
118
|
"webpack-cli": "^4.9.2",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { TriggerCondition, URLMatchTriggerCondition } from "./types";
|
|
2
|
-
export declare const evalUrlMatchTriggerCondition: (triggerCondition: URLMatchTriggerCondition, url: string) => boolean;
|
|
3
|
-
export declare const evalTriggerCondition: (triggerCondition: TriggerCondition) => boolean;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { DateTimeTriggerCondition, TriggerCondition, URLMatchTriggerCondition } from "./types";
|
|
2
|
-
export declare const evalUrlMatchTriggerCondition: (triggerCondition: URLMatchTriggerCondition, url: string) => boolean;
|
|
3
|
-
export declare const evalDatetimeTriggerCondition: (triggerCondition: DateTimeTriggerCondition, currentDateTime: Date) => boolean;
|
|
4
|
-
export declare const evalTriggerCondition: (triggerCondition: TriggerCondition) => boolean;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import "frames/lib/error-tracker";
|
|
2
|
-
export declare const LIVE_CHAT_PENDING_STORAGE_KEY = "liveChatPending";
|
|
3
|
-
export declare const IS_DRAWER_OPEN_STORAGE_KEY = "ada-embed_is-drawer-open";
|
|
4
|
-
/**
|
|
5
|
-
* NOTE: If you import this file into any other file
|
|
6
|
-
* it will trigger the init() function below - may cause errors!
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Auto-opens the chat door if crossWindowPersistence is one, the chatter is in
|
|
10
|
-
* a live chat, and if the drawer was previously opened.
|
|
11
|
-
*/
|
|
12
|
-
export declare function setIsDrawerOpen(): Promise<void>;
|