@atlaskit/editor-plugin-list 8.2.14 → 8.2.15

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-list
2
2
 
3
+ ## 8.2.15
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
  ## 8.2.14
4
12
 
5
13
  ### Patch Changes
@@ -28,13 +28,20 @@ var BulletedListBlockMenuItem = function BulletedListBlockMenuItem(_ref) {
28
28
  var isSelected = bulletListActive && !isBlockquoteSelected;
29
29
  var handleClick = function handleClick(event) {
30
30
  if (!bulletListActive) {
31
- var _api$blockMenu;
32
31
  var triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ? _analytics.INPUT_METHOD.KEYBOARD : _analytics.INPUT_METHOD.MOUSE;
33
32
  var inputMethod = _analytics.INPUT_METHOD.BLOCK_MENU;
34
- 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("bulletList", {
35
- inputMethod: inputMethod,
36
- triggeredFrom: triggeredFrom
37
- }));
33
+ api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
34
+ var _api$blockMenu;
35
+ var tr = _ref2.tr;
36
+ 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.bulletList, {
37
+ inputMethod: inputMethod,
38
+ triggeredFrom: triggeredFrom,
39
+ targetTypeName: 'bulletList'
40
+ });
41
+ return command ? command({
42
+ tr: tr
43
+ }) : null;
44
+ });
38
45
  }
39
46
  };
40
47
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
@@ -45,8 +52,8 @@ var BulletedListBlockMenuItem = function BulletedListBlockMenuItem(_ref) {
45
52
  })
46
53
  }, formatMessage(_messages.listMessages.bulletedList));
47
54
  };
48
- var createBulletedListBlockMenuItem = exports.createBulletedListBlockMenuItem = function createBulletedListBlockMenuItem(_ref2) {
49
- var api = _ref2.api;
55
+ var createBulletedListBlockMenuItem = exports.createBulletedListBlockMenuItem = function createBulletedListBlockMenuItem(_ref3) {
56
+ var api = _ref3.api;
50
57
  return function () {
51
58
  return /*#__PURE__*/_react.default.createElement(BulletedListBlockMenuItem, {
52
59
  api: api
@@ -26,13 +26,20 @@ var NumberedListBlockMenuItem = function NumberedListBlockMenuItem(_ref) {
26
26
  var isSelected = orderedListActive && !isBlockquoteSelected;
27
27
  var handleClick = function handleClick(event) {
28
28
  if (!orderedListActive) {
29
- var _api$blockMenu;
30
29
  var triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ? _analytics.INPUT_METHOD.KEYBOARD : _analytics.INPUT_METHOD.MOUSE;
31
30
  var inputMethod = _analytics.INPUT_METHOD.BLOCK_MENU;
32
- 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("orderedList", {
33
- inputMethod: inputMethod,
34
- triggeredFrom: triggeredFrom
35
- }));
31
+ api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
32
+ var _api$blockMenu;
33
+ var tr = _ref2.tr;
34
+ 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.orderedList, {
35
+ inputMethod: inputMethod,
36
+ triggeredFrom: triggeredFrom,
37
+ targetTypeName: 'orderedList'
38
+ });
39
+ return command ? command({
40
+ tr: tr
41
+ }) : null;
42
+ });
36
43
  }
37
44
  };
38
45
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
@@ -43,8 +50,8 @@ var NumberedListBlockMenuItem = function NumberedListBlockMenuItem(_ref) {
43
50
  })
44
51
  }, formatMessage(_messages.listMessages.orderedList));
45
52
  };
46
- var createNumberedListBlockMenuItem = exports.createNumberedListBlockMenuItem = function createNumberedListBlockMenuItem(_ref2) {
47
- var api = _ref2.api;
53
+ var createNumberedListBlockMenuItem = exports.createNumberedListBlockMenuItem = function createNumberedListBlockMenuItem(_ref3) {
54
+ var api = _ref3.api;
48
55
  return function () {
49
56
  return /*#__PURE__*/_react.default.createElement(NumberedListBlockMenuItem, {
50
57
  api: api
@@ -23,13 +23,21 @@ const BulletedListBlockMenuItem = ({
23
23
  const isSelected = bulletListActive && !isBlockquoteSelected;
24
24
  const handleClick = event => {
25
25
  if (!bulletListActive) {
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(`bulletList`, {
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.bulletList, {
33
+ inputMethod,
34
+ triggeredFrom,
35
+ targetTypeName: 'bulletList'
36
+ });
37
+ return command ? command({
38
+ tr
39
+ }) : null;
40
+ });
33
41
  }
34
42
  };
35
43
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
@@ -21,13 +21,21 @@ const NumberedListBlockMenuItem = ({
21
21
  const isSelected = orderedListActive && !isBlockquoteSelected;
22
22
  const handleClick = event => {
23
23
  if (!orderedListActive) {
24
- var _api$blockMenu;
25
24
  const triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ? INPUT_METHOD.KEYBOARD : INPUT_METHOD.MOUSE;
26
25
  const inputMethod = INPUT_METHOD.BLOCK_MENU;
27
- 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(`orderedList`, {
28
- inputMethod,
29
- triggeredFrom
30
- }));
26
+ api === null || api === void 0 ? void 0 : api.core.actions.execute(({
27
+ tr
28
+ }) => {
29
+ var _api$blockMenu;
30
+ 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.orderedList, {
31
+ inputMethod,
32
+ triggeredFrom,
33
+ targetTypeName: 'orderedList'
34
+ });
35
+ return command ? command({
36
+ tr
37
+ }) : null;
38
+ });
31
39
  }
32
40
  };
33
41
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
@@ -21,13 +21,20 @@ var BulletedListBlockMenuItem = function BulletedListBlockMenuItem(_ref) {
21
21
  var isSelected = bulletListActive && !isBlockquoteSelected;
22
22
  var handleClick = function handleClick(event) {
23
23
  if (!bulletListActive) {
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("bulletList", {
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.bulletList, {
30
+ inputMethod: inputMethod,
31
+ triggeredFrom: triggeredFrom,
32
+ targetTypeName: 'bulletList'
33
+ });
34
+ return command ? command({
35
+ tr: tr
36
+ }) : null;
37
+ });
31
38
  }
32
39
  };
33
40
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
@@ -38,8 +45,8 @@ var BulletedListBlockMenuItem = function BulletedListBlockMenuItem(_ref) {
38
45
  })
39
46
  }, formatMessage(listMessages.bulletedList));
40
47
  };
41
- export var createBulletedListBlockMenuItem = function createBulletedListBlockMenuItem(_ref2) {
42
- var api = _ref2.api;
48
+ export var createBulletedListBlockMenuItem = function createBulletedListBlockMenuItem(_ref3) {
49
+ var api = _ref3.api;
43
50
  return function () {
44
51
  return /*#__PURE__*/React.createElement(BulletedListBlockMenuItem, {
45
52
  api: api
@@ -19,13 +19,20 @@ var NumberedListBlockMenuItem = function NumberedListBlockMenuItem(_ref) {
19
19
  var isSelected = orderedListActive && !isBlockquoteSelected;
20
20
  var handleClick = function handleClick(event) {
21
21
  if (!orderedListActive) {
22
- var _api$blockMenu;
23
22
  var triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ? INPUT_METHOD.KEYBOARD : INPUT_METHOD.MOUSE;
24
23
  var inputMethod = INPUT_METHOD.BLOCK_MENU;
25
- 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("orderedList", {
26
- inputMethod: inputMethod,
27
- triggeredFrom: triggeredFrom
28
- }));
24
+ api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
25
+ var _api$blockMenu;
26
+ var tr = _ref2.tr;
27
+ 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.orderedList, {
28
+ inputMethod: inputMethod,
29
+ triggeredFrom: triggeredFrom,
30
+ targetTypeName: 'orderedList'
31
+ });
32
+ return command ? command({
33
+ tr: tr
34
+ }) : null;
35
+ });
29
36
  }
30
37
  };
31
38
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
@@ -36,8 +43,8 @@ var NumberedListBlockMenuItem = function NumberedListBlockMenuItem(_ref) {
36
43
  })
37
44
  }, formatMessage(listMessages.orderedList));
38
45
  };
39
- export var createNumberedListBlockMenuItem = function createNumberedListBlockMenuItem(_ref2) {
40
- var api = _ref2.api;
46
+ export var createNumberedListBlockMenuItem = function createNumberedListBlockMenuItem(_ref3) {
47
+ var api = _ref3.api;
41
48
  return function () {
42
49
  return /*#__PURE__*/React.createElement(NumberedListBlockMenuItem, {
43
50
  api: api
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-list",
3
- "version": "8.2.14",
3
+ "version": "8.2.15",
4
4
  "description": "List plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "@atlaskit/adf-schema": "^51.4.0",
31
31
  "@atlaskit/editor-plugin-analytics": "^6.2.0",
32
- "@atlaskit/editor-plugin-block-menu": "^5.0.0",
32
+ "@atlaskit/editor-plugin-block-menu": "^5.1.0",
33
33
  "@atlaskit/editor-plugin-feature-flags": "^5.0.0",
34
34
  "@atlaskit/editor-plugin-toolbar": "^3.4.0",
35
35
  "@atlaskit/editor-prosemirror": "7.0.0",
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/platform-feature-flags": "^1.1.0",
40
40
  "@atlaskit/prosemirror-history": "^0.2.0",
41
41
  "@atlaskit/prosemirror-input-rules": "^3.6.0",
42
- "@atlaskit/tmp-editor-statsig": "^14.1.0",
42
+ "@atlaskit/tmp-editor-statsig": "^14.2.0",
43
43
  "@babel/runtime": "^7.0.0"
44
44
  },
45
45
  "peerDependencies": {