@atlaskit/editor-plugin-block-controls 7.2.9 → 7.2.11
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 +18 -2
- package/dist/cjs/pm-plugins/handle-mouse-down.js +14 -2
- package/dist/cjs/pm-plugins/handle-mouse-over.js +13 -3
- package/dist/cjs/pm-plugins/main.js +1 -1
- package/dist/cjs/ui/global-styles.js +6 -9
- package/dist/es2019/pm-plugins/handle-mouse-down.js +14 -2
- package/dist/es2019/pm-plugins/handle-mouse-over.js +13 -3
- package/dist/es2019/pm-plugins/main.js +1 -1
- package/dist/es2019/ui/global-styles.js +8 -8
- package/dist/esm/pm-plugins/handle-mouse-down.js +14 -2
- package/dist/esm/pm-plugins/handle-mouse-over.js +13 -3
- package/dist/esm/pm-plugins/main.js +1 -1
- package/dist/esm/ui/global-styles.js +6 -9
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 7.2.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`606c3303a0d61`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/606c3303a0d61) -
|
|
8
|
+
[ux] ED-29331 fix block controls misalignment on first line of empty document with
|
|
9
|
+
platform_editor_native_anchor_support on
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 7.2.10
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`2470543de66c4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2470543de66c4) -
|
|
17
|
+
[ux] ED-29341 fix block quote drag handle is hard to trigger behind with
|
|
18
|
+
platform_editor_native_anchor_support on
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 7.2.9
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -552,7 +570,6 @@
|
|
|
552
570
|
shared context or singletons.
|
|
553
571
|
|
|
554
572
|
**HOW TO ADJUST:**
|
|
555
|
-
|
|
556
573
|
- Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
|
|
557
574
|
any of these editor plugins.
|
|
558
575
|
- Ensure the version you install matches the version required by the plugins.
|
|
@@ -2246,7 +2263,6 @@
|
|
|
2246
2263
|
- [#171014](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/171014)
|
|
2247
2264
|
[`6163248356c63`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6163248356c63) -
|
|
2248
2265
|
[ED-25833] Replace the following FGs with experiment `platform_editor_advanced_layouts`
|
|
2249
|
-
|
|
2250
2266
|
- platform_editor_advanced_layouts_breakout_resizing
|
|
2251
2267
|
- platform_editor_advanced_layouts_pre_release_1
|
|
2252
2268
|
- platform_editor_advanced_layouts_pre_release_2
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.handleMouseDown = void 0;
|
|
7
7
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
8
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
8
9
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
9
10
|
var handleMouseDown = exports.handleMouseDown = function handleMouseDown(api) {
|
|
10
11
|
return function (view, event) {
|
|
@@ -12,7 +13,6 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(api) {
|
|
|
12
13
|
return false;
|
|
13
14
|
}
|
|
14
15
|
if (!view.editable) {
|
|
15
|
-
var _rootNode$type$name, _rootNode$type$name2;
|
|
16
16
|
var targetPos = view.posAtDOM(event.target, 0);
|
|
17
17
|
// always fetch top level position for mouseDown to avoid drag handle positions being incorrect
|
|
18
18
|
var rootPos = view.state.doc.resolve(targetPos).before(1);
|
|
@@ -20,7 +20,19 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(api) {
|
|
|
20
20
|
if (!rootNode) {
|
|
21
21
|
return false;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_native_anchor_support', 'isEnabled', true)) {
|
|
24
|
+
var _rootNode$type$name, _rootNode$type$name2;
|
|
25
|
+
var anchorName = api === null || api === void 0 ? void 0 : api.core.actions.getAnchorIdForNode(rootNode, rootPos);
|
|
26
|
+
|
|
27
|
+
// don't show the handles if we can't find an anchor
|
|
28
|
+
if (!anchorName) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.showDragHandleAt(rootPos, anchorName, (_rootNode$type$name = rootNode.type.name) !== null && _rootNode$type$name !== void 0 ? _rootNode$type$name : '', undefined, rootPos, anchorName, (_rootNode$type$name2 = rootNode.type.name) !== null && _rootNode$type$name2 !== void 0 ? _rootNode$type$name2 : ''));
|
|
32
|
+
} else {
|
|
33
|
+
var _rootNode$type$name3, _rootNode$type$name4;
|
|
34
|
+
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.showDragHandleAt(rootPos, '', (_rootNode$type$name3 = rootNode.type.name) !== null && _rootNode$type$name3 !== void 0 ? _rootNode$type$name3 : '', undefined, rootPos, '', (_rootNode$type$name4 = rootNode.type.name) !== null && _rootNode$type$name4 !== void 0 ? _rootNode$type$name4 : ''));
|
|
35
|
+
}
|
|
24
36
|
} else {
|
|
25
37
|
var isDragHandle = event.target.closest((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) ? _styles.DRAG_HANDLE_SELECTOR : '[data-editor-block-ctrl-drag-handle]') !== null;
|
|
26
38
|
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.setSelectedViaDragHandle(isDragHandle));
|
|
@@ -100,10 +100,20 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
|
|
|
100
100
|
rootElement = parentElement;
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
+
var anchorName;
|
|
104
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_native_anchor_support', 'isEnabled', true)) {
|
|
105
|
+
anchorName = rootElement.getAttribute((0, _domAttrName.getAnchorAttrName)());
|
|
106
|
+
|
|
107
|
+
// don't show handles if we can't find an anchor
|
|
108
|
+
if (!anchorName) {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
} else {
|
|
112
|
+
// Ignored via go/ees005
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
114
|
+
anchorName = rootElement.getAttribute((0, _domAttrName.getAnchorAttrName)());
|
|
115
|
+
}
|
|
103
116
|
|
|
104
|
-
// Ignored via go/ees005
|
|
105
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
106
|
-
var anchorName = rootElement.getAttribute((0, _domAttrName.getAnchorAttrName)());
|
|
107
117
|
// No need to update handle position if its already there
|
|
108
118
|
if ((activeNode === null || activeNode === void 0 ? void 0 : activeNode.anchorName) === anchorName) {
|
|
109
119
|
return false;
|
|
@@ -503,7 +503,7 @@ var _apply = exports.apply = function apply(api, formatMessage, tr, currentState
|
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
var isEmptyDoc = (0, _utils.isEmptyDocument)(newState.doc);
|
|
506
|
-
if (isEmptyDoc) {
|
|
506
|
+
if (isEmptyDoc && !(0, _expValEquals.expValEquals)('platform_editor_native_anchor_support', 'isEnabled', true)) {
|
|
507
507
|
var hasNodeDecoration = !!(0, _decorationsAnchor.findNodeDecs)(newState, decorations).length;
|
|
508
508
|
if (!hasNodeDecoration) {
|
|
509
509
|
decorations = decorations.add(newState.doc, [(0, _decorationsDragHandle.emptyParagraphNodeDecorations)()]);
|
|
@@ -129,7 +129,7 @@ var extendedHoverZoneNext = function extendedHoverZoneNext() {
|
|
|
129
129
|
height: '100%',
|
|
130
130
|
cursor: 'default',
|
|
131
131
|
zIndex: 1
|
|
132
|
-
}),
|
|
132
|
+
}), "&&& ".concat(dragHandlerAnchorSelectorNext, "[data-layout-column]::after"), {
|
|
133
133
|
content: '""',
|
|
134
134
|
position: 'absolute',
|
|
135
135
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -144,7 +144,7 @@ var extendedHoverZoneNext = function extendedHoverZoneNext() {
|
|
|
144
144
|
zIndex: 1
|
|
145
145
|
})), 'hr[data-drag-handler-anchor-name]', {
|
|
146
146
|
overflow: 'visible'
|
|
147
|
-
}),
|
|
147
|
+
}), "[data-blocks-drag-handle-container=\"true\"] + ".concat(dragHandlerAnchorSelectorNext, ":not([").concat(_domAttrName.NODE_ANCHOR_ATTR_NAME, "] [").concat(_domAttrName.NODE_ANCHOR_ATTR_NAME, "])::after"), {
|
|
148
148
|
display: 'none'
|
|
149
149
|
}));
|
|
150
150
|
};
|
|
@@ -175,7 +175,7 @@ var extendedDragZone = (0, _react.css)({
|
|
|
175
175
|
});
|
|
176
176
|
var extendedDragZoneNext = (0, _react.css)({
|
|
177
177
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
178
|
-
'.ProseMirror': (0, _defineProperty2.default)({}, "&&
|
|
178
|
+
'.ProseMirror': (0, _defineProperty2.default)({}, "&& ".concat(dragHandlerAnchorSelectorNext, ":not([").concat(_domAttrName.NODE_ANCHOR_ATTR_NAME, "] [").concat(_domAttrName.NODE_ANCHOR_ATTR_NAME, "])::after"), {
|
|
179
179
|
width: 'var(--ak-editor-max-container-width)',
|
|
180
180
|
left: "calc((100% - var(--ak-editor-max-container-width))/2)"
|
|
181
181
|
})
|
|
@@ -376,12 +376,9 @@ var withAnchorNameZindexStyle = (0, _react.css)({
|
|
|
376
376
|
});
|
|
377
377
|
var withAnchorNameZindexStyleNext = (0, _react.css)({
|
|
378
378
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
379
|
-
'.ProseMirror': {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
zIndex: 1
|
|
383
|
-
}
|
|
384
|
-
}
|
|
379
|
+
'.ProseMirror': (0, _defineProperty2.default)({}, "&& [".concat(_domAttrName.NODE_ANCHOR_ATTR_NAME, "]:not([").concat(_domAttrName.NODE_ANCHOR_ATTR_NAME, "] [").concat(_domAttrName.NODE_ANCHOR_ATTR_NAME, "])"), {
|
|
380
|
+
zIndex: 1
|
|
381
|
+
})
|
|
385
382
|
});
|
|
386
383
|
|
|
387
384
|
// This style is used to define width for block card (with datasource) that does not have layout
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DRAG_HANDLE_SELECTOR } from '@atlaskit/editor-common/styles';
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
2
3
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
3
4
|
export const handleMouseDown = api => (view, event) => {
|
|
4
5
|
if (!(event.target instanceof HTMLElement)) {
|
|
5
6
|
return false;
|
|
6
7
|
}
|
|
7
8
|
if (!view.editable) {
|
|
8
|
-
var _rootNode$type$name, _rootNode$type$name2;
|
|
9
9
|
const targetPos = view.posAtDOM(event.target, 0);
|
|
10
10
|
// always fetch top level position for mouseDown to avoid drag handle positions being incorrect
|
|
11
11
|
const rootPos = view.state.doc.resolve(targetPos).before(1);
|
|
@@ -13,7 +13,19 @@ export const handleMouseDown = api => (view, event) => {
|
|
|
13
13
|
if (!rootNode) {
|
|
14
14
|
return false;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
if (expValEquals('platform_editor_native_anchor_support', 'isEnabled', true)) {
|
|
17
|
+
var _rootNode$type$name, _rootNode$type$name2;
|
|
18
|
+
const anchorName = api === null || api === void 0 ? void 0 : api.core.actions.getAnchorIdForNode(rootNode, rootPos);
|
|
19
|
+
|
|
20
|
+
// don't show the handles if we can't find an anchor
|
|
21
|
+
if (!anchorName) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.showDragHandleAt(rootPos, anchorName, (_rootNode$type$name = rootNode.type.name) !== null && _rootNode$type$name !== void 0 ? _rootNode$type$name : '', undefined, rootPos, anchorName, (_rootNode$type$name2 = rootNode.type.name) !== null && _rootNode$type$name2 !== void 0 ? _rootNode$type$name2 : ''));
|
|
25
|
+
} else {
|
|
26
|
+
var _rootNode$type$name3, _rootNode$type$name4;
|
|
27
|
+
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.showDragHandleAt(rootPos, '', (_rootNode$type$name3 = rootNode.type.name) !== null && _rootNode$type$name3 !== void 0 ? _rootNode$type$name3 : '', undefined, rootPos, '', (_rootNode$type$name4 = rootNode.type.name) !== null && _rootNode$type$name4 !== void 0 ? _rootNode$type$name4 : ''));
|
|
28
|
+
}
|
|
17
29
|
} else {
|
|
18
30
|
const isDragHandle = event.target.closest(expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) ? DRAG_HANDLE_SELECTOR : '[data-editor-block-ctrl-drag-handle]') !== null;
|
|
19
31
|
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.setSelectedViaDragHandle(isDragHandle));
|
|
@@ -90,10 +90,20 @@ export const handleMouseOver = (view, event, api) => {
|
|
|
90
90
|
rootElement = parentElement;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
+
let anchorName;
|
|
94
|
+
if (expValEquals('platform_editor_native_anchor_support', 'isEnabled', true)) {
|
|
95
|
+
anchorName = rootElement.getAttribute(getAnchorAttrName());
|
|
96
|
+
|
|
97
|
+
// don't show handles if we can't find an anchor
|
|
98
|
+
if (!anchorName) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
} else {
|
|
102
|
+
// Ignored via go/ees005
|
|
103
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
104
|
+
anchorName = rootElement.getAttribute(getAnchorAttrName());
|
|
105
|
+
}
|
|
93
106
|
|
|
94
|
-
// Ignored via go/ees005
|
|
95
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
96
|
-
const anchorName = rootElement.getAttribute(getAnchorAttrName());
|
|
97
107
|
// No need to update handle position if its already there
|
|
98
108
|
if ((activeNode === null || activeNode === void 0 ? void 0 : activeNode.anchorName) === anchorName) {
|
|
99
109
|
return false;
|
|
@@ -501,7 +501,7 @@ export const apply = (api, formatMessage, tr, currentState, newState, flags, nod
|
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
503
|
const isEmptyDoc = isEmptyDocument(newState.doc);
|
|
504
|
-
if (isEmptyDoc) {
|
|
504
|
+
if (isEmptyDoc && !expValEquals('platform_editor_native_anchor_support', 'isEnabled', true)) {
|
|
505
505
|
const hasNodeDecoration = !!findNodeDecs(newState, decorations).length;
|
|
506
506
|
if (!hasNodeDecoration) {
|
|
507
507
|
decorations = decorations.add(newState.doc, [emptyParagraphNodeDecorations()]);
|
|
@@ -149,8 +149,8 @@ const extendedHoverZoneNext = () => css({
|
|
|
149
149
|
zIndex: 1
|
|
150
150
|
},
|
|
151
151
|
// hover zone for layout column should be placed near the top of the column (where drag handle is)
|
|
152
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
153
|
-
|
|
152
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
153
|
+
[`&&& ${dragHandlerAnchorSelectorNext}[data-layout-column]::after`]: {
|
|
154
154
|
content: '""',
|
|
155
155
|
position: 'absolute',
|
|
156
156
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -171,8 +171,8 @@ const extendedHoverZoneNext = () => css({
|
|
|
171
171
|
overflow: 'visible'
|
|
172
172
|
},
|
|
173
173
|
//Hide pseudo element at top depth level. Leave for nested depths to prevent mouseover loop.
|
|
174
|
-
//eslint-disable-next-line @atlaskit/ui-styling-standard/no-
|
|
175
|
-
|
|
174
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
175
|
+
[`[data-blocks-drag-handle-container="true"] + ${dragHandlerAnchorSelectorNext}:not([${NODE_ANCHOR_ATTR_NAME}] [${NODE_ANCHOR_ATTR_NAME}])::after`]: {
|
|
176
176
|
display: 'none'
|
|
177
177
|
}
|
|
178
178
|
});
|
|
@@ -219,8 +219,8 @@ const extendedDragZone = css({
|
|
|
219
219
|
const extendedDragZoneNext = css({
|
|
220
220
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
221
221
|
'.ProseMirror': {
|
|
222
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
223
|
-
[`&&
|
|
222
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
223
|
+
[`&& ${dragHandlerAnchorSelectorNext}:not([${NODE_ANCHOR_ATTR_NAME}] [${NODE_ANCHOR_ATTR_NAME}])::after`]: {
|
|
224
224
|
width: 'var(--ak-editor-max-container-width)',
|
|
225
225
|
left: `calc((100% - var(--ak-editor-max-container-width))/2)`
|
|
226
226
|
}
|
|
@@ -447,8 +447,8 @@ const withAnchorNameZindexStyle = css({
|
|
|
447
447
|
const withAnchorNameZindexStyleNext = css({
|
|
448
448
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
449
449
|
'.ProseMirror': {
|
|
450
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
451
|
-
|
|
450
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
451
|
+
[`&& [${NODE_ANCHOR_ATTR_NAME}]:not([${NODE_ANCHOR_ATTR_NAME}] [${NODE_ANCHOR_ATTR_NAME}])`]: {
|
|
452
452
|
zIndex: 1
|
|
453
453
|
}
|
|
454
454
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DRAG_HANDLE_SELECTOR } from '@atlaskit/editor-common/styles';
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
2
3
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
3
4
|
export var handleMouseDown = function handleMouseDown(api) {
|
|
4
5
|
return function (view, event) {
|
|
@@ -6,7 +7,6 @@ export var handleMouseDown = function handleMouseDown(api) {
|
|
|
6
7
|
return false;
|
|
7
8
|
}
|
|
8
9
|
if (!view.editable) {
|
|
9
|
-
var _rootNode$type$name, _rootNode$type$name2;
|
|
10
10
|
var targetPos = view.posAtDOM(event.target, 0);
|
|
11
11
|
// always fetch top level position for mouseDown to avoid drag handle positions being incorrect
|
|
12
12
|
var rootPos = view.state.doc.resolve(targetPos).before(1);
|
|
@@ -14,7 +14,19 @@ export var handleMouseDown = function handleMouseDown(api) {
|
|
|
14
14
|
if (!rootNode) {
|
|
15
15
|
return false;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
if (expValEquals('platform_editor_native_anchor_support', 'isEnabled', true)) {
|
|
18
|
+
var _rootNode$type$name, _rootNode$type$name2;
|
|
19
|
+
var anchorName = api === null || api === void 0 ? void 0 : api.core.actions.getAnchorIdForNode(rootNode, rootPos);
|
|
20
|
+
|
|
21
|
+
// don't show the handles if we can't find an anchor
|
|
22
|
+
if (!anchorName) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.showDragHandleAt(rootPos, anchorName, (_rootNode$type$name = rootNode.type.name) !== null && _rootNode$type$name !== void 0 ? _rootNode$type$name : '', undefined, rootPos, anchorName, (_rootNode$type$name2 = rootNode.type.name) !== null && _rootNode$type$name2 !== void 0 ? _rootNode$type$name2 : ''));
|
|
26
|
+
} else {
|
|
27
|
+
var _rootNode$type$name3, _rootNode$type$name4;
|
|
28
|
+
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.showDragHandleAt(rootPos, '', (_rootNode$type$name3 = rootNode.type.name) !== null && _rootNode$type$name3 !== void 0 ? _rootNode$type$name3 : '', undefined, rootPos, '', (_rootNode$type$name4 = rootNode.type.name) !== null && _rootNode$type$name4 !== void 0 ? _rootNode$type$name4 : ''));
|
|
29
|
+
}
|
|
18
30
|
} else {
|
|
19
31
|
var isDragHandle = event.target.closest(expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) ? DRAG_HANDLE_SELECTOR : '[data-editor-block-ctrl-drag-handle]') !== null;
|
|
20
32
|
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.setSelectedViaDragHandle(isDragHandle));
|
|
@@ -93,10 +93,20 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
|
|
|
93
93
|
rootElement = parentElement;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
+
var anchorName;
|
|
97
|
+
if (expValEquals('platform_editor_native_anchor_support', 'isEnabled', true)) {
|
|
98
|
+
anchorName = rootElement.getAttribute(getAnchorAttrName());
|
|
99
|
+
|
|
100
|
+
// don't show handles if we can't find an anchor
|
|
101
|
+
if (!anchorName) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
// Ignored via go/ees005
|
|
106
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
107
|
+
anchorName = rootElement.getAttribute(getAnchorAttrName());
|
|
108
|
+
}
|
|
96
109
|
|
|
97
|
-
// Ignored via go/ees005
|
|
98
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
99
|
-
var anchorName = rootElement.getAttribute(getAnchorAttrName());
|
|
100
110
|
// No need to update handle position if its already there
|
|
101
111
|
if ((activeNode === null || activeNode === void 0 ? void 0 : activeNode.anchorName) === anchorName) {
|
|
102
112
|
return false;
|
|
@@ -496,7 +496,7 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
|
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
var isEmptyDoc = isEmptyDocument(newState.doc);
|
|
499
|
-
if (isEmptyDoc) {
|
|
499
|
+
if (isEmptyDoc && !expValEquals('platform_editor_native_anchor_support', 'isEnabled', true)) {
|
|
500
500
|
var hasNodeDecoration = !!findNodeDecs(newState, decorations).length;
|
|
501
501
|
if (!hasNodeDecoration) {
|
|
502
502
|
decorations = decorations.add(newState.doc, [emptyParagraphNodeDecorations()]);
|
|
@@ -122,7 +122,7 @@ var extendedHoverZoneNext = function extendedHoverZoneNext() {
|
|
|
122
122
|
height: '100%',
|
|
123
123
|
cursor: 'default',
|
|
124
124
|
zIndex: 1
|
|
125
|
-
}),
|
|
125
|
+
}), "&&& ".concat(dragHandlerAnchorSelectorNext, "[data-layout-column]::after"), {
|
|
126
126
|
content: '""',
|
|
127
127
|
position: 'absolute',
|
|
128
128
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -137,7 +137,7 @@ var extendedHoverZoneNext = function extendedHoverZoneNext() {
|
|
|
137
137
|
zIndex: 1
|
|
138
138
|
})), 'hr[data-drag-handler-anchor-name]', {
|
|
139
139
|
overflow: 'visible'
|
|
140
|
-
}),
|
|
140
|
+
}), "[data-blocks-drag-handle-container=\"true\"] + ".concat(dragHandlerAnchorSelectorNext, ":not([").concat(NODE_ANCHOR_ATTR_NAME, "] [").concat(NODE_ANCHOR_ATTR_NAME, "])::after"), {
|
|
141
141
|
display: 'none'
|
|
142
142
|
}));
|
|
143
143
|
};
|
|
@@ -168,7 +168,7 @@ var extendedDragZone = css({
|
|
|
168
168
|
});
|
|
169
169
|
var extendedDragZoneNext = css({
|
|
170
170
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
171
|
-
'.ProseMirror': _defineProperty({}, "&&
|
|
171
|
+
'.ProseMirror': _defineProperty({}, "&& ".concat(dragHandlerAnchorSelectorNext, ":not([").concat(NODE_ANCHOR_ATTR_NAME, "] [").concat(NODE_ANCHOR_ATTR_NAME, "])::after"), {
|
|
172
172
|
width: 'var(--ak-editor-max-container-width)',
|
|
173
173
|
left: "calc((100% - var(--ak-editor-max-container-width))/2)"
|
|
174
174
|
})
|
|
@@ -369,12 +369,9 @@ var withAnchorNameZindexStyle = css({
|
|
|
369
369
|
});
|
|
370
370
|
var withAnchorNameZindexStyleNext = css({
|
|
371
371
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
372
|
-
'.ProseMirror': {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
zIndex: 1
|
|
376
|
-
}
|
|
377
|
-
}
|
|
372
|
+
'.ProseMirror': _defineProperty({}, "&& [".concat(NODE_ANCHOR_ATTR_NAME, "]:not([").concat(NODE_ANCHOR_ATTR_NAME, "] [").concat(NODE_ANCHOR_ATTR_NAME, "])"), {
|
|
373
|
+
zIndex: 1
|
|
374
|
+
})
|
|
378
375
|
});
|
|
379
376
|
|
|
380
377
|
// This style is used to define width for block card (with datasource) that does not have layout
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.11",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
53
53
|
"@atlaskit/primitives": "^15.0.0",
|
|
54
54
|
"@atlaskit/theme": "^21.0.0",
|
|
55
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
55
|
+
"@atlaskit/tmp-editor-statsig": "^13.12.0",
|
|
56
56
|
"@atlaskit/tokens": "^6.5.0",
|
|
57
57
|
"@atlaskit/tooltip": "^20.5.0",
|
|
58
58
|
"@babel/runtime": "^7.0.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"uuid": "^3.1.0"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@atlaskit/editor-common": "^110.
|
|
67
|
+
"@atlaskit/editor-common": "^110.13.0",
|
|
68
68
|
"react": "^18.2.0",
|
|
69
69
|
"react-dom": "^18.2.0",
|
|
70
70
|
"react-intl-next": "npm:react-intl@^5.18.1"
|