@atlaskit/editor-plugin-emoji 11.2.4 → 11.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-plugin-emoji
2
2
 
3
+ ## 11.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 11.2.4
4
10
 
5
11
  ### Patch Changes
@@ -257,25 +257,25 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
257
257
  var _setProvider = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(providerPromise) {
258
258
  var _api$core$actions$exe;
259
259
  var provider;
260
- return _regenerator.default.wrap(function _callee$(_context) {
260
+ return _regenerator.default.wrap(function (_context) {
261
261
  while (1) switch (_context.prev = _context.next) {
262
262
  case 0:
263
- _context.next = 2;
263
+ _context.next = 1;
264
264
  return providerPromise;
265
- case 2:
265
+ case 1:
266
266
  provider = _context.sent;
267
267
  if (!(previousEmojiProvider === provider || (options === null || options === void 0 ? void 0 : options.emojiProvider) === providerPromise)) {
268
- _context.next = 5;
268
+ _context.next = 2;
269
269
  break;
270
270
  }
271
271
  return _context.abrupt("return", false);
272
- case 5:
272
+ case 2:
273
273
  previousEmojiProvider = provider;
274
274
  return _context.abrupt("return", (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(function (_ref0) {
275
275
  var tr = _ref0.tr;
276
276
  return setProviderTr(provider)(tr);
277
277
  })) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false);
278
- case 7:
278
+ case 3:
279
279
  case "end":
280
280
  return _context.stop();
281
281
  }
@@ -154,50 +154,50 @@ var EmojiNodeView = exports.EmojiNodeView = /*#__PURE__*/function () {
154
154
  key: "updateDom",
155
155
  value: function () {
156
156
  var _updateDom = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(emojiProvider) {
157
- var _this$node$attrs, shortName, id, fallback, emojiDescription, emojiRepresentation;
158
- return _regenerator.default.wrap(function _callee$(_context) {
157
+ var _this$node$attrs, shortName, id, fallback, emojiDescription, emojiRepresentation, _t;
158
+ return _regenerator.default.wrap(function (_context) {
159
159
  while (1) switch (_context.prev = _context.next) {
160
160
  case 0:
161
161
  _context.prev = 0;
162
162
  _this$node$attrs = this.node.attrs, shortName = _this$node$attrs.shortName, id = _this$node$attrs.id, fallback = _this$node$attrs.text;
163
- _context.next = 4;
163
+ _context.next = 1;
164
164
  return emojiProvider === null || emojiProvider === void 0 ? void 0 : emojiProvider.fetchByEmojiId({
165
165
  id: id,
166
166
  shortName: shortName,
167
167
  fallback: fallback
168
168
  }, true);
169
- case 4:
169
+ case 1:
170
170
  emojiDescription = _context.sent;
171
171
  if (emojiDescription) {
172
- _context.next = 9;
172
+ _context.next = 2;
173
173
  break;
174
174
  }
175
175
  EmojiNodeView.logError(new Error('Emoji description is not loaded'));
176
176
  this.renderFallback();
177
177
  return _context.abrupt("return");
178
- case 9:
178
+ case 2:
179
179
  emojiRepresentation = emojiDescription === null || emojiDescription === void 0 ? void 0 : emojiDescription.representation;
180
180
  if (EmojiNodeView.isEmojiRepresentationSupported(emojiRepresentation)) {
181
- _context.next = 14;
181
+ _context.next = 3;
182
182
  break;
183
183
  }
184
184
  EmojiNodeView.logError(new Error('Emoji representation is not supported'));
185
185
  this.renderFallback();
186
186
  return _context.abrupt("return");
187
- case 14:
187
+ case 3:
188
188
  this.renderEmoji(emojiDescription, emojiRepresentation);
189
- _context.next = 21;
189
+ _context.next = 5;
190
190
  break;
191
- case 17:
192
- _context.prev = 17;
193
- _context.t0 = _context["catch"](0);
194
- EmojiNodeView.logError(_context.t0 instanceof Error ? _context.t0 : new Error('Unknown error on EmojiNodeView updateDom'));
191
+ case 4:
192
+ _context.prev = 4;
193
+ _t = _context["catch"](0);
194
+ EmojiNodeView.logError(_t instanceof Error ? _t : new Error('Unknown error on EmojiNodeView updateDom'));
195
195
  this.renderFallback();
196
- case 21:
196
+ case 5:
197
197
  case "end":
198
198
  return _context.stop();
199
199
  }
200
- }, _callee, this, [[0, 17]]);
200
+ }, _callee, this, [[0, 4]]);
201
201
  }));
202
202
  function updateDom(_x) {
203
203
  return _updateDom.apply(this, arguments);
@@ -78,7 +78,7 @@ var EmojiNodeDataProvider = exports.EmojiNodeDataProvider = /*#__PURE__*/functio
78
78
  var _fetchNodesData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(nodes) {
79
79
  var _this$emojiResource$e;
80
80
  var getOptimisticImageUrl, emojiProvider, fetches;
81
- return _regenerator.default.wrap(function _callee2$(_context2) {
81
+ return _regenerator.default.wrap(function (_context2) {
82
82
  while (1) switch (_context2.prev = _context2.next) {
83
83
  case 0:
84
84
  // If we have an `optimisticImageApi`, use it to generate a URL immediately.
@@ -92,7 +92,7 @@ var EmojiNodeDataProvider = exports.EmojiNodeDataProvider = /*#__PURE__*/functio
92
92
  // and platform/packages/elements/emoji/src/components/common/ResourcedEmojiComponent.tsx
93
93
  getOptimisticImageUrl = (_this$emojiResource$e = this.emojiResource.emojiProviderConfig.optimisticImageApi) === null || _this$emojiResource$e === void 0 ? void 0 : _this$emojiResource$e.getUrl;
94
94
  if (!((0, _coreUtils.isSSR)() && getOptimisticImageUrl)) {
95
- _context2.next = 3;
95
+ _context2.next = 1;
96
96
  break;
97
97
  }
98
98
  return _context2.abrupt("return", nodes.map(function (node) {
@@ -118,15 +118,15 @@ var EmojiNodeDataProvider = exports.EmojiNodeDataProvider = /*#__PURE__*/functio
118
118
  category: ''
119
119
  };
120
120
  }));
121
- case 3:
122
- _context2.next = 5;
121
+ case 1:
122
+ _context2.next = 2;
123
123
  return this.emojiProvider;
124
- case 5:
124
+ case 2:
125
125
  emojiProvider = _context2.sent;
126
126
  fetches = nodes.map( /*#__PURE__*/function () {
127
127
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(node) {
128
128
  var emojiId, result, optimisticImageURL;
129
- return _regenerator.default.wrap(function _callee$(_context) {
129
+ return _regenerator.default.wrap(function (_context) {
130
130
  while (1) switch (_context.prev = _context.next) {
131
131
  case 0:
132
132
  emojiId = {
@@ -134,17 +134,17 @@ var EmojiNodeDataProvider = exports.EmojiNodeDataProvider = /*#__PURE__*/functio
134
134
  shortName: node.attrs.shortName,
135
135
  fallback: node.attrs.text
136
136
  }; // This usually fast because the emojiProvider already has all emojis fetched.
137
- _context.next = 3;
137
+ _context.next = 1;
138
138
  return emojiProvider.fetchByEmojiId(emojiId, true);
139
- case 3:
139
+ case 1:
140
140
  result = _context.sent;
141
141
  if (!(getOptimisticImageUrl && result)) {
142
- _context.next = 8;
142
+ _context.next = 2;
143
143
  break;
144
144
  }
145
145
  optimisticImageURL = getOptimisticImageUrl(emojiId);
146
146
  if (!(result.representation && 'imagePath' in result.representation)) {
147
- _context.next = 8;
147
+ _context.next = 2;
148
148
  break;
149
149
  }
150
150
  return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
@@ -152,9 +152,9 @@ var EmojiNodeDataProvider = exports.EmojiNodeDataProvider = /*#__PURE__*/functio
152
152
  imagePath: optimisticImageURL
153
153
  })
154
154
  }));
155
- case 8:
155
+ case 2:
156
156
  return _context.abrupt("return", result);
157
- case 9:
157
+ case 3:
158
158
  case "end":
159
159
  return _context.stop();
160
160
  }
@@ -165,7 +165,7 @@ var EmojiNodeDataProvider = exports.EmojiNodeDataProvider = /*#__PURE__*/functio
165
165
  };
166
166
  }());
167
167
  return _context2.abrupt("return", Promise.all(fetches));
168
- case 8:
168
+ case 3:
169
169
  case "end":
170
170
  return _context2.stop();
171
171
  }
@@ -246,25 +246,25 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
246
246
  var _setProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(providerPromise) {
247
247
  var _api$core$actions$exe;
248
248
  var provider;
249
- return _regeneratorRuntime.wrap(function _callee$(_context) {
249
+ return _regeneratorRuntime.wrap(function (_context) {
250
250
  while (1) switch (_context.prev = _context.next) {
251
251
  case 0:
252
- _context.next = 2;
252
+ _context.next = 1;
253
253
  return providerPromise;
254
- case 2:
254
+ case 1:
255
255
  provider = _context.sent;
256
256
  if (!(previousEmojiProvider === provider || (options === null || options === void 0 ? void 0 : options.emojiProvider) === providerPromise)) {
257
- _context.next = 5;
257
+ _context.next = 2;
258
258
  break;
259
259
  }
260
260
  return _context.abrupt("return", false);
261
- case 5:
261
+ case 2:
262
262
  previousEmojiProvider = provider;
263
263
  return _context.abrupt("return", (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(function (_ref0) {
264
264
  var tr = _ref0.tr;
265
265
  return setProviderTr(provider)(tr);
266
266
  })) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false);
267
- case 7:
267
+ case 3:
268
268
  case "end":
269
269
  return _context.stop();
270
270
  }
@@ -146,50 +146,50 @@ export var EmojiNodeView = /*#__PURE__*/function () {
146
146
  key: "updateDom",
147
147
  value: function () {
148
148
  var _updateDom = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(emojiProvider) {
149
- var _this$node$attrs, shortName, id, fallback, emojiDescription, emojiRepresentation;
150
- return _regeneratorRuntime.wrap(function _callee$(_context) {
149
+ var _this$node$attrs, shortName, id, fallback, emojiDescription, emojiRepresentation, _t;
150
+ return _regeneratorRuntime.wrap(function (_context) {
151
151
  while (1) switch (_context.prev = _context.next) {
152
152
  case 0:
153
153
  _context.prev = 0;
154
154
  _this$node$attrs = this.node.attrs, shortName = _this$node$attrs.shortName, id = _this$node$attrs.id, fallback = _this$node$attrs.text;
155
- _context.next = 4;
155
+ _context.next = 1;
156
156
  return emojiProvider === null || emojiProvider === void 0 ? void 0 : emojiProvider.fetchByEmojiId({
157
157
  id: id,
158
158
  shortName: shortName,
159
159
  fallback: fallback
160
160
  }, true);
161
- case 4:
161
+ case 1:
162
162
  emojiDescription = _context.sent;
163
163
  if (emojiDescription) {
164
- _context.next = 9;
164
+ _context.next = 2;
165
165
  break;
166
166
  }
167
167
  EmojiNodeView.logError(new Error('Emoji description is not loaded'));
168
168
  this.renderFallback();
169
169
  return _context.abrupt("return");
170
- case 9:
170
+ case 2:
171
171
  emojiRepresentation = emojiDescription === null || emojiDescription === void 0 ? void 0 : emojiDescription.representation;
172
172
  if (EmojiNodeView.isEmojiRepresentationSupported(emojiRepresentation)) {
173
- _context.next = 14;
173
+ _context.next = 3;
174
174
  break;
175
175
  }
176
176
  EmojiNodeView.logError(new Error('Emoji representation is not supported'));
177
177
  this.renderFallback();
178
178
  return _context.abrupt("return");
179
- case 14:
179
+ case 3:
180
180
  this.renderEmoji(emojiDescription, emojiRepresentation);
181
- _context.next = 21;
181
+ _context.next = 5;
182
182
  break;
183
- case 17:
184
- _context.prev = 17;
185
- _context.t0 = _context["catch"](0);
186
- EmojiNodeView.logError(_context.t0 instanceof Error ? _context.t0 : new Error('Unknown error on EmojiNodeView updateDom'));
183
+ case 4:
184
+ _context.prev = 4;
185
+ _t = _context["catch"](0);
186
+ EmojiNodeView.logError(_t instanceof Error ? _t : new Error('Unknown error on EmojiNodeView updateDom'));
187
187
  this.renderFallback();
188
- case 21:
188
+ case 5:
189
189
  case "end":
190
190
  return _context.stop();
191
191
  }
192
- }, _callee, this, [[0, 17]]);
192
+ }, _callee, this, [[0, 4]]);
193
193
  }));
194
194
  function updateDom(_x) {
195
195
  return _updateDom.apply(this, arguments);
@@ -71,7 +71,7 @@ export var EmojiNodeDataProvider = /*#__PURE__*/function (_NodeDataProvider) {
71
71
  var _fetchNodesData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(nodes) {
72
72
  var _this$emojiResource$e;
73
73
  var getOptimisticImageUrl, emojiProvider, fetches;
74
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
74
+ return _regeneratorRuntime.wrap(function (_context2) {
75
75
  while (1) switch (_context2.prev = _context2.next) {
76
76
  case 0:
77
77
  // If we have an `optimisticImageApi`, use it to generate a URL immediately.
@@ -85,7 +85,7 @@ export var EmojiNodeDataProvider = /*#__PURE__*/function (_NodeDataProvider) {
85
85
  // and platform/packages/elements/emoji/src/components/common/ResourcedEmojiComponent.tsx
86
86
  getOptimisticImageUrl = (_this$emojiResource$e = this.emojiResource.emojiProviderConfig.optimisticImageApi) === null || _this$emojiResource$e === void 0 ? void 0 : _this$emojiResource$e.getUrl;
87
87
  if (!(isSSR() && getOptimisticImageUrl)) {
88
- _context2.next = 3;
88
+ _context2.next = 1;
89
89
  break;
90
90
  }
91
91
  return _context2.abrupt("return", nodes.map(function (node) {
@@ -111,15 +111,15 @@ export var EmojiNodeDataProvider = /*#__PURE__*/function (_NodeDataProvider) {
111
111
  category: ''
112
112
  };
113
113
  }));
114
- case 3:
115
- _context2.next = 5;
114
+ case 1:
115
+ _context2.next = 2;
116
116
  return this.emojiProvider;
117
- case 5:
117
+ case 2:
118
118
  emojiProvider = _context2.sent;
119
119
  fetches = nodes.map( /*#__PURE__*/function () {
120
120
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(node) {
121
121
  var emojiId, result, optimisticImageURL;
122
- return _regeneratorRuntime.wrap(function _callee$(_context) {
122
+ return _regeneratorRuntime.wrap(function (_context) {
123
123
  while (1) switch (_context.prev = _context.next) {
124
124
  case 0:
125
125
  emojiId = {
@@ -127,17 +127,17 @@ export var EmojiNodeDataProvider = /*#__PURE__*/function (_NodeDataProvider) {
127
127
  shortName: node.attrs.shortName,
128
128
  fallback: node.attrs.text
129
129
  }; // This usually fast because the emojiProvider already has all emojis fetched.
130
- _context.next = 3;
130
+ _context.next = 1;
131
131
  return emojiProvider.fetchByEmojiId(emojiId, true);
132
- case 3:
132
+ case 1:
133
133
  result = _context.sent;
134
134
  if (!(getOptimisticImageUrl && result)) {
135
- _context.next = 8;
135
+ _context.next = 2;
136
136
  break;
137
137
  }
138
138
  optimisticImageURL = getOptimisticImageUrl(emojiId);
139
139
  if (!(result.representation && 'imagePath' in result.representation)) {
140
- _context.next = 8;
140
+ _context.next = 2;
141
141
  break;
142
142
  }
143
143
  return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
@@ -145,9 +145,9 @@ export var EmojiNodeDataProvider = /*#__PURE__*/function (_NodeDataProvider) {
145
145
  imagePath: optimisticImageURL
146
146
  })
147
147
  }));
148
- case 8:
148
+ case 2:
149
149
  return _context.abrupt("return", result);
150
- case 9:
150
+ case 3:
151
151
  case "end":
152
152
  return _context.stop();
153
153
  }
@@ -158,7 +158,7 @@ export var EmojiNodeDataProvider = /*#__PURE__*/function (_NodeDataProvider) {
158
158
  };
159
159
  }());
160
160
  return _context2.abrupt("return", Promise.all(fetches));
161
- case 8:
161
+ case 3:
162
162
  case "end":
163
163
  return _context2.stop();
164
164
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-emoji",
3
- "version": "11.2.4",
3
+ "version": "11.2.5",
4
4
  "description": "Emoji plugin for @atlaskit/editor-core",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -21,7 +21,7 @@
21
21
  "singleton": true
22
22
  },
23
23
  "dependencies": {
24
- "@atlaskit/adf-schema": "^52.14.0",
24
+ "@atlaskit/adf-schema": "^52.15.0",
25
25
  "@atlaskit/browser-apis": "^0.0.2",
26
26
  "@atlaskit/editor-plugin-analytics": "^10.1.0",
27
27
  "@atlaskit/editor-plugin-annotation": "^10.5.0",
@@ -29,23 +29,23 @@
29
29
  "@atlaskit/editor-plugin-connectivity": "^10.1.0",
30
30
  "@atlaskit/editor-plugin-editor-viewmode": "^12.1.0",
31
31
  "@atlaskit/editor-plugin-metrics": "^11.1.0",
32
- "@atlaskit/editor-plugin-type-ahead": "^10.2.0",
32
+ "@atlaskit/editor-plugin-type-ahead": "^10.3.0",
33
33
  "@atlaskit/editor-prosemirror": "^7.3.0",
34
34
  "@atlaskit/editor-shared-styles": "^3.11.0",
35
- "@atlaskit/emoji": "^70.10.0",
35
+ "@atlaskit/emoji": "^70.11.0",
36
36
  "@atlaskit/icon": "^35.3.0",
37
37
  "@atlaskit/node-data-provider": "^11.1.0",
38
38
  "@atlaskit/platform-feature-flags": "^1.1.0",
39
39
  "@atlaskit/prosemirror-input-rules": "^3.7.0",
40
- "@atlaskit/tmp-editor-statsig": "^84.0.0",
41
- "@atlaskit/tokens": "^13.0.0",
40
+ "@atlaskit/tmp-editor-statsig": "^85.0.0",
41
+ "@atlaskit/tokens": "^13.1.0",
42
42
  "@babel/runtime": "^7.0.0",
43
43
  "@emotion/react": "^11.7.1",
44
44
  "lodash": "^4.17.21",
45
45
  "react-loadable": "^5.1.0"
46
46
  },
47
47
  "peerDependencies": {
48
- "@atlaskit/editor-common": "^114.47.0",
48
+ "@atlaskit/editor-common": "^114.50.0",
49
49
  "react": "^18.2.0",
50
50
  "react-dom": "^18.2.0",
51
51
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"