@atlaskit/editor-plugin-selection-toolbar 3.7.2 → 3.7.4
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/pm-plugins/commands.js +9 -12
- package/dist/cjs/selectionToolbarPlugin.js +2 -2
- package/dist/es2019/pm-plugins/commands.js +9 -12
- package/dist/es2019/selectionToolbarPlugin.js +2 -2
- package/dist/esm/pm-plugins/commands.js +9 -12
- package/dist/esm/selectionToolbarPlugin.js +2 -2
- package/package.json +4 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection-toolbar
|
|
2
2
|
|
|
3
|
+
## 3.7.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#172583](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/172583)
|
|
8
|
+
[`40f387a0c0962`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/40f387a0c0962) -
|
|
9
|
+
Clean up platform_editor_controls_patch_2
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.7.3
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 3.7.2
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.updateToolbarDocking = exports.toggleToolbar = exports.setToolbarDocking = exports.forceToolbarDockingWithoutAnalytics = void 0;
|
|
7
7
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
8
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
9
|
var _pluginKey = require("./plugin-key");
|
|
11
10
|
var toggleToolbar = exports.toggleToolbar = function toggleToolbar(_ref) {
|
|
12
11
|
var hide = _ref.hide;
|
|
@@ -43,17 +42,15 @@ var setToolbarDocking = exports.setToolbarDocking = function setToolbarDocking(_
|
|
|
43
42
|
// Remove the selection if the toolbar is docked to the top
|
|
44
43
|
tr.setSelection(_state.TextSelection.create(tr.doc, tr.selection.head));
|
|
45
44
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
})(tr);
|
|
56
|
-
}
|
|
45
|
+
editorAnalyticsApi === null || editorAnalyticsApi === void 0 || editorAnalyticsApi.attachAnalyticsEvent({
|
|
46
|
+
action: _analytics.ACTION.UPDATED,
|
|
47
|
+
actionSubject: _analytics.ACTION_SUBJECT.USER_PREFERENCES,
|
|
48
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.SELECTION_TOOLBAR_PREFERENCES,
|
|
49
|
+
attributes: {
|
|
50
|
+
toolbarDocking: toolbarDocking
|
|
51
|
+
},
|
|
52
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
53
|
+
})(tr);
|
|
57
54
|
return tr;
|
|
58
55
|
};
|
|
59
56
|
};
|
|
@@ -209,7 +209,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
|
|
|
209
209
|
if ((0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin')) {
|
|
210
210
|
return null;
|
|
211
211
|
}
|
|
212
|
-
if (!isPreferenceInitialized && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')
|
|
212
|
+
if (!isPreferenceInitialized && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
213
213
|
var toolbarDockingPreference = userPreferencesProvider === null || userPreferencesProvider === void 0 ? void 0 : userPreferencesProvider.getPreference('toolbarDockingInitialPosition');
|
|
214
214
|
if (toolbarDockingPreference !== undefined) {
|
|
215
215
|
var _api$analytics2;
|
|
@@ -266,7 +266,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
|
|
|
266
266
|
// do not show the toolbar.
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
269
|
-
if (isCellSelection && isEditorControlsEnabled
|
|
269
|
+
if (isCellSelection && isEditorControlsEnabled) {
|
|
270
270
|
var _api$blockControls;
|
|
271
271
|
var isSelectedViaDragHandle = api === null || api === void 0 || (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 || (_api$blockControls = _api$blockControls.sharedState.currentState()) === null || _api$blockControls === void 0 ? void 0 : _api$blockControls.isSelectedViaDragHandle;
|
|
272
272
|
if (isSelectedViaDragHandle) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { selectionToolbarPluginKey } from './plugin-key';
|
|
5
4
|
export const toggleToolbar = ({
|
|
6
5
|
hide
|
|
@@ -38,17 +37,15 @@ export const setToolbarDocking = ({
|
|
|
38
37
|
// Remove the selection if the toolbar is docked to the top
|
|
39
38
|
tr.setSelection(TextSelection.create(tr.doc, tr.selection.head));
|
|
40
39
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
})(tr);
|
|
51
|
-
}
|
|
40
|
+
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent({
|
|
41
|
+
action: ACTION.UPDATED,
|
|
42
|
+
actionSubject: ACTION_SUBJECT.USER_PREFERENCES,
|
|
43
|
+
actionSubjectId: ACTION_SUBJECT_ID.SELECTION_TOOLBAR_PREFERENCES,
|
|
44
|
+
attributes: {
|
|
45
|
+
toolbarDocking
|
|
46
|
+
},
|
|
47
|
+
eventType: EVENT_TYPE.TRACK
|
|
48
|
+
})(tr);
|
|
52
49
|
return tr;
|
|
53
50
|
};
|
|
54
51
|
|
|
@@ -205,7 +205,7 @@ export const selectionToolbarPlugin = ({
|
|
|
205
205
|
if (fg('platform_editor_use_preferences_plugin')) {
|
|
206
206
|
return null;
|
|
207
207
|
}
|
|
208
|
-
if (!isPreferenceInitialized && editorExperiment('platform_editor_controls', 'variant1')
|
|
208
|
+
if (!isPreferenceInitialized && editorExperiment('platform_editor_controls', 'variant1')) {
|
|
209
209
|
const toolbarDockingPreference = userPreferencesProvider === null || userPreferencesProvider === void 0 ? void 0 : userPreferencesProvider.getPreference('toolbarDockingInitialPosition');
|
|
210
210
|
if (toolbarDockingPreference !== undefined) {
|
|
211
211
|
var _api$analytics2;
|
|
@@ -263,7 +263,7 @@ export const selectionToolbarPlugin = ({
|
|
|
263
263
|
// do not show the toolbar.
|
|
264
264
|
return;
|
|
265
265
|
}
|
|
266
|
-
if (isCellSelection && isEditorControlsEnabled
|
|
266
|
+
if (isCellSelection && isEditorControlsEnabled) {
|
|
267
267
|
var _api$blockControls, _api$blockControls$sh;
|
|
268
268
|
const isSelectedViaDragHandle = api === null || api === void 0 ? void 0 : (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 ? void 0 : (_api$blockControls$sh = _api$blockControls.sharedState.currentState()) === null || _api$blockControls$sh === void 0 ? void 0 : _api$blockControls$sh.isSelectedViaDragHandle;
|
|
269
269
|
if (isSelectedViaDragHandle) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { selectionToolbarPluginKey } from './plugin-key';
|
|
5
4
|
export var toggleToolbar = function toggleToolbar(_ref) {
|
|
6
5
|
var hide = _ref.hide;
|
|
@@ -37,17 +36,15 @@ export var setToolbarDocking = function setToolbarDocking(_ref5) {
|
|
|
37
36
|
// Remove the selection if the toolbar is docked to the top
|
|
38
37
|
tr.setSelection(TextSelection.create(tr.doc, tr.selection.head));
|
|
39
38
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
})(tr);
|
|
50
|
-
}
|
|
39
|
+
editorAnalyticsApi === null || editorAnalyticsApi === void 0 || editorAnalyticsApi.attachAnalyticsEvent({
|
|
40
|
+
action: ACTION.UPDATED,
|
|
41
|
+
actionSubject: ACTION_SUBJECT.USER_PREFERENCES,
|
|
42
|
+
actionSubjectId: ACTION_SUBJECT_ID.SELECTION_TOOLBAR_PREFERENCES,
|
|
43
|
+
attributes: {
|
|
44
|
+
toolbarDocking: toolbarDocking
|
|
45
|
+
},
|
|
46
|
+
eventType: EVENT_TYPE.TRACK
|
|
47
|
+
})(tr);
|
|
51
48
|
return tr;
|
|
52
49
|
};
|
|
53
50
|
};
|
|
@@ -202,7 +202,7 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
|
|
|
202
202
|
if (fg('platform_editor_use_preferences_plugin')) {
|
|
203
203
|
return null;
|
|
204
204
|
}
|
|
205
|
-
if (!isPreferenceInitialized && editorExperiment('platform_editor_controls', 'variant1')
|
|
205
|
+
if (!isPreferenceInitialized && editorExperiment('platform_editor_controls', 'variant1')) {
|
|
206
206
|
var toolbarDockingPreference = userPreferencesProvider === null || userPreferencesProvider === void 0 ? void 0 : userPreferencesProvider.getPreference('toolbarDockingInitialPosition');
|
|
207
207
|
if (toolbarDockingPreference !== undefined) {
|
|
208
208
|
var _api$analytics2;
|
|
@@ -259,7 +259,7 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
|
|
|
259
259
|
// do not show the toolbar.
|
|
260
260
|
return;
|
|
261
261
|
}
|
|
262
|
-
if (isCellSelection && isEditorControlsEnabled
|
|
262
|
+
if (isCellSelection && isEditorControlsEnabled) {
|
|
263
263
|
var _api$blockControls;
|
|
264
264
|
var isSelectedViaDragHandle = api === null || api === void 0 || (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 || (_api$blockControls = _api$blockControls.sharedState.currentState()) === null || _api$blockControls === void 0 ? void 0 : _api$blockControls.isSelectedViaDragHandle;
|
|
265
265
|
if (isSelectedViaDragHandle) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-toolbar",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.4",
|
|
4
4
|
"description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
".": "./src/index.ts"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@atlaskit/css": "^0.
|
|
36
|
+
"@atlaskit/css": "^0.11.0",
|
|
37
37
|
"@atlaskit/editor-common": "^107.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
39
39
|
"@atlaskit/editor-plugin-block-controls": "^3.19.0",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"@atlaskit/icon-lab": "^5.0.0",
|
|
47
47
|
"@atlaskit/menu": "^8.0.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
49
|
-
"@atlaskit/tmp-editor-statsig": "^7.
|
|
50
|
-
"@atlaskit/tokens": "^5.
|
|
49
|
+
"@atlaskit/tmp-editor-statsig": "^7.2.0",
|
|
50
|
+
"@atlaskit/tokens": "^5.3.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
52
52
|
"bind-event-listener": "^3.0.0"
|
|
53
53
|
},
|
|
@@ -100,15 +100,9 @@
|
|
|
100
100
|
"platform_editor_user_preferences_provider_update": {
|
|
101
101
|
"type": "boolean"
|
|
102
102
|
},
|
|
103
|
-
"platform_editor_controls_patch_2": {
|
|
104
|
-
"type": "boolean"
|
|
105
|
-
},
|
|
106
103
|
"platform_editor_controls_patch_4": {
|
|
107
104
|
"type": "boolean"
|
|
108
105
|
},
|
|
109
|
-
"platform_editor_controls_patch_5": {
|
|
110
|
-
"type": "boolean"
|
|
111
|
-
},
|
|
112
106
|
"platform_editor_use_preferences_plugin": {
|
|
113
107
|
"type": "boolean"
|
|
114
108
|
},
|