@atlaskit/editor-plugin-block-controls 17.1.5 → 17.2.1
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/main.js +2 -1
- package/dist/cjs/ui/block-controls-left-surfaces.js +2 -2
- package/dist/es2019/pm-plugins/main.js +2 -1
- package/dist/es2019/ui/block-controls-left-surfaces.js +1 -1
- package/dist/esm/pm-plugins/main.js +2 -1
- package/dist/esm/ui/block-controls-left-surfaces.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 17.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c5ff0c329170a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c5ff0c329170a) -
|
|
8
|
+
Add a dedicated createSurfaceContext entrypoint and use it in editor runtime packages.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 17.2.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`dce725fd04593`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dce725fd04593) -
|
|
16
|
+
[ux] make right block nudge remix stable gated by cc-ce-maui-remix-menu-multivariant
|
|
17
|
+
|
|
3
18
|
## 17.1.5
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -1137,11 +1137,12 @@ var createPlugin = exports.createPlugin = function createPlugin(api, getIntl, no
|
|
|
1137
1137
|
var _api$core2;
|
|
1138
1138
|
// Focus moving into the registry surface remains inside the editor experience.
|
|
1139
1139
|
var isChildOfSurface = !flags.legacyDragHandleEnabled && event.relatedTarget instanceof HTMLElement && event.relatedTarget.closest(_consts.BLOCK_CONTROLS_SURFACE_SELECTOR) !== null;
|
|
1140
|
+
var shouldPreserveRemixInlineDropdownFocus = event.relatedTarget instanceof HTMLElement && event.relatedTarget.closest('[data-editor-remix-inline-dropdown-preserve-focus]') !== null;
|
|
1140
1141
|
var isChildOfEditor = event.relatedTarget instanceof HTMLElement && event.relatedTarget.closest("#".concat(_ui.EDIT_AREA_ID)) !== null;
|
|
1141
1142
|
|
|
1142
1143
|
// don't do anything if the event relatedTarget (the element receiving focus) is a child of the editor
|
|
1143
1144
|
// or if the editor has focus
|
|
1144
|
-
if (isChildOfEditor || isChildOfSurface || view.hasFocus()) {
|
|
1145
|
+
if (isChildOfEditor || isChildOfSurface || shouldPreserveRemixInlineDropdownFocus || view.hasFocus()) {
|
|
1145
1146
|
return false;
|
|
1146
1147
|
}
|
|
1147
1148
|
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(function (_ref6) {
|
|
@@ -16,7 +16,7 @@ var _browserApis = require("@atlaskit/browser-apis");
|
|
|
16
16
|
var _blockControlUiContext = require("@atlaskit/editor-common/block-controls/block-control-ui-context");
|
|
17
17
|
var _surfaceKeys = require("@atlaskit/editor-common/block-controls/surface-keys");
|
|
18
18
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
19
|
-
var
|
|
19
|
+
var _createSurfaceContext = require("@atlaskit/editor-ui-control-model/create-surface-context");
|
|
20
20
|
var _decorationsCommon = require("../pm-plugins/decorations-common");
|
|
21
21
|
var _blockControlsSurfaceContext = require("./block-controls-surface-context");
|
|
22
22
|
var _blockControlsLeftSurface = require("./block-controls-left-surface");
|
|
@@ -54,7 +54,7 @@ var BlockControlsLeftSurfaces = exports.BlockControlsLeftSurfaces = function Blo
|
|
|
54
54
|
if (!context) {
|
|
55
55
|
return [];
|
|
56
56
|
}
|
|
57
|
-
var surfaceContext = (0,
|
|
57
|
+
var surfaceContext = (0, _createSurfaceContext.createSurfaceContext)(_blockControlUiContext.BLOCK_CONTROL_UI_CONTEXT, context);
|
|
58
58
|
return [_objectSpread(_objectSpread({}, target), {}, {
|
|
59
59
|
blockControlsContext: context,
|
|
60
60
|
surfaceContext: surfaceContext
|
|
@@ -1042,11 +1042,12 @@ export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI, nodeDecora
|
|
|
1042
1042
|
var _api$core2;
|
|
1043
1043
|
// Focus moving into the registry surface remains inside the editor experience.
|
|
1044
1044
|
const isChildOfSurface = !flags.legacyDragHandleEnabled && event.relatedTarget instanceof HTMLElement && event.relatedTarget.closest(BLOCK_CONTROLS_SURFACE_SELECTOR) !== null;
|
|
1045
|
+
const shouldPreserveRemixInlineDropdownFocus = event.relatedTarget instanceof HTMLElement && event.relatedTarget.closest('[data-editor-remix-inline-dropdown-preserve-focus]') !== null;
|
|
1045
1046
|
const isChildOfEditor = event.relatedTarget instanceof HTMLElement && event.relatedTarget.closest(`#${EDIT_AREA_ID}`) !== null;
|
|
1046
1047
|
|
|
1047
1048
|
// don't do anything if the event relatedTarget (the element receiving focus) is a child of the editor
|
|
1048
1049
|
// or if the editor has focus
|
|
1049
|
-
if (isChildOfEditor || isChildOfSurface || view.hasFocus()) {
|
|
1050
|
+
if (isChildOfEditor || isChildOfSurface || shouldPreserveRemixInlineDropdownFocus || view.hasFocus()) {
|
|
1050
1051
|
return false;
|
|
1051
1052
|
}
|
|
1052
1053
|
api === null || api === void 0 ? void 0 : (_api$core2 = api.core) === null || _api$core2 === void 0 ? void 0 : _api$core2.actions.execute(({
|
|
@@ -6,7 +6,7 @@ import { getDocument } from '@atlaskit/browser-apis';
|
|
|
6
6
|
import { BLOCK_CONTROL_UI_CONTEXT } from '@atlaskit/editor-common/block-controls/block-control-ui-context';
|
|
7
7
|
import { BLOCK_CONTROLS_LEFT_SURFACE } from '@atlaskit/editor-common/block-controls/surface-keys';
|
|
8
8
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
9
|
-
import { createSurfaceContext } from '@atlaskit/editor-ui-control-model/
|
|
9
|
+
import { createSurfaceContext } from '@atlaskit/editor-ui-control-model/create-surface-context';
|
|
10
10
|
import { getNodeTypeWithLevel } from '../pm-plugins/decorations-common';
|
|
11
11
|
import { createBlockControlsSurfaceContext, createBlockControlsSurfaceContextForPosition } from './block-controls-surface-context';
|
|
12
12
|
import { BlockControlsLeftSurface } from './block-controls-left-surface';
|
|
@@ -1131,11 +1131,12 @@ export var createPlugin = function createPlugin(api, getIntl, nodeViewPortalProv
|
|
|
1131
1131
|
var _api$core2;
|
|
1132
1132
|
// Focus moving into the registry surface remains inside the editor experience.
|
|
1133
1133
|
var isChildOfSurface = !flags.legacyDragHandleEnabled && event.relatedTarget instanceof HTMLElement && event.relatedTarget.closest(BLOCK_CONTROLS_SURFACE_SELECTOR) !== null;
|
|
1134
|
+
var shouldPreserveRemixInlineDropdownFocus = event.relatedTarget instanceof HTMLElement && event.relatedTarget.closest('[data-editor-remix-inline-dropdown-preserve-focus]') !== null;
|
|
1134
1135
|
var isChildOfEditor = event.relatedTarget instanceof HTMLElement && event.relatedTarget.closest("#".concat(EDIT_AREA_ID)) !== null;
|
|
1135
1136
|
|
|
1136
1137
|
// don't do anything if the event relatedTarget (the element receiving focus) is a child of the editor
|
|
1137
1138
|
// or if the editor has focus
|
|
1138
|
-
if (isChildOfEditor || isChildOfSurface || view.hasFocus()) {
|
|
1139
|
+
if (isChildOfEditor || isChildOfSurface || shouldPreserveRemixInlineDropdownFocus || view.hasFocus()) {
|
|
1139
1140
|
return false;
|
|
1140
1141
|
}
|
|
1141
1142
|
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(function (_ref6) {
|
|
@@ -13,7 +13,7 @@ import { getDocument } from '@atlaskit/browser-apis';
|
|
|
13
13
|
import { BLOCK_CONTROL_UI_CONTEXT } from '@atlaskit/editor-common/block-controls/block-control-ui-context';
|
|
14
14
|
import { BLOCK_CONTROLS_LEFT_SURFACE } from '@atlaskit/editor-common/block-controls/surface-keys';
|
|
15
15
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
16
|
-
import { createSurfaceContext } from '@atlaskit/editor-ui-control-model/
|
|
16
|
+
import { createSurfaceContext } from '@atlaskit/editor-ui-control-model/create-surface-context';
|
|
17
17
|
import { getNodeTypeWithLevel } from '../pm-plugins/decorations-common';
|
|
18
18
|
import { createBlockControlsSurfaceContext, createBlockControlsSurfaceContextForPosition } from './block-controls-surface-context';
|
|
19
19
|
import { BlockControlsLeftSurface } from './block-controls-left-surface';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "17.1
|
|
3
|
+
"version": "17.2.1",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
44
44
|
"@atlaskit/editor-shared-styles": "^4.0.0",
|
|
45
45
|
"@atlaskit/editor-tables": "^3.0.0",
|
|
46
|
-
"@atlaskit/editor-ui-control-model": "^2.
|
|
46
|
+
"@atlaskit/editor-ui-control-model": "^2.9.0",
|
|
47
47
|
"@atlaskit/icon": "^37.5.0",
|
|
48
48
|
"@atlaskit/icon-lab": "^7.7.0",
|
|
49
49
|
"@atlaskit/link": "^5.1.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@atlaskit/primitives": "^22.4.0",
|
|
56
56
|
"@atlaskit/section-message": "^10.1.0",
|
|
57
57
|
"@atlaskit/theme": "^28.1.0",
|
|
58
|
-
"@atlaskit/tmp-editor-statsig": "^164.
|
|
58
|
+
"@atlaskit/tmp-editor-statsig": "^164.1.0",
|
|
59
59
|
"@atlaskit/tokens": "^16.8.0",
|
|
60
60
|
"@atlaskit/tooltip": "^24.2.0",
|
|
61
61
|
"@babel/runtime": "^7.0.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"uuid": "^3.1.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@atlaskit/editor-common": "^120.
|
|
70
|
+
"@atlaskit/editor-common": "^120.6.0",
|
|
71
71
|
"react": "^18.2.0 || ^19.2.0",
|
|
72
72
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
73
73
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|