@atlaskit/editor-plugin-expand 7.4.10 → 7.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,13 @@
1
1
  # @atlaskit/editor-plugin-expand
2
2
 
3
+ ## 7.4.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [`bd911d5eca1cb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bd911d5eca1cb) -
8
+ Use new transfromNode command in existing block menu items. Update transformNode analytics type.
9
+ - Updated dependencies
10
+
3
11
  ## 7.4.10
4
12
 
5
13
  ### Patch Changes
@@ -31,13 +31,20 @@ var ExpandBlockMenuItem = function ExpandBlockMenuItem(_ref) {
31
31
  return false;
32
32
  }, [selection]);
33
33
  var handleClick = function handleClick(event) {
34
- var _api$blockMenu;
35
34
  var triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ? _analytics.INPUT_METHOD.KEYBOARD : _analytics.INPUT_METHOD.MOUSE;
36
35
  var inputMethod = _analytics.INPUT_METHOD.BLOCK_MENU;
37
- api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode(nodeName, {
38
- inputMethod: inputMethod,
39
- triggeredFrom: triggeredFrom
40
- }));
36
+ api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
37
+ var _api$blockMenu;
38
+ var tr = _ref2.tr;
39
+ var command = api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.expand, {
40
+ inputMethod: inputMethod,
41
+ triggeredFrom: triggeredFrom,
42
+ targetTypeName: nodeName
43
+ });
44
+ return command ? command({
45
+ tr: tr
46
+ }) : null;
47
+ });
41
48
  };
42
49
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
43
50
  onClick: handleClick,
@@ -24,13 +24,21 @@ const ExpandBlockMenuItem = ({
24
24
  return false;
25
25
  }, [selection]);
26
26
  const handleClick = event => {
27
- var _api$blockMenu;
28
27
  const triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ? INPUT_METHOD.KEYBOARD : INPUT_METHOD.MOUSE;
29
28
  const inputMethod = INPUT_METHOD.BLOCK_MENU;
30
- api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode(nodeName, {
31
- inputMethod,
32
- triggeredFrom
33
- }));
29
+ api === null || api === void 0 ? void 0 : api.core.actions.execute(({
30
+ tr
31
+ }) => {
32
+ var _api$blockMenu;
33
+ const command = api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.expand, {
34
+ inputMethod,
35
+ triggeredFrom,
36
+ targetTypeName: nodeName
37
+ });
38
+ return command ? command({
39
+ tr
40
+ }) : null;
41
+ });
34
42
  };
35
43
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
36
44
  onClick: handleClick,
@@ -22,13 +22,20 @@ var ExpandBlockMenuItem = function ExpandBlockMenuItem(_ref) {
22
22
  return false;
23
23
  }, [selection]);
24
24
  var handleClick = function handleClick(event) {
25
- var _api$blockMenu;
26
25
  var triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ? INPUT_METHOD.KEYBOARD : INPUT_METHOD.MOUSE;
27
26
  var inputMethod = INPUT_METHOD.BLOCK_MENU;
28
- api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode(nodeName, {
29
- inputMethod: inputMethod,
30
- triggeredFrom: triggeredFrom
31
- }));
27
+ api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
28
+ var _api$blockMenu;
29
+ var tr = _ref2.tr;
30
+ var command = api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.expand, {
31
+ inputMethod: inputMethod,
32
+ triggeredFrom: triggeredFrom,
33
+ targetTypeName: nodeName
34
+ });
35
+ return command ? command({
36
+ tr: tr
37
+ }) : null;
38
+ });
32
39
  };
33
40
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
34
41
  onClick: handleClick,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-expand",
3
- "version": "7.4.10",
3
+ "version": "7.4.11",
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
  "@atlaskit/browser-apis": "^0.0.1",
34
34
  "@atlaskit/button": "^23.6.0",
35
35
  "@atlaskit/editor-plugin-analytics": "^6.2.0",
36
- "@atlaskit/editor-plugin-block-menu": "^5.0.0",
36
+ "@atlaskit/editor-plugin-block-menu": "^5.1.0",
37
37
  "@atlaskit/editor-plugin-decorations": "^6.1.0",
38
38
  "@atlaskit/editor-plugin-editor-disabled": "^6.1.0",
39
39
  "@atlaskit/editor-plugin-editor-viewmode": "^8.0.0",
@@ -48,7 +48,7 @@
48
48
  "@atlaskit/icon-lab": "^5.12.0",
49
49
  "@atlaskit/platform-feature-flags": "^1.1.0",
50
50
  "@atlaskit/prosemirror-history": "^0.2.0",
51
- "@atlaskit/tmp-editor-statsig": "^14.1.0",
51
+ "@atlaskit/tmp-editor-statsig": "^14.2.0",
52
52
  "@atlaskit/tokens": "^8.4.0",
53
53
  "@atlaskit/tooltip": "^20.10.0",
54
54
  "@babel/runtime": "^7.0.0",