@atlaskit/editor-plugin-grid 5.0.0 → 6.0.1

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,19 @@
1
1
  # @atlaskit/editor-plugin-grid
2
2
 
3
+ ## 6.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`49d845e4c0ec3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/49d845e4c0ec3) -
8
+ ED-29167: fix grid hydration
9
+ - Updated dependencies
10
+
11
+ ## 6.0.0
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 5.0.0
4
18
 
5
19
  ### Patch Changes
@@ -10,10 +10,12 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _react2 = require("@emotion/react");
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
+ var _coreUtils = require("@atlaskit/editor-common/core-utils");
13
14
  var _hooks = require("@atlaskit/editor-common/hooks");
14
15
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
15
16
  var _state = require("@atlaskit/editor-prosemirror/state");
16
17
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
18
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
17
19
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
18
20
 
19
21
  var GRID_SIZE = exports.GRID_SIZE = 12;
@@ -201,6 +203,12 @@ var gridPlugin = exports.gridPlugin = function gridPlugin(_ref5) {
201
203
  },
202
204
  contentComponent: function contentComponent(_ref6) {
203
205
  var editorView = _ref6.editorView;
206
+ if (!editorView) {
207
+ return null;
208
+ }
209
+ if ((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) && (0, _coreUtils.isSSR)()) {
210
+ return null;
211
+ }
204
212
  return /*#__PURE__*/_react.default.createElement(ContentComponent, {
205
213
  editorView: editorView,
206
214
  options: options,
@@ -3,10 +3,12 @@ import React from 'react';
3
3
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
4
  import { withTheme } from '@emotion/react';
5
5
  import classnames from 'classnames';
6
+ import { isSSR } from '@atlaskit/editor-common/core-utils';
6
7
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
7
8
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
8
9
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
9
10
  import { akEditorBreakoutPadding, akEditorFullPageMaxWidth, breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles';
11
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
12
  export const GRID_SIZE = 12;
11
13
  const key = new PluginKey('gridPlugin');
12
14
  const createDisplayGrid = view => props => {
@@ -195,10 +197,18 @@ export const gridPlugin = ({
195
197
  },
196
198
  contentComponent: ({
197
199
  editorView
198
- }) => /*#__PURE__*/React.createElement(ContentComponent, {
199
- editorView: editorView,
200
- options: options,
201
- api: api
202
- })
200
+ }) => {
201
+ if (!editorView) {
202
+ return null;
203
+ }
204
+ if (expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) && isSSR()) {
205
+ return null;
206
+ }
207
+ return /*#__PURE__*/React.createElement(ContentComponent, {
208
+ editorView: editorView,
209
+ options: options,
210
+ api: api
211
+ });
212
+ }
203
213
  };
204
214
  };
@@ -5,10 +5,12 @@ import React from 'react';
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
6
  import { withTheme } from '@emotion/react';
7
7
  import classnames from 'classnames';
8
+ import { isSSR } from '@atlaskit/editor-common/core-utils';
8
9
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
9
10
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
10
11
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
11
12
  import { akEditorBreakoutPadding, akEditorFullPageMaxWidth, breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles';
13
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
14
  export var GRID_SIZE = 12;
13
15
  var key = new PluginKey('gridPlugin');
14
16
  var createDisplayGrid = function createDisplayGrid(view) {
@@ -194,6 +196,12 @@ export var gridPlugin = function gridPlugin(_ref5) {
194
196
  },
195
197
  contentComponent: function contentComponent(_ref6) {
196
198
  var editorView = _ref6.editorView;
199
+ if (!editorView) {
200
+ return null;
201
+ }
202
+ if (expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) && isSSR()) {
203
+ return null;
204
+ }
197
205
  return /*#__PURE__*/React.createElement(ContentComponent, {
198
206
  editorView: editorView,
199
207
  options: options,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-grid",
3
- "version": "5.0.0",
3
+ "version": "6.0.1",
4
4
  "description": "Grid plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -21,15 +21,16 @@
21
21
  ],
22
22
  "atlaskit:src": "src/index.ts",
23
23
  "dependencies": {
24
- "@atlaskit/editor-plugin-width": "^6.0.0",
24
+ "@atlaskit/editor-plugin-width": "^7.0.0",
25
25
  "@atlaskit/editor-prosemirror": "7.0.0",
26
26
  "@atlaskit/editor-shared-styles": "^3.6.0",
27
+ "@atlaskit/tmp-editor-statsig": "^12.32.0",
27
28
  "@babel/runtime": "^7.0.0",
28
29
  "@emotion/react": "^11.7.1",
29
30
  "classnames": "^2.2.5"
30
31
  },
31
32
  "peerDependencies": {
32
- "@atlaskit/editor-common": "^109.0.0",
33
+ "@atlaskit/editor-common": "^110.4.0",
33
34
  "react": "^18.2.0",
34
35
  "react-dom": "^18.2.0"
35
36
  },