@atlaskit/editor-plugin-toolbar 19.0.10 → 20.0.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,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-toolbar
|
|
2
2
|
|
|
3
|
+
## 20.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 19.0.11
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`feeef61c773db`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/feeef61c773db) -
|
|
14
|
+
Clean up feature gate `platform_editor_blocks_patch_7`
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 19.0.10
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -15,7 +15,6 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
15
15
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
16
16
|
var _editorToolbarModel = require("@atlaskit/editor-toolbar-model");
|
|
17
17
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
18
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
19
18
|
var _selectionToolbarOpenExperience = require("./pm-plugins/experiences/selection-toolbar-open-experience");
|
|
20
19
|
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
21
20
|
var _consts = require("./ui/consts");
|
|
@@ -203,8 +202,8 @@ var toolbarPlugin = exports.toolbarPlugin = function toolbarPlugin(_ref) {
|
|
|
203
202
|
// Prevent outside clicks from reopening a blurred editor's toolbar.
|
|
204
203
|
var _editorViewModePlugin = api === null || api === void 0 || (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.sharedState.currentState();
|
|
205
204
|
var _isViewModeEnabled = (_editorViewModePlugin === null || _editorViewModePlugin === void 0 ? void 0 : _editorViewModePlugin.mode) === 'view';
|
|
206
|
-
// Include focus in nested editable islands
|
|
207
|
-
var _hasEditorFocus =
|
|
205
|
+
// Include focus in nested editable islands.
|
|
206
|
+
var _hasEditorFocus = _view.hasFocus() || _view.dom.contains(_view.root.activeElement);
|
|
208
207
|
var shouldShowToolbar = _isViewModeEnabled ? isMouseUpInEditor || isMouseUpInOwnedToolbar : _hasEditorFocus || isMouseUpInOwnedToolbar;
|
|
209
208
|
var currentShouldShowToolbar = api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || (_api$toolbar = _api$toolbar.sharedState.currentState()) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.shouldShowToolbar;
|
|
210
209
|
if (currentShouldShowToolbar !== shouldShowToolbar) {
|
|
@@ -225,7 +224,7 @@ var toolbarPlugin = exports.toolbarPlugin = function toolbarPlugin(_ref) {
|
|
|
225
224
|
// Focus can sit inside a nested editable region ProseMirror does not own -
|
|
226
225
|
// such as a reference synced block's island - where `view.hasFocus()` is
|
|
227
226
|
// false but the user is still interacting with the editor.
|
|
228
|
-
var hasEditorFocus =
|
|
227
|
+
var hasEditorFocus = _view.hasFocus() || _view.dom.contains(_view.root.activeElement);
|
|
229
228
|
_view.dispatch(_view.state.tr.setMeta(_pluginKey.editorToolbarPluginKey, {
|
|
230
229
|
shouldShowToolbar: !isViewModeEnabled ? hasEditorFocus || isInToolbar || isInPortal : true
|
|
231
230
|
}));
|
|
@@ -5,7 +5,6 @@ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
5
5
|
import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import { createComponentRegistry } from '@atlaskit/editor-toolbar-model';
|
|
7
7
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
9
8
|
import { getSelectionToolbarOpenExperiencePlugin } from './pm-plugins/experiences/selection-toolbar-open-experience';
|
|
10
9
|
import { editorToolbarPluginKey } from './pm-plugins/plugin-key';
|
|
11
10
|
import { DEFAULT_POPUP_SELECTORS } from './ui/consts';
|
|
@@ -195,8 +194,8 @@ export const toolbarPlugin = ({
|
|
|
195
194
|
// Prevent outside clicks from reopening a blurred editor's toolbar.
|
|
196
195
|
const editorViewModePlugin = api === null || api === void 0 ? void 0 : (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.sharedState.currentState();
|
|
197
196
|
const isViewModeEnabled = (editorViewModePlugin === null || editorViewModePlugin === void 0 ? void 0 : editorViewModePlugin.mode) === 'view';
|
|
198
|
-
// Include focus in nested editable islands
|
|
199
|
-
const hasEditorFocus =
|
|
197
|
+
// Include focus in nested editable islands.
|
|
198
|
+
const hasEditorFocus = view.hasFocus() || view.dom.contains(view.root.activeElement);
|
|
200
199
|
const shouldShowToolbar = isViewModeEnabled ? isMouseUpInEditor || isMouseUpInOwnedToolbar : hasEditorFocus || isMouseUpInOwnedToolbar;
|
|
201
200
|
const currentShouldShowToolbar = api === null || api === void 0 ? void 0 : (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : (_api$toolbar$sharedSt = _api$toolbar.sharedState.currentState()) === null || _api$toolbar$sharedSt === void 0 ? void 0 : _api$toolbar$sharedSt.shouldShowToolbar;
|
|
202
201
|
if (currentShouldShowToolbar !== shouldShowToolbar) {
|
|
@@ -217,7 +216,7 @@ export const toolbarPlugin = ({
|
|
|
217
216
|
// Focus can sit inside a nested editable region ProseMirror does not own -
|
|
218
217
|
// such as a reference synced block's island - where `view.hasFocus()` is
|
|
219
218
|
// false but the user is still interacting with the editor.
|
|
220
|
-
const hasEditorFocus =
|
|
219
|
+
const hasEditorFocus = view.hasFocus() || view.dom.contains(view.root.activeElement);
|
|
221
220
|
view.dispatch(view.state.tr.setMeta(editorToolbarPluginKey, {
|
|
222
221
|
shouldShowToolbar: !isViewModeEnabled ? hasEditorFocus || isInToolbar || isInPortal : true
|
|
223
222
|
}));
|
|
@@ -11,7 +11,6 @@ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
11
11
|
import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
12
12
|
import { createComponentRegistry } from '@atlaskit/editor-toolbar-model';
|
|
13
13
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
14
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
15
14
|
import { getSelectionToolbarOpenExperiencePlugin } from './pm-plugins/experiences/selection-toolbar-open-experience';
|
|
16
15
|
import { editorToolbarPluginKey } from './pm-plugins/plugin-key';
|
|
17
16
|
import { DEFAULT_POPUP_SELECTORS } from './ui/consts';
|
|
@@ -196,8 +195,8 @@ export var toolbarPlugin = function toolbarPlugin(_ref) {
|
|
|
196
195
|
// Prevent outside clicks from reopening a blurred editor's toolbar.
|
|
197
196
|
var _editorViewModePlugin = api === null || api === void 0 || (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.sharedState.currentState();
|
|
198
197
|
var _isViewModeEnabled = (_editorViewModePlugin === null || _editorViewModePlugin === void 0 ? void 0 : _editorViewModePlugin.mode) === 'view';
|
|
199
|
-
// Include focus in nested editable islands
|
|
200
|
-
var _hasEditorFocus =
|
|
198
|
+
// Include focus in nested editable islands.
|
|
199
|
+
var _hasEditorFocus = _view.hasFocus() || _view.dom.contains(_view.root.activeElement);
|
|
201
200
|
var shouldShowToolbar = _isViewModeEnabled ? isMouseUpInEditor || isMouseUpInOwnedToolbar : _hasEditorFocus || isMouseUpInOwnedToolbar;
|
|
202
201
|
var currentShouldShowToolbar = api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || (_api$toolbar = _api$toolbar.sharedState.currentState()) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.shouldShowToolbar;
|
|
203
202
|
if (currentShouldShowToolbar !== shouldShowToolbar) {
|
|
@@ -218,7 +217,7 @@ export var toolbarPlugin = function toolbarPlugin(_ref) {
|
|
|
218
217
|
// Focus can sit inside a nested editable region ProseMirror does not own -
|
|
219
218
|
// such as a reference synced block's island - where `view.hasFocus()` is
|
|
220
219
|
// false but the user is still interacting with the editor.
|
|
221
|
-
var hasEditorFocus =
|
|
220
|
+
var hasEditorFocus = _view.hasFocus() || _view.dom.contains(_view.root.activeElement);
|
|
222
221
|
_view.dispatch(_view.state.tr.setMeta(editorToolbarPluginKey, {
|
|
223
222
|
shouldShowToolbar: !isViewModeEnabled ? hasEditorFocus || isInToolbar || isInPortal : true
|
|
224
223
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-toolbar",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.0",
|
|
4
4
|
"description": "Toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -21,33 +21,26 @@
|
|
|
21
21
|
"atlaskit:src": "src/index.ts",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@atlaskit/browser-apis": "^1.2.0",
|
|
24
|
-
"@atlaskit/editor-plugin-analytics": "^
|
|
25
|
-
"@atlaskit/editor-plugin-connectivity": "^
|
|
26
|
-
"@atlaskit/editor-plugin-editor-viewmode": "^
|
|
27
|
-
"@atlaskit/editor-plugin-selection": "^
|
|
28
|
-
"@atlaskit/editor-plugin-user-intent": "^
|
|
29
|
-
"@atlaskit/editor-plugin-user-preferences": "^
|
|
24
|
+
"@atlaskit/editor-plugin-analytics": "^23.0.0",
|
|
25
|
+
"@atlaskit/editor-plugin-connectivity": "^23.0.0",
|
|
26
|
+
"@atlaskit/editor-plugin-editor-viewmode": "^25.0.0",
|
|
27
|
+
"@atlaskit/editor-plugin-selection": "^23.0.0",
|
|
28
|
+
"@atlaskit/editor-plugin-user-intent": "^21.0.0",
|
|
29
|
+
"@atlaskit/editor-plugin-user-preferences": "^21.0.0",
|
|
30
30
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
31
31
|
"@atlaskit/editor-shared-styles": "^4.3.0",
|
|
32
32
|
"@atlaskit/editor-toolbar": "^2.8.0",
|
|
33
33
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
34
34
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
35
|
-
"@atlaskit/
|
|
36
|
-
"@atlaskit/tmp-editor-statsig": "^218.0.0",
|
|
35
|
+
"@atlaskit/tmp-editor-statsig": "^219.0.0",
|
|
37
36
|
"@babel/runtime": "^7.0.0",
|
|
38
37
|
"bind-event-listener": "^3.0.0"
|
|
39
38
|
},
|
|
40
39
|
"peerDependencies": {
|
|
41
|
-
"@atlaskit/editor-common": "^
|
|
40
|
+
"@atlaskit/editor-common": "^127.0.0",
|
|
42
41
|
"react": "^18.2.0 || ^19.2.0",
|
|
43
42
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
44
43
|
},
|
|
45
|
-
"platform-feature-flags": {
|
|
46
|
-
"platform_editor_blocks_patch_7": {
|
|
47
|
-
"type": "boolean",
|
|
48
|
-
"referenceOnly": true
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
44
|
"devDependencies": {
|
|
52
45
|
"react": "^19.2.0",
|
|
53
46
|
"react-intl": "^7.0.0"
|