@atlaskit/editor-plugin-block-controls 3.5.1 → 3.5.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 +9 -0
- package/dist/cjs/pm-plugins/handle-mouse-over.js +1 -2
- package/dist/cjs/pm-plugins/main.js +2 -4
- package/dist/cjs/pm-plugins/utils/active-anchor-tracker.js +1 -2
- package/dist/es2019/pm-plugins/handle-mouse-over.js +1 -2
- package/dist/es2019/pm-plugins/main.js +2 -4
- package/dist/es2019/pm-plugins/utils/active-anchor-tracker.js +1 -2
- package/dist/esm/pm-plugins/handle-mouse-over.js +1 -2
- package/dist/esm/pm-plugins/main.js +2 -4
- package/dist/esm/pm-plugins/utils/active-anchor-tracker.js +1 -2
- package/package.json +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 3.5.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#128179](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/128179)
|
|
8
|
+
[`1ce5182d1a35f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1ce5182d1a35f) -
|
|
9
|
+
Clean up feature flag platform_editor_advanced_layouts_post_fix_patch_3
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 3.5.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.handleMouseOver = void 0;
|
|
7
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
7
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
9
8
|
var isEmptyNestedParagraphOrHeading = function isEmptyNestedParagraphOrHeading(target) {
|
|
10
9
|
if (target instanceof HTMLHeadingElement || target instanceof HTMLParagraphElement) {
|
|
@@ -88,7 +87,7 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
|
|
|
88
87
|
} else {
|
|
89
88
|
pos = view.posAtDOM(rootElement, 0);
|
|
90
89
|
}
|
|
91
|
-
if (parentRootElement && parentRootElement.getAttribute('data-layout-section') === 'true' && parentRootElement.querySelectorAll('[data-layout-column]').length === 1 && (0, _experiments.editorExperiment)('advanced_layouts', true)
|
|
90
|
+
if (parentRootElement && parentRootElement.getAttribute('data-layout-section') === 'true' && parentRootElement.querySelectorAll('[data-layout-column]').length === 1 && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
92
91
|
// Don't show drag handle for layout column in a single column layout
|
|
93
92
|
return false;
|
|
94
93
|
}
|
|
@@ -55,7 +55,7 @@ var destroyFn = function destroyFn(api, editorView) {
|
|
|
55
55
|
return source.data.type === 'element';
|
|
56
56
|
},
|
|
57
57
|
onDrag: function onDrag() {
|
|
58
|
-
if ((0, _performanceMeasures.isMeasuring)(EDITOR_BLOCKS_DRAG_INIT)
|
|
58
|
+
if ((0, _performanceMeasures.isMeasuring)(EDITOR_BLOCKS_DRAG_INIT)) {
|
|
59
59
|
(0, _performanceMeasures.stopMeasure)(EDITOR_BLOCKS_DRAG_INIT, function (duration, startTime) {
|
|
60
60
|
var _api$analytics;
|
|
61
61
|
var state = editorView.state;
|
|
@@ -694,9 +694,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api, getIntl, no
|
|
|
694
694
|
},
|
|
695
695
|
dragstart: function dragstart(view) {
|
|
696
696
|
var _anchorRectCache;
|
|
697
|
-
|
|
698
|
-
(0, _performanceMeasures.startMeasure)(EDITOR_BLOCKS_DRAG_INIT);
|
|
699
|
-
}
|
|
697
|
+
(0, _performanceMeasures.startMeasure)(EDITOR_BLOCKS_DRAG_INIT);
|
|
700
698
|
if (isAdvancedLayoutEnabled) {
|
|
701
699
|
_activeAnchorTracker.defaultActiveAnchorTracker.reset();
|
|
702
700
|
}
|
|
@@ -11,7 +11,6 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
11
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
12
|
var _events = require("events");
|
|
13
13
|
var _react = require("react");
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
16
15
|
var ActiveAnchorTracker = exports.ActiveAnchorTracker = /*#__PURE__*/function () {
|
|
17
16
|
function ActiveAnchorTracker() {
|
|
@@ -74,7 +73,7 @@ var useActiveAnchorTracker = exports.useActiveAnchorTracker = function useActive
|
|
|
74
73
|
(0, _react.useEffect)(function () {
|
|
75
74
|
if (activeAnchorTracker && anchorName && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
76
75
|
activeAnchorTracker.subscribe(anchorName, onActive);
|
|
77
|
-
if (activeAnchorTracker.getActiveAnchor() === anchorName
|
|
76
|
+
if (activeAnchorTracker.getActiveAnchor() === anchorName) {
|
|
78
77
|
setIsActive(true);
|
|
79
78
|
}
|
|
80
79
|
var unsubscribe = function unsubscribe() {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
2
|
const isEmptyNestedParagraphOrHeading = target => {
|
|
4
3
|
if (target instanceof HTMLHeadingElement || target instanceof HTMLParagraphElement) {
|
|
@@ -83,7 +82,7 @@ export const handleMouseOver = (view, event, api) => {
|
|
|
83
82
|
} else {
|
|
84
83
|
pos = view.posAtDOM(rootElement, 0);
|
|
85
84
|
}
|
|
86
|
-
if (parentRootElement && parentRootElement.getAttribute('data-layout-section') === 'true' && parentRootElement.querySelectorAll('[data-layout-column]').length === 1 && editorExperiment('advanced_layouts', true)
|
|
85
|
+
if (parentRootElement && parentRootElement.getAttribute('data-layout-section') === 'true' && parentRootElement.querySelectorAll('[data-layout-column]').length === 1 && editorExperiment('advanced_layouts', true)) {
|
|
87
86
|
// Don't show drag handle for layout column in a single column layout
|
|
88
87
|
return false;
|
|
89
88
|
}
|
|
@@ -43,7 +43,7 @@ const destroyFn = (api, editorView) => {
|
|
|
43
43
|
source
|
|
44
44
|
}) => source.data.type === 'element',
|
|
45
45
|
onDrag: () => {
|
|
46
|
-
if (isMeasuring(EDITOR_BLOCKS_DRAG_INIT)
|
|
46
|
+
if (isMeasuring(EDITOR_BLOCKS_DRAG_INIT)) {
|
|
47
47
|
stopMeasure(EDITOR_BLOCKS_DRAG_INIT, (duration, startTime) => {
|
|
48
48
|
var _api$analytics;
|
|
49
49
|
const {
|
|
@@ -676,9 +676,7 @@ export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI) => {
|
|
|
676
676
|
},
|
|
677
677
|
dragstart(view) {
|
|
678
678
|
var _anchorRectCache;
|
|
679
|
-
|
|
680
|
-
startMeasure(EDITOR_BLOCKS_DRAG_INIT);
|
|
681
|
-
}
|
|
679
|
+
startMeasure(EDITOR_BLOCKS_DRAG_INIT);
|
|
682
680
|
if (isAdvancedLayoutEnabled) {
|
|
683
681
|
defaultActiveAnchorTracker.reset();
|
|
684
682
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
import { useCallback, useEffect, useState } from 'react';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
5
|
export class ActiveAnchorTracker {
|
|
7
6
|
constructor() {
|
|
@@ -50,7 +49,7 @@ export const useActiveAnchorTracker = (anchorName, activeAnchorTracker = default
|
|
|
50
49
|
useEffect(() => {
|
|
51
50
|
if (activeAnchorTracker && anchorName && editorExperiment('advanced_layouts', true)) {
|
|
52
51
|
activeAnchorTracker.subscribe(anchorName, onActive);
|
|
53
|
-
if (activeAnchorTracker.getActiveAnchor() === anchorName
|
|
52
|
+
if (activeAnchorTracker.getActiveAnchor() === anchorName) {
|
|
54
53
|
setIsActive(true);
|
|
55
54
|
}
|
|
56
55
|
const unsubscribe = () => {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
2
|
var isEmptyNestedParagraphOrHeading = function isEmptyNestedParagraphOrHeading(target) {
|
|
4
3
|
if (target instanceof HTMLHeadingElement || target instanceof HTMLParagraphElement) {
|
|
@@ -82,7 +81,7 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
|
|
|
82
81
|
} else {
|
|
83
82
|
pos = view.posAtDOM(rootElement, 0);
|
|
84
83
|
}
|
|
85
|
-
if (parentRootElement && parentRootElement.getAttribute('data-layout-section') === 'true' && parentRootElement.querySelectorAll('[data-layout-column]').length === 1 && editorExperiment('advanced_layouts', true)
|
|
84
|
+
if (parentRootElement && parentRootElement.getAttribute('data-layout-section') === 'true' && parentRootElement.querySelectorAll('[data-layout-column]').length === 1 && editorExperiment('advanced_layouts', true)) {
|
|
86
85
|
// Don't show drag handle for layout column in a single column layout
|
|
87
86
|
return false;
|
|
88
87
|
}
|
|
@@ -48,7 +48,7 @@ var destroyFn = function destroyFn(api, editorView) {
|
|
|
48
48
|
return source.data.type === 'element';
|
|
49
49
|
},
|
|
50
50
|
onDrag: function onDrag() {
|
|
51
|
-
if (isMeasuring(EDITOR_BLOCKS_DRAG_INIT)
|
|
51
|
+
if (isMeasuring(EDITOR_BLOCKS_DRAG_INIT)) {
|
|
52
52
|
stopMeasure(EDITOR_BLOCKS_DRAG_INIT, function (duration, startTime) {
|
|
53
53
|
var _api$analytics;
|
|
54
54
|
var state = editorView.state;
|
|
@@ -687,9 +687,7 @@ export var createPlugin = function createPlugin(api, getIntl, nodeViewPortalProv
|
|
|
687
687
|
},
|
|
688
688
|
dragstart: function dragstart(view) {
|
|
689
689
|
var _anchorRectCache;
|
|
690
|
-
|
|
691
|
-
startMeasure(EDITOR_BLOCKS_DRAG_INIT);
|
|
692
|
-
}
|
|
690
|
+
startMeasure(EDITOR_BLOCKS_DRAG_INIT);
|
|
693
691
|
if (isAdvancedLayoutEnabled) {
|
|
694
692
|
defaultActiveAnchorTracker.reset();
|
|
695
693
|
}
|
|
@@ -4,7 +4,6 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
5
|
import { EventEmitter } from 'events';
|
|
6
6
|
import { useCallback, useEffect, useState } from 'react';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
8
|
export var ActiveAnchorTracker = /*#__PURE__*/function () {
|
|
10
9
|
function ActiveAnchorTracker() {
|
|
@@ -69,7 +68,7 @@ export var useActiveAnchorTracker = function useActiveAnchorTracker(anchorName)
|
|
|
69
68
|
useEffect(function () {
|
|
70
69
|
if (activeAnchorTracker && anchorName && editorExperiment('advanced_layouts', true)) {
|
|
71
70
|
activeAnchorTracker.subscribe(anchorName, onActive);
|
|
72
|
-
if (activeAnchorTracker.getActiveAnchor() === anchorName
|
|
71
|
+
if (activeAnchorTracker.getActiveAnchor() === anchorName) {
|
|
73
72
|
setIsActive(true);
|
|
74
73
|
}
|
|
75
74
|
var unsubscribe = function unsubscribe() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.2",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
36
|
-
"@atlaskit/editor-common": "^102.
|
|
36
|
+
"@atlaskit/editor-common": "^102.13.0",
|
|
37
37
|
"@atlaskit/editor-plugin-accessibility-utils": "^2.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-feature-flags": "^1.3.0",
|
|
41
41
|
"@atlaskit/editor-plugin-metrics": "^3.4.0",
|
|
42
|
-
"@atlaskit/editor-plugin-quick-insert": "^2.
|
|
42
|
+
"@atlaskit/editor-plugin-quick-insert": "^2.2.0",
|
|
43
43
|
"@atlaskit/editor-plugin-selection": "^2.1.0",
|
|
44
|
-
"@atlaskit/editor-plugin-type-ahead": "^2.
|
|
44
|
+
"@atlaskit/editor-plugin-type-ahead": "^2.2.0",
|
|
45
45
|
"@atlaskit/editor-plugin-width": "^3.0.0",
|
|
46
46
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
47
47
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.0.0",
|
|
54
54
|
"@atlaskit/primitives": "^14.2.0",
|
|
55
55
|
"@atlaskit/theme": "^18.0.0",
|
|
56
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
56
|
+
"@atlaskit/tmp-editor-statsig": "^4.2.0",
|
|
57
57
|
"@atlaskit/tokens": "^4.5.0",
|
|
58
58
|
"@atlaskit/tooltip": "^20.0.0",
|
|
59
59
|
"@babel/runtime": "^7.0.0",
|
|
@@ -123,9 +123,6 @@
|
|
|
123
123
|
"platform_editor_use_nested_table_pm_nodes": {
|
|
124
124
|
"type": "boolean"
|
|
125
125
|
},
|
|
126
|
-
"platform_editor_advanced_layouts_post_fix_patch_3": {
|
|
127
|
-
"type": "boolean"
|
|
128
|
-
},
|
|
129
126
|
"platform_editor_advanced_layouts_dnd_remove_layout": {
|
|
130
127
|
"type": "boolean"
|
|
131
128
|
},
|