@atlaskit/editor-plugin-block-controls 4.0.7 → 4.0.8
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 +9 -0
- package/dist/cjs/blockControlsPlugin.js +1 -1
- package/dist/cjs/pm-plugins/interaction-tracking/pm-plugin.js +2 -16
- package/dist/cjs/ui/global-styles.js +2 -2
- package/dist/es2019/blockControlsPlugin.js +1 -1
- package/dist/es2019/pm-plugins/interaction-tracking/pm-plugin.js +2 -16
- package/dist/es2019/ui/global-styles.js +2 -2
- package/dist/esm/blockControlsPlugin.js +1 -1
- package/dist/esm/pm-plugins/interaction-tracking/pm-plugin.js +2 -16
- package/dist/esm/ui/global-styles.js +2 -2
- package/package.json +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 4.0.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#185723](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/185723)
|
|
8
|
+
[`751aeb4580469`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/751aeb4580469) -
|
|
9
|
+
ED-28315 clean up fg platform_editor_controls_patch_13
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 4.0.7
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -195,7 +195,7 @@ var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPl
|
|
|
195
195
|
isEditing: (_interactionTrackingP = _pmPlugin.interactionTrackingPluginKey.getState(editorState)) === null || _interactionTrackingP === void 0 ? void 0 : _interactionTrackingP.isEditing,
|
|
196
196
|
isSelectedViaDragHandle: (_key$getState$isSelec = (_key$getState0 = _main.key.getState(editorState)) === null || _key$getState0 === void 0 ? void 0 : _key$getState0.isSelectedViaDragHandle) !== null && _key$getState$isSelec !== void 0 ? _key$getState$isSelec : false
|
|
197
197
|
};
|
|
198
|
-
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')
|
|
198
|
+
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
199
199
|
var _interactionTrackingP2, _interactionTrackingP3;
|
|
200
200
|
sharedState.isMouseOut = (_interactionTrackingP2 = (_interactionTrackingP3 = _pmPlugin.interactionTrackingPluginKey.getState(editorState)) === null || _interactionTrackingP3 === void 0 ? void 0 : _interactionTrackingP3.isMouseOut) !== null && _interactionTrackingP2 !== void 0 ? _interactionTrackingP2 : false;
|
|
201
201
|
}
|
|
@@ -9,7 +9,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _bindEventListener = require("bind-event-listener");
|
|
10
10
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
11
11
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
12
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
14
13
|
var _handleKeyDown = require("./handle-key-down");
|
|
15
14
|
var _handleMouseMove = require("./handle-mouse-move");
|
|
@@ -24,26 +23,13 @@ var createInteractionTrackingPlugin = exports.createInteractionTrackingPlugin =
|
|
|
24
23
|
var state = {
|
|
25
24
|
isEditing: false
|
|
26
25
|
};
|
|
27
|
-
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')
|
|
26
|
+
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
28
27
|
state.isMouseOut = false;
|
|
29
28
|
}
|
|
30
29
|
return state;
|
|
31
30
|
},
|
|
32
31
|
apply: function apply(tr, pluginState) {
|
|
33
32
|
var meta = tr.getMeta(interactionTrackingPluginKey);
|
|
34
|
-
if (!(0, _platformFeatureFlags.fg)('platform_editor_controls_patch_13')) {
|
|
35
|
-
switch (meta === null || meta === void 0 ? void 0 : meta.type) {
|
|
36
|
-
case 'startEditing':
|
|
37
|
-
return {
|
|
38
|
-
isEditing: true
|
|
39
|
-
};
|
|
40
|
-
case 'stopEditing':
|
|
41
|
-
return {
|
|
42
|
-
isEditing: false
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
return pluginState;
|
|
46
|
-
}
|
|
47
33
|
var newState = {};
|
|
48
34
|
switch (meta === null || meta === void 0 ? void 0 : meta.type) {
|
|
49
35
|
case 'startEditing':
|
|
@@ -68,7 +54,7 @@ var createInteractionTrackingPlugin = exports.createInteractionTrackingPlugin =
|
|
|
68
54
|
mousemove: _handleMouseMove.handleMouseMove
|
|
69
55
|
}
|
|
70
56
|
},
|
|
71
|
-
view: (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')
|
|
57
|
+
view: (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? function (view) {
|
|
72
58
|
var editorContentArea = view.dom.closest('.ak-editor-content-area');
|
|
73
59
|
var unbindMouseEnter;
|
|
74
60
|
var unbindMouseLeave;
|
|
@@ -28,10 +28,10 @@ var _consts = require("./consts");
|
|
|
28
28
|
*/
|
|
29
29
|
var dragHandlerAnchorSelector = '[data-drag-handler-anchor-name]:not([data-drag-handler-node-type="tableRow"], [data-drag-handler-node-type="media"])';
|
|
30
30
|
var gutterPaddingWidth = function gutterPaddingWidth() {
|
|
31
|
-
return (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')
|
|
31
|
+
return (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? "".concat((0, _editorSharedStyles.akEditorGutterPaddingDynamic)(), "px") : '100%';
|
|
32
32
|
};
|
|
33
33
|
var gutterPaddingLeft = function gutterPaddingLeft() {
|
|
34
|
-
return (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')
|
|
34
|
+
return (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? "-".concat((0, _editorSharedStyles.akEditorGutterPaddingDynamic)(), "px") : '-100px';
|
|
35
35
|
};
|
|
36
36
|
var extendedHoverZone = function extendedHoverZone() {
|
|
37
37
|
return (0, _react.css)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, ".block-ctrl-drag-preview ".concat(dragHandlerAnchorSelector, "::after"), {
|
|
@@ -186,7 +186,7 @@ export const blockControlsPlugin = ({
|
|
|
186
186
|
isEditing: (_interactionTrackingP = interactionTrackingPluginKey.getState(editorState)) === null || _interactionTrackingP === void 0 ? void 0 : _interactionTrackingP.isEditing,
|
|
187
187
|
isSelectedViaDragHandle: (_key$getState$isSelec = (_key$getState0 = key.getState(editorState)) === null || _key$getState0 === void 0 ? void 0 : _key$getState0.isSelectedViaDragHandle) !== null && _key$getState$isSelec !== void 0 ? _key$getState$isSelec : false
|
|
188
188
|
};
|
|
189
|
-
if (editorExperiment('platform_editor_controls', 'variant1')
|
|
189
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
190
190
|
var _interactionTrackingP2, _interactionTrackingP3;
|
|
191
191
|
sharedState.isMouseOut = (_interactionTrackingP2 = (_interactionTrackingP3 = interactionTrackingPluginKey.getState(editorState)) === null || _interactionTrackingP3 === void 0 ? void 0 : _interactionTrackingP3.isMouseOut) !== null && _interactionTrackingP2 !== void 0 ? _interactionTrackingP2 : false;
|
|
192
192
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { bind } from 'bind-event-listener';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
5
|
import { handleKeyDown } from './handle-key-down';
|
|
7
6
|
import { handleMouseEnter, handleMouseLeave, handleMouseMove } from './handle-mouse-move';
|
|
@@ -14,26 +13,13 @@ export const createInteractionTrackingPlugin = () => {
|
|
|
14
13
|
const state = {
|
|
15
14
|
isEditing: false
|
|
16
15
|
};
|
|
17
|
-
if (editorExperiment('platform_editor_controls', 'variant1')
|
|
16
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
18
17
|
state.isMouseOut = false;
|
|
19
18
|
}
|
|
20
19
|
return state;
|
|
21
20
|
},
|
|
22
21
|
apply(tr, pluginState) {
|
|
23
22
|
const meta = tr.getMeta(interactionTrackingPluginKey);
|
|
24
|
-
if (!fg('platform_editor_controls_patch_13')) {
|
|
25
|
-
switch (meta === null || meta === void 0 ? void 0 : meta.type) {
|
|
26
|
-
case 'startEditing':
|
|
27
|
-
return {
|
|
28
|
-
isEditing: true
|
|
29
|
-
};
|
|
30
|
-
case 'stopEditing':
|
|
31
|
-
return {
|
|
32
|
-
isEditing: false
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
return pluginState;
|
|
36
|
-
}
|
|
37
23
|
const newState = {};
|
|
38
24
|
switch (meta === null || meta === void 0 ? void 0 : meta.type) {
|
|
39
25
|
case 'startEditing':
|
|
@@ -61,7 +47,7 @@ export const createInteractionTrackingPlugin = () => {
|
|
|
61
47
|
mousemove: handleMouseMove
|
|
62
48
|
}
|
|
63
49
|
},
|
|
64
|
-
view: editorExperiment('platform_editor_controls', 'variant1')
|
|
50
|
+
view: editorExperiment('platform_editor_controls', 'variant1') ? view => {
|
|
65
51
|
const editorContentArea = view.dom.closest('.ak-editor-content-area');
|
|
66
52
|
let unbindMouseEnter;
|
|
67
53
|
let unbindMouseLeave;
|
|
@@ -19,8 +19,8 @@ import { DRAG_HANDLE_MAX_WIDTH_PLUS_GAP, DRAG_HANDLE_WIDTH } from './consts';
|
|
|
19
19
|
* including those within table rows and media.
|
|
20
20
|
*/
|
|
21
21
|
const dragHandlerAnchorSelector = '[data-drag-handler-anchor-name]:not([data-drag-handler-node-type="tableRow"], [data-drag-handler-node-type="media"])';
|
|
22
|
-
const gutterPaddingWidth = () => editorExperiment('platform_editor_controls', 'variant1')
|
|
23
|
-
const gutterPaddingLeft = () => editorExperiment('platform_editor_controls', 'variant1')
|
|
22
|
+
const gutterPaddingWidth = () => editorExperiment('platform_editor_controls', 'variant1') ? `${akEditorGutterPaddingDynamic()}px` : '100%';
|
|
23
|
+
const gutterPaddingLeft = () => editorExperiment('platform_editor_controls', 'variant1') ? `-${akEditorGutterPaddingDynamic()}px` : '-100px';
|
|
24
24
|
const extendedHoverZone = () => css({
|
|
25
25
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
26
26
|
[`.block-ctrl-drag-preview ${dragHandlerAnchorSelector}::after`]: {
|
|
@@ -188,7 +188,7 @@ export var blockControlsPlugin = function blockControlsPlugin(_ref) {
|
|
|
188
188
|
isEditing: (_interactionTrackingP = interactionTrackingPluginKey.getState(editorState)) === null || _interactionTrackingP === void 0 ? void 0 : _interactionTrackingP.isEditing,
|
|
189
189
|
isSelectedViaDragHandle: (_key$getState$isSelec = (_key$getState0 = key.getState(editorState)) === null || _key$getState0 === void 0 ? void 0 : _key$getState0.isSelectedViaDragHandle) !== null && _key$getState$isSelec !== void 0 ? _key$getState$isSelec : false
|
|
190
190
|
};
|
|
191
|
-
if (editorExperiment('platform_editor_controls', 'variant1')
|
|
191
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
192
192
|
var _interactionTrackingP2, _interactionTrackingP3;
|
|
193
193
|
sharedState.isMouseOut = (_interactionTrackingP2 = (_interactionTrackingP3 = interactionTrackingPluginKey.getState(editorState)) === null || _interactionTrackingP3 === void 0 ? void 0 : _interactionTrackingP3.isMouseOut) !== null && _interactionTrackingP2 !== void 0 ? _interactionTrackingP2 : false;
|
|
194
194
|
}
|
|
@@ -4,7 +4,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import { bind } from 'bind-event-listener';
|
|
5
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
6
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
8
|
import { handleKeyDown } from './handle-key-down';
|
|
10
9
|
import { handleMouseEnter, handleMouseLeave, handleMouseMove } from './handle-mouse-move';
|
|
@@ -17,26 +16,13 @@ export var createInteractionTrackingPlugin = function createInteractionTrackingP
|
|
|
17
16
|
var state = {
|
|
18
17
|
isEditing: false
|
|
19
18
|
};
|
|
20
|
-
if (editorExperiment('platform_editor_controls', 'variant1')
|
|
19
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
21
20
|
state.isMouseOut = false;
|
|
22
21
|
}
|
|
23
22
|
return state;
|
|
24
23
|
},
|
|
25
24
|
apply: function apply(tr, pluginState) {
|
|
26
25
|
var meta = tr.getMeta(interactionTrackingPluginKey);
|
|
27
|
-
if (!fg('platform_editor_controls_patch_13')) {
|
|
28
|
-
switch (meta === null || meta === void 0 ? void 0 : meta.type) {
|
|
29
|
-
case 'startEditing':
|
|
30
|
-
return {
|
|
31
|
-
isEditing: true
|
|
32
|
-
};
|
|
33
|
-
case 'stopEditing':
|
|
34
|
-
return {
|
|
35
|
-
isEditing: false
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
return pluginState;
|
|
39
|
-
}
|
|
40
26
|
var newState = {};
|
|
41
27
|
switch (meta === null || meta === void 0 ? void 0 : meta.type) {
|
|
42
28
|
case 'startEditing':
|
|
@@ -61,7 +47,7 @@ export var createInteractionTrackingPlugin = function createInteractionTrackingP
|
|
|
61
47
|
mousemove: handleMouseMove
|
|
62
48
|
}
|
|
63
49
|
},
|
|
64
|
-
view: editorExperiment('platform_editor_controls', 'variant1')
|
|
50
|
+
view: editorExperiment('platform_editor_controls', 'variant1') ? function (view) {
|
|
65
51
|
var editorContentArea = view.dom.closest('.ak-editor-content-area');
|
|
66
52
|
var unbindMouseEnter;
|
|
67
53
|
var unbindMouseLeave;
|
|
@@ -21,10 +21,10 @@ import { DRAG_HANDLE_MAX_WIDTH_PLUS_GAP, DRAG_HANDLE_WIDTH } from './consts';
|
|
|
21
21
|
*/
|
|
22
22
|
var dragHandlerAnchorSelector = '[data-drag-handler-anchor-name]:not([data-drag-handler-node-type="tableRow"], [data-drag-handler-node-type="media"])';
|
|
23
23
|
var gutterPaddingWidth = function gutterPaddingWidth() {
|
|
24
|
-
return editorExperiment('platform_editor_controls', 'variant1')
|
|
24
|
+
return editorExperiment('platform_editor_controls', 'variant1') ? "".concat(akEditorGutterPaddingDynamic(), "px") : '100%';
|
|
25
25
|
};
|
|
26
26
|
var gutterPaddingLeft = function gutterPaddingLeft() {
|
|
27
|
-
return editorExperiment('platform_editor_controls', 'variant1')
|
|
27
|
+
return editorExperiment('platform_editor_controls', 'variant1') ? "-".concat(akEditorGutterPaddingDynamic(), "px") : '-100px';
|
|
28
28
|
};
|
|
29
29
|
var extendedHoverZone = function extendedHoverZone() {
|
|
30
30
|
return css(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ".block-ctrl-drag-preview ".concat(dragHandlerAnchorSelector, "::after"), {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.8",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -167,9 +167,6 @@
|
|
|
167
167
|
"dst-a11y__replace-anchor-with-link__editor-jenga": {
|
|
168
168
|
"type": "boolean"
|
|
169
169
|
},
|
|
170
|
-
"platform_editor_controls_patch_13": {
|
|
171
|
-
"type": "boolean"
|
|
172
|
-
},
|
|
173
170
|
"platform_editor_breakout_resizing_hello_release": {
|
|
174
171
|
"type": "boolean"
|
|
175
172
|
},
|