@atlaskit/editor-plugin-emoji 7.7.0 → 7.7.2
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 +14 -0
- package/dist/cjs/emojiPlugin.js +1 -21
- package/dist/es2019/emojiPlugin.js +1 -25
- package/dist/esm/emojiPlugin.js +1 -21
- package/package.json +3 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-emoji
|
|
2
2
|
|
|
3
|
+
## 7.7.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`55920a92e882a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/55920a92e882a) -
|
|
8
|
+
tsignores added for help-center local consumpton removed
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 7.7.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 7.7.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/dist/cjs/emojiPlugin.js
CHANGED
|
@@ -126,8 +126,6 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
126
126
|
if (!emojiResult || !emojiResult.emojis) {
|
|
127
127
|
resolve([]);
|
|
128
128
|
} else {
|
|
129
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
130
|
-
|
|
131
129
|
var emojiItems = emojiResult.emojis.map(function (emoji) {
|
|
132
130
|
return memoizedToItem.call(emoji, emojiProvider);
|
|
133
131
|
});
|
|
@@ -137,9 +135,6 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
137
135
|
}
|
|
138
136
|
};
|
|
139
137
|
emojiProvider.subscribe(emojiProviderChangeHandler);
|
|
140
|
-
|
|
141
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
142
|
-
|
|
143
138
|
emojiProvider.filter(TRIGGER.concat(query), {
|
|
144
139
|
limit: defaultListLimit,
|
|
145
140
|
skinTone: emojiProvider.getSelectedTone(),
|
|
@@ -163,10 +158,7 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
163
158
|
emoji: _emoji
|
|
164
159
|
};
|
|
165
160
|
}
|
|
166
|
-
var matchedItem = isFullShortName(normalizedQuery) ?
|
|
167
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
168
|
-
|
|
169
|
-
items.find(function (item) {
|
|
161
|
+
var matchedItem = isFullShortName(normalizedQuery) ? items.find(function (item) {
|
|
170
162
|
return item.title.toLowerCase() === normalizedQuery;
|
|
171
163
|
}) : undefined;
|
|
172
164
|
return matchedItem;
|
|
@@ -206,8 +198,6 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
206
198
|
var emojiNodeType = schema.nodes.emoji;
|
|
207
199
|
if (node.type === emojiNodeType) {
|
|
208
200
|
var newText = node.attrs.text;
|
|
209
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
210
|
-
|
|
211
201
|
var currentPos = tr.mapping.map(pos);
|
|
212
202
|
tr.replaceWith(currentPos, currentPos + node.nodeSize, schema.text(newText, node.marks));
|
|
213
203
|
}
|
|
@@ -387,8 +377,6 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
387
377
|
items: function items(node) {
|
|
388
378
|
var _api$annotation2;
|
|
389
379
|
var annotationState = api === null || api === void 0 || (_api$annotation2 = api.annotation) === null || _api$annotation2 === void 0 ? void 0 : _api$annotation2.sharedState.currentState();
|
|
390
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
391
|
-
|
|
392
380
|
var activeCommentMark = node.marks.find(function (mark) {
|
|
393
381
|
return mark.type.name === 'annotation' && (annotationState === null || annotationState === void 0 ? void 0 : annotationState.annotations[mark.attrs.id]) === false;
|
|
394
382
|
});
|
|
@@ -491,7 +479,6 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
491
479
|
return new _safePlugin.SafePlugin({
|
|
492
480
|
key: emojiPluginKey,
|
|
493
481
|
state: {
|
|
494
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
495
482
|
init: function init() {
|
|
496
483
|
if (options !== null && options !== void 0 && options.emojiProvider && (0, _experiments.editorExperiment)('platform_editor_prevent_toolbar_layout_shifts', true)) {
|
|
497
484
|
return {
|
|
@@ -500,7 +487,6 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
500
487
|
}
|
|
501
488
|
return {};
|
|
502
489
|
},
|
|
503
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
504
490
|
apply: function apply(tr, pluginState) {
|
|
505
491
|
var _ref11 = tr.getMeta(emojiPluginKey) || {
|
|
506
492
|
action: null,
|
|
@@ -534,11 +520,7 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
534
520
|
}
|
|
535
521
|
},
|
|
536
522
|
props: {
|
|
537
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
538
|
-
|
|
539
523
|
nodeViews: {
|
|
540
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
541
|
-
|
|
542
524
|
emoji: function emoji(node) {
|
|
543
525
|
return new _EmojiNodeView.EmojiNodeView(node, {
|
|
544
526
|
intl: pmPluginFactoryParams.getIntl(),
|
|
@@ -548,7 +530,6 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
548
530
|
}
|
|
549
531
|
}
|
|
550
532
|
},
|
|
551
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
552
533
|
view: function view(editorView) {
|
|
553
534
|
var providerHandler = function providerHandler(name, providerPromise) {
|
|
554
535
|
switch (name) {
|
|
@@ -575,7 +556,6 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
575
556
|
providerHandler('emojiProvider', options.emojiProvider);
|
|
576
557
|
}
|
|
577
558
|
return {
|
|
578
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
579
559
|
destroy: function destroy() {
|
|
580
560
|
if (pmPluginFactoryParams.providerFactory) {
|
|
581
561
|
pmPluginFactoryParams.providerFactory.unsubscribe('emojiProvider', providerHandler);
|
|
@@ -105,8 +105,6 @@ export const emojiPlugin = ({
|
|
|
105
105
|
if (!emojiResult || !emojiResult.emojis) {
|
|
106
106
|
resolve([]);
|
|
107
107
|
} else {
|
|
108
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
109
|
-
|
|
110
108
|
const emojiItems = emojiResult.emojis.map(emoji => memoizedToItem.call(emoji, emojiProvider));
|
|
111
109
|
resolve(emojiItems);
|
|
112
110
|
}
|
|
@@ -114,9 +112,6 @@ export const emojiPlugin = ({
|
|
|
114
112
|
}
|
|
115
113
|
};
|
|
116
114
|
emojiProvider.subscribe(emojiProviderChangeHandler);
|
|
117
|
-
|
|
118
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
119
|
-
|
|
120
115
|
emojiProvider.filter(TRIGGER.concat(query), {
|
|
121
116
|
limit: defaultListLimit,
|
|
122
117
|
skinTone: emojiProvider.getSelectedTone(),
|
|
@@ -142,10 +137,7 @@ export const emojiPlugin = ({
|
|
|
142
137
|
emoji
|
|
143
138
|
};
|
|
144
139
|
}
|
|
145
|
-
const matchedItem = isFullShortName(normalizedQuery) ?
|
|
146
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
147
|
-
|
|
148
|
-
items.find(item => item.title.toLowerCase() === normalizedQuery) : undefined;
|
|
140
|
+
const matchedItem = isFullShortName(normalizedQuery) ? items.find(item => item.title.toLowerCase() === normalizedQuery) : undefined;
|
|
149
141
|
return matchedItem;
|
|
150
142
|
},
|
|
151
143
|
selectItem(state, item, insert, {
|
|
@@ -191,8 +183,6 @@ export const emojiPlugin = ({
|
|
|
191
183
|
} = schema.nodes;
|
|
192
184
|
if (node.type === emojiNodeType) {
|
|
193
185
|
const newText = node.attrs.text;
|
|
194
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
195
|
-
|
|
196
186
|
const currentPos = tr.mapping.map(pos);
|
|
197
187
|
tr.replaceWith(currentPos, currentPos + node.nodeSize, schema.text(newText, node.marks));
|
|
198
188
|
}
|
|
@@ -351,8 +341,6 @@ export const emojiPlugin = ({
|
|
|
351
341
|
items: node => {
|
|
352
342
|
var _api$annotation2;
|
|
353
343
|
const annotationState = api === null || api === void 0 ? void 0 : (_api$annotation2 = api.annotation) === null || _api$annotation2 === void 0 ? void 0 : _api$annotation2.sharedState.currentState();
|
|
354
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
355
|
-
|
|
356
344
|
const activeCommentMark = node.marks.find(mark => mark.type.name === 'annotation' && (annotationState === null || annotationState === void 0 ? void 0 : annotationState.annotations[mark.attrs.id]) === false);
|
|
357
345
|
const showAnnotation = annotationState && annotationState.isVisible && !annotationState.bookmark && !annotationState.mouseData.isSelecting && !activeCommentMark && isViewMode();
|
|
358
346
|
if (showAnnotation) {
|
|
@@ -445,8 +433,6 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
445
433
|
return new SafePlugin({
|
|
446
434
|
key: emojiPluginKey,
|
|
447
435
|
state: {
|
|
448
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
449
|
-
|
|
450
436
|
init() {
|
|
451
437
|
if (options !== null && options !== void 0 && options.emojiProvider && editorExperiment('platform_editor_prevent_toolbar_layout_shifts', true)) {
|
|
452
438
|
return {
|
|
@@ -455,8 +441,6 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
455
441
|
}
|
|
456
442
|
return {};
|
|
457
443
|
},
|
|
458
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
459
|
-
|
|
460
444
|
apply(tr, pluginState) {
|
|
461
445
|
const {
|
|
462
446
|
action,
|
|
@@ -494,11 +478,7 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
494
478
|
}
|
|
495
479
|
},
|
|
496
480
|
props: {
|
|
497
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
498
|
-
|
|
499
481
|
nodeViews: {
|
|
500
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
501
|
-
|
|
502
482
|
emoji: node => {
|
|
503
483
|
return new EmojiNodeView(node, {
|
|
504
484
|
intl: pmPluginFactoryParams.getIntl(),
|
|
@@ -508,8 +488,6 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
508
488
|
}
|
|
509
489
|
}
|
|
510
490
|
},
|
|
511
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
512
|
-
|
|
513
491
|
view(editorView) {
|
|
514
492
|
const providerHandler = (name, providerPromise) => {
|
|
515
493
|
switch (name) {
|
|
@@ -536,8 +514,6 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
536
514
|
providerHandler('emojiProvider', options.emojiProvider);
|
|
537
515
|
}
|
|
538
516
|
return {
|
|
539
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
540
|
-
|
|
541
517
|
destroy() {
|
|
542
518
|
if (pmPluginFactoryParams.providerFactory) {
|
|
543
519
|
pmPluginFactoryParams.providerFactory.unsubscribe('emojiProvider', providerHandler);
|
package/dist/esm/emojiPlugin.js
CHANGED
|
@@ -115,8 +115,6 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
115
115
|
if (!emojiResult || !emojiResult.emojis) {
|
|
116
116
|
resolve([]);
|
|
117
117
|
} else {
|
|
118
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
119
|
-
|
|
120
118
|
var emojiItems = emojiResult.emojis.map(function (emoji) {
|
|
121
119
|
return memoizedToItem.call(emoji, emojiProvider);
|
|
122
120
|
});
|
|
@@ -126,9 +124,6 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
126
124
|
}
|
|
127
125
|
};
|
|
128
126
|
emojiProvider.subscribe(emojiProviderChangeHandler);
|
|
129
|
-
|
|
130
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
131
|
-
|
|
132
127
|
emojiProvider.filter(TRIGGER.concat(query), {
|
|
133
128
|
limit: defaultListLimit,
|
|
134
129
|
skinTone: emojiProvider.getSelectedTone(),
|
|
@@ -152,10 +147,7 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
152
147
|
emoji: _emoji
|
|
153
148
|
};
|
|
154
149
|
}
|
|
155
|
-
var matchedItem = isFullShortName(normalizedQuery) ?
|
|
156
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
157
|
-
|
|
158
|
-
items.find(function (item) {
|
|
150
|
+
var matchedItem = isFullShortName(normalizedQuery) ? items.find(function (item) {
|
|
159
151
|
return item.title.toLowerCase() === normalizedQuery;
|
|
160
152
|
}) : undefined;
|
|
161
153
|
return matchedItem;
|
|
@@ -195,8 +187,6 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
195
187
|
var emojiNodeType = schema.nodes.emoji;
|
|
196
188
|
if (node.type === emojiNodeType) {
|
|
197
189
|
var newText = node.attrs.text;
|
|
198
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
199
|
-
|
|
200
190
|
var currentPos = tr.mapping.map(pos);
|
|
201
191
|
tr.replaceWith(currentPos, currentPos + node.nodeSize, schema.text(newText, node.marks));
|
|
202
192
|
}
|
|
@@ -376,8 +366,6 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
376
366
|
items: function items(node) {
|
|
377
367
|
var _api$annotation2;
|
|
378
368
|
var annotationState = api === null || api === void 0 || (_api$annotation2 = api.annotation) === null || _api$annotation2 === void 0 ? void 0 : _api$annotation2.sharedState.currentState();
|
|
379
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
380
|
-
|
|
381
369
|
var activeCommentMark = node.marks.find(function (mark) {
|
|
382
370
|
return mark.type.name === 'annotation' && (annotationState === null || annotationState === void 0 ? void 0 : annotationState.annotations[mark.attrs.id]) === false;
|
|
383
371
|
});
|
|
@@ -480,7 +468,6 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
480
468
|
return new SafePlugin({
|
|
481
469
|
key: emojiPluginKey,
|
|
482
470
|
state: {
|
|
483
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
484
471
|
init: function init() {
|
|
485
472
|
if (options !== null && options !== void 0 && options.emojiProvider && editorExperiment('platform_editor_prevent_toolbar_layout_shifts', true)) {
|
|
486
473
|
return {
|
|
@@ -489,7 +476,6 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
489
476
|
}
|
|
490
477
|
return {};
|
|
491
478
|
},
|
|
492
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
493
479
|
apply: function apply(tr, pluginState) {
|
|
494
480
|
var _ref11 = tr.getMeta(emojiPluginKey) || {
|
|
495
481
|
action: null,
|
|
@@ -523,11 +509,7 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
523
509
|
}
|
|
524
510
|
},
|
|
525
511
|
props: {
|
|
526
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
527
|
-
|
|
528
512
|
nodeViews: {
|
|
529
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
530
|
-
|
|
531
513
|
emoji: function emoji(node) {
|
|
532
514
|
return new EmojiNodeView(node, {
|
|
533
515
|
intl: pmPluginFactoryParams.getIntl(),
|
|
@@ -537,7 +519,6 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
537
519
|
}
|
|
538
520
|
}
|
|
539
521
|
},
|
|
540
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
541
522
|
view: function view(editorView) {
|
|
542
523
|
var providerHandler = function providerHandler(name, providerPromise) {
|
|
543
524
|
switch (name) {
|
|
@@ -564,7 +545,6 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
564
545
|
providerHandler('emojiProvider', options.emojiProvider);
|
|
565
546
|
}
|
|
566
547
|
return {
|
|
567
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
568
548
|
destroy: function destroy() {
|
|
569
549
|
if (pmPluginFactoryParams.providerFactory) {
|
|
570
550
|
pmPluginFactoryParams.providerFactory.unsubscribe('emojiProvider', providerHandler);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-emoji",
|
|
3
|
-
"version": "7.7.
|
|
3
|
+
"version": "7.7.2",
|
|
4
4
|
"description": "Emoji plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -35,8 +35,7 @@
|
|
|
35
35
|
"@atlaskit/node-data-provider": "^7.5.0",
|
|
36
36
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
37
37
|
"@atlaskit/prosemirror-input-rules": "^3.6.0",
|
|
38
|
-
"@atlaskit/
|
|
39
|
-
"@atlaskit/tmp-editor-statsig": "^13.44.0",
|
|
38
|
+
"@atlaskit/tmp-editor-statsig": "^14.2.0",
|
|
40
39
|
"@atlaskit/tokens": "^8.4.0",
|
|
41
40
|
"@babel/runtime": "^7.0.0",
|
|
42
41
|
"@emotion/react": "^11.7.1",
|
|
@@ -45,15 +44,11 @@
|
|
|
45
44
|
"react-loadable": "^5.1.0"
|
|
46
45
|
},
|
|
47
46
|
"peerDependencies": {
|
|
48
|
-
"@atlaskit/editor-common": "^110.
|
|
47
|
+
"@atlaskit/editor-common": "^110.36.0",
|
|
49
48
|
"react": "^18.2.0",
|
|
50
49
|
"react-dom": "^18.2.0"
|
|
51
50
|
},
|
|
52
51
|
"devDependencies": {
|
|
53
|
-
"@af/visual-regression": "workspace:^",
|
|
54
|
-
"@atlaskit/editor-plugin-composition": "^5.0.0",
|
|
55
|
-
"@atlaskit/editor-plugin-decorations": "^6.1.0",
|
|
56
|
-
"@atlaskit/ssr": "workspace:^",
|
|
57
52
|
"@testing-library/react": "^13.4.0",
|
|
58
53
|
"wait-for-expect": "^1.2.0"
|
|
59
54
|
},
|