@atlaskit/editor-plugin-expand 2.9.4 → 2.9.5

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,15 @@
1
1
  # @atlaskit/editor-plugin-expand
2
2
 
3
+ ## 2.9.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#159926](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/159926)
8
+ [`f60e3e772ea72`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f60e3e772ea72) -
9
+ Add null check to fix crash in legacy toolbar while swapping ebetween view and edit mode in love
10
+ pages
11
+ - Updated dependencies
12
+
3
13
  ## 2.9.4
4
14
 
5
15
  ### Patch Changes
@@ -12,13 +12,16 @@ var _commands = require("./commands");
12
12
  var _pluginFactory = require("./pm-plugins/plugin-factory");
13
13
  var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(api) {
14
14
  return function (state, _ref) {
15
- var _api$decorations$acti, _api$decorations, _api$analytics;
15
+ var _api$decorations$acti, _api$decorations, _api$analytics, _getPluginState;
16
16
  var formatMessage = _ref.formatMessage;
17
17
  var _ref2 = (_api$decorations$acti = api === null || api === void 0 || (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions) !== null && _api$decorations$acti !== void 0 ? _api$decorations$acti : {},
18
18
  hoverDecoration = _ref2.hoverDecoration;
19
19
  var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
20
- var _getPluginState = (0, _pluginFactory.getPluginState)(state),
21
- expandRef = _getPluginState.expandRef;
20
+ // JST-1060364: We are observing this crashing the editor where the `expandPlugin` doesn't exist
21
+ // in the editor (resulting in `Cannot destructure property 'expandRef' of ...`).
22
+ // For now let's add a null check to ensure we don't crash while we investigate further.
23
+ var _ref3 = (_getPluginState = (0, _pluginFactory.getPluginState)(state)) !== null && _getPluginState !== void 0 ? _getPluginState : {},
24
+ expandRef = _ref3.expandRef;
22
25
  if (expandRef) {
23
26
  var _state$schema$nodes = state.schema.nodes,
24
27
  nestedExpand = _state$schema$nodes.nestedExpand,
@@ -6,14 +6,17 @@ import { getPluginState } from './pm-plugins/plugin-factory';
6
6
  export const getToolbarConfig = api => (state, {
7
7
  formatMessage
8
8
  }) => {
9
- var _api$decorations$acti, _api$decorations, _api$analytics;
9
+ var _api$decorations$acti, _api$decorations, _api$analytics, _getPluginState;
10
10
  const {
11
11
  hoverDecoration
12
12
  } = (_api$decorations$acti = api === null || api === void 0 ? void 0 : (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions) !== null && _api$decorations$acti !== void 0 ? _api$decorations$acti : {};
13
13
  const editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
14
+ // JST-1060364: We are observing this crashing the editor where the `expandPlugin` doesn't exist
15
+ // in the editor (resulting in `Cannot destructure property 'expandRef' of ...`).
16
+ // For now let's add a null check to ensure we don't crash while we investigate further.
14
17
  const {
15
18
  expandRef
16
- } = getPluginState(state);
19
+ } = (_getPluginState = getPluginState(state)) !== null && _getPluginState !== void 0 ? _getPluginState : {};
17
20
  if (expandRef) {
18
21
  const {
19
22
  nestedExpand,
@@ -5,13 +5,16 @@ import { deleteExpand } from './commands';
5
5
  import { getPluginState } from './pm-plugins/plugin-factory';
6
6
  export var getToolbarConfig = function getToolbarConfig(api) {
7
7
  return function (state, _ref) {
8
- var _api$decorations$acti, _api$decorations, _api$analytics;
8
+ var _api$decorations$acti, _api$decorations, _api$analytics, _getPluginState;
9
9
  var formatMessage = _ref.formatMessage;
10
10
  var _ref2 = (_api$decorations$acti = api === null || api === void 0 || (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions) !== null && _api$decorations$acti !== void 0 ? _api$decorations$acti : {},
11
11
  hoverDecoration = _ref2.hoverDecoration;
12
12
  var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
13
- var _getPluginState = getPluginState(state),
14
- expandRef = _getPluginState.expandRef;
13
+ // JST-1060364: We are observing this crashing the editor where the `expandPlugin` doesn't exist
14
+ // in the editor (resulting in `Cannot destructure property 'expandRef' of ...`).
15
+ // For now let's add a null check to ensure we don't crash while we investigate further.
16
+ var _ref3 = (_getPluginState = getPluginState(state)) !== null && _getPluginState !== void 0 ? _getPluginState : {},
17
+ expandRef = _ref3.expandRef;
15
18
  if (expandRef) {
16
19
  var _state$schema$nodes = state.schema.nodes,
17
20
  nestedExpand = _state$schema$nodes.nestedExpand,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-expand",
3
- "version": "2.9.4",
3
+ "version": "2.9.5",
4
4
  "description": "Expand plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^44.2.0",
35
35
  "@atlaskit/button": "^20.3.0",
36
- "@atlaskit/editor-common": "^94.11.0",
36
+ "@atlaskit/editor-common": "^94.12.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
38
38
  "@atlaskit/editor-plugin-decorations": "^1.3.0",
39
39
  "@atlaskit/editor-plugin-editor-disabled": "^1.3.0",