@atlaskit/editor-plugin-text-formatting 0.4.9 → 0.4.11

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,17 @@
1
1
  # @atlaskit/editor-plugin-text-formatting
2
2
 
3
+ ## 0.4.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [#42770](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42770) [`c7a6a824958`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c7a6a824958) - Extract code-block plugin from editor-core as `@atlaskit/editor-plugin-code-block`.
8
+
9
+ ## 0.4.10
10
+
11
+ ### Patch Changes
12
+
13
+ - [#42570](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42570) [`d7ff4d590d7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d7ff4d590d7) - ED-20023: Adding check for undefined item in dropdown menu
14
+
3
15
  ## 0.4.9
4
16
 
5
17
  ### Patch Changes
@@ -41,9 +41,11 @@ var FormattingTextDropdownMenu = exports.FormattingTextDropdownMenu = /*#__PURE_
41
41
  var item = _ref2.item,
42
42
  _ref2$shouldCloseMenu = _ref2.shouldCloseMenu,
43
43
  shouldCloseMenu = _ref2$shouldCloseMenu === void 0 ? true : _ref2$shouldCloseMenu;
44
- item.command(editorView.state, editorView.dispatch);
45
- if (shouldCloseMenu) {
46
- closeMenu();
44
+ if (item) {
45
+ item.command(editorView.state, editorView.dispatch);
46
+ if (shouldCloseMenu) {
47
+ closeMenu();
48
+ }
47
49
  }
48
50
  }, [editorView.state, editorView.dispatch, closeMenu]);
49
51
  return /*#__PURE__*/_react.default.createElement(_uiMenu.DropdownMenuWithKeyboardNavigation, {
@@ -22,9 +22,11 @@ export const FormattingTextDropdownMenu = /*#__PURE__*/React.memo(({
22
22
  item,
23
23
  shouldCloseMenu = true
24
24
  }) => {
25
- item.command(editorView.state, editorView.dispatch);
26
- if (shouldCloseMenu) {
27
- closeMenu();
25
+ if (item) {
26
+ item.command(editorView.state, editorView.dispatch);
27
+ if (shouldCloseMenu) {
28
+ closeMenu();
29
+ }
28
30
  }
29
31
  }, [editorView.state, editorView.dispatch, closeMenu]);
30
32
  return /*#__PURE__*/React.createElement(DropdownMenu, {
@@ -31,9 +31,11 @@ export var FormattingTextDropdownMenu = /*#__PURE__*/React.memo(function (_ref)
31
31
  var item = _ref2.item,
32
32
  _ref2$shouldCloseMenu = _ref2.shouldCloseMenu,
33
33
  shouldCloseMenu = _ref2$shouldCloseMenu === void 0 ? true : _ref2$shouldCloseMenu;
34
- item.command(editorView.state, editorView.dispatch);
35
- if (shouldCloseMenu) {
36
- closeMenu();
34
+ if (item) {
35
+ item.command(editorView.state, editorView.dispatch);
36
+ if (shouldCloseMenu) {
37
+ closeMenu();
38
+ }
37
39
  }
38
40
  }, [editorView.state, editorView.dispatch, closeMenu]);
39
41
  return /*#__PURE__*/React.createElement(DropdownMenu, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-text-formatting",
3
- "version": "0.4.9",
3
+ "version": "0.4.11",
4
4
  "description": "Text-formatting plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^32.0.0",
35
- "@atlaskit/editor-common": "^76.17.0",
35
+ "@atlaskit/editor-common": "^76.18.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^0.3.0",
37
37
  "@atlaskit/editor-prosemirror": "1.1.0",
38
38
  "@atlaskit/editor-shared-styles": "^2.8.0",