@atlaskit/editor-plugin-emoji 3.5.2 → 3.5.3

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,14 @@
1
1
  # @atlaskit/editor-plugin-emoji
2
2
 
3
+ ## 3.5.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#137646](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/137646)
8
+ [`7513743b76e0f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7513743b76e0f) -
9
+ [https://product-fabric.atlassian.net/browse/ED-27459](ED-27459) - fix vanilla js emoji SSR
10
+ rendering issue
11
+
3
12
  ## 3.5.2
4
13
 
5
14
  ### Patch Changes
@@ -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
@@ -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
@@ -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.3",
4
4
  "description": "Emoji plugin for @atlaskit/editor-core",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"