@atlaskit/editor-plugin-emoji 2.0.2 → 2.1.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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/editor-plugin-emoji
2
2
 
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#122895](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/122895)
8
+ [`49b8c7658f3b5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/49b8c7658f3b5) -
9
+ [ED-24173] bump @atlaskit/adf-schema to 40.3.0 and @atlassian/adf-schema-json to 1.18.0
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 2.0.3
16
+
17
+ ### Patch Changes
18
+
19
+ - [#122612](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/122612)
20
+ [`01a85ce0a88ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/01a85ce0a88ec) -
21
+ [ux] ED-23705 Add logic to handle annotations on inline nodes when they are inserted or pasted.
22
+ Covers the following inline nodes: emoji, status, mention, date, inlineCard
23
+
3
24
  ## 2.0.2
4
25
 
5
26
  ### Patch Changes
@@ -4,14 +4,30 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.insertEmoji = void 0;
7
+ exports.insertEmoji = exports.createEmojiFragment = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _analytics = require("@atlaskit/editor-common/analytics");
10
+ var _utils = require("@atlaskit/editor-common/utils");
10
11
  var _model = require("@atlaskit/editor-prosemirror/model");
11
12
  var _state = require("@atlaskit/editor-prosemirror/state");
12
- var _utils = require("@atlaskit/editor-prosemirror/utils");
13
+ var _utils2 = require("@atlaskit/editor-prosemirror/utils");
14
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
15
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
16
  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) { (0, _defineProperty2.default)(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; }
17
+ var createEmojiFragment = exports.createEmojiFragment = function createEmojiFragment(doc, pos, emoji) {
18
+ var _emoji$id = emoji.id,
19
+ id = _emoji$id === void 0 ? '' : _emoji$id,
20
+ fallback = emoji.fallback,
21
+ shortName = emoji.shortName;
22
+ var annotationMarksForPos = (0, _utils.getAnnotationMarksForPos)(pos);
23
+ var emojiNode = doc.type.schema.nodes.emoji.createChecked({
24
+ shortName: shortName,
25
+ id: id,
26
+ text: fallback || shortName
27
+ }, null, annotationMarksForPos);
28
+ var space = doc.type.schema.text(' ', annotationMarksForPos);
29
+ return _model.Fragment.fromArray([emojiNode, space]);
30
+ };
15
31
  var insertEmoji = exports.insertEmoji = function insertEmoji(editorAnalyticsAPI) {
16
32
  return function (emojiId, inputMethod) {
17
33
  return function (_ref) {
@@ -20,12 +36,17 @@ var insertEmoji = exports.insertEmoji = function insertEmoji(editorAnalyticsAPI)
20
36
  selection = tr.selection;
21
37
  var emoji = tr.doc.type.schema.nodes.emoji;
22
38
  if (emoji && emojiId) {
23
- var node = emoji.createChecked(_objectSpread(_objectSpread({}, emojiId), {}, {
24
- text: emojiId.fallback || emojiId.shortName
25
- }));
26
- var textNode = doc.type.schema.text(' ');
27
- var fragment = _model.Fragment.fromArray([node, textNode]);
28
- var newTr = (0, _utils.safeInsert)(fragment)(tr);
39
+ var fragment;
40
+ if ((0, _platformFeatureFlags.fg)('editor_inline_comments_paste_insert_nodes')) {
41
+ fragment = createEmojiFragment(doc, selection.$head, emojiId);
42
+ } else {
43
+ var node = emoji.createChecked(_objectSpread(_objectSpread({}, emojiId), {}, {
44
+ text: emojiId.fallback || emojiId.shortName
45
+ }));
46
+ var textNode = doc.type.schema.text(' ');
47
+ fragment = _model.Fragment.fromArray([node, textNode]);
48
+ }
49
+ var newTr = (0, _utils2.safeInsert)(fragment)(tr);
29
50
  if (inputMethod) {
30
51
  editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
31
52
  action: _analytics.ACTION.INSERTED,
@@ -23,6 +23,7 @@ var _typeAhead = require("@atlaskit/editor-common/type-ahead");
23
23
  var _model = require("@atlaskit/editor-prosemirror/model");
24
24
  var _state = require("@atlaskit/editor-prosemirror/state");
25
25
  var _emoji2 = require("@atlaskit/emoji");
26
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
26
27
  var _insertEmoji = require("./commands/insert-emoji");
27
28
  var _emoji3 = require("./nodeviews/emoji");
28
29
  var _asciiInputRules = require("./pm-plugins/ascii-input-rules");
@@ -144,12 +145,6 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
144
145
  selectItem: function selectItem(state, item, insert, _ref6) {
145
146
  var _api$analytics3;
146
147
  var mode = _ref6.mode;
147
- var _item$emoji = item.emoji,
148
- _item$emoji$id = _item$emoji.id,
149
- id = _item$emoji$id === void 0 ? '' : _item$emoji$id,
150
- fallback = _item$emoji.fallback,
151
- shortName = _item$emoji.shortName;
152
- var text = fallback || shortName;
153
148
  var emojiPluginState = emojiPluginKey.getState(state);
154
149
  if (emojiPluginState.emojiProvider && emojiPluginState.emojiProvider.recordSelection && item.emoji) {
155
150
  var _api$analytics$shared, _api$analytics, _api$analytics$shared2, _api$analytics2;
@@ -159,13 +154,25 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
159
154
  createAnalyticsEvent: (_api$analytics$shared2 = api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || (_api$analytics2 = _api$analytics2.sharedState.currentState()) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.createAnalyticsEvent) !== null && _api$analytics$shared2 !== void 0 ? _api$analytics$shared2 : undefined
160
155
  }));
161
156
  }
162
- var emojiNode = state.schema.nodes.emoji.createChecked({
163
- shortName: shortName,
164
- id: id,
165
- text: text
166
- });
167
- var space = state.schema.text(' ');
168
- var tr = insert(_model.Fragment.from([emojiNode, space]));
157
+ var fragment;
158
+ if ((0, _platformFeatureFlags.fg)('editor_inline_comments_paste_insert_nodes')) {
159
+ fragment = (0, _insertEmoji.createEmojiFragment)(state.doc, state.selection.$head, item.emoji);
160
+ } else {
161
+ var _item$emoji = item.emoji,
162
+ _item$emoji$id = _item$emoji.id,
163
+ id = _item$emoji$id === void 0 ? '' : _item$emoji$id,
164
+ fallback = _item$emoji.fallback,
165
+ shortName = _item$emoji.shortName;
166
+ var text = fallback || shortName;
167
+ var emojiNode = state.schema.nodes.emoji.createChecked({
168
+ shortName: shortName,
169
+ id: id,
170
+ text: text
171
+ });
172
+ var space = state.schema.text(' ');
173
+ fragment = _model.Fragment.from([emojiNode, space]);
174
+ }
175
+ var tr = insert(fragment);
169
176
  api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 || _api$analytics3.actions.attachAnalyticsEvent({
170
177
  action: _analytics.ACTION.INSERTED,
171
178
  actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
@@ -9,7 +9,10 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
9
9
  var _react = require("@emotion/react");
10
10
  var _emoji = require("@atlaskit/editor-common/emoji");
11
11
  var _templateObject;
12
- /** @jsx jsx */
12
+ /**
13
+ * @jsxRuntime classic
14
+ * @jsx jsx
15
+ */
13
16
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
17
  // eslint-disable-next-line
15
18
  var clickSelectWrapperStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage\n\tuser-select: all;\n"])));
@@ -1,7 +1,24 @@
1
1
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
2
+ import { getAnnotationMarksForPos } from '@atlaskit/editor-common/utils';
2
3
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
3
4
  import { Selection } from '@atlaskit/editor-prosemirror/state';
4
5
  import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
7
+ export const createEmojiFragment = (doc, pos, emoji) => {
8
+ const {
9
+ id = '',
10
+ fallback,
11
+ shortName
12
+ } = emoji;
13
+ const annotationMarksForPos = getAnnotationMarksForPos(pos);
14
+ const emojiNode = doc.type.schema.nodes.emoji.createChecked({
15
+ shortName,
16
+ id,
17
+ text: fallback || shortName
18
+ }, null, annotationMarksForPos);
19
+ const space = doc.type.schema.text(' ', annotationMarksForPos);
20
+ return Fragment.fromArray([emojiNode, space]);
21
+ };
5
22
  export const insertEmoji = editorAnalyticsAPI => (emojiId, inputMethod) => {
6
23
  return ({
7
24
  tr
@@ -14,12 +31,17 @@ export const insertEmoji = editorAnalyticsAPI => (emojiId, inputMethod) => {
14
31
  emoji
15
32
  } = tr.doc.type.schema.nodes;
16
33
  if (emoji && emojiId) {
17
- const node = emoji.createChecked({
18
- ...emojiId,
19
- text: emojiId.fallback || emojiId.shortName
20
- });
21
- const textNode = doc.type.schema.text(' ');
22
- const fragment = Fragment.fromArray([node, textNode]);
34
+ let fragment;
35
+ if (fg('editor_inline_comments_paste_insert_nodes')) {
36
+ fragment = createEmojiFragment(doc, selection.$head, emojiId);
37
+ } else {
38
+ const node = emoji.createChecked({
39
+ ...emojiId,
40
+ text: emojiId.fallback || emojiId.shortName
41
+ });
42
+ const textNode = doc.type.schema.text(' ');
43
+ fragment = Fragment.fromArray([node, textNode]);
44
+ }
23
45
  const newTr = safeInsert(fragment)(tr);
24
46
  if (inputMethod) {
25
47
  editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
@@ -9,7 +9,8 @@ import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
9
9
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
10
10
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
11
11
  import { EmojiTypeAheadItem, recordSelectionFailedSli, recordSelectionSucceededSli, SearchSort } from '@atlaskit/emoji';
12
- import { insertEmoji } from './commands/insert-emoji';
12
+ import { fg } from '@atlaskit/platform-feature-flags';
13
+ import { createEmojiFragment, insertEmoji } from './commands/insert-emoji';
13
14
  import { EmojiNodeView } from './nodeviews/emoji';
14
15
  import { inputRulePlugin as asciiInputRulePlugin } from './pm-plugins/ascii-input-rules';
15
16
  export const emojiToTypeaheadItem = (emoji, emojiProvider) => ({
@@ -126,12 +127,6 @@ export const emojiPlugin = ({
126
127
  mode
127
128
  }) {
128
129
  var _api$analytics3;
129
- const {
130
- id = '',
131
- fallback,
132
- shortName
133
- } = item.emoji;
134
- const text = fallback || shortName;
135
130
  const emojiPluginState = emojiPluginKey.getState(state);
136
131
  if (emojiPluginState.emojiProvider && emojiPluginState.emojiProvider.recordSelection && item.emoji) {
137
132
  var _api$analytics$shared, _api$analytics, _api$analytics$shared2, _api$analytics$shared3, _api$analytics2, _api$analytics2$share;
@@ -141,13 +136,25 @@ export const emojiPlugin = ({
141
136
  createAnalyticsEvent: (_api$analytics$shared3 = api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : (_api$analytics2$share = _api$analytics2.sharedState.currentState()) === null || _api$analytics2$share === void 0 ? void 0 : _api$analytics2$share.createAnalyticsEvent) !== null && _api$analytics$shared3 !== void 0 ? _api$analytics$shared3 : undefined
142
137
  }));
143
138
  }
144
- const emojiNode = state.schema.nodes.emoji.createChecked({
145
- shortName,
146
- id,
147
- text
148
- });
149
- const space = state.schema.text(' ');
150
- const tr = insert(Fragment.from([emojiNode, space]));
139
+ let fragment;
140
+ if (fg('editor_inline_comments_paste_insert_nodes')) {
141
+ fragment = createEmojiFragment(state.doc, state.selection.$head, item.emoji);
142
+ } else {
143
+ const {
144
+ id = '',
145
+ fallback,
146
+ shortName
147
+ } = item.emoji;
148
+ const text = fallback || shortName;
149
+ const emojiNode = state.schema.nodes.emoji.createChecked({
150
+ shortName,
151
+ id,
152
+ text
153
+ });
154
+ const space = state.schema.text(' ');
155
+ fragment = Fragment.from([emojiNode, space]);
156
+ }
157
+ const tr = insert(fragment);
151
158
  api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions.attachAnalyticsEvent({
152
159
  action: ACTION.INSERTED,
153
160
  actionSubject: ACTION_SUBJECT.DOCUMENT,
@@ -1,4 +1,7 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
6
  import { css, jsx } from '@emotion/react';
4
7
  import { Emoji } from '@atlaskit/editor-common/emoji';
@@ -2,9 +2,25 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  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; }
4
4
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
5
+ import { getAnnotationMarksForPos } from '@atlaskit/editor-common/utils';
5
6
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
6
7
  import { Selection } from '@atlaskit/editor-prosemirror/state';
7
8
  import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
10
+ export var createEmojiFragment = function createEmojiFragment(doc, pos, emoji) {
11
+ var _emoji$id = emoji.id,
12
+ id = _emoji$id === void 0 ? '' : _emoji$id,
13
+ fallback = emoji.fallback,
14
+ shortName = emoji.shortName;
15
+ var annotationMarksForPos = getAnnotationMarksForPos(pos);
16
+ var emojiNode = doc.type.schema.nodes.emoji.createChecked({
17
+ shortName: shortName,
18
+ id: id,
19
+ text: fallback || shortName
20
+ }, null, annotationMarksForPos);
21
+ var space = doc.type.schema.text(' ', annotationMarksForPos);
22
+ return Fragment.fromArray([emojiNode, space]);
23
+ };
8
24
  export var insertEmoji = function insertEmoji(editorAnalyticsAPI) {
9
25
  return function (emojiId, inputMethod) {
10
26
  return function (_ref) {
@@ -13,11 +29,16 @@ export var insertEmoji = function insertEmoji(editorAnalyticsAPI) {
13
29
  selection = tr.selection;
14
30
  var emoji = tr.doc.type.schema.nodes.emoji;
15
31
  if (emoji && emojiId) {
16
- var node = emoji.createChecked(_objectSpread(_objectSpread({}, emojiId), {}, {
17
- text: emojiId.fallback || emojiId.shortName
18
- }));
19
- var textNode = doc.type.schema.text(' ');
20
- var fragment = Fragment.fromArray([node, textNode]);
32
+ var fragment;
33
+ if (fg('editor_inline_comments_paste_insert_nodes')) {
34
+ fragment = createEmojiFragment(doc, selection.$head, emojiId);
35
+ } else {
36
+ var node = emoji.createChecked(_objectSpread(_objectSpread({}, emojiId), {}, {
37
+ text: emojiId.fallback || emojiId.shortName
38
+ }));
39
+ var textNode = doc.type.schema.text(' ');
40
+ fragment = Fragment.fromArray([node, textNode]);
41
+ }
21
42
  var newTr = safeInsert(fragment)(tr);
22
43
  if (inputMethod) {
23
44
  editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
@@ -12,7 +12,8 @@ import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
12
12
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
13
13
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
14
14
  import { EmojiTypeAheadItem, recordSelectionFailedSli, recordSelectionSucceededSli, SearchSort } from '@atlaskit/emoji';
15
- import { insertEmoji } from './commands/insert-emoji';
15
+ import { fg } from '@atlaskit/platform-feature-flags';
16
+ import { createEmojiFragment, insertEmoji } from './commands/insert-emoji';
16
17
  import { EmojiNodeView } from './nodeviews/emoji';
17
18
  import { inputRulePlugin as asciiInputRulePlugin } from './pm-plugins/ascii-input-rules';
18
19
  export var emojiToTypeaheadItem = function emojiToTypeaheadItem(emoji, emojiProvider) {
@@ -131,12 +132,6 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
131
132
  selectItem: function selectItem(state, item, insert, _ref6) {
132
133
  var _api$analytics3;
133
134
  var mode = _ref6.mode;
134
- var _item$emoji = item.emoji,
135
- _item$emoji$id = _item$emoji.id,
136
- id = _item$emoji$id === void 0 ? '' : _item$emoji$id,
137
- fallback = _item$emoji.fallback,
138
- shortName = _item$emoji.shortName;
139
- var text = fallback || shortName;
140
135
  var emojiPluginState = emojiPluginKey.getState(state);
141
136
  if (emojiPluginState.emojiProvider && emojiPluginState.emojiProvider.recordSelection && item.emoji) {
142
137
  var _api$analytics$shared, _api$analytics, _api$analytics$shared2, _api$analytics2;
@@ -146,13 +141,25 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
146
141
  createAnalyticsEvent: (_api$analytics$shared2 = api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || (_api$analytics2 = _api$analytics2.sharedState.currentState()) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.createAnalyticsEvent) !== null && _api$analytics$shared2 !== void 0 ? _api$analytics$shared2 : undefined
147
142
  }));
148
143
  }
149
- var emojiNode = state.schema.nodes.emoji.createChecked({
150
- shortName: shortName,
151
- id: id,
152
- text: text
153
- });
154
- var space = state.schema.text(' ');
155
- var tr = insert(Fragment.from([emojiNode, space]));
144
+ var fragment;
145
+ if (fg('editor_inline_comments_paste_insert_nodes')) {
146
+ fragment = createEmojiFragment(state.doc, state.selection.$head, item.emoji);
147
+ } else {
148
+ var _item$emoji = item.emoji,
149
+ _item$emoji$id = _item$emoji.id,
150
+ id = _item$emoji$id === void 0 ? '' : _item$emoji$id,
151
+ fallback = _item$emoji.fallback,
152
+ shortName = _item$emoji.shortName;
153
+ var text = fallback || shortName;
154
+ var emojiNode = state.schema.nodes.emoji.createChecked({
155
+ shortName: shortName,
156
+ id: id,
157
+ text: text
158
+ });
159
+ var space = state.schema.text(' ');
160
+ fragment = Fragment.from([emojiNode, space]);
161
+ }
162
+ var tr = insert(fragment);
156
163
  api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 || _api$analytics3.actions.attachAnalyticsEvent({
157
164
  action: ACTION.INSERTED,
158
165
  actionSubject: ACTION_SUBJECT.DOCUMENT,
@@ -1,6 +1,9 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
2
  var _templateObject;
3
- /** @jsx jsx */
3
+ /**
4
+ * @jsxRuntime classic
5
+ * @jsx jsx
6
+ */
4
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
5
8
  import { css, jsx } from '@emotion/react';
6
9
  import { Emoji } from '@atlaskit/editor-common/emoji';
@@ -1,4 +1,6 @@
1
1
  import type { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import type { EditorCommand } from '@atlaskit/editor-common/types';
3
+ import { Fragment, type Node, type ResolvedPos } from '@atlaskit/editor-prosemirror/model';
3
4
  import type { EmojiId } from '@atlaskit/emoji';
5
+ export declare const createEmojiFragment: (doc: Node, pos: ResolvedPos, emoji: EmojiId) => Fragment;
4
6
  export declare const insertEmoji: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (emojiId: EmojiId, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD) => EditorCommand;
@@ -1,4 +1,7 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  import { jsx } from '@emotion/react';
3
6
  import type { EmojiProps } from '@atlaskit/editor-common/emoji';
4
7
  export default function EmojiNode(props: EmojiProps): jsx.JSX.Element;
@@ -1,4 +1,6 @@
1
1
  import type { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import type { EditorCommand } from '@atlaskit/editor-common/types';
3
+ import { Fragment, type Node, type ResolvedPos } from '@atlaskit/editor-prosemirror/model';
3
4
  import type { EmojiId } from '@atlaskit/emoji';
5
+ export declare const createEmojiFragment: (doc: Node, pos: ResolvedPos, emoji: EmojiId) => Fragment;
4
6
  export declare const insertEmoji: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (emojiId: EmojiId, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD) => EditorCommand;
@@ -1,4 +1,7 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  import { jsx } from '@emotion/react';
3
6
  import type { EmojiProps } from '@atlaskit/editor-common/emoji';
4
7
  export default function EmojiNode(props: EmojiProps): jsx.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-emoji",
3
- "version": "2.0.2",
3
+ "version": "2.1.0",
4
4
  "description": "Emoji plugin for @atlaskit/editor-core",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -21,12 +21,13 @@
21
21
  "runReact18": false
22
22
  },
23
23
  "dependencies": {
24
- "@atlaskit/adf-schema": "^39.0.3",
25
- "@atlaskit/editor-common": "^86.0.0",
26
- "@atlaskit/editor-plugin-analytics": "^1.4.0",
27
- "@atlaskit/editor-plugin-type-ahead": "^1.4.0",
24
+ "@atlaskit/adf-schema": "^40.3.0",
25
+ "@atlaskit/editor-common": "^86.7.0",
26
+ "@atlaskit/editor-plugin-analytics": "^1.5.0",
27
+ "@atlaskit/editor-plugin-type-ahead": "^1.5.0",
28
28
  "@atlaskit/editor-prosemirror": "4.0.1",
29
29
  "@atlaskit/emoji": "^67.6.0",
30
+ "@atlaskit/platform-feature-flags": "^0.3.0",
30
31
  "@atlaskit/prosemirror-input-rules": "^3.1.0",
31
32
  "@babel/runtime": "^7.0.0",
32
33
  "@emotion/react": "^11.7.1",
@@ -90,5 +91,10 @@
90
91
  },
91
92
  "af:exports": {
92
93
  ".": "./src/index.ts"
94
+ },
95
+ "platform-feature-flags": {
96
+ "editor_inline_comments_paste_insert_nodes": {
97
+ "type": "boolean"
98
+ }
93
99
  }
94
100
  }