@atlaskit/editor-plugin-block-controls 4.2.1 → 4.2.2
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 +7 -0
- package/dist/cjs/pm-plugins/decorations-drop-target-active.js +0 -4
- package/dist/cjs/pm-plugins/decorations-drop-target.js +2 -10
- package/dist/es2019/pm-plugins/decorations-drop-target-active.js +1 -5
- package/dist/es2019/pm-plugins/decorations-drop-target.js +3 -11
- package/dist/esm/pm-plugins/decorations-drop-target-active.js +1 -5
- package/dist/esm/pm-plugins/decorations-drop-target.js +3 -11
- package/package.json +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getActiveDropTargetDecorations = exports.canMoveNodeOrSliceToPos = void 0;
|
|
7
7
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
8
8
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
9
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
11
10
|
var _decorationsCommon = require("./decorations-common");
|
|
12
11
|
var _decorationsDropTarget = require("./decorations-drop-target");
|
|
@@ -60,9 +59,6 @@ var canMoveNodeOrSliceToPos = exports.canMoveNodeOrSliceToPos = function canMove
|
|
|
60
59
|
return true;
|
|
61
60
|
};
|
|
62
61
|
var getActiveDropTargetDecorations = exports.getActiveDropTargetDecorations = function getActiveDropTargetDecorations(activeDropTargetNode, state, api, existingDecs, formatMessage, nodeViewPortalProviderAPI, activeNode, anchorRectCache) {
|
|
63
|
-
if (!(0, _platformFeatureFlags.fg)('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
64
|
-
(0, _decorationsCommon.unmountDecorations)(nodeViewPortalProviderAPI, 'data-blocks-drop-target-container', 'data-blocks-drop-target-key');
|
|
65
|
-
}
|
|
66
62
|
var decsToAdd = [];
|
|
67
63
|
var decsToRemove = existingDecs.filter(function (dec) {
|
|
68
64
|
return !!dec;
|
|
@@ -11,7 +11,6 @@ var _uuid = _interopRequireDefault(require("uuid"));
|
|
|
11
11
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
12
12
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
13
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
16
15
|
var _consts = require("../ui/consts");
|
|
17
16
|
var _dropTarget = require("../ui/drop-target");
|
|
@@ -117,9 +116,7 @@ var createDropTargetDecoration = exports.createDropTargetDecoration = function c
|
|
|
117
116
|
type: _decorationsCommon.TYPE_DROP_TARGET_DEC,
|
|
118
117
|
side: side,
|
|
119
118
|
destroy: function destroy() {
|
|
120
|
-
|
|
121
|
-
nodeViewPortalProviderAPI.remove(key);
|
|
122
|
-
}
|
|
119
|
+
nodeViewPortalProviderAPI.remove(key);
|
|
123
120
|
}
|
|
124
121
|
});
|
|
125
122
|
};
|
|
@@ -149,16 +146,11 @@ var createLayoutDropTargetDecoration = exports.createLayoutDropTargetDecoration
|
|
|
149
146
|
}, {
|
|
150
147
|
type: _decorationsCommon.TYPE_DROP_TARGET_DEC,
|
|
151
148
|
destroy: function destroy() {
|
|
152
|
-
|
|
153
|
-
nodeViewPortalProviderAPI.remove(key);
|
|
154
|
-
}
|
|
149
|
+
nodeViewPortalProviderAPI.remove(key);
|
|
155
150
|
}
|
|
156
151
|
});
|
|
157
152
|
};
|
|
158
153
|
var dropTargetDecorations = exports.dropTargetDecorations = function dropTargetDecorations(newState, api, formatMessage, nodeViewPortalProviderAPI, activeNode, anchorRectCache, from, to) {
|
|
159
|
-
if (!(0, _platformFeatureFlags.fg)('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
160
|
-
(0, _decorationsCommon.unmountDecorations)(nodeViewPortalProviderAPI, 'data-blocks-drop-target-container', 'data-blocks-drop-target-key');
|
|
161
|
-
}
|
|
162
154
|
var decs = [];
|
|
163
155
|
var POS_END_OF_DOC = newState.doc.nodeSize - 2;
|
|
164
156
|
var docFrom = from === undefined || from < 0 ? 0 : from;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { expandSelectionBounds } from '@atlaskit/editor-common/selection';
|
|
2
2
|
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
|
-
import { getNodeAnchor
|
|
4
|
+
import { getNodeAnchor } from './decorations-common';
|
|
6
5
|
import { createDropTargetDecoration, createLayoutDropTargetDecoration } from './decorations-drop-target';
|
|
7
6
|
import { findSurroundingNodes } from './decorations-find-surrounding-nodes';
|
|
8
7
|
import { defaultActiveAnchorTracker } from './utils/active-anchor-tracker';
|
|
@@ -56,9 +55,6 @@ export const canMoveNodeOrSliceToPos = (state, node, parent, index, $toPos, acti
|
|
|
56
55
|
return true;
|
|
57
56
|
};
|
|
58
57
|
export const getActiveDropTargetDecorations = (activeDropTargetNode, state, api, existingDecs, formatMessage, nodeViewPortalProviderAPI, activeNode, anchorRectCache) => {
|
|
59
|
-
if (!fg('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
60
|
-
unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drop-target-container', 'data-blocks-drop-target-key');
|
|
61
|
-
}
|
|
62
58
|
const decsToAdd = [];
|
|
63
59
|
let decsToRemove = existingDecs.filter(dec => !!dec);
|
|
64
60
|
const activeNodePos = activeNode === null || activeNode === void 0 ? void 0 : activeNode.pos;
|
|
@@ -3,12 +3,11 @@ import uuid from 'uuid';
|
|
|
3
3
|
import { expandSelectionBounds } from '@atlaskit/editor-common/selection';
|
|
4
4
|
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
import { nodeMargins } from '../ui/consts';
|
|
9
8
|
import { DropTarget, EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_GAP, EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_OFFSET } from '../ui/drop-target';
|
|
10
9
|
import { DropTargetLayout } from '../ui/drop-target-layout';
|
|
11
|
-
import { NESTED_DEPTH, TYPE_DROP_TARGET_DEC
|
|
10
|
+
import { NESTED_DEPTH, TYPE_DROP_TARGET_DEC } from './decorations-common';
|
|
12
11
|
import { maxLayoutColumnSupported } from './utils/consts';
|
|
13
12
|
import { canMoveNodeToIndex, canMoveSliceToIndex, isInSameLayout } from './utils/validation';
|
|
14
13
|
const IGNORE_NODES = ['tableCell', 'tableHeader', 'tableRow', 'layoutColumn', 'listItem', 'caption'];
|
|
@@ -105,9 +104,7 @@ export const createDropTargetDecoration = (pos, props, nodeViewPortalProviderAPI
|
|
|
105
104
|
type: TYPE_DROP_TARGET_DEC,
|
|
106
105
|
side,
|
|
107
106
|
destroy: () => {
|
|
108
|
-
|
|
109
|
-
nodeViewPortalProviderAPI.remove(key);
|
|
110
|
-
}
|
|
107
|
+
nodeViewPortalProviderAPI.remove(key);
|
|
111
108
|
}
|
|
112
109
|
});
|
|
113
110
|
};
|
|
@@ -136,16 +133,11 @@ export const createLayoutDropTargetDecoration = (pos, props, nodeViewPortalProvi
|
|
|
136
133
|
}, {
|
|
137
134
|
type: TYPE_DROP_TARGET_DEC,
|
|
138
135
|
destroy: () => {
|
|
139
|
-
|
|
140
|
-
nodeViewPortalProviderAPI.remove(key);
|
|
141
|
-
}
|
|
136
|
+
nodeViewPortalProviderAPI.remove(key);
|
|
142
137
|
}
|
|
143
138
|
});
|
|
144
139
|
};
|
|
145
140
|
export const dropTargetDecorations = (newState, api, formatMessage, nodeViewPortalProviderAPI, activeNode, anchorRectCache, from, to) => {
|
|
146
|
-
if (!fg('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
147
|
-
unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drop-target-container', 'data-blocks-drop-target-key');
|
|
148
|
-
}
|
|
149
141
|
const decs = [];
|
|
150
142
|
const POS_END_OF_DOC = newState.doc.nodeSize - 2;
|
|
151
143
|
const docFrom = from === undefined || from < 0 ? 0 : from;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { expandSelectionBounds } from '@atlaskit/editor-common/selection';
|
|
2
2
|
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
|
-
import { getNodeAnchor
|
|
4
|
+
import { getNodeAnchor } from './decorations-common';
|
|
6
5
|
import { createDropTargetDecoration, createLayoutDropTargetDecoration } from './decorations-drop-target';
|
|
7
6
|
import { findSurroundingNodes } from './decorations-find-surrounding-nodes';
|
|
8
7
|
import { defaultActiveAnchorTracker } from './utils/active-anchor-tracker';
|
|
@@ -55,9 +54,6 @@ export var canMoveNodeOrSliceToPos = function canMoveNodeOrSliceToPos(state, nod
|
|
|
55
54
|
return true;
|
|
56
55
|
};
|
|
57
56
|
export var getActiveDropTargetDecorations = function getActiveDropTargetDecorations(activeDropTargetNode, state, api, existingDecs, formatMessage, nodeViewPortalProviderAPI, activeNode, anchorRectCache) {
|
|
58
|
-
if (!fg('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
59
|
-
unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drop-target-container', 'data-blocks-drop-target-key');
|
|
60
|
-
}
|
|
61
57
|
var decsToAdd = [];
|
|
62
58
|
var decsToRemove = existingDecs.filter(function (dec) {
|
|
63
59
|
return !!dec;
|
|
@@ -6,12 +6,11 @@ import uuid from 'uuid';
|
|
|
6
6
|
import { expandSelectionBounds } from '@atlaskit/editor-common/selection';
|
|
7
7
|
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
10
|
import { nodeMargins } from '../ui/consts';
|
|
12
11
|
import { DropTarget, EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_GAP, EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_OFFSET } from '../ui/drop-target';
|
|
13
12
|
import { DropTargetLayout } from '../ui/drop-target-layout';
|
|
14
|
-
import { NESTED_DEPTH, TYPE_DROP_TARGET_DEC
|
|
13
|
+
import { NESTED_DEPTH, TYPE_DROP_TARGET_DEC } from './decorations-common';
|
|
15
14
|
import { maxLayoutColumnSupported } from './utils/consts';
|
|
16
15
|
import { canMoveNodeToIndex, canMoveSliceToIndex, isInSameLayout } from './utils/validation';
|
|
17
16
|
var IGNORE_NODES = ['tableCell', 'tableHeader', 'tableRow', 'layoutColumn', 'listItem', 'caption'];
|
|
@@ -110,9 +109,7 @@ export var createDropTargetDecoration = function createDropTargetDecoration(pos,
|
|
|
110
109
|
type: TYPE_DROP_TARGET_DEC,
|
|
111
110
|
side: side,
|
|
112
111
|
destroy: function destroy() {
|
|
113
|
-
|
|
114
|
-
nodeViewPortalProviderAPI.remove(key);
|
|
115
|
-
}
|
|
112
|
+
nodeViewPortalProviderAPI.remove(key);
|
|
116
113
|
}
|
|
117
114
|
});
|
|
118
115
|
};
|
|
@@ -142,16 +139,11 @@ export var createLayoutDropTargetDecoration = function createLayoutDropTargetDec
|
|
|
142
139
|
}, {
|
|
143
140
|
type: TYPE_DROP_TARGET_DEC,
|
|
144
141
|
destroy: function destroy() {
|
|
145
|
-
|
|
146
|
-
nodeViewPortalProviderAPI.remove(key);
|
|
147
|
-
}
|
|
142
|
+
nodeViewPortalProviderAPI.remove(key);
|
|
148
143
|
}
|
|
149
144
|
});
|
|
150
145
|
};
|
|
151
146
|
export var dropTargetDecorations = function dropTargetDecorations(newState, api, formatMessage, nodeViewPortalProviderAPI, activeNode, anchorRectCache, from, to) {
|
|
152
|
-
if (!fg('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
153
|
-
unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drop-target-container', 'data-blocks-drop-target-key');
|
|
154
|
-
}
|
|
155
147
|
var decs = [];
|
|
156
148
|
var POS_END_OF_DOC = newState.doc.nodeSize - 2;
|
|
157
149
|
var docFrom = from === undefined || from < 0 ? 0 : from;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.2",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -168,9 +168,6 @@
|
|
|
168
168
|
"platform_editor_breakout_resizing_hello_release": {
|
|
169
169
|
"type": "boolean"
|
|
170
170
|
},
|
|
171
|
-
"platform_editor_block_controls_drop_target_mem_fix": {
|
|
172
|
-
"type": "boolean"
|
|
173
|
-
},
|
|
174
171
|
"platform_editor_controls_patch_15": {
|
|
175
172
|
"type": "boolean"
|
|
176
173
|
},
|