@atlaskit/editor-plugin-selection-toolbar 3.7.6 → 3.8.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
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection-toolbar
|
|
2
2
|
|
|
3
|
+
## 3.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#177157](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/177157)
|
|
8
|
+
[`6bcf8912217df`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6bcf8912217df) -
|
|
9
|
+
ED-27284 additional integration with user preference plugin
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 3.7.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -22,6 +22,7 @@ var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-
|
|
|
22
22
|
var _pin = _interopRequireDefault(require("@atlaskit/icon/core/pin"));
|
|
23
23
|
var _pinFilled = _interopRequireDefault(require("@atlaskit/icon/core/pin-filled"));
|
|
24
24
|
var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
|
|
25
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
25
26
|
var _overflowToolbarConfig = require("./overflow-toolbar-config");
|
|
26
27
|
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); }
|
|
27
28
|
var DROPDOWN_WIDTH = 240;
|
|
@@ -101,13 +102,13 @@ function PrimaryToolbarComponent(_ref) {
|
|
|
101
102
|
* button to the toolbar to the or make it in-line.
|
|
102
103
|
*/
|
|
103
104
|
var PrimaryToolbarComponentNew = exports.PrimaryToolbarComponentNew = function PrimaryToolbarComponentNew(_ref3) {
|
|
104
|
-
var _api$selectionToolbar;
|
|
105
|
+
var _api$userPreferences, _api$selectionToolbar;
|
|
105
106
|
var api = _ref3.api,
|
|
106
107
|
disabled = _ref3.disabled;
|
|
107
108
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
108
109
|
var mode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'connectivity.mode');
|
|
109
110
|
var isOffline = mode === 'offline' || false;
|
|
110
|
-
var isDockedToTop = (api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar.sharedState.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top';
|
|
111
|
+
var isDockedToTop = (0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin') ? (api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.preferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.toolbarDockingPosition) === 'top' : (api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar.sharedState.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top';
|
|
111
112
|
if (isDockedToTop) {
|
|
112
113
|
return /*#__PURE__*/React.createElement(_uiMenu.ToolbarButton, {
|
|
113
114
|
"aria-label": intl.formatMessage(_messages.selectionToolbarMessages.toolbarPositionPinedAtTop)
|
|
@@ -12,6 +12,7 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
|
|
|
12
12
|
import PinIcon from '@atlaskit/icon/core/pin';
|
|
13
13
|
import PinFilledIcon from '@atlaskit/icon/core/pin-filled';
|
|
14
14
|
import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
15
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
16
|
import { getOverflowPrimaryToolbarConfig } from './overflow-toolbar-config';
|
|
16
17
|
const DROPDOWN_WIDTH = 240;
|
|
17
18
|
const buttonStyles = null;
|
|
@@ -88,11 +89,11 @@ export const PrimaryToolbarComponentNew = ({
|
|
|
88
89
|
api,
|
|
89
90
|
disabled
|
|
90
91
|
}) => {
|
|
91
|
-
var _api$selectionToolbar;
|
|
92
|
+
var _api$userPreferences, _api$userPreferences$, _api$userPreferences$2, _api$selectionToolbar;
|
|
92
93
|
const intl = useIntl();
|
|
93
94
|
const mode = useSharedPluginStateSelector(api, 'connectivity.mode');
|
|
94
95
|
const isOffline = mode === 'offline' || false;
|
|
95
|
-
const isDockedToTop = (api === null || api === void 0 ? void 0 : (_api$selectionToolbar = api.selectionToolbar.sharedState.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top';
|
|
96
|
+
const isDockedToTop = fg('platform_editor_use_preferences_plugin') ? (api === null || api === void 0 ? void 0 : (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : (_api$userPreferences$ = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences$ === void 0 ? void 0 : (_api$userPreferences$2 = _api$userPreferences$.preferences) === null || _api$userPreferences$2 === void 0 ? void 0 : _api$userPreferences$2.toolbarDockingPosition) === 'top' : (api === null || api === void 0 ? void 0 : (_api$selectionToolbar = api.selectionToolbar.sharedState.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top';
|
|
96
97
|
if (isDockedToTop) {
|
|
97
98
|
return /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
98
99
|
"aria-label": intl.formatMessage(selectionToolbarMessages.toolbarPositionPinedAtTop)
|
|
@@ -13,6 +13,7 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
|
|
|
13
13
|
import PinIcon from '@atlaskit/icon/core/pin';
|
|
14
14
|
import PinFilledIcon from '@atlaskit/icon/core/pin-filled';
|
|
15
15
|
import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
16
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
17
|
import { getOverflowPrimaryToolbarConfig } from './overflow-toolbar-config';
|
|
17
18
|
var DROPDOWN_WIDTH = 240;
|
|
18
19
|
var buttonStyles = null;
|
|
@@ -91,13 +92,13 @@ export function PrimaryToolbarComponent(_ref) {
|
|
|
91
92
|
* button to the toolbar to the or make it in-line.
|
|
92
93
|
*/
|
|
93
94
|
export var PrimaryToolbarComponentNew = function PrimaryToolbarComponentNew(_ref3) {
|
|
94
|
-
var _api$selectionToolbar;
|
|
95
|
+
var _api$userPreferences, _api$selectionToolbar;
|
|
95
96
|
var api = _ref3.api,
|
|
96
97
|
disabled = _ref3.disabled;
|
|
97
98
|
var intl = useIntl();
|
|
98
99
|
var mode = useSharedPluginStateSelector(api, 'connectivity.mode');
|
|
99
100
|
var isOffline = mode === 'offline' || false;
|
|
100
|
-
var isDockedToTop = (api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar.sharedState.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top';
|
|
101
|
+
var isDockedToTop = fg('platform_editor_use_preferences_plugin') ? (api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.preferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.toolbarDockingPosition) === 'top' : (api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar.sharedState.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top';
|
|
101
102
|
if (isDockedToTop) {
|
|
102
103
|
return /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
103
104
|
"aria-label": intl.formatMessage(selectionToolbarMessages.toolbarPositionPinedAtTop)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-toolbar",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0",
|
|
4
4
|
"description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"atlassian": {
|
|
11
11
|
"team": "Editor: AI",
|
|
12
|
-
"singleton": true
|
|
13
|
-
"runReact18": true
|
|
12
|
+
"singleton": true
|
|
14
13
|
},
|
|
15
14
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
16
15
|
"main": "dist/cjs/index.js",
|
|
@@ -34,19 +33,19 @@
|
|
|
34
33
|
},
|
|
35
34
|
"dependencies": {
|
|
36
35
|
"@atlaskit/css": "^0.12.0",
|
|
37
|
-
"@atlaskit/editor-common": "^107.
|
|
36
|
+
"@atlaskit/editor-common": "^107.4.0",
|
|
38
37
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
39
38
|
"@atlaskit/editor-plugin-block-controls": "^3.19.0",
|
|
40
39
|
"@atlaskit/editor-plugin-connectivity": "^2.0.0",
|
|
41
40
|
"@atlaskit/editor-plugin-editor-viewmode": "^4.0.0",
|
|
42
41
|
"@atlaskit/editor-plugin-primary-toolbar": "^3.2.0",
|
|
43
|
-
"@atlaskit/editor-plugin-user-preferences": "^0.
|
|
42
|
+
"@atlaskit/editor-plugin-user-preferences": "^0.3.0",
|
|
44
43
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
45
44
|
"@atlaskit/icon": "^27.2.0",
|
|
46
45
|
"@atlaskit/icon-lab": "^5.1.0",
|
|
47
46
|
"@atlaskit/menu": "^8.0.0",
|
|
48
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
49
|
-
"@atlaskit/tmp-editor-statsig": "^8.
|
|
48
|
+
"@atlaskit/tmp-editor-statsig": "^8.5.0",
|
|
50
49
|
"@atlaskit/tokens": "^5.4.0",
|
|
51
50
|
"@babel/runtime": "^7.0.0",
|
|
52
51
|
"bind-event-listener": "^3.0.0"
|