@atlaskit/editor-plugin-emoji 7.4.1 → 7.5.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 +21 -0
- package/dist/cjs/emojiPlugin.js +1 -2
- package/dist/cjs/nodeviews/EmojiNodeView.js +18 -8
- package/dist/cjs/pm-plugins/providers/EmojiNodeDataProvider.js +31 -0
- package/dist/es2019/emojiPlugin.js +1 -2
- package/dist/es2019/nodeviews/EmojiNodeView.js +18 -8
- package/dist/es2019/pm-plugins/providers/EmojiNodeDataProvider.js +27 -1
- package/dist/esm/emojiPlugin.js +1 -2
- package/dist/esm/nodeviews/EmojiNodeView.js +18 -8
- package/dist/esm/pm-plugins/providers/EmojiNodeDataProvider.js +32 -1
- package/dist/types/pm-plugins/providers/EmojiNodeDataProvider.d.ts +22 -0
- package/dist/types-ts4.5/pm-plugins/providers/EmojiNodeDataProvider.d.ts +22 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-emoji
|
|
2
2
|
|
|
3
|
+
## 7.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`5319dac3f8740`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5319dac3f8740) -
|
|
8
|
+
Do not re-fetch emoji on a client after successful ssr
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 7.4.2
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`21fe79119fe74`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/21fe79119fe74) -
|
|
19
|
+
EDITOR-2447 Bump adf-schema to 51.3.2
|
|
20
|
+
- [`f42616e52392b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f42616e52392b) -
|
|
21
|
+
[ux] EDITOR-2506 Disable emoji inserting when matched with ascii map
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 7.4.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/dist/cjs/emojiPlugin.js
CHANGED
|
@@ -151,10 +151,9 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
151
151
|
var _ref5 = emojiPluginKey.getState(editorState) || {},
|
|
152
152
|
asciiMap = _ref5.asciiMap;
|
|
153
153
|
var normalizedQuery = TRIGGER.concat(query);
|
|
154
|
-
|
|
155
154
|
// if the query has space at the end
|
|
156
155
|
// check the ascii map for emojis
|
|
157
|
-
if (asciiMap && normalizedQuery.length >= 3 && normalizedQuery.endsWith(' ') && asciiMap.has(normalizedQuery.trim())) {
|
|
156
|
+
if (!(options !== null && options !== void 0 && options.disableAutoformat && (0, _expValEquals.expValEquals)('platform_editor_plain_text_support', 'isEnabled', true)) && asciiMap && normalizedQuery.length >= 3 && normalizedQuery.endsWith(' ') && asciiMap.has(normalizedQuery.trim())) {
|
|
158
157
|
var _emoji = asciiMap.get(normalizedQuery.trim());
|
|
159
158
|
return {
|
|
160
159
|
title: (_emoji === null || _emoji === void 0 ? void 0 : _emoji.name) || '',
|
|
@@ -278,23 +278,33 @@ var EmojiNodeView = exports.EmojiNodeView = /*#__PURE__*/function () {
|
|
|
278
278
|
imageElement.src = 'imagePath' in representation ? representation.imagePath : representation.mediaPath;
|
|
279
279
|
imageElement.loading = 'lazy';
|
|
280
280
|
imageElement.alt = emojiDescription.name || emojiDescription.shortName;
|
|
281
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_emoji_otp', 'isEnabled', true)) {
|
|
282
|
+
imageElement.style.minWidth = "".concat(_emoji.defaultEmojiHeight, "px");
|
|
283
|
+
imageElement.style.objectFit = 'contain';
|
|
284
|
+
}
|
|
281
285
|
if (representation.width && representation.height) {
|
|
282
286
|
imageElement.height = _emoji.defaultEmojiHeight;
|
|
283
|
-
|
|
284
|
-
|
|
287
|
+
if (!(0, _expValEquals.expValEquals)('platform_editor_emoji_otp', 'isEnabled', true)) {
|
|
288
|
+
// Because img.width is round to the nearest integer.
|
|
289
|
+
imageElement.setAttribute('width', "".concat(_emoji.defaultEmojiHeight / representation.height * representation.width));
|
|
290
|
+
}
|
|
285
291
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
292
|
+
imageElement.onerror = function () {
|
|
293
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_emoji_otp', 'isEnabled', true)) {
|
|
294
|
+
_this2.renderFallback();
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
if ((0, _experiments.editorExperiment)('platform_editor_offline_editing_web', true)) {
|
|
298
|
+
// If there's an error (ie. offline) render the ascii fallback if possible, otherwise
|
|
299
|
+
// mark the node to refresh when returning online.
|
|
290
300
|
// Create a check that confirms if this.node.attrs.text if an ascii emoji
|
|
291
301
|
if (isSingleEmoji(_this2.node.attrs.text)) {
|
|
292
302
|
_this2.renderFallback();
|
|
293
303
|
} else {
|
|
294
304
|
_this2.renderingFallback = true;
|
|
295
305
|
}
|
|
296
|
-
}
|
|
297
|
-
}
|
|
306
|
+
}
|
|
307
|
+
};
|
|
298
308
|
return imageElement;
|
|
299
309
|
}
|
|
300
310
|
}], [{
|
|
@@ -42,6 +42,37 @@ var EmojiNodeDataProvider = exports.EmojiNodeDataProvider = /*#__PURE__*/functio
|
|
|
42
42
|
var _node$attrs$id;
|
|
43
43
|
return (_node$attrs$id = node.attrs.id) !== null && _node$attrs$id !== void 0 ? _node$attrs$id : node.attrs.shortName;
|
|
44
44
|
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Implementing different re-fetching strategy for emoji.
|
|
48
|
+
*
|
|
49
|
+
* Default strategy for NodeDataProvider is to:
|
|
50
|
+
* 1. If entry is in cache = return from cache
|
|
51
|
+
* 2. Re-fetch data.
|
|
52
|
+
* 3. Update cache
|
|
53
|
+
* 4. Re-render node with fresh data.
|
|
54
|
+
*
|
|
55
|
+
* This is similar, but doesn't update the node.
|
|
56
|
+
* 1. If entry is in cache = return from cache
|
|
57
|
+
* 2. Re-fetch data.
|
|
58
|
+
* 3. Update cache
|
|
59
|
+
*/
|
|
60
|
+
}, {
|
|
61
|
+
key: "getData",
|
|
62
|
+
value: function getData(node, callback) {
|
|
63
|
+
var _this2 = this;
|
|
64
|
+
var cached = this.getNodeDataFromCache(node);
|
|
65
|
+
if (cached && cached.data && !(0, _nodeDataProvider.isPromise)(cached.data)) {
|
|
66
|
+
callback(cached);
|
|
67
|
+
if (!(0, _coreUtils.isSSR)() && typeof requestAnimationFrame !== 'undefined') {
|
|
68
|
+
requestAnimationFrame(function () {
|
|
69
|
+
return void _this2.getDataAsync(node, function () {});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
void this.getDataAsync(node, callback);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
45
76
|
}, {
|
|
46
77
|
key: "fetchNodesData",
|
|
47
78
|
value: function () {
|
|
@@ -130,10 +130,9 @@ export const emojiPlugin = ({
|
|
|
130
130
|
asciiMap
|
|
131
131
|
} = emojiPluginKey.getState(editorState) || {};
|
|
132
132
|
const normalizedQuery = TRIGGER.concat(query);
|
|
133
|
-
|
|
134
133
|
// if the query has space at the end
|
|
135
134
|
// check the ascii map for emojis
|
|
136
|
-
if (asciiMap && normalizedQuery.length >= 3 && normalizedQuery.endsWith(' ') && asciiMap.has(normalizedQuery.trim())) {
|
|
135
|
+
if (!(options !== null && options !== void 0 && options.disableAutoformat && expValEquals('platform_editor_plain_text_support', 'isEnabled', true)) && asciiMap && normalizedQuery.length >= 3 && normalizedQuery.endsWith(' ') && asciiMap.has(normalizedQuery.trim())) {
|
|
137
136
|
const emoji = asciiMap.get(normalizedQuery.trim());
|
|
138
137
|
return {
|
|
139
138
|
title: (emoji === null || emoji === void 0 ? void 0 : emoji.name) || '',
|
|
@@ -239,23 +239,33 @@ export class EmojiNodeView {
|
|
|
239
239
|
imageElement.src = 'imagePath' in representation ? representation.imagePath : representation.mediaPath;
|
|
240
240
|
imageElement.loading = 'lazy';
|
|
241
241
|
imageElement.alt = emojiDescription.name || emojiDescription.shortName;
|
|
242
|
+
if (expValEquals('platform_editor_emoji_otp', 'isEnabled', true)) {
|
|
243
|
+
imageElement.style.minWidth = `${defaultEmojiHeight}px`;
|
|
244
|
+
imageElement.style.objectFit = 'contain';
|
|
245
|
+
}
|
|
242
246
|
if (representation.width && representation.height) {
|
|
243
247
|
imageElement.height = defaultEmojiHeight;
|
|
244
|
-
|
|
245
|
-
|
|
248
|
+
if (!expValEquals('platform_editor_emoji_otp', 'isEnabled', true)) {
|
|
249
|
+
// Because img.width is round to the nearest integer.
|
|
250
|
+
imageElement.setAttribute('width', `${defaultEmojiHeight / representation.height * representation.width}`);
|
|
251
|
+
}
|
|
246
252
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
253
|
+
imageElement.onerror = () => {
|
|
254
|
+
if (expValEquals('platform_editor_emoji_otp', 'isEnabled', true)) {
|
|
255
|
+
this.renderFallback();
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
if (editorExperiment('platform_editor_offline_editing_web', true)) {
|
|
259
|
+
// If there's an error (ie. offline) render the ascii fallback if possible, otherwise
|
|
260
|
+
// mark the node to refresh when returning online.
|
|
251
261
|
// Create a check that confirms if this.node.attrs.text if an ascii emoji
|
|
252
262
|
if (isSingleEmoji(this.node.attrs.text)) {
|
|
253
263
|
this.renderFallback();
|
|
254
264
|
} else {
|
|
255
265
|
this.renderingFallback = true;
|
|
256
266
|
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
267
|
+
}
|
|
268
|
+
};
|
|
259
269
|
return imageElement;
|
|
260
270
|
}
|
|
261
271
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
3
3
|
import { defaultEmojiHeight } from '@atlaskit/emoji';
|
|
4
|
-
import { NodeDataProvider } from '@atlaskit/node-data-provider';
|
|
4
|
+
import { NodeDataProvider, isPromise } from '@atlaskit/node-data-provider';
|
|
5
5
|
export class EmojiNodeDataProvider extends NodeDataProvider {
|
|
6
6
|
constructor(resource) {
|
|
7
7
|
super();
|
|
@@ -16,6 +16,32 @@ export class EmojiNodeDataProvider extends NodeDataProvider {
|
|
|
16
16
|
var _node$attrs$id;
|
|
17
17
|
return (_node$attrs$id = node.attrs.id) !== null && _node$attrs$id !== void 0 ? _node$attrs$id : node.attrs.shortName;
|
|
18
18
|
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Implementing different re-fetching strategy for emoji.
|
|
22
|
+
*
|
|
23
|
+
* Default strategy for NodeDataProvider is to:
|
|
24
|
+
* 1. If entry is in cache = return from cache
|
|
25
|
+
* 2. Re-fetch data.
|
|
26
|
+
* 3. Update cache
|
|
27
|
+
* 4. Re-render node with fresh data.
|
|
28
|
+
*
|
|
29
|
+
* This is similar, but doesn't update the node.
|
|
30
|
+
* 1. If entry is in cache = return from cache
|
|
31
|
+
* 2. Re-fetch data.
|
|
32
|
+
* 3. Update cache
|
|
33
|
+
*/
|
|
34
|
+
getData(node, callback) {
|
|
35
|
+
const cached = this.getNodeDataFromCache(node);
|
|
36
|
+
if (cached && cached.data && !isPromise(cached.data)) {
|
|
37
|
+
callback(cached);
|
|
38
|
+
if (!isSSR() && typeof requestAnimationFrame !== 'undefined') {
|
|
39
|
+
requestAnimationFrame(() => void this.getDataAsync(node, () => {}));
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
void this.getDataAsync(node, callback);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
19
45
|
async fetchNodesData(nodes) {
|
|
20
46
|
var _this$emojiResource$e;
|
|
21
47
|
// If we have an `optimisticImageApi`, use it to generate a URL immediately.
|
package/dist/esm/emojiPlugin.js
CHANGED
|
@@ -140,10 +140,9 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
140
140
|
var _ref5 = emojiPluginKey.getState(editorState) || {},
|
|
141
141
|
asciiMap = _ref5.asciiMap;
|
|
142
142
|
var normalizedQuery = TRIGGER.concat(query);
|
|
143
|
-
|
|
144
143
|
// if the query has space at the end
|
|
145
144
|
// check the ascii map for emojis
|
|
146
|
-
if (asciiMap && normalizedQuery.length >= 3 && normalizedQuery.endsWith(' ') && asciiMap.has(normalizedQuery.trim())) {
|
|
145
|
+
if (!(options !== null && options !== void 0 && options.disableAutoformat && expValEquals('platform_editor_plain_text_support', 'isEnabled', true)) && asciiMap && normalizedQuery.length >= 3 && normalizedQuery.endsWith(' ') && asciiMap.has(normalizedQuery.trim())) {
|
|
147
146
|
var _emoji = asciiMap.get(normalizedQuery.trim());
|
|
148
147
|
return {
|
|
149
148
|
title: (_emoji === null || _emoji === void 0 ? void 0 : _emoji.name) || '',
|
|
@@ -270,23 +270,33 @@ export var EmojiNodeView = /*#__PURE__*/function () {
|
|
|
270
270
|
imageElement.src = 'imagePath' in representation ? representation.imagePath : representation.mediaPath;
|
|
271
271
|
imageElement.loading = 'lazy';
|
|
272
272
|
imageElement.alt = emojiDescription.name || emojiDescription.shortName;
|
|
273
|
+
if (expValEquals('platform_editor_emoji_otp', 'isEnabled', true)) {
|
|
274
|
+
imageElement.style.minWidth = "".concat(defaultEmojiHeight, "px");
|
|
275
|
+
imageElement.style.objectFit = 'contain';
|
|
276
|
+
}
|
|
273
277
|
if (representation.width && representation.height) {
|
|
274
278
|
imageElement.height = defaultEmojiHeight;
|
|
275
|
-
|
|
276
|
-
|
|
279
|
+
if (!expValEquals('platform_editor_emoji_otp', 'isEnabled', true)) {
|
|
280
|
+
// Because img.width is round to the nearest integer.
|
|
281
|
+
imageElement.setAttribute('width', "".concat(defaultEmojiHeight / representation.height * representation.width));
|
|
282
|
+
}
|
|
277
283
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
284
|
+
imageElement.onerror = function () {
|
|
285
|
+
if (expValEquals('platform_editor_emoji_otp', 'isEnabled', true)) {
|
|
286
|
+
_this2.renderFallback();
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
if (editorExperiment('platform_editor_offline_editing_web', true)) {
|
|
290
|
+
// If there's an error (ie. offline) render the ascii fallback if possible, otherwise
|
|
291
|
+
// mark the node to refresh when returning online.
|
|
282
292
|
// Create a check that confirms if this.node.attrs.text if an ascii emoji
|
|
283
293
|
if (isSingleEmoji(_this2.node.attrs.text)) {
|
|
284
294
|
_this2.renderFallback();
|
|
285
295
|
} else {
|
|
286
296
|
_this2.renderingFallback = true;
|
|
287
297
|
}
|
|
288
|
-
}
|
|
289
|
-
}
|
|
298
|
+
}
|
|
299
|
+
};
|
|
290
300
|
return imageElement;
|
|
291
301
|
}
|
|
292
302
|
}], [{
|
|
@@ -12,7 +12,7 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
|
|
|
12
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
13
|
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
14
14
|
import { defaultEmojiHeight } from '@atlaskit/emoji';
|
|
15
|
-
import { NodeDataProvider } from '@atlaskit/node-data-provider';
|
|
15
|
+
import { NodeDataProvider, isPromise } from '@atlaskit/node-data-provider';
|
|
16
16
|
export var EmojiNodeDataProvider = /*#__PURE__*/function (_NodeDataProvider) {
|
|
17
17
|
function EmojiNodeDataProvider(resource) {
|
|
18
18
|
var _this;
|
|
@@ -35,6 +35,37 @@ export var EmojiNodeDataProvider = /*#__PURE__*/function (_NodeDataProvider) {
|
|
|
35
35
|
var _node$attrs$id;
|
|
36
36
|
return (_node$attrs$id = node.attrs.id) !== null && _node$attrs$id !== void 0 ? _node$attrs$id : node.attrs.shortName;
|
|
37
37
|
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Implementing different re-fetching strategy for emoji.
|
|
41
|
+
*
|
|
42
|
+
* Default strategy for NodeDataProvider is to:
|
|
43
|
+
* 1. If entry is in cache = return from cache
|
|
44
|
+
* 2. Re-fetch data.
|
|
45
|
+
* 3. Update cache
|
|
46
|
+
* 4. Re-render node with fresh data.
|
|
47
|
+
*
|
|
48
|
+
* This is similar, but doesn't update the node.
|
|
49
|
+
* 1. If entry is in cache = return from cache
|
|
50
|
+
* 2. Re-fetch data.
|
|
51
|
+
* 3. Update cache
|
|
52
|
+
*/
|
|
53
|
+
}, {
|
|
54
|
+
key: "getData",
|
|
55
|
+
value: function getData(node, callback) {
|
|
56
|
+
var _this2 = this;
|
|
57
|
+
var cached = this.getNodeDataFromCache(node);
|
|
58
|
+
if (cached && cached.data && !isPromise(cached.data)) {
|
|
59
|
+
callback(cached);
|
|
60
|
+
if (!isSSR() && typeof requestAnimationFrame !== 'undefined') {
|
|
61
|
+
requestAnimationFrame(function () {
|
|
62
|
+
return void _this2.getDataAsync(node, function () {});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
} else {
|
|
66
|
+
void this.getDataAsync(node, callback);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
38
69
|
}, {
|
|
39
70
|
key: "fetchNodesData",
|
|
40
71
|
value: function () {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { EmojiDefinition } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { JSONNode } from '@atlaskit/editor-json-transformer';
|
|
3
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
4
|
import { type EmojiResource, type OptionalEmojiDescriptionWithVariations } from '@atlaskit/emoji';
|
|
4
5
|
import { NodeDataProvider } from '@atlaskit/node-data-provider';
|
|
5
6
|
export declare class EmojiNodeDataProvider extends NodeDataProvider<EmojiDefinition, OptionalEmojiDescriptionWithVariations> {
|
|
@@ -9,5 +10,26 @@ export declare class EmojiNodeDataProvider extends NodeDataProvider<EmojiDefinit
|
|
|
9
10
|
constructor(resource: EmojiResource);
|
|
10
11
|
isNodeSupported(node: JSONNode): node is EmojiDefinition;
|
|
11
12
|
nodeDataKey(node: EmojiDefinition): string;
|
|
13
|
+
/**
|
|
14
|
+
* Implementing different re-fetching strategy for emoji.
|
|
15
|
+
*
|
|
16
|
+
* Default strategy for NodeDataProvider is to:
|
|
17
|
+
* 1. If entry is in cache = return from cache
|
|
18
|
+
* 2. Re-fetch data.
|
|
19
|
+
* 3. Update cache
|
|
20
|
+
* 4. Re-render node with fresh data.
|
|
21
|
+
*
|
|
22
|
+
* This is similar, but doesn't update the node.
|
|
23
|
+
* 1. If entry is in cache = return from cache
|
|
24
|
+
* 2. Re-fetch data.
|
|
25
|
+
* 3. Update cache
|
|
26
|
+
*/
|
|
27
|
+
getData(node: EmojiDefinition | PMNode, callback: (payload: {
|
|
28
|
+
data: OptionalEmojiDescriptionWithVariations;
|
|
29
|
+
error?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
data?: undefined;
|
|
32
|
+
error: Error;
|
|
33
|
+
}) => void): void;
|
|
12
34
|
fetchNodesData(nodes: EmojiDefinition[]): Promise<OptionalEmojiDescriptionWithVariations[]>;
|
|
13
35
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { EmojiDefinition } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { JSONNode } from '@atlaskit/editor-json-transformer';
|
|
3
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
4
|
import { type EmojiResource, type OptionalEmojiDescriptionWithVariations } from '@atlaskit/emoji';
|
|
4
5
|
import { NodeDataProvider } from '@atlaskit/node-data-provider';
|
|
5
6
|
export declare class EmojiNodeDataProvider extends NodeDataProvider<EmojiDefinition, OptionalEmojiDescriptionWithVariations> {
|
|
@@ -9,5 +10,26 @@ export declare class EmojiNodeDataProvider extends NodeDataProvider<EmojiDefinit
|
|
|
9
10
|
constructor(resource: EmojiResource);
|
|
10
11
|
isNodeSupported(node: JSONNode): node is EmojiDefinition;
|
|
11
12
|
nodeDataKey(node: EmojiDefinition): string;
|
|
13
|
+
/**
|
|
14
|
+
* Implementing different re-fetching strategy for emoji.
|
|
15
|
+
*
|
|
16
|
+
* Default strategy for NodeDataProvider is to:
|
|
17
|
+
* 1. If entry is in cache = return from cache
|
|
18
|
+
* 2. Re-fetch data.
|
|
19
|
+
* 3. Update cache
|
|
20
|
+
* 4. Re-render node with fresh data.
|
|
21
|
+
*
|
|
22
|
+
* This is similar, but doesn't update the node.
|
|
23
|
+
* 1. If entry is in cache = return from cache
|
|
24
|
+
* 2. Re-fetch data.
|
|
25
|
+
* 3. Update cache
|
|
26
|
+
*/
|
|
27
|
+
getData(node: EmojiDefinition | PMNode, callback: (payload: {
|
|
28
|
+
data: OptionalEmojiDescriptionWithVariations;
|
|
29
|
+
error?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
data?: undefined;
|
|
32
|
+
error: Error;
|
|
33
|
+
}) => void): void;
|
|
12
34
|
fetchNodesData(nodes: EmojiDefinition[]): Promise<OptionalEmojiDescriptionWithVariations[]>;
|
|
13
35
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-emoji",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.0",
|
|
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": "^51.3.
|
|
24
|
+
"@atlaskit/adf-schema": "^51.3.2",
|
|
25
25
|
"@atlaskit/editor-plugin-analytics": "^6.2.0",
|
|
26
26
|
"@atlaskit/editor-plugin-annotation": "^6.2.0",
|
|
27
27
|
"@atlaskit/editor-plugin-base": "^7.2.0",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"@atlaskit/editor-shared-styles": "^3.8.0",
|
|
33
33
|
"@atlaskit/emoji": "^69.6.0",
|
|
34
34
|
"@atlaskit/icon": "^28.5.0",
|
|
35
|
-
"@atlaskit/node-data-provider": "^7.
|
|
35
|
+
"@atlaskit/node-data-provider": "^7.3.0",
|
|
36
36
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
37
37
|
"@atlaskit/prosemirror-input-rules": "^3.5.0",
|
|
38
38
|
"@atlaskit/theme": "^21.0.0",
|
|
39
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
39
|
+
"@atlaskit/tmp-editor-statsig": "^13.19.0",
|
|
40
40
|
"@atlaskit/tokens": "^7.0.0",
|
|
41
41
|
"@babel/runtime": "^7.0.0",
|
|
42
42
|
"@emotion/react": "^11.7.1",
|