@atlaskit/editor-common 94.4.0 → 94.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/cjs/analytics/types/enums.js +3 -0
  3. package/dist/cjs/element-browser/components/ElementList/ElementList.js +2 -2
  4. package/dist/cjs/media/messages/caption.js +5 -0
  5. package/dist/cjs/monitoring/error.js +1 -1
  6. package/dist/cjs/styles/shared/headings.js +2 -2
  7. package/dist/cjs/styles/shared/paragraph.js +2 -2
  8. package/dist/cjs/ui/DropList/index.js +15 -10
  9. package/dist/cjs/ui/Emoji/index.js +17 -9
  10. package/dist/cjs/ui-menu/Dropdown/index.js +13 -7
  11. package/dist/cjs/ui-menu/DropdownMenu/index.js +11 -3
  12. package/dist/cjs/ui-react/index.js +10 -1
  13. package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +24 -13
  14. package/dist/es2019/analytics/types/enums.js +3 -0
  15. package/dist/es2019/element-browser/components/ElementList/ElementList.js +2 -2
  16. package/dist/es2019/media/messages/caption.js +5 -0
  17. package/dist/es2019/monitoring/error.js +1 -1
  18. package/dist/es2019/styles/shared/headings.js +2 -2
  19. package/dist/es2019/styles/shared/paragraph.js +2 -2
  20. package/dist/es2019/ui/DropList/index.js +7 -2
  21. package/dist/es2019/ui/Emoji/index.js +10 -8
  22. package/dist/es2019/ui-menu/Dropdown/index.js +6 -5
  23. package/dist/es2019/ui-menu/DropdownMenu/index.js +12 -4
  24. package/dist/es2019/ui-react/index.js +1 -1
  25. package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +23 -14
  26. package/dist/esm/analytics/types/enums.js +3 -0
  27. package/dist/esm/element-browser/components/ElementList/ElementList.js +2 -2
  28. package/dist/esm/media/messages/caption.js +5 -0
  29. package/dist/esm/monitoring/error.js +1 -1
  30. package/dist/esm/styles/shared/headings.js +2 -2
  31. package/dist/esm/styles/shared/paragraph.js +2 -2
  32. package/dist/esm/ui/DropList/index.js +15 -10
  33. package/dist/esm/ui/Emoji/index.js +14 -8
  34. package/dist/esm/ui-menu/Dropdown/index.js +14 -8
  35. package/dist/esm/ui-menu/DropdownMenu/index.js +12 -4
  36. package/dist/esm/ui-react/index.js +1 -1
  37. package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +23 -14
  38. package/dist/types/analytics/types/enums.d.ts +5 -2
  39. package/dist/types/analytics/types/index.d.ts +1 -1
  40. package/dist/types/analytics/types/media-events.d.ts +6 -2
  41. package/dist/types/media/messages/caption.d.ts +5 -0
  42. package/dist/types/ui/DropList/index.d.ts +6 -2
  43. package/dist/types/ui/Emoji/index.d.ts +3 -3
  44. package/dist/types/ui/index.d.ts +1 -1
  45. package/dist/types/ui-react/index.d.ts +1 -1
  46. package/dist/types/ui-react/with-react-editor-view-outer-listeners.d.ts +1 -0
  47. package/dist/types-ts4.5/analytics/types/enums.d.ts +5 -2
  48. package/dist/types-ts4.5/analytics/types/index.d.ts +1 -1
  49. package/dist/types-ts4.5/analytics/types/media-events.d.ts +6 -2
  50. package/dist/types-ts4.5/media/messages/caption.d.ts +5 -0
  51. package/dist/types-ts4.5/ui/DropList/index.d.ts +6 -2
  52. package/dist/types-ts4.5/ui/Emoji/index.d.ts +3 -3
  53. package/dist/types-ts4.5/ui/index.d.ts +1 -1
  54. package/dist/types-ts4.5/ui-react/index.d.ts +1 -1
  55. package/dist/types-ts4.5/ui-react/with-react-editor-view-outer-listeners.d.ts +1 -0
  56. package/package.json +9 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 94.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#156303](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/156303)
