@atlaskit/editor-plugin-block-menu 6.0.28 → 6.0.30

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-block-menu
2
2
 
3
+ ## 6.0.30
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 6.0.29
10
+
11
+ ### Patch Changes
12
+
13
+ - [`7b1f3cc37e760`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7b1f3cc37e760) -
14
+ Fire `element undid` event after undo transform
15
+ - Updated dependencies
16
+
3
17
  ## 6.0.28
4
18
 
5
19
  ### Patch Changes
@@ -37,6 +37,9 @@ var transformNode = exports.transformNode = function transformNode(api) {
37
37
  var typeName = node.type.name;
38
38
  sourceNodeTypes[typeName] = (sourceNodeTypes[typeName] || 0) + 1;
39
39
  });
40
+
41
+ // Check if source node is empty paragraph or heading
42
+ var isEmptyLine = sourceNodes.length === 1 && (sourceNodes[0].type === nodes.paragraph || sourceNodes[0].type === nodes.heading) && (sourceNodes[0].content.size === 0 || sourceNodes[0].textContent.trim() === '');
40
43
  var resultNodes = (0, _transform2.convertNodesToTargetType)({
41
44
  sourceNodes: sourceNodes,
42
45
  targetNodeType: targetType,
@@ -75,12 +78,12 @@ var transformNode = exports.transformNode = function transformNode(api) {
75
78
  }
76
79
  (0, _performanceMeasures.stopMeasure)(measureId, function (duration, startTime) {
77
80
  var _api$analytics;
78
- api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || _api$analytics.fireAnalyticsEvent({
81
+ api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || _api$analytics.attachAnalyticsEvent({
79
82
  action: _analytics.ACTION.TRANSFORMED,
80
83
  actionSubject: _analytics.ACTION_SUBJECT.ELEMENT,
81
84
  attributes: {
82
85
  duration: duration,
83
- isList: isList,
86
+ isEmptyLine: isEmptyLine,
84
87
  isNested: isNested,
85
88
  sourceNodesCount: sourceNodes.length,
86
89
  sourceNodesCountByType: sourceNodeTypes,
@@ -91,7 +94,7 @@ var transformNode = exports.transformNode = function transformNode(api) {
91
94
  inputMethod: _analytics.INPUT_METHOD.BLOCK_MENU
92
95
  },
93
96
  eventType: _analytics.EVENT_TYPE.TRACK
94
- });
97
+ })(tr);
95
98
  });
96
99
  return tr;
97
100
  };
@@ -33,6 +33,9 @@ export const transformNode = api => (targetType, metadata) => ({
33
33
  const typeName = node.type.name;
34
34
  sourceNodeTypes[typeName] = (sourceNodeTypes[typeName] || 0) + 1;
35
35
  });
36
+
37
+ // Check if source node is empty paragraph or heading
38
+ const isEmptyLine = sourceNodes.length === 1 && (sourceNodes[0].type === nodes.paragraph || sourceNodes[0].type === nodes.heading) && (sourceNodes[0].content.size === 0 || sourceNodes[0].textContent.trim() === '');
36
39
  const resultNodes = convertNodesToTargetType({
37
40
  sourceNodes,
38
41
  targetNodeType: targetType,
@@ -67,12 +70,12 @@ export const transformNode = api => (targetType, metadata) => ({
67
70
  }
68
71
  stopMeasure(measureId, (duration, startTime) => {
69
72
  var _api$analytics, _api$analytics$action;
70
- api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.fireAnalyticsEvent({
73
+ api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.attachAnalyticsEvent({
71
74
  action: ACTION.TRANSFORMED,
72
75
  actionSubject: ACTION_SUBJECT.ELEMENT,
73
76
  attributes: {
74
77
  duration,
75
- isList,
78
+ isEmptyLine,
76
79
  isNested,
77
80
  sourceNodesCount: sourceNodes.length,
78
81
  sourceNodesCountByType: sourceNodeTypes,
@@ -83,7 +86,7 @@ export const transformNode = api => (targetType, metadata) => ({
83
86
  inputMethod: INPUT_METHOD.BLOCK_MENU
84
87
  },
85
88
  eventType: EVENT_TYPE.TRACK
86
- });
89
+ })(tr);
87
90
  });
88
91
  return tr;
89
92
  };
@@ -31,6 +31,9 @@ export var transformNode = function transformNode(api) {
31
31
  var typeName = node.type.name;
32
32
  sourceNodeTypes[typeName] = (sourceNodeTypes[typeName] || 0) + 1;
33
33
  });
34
+
35
+ // Check if source node is empty paragraph or heading
36
+ var isEmptyLine = sourceNodes.length === 1 && (sourceNodes[0].type === nodes.paragraph || sourceNodes[0].type === nodes.heading) && (sourceNodes[0].content.size === 0 || sourceNodes[0].textContent.trim() === '');
34
37
  var resultNodes = convertNodesToTargetType({
35
38
  sourceNodes: sourceNodes,
36
39
  targetNodeType: targetType,
@@ -69,12 +72,12 @@ export var transformNode = function transformNode(api) {
69
72
  }
70
73
  stopMeasure(measureId, function (duration, startTime) {
71
74
  var _api$analytics;
72
- api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || _api$analytics.fireAnalyticsEvent({
75
+ api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || _api$analytics.attachAnalyticsEvent({
73
76
  action: ACTION.TRANSFORMED,
74
77
  actionSubject: ACTION_SUBJECT.ELEMENT,
75
78
  attributes: {
76
79
  duration: duration,
77
- isList: isList,
80
+ isEmptyLine: isEmptyLine,
78
81
  isNested: isNested,
79
82
  sourceNodesCount: sourceNodes.length,
80
83
  sourceNodesCountByType: sourceNodeTypes,
@@ -85,7 +88,7 @@ export var transformNode = function transformNode(api) {
85
88
  inputMethod: INPUT_METHOD.BLOCK_MENU
86
89
  },
87
90
  eventType: EVENT_TYPE.TRACK
88
- });
91
+ })(tr);
89
92
  });
90
93
  return tr;
91
94
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-menu",
3
- "version": "6.0.28",
3
+ "version": "6.0.30",
4
4
  "description": "BlockMenu plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -44,15 +44,15 @@
44
44
  "@atlaskit/icon": "^30.0.0",
45
45
  "@atlaskit/platform-feature-flags": "^1.1.0",
46
46
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
47
- "@atlaskit/primitives": "^17.1.0",
47
+ "@atlaskit/primitives": "^18.0.0",
48
48
  "@atlaskit/prosemirror-history": "^0.2.0",
49
- "@atlaskit/tmp-editor-statsig": "^17.4.0",
50
- "@atlaskit/tokens": "^10.1.0",
49
+ "@atlaskit/tmp-editor-statsig": "^17.10.0",
50
+ "@atlaskit/tokens": "^11.0.0",
51
51
  "@babel/runtime": "^7.0.0",
52
52
  "bind-event-listener": "^3.0.0"
53
53
  },
54
54
  "peerDependencies": {
55
- "@atlaskit/editor-common": "^111.9.0",
55
+ "@atlaskit/editor-common": "^111.11.0",
56
56
  "react": "^18.2.0",
57
57
  "react-intl-next": "npm:react-intl@^5.18.1"
58
58
  },