@atlaskit/editor-plugin-block-menu 7.0.23 → 7.0.24

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,14 @@
1
1
  # @atlaskit/editor-plugin-block-menu
2
2
 
3
+ ## 7.0.24
4
+
5
+ ### Patch Changes
6
+
7
+ - [`1c4534dc921e6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1c4534dc921e6) -
8
+ Preserve small text formatting when converting selections to task lists across block menu, block
9
+ type, and paste flows
10
+ - Updated dependencies
11
+
3
12
  ## 7.0.23
4
13
 
5
14
  ### Patch Changes
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.listToListStep = void 0;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
+ var _transforms = require("@atlaskit/editor-common/transforms");
9
10
  var _model = require("@atlaskit/editor-prosemirror/model");
11
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
10
12
  var _nodeChecks = require("../nodeChecks");
11
13
  /**
12
14
  * Recursively converts nested lists to the target list type.
@@ -73,9 +75,13 @@ var _transformList = function transformList(node, targetListType, targetItemType
73
75
  var paragraphType = schema.nodes.paragraph;
74
76
  if (isTargetTaskItem) {
75
77
  var inlineContent = [];
78
+ var blockMarks = itemNode.marks;
76
79
  itemNode.forEach(function (child) {
77
80
  if (child.type === paragraphType) {
78
81
  inlineContent.push.apply(inlineContent, (0, _toConsumableArray2.default)(child.children));
82
+ if (child.marks.length > 0) {
83
+ blockMarks = child.marks;
84
+ }
79
85
  } else if (child.isInline) {
80
86
  inlineContent.push(child);
81
87
  // Nested lists will be extracted and placed as siblings in the taskList
@@ -83,6 +89,14 @@ var _transformList = function transformList(node, targetListType, targetItemType
83
89
  unsupportedContent.push(child);
84
90
  }
85
91
  });
92
+ var blockTaskItem = schema.nodes.blockTaskItem;
93
+ if (blockTaskItem && blockMarks.length > 0 && (0, _expValEquals.expValEquals)('platform_editor_small_font_size', 'isEnabled', true)) {
94
+ return (0, _transforms.createBlockTaskItem)({
95
+ content: inlineContent,
96
+ marks: blockMarks,
97
+ schema: schema
98
+ });
99
+ }
86
100
  return targetItemNodeType.create({}, inlineContent);
87
101
  }
88
102
  var transformedContent = [];
@@ -1,4 +1,6 @@
1
+ import { createBlockTaskItem } from '@atlaskit/editor-common/transforms';
1
2
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
3
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
2
4
  import { isListWithIndentation } from '../nodeChecks';
3
5
  /**
4
6
  * Recursively converts nested lists to the target list type.
@@ -64,9 +66,13 @@ const transformList = (node, targetListType, targetItemType, unsupportedContent)
64
66
  const paragraphType = schema.nodes.paragraph;
65
67
  if (isTargetTaskItem) {
66
68
  const inlineContent = [];
69
+ let blockMarks = itemNode.marks;
67
70
  itemNode.forEach(child => {
68
71
  if (child.type === paragraphType) {
69
72
  inlineContent.push(...child.children);
73
+ if (child.marks.length > 0) {
74
+ blockMarks = child.marks;
75
+ }
70
76
  } else if (child.isInline) {
71
77
  inlineContent.push(child);
72
78
  // Nested lists will be extracted and placed as siblings in the taskList
@@ -74,6 +80,16 @@ const transformList = (node, targetListType, targetItemType, unsupportedContent)
74
80
  unsupportedContent.push(child);
75
81
  }
76
82
  });
83
+ const {
84
+ blockTaskItem
85
+ } = schema.nodes;
86
+ if (blockTaskItem && blockMarks.length > 0 && expValEquals('platform_editor_small_font_size', 'isEnabled', true)) {
87
+ return createBlockTaskItem({
88
+ content: inlineContent,
89
+ marks: blockMarks,
90
+ schema
91
+ });
92
+ }
77
93
  return targetItemNodeType.create({}, inlineContent);
78
94
  }
79
95
  const transformedContent = [];
@@ -1,5 +1,7 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
+ import { createBlockTaskItem } from '@atlaskit/editor-common/transforms';
2
3
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
4
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
5
  import { isListWithIndentation } from '../nodeChecks';
4
6
  /**
5
7
  * Recursively converts nested lists to the target list type.
@@ -66,9 +68,13 @@ var _transformList = function transformList(node, targetListType, targetItemType
66
68
  var paragraphType = schema.nodes.paragraph;
67
69
  if (isTargetTaskItem) {
68
70
  var inlineContent = [];
71
+ var blockMarks = itemNode.marks;
69
72
  itemNode.forEach(function (child) {
70
73
  if (child.type === paragraphType) {
71
74
  inlineContent.push.apply(inlineContent, _toConsumableArray(child.children));
75
+ if (child.marks.length > 0) {
76
+ blockMarks = child.marks;
77
+ }
72
78
  } else if (child.isInline) {
73
79
  inlineContent.push(child);
74
80
  // Nested lists will be extracted and placed as siblings in the taskList
@@ -76,6 +82,14 @@ var _transformList = function transformList(node, targetListType, targetItemType
76
82
  unsupportedContent.push(child);
77
83
  }
78
84
  });
85
+ var blockTaskItem = schema.nodes.blockTaskItem;
86
+ if (blockTaskItem && blockMarks.length > 0 && expValEquals('platform_editor_small_font_size', 'isEnabled', true)) {
87
+ return createBlockTaskItem({
88
+ content: inlineContent,
89
+ marks: blockMarks,
90
+ schema: schema
91
+ });
92
+ }
79
93
  return targetItemNodeType.create({}, inlineContent);
80
94
  }
81
95
  var transformedContent = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-menu",
3
- "version": "7.0.23",
3
+ "version": "7.0.24",
4
4
  "description": "BlockMenu plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -44,13 +44,13 @@
44
44
  "@atlaskit/platform-feature-flags": "^1.1.0",
45
45
  "@atlaskit/primitives": "^18.1.0",
46
46
  "@atlaskit/prosemirror-history": "^0.2.0",
47
- "@atlaskit/tmp-editor-statsig": "^52.0.0",
47
+ "@atlaskit/tmp-editor-statsig": "^52.1.0",
48
48
  "@atlaskit/tokens": "^11.4.0",
49
49
  "@babel/runtime": "^7.0.0",
50
50
  "bind-event-listener": "^3.0.0"
51
51
  },
52
52
  "peerDependencies": {
53
- "@atlaskit/editor-common": "^112.13.0",
53
+ "@atlaskit/editor-common": "^112.15.0",
54
54
  "react": "^18.2.0",
55
55
  "react-intl-next": "npm:react-intl@^5.18.1"
56
56
  },