@atlaskit/editor-plugin-emoji 8.0.0 → 8.1.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,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-emoji
|
|
2
2
|
|
|
3
|
+
## 8.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`517f06f895cc9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/517f06f895cc9) -
|
|
8
|
+
[https://product-fabric.atlassian.net/browse/ED-29730](ED-29730) - clen up
|
|
9
|
+
platform_editor_emoji_otp Statsig experiment
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 8.0.0
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -66,12 +66,8 @@ var EmojiNodeView = exports.EmojiNodeView = /*#__PURE__*/function () {
|
|
|
66
66
|
var _DOMSerializer$render = _model.DOMSerializer.renderSpec(document, (0, _emojiNodeSpec.emojiToDom)(this.node)),
|
|
67
67
|
dom = _DOMSerializer$render.dom;
|
|
68
68
|
this.dom = dom;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
} else {
|
|
72
|
-
this.domElement = dom instanceof HTMLElement ? dom : undefined;
|
|
73
|
-
}
|
|
74
|
-
if ((0, _expValEquals.expValEquals)('platform_editor_emoji_otp', 'isEnabled', true) && emojiNodeDataProvider) {
|
|
69
|
+
this.domElement = this.isHTMLElement(dom) ? dom : undefined;
|
|
70
|
+
if (emojiNodeDataProvider) {
|
|
75
71
|
var previousEmojiDescription;
|
|
76
72
|
emojiNodeDataProvider.getData(node, function (payload) {
|
|
77
73
|
if (payload.error) {
|
|
@@ -279,22 +275,10 @@ var EmojiNodeView = exports.EmojiNodeView = /*#__PURE__*/function () {
|
|
|
279
275
|
imageElement.src = 'imagePath' in representation ? representation.imagePath : representation.mediaPath;
|
|
280
276
|
imageElement.loading = 'lazy';
|
|
281
277
|
imageElement.alt = emojiDescription.name || emojiDescription.shortName;
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
if (representation.width && representation.height) {
|
|
287
|
-
imageElement.height = _emoji.defaultEmojiHeight;
|
|
288
|
-
if (!(0, _expValEquals.expValEquals)('platform_editor_emoji_otp', 'isEnabled', true)) {
|
|
289
|
-
// Because img.width is round to the nearest integer.
|
|
290
|
-
imageElement.setAttribute('width', "".concat(_emoji.defaultEmojiHeight / representation.height * representation.width));
|
|
291
|
-
}
|
|
292
|
-
}
|
|
278
|
+
imageElement.style.minWidth = "".concat(_emoji.defaultEmojiHeight, "px");
|
|
279
|
+
imageElement.style.objectFit = 'contain';
|
|
280
|
+
imageElement.height = _emoji.defaultEmojiHeight;
|
|
293
281
|
imageElement.onerror = function () {
|
|
294
|
-
if ((0, _expValEquals.expValEquals)('platform_editor_emoji_otp', 'isEnabled', true)) {
|
|
295
|
-
_this2.renderFallback();
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
282
|
if ((0, _experiments.editorExperiment)('platform_editor_offline_editing_web', true)) {
|
|
299
283
|
// If there's an error (ie. offline) render the ascii fallback if possible, otherwise
|
|
300
284
|
// mark the node to refresh when returning online.
|
|
@@ -304,6 +288,8 @@ var EmojiNodeView = exports.EmojiNodeView = /*#__PURE__*/function () {
|
|
|
304
288
|
} else {
|
|
305
289
|
_this2.renderingFallback = true;
|
|
306
290
|
}
|
|
291
|
+
} else {
|
|
292
|
+
_this2.renderFallback();
|
|
307
293
|
}
|
|
308
294
|
};
|
|
309
295
|
return imageElement;
|
|
@@ -60,12 +60,8 @@ export class EmojiNodeView {
|
|
|
60
60
|
dom
|
|
61
61
|
} = DOMSerializer.renderSpec(document, emojiToDom(this.node));
|
|
62
62
|
this.dom = dom;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
} else {
|
|
66
|
-
this.domElement = dom instanceof HTMLElement ? dom : undefined;
|
|
67
|
-
}
|
|
68
|
-
if (expValEquals('platform_editor_emoji_otp', 'isEnabled', true) && emojiNodeDataProvider) {
|
|
63
|
+
this.domElement = this.isHTMLElement(dom) ? dom : undefined;
|
|
64
|
+
if (emojiNodeDataProvider) {
|
|
69
65
|
let previousEmojiDescription;
|
|
70
66
|
emojiNodeDataProvider.getData(node, payload => {
|
|
71
67
|
if (payload.error) {
|
|
@@ -240,22 +236,10 @@ export class EmojiNodeView {
|
|
|
240
236
|
imageElement.src = 'imagePath' in representation ? representation.imagePath : representation.mediaPath;
|
|
241
237
|
imageElement.loading = 'lazy';
|
|
242
238
|
imageElement.alt = emojiDescription.name || emojiDescription.shortName;
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
if (representation.width && representation.height) {
|
|
248
|
-
imageElement.height = defaultEmojiHeight;
|
|
249
|
-
if (!expValEquals('platform_editor_emoji_otp', 'isEnabled', true)) {
|
|
250
|
-
// Because img.width is round to the nearest integer.
|
|
251
|
-
imageElement.setAttribute('width', `${defaultEmojiHeight / representation.height * representation.width}`);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
239
|
+
imageElement.style.minWidth = `${defaultEmojiHeight}px`;
|
|
240
|
+
imageElement.style.objectFit = 'contain';
|
|
241
|
+
imageElement.height = defaultEmojiHeight;
|
|
254
242
|
imageElement.onerror = () => {
|
|
255
|
-
if (expValEquals('platform_editor_emoji_otp', 'isEnabled', true)) {
|
|
256
|
-
this.renderFallback();
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
243
|
if (editorExperiment('platform_editor_offline_editing_web', true)) {
|
|
260
244
|
// If there's an error (ie. offline) render the ascii fallback if possible, otherwise
|
|
261
245
|
// mark the node to refresh when returning online.
|
|
@@ -265,6 +249,8 @@ export class EmojiNodeView {
|
|
|
265
249
|
} else {
|
|
266
250
|
this.renderingFallback = true;
|
|
267
251
|
}
|
|
252
|
+
} else {
|
|
253
|
+
this.renderFallback();
|
|
268
254
|
}
|
|
269
255
|
};
|
|
270
256
|
return imageElement;
|
|
@@ -58,12 +58,8 @@ export var EmojiNodeView = /*#__PURE__*/function () {
|
|
|
58
58
|
var _DOMSerializer$render = DOMSerializer.renderSpec(document, emojiToDom(this.node)),
|
|
59
59
|
dom = _DOMSerializer$render.dom;
|
|
60
60
|
this.dom = dom;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
} else {
|
|
64
|
-
this.domElement = dom instanceof HTMLElement ? dom : undefined;
|
|
65
|
-
}
|
|
66
|
-
if (expValEquals('platform_editor_emoji_otp', 'isEnabled', true) && emojiNodeDataProvider) {
|
|
61
|
+
this.domElement = this.isHTMLElement(dom) ? dom : undefined;
|
|
62
|
+
if (emojiNodeDataProvider) {
|
|
67
63
|
var previousEmojiDescription;
|
|
68
64
|
emojiNodeDataProvider.getData(node, function (payload) {
|
|
69
65
|
if (payload.error) {
|
|
@@ -271,22 +267,10 @@ export var EmojiNodeView = /*#__PURE__*/function () {
|
|
|
271
267
|
imageElement.src = 'imagePath' in representation ? representation.imagePath : representation.mediaPath;
|
|
272
268
|
imageElement.loading = 'lazy';
|
|
273
269
|
imageElement.alt = emojiDescription.name || emojiDescription.shortName;
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
if (representation.width && representation.height) {
|
|
279
|
-
imageElement.height = defaultEmojiHeight;
|
|
280
|
-
if (!expValEquals('platform_editor_emoji_otp', 'isEnabled', true)) {
|
|
281
|
-
// Because img.width is round to the nearest integer.
|
|
282
|
-
imageElement.setAttribute('width', "".concat(defaultEmojiHeight / representation.height * representation.width));
|
|
283
|
-
}
|
|
284
|
-
}
|
|
270
|
+
imageElement.style.minWidth = "".concat(defaultEmojiHeight, "px");
|
|
271
|
+
imageElement.style.objectFit = 'contain';
|
|
272
|
+
imageElement.height = defaultEmojiHeight;
|
|
285
273
|
imageElement.onerror = function () {
|
|
286
|
-
if (expValEquals('platform_editor_emoji_otp', 'isEnabled', true)) {
|
|
287
|
-
_this2.renderFallback();
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
274
|
if (editorExperiment('platform_editor_offline_editing_web', true)) {
|
|
291
275
|
// If there's an error (ie. offline) render the ascii fallback if possible, otherwise
|
|
292
276
|
// mark the node to refresh when returning online.
|
|
@@ -296,6 +280,8 @@ export var EmojiNodeView = /*#__PURE__*/function () {
|
|
|
296
280
|
} else {
|
|
297
281
|
_this2.renderingFallback = true;
|
|
298
282
|
}
|
|
283
|
+
} else {
|
|
284
|
+
_this2.renderFallback();
|
|
299
285
|
}
|
|
300
286
|
};
|
|
301
287
|
return imageElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-emoji",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"description": "Emoji plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"@atlaskit/node-data-provider": "^8.0.0",
|
|
37
37
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
38
38
|
"@atlaskit/prosemirror-input-rules": "^3.6.0",
|
|
39
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
40
|
-
"@atlaskit/tokens": "^9.
|
|
39
|
+
"@atlaskit/tmp-editor-statsig": "^16.8.0",
|
|
40
|
+
"@atlaskit/tokens": "^9.1.0",
|
|
41
41
|
"@babel/runtime": "^7.0.0",
|
|
42
42
|
"@emotion/react": "^11.7.1",
|
|
43
43
|
"lodash": "^4.17.21",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"react-loadable": "^5.1.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@atlaskit/editor-common": "^111.
|
|
48
|
+
"@atlaskit/editor-common": "^111.4.0",
|
|
49
49
|
"react": "^18.2.0",
|
|
50
50
|
"react-dom": "^18.2.0"
|
|
51
51
|
},
|