@atlaskit/editor-plugin-floating-toolbar 5.0.4 → 5.0.6
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 +15 -0
- package/dist/cjs/floatingToolbarPlugin.js +2 -1
- package/dist/cjs/ui/Dropdown.js +2 -2
- package/dist/cjs/ui/DropdownMenu.js +2 -2
- package/dist/cjs/ui/Toolbar.js +11 -10
- package/dist/es2019/floatingToolbarPlugin.js +2 -1
- package/dist/es2019/ui/Dropdown.js +2 -2
- package/dist/es2019/ui/DropdownMenu.js +2 -2
- package/dist/es2019/ui/Toolbar.js +11 -10
- package/dist/esm/floatingToolbarPlugin.js +2 -1
- package/dist/esm/ui/Dropdown.js +2 -2
- package/dist/esm/ui/DropdownMenu.js +2 -2
- package/dist/esm/ui/Toolbar.js +11 -10
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 5.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#188597](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/188597)
|
|
8
|
+
[`4de5a96f3e24c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4de5a96f3e24c) -
|
|
9
|
+
[ED-28523] Enable new editor element toolbars UI for Jira
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 5.0.5
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 5.0.4
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -19,6 +19,7 @@ var _errorBoundary = require("@atlaskit/editor-common/error-boundary");
|
|
|
19
19
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
20
20
|
var _providerFactory = require("@atlaskit/editor-common/provider-factory");
|
|
21
21
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
22
|
+
var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
22
23
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
23
24
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
24
25
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
@@ -288,7 +289,7 @@ function ContentComponent(_ref5) {
|
|
|
288
289
|
return toolbarItemViewModeProp in item && !!item[toolbarItemViewModeProp];
|
|
289
290
|
});
|
|
290
291
|
}
|
|
291
|
-
if ((0,
|
|
292
|
+
if ((0, _toolbarFlagCheck.areToolbarFlagsEnabled)()) {
|
|
292
293
|
var _items2;
|
|
293
294
|
// Consolidate floating toolbar items
|
|
294
295
|
var toolbarItemsArray = Array.isArray(items) ? items : (_items2 = items) === null || _items2 === void 0 ? void 0 : _items2(node);
|
package/dist/cjs/ui/Dropdown.js
CHANGED
|
@@ -14,11 +14,11 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
16
|
var _react2 = require("@emotion/react");
|
|
17
|
+
var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
17
18
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
18
19
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
19
20
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-down"));
|
|
20
21
|
var _chevronDown2 = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
21
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
22
22
|
var _Divider = require("./Divider");
|
|
23
23
|
var _DropdownMenu = _interopRequireWildcard(require("./DropdownMenu"));
|
|
24
24
|
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); }
|
|
@@ -172,7 +172,7 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
172
172
|
selected: isOpen,
|
|
173
173
|
disabled: disabled,
|
|
174
174
|
tooltipContent: tooltip,
|
|
175
|
-
ariaHasPopup: (0,
|
|
175
|
+
ariaHasPopup: (0, _toolbarFlagCheck.areToolbarFlagsEnabled)() ? true : undefined,
|
|
176
176
|
onMount: onMount,
|
|
177
177
|
pulse: pulse,
|
|
178
178
|
spotlightConfig: spotlightConfig
|
|
@@ -8,9 +8,9 @@ var _react = require("react");
|
|
|
8
8
|
var _react2 = require("@emotion/react");
|
|
9
9
|
var _reactIntlNext = require("react-intl-next");
|
|
10
10
|
var _floatingToolbar = require("@atlaskit/editor-common/floating-toolbar");
|
|
11
|
+
var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
11
12
|
var _menu = require("@atlaskit/menu");
|
|
12
13
|
var _constants = require("@atlaskit/theme/constants");
|
|
13
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
14
14
|
/**
|
|
15
15
|
* @jsxRuntime classic
|
|
16
16
|
* @jsx jsx
|
|
@@ -64,7 +64,7 @@ var Dropdown = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
64
64
|
editorView = props.editorView,
|
|
65
65
|
_props$showSelected = props.showSelected,
|
|
66
66
|
showSelected = _props$showSelected === void 0 ? true : _props$showSelected;
|
|
67
|
-
if ((0,
|
|
67
|
+
if ((0, _toolbarFlagCheck.areToolbarFlagsEnabled)()) {
|
|
68
68
|
return (0, _react2.jsx)("div", {
|
|
69
69
|
css: menuContainerStyles,
|
|
70
70
|
role: "menu"
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -20,6 +20,7 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
20
20
|
var _buttonGroup = _interopRequireDefault(require("@atlaskit/button/button-group"));
|
|
21
21
|
var _floatingToolbar = require("@atlaskit/editor-common/floating-toolbar");
|
|
22
22
|
var _messages = _interopRequireDefault(require("@atlaskit/editor-common/messages"));
|
|
23
|
+
var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
23
24
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
24
25
|
var _uiColor = require("@atlaskit/editor-common/ui-color");
|
|
25
26
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
@@ -61,7 +62,7 @@ function groupItems(items) {
|
|
|
61
62
|
} else {
|
|
62
63
|
finalOutput.push(item);
|
|
63
64
|
}
|
|
64
|
-
} else if (item.type === 'separator' && (0,
|
|
65
|
+
} else if (item.type === 'separator' && (0, _toolbarFlagCheck.areToolbarFlagsEnabled)()) {
|
|
65
66
|
var _items;
|
|
66
67
|
var isLeadingSeparator = i === 0;
|
|
67
68
|
var isTrailingSeparator = i === items.length - 1;
|
|
@@ -340,7 +341,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
340
341
|
scrollable: scrollable
|
|
341
342
|
});
|
|
342
343
|
case 'separator':
|
|
343
|
-
if ((0,
|
|
344
|
+
if ((0, _toolbarFlagCheck.areToolbarFlagsEnabled)()) {
|
|
344
345
|
return item.fullHeight ? (0, _react2.jsx)(_ui.FloatingToolbarSeparator, {
|
|
345
346
|
key: idx,
|
|
346
347
|
fullHeight: true
|
|
@@ -364,7 +365,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
364
365
|
// Ignored via go/ees005
|
|
365
366
|
// eslint-disable-next-line react/no-array-index-key
|
|
366
367
|
key: index,
|
|
367
|
-
css: (0,
|
|
368
|
+
css: (0, _toolbarFlagCheck.areToolbarFlagsEnabled)() ? buttonGroupStylesNew : buttonGroupStyles,
|
|
368
369
|
role: "radiogroup",
|
|
369
370
|
"aria-label": groupLabel !== null && groupLabel !== void 0 ? groupLabel : undefined,
|
|
370
371
|
"data-testid": "editor-floating-toolbar-grouped-buttons"
|
|
@@ -430,7 +431,7 @@ var toolbarContainer = function toolbarContainer(scrollable, hasSelect, firstEle
|
|
|
430
431
|
overflow: 'hidden'
|
|
431
432
|
}) :
|
|
432
433
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
433
|
-
(0,
|
|
434
|
+
(0, _toolbarFlagCheck.areToolbarFlagsEnabled)() ?
|
|
434
435
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
435
436
|
(0, _react2.css)({
|
|
436
437
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
@@ -453,7 +454,7 @@ var toolbarContainer = function toolbarContainer(scrollable, hasSelect, firstEle
|
|
|
453
454
|
paddingLeft: "var(--ds-space-050, 4px)"
|
|
454
455
|
})),
|
|
455
456
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
456
|
-
(0,
|
|
457
|
+
(0, _toolbarFlagCheck.areToolbarFlagsEnabled)() ?
|
|
457
458
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
458
459
|
(0, _react2.css)({
|
|
459
460
|
minHeight: "var(--ds-space-500, 40px)"
|
|
@@ -506,7 +507,7 @@ var toolbarOverflow = function toolbarOverflow(_ref2) {
|
|
|
506
507
|
}
|
|
507
508
|
},
|
|
508
509
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
509
|
-
(0,
|
|
510
|
+
(0, _toolbarFlagCheck.areToolbarFlagsEnabled)() ?
|
|
510
511
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
511
512
|
(0, _react2.css)({
|
|
512
513
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
@@ -652,7 +653,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
652
653
|
intl = _this$props2.intl,
|
|
653
654
|
scrollable = _this$props2.scrollable,
|
|
654
655
|
mediaAssistiveMessage = _this$props2.mediaAssistiveMessage;
|
|
655
|
-
var
|
|
656
|
+
var isNewEditorToolbarEnabled = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)();
|
|
656
657
|
if (!items || !items.length) {
|
|
657
658
|
return null;
|
|
658
659
|
}
|
|
@@ -684,11 +685,11 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
684
685
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
685
686
|
,
|
|
686
687
|
className: className,
|
|
687
|
-
onMouseDown:
|
|
688
|
+
onMouseDown: isNewEditorToolbarEnabled ? this.captureMouseEvent : undefined
|
|
688
689
|
}, (0, _react2.jsx)(_ui.Announcer, {
|
|
689
690
|
text: mediaAssistiveMessage ? "".concat(mediaAssistiveMessage, ", ").concat(intl.formatMessage(_floatingToolbar.messages.floatingToolbarAnnouncer)) : intl.formatMessage(_floatingToolbar.messages.floatingToolbarAnnouncer),
|
|
690
691
|
delay: 250
|
|
691
|
-
}), scrollable &&
|
|
692
|
+
}), scrollable && isNewEditorToolbarEnabled && (0, _react2.jsx)(_ScrollButton.ScrollButton, {
|
|
692
693
|
intl: intl,
|
|
693
694
|
scrollContainerRef: this.scrollContainerRef,
|
|
694
695
|
node: node,
|
|
@@ -713,7 +714,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
713
714
|
setDisableScroll: this.setDisableScroll.bind(this),
|
|
714
715
|
mountRef: this.mountRef,
|
|
715
716
|
mounted: this.state.mounted
|
|
716
|
-
}))), scrollable && (
|
|
717
|
+
}))), scrollable && (isNewEditorToolbarEnabled ? (0, _react2.jsx)(_ScrollButton.ScrollButton, {
|
|
717
718
|
intl: intl,
|
|
718
719
|
scrollContainerRef: this.scrollContainerRef,
|
|
719
720
|
node: node,
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
9
9
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
10
10
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
11
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
11
12
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
12
13
|
import { AllSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
13
14
|
import { findDomRefAtPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
@@ -277,7 +278,7 @@ export function ContentComponent({
|
|
|
277
278
|
const toolbarItemViewModeProp = 'supportsViewMode';
|
|
278
279
|
items = iterableItems.filter(item => toolbarItemViewModeProp in item && !!item[toolbarItemViewModeProp]);
|
|
279
280
|
}
|
|
280
|
-
if (
|
|
281
|
+
if (areToolbarFlagsEnabled()) {
|
|
281
282
|
var _items2;
|
|
282
283
|
// Consolidate floating toolbar items
|
|
283
284
|
const toolbarItemsArray = Array.isArray(items) ? items : (_items2 = items) === null || _items2 === void 0 ? void 0 : _items2(node);
|
|
@@ -9,11 +9,11 @@ import React, { Component } from 'react';
|
|
|
9
9
|
|
|
10
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
11
|
import { css, jsx } from '@emotion/react';
|
|
12
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
12
13
|
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
13
14
|
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
14
15
|
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
15
16
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
16
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
17
17
|
import { Divider } from './Divider';
|
|
18
18
|
import DropdownMenu, { itemSpacing, menuItemDimensions } from './DropdownMenu';
|
|
19
19
|
|
|
@@ -154,7 +154,7 @@ export default class Dropdown extends Component {
|
|
|
154
154
|
selected: isOpen,
|
|
155
155
|
disabled: disabled,
|
|
156
156
|
tooltipContent: tooltip,
|
|
157
|
-
ariaHasPopup:
|
|
157
|
+
ariaHasPopup: areToolbarFlagsEnabled() ? true : undefined,
|
|
158
158
|
onMount: onMount,
|
|
159
159
|
pulse: pulse,
|
|
160
160
|
spotlightConfig: spotlightConfig
|
|
@@ -10,10 +10,10 @@ import { css, jsx } from '@emotion/react';
|
|
|
10
10
|
|
|
11
11
|
import { injectIntl } from 'react-intl-next';
|
|
12
12
|
import { DropdownMenuItem } from '@atlaskit/editor-common/floating-toolbar';
|
|
13
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
13
14
|
import { HeadingItem } from '@atlaskit/menu';
|
|
14
15
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
15
16
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
16
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
17
17
|
export const menuItemDimensions = {
|
|
18
18
|
width: 175,
|
|
19
19
|
height: 32
|
|
@@ -57,7 +57,7 @@ const Dropdown = /*#__PURE__*/memo(props => {
|
|
|
57
57
|
editorView,
|
|
58
58
|
showSelected = true
|
|
59
59
|
} = props;
|
|
60
|
-
if (
|
|
60
|
+
if (areToolbarFlagsEnabled()) {
|
|
61
61
|
return jsx("div", {
|
|
62
62
|
css: menuContainerStyles,
|
|
63
63
|
role: "menu"
|
|
@@ -13,6 +13,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
13
13
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
14
14
|
import { areSameItems, messages } from '@atlaskit/editor-common/floating-toolbar';
|
|
15
15
|
import commonMessages from '@atlaskit/editor-common/messages';
|
|
16
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
16
17
|
import { Announcer, FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
|
|
17
18
|
import { backgroundPaletteTooltipMessages } from '@atlaskit/editor-common/ui-color';
|
|
18
19
|
import { ColorPickerButton, ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
@@ -50,7 +51,7 @@ export function groupItems(items) {
|
|
|
50
51
|
} else {
|
|
51
52
|
finalOutput.push(item);
|
|
52
53
|
}
|
|
53
|
-
} else if (item.type === 'separator' &&
|
|
54
|
+
} else if (item.type === 'separator' && areToolbarFlagsEnabled()) {
|
|
54
55
|
var _items;
|
|
55
56
|
const isLeadingSeparator = i === 0;
|
|
56
57
|
const isTrailingSeparator = i === items.length - 1;
|
|
@@ -314,7 +315,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
314
315
|
scrollable: scrollable
|
|
315
316
|
});
|
|
316
317
|
case 'separator':
|
|
317
|
-
if (
|
|
318
|
+
if (areToolbarFlagsEnabled()) {
|
|
318
319
|
return item.fullHeight ? jsx(Separator, {
|
|
319
320
|
key: idx,
|
|
320
321
|
fullHeight: true
|
|
@@ -336,7 +337,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
336
337
|
// Ignored via go/ees005
|
|
337
338
|
// eslint-disable-next-line react/no-array-index-key
|
|
338
339
|
key: index,
|
|
339
|
-
css:
|
|
340
|
+
css: areToolbarFlagsEnabled() ? buttonGroupStylesNew : buttonGroupStyles,
|
|
340
341
|
role: "radiogroup",
|
|
341
342
|
"aria-label": groupLabel !== null && groupLabel !== void 0 ? groupLabel : undefined,
|
|
342
343
|
"data-testid": "editor-floating-toolbar-grouped-buttons"
|
|
@@ -397,7 +398,7 @@ css({
|
|
|
397
398
|
overflow: 'hidden'
|
|
398
399
|
}) :
|
|
399
400
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
400
|
-
|
|
401
|
+
areToolbarFlagsEnabled() ?
|
|
401
402
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
402
403
|
css({
|
|
403
404
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
@@ -420,7 +421,7 @@ css({
|
|
|
420
421
|
paddingLeft: "var(--ds-space-050, 4px)"
|
|
421
422
|
})),
|
|
422
423
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
423
|
-
|
|
424
|
+
areToolbarFlagsEnabled() ?
|
|
424
425
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
425
426
|
css({
|
|
426
427
|
minHeight: "var(--ds-space-500, 40px)"
|
|
@@ -472,7 +473,7 @@ css({
|
|
|
472
473
|
}
|
|
473
474
|
},
|
|
474
475
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
475
|
-
|
|
476
|
+
areToolbarFlagsEnabled() ?
|
|
476
477
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
477
478
|
css({
|
|
478
479
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
@@ -606,7 +607,7 @@ class Toolbar extends Component {
|
|
|
606
607
|
scrollable,
|
|
607
608
|
mediaAssistiveMessage
|
|
608
609
|
} = this.props;
|
|
609
|
-
const
|
|
610
|
+
const isNewEditorToolbarEnabled = areToolbarFlagsEnabled();
|
|
610
611
|
if (!items || !items.length) {
|
|
611
612
|
return null;
|
|
612
613
|
}
|
|
@@ -634,11 +635,11 @@ class Toolbar extends Component {
|
|
|
634
635
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
635
636
|
,
|
|
636
637
|
className: className,
|
|
637
|
-
onMouseDown:
|
|
638
|
+
onMouseDown: isNewEditorToolbarEnabled ? this.captureMouseEvent : undefined
|
|
638
639
|
}, jsx(Announcer, {
|
|
639
640
|
text: mediaAssistiveMessage ? `${mediaAssistiveMessage}, ${intl.formatMessage(messages.floatingToolbarAnnouncer)}` : intl.formatMessage(messages.floatingToolbarAnnouncer),
|
|
640
641
|
delay: 250
|
|
641
|
-
}), scrollable &&
|
|
642
|
+
}), scrollable && isNewEditorToolbarEnabled && jsx(ScrollButton, {
|
|
642
643
|
intl: intl,
|
|
643
644
|
scrollContainerRef: this.scrollContainerRef,
|
|
644
645
|
node: node,
|
|
@@ -663,7 +664,7 @@ class Toolbar extends Component {
|
|
|
663
664
|
setDisableScroll: this.setDisableScroll.bind(this),
|
|
664
665
|
mountRef: this.mountRef,
|
|
665
666
|
mounted: this.state.mounted
|
|
666
|
-
}))), scrollable && (
|
|
667
|
+
}))), scrollable && (isNewEditorToolbarEnabled ? jsx(ScrollButton, {
|
|
667
668
|
intl: intl,
|
|
668
669
|
scrollContainerRef: this.scrollContainerRef,
|
|
669
670
|
node: node,
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
13
13
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
14
14
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
15
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
15
16
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
16
17
|
import { AllSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
17
18
|
import { findDomRefAtPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
@@ -279,7 +280,7 @@ export function ContentComponent(_ref5) {
|
|
|
279
280
|
return toolbarItemViewModeProp in item && !!item[toolbarItemViewModeProp];
|
|
280
281
|
});
|
|
281
282
|
}
|
|
282
|
-
if (
|
|
283
|
+
if (areToolbarFlagsEnabled()) {
|
|
283
284
|
var _items2;
|
|
284
285
|
// Consolidate floating toolbar items
|
|
285
286
|
var toolbarItemsArray = Array.isArray(items) ? items : (_items2 = items) === null || _items2 === void 0 ? void 0 : _items2(node);
|
package/dist/esm/ui/Dropdown.js
CHANGED
|
@@ -18,11 +18,11 @@ import React, { Component } from 'react';
|
|
|
18
18
|
|
|
19
19
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
20
20
|
import { css, jsx } from '@emotion/react';
|
|
21
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
21
22
|
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
22
23
|
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
23
24
|
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
24
25
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
25
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
26
26
|
import { Divider } from './Divider';
|
|
27
27
|
import DropdownMenu, { itemSpacing, menuItemDimensions } from './DropdownMenu';
|
|
28
28
|
|
|
@@ -168,7 +168,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
168
168
|
selected: isOpen,
|
|
169
169
|
disabled: disabled,
|
|
170
170
|
tooltipContent: tooltip,
|
|
171
|
-
ariaHasPopup:
|
|
171
|
+
ariaHasPopup: areToolbarFlagsEnabled() ? true : undefined,
|
|
172
172
|
onMount: onMount,
|
|
173
173
|
pulse: pulse,
|
|
174
174
|
spotlightConfig: spotlightConfig
|
|
@@ -10,10 +10,10 @@ import { css, jsx } from '@emotion/react';
|
|
|
10
10
|
|
|
11
11
|
import { injectIntl } from 'react-intl-next';
|
|
12
12
|
import { DropdownMenuItem } from '@atlaskit/editor-common/floating-toolbar';
|
|
13
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
13
14
|
import { HeadingItem } from '@atlaskit/menu';
|
|
14
15
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
15
16
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
16
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
17
17
|
export var menuItemDimensions = {
|
|
18
18
|
width: 175,
|
|
19
19
|
height: 32
|
|
@@ -56,7 +56,7 @@ var Dropdown = /*#__PURE__*/memo(function (props) {
|
|
|
56
56
|
editorView = props.editorView,
|
|
57
57
|
_props$showSelected = props.showSelected,
|
|
58
58
|
showSelected = _props$showSelected === void 0 ? true : _props$showSelected;
|
|
59
|
-
if (
|
|
59
|
+
if (areToolbarFlagsEnabled()) {
|
|
60
60
|
return jsx("div", {
|
|
61
61
|
css: menuContainerStyles,
|
|
62
62
|
role: "menu"
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -20,6 +20,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
20
20
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
21
21
|
import { areSameItems, messages } from '@atlaskit/editor-common/floating-toolbar';
|
|
22
22
|
import commonMessages from '@atlaskit/editor-common/messages';
|
|
23
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
23
24
|
import { Announcer, FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
|
|
24
25
|
import { backgroundPaletteTooltipMessages } from '@atlaskit/editor-common/ui-color';
|
|
25
26
|
import { ColorPickerButton, ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
@@ -55,7 +56,7 @@ export function groupItems(items) {
|
|
|
55
56
|
} else {
|
|
56
57
|
finalOutput.push(item);
|
|
57
58
|
}
|
|
58
|
-
} else if (item.type === 'separator' &&
|
|
59
|
+
} else if (item.type === 'separator' && areToolbarFlagsEnabled()) {
|
|
59
60
|
var _items;
|
|
60
61
|
var isLeadingSeparator = i === 0;
|
|
61
62
|
var isTrailingSeparator = i === items.length - 1;
|
|
@@ -334,7 +335,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
334
335
|
scrollable: scrollable
|
|
335
336
|
});
|
|
336
337
|
case 'separator':
|
|
337
|
-
if (
|
|
338
|
+
if (areToolbarFlagsEnabled()) {
|
|
338
339
|
return item.fullHeight ? jsx(Separator, {
|
|
339
340
|
key: idx,
|
|
340
341
|
fullHeight: true
|
|
@@ -358,7 +359,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
358
359
|
// Ignored via go/ees005
|
|
359
360
|
// eslint-disable-next-line react/no-array-index-key
|
|
360
361
|
key: index,
|
|
361
|
-
css:
|
|
362
|
+
css: areToolbarFlagsEnabled() ? buttonGroupStylesNew : buttonGroupStyles,
|
|
362
363
|
role: "radiogroup",
|
|
363
364
|
"aria-label": groupLabel !== null && groupLabel !== void 0 ? groupLabel : undefined,
|
|
364
365
|
"data-testid": "editor-floating-toolbar-grouped-buttons"
|
|
@@ -424,7 +425,7 @@ var toolbarContainer = function toolbarContainer(scrollable, hasSelect, firstEle
|
|
|
424
425
|
overflow: 'hidden'
|
|
425
426
|
}) :
|
|
426
427
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
427
|
-
|
|
428
|
+
areToolbarFlagsEnabled() ?
|
|
428
429
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
429
430
|
css({
|
|
430
431
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
@@ -447,7 +448,7 @@ var toolbarContainer = function toolbarContainer(scrollable, hasSelect, firstEle
|
|
|
447
448
|
paddingLeft: "var(--ds-space-050, 4px)"
|
|
448
449
|
})),
|
|
449
450
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
450
|
-
|
|
451
|
+
areToolbarFlagsEnabled() ?
|
|
451
452
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
452
453
|
css({
|
|
453
454
|
minHeight: "var(--ds-space-500, 40px)"
|
|
@@ -500,7 +501,7 @@ var toolbarOverflow = function toolbarOverflow(_ref2) {
|
|
|
500
501
|
}
|
|
501
502
|
},
|
|
502
503
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
503
|
-
|
|
504
|
+
areToolbarFlagsEnabled() ?
|
|
504
505
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
505
506
|
css({
|
|
506
507
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
@@ -646,7 +647,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
646
647
|
intl = _this$props2.intl,
|
|
647
648
|
scrollable = _this$props2.scrollable,
|
|
648
649
|
mediaAssistiveMessage = _this$props2.mediaAssistiveMessage;
|
|
649
|
-
var
|
|
650
|
+
var isNewEditorToolbarEnabled = areToolbarFlagsEnabled();
|
|
650
651
|
if (!items || !items.length) {
|
|
651
652
|
return null;
|
|
652
653
|
}
|
|
@@ -678,11 +679,11 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
678
679
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
679
680
|
,
|
|
680
681
|
className: className,
|
|
681
|
-
onMouseDown:
|
|
682
|
+
onMouseDown: isNewEditorToolbarEnabled ? this.captureMouseEvent : undefined
|
|
682
683
|
}, jsx(Announcer, {
|
|
683
684
|
text: mediaAssistiveMessage ? "".concat(mediaAssistiveMessage, ", ").concat(intl.formatMessage(messages.floatingToolbarAnnouncer)) : intl.formatMessage(messages.floatingToolbarAnnouncer),
|
|
684
685
|
delay: 250
|
|
685
|
-
}), scrollable &&
|
|
686
|
+
}), scrollable && isNewEditorToolbarEnabled && jsx(ScrollButton, {
|
|
686
687
|
intl: intl,
|
|
687
688
|
scrollContainerRef: this.scrollContainerRef,
|
|
688
689
|
node: node,
|
|
@@ -707,7 +708,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
707
708
|
setDisableScroll: this.setDisableScroll.bind(this),
|
|
708
709
|
mountRef: this.mountRef,
|
|
709
710
|
mounted: this.state.mounted
|
|
710
|
-
}))), scrollable && (
|
|
711
|
+
}))), scrollable && (isNewEditorToolbarEnabled ? jsx(ScrollButton, {
|
|
711
712
|
intl: intl,
|
|
712
713
|
scrollContainerRef: this.scrollContainerRef,
|
|
713
714
|
node: node,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.6",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
"@atlaskit/editor-plugin-emoji": "^4.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-extension": "^6.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-interaction": "^4.0.0",
|
|
40
|
-
"@atlaskit/editor-plugin-table": "^
|
|
40
|
+
"@atlaskit/editor-plugin-table": "^12.0.0",
|
|
41
41
|
"@atlaskit/editor-plugin-user-intent": "^1.0.0",
|
|
42
42
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
43
43
|
"@atlaskit/emoji": "^69.3.0",
|
|
44
|
-
"@atlaskit/icon": "^27.
|
|
44
|
+
"@atlaskit/icon": "^27.5.0",
|
|
45
45
|
"@atlaskit/menu": "^8.0.0",
|
|
46
|
-
"@atlaskit/modal-dialog": "^14.
|
|
46
|
+
"@atlaskit/modal-dialog": "^14.3.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
48
|
"@atlaskit/primitives": "^14.10.0",
|
|
49
49
|
"@atlaskit/select": "^21.2.0",
|
|
50
50
|
"@atlaskit/theme": "^19.0.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
52
|
-
"@atlaskit/tokens": "^5.
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^9.9.0",
|
|
52
|
+
"@atlaskit/tokens": "^5.6.0",
|
|
53
53
|
"@atlaskit/tooltip": "^20.3.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
55
55
|
"@emotion/react": "^11.7.1",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"react-loadable": "^5.1.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@atlaskit/editor-common": "^107.
|
|
63
|
+
"@atlaskit/editor-common": "^107.9.0",
|
|
64
64
|
"react": "^18.2.0",
|
|
65
65
|
"react-dom": "^18.2.0"
|
|
66
66
|
},
|