@ada-support/embed2 1.1.2 → 1.1.5

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.
@@ -4,6 +4,7 @@ import type { StoreProxy } from "client/lib/store-proxy";
4
4
  import type { Module } from "common/types/modules";
5
5
  interface OwnProps {
6
6
  name: Module;
7
+ roleDescription?: string;
7
8
  styles: string;
8
9
  store: StoreProxy;
9
10
  messageService: MessageService;
@@ -36,6 +36,13 @@ module.exports = __webpack_require__(3778);
36
36
 
37
37
  /***/ }),
38
38
 
39
+ /***/ 1643:
40
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
41
+
42
+ module.exports = __webpack_require__(9373);
43
+
44
+ /***/ }),
45
+
39
46
  /***/ 3811:
40
47
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
41
48
 
@@ -721,9 +728,9 @@ var getPrototypeOf = __webpack_require__(3362);
721
728
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/set.js
722
729
  var set = __webpack_require__(6384);
723
730
  var set_default = /*#__PURE__*/__webpack_require__.n(set);
724
- // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/includes.js
725
- var includes = __webpack_require__(9632);
726
- var includes_default = /*#__PURE__*/__webpack_require__.n(includes);
731
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/index-of.js
732
+ var index_of = __webpack_require__(1643);
733
+ var index_of_default = /*#__PURE__*/__webpack_require__.n(index_of);
727
734
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/json/stringify.js
728
735
  var stringify = __webpack_require__(9340);
729
736
  var stringify_default = /*#__PURE__*/__webpack_require__.n(stringify);
@@ -733,6 +740,9 @@ var concat_default = /*#__PURE__*/__webpack_require__.n(concat);
733
740
  // EXTERNAL MODULE: ./node_modules/uniqid/index.js
734
741
  var uniqid = __webpack_require__(6104);
735
742
  var uniqid_default = /*#__PURE__*/__webpack_require__.n(uniqid);
743
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/includes.js
744
+ var includes = __webpack_require__(9632);
745
+ var includes_default = /*#__PURE__*/__webpack_require__.n(includes);
736
746
  ;// CONCATENATED MODULE: ./node_modules/@sentry/browser/node_modules/tslib/tslib.es6.js
737
747
  /*! *****************************************************************************
738
748
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8788,7 +8798,7 @@ var client = new error_tracker_BrowserClient({
8788
8798
  return event;
8789
8799
  },
8790
8800
  environment: "production",
8791
- release: "1.1.2-c955770",
8801
+ release: "1.1.5-60bb753",
8792
8802
  sampleRate: 0.25,
8793
8803
  autoSessionTracking: false,
8794
8804
  // Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
@@ -9139,7 +9149,7 @@ var FrameChannel = /*#__PURE__*/function (_Channel) {
9139
9149
 
9140
9150
  var parsedData;
9141
9151
 
9142
- if ( true && _this2.targetOrigin !== "*" && (!("origin" in event) || !includes_default()(_context = _this2.targetOrigin).call(_context, event.origin))) {
9152
+ if ( true && _this2.targetOrigin !== "*" && (!("origin" in event) || index_of_default()(_context = _this2.targetOrigin).call(_context, event.origin) < 0)) {
9143
9153
  return;
9144
9154
  }
9145
9155
 
@@ -9490,7 +9500,7 @@ function getEmbedURL(_ref) {
9490
9500
  polyfillVersionString = "legacy";
9491
9501
  }
9492
9502
 
9493
- return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "c955770", "/index.html");
9503
+ return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "60bb753", "/index.html");
9494
9504
  }
