@atlaskit/editor-plugin-block-controls 2.16.2 → 2.16.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 +17 -0
- package/dist/cjs/pm-plugins/handle-mouse-over.js +4 -0
- package/dist/cjs/pm-plugins/main.js +32 -9
- package/dist/es2019/pm-plugins/handle-mouse-over.js +4 -0
- package/dist/es2019/pm-plugins/keymap.js +1 -1
- package/dist/es2019/pm-plugins/main.js +38 -10
- package/dist/esm/pm-plugins/handle-mouse-over.js +4 -0
- package/dist/esm/pm-plugins/main.js +32 -9
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 2.16.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#97978](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97978)
|
|
8
|
+
[`ea88bd7273c73`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ea88bd7273c73) -
|
|
9
|
+
Added Blocks Drag Init measurement analytics event
|
|
10
|
+
- [#99482](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/99482)
|
|
11
|
+
[`5fdd98e19255d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5fdd98e19255d) -
|
|
12
|
+
ED-26122 disable drag layout column for single column layout
|
|
13
|
+
|
|
14
|
+
## 2.16.3
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 2.16.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -92,6 +92,10 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
|
|
|
92
92
|
} else {
|
|
93
93
|
pos = view.posAtDOM(rootElement, 0);
|
|
94
94
|
}
|
|
95
|
+
if (parentRootElement && parentRootElement.getAttribute('data-layout-section') === 'true' && parentRootElement.querySelectorAll('[data-layout-column]').length === 1 && (0, _experiments.editorExperiment)('advanced_layouts', true) && (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_post_fix_patch_3')) {
|
|
96
|
+
// Don't show drag handle for layout column in a single column layout
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
95
99
|
var rootPos;
|
|
96
100
|
if ((0, _experiments.editorExperiment)('nested-dnd', true)) {
|
|
97
101
|
rootPos = view.state.doc.resolve(pos).pos;
|
|
@@ -10,6 +10,7 @@ var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
|
10
10
|
var _steps = require("@atlaskit/adf-schema/steps");
|
|
11
11
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
12
|
var _browser = require("@atlaskit/editor-common/browser");
|
|
13
|
+
var _performanceMeasures = require("@atlaskit/editor-common/performance-measures");
|
|
13
14
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
14
15
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
15
16
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
@@ -29,10 +30,11 @@ var _anchorUtils = require("./utils/anchor-utils");
|
|
|
29
30
|
var _dragTargetDebug = require("./utils/drag-target-debug");
|
|
30
31
|
var _transactions = require("./utils/transactions");
|
|
31
32
|
var key = exports.key = new _state.PluginKey('blockControls');
|
|
33
|
+
var EDITOR_BLOCKS_DRAG_INIT = 'Editor Blocks Drag Initialization Time';
|
|
32
34
|
var isHTMLElement = function isHTMLElement(element) {
|
|
33
35
|
return element instanceof HTMLElement;
|
|
34
36
|
};
|
|
35
|
-
var destroyFn = function destroyFn(api) {
|
|
37
|
+
var destroyFn = function destroyFn(api, editorView) {
|
|
36
38
|
var scrollable = document.querySelector('.fabric-editor-popup-scroll-parent');
|
|
37
39
|
var cleanupFn = [];
|
|
38
40
|
if (scrollable) {
|
|
@@ -45,6 +47,24 @@ var destroyFn = function destroyFn(api) {
|
|
|
45
47
|
var source = _ref.source;
|
|
46
48
|
return source.data.type === 'element';
|
|
47
49
|
},
|
|
50
|
+
onDrag: function onDrag() {
|
|
51
|
+
if ((0, _performanceMeasures.isMeasuring)(EDITOR_BLOCKS_DRAG_INIT) && (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_post_fix_patch_3')) {
|
|
52
|
+
(0, _performanceMeasures.stopMeasure)(EDITOR_BLOCKS_DRAG_INIT, function (duration, startTime) {
|
|
53
|
+
var _api$analytics;
|
|
54
|
+
var state = editorView.state;
|
|
55
|
+
api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.fireAnalyticsEvent({
|
|
56
|
+
action: _analytics.ACTION.BLOCKS_DRAG_INIT,
|
|
57
|
+
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
58
|
+
eventType: _analytics.EVENT_TYPE.OPERATIONAL,
|
|
59
|
+
attributes: {
|
|
60
|
+
duration: duration,
|
|
61
|
+
startTime: startTime,
|
|
62
|
+
nodesCount: state.doc.nodeSize
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
},
|
|
48
68
|
onDragStart: function onDragStart() {
|
|
49
69
|
if (isHTMLElement(scrollable)) {
|
|
50
70
|
scrollable.style.setProperty('scroll-behavior', 'unset');
|
|
@@ -63,10 +83,10 @@ var destroyFn = function destroyFn(api) {
|
|
|
63
83
|
start = _ref4.start;
|
|
64
84
|
// if no drop targets are rendered, assume that drop is invalid
|
|
65
85
|
if (location.current.dropTargets.length === 0) {
|
|
66
|
-
var _api$
|
|
86
|
+
var _api$analytics2;
|
|
67
87
|
var resolvedMovingNode = tr.doc.resolve(start);
|
|
68
88
|
var maybeNode = resolvedMovingNode.nodeAfter;
|
|
69
|
-
api === null || api === void 0 || (_api$
|
|
89
|
+
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
|
|
70
90
|
eventType: _analytics.EVENT_TYPE.UI,
|
|
71
91
|
action: _analytics.ACTION.CANCELLED,
|
|
72
92
|
actionSubject: _analytics.ACTION_SUBJECT.DRAG,
|
|
@@ -105,13 +125,13 @@ var newApply = exports.newApply = function newApply(api, formatMessage, tr, curr
|
|
|
105
125
|
var _meta$activeNode, _activeNode, _activeNode2, _meta$activeNode$hand, _meta$isDragging, _meta$isDragging2, _meta$editorHeight, _meta$editorWidthLeft, _meta$editorWidthRigh, _meta$isPMDragging;
|
|
106
126
|
var activeNode = currentState.activeNode,
|
|
107
127
|
decorations = currentState.decorations,
|
|
108
|
-
|
|
128
|
+
isResizerResizing = currentState.isResizerResizing;
|
|
129
|
+
var editorHeight = currentState.editorHeight,
|
|
109
130
|
editorWidthLeft = currentState.editorWidthLeft,
|
|
110
131
|
editorWidthRight = currentState.editorWidthRight,
|
|
111
132
|
isDragging = currentState.isDragging,
|
|
112
133
|
isMenuOpen = currentState.isMenuOpen,
|
|
113
|
-
isPMDragging = currentState.isPMDragging
|
|
114
|
-
isResizerResizing = currentState.isResizerResizing;
|
|
134
|
+
isPMDragging = currentState.isPMDragging;
|
|
115
135
|
var isActiveNodeDeleted = false;
|
|
116
136
|
|
|
117
137
|
// Remap existing decorations and activeNode when steps exist
|
|
@@ -239,14 +259,14 @@ var oldApply = exports.oldApply = function oldApply(api, formatMessage, tr, curr
|
|
|
239
259
|
var _meta$activeNode2, _meta$activeNode$hand2, _activeNodeWithNewNod, _meta$activeNode8, _meta$isDragging4, _meta$editorHeight2, _meta$editorWidthLeft2, _meta$editorWidthRigh2, _meta$isPMDragging2;
|
|
240
260
|
var isNestedEnabled = flags.isNestedEnabled;
|
|
241
261
|
var activeNode = currentState.activeNode,
|
|
242
|
-
decorations = currentState.decorations,
|
|
243
262
|
isMenuOpen = currentState.isMenuOpen,
|
|
244
263
|
editorHeight = currentState.editorHeight,
|
|
245
264
|
editorWidthLeft = currentState.editorWidthLeft,
|
|
246
265
|
editorWidthRight = currentState.editorWidthRight,
|
|
247
|
-
isResizerResizing = currentState.isResizerResizing,
|
|
248
266
|
isDragging = currentState.isDragging,
|
|
249
267
|
isPMDragging = currentState.isPMDragging;
|
|
268
|
+
var decorations = currentState.decorations,
|
|
269
|
+
isResizerResizing = currentState.isResizerResizing;
|
|
250
270
|
|
|
251
271
|
// Remap existing decorations when steps exist
|
|
252
272
|
if (tr.docChanged) {
|
|
@@ -524,6 +544,9 @@ var createPlugin = exports.createPlugin = function createPlugin(api, getIntl, no
|
|
|
524
544
|
},
|
|
525
545
|
dragstart: function dragstart(view) {
|
|
526
546
|
var _anchorRectCache;
|
|
547
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_post_fix_patch_3')) {
|
|
548
|
+
(0, _performanceMeasures.startMeasure)(EDITOR_BLOCKS_DRAG_INIT);
|
|
549
|
+
}
|
|
527
550
|
if (isAdvancedLayoutEnabled) {
|
|
528
551
|
_activeAnchorTracker.defaultActiveAnchorTracker.reset();
|
|
529
552
|
}
|
|
@@ -605,7 +628,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api, getIntl, no
|
|
|
605
628
|
}
|
|
606
629
|
|
|
607
630
|
// Start pragmatic monitors
|
|
608
|
-
var pragmaticCleanup = destroyFn(api);
|
|
631
|
+
var pragmaticCleanup = destroyFn(api, editorView);
|
|
609
632
|
return {
|
|
610
633
|
destroy: function destroy() {
|
|
611
634
|
if (editorContentArea) {
|
|
@@ -87,6 +87,10 @@ export const handleMouseOver = (view, event, api) => {
|
|
|
87
87
|
} else {
|
|
88
88
|
pos = view.posAtDOM(rootElement, 0);
|
|
89
89
|
}
|
|
90
|
+
if (parentRootElement && parentRootElement.getAttribute('data-layout-section') === 'true' && parentRootElement.querySelectorAll('[data-layout-column]').length === 1 && editorExperiment('advanced_layouts', true) && fg('platform_editor_advanced_layouts_post_fix_patch_3')) {
|
|
91
|
+
// Don't show drag handle for layout column in a single column layout
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
90
94
|
let rootPos;
|
|
91
95
|
if (editorExperiment('nested-dnd', true)) {
|
|
92
96
|
rootPos = view.state.doc.resolve(pos).pos;
|
|
@@ -6,7 +6,7 @@ import { moveNodeViaShortcut } from '../editor-commands/move-node';
|
|
|
6
6
|
import { showDragHandleAtSelection } from '../editor-commands/show-drag-handle';
|
|
7
7
|
import { DIRECTION } from './utils/consts';
|
|
8
8
|
function keymapList(api, formatMessage) {
|
|
9
|
-
|
|
9
|
+
const keymapList = {};
|
|
10
10
|
if (api && fg('platform_editor_element_drag_and_drop_ed_23873')) {
|
|
11
11
|
bindKeymapWithCommand(
|
|
12
12
|
// Ignored via go/ees005
|
|
@@ -2,6 +2,7 @@ import rafSchedule from 'raf-schd';
|
|
|
2
2
|
import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
5
|
+
import { isMeasuring, startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-measures';
|
|
5
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
7
|
import { isEmptyDocument, isTextInput } from '@atlaskit/editor-common/utils';
|
|
7
8
|
import { NodeSelection, PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -21,10 +22,11 @@ import { AnchorRectCache, isAnchorSupported } from './utils/anchor-utils';
|
|
|
21
22
|
import { isBlocksDragTargetDebug } from './utils/drag-target-debug';
|
|
22
23
|
import { getTrMetadata } from './utils/transactions';
|
|
23
24
|
export const key = new PluginKey('blockControls');
|
|
25
|
+
const EDITOR_BLOCKS_DRAG_INIT = 'Editor Blocks Drag Initialization Time';
|
|
24
26
|
const isHTMLElement = element => {
|
|
25
27
|
return element instanceof HTMLElement;
|
|
26
28
|
};
|
|
27
|
-
const destroyFn = api => {
|
|
29
|
+
const destroyFn = (api, editorView) => {
|
|
28
30
|
const scrollable = document.querySelector('.fabric-editor-popup-scroll-parent');
|
|
29
31
|
const cleanupFn = [];
|
|
30
32
|
if (scrollable) {
|
|
@@ -36,6 +38,26 @@ const destroyFn = api => {
|
|
|
36
38
|
canMonitor: ({
|
|
37
39
|
source
|
|
38
40
|
}) => source.data.type === 'element',
|
|
41
|
+
onDrag: () => {
|
|
42
|
+
if (isMeasuring(EDITOR_BLOCKS_DRAG_INIT) && fg('platform_editor_advanced_layouts_post_fix_patch_3')) {
|
|
43
|
+
stopMeasure(EDITOR_BLOCKS_DRAG_INIT, (duration, startTime) => {
|
|
44
|
+
var _api$analytics;
|
|
45
|
+
const {
|
|
46
|
+
state
|
|
47
|
+
} = editorView;
|
|
48
|
+
api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.fireAnalyticsEvent({
|
|
49
|
+
action: ACTION.BLOCKS_DRAG_INIT,
|
|
50
|
+
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
51
|
+
eventType: EVENT_TYPE.OPERATIONAL,
|
|
52
|
+
attributes: {
|
|
53
|
+
duration,
|
|
54
|
+
startTime,
|
|
55
|
+
nodesCount: state.doc.nodeSize
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
},
|
|
39
61
|
onDragStart: () => {
|
|
40
62
|
if (isHTMLElement(scrollable)) {
|
|
41
63
|
scrollable.style.setProperty('scroll-behavior', 'unset');
|
|
@@ -57,10 +79,10 @@ const destroyFn = api => {
|
|
|
57
79
|
} = source.data;
|
|
58
80
|
// if no drop targets are rendered, assume that drop is invalid
|
|
59
81
|
if (location.current.dropTargets.length === 0) {
|
|
60
|
-
var _api$
|
|
82
|
+
var _api$analytics2;
|
|
61
83
|
const resolvedMovingNode = tr.doc.resolve(start);
|
|
62
84
|
const maybeNode = resolvedMovingNode.nodeAfter;
|
|
63
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
85
|
+
api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions.attachAnalyticsEvent({
|
|
64
86
|
eventType: EVENT_TYPE.UI,
|
|
65
87
|
action: ACTION.CANCELLED,
|
|
66
88
|
actionSubject: ACTION_SUBJECT.DRAG,
|
|
@@ -100,15 +122,16 @@ export const newApply = (api, formatMessage, tr, currentState, newState, flags,
|
|
|
100
122
|
let {
|
|
101
123
|
activeNode,
|
|
102
124
|
decorations,
|
|
125
|
+
isResizerResizing
|
|
126
|
+
} = currentState;
|
|
127
|
+
const {
|
|
103
128
|
editorHeight,
|
|
104
129
|
editorWidthLeft,
|
|
105
130
|
editorWidthRight,
|
|
106
131
|
isDragging,
|
|
107
132
|
isMenuOpen,
|
|
108
133
|
// NOT USED
|
|
109
|
-
isPMDragging
|
|
110
|
-
// NOT USED
|
|
111
|
-
isResizerResizing
|
|
134
|
+
isPMDragging // NOT USED
|
|
112
135
|
} = currentState;
|
|
113
136
|
let isActiveNodeDeleted = false;
|
|
114
137
|
|
|
@@ -237,17 +260,19 @@ export const oldApply = (api, formatMessage, tr, currentState, oldState, newStat
|
|
|
237
260
|
const {
|
|
238
261
|
isNestedEnabled
|
|
239
262
|
} = flags;
|
|
240
|
-
|
|
263
|
+
const {
|
|
241
264
|
activeNode,
|
|
242
|
-
decorations,
|
|
243
265
|
isMenuOpen,
|
|
244
266
|
editorHeight,
|
|
245
267
|
editorWidthLeft,
|
|
246
268
|
editorWidthRight,
|
|
247
|
-
isResizerResizing,
|
|
248
269
|
isDragging,
|
|
249
270
|
isPMDragging
|
|
250
271
|
} = currentState;
|
|
272
|
+
let {
|
|
273
|
+
decorations,
|
|
274
|
+
isResizerResizing
|
|
275
|
+
} = currentState;
|
|
251
276
|
|
|
252
277
|
// Remap existing decorations when steps exist
|
|
253
278
|
if (tr.docChanged) {
|
|
@@ -501,6 +526,9 @@ export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI) => {
|
|
|
501
526
|
},
|
|
502
527
|
dragstart(view) {
|
|
503
528
|
var _anchorRectCache;
|
|
529
|
+
if (fg('platform_editor_advanced_layouts_post_fix_patch_3')) {
|
|
530
|
+
startMeasure(EDITOR_BLOCKS_DRAG_INIT);
|
|
531
|
+
}
|
|
504
532
|
if (isAdvancedLayoutEnabled) {
|
|
505
533
|
defaultActiveAnchorTracker.reset();
|
|
506
534
|
}
|
|
@@ -585,7 +613,7 @@ export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI) => {
|
|
|
585
613
|
}
|
|
586
614
|
|
|
587
615
|
// Start pragmatic monitors
|
|
588
|
-
const pragmaticCleanup = destroyFn(api);
|
|
616
|
+
const pragmaticCleanup = destroyFn(api, editorView);
|
|
589
617
|
return {
|
|
590
618
|
destroy() {
|
|
591
619
|
if (editorContentArea) {
|
|
@@ -86,6 +86,10 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
|
|
|
86
86
|
} else {
|
|
87
87
|
pos = view.posAtDOM(rootElement, 0);
|
|
88
88
|
}
|
|
89
|
+
if (parentRootElement && parentRootElement.getAttribute('data-layout-section') === 'true' && parentRootElement.querySelectorAll('[data-layout-column]').length === 1 && editorExperiment('advanced_layouts', true) && fg('platform_editor_advanced_layouts_post_fix_patch_3')) {
|
|
90
|
+
// Don't show drag handle for layout column in a single column layout
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
89
93
|
var rootPos;
|
|
90
94
|
if (editorExperiment('nested-dnd', true)) {
|
|
91
95
|
rootPos = view.state.doc.resolve(pos).pos;
|
|
@@ -3,6 +3,7 @@ import rafSchedule from 'raf-schd';
|
|
|
3
3
|
import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
6
|
+
import { isMeasuring, startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-measures';
|
|
6
7
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
8
|
import { isEmptyDocument, isTextInput } from '@atlaskit/editor-common/utils';
|
|
8
9
|
import { NodeSelection, PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -22,10 +23,11 @@ import { AnchorRectCache, isAnchorSupported } from './utils/anchor-utils';
|
|
|
22
23
|
import { isBlocksDragTargetDebug } from './utils/drag-target-debug';
|
|
23
24
|
import { getTrMetadata } from './utils/transactions';
|
|
24
25
|
export var key = new PluginKey('blockControls');
|
|
26
|
+
var EDITOR_BLOCKS_DRAG_INIT = 'Editor Blocks Drag Initialization Time';
|
|
25
27
|
var isHTMLElement = function isHTMLElement(element) {
|
|
26
28
|
return element instanceof HTMLElement;
|
|
27
29
|
};
|
|
28
|
-
var destroyFn = function destroyFn(api) {
|
|
30
|
+
var destroyFn = function destroyFn(api, editorView) {
|
|
29
31
|
var scrollable = document.querySelector('.fabric-editor-popup-scroll-parent');
|
|
30
32
|
var cleanupFn = [];
|
|
31
33
|
if (scrollable) {
|
|
@@ -38,6 +40,24 @@ var destroyFn = function destroyFn(api) {
|
|
|
38
40
|
var source = _ref.source;
|
|
39
41
|
return source.data.type === 'element';
|
|
40
42
|
},
|
|
43
|
+
onDrag: function onDrag() {
|
|
44
|
+
if (isMeasuring(EDITOR_BLOCKS_DRAG_INIT) && fg('platform_editor_advanced_layouts_post_fix_patch_3')) {
|
|
45
|
+
stopMeasure(EDITOR_BLOCKS_DRAG_INIT, function (duration, startTime) {
|
|
46
|
+
var _api$analytics;
|
|
47
|
+
var state = editorView.state;
|
|
48
|
+
api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.fireAnalyticsEvent({
|
|
49
|
+
action: ACTION.BLOCKS_DRAG_INIT,
|
|
50
|
+
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
51
|
+
eventType: EVENT_TYPE.OPERATIONAL,
|
|
52
|
+
attributes: {
|
|
53
|
+
duration: duration,
|
|
54
|
+
startTime: startTime,
|
|
55
|
+
nodesCount: state.doc.nodeSize
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
},
|
|
41
61
|
onDragStart: function onDragStart() {
|
|
42
62
|
if (isHTMLElement(scrollable)) {
|
|
43
63
|
scrollable.style.setProperty('scroll-behavior', 'unset');
|
|
@@ -56,10 +76,10 @@ var destroyFn = function destroyFn(api) {
|
|
|
56
76
|
start = _ref4.start;
|
|
57
77
|
// if no drop targets are rendered, assume that drop is invalid
|
|
58
78
|
if (location.current.dropTargets.length === 0) {
|
|
59
|
-
var _api$
|
|
79
|
+
var _api$analytics2;
|
|
60
80
|
var resolvedMovingNode = tr.doc.resolve(start);
|
|
61
81
|
var maybeNode = resolvedMovingNode.nodeAfter;
|
|
62
|
-
api === null || api === void 0 || (_api$
|
|
82
|
+
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
|
|
63
83
|
eventType: EVENT_TYPE.UI,
|
|
64
84
|
action: ACTION.CANCELLED,
|
|
65
85
|
actionSubject: ACTION_SUBJECT.DRAG,
|
|
@@ -98,13 +118,13 @@ export var newApply = function newApply(api, formatMessage, tr, currentState, ne
|
|
|
98
118
|
var _meta$activeNode, _activeNode, _activeNode2, _meta$activeNode$hand, _meta$isDragging, _meta$isDragging2, _meta$editorHeight, _meta$editorWidthLeft, _meta$editorWidthRigh, _meta$isPMDragging;
|
|
99
119
|
var activeNode = currentState.activeNode,
|
|
100
120
|
decorations = currentState.decorations,
|
|
101
|
-
|
|
121
|
+
isResizerResizing = currentState.isResizerResizing;
|
|
122
|
+
var editorHeight = currentState.editorHeight,
|
|
102
123
|
editorWidthLeft = currentState.editorWidthLeft,
|
|
103
124
|
editorWidthRight = currentState.editorWidthRight,
|
|
104
125
|
isDragging = currentState.isDragging,
|
|
105
126
|
isMenuOpen = currentState.isMenuOpen,
|
|
106
|
-
isPMDragging = currentState.isPMDragging
|
|
107
|
-
isResizerResizing = currentState.isResizerResizing;
|
|
127
|
+
isPMDragging = currentState.isPMDragging;
|
|
108
128
|
var isActiveNodeDeleted = false;
|
|
109
129
|
|
|
110
130
|
// Remap existing decorations and activeNode when steps exist
|
|
@@ -232,14 +252,14 @@ export var oldApply = function oldApply(api, formatMessage, tr, currentState, ol
|
|
|
232
252
|
var _meta$activeNode2, _meta$activeNode$hand2, _activeNodeWithNewNod, _meta$activeNode8, _meta$isDragging4, _meta$editorHeight2, _meta$editorWidthLeft2, _meta$editorWidthRigh2, _meta$isPMDragging2;
|
|
233
253
|
var isNestedEnabled = flags.isNestedEnabled;
|
|
234
254
|
var activeNode = currentState.activeNode,
|
|
235
|
-
decorations = currentState.decorations,
|
|
236
255
|
isMenuOpen = currentState.isMenuOpen,
|
|
237
256
|
editorHeight = currentState.editorHeight,
|
|
238
257
|
editorWidthLeft = currentState.editorWidthLeft,
|
|
239
258
|
editorWidthRight = currentState.editorWidthRight,
|
|
240
|
-
isResizerResizing = currentState.isResizerResizing,
|
|
241
259
|
isDragging = currentState.isDragging,
|
|
242
260
|
isPMDragging = currentState.isPMDragging;
|
|
261
|
+
var decorations = currentState.decorations,
|
|
262
|
+
isResizerResizing = currentState.isResizerResizing;
|
|
243
263
|
|
|
244
264
|
// Remap existing decorations when steps exist
|
|
245
265
|
if (tr.docChanged) {
|
|
@@ -517,6 +537,9 @@ export var createPlugin = function createPlugin(api, getIntl, nodeViewPortalProv
|
|
|
517
537
|
},
|
|
518
538
|
dragstart: function dragstart(view) {
|
|
519
539
|
var _anchorRectCache;
|
|
540
|
+
if (fg('platform_editor_advanced_layouts_post_fix_patch_3')) {
|
|
541
|
+
startMeasure(EDITOR_BLOCKS_DRAG_INIT);
|
|
542
|
+
}
|
|
520
543
|
if (isAdvancedLayoutEnabled) {
|
|
521
544
|
defaultActiveAnchorTracker.reset();
|
|
522
545
|
}
|
|
@@ -598,7 +621,7 @@ export var createPlugin = function createPlugin(api, getIntl, nodeViewPortalProv
|
|
|
598
621
|
}
|
|
599
622
|
|
|
600
623
|
// Start pragmatic monitors
|
|
601
|
-
var pragmaticCleanup = destroyFn(api);
|
|
624
|
+
var pragmaticCleanup = destroyFn(api, editorView);
|
|
602
625
|
return {
|
|
603
626
|
destroy: function destroy() {
|
|
604
627
|
if (editorContentArea) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "2.16.
|
|
3
|
+
"version": "2.16.4",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
34
|
-
"@atlaskit/editor-common": "^
|
|
34
|
+
"@atlaskit/editor-common": "^98.0.0",
|
|
35
35
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
37
37
|
"@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.0",
|
|
49
49
|
"@atlaskit/primitives": "^13.3.0",
|
|
50
50
|
"@atlaskit/theme": "^14.0.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^2.31.0",
|
|
52
52
|
"@atlaskit/tokens": "^2.5.0",
|
|
53
53
|
"@atlaskit/tooltip": "^19.0.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
@@ -168,6 +168,9 @@
|
|
|
168
168
|
},
|
|
169
169
|
"platform_editor_advanced_layouts_post_fix_patch_2": {
|
|
170
170
|
"type": "boolean"
|
|
171
|
+
},
|
|
172
|
+
"platform_editor_advanced_layouts_post_fix_patch_3": {
|
|
173
|
+
"type": "boolean"
|
|
171
174
|
}
|
|
172
175
|
}
|
|
173
176
|
}
|