@atlaskit/editor-plugin-block-controls 2.21.3 → 2.21.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 +11 -0
- package/dist/cjs/pm-plugins/decorations-anchor.js +2 -1
- package/dist/cjs/ui/drag-handle.js +9 -1
- package/dist/es2019/pm-plugins/decorations-anchor.js +2 -1
- package/dist/es2019/ui/drag-handle.js +9 -1
- package/dist/esm/pm-plugins/decorations-anchor.js +2 -1
- package/dist/esm/ui/drag-handle.js +9 -1
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 2.21.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#102952](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102952)
|
|
8
|
+
[`6d865148eda80`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6d865148eda80) -
|
|
9
|
+
Fix incorrect drop zone on table cell
|
|
10
|
+
- [#103494](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103494)
|
|
11
|
+
[`955dbd85f329f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/955dbd85f329f) -
|
|
12
|
+
[ux] ED-26266: Fixed the drag handle highlight when selecting multiple line in Firefox
|
|
13
|
+
|
|
3
14
|
## 2.21.3
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.shouldDescendIntoNode = exports.nodeDecorations = exports.findNodeDecs = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
10
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
11
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
11
12
|
var _decorationsCommon = require("./decorations-common");
|
|
12
13
|
var IGNORE_NODES = ['tableCell', 'tableHeader', 'tableRow', 'listItem', 'caption', 'layoutColumn'];
|
|
@@ -17,7 +18,7 @@ var shouldDescendIntoNode = exports.shouldDescendIntoNode = function shouldDesce
|
|
|
17
18
|
// Optimisation to avoid drawing node decorations for empty table cells
|
|
18
19
|
if (['tableCell', 'tableHeader'].includes(node.type.name)) {
|
|
19
20
|
var _node$firstChild;
|
|
20
|
-
if (node.childCount === 1 && ((_node$firstChild = node.firstChild) === null || _node$firstChild === void 0 ? void 0 : _node$firstChild.type.name) === 'paragraph') {
|
|
21
|
+
if (node.childCount === 1 && ((_node$firstChild = node.firstChild) === null || _node$firstChild === void 0 ? void 0 : _node$firstChild.type.name) === 'paragraph' && ((0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_6') ? node.firstChild.childCount === 0 : true)) {
|
|
21
22
|
return false;
|
|
22
23
|
}
|
|
23
24
|
}
|
|
@@ -72,6 +72,11 @@ var dragHandleButtonStyles = (0, _react2.css)({
|
|
|
72
72
|
outline: "2px solid ".concat("var(--ds-border-focused, #388BFF)")
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
|
+
var dragHandleMultiLineSelectionFixFirefox = (0, _react2.css)({
|
|
76
|
+
'&::selection': {
|
|
77
|
+
backgroundColor: 'transparent'
|
|
78
|
+
}
|
|
79
|
+
});
|
|
75
80
|
var layoutColumnDragHandleStyles = (0, _react2.css)({
|
|
76
81
|
transform: 'rotate(90deg)'
|
|
77
82
|
});
|
|
@@ -430,7 +435,10 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
430
435
|
// eslint-disable-next-line @atlaskit/design-system/no-html-button
|
|
431
436
|
(0, _react2.jsx)("button", {
|
|
432
437
|
type: "button",
|
|
433
|
-
css: [dragHandleButtonStyles,
|
|
438
|
+
css: [dragHandleButtonStyles,
|
|
439
|
+
// ED-26266: Fixed the drag handle highlight when selecting multiple line in Firefox
|
|
440
|
+
// See https://product-fabric.atlassian.net/browse/ED-26266
|
|
441
|
+
_browser.browser.gecko && (0, _platformFeatureFlags.fg)('platform_editor_dnd_handle_highlight_fix_firefox') && dragHandleMultiLineSelectionFixFirefox, (0, _experiments.editorExperiment)('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && selectedStyles],
|
|
434
442
|
ref: buttonRef
|
|
435
443
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
436
444
|
,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
4
|
import { getNestedDepth, getNodeAnchor, TYPE_NODE_DEC } from './decorations-common';
|
|
4
5
|
const IGNORE_NODES = ['tableCell', 'tableHeader', 'tableRow', 'listItem', 'caption', 'layoutColumn'];
|
|
@@ -9,7 +10,7 @@ export const shouldDescendIntoNode = node => {
|
|
|
9
10
|
// Optimisation to avoid drawing node decorations for empty table cells
|
|
10
11
|
if (['tableCell', 'tableHeader'].includes(node.type.name)) {
|
|
11
12
|
var _node$firstChild;
|
|
12
|
-
if (node.childCount === 1 && ((_node$firstChild = node.firstChild) === null || _node$firstChild === void 0 ? void 0 : _node$firstChild.type.name) === 'paragraph') {
|
|
13
|
+
if (node.childCount === 1 && ((_node$firstChild = node.firstChild) === null || _node$firstChild === void 0 ? void 0 : _node$firstChild.type.name) === 'paragraph' && (fg('platform_editor_element_dnd_nested_fix_patch_6') ? node.firstChild.childCount === 0 : true)) {
|
|
13
14
|
return false;
|
|
14
15
|
}
|
|
15
16
|
}
|
|
@@ -61,6 +61,11 @@ const dragHandleButtonStyles = css({
|
|
|
61
61
|
outline: `2px solid ${"var(--ds-border-focused, #388BFF)"}`
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
|
+
const dragHandleMultiLineSelectionFixFirefox = css({
|
|
65
|
+
'&::selection': {
|
|
66
|
+
backgroundColor: 'transparent'
|
|
67
|
+
}
|
|
68
|
+
});
|
|
64
69
|
const layoutColumnDragHandleStyles = css({
|
|
65
70
|
transform: 'rotate(90deg)'
|
|
66
71
|
});
|
|
@@ -409,7 +414,10 @@ export const DragHandle = ({
|
|
|
409
414
|
// eslint-disable-next-line @atlaskit/design-system/no-html-button
|
|
410
415
|
jsx("button", {
|
|
411
416
|
type: "button",
|
|
412
|
-
css: [dragHandleButtonStyles,
|
|
417
|
+
css: [dragHandleButtonStyles,
|
|
418
|
+
// ED-26266: Fixed the drag handle highlight when selecting multiple line in Firefox
|
|
419
|
+
// See https://product-fabric.atlassian.net/browse/ED-26266
|
|
420
|
+
browser.gecko && fg('platform_editor_dnd_handle_highlight_fix_firefox') && dragHandleMultiLineSelectionFixFirefox, editorExperiment('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && selectedStyles],
|
|
413
421
|
ref: buttonRef
|
|
414
422
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
415
423
|
,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
5
|
import { getNestedDepth, getNodeAnchor, TYPE_NODE_DEC } from './decorations-common';
|
|
5
6
|
var IGNORE_NODES = ['tableCell', 'tableHeader', 'tableRow', 'listItem', 'caption', 'layoutColumn'];
|
|
@@ -10,7 +11,7 @@ export var shouldDescendIntoNode = function shouldDescendIntoNode(node) {
|
|
|
10
11
|
// Optimisation to avoid drawing node decorations for empty table cells
|
|
11
12
|
if (['tableCell', 'tableHeader'].includes(node.type.name)) {
|
|
12
13
|
var _node$firstChild;
|
|
13
|
-
if (node.childCount === 1 && ((_node$firstChild = node.firstChild) === null || _node$firstChild === void 0 ? void 0 : _node$firstChild.type.name) === 'paragraph') {
|
|
14
|
+
if (node.childCount === 1 && ((_node$firstChild = node.firstChild) === null || _node$firstChild === void 0 ? void 0 : _node$firstChild.type.name) === 'paragraph' && (fg('platform_editor_element_dnd_nested_fix_patch_6') ? node.firstChild.childCount === 0 : true)) {
|
|
14
15
|
return false;
|
|
15
16
|
}
|
|
16
17
|
}
|
|
@@ -63,6 +63,11 @@ var dragHandleButtonStyles = css({
|
|
|
63
63
|
outline: "2px solid ".concat("var(--ds-border-focused, #388BFF)")
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
+
var dragHandleMultiLineSelectionFixFirefox = css({
|
|
67
|
+
'&::selection': {
|
|
68
|
+
backgroundColor: 'transparent'
|
|
69
|
+
}
|
|
70
|
+
});
|
|
66
71
|
var layoutColumnDragHandleStyles = css({
|
|
67
72
|
transform: 'rotate(90deg)'
|
|
68
73
|
});
|
|
@@ -421,7 +426,10 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
421
426
|
// eslint-disable-next-line @atlaskit/design-system/no-html-button
|
|
422
427
|
jsx("button", {
|
|
423
428
|
type: "button",
|
|
424
|
-
css: [dragHandleButtonStyles,
|
|
429
|
+
css: [dragHandleButtonStyles,
|
|
430
|
+
// ED-26266: Fixed the drag handle highlight when selecting multiple line in Firefox
|
|
431
|
+
// See https://product-fabric.atlassian.net/browse/ED-26266
|
|
432
|
+
browser.gecko && fg('platform_editor_dnd_handle_highlight_fix_firefox') && dragHandleMultiLineSelectionFixFirefox, editorExperiment('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && selectedStyles],
|
|
425
433
|
ref: buttonRef
|
|
426
434
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
427
435
|
,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "2.21.
|
|
3
|
+
"version": "2.21.4",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -147,6 +147,9 @@
|
|
|
147
147
|
},
|
|
148
148
|
"platform_editor_dnd_update_drag_start_target": {
|
|
149
149
|
"type": "boolean"
|
|
150
|
+
},
|
|
151
|
+
"platform_editor_dnd_handle_highlight_fix_firefox": {
|
|
152
|
+
"type": "boolean"
|
|
150
153
|
}
|
|
151
154
|
}
|
|
152
155
|
}
|