@atlaskit/editor-plugin-block-controls 2.20.0 → 2.21.0
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 +8 -0
- package/dist/cjs/pm-plugins/utils/active-anchor-tracker.js +9 -0
- package/dist/es2019/pm-plugins/utils/active-anchor-tracker.js +7 -0
- package/dist/esm/pm-plugins/utils/active-anchor-tracker.js +9 -0
- package/dist/types/pm-plugins/utils/active-anchor-tracker.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/utils/active-anchor-tracker.d.ts +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 2.21.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#102469](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102469)
|
|
8
|
+
[`bb834fe685b5a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bb834fe685b5a) -
|
|
9
|
+
ED-25924 makes drop hints appear more consistent
|
|
10
|
+
|
|
3
11
|
## 2.20.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -11,6 +11,7 @@ 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");
|
|
14
15
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
15
16
|
var ActiveAnchorTracker = exports.ActiveAnchorTracker = /*#__PURE__*/function () {
|
|
16
17
|
function ActiveAnchorTracker() {
|
|
@@ -19,6 +20,11 @@ var ActiveAnchorTracker = exports.ActiveAnchorTracker = /*#__PURE__*/function ()
|
|
|
19
20
|
this.emitter = new _events.EventEmitter();
|
|
20
21
|
}
|
|
21
22
|
return (0, _createClass2.default)(ActiveAnchorTracker, [{
|
|
23
|
+
key: "getActiveAnchor",
|
|
24
|
+
value: function getActiveAnchor() {
|
|
25
|
+
return this.lastActiveAnchor;
|
|
26
|
+
}
|
|
27
|
+
}, {
|
|
22
28
|
key: "subscribe",
|
|
23
29
|
value: function subscribe(anchorName, callback) {
|
|
24
30
|
if (this.emitter) {
|
|
@@ -68,6 +74,9 @@ var useActiveAnchorTracker = exports.useActiveAnchorTracker = function useActive
|
|
|
68
74
|
(0, _react.useEffect)(function () {
|
|
69
75
|
if (activeAnchorTracker && anchorName && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
70
76
|
activeAnchorTracker.subscribe(anchorName, onActive);
|
|
77
|
+
if (activeAnchorTracker.getActiveAnchor() === anchorName && (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_post_fix_patch_3')) {
|
|
78
|
+
setIsActive(true);
|
|
79
|
+
}
|
|
71
80
|
var unsubscribe = function unsubscribe() {
|
|
72
81
|
activeAnchorTracker.unsubscribe(anchorName, onActive);
|
|
73
82
|
};
|
|
@@ -1,12 +1,16 @@
|
|
|
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';
|
|
4
5
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
6
|
export class ActiveAnchorTracker {
|
|
6
7
|
constructor() {
|
|
7
8
|
_defineProperty(this, "lastActiveAnchor", '');
|
|
8
9
|
this.emitter = new EventEmitter();
|
|
9
10
|
}
|
|
11
|
+
getActiveAnchor() {
|
|
12
|
+
return this.lastActiveAnchor;
|
|
13
|
+
}
|
|
10
14
|
subscribe(anchorName, callback) {
|
|
11
15
|
if (this.emitter) {
|
|
12
16
|
this.emitter.on(anchorName, callback);
|
|
@@ -46,6 +50,9 @@ export const useActiveAnchorTracker = (anchorName, activeAnchorTracker = default
|
|
|
46
50
|
useEffect(() => {
|
|
47
51
|
if (activeAnchorTracker && anchorName && editorExperiment('advanced_layouts', true)) {
|
|
48
52
|
activeAnchorTracker.subscribe(anchorName, onActive);
|
|
53
|
+
if (activeAnchorTracker.getActiveAnchor() === anchorName && fg('platform_editor_advanced_layouts_post_fix_patch_3')) {
|
|
54
|
+
setIsActive(true);
|
|
55
|
+
}
|
|
49
56
|
const unsubscribe = () => {
|
|
50
57
|
activeAnchorTracker.unsubscribe(anchorName, onActive);
|
|
51
58
|
};
|
|
@@ -4,6 +4,7 @@ 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';
|
|
7
8
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
9
|
export var ActiveAnchorTracker = /*#__PURE__*/function () {
|
|
9
10
|
function ActiveAnchorTracker() {
|
|
@@ -12,6 +13,11 @@ export var ActiveAnchorTracker = /*#__PURE__*/function () {
|
|
|
12
13
|
this.emitter = new EventEmitter();
|
|
13
14
|
}
|
|
14
15
|
return _createClass(ActiveAnchorTracker, [{
|
|
16
|
+
key: "getActiveAnchor",
|
|
17
|
+
value: function getActiveAnchor() {
|
|
18
|
+
return this.lastActiveAnchor;
|
|
19
|
+
}
|
|
20
|
+
}, {
|
|
15
21
|
key: "subscribe",
|
|
16
22
|
value: function subscribe(anchorName, callback) {
|
|
17
23
|
if (this.emitter) {
|
|
@@ -63,6 +69,9 @@ export var useActiveAnchorTracker = function useActiveAnchorTracker(anchorName)
|
|
|
63
69
|
useEffect(function () {
|
|
64
70
|
if (activeAnchorTracker && anchorName && editorExperiment('advanced_layouts', true)) {
|
|
65
71
|
activeAnchorTracker.subscribe(anchorName, onActive);
|
|
72
|
+
if (activeAnchorTracker.getActiveAnchor() === anchorName && fg('platform_editor_advanced_layouts_post_fix_patch_3')) {
|
|
73
|
+
setIsActive(true);
|
|
74
|
+
}
|
|
66
75
|
var unsubscribe = function unsubscribe() {
|
|
67
76
|
activeAnchorTracker.unsubscribe(anchorName, onActive);
|
|
68
77
|
};
|
|
@@ -6,6 +6,7 @@ export declare class ActiveAnchorTracker {
|
|
|
6
6
|
emitter: EventEmitter | null;
|
|
7
7
|
lastActiveAnchor: string;
|
|
8
8
|
constructor();
|
|
9
|
+
getActiveAnchor(): string;
|
|
9
10
|
subscribe(anchorName: string, callback: (isActive: boolean) => void): void;
|
|
10
11
|
unsubscribe(anchorName: string, callback: (isActive: boolean) => void): void;
|
|
11
12
|
emit(anchorName: string): void;
|
|
@@ -6,6 +6,7 @@ export declare class ActiveAnchorTracker {
|
|
|
6
6
|
emitter: EventEmitter | null;
|
|
7
7
|
lastActiveAnchor: string;
|
|
8
8
|
constructor();
|
|
9
|
+
getActiveAnchor(): string;
|
|
9
10
|
subscribe(anchorName: string, callback: (isActive: boolean) => void): void;
|
|
10
11
|
unsubscribe(anchorName: string, callback: (isActive: boolean) => void): void;
|
|
11
12
|
emit(anchorName: string): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.21.0",
|
|
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": "^99.
|
|
34
|
+
"@atlaskit/editor-common": "^99.3.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",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
42
42
|
"@atlaskit/editor-shared-styles": "^3.2.0",
|
|
43
43
|
"@atlaskit/editor-tables": "^2.8.0",
|
|
44
|
-
"@atlaskit/icon": "^23.
|
|
44
|
+
"@atlaskit/icon": "^23.4.0",
|
|
45
45
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
46
46
|
"@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
|
|
47
47
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|