@atlaskit/editor-plugin-tasks-and-decisions 11.4.2 → 11.4.4

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,24 @@
1
1
  # @atlaskit/editor-plugin-tasks-and-decisions
2
2
 
3
+ ## 11.4.4
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
+
12
+ ## 11.4.3
13
+
14
+ ### Patch Changes
15
+
16
+ - [`e2f512c5e8eba`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e2f512c5e8eba) -
17
+ Clean up feature flag platform_editor_task_item_styles for task item checkbox and remove unused
18
+ styles objects taskItemCheckboxStylesWithBlockTaskItem and taskItemCheckboxStyles. Renamed
19
+ taskItemNextCheckboxStyles to taskItemCheckboxStyles
20
+ - Updated dependencies
21
+
3
22
  ## 11.4.2
4
23
 
5
24
  ### Patch Changes
@@ -91,7 +91,7 @@ function taskItemToDom(node, placeholder, intl) {
91
91
  'data-empty': 'true'
92
92
  } : {};
93
93
  }
94
- var checkboxIcons = (0, _expValEquals.expValEquals)('platform_editor_task_item_styles', 'isEnabled', true) ? ['http://www.w3.org/2000/svg svg', {
94
+ var checkboxIcons = ['http://www.w3.org/2000/svg svg', {
95
95
  width: '20',
96
96
  height: '20',
97
97
  viewBox: '2 2 20 20',
@@ -111,36 +111,6 @@ function taskItemToDom(node, placeholder, intl) {
111
111
  'clip-rule': 'evenodd',
112
112
  d: 'm16.326 9.48-1.152-.96-4.424 5.308-1.924-2.308-1.152.96 2.5 3a.75.75 0 0 0 1.152 0z',
113
113
  fill: 'inherit'
114
- }]]] : ['span', {
115
- 'aria-hidden': true,
116
- 'data-component': 'checkbox-icon-wrap'
117
- }, ['http://www.w3.org/2000/svg svg', {
118
- viewBox: "0 0 16 16",
119
- width: '16',
120
- height: '16',
121
- role: 'presentation',
122
- fill: 'none',
123
- 'data-component': 'checkbox-unchecked-icon'
124
- }, ['http://www.w3.org/2000/svg rect', {
125
- width: '12.5',
126
- height: '12.5',
127
- x: '1.75',
128
- y: '1.75',
129
- stroke: 'currentcolor',
130
- 'stroke-width': '1.5',
131
- rx: '1.25'
132
- }]], ['http://www.w3.org/2000/svg svg', {
133
- viewBox: "0 0 16 16",
134
- width: '16',
135
- height: '16',
136
- role: 'presentation',
137
- fill: 'none',
138
- 'data-component': 'checkbox-checked-icon'
139
- }, ['http://www.w3.org/2000/svg path', {
140
- fill: 'currentcolor',
141
- 'fill-rule': 'evenodd',
142
- 'clip-rule': 'evenodd',
143
- d: 'M3 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2zm9.326 4.48-1.152-.96L6.75 9.828 4.826 7.52l-1.152.96 2.5 3a.75.75 0 0 0 1.152 0z'
144
114
  }]]];
145
115
  return ['div', _objectSpread(_objectSpread({
146
116
  class: "".concat(_styles.TaskDecisionSharedCssClassName.TASK_CONTAINER)
@@ -73,11 +73,13 @@ var getTaskPasteContext = function getTaskPasteContext(view) {
73
73
  };
74
74
  };
75
75
  var convertTaskItemToBlockTaskItem = function convertTaskItemToBlockTaskItem(node, schema, smallTextAttrs) {
76
- var _schema$nodes2 = schema.nodes,
77
- blockTaskItem = _schema$nodes2.blockTaskItem,
78
- paragraph = _schema$nodes2.paragraph;
79
76
  var fontSize = schema.marks.fontSize;
80
- return blockTaskItem.create(node.attrs, paragraph.createChecked({}, node.content, [fontSize.create(smallTextAttrs)]));
77
+ return (0, _transforms.createBlockTaskItem)({
78
+ attrs: node.attrs,
79
+ content: node.content,
80
+ marks: [fontSize.create(smallTextAttrs)],
81
+ schema: schema
82
+ });
81
83
  };
82
84
  var addSmallTextToBlockTaskItem = function addSmallTextToBlockTaskItem(node, schema, smallTextAttrs) {
83
85
  var paragraph = schema.nodes.paragraph;
@@ -95,10 +97,10 @@ var addSmallTextToBlockTaskItem = function addSmallTextToBlockTaskItem(node, sch
95
97
  return node.type.create(node.attrs, newContent);
96
98
  };
97
99
  var normalizeBlockTaskItemToTaskItems = function normalizeBlockTaskItemToTaskItems(node, schema) {
98
- var _schema$nodes3 = schema.nodes,
99
- taskItem = _schema$nodes3.taskItem,
100
- blockTaskItem = _schema$nodes3.blockTaskItem,
101
- paragraph = _schema$nodes3.paragraph;
100
+ var _schema$nodes2 = schema.nodes,
101
+ taskItem = _schema$nodes2.taskItem,
102
+ blockTaskItem = _schema$nodes2.blockTaskItem,
103
+ paragraph = _schema$nodes2.paragraph;
102
104
  if (!blockTaskItem || node.type !== blockTaskItem) {
103
105
  return [node];
104
106
  }
@@ -135,9 +137,9 @@ var transformSliceContent = function transformSliceContent(slice, transformNode)
135
137
  };
136
138
  var transformSliceToRemoveBlockTaskItemLegacy = function transformSliceToRemoveBlockTaskItemLegacy(slice, view) {
137
139
  var schema = view.state.schema;
138
- var _schema$nodes4 = schema.nodes,
139
- taskItem = _schema$nodes4.taskItem,
140
- blockTaskItem = _schema$nodes4.blockTaskItem;
140
+ var _schema$nodes3 = schema.nodes,
141
+ taskItem = _schema$nodes3.taskItem,
142
+ blockTaskItem = _schema$nodes3.blockTaskItem;
141
143
  var isInTaskItem = view.state.selection.$from.node().type === taskItem;
142
144
  if (!isInTaskItem || !blockTaskItem) {
143
145
  return slice;
@@ -147,10 +149,10 @@ var transformSliceToRemoveBlockTaskItemLegacy = function transformSliceToRemoveB
147
149
  });
148
150
  };
149
151
  var _normalizeNodeForTaskTextSize = exports.normalizeNodeForTaskTextSize = function normalizeNodeForTaskTextSize(node, schema, smallTextAttrs) {
150
- var _schema$nodes5 = schema.nodes,
151
- taskList = _schema$nodes5.taskList,
152
- taskItem = _schema$nodes5.taskItem,
153
- blockTaskItem = _schema$nodes5.blockTaskItem;
152
+ var _schema$nodes4 = schema.nodes,
153
+ taskList = _schema$nodes4.taskList,
154
+ taskItem = _schema$nodes4.taskItem,
155
+ blockTaskItem = _schema$nodes4.blockTaskItem;
154
156
  var fontSize = schema.marks.fontSize;
155
157
  if (!smallTextAttrs) {
156
158
  return [node];
@@ -77,7 +77,7 @@ export function taskItemToDom(node, placeholder, intl) {
77
77
  'data-empty': 'true'
78
78
  } : {};
79
79
  }
80
- const checkboxIcons = expValEquals('platform_editor_task_item_styles', 'isEnabled', true) ? ['http://www.w3.org/2000/svg svg', {
80
+ const checkboxIcons = ['http://www.w3.org/2000/svg svg', {
81
81
  width: '20',
82
82
  height: '20',
83
83
  viewBox: '2 2 20 20',
@@ -97,36 +97,6 @@ export function taskItemToDom(node, placeholder, intl) {
97
97
  'clip-rule': 'evenodd',
98
98
  d: 'm16.326 9.48-1.152-.96-4.424 5.308-1.924-2.308-1.152.96 2.5 3a.75.75 0 0 0 1.152 0z',
99
99
  fill: 'inherit'
100
- }]]] : ['span', {
101
- 'aria-hidden': true,
102
- 'data-component': 'checkbox-icon-wrap'
103
- }, ['http://www.w3.org/2000/svg svg', {
104
- viewBox: `0 0 16 16`,
105
- width: '16',
106
- height: '16',
107
- role: 'presentation',
108
- fill: 'none',
109
- 'data-component': 'checkbox-unchecked-icon'
110
- }, ['http://www.w3.org/2000/svg rect', {
111
- width: '12.5',
112
- height: '12.5',
113
- x: '1.75',
114
- y: '1.75',
115
- stroke: 'currentcolor',
116
- 'stroke-width': '1.5',
117
- rx: '1.25'
118
- }]], ['http://www.w3.org/2000/svg svg', {
119
- viewBox: `0 0 16 16`,
120
- width: '16',
121
- height: '16',
122
- role: 'presentation',
123
- fill: 'none',
124
- 'data-component': 'checkbox-checked-icon'
125
- }, ['http://www.w3.org/2000/svg path', {
126
- fill: 'currentcolor',
127
- 'fill-rule': 'evenodd',
128
- 'clip-rule': 'evenodd',
129
- d: 'M3 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2zm9.326 4.48-1.152-.96L6.75 9.828 4.826 7.52l-1.152.96 2.5 3a.75.75 0 0 0 1.152 0z'
130
100
  }]]];
131
101
  return ['div', {
132
102
  class: `${TaskDecisionSharedCssClassName.TASK_CONTAINER}`,
@@ -1,6 +1,6 @@
1
1
  import { uuid } from '@atlaskit/adf-schema';
2
2
  import { getBlockMarkAttrs, getFirstParagraphBlockMarkAttrs } from '@atlaskit/editor-common/lists';
3
- import { isTaskList } from '@atlaskit/editor-common/transforms';
3
+ import { createBlockTaskItem, isTaskList } from '@atlaskit/editor-common/transforms';
4
4
  import { Slice, Fragment } from '@atlaskit/editor-prosemirror/model';
5
5
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
6
 
@@ -70,14 +70,15 @@ const getTaskPasteContext = view => {
70
70
  };
71
71
  };
72
72
  const convertTaskItemToBlockTaskItem = (node, schema, smallTextAttrs) => {
73
- const {
74
- blockTaskItem,
75
- paragraph
76
- } = schema.nodes;
77
73
  const {
78
74
  fontSize
79
75
  } = schema.marks;
80
- return blockTaskItem.create(node.attrs, paragraph.createChecked({}, node.content, [fontSize.create(smallTextAttrs)]));
76
+ return createBlockTaskItem({
77
+ attrs: node.attrs,
78
+ content: node.content,
79
+ marks: [fontSize.create(smallTextAttrs)],
80
+ schema
81
+ });
81
82
  };
82
83
  const addSmallTextToBlockTaskItem = (node, schema, smallTextAttrs) => {
83
84
  const {
@@ -83,7 +83,7 @@ export function taskItemToDom(node, placeholder, intl) {
83
83
  'data-empty': 'true'
84
84
  } : {};
85
85
  }
86
- var checkboxIcons = expValEquals('platform_editor_task_item_styles', 'isEnabled', true) ? ['http://www.w3.org/2000/svg svg', {
86
+ var checkboxIcons = ['http://www.w3.org/2000/svg svg', {
87
87
  width: '20',
88
88
  height: '20',
89
89
  viewBox: '2 2 20 20',
@@ -103,36 +103,6 @@ export function taskItemToDom(node, placeholder, intl) {
103
103
  'clip-rule': 'evenodd',
104
104
  d: 'm16.326 9.48-1.152-.96-4.424 5.308-1.924-2.308-1.152.96 2.5 3a.75.75 0 0 0 1.152 0z',
105
105
  fill: 'inherit'
106
- }]]] : ['span', {
107
- 'aria-hidden': true,
108
- 'data-component': 'checkbox-icon-wrap'
109
- }, ['http://www.w3.org/2000/svg svg', {
110
- viewBox: "0 0 16 16",
111
- width: '16',
112
- height: '16',
113
- role: 'presentation',
114
- fill: 'none',
115
- 'data-component': 'checkbox-unchecked-icon'
116
- }, ['http://www.w3.org/2000/svg rect', {
117
- width: '12.5',
118
- height: '12.5',
119
- x: '1.75',
120
- y: '1.75',
121
- stroke: 'currentcolor',
122
- 'stroke-width': '1.5',
123
- rx: '1.25'
124
- }]], ['http://www.w3.org/2000/svg svg', {
125
- viewBox: "0 0 16 16",
126
- width: '16',
127
- height: '16',
128
- role: 'presentation',
129
- fill: 'none',
130
- 'data-component': 'checkbox-checked-icon'
131
- }, ['http://www.w3.org/2000/svg path', {
132
- fill: 'currentcolor',
133
- 'fill-rule': 'evenodd',
134
- 'clip-rule': 'evenodd',
135
- d: 'M3 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2zm9.326 4.48-1.152-.96L6.75 9.828 4.826 7.52l-1.152.96 2.5 3a.75.75 0 0 0 1.152 0z'
136
106
  }]]];
137
107
  return ['div', _objectSpread(_objectSpread({
138
108
  class: "".concat(TaskDecisionSharedCssClassName.TASK_CONTAINER)
@@ -1,7 +1,7 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import { uuid } from '@atlaskit/adf-schema';
3
3
  import { getBlockMarkAttrs, getFirstParagraphBlockMarkAttrs } from '@atlaskit/editor-common/lists';
4
- import { isTaskList } from '@atlaskit/editor-common/transforms';
4
+ import { createBlockTaskItem, isTaskList } from '@atlaskit/editor-common/transforms';
5
5
  import { Slice, Fragment } from '@atlaskit/editor-prosemirror/model';
6
6
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
7
 
@@ -67,11 +67,13 @@ var getTaskPasteContext = function getTaskPasteContext(view) {
67
67
  };
68
68
  };
69
69
  var convertTaskItemToBlockTaskItem = function convertTaskItemToBlockTaskItem(node, schema, smallTextAttrs) {
70
- var _schema$nodes2 = schema.nodes,
71
- blockTaskItem = _schema$nodes2.blockTaskItem,
72
- paragraph = _schema$nodes2.paragraph;
73
70
  var fontSize = schema.marks.fontSize;
74
- return blockTaskItem.create(node.attrs, paragraph.createChecked({}, node.content, [fontSize.create(smallTextAttrs)]));
71
+ return createBlockTaskItem({
72
+ attrs: node.attrs,
73
+ content: node.content,
74
+ marks: [fontSize.create(smallTextAttrs)],
75
+ schema: schema
76
+ });
75
77
  };
76
78
  var addSmallTextToBlockTaskItem = function addSmallTextToBlockTaskItem(node, schema, smallTextAttrs) {
77
79
  var paragraph = schema.nodes.paragraph;
@@ -89,10 +91,10 @@ var addSmallTextToBlockTaskItem = function addSmallTextToBlockTaskItem(node, sch
89
91
  return node.type.create(node.attrs, newContent);
90
92
  };
91
93
  var normalizeBlockTaskItemToTaskItems = function normalizeBlockTaskItemToTaskItems(node, schema) {
92
- var _schema$nodes3 = schema.nodes,
93
- taskItem = _schema$nodes3.taskItem,
94
- blockTaskItem = _schema$nodes3.blockTaskItem,
95
- paragraph = _schema$nodes3.paragraph;
94
+ var _schema$nodes2 = schema.nodes,
95
+ taskItem = _schema$nodes2.taskItem,
96
+ blockTaskItem = _schema$nodes2.blockTaskItem,
97
+ paragraph = _schema$nodes2.paragraph;
96
98
  if (!blockTaskItem || node.type !== blockTaskItem) {
97
99
  return [node];
98
100
  }
@@ -129,9 +131,9 @@ var transformSliceContent = function transformSliceContent(slice, transformNode)
129
131
  };
130
132
  var transformSliceToRemoveBlockTaskItemLegacy = function transformSliceToRemoveBlockTaskItemLegacy(slice, view) {
131
133
  var schema = view.state.schema;
132
- var _schema$nodes4 = schema.nodes,
133
- taskItem = _schema$nodes4.taskItem,
134
- blockTaskItem = _schema$nodes4.blockTaskItem;
134
+ var _schema$nodes3 = schema.nodes,
135
+ taskItem = _schema$nodes3.taskItem,
136
+ blockTaskItem = _schema$nodes3.blockTaskItem;
135
137
  var isInTaskItem = view.state.selection.$from.node().type === taskItem;
136
138
  if (!isInTaskItem || !blockTaskItem) {
137
139
  return slice;
@@ -141,10 +143,10 @@ var transformSliceToRemoveBlockTaskItemLegacy = function transformSliceToRemoveB
141
143
  });
142
144
  };
143
145
  var _normalizeNodeForTaskTextSize = function normalizeNodeForTaskTextSize(node, schema, smallTextAttrs) {
144
- var _schema$nodes5 = schema.nodes,
145
- taskList = _schema$nodes5.taskList,
146
- taskItem = _schema$nodes5.taskItem,
147
- blockTaskItem = _schema$nodes5.blockTaskItem;
146
+ var _schema$nodes4 = schema.nodes,
147
+ taskList = _schema$nodes4.taskList,
148
+ taskItem = _schema$nodes4.taskItem,
149
+ blockTaskItem = _schema$nodes4.blockTaskItem;
148
150
  var fontSize = schema.marks.fontSize;
149
151
  if (!smallTextAttrs) {
150
152
  return [node];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-tasks-and-decisions",
3
- "version": "11.4.2",
3
+ "version": "11.4.4",
4
4
  "description": "Tasks and decisions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -49,14 +49,14 @@
49
49
  "@atlaskit/primitives": "^18.1.0",
50
50
  "@atlaskit/prosemirror-input-rules": "^3.6.0",
51
51
  "@atlaskit/task-decision": "^19.3.0",
52
- "@atlaskit/tmp-editor-statsig": "^51.0.0",
52
+ "@atlaskit/tmp-editor-statsig": "^52.1.0",
53
53
  "@atlaskit/tokens": "^11.4.0",
54
54
  "@babel/runtime": "^7.0.0",
55
55
  "@compiled/react": "^0.20.0",
56
56
  "bind-event-listener": "^3.0.0"
57
57
  },
58
58
  "peerDependencies": {
59
- "@atlaskit/editor-common": "^112.13.0",
59
+ "@atlaskit/editor-common": "^112.15.0",
60
60
  "react": "^18.2.0",
61
61
  "react-dom": "^18.2.0",
62
62
  "react-intl-next": "npm:react-intl@^5.18.1"