@atlaskit/editor-plugin-block-controls 2.1.4 → 2.1.5
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 +12 -0
- package/dist/cjs/pm-plugins/decorations.js +10 -1
- package/dist/cjs/pm-plugins/handle-mouse-over.js +2 -0
- package/dist/cjs/pm-plugins/main.js +3 -0
- package/dist/es2019/pm-plugins/decorations.js +10 -1
- package/dist/es2019/pm-plugins/handle-mouse-over.js +2 -0
- package/dist/es2019/pm-plugins/main.js +3 -0
- package/dist/esm/pm-plugins/decorations.js +10 -1
- package/dist/esm/pm-plugins/handle-mouse-over.js +2 -0
- package/dist/esm/pm-plugins/main.js +3 -0
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 2.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#144914](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/144914)
|
|
8
|
+
[`5c53f0507a346`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5c53f0507a346) -
|
|
9
|
+
ED-25125 Add patch 2 Fg
|
|
10
|
+
- [#142749](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/142749)
|
|
11
|
+
[`273fc31422520`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/273fc31422520) -
|
|
12
|
+
ED-25019 fix wrapped image z index issue
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 2.1.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -15,6 +15,7 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
15
15
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
16
16
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
17
17
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
18
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
19
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
19
20
|
var _dragHandle = require("../ui/drag-handle");
|
|
20
21
|
var _dropTarget = require("../ui/drop-target");
|
|
@@ -137,6 +138,14 @@ var ObjHash = /*#__PURE__*/function () {
|
|
|
137
138
|
return ObjHash;
|
|
138
139
|
}();
|
|
139
140
|
(0, _defineProperty2.default)(ObjHash, "caching", new WeakMap());
|
|
141
|
+
var shouldIgnoreNode = function shouldIgnoreNode(node) {
|
|
142
|
+
if ('mediaSingle' === node.type.name && (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_1')) {
|
|
143
|
+
if (['wrap-right', 'wrap-left'].includes(node.attrs.layout)) {
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return IGNORE_NODES.includes(node.type.name);
|
|
148
|
+
};
|
|
140
149
|
var nodeDecorations = exports.nodeDecorations = function nodeDecorations(newState) {
|
|
141
150
|
var decs = [];
|
|
142
151
|
newState.doc.descendants(function (node, pos, _parent, index) {
|
|
@@ -156,7 +165,7 @@ var nodeDecorations = exports.nodeDecorations = function nodeDecorations(newStat
|
|
|
156
165
|
if (node.isInline) {
|
|
157
166
|
return false;
|
|
158
167
|
}
|
|
159
|
-
if (
|
|
168
|
+
if (shouldIgnoreNode(node)) {
|
|
160
169
|
return shouldDescend; //skip over, don't consider it a valid depth
|
|
161
170
|
}
|
|
162
171
|
depth = newState.doc.resolve(pos).depth;
|
|
@@ -52,6 +52,8 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
// We want to exlude handles from showing for wrapped nodes
|
|
55
|
+
// TODO We should be able remove these check if we decided to
|
|
56
|
+
// go we not decoration for wrapped image solution.
|
|
55
57
|
if (['wrap-right', 'wrap-left'].includes(rootElement.getAttribute('layout') || '') && (0, _platformFeatureFlags.fg)('platform_editor_element_drag_and_drop_ed_24227')) {
|
|
56
58
|
return false;
|
|
57
59
|
}
|
|
@@ -99,6 +99,9 @@ var createPlugin = exports.createPlugin = function createPlugin(api, getIntl) {
|
|
|
99
99
|
var isNestedEnabled = (0, _experiments.editorExperiment)('nested-dnd', true, {
|
|
100
100
|
exposure: true
|
|
101
101
|
});
|
|
102
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_2')) {
|
|
103
|
+
// TODO: Remove this once FG is used in code
|
|
104
|
+
}
|
|
102
105
|
return new _safePlugin.SafePlugin({
|
|
103
106
|
key: key,
|
|
104
107
|
state: {
|
|
@@ -6,6 +6,7 @@ import { RawIntlProvider } from 'react-intl-next';
|
|
|
6
6
|
import uuid from 'uuid';
|
|
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';
|
|
9
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
10
11
|
import { DragHandle } from '../ui/drag-handle';
|
|
11
12
|
import { DropTarget } from '../ui/drop-target';
|
|
@@ -116,6 +117,14 @@ class ObjHash {
|
|
|
116
117
|
}
|
|
117
118
|
}
|
|
118
119
|
_defineProperty(ObjHash, "caching", new WeakMap());
|
|
120
|
+
const shouldIgnoreNode = node => {
|
|
121
|
+
if ('mediaSingle' === node.type.name && fg('platform_editor_element_dnd_nested_fix_patch_1')) {
|
|
122
|
+
if (['wrap-right', 'wrap-left'].includes(node.attrs.layout)) {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return IGNORE_NODES.includes(node.type.name);
|
|
127
|
+
};
|
|
119
128
|
export const nodeDecorations = newState => {
|
|
120
129
|
const decs = [];
|
|
121
130
|
newState.doc.descendants((node, pos, _parent, index) => {
|
|
@@ -134,7 +143,7 @@ export const nodeDecorations = newState => {
|
|
|
134
143
|
if (node.isInline) {
|
|
135
144
|
return false;
|
|
136
145
|
}
|
|
137
|
-
if (
|
|
146
|
+
if (shouldIgnoreNode(node)) {
|
|
138
147
|
return shouldDescend; //skip over, don't consider it a valid depth
|
|
139
148
|
}
|
|
140
149
|
depth = newState.doc.resolve(pos).depth;
|
|
@@ -47,6 +47,8 @@ export const handleMouseOver = (view, event, api) => {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
// We want to exlude handles from showing for wrapped nodes
|
|
50
|
+
// TODO We should be able remove these check if we decided to
|
|
51
|
+
// go we not decoration for wrapped image solution.
|
|
50
52
|
if (['wrap-right', 'wrap-left'].includes(rootElement.getAttribute('layout') || '') && fg('platform_editor_element_drag_and_drop_ed_24227')) {
|
|
51
53
|
return false;
|
|
52
54
|
}
|
|
@@ -94,6 +94,9 @@ export const createPlugin = (api, getIntl) => {
|
|
|
94
94
|
const isNestedEnabled = editorExperiment('nested-dnd', true, {
|
|
95
95
|
exposure: true
|
|
96
96
|
});
|
|
97
|
+
if (fg('platform_editor_element_dnd_nested_fix_patch_2')) {
|
|
98
|
+
// TODO: Remove this once FG is used in code
|
|
99
|
+
}
|
|
97
100
|
return new SafePlugin({
|
|
98
101
|
key,
|
|
99
102
|
state: {
|
|
@@ -8,6 +8,7 @@ import { RawIntlProvider } from 'react-intl-next';
|
|
|
8
8
|
import uuid from 'uuid';
|
|
9
9
|
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
10
10
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
13
|
import { DragHandle } from '../ui/drag-handle';
|
|
13
14
|
import { DropTarget } from '../ui/drop-target';
|
|
@@ -130,6 +131,14 @@ var ObjHash = /*#__PURE__*/function () {
|
|
|
130
131
|
return ObjHash;
|
|
131
132
|
}();
|
|
132
133
|
_defineProperty(ObjHash, "caching", new WeakMap());
|
|
134
|
+
var shouldIgnoreNode = function shouldIgnoreNode(node) {
|
|
135
|
+
if ('mediaSingle' === node.type.name && fg('platform_editor_element_dnd_nested_fix_patch_1')) {
|
|
136
|
+
if (['wrap-right', 'wrap-left'].includes(node.attrs.layout)) {
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return IGNORE_NODES.includes(node.type.name);
|
|
141
|
+
};
|
|
133
142
|
export var nodeDecorations = function nodeDecorations(newState) {
|
|
134
143
|
var decs = [];
|
|
135
144
|
newState.doc.descendants(function (node, pos, _parent, index) {
|
|
@@ -149,7 +158,7 @@ export var nodeDecorations = function nodeDecorations(newState) {
|
|
|
149
158
|
if (node.isInline) {
|
|
150
159
|
return false;
|
|
151
160
|
}
|
|
152
|
-
if (
|
|
161
|
+
if (shouldIgnoreNode(node)) {
|
|
153
162
|
return shouldDescend; //skip over, don't consider it a valid depth
|
|
154
163
|
}
|
|
155
164
|
depth = newState.doc.resolve(pos).depth;
|
|
@@ -46,6 +46,8 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
// We want to exlude handles from showing for wrapped nodes
|
|
49
|
+
// TODO We should be able remove these check if we decided to
|
|
50
|
+
// go we not decoration for wrapped image solution.
|
|
49
51
|
if (['wrap-right', 'wrap-left'].includes(rootElement.getAttribute('layout') || '') && fg('platform_editor_element_drag_and_drop_ed_24227')) {
|
|
50
52
|
return false;
|
|
51
53
|
}
|
|
@@ -92,6 +92,9 @@ export var createPlugin = function createPlugin(api, getIntl) {
|
|
|
92
92
|
var isNestedEnabled = editorExperiment('nested-dnd', true, {
|
|
93
93
|
exposure: true
|
|
94
94
|
});
|
|
95
|
+
if (fg('platform_editor_element_dnd_nested_fix_patch_2')) {
|
|
96
|
+
// TODO: Remove this once FG is used in code
|
|
97
|
+
}
|
|
95
98
|
return new SafePlugin({
|
|
96
99
|
key: key,
|
|
97
100
|
state: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
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": "^40.9.0",
|
|
34
|
-
"@atlaskit/editor-common": "^91.
|
|
34
|
+
"@atlaskit/editor-common": "^91.1.0",
|
|
35
35
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
37
37
|
"@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@atlaskit/editor-plugin-quick-insert": "^1.4.0",
|
|
40
40
|
"@atlaskit/editor-plugin-width": "^1.3.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "6.0.0",
|
|
42
|
-
"@atlaskit/editor-shared-styles": "^
|
|
42
|
+
"@atlaskit/editor-shared-styles": "^3.0.0",
|
|
43
43
|
"@atlaskit/editor-tables": "^2.8.0",
|
|
44
44
|
"@atlaskit/icon": "^22.18.0",
|
|
45
45
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
@@ -138,6 +138,9 @@
|
|
|
138
138
|
},
|
|
139
139
|
"platform_editor_element_dnd_nested_fix_patch_1": {
|
|
140
140
|
"type": "boolean"
|
|
141
|
+
},
|
|
142
|
+
"platform_editor_element_dnd_nested_fix_patch_2": {
|
|
143
|
+
"type": "boolean"
|
|
141
144
|
}
|
|
142
145
|
}
|
|
143
146
|
}
|