@atlaskit/editor-plugin-block-controls 3.3.6 → 3.3.7
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 +8 -0
- package/dist/cjs/pm-plugins/main.js +2 -1
- package/dist/cjs/ui/consts.js +6 -2
- package/dist/cjs/ui/drag-handle.js +1 -1
- package/dist/es2019/pm-plugins/main.js +2 -1
- package/dist/es2019/ui/consts.js +5 -1
- package/dist/es2019/ui/drag-handle.js +4 -2
- package/dist/esm/pm-plugins/main.js +2 -1
- package/dist/esm/ui/consts.js +5 -1
- package/dist/esm/ui/drag-handle.js +4 -2
- package/dist/types/ui/consts.d.ts +1 -0
- package/dist/types-ts4.5/ui/consts.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 3.3.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#124718](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/124718)
|
|
8
|
+
[`d923941c82bb4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d923941c82bb4) -
|
|
9
|
+
Disable block menu in Editor controls
|
|
10
|
+
|
|
3
11
|
## 3.3.6
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -21,6 +21,7 @@ var _element = require("@atlaskit/pragmatic-drag-and-drop-auto-scroll/element");
|
|
|
21
21
|
var _combine = require("@atlaskit/pragmatic-drag-and-drop/combine");
|
|
22
22
|
var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
23
23
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
24
|
+
var _consts = require("../ui/consts");
|
|
24
25
|
var _decorationsAnchor = require("./decorations-anchor");
|
|
25
26
|
var _decorationsDragHandle = require("./decorations-drag-handle");
|
|
26
27
|
var _decorationsDropTarget = require("./decorations-drop-target");
|
|
@@ -363,7 +364,7 @@ var newApply = exports.newApply = function newApply(api, formatMessage, tr, curr
|
|
|
363
364
|
}
|
|
364
365
|
var newActiveNode = isEmptyDoc || !(meta !== null && meta !== void 0 && meta.activeNode) && (0, _decorationsDragHandle.findHandleDec)(decorations, latestActiveNode === null || latestActiveNode === void 0 ? void 0 : latestActiveNode.pos, latestActiveNode === null || latestActiveNode === void 0 ? void 0 : latestActiveNode.pos).length === 0 ? null : latestActiveNode;
|
|
365
366
|
var isMenuOpenNew = isMenuOpen;
|
|
366
|
-
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
367
|
+
if (_consts.BLOCK_MENU_ENABLED && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
367
368
|
if (meta !== null && meta !== void 0 && meta.closeMenu) {
|
|
368
369
|
isMenuOpenNew = false;
|
|
369
370
|
} else if (meta !== null && meta !== void 0 && meta.toggleMenu) {
|
package/dist/cjs/ui/consts.js
CHANGED
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.topPositionAdjustment = exports.spacingBetweenNodesForPreview = exports.spaceLookupMap = exports.rootElementGap = exports.nodeMargins = exports.getNestedNodeLeftPaddingMargin = exports.dropTargetMarginMap = exports.dragHandleGap = exports.QUICK_INSERT_WIDTH = exports.QUICK_INSERT_HEIGHT = exports.QUICK_INSERT_DIMENSIONS = exports.DRAG_HANDLE_ZINDEX = exports.DRAG_HANDLE_WIDTH = exports.DRAG_HANDLE_PARAGRAPH_TOP_ADJUSTMENT = exports.DRAG_HANDLE_NARROW_GAP = exports.DRAG_HANDLE_MAX_WIDTH_PLUS_GAP = exports.DRAG_HANDLE_MAX_SHIFT_CLICK_DEPTH = exports.DRAG_HANDLE_MAX_GAP = exports.DRAG_HANDLE_LAYOUT_SECTION_TOP_ADJUSTMENT = exports.DRAG_HANDLE_HEIGHT = exports.DRAG_HANDLE_H6_TOP_ADJUSTMENT = exports.DRAG_HANDLE_H5_TOP_ADJUSTMENT = exports.DRAG_HANDLE_H4_TOP_ADJUSTMENT = exports.DRAG_HANDLE_H3_TOP_ADJUSTMENT = exports.DRAG_HANDLE_H2_TOP_ADJUSTMENT = exports.DRAG_HANDLE_H1_TOP_ADJUSTMENT = exports.DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT = exports.DRAG_HANDLE_DEFAULT_GAP = exports.DRAG_HANDLE_BORDER_RADIUS = exports.DEFAULT_COLUMN_DISTRIBUTIONS = exports.BLOCK_MENU_WIDTH = void 0;
|
|
7
|
+
exports.topPositionAdjustment = exports.spacingBetweenNodesForPreview = exports.spaceLookupMap = exports.rootElementGap = exports.nodeMargins = exports.getNestedNodeLeftPaddingMargin = exports.dropTargetMarginMap = exports.dragHandleGap = exports.QUICK_INSERT_WIDTH = exports.QUICK_INSERT_HEIGHT = exports.QUICK_INSERT_DIMENSIONS = exports.DRAG_HANDLE_ZINDEX = exports.DRAG_HANDLE_WIDTH = exports.DRAG_HANDLE_PARAGRAPH_TOP_ADJUSTMENT = exports.DRAG_HANDLE_NARROW_GAP = exports.DRAG_HANDLE_MAX_WIDTH_PLUS_GAP = exports.DRAG_HANDLE_MAX_SHIFT_CLICK_DEPTH = exports.DRAG_HANDLE_MAX_GAP = exports.DRAG_HANDLE_LAYOUT_SECTION_TOP_ADJUSTMENT = exports.DRAG_HANDLE_HEIGHT = exports.DRAG_HANDLE_H6_TOP_ADJUSTMENT = exports.DRAG_HANDLE_H5_TOP_ADJUSTMENT = exports.DRAG_HANDLE_H4_TOP_ADJUSTMENT = exports.DRAG_HANDLE_H3_TOP_ADJUSTMENT = exports.DRAG_HANDLE_H2_TOP_ADJUSTMENT = exports.DRAG_HANDLE_H1_TOP_ADJUSTMENT = exports.DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT = exports.DRAG_HANDLE_DEFAULT_GAP = exports.DRAG_HANDLE_BORDER_RADIUS = exports.DEFAULT_COLUMN_DISTRIBUTIONS = exports.BLOCK_MENU_WIDTH = exports.BLOCK_MENU_ENABLED = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
10
10
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
@@ -344,4 +344,8 @@ var DEFAULT_COLUMN_DISTRIBUTIONS = exports.DEFAULT_COLUMN_DISTRIBUTIONS = {
|
|
|
344
344
|
4: 25,
|
|
345
345
|
5: 20
|
|
346
346
|
};
|
|
347
|
-
var BLOCK_MENU_WIDTH = exports.BLOCK_MENU_WIDTH = 220;
|
|
347
|
+
var BLOCK_MENU_WIDTH = exports.BLOCK_MENU_WIDTH = 220;
|
|
348
|
+
|
|
349
|
+
// Temporarily disable BLOCK MENU feature until Q4 FY25.
|
|
350
|
+
// For more details, refer to ticket ED-26972 https://product-fabric.atlassian.net/browse/ED-26972
|
|
351
|
+
var BLOCK_MENU_ENABLED = exports.BLOCK_MENU_ENABLED = false;
|
|
@@ -200,7 +200,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
200
200
|
var $anchor = (mSelect === null || mSelect === void 0 ? void 0 : mSelect.anchor) !== undefined ? tr.doc.resolve(mSelect === null || mSelect === void 0 ? void 0 : mSelect.anchor) : tr.selection.$anchor;
|
|
201
201
|
if (!isMultiSelect || tr.selection.empty || !e.shiftKey) {
|
|
202
202
|
tr = (0, _getSelection.selectNode)(tr, startPos, nodeType);
|
|
203
|
-
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
203
|
+
if (_consts.BLOCK_MENU_ENABLED && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
204
204
|
var _api$blockControls;
|
|
205
205
|
api === null || api === void 0 || (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 || _api$blockControls.commands.toggleBlockMenu({
|
|
206
206
|
anchorName: anchorName
|
|
@@ -12,6 +12,7 @@ import { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-sc
|
|
|
12
12
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
13
13
|
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
14
14
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
15
|
+
import { BLOCK_MENU_ENABLED } from '../ui/consts';
|
|
15
16
|
import { findNodeDecs, nodeDecorations } from './decorations-anchor';
|
|
16
17
|
import { dragHandleDecoration, emptyParagraphNodeDecorations, findHandleDec } from './decorations-drag-handle';
|
|
17
18
|
import { dropTargetDecorations, findDropTargetDecs } from './decorations-drop-target';
|
|
@@ -360,7 +361,7 @@ export const newApply = (api, formatMessage, tr, currentState, newState, flags,
|
|
|
360
361
|
}
|
|
361
362
|
const newActiveNode = isEmptyDoc || !(meta !== null && meta !== void 0 && meta.activeNode) && findHandleDec(decorations, latestActiveNode === null || latestActiveNode === void 0 ? void 0 : latestActiveNode.pos, latestActiveNode === null || latestActiveNode === void 0 ? void 0 : latestActiveNode.pos).length === 0 ? null : latestActiveNode;
|
|
362
363
|
let isMenuOpenNew = isMenuOpen;
|
|
363
|
-
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
364
|
+
if (BLOCK_MENU_ENABLED && editorExperiment('platform_editor_controls', 'variant1')) {
|
|
364
365
|
if (meta !== null && meta !== void 0 && meta.closeMenu) {
|
|
365
366
|
isMenuOpenNew = false;
|
|
366
367
|
} else if (meta !== null && meta !== void 0 && meta.toggleMenu) {
|
package/dist/es2019/ui/consts.js
CHANGED
|
@@ -353,4 +353,8 @@ export const DEFAULT_COLUMN_DISTRIBUTIONS = {
|
|
|
353
353
|
4: 25,
|
|
354
354
|
5: 20
|
|
355
355
|
};
|
|
356
|
-
export const BLOCK_MENU_WIDTH = 220;
|
|
356
|
+
export const BLOCK_MENU_WIDTH = 220;
|
|
357
|
+
|
|
358
|
+
// Temporarily disable BLOCK MENU feature until Q4 FY25.
|
|
359
|
+
// For more details, refer to ticket ED-26972 https://product-fabric.atlassian.net/browse/ED-26972
|
|
360
|
+
export const BLOCK_MENU_ENABLED = false;
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
+
|
|
5
6
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
7
|
+
|
|
6
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
9
|
import { css, jsx } from '@emotion/react';
|
|
8
10
|
import { bind } from 'bind-event-listener';
|
|
@@ -26,7 +28,7 @@ import { getMultiSelectAnalyticsAttributes } from '../pm-plugins/utils/analytics
|
|
|
26
28
|
import { getLeftPosition, getTopPosition } from '../pm-plugins/utils/drag-handle-positions';
|
|
27
29
|
import { isHandleCorrelatedToSelection, selectNode } from '../pm-plugins/utils/getSelection';
|
|
28
30
|
import { alignAnchorHeadInDirectionOfPos, expandSelectionHeadToNodeAtPos } from '../pm-plugins/utils/selection';
|
|
29
|
-
import { DRAG_HANDLE_BORDER_RADIUS, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_MAX_SHIFT_CLICK_DEPTH, DRAG_HANDLE_WIDTH, DRAG_HANDLE_ZINDEX, dragHandleGap, nodeMargins, spacingBetweenNodesForPreview, topPositionAdjustment } from './consts';
|
|
31
|
+
import { BLOCK_MENU_ENABLED, DRAG_HANDLE_BORDER_RADIUS, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_MAX_SHIFT_CLICK_DEPTH, DRAG_HANDLE_WIDTH, DRAG_HANDLE_ZINDEX, dragHandleGap, nodeMargins, spacingBetweenNodesForPreview, topPositionAdjustment } from './consts';
|
|
30
32
|
import { dragPreview } from './drag-preview';
|
|
31
33
|
const iconWrapperStyles = xcss({
|
|
32
34
|
display: 'flex',
|
|
@@ -181,7 +183,7 @@ export const DragHandle = ({
|
|
|
181
183
|
const $anchor = (mSelect === null || mSelect === void 0 ? void 0 : mSelect.anchor) !== undefined ? tr.doc.resolve(mSelect === null || mSelect === void 0 ? void 0 : mSelect.anchor) : tr.selection.$anchor;
|
|
182
184
|
if (!isMultiSelect || tr.selection.empty || !e.shiftKey) {
|
|
183
185
|
tr = selectNode(tr, startPos, nodeType);
|
|
184
|
-
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
186
|
+
if (BLOCK_MENU_ENABLED && editorExperiment('platform_editor_controls', 'variant1')) {
|
|
185
187
|
var _api$blockControls;
|
|
186
188
|
api === null || api === void 0 ? void 0 : (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 ? void 0 : _api$blockControls.commands.toggleBlockMenu({
|
|
187
189
|
anchorName
|
|
@@ -16,6 +16,7 @@ import { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-sc
|
|
|
16
16
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
17
17
|
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
18
18
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
19
|
+
import { BLOCK_MENU_ENABLED } from '../ui/consts';
|
|
19
20
|
import { findNodeDecs, nodeDecorations } from './decorations-anchor';
|
|
20
21
|
import { dragHandleDecoration, emptyParagraphNodeDecorations, findHandleDec } from './decorations-drag-handle';
|
|
21
22
|
import { dropTargetDecorations, findDropTargetDecs } from './decorations-drop-target';
|
|
@@ -356,7 +357,7 @@ export var newApply = function newApply(api, formatMessage, tr, currentState, ne
|
|
|
356
357
|
}
|
|
357
358
|
var newActiveNode = isEmptyDoc || !(meta !== null && meta !== void 0 && meta.activeNode) && findHandleDec(decorations, latestActiveNode === null || latestActiveNode === void 0 ? void 0 : latestActiveNode.pos, latestActiveNode === null || latestActiveNode === void 0 ? void 0 : latestActiveNode.pos).length === 0 ? null : latestActiveNode;
|
|
358
359
|
var isMenuOpenNew = isMenuOpen;
|
|
359
|
-
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
360
|
+
if (BLOCK_MENU_ENABLED && editorExperiment('platform_editor_controls', 'variant1')) {
|
|
360
361
|
if (meta !== null && meta !== void 0 && meta.closeMenu) {
|
|
361
362
|
isMenuOpenNew = false;
|
|
362
363
|
} else if (meta !== null && meta !== void 0 && meta.toggleMenu) {
|
package/dist/esm/ui/consts.js
CHANGED
|
@@ -337,4 +337,8 @@ export var DEFAULT_COLUMN_DISTRIBUTIONS = {
|
|
|
337
337
|
4: 25,
|
|
338
338
|
5: 20
|
|
339
339
|
};
|
|
340
|
-
export var BLOCK_MENU_WIDTH = 220;
|
|
340
|
+
export var BLOCK_MENU_WIDTH = 220;
|
|
341
|
+
|
|
342
|
+
// Temporarily disable BLOCK MENU feature until Q4 FY25.
|
|
343
|
+
// For more details, refer to ticket ED-26972 https://product-fabric.atlassian.net/browse/ED-26972
|
|
344
|
+
export var BLOCK_MENU_ENABLED = false;
|
|
@@ -7,7 +7,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
* @jsxRuntime classic
|
|
8
8
|
* @jsx jsx
|
|
9
9
|
*/
|
|
10
|
+
|
|
10
11
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
12
|
+
|
|
11
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
12
14
|
import { css, jsx } from '@emotion/react';
|
|
13
15
|
import { bind } from 'bind-event-listener';
|
|
@@ -31,7 +33,7 @@ import { getMultiSelectAnalyticsAttributes } from '../pm-plugins/utils/analytics
|
|
|
31
33
|
import { getLeftPosition, getTopPosition } from '../pm-plugins/utils/drag-handle-positions';
|
|
32
34
|
import { isHandleCorrelatedToSelection, selectNode } from '../pm-plugins/utils/getSelection';
|
|
33
35
|
import { alignAnchorHeadInDirectionOfPos, expandSelectionHeadToNodeAtPos } from '../pm-plugins/utils/selection';
|
|
34
|
-
import { DRAG_HANDLE_BORDER_RADIUS, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_MAX_SHIFT_CLICK_DEPTH, DRAG_HANDLE_WIDTH, DRAG_HANDLE_ZINDEX, dragHandleGap, nodeMargins, spacingBetweenNodesForPreview, topPositionAdjustment } from './consts';
|
|
36
|
+
import { BLOCK_MENU_ENABLED, DRAG_HANDLE_BORDER_RADIUS, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_MAX_SHIFT_CLICK_DEPTH, DRAG_HANDLE_WIDTH, DRAG_HANDLE_ZINDEX, dragHandleGap, nodeMargins, spacingBetweenNodesForPreview, topPositionAdjustment } from './consts';
|
|
35
37
|
import { dragPreview } from './drag-preview';
|
|
36
38
|
var iconWrapperStyles = xcss({
|
|
37
39
|
display: 'flex',
|
|
@@ -195,7 +197,7 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
195
197
|
var $anchor = (mSelect === null || mSelect === void 0 ? void 0 : mSelect.anchor) !== undefined ? tr.doc.resolve(mSelect === null || mSelect === void 0 ? void 0 : mSelect.anchor) : tr.selection.$anchor;
|
|
196
198
|
if (!isMultiSelect || tr.selection.empty || !e.shiftKey) {
|
|
197
199
|
tr = selectNode(tr, startPos, nodeType);
|
|
198
|
-
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
200
|
+
if (BLOCK_MENU_ENABLED && editorExperiment('platform_editor_controls', 'variant1')) {
|
|
199
201
|
var _api$blockControls;
|
|
200
202
|
api === null || api === void 0 || (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 || _api$blockControls.commands.toggleBlockMenu({
|
|
201
203
|
anchorName: anchorName
|