@atlaskit/editor-plugin-selection-toolbar 3.7.0 → 3.7.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 +12 -0
- package/dist/cjs/selectionToolbarPlugin.js +2 -10
- package/dist/cjs/ui/PageVisibilityWatcher.js +14 -55
- package/dist/es2019/selectionToolbarPlugin.js +2 -10
- package/dist/es2019/ui/PageVisibilityWatcher.js +2 -21
- package/dist/esm/selectionToolbarPlugin.js +2 -10
- package/dist/esm/ui/PageVisibilityWatcher.js +14 -55
- package/package.json +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -307,20 +307,12 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
|
|
|
307
307
|
}
|
|
308
308
|
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
309
309
|
if (resolved[i] && resolved[i + 1]) {
|
|
310
|
-
var _resolved
|
|
311
|
-
|
|
312
|
-
if (((_resolved3 = resolved[i + 1]) === null || _resolved3 === void 0 ? void 0 : _resolved3.pluginName) === 'annotation') {
|
|
310
|
+
var _resolved;
|
|
311
|
+
if (((_resolved = resolved[i + 1]) === null || _resolved === void 0 ? void 0 : _resolved.pluginName) === 'annotation') {
|
|
313
312
|
items.push({
|
|
314
313
|
type: 'separator',
|
|
315
314
|
fullHeight: true
|
|
316
315
|
});
|
|
317
|
-
} else if (!(0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6')) {
|
|
318
|
-
if (i !== resolved.length - 1 && !shouldNotAddSeparator) {
|
|
319
|
-
items.push({
|
|
320
|
-
type: 'separator',
|
|
321
|
-
fullHeight: false
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
316
|
}
|
|
325
317
|
}
|
|
326
318
|
} else {
|
|
@@ -10,7 +10,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _bindEventListener = require("bind-event-listener");
|
|
12
12
|
var _monitoring = require("@atlaskit/editor-common/monitoring");
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
15
14
|
var PageVisibilityWatcher = exports.PageVisibilityWatcher = function PageVisibilityWatcher(_ref) {
|
|
16
15
|
var api = _ref.api,
|
|
@@ -19,75 +18,35 @@ var PageVisibilityWatcher = exports.PageVisibilityWatcher = function PageVisibil
|
|
|
19
18
|
if (!userPreferencesProvider || !api) {
|
|
20
19
|
return;
|
|
21
20
|
}
|
|
22
|
-
if (!(0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6')) {
|
|
23
|
-
return (0, _bindEventListener.bind)(document, {
|
|
24
|
-
type: 'visibilitychange',
|
|
25
|
-
listener: function () {
|
|
26
|
-
var _listener = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
27
|
-
var _api$selectionToolbar, _api$selectionToolbar2;
|
|
28
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
29
|
-
while (1) switch (_context.prev = _context.next) {
|
|
30
|
-
case 0:
|
|
31
|
-
if (!(document.visibilityState === 'visible')) {
|
|
32
|
-
_context.next = 10;
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
_context.prev = 1;
|
|
36
|
-
_context.next = 4;
|
|
37
|
-
return userPreferencesProvider.loadPreferences();
|
|
38
|
-
case 4:
|
|
39
|
-
_context.next = 9;
|
|
40
|
-
break;
|
|
41
|
-
case 6:
|
|
42
|
-
_context.prev = 6;
|
|
43
|
-
_context.t0 = _context["catch"](1);
|
|
44
|
-
(0, _monitoring.logException)(_context.t0, {
|
|
45
|
-
location: 'editor-plugin-selection-toolbar/PageVisibilityWatcher'
|
|
46
|
-
});
|
|
47
|
-
case 9:
|
|
48
|
-
api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.actions) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar2 = _api$selectionToolbar.refreshToolbarDocking) === null || _api$selectionToolbar2 === void 0 || _api$selectionToolbar2.call(_api$selectionToolbar);
|
|
49
|
-
case 10:
|
|
50
|
-
case "end":
|
|
51
|
-
return _context.stop();
|
|
52
|
-
}
|
|
53
|
-
}, _callee, null, [[1, 6]]);
|
|
54
|
-
}));
|
|
55
|
-
function listener() {
|
|
56
|
-
return _listener.apply(this, arguments);
|
|
57
|
-
}
|
|
58
|
-
return listener;
|
|
59
|
-
}()
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
21
|
var refreshPrefrerence = /*#__PURE__*/function () {
|
|
63
|
-
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
64
|
-
var _api$
|
|
65
|
-
return _regenerator.default.wrap(function
|
|
66
|
-
while (1) switch (
|
|
22
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
23
|
+
var _api$selectionToolbar, _api$selectionToolbar2;
|
|
24
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
25
|
+
while (1) switch (_context.prev = _context.next) {
|
|
67
26
|
case 0:
|
|
68
27
|
if (!(document.visibilityState === 'visible')) {
|
|
69
|
-
|
|
28
|
+
_context.next = 10;
|
|
70
29
|
break;
|
|
71
30
|
}
|
|
72
|
-
|
|
73
|
-
|
|
31
|
+
_context.prev = 1;
|
|
32
|
+
_context.next = 4;
|
|
74
33
|
return userPreferencesProvider.loadPreferences();
|
|
75
34
|
case 4:
|
|
76
|
-
|
|
35
|
+
_context.next = 9;
|
|
77
36
|
break;
|
|
78
37
|
case 6:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
(0, _monitoring.logException)(
|
|
38
|
+
_context.prev = 6;
|
|
39
|
+
_context.t0 = _context["catch"](1);
|
|
40
|
+
(0, _monitoring.logException)(_context.t0, {
|
|
82
41
|
location: 'editor-plugin-selection-toolbar/PageVisibilityWatcher'
|
|
83
42
|
});
|
|
84
43
|
case 9:
|
|
85
|
-
api === null || api === void 0 || (_api$
|
|
44
|
+
api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.actions) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar2 = _api$selectionToolbar.refreshToolbarDocking) === null || _api$selectionToolbar2 === void 0 || _api$selectionToolbar2.call(_api$selectionToolbar);
|
|
86
45
|
case 10:
|
|
87
46
|
case "end":
|
|
88
|
-
return
|
|
47
|
+
return _context.stop();
|
|
89
48
|
}
|
|
90
|
-
},
|
|
49
|
+
}, _callee, null, [[1, 6]]);
|
|
91
50
|
}));
|
|
92
51
|
return function refreshPrefrerence() {
|
|
93
52
|
return _ref2.apply(this, arguments);
|
|
@@ -300,20 +300,12 @@ export const selectionToolbarPlugin = ({
|
|
|
300
300
|
}
|
|
301
301
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
302
302
|
if (resolved[i] && resolved[i + 1]) {
|
|
303
|
-
var _resolved
|
|
304
|
-
|
|
305
|
-
if (((_resolved3 = resolved[i + 1]) === null || _resolved3 === void 0 ? void 0 : _resolved3.pluginName) === 'annotation') {
|
|
303
|
+
var _resolved;
|
|
304
|
+
if (((_resolved = resolved[i + 1]) === null || _resolved === void 0 ? void 0 : _resolved.pluginName) === 'annotation') {
|
|
306
305
|
items.push({
|
|
307
306
|
type: 'separator',
|
|
308
307
|
fullHeight: true
|
|
309
308
|
});
|
|
310
|
-
} else if (!fg('platform_editor_controls_patch_6')) {
|
|
311
|
-
if (i !== resolved.length - 1 && !shouldNotAddSeparator) {
|
|
312
|
-
items.push({
|
|
313
|
-
type: 'separator',
|
|
314
|
-
fullHeight: false
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
309
|
}
|
|
318
310
|
}
|
|
319
311
|
} else {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
import { bind } from 'bind-event-listener';
|
|
3
3
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
5
|
export const PageVisibilityWatcher = ({
|
|
7
6
|
api,
|
|
@@ -11,27 +10,9 @@ export const PageVisibilityWatcher = ({
|
|
|
11
10
|
if (!userPreferencesProvider || !api) {
|
|
12
11
|
return;
|
|
13
12
|
}
|
|
14
|
-
if (!fg('platform_editor_controls_patch_6')) {
|
|
15
|
-
return bind(document, {
|
|
16
|
-
type: 'visibilitychange',
|
|
17
|
-
listener: async () => {
|
|
18
|
-
if (document.visibilityState === 'visible') {
|
|
19
|
-
var _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
|
|
20
|
-
try {
|
|
21
|
-
await userPreferencesProvider.loadPreferences();
|
|
22
|
-
} catch (error) {
|
|
23
|
-
logException(error, {
|
|
24
|
-
location: 'editor-plugin-selection-toolbar/PageVisibilityWatcher'
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
api === null || api === void 0 ? void 0 : (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 ? void 0 : (_api$selectionToolbar2 = _api$selectionToolbar.actions) === null || _api$selectionToolbar2 === void 0 ? void 0 : (_api$selectionToolbar3 = _api$selectionToolbar2.refreshToolbarDocking) === null || _api$selectionToolbar3 === void 0 ? void 0 : _api$selectionToolbar3.call(_api$selectionToolbar2);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
13
|
const refreshPrefrerence = async () => {
|
|
33
14
|
if (document.visibilityState === 'visible') {
|
|
34
|
-
var _api$
|
|
15
|
+
var _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
|
|
35
16
|
try {
|
|
36
17
|
await userPreferencesProvider.loadPreferences();
|
|
37
18
|
} catch (error) {
|
|
@@ -39,7 +20,7 @@ export const PageVisibilityWatcher = ({
|
|
|
39
20
|
location: 'editor-plugin-selection-toolbar/PageVisibilityWatcher'
|
|
40
21
|
});
|
|
41
22
|
}
|
|
42
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
23
|
+
api === null || api === void 0 ? void 0 : (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 ? void 0 : (_api$selectionToolbar2 = _api$selectionToolbar.actions) === null || _api$selectionToolbar2 === void 0 ? void 0 : (_api$selectionToolbar3 = _api$selectionToolbar2.refreshToolbarDocking) === null || _api$selectionToolbar3 === void 0 ? void 0 : _api$selectionToolbar3.call(_api$selectionToolbar2);
|
|
43
24
|
}
|
|
44
25
|
};
|
|
45
26
|
if (editorExperiment('platform_editor_controls_performance_fixes', false)) {
|
|
@@ -300,20 +300,12 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
|
|
|
300
300
|
}
|
|
301
301
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
302
302
|
if (resolved[i] && resolved[i + 1]) {
|
|
303
|
-
var _resolved
|
|
304
|
-
|
|
305
|
-
if (((_resolved3 = resolved[i + 1]) === null || _resolved3 === void 0 ? void 0 : _resolved3.pluginName) === 'annotation') {
|
|
303
|
+
var _resolved;
|
|
304
|
+
if (((_resolved = resolved[i + 1]) === null || _resolved === void 0 ? void 0 : _resolved.pluginName) === 'annotation') {
|
|
306
305
|
items.push({
|
|
307
306
|
type: 'separator',
|
|
308
307
|
fullHeight: true
|
|
309
308
|
});
|
|
310
|
-
} else if (!fg('platform_editor_controls_patch_6')) {
|
|
311
|
-
if (i !== resolved.length - 1 && !shouldNotAddSeparator) {
|
|
312
|
-
items.push({
|
|
313
|
-
type: 'separator',
|
|
314
|
-
fullHeight: false
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
309
|
}
|
|
318
310
|
}
|
|
319
311
|
} else {
|
|
@@ -3,7 +3,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
3
3
|
import { useEffect } from 'react';
|
|
4
4
|
import { bind } from 'bind-event-listener';
|
|
5
5
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
export var PageVisibilityWatcher = function PageVisibilityWatcher(_ref) {
|
|
9
8
|
var api = _ref.api,
|
|
@@ -12,75 +11,35 @@ export var PageVisibilityWatcher = function PageVisibilityWatcher(_ref) {
|
|
|
12
11
|
if (!userPreferencesProvider || !api) {
|
|
13
12
|
return;
|
|
14
13
|
}
|
|
15
|
-
if (!fg('platform_editor_controls_patch_6')) {
|
|
16
|
-
return bind(document, {
|
|
17
|
-
type: 'visibilitychange',
|
|
18
|
-
listener: function () {
|
|
19
|
-
var _listener = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
20
|
-
var _api$selectionToolbar, _api$selectionToolbar2;
|
|
21
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
22
|
-
while (1) switch (_context.prev = _context.next) {
|
|
23
|
-
case 0:
|
|
24
|
-
if (!(document.visibilityState === 'visible')) {
|
|
25
|
-
_context.next = 10;
|
|
26
|
-
break;
|
|
27
|
-
}
|
|
28
|
-
_context.prev = 1;
|
|
29
|
-
_context.next = 4;
|
|
30
|
-
return userPreferencesProvider.loadPreferences();
|
|
31
|
-
case 4:
|
|
32
|
-
_context.next = 9;
|
|
33
|
-
break;
|
|
34
|
-
case 6:
|
|
35
|
-
_context.prev = 6;
|
|
36
|
-
_context.t0 = _context["catch"](1);
|
|
37
|
-
logException(_context.t0, {
|
|
38
|
-
location: 'editor-plugin-selection-toolbar/PageVisibilityWatcher'
|
|
39
|
-
});
|
|
40
|
-
case 9:
|
|
41
|
-
api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.actions) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar2 = _api$selectionToolbar.refreshToolbarDocking) === null || _api$selectionToolbar2 === void 0 || _api$selectionToolbar2.call(_api$selectionToolbar);
|
|
42
|
-
case 10:
|
|
43
|
-
case "end":
|
|
44
|
-
return _context.stop();
|
|
45
|
-
}
|
|
46
|
-
}, _callee, null, [[1, 6]]);
|
|
47
|
-
}));
|
|
48
|
-
function listener() {
|
|
49
|
-
return _listener.apply(this, arguments);
|
|
50
|
-
}
|
|
51
|
-
return listener;
|
|
52
|
-
}()
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
14
|
var refreshPrefrerence = /*#__PURE__*/function () {
|
|
56
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
57
|
-
var _api$
|
|
58
|
-
return _regeneratorRuntime.wrap(function
|
|
59
|
-
while (1) switch (
|
|
15
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
16
|
+
var _api$selectionToolbar, _api$selectionToolbar2;
|
|
17
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
18
|
+
while (1) switch (_context.prev = _context.next) {
|
|
60
19
|
case 0:
|
|
61
20
|
if (!(document.visibilityState === 'visible')) {
|
|
62
|
-
|
|
21
|
+
_context.next = 10;
|
|
63
22
|
break;
|
|
64
23
|
}
|
|
65
|
-
|
|
66
|
-
|
|
24
|
+
_context.prev = 1;
|
|
25
|
+
_context.next = 4;
|
|
67
26
|
return userPreferencesProvider.loadPreferences();
|
|
68
27
|
case 4:
|
|
69
|
-
|
|
28
|
+
_context.next = 9;
|
|
70
29
|
break;
|
|
71
30
|
case 6:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
logException(
|
|
31
|
+
_context.prev = 6;
|
|
32
|
+
_context.t0 = _context["catch"](1);
|
|
33
|
+
logException(_context.t0, {
|
|
75
34
|
location: 'editor-plugin-selection-toolbar/PageVisibilityWatcher'
|
|
76
35
|
});
|
|
77
36
|
case 9:
|
|
78
|
-
api === null || api === void 0 || (_api$
|
|
37
|
+
api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.actions) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar2 = _api$selectionToolbar.refreshToolbarDocking) === null || _api$selectionToolbar2 === void 0 || _api$selectionToolbar2.call(_api$selectionToolbar);
|
|
79
38
|
case 10:
|
|
80
39
|
case "end":
|
|
81
|
-
return
|
|
40
|
+
return _context.stop();
|
|
82
41
|
}
|
|
83
|
-
},
|
|
42
|
+
}, _callee, null, [[1, 6]]);
|
|
84
43
|
}));
|
|
85
44
|
return function refreshPrefrerence() {
|
|
86
45
|
return _ref2.apply(this, arguments);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-toolbar",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.2",
|
|
4
4
|
"description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/css": "^0.10.0",
|
|
37
|
-
"@atlaskit/editor-common": "^
|
|
37
|
+
"@atlaskit/editor-common": "^107.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
39
39
|
"@atlaskit/editor-plugin-block-controls": "^3.19.0",
|
|
40
40
|
"@atlaskit/editor-plugin-connectivity": "^2.0.0",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"@atlaskit/editor-plugin-primary-toolbar": "^3.2.0",
|
|
43
43
|
"@atlaskit/editor-plugin-user-preferences": "^0.2.0",
|
|
44
44
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
45
|
-
"@atlaskit/icon": "^
|
|
46
|
-
"@atlaskit/icon-lab": "^
|
|
45
|
+
"@atlaskit/icon": "^27.0.0",
|
|
46
|
+
"@atlaskit/icon-lab": "^5.0.0",
|
|
47
47
|
"@atlaskit/menu": "^8.0.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
49
|
-
"@atlaskit/tmp-editor-statsig": "^7.
|
|
49
|
+
"@atlaskit/tmp-editor-statsig": "^7.1.0",
|
|
50
50
|
"@atlaskit/tokens": "^5.2.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
52
52
|
"bind-event-listener": "^3.0.0"
|
|
@@ -112,9 +112,6 @@
|
|
|
112
112
|
"platform_editor_use_preferences_plugin": {
|
|
113
113
|
"type": "boolean"
|
|
114
114
|
},
|
|
115
|
-
"platform_editor_controls_patch_6": {
|
|
116
|
-
"type": "boolean"
|
|
117
|
-
},
|
|
118
115
|
"platform_editor_controls_patch_8": {
|
|
119
116
|
"type": "boolean"
|
|
120
117
|
}
|