@atlaskit/editor-plugin-block-controls 11.3.0 → 11.3.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,14 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 11.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4c22fe79f104e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4c22fe79f104e) -
8
+ Guard against undefined plugin state when reading shared state in floating-toolbar handler
9
+ (layout) and useEffect deps array (block-controls drag handle); fixes intermittent crash during
10
+ editor reconfigure / partial-preset transitions.
11
+
3
12
  ## 11.3.0
4
13
 
5
14
  ### Minor Changes
@@ -340,7 +340,7 @@ var getNodeMargins = function getNodeMargins(node) {
340
340
  return _consts2.nodeMargins[nodeTypeName] || _consts2.nodeMargins['default'];
341
341
  };
342
342
  var DragHandle = exports.DragHandle = function DragHandle(_ref) {
343
- var _api$core4;
343
+ var _api$core4, _api$blockControls8;
344
344
  var view = _ref.view,
345
345
  api = _ref.api,
346
346
  formatMessage = _ref.formatMessage,
@@ -900,7 +900,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
900
900
  } else {
901
901
  setDragHandleDisabled(false);
902
902
  }
903
- }, [api === null || api === void 0 ? void 0 : api.blockControls.sharedState, isShiftDown, isTopLevelNodeValue, view]);
903
+ }, [api === null || api === void 0 || (_api$blockControls8 = api.blockControls) === null || _api$blockControls8 === void 0 ? void 0 : _api$blockControls8.sharedState, isShiftDown, isTopLevelNodeValue, view]);
904
904
  var dragHandleMessage = (0, _experiments.editorExperiment)('platform_editor_block_menu', true) ? formatMessage(_messages.blockControlsMessages.dragToMoveClickToOpen, {
905
905
  br: (0, _react2.jsx)("br", null)
906
906
  }) : formatMessage(_messages.blockControlsMessages.dragToMove);
@@ -344,7 +344,7 @@ export const DragHandle = ({
344
344
  isTopLevelNode = true,
345
345
  anchorRectCache
346
346
  }) => {
347
- var _api$core4;
347
+ var _api$core4, _api$blockControls8;
348
348
  const buttonRef = useRef(null);
349
349
  const mouseDownRef = useRef(false);
350
350
  const [dragHandleSelected, setDragHandleSelected] = useState(false);
@@ -882,7 +882,7 @@ export const DragHandle = ({
882
882
  } else {
883
883
  setDragHandleDisabled(false);
884
884
  }
885
- }, [api === null || api === void 0 ? void 0 : api.blockControls.sharedState, isShiftDown, isTopLevelNodeValue, view]);
885
+ }, [api === null || api === void 0 ? void 0 : (_api$blockControls8 = api.blockControls) === null || _api$blockControls8 === void 0 ? void 0 : _api$blockControls8.sharedState, isShiftDown, isTopLevelNodeValue, view]);
886
886
  const dragHandleMessage = editorExperiment('platform_editor_block_menu', true) ? formatMessage(blockControlsMessages.dragToMoveClickToOpen, {
887
887
  br: jsx("br", null)
888
888
  }) : formatMessage(blockControlsMessages.dragToMove);
@@ -336,7 +336,7 @@ var getNodeMargins = function getNodeMargins(node) {
336
336
  return nodeMargins[nodeTypeName] || nodeMargins['default'];
337
337
  };
338
338
  export var DragHandle = function DragHandle(_ref) {
339
- var _api$core4;
339
+ var _api$core4, _api$blockControls8;
340
340
  var view = _ref.view,
341
341
  api = _ref.api,
342
342
  formatMessage = _ref.formatMessage,
@@ -896,7 +896,7 @@ export var DragHandle = function DragHandle(_ref) {
896
896
  } else {
897
897
  setDragHandleDisabled(false);
898
898
  }
899
- }, [api === null || api === void 0 ? void 0 : api.blockControls.sharedState, isShiftDown, isTopLevelNodeValue, view]);
899
+ }, [api === null || api === void 0 || (_api$blockControls8 = api.blockControls) === null || _api$blockControls8 === void 0 ? void 0 : _api$blockControls8.sharedState, isShiftDown, isTopLevelNodeValue, view]);
900
900
  var dragHandleMessage = editorExperiment('platform_editor_block_menu', true) ? formatMessage(blockControlsMessages.dragToMoveClickToOpen, {
901
901
  br: jsx("br", null)
902
902
  }) : formatMessage(blockControlsMessages.dragToMove);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "11.3.0",
3
+ "version": "11.3.1",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -56,7 +56,7 @@
56
56
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
57
57
  "@atlaskit/primitives": "^19.0.0",
58
58
  "@atlaskit/theme": "^23.2.0",
59
- "@atlaskit/tmp-editor-statsig": "^80.0.0",
59
+ "@atlaskit/tmp-editor-statsig": "^80.1.0",
60
60
  "@atlaskit/tokens": "^13.0.0",
61
61
  "@atlaskit/tooltip": "^22.2.0",
62
62
  "@babel/runtime": "^7.0.0",