@atlaskit/editor-plugin-emoji 9.0.27 → 9.0.28
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/emojiPlugin.js +2 -3
- package/dist/cjs/pm-plugins/ascii-input-rules.js +1 -2
- package/dist/es2019/emojiPlugin.js +2 -3
- package/dist/es2019/pm-plugins/ascii-input-rules.js +1 -2
- package/dist/esm/emojiPlugin.js +2 -3
- package/dist/esm/pm-plugins/ascii-input-rules.js +1 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-emoji
|
|
2
2
|
|
|
3
|
+
## 9.0.28
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`48a64b7bbac82`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/48a64b7bbac82) -
|
|
8
|
+
Clean up stale experiment platform_editor_plain_text_support (always-enabled path)
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 9.0.27
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/cjs/emojiPlugin.js
CHANGED
|
@@ -22,7 +22,6 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
22
22
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
23
23
|
var _emoji2 = require("@atlaskit/emoji");
|
|
24
24
|
var _comment = _interopRequireDefault(require("@atlaskit/icon/core/comment"));
|
|
25
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
26
25
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
27
26
|
var _insertEmoji = require("./editor-commands/insert-emoji");
|
|
28
27
|
var _emojiNodeSpec = require("./nodeviews/emojiNodeSpec");
|
|
@@ -151,7 +150,7 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
151
150
|
var normalizedQuery = TRIGGER.concat(query);
|
|
152
151
|
// if the query has space at the end
|
|
153
152
|
// check the ascii map for emojis
|
|
154
|
-
if (!(options !== null && options !== void 0 && options.disableAutoformat
|
|
153
|
+
if (!(options !== null && options !== void 0 && options.disableAutoformat) && asciiMap && normalizedQuery.length >= 3 && normalizedQuery.endsWith(' ') && asciiMap.has(normalizedQuery.trim())) {
|
|
155
154
|
var _emoji = asciiMap.get(normalizedQuery.trim());
|
|
156
155
|
return {
|
|
157
156
|
title: (_emoji === null || _emoji === void 0 ? void 0 : _emoji.name) || '',
|
|
@@ -228,7 +227,7 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
228
227
|
plugin: function plugin(_ref8) {
|
|
229
228
|
var _api$analytics4;
|
|
230
229
|
var schema = _ref8.schema;
|
|
231
|
-
return (0, _asciiInputRules.inputRulePlugin)(schema, api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions, api,
|
|
230
|
+
return (0, _asciiInputRules.inputRulePlugin)(schema, api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions, api, options === null || options === void 0 ? void 0 : options.disableAutoformat);
|
|
232
231
|
}
|
|
233
232
|
}];
|
|
234
233
|
},
|
|
@@ -18,13 +18,12 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
18
18
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
19
19
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
20
20
|
var _prosemirrorInputRules = require("@atlaskit/prosemirror-input-rules");
|
|
21
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
22
21
|
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)); }
|
|
23
22
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
23
|
function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
25
24
|
var matcher;
|
|
26
25
|
function inputRulePlugin(schema, editorAnalyticsAPI, pluginInjectionApi, disableAutoformat) {
|
|
27
|
-
if (disableAutoformat
|
|
26
|
+
if (disableAutoformat) {
|
|
28
27
|
return;
|
|
29
28
|
}
|
|
30
29
|
if (schema.nodes.emoji) {
|
|
@@ -9,7 +9,6 @@ import { calculateToolbarPositionAboveSelection } from '@atlaskit/editor-common/
|
|
|
9
9
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
10
10
|
import { EmojiTypeAheadItem, preloadEmojiPicker, recordSelectionFailedSli, recordSelectionSucceededSli, SearchSort } from '@atlaskit/emoji';
|
|
11
11
|
import CommentIcon from '@atlaskit/icon/core/comment';
|
|
12
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
12
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
14
13
|
import { createEmojiFragment, insertEmoji } from './editor-commands/insert-emoji';
|
|
15
14
|
import { emojiNodeSpec } from './nodeviews/emojiNodeSpec';
|
|
@@ -130,7 +129,7 @@ export const emojiPlugin = ({
|
|
|
130
129
|
const normalizedQuery = TRIGGER.concat(query);
|
|
131
130
|
// if the query has space at the end
|
|
132
131
|
// check the ascii map for emojis
|
|
133
|
-
if (!(options !== null && options !== void 0 && options.disableAutoformat
|
|
132
|
+
if (!(options !== null && options !== void 0 && options.disableAutoformat) && asciiMap && normalizedQuery.length >= 3 && normalizedQuery.endsWith(' ') && asciiMap.has(normalizedQuery.trim())) {
|
|
134
133
|
const emoji = asciiMap.get(normalizedQuery.trim());
|
|
135
134
|
return {
|
|
136
135
|
title: (emoji === null || emoji === void 0 ? void 0 : emoji.name) || '',
|
|
@@ -214,7 +213,7 @@ export const emojiPlugin = ({
|
|
|
214
213
|
schema
|
|
215
214
|
}) => {
|
|
216
215
|
var _api$analytics4;
|
|
217
|
-
return asciiInputRulePlugin(schema, api === null || api === void 0 ? void 0 : (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions, api,
|
|
216
|
+
return asciiInputRulePlugin(schema, api === null || api === void 0 ? void 0 : (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions, api, options === null || options === void 0 ? void 0 : options.disableAutoformat);
|
|
218
217
|
}
|
|
219
218
|
}];
|
|
220
219
|
},
|
|
@@ -3,10 +3,9 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
|
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import { createRule } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { createPlugin, leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
|
|
6
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
6
|
let matcher;
|
|
8
7
|
export function inputRulePlugin(schema, editorAnalyticsAPI, pluginInjectionApi, disableAutoformat) {
|
|
9
|
-
if (disableAutoformat
|
|
8
|
+
if (disableAutoformat) {
|
|
10
9
|
return;
|
|
11
10
|
}
|
|
12
11
|
if (schema.nodes.emoji) {
|
package/dist/esm/emojiPlugin.js
CHANGED
|
@@ -14,7 +14,6 @@ import { calculateToolbarPositionAboveSelection } from '@atlaskit/editor-common/
|
|
|
14
14
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
15
15
|
import { EmojiTypeAheadItem, preloadEmojiPicker, recordSelectionFailedSli, recordSelectionSucceededSli, SearchSort } from '@atlaskit/emoji';
|
|
16
16
|
import CommentIcon from '@atlaskit/icon/core/comment';
|
|
17
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
17
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
19
18
|
import { createEmojiFragment, insertEmoji } from './editor-commands/insert-emoji';
|
|
20
19
|
import { emojiNodeSpec } from './nodeviews/emojiNodeSpec';
|
|
@@ -140,7 +139,7 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
140
139
|
var normalizedQuery = TRIGGER.concat(query);
|
|
141
140
|
// if the query has space at the end
|
|
142
141
|
// check the ascii map for emojis
|
|
143
|
-
if (!(options !== null && options !== void 0 && options.disableAutoformat
|
|
142
|
+
if (!(options !== null && options !== void 0 && options.disableAutoformat) && asciiMap && normalizedQuery.length >= 3 && normalizedQuery.endsWith(' ') && asciiMap.has(normalizedQuery.trim())) {
|
|
144
143
|
var _emoji = asciiMap.get(normalizedQuery.trim());
|
|
145
144
|
return {
|
|
146
145
|
title: (_emoji === null || _emoji === void 0 ? void 0 : _emoji.name) || '',
|
|
@@ -217,7 +216,7 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
217
216
|
plugin: function plugin(_ref8) {
|
|
218
217
|
var _api$analytics4;
|
|
219
218
|
var schema = _ref8.schema;
|
|
220
|
-
return asciiInputRulePlugin(schema, api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions, api,
|
|
219
|
+
return asciiInputRulePlugin(schema, api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions, api, options === null || options === void 0 ? void 0 : options.disableAutoformat);
|
|
221
220
|
}
|
|
222
221
|
}];
|
|
223
222
|
},
|
|
@@ -13,10 +13,9 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
|
|
|
13
13
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
14
14
|
import { createRule } from '@atlaskit/editor-common/utils';
|
|
15
15
|
import { createPlugin, leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
|
|
16
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
17
16
|
var matcher;
|
|
18
17
|
export function inputRulePlugin(schema, editorAnalyticsAPI, pluginInjectionApi, disableAutoformat) {
|
|
19
|
-
if (disableAutoformat
|
|
18
|
+
if (disableAutoformat) {
|
|
20
19
|
return;
|
|
21
20
|
}
|
|
22
21
|
if (schema.nodes.emoji) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-emoji",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.28",
|
|
4
4
|
"description": "Emoji plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@atlaskit/node-data-provider": "^9.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": "^
|
|
39
|
+
"@atlaskit/tmp-editor-statsig": "^58.0.0",
|
|
40
40
|
"@atlaskit/tokens": "^12.0.0",
|
|
41
41
|
"@babel/runtime": "^7.0.0",
|
|
42
42
|
"@emotion/react": "^11.7.1",
|