@atlaskit/editor-plugin-layout 6.2.9 → 6.2.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,19 @@
1
1
  # @atlaskit/editor-plugin-layout
2
2
 
3
+ ## 6.2.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
+
11
+ ## 6.2.10
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 6.2.9
4
18
 
5
19
  ### Patch Changes
@@ -30,13 +30,20 @@ var LayoutBlockMenuItem = function LayoutBlockMenuItem(_ref) {
30
30
  return false;
31
31
  }, [selection]);
32
32
  var handleClick = function handleClick(event) {
33
- var _api$blockMenu;
34
33
  var triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ? _analytics.INPUT_METHOD.KEYBOARD : _analytics.INPUT_METHOD.MOUSE;
35
34
  var inputMethod = _analytics.INPUT_METHOD.BLOCK_MENU;
36
- 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('layoutSection', {
37
- inputMethod: inputMethod,
38
- triggeredFrom: triggeredFrom
39
- }));
35
+ api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
36
+ var _api$blockMenu;
37
+ var tr = _ref2.tr;
38
+ 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.layoutSection, {
39
+ inputMethod: inputMethod,
40
+ triggeredFrom: triggeredFrom,
41
+ targetTypeName: 'layoutSection'
42
+ });
43
+ return command ? command({
44
+ tr: tr
45
+ }) : null;
46
+ });
40
47
  };
41
48
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
42
49
  onClick: handleClick,
@@ -23,13 +23,21 @@ const LayoutBlockMenuItem = ({
23
23
  return false;
24
24
  }, [selection]);
25
25
  const handleClick = event => {
26
- var _api$blockMenu;
27
26
  const triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ? INPUT_METHOD.KEYBOARD : INPUT_METHOD.MOUSE;
28
27
  const inputMethod = INPUT_METHOD.BLOCK_MENU;
29
- 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('layoutSection', {
30
- inputMethod,
31
- triggeredFrom
32
- }));
28
+ api === null || api === void 0 ? void 0 : api.core.actions.execute(({
29
+ tr
30
+ }) => {
31
+ var _api$blockMenu;
32
+ 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.layoutSection, {
33
+ inputMethod,
34
+ triggeredFrom,
35
+ targetTypeName: 'layoutSection'
36
+ });
37
+ return command ? command({
38
+ tr
39
+ }) : null;
40
+ });
33
41
  };
34
42
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
35
43
  onClick: handleClick,
@@ -21,13 +21,20 @@ var LayoutBlockMenuItem = function LayoutBlockMenuItem(_ref) {
21
21
  return false;
22
22
  }, [selection]);
23
23
  var handleClick = function handleClick(event) {
24
- var _api$blockMenu;
25
24
  var triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ? INPUT_METHOD.KEYBOARD : INPUT_METHOD.MOUSE;
26
25
  var inputMethod = INPUT_METHOD.BLOCK_MENU;
27
- 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('layoutSection', {
28
- inputMethod: inputMethod,
29
- triggeredFrom: triggeredFrom
30
- }));
26
+ api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
27
+ var _api$blockMenu;
28
+ var tr = _ref2.tr;
29
+ 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.layoutSection, {
30
+ inputMethod: inputMethod,
31
+ triggeredFrom: triggeredFrom,
32
+ targetTypeName: 'layoutSection'
33
+ });
34
+ return command ? command({
35
+ tr: tr
36
+ }) : null;
37
+ });
31
38
  };
32
39
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
33
40
  onClick: handleClick,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-layout",
3
- "version": "6.2.9",
3
+ "version": "6.2.11",
4
4
  "description": "Layout plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  "dependencies": {
32
32
  "@atlaskit/adf-schema": "^51.4.0",
33
33
  "@atlaskit/editor-plugin-analytics": "^6.2.0",
34
- "@atlaskit/editor-plugin-block-menu": "^5.0.0",
34
+ "@atlaskit/editor-plugin-block-menu": "^5.1.0",
35
35
  "@atlaskit/editor-plugin-decorations": "^6.1.0",
36
36
  "@atlaskit/editor-plugin-editor-disabled": "^6.1.0",
37
37
  "@atlaskit/editor-plugin-guideline": "^6.0.0",
@@ -41,11 +41,11 @@
41
41
  "@atlaskit/editor-plugin-width": "^7.0.0",
42
42
  "@atlaskit/editor-prosemirror": "7.0.0",
43
43
  "@atlaskit/editor-shared-styles": "^3.10.0",
44
- "@atlaskit/editor-toolbar": "^0.17.0",
44
+ "@atlaskit/editor-toolbar": "^0.18.0",
45
45
  "@atlaskit/icon": "^29.0.0",
46
46
  "@atlaskit/icon-lab": "^5.12.0",
47
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
48
- "@atlaskit/tmp-editor-statsig": "^14.0.0",
48
+ "@atlaskit/tmp-editor-statsig": "^14.2.0",
49
49
  "@atlaskit/tokens": "^8.4.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@emotion/react": "^11.7.1"