@atlaskit/editor-plugin-emoji 3.5.2 → 3.5.4

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,23 @@
1
1
  # @atlaskit/editor-plugin-emoji
2
2
 
3
+ ## 3.5.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#138298](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/138298)
8
+ [`cc7cc96e28407`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cc7cc96e28407) -
9
+ Cleans up FG to preload emoji picker, allowing it to work offline
10
+ - Updated dependencies
11
+
12
+ ## 3.5.3
13
+
14
+ ### Patch Changes
15
+
16
+ - [#137646](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/137646)
17
+ [`7513743b76e0f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7513743b76e0f) -
18
+ [https://product-fabric.atlassian.net/browse/ED-27459](ED-27459) - fix vanilla js emoji SSR
19
+ rendering issue
20
+
3
21
  ## 3.5.2
4
22
 
5
23
  ### Patch Changes
@@ -238,9 +238,7 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
238
238
  usePluginHook: function usePluginHook() {
239
239
  (0, _react.useEffect)(function () {
240
240
  delayUntilIdle(function () {
241
- if ((0, _platformFeatureFlags.fg)('platform_editor_preload_emoji_picker')) {
242
- (0, _emoji2.preloadEmojiPicker)();
243
- }
241
+ (0, _emoji2.preloadEmojiPicker)();
244
242
  });
245
243
  }, []);
246
244
  },
@@ -344,7 +342,7 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
344
342
  description: formatMessage(_messages.toolbarInsertBlockMessages.emojiDescription),
345
343
  priority: 500,
346
344
  keyshortcut: ':',
347
- isDisabledOffline: (0, _platformFeatureFlags.fg)('platform_editor_preload_emoji_picker') ? false : true,
345
+ isDisabledOffline: false,
348
346
  icon: function icon() {
349
347
  return /*#__PURE__*/_react.default.createElement(_quickInsert.IconEmoji, null);
350
348
  },
@@ -10,6 +10,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
10
10
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
11
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
12
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
+ var _coreUtils = require("@atlaskit/editor-common/core-utils");
13
14
  var _emoji = require("@atlaskit/editor-common/emoji");
14
15
  var _monitoring = require("@atlaskit/editor-common/monitoring");
15
16
  var _model = require("@atlaskit/editor-prosemirror/model");
@@ -36,6 +37,12 @@ var EmojiNodeView = exports.EmojiNodeView = /*#__PURE__*/function () {
36
37
  throw new Error('DOMSerializer.renderSpec() did not return HTMLElement');
37
38
  }
38
39
  this.dom = dom;
40
+ if ((0, _coreUtils.isSSR)()) {
41
+ // The provider doesn't work in SSR, and we don't want to render fallback in SSR,
42
+ // that's why we don't need to continue node rendering.
43
+ // In SSR we want to show a placeholder, that `emojiToDom()` returns.
44
+ return;
45
+ }
39
46
 
40
47
  // We use the `emojiProvider` from the shared state
41
48
  // because it supports the `emojiProvider` prop in the `ComposableEditor` options
@@ -219,9 +219,7 @@ export const emojiPlugin = ({
219
219
  usePluginHook() {
220
220
  useEffect(() => {
221
221
  delayUntilIdle(() => {
222
- if (fg('platform_editor_preload_emoji_picker')) {
223
- preloadEmojiPicker();
224
- }
222
+ preloadEmojiPicker();
225
223
  });
226
224
  }, []);
227
225
  },
@@ -307,7 +305,7 @@ export const emojiPlugin = ({
307
305
  description: formatMessage(messages.emojiDescription),
308
306
  priority: 500,
309
307
  keyshortcut: ':',
310
- isDisabledOffline: fg('platform_editor_preload_emoji_picker') ? false : true,
308
+ isDisabledOffline: false,
311
309
  icon: () => /*#__PURE__*/React.createElement(IconEmoji, null),
312
310
  action(insert) {
313
311
  var _api$typeAhead;
@@ -1,4 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import { isSSR } from '@atlaskit/editor-common/core-utils';
2
3
  import { messages, EmojiSharedCssClassName, defaultEmojiHeight } from '@atlaskit/editor-common/emoji';
3
4
  import { logException } from '@atlaskit/editor-common/monitoring';
4
5
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
@@ -30,6 +31,12 @@ export class EmojiNodeView {
30
31
  throw new Error('DOMSerializer.renderSpec() did not return HTMLElement');
31
32
  }
32
33
  this.dom = dom;
34
+ if (isSSR()) {
35
+ // The provider doesn't work in SSR, and we don't want to render fallback in SSR,
36
+ // that's why we don't need to continue node rendering.
37
+ // In SSR we want to show a placeholder, that `emojiToDom()` returns.
38
+ return;
39
+ }
33
40
 
34
41
  // We use the `emojiProvider` from the shared state
35
42
  // because it supports the `emojiProvider` prop in the `ComposableEditor` options
@@ -223,9 +223,7 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
223
223
  usePluginHook: function usePluginHook() {
224
224
  useEffect(function () {
225
225
  delayUntilIdle(function () {
226
- if (fg('platform_editor_preload_emoji_picker')) {
227
- preloadEmojiPicker();
228
- }
226
+ preloadEmojiPicker();
229
227
  });
230
228
  }, []);
231
229
  },
@@ -329,7 +327,7 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
329
327
  description: formatMessage(messages.emojiDescription),
330
328
  priority: 500,
331
329
  keyshortcut: ':',
332
- isDisabledOffline: fg('platform_editor_preload_emoji_picker') ? false : true,
330
+ isDisabledOffline: false,
333
331
  icon: function icon() {
334
332
  return /*#__PURE__*/React.createElement(IconEmoji, null);
335
333
  },
@@ -3,6 +3,7 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/createClass";
4
4
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
5
  import _regeneratorRuntime from "@babel/runtime/regenerator";
6
+ import { isSSR } from '@atlaskit/editor-common/core-utils';
6
7
  import { messages, EmojiSharedCssClassName, defaultEmojiHeight } from '@atlaskit/editor-common/emoji';
7
8
  import { logException } from '@atlaskit/editor-common/monitoring';
8
9
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
@@ -29,6 +30,12 @@ export var EmojiNodeView = /*#__PURE__*/function () {
29
30
  throw new Error('DOMSerializer.renderSpec() did not return HTMLElement');
30
31
  }
31
32
  this.dom = dom;
33
+ if (isSSR()) {
34
+ // The provider doesn't work in SSR, and we don't want to render fallback in SSR,
35
+ // that's why we don't need to continue node rendering.
36
+ // In SSR we want to show a placeholder, that `emojiToDom()` returns.
37
+ return;
38
+ }
32
39
 
33
40
  // We use the `emojiProvider` from the shared state
34
41
  // because it supports the `emojiProvider` prop in the `ComposableEditor` options
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-emoji",
3
- "version": "3.5.2",
3
+ "version": "3.5.4",
4
4
  "description": "Emoji plugin for @atlaskit/editor-core",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -109,9 +109,6 @@
109
109
  "platform-feature-flags": {
110
110
  "editor_inline_comments_paste_insert_nodes": {
111
111
  "type": "boolean"
112
- },
113
- "platform_editor_preload_emoji_picker": {
114
- "type": "boolean"
115
112
  }
116
113
  }
117
114
  }