@atlaskit/util-data-test 17.13.25 → 17.13.26

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/util-data-test
2
2
 
3
+ ## 17.13.26
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 17.13.25
4
10
 
5
11
  ### Patch Changes
@@ -20,6 +20,7 @@ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0,
20
20
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
21
21
  var MockMentionResource = exports.MockMentionResource = /*#__PURE__*/function (_AbstractMentionResou) {
22
22
  function MockMentionResource(config) {
23
+ var _window, _window2;
23
24
  var _this;
24
25
  (0, _classCallCheck2.default)(this, MockMentionResource);
25
26
  _this = _callSuper(this, MockMentionResource);
@@ -34,6 +35,13 @@ var MockMentionResource = exports.MockMentionResource = /*#__PURE__*/function (_
34
35
  _this.shouldEnableInvite = !!config.shouldEnableInvite;
35
36
  _this.onInviteItemClick = config.onInviteItemClick;
36
37
  _this.userRole = config.userRole || 'basic';
38
+ _this.isBrowserOnline = true;
39
+ (_window = window) === null || _window === void 0 || _window.addEventListener('offline', function () {
40
+ _this.isBrowserOnline = false;
41
+ });
42
+ (_window2 = window) === null || _window2 === void 0 || _window2.addEventListener('online', function () {
43
+ _this.isBrowserOnline = true;
44
+ });
37
45
  return _this;
38
46
  }
39
47
  (0, _inherits2.default)(MockMentionResource, _AbstractMentionResou);
@@ -69,7 +77,10 @@ var MockMentionResource = exports.MockMentionResource = /*#__PURE__*/function (_
69
77
  var waitTime = Math.random() * randomTime + minWait;
70
78
  setTimeout(function () {
71
79
  var mentions;
72
- if (query === 'error') {
80
+ if (!_this2.isBrowserOnline) {
81
+ notifyErrors(new Error('mock-offline-error'));
82
+ return;
83
+ } else if (query === 'error') {
73
84
  notifyErrors(new Error('mock-error'));
74
85
  notifyAnalytics(_resource.SLI_EVENT_TYPE, 'searchUser', 'failed');
75
86
  return;
@@ -6,6 +6,7 @@ import { mentionTestResult } from './mention-test-data';
6
6
  import { HttpError } from './utils';
7
7
  export class MockMentionResource extends AbstractMentionResource {
8
8
  constructor(config) {
9
+ var _window, _window2;
9
10
  super();
10
11
  _defineProperty(this, "search", new Search('id'));
11
12
  this.search.addIndex('name');
@@ -18,6 +19,13 @@ export class MockMentionResource extends AbstractMentionResource {
18
19
  this.shouldEnableInvite = !!config.shouldEnableInvite;
19
20
  this.onInviteItemClick = config.onInviteItemClick;
20
21
  this.userRole = config.userRole || 'basic';
22
+ this.isBrowserOnline = true;
23
+ (_window = window) === null || _window === void 0 ? void 0 : _window.addEventListener('offline', () => {
24
+ this.isBrowserOnline = false;
25
+ });
26
+ (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.addEventListener('online', () => {
27
+ this.isBrowserOnline = true;
28
+ });
21
29
  }
22
30
  filter(query) {
23
31
  const searchTime = Date.now();
@@ -48,7 +56,10 @@ export class MockMentionResource extends AbstractMentionResource {
48
56
  const waitTime = Math.random() * randomTime + minWait;
49
57
  setTimeout(() => {
50
58
  let mentions;
51
- if (query === 'error') {
59
+ if (!this.isBrowserOnline) {
60
+ notifyErrors(new Error('mock-offline-error'));
61
+ return;
62
+ } else if (query === 'error') {
52
63
  notifyErrors(new Error('mock-error'));
53
64
  notifyAnalytics(SLI_EVENT_TYPE, 'searchUser', 'failed');
54
65
  return;
@@ -13,6 +13,7 @@ import { mentionTestResult } from './mention-test-data';
13
13
  import { HttpError } from './utils';
14
14
  export var MockMentionResource = /*#__PURE__*/function (_AbstractMentionResou) {
15
15
  function MockMentionResource(config) {
16
+ var _window, _window2;
16
17
  var _this;
17
18
  _classCallCheck(this, MockMentionResource);
18
19
  _this = _callSuper(this, MockMentionResource);
@@ -27,6 +28,13 @@ export var MockMentionResource = /*#__PURE__*/function (_AbstractMentionResou) {
27
28
  _this.shouldEnableInvite = !!config.shouldEnableInvite;
28
29
  _this.onInviteItemClick = config.onInviteItemClick;
29
30
  _this.userRole = config.userRole || 'basic';
31
+ _this.isBrowserOnline = true;
32
+ (_window = window) === null || _window === void 0 || _window.addEventListener('offline', function () {
33
+ _this.isBrowserOnline = false;
34
+ });
35
+ (_window2 = window) === null || _window2 === void 0 || _window2.addEventListener('online', function () {
36
+ _this.isBrowserOnline = true;
37
+ });
30
38
  return _this;
31
39
  }
32
40
  _inherits(MockMentionResource, _AbstractMentionResou);
@@ -62,7 +70,10 @@ export var MockMentionResource = /*#__PURE__*/function (_AbstractMentionResou) {
62
70
  var waitTime = Math.random() * randomTime + minWait;
63
71
  setTimeout(function () {
64
72
  var mentions;
65
- if (query === 'error') {
73
+ if (!_this2.isBrowserOnline) {
74
+ notifyErrors(new Error('mock-offline-error'));
75
+ return;
76
+ } else if (query === 'error') {
66
77
  notifyErrors(new Error('mock-error'));
67
78
  notifyAnalytics(SLI_EVENT_TYPE, 'searchUser', 'failed');
68
79
  return;
@@ -13,6 +13,7 @@ export declare class MockMentionResource extends AbstractMentionResource impleme
13
13
  private config;
14
14
  private lastReturnedSearch;
15
15
  private search;
16
+ private isBrowserOnline;
16
17
  productName?: string;
17
18
  shouldEnableInvite: boolean;
18
19
  userRole: UserRole;
@@ -13,6 +13,7 @@ export declare class MockMentionResource extends AbstractMentionResource impleme
13
13
  private config;
14
14
  private lastReturnedSearch;
15
15
  private search;
16
+ private isBrowserOnline;
16
17
  productName?: string;
17
18
  shouldEnableInvite: boolean;
18
19
  userRole: UserRole;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/util-data-test",
3
- "version": "17.13.25",
3
+ "version": "17.13.26",
4
4
  "description": "Shared test and story data",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -67,14 +67,14 @@
67
67
  },
68
68
  "dependencies": {
69
69
  "@atlaskit/analytics-next": "^10.2.0",
70
- "@atlaskit/emoji": "67.12.0",
71
- "@atlaskit/icon": "^23.1.0",
72
- "@atlaskit/mention": "23.7.0",
70
+ "@atlaskit/emoji": "67.12.1",
71
+ "@atlaskit/icon": "^23.3.0",
72
+ "@atlaskit/mention": "23.7.1",
73
73
  "@atlaskit/primitives": "^13.3.0",
74
74
  "@atlaskit/profilecard": "^21.1.0",
75
75
  "@atlaskit/theme": "^14.0.0",
76
- "@atlaskit/tokens": "^2.5.0",
77
- "@atlaskit/user-picker": "10.29.1",
76
+ "@atlaskit/tokens": "^3.0.0",
77
+ "@atlaskit/user-picker": "10.29.2",
78
78
  "@atlaskit/util-service-support": "^6.2.0",
79
79
  "@babel/runtime": "^7.0.0",
80
80
  "lodash": "^4.17.21",