8
+ [`dd9e4eaa8e65b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/dd9e4eaa8e65b) -
9
+ [ux] ED-25493 Support caption onboarding, comment notification visual refresh and live view double
10
+ click support
11
+ - [#155668](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/155668)
12
+ [`f948f63ced742`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f948f63ced742) -
13
+ We are testing replacing findDOMNode with an explicit ref behind a feature flag. If this fix is
14
+ successful it will be available in a later release.
15
+
16
+ ### Patch Changes
17
+
18
+ - [#156904](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/156904)
19
+ [`be03c594d7304`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/be03c594d7304) -
20
+ add missing margin top back to h5
21
+ - [#157011](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/157011)
22
+ [`4ff0cc01def2d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4ff0cc01def2d) -
23
+ ED-25301: prevent excessive emoji re-renders
24
+ - [#157011](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/157011)
25
+ [`dcdfd1e83ce5a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/dcdfd1e83ce5a) -
26
+ change ugc typography experiment to a gate
27
+ - Updated dependencies
28
+
3
29
  ## 94.4.0
4
30
 
5
31
  ### Minor Changes
@@ -41,6 +41,7 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
41
41
  ACTION["DISMISSED"] = "dismissed";
42
42
  ACTION["DISPATCHED_INVALID_TRANSACTION"] = "dispatchedInvalidTransaction";
43
43
  ACTION["DISPATCHED_VALID_TRANSACTION"] = "dispatchedValidTransaction";
44
+ ACTION["DOUBLE_CLICKED"] = "doubleClicked";
44
45
  ACTION["DRAGGED"] = "dragged";
45
46
  ACTION["EDITED"] = "edited";
46
47
  ACTION["EDITOR_CRASHED"] = "unhandledErrorCaught";
@@ -186,6 +187,7 @@ var INPUT_METHOD = exports.INPUT_METHOD = /*#__PURE__*/function (INPUT_METHOD) {
186
187
  INPUT_METHOD["TABLE_CONTEXT_MENU"] = "tableContextMenu";
187
188
  INPUT_METHOD["MOUSE"] = "mouse";
188
189
  INPUT_METHOD["BROWSER"] = "browser";
190
+ INPUT_METHOD["DOUBLE_CLICK"] = "doubleClick";
189
191
  return INPUT_METHOD;
190
192
  }({});
191
193
  var INSERT_MEDIA_VIA = exports.INSERT_MEDIA_VIA = /*#__PURE__*/function (INSERT_MEDIA_VIA) {
@@ -263,6 +265,7 @@ var ACTION_SUBJECT = exports.ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJ
263
265
  ACTION_SUBJECT["CONTEXT_MENU"] = "contextMenu";
264
266
  ACTION_SUBJECT["INLINE_DIALOG"] = "inlineDialog";
265
267
  ACTION_SUBJECT["ENGAGEMENT_PLATFORM"] = "engagementPlatform";
268
+ ACTION_SUBJECT["MEDIA_VIEWER"] = "mediaViewer";
266
269
  return ACTION_SUBJECT;
267
270
  }({});
268
271
  var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
@@ -19,8 +19,8 @@ var _withAnalyticsContext = _interopRequireDefault(require("@atlaskit/analytics-
19
19
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
20
20
  var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
21
21
  var _menu = require("@atlaskit/menu");
22
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
23
  var _primitives = require("@atlaskit/primitives");
23
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
24
24
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
25
25
  var _analytics = require("../../../analytics");
26
26
  var _quickInsert = require("../../../quick-insert");
@@ -301,7 +301,7 @@ var ItemContent = /*#__PURE__*/(0, _react.memo)(function (_ref7) {
301
301
  var title = _ref7.title,
302
302
  description = _ref7.description,
303
303
  keyshortcut = _ref7.keyshortcut;
304
- if ((0, _experiments.editorExperiment)('typography_migration_ugc', true)) {
304
+ if ((0, _platformFeatureFlags.fg)('platform_editor_typography_ugc')) {
305
305
  return (
306
306
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
307
307
  (0, _react2.jsx)("div", {
@@ -10,5 +10,10 @@ var captionMessages = exports.captionMessages = (0, _reactIntlNext.defineMessage
10
10
  id: 'fabric.editor.captionPlaceholder',
11
11
  defaultMessage: 'Add a caption',
12
12
  description: 'Placeholder description for an empty (new) caption in the editor'
13
+ },
14
+ placeholderWithDoubleClickPrompt: {
15
+ id: 'fabric.editor.captionPlaceholderWithDoubleClickPrompt',
16
+ defaultMessage: 'Add a caption - double-click to preview',
17
+ description: 'Placeholder description to prompt users to add a caption and double click media to preview'
13
18
  }
14
19
  });
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "94.4.0";
20
+ var packageVersion = "94.5.0";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // TODO: Sanitise the URL instead of just removing it
@@ -8,7 +8,6 @@ exports.headingsSharedStyles = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _react = require("@emotion/react");
10
10
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
12
11
  var _getEditorUgcToken = _interopRequireDefault(require("../../ugc-tokens/get-editor-ugc-token"));
13
12
  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
13
  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; } /* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */ /* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */ /* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors */ /* eslint-disable @atlaskit/design-system/use-tokens-space */ /* eslint-disable @atlaskit/design-system/use-tokens-typography */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -49,7 +48,7 @@ var headingWithAlignmentStyles = function headingWithAlignmentStyles() {
49
48
  // @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
50
49
  // text sizing prototype: http://proto/fabricrender/
51
50
  var headingsSharedStyles = exports.headingsSharedStyles = function headingsSharedStyles(typographyTheme) {
52
- var isADSTokenMigrationEnabled = (0, _experiments.editorExperiment)('typography_migration_ugc', true);
51
+ var isADSTokenMigrationEnabled = (0, _platformFeatureFlags.fg)('platform_editor_typography_ugc');
53
52
  if (isADSTokenMigrationEnabled) {
54
53
  return (0, _react.css)(_objectSpread({
55
54
  '& h1': {
@@ -73,6 +72,7 @@ var headingsSharedStyles = exports.headingsSharedStyles = function headingsShare
73
72
  },
74
73
  '& h5': {
75
74
  font: (0, _getEditorUgcToken.default)('editor.font.heading.h5', typographyTheme),
75
+ marginTop: '1.667em',
76
76
  textTransform: 'none'
77
77
  },
78
78
  '& h6': {
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.paragraphSharedStyles = void 0;
8
8
  var _react = require("@emotion/react");
9
9
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
10
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
10
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
11
  var _getEditorUgcToken = _interopRequireDefault(require("../../ugc-tokens/get-editor-ugc-token"));
12
12
  /* eslint-disable @atlaskit/ui-styling-standard/no-exported-styles */
13
13
  /* eslint-disable @atlaskit/design-system/use-tokens-typography */
@@ -17,7 +17,7 @@ var _getEditorUgcToken = _interopRequireDefault(require("../../ugc-tokens/get-ed
17
17
 
18
18
  // @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
19
19
  var paragraphSharedStyles = exports.paragraphSharedStyles = function paragraphSharedStyles(typographyTheme) {
20
- return (0, _experiments.editorExperiment)('typography_migration_ugc', true) ? (0, _react.css)({
20
+ return (0, _platformFeatureFlags.fg)('platform_editor_typography_ugc') ? (0, _react.css)({
21
21
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
22
22
  '& p': {
23
23
  font: (0, _getEditorUgcToken.default)('editor.font.body', typographyTheme),
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "94.4.0";
27
+ var packageVersion = "94.5.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -132,6 +132,10 @@ var DropList = /*#__PURE__*/function (_Component) {
132
132
  ref.focus();
133
133
  }
134
134
  });
135
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleDroplistRef", function (ref) {
136
+ var _this$props$onDroplis, _this$props;
137
+ (_this$props$onDroplis = (_this$props = _this.props).onDroplistRef) === null || _this$props$onDroplis === void 0 || _this$props$onDroplis.call(_this$props, ref);
138
+ });
135
139
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleTriggerRef", function (ref) {
136
140
  _this.triggerRef = ref;
137
141
  });
@@ -140,14 +144,14 @@ var DropList = /*#__PURE__*/function (_Component) {
140
144
  (0, _createClass2.default)(DropList, [{
141
145
  key: "render",
142
146
  value: function render() {
143
- var _this$props = this.props,
144
- children = _this$props.children,
145
- isOpen = _this$props.isOpen,
146
- position = _this$props.position,
147
- trigger = _this$props.trigger,
148
- onPositioned = _this$props.onPositioned,
149
- testId = _this$props.testId,
150
- id = _this$props.id;
147
+ var _this$props2 = this.props,
148
+ children = _this$props2.children,
149
+ isOpen = _this$props2.isOpen,
150
+ position = _this$props2.position,
151
+ trigger = _this$props2.trigger,
152
+ onPositioned = _this$props2.onPositioned,
153
+ testId = _this$props2.testId,
154
+ id = _this$props2.id;
151
155
  var layerContent = isOpen ? (0, _react2.jsx)("div", {
152
156
  css: this.menuWrapper,
153
157
  "data-role": "droplistContent",
@@ -157,7 +161,8 @@ var DropList = /*#__PURE__*/function (_Component) {
157
161
  role: "presentation"
158
162
  }, children) : null;
159
163
  return (0, _react2.jsx)("div", {
160
- css: this.wrapperStyles
164
+ css: this.wrapperStyles,
165
+ ref: this.handleDroplistRef
161
166
  }, (0, _react2.jsx)(_Layer.default, {
162
167
  content: layerContent,
163
168
  offset: dropOffset,
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _react = _interopRequireDefault(require("react"));
8
+ var _react = _interopRequireWildcard(require("react"));
9
9
  var _element = require("@atlaskit/emoji/element");
10
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
11
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
12
  var EmojiNodeFunctional = function EmojiNodeFunctional(props) {
11
13
  var _resourceConfig$optim;
12
14
  var allowTextFallback = props.allowTextFallback,
@@ -17,6 +19,16 @@ var EmojiNodeFunctional = function EmojiNodeFunctional(props) {
17
19
  showTooltip = props.showTooltip,
18
20
  resourceConfig = props.resourceConfig,
19
21
  emojiProvider = props.emojiProvider;
22
+ var emojiId = (0, _react.useMemo)(function () {
23
+ return {
24
+ shortName: shortName,
25
+ id: id,
26
+ fallback: fallback
27
+ };
28
+ }, [shortName, id, fallback]);
29
+ var emojiProviderResolver = (0, _react.useMemo)(function () {
30
+ return Promise.resolve(emojiProvider);
31
+ }, [emojiProvider]);
20
32
  if (allowTextFallback && !emojiProvider) {
21
33
  return /*#__PURE__*/_react.default.createElement("span", {
22
34
  "data-emoji-id": id,
@@ -28,12 +40,8 @@ var EmojiNodeFunctional = function EmojiNodeFunctional(props) {
28
40
  return null;
29
41
  }
30
42
  return /*#__PURE__*/_react.default.createElement(_element.ResourcedEmoji, {
31
- emojiId: {
32
- id: id,
33
- fallback: fallback,
34
- shortName: shortName
35
- },
36
- emojiProvider: Promise.resolve(emojiProvider),
43
+ emojiId: emojiId,
44
+ emojiProvider: emojiProviderResolver,
37
45
  showTooltip: showTooltip,
38
46
  fitToHeight: fitToHeight,
39
47
  optimistic: true,
@@ -48,4 +56,4 @@ var EmojiNodeFunctional = function EmojiNodeFunctional(props) {
48
56
  var EmojiNode = function EmojiNode(props) {
49
57
  return /*#__PURE__*/_react.default.createElement(EmojiNodeFunctional, props);
50
58
  };
51
- var _default = exports.default = EmojiNode;
59
+ var _default = exports.default = /*#__PURE__*/_react.default.memo(EmojiNode);
@@ -36,10 +36,13 @@ var Dropdown = exports.Dropdown = /*#__PURE__*/function (_PureComponent) {
36
36
  var _this;
37
37
  (0, _classCallCheck2.default)(this, Dropdown);
38
38
  _this = _super.call(this, props);
39
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleRef", function (target) {
40
- _this.setState({
41
- target: target || undefined
42
- });
39
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleRef", function (setOutsideClickTargetRef) {
40
+ return function (target) {
41
+ setOutsideClickTargetRef(target);
42
+ _this.setState({
43
+ target: target || undefined
44
+ });
45
+ };
43
46
  });
44
47
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updatePopupPlacement", function (placement) {
45
48
  _this.setState({
@@ -111,12 +114,15 @@ var Dropdown = exports.Dropdown = /*#__PURE__*/function (_PureComponent) {
111
114
  }, {
112
115
  key: "render",
113
116
  value: function render() {
117
+ var _this2 = this;
114
118
  var _this$props2 = this.props,
115
119
  trigger = _this$props2.trigger,
116
120
  isOpen = _this$props2.isOpen;
117
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
118
- ref: this.handleRef
119
- }, trigger), isOpen ? this.renderDropdown() : null);
121
+ return /*#__PURE__*/_react.default.createElement(_uiReact.OutsideClickTargetRefContext.Consumer, null, function (setOutsideClickTargetRef) {
122
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
123
+ ref: _this2.handleRef(setOutsideClickTargetRef)
124
+ }, trigger), isOpen ? _this2.renderDropdown() : null);
125
+ });
120
126
  }
121
127
  }]);
122
128
  return Dropdown;
@@ -10,7 +10,6 @@ exports.default = exports.DropdownMenuWithKeyboardNavigation = void 0;
10
10
  var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));
11
11
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
12
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
14
13
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
15
14
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
16
15
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
@@ -18,6 +17,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
18
17
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
18
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
20
19
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
20
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
21
21
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
22
22
  var _react = _interopRequireWildcard(require("react"));
23
23
  var _react2 = require("@emotion/react");
@@ -68,7 +68,13 @@ var buttonStyles = function buttonStyles(isActive, submenuActive) {
68
68
  return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t> span:hover[aria-disabled='false'] {\n\t\t\t\tcolor: ", ";\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\t\t\t", "\n\t\t\t> span[aria-disabled='true'] {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\t\t\t:focus > span[aria-disabled='false'] {\n\t\t\t\t", ";\n\t\t\t}\n\t\t\t:focus-visible,\n\t\t\t:focus-visible > span[aria-disabled='false'] {\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t"])), "var(--ds-text, #172B4D)", "var(--ds-background-neutral-subtle-hovered, rgb(244, 245, 247))", !submenuActive && "\n\t\t\t\t\t> span:active[aria-disabled='false'] {\n\t\t\t\t\t\tbackground-color: ".concat("var(--ds-background-neutral-subtle-pressed, rgb(179, 212, 255))", ";\n\t\t\t\t\t}"), "var(--ds-text-disabled, #091E424F)", focusedMenuItemStyle); // The default focus-visible style is removed to ensure consistency across browsers
69
69
  }
70
70
  };
71
- var DropListWithOutsideListeners = (0, _uiReact.withReactEditorViewOuterListeners)(_DropList.default);
71
+ var DropListWithOutsideClickTargetRef = function DropListWithOutsideClickTargetRef(props) {
72
+ var setOutsideClickTargetRef = _react.default.useContext(_uiReact.OutsideClickTargetRefContext);
73
+ return (0, _react2.jsx)(_DropList.default, (0, _extends2.default)({
74
+ onDroplistRef: setOutsideClickTargetRef
75
+ }, props));
76
+ };
77
+ var DropListWithOutsideListeners = (0, _uiReact.withReactEditorViewOuterListeners)(DropListWithOutsideClickTargetRef);
72
78
 
73
79
  /**
74
80
  * Wrapper around @atlaskit/droplist which uses Popup and Portal to render
@@ -315,7 +321,9 @@ function DropdownMenuItem(_ref) {
315
321
  // From time to time we don't want to have any tabIndex on item wrapper
316
322
  // especially when we pass any interactive element as a item.content
317
323
  var tabIndex = item.wrapperTabIndex === null ? undefined : item.wrapperTabIndex || -1;
318
- var dropListItem = (0, _react2.jsx)("div", {
324
+ var dropListItem =
325
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
326
+ (0, _react2.jsx)("div", {
319
327
  css: function css() {
320
328
  return buttonStyles(item.isActive, submenuActive);
321
329
  },
@@ -1,9 +1,16 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
8
+ Object.defineProperty(exports, "OutsideClickTargetRefContext", {
9
+ enumerable: true,
10
+ get: function get() {
11
+ return _withReactEditorViewOuterListeners.OutsideClickTargetRefContext;
12
+ }
13
+ });
7
14
  Object.defineProperty(exports, "ReactEditorViewContext", {
8
15
  enumerable: true,
9
16
  get: function get() {
@@ -17,4 +24,6 @@ Object.defineProperty(exports, "withReactEditorViewOuterListeners", {
17
24
  }
18
25
  });
19
26
  var _ReactEditorViewContext = _interopRequireDefault(require("./ReactEditorViewContext"));
20
- var _withReactEditorViewOuterListeners = _interopRequireDefault(require("./with-react-editor-view-outer-listeners"));
27
+ var _withReactEditorViewOuterListeners = _interopRequireWildcard(require("./with-react-editor-view-outer-listeners"));
28
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
29
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -5,6 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
+ exports.OutsideClickTargetRefContext = void 0;
8
9
  exports.default = withReactEditorViewOuterListeners;
9
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
@@ -17,13 +18,18 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
17
18
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
18
19
  var _react = _interopRequireWildcard(require("react"));
19
20
  var _reactDom = _interopRequireDefault(require("react-dom"));
21
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
22
  var _ReactEditorViewContext = _interopRequireDefault(require("./ReactEditorViewContext"));
21
23
  var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "closeOnTab"];
22
24
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
23
25
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
26
  function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
25
27
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
26
- // This needs exporting to be used alongisde `withReactEditorViewOuterListeners`
28
+ // Use this context to pass in the reference of the element that should be considered as the outside click target
29
+ // The outside click target is the element that should be clicked outside of to trigger the `handleClickOutside` event
30
+ var OutsideClickTargetRefContext = exports.OutsideClickTargetRefContext = /*#__PURE__*/_react.default.createContext(function () {});
31
+
32
+ // This needs exporting to be used alongside `withReactEditorViewOuterListeners`
27
33
  var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
28
34
  (0, _inherits2.default)(WithOutsideClick, _PureComponent);
29
35
  var _super = _createSuper(WithOutsideClick);
@@ -35,19 +41,17 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
35
41
  }
36
42
  _this = _super.call.apply(_super, [this].concat(args));
37
43
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleClick", function (evt) {
38
- if (!_this.props.isActiveComponent) {
44
+ if (!_this.props.isActiveComponent || !_this.props.handleClickOutside) {
39
45
  return;
40
46
  }
41
- var domNode = _reactDom.default.findDOMNode((0, _assertThisInitialized2.default)(_this)); // eslint-disable-line react/no-find-dom-node
47
+ var domNode = (0, _platformFeatureFlags.fg)('platform_editor_replace_finddomnode_in_common') ? _this.props.outsideClickTargetRef.current : _reactDom.default.findDOMNode((0, _assertThisInitialized2.default)(_this));
42
48
  if (!domNode || evt.target instanceof Node && !domNode.contains(evt.target)) {
43
- if (_this.props.handleClickOutside) {
44
- var _this$props$editorVie;
45
- _this.props.handleClickOutside(evt);
46
- // When the menus are closed by clicking outside the focus is set on editor.
47
- if (!((_this$props$editorVie = _this.props.editorView) !== null && _this$props$editorVie !== void 0 && _this$props$editorVie.hasFocus())) {
48
- var _this$props$editorVie2;
49
- (_this$props$editorVie2 = _this.props.editorView) === null || _this$props$editorVie2 === void 0 || _this$props$editorVie2.focus();
50
- }
49
+ var _this$props$editorVie;
50
+ _this.props.handleClickOutside(evt);
51
+ // When the menus are closed by clicking outside the focus is set on editor.
52
+ if (!((_this$props$editorVie = _this.props.editorView) !== null && _this$props$editorVie !== void 0 && _this$props$editorVie.hasFocus())) {
53
+ var _this$props$editorVie2;
54
+ (_this$props$editorVie2 = _this.props.editorView) === null || _this$props$editorVie2 === void 0 || _this$props$editorVie2.focus();
51
55
  }
52
56
  }
53
57
  });
@@ -116,6 +120,10 @@ function withReactEditorViewOuterListeners(Component) {
116
120
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
117
121
  isActiveComponent = _useState2[0],
118
122
  setActiveComponent = _useState2[1];
123
+ var outsideClickTargetRef = (0, _react.useRef)(null);
124
+ var setOutsideClickTargetRef = (0, _react.useCallback)(function (el) {
125
+ outsideClickTargetRef.current = el;
126
+ }, [outsideClickTargetRef]);
119
127
  (0, _react.useEffect)(function () {
120
128
  requestAnimationFrame(function () {
121
129
  setActiveComponent(isActiveProp);
@@ -125,17 +133,20 @@ function withReactEditorViewOuterListeners(Component) {
125
133
  var editorView = _ref2.editorView,
126
134
  popupsMountPoint = _ref2.popupsMountPoint,
127
135
  editorRef = _ref2.editorRef;
128
- return /*#__PURE__*/_react.default.createElement(WithOutsideClick, {
136
+ return /*#__PURE__*/_react.default.createElement(OutsideClickTargetRefContext.Provider, {
137
+ value: setOutsideClickTargetRef
138
+ }, /*#__PURE__*/_react.default.createElement(WithOutsideClick, {
129
139
  editorView: editorView,
130
140
  editorRef: editorRef,
131
141
  targetRef: props.targetRef,
142
+ outsideClickTargetRef: outsideClickTargetRef,
132
143
  popupsMountPoint: popupsMountPoint,
133
144
  isActiveComponent: isActiveComponent,
134
145
  handleClickOutside: handleClickOutside,
135
146
  handleEnterKeydown: handleEnterKeydown,
136
147
  handleEscapeKeydown: handleEscapeKeydown,
137
148
  closeOnTab: closeOnTab
138
- }, /*#__PURE__*/_react.default.createElement(Component, props));
149
+ }, /*#__PURE__*/_react.default.createElement(Component, props)));
139
150
  });
140
151
  };
141
152
  }
@@ -35,6 +35,7 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
35
35
  ACTION["DISMISSED"] = "dismissed";
36
36
  ACTION["DISPATCHED_INVALID_TRANSACTION"] = "dispatchedInvalidTransaction";
37
37
  ACTION["DISPATCHED_VALID_TRANSACTION"] = "dispatchedValidTransaction";
38
+ ACTION["DOUBLE_CLICKED"] = "doubleClicked";
38
39
  ACTION["DRAGGED"] = "dragged";
39
40
  ACTION["EDITED"] = "edited";
40
41
  ACTION["EDITOR_CRASHED"] = "unhandledErrorCaught";
@@ -180,6 +181,7 @@ export let INPUT_METHOD = /*#__PURE__*/function (INPUT_METHOD) {
180
181
  INPUT_METHOD["TABLE_CONTEXT_MENU"] = "tableContextMenu";
181
182
  INPUT_METHOD["MOUSE"] = "mouse";
182
183
  INPUT_METHOD["BROWSER"] = "browser";
184
+ INPUT_METHOD["DOUBLE_CLICK"] = "doubleClick";
183
185
  return INPUT_METHOD;
184
186
  }({});
185
187
  export let INSERT_MEDIA_VIA = /*#__PURE__*/function (INSERT_MEDIA_VIA) {
@@ -257,6 +259,7 @@ export let ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJECT) {
257
259
  ACTION_SUBJECT["CONTEXT_MENU"] = "contextMenu";
258
260
  ACTION_SUBJECT["INLINE_DIALOG"] = "inlineDialog";
259
261
  ACTION_SUBJECT["ENGAGEMENT_PLATFORM"] = "engagementPlatform";
262
+ ACTION_SUBJECT["MEDIA_VIEWER"] = "mediaViewer";
260
263
  return ACTION_SUBJECT;
261
264
  }({});
262
265
  export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
@@ -14,8 +14,8 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
14
14
  import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
15
15
  import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
16
16
  import { ButtonItem } from '@atlaskit/menu';
17
+ import { fg } from '@atlaskit/platform-feature-flags';
17
18
  import { Stack, Text } from '@atlaskit/primitives';
18
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
19
19
  import Tooltip from '@atlaskit/tooltip';
20
20
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '../../../analytics';
21
21
  import { IconFallback } from '../../../quick-insert';
@@ -287,7 +287,7 @@ const ItemContent = /*#__PURE__*/memo(({
287
287
  description,
288
288
  keyshortcut
289
289
  }) => {
290
- if (editorExperiment('typography_migration_ugc', true)) {
290
+ if (fg('platform_editor_typography_ugc')) {
291
291
  return (
292
292
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
293
293
  jsx("div", {
@@ -4,5 +4,10 @@ export const captionMessages = defineMessages({
4
4
  id: 'fabric.editor.captionPlaceholder',
5
5
  defaultMessage: 'Add a caption',
6
6
  description: 'Placeholder description for an empty (new) caption in the editor'
7
+ },
8
+ placeholderWithDoubleClickPrompt: {
9
+ id: 'fabric.editor.captionPlaceholderWithDoubleClickPrompt',
10
+ defaultMessage: 'Add a caption - double-click to preview',
11
+ description: 'Placeholder description to prompt users to add a caption and double click media to preview'
7
12
  }
8
13
  });
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "94.4.0";
4
+ const packageVersion = "94.5.0";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // TODO: Sanitise the URL instead of just removing it
@@ -6,7 +6,6 @@
6
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
7
  import { css } from '@emotion/react';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
10
9
  import editorUGCToken from '../../ugc-tokens/get-editor-ugc-token';
11
10
  const headingWithAlignmentStyles = () =>
12
11
  // Override marginTop: 0 with default margin found in headingsSharedStyles for first heading in alignment block that is not the first child
@@ -42,7 +41,7 @@ fg('platform_editor_heading_margin_fix') ? {
42
41
  // @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
43
42
  // text sizing prototype: http://proto/fabricrender/
44
43
  export const headingsSharedStyles = typographyTheme => {
45
- const isADSTokenMigrationEnabled = editorExperiment('typography_migration_ugc', true);
44
+ const isADSTokenMigrationEnabled = fg('platform_editor_typography_ugc');
46
45
  if (isADSTokenMigrationEnabled) {
47
46
  return css({
48
47
  '& h1': {
@@ -66,6 +65,7 @@ export const headingsSharedStyles = typographyTheme => {
66
65
  },
67
66
  '& h5': {
68
67
  font: editorUGCToken('editor.font.heading.h5', typographyTheme),
68
+ marginTop: '1.667em',
69
69
  textTransform: 'none'
70
70
  },
71
71
  '& h6': {
@@ -5,12 +5,12 @@
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
6
  import { css } from '@emotion/react';
7
7
  import { akEditorLineHeight, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
8
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
9
9
  import editorUGCToken from '../../ugc-tokens/get-editor-ugc-token';
10
10
 
11
11
  // @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
12
12
  export const paragraphSharedStyles = typographyTheme => {
13
- return editorExperiment('typography_migration_ugc', true) ? css({
13
+ return fg('platform_editor_typography_ugc') ? css({
14
14
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
15
15
  '& p': {
16
16
  font: editorUGCToken('editor.font.body', typographyTheme),
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "94.4.0";
16
+ const packageVersion = "94.5.0";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  class DropList extends Component {
@@ -117,6 +117,10 @@ class DropList extends Component {
117
117
  ref.focus();
118
118
  }
119
119
  });
120
+ _defineProperty(this, "handleDroplistRef", ref => {
121
+ var _this$props$onDroplis, _this$props;
122
+ (_this$props$onDroplis = (_this$props = this.props).onDroplistRef) === null || _this$props$onDroplis === void 0 ? void 0 : _this$props$onDroplis.call(_this$props, ref);
123
+ });
120
124
  _defineProperty(this, "handleTriggerRef", ref => {
121
125
  this.triggerRef = ref;
122
126
  });
@@ -140,7 +144,8 @@ class DropList extends Component {
140
144
  role: "presentation"
141
145
  }, children) : null;
142
146
  return jsx("div", {
143
- css: this.wrapperStyles
147
+ css: this.wrapperStyles,
148
+ ref: this.handleDroplistRef
144
149
  }, jsx(Layer, {
145
150
  content: layerContent,
146
151
  offset: dropOffset,
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useMemo } from 'react';
2
2
  import { ResourcedEmoji } from '@atlaskit/emoji/element';
3
3
  const EmojiNodeFunctional = props => {
4
4
  var _resourceConfig$optim;
@@ -12,6 +12,12 @@ const EmojiNodeFunctional = props => {
12
12
  resourceConfig,
13
13
  emojiProvider
14
14
  } = props;
15
+ const emojiId = useMemo(() => ({
16
+ shortName,
17
+ id,
18
+ fallback
19
+ }), [shortName, id, fallback]);
20
+ const emojiProviderResolver = useMemo(() => Promise.resolve(emojiProvider), [emojiProvider]);
15
21
  if (allowTextFallback && !emojiProvider) {
16
22
  return /*#__PURE__*/React.createElement("span", {
17
23
  "data-emoji-id": id,
@@ -23,12 +29,8 @@ const EmojiNodeFunctional = props => {
23
29
  return null;
24
30
  }
25
31
  return /*#__PURE__*/React.createElement(ResourcedEmoji, {
26
- emojiId: {
27
- id,
28
- fallback,
29
- shortName
30
- },
31
- emojiProvider: Promise.resolve(emojiProvider),
32
+ emojiId: emojiId,
33
+ emojiProvider: emojiProviderResolver,
32
34
  showTooltip: showTooltip,
33
35
  fitToHeight: fitToHeight,
34
36
  optimistic: true,
@@ -43,4 +45,4 @@ const EmojiNodeFunctional = props => {
43
45
  const EmojiNode = props => {
44
46
  return /*#__PURE__*/React.createElement(EmojiNodeFunctional, props);
45
47
  };
46
- export default EmojiNode;
48
+ export default /*#__PURE__*/React.memo(EmojiNode);