@atlaskit/editor-common 109.3.0 → 109.4.0

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.
Files changed (67) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/analytics/types/enums.js +1 -0
  3. package/dist/cjs/analytics/types/width-events.js +5 -0
  4. package/dist/cjs/element-browser/components/ViewMore.js +1 -1
  5. package/dist/cjs/monitoring/error.js +1 -1
  6. package/dist/cjs/styles/shared/table.js +1 -1
  7. package/dist/cjs/transforms/index.js +63 -1
  8. package/dist/cjs/transforms/list-transforms.js +306 -0
  9. package/dist/cjs/transforms/list-types.js +5 -0
  10. package/dist/cjs/transforms/list-utils.js +36 -0
  11. package/dist/cjs/ui/DropList/index.js +1 -1
  12. package/dist/cjs/ui/Shortcut/index.js +1 -1
  13. package/dist/cjs/ui/Toolbar/ButtonGroup.js +1 -1
  14. package/dist/cjs/ui/Toolbar/DropdownTriggerWrapper.js +1 -1
  15. package/dist/cjs/ui/Toolbar/DropdownWrapper.compiled.css +2 -1
  16. package/dist/cjs/ui/Toolbar/DropdownWrapper.js +1 -1
  17. package/dist/cjs/ui/Toolbar/ExpandIcon.js +1 -1
  18. package/dist/cjs/ui/Toolbar/Separator.js +1 -1
  19. package/dist/es2019/analytics/types/enums.js +1 -0
  20. package/dist/es2019/analytics/types/width-events.js +1 -0
  21. package/dist/es2019/element-browser/components/ViewMore.js +1 -1
  22. package/dist/es2019/monitoring/error.js +1 -1
  23. package/dist/es2019/styles/shared/table.js +2 -1
  24. package/dist/es2019/transforms/index.js +3 -1
  25. package/dist/es2019/transforms/list-transforms.js +309 -0
  26. package/dist/es2019/transforms/list-types.js +1 -0
  27. package/dist/es2019/transforms/list-utils.js +30 -0
  28. package/dist/es2019/ui/DropList/index.js +1 -1
  29. package/dist/es2019/ui/Shortcut/index.js +1 -1
  30. package/dist/es2019/ui/Toolbar/ButtonGroup.js +1 -1
  31. package/dist/es2019/ui/Toolbar/DropdownTriggerWrapper.js +1 -1
  32. package/dist/es2019/ui/Toolbar/DropdownWrapper.compiled.css +2 -1
  33. package/dist/es2019/ui/Toolbar/DropdownWrapper.js +1 -1
  34. package/dist/es2019/ui/Toolbar/ExpandIcon.js +1 -1
  35. package/dist/es2019/ui/Toolbar/Separator.js +1 -1
  36. package/dist/esm/analytics/types/enums.js +1 -0
  37. package/dist/esm/analytics/types/width-events.js +1 -0
  38. package/dist/esm/element-browser/components/ViewMore.js +1 -1
  39. package/dist/esm/monitoring/error.js +1 -1
  40. package/dist/esm/styles/shared/table.js +1 -1
  41. package/dist/esm/transforms/index.js +3 -1
  42. package/dist/esm/transforms/list-transforms.js +300 -0
  43. package/dist/esm/transforms/list-types.js +1 -0
  44. package/dist/esm/transforms/list-utils.js +29 -0
  45. package/dist/esm/ui/DropList/index.js +1 -1
  46. package/dist/esm/ui/Shortcut/index.js +1 -1
  47. package/dist/esm/ui/Toolbar/ButtonGroup.js +1 -1
  48. package/dist/esm/ui/Toolbar/DropdownTriggerWrapper.js +1 -1
  49. package/dist/esm/ui/Toolbar/DropdownWrapper.compiled.css +2 -1
  50. package/dist/esm/ui/Toolbar/DropdownWrapper.js +1 -1
  51. package/dist/esm/ui/Toolbar/ExpandIcon.js +1 -1
  52. package/dist/esm/ui/Toolbar/Separator.js +1 -1
  53. package/dist/types/analytics/types/enums.d.ts +2 -1
  54. package/dist/types/analytics/types/events.d.ts +2 -1
  55. package/dist/types/analytics/types/width-events.d.ts +5 -0
  56. package/dist/types/transforms/index.d.ts +3 -0
  57. package/dist/types/transforms/list-transforms.d.ts +36 -0
  58. package/dist/types/transforms/list-types.d.ts +10 -0
  59. package/dist/types/transforms/list-utils.d.ts +9 -0
  60. package/dist/types-ts4.5/analytics/types/enums.d.ts +2 -1
  61. package/dist/types-ts4.5/analytics/types/events.d.ts +2 -1
  62. package/dist/types-ts4.5/analytics/types/width-events.d.ts +5 -0
  63. package/dist/types-ts4.5/transforms/index.d.ts +3 -0
  64. package/dist/types-ts4.5/transforms/list-transforms.d.ts +36 -0
  65. package/dist/types-ts4.5/transforms/list-types.d.ts +10 -0
  66. package/dist/types-ts4.5/transforms/list-utils.d.ts +9 -0
  67. package/package.json +6 -6
@@ -0,0 +1,309 @@
1
+ import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
2
+ import { findChildrenByType, findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
3
+ import { getSupportedListTypesSet, isBulletOrOrderedList, isTaskList, convertBlockToInlineContent } from './list-utils';
4
+ export const transformListRecursively = props => {
5
+ const transformedItems = [];
6
+ const {
7
+ listNode,
8
+ isSourceBulletOrOrdered,
9
+ isTargetBulletOrOrdered,
10
+ isSourceTask,
11
+ isTargetTask,
12
+ supportedListTypes,
13
+ schema,
14
+ targetNodeType
15
+ } = props;
16
+ const {
17
+ taskList,
18
+ listItem,
19
+ taskItem,
20
+ paragraph
21
+ } = schema.nodes;
22
+ listNode.forEach(child => {
23
+ if (isSourceBulletOrOrdered && isTargetTask) {
24
+ // Convert bullet/ordered => task
25
+ if (child.type === listItem) {
26
+ const inlineContent = [];
27
+ const nestedTaskLists = [];
28
+ child.forEach(grandChild => {
29
+ if (supportedListTypes.has(grandChild.type) && grandChild.type !== taskList) {
30
+ nestedTaskLists.push(transformListRecursively({
31
+ ...props,
32
+ listNode: grandChild
33
+ }));
34
+ } else {
35
+ inlineContent.push(...convertBlockToInlineContent(grandChild, schema));
36
+ }
37
+ });
38
+ transformedItems.push(taskItem.create(null, inlineContent.length > 0 ? inlineContent : null));
39
+ transformedItems.push(...nestedTaskLists);
40
+ }
41
+ } else if (isSourceTask && isTargetBulletOrOrdered) {
42
+ // Convert task => bullet/ordered
43
+ if (child.type === taskItem) {
44
+ const inlineContent = [...child.content.content];
45
+ const paragraphNode = paragraph.create(null, inlineContent.length > 0 ? inlineContent : null);
46
+ transformedItems.push(listItem.create(null, [paragraphNode]));
47
+ } else if (child.type === taskList) {
48
+ const transformedNestedList = transformListRecursively({
49
+ ...props,
50
+ listNode: child
51
+ });
52
+ const lastItem = transformedItems[transformedItems.length - 1];
53
+ if ((lastItem === null || lastItem === void 0 ? void 0 : lastItem.type) === listItem) {
54
+ // Attach nested list to previous item
55
+ const updatedContent = [...lastItem.content.content, transformedNestedList];
56
+ transformedItems[transformedItems.length - 1] = listItem.create(lastItem.attrs, updatedContent);
57
+ } else {
58
+ // No previous item, flatten nested items
59
+ transformedItems.push(...transformedNestedList.content.content);
60
+ }
61
+ }
62
+ } else if (isSourceBulletOrOrdered && isTargetBulletOrOrdered) {
63
+ if (child.type === listItem) {
64
+ const convertedNestedLists = [];
65
+ child.forEach(grandChild => {
66
+ if (supportedListTypes.has(grandChild.type) && grandChild.type !== targetNodeType) {
67
+ const convertedNode = transformListRecursively({
68
+ ...props,
69
+ listNode: grandChild
70
+ });
71
+ convertedNestedLists.push(convertedNode);
72
+ } else {
73
+ convertedNestedLists.push(grandChild);
74
+ }
75
+ });
76
+ transformedItems.push(listItem.create(null, convertedNestedLists));
77
+ }
78
+ }
79
+ });
80
+ return targetNodeType.create(null, transformedItems);
81
+ };
82
+
83
+ /**
84
+ * Transform list structure between different list types
85
+ */
86
+ export const transformListStructure = context => {
87
+ const {
88
+ tr,
89
+ sourceNode,
90
+ sourcePos,
91
+ targetNodeType
92
+ } = context;
93
+ const nodes = tr.doc.type.schema.nodes;
94
+ try {
95
+ const listNode = {
96
+ node: sourceNode,
97
+ pos: sourcePos
98
+ };
99
+ const {
100
+ node: sourceList,
101
+ pos: listPos
102
+ } = listNode;
103
+ // const { taskList, listItem, taskItem, paragraph } = nodes;
104
+
105
+ const isSourceBulletOrOrdered = isBulletOrOrderedList(sourceList.type);
106
+ const isTargetTask = isTaskList(targetNodeType);
107
+ const isSourceTask = isTaskList(sourceList.type);
108
+ const isTargetBulletOrOrdered = isBulletOrOrderedList(targetNodeType);
109
+ const supportedListTypes = getSupportedListTypesSet(nodes);
110
+ const newList = transformListRecursively({
111
+ isSourceBulletOrOrdered,
112
+ isSourceTask,
113
+ isTargetBulletOrOrdered,
114
+ isTargetTask,
115
+ listNode: sourceList,
116
+ schema: tr.doc.type.schema,
117
+ supportedListTypes,
118
+ targetNodeType
119
+ });
120
+ tr.replaceWith(listPos, listPos + sourceList.nodeSize, newList);
121
+ return tr;
122
+ } catch {
123
+ return tr;
124
+ }
125
+ };
126
+
127
+ /**
128
+ * Transform between different list types
129
+ */
130
+ export const transformBetweenListTypes = context => {
131
+ const {
132
+ tr,
133
+ sourceNode,
134
+ sourcePos,
135
+ targetNodeType
136
+ } = context;
137
+ const {
138
+ nodes
139
+ } = tr.doc.type.schema;
140
+ const sourceListType = sourceNode.type;
141
+ const isSourceBulletOrOrdered = isBulletOrOrderedList(sourceListType);
142
+ const isTargetTask = isTaskList(targetNodeType);
143
+ const isSourceTask = isTaskList(sourceListType);
144
+ const isTargetBulletOrOrdered = isBulletOrOrderedList(targetNodeType);
145
+
146
+ // Check if we need structure transformation
147
+ const needsStructureTransform = isSourceBulletOrOrdered && isTargetTask || isSourceTask && isTargetBulletOrOrdered;
148
+ try {
149
+ if (!needsStructureTransform) {
150
+ // Simple type change for same structure lists (bullet <-> ordered)
151
+ // Apply to the main list
152
+ tr.setNodeMarkup(sourcePos, targetNodeType);
153
+
154
+ // Apply to nested lists
155
+ const listStart = sourcePos;
156
+ const listEnd = sourcePos + sourceNode.nodeSize;
157
+ const supportedListTypesSet = getSupportedListTypesSet(nodes);
158
+ tr.doc.nodesBetween(listStart, listEnd, (node, pos, parent) => {
159
+ // Only process nested lists (not the root list we already handled)
160
+ if (supportedListTypesSet.has(node.type) && pos !== sourcePos) {
161
+ const isNestedList = parent && (supportedListTypesSet.has(parent.type) || parent.type === nodes.listItem);
162
+ if (isNestedList) {
163
+ const shouldTransformNode = node.type === sourceListType || isBulletOrOrderedList(node.type) && isTargetBulletOrOrdered;
164
+ if (shouldTransformNode) {
165
+ tr.setNodeMarkup(pos, targetNodeType);
166
+ }
167
+ }
168
+ }
169
+ return true; // Continue traversing
170
+ });
171
+ return tr;
172
+ } else {
173
+ return transformListStructure(context);
174
+ }
175
+ } catch {
176
+ return null;
177
+ }
178
+ };
179
+
180
+ /**
181
+ * Transform selection to task list
182
+ * Handles the special structure where taskItem contains text directly (no paragraph wrapper)
183
+ */
184
+ export const transformToTaskList = (tr, range, targetNodeType, targetAttrs, nodes) => {
185
+ try {
186
+ const {
187
+ taskItem
188
+ } = nodes;
189
+ const listItems = [];
190
+
191
+ // Process each block in the range
192
+ tr.doc.nodesBetween(range.start, range.end, node => {
193
+ if (node.isBlock) {
194
+ // For block nodes like paragraphs, directly use their inline content
195
+ const inlineContent = [...node.content.content];
196
+ if (inlineContent.length > 0) {
197
+ // Create task item with inline content directly
198
+ const listItem = taskItem.create(targetAttrs, inlineContent);
199
+ listItems.push(listItem);
200
+ }
201
+ }
202
+ return false; // Don't traverse into children
203
+ });
204
+ if (listItems.length === 0) {
205
+ return null;
206
+ }
207
+
208
+ // Create the new task list
209
+ const newList = targetNodeType.create(targetAttrs, listItems);
210
+
211
+ // Replace the range with the new list
212
+ tr.replaceWith(range.start, range.end, newList);
213
+ return tr;
214
+ } catch {
215
+ return null;
216
+ }
217
+ };
218
+ export const transformTaskListToBlockNodes = context => {
219
+ const {
220
+ tr,
221
+ targetNodeType,
222
+ targetAttrs,
223
+ sourceNode,
224
+ sourcePos
225
+ } = context;
226
+ const {
227
+ selection
228
+ } = tr;
229
+ const schema = selection.$from.doc.type.schema;
230
+ const taskItemsResult = findChildrenByType(sourceNode, schema.nodes.taskItem);
231
+ const taskItems = taskItemsResult.map(item => item.node);
232
+ const taskItemFragments = taskItems.map(taskItem => taskItem.content);
233
+ let targetNodes = [];
234
+
235
+ // Convert fragments to headings if target is heading
236
+ if (targetNodeType === schema.nodes.heading && targetAttrs) {
237
+ // convert the fragments to headings
238
+ const targetHeadingLevel = targetAttrs.level;
239
+ targetNodes = taskItemFragments.map(fragment => schema.nodes.heading.createChecked({
240
+ level: targetHeadingLevel
241
+ }, fragment.content));
242
+ }
243
+
244
+ // Convert fragments to paragraphs if target is paragraphs
245
+ if (targetNodeType === schema.nodes.paragraph) {
246
+ // convert the fragments to paragraphs
247
+ targetNodes = taskItemFragments.map(fragment => schema.nodes.paragraph.createChecked({}, fragment.content));
248
+ }
249
+
250
+ // Convert fragments to code block if target is code block
251
+ if (targetNodeType === schema.nodes.codeBlock) {
252
+ // convert the fragments to one code block
253
+ const codeBlockContent = taskItemFragments.map(fragment => fragment.textBetween(0, fragment.size, '\n')).join('\n');
254
+ targetNodes = [schema.nodes.codeBlock.createChecked({}, schema.text(codeBlockContent))];
255
+ }
256
+
257
+ // Replace the task list node with the new content in the transaction
258
+ const slice = new Slice(Fragment.fromArray(targetNodes), 0, 0);
259
+ const rangeStart = sourcePos !== null ? sourcePos : selection.from;
260
+ tr.replaceRange(rangeStart, rangeStart + sourceNode.nodeSize, slice);
261
+ return tr;
262
+ };
263
+ export const getFormattedNode = tr => {
264
+ const {
265
+ selection
266
+ } = tr;
267
+ const {
268
+ nodes
269
+ } = tr.doc.type.schema;
270
+
271
+ // Find the node to format from the current selection
272
+ let nodeToFormat;
273
+ let nodePos = selection.from;
274
+
275
+ // Try to find the current node from selection
276
+ const selectedNode = findSelectedNodeOfType([nodes.paragraph, nodes.heading, nodes.blockquote, nodes.panel, nodes.expand, nodes.codeBlock, nodes.bulletList, nodes.orderedList, nodes.taskList, nodes.layoutSection])(selection);
277
+ if (selectedNode) {
278
+ nodeToFormat = selectedNode.node;
279
+ nodePos = selectedNode.pos;
280
+ } else {
281
+ // Try to find parent node (including list parents)
282
+ const parentNode = findParentNodeOfType([nodes.blockquote, nodes.panel, nodes.expand, nodes.codeBlock, nodes.listItem, nodes.taskItem, nodes.layoutSection])(selection);
283
+ if (parentNode) {
284
+ nodeToFormat = parentNode.node;
285
+ nodePos = parentNode.pos;
286
+ const paragraphOrHeadingNode = findParentNodeOfType([nodes.paragraph, nodes.heading])(selection);
287
+ // Special case: if we found a listItem, check if we need the parent list instead
288
+ if (parentNode.node.type === nodes.listItem || parentNode.node.type === nodes.taskItem) {
289
+ const listParent = findParentNodeOfType([nodes.bulletList, nodes.orderedList, nodes.taskList])(selection);
290
+ if (listParent) {
291
+ // For list transformations, we want the list parent, not the listItem
292
+ nodeToFormat = listParent.node;
293
+ nodePos = listParent.pos;
294
+ }
295
+ } else if (parentNode.node.type !== nodes.blockquote && paragraphOrHeadingNode) {
296
+ nodeToFormat = paragraphOrHeadingNode.node;
297
+ nodePos = paragraphOrHeadingNode.pos;
298
+ }
299
+ }
300
+ }
301
+ if (!nodeToFormat) {
302
+ nodeToFormat = selection.$from.node();
303
+ nodePos = selection.$from.pos;
304
+ }
305
+ return {
306
+ node: nodeToFormat,
307
+ pos: nodePos
308
+ };
309
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,30 @@
1
+ // List type utilities
2
+ export const isBulletOrOrderedList = nodeType => {
3
+ return nodeType.name === 'bulletList' || nodeType.name === 'orderedList';
4
+ };
5
+ export const isTaskList = nodeType => {
6
+ return nodeType.name === 'taskList';
7
+ };
8
+ export const getSupportedListTypes = nodes => {
9
+ return [nodes.bulletList, nodes.orderedList, nodes.taskList].filter(Boolean);
10
+ };
11
+ export const getSupportedListTypesSet = nodes => {
12
+ return new Set(getSupportedListTypes(nodes));
13
+ };
14
+
15
+ /**
16
+ * Convert a block node to inline content suitable for task items
17
+ */
18
+ export const convertBlockToInlineContent = (node, schema) => {
19
+ const {
20
+ paragraph
21
+ } = schema.nodes;
22
+ if (node.type === paragraph) {
23
+ return [...node.content.content];
24
+ }
25
+ if (node.isBlock) {
26
+ const textContent = node.textContent;
27
+ return textContent ? [schema.text(textContent)] : [];
28
+ }
29
+ return [node];
30
+ };
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "109.2.0";
17
+ const packageVersion = "109.3.1";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./index.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* ButtonGroup.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* ButtonGroup.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./ButtonGroup.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* DropdownTriggerWrapper.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* DropdownTriggerWrapper.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./DropdownTriggerWrapper.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -2,6 +2,7 @@
2
2
  ._1fvdglyw button:not([disabled]):after{border:none}._18u0idpf{margin-left:0}
3
3
  ._1e0c1txw{display:flex}
4
4
  ._1ul91wug{min-width:auto}
5
+ ._1xdi1txw >span{display:flex}
5
6
  ._1ylx1txw >div>div{display:flex}
6
7
  ._4cvr1h6o{align-items:center}
7
- ._p7r11txw >div, ._1xdi1txw >span{display:flex}
8
+ ._p7r11txw >div{display:flex}
@@ -1,4 +1,4 @@
1
- /* DropdownWrapper.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* DropdownWrapper.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./DropdownWrapper.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* ExpandIcon.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* ExpandIcon.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./ExpandIcon.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* Separator.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* Separator.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./Separator.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -190,6 +190,7 @@ export var ACTION = /*#__PURE__*/function (ACTION) {
190
190
  ACTION["SUGGESTION_INSERTED"] = "suggestionInserted";
191
191
  ACTION["SUGGESTION_DISMISSED"] = "suggestionDismissed";
192
192
  ACTION["SUGGESTION_VIEWED"] = "suggestionViewed";
193
+ ACTION["INITIAL_EDITOR_WIDTH"] = "initialEditorWidth";
193
194
  return ACTION;
194
195
  }({});
195
196
  export var INPUT_METHOD = /*#__PURE__*/function (INPUT_METHOD) {
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- /* ViewMore.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* ViewMore.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./ViewMore.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "109.2.0";
10
+ var packageVersion = "109.3.1";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // Ignored via go/ees007
@@ -53,7 +53,7 @@ var firstNodeWithNotMarginTop = function firstNodeWithNotMarginTop() {
53
53
 
54
54
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Appears safe to auto-fix, but leaving it up to the team to remediate as the readability only gets worse with autofixing
55
55
  var tableSharedStyle = function tableSharedStyle() {
56
- return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t", "\n\t.", " {\n\t\tposition: relative;\n\t\tmargin: 0 auto ", ";\n\t\tbox-sizing: border-box;\n\n\t\t/**\n * Fix block top alignment inside table cells.\n */\n\t\t.decisionItemView-content-wrap:first-of-type > div {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.", "[data-number-column='true'] {\n\t\tpadding-left: ", "px;\n\t\tclear: both;\n\t}\n\n\t.", " {\n\t\twill-change: width, margin-left;\n\t}\n\n\t.", " table {\n\t\twill-change: width;\n\t}\n\n\t.", " > table {\n\t\tmargin: ", " 0 0 0;\n\t}\n\n\t.", " > table,\n\t.", " > table {\n\t\tmargin: ", " ", " 0 0;\n\t}\n\n\t/* support panel nested in table */\n\t", "\n\n\t/* avoid applying styles to nested tables (possible via extensions) */\n\t.", " > table,\n\t.", " > table,\n\t.", " > table {\n\t\tborder-collapse: collapse;\n\t\tborder: ", "px solid\n\t\t\t", ";\n\t\ttable-layout: fixed;\n\t\tfont-size: 1em;\n\t\twidth: 100%;\n\n\t\t&[data-autosize='true'] {\n\t\t\ttable-layout: auto;\n\t\t}\n\n\t\t& {\n\t\t\t* {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\thr {\n\t\t\t\tbox-sizing: content-box;\n\t\t\t}\n\n\t\t\ttbody {\n\t\t\t\tborder-bottom: none;\n\t\t\t}\n\t\t\tth td {\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\n\t\t\t", " {\n\t\t\t\tmin-width: ", "px;\n\t\t\t\tfont-weight: ", ";\n\t\t\t\tvertical-align: top;\n\t\t\t\tborder: 1px solid ", ";\n\t\t\t\tborder-right-width: 0;\n\t\t\t\tborder-bottom-width: 0;\n\n\t\t\t\tpadding: ", ";\n\t\t\t\t/* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n\t\t\t\t", "\n\n\t\t\t\t", "\n\n\t\t\t\tth p:not(:first-of-type),\n\t\t\t\ttd p:not(:first-of-type) {\n\t\t\t\t\tmargin-top: ", ";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Ensures nested tables are compatible with parent table background color - uses specificity to ensure tables nested by extensions are not affected */\n\t\t\t> tbody > tr > td {\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\n\t\t\tth {\n\t\t\t\tbackground-color: ", ";\n\t\t\t\ttext-align: left;\n\n\t\t\t\t/* only apply this styling to codeblocks in default background headercells */\n\t\t\t\t/* TODO this needs to be overhauled as it relies on unsafe selectors */\n\t\t\t\t&:not([style]):not(.danger) {\n\t\t\t\t\t.", ":not(.danger) {\n\t\t\t\t\t\tbackground-color: ", ";\n\n\t\t\t\t\t\t:not(.", ") {\n\t\t\t\t\t\t\tbox-shadow: 0px 0px 0px 1px ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\tbackground-image: ", ";\n\n\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* this is only relevant to the element taken care of by renderer */\n\t\t\t\t\t\t> [data-ds--code--code-block] {\n\t\t\t\t\t\t\tbackground-image: ", "!important;\n\n\t\t\t\t\t\t\tbackground-color: ", "!important;\n\n\t\t\t\t\t\t\t/* selector lives inside @atlaskit/code */\n\t\t\t\t\t\t\t--ds--code--line-number-bg-color: ", ";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n"])), tableCellBackgroundStyleOverride(), TableSharedCssClassName.TABLE_CONTAINER, "var(--ds-space-200, 16px)", TableSharedCssClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, "var(--ds-space-300, 24px)", TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", fg('platform_editor_bordered_panel_nested_in_table') ? ".".concat(TableSharedCssClassName.TABLE_NODE_WRAPPER, " .ak-editor-panel {\n\t\t\tborder: ", "var(--ds-border-width, 1px)", " solid ", "var(--ds-border, #d9dbea)", ";\n\t\t}") : '', TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-neutral-subtle, white)", fg('platform_editor_renderer_table_header_styles') ? "> tbody > tr > th, > tbody > tr > td" : 'th, td', tableCellMinWidth, "var(--ds-font-weight-regular, 400)", "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-space-100, 8px)", browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : '', firstNodeWithNotMarginTop(), "var(--ds-space-150, 12px)", "var(--ds-surface, #FFFFFF)", "var(--ds-background-accent-gray-subtlest, ".concat(akEditorTableToolbar, ")"), CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, rgb(235, 237, 240))", akEditorSelectedNodeClassName, "var(--ds-border, transparent)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, overflowShadow({
56
+ return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t", "\n\t.", " {\n\t\tposition: relative;\n\t\tmargin: 0 auto ", ";\n\t\tbox-sizing: border-box;\n\n\t\t/**\n * Fix block top alignment inside table cells.\n */\n\t\t.decisionItemView-content-wrap:first-of-type > div {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.", "[data-number-column='true'] {\n\t\tpadding-left: ", "px;\n\t\tclear: both;\n\t}\n\n\t.", " {\n\t\twill-change: width, margin-left;\n\t}\n\n\t.", " table {\n\t\twill-change: width;\n\t}\n\n\t.", " > table {\n\t\tmargin: ", " 0 0 0;\n\t}\n\n\t.", " > table,\n\t.", " > table {\n\t\tmargin: ", " ", " 0 0;\n\t}\n\n\t/* support panel nested in table */\n\t", "\n\n\t/* avoid applying styles to nested tables (possible via extensions) */\n\t.", " > table,\n\t.", " > table,\n\t.", " > table {\n\t\tborder-collapse: collapse;\n\t\tborder: ", "px solid\n\t\t\t", ";\n\t\ttable-layout: fixed;\n\t\tfont-size: 1em;\n\t\twidth: 100%;\n\n\t\t&[data-autosize='true'] {\n\t\t\ttable-layout: auto;\n\t\t}\n\n\t\t& {\n\t\t\t* {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\thr {\n\t\t\t\tbox-sizing: content-box;\n\t\t\t}\n\n\t\t\ttbody {\n\t\t\t\tborder-bottom: none;\n\t\t\t}\n\t\t\tth td {\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\n\n\t\t\t> tbody > tr > th, > tbody > tr > td {\n\t\t\t\tmin-width: ", "px;\n\t\t\t\tfont-weight: ", ";\n\t\t\t\tvertical-align: top;\n\t\t\t\tborder: 1px solid ", ";\n\t\t\t\tborder-right-width: 0;\n\t\t\t\tborder-bottom-width: 0;\n\n\t\t\t\tpadding: ", ";\n\t\t\t\t/* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n\t\t\t\t", "\n\n\t\t\t\t", "\n\n\t\t\t\tth p:not(:first-of-type),\n\t\t\t\ttd p:not(:first-of-type) {\n\t\t\t\t\tmargin-top: ", ";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Ensures nested tables are compatible with parent table background color - uses specificity to ensure tables nested by extensions are not affected */\n\t\t\t> tbody > tr > td {\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\n\t\t\tth {\n\t\t\t\tbackground-color: ", ";\n\t\t\t\ttext-align: left;\n\n\t\t\t\t/* only apply this styling to codeblocks in default background headercells */\n\t\t\t\t/* TODO this needs to be overhauled as it relies on unsafe selectors */\n\t\t\t\t&:not([style]):not(.danger) {\n\t\t\t\t\t.", ":not(.danger) {\n\t\t\t\t\t\tbackground-color: ", ";\n\n\t\t\t\t\t\t:not(.", ") {\n\t\t\t\t\t\t\tbox-shadow: 0px 0px 0px 1px ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\tbackground-image: ", ";\n\n\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* this is only relevant to the element taken care of by renderer */\n\t\t\t\t\t\t> [data-ds--code--code-block] {\n\t\t\t\t\t\t\tbackground-image: ", "!important;\n\n\t\t\t\t\t\t\tbackground-color: ", "!important;\n\n\t\t\t\t\t\t\t/* selector lives inside @atlaskit/code */\n\t\t\t\t\t\t\t--ds--code--line-number-bg-color: ", ";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n"])), tableCellBackgroundStyleOverride(), TableSharedCssClassName.TABLE_CONTAINER, "var(--ds-space-200, 16px)", TableSharedCssClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, "var(--ds-space-300, 24px)", TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", fg('platform_editor_bordered_panel_nested_in_table') ? ".".concat(TableSharedCssClassName.TABLE_NODE_WRAPPER, " .ak-editor-panel {\n\t\t\tborder: ", "var(--ds-border-width, 1px)", " solid ", "var(--ds-border, #d9dbea)", ";\n\t\t}") : '', TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-neutral-subtle, white)", tableCellMinWidth, "var(--ds-font-weight-regular, 400)", "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-space-100, 8px)", browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : '', firstNodeWithNotMarginTop(), "var(--ds-space-150, 12px)", "var(--ds-surface, #FFFFFF)", "var(--ds-background-accent-gray-subtlest, ".concat(akEditorTableToolbar, ")"), CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, rgb(235, 237, 240))", akEditorSelectedNodeClassName, "var(--ds-border, transparent)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, overflowShadow({
57
57
  leftCoverWidth: "var(--ds-space-300, 24px)"
58
58
  }), "var(--ds-background-neutral, rgb(235, 237, 240))", CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-neutral, rgb(226, 229, 233))", overflowShadow({
59
59
  leftCoverWidth: "var(--ds-space-300, 24px)"
@@ -5,4 +5,6 @@ export { unwrapContentFromLayout, removeLayoutFromFirstChild, removeLayoutFromLa
5
5
  export { findExpand, transformSliceToRemoveOpenExpand, transformSliceToRemoveOpenNestedExpand, transformSliceNestedExpandToExpand, transformSliceExpandToNestedExpand } from './expand';
6
6
  export { transformSliceToRemoveOpenBodiedExtension, transformSliceToRemoveOpenMultiBodiedExtension, transformSliceToRemoveLegacyContentMacro, transformSliceToRemoveMacroId } from './extension';
7
7
  export { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark, findCodeBlock } from './code-block';
8
- export { transformSliceToDecisionList } from './decision-list';
8
+ export { transformSliceToDecisionList } from './decision-list';
9
+ export { transformListStructure, transformBetweenListTypes, transformListRecursively, transformToTaskList, transformTaskListToBlockNodes, getFormattedNode } from './list-transforms';
10
+ export { isBulletOrOrderedList, isTaskList, getSupportedListTypesSet, convertBlockToInlineContent } from './list-utils';