@atlaskit/editor-plugin-emoji 13.0.6 → 13.0.8
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 +16 -0
- package/dist/cjs/nodeviews/EmojiNodeView.js +8 -0
- package/dist/cjs/pm-plugins/providers/EmojiNodeDataProvider.js +3 -3
- package/dist/es2019/nodeviews/EmojiNodeView.js +6 -0
- package/dist/es2019/pm-plugins/providers/EmojiNodeDataProvider.js +3 -3
- package/dist/esm/nodeviews/EmojiNodeView.js +8 -0
- package/dist/esm/pm-plugins/providers/EmojiNodeDataProvider.js +3 -3
- package/dist/types/nodeviews/EmojiNodeView.d.ts +1 -0
- package/package.json +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-emoji
|
|
2
2
|
|
|
3
|
+
## 13.0.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`05b9f7b19ddba`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/05b9f7b19ddba) -
|
|
8
|
+
Use the platform_use_unicode_emojis experiment for native Unicode emoji rendering.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 13.0.7
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`9a7ca4cefe634`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9a7ca4cefe634) -
|
|
16
|
+
Use the platform_use_unicode_emojis experiment for native Unicode emoji rendering.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 13.0.6
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -273,6 +273,9 @@ var EmojiNodeView = exports.EmojiNodeView = /*#__PURE__*/function () {
|
|
|
273
273
|
var emojiElement = 'unicodeEmoji' in representation ? this.createUnicodeEmojiElement(representation.unicodeEmoji) : 'sprite' in representation ? this.createSpriteEmojiElement(representation) : this.createImageEmojiElement(description, representation);
|
|
274
274
|
containerElement.appendChild(emojiElement);
|
|
275
275
|
this.dom.appendChild(containerElement);
|
|
276
|
+
if (EmojiNodeView.shouldRecordUnicodeEmojiExposure(description, representation)) {
|
|
277
|
+
(0, _expValEquals.expValEquals)('platform_use_unicode_emojis', 'isEnabled', true);
|
|
278
|
+
}
|
|
276
279
|
}
|
|
277
280
|
}, {
|
|
278
281
|
key: "createUnicodeEmojiElement",
|
|
@@ -364,5 +367,10 @@ var EmojiNodeView = exports.EmojiNodeView = /*#__PURE__*/function () {
|
|
|
364
367
|
value: function isEmojiRepresentationSupported(representation) {
|
|
365
368
|
return !!representation && ('sprite' in representation || 'imagePath' in representation || 'mediaPath' in representation || 'unicodeEmoji' in representation);
|
|
366
369
|
}
|
|
370
|
+
}, {
|
|
371
|
+
key: "shouldRecordUnicodeEmojiExposure",
|
|
372
|
+
value: function shouldRecordUnicodeEmojiExposure(description, representation) {
|
|
373
|
+
return description.type === 'STANDARD' || 'unicodeEmoji' in representation;
|
|
374
|
+
}
|
|
367
375
|
}]);
|
|
368
376
|
}();
|
|
@@ -17,7 +17,7 @@ var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
|
17
17
|
var _emoji = require("@atlaskit/emoji");
|
|
18
18
|
var _emojiIdToEmoji = require("@atlaskit/emoji/emoji-id-to-emoji");
|
|
19
19
|
var _nodeDataProvider = require("@atlaskit/node-data-provider");
|
|
20
|
-
var
|
|
20
|
+
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
21
21
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22
22
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23
23
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
@@ -98,7 +98,7 @@ var EmojiNodeDataProvider = exports.EmojiNodeDataProvider = /*#__PURE__*/functio
|
|
|
98
98
|
break;
|
|
99
99
|
}
|
|
100
100
|
return _context2.abrupt("return", nodes.map(function (node) {
|
|
101
|
-
if ((0,
|
|
101
|
+
if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_use_unicode_emojis', 'isEnabled', true)) {
|
|
102
102
|
// Skip SSR for nodes without an Id
|
|
103
103
|
if (!node.attrs.id) {
|
|
104
104
|
return undefined;
|
|
@@ -160,7 +160,7 @@ var EmojiNodeDataProvider = exports.EmojiNodeDataProvider = /*#__PURE__*/functio
|
|
|
160
160
|
return emojiProvider.fetchByEmojiId(emojiId, true);
|
|
161
161
|
case 1:
|
|
162
162
|
result = _context.sent;
|
|
163
|
-
if (!(node.attrs.id && result && (0,
|
|
163
|
+
if (!(node.attrs.id && result && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_use_unicode_emojis', 'isEnabled', true))) {
|
|
164
164
|
_context.next = 2;
|
|
165
165
|
break;
|
|
166
166
|
}
|
|
@@ -177,6 +177,9 @@ export class EmojiNodeView {
|
|
|
177
177
|
static isEmojiRepresentationSupported(representation) {
|
|
178
178
|
return !!representation && ('sprite' in representation || 'imagePath' in representation || 'mediaPath' in representation || 'unicodeEmoji' in representation);
|
|
179
179
|
}
|
|
180
|
+
static shouldRecordUnicodeEmojiExposure(description, representation) {
|
|
181
|
+
return description.type === 'STANDARD' || 'unicodeEmoji' in representation;
|
|
182
|
+
}
|
|
180
183
|
|
|
181
184
|
// Pay attention, this method should be called only when the emoji provider returns
|
|
182
185
|
// emoji data to prevent rendering empty emoji during loading.
|
|
@@ -240,6 +243,9 @@ export class EmojiNodeView {
|
|
|
240
243
|
const emojiElement = 'unicodeEmoji' in representation ? this.createUnicodeEmojiElement(representation.unicodeEmoji) : 'sprite' in representation ? this.createSpriteEmojiElement(representation) : this.createImageEmojiElement(description, representation);
|
|
241
244
|
containerElement.appendChild(emojiElement);
|
|
242
245
|
this.dom.appendChild(containerElement);
|
|
246
|
+
if (EmojiNodeView.shouldRecordUnicodeEmojiExposure(description, representation)) {
|
|
247
|
+
expValEquals('platform_use_unicode_emojis', 'isEnabled', true);
|
|
248
|
+
}
|
|
243
249
|
}
|
|
244
250
|
createUnicodeEmojiElement(emoji) {
|
|
245
251
|
let doc = getDocument();
|
|
@@ -3,7 +3,7 @@ import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
|
3
3
|
import { defaultEmojiHeight } from '@atlaskit/emoji';
|
|
4
4
|
import { emojiIdToEmoji } from '@atlaskit/emoji/emoji-id-to-emoji';
|
|
5
5
|
import { NodeDataProvider } from '@atlaskit/node-data-provider';
|
|
6
|
-
import {
|
|
6
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
7
7
|
export class EmojiNodeDataProvider extends NodeDataProvider {
|
|
8
8
|
constructor(resource) {
|
|
9
9
|
super();
|
|
@@ -57,7 +57,7 @@ export class EmojiNodeDataProvider extends NodeDataProvider {
|
|
|
57
57
|
const getOptimisticImageUrl = (_this$emojiResource$e = this.emojiResource.emojiProviderConfig.optimisticImageApi) === null || _this$emojiResource$e === void 0 ? void 0 : _this$emojiResource$e.getUrl;
|
|
58
58
|
if (isSSR() && getOptimisticImageUrl) {
|
|
59
59
|
return nodes.map(node => {
|
|
60
|
-
if (
|
|
60
|
+
if (expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true)) {
|
|
61
61
|
// Skip SSR for nodes without an Id
|
|
62
62
|
if (!node.attrs.id) {
|
|
63
63
|
return undefined;
|
|
@@ -116,7 +116,7 @@ export class EmojiNodeDataProvider extends NodeDataProvider {
|
|
|
116
116
|
|
|
117
117
|
// For STANDARD emojis, return a UnicodeRepresentation so they are rendered
|
|
118
118
|
// as native text characters rather than images (twemoji removal).
|
|
119
|
-
if (node.attrs.id && result &&
|
|
119
|
+
if (node.attrs.id && result && expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true)) {
|
|
120
120
|
const unicodeEmoji = emojiIdToEmoji(node.attrs.id);
|
|
121
121
|
if (unicodeEmoji) {
|
|
122
122
|
return {
|
|
@@ -265,6 +265,9 @@ export var EmojiNodeView = /*#__PURE__*/function () {
|
|
|
265
265
|
var emojiElement = 'unicodeEmoji' in representation ? this.createUnicodeEmojiElement(representation.unicodeEmoji) : 'sprite' in representation ? this.createSpriteEmojiElement(representation) : this.createImageEmojiElement(description, representation);
|
|
266
266
|
containerElement.appendChild(emojiElement);
|
|
267
267
|
this.dom.appendChild(containerElement);
|
|
268
|
+
if (EmojiNodeView.shouldRecordUnicodeEmojiExposure(description, representation)) {
|
|
269
|
+
expValEquals('platform_use_unicode_emojis', 'isEnabled', true);
|
|
270
|
+
}
|
|
268
271
|
}
|
|
269
272
|
}, {
|
|
270
273
|
key: "createUnicodeEmojiElement",
|
|
@@ -356,5 +359,10 @@ export var EmojiNodeView = /*#__PURE__*/function () {
|
|
|
356
359
|
value: function isEmojiRepresentationSupported(representation) {
|
|
357
360
|
return !!representation && ('sprite' in representation || 'imagePath' in representation || 'mediaPath' in representation || 'unicodeEmoji' in representation);
|
|
358
361
|
}
|
|
362
|
+
}, {
|
|
363
|
+
key: "shouldRecordUnicodeEmojiExposure",
|
|
364
|
+
value: function shouldRecordUnicodeEmojiExposure(description, representation) {
|
|
365
|
+
return description.type === 'STANDARD' || 'unicodeEmoji' in representation;
|
|
366
|
+
}
|
|
359
367
|
}]);
|
|
360
368
|
}();
|
|
@@ -14,7 +14,7 @@ import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
|
14
14
|
import { defaultEmojiHeight } from '@atlaskit/emoji';
|
|
15
15
|
import { emojiIdToEmoji } from '@atlaskit/emoji/emoji-id-to-emoji';
|
|
16
16
|
import { NodeDataProvider } from '@atlaskit/node-data-provider';
|
|
17
|
-
import {
|
|
17
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
18
18
|
export var EmojiNodeDataProvider = /*#__PURE__*/function (_NodeDataProvider) {
|
|
19
19
|
function EmojiNodeDataProvider(resource) {
|
|
20
20
|
var _this;
|
|
@@ -91,7 +91,7 @@ export var EmojiNodeDataProvider = /*#__PURE__*/function (_NodeDataProvider) {
|
|
|
91
91
|
break;
|
|
92
92
|
}
|
|
93
93
|
return _context2.abrupt("return", nodes.map(function (node) {
|
|
94
|
-
if (
|
|
94
|
+
if (expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true)) {
|
|
95
95
|
// Skip SSR for nodes without an Id
|
|
96
96
|
if (!node.attrs.id) {
|
|
97
97
|
return undefined;
|
|
@@ -153,7 +153,7 @@ export var EmojiNodeDataProvider = /*#__PURE__*/function (_NodeDataProvider) {
|
|
|
153
153
|
return emojiProvider.fetchByEmojiId(emojiId, true);
|
|
154
154
|
case 1:
|
|
155
155
|
result = _context.sent;
|
|
156
|
-
if (!(node.attrs.id && result &&
|
|
156
|
+
if (!(node.attrs.id && result && expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true))) {
|
|
157
157
|
_context.next = 2;
|
|
158
158
|
break;
|
|
159
159
|
}
|
|
@@ -47,6 +47,7 @@ export declare class EmojiNodeView implements NodeView {
|
|
|
47
47
|
private isHTMLElement;
|
|
48
48
|
private updateDom;
|
|
49
49
|
private static isEmojiRepresentationSupported;
|
|
50
|
+
private static shouldRecordUnicodeEmojiExposure;
|
|
50
51
|
private cleanUpAndRenderCommonAttributes;
|
|
51
52
|
private renderFallback;
|
|
52
53
|
private renderEmoji;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-emoji",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.8",
|
|
4
4
|
"description": "Emoji plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"@atlaskit/editor-plugin-type-ahead": "^12.0.0",
|
|
33
33
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
34
34
|
"@atlaskit/editor-shared-styles": "^4.0.0",
|
|
35
|
-
"@atlaskit/emoji": "^71.
|
|
35
|
+
"@atlaskit/emoji": "^71.4.0",
|
|
36
36
|
"@atlaskit/icon": "^36.0.0",
|
|
37
37
|
"@atlaskit/node-data-provider": "^13.0.0",
|
|
38
38
|
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
39
39
|
"@atlaskit/prosemirror-input-rules": "^4.0.0",
|
|
40
|
-
"@atlaskit/tmp-editor-statsig": "^109.
|
|
40
|
+
"@atlaskit/tmp-editor-statsig": "^109.2.0",
|
|
41
41
|
"@atlaskit/tokens": "^14.0.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0",
|
|
43
43
|
"@emotion/react": "^11.7.1",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"react-loadable": "^5.1.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@atlaskit/editor-common": "^116.
|
|
48
|
+
"@atlaskit/editor-common": "^116.9.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"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@testing-library/react": "^16.3.0",
|
|
55
55
|
"react": "^18.2.0",
|
|
56
56
|
"react-dom": "^18.2.0",
|
|
57
|
-
"react-intl": "^
|
|
57
|
+
"react-intl": "^7.0.0",
|
|
58
58
|
"wait-for-expect": "^1.2.0"
|
|
59
59
|
},
|
|
60
60
|
"techstack": {
|
|
@@ -100,9 +100,6 @@
|
|
|
100
100
|
"platform_editor_adf_with_localid": {
|
|
101
101
|
"type": "boolean"
|
|
102
102
|
},
|
|
103
|
-
"platform_twemoji_removal_unicode_emojis": {
|
|
104
|
-
"type": "boolean"
|
|
105
|
-
},
|
|
106
103
|
"platform_editor_custom_emoji_unicode_fallback": {
|
|
107
104
|
"type": "boolean"
|
|
108
105
|
}
|