@atlaskit/editor-plugin-selection-toolbar 7.0.7 → 7.0.8
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-selection-toolbar
|
|
2
2
|
|
|
3
|
+
## 7.0.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c04bcabb31f7c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c04bcabb31f7c) -
|
|
8
|
+
[ux] ED-29513 Force showing pinning toolbar for LCM using user preferences plugin
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 7.0.7
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -98,19 +98,26 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
|
|
|
98
98
|
}))) !== null && _api$core$actions$exe4 !== void 0 ? _api$core$actions$exe4 : false;
|
|
99
99
|
},
|
|
100
100
|
forceToolbarDockingWithoutAnalytics: function forceToolbarDockingWithoutAnalytics(toolbarDocking) {
|
|
101
|
-
var _api$core$actions$
|
|
102
|
-
|
|
101
|
+
var _api$core$actions$exe6;
|
|
102
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin')) {
|
|
103
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_lcm_toolbar_docking_fix')) {
|
|
104
|
+
var _api$core$actions$exe5, _api$userPreferences2;
|
|
105
|
+
// to avoid nested gate. Will remove when cleaning up platform_editor_lcm_toolbar_docking_fix
|
|
106
|
+
return (_api$core$actions$exe5 = 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', toolbarDocking))) !== null && _api$core$actions$exe5 !== void 0 ? _api$core$actions$exe5 : false;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return (_api$core$actions$exe6 = api === null || api === void 0 ? void 0 : api.core.actions.execute((0, _commands.forceToolbarDockingWithoutAnalytics)({
|
|
103
110
|
toolbarDocking: toolbarDocking,
|
|
104
111
|
userPreferencesProvider: userPreferencesProvider
|
|
105
|
-
}))) !== null && _api$core$actions$
|
|
112
|
+
}))) !== null && _api$core$actions$exe6 !== void 0 ? _api$core$actions$exe6 : false;
|
|
106
113
|
},
|
|
107
114
|
refreshToolbarDocking: function refreshToolbarDocking() {
|
|
108
115
|
if (userPreferencesProvider) {
|
|
109
|
-
var _api$core$actions$
|
|
116
|
+
var _api$core$actions$exe7;
|
|
110
117
|
var userToolbarDockingPref = getToolbarDocking(contextualFormattingEnabled, userPreferencesProvider);
|
|
111
|
-
return (_api$core$actions$
|
|
118
|
+
return (_api$core$actions$exe7 = api === null || api === void 0 ? void 0 : api.core.actions.execute((0, _commands.updateToolbarDocking)({
|
|
112
119
|
toolbarDocking: userToolbarDockingPref
|
|
113
|
-
}))) !== null && _api$core$actions$
|
|
120
|
+
}))) !== null && _api$core$actions$exe7 !== void 0 ? _api$core$actions$exe7 : false;
|
|
114
121
|
}
|
|
115
122
|
return false;
|
|
116
123
|
}
|
|
@@ -122,11 +129,11 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
|
|
|
122
129
|
return _pluginKey.selectionToolbarPluginKey.getState(editorState);
|
|
123
130
|
},
|
|
124
131
|
pmPlugins: function pmPlugins(selectionToolbarHandlers) {
|
|
125
|
-
var _api$
|
|
132
|
+
var _api$userPreferences3;
|
|
126
133
|
if (selectionToolbarHandlers) {
|
|
127
134
|
__selectionToolbarHandlers.push.apply(__selectionToolbarHandlers, (0, _toConsumableArray2.default)(selectionToolbarHandlers));
|
|
128
135
|
}
|
|
129
|
-
var initialToolbarDocking = (0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin') ? getToolbarDockingV2(contextualFormattingEnabled, api === null || api === void 0 || (_api$
|
|
136
|
+
var initialToolbarDocking = (0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin') ? getToolbarDockingV2(contextualFormattingEnabled, api === null || api === void 0 || (_api$userPreferences3 = api.userPreferences) === null || _api$userPreferences3 === void 0 || (_api$userPreferences3 = _api$userPreferences3.sharedState.currentState()) === null || _api$userPreferences3 === void 0 || (_api$userPreferences3 = _api$userPreferences3.preferences) === null || _api$userPreferences3 === void 0 ? void 0 : _api$userPreferences3.toolbarDockingPosition) : getToolbarDocking(contextualFormattingEnabled, userPreferencesProvider);
|
|
130
137
|
return [{
|
|
131
138
|
name: 'selection-tracker',
|
|
132
139
|
plugin: function plugin() {
|
|
@@ -330,8 +337,8 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
|
|
|
330
337
|
}
|
|
331
338
|
}
|
|
332
339
|
if (items.length > 0 && contextualFormattingEnabled && isEditorControlsEnabled) {
|
|
333
|
-
var _api$
|
|
334
|
-
var toolbarDockingPref = api !== null && api !== void 0 && api.userPreferences && (0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin') ? api === null || api === void 0 || (_api$
|
|
340
|
+
var _api$userPreferences4;
|
|
341
|
+
var toolbarDockingPref = api !== null && api !== void 0 && api.userPreferences && (0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin') ? api === null || api === void 0 || (_api$userPreferences4 = api.userPreferences) === null || _api$userPreferences4 === void 0 || (_api$userPreferences4 = _api$userPreferences4.sharedState.currentState()) === null || _api$userPreferences4 === void 0 || (_api$userPreferences4 = _api$userPreferences4.preferences) === null || _api$userPreferences4 === void 0 ? void 0 : _api$userPreferences4.toolbarDockingPosition : toolbarDocking;
|
|
335
342
|
items.push.apply(items, (0, _toConsumableArray2.default)((0, _pinToolbarConfig.getPinOptionToolbarConfig)({
|
|
336
343
|
api: api,
|
|
337
344
|
toolbarDocking: toolbarDockingPref,
|
|
@@ -91,19 +91,26 @@ export const selectionToolbarPlugin = ({
|
|
|
91
91
|
}))) !== null && _api$core$actions$exe4 !== void 0 ? _api$core$actions$exe4 : false;
|
|
92
92
|
},
|
|
93
93
|
forceToolbarDockingWithoutAnalytics: toolbarDocking => {
|
|
94
|
-
var _api$core$actions$
|
|
95
|
-
|
|
94
|
+
var _api$core$actions$exe6;
|
|
95
|
+
if (fg('platform_editor_use_preferences_plugin')) {
|
|
96
|
+
if (fg('platform_editor_lcm_toolbar_docking_fix')) {
|
|
97
|
+
var _api$core$actions$exe5, _api$userPreferences2;
|
|
98
|
+
// to avoid nested gate. Will remove when cleaning up platform_editor_lcm_toolbar_docking_fix
|
|
99
|
+
return (_api$core$actions$exe5 = 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', toolbarDocking))) !== null && _api$core$actions$exe5 !== void 0 ? _api$core$actions$exe5 : false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return (_api$core$actions$exe6 = api === null || api === void 0 ? void 0 : api.core.actions.execute(forceToolbarDockingWithoutAnalytics({
|
|
96
103
|
toolbarDocking,
|
|
97
104
|
userPreferencesProvider
|
|
98
|
-
}))) !== null && _api$core$actions$
|
|
105
|
+
}))) !== null && _api$core$actions$exe6 !== void 0 ? _api$core$actions$exe6 : false;
|
|
99
106
|
},
|
|
100
107
|
refreshToolbarDocking: () => {
|
|
101
108
|
if (userPreferencesProvider) {
|
|
102
|
-
var _api$core$actions$
|
|
109
|
+
var _api$core$actions$exe7;
|
|
103
110
|
const userToolbarDockingPref = getToolbarDocking(contextualFormattingEnabled, userPreferencesProvider);
|
|
104
|
-
return (_api$core$actions$
|
|
111
|
+
return (_api$core$actions$exe7 = api === null || api === void 0 ? void 0 : api.core.actions.execute(updateToolbarDocking({
|
|
105
112
|
toolbarDocking: userToolbarDockingPref
|
|
106
|
-
}))) !== null && _api$core$actions$
|
|
113
|
+
}))) !== null && _api$core$actions$exe7 !== void 0 ? _api$core$actions$exe7 : false;
|
|
107
114
|
}
|
|
108
115
|
return false;
|
|
109
116
|
}
|
|
@@ -115,11 +122,11 @@ export const selectionToolbarPlugin = ({
|
|
|
115
122
|
return selectionToolbarPluginKey.getState(editorState);
|
|
116
123
|
},
|
|
117
124
|
pmPlugins(selectionToolbarHandlers) {
|
|
118
|
-
var _api$
|
|
125
|
+
var _api$userPreferences3, _api$userPreferences4, _api$userPreferences5;
|
|
119
126
|
if (selectionToolbarHandlers) {
|
|
120
127
|
__selectionToolbarHandlers.push(...selectionToolbarHandlers);
|
|
121
128
|
}
|
|
122
|
-
const initialToolbarDocking = fg('platform_editor_use_preferences_plugin') ? getToolbarDockingV2(contextualFormattingEnabled, api === null || api === void 0 ? void 0 : (_api$
|
|
129
|
+
const initialToolbarDocking = fg('platform_editor_use_preferences_plugin') ? getToolbarDockingV2(contextualFormattingEnabled, api === null || api === void 0 ? void 0 : (_api$userPreferences3 = api.userPreferences) === null || _api$userPreferences3 === void 0 ? void 0 : (_api$userPreferences4 = _api$userPreferences3.sharedState.currentState()) === null || _api$userPreferences4 === void 0 ? void 0 : (_api$userPreferences5 = _api$userPreferences4.preferences) === null || _api$userPreferences5 === void 0 ? void 0 : _api$userPreferences5.toolbarDockingPosition) : getToolbarDocking(contextualFormattingEnabled, userPreferencesProvider);
|
|
123
130
|
return [{
|
|
124
131
|
name: 'selection-tracker',
|
|
125
132
|
plugin: () => {
|
|
@@ -325,8 +332,8 @@ export const selectionToolbarPlugin = ({
|
|
|
325
332
|
}
|
|
326
333
|
}
|
|
327
334
|
if (items.length > 0 && contextualFormattingEnabled && isEditorControlsEnabled) {
|
|
328
|
-
var _api$
|
|
329
|
-
const toolbarDockingPref = api !== null && api !== void 0 && api.userPreferences && fg('platform_editor_use_preferences_plugin') ? api === null || api === void 0 ? void 0 : (_api$
|
|
335
|
+
var _api$userPreferences6, _api$userPreferences7, _api$userPreferences8;
|
|
336
|
+
const toolbarDockingPref = api !== null && api !== void 0 && api.userPreferences && fg('platform_editor_use_preferences_plugin') ? api === null || api === void 0 ? void 0 : (_api$userPreferences6 = api.userPreferences) === null || _api$userPreferences6 === void 0 ? void 0 : (_api$userPreferences7 = _api$userPreferences6.sharedState.currentState()) === null || _api$userPreferences7 === void 0 ? void 0 : (_api$userPreferences8 = _api$userPreferences7.preferences) === null || _api$userPreferences8 === void 0 ? void 0 : _api$userPreferences8.toolbarDockingPosition : toolbarDocking;
|
|
330
337
|
items.push(...getPinOptionToolbarConfig({
|
|
331
338
|
api,
|
|
332
339
|
toolbarDocking: toolbarDockingPref,
|
|
@@ -91,19 +91,26 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
|
|
|
91
91
|
}))) !== null && _api$core$actions$exe4 !== void 0 ? _api$core$actions$exe4 : false;
|
|
92
92
|
},
|
|
93
93
|
forceToolbarDockingWithoutAnalytics: function forceToolbarDockingWithoutAnalytics(toolbarDocking) {
|
|
94
|
-
var _api$core$actions$
|
|
95
|
-
|
|
94
|
+
var _api$core$actions$exe6;
|
|
95
|
+
if (fg('platform_editor_use_preferences_plugin')) {
|
|
96
|
+
if (fg('platform_editor_lcm_toolbar_docking_fix')) {
|
|
97
|
+
var _api$core$actions$exe5, _api$userPreferences2;
|
|
98
|
+
// to avoid nested gate. Will remove when cleaning up platform_editor_lcm_toolbar_docking_fix
|
|
99
|
+
return (_api$core$actions$exe5 = 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', toolbarDocking))) !== null && _api$core$actions$exe5 !== void 0 ? _api$core$actions$exe5 : false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return (_api$core$actions$exe6 = api === null || api === void 0 ? void 0 : api.core.actions.execute(_forceToolbarDockingWithoutAnalytics({
|
|
96
103
|
toolbarDocking: toolbarDocking,
|
|
97
104
|
userPreferencesProvider: userPreferencesProvider
|
|
98
|
-
}))) !== null && _api$core$actions$
|
|
105
|
+
}))) !== null && _api$core$actions$exe6 !== void 0 ? _api$core$actions$exe6 : false;
|
|
99
106
|
},
|
|
100
107
|
refreshToolbarDocking: function refreshToolbarDocking() {
|
|
101
108
|
if (userPreferencesProvider) {
|
|
102
|
-
var _api$core$actions$
|
|
109
|
+
var _api$core$actions$exe7;
|
|
103
110
|
var userToolbarDockingPref = getToolbarDocking(contextualFormattingEnabled, userPreferencesProvider);
|
|
104
|
-
return (_api$core$actions$
|
|
111
|
+
return (_api$core$actions$exe7 = api === null || api === void 0 ? void 0 : api.core.actions.execute(updateToolbarDocking({
|
|
105
112
|
toolbarDocking: userToolbarDockingPref
|
|
106
|
-
}))) !== null && _api$core$actions$
|
|
113
|
+
}))) !== null && _api$core$actions$exe7 !== void 0 ? _api$core$actions$exe7 : false;
|
|
107
114
|
}
|
|
108
115
|
return false;
|
|
109
116
|
}
|
|
@@ -115,11 +122,11 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
|
|
|
115
122
|
return selectionToolbarPluginKey.getState(editorState);
|
|
116
123
|
},
|
|
117
124
|
pmPlugins: function pmPlugins(selectionToolbarHandlers) {
|
|
118
|
-
var _api$
|
|
125
|
+
var _api$userPreferences3;
|
|
119
126
|
if (selectionToolbarHandlers) {
|
|
120
127
|
__selectionToolbarHandlers.push.apply(__selectionToolbarHandlers, _toConsumableArray(selectionToolbarHandlers));
|
|
121
128
|
}
|
|
122
|
-
var initialToolbarDocking = fg('platform_editor_use_preferences_plugin') ? getToolbarDockingV2(contextualFormattingEnabled, api === null || api === void 0 || (_api$
|
|
129
|
+
var initialToolbarDocking = fg('platform_editor_use_preferences_plugin') ? getToolbarDockingV2(contextualFormattingEnabled, api === null || api === void 0 || (_api$userPreferences3 = api.userPreferences) === null || _api$userPreferences3 === void 0 || (_api$userPreferences3 = _api$userPreferences3.sharedState.currentState()) === null || _api$userPreferences3 === void 0 || (_api$userPreferences3 = _api$userPreferences3.preferences) === null || _api$userPreferences3 === void 0 ? void 0 : _api$userPreferences3.toolbarDockingPosition) : getToolbarDocking(contextualFormattingEnabled, userPreferencesProvider);
|
|
123
130
|
return [{
|
|
124
131
|
name: 'selection-tracker',
|
|
125
132
|
plugin: function plugin() {
|
|
@@ -323,8 +330,8 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
|
|
|
323
330
|
}
|
|
324
331
|
}
|
|
325
332
|
if (items.length > 0 && contextualFormattingEnabled && isEditorControlsEnabled) {
|
|
326
|
-
var _api$
|
|
327
|
-
var toolbarDockingPref = api !== null && api !== void 0 && api.userPreferences && fg('platform_editor_use_preferences_plugin') ? api === null || api === void 0 || (_api$
|
|
333
|
+
var _api$userPreferences4;
|
|
334
|
+
var toolbarDockingPref = api !== null && api !== void 0 && api.userPreferences && fg('platform_editor_use_preferences_plugin') ? api === null || api === void 0 || (_api$userPreferences4 = api.userPreferences) === null || _api$userPreferences4 === void 0 || (_api$userPreferences4 = _api$userPreferences4.sharedState.currentState()) === null || _api$userPreferences4 === void 0 || (_api$userPreferences4 = _api$userPreferences4.preferences) === null || _api$userPreferences4 === void 0 ? void 0 : _api$userPreferences4.toolbarDockingPosition : toolbarDocking;
|
|
328
335
|
items.push.apply(items, _toConsumableArray(getPinOptionToolbarConfig({
|
|
329
336
|
api: api,
|
|
330
337
|
toolbarDocking: toolbarDockingPref,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-toolbar",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.8",
|
|
4
4
|
"description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,18 +41,18 @@
|
|
|
41
41
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
42
42
|
"@atlaskit/editor-toolbar": "^0.14.0",
|
|
43
43
|
"@atlaskit/editor-toolbar-model": "^0.2.0",
|
|
44
|
-
"@atlaskit/icon": "^28.
|
|
45
|
-
"@atlaskit/icon-lab": "^5.
|
|
44
|
+
"@atlaskit/icon": "^28.5.0",
|
|
45
|
+
"@atlaskit/icon-lab": "^5.10.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.3.0",
|
|
49
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
49
|
+
"@atlaskit/tmp-editor-statsig": "^13.6.0",
|
|
50
50
|
"@atlaskit/tokens": "^6.4.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": "^110.
|
|
55
|
+
"@atlaskit/editor-common": "^110.10.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"
|
|
@@ -104,6 +104,9 @@
|
|
|
104
104
|
},
|
|
105
105
|
"aifc_create_enabled": {
|
|
106
106
|
"type": "boolean"
|
|
107
|
+
},
|
|
108
|
+
"platform_editor_lcm_toolbar_docking_fix": {
|
|
109
|
+
"type": "boolean"
|
|
107
110
|
}
|
|
108
111
|
}
|
|
109
112
|
}
|