@atlaskit/editor-plugin-block-controls 7.9.0 → 7.10.1
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 +24 -5
- package/dist/cjs/blockControlsPlugin.js +1 -1
- package/dist/cjs/editor-commands/show-drag-handle.js +2 -2
- package/dist/cjs/pm-plugins/decorations-anchor.js +1 -1
- package/dist/cjs/pm-plugins/decorations-drop-target-active.js +1 -1
- package/dist/cjs/pm-plugins/decorations-drop-target.js +1 -2
- package/dist/cjs/pm-plugins/handle-mouse-down.js +1 -1
- package/dist/cjs/pm-plugins/handle-mouse-over.js +3 -3
- package/dist/cjs/pm-plugins/main.js +5 -5
- package/dist/cjs/ui/drag-handle.js +10 -10
- package/dist/cjs/ui/drop-target-layout.js +2 -2
- package/dist/cjs/ui/drop-target.js +2 -2
- package/dist/cjs/ui/global-styles.js +4 -5
- package/dist/cjs/ui/inline-drop-target.js +5 -5
- package/dist/cjs/ui/utils/anchor-name.js +1 -1
- package/dist/cjs/ui/utils/dom-attr-name.js +2 -2
- package/dist/es2019/blockControlsPlugin.js +1 -1
- package/dist/es2019/editor-commands/show-drag-handle.js +2 -2
- package/dist/es2019/pm-plugins/decorations-anchor.js +1 -1
- package/dist/es2019/pm-plugins/decorations-drop-target-active.js +1 -1
- package/dist/es2019/pm-plugins/decorations-drop-target.js +1 -2
- package/dist/es2019/pm-plugins/handle-mouse-down.js +1 -1
- package/dist/es2019/pm-plugins/handle-mouse-over.js +3 -3
- package/dist/es2019/pm-plugins/main.js +5 -5
- package/dist/es2019/ui/drag-handle.js +10 -10
- package/dist/es2019/ui/drop-target-layout.js +2 -2
- package/dist/es2019/ui/drop-target.js +2 -2
- package/dist/es2019/ui/global-styles.js +4 -5
- package/dist/es2019/ui/inline-drop-target.js +5 -5
- package/dist/es2019/ui/utils/anchor-name.js +1 -1
- package/dist/es2019/ui/utils/dom-attr-name.js +2 -2
- package/dist/esm/blockControlsPlugin.js +1 -1
- package/dist/esm/editor-commands/show-drag-handle.js +2 -2
- package/dist/esm/pm-plugins/decorations-anchor.js +1 -1
- package/dist/esm/pm-plugins/decorations-drop-target-active.js +1 -1
- package/dist/esm/pm-plugins/decorations-drop-target.js +1 -2
- package/dist/esm/pm-plugins/handle-mouse-down.js +1 -1
- package/dist/esm/pm-plugins/handle-mouse-over.js +3 -3
- package/dist/esm/pm-plugins/main.js +5 -5
- package/dist/esm/ui/drag-handle.js +10 -10
- package/dist/esm/ui/drop-target-layout.js +2 -2
- package/dist/esm/ui/drop-target.js +2 -2
- package/dist/esm/ui/global-styles.js +4 -5
- package/dist/esm/ui/inline-drop-target.js +5 -5
- package/dist/esm/ui/utils/anchor-name.js +1 -1
- package/dist/esm/ui/utils/dom-attr-name.js +2 -2
- package/package.json +4 -13
|
@@ -10,7 +10,6 @@ import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-che
|
|
|
10
10
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
11
11
|
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
|
|
12
12
|
import { akEditorBreakoutPadding, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorFullPageNarrowBreakout, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced } from '@atlaskit/editor-shared-styles';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
13
|
import { layers } from '@atlaskit/theme/constants';
|
|
15
14
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
16
15
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
@@ -458,13 +457,13 @@ export var GlobalStylesWrapper = function GlobalStylesWrapper(_ref) {
|
|
|
458
457
|
var isDragging = useSharedPluginStateSelector(api, 'blockControls.isDragging', {
|
|
459
458
|
disabled: !expValEquals('platform_editor_block_controls_perf_optimization', 'isEnabled', true)
|
|
460
459
|
});
|
|
461
|
-
var shouldRenderAnchors = isCSSAnchorSupported() && expValEquals('
|
|
460
|
+
var shouldRenderAnchors = isCSSAnchorSupported() && expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true);
|
|
462
461
|
var toolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
463
462
|
return jsx(Global, {
|
|
464
|
-
styles: [globalStyles(), globalDnDStyle, expValEquals('
|
|
463
|
+
styles: [globalStyles(), globalDnDStyle, expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) ? extendedHoverZoneNext() : extendedHoverZone(), isDragging && (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) ? extendedDragZoneNext : extendedDragZone), editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
465
464
|
exposure: true
|
|
466
|
-
}) ? expValEquals('
|
|
465
|
+
}) ? expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) ? extendHoverZoneReducedNext : extendHoverZoneReduced : undefined,
|
|
467
466
|
// platform_editor_controls note: this allows drag handles to render on empty lines
|
|
468
|
-
toolbarFlagsEnabled ? undefined : withInlineNodeStyle, editorExperiment('platform_editor_block_control_optimise_render', true) ? quickInsertStyles : undefined, withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, headingWithIndentationInLayoutStyleFix, editorExperiment('advanced_layouts', true) ? blockCardWithoutLayout : undefined, withDividerInPanelStyleFix, withFormatInLayoutStyleFix, expValEquals('
|
|
467
|
+
toolbarFlagsEnabled ? undefined : withInlineNodeStyle, editorExperiment('platform_editor_block_control_optimise_render', true) ? quickInsertStyles : undefined, withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, headingWithIndentationInLayoutStyleFix, editorExperiment('advanced_layouts', true) ? blockCardWithoutLayout : undefined, withDividerInPanelStyleFix, withFormatInLayoutStyleFix, expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) ? withRelativePosStyleNext : withRelativePosStyle, topLevelNodeMarginStyles, expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) ? withAnchorNameZindexStyleNext : withAnchorNameZindexStyle, expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && expValEquals('advanced_layouts', 'isEnabled', true) ? layoutColumnExtendedHoverZone : layoutColumnWithoutHoverZone, shouldRenderAnchors && (isDragging ? dragAnchorStyles : dragHandlerAnchorStyles)]
|
|
469
468
|
});
|
|
470
469
|
};
|
|
@@ -93,7 +93,7 @@ export var InlineDropTarget = function InlineDropTarget(_ref) {
|
|
|
93
93
|
isDraggedOver = _useState2[0],
|
|
94
94
|
setIsDraggedOver = _useState2[1];
|
|
95
95
|
var anchorName = useMemo(function () {
|
|
96
|
-
if (expValEquals('
|
|
96
|
+
if (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true)) {
|
|
97
97
|
var _getPos;
|
|
98
98
|
return nextNode ? (api === null || api === void 0 ? void 0 : api.core.actions.getAnchorIdForNode(nextNode, (_getPos = getPos()) !== null && _getPos !== void 0 ? _getPos : -1)) || '' : '';
|
|
99
99
|
}
|
|
@@ -126,7 +126,7 @@ export var InlineDropTarget = function InlineDropTarget(_ref) {
|
|
|
126
126
|
innerContainerWidth = "calc(var(--ak-editor--line-length) * ".concat(percentageWidth, ")");
|
|
127
127
|
}
|
|
128
128
|
} else if (nextNode.type.name === 'table' && nextNode.firstChild) {
|
|
129
|
-
var tableWidthAnchor = expValEquals('
|
|
129
|
+
var tableWidthAnchor = expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) ? typeof nextNodePos === 'number' ? (api === null || api === void 0 ? void 0 : api.core.actions.getAnchorIdForNode(nextNode.firstChild, nextNodePos + 1)) || '' : '' : getNodeAnchor(nextNode.firstChild);
|
|
130
130
|
var isNumberColumnEnabled = Boolean(nextNode.attrs.isNumberColumnEnabled);
|
|
131
131
|
if (isAnchorSupported()) {
|
|
132
132
|
innerContainerWidth = isNumberColumnEnabled ? "calc(anchor-size(".concat(tableWidthAnchor, " width) + ").concat(TABLE_NUMBERED_COLUMN_WIDTH, "px)") : "anchor-size(".concat(tableWidthAnchor, " width)");
|
|
@@ -139,7 +139,7 @@ export var InlineDropTarget = function InlineDropTarget(_ref) {
|
|
|
139
139
|
innerContainerWidth = "min(".concat(nextNode.attrs.width, "px, ").concat(innerContainerWidth, ")");
|
|
140
140
|
}
|
|
141
141
|
} else if (nextNode.type.name === 'mediaSingle' && nextNode.firstChild) {
|
|
142
|
-
if (expValEquals('
|
|
142
|
+
if (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true)) {
|
|
143
143
|
var _nextNode$firstChild;
|
|
144
144
|
// check pos is a number
|
|
145
145
|
if (typeof nextNodePos === 'number' && ((_nextNode$firstChild = nextNode.firstChild) === null || _nextNode$firstChild === void 0 ? void 0 : _nextNode$firstChild.type.name) === 'media') {
|
|
@@ -154,7 +154,7 @@ export var InlineDropTarget = function InlineDropTarget(_ref) {
|
|
|
154
154
|
var heightTargetAnchorName = targetAnchorName;
|
|
155
155
|
if (nextNode.type.name === 'layoutSection' && nextNode.firstChild && nextNode.lastChild) {
|
|
156
156
|
if (isLeftPosition) {
|
|
157
|
-
if (expValEquals('
|
|
157
|
+
if (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true)) {
|
|
158
158
|
if (typeof nextNodePos === 'number') {
|
|
159
159
|
heightTargetAnchorName = (api === null || api === void 0 ? void 0 : api.core.actions.getAnchorIdForNode(nextNode.firstChild, nextNodePos + 1)) || '';
|
|
160
160
|
} else {
|
|
@@ -164,7 +164,7 @@ export var InlineDropTarget = function InlineDropTarget(_ref) {
|
|
|
164
164
|
heightTargetAnchorName = getNodeAnchor(nextNode.firstChild);
|
|
165
165
|
}
|
|
166
166
|
} else {
|
|
167
|
-
if (expValEquals('
|
|
167
|
+
if (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true)) {
|
|
168
168
|
if (typeof nextNodePos === 'number') {
|
|
169
169
|
var lastNodeStartPos = nextNode.content.size - nextNode.lastChild.nodeSize;
|
|
170
170
|
heightTargetAnchorName = (api === null || api === void 0 ? void 0 : api.core.actions.getAnchorIdForNode(nextNode.lastChild, lastNodeStartPos + 1)) || '';
|
|
@@ -10,7 +10,7 @@ export var refreshAnchorName = function refreshAnchorName(_ref) {
|
|
|
10
10
|
view = _ref.view,
|
|
11
11
|
anchorName = _ref.anchorName;
|
|
12
12
|
var newAnchorName = anchorName || '';
|
|
13
|
-
if (expValEquals('
|
|
13
|
+
if (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true)) {
|
|
14
14
|
return newAnchorName;
|
|
15
15
|
}
|
|
16
16
|
var pos = getPos();
|
|
@@ -2,13 +2,13 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
|
2
2
|
export var NODE_ANCHOR_ATTR_NAME = 'data-node-anchor';
|
|
3
3
|
export var NODE_NODE_TYPE_ATTR_NAME = 'data-prosemirror-node-name';
|
|
4
4
|
export var getAnchorAttrName = function getAnchorAttrName() {
|
|
5
|
-
if (expValEquals('
|
|
5
|
+
if (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true)) {
|
|
6
6
|
return NODE_ANCHOR_ATTR_NAME;
|
|
7
7
|
}
|
|
8
8
|
return 'data-drag-handler-anchor-name';
|
|
9
9
|
};
|
|
10
10
|
export var getTypeNameAttrName = function getTypeNameAttrName() {
|
|
11
|
-
if (expValEquals('
|
|
11
|
+
if (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true)) {
|
|
12
12
|
return NODE_NODE_TYPE_ATTR_NAME;
|
|
13
13
|
}
|
|
14
14
|
return 'data-drag-handler-node-type';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.10.1",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
55
55
|
"@atlaskit/primitives": "^16.4.0",
|
|
56
56
|
"@atlaskit/theme": "^21.0.0",
|
|
57
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
58
|
-
"@atlaskit/tokens": "^8.
|
|
57
|
+
"@atlaskit/tmp-editor-statsig": "^14.1.0",
|
|
58
|
+
"@atlaskit/tokens": "^8.4.0",
|
|
59
59
|
"@atlaskit/tooltip": "^20.10.0",
|
|
60
60
|
"@babel/runtime": "^7.0.0",
|
|
61
61
|
"@emotion/react": "^11.7.1",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"uuid": "^3.1.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@atlaskit/editor-common": "^110.
|
|
69
|
+
"@atlaskit/editor-common": "^110.36.0",
|
|
70
70
|
"react": "^18.2.0",
|
|
71
71
|
"react-dom": "^18.2.0",
|
|
72
72
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -143,9 +143,6 @@
|
|
|
143
143
|
"dst-a11y__replace-anchor-with-link__editor-jenga": {
|
|
144
144
|
"type": "boolean"
|
|
145
145
|
},
|
|
146
|
-
"platform_native_anchor_use_css_style": {
|
|
147
|
-
"type": "boolean"
|
|
148
|
-
},
|
|
149
146
|
"editor_native_anchor_remove_decoration_in_apply": {
|
|
150
147
|
"type": "boolean"
|
|
151
148
|
},
|
|
@@ -154,12 +151,6 @@
|
|
|
154
151
|
},
|
|
155
152
|
"platform_editor_toolbar_aifc_user_intent_fix": {
|
|
156
153
|
"type": "boolean"
|
|
157
|
-
},
|
|
158
|
-
"platform_editor_native_anchor_table_nested_fix": {
|
|
159
|
-
"type": "boolean"
|
|
160
|
-
},
|
|
161
|
-
"editor_native_anchor_update_layout_drop_hint": {
|
|
162
|
-
"type": "boolean"
|
|
163
154
|
}
|
|
164
155
|
}
|
|
165
156
|
}
|