@atlaskit/editor-plugin-emoji 26.0.0 → 26.0.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 +18 -18
- package/dist/cjs/ui/quick-insert/EmojiQuickInsertMenuItem.js +6 -6
- package/dist/cjs/ui/quick-insert/getEmojiQuickInsertComponents.js +11 -4
- package/dist/es2019/emojiPlugin.js +18 -18
- package/dist/es2019/ui/quick-insert/EmojiQuickInsertMenuItem.js +4 -3
- package/dist/es2019/ui/quick-insert/getEmojiQuickInsertComponents.js +7 -2
- package/dist/esm/emojiPlugin.js +18 -18
- package/dist/esm/ui/quick-insert/EmojiQuickInsertMenuItem.js +6 -6
- package/dist/esm/ui/quick-insert/getEmojiQuickInsertComponents.js +10 -4
- package/dist/types/ui/quick-insert/EmojiQuickInsertMenuItem.d.ts +5 -1
- package/dist/types/ui/quick-insert/getEmojiQuickInsertComponents.d.ts +5 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-emoji
|
|
2
2
|
|
|
3
|
+
## 26.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 26.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`b7e558430d632`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b7e558430d632) -
|
|
14
|
+
Use legacy emoji quick-insert selection for registered menus under platform_editor_slash_command.
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 26.0.0
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/cjs/emojiPlugin.js
CHANGED
|
@@ -190,10 +190,26 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
190
190
|
return tr;
|
|
191
191
|
}
|
|
192
192
|
};
|
|
193
|
+
var selectEmojiFromQuickInsert = function selectEmojiFromQuickInsert(insert) {
|
|
194
|
+
var _api$typeAhead;
|
|
195
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1', {
|
|
196
|
+
exposure: true
|
|
197
|
+
})) {
|
|
198
|
+
return (0, _actions.setInlineEmojiPopupOpen)(true)(insert(''));
|
|
199
|
+
}
|
|
200
|
+
var tr = insert(undefined);
|
|
201
|
+
api === null || api === void 0 || (_api$typeAhead = api.typeAhead) === null || _api$typeAhead === void 0 || _api$typeAhead.actions.openAtTransaction({
|
|
202
|
+
triggerHandler: typeAhead,
|
|
203
|
+
inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT
|
|
204
|
+
})(tr);
|
|
205
|
+
return tr;
|
|
206
|
+
};
|
|
193
207
|
var isRegisteredSlashCommandEnabled = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_slash_command');
|
|
194
208
|
if (isRegisteredSlashCommandEnabled) {
|
|
195
209
|
var _api$uiControlRegistr;
|
|
196
|
-
api === null || api === void 0 || (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 || _api$uiControlRegistr.actions.register((0, _getEmojiQuickInsertComponents.getEmojiQuickInsertComponents)(
|
|
210
|
+
api === null || api === void 0 || (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 || _api$uiControlRegistr.actions.register((0, _getEmojiQuickInsertComponents.getEmojiQuickInsertComponents)({
|
|
211
|
+
selectEmojiFromQuickInsert: selectEmojiFromQuickInsert
|
|
212
|
+
}));
|
|
197
213
|
}
|
|
198
214
|
api === null || api === void 0 || (_api$base = api.base) === null || _api$base === void 0 || _api$base.actions.registerMarks(function (_ref7) {
|
|
199
215
|
var tr = _ref7.tr,
|
|
@@ -328,23 +344,7 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
328
344
|
icon: function icon() {
|
|
329
345
|
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconEmoji, null);
|
|
330
346
|
},
|
|
331
|
-
action:
|
|
332
|
-
var _api$typeAhead;
|
|
333
|
-
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1', {
|
|
334
|
-
exposure: true
|
|
335
|
-
})) {
|
|
336
|
-
// Clear slash
|
|
337
|
-
var _tr = insert('');
|
|
338
|
-
_tr = (0, _actions.setInlineEmojiPopupOpen)(true)(_tr);
|
|
339
|
-
return _tr;
|
|
340
|
-
}
|
|
341
|
-
var tr = insert(undefined);
|
|
342
|
-
api === null || api === void 0 || (_api$typeAhead = api.typeAhead) === null || _api$typeAhead === void 0 || _api$typeAhead.actions.openAtTransaction({
|
|
343
|
-
triggerHandler: typeAhead,
|
|
344
|
-
inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT
|
|
345
|
-
})(tr);
|
|
346
|
-
return tr;
|
|
347
|
-
}
|
|
347
|
+
action: selectEmojiFromQuickInsert
|
|
348
348
|
}];
|
|
349
349
|
}
|
|
350
350
|
}), {}, {
|
|
@@ -12,13 +12,13 @@ var _messages = require("@atlaskit/editor-common/messages");
|
|
|
12
12
|
var _menuItem = require("@atlaskit/editor-common/quick-insert/menu-item");
|
|
13
13
|
var _messages2 = require("@atlaskit/editor-common/quick-insert/messages");
|
|
14
14
|
var _emoji = _interopRequireDefault(require("@atlaskit/icon/core/emoji"));
|
|
15
|
-
var _actions = require("../../pm-plugins/actions");
|
|
16
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
16
|
var previewImageUrls = {
|
|
18
17
|
dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVH4.png',
|
|
19
18
|
light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVKH.png'
|
|
20
19
|
};
|
|
21
|
-
var EmojiQuickInsertMenuItem = exports.EmojiQuickInsertMenuItem = function EmojiQuickInsertMenuItem() {
|
|
20
|
+
var EmojiQuickInsertMenuItem = exports.EmojiQuickInsertMenuItem = function EmojiQuickInsertMenuItem(_ref) {
|
|
21
|
+
var selectEmojiFromQuickInsert = _ref.selectEmojiFromQuickInsert;
|
|
22
22
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
23
23
|
formatMessage = _useIntl.formatMessage;
|
|
24
24
|
var preview = (0, _react.useMemo)(function () {
|
|
@@ -29,10 +29,10 @@ var EmojiQuickInsertMenuItem = exports.EmojiQuickInsertMenuItem = function Emoji
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}, [formatMessage]);
|
|
32
|
-
var onSelect = (0, _react.useCallback)(function (
|
|
33
|
-
var insert =
|
|
34
|
-
return (
|
|
35
|
-
}, []);
|
|
32
|
+
var onSelect = (0, _react.useCallback)(function (_ref2) {
|
|
33
|
+
var insert = _ref2.insert;
|
|
34
|
+
return selectEmojiFromQuickInsert(insert);
|
|
35
|
+
}, [selectEmojiFromQuickInsert]);
|
|
36
36
|
return /*#__PURE__*/_react.default.createElement(_menuItem.QuickInsertMenuItem, {
|
|
37
37
|
description: formatMessage(_messages.toolbarInsertBlockMessages.emojiDescription),
|
|
38
38
|
iconBefore: /*#__PURE__*/_react.default.createElement(_emoji.default, {
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.getEmojiQuickInsertComponents = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
9
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
8
10
|
var _createQuickInsertMatcher = require("@atlaskit/editor-common/quick-insert/create-quick-insert-matcher");
|
|
9
11
|
var _keys = require("@atlaskit/editor-common/quick-insert/keys");
|
|
10
12
|
var _rank = require("@atlaskit/editor-common/quick-insert/rank");
|
|
11
13
|
var _EmojiQuickInsertMenuItem = require("./EmojiQuickInsertMenuItem");
|
|
12
|
-
var getEmojiQuickInsertComponents = exports.getEmojiQuickInsertComponents = function getEmojiQuickInsertComponents() {
|
|
14
|
+
var getEmojiQuickInsertComponents = exports.getEmojiQuickInsertComponents = function getEmojiQuickInsertComponents(_ref) {
|
|
15
|
+
var selectEmojiFromQuickInsert = _ref.selectEmojiFromQuickInsert;
|
|
13
16
|
return [{
|
|
14
17
|
key: _keys.EMOJI_MENU_ITEM.key,
|
|
15
18
|
type: _keys.EMOJI_MENU_ITEM.type,
|
|
@@ -18,14 +21,18 @@ var getEmojiQuickInsertComponents = exports.getEmojiQuickInsertComponents = func
|
|
|
18
21
|
type: _keys.MEDIA_SECTION.type,
|
|
19
22
|
rank: _rank.MEDIA_SECTION_RANK[_keys.EMOJI_MENU_ITEM.key]
|
|
20
23
|
}],
|
|
21
|
-
match: (0, _createQuickInsertMatcher.createQuickInsertMatcher)(function (
|
|
22
|
-
var formatMessage =
|
|
24
|
+
match: (0, _createQuickInsertMatcher.createQuickInsertMatcher)(function (_ref2) {
|
|
25
|
+
var formatMessage = _ref2.formatMessage;
|
|
23
26
|
return {
|
|
24
27
|
description: formatMessage(_messages.toolbarInsertBlockMessages.emojiDescription),
|
|
25
28
|
shortcut: ':',
|
|
26
29
|
title: formatMessage(_messages.toolbarInsertBlockMessages.emoji)
|
|
27
30
|
};
|
|
28
31
|
}),
|
|
29
|
-
component:
|
|
32
|
+
component: function component() {
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement(_EmojiQuickInsertMenuItem.EmojiQuickInsertMenuItem, {
|
|
34
|
+
selectEmojiFromQuickInsert: selectEmojiFromQuickInsert
|
|
35
|
+
});
|
|
36
|
+
}
|
|
30
37
|
}];
|
|
31
38
|
};
|
|
@@ -168,10 +168,26 @@ export const emojiPlugin = ({
|
|
|
168
168
|
return tr;
|
|
169
169
|
}
|
|
170
170
|
};
|
|
171
|
+
const selectEmojiFromQuickInsert = insert => {
|
|
172
|
+
var _api$typeAhead;
|
|
173
|
+
if (editorExperiment('platform_editor_controls', 'variant1', {
|
|
174
|
+
exposure: true
|
|
175
|
+
})) {
|
|
176
|
+
return setInlineEmojiPopupOpen(true)(insert(''));
|
|
177
|
+
}
|
|
178
|
+
const tr = insert(undefined);
|
|
179
|
+
api === null || api === void 0 ? void 0 : (_api$typeAhead = api.typeAhead) === null || _api$typeAhead === void 0 ? void 0 : _api$typeAhead.actions.openAtTransaction({
|
|
180
|
+
triggerHandler: typeAhead,
|
|
181
|
+
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
182
|
+
})(tr);
|
|
183
|
+
return tr;
|
|
184
|
+
};
|
|
171
185
|
const isRegisteredSlashCommandEnabled = isExperimentEnabled('platform_editor_slash_command');
|
|
172
186
|
if (isRegisteredSlashCommandEnabled) {
|
|
173
187
|
var _api$uiControlRegistr;
|
|
174
|
-
api === null || api === void 0 ? void 0 : (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 ? void 0 : _api$uiControlRegistr.actions.register(getEmojiQuickInsertComponents(
|
|
188
|
+
api === null || api === void 0 ? void 0 : (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 ? void 0 : _api$uiControlRegistr.actions.register(getEmojiQuickInsertComponents({
|
|
189
|
+
selectEmojiFromQuickInsert
|
|
190
|
+
}));
|
|
175
191
|
}
|
|
176
192
|
api === null || api === void 0 ? void 0 : (_api$base = api.base) === null || _api$base === void 0 ? void 0 : _api$base.actions.registerMarks(({
|
|
177
193
|
tr,
|
|
@@ -294,23 +310,7 @@ export const emojiPlugin = ({
|
|
|
294
310
|
keyshortcut: ':',
|
|
295
311
|
isDisabledOffline: false,
|
|
296
312
|
icon: () => /*#__PURE__*/React.createElement(IconEmoji, null),
|
|
297
|
-
action
|
|
298
|
-
var _api$typeAhead;
|
|
299
|
-
if (editorExperiment('platform_editor_controls', 'variant1', {
|
|
300
|
-
exposure: true
|
|
301
|
-
})) {
|
|
302
|
-
// Clear slash
|
|
303
|
-
let tr = insert('');
|
|
304
|
-
tr = setInlineEmojiPopupOpen(true)(tr);
|
|
305
|
-
return tr;
|
|
306
|
-
}
|
|
307
|
-
const tr = insert(undefined);
|
|
308
|
-
api === null || api === void 0 ? void 0 : (_api$typeAhead = api.typeAhead) === null || _api$typeAhead === void 0 ? void 0 : _api$typeAhead.actions.openAtTransaction({
|
|
309
|
-
triggerHandler: typeAhead,
|
|
310
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
311
|
-
})(tr);
|
|
312
|
-
return tr;
|
|
313
|
-
}
|
|
313
|
+
action: selectEmojiFromQuickInsert
|
|
314
314
|
}]
|
|
315
315
|
}),
|
|
316
316
|
typeAhead,
|
|
@@ -4,12 +4,13 @@ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/
|
|
|
4
4
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
5
5
|
import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
|
|
6
6
|
import EmojiIcon from '@atlaskit/icon/core/emoji';
|
|
7
|
-
import { setInlineEmojiPopupOpen } from '../../pm-plugins/actions';
|
|
8
7
|
const previewImageUrls = {
|
|
9
8
|
dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVH4.png',
|
|
10
9
|
light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVKH.png'
|
|
11
10
|
};
|
|
12
|
-
export const EmojiQuickInsertMenuItem = (
|
|
11
|
+
export const EmojiQuickInsertMenuItem = ({
|
|
12
|
+
selectEmojiFromQuickInsert
|
|
13
|
+
}) => {
|
|
13
14
|
const {
|
|
14
15
|
formatMessage
|
|
15
16
|
} = useIntl();
|
|
@@ -21,7 +22,7 @@ export const EmojiQuickInsertMenuItem = () => {
|
|
|
21
22
|
}), [formatMessage]);
|
|
22
23
|
const onSelect = useCallback(({
|
|
23
24
|
insert
|
|
24
|
-
}) =>
|
|
25
|
+
}) => selectEmojiFromQuickInsert(insert), [selectEmojiFromQuickInsert]);
|
|
25
26
|
return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
|
|
26
27
|
description: formatMessage(messages.emojiDescription),
|
|
27
28
|
iconBefore: /*#__PURE__*/React.createElement(EmojiIcon, {
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
2
3
|
import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
|
|
3
4
|
import { EMOJI_MENU_ITEM, MEDIA_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
|
|
4
5
|
import { MEDIA_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
|
|
5
6
|
import { EmojiQuickInsertMenuItem } from './EmojiQuickInsertMenuItem';
|
|
6
|
-
export const getEmojiQuickInsertComponents = (
|
|
7
|
+
export const getEmojiQuickInsertComponents = ({
|
|
8
|
+
selectEmojiFromQuickInsert
|
|
9
|
+
}) => [{
|
|
7
10
|
key: EMOJI_MENU_ITEM.key,
|
|
8
11
|
type: EMOJI_MENU_ITEM.type,
|
|
9
12
|
parents: [{
|
|
@@ -18,5 +21,7 @@ export const getEmojiQuickInsertComponents = () => [{
|
|
|
18
21
|
shortcut: ':',
|
|
19
22
|
title: formatMessage(messages.emoji)
|
|
20
23
|
})),
|
|
21
|
-
component: EmojiQuickInsertMenuItem
|
|
24
|
+
component: () => /*#__PURE__*/React.createElement(EmojiQuickInsertMenuItem, {
|
|
25
|
+
selectEmojiFromQuickInsert: selectEmojiFromQuickInsert
|
|
26
|
+
})
|
|
22
27
|
}];
|
package/dist/esm/emojiPlugin.js
CHANGED
|
@@ -179,10 +179,26 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
179
179
|
return tr;
|
|
180
180
|
}
|
|
181
181
|
};
|
|
182
|
+
var selectEmojiFromQuickInsert = function selectEmojiFromQuickInsert(insert) {
|
|
183
|
+
var _api$typeAhead;
|
|
184
|
+
if (editorExperiment('platform_editor_controls', 'variant1', {
|
|
185
|
+
exposure: true
|
|
186
|
+
})) {
|
|
187
|
+
return setInlineEmojiPopupOpen(true)(insert(''));
|
|
188
|
+
}
|
|
189
|
+
var tr = insert(undefined);
|
|
190
|
+
api === null || api === void 0 || (_api$typeAhead = api.typeAhead) === null || _api$typeAhead === void 0 || _api$typeAhead.actions.openAtTransaction({
|
|
191
|
+
triggerHandler: typeAhead,
|
|
192
|
+
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
193
|
+
})(tr);
|
|
194
|
+
return tr;
|
|
195
|
+
};
|
|
182
196
|
var isRegisteredSlashCommandEnabled = isExperimentEnabled('platform_editor_slash_command');
|
|
183
197
|
if (isRegisteredSlashCommandEnabled) {
|
|
184
198
|
var _api$uiControlRegistr;
|
|
185
|
-
api === null || api === void 0 || (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 || _api$uiControlRegistr.actions.register(getEmojiQuickInsertComponents(
|
|
199
|
+
api === null || api === void 0 || (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 || _api$uiControlRegistr.actions.register(getEmojiQuickInsertComponents({
|
|
200
|
+
selectEmojiFromQuickInsert: selectEmojiFromQuickInsert
|
|
201
|
+
}));
|
|
186
202
|
}
|
|
187
203
|
api === null || api === void 0 || (_api$base = api.base) === null || _api$base === void 0 || _api$base.actions.registerMarks(function (_ref7) {
|
|
188
204
|
var tr = _ref7.tr,
|
|
@@ -317,23 +333,7 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
317
333
|
icon: function icon() {
|
|
318
334
|
return /*#__PURE__*/React.createElement(IconEmoji, null);
|
|
319
335
|
},
|
|
320
|
-
action:
|
|
321
|
-
var _api$typeAhead;
|
|
322
|
-
if (editorExperiment('platform_editor_controls', 'variant1', {
|
|
323
|
-
exposure: true
|
|
324
|
-
})) {
|
|
325
|
-
// Clear slash
|
|
326
|
-
var _tr = insert('');
|
|
327
|
-
_tr = setInlineEmojiPopupOpen(true)(_tr);
|
|
328
|
-
return _tr;
|
|
329
|
-
}
|
|
330
|
-
var tr = insert(undefined);
|
|
331
|
-
api === null || api === void 0 || (_api$typeAhead = api.typeAhead) === null || _api$typeAhead === void 0 || _api$typeAhead.actions.openAtTransaction({
|
|
332
|
-
triggerHandler: typeAhead,
|
|
333
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
334
|
-
})(tr);
|
|
335
|
-
return tr;
|
|
336
|
-
}
|
|
336
|
+
action: selectEmojiFromQuickInsert
|
|
337
337
|
}];
|
|
338
338
|
}
|
|
339
339
|
}), {}, {
|
|
@@ -4,12 +4,12 @@ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/
|
|
|
4
4
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
5
5
|
import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
|
|
6
6
|
import EmojiIcon from '@atlaskit/icon/core/emoji';
|
|
7
|
-
import { setInlineEmojiPopupOpen } from '../../pm-plugins/actions';
|
|
8
7
|
var previewImageUrls = {
|
|
9
8
|
dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVH4.png',
|
|
10
9
|
light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVKH.png'
|
|
11
10
|
};
|
|
12
|
-
export var EmojiQuickInsertMenuItem = function EmojiQuickInsertMenuItem() {
|
|
11
|
+
export var EmojiQuickInsertMenuItem = function EmojiQuickInsertMenuItem(_ref) {
|
|
12
|
+
var selectEmojiFromQuickInsert = _ref.selectEmojiFromQuickInsert;
|
|
13
13
|
var _useIntl = useIntl(),
|
|
14
14
|
formatMessage = _useIntl.formatMessage;
|
|
15
15
|
var preview = useMemo(function () {
|
|
@@ -20,10 +20,10 @@ export var EmojiQuickInsertMenuItem = function EmojiQuickInsertMenuItem() {
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
}, [formatMessage]);
|
|
23
|
-
var onSelect = useCallback(function (
|
|
24
|
-
var insert =
|
|
25
|
-
return
|
|
26
|
-
}, []);
|
|
23
|
+
var onSelect = useCallback(function (_ref2) {
|
|
24
|
+
var insert = _ref2.insert;
|
|
25
|
+
return selectEmojiFromQuickInsert(insert);
|
|
26
|
+
}, [selectEmojiFromQuickInsert]);
|
|
27
27
|
return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
|
|
28
28
|
description: formatMessage(messages.emojiDescription),
|
|
29
29
|
iconBefore: /*#__PURE__*/React.createElement(EmojiIcon, {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
2
3
|
import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
|
|
3
4
|
import { EMOJI_MENU_ITEM, MEDIA_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
|
|
4
5
|
import { MEDIA_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
|
|
5
6
|
import { EmojiQuickInsertMenuItem } from './EmojiQuickInsertMenuItem';
|
|
6
|
-
export var getEmojiQuickInsertComponents = function getEmojiQuickInsertComponents() {
|
|
7
|
+
export var getEmojiQuickInsertComponents = function getEmojiQuickInsertComponents(_ref) {
|
|
8
|
+
var selectEmojiFromQuickInsert = _ref.selectEmojiFromQuickInsert;
|
|
7
9
|
return [{
|
|
8
10
|
key: EMOJI_MENU_ITEM.key,
|
|
9
11
|
type: EMOJI_MENU_ITEM.type,
|
|
@@ -12,14 +14,18 @@ export var getEmojiQuickInsertComponents = function getEmojiQuickInsertComponent
|
|
|
12
14
|
type: MEDIA_SECTION.type,
|
|
13
15
|
rank: MEDIA_SECTION_RANK[EMOJI_MENU_ITEM.key]
|
|
14
16
|
}],
|
|
15
|
-
match: createQuickInsertMatcher(function (
|
|
16
|
-
var formatMessage =
|
|
17
|
+
match: createQuickInsertMatcher(function (_ref2) {
|
|
18
|
+
var formatMessage = _ref2.formatMessage;
|
|
17
19
|
return {
|
|
18
20
|
description: formatMessage(messages.emojiDescription),
|
|
19
21
|
shortcut: ':',
|
|
20
22
|
title: formatMessage(messages.emoji)
|
|
21
23
|
};
|
|
22
24
|
}),
|
|
23
|
-
component:
|
|
25
|
+
component: function component() {
|
|
26
|
+
return /*#__PURE__*/React.createElement(EmojiQuickInsertMenuItem, {
|
|
27
|
+
selectEmojiFromQuickInsert: selectEmojiFromQuickInsert
|
|
28
|
+
});
|
|
29
|
+
}
|
|
24
30
|
}];
|
|
25
31
|
};
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import type { TypeAheadInsert } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
export declare const EmojiQuickInsertMenuItem: ({ selectEmojiFromQuickInsert, }: {
|
|
5
|
+
selectEmojiFromQuickInsert: (insert: TypeAheadInsert) => Transaction;
|
|
6
|
+
}) => React.JSX.Element;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
import type { TypeAheadInsert } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
1
3
|
import type { RegisterMenuItem } from '@atlaskit/editor-ui-control-model/types';
|
|
2
|
-
export declare const getEmojiQuickInsertComponents: (
|
|
4
|
+
export declare const getEmojiQuickInsertComponents: ({ selectEmojiFromQuickInsert, }: {
|
|
5
|
+
selectEmojiFromQuickInsert: (insert: TypeAheadInsert) => Transaction;
|
|
6
|
+
}) => RegisterMenuItem[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-emoji",
|
|
3
|
-
"version": "26.0.
|
|
3
|
+
"version": "26.0.2",
|
|
4
4
|
"description": "Emoji plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
43
43
|
"@atlaskit/prosemirror-input-rules": "^4.1.0",
|
|
44
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
44
|
+
"@atlaskit/tmp-editor-statsig": "^226.0.0",
|
|
45
45
|
"@atlaskit/tokens": "^20.3.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0",
|
|
47
47
|
"@emotion/react": "^11.7.1",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"react-loadable": "^5.1.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@atlaskit/editor-common": "^129.
|
|
53
|
+
"@atlaskit/editor-common": "^129.1.0",
|
|
54
54
|
"react": "^18.2.0 || ^19.2.0",
|
|
55
55
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
56
56
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|