9495
9505
  /**
9496
9506
  * Generate the Chat / API URL
@@ -11013,7 +11023,7 @@ function wait(ms) {
11013
11023
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/object/get-own-property-symbols.js
11014
11024
  var object_get_own_property_symbols = __webpack_require__(3263);
11015
11025
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/index-of.js
11016
- var index_of = __webpack_require__(5683);
11026
+ var instance_index_of = __webpack_require__(5683);
11017
11027
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/object/keys.js
11018
11028
  var keys = __webpack_require__(9356);
11019
11029
  ;// CONCATENATED MODULE: ./node_modules/@babel/runtime-corejs3/helpers/esm/objectWithoutPropertiesLoose.js
@@ -11029,7 +11039,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
11029
11039
 
11030
11040
  for (i = 0; i < sourceKeys.length; i++) {
11031
11041
  key = sourceKeys[i];
11032
- if (index_of(excluded).call(excluded, key) >= 0) continue;
11042
+ if (instance_index_of(excluded).call(excluded, key) >= 0) continue;
11033
11043
  target[key] = source[key];
11034
11044
  }
11035
11045
 
@@ -11049,7 +11059,7 @@ function _objectWithoutProperties(source, excluded) {
11049
11059
 
11050
11060
  for (i = 0; i < sourceSymbolKeys.length; i++) {
11051
11061
  key = sourceSymbolKeys[i];
11052
- if (index_of(excluded).call(excluded, key) >= 0) continue;
11062
+ if (instance_index_of(excluded).call(excluded, key) >= 0) continue;
11053
11063
  if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
11054
11064
  target[key] = source[key];
11055
11065
  }
@@ -11346,6 +11356,7 @@ var IFrame = /*#__PURE__*/function (_Component) {
11346
11356
  value: function render() {
11347
11357
  var _this$props4 = this.props,
11348
11358
  name = _this$props4.name,
11359
+ roleDescription = _this$props4.roleDescription,
11349
11360
  onTransitionEnd = _this$props4.onTransitionEnd,
11350
11361
  styles = _this$props4.styles,
11351
11362
  title = _this$props4.title;
@@ -11361,7 +11372,7 @@ var IFrame = /*#__PURE__*/function (_Component) {
11361
11372
  title: title || iFrameName,
11362
11373
  className: iFrameName,
11363
11374
  onTransitionEnd: onTransitionEnd,
11364
- "aria-roledescription": iFrameName,
11375
+ "aria-roledescription": roleDescription,
11365
11376
  role: "application"
11366
11377
  });
11367
11378
  }
@@ -11402,6 +11413,7 @@ function mapDispatchToProps(dispatch) {
11402
11413
 
11403
11414
 
11404
11415
 
11416
+
11405
11417
  function ButtonFrame_createSuper(Derived) { var hasNativeReflectConstruct = ButtonFrame_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0,getPrototypeOf/* default */.Z)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0,getPrototypeOf/* default */.Z)(this).constructor; result = construct_default()(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0,possibleConstructorReturn/* default */.Z)(this, result); }; }
11406
11418
 
11407
11419
  function ButtonFrame_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !(construct_default())) return false; if ((construct_default()).sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(construct_default()(Boolean, [], function () {})); return true; } catch (e) { return false; } }
@@ -11509,12 +11521,25 @@ var ButtonFrame = /*#__PURE__*/function (_Component) {
11509
11521
  value: function render() {
11510
11522
  var _this2 = this;
11511
11523
 
11524
+ var client = this.props.client;
11525
+
11526
+ var roleDescription = function roleDescription() {
11527
+ var _context11;
11528
+
11529
+ if (!(client !== null && client !== void 0 && client.handle)) {
11530
+ return "Chat Button";
11531
+ }
11532
+
11533
+ return "".concat(client.handle.charAt(0).toUpperCase() + slice_default()(_context11 = client.handle).call(_context11, 1), " Chat Button");
11534
+ };
11535
+
11512
11536
  return v(StoreContext.Consumer, null, function (store) {
11513
11537
  return v(MessageServiceContext.Consumer, null, function (messageService) {
11514
11538
  return v(components_IFrame, {
11515
11539
  title: "Chat with bot",
11516
11540
  styles: _this2.styles,
11517
11541
  name: BUTTON_IFRAME,
11542
+ roleDescription: roleDescription(),
11518
11543
  store: store,
11519
11544
  messageService: messageService,
11520
11545
  onTransitionEnd: _this2.handleOnTransitionEndBound
@@ -11558,6 +11583,7 @@ var isMobile = /(iPhone)|(iPod)|(android)|(webOS)/i.exec(navigator.userAgent) !=
11558
11583
 
11559
11584
 
11560
11585
 
11586
+
11561
11587
  function ChatFrame_createSuper(Derived) { var hasNativeReflectConstruct = ChatFrame_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0,getPrototypeOf/* default */.Z)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0,getPrototypeOf/* default */.Z)(this).constructor; result = construct_default()(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0,possibleConstructorReturn/* default */.Z)(this, result); }; }
11562
11588
 
11563
11589
  function ChatFrame_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !(construct_default())) return false; if ((construct_default()).sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(construct_default()(Boolean, [], function () {})); return true; } catch (e) { return false; } }
@@ -12324,8 +12350,20 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
12324
12350
  value: function render() {
12325
12351
  var _this$props12 = this.props,
12326
12352
  name = _this$props12.name,
12353
+ client = _this$props12.client,
12327
12354
  isDrawerOpen = _this$props12.isDrawerOpen;
12328
12355
  var iFrameName = "ada-".concat(name, "-frame");
12356
+
12357
+ var roleDescription = function roleDescription() {
12358
+ var _context23;
12359
+
12360
+ if (!(client !== null && client !== void 0 && client.handle)) {
12361
+ return "Chat Window";
12362
+ }
12363
+
12364
+ return "".concat(client.handle.charAt(0).toUpperCase() + slice_default()(_context23 = client.handle).call(_context23, 1), " Chat Window");
12365
+ };
12366
+
12329
12367
  return v("iframe", {
12330
12368
  src: this.url,
12331
12369
  scrolling: "no",
@@ -12337,6 +12375,7 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
12337
12375
  title: iFrameName,
12338
12376
  className: iFrameName,
12339
12377
  "aria-expanded": isDrawerOpen,
12378
+ "aria-roledescription": roleDescription(),
12340
12379
  allowTransparency: true,
12341
12380
  allowFullScreen: true,
12342
12381
  onLoad: this.frameLoaded.bind(this)
@@ -14379,7 +14418,7 @@ window.__AdaEmbedConstructor = Embed;
14379
14418
  /* harmony export */ });
14380
14419
  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)\\/(99|([1-9]\\d\\d|\\d{4,}))\\.\\d+(?:\\.\\d+)?)|(Version\\/(15|(1[6-9]|[2-9]\\d|\\d{3,}))\\.\\d+(?:\\.\\d+)? Safari\\/)|(Firefox\\/(98|(99|\\d{3,}))\\.\\d+\\.\\d+)|(Firefox\\/(98|(99|\\d{3,}))\\.\\d+(pre|[ab]\\d+[a-z]*)?)").test(navigator.userAgent);
14381
14420
  var isProduction = "production" === "production";
14382
- var embed2Version = "c955770";
14421
+ var embed2Version = "60bb753";
14383
14422
 
14384
14423
  /***/ }),
14385
14424
 
@@ -14725,9 +14764,9 @@ function _log() {
14725
14764
  service: "embed",
14726
14765
  env: "production",
14727
14766
  embedVersion: 2,
14728
- version: "1.1.2",
14767
+ version: "1.1.5",
14729
14768
  isNpm: true,
14730
- commitHash: "c955770"
14769
+ commitHash: "60bb753"
14731
14770
  }))
14732
14771
  });
14733
14772
 
@@ -25668,7 +25707,7 @@ function _loadClientChunk() {
25668
25707
  polyfillVersionString = "legacy";
25669
25708
  }
25670
25709
 
25671
- clientScriptSource = concat_default()(_context17 = concat_default()(_context18 = "".concat(host, "/embed/")).call(_context18, polyfillVersionString, "/client/")).call(_context17, "c955770", "/index.js");
25710
+ clientScriptSource = concat_default()(_context17 = concat_default()(_context18 = "".concat(host, "/embed/")).call(_context18, polyfillVersionString, "/client/")).call(_context17, "60bb753", "/index.js");
25672
25711
  } // `window.__AdaEmbedConstructor` gets created in the "client" bundle
25673
25712
 
25674
25713
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.1.2",
3
+ "version": "1.1.5",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index.d.ts",