@atlaskit/editor-plugin-floating-toolbar 8.2.11 → 8.2.12
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
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 8.2.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`e727490d9f62f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e727490d9f62f) -
|
|
8
|
+
[ux] EDITOR-2572 Hide floating toolbar when status picker is open
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 8.2.11
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -39,6 +39,8 @@ var _utils3 = require("./ui/utils");
|
|
|
39
39
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
40
40
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
41
41
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
42
|
+
var SUPPRESS_TOOLBAR_USER_INTENTS = ['dragging', 'tablePopupOpen', 'commenting', 'resizing', 'blockMenuOpen', 'statusPickerOpen'];
|
|
43
|
+
|
|
42
44
|
// TODO: AFP-2532 - Fix automatic suppressions below
|
|
43
45
|
var getRelevantConfig = exports.getRelevantConfig = function getRelevantConfig(selection, configs) {
|
|
44
46
|
// node selections always take precedence, see if
|
|
@@ -259,7 +261,7 @@ function ContentComponent(_ref5) {
|
|
|
259
261
|
if (((userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'dragging' || (userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'blockMenuOpen' && (0, _expValEquals.expValEquals)('platform_editor_block_menu', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_hide_floating_toolbar')) && !userIntentEnabled) {
|
|
260
262
|
return null;
|
|
261
263
|
}
|
|
262
|
-
if (userIntentState !== null && userIntentState !== void 0 && userIntentState.currentUserIntent &&
|
|
264
|
+
if (userIntentState !== null && userIntentState !== void 0 && userIntentState.currentUserIntent && SUPPRESS_TOOLBAR_USER_INTENTS.includes(userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) && userIntentEnabled) {
|
|
263
265
|
return null;
|
|
264
266
|
}
|
|
265
267
|
var config = configWithNodeInfo.config,
|
|
@@ -567,7 +569,7 @@ function floatingToolbarPluginFactory(options) {
|
|
|
567
569
|
activeConfigs = undefined;
|
|
568
570
|
break;
|
|
569
571
|
}
|
|
570
|
-
if (userIntentEnabled &&
|
|
572
|
+
if (userIntentEnabled && SUPPRESS_TOOLBAR_USER_INTENTS.includes((api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || (_api$userIntent = _api$userIntent.sharedState.currentState()) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.currentUserIntent) || '')) {
|
|
571
573
|
activeConfigs = undefined;
|
|
572
574
|
break;
|
|
573
575
|
}
|
|
@@ -25,6 +25,7 @@ import { findNode } from './pm-plugins/utils';
|
|
|
25
25
|
import { ConfirmationModal } from './ui/ConfirmationModal';
|
|
26
26
|
import Toolbar from './ui/Toolbar';
|
|
27
27
|
import { consolidateOverflowDropdownItems } from './ui/utils';
|
|
28
|
+
const SUPPRESS_TOOLBAR_USER_INTENTS = ['dragging', 'tablePopupOpen', 'commenting', 'resizing', 'blockMenuOpen', 'statusPickerOpen'];
|
|
28
29
|
|
|
29
30
|
// TODO: AFP-2532 - Fix automatic suppressions below
|
|
30
31
|
export const getRelevantConfig = (selection, configs) => {
|
|
@@ -249,7 +250,7 @@ export function ContentComponent({
|
|
|
249
250
|
if (((userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'dragging' || (userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'blockMenuOpen' && expValEquals('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_hide_floating_toolbar')) && !userIntentEnabled) {
|
|
250
251
|
return null;
|
|
251
252
|
}
|
|
252
|
-
if (userIntentState !== null && userIntentState !== void 0 && userIntentState.currentUserIntent &&
|
|
253
|
+
if (userIntentState !== null && userIntentState !== void 0 && userIntentState.currentUserIntent && SUPPRESS_TOOLBAR_USER_INTENTS.includes(userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) && userIntentEnabled) {
|
|
253
254
|
return null;
|
|
254
255
|
}
|
|
255
256
|
const {
|
|
@@ -553,7 +554,7 @@ export function floatingToolbarPluginFactory(options) {
|
|
|
553
554
|
activeConfigs = undefined;
|
|
554
555
|
break;
|
|
555
556
|
}
|
|
556
|
-
if (userIntentEnabled &&
|
|
557
|
+
if (userIntentEnabled && SUPPRESS_TOOLBAR_USER_INTENTS.includes((api === null || api === void 0 ? void 0 : (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : (_api$userIntent$share = _api$userIntent.sharedState.currentState()) === null || _api$userIntent$share === void 0 ? void 0 : _api$userIntent$share.currentUserIntent) || '')) {
|
|
557
558
|
activeConfigs = undefined;
|
|
558
559
|
break;
|
|
559
560
|
}
|
|
@@ -29,6 +29,7 @@ import { findNode } from './pm-plugins/utils';
|
|
|
29
29
|
import { ConfirmationModal } from './ui/ConfirmationModal';
|
|
30
30
|
import Toolbar from './ui/Toolbar';
|
|
31
31
|
import { consolidateOverflowDropdownItems } from './ui/utils';
|
|
32
|
+
var SUPPRESS_TOOLBAR_USER_INTENTS = ['dragging', 'tablePopupOpen', 'commenting', 'resizing', 'blockMenuOpen', 'statusPickerOpen'];
|
|
32
33
|
|
|
33
34
|
// TODO: AFP-2532 - Fix automatic suppressions below
|
|
34
35
|
export var getRelevantConfig = function getRelevantConfig(selection, configs) {
|
|
@@ -250,7 +251,7 @@ export function ContentComponent(_ref5) {
|
|
|
250
251
|
if (((userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'dragging' || (userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'blockMenuOpen' && expValEquals('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_hide_floating_toolbar')) && !userIntentEnabled) {
|
|
251
252
|
return null;
|
|
252
253
|
}
|
|
253
|
-
if (userIntentState !== null && userIntentState !== void 0 && userIntentState.currentUserIntent &&
|
|
254
|
+
if (userIntentState !== null && userIntentState !== void 0 && userIntentState.currentUserIntent && SUPPRESS_TOOLBAR_USER_INTENTS.includes(userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) && userIntentEnabled) {
|
|
254
255
|
return null;
|
|
255
256
|
}
|
|
256
257
|
var config = configWithNodeInfo.config,
|
|
@@ -558,7 +559,7 @@ export function floatingToolbarPluginFactory(options) {
|
|
|
558
559
|
activeConfigs = undefined;
|
|
559
560
|
break;
|
|
560
561
|
}
|
|
561
|
-
if (userIntentEnabled &&
|
|
562
|
+
if (userIntentEnabled && SUPPRESS_TOOLBAR_USER_INTENTS.includes((api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || (_api$userIntent = _api$userIntent.sharedState.currentState()) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.currentUserIntent) || '')) {
|
|
562
563
|
activeConfigs = undefined;
|
|
563
564
|
break;
|
|
564
565
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.12",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@atlaskit/primitives": "^16.1.0",
|
|
46
46
|
"@atlaskit/select": "^21.3.0",
|
|
47
47
|
"@atlaskit/theme": "^21.0.0",
|
|
48
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
48
|
+
"@atlaskit/tmp-editor-statsig": "^13.22.0",
|
|
49
49
|
"@atlaskit/tokens": "^7.0.0",
|
|
50
50
|
"@atlaskit/tooltip": "^20.7.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|