@atlaskit/editor-plugin-tasks-and-decisions 9.1.16 → 9.1.17

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-tasks-and-decisions
2
2
 
3
+ ## 9.1.17
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
  ## 9.1.16
4
12
 
5
13
  ### Patch Changes
@@ -23,13 +23,20 @@ var TaskListBlockMenuItem = exports.TaskListBlockMenuItem = function TaskListBlo
23
23
  return selection && selection.$from.parent.type.name === 'taskItem';
24
24
  }, [selection]);
25
25
  var onClick = function onClick(event) {
26
- var _api$blockMenu;
27
26
  var triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ? _analytics.INPUT_METHOD.KEYBOARD : _analytics.INPUT_METHOD.MOUSE;
28
27
  var inputMethod = _analytics.INPUT_METHOD.BLOCK_MENU;
29
- 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('taskList', {
30
- inputMethod: inputMethod,
31
- triggeredFrom: triggeredFrom
32
- }));
28
+ api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
29
+ var _api$blockMenu;
30
+ var tr = _ref2.tr;
31
+ 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.taskList, {
32
+ inputMethod: inputMethod,
33
+ triggeredFrom: triggeredFrom,
34
+ targetTypeName: 'taskList'
35
+ });
36
+ return command ? command({
37
+ tr: tr
38
+ }) : null;
39
+ });
33
40
  };
34
41
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
35
42
  isSelected: isSelected,
@@ -16,13 +16,21 @@ export const TaskListBlockMenuItem = ({
16
16
  return selection && selection.$from.parent.type.name === 'taskItem';
17
17
  }, [selection]);
18
18
  const onClick = event => {
19
- var _api$blockMenu;
20
19
  const triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ? INPUT_METHOD.KEYBOARD : INPUT_METHOD.MOUSE;
21
20
  const inputMethod = INPUT_METHOD.BLOCK_MENU;
22
- 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('taskList', {
23
- inputMethod,
24
- triggeredFrom
25
- }));
21
+ api === null || api === void 0 ? void 0 : api.core.actions.execute(({
22
+ tr
23
+ }) => {
24
+ var _api$blockMenu;
25
+ 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.taskList, {
26
+ inputMethod,
27
+ triggeredFrom,
28
+ targetTypeName: 'taskList'
29
+ });
30
+ return command ? command({
31
+ tr
32
+ }) : null;
33
+ });
26
34
  };
27
35
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
28
36
  isSelected: isSelected,
@@ -14,13 +14,20 @@ export var TaskListBlockMenuItem = function TaskListBlockMenuItem(_ref) {
14
14
  return selection && selection.$from.parent.type.name === 'taskItem';
15
15
  }, [selection]);
16
16
  var onClick = function onClick(event) {
17
- var _api$blockMenu;
18
17
  var triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ? INPUT_METHOD.KEYBOARD : INPUT_METHOD.MOUSE;
19
18
  var inputMethod = INPUT_METHOD.BLOCK_MENU;
20
- 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('taskList', {
21
- inputMethod: inputMethod,
22
- triggeredFrom: triggeredFrom
23
- }));
19
+ api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
20
+ var _api$blockMenu;
21
+ var tr = _ref2.tr;
22
+ 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.taskList, {
23
+ inputMethod: inputMethod,
24
+ triggeredFrom: triggeredFrom,
25
+ targetTypeName: 'taskList'
26
+ });
27
+ return command ? command({
28
+ tr: tr
29
+ }) : null;
30
+ });
24
31
  };
25
32
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
26
33
  isSelected: isSelected,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-tasks-and-decisions",
3
- "version": "9.1.16",
3
+ "version": "9.1.17",
4
4
  "description": "Tasks and decisions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  "@atlaskit/analytics-namespaced-context": "^7.2.0",
34
34
  "@atlaskit/css": "^0.17.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-context-identifier": "^6.0.0",
38
38
  "@atlaskit/editor-plugin-editor-viewmode": "^8.0.0",
39
39
  "@atlaskit/editor-plugin-selection": "^6.1.0",
@@ -49,7 +49,7 @@
49
49
  "@atlaskit/primitives": "^16.4.0",
50
50
  "@atlaskit/prosemirror-input-rules": "^3.6.0",
51
51
  "@atlaskit/task-decision": "^19.2.0",
52
- "@atlaskit/tmp-editor-statsig": "^14.1.0",
52
+ "@atlaskit/tmp-editor-statsig": "^14.2.0",
53
53
  "@atlaskit/tokens": "^8.4.0",
54
54
  "@babel/runtime": "^7.0.0",
55
55
  "@compiled/react": "^0.18.6",