@atlaskit/editor-plugin-selection-toolbar 8.0.1 → 8.0.3
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 +14 -0
- package/dist/cjs/ui/PinButton.js +2 -7
- package/dist/cjs/ui/PinMenuItem.js +3 -13
- package/dist/cjs/ui/PrimaryToolbarComponent.js +4 -12
- package/dist/cjs/ui/pin-toolbar-config.js +4 -13
- package/dist/es2019/ui/PinButton.js +2 -7
- package/dist/es2019/ui/PinMenuItem.js +3 -13
- package/dist/es2019/ui/PrimaryToolbarComponent.js +4 -12
- package/dist/es2019/ui/pin-toolbar-config.js +4 -13
- package/dist/esm/ui/PinButton.js +2 -7
- package/dist/esm/ui/PinMenuItem.js +3 -13
- package/dist/esm/ui/PrimaryToolbarComponent.js +4 -12
- package/dist/esm/ui/pin-toolbar-config.js +4 -13
- package/package.json +7 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection-toolbar
|
|
2
2
|
|
|
3
|
+
## 8.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 8.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`11e9e613d2d5e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/11e9e613d2d5e) -
|
|
14
|
+
Remove platform_editor_migrate_toolbar_docking feature gate
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 8.0.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/cjs/ui/PinButton.js
CHANGED
|
@@ -19,16 +19,11 @@ var PinButton = exports.PinButton = function PinButton(_ref) {
|
|
|
19
19
|
isOffline = _useEditorToolbar.isOffline;
|
|
20
20
|
var isDisabled = (0, _platformFeatureFlags.fg)('platform_editor_toolbar_aifc_patch_7') ? isOffline : false;
|
|
21
21
|
var onClick = function onClick() {
|
|
22
|
-
var _api$
|
|
22
|
+
var _api$userPreferences;
|
|
23
23
|
if (!api || isDisabled) {
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
var _api$userPreferences;
|
|
28
|
-
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'none'));
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
(_api$selectionToolbar = api.selectionToolbar.actions) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar2 = _api$selectionToolbar.setToolbarDocking) === null || _api$selectionToolbar2 === void 0 || _api$selectionToolbar2.call(_api$selectionToolbar, 'none');
|
|
26
|
+
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'none'));
|
|
32
27
|
};
|
|
33
28
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarTooltip, {
|
|
34
29
|
content: message
|
|
@@ -20,7 +20,7 @@ var shouldShowPinMenuItem = function shouldShowPinMenuItem(editMode) {
|
|
|
20
20
|
};
|
|
21
21
|
var usePluginState = (0, _platformFeatureFlagsReact.conditionalHooksFactory)(function () {
|
|
22
22
|
return (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true);
|
|
23
|
-
}, function (
|
|
23
|
+
}, function (_api) {
|
|
24
24
|
var _useEditorToolbar = (0, _toolbar.useEditorToolbar)(),
|
|
25
25
|
editorViewMode = _useEditorToolbar.editorViewMode,
|
|
26
26
|
editorToolbarDockingPreference = _useEditorToolbar.editorToolbarDockingPreference,
|
|
@@ -57,21 +57,11 @@ var PinMenuItem = exports.PinMenuItem = function PinMenuItem(_ref) {
|
|
|
57
57
|
return null;
|
|
58
58
|
}
|
|
59
59
|
var onClick = function onClick() {
|
|
60
|
+
var _api$userPreferences;
|
|
60
61
|
if (!api || isDisabled) {
|
|
61
62
|
return;
|
|
62
63
|
}
|
|
63
|
-
|
|
64
|
-
var _api$userPreferences;
|
|
65
|
-
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', isToolbarDocked ? 'none' : 'top'));
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
if (isToolbarDocked) {
|
|
69
|
-
var _api$selectionToolbar, _api$selectionToolbar2;
|
|
70
|
-
(_api$selectionToolbar = api.selectionToolbar.actions) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar2 = _api$selectionToolbar.setToolbarDocking) === null || _api$selectionToolbar2 === void 0 || _api$selectionToolbar2.call(_api$selectionToolbar, 'none');
|
|
71
|
-
} else {
|
|
72
|
-
var _api$selectionToolbar3, _api$selectionToolbar4;
|
|
73
|
-
(_api$selectionToolbar3 = api.selectionToolbar.actions) === null || _api$selectionToolbar3 === void 0 || (_api$selectionToolbar4 = _api$selectionToolbar3.setToolbarDocking) === null || _api$selectionToolbar4 === void 0 || _api$selectionToolbar4.call(_api$selectionToolbar3, 'top');
|
|
74
|
-
}
|
|
64
|
+
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', isToolbarDocked ? 'none' : 'top'));
|
|
75
65
|
};
|
|
76
66
|
var message = intl.formatMessage(isToolbarDocked ? _messages.selectionToolbarMessages.toolbarPositionPinedAtTop : _messages.selectionToolbarMessages.toolbarPositionUnpinnedConcise);
|
|
77
67
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
@@ -44,12 +44,8 @@ var PrimaryToolbarComponent = exports.PrimaryToolbarComponent = function Primary
|
|
|
44
44
|
spacing: "spacious"
|
|
45
45
|
}),
|
|
46
46
|
onClick: function onClick() {
|
|
47
|
-
var _api$
|
|
48
|
-
|
|
49
|
-
var _api$core$actions$exe, _api$userPreferences2;
|
|
50
|
-
return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences2 = api.userPreferences) === null || _api$userPreferences2 === void 0 ? void 0 : _api$userPreferences2.actions.updateUserPreference('toolbarDockingPosition', 'none'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
|
|
51
|
-
}
|
|
52
|
-
return (_api$selectionToolbar2 = api === null || api === void 0 || (_api$selectionToolbar3 = api.selectionToolbar.actions) === null || _api$selectionToolbar3 === void 0 || (_api$selectionToolbar4 = _api$selectionToolbar3.setToolbarDocking) === null || _api$selectionToolbar4 === void 0 ? void 0 : _api$selectionToolbar4.call(_api$selectionToolbar3, 'none')) !== null && _api$selectionToolbar2 !== void 0 ? _api$selectionToolbar2 : false;
|
|
47
|
+
var _api$core$actions$exe, _api$userPreferences2;
|
|
48
|
+
return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences2 = api.userPreferences) === null || _api$userPreferences2 === void 0 ? void 0 : _api$userPreferences2.actions.updateUserPreference('toolbarDockingPosition', 'none'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
|
|
53
49
|
},
|
|
54
50
|
title: intl.formatMessage(_messages.selectionToolbarMessages.toolbarPositionPinedAtTop),
|
|
55
51
|
className: (0, _runtime.ax)(["_ca0q12x7 _n3td12x7 _19bv12x7 _u5f312x7"])
|
|
@@ -66,12 +62,8 @@ var PrimaryToolbarComponent = exports.PrimaryToolbarComponent = function Primary
|
|
|
66
62
|
spacing: "spacious"
|
|
67
63
|
}),
|
|
68
64
|
onClick: function onClick() {
|
|
69
|
-
var _api$
|
|
70
|
-
|
|
71
|
-
var _api$core$actions$exe2, _api$userPreferences3;
|
|
72
|
-
return (_api$core$actions$exe2 = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences3 = api.userPreferences) === null || _api$userPreferences3 === void 0 ? void 0 : _api$userPreferences3.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe2 !== void 0 ? _api$core$actions$exe2 : false;
|
|
73
|
-
}
|
|
74
|
-
return (_api$selectionToolbar5 = api === null || api === void 0 || (_api$selectionToolbar6 = api.selectionToolbar.actions) === null || _api$selectionToolbar6 === void 0 || (_api$selectionToolbar7 = _api$selectionToolbar6.setToolbarDocking) === null || _api$selectionToolbar7 === void 0 ? void 0 : _api$selectionToolbar7.call(_api$selectionToolbar6, 'top')) !== null && _api$selectionToolbar5 !== void 0 ? _api$selectionToolbar5 : false;
|
|
65
|
+
var _api$core$actions$exe2, _api$userPreferences3;
|
|
66
|
+
return (_api$core$actions$exe2 = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences3 = api.userPreferences) === null || _api$userPreferences3 === void 0 ? void 0 : _api$userPreferences3.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe2 !== void 0 ? _api$core$actions$exe2 : false;
|
|
75
67
|
},
|
|
76
68
|
title: intl.formatMessage(_messages.selectionToolbarMessages.toolbarPositionUnpined),
|
|
77
69
|
className: (0, _runtime.ax)(["_ca0q12x7 _n3td12x7 _19bv12x7 _u5f312x7"])
|
|
@@ -10,7 +10,6 @@ var _messages = require("@atlaskit/editor-common/messages");
|
|
|
10
10
|
var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
|
|
11
11
|
var _pin = _interopRequireDefault(require("@atlaskit/icon/core/pin"));
|
|
12
12
|
var _pinFilled = _interopRequireDefault(require("@atlaskit/icon/core/pin-filled"));
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var getPinOptionToolbarConfig = exports.getPinOptionToolbarConfig = function getPinOptionToolbarConfig(_ref) {
|
|
15
14
|
var _api$connectivity;
|
|
16
15
|
var api = _ref.api,
|
|
@@ -26,12 +25,8 @@ var getPinOptionToolbarConfig = exports.getPinOptionToolbarConfig = function get
|
|
|
26
25
|
});
|
|
27
26
|
},
|
|
28
27
|
onClick: function onClick() {
|
|
29
|
-
var _api$
|
|
30
|
-
|
|
31
|
-
var _api$core$actions$exe, _api$userPreferences;
|
|
32
|
-
return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
|
|
33
|
-
}
|
|
34
|
-
return (_api$selectionToolbar = api === null || api === void 0 || (_api$selectionToolbar2 = api.selectionToolbar.actions) === null || _api$selectionToolbar2 === void 0 || (_api$selectionToolbar3 = _api$selectionToolbar2.setToolbarDocking) === null || _api$selectionToolbar3 === void 0 ? void 0 : _api$selectionToolbar3.call(_api$selectionToolbar2, 'top')) !== null && _api$selectionToolbar !== void 0 ? _api$selectionToolbar : false;
|
|
28
|
+
var _api$core$actions$exe, _api$userPreferences;
|
|
29
|
+
return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
|
|
35
30
|
},
|
|
36
31
|
title: intl.formatMessage(_messages.selectionToolbarMessages.toolbarPositionUnpined),
|
|
37
32
|
type: 'button'
|
|
@@ -47,12 +42,8 @@ var getPinOptionToolbarConfig = exports.getPinOptionToolbarConfig = function get
|
|
|
47
42
|
});
|
|
48
43
|
},
|
|
49
44
|
onClick: function onClick() {
|
|
50
|
-
var _api$
|
|
51
|
-
|
|
52
|
-
var _api$core$actions$exe2, _api$userPreferences2;
|
|
53
|
-
return (_api$core$actions$exe2 = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences2 = api.userPreferences) === null || _api$userPreferences2 === void 0 ? void 0 : _api$userPreferences2.actions.updateUserPreference('toolbarDockingPosition', 'none'))) !== null && _api$core$actions$exe2 !== void 0 ? _api$core$actions$exe2 : false;
|
|
54
|
-
}
|
|
55
|
-
return (_api$selectionToolbar4 = api === null || api === void 0 || (_api$selectionToolbar5 = api.selectionToolbar.actions) === null || _api$selectionToolbar5 === void 0 || (_api$selectionToolbar6 = _api$selectionToolbar5.setToolbarDocking) === null || _api$selectionToolbar6 === void 0 ? void 0 : _api$selectionToolbar6.call(_api$selectionToolbar5, 'none')) !== null && _api$selectionToolbar4 !== void 0 ? _api$selectionToolbar4 : false;
|
|
45
|
+
var _api$core$actions$exe2, _api$userPreferences2;
|
|
46
|
+
return (_api$core$actions$exe2 = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences2 = api.userPreferences) === null || _api$userPreferences2 === void 0 ? void 0 : _api$userPreferences2.actions.updateUserPreference('toolbarDockingPosition', 'none'))) !== null && _api$core$actions$exe2 !== void 0 ? _api$core$actions$exe2 : false;
|
|
56
47
|
},
|
|
57
48
|
type: 'button',
|
|
58
49
|
title: intl.formatMessage(_messages.selectionToolbarMessages.toolbarPositionPinedAtTop)
|
|
@@ -14,16 +14,11 @@ export const PinButton = ({
|
|
|
14
14
|
} = useEditorToolbar();
|
|
15
15
|
const isDisabled = fg('platform_editor_toolbar_aifc_patch_7') ? isOffline : false;
|
|
16
16
|
const onClick = () => {
|
|
17
|
-
var _api$
|
|
17
|
+
var _api$userPreferences;
|
|
18
18
|
if (!api || isDisabled) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
var _api$userPreferences;
|
|
23
|
-
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'none'));
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
(_api$selectionToolbar = api.selectionToolbar.actions) === null || _api$selectionToolbar === void 0 ? void 0 : (_api$selectionToolbar2 = _api$selectionToolbar.setToolbarDocking) === null || _api$selectionToolbar2 === void 0 ? void 0 : _api$selectionToolbar2.call(_api$selectionToolbar, 'none');
|
|
21
|
+
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'none'));
|
|
27
22
|
};
|
|
28
23
|
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
29
24
|
content: message
|
|
@@ -11,7 +11,7 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
|
11
11
|
const shouldShowPinMenuItem = editMode => {
|
|
12
12
|
return editMode !== 'view';
|
|
13
13
|
};
|
|
14
|
-
const usePluginState = conditionalHooksFactory(() => expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true),
|
|
14
|
+
const usePluginState = conditionalHooksFactory(() => expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true), _api => {
|
|
15
15
|
const {
|
|
16
16
|
editorViewMode,
|
|
17
17
|
editorToolbarDockingPreference,
|
|
@@ -51,21 +51,11 @@ export const PinMenuItem = ({
|
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
53
53
|
const onClick = () => {
|
|
54
|
+
var _api$userPreferences;
|
|
54
55
|
if (!api || isDisabled) {
|
|
55
56
|
return;
|
|
56
57
|
}
|
|
57
|
-
|
|
58
|
-
var _api$userPreferences;
|
|
59
|
-
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', isToolbarDocked ? 'none' : 'top'));
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if (isToolbarDocked) {
|
|
63
|
-
var _api$selectionToolbar, _api$selectionToolbar2;
|
|
64
|
-
(_api$selectionToolbar = api.selectionToolbar.actions) === null || _api$selectionToolbar === void 0 ? void 0 : (_api$selectionToolbar2 = _api$selectionToolbar.setToolbarDocking) === null || _api$selectionToolbar2 === void 0 ? void 0 : _api$selectionToolbar2.call(_api$selectionToolbar, 'none');
|
|
65
|
-
} else {
|
|
66
|
-
var _api$selectionToolbar3, _api$selectionToolbar4;
|
|
67
|
-
(_api$selectionToolbar3 = api.selectionToolbar.actions) === null || _api$selectionToolbar3 === void 0 ? void 0 : (_api$selectionToolbar4 = _api$selectionToolbar3.setToolbarDocking) === null || _api$selectionToolbar4 === void 0 ? void 0 : _api$selectionToolbar4.call(_api$selectionToolbar3, 'top');
|
|
68
|
-
}
|
|
58
|
+
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', isToolbarDocked ? 'none' : 'top'));
|
|
69
59
|
};
|
|
70
60
|
const message = intl.formatMessage(isToolbarDocked ? selectionToolbarMessages.toolbarPositionPinedAtTop : selectionToolbarMessages.toolbarPositionUnpinnedConcise);
|
|
71
61
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
@@ -36,12 +36,8 @@ export const PrimaryToolbarComponent = ({
|
|
|
36
36
|
spacing: "spacious"
|
|
37
37
|
}),
|
|
38
38
|
onClick: () => {
|
|
39
|
-
var _api$
|
|
40
|
-
|
|
41
|
-
var _api$core$actions$exe, _api$userPreferences2;
|
|
42
|
-
return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userPreferences2 = api.userPreferences) === null || _api$userPreferences2 === void 0 ? void 0 : _api$userPreferences2.actions.updateUserPreference('toolbarDockingPosition', 'none'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
|
|
43
|
-
}
|
|
44
|
-
return (_api$selectionToolbar2 = api === null || api === void 0 ? void 0 : (_api$selectionToolbar3 = api.selectionToolbar.actions) === null || _api$selectionToolbar3 === void 0 ? void 0 : (_api$selectionToolbar4 = _api$selectionToolbar3.setToolbarDocking) === null || _api$selectionToolbar4 === void 0 ? void 0 : _api$selectionToolbar4.call(_api$selectionToolbar3, 'none')) !== null && _api$selectionToolbar2 !== void 0 ? _api$selectionToolbar2 : false;
|
|
39
|
+
var _api$core$actions$exe, _api$userPreferences2;
|
|
40
|
+
return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userPreferences2 = api.userPreferences) === null || _api$userPreferences2 === void 0 ? void 0 : _api$userPreferences2.actions.updateUserPreference('toolbarDockingPosition', 'none'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
|
|
45
41
|
},
|
|
46
42
|
title: intl.formatMessage(selectionToolbarMessages.toolbarPositionPinedAtTop),
|
|
47
43
|
className: ax(["_ca0q12x7 _n3td12x7 _19bv12x7 _u5f312x7"])
|
|
@@ -58,12 +54,8 @@ export const PrimaryToolbarComponent = ({
|
|
|
58
54
|
spacing: "spacious"
|
|
59
55
|
}),
|
|
60
56
|
onClick: () => {
|
|
61
|
-
var _api$
|
|
62
|
-
|
|
63
|
-
var _api$core$actions$exe2, _api$userPreferences3;
|
|
64
|
-
return (_api$core$actions$exe2 = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userPreferences3 = api.userPreferences) === null || _api$userPreferences3 === void 0 ? void 0 : _api$userPreferences3.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe2 !== void 0 ? _api$core$actions$exe2 : false;
|
|
65
|
-
}
|
|
66
|
-
return (_api$selectionToolbar5 = api === null || api === void 0 ? void 0 : (_api$selectionToolbar6 = api.selectionToolbar.actions) === null || _api$selectionToolbar6 === void 0 ? void 0 : (_api$selectionToolbar7 = _api$selectionToolbar6.setToolbarDocking) === null || _api$selectionToolbar7 === void 0 ? void 0 : _api$selectionToolbar7.call(_api$selectionToolbar6, 'top')) !== null && _api$selectionToolbar5 !== void 0 ? _api$selectionToolbar5 : false;
|
|
57
|
+
var _api$core$actions$exe2, _api$userPreferences3;
|
|
58
|
+
return (_api$core$actions$exe2 = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userPreferences3 = api.userPreferences) === null || _api$userPreferences3 === void 0 ? void 0 : _api$userPreferences3.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe2 !== void 0 ? _api$core$actions$exe2 : false;
|
|
67
59
|
},
|
|
68
60
|
title: intl.formatMessage(selectionToolbarMessages.toolbarPositionUnpined),
|
|
69
61
|
className: ax(["_ca0q12x7 _n3td12x7 _19bv12x7 _u5f312x7"])
|
|
@@ -3,7 +3,6 @@ import { selectionToolbarMessages } from '@atlaskit/editor-common/messages';
|
|
|
3
3
|
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
4
4
|
import PinIcon from '@atlaskit/icon/core/pin';
|
|
5
5
|
import PinFilledIcon from '@atlaskit/icon/core/pin-filled';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
export const getPinOptionToolbarConfig = ({
|
|
8
7
|
api,
|
|
9
8
|
toolbarDocking,
|
|
@@ -18,12 +17,8 @@ export const getPinOptionToolbarConfig = ({
|
|
|
18
17
|
label: ""
|
|
19
18
|
}),
|
|
20
19
|
onClick: () => {
|
|
21
|
-
var _api$
|
|
22
|
-
|
|
23
|
-
var _api$core$actions$exe, _api$userPreferences;
|
|
24
|
-
return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
|
|
25
|
-
}
|
|
26
|
-
return (_api$selectionToolbar = api === null || api === void 0 ? void 0 : (_api$selectionToolbar2 = api.selectionToolbar.actions) === null || _api$selectionToolbar2 === void 0 ? void 0 : (_api$selectionToolbar3 = _api$selectionToolbar2.setToolbarDocking) === null || _api$selectionToolbar3 === void 0 ? void 0 : _api$selectionToolbar3.call(_api$selectionToolbar2, 'top')) !== null && _api$selectionToolbar !== void 0 ? _api$selectionToolbar : false;
|
|
20
|
+
var _api$core$actions$exe, _api$userPreferences;
|
|
21
|
+
return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
|
|
27
22
|
},
|
|
28
23
|
title: intl.formatMessage(selectionToolbarMessages.toolbarPositionUnpined),
|
|
29
24
|
type: 'button'
|
|
@@ -37,12 +32,8 @@ export const getPinOptionToolbarConfig = ({
|
|
|
37
32
|
label: ""
|
|
38
33
|
}),
|
|
39
34
|
onClick: () => {
|
|
40
|
-
var _api$
|
|
41
|
-
|
|
42
|
-
var _api$core$actions$exe2, _api$userPreferences2;
|
|
43
|
-
return (_api$core$actions$exe2 = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userPreferences2 = api.userPreferences) === null || _api$userPreferences2 === void 0 ? void 0 : _api$userPreferences2.actions.updateUserPreference('toolbarDockingPosition', 'none'))) !== null && _api$core$actions$exe2 !== void 0 ? _api$core$actions$exe2 : false;
|
|
44
|
-
}
|
|
45
|
-
return (_api$selectionToolbar4 = api === null || api === void 0 ? void 0 : (_api$selectionToolbar5 = api.selectionToolbar.actions) === null || _api$selectionToolbar5 === void 0 ? void 0 : (_api$selectionToolbar6 = _api$selectionToolbar5.setToolbarDocking) === null || _api$selectionToolbar6 === void 0 ? void 0 : _api$selectionToolbar6.call(_api$selectionToolbar5, 'none')) !== null && _api$selectionToolbar4 !== void 0 ? _api$selectionToolbar4 : false;
|
|
35
|
+
var _api$core$actions$exe2, _api$userPreferences2;
|
|
36
|
+
return (_api$core$actions$exe2 = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userPreferences2 = api.userPreferences) === null || _api$userPreferences2 === void 0 ? void 0 : _api$userPreferences2.actions.updateUserPreference('toolbarDockingPosition', 'none'))) !== null && _api$core$actions$exe2 !== void 0 ? _api$core$actions$exe2 : false;
|
|
46
37
|
},
|
|
47
38
|
type: 'button',
|
|
48
39
|
title: intl.formatMessage(selectionToolbarMessages.toolbarPositionPinedAtTop)
|
package/dist/esm/ui/PinButton.js
CHANGED
|
@@ -12,16 +12,11 @@ export var PinButton = function PinButton(_ref) {
|
|
|
12
12
|
isOffline = _useEditorToolbar.isOffline;
|
|
13
13
|
var isDisabled = fg('platform_editor_toolbar_aifc_patch_7') ? isOffline : false;
|
|
14
14
|
var onClick = function onClick() {
|
|
15
|
-
var _api$
|
|
15
|
+
var _api$userPreferences;
|
|
16
16
|
if (!api || isDisabled) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
var _api$userPreferences;
|
|
21
|
-
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'none'));
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
(_api$selectionToolbar = api.selectionToolbar.actions) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar2 = _api$selectionToolbar.setToolbarDocking) === null || _api$selectionToolbar2 === void 0 || _api$selectionToolbar2.call(_api$selectionToolbar, 'none');
|
|
19
|
+
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'none'));
|
|
25
20
|
};
|
|
26
21
|
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
27
22
|
content: message
|
|
@@ -13,7 +13,7 @@ var shouldShowPinMenuItem = function shouldShowPinMenuItem(editMode) {
|
|
|
13
13
|
};
|
|
14
14
|
var usePluginState = conditionalHooksFactory(function () {
|
|
15
15
|
return expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true);
|
|
16
|
-
}, function (
|
|
16
|
+
}, function (_api) {
|
|
17
17
|
var _useEditorToolbar = useEditorToolbar(),
|
|
18
18
|
editorViewMode = _useEditorToolbar.editorViewMode,
|
|
19
19
|
editorToolbarDockingPreference = _useEditorToolbar.editorToolbarDockingPreference,
|
|
@@ -50,21 +50,11 @@ export var PinMenuItem = function PinMenuItem(_ref) {
|
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
52
52
|
var onClick = function onClick() {
|
|
53
|
+
var _api$userPreferences;
|
|
53
54
|
if (!api || isDisabled) {
|
|
54
55
|
return;
|
|
55
56
|
}
|
|
56
|
-
|
|
57
|
-
var _api$userPreferences;
|
|
58
|
-
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', isToolbarDocked ? 'none' : 'top'));
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
if (isToolbarDocked) {
|
|
62
|
-
var _api$selectionToolbar, _api$selectionToolbar2;
|
|
63
|
-
(_api$selectionToolbar = api.selectionToolbar.actions) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar2 = _api$selectionToolbar.setToolbarDocking) === null || _api$selectionToolbar2 === void 0 || _api$selectionToolbar2.call(_api$selectionToolbar, 'none');
|
|
64
|
-
} else {
|
|
65
|
-
var _api$selectionToolbar3, _api$selectionToolbar4;
|
|
66
|
-
(_api$selectionToolbar3 = api.selectionToolbar.actions) === null || _api$selectionToolbar3 === void 0 || (_api$selectionToolbar4 = _api$selectionToolbar3.setToolbarDocking) === null || _api$selectionToolbar4 === void 0 || _api$selectionToolbar4.call(_api$selectionToolbar3, 'top');
|
|
67
|
-
}
|
|
57
|
+
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', isToolbarDocked ? 'none' : 'top'));
|
|
68
58
|
};
|
|
69
59
|
var message = intl.formatMessage(isToolbarDocked ? selectionToolbarMessages.toolbarPositionPinedAtTop : selectionToolbarMessages.toolbarPositionUnpinnedConcise);
|
|
70
60
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
@@ -35,12 +35,8 @@ export var PrimaryToolbarComponent = function PrimaryToolbarComponent(_ref) {
|
|
|
35
35
|
spacing: "spacious"
|
|
36
36
|
}),
|
|
37
37
|
onClick: function onClick() {
|
|
38
|
-
var _api$
|
|
39
|
-
|
|
40
|
-
var _api$core$actions$exe, _api$userPreferences2;
|
|
41
|
-
return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences2 = api.userPreferences) === null || _api$userPreferences2 === void 0 ? void 0 : _api$userPreferences2.actions.updateUserPreference('toolbarDockingPosition', 'none'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
|
|
42
|
-
}
|
|
43
|
-
return (_api$selectionToolbar2 = api === null || api === void 0 || (_api$selectionToolbar3 = api.selectionToolbar.actions) === null || _api$selectionToolbar3 === void 0 || (_api$selectionToolbar4 = _api$selectionToolbar3.setToolbarDocking) === null || _api$selectionToolbar4 === void 0 ? void 0 : _api$selectionToolbar4.call(_api$selectionToolbar3, 'none')) !== null && _api$selectionToolbar2 !== void 0 ? _api$selectionToolbar2 : false;
|
|
38
|
+
var _api$core$actions$exe, _api$userPreferences2;
|
|
39
|
+
return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences2 = api.userPreferences) === null || _api$userPreferences2 === void 0 ? void 0 : _api$userPreferences2.actions.updateUserPreference('toolbarDockingPosition', 'none'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
|
|
44
40
|
},
|
|
45
41
|
title: intl.formatMessage(selectionToolbarMessages.toolbarPositionPinedAtTop),
|
|
46
42
|
className: ax(["_ca0q12x7 _n3td12x7 _19bv12x7 _u5f312x7"])
|
|
@@ -57,12 +53,8 @@ export var PrimaryToolbarComponent = function PrimaryToolbarComponent(_ref) {
|
|
|
57
53
|
spacing: "spacious"
|
|
58
54
|
}),
|
|
59
55
|
onClick: function onClick() {
|
|
60
|
-
var _api$
|
|
61
|
-
|
|
62
|
-
var _api$core$actions$exe2, _api$userPreferences3;
|
|
63
|
-
return (_api$core$actions$exe2 = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences3 = api.userPreferences) === null || _api$userPreferences3 === void 0 ? void 0 : _api$userPreferences3.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe2 !== void 0 ? _api$core$actions$exe2 : false;
|
|
64
|
-
}
|
|
65
|
-
return (_api$selectionToolbar5 = api === null || api === void 0 || (_api$selectionToolbar6 = api.selectionToolbar.actions) === null || _api$selectionToolbar6 === void 0 || (_api$selectionToolbar7 = _api$selectionToolbar6.setToolbarDocking) === null || _api$selectionToolbar7 === void 0 ? void 0 : _api$selectionToolbar7.call(_api$selectionToolbar6, 'top')) !== null && _api$selectionToolbar5 !== void 0 ? _api$selectionToolbar5 : false;
|
|
56
|
+
var _api$core$actions$exe2, _api$userPreferences3;
|
|
57
|
+
return (_api$core$actions$exe2 = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences3 = api.userPreferences) === null || _api$userPreferences3 === void 0 ? void 0 : _api$userPreferences3.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe2 !== void 0 ? _api$core$actions$exe2 : false;
|
|
66
58
|
},
|
|
67
59
|
title: intl.formatMessage(selectionToolbarMessages.toolbarPositionUnpined),
|
|
68
60
|
className: ax(["_ca0q12x7 _n3td12x7 _19bv12x7 _u5f312x7"])
|
|
@@ -3,7 +3,6 @@ import { selectionToolbarMessages } from '@atlaskit/editor-common/messages';
|
|
|
3
3
|
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
4
4
|
import PinIcon from '@atlaskit/icon/core/pin';
|
|
5
5
|
import PinFilledIcon from '@atlaskit/icon/core/pin-filled';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
export var getPinOptionToolbarConfig = function getPinOptionToolbarConfig(_ref) {
|
|
8
7
|
var _api$connectivity;
|
|
9
8
|
var api = _ref.api,
|
|
@@ -19,12 +18,8 @@ export var getPinOptionToolbarConfig = function getPinOptionToolbarConfig(_ref)
|
|
|
19
18
|
});
|
|
20
19
|
},
|
|
21
20
|
onClick: function onClick() {
|
|
22
|
-
var _api$
|
|
23
|
-
|
|
24
|
-
var _api$core$actions$exe, _api$userPreferences;
|
|
25
|
-
return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
|
|
26
|
-
}
|
|
27
|
-
return (_api$selectionToolbar = api === null || api === void 0 || (_api$selectionToolbar2 = api.selectionToolbar.actions) === null || _api$selectionToolbar2 === void 0 || (_api$selectionToolbar3 = _api$selectionToolbar2.setToolbarDocking) === null || _api$selectionToolbar3 === void 0 ? void 0 : _api$selectionToolbar3.call(_api$selectionToolbar2, 'top')) !== null && _api$selectionToolbar !== void 0 ? _api$selectionToolbar : false;
|
|
21
|
+
var _api$core$actions$exe, _api$userPreferences;
|
|
22
|
+
return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
|
|
28
23
|
},
|
|
29
24
|
title: intl.formatMessage(selectionToolbarMessages.toolbarPositionUnpined),
|
|
30
25
|
type: 'button'
|
|
@@ -40,12 +35,8 @@ export var getPinOptionToolbarConfig = function getPinOptionToolbarConfig(_ref)
|
|
|
40
35
|
});
|
|
41
36
|
},
|
|
42
37
|
onClick: function onClick() {
|
|
43
|
-
var _api$
|
|
44
|
-
|
|
45
|
-
var _api$core$actions$exe2, _api$userPreferences2;
|
|
46
|
-
return (_api$core$actions$exe2 = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences2 = api.userPreferences) === null || _api$userPreferences2 === void 0 ? void 0 : _api$userPreferences2.actions.updateUserPreference('toolbarDockingPosition', 'none'))) !== null && _api$core$actions$exe2 !== void 0 ? _api$core$actions$exe2 : false;
|
|
47
|
-
}
|
|
48
|
-
return (_api$selectionToolbar4 = api === null || api === void 0 || (_api$selectionToolbar5 = api.selectionToolbar.actions) === null || _api$selectionToolbar5 === void 0 || (_api$selectionToolbar6 = _api$selectionToolbar5.setToolbarDocking) === null || _api$selectionToolbar6 === void 0 ? void 0 : _api$selectionToolbar6.call(_api$selectionToolbar5, 'none')) !== null && _api$selectionToolbar4 !== void 0 ? _api$selectionToolbar4 : false;
|
|
38
|
+
var _api$core$actions$exe2, _api$userPreferences2;
|
|
39
|
+
return (_api$core$actions$exe2 = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences2 = api.userPreferences) === null || _api$userPreferences2 === void 0 ? void 0 : _api$userPreferences2.actions.updateUserPreference('toolbarDockingPosition', 'none'))) !== null && _api$core$actions$exe2 !== void 0 ? _api$core$actions$exe2 : false;
|
|
49
40
|
},
|
|
50
41
|
type: 'button',
|
|
51
42
|
title: intl.formatMessage(selectionToolbarMessages.toolbarPositionPinedAtTop)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-toolbar",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.3",
|
|
4
4
|
"description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -39,20 +39,20 @@
|
|
|
39
39
|
"@atlaskit/editor-plugin-user-intent": "^5.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-user-preferences": "^5.0.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "^7.2.0",
|
|
42
|
-
"@atlaskit/editor-toolbar": "^0.
|
|
42
|
+
"@atlaskit/editor-toolbar": "^0.19.0",
|
|
43
43
|
"@atlaskit/editor-toolbar-model": "^0.2.0",
|
|
44
|
-
"@atlaskit/icon": "^29.
|
|
45
|
-
"@atlaskit/icon-lab": "^5.
|
|
44
|
+
"@atlaskit/icon": "^29.4.0",
|
|
45
|
+
"@atlaskit/icon-lab": "^5.14.0",
|
|
46
46
|
"@atlaskit/menu": "^8.4.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
49
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
50
|
-
"@atlaskit/tokens": "^9.
|
|
49
|
+
"@atlaskit/tmp-editor-statsig": "^16.11.0",
|
|
50
|
+
"@atlaskit/tokens": "^9.1.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
52
52
|
"bind-event-listener": "^3.0.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@atlaskit/editor-common": "^111.
|
|
55
|
+
"@atlaskit/editor-common": "^111.7.0",
|
|
56
56
|
"react": "^18.2.0",
|
|
57
57
|
"react-dom": "^18.2.0",
|
|
58
58
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -106,9 +106,6 @@
|
|
|
106
106
|
"platform_editor_toolbar_aifc_patch_7": {
|
|
107
107
|
"type": "boolean"
|
|
108
108
|
},
|
|
109
|
-
"platform_editor_migrate_toolbar_docking": {
|
|
110
|
-
"type": "boolean"
|
|
111
|
-
},
|
|
112
109
|
"platform_editor_toolbar_aifc_placement_config": {
|
|
113
110
|
"type": "boolean"
|
|
114
111
|
}
|