@atlaskit/util-data-test 17.3.0 → 17.4.0

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,15 @@
1
1
  # @atlaskit/util-data-test
2
2
 
3
+ ## 17.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`06232e0f8dd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/06232e0f8dd) - [ux] Opt In SSR for Resourced Emoji and Emoji Placeholder with EmojiResource interfaces
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
3
13
  ## 17.3.0
4
14
 
5
15
  ### Minor Changes
@@ -88,6 +88,65 @@ var MockEmojiResource = /*#__PURE__*/function (_MockNonUploadingEmoj) {
88
88
 
89
89
  return getMediaEmojiDescriptionURLWithInlineToken;
90
90
  }()
91
+ }, {
92
+ key: "fetchEmojiProvider",
93
+ value: function () {
94
+ var _fetchEmojiProvider = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(force) {
95
+ return _regenerator.default.wrap(function _callee2$(_context2) {
96
+ while (1) {
97
+ switch (_context2.prev = _context2.next) {
98
+ case 0:
99
+ return _context2.abrupt("return", Promise.resolve(this.emojiRepository));
100
+
101
+ case 1:
102
+ case "end":
103
+ return _context2.stop();
104
+ }
105
+ }
106
+ }, _callee2, this);
107
+ }));
108
+
109
+ function fetchEmojiProvider(_x2) {
110
+ return _fetchEmojiProvider.apply(this, arguments);
111
+ }
112
+
113
+ return fetchEmojiProvider;
114
+ }()
115
+ }, {
116
+ key: "fetchByEmojiId",
117
+ value: function () {
118
+ var _fetchByEmojiId = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(emojiId, optimistic) {
119
+ var _this2 = this;
120
+
121
+ return _regenerator.default.wrap(function _callee3$(_context3) {
122
+ while (1) {
123
+ switch (_context3.prev = _context3.next) {
124
+ case 0:
125
+ return _context3.abrupt("return", new Promise(function (resolve) {
126
+ setTimeout(function () {
127
+ resolve(_this2.findByEmojiId(emojiId));
128
+ }, 1000);
129
+ }));
130
+
131
+ case 1:
132
+ case "end":
133
+ return _context3.stop();
134
+ }
135
+ }
136
+ }, _callee3);
137
+ }));
138
+
139
+ function fetchByEmojiId(_x3, _x4) {
140
+ return _fetchByEmojiId.apply(this, arguments);
141
+ }
142
+
143
+ return fetchByEmojiId;
144
+ }()
145
+ }, {
146
+ key: "getOptimisticImageURL",
147
+ value: function getOptimisticImageURL(emojiId) {
148
+ return 'optimisticUrl';
149
+ }
91
150
  }, {
92
151
  key: "isUploadSupported",
93
152
  value: function isUploadSupported() {
@@ -69,6 +69,35 @@ var MockNonUploadingEmojiResource = /*#__PURE__*/function (_AbstractResource) {
69
69
  }
70
70
 
71
71
  (0, _createClass2.default)(MockNonUploadingEmojiResource, [{
72
+ key: "fetchEmojiProvider",
73
+ value: function () {
74
+ var _fetchEmojiProvider = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(force) {
75
+ return _regenerator.default.wrap(function _callee$(_context) {
76
+ while (1) {
77
+ switch (_context.prev = _context.next) {
78
+ case 0:
79
+ return _context.abrupt("return", Promise.resolve(this.emojiRepository));
80
+
81
+ case 1:
82
+ case "end":
83
+ return _context.stop();
84
+ }
85
+ }
86
+ }, _callee, this);
87
+ }));
88
+
89
+ function fetchEmojiProvider(_x) {
90
+ return _fetchEmojiProvider.apply(this, arguments);
91
+ }
92
+
93
+ return fetchEmojiProvider;
94
+ }()
95
+ }, {
96
+ key: "getOptimisticImageURL",
97
+ value: function getOptimisticImageURL(emojiId) {
98
+ return 'optimisticUrl';
99
+ }
100
+ }, {
72
101
  key: "getCurrentUser",
73
102
  value: function getCurrentUser() {
74
103
  return this.currentUser;
@@ -127,22 +156,22 @@ var MockNonUploadingEmojiResource = /*#__PURE__*/function (_AbstractResource) {
127
156
  }, {
128
157
  key: "getFrequentlyUsed",
129
158
  value: function () {
130
- var _getFrequentlyUsed = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(options) {
131
- return _regenerator.default.wrap(function _callee$(_context) {
159
+ var _getFrequentlyUsed = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(options) {
160
+ return _regenerator.default.wrap(function _callee2$(_context2) {
132
161
  while (1) {
133
- switch (_context.prev = _context.next) {
162
+ switch (_context2.prev = _context2.next) {
134
163
  case 0:
135
- return _context.abrupt("return", this.promiseBuilder(this.emojiRepository.getFrequentlyUsed(options), 'getFrequentlyUsed'));
164
+ return _context2.abrupt("return", this.promiseBuilder(this.emojiRepository.getFrequentlyUsed(options), 'getFrequentlyUsed'));
136
165
 
137
166
  case 1:
138
167
  case "end":
139
- return _context.stop();
168
+ return _context2.stop();
140
169
  }
141
170
  }
142
- }, _callee, this);
171
+ }, _callee2, this);
143
172
  }));
144
173
 
145
- function getFrequentlyUsed(_x) {
174
+ function getFrequentlyUsed(_x2) {
146
175
  return _getFrequentlyUsed.apply(this, arguments);
147
176
  }
148
177
 
@@ -151,22 +180,22 @@ var MockNonUploadingEmojiResource = /*#__PURE__*/function (_AbstractResource) {
151
180
  }, {
152
181
  key: "getMediaEmojiDescriptionURLWithInlineToken",
153
182
  value: function () {
154
- var _getMediaEmojiDescriptionURLWithInlineToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(emoji) {
155
- return _regenerator.default.wrap(function _callee2$(_context2) {
183
+ var _getMediaEmojiDescriptionURLWithInlineToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(emoji) {
184
+ return _regenerator.default.wrap(function _callee3$(_context3) {
156
185
  while (1) {
157
- switch (_context2.prev = _context2.next) {
186
+ switch (_context3.prev = _context3.next) {
158
187
  case 0:
159
- return _context2.abrupt("return", emoji);
188
+ return _context3.abrupt("return", emoji);
160
189
 
161
190
  case 1:
162
191
  case "end":
163
- return _context2.stop();
192
+ return _context3.stop();
164
193
  }
165
194
  }
166
- }, _callee2);
195
+ }, _callee3);
167
196
  }));
168
197
 
169
- function getMediaEmojiDescriptionURLWithInlineToken(_x2) {
198
+ function getMediaEmojiDescriptionURLWithInlineToken(_x3) {
170
199
  return _getMediaEmojiDescriptionURLWithInlineToken.apply(this, arguments);
171
200
  }
172
201
 
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/util-data-test",
3
- "version": "17.3.0"
3
+ "version": "17.4.0"
4
4
  }
@@ -23,6 +23,22 @@ export class MockEmojiResource extends MockNonUploadingEmojiResource {
23
23
  return emoji;
24
24
  }
25
25
 
26
+ async fetchEmojiProvider(force) {
27
+ return Promise.resolve(this.emojiRepository);
28
+ }
29
+
30
+ async fetchByEmojiId(emojiId, optimistic) {
31
+ return new Promise(resolve => {
32
+ setTimeout(() => {
33
+ resolve(this.findByEmojiId(emojiId));
34
+ }, 1000);
35
+ });
36
+ }
37
+
38
+ getOptimisticImageURL(emojiId) {
39
+ return 'optimisticUrl';
40
+ }
41
+
26
42
  isUploadSupported() {
27
43
  return this.promiseBuilder(this.uploadSupported, 'isUploadSupported');
28
44
  }
@@ -28,6 +28,14 @@ export class MockNonUploadingEmojiResource extends AbstractResource {
28
28
  }
29
29
  }
30
30
 
31
+ async fetchEmojiProvider(force) {
32
+ return Promise.resolve(this.emojiRepository);
33
+ }
34
+
35
+ getOptimisticImageURL(emojiId) {
36
+ return 'optimisticUrl';
37
+ }
38
+
31
39
  getCurrentUser() {
32
40
  return this.currentUser;
33
41
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/util-data-test",
3
- "version": "17.3.0"
3
+ "version": "17.4.0"
4
4
  }
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import { EmojiRepository } from '@atlaskit/emoji/resource';
4
4
  import { denormaliseEmojiServiceResponse } from '@atlaskit/emoji/utils';
5
5
  import { MockEmojiResource } from './mock-emoji-resource';
@@ -1,4 +1,3 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
3
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -8,6 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
8
7
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
9
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
10
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
11
11
 
12
12
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
13
13
 
@@ -71,6 +71,65 @@ export var MockEmojiResource = /*#__PURE__*/function (_MockNonUploadingEmoj) {
71
71
 
72
72
  return getMediaEmojiDescriptionURLWithInlineToken;
73
73
  }()
74
+ }, {
75
+ key: "fetchEmojiProvider",
76
+ value: function () {
77
+ var _fetchEmojiProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(force) {
78
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
79
+ while (1) {
80
+ switch (_context2.prev = _context2.next) {
81
+ case 0:
82
+ return _context2.abrupt("return", Promise.resolve(this.emojiRepository));
83
+
84
+ case 1:
85
+ case "end":
86
+ return _context2.stop();
87
+ }
88
+ }
89
+ }, _callee2, this);
90
+ }));
91
+
92
+ function fetchEmojiProvider(_x2) {
93
+ return _fetchEmojiProvider.apply(this, arguments);
94
+ }
95
+
96
+ return fetchEmojiProvider;
97
+ }()
98
+ }, {
99
+ key: "fetchByEmojiId",
100
+ value: function () {
101
+ var _fetchByEmojiId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(emojiId, optimistic) {
102
+ var _this2 = this;
103
+
104
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
105
+ while (1) {
106
+ switch (_context3.prev = _context3.next) {
107
+ case 0:
108
+ return _context3.abrupt("return", new Promise(function (resolve) {
109
+ setTimeout(function () {
110
+ resolve(_this2.findByEmojiId(emojiId));
111
+ }, 1000);
112
+ }));
113
+
114
+ case 1:
115
+ case "end":
116
+ return _context3.stop();
117
+ }
118
+ }
119
+ }, _callee3);
120
+ }));
121
+
122
+ function fetchByEmojiId(_x3, _x4) {
123
+ return _fetchByEmojiId.apply(this, arguments);
124
+ }
125
+
126
+ return fetchByEmojiId;
127
+ }()
128
+ }, {
129
+ key: "getOptimisticImageURL",
130
+ value: function getOptimisticImageURL(emojiId) {
131
+ return 'optimisticUrl';
132
+ }
74
133
  }, {
75
134
  key: "isUploadSupported",
76
135
  value: function isUploadSupported() {
@@ -1,4 +1,3 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
3
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -7,6 +6,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
6
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
7
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
10
10
 
11
11
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
12
 
@@ -54,6 +54,35 @@ export var MockNonUploadingEmojiResource = /*#__PURE__*/function (_AbstractResou
54
54
  }
55
55
 
56
56
  _createClass(MockNonUploadingEmojiResource, [{
57
+ key: "fetchEmojiProvider",
58
+ value: function () {
59
+ var _fetchEmojiProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(force) {
60
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
61
+ while (1) {
62
+ switch (_context.prev = _context.next) {
63
+ case 0:
64
+ return _context.abrupt("return", Promise.resolve(this.emojiRepository));
65
+
66
+ case 1:
67
+ case "end":
68
+ return _context.stop();
69
+ }
70
+ }
71
+ }, _callee, this);
72
+ }));
73
+
74
+ function fetchEmojiProvider(_x) {
75
+ return _fetchEmojiProvider.apply(this, arguments);
76
+ }
77
+
78
+ return fetchEmojiProvider;
79
+ }()
80
+ }, {
81
+ key: "getOptimisticImageURL",
82
+ value: function getOptimisticImageURL(emojiId) {
83
+ return 'optimisticUrl';
84
+ }
85
+ }, {
57
86
  key: "getCurrentUser",
58
87
  value: function getCurrentUser() {
59
88
  return this.currentUser;
@@ -112,22 +141,22 @@ export var MockNonUploadingEmojiResource = /*#__PURE__*/function (_AbstractResou
112
141
  }, {
113
142
  key: "getFrequentlyUsed",
114
143
  value: function () {
115
- var _getFrequentlyUsed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
116
- return _regeneratorRuntime.wrap(function _callee$(_context) {
144
+ var _getFrequentlyUsed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(options) {
145
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
117
146
  while (1) {
118
- switch (_context.prev = _context.next) {
147
+ switch (_context2.prev = _context2.next) {
119
148
  case 0:
120
- return _context.abrupt("return", this.promiseBuilder(this.emojiRepository.getFrequentlyUsed(options), 'getFrequentlyUsed'));
149
+ return _context2.abrupt("return", this.promiseBuilder(this.emojiRepository.getFrequentlyUsed(options), 'getFrequentlyUsed'));
121
150
 
122
151
  case 1:
123
152
  case "end":
124
- return _context.stop();
153
+ return _context2.stop();
125
154
  }
126
155
  }
127
- }, _callee, this);
156
+ }, _callee2, this);
128
157
  }));
129
158
 
130
- function getFrequentlyUsed(_x) {
159
+ function getFrequentlyUsed(_x2) {
131
160
  return _getFrequentlyUsed.apply(this, arguments);
132
161
  }
133
162
 
@@ -136,22 +165,22 @@ export var MockNonUploadingEmojiResource = /*#__PURE__*/function (_AbstractResou
136
165
  }, {
137
166
  key: "getMediaEmojiDescriptionURLWithInlineToken",
138
167
  value: function () {
139
- var _getMediaEmojiDescriptionURLWithInlineToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(emoji) {
140
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
168
+ var _getMediaEmojiDescriptionURLWithInlineToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(emoji) {
169
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
141
170
  while (1) {
142
- switch (_context2.prev = _context2.next) {
171
+ switch (_context3.prev = _context3.next) {
143
172
  case 0:
144
- return _context2.abrupt("return", emoji);
173
+ return _context3.abrupt("return", emoji);
145
174
 
146
175
  case 1:
147
176
  case "end":
148
- return _context2.stop();
177
+ return _context3.stop();
149
178
  }
150
179
  }
151
- }, _callee2);
180
+ }, _callee3);
152
181
  }));
153
182
 
154
- function getMediaEmojiDescriptionURLWithInlineToken(_x2) {
183
+ function getMediaEmojiDescriptionURLWithInlineToken(_x3) {
155
184
  return _getMediaEmojiDescriptionURLWithInlineToken.apply(this, arguments);
156
185
  }
157
186
 
@@ -1,4 +1,3 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
@@ -6,6 +5,7 @@ import _createClass from "@babel/runtime/helpers/createClass";
6
5
  import _inherits from "@babel/runtime/helpers/inherits";
7
6
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
7
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
9
9
 
10
10
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
11
 
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/util-data-test",
3
- "version": "17.3.0"
3
+ "version": "17.4.0"
4
4
  }
@@ -1,5 +1,5 @@
1
1
  import { UploadingEmojiProvider, EmojiRepository } from '@atlaskit/emoji/resource';
2
- import { EmojiDescription, EmojiUpload } from '@atlaskit/emoji/types';
2
+ import { EmojiDescription, EmojiId, EmojiUpload, OptionalEmojiDescriptionWithVariations } from '@atlaskit/emoji/types';
3
3
  import { MockNonUploadingEmojiResource } from './mock-non-uploading-emoji-resource';
4
4
  import { MockEmojiResourceConfig, UploadDetail } from './types';
5
5
  export declare class MockEmojiResource extends MockNonUploadingEmojiResource implements UploadingEmojiProvider {
@@ -8,6 +8,9 @@ export declare class MockEmojiResource extends MockNonUploadingEmojiResource imp
8
8
  private uploadError?;
9
9
  constructor(emojiService: EmojiRepository, config?: MockEmojiResourceConfig);
10
10
  getMediaEmojiDescriptionURLWithInlineToken(emoji: EmojiDescription): Promise<EmojiDescription>;
11
+ fetchEmojiProvider(force?: boolean): Promise<EmojiRepository | undefined>;
12
+ fetchByEmojiId(emojiId: EmojiId, optimistic: boolean): Promise<OptionalEmojiDescriptionWithVariations>;
13
+ getOptimisticImageURL(emojiId: EmojiId): string;
11
14
  isUploadSupported(): Promise<boolean>;
12
15
  uploadCustomEmoji(upload: EmojiUpload): Promise<any>;
13
16
  getUploads(): UploadDetail[];
@@ -11,6 +11,8 @@ export declare class MockNonUploadingEmojiResource extends AbstractResource<stri
11
11
  protected currentUser?: User;
12
12
  recordedSelections: EmojiDescription[];
13
13
  constructor(emojiService: EmojiRepository, config?: MockEmojiResourceConfig);
14
+ fetchEmojiProvider(force?: boolean): Promise<EmojiRepository | undefined>;
15
+ getOptimisticImageURL(emojiId: EmojiId): string;
14
16
  getCurrentUser(): OptionalUser;
15
17
  filter(query?: string, options?: SearchOptions): void;
16
18
  findByShortName(shortName: string): Promise<OptionalEmojiDescription>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/util-data-test",
3
- "version": "17.3.0",
3
+ "version": "17.4.0",
4
4
  "description": "Shared test and story data",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -66,9 +66,9 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@atlaskit/analytics-next": "^8.0.0",
69
- "@atlaskit/emoji": "^64.7.0",
69
+ "@atlaskit/emoji": "^65.0.0",
70
70
  "@atlaskit/mention": "^21.0.0",
71
- "@atlaskit/profilecard": "^16.5.0",
71
+ "@atlaskit/profilecard": "^16.10.0",
72
72
  "@atlaskit/task-decision": "^17.4.0",
73
73
  "@atlaskit/util-service-support": "^6.1.0",
74
74
  "@babel/runtime": "^7.0.0",