@atlaskit/emoji 70.12.0 → 70.13.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 +8 -0
- package/dist/cjs/api/EmojiUtils.js +8 -1
- package/dist/cjs/util/analytics/analytics.js +1 -1
- package/dist/es2019/api/EmojiUtils.js +8 -1
- package/dist/es2019/util/analytics/analytics.js +1 -1
- package/dist/esm/api/EmojiUtils.js +8 -1
- package/dist/esm/util/analytics/analytics.js +1 -1
- package/dist/types/api/EmojiUtils.d.ts +1 -1
- package/dist/types-ts4.5/api/EmojiUtils.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/emoji
|
|
2
2
|
|
|
3
|
+
## 70.13.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`81637ec91afd1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/81637ec91afd1) -
|
|
8
|
+
Represent standard emojis as native Unicode characters instead of images. Updates
|
|
9
|
+
EmojiNodeDataProvider to support Unicode representations.
|
|
10
|
+
|
|
3
11
|
## 70.12.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -9,8 +9,11 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _utilServiceSupport = require("@atlaskit/util-service-support");
|
|
11
11
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
12
|
+
var _types = require("../types");
|
|
12
13
|
var _typeHelpers = require("../util/type-helpers");
|
|
13
14
|
var _logger = _interopRequireDefault(require("../util/logger"));
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
|
+
var _emojiIdToEmoji = require("../util/emojiIdToEmoji");
|
|
14
17
|
var _excluded = ["getRatio"],
|
|
15
18
|
_excluded2 = ["queryParams"],
|
|
16
19
|
_excluded3 = ["representation", "altRepresentations"],
|
|
@@ -138,7 +141,11 @@ var denormaliseSkinEmoji = exports.denormaliseSkinEmoji = function denormaliseSk
|
|
|
138
141
|
*/
|
|
139
142
|
var denormaliseEmojiServiceResponse = exports.denormaliseEmojiServiceResponse = function denormaliseEmojiServiceResponse(emojiData) {
|
|
140
143
|
var emojis = emojiData.emojis.map(function (emoji) {
|
|
141
|
-
var
|
|
144
|
+
var unicodeEmoji = (0, _emojiIdToEmoji.emojiIdToEmoji)(emoji.id);
|
|
145
|
+
var useUnicodeRepresentation = !!(emoji.id && emoji.type === _types.ProviderTypes.STANDARD && unicodeEmoji && (0, _platformFeatureFlags.fg)('platform_twemoji_removal_unicode_emojis'));
|
|
146
|
+
var newRepresentation = useUnicodeRepresentation ? {
|
|
147
|
+
unicodeEmoji: unicodeEmoji
|
|
148
|
+
} : denormaliseServiceRepresentation(emoji.representation, emojiData.meta);
|
|
142
149
|
var altRepresentation = denormaliseServiceAltRepresentation(emoji.altRepresentations, emojiData.meta);
|
|
143
150
|
var newSkinVariations = denormaliseSkinEmoji(emoji, emojiData.meta);
|
|
144
151
|
|
|
@@ -20,7 +20,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
20
20
|
actionSubjectId: actionSubjectId,
|
|
21
21
|
attributes: _objectSpread({
|
|
22
22
|
packageName: "@atlaskit/emoji",
|
|
23
|
-
packageVersion: "70.
|
|
23
|
+
packageVersion: "70.12.0"
|
|
24
24
|
}, attributes)
|
|
25
25
|
};
|
|
26
26
|
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { utils as serviceUtils } from '@atlaskit/util-service-support';
|
|
2
2
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
|
+
import { ProviderTypes } from '../types';
|
|
3
4
|
import { isImageRepresentation, isSpriteServiceRepresentation, convertImageToMediaRepresentation, buildEmojiDescriptionWithAltRepresentation } from '../util/type-helpers';
|
|
4
5
|
import debug from '../util/logger';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
import { emojiIdToEmoji } from '../util/emojiIdToEmoji';
|
|
5
8
|
export const emojiRequest = (provider, options) => {
|
|
6
9
|
const {
|
|
7
10
|
getRatio = getPixelRatio,
|
|
@@ -131,7 +134,11 @@ export const denormaliseSkinEmoji = (emoji, meta) => {
|
|
|
131
134
|
*/
|
|
132
135
|
export const denormaliseEmojiServiceResponse = emojiData => {
|
|
133
136
|
const emojis = emojiData.emojis.map(emoji => {
|
|
134
|
-
const
|
|
137
|
+
const unicodeEmoji = emojiIdToEmoji(emoji.id);
|
|
138
|
+
const useUnicodeRepresentation = !!(emoji.id && emoji.type === ProviderTypes.STANDARD && unicodeEmoji && fg('platform_twemoji_removal_unicode_emojis'));
|
|
139
|
+
const newRepresentation = useUnicodeRepresentation ? {
|
|
140
|
+
unicodeEmoji
|
|
141
|
+
} : denormaliseServiceRepresentation(emoji.representation, emojiData.meta);
|
|
135
142
|
const altRepresentation = denormaliseServiceAltRepresentation(emoji.altRepresentations, emojiData.meta);
|
|
136
143
|
const newSkinVariations = denormaliseSkinEmoji(emoji, emojiData.meta);
|
|
137
144
|
|
|
@@ -8,8 +8,11 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
8
8
|
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) { _defineProperty(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; }
|
|
9
9
|
import { utils as serviceUtils } from '@atlaskit/util-service-support';
|
|
10
10
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
|
+
import { ProviderTypes } from '../types';
|
|
11
12
|
import { isImageRepresentation, isSpriteServiceRepresentation, convertImageToMediaRepresentation, buildEmojiDescriptionWithAltRepresentation } from '../util/type-helpers';
|
|
12
13
|
import debug from '../util/logger';
|
|
14
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
|
+
import { emojiIdToEmoji } from '../util/emojiIdToEmoji';
|
|
13
16
|
export var emojiRequest = function emojiRequest(provider, options) {
|
|
14
17
|
var _provider$getRatio = provider.getRatio,
|
|
15
18
|
getRatio = _provider$getRatio === void 0 ? getPixelRatio : _provider$getRatio,
|
|
@@ -131,7 +134,11 @@ export var denormaliseSkinEmoji = function denormaliseSkinEmoji(emoji, meta) {
|
|
|
131
134
|
*/
|
|
132
135
|
export var denormaliseEmojiServiceResponse = function denormaliseEmojiServiceResponse(emojiData) {
|
|
133
136
|
var emojis = emojiData.emojis.map(function (emoji) {
|
|
134
|
-
var
|
|
137
|
+
var unicodeEmoji = emojiIdToEmoji(emoji.id);
|
|
138
|
+
var useUnicodeRepresentation = !!(emoji.id && emoji.type === ProviderTypes.STANDARD && unicodeEmoji && fg('platform_twemoji_removal_unicode_emojis'));
|
|
139
|
+
var newRepresentation = useUnicodeRepresentation ? {
|
|
140
|
+
unicodeEmoji: unicodeEmoji
|
|
141
|
+
} : denormaliseServiceRepresentation(emoji.representation, emojiData.meta);
|
|
135
142
|
var altRepresentation = denormaliseServiceAltRepresentation(emoji.altRepresentations, emojiData.meta);
|
|
136
143
|
var newSkinVariations = denormaliseSkinEmoji(emoji, emojiData.meta);
|
|
137
144
|
|
|
@@ -14,7 +14,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
14
14
|
actionSubjectId: actionSubjectId,
|
|
15
15
|
attributes: _objectSpread({
|
|
16
16
|
packageName: "@atlaskit/emoji",
|
|
17
|
-
packageVersion: "70.
|
|
17
|
+
packageVersion: "70.12.0"
|
|
18
18
|
}, attributes)
|
|
19
19
|
};
|
|
20
20
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RequestServiceOptions, type ServiceConfig } from '@atlaskit/util-service-support';
|
|
2
|
-
import type
|
|
2
|
+
import { type AltRepresentations, type EmojiDescription, type EmojiDescriptionWithVariations, type EmojiMeta, type EmojiRepresentation, type EmojiResponse, type EmojiServiceDescriptionWithVariations, type EmojiServiceRepresentation, type EmojiServiceResponse, type EmojiId } from '../types';
|
|
3
3
|
export interface EmojiLoaderConfig extends ServiceConfig {
|
|
4
4
|
getRatio?: () => number;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RequestServiceOptions, type ServiceConfig } from '@atlaskit/util-service-support';
|
|
2
|
-
import type
|
|
2
|
+
import { type AltRepresentations, type EmojiDescription, type EmojiDescriptionWithVariations, type EmojiMeta, type EmojiRepresentation, type EmojiResponse, type EmojiServiceDescriptionWithVariations, type EmojiServiceRepresentation, type EmojiServiceResponse, type EmojiId } from '../types';
|
|
3
3
|
export interface EmojiLoaderConfig extends ServiceConfig {
|
|
4
4
|
getRatio?: () => number;
|
|
5
5
|
}
|