@atlaskit/editor-plugin-block-controls 2.15.4 → 2.15.5
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,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 2.15.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#177432](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/177432)
|
|
8
|
+
[`08919a1aae553`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/08919a1aae553) -
|
|
9
|
+
[ux] Fixes top position of the drag handle for layoutColumn node type.
|
|
10
|
+
|
|
3
11
|
## 2.15.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -4,18 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getTopPosition = exports.getLeftPosition = void 0;
|
|
7
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
7
8
|
var _consts = require("../../ui/consts");
|
|
8
9
|
var getTopPosition = exports.getTopPosition = function getTopPosition(dom, type) {
|
|
9
10
|
if (!dom) {
|
|
10
11
|
return 'auto';
|
|
11
12
|
}
|
|
12
13
|
var table = dom.querySelector('table');
|
|
13
|
-
|
|
14
|
+
var isTable = (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_post_fix_patch_1') ? table && (!type || type === 'table') : table;
|
|
15
|
+
if (isTable) {
|
|
14
16
|
return "".concat(dom.offsetTop + ((table === null || table === void 0 ? void 0 : table.offsetTop) || 0), "px");
|
|
15
17
|
} else if (type === 'rule') {
|
|
16
18
|
return "".concat(dom.offsetTop - _consts.DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT, "px");
|
|
17
19
|
} else if (type === 'layoutColumn') {
|
|
18
|
-
|
|
20
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_post_fix_patch_1')) {
|
|
21
|
+
return "".concat(-dom.offsetTop / 2, "px");
|
|
22
|
+
} else {
|
|
23
|
+
return "".concat(-_consts.DRAG_HANDLE_WIDTH, "px");
|
|
24
|
+
}
|
|
19
25
|
} else if (type === 'heading-3') {
|
|
20
26
|
return "".concat(dom.offsetTop - _consts.DRAG_HANDLE_H3_TOP_ADJUSTMENT, "px");
|
|
21
27
|
} else if (type === 'heading-4') {
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import { DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT, DRAG_HANDLE_H3_TOP_ADJUSTMENT, DRAG_HANDLE_H4_TOP_ADJUSTMENT, DRAG_HANDLE_H5_TOP_ADJUSTMENT, DRAG_HANDLE_H6_TOP_ADJUSTMENT, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_WIDTH, dragHandleGap } from '../../ui/consts';
|
|
2
3
|
export const getTopPosition = (dom, type) => {
|
|
3
4
|
if (!dom) {
|
|
4
5
|
return 'auto';
|
|
5
6
|
}
|
|
6
7
|
const table = dom.querySelector('table');
|
|
7
|
-
|
|
8
|
+
const isTable = fg('platform_editor_advanced_layouts_post_fix_patch_1') ? table && (!type || type === 'table') : table;
|
|
9
|
+
if (isTable) {
|
|
8
10
|
return `${dom.offsetTop + ((table === null || table === void 0 ? void 0 : table.offsetTop) || 0)}px`;
|
|
9
11
|
} else if (type === 'rule') {
|
|
10
12
|
return `${dom.offsetTop - DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT}px`;
|
|
11
13
|
} else if (type === 'layoutColumn') {
|
|
12
|
-
|
|
14
|
+
if (fg('platform_editor_advanced_layouts_post_fix_patch_1')) {
|
|
15
|
+
return `${-dom.offsetTop / 2}px`;
|
|
16
|
+
} else {
|
|
17
|
+
return `${-DRAG_HANDLE_WIDTH}px`;
|
|
18
|
+
}
|
|
13
19
|
} else if (type === 'heading-3') {
|
|
14
20
|
return `${dom.offsetTop - DRAG_HANDLE_H3_TOP_ADJUSTMENT}px`;
|
|
15
21
|
} else if (type === 'heading-4') {
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import { DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT, DRAG_HANDLE_H3_TOP_ADJUSTMENT, DRAG_HANDLE_H4_TOP_ADJUSTMENT, DRAG_HANDLE_H5_TOP_ADJUSTMENT, DRAG_HANDLE_H6_TOP_ADJUSTMENT, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_WIDTH, dragHandleGap } from '../../ui/consts';
|
|
2
3
|
export var getTopPosition = function getTopPosition(dom, type) {
|
|
3
4
|
if (!dom) {
|
|
4
5
|
return 'auto';
|
|
5
6
|
}
|
|
6
7
|
var table = dom.querySelector('table');
|
|
7
|
-
|
|
8
|
+
var isTable = fg('platform_editor_advanced_layouts_post_fix_patch_1') ? table && (!type || type === 'table') : table;
|
|
9
|
+
if (isTable) {
|
|
8
10
|
return "".concat(dom.offsetTop + ((table === null || table === void 0 ? void 0 : table.offsetTop) || 0), "px");
|
|
9
11
|
} else if (type === 'rule') {
|
|
10
12
|
return "".concat(dom.offsetTop - DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT, "px");
|
|
11
13
|
} else if (type === 'layoutColumn') {
|
|
12
|
-
|
|
14
|
+
if (fg('platform_editor_advanced_layouts_post_fix_patch_1')) {
|
|
15
|
+
return "".concat(-dom.offsetTop / 2, "px");
|
|
16
|
+
} else {
|
|
17
|
+
return "".concat(-DRAG_HANDLE_WIDTH, "px");
|
|
18
|
+
}
|
|
13
19
|
} else if (type === 'heading-3') {
|
|
14
20
|
return "".concat(dom.offsetTop - DRAG_HANDLE_H3_TOP_ADJUSTMENT, "px");
|
|
15
21
|
} else if (type === 'heading-4') {
|