@atlaskit/editor-plugin-block-controls 4.1.3 → 4.1.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
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 4.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c08b561ac933b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c08b561ac933b) -
|
|
8
|
+
[ux] Fixes a regression where isSelectedViaDragHandle state wasn't updated correctly.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 4.1.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -251,7 +251,8 @@ var _apply = exports.apply = function apply(api, formatMessage, tr, currentState
|
|
|
251
251
|
menuTriggerBy = currentState.menuTriggerBy,
|
|
252
252
|
isPMDragging = currentState.isPMDragging,
|
|
253
253
|
isShiftDown = currentState.isShiftDown,
|
|
254
|
-
lastDragCancelled = currentState.lastDragCancelled
|
|
254
|
+
lastDragCancelled = currentState.lastDragCancelled,
|
|
255
|
+
isSelectedViaDragHandle = currentState.isSelectedViaDragHandle;
|
|
255
256
|
var isActiveNodeDeleted = false;
|
|
256
257
|
var _getTrMetadata = (0, _transactions.getTrMetadata)(tr),
|
|
257
258
|
from = _getTrMetadata.from,
|
|
@@ -513,7 +514,12 @@ var _apply = exports.apply = function apply(api, formatMessage, tr, currentState
|
|
|
513
514
|
} else if (meta !== null && meta !== void 0 && meta.toggleMenu) {
|
|
514
515
|
isMenuOpenNew = !isMenuOpen;
|
|
515
516
|
}
|
|
516
|
-
var
|
|
517
|
+
var isSelectedViaDragHandleNew;
|
|
518
|
+
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _expValEquals.expValEquals)('platform_editor_controls_block_controls_state_fix', 'isEnabled', true)) {
|
|
519
|
+
isSelectedViaDragHandleNew = (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle) !== undefined ? meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle : isSelectedViaDragHandle;
|
|
520
|
+
} else {
|
|
521
|
+
isSelectedViaDragHandleNew = (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle) !== undefined && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle);
|
|
522
|
+
}
|
|
517
523
|
return {
|
|
518
524
|
decorations: decorations,
|
|
519
525
|
activeNode: newActiveNode,
|
|
@@ -530,7 +536,7 @@ var _apply = exports.apply = function apply(api, formatMessage, tr, currentState
|
|
|
530
536
|
multiSelectDnD: multiSelectDnD,
|
|
531
537
|
isShiftDown: (_meta$isShiftDown = meta === null || meta === void 0 ? void 0 : meta.isShiftDown) !== null && _meta$isShiftDown !== void 0 ? _meta$isShiftDown : isShiftDown,
|
|
532
538
|
lastDragCancelled: (_meta$lastDragCancell = meta === null || meta === void 0 ? void 0 : meta.lastDragCancelled) !== null && _meta$lastDragCancell !== void 0 ? _meta$lastDragCancell : lastDragCancelled,
|
|
533
|
-
isSelectedViaDragHandle:
|
|
539
|
+
isSelectedViaDragHandle: isSelectedViaDragHandleNew
|
|
534
540
|
};
|
|
535
541
|
};
|
|
536
542
|
var createPlugin = exports.createPlugin = function createPlugin(api, getIntl, nodeViewPortalProviderAPI) {
|
|
@@ -250,7 +250,8 @@ export const apply = (api, formatMessage, tr, currentState, newState, flags, nod
|
|
|
250
250
|
menuTriggerBy,
|
|
251
251
|
isPMDragging,
|
|
252
252
|
isShiftDown,
|
|
253
|
-
lastDragCancelled
|
|
253
|
+
lastDragCancelled,
|
|
254
|
+
isSelectedViaDragHandle
|
|
254
255
|
} = currentState;
|
|
255
256
|
let isActiveNodeDeleted = false;
|
|
256
257
|
const {
|
|
@@ -513,7 +514,12 @@ export const apply = (api, formatMessage, tr, currentState, newState, flags, nod
|
|
|
513
514
|
} else if (meta !== null && meta !== void 0 && meta.toggleMenu) {
|
|
514
515
|
isMenuOpenNew = !isMenuOpen;
|
|
515
516
|
}
|
|
516
|
-
|
|
517
|
+
let isSelectedViaDragHandleNew;
|
|
518
|
+
if (editorExperiment('platform_editor_controls', 'variant1') && expValEquals('platform_editor_controls_block_controls_state_fix', 'isEnabled', true)) {
|
|
519
|
+
isSelectedViaDragHandleNew = (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle) !== undefined ? meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle : isSelectedViaDragHandle;
|
|
520
|
+
} else {
|
|
521
|
+
isSelectedViaDragHandleNew = (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle) !== undefined && editorExperiment('platform_editor_controls', 'variant1') && (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle);
|
|
522
|
+
}
|
|
517
523
|
return {
|
|
518
524
|
decorations,
|
|
519
525
|
activeNode: newActiveNode,
|
|
@@ -530,7 +536,7 @@ export const apply = (api, formatMessage, tr, currentState, newState, flags, nod
|
|
|
530
536
|
multiSelectDnD,
|
|
531
537
|
isShiftDown: (_meta$isShiftDown = meta === null || meta === void 0 ? void 0 : meta.isShiftDown) !== null && _meta$isShiftDown !== void 0 ? _meta$isShiftDown : isShiftDown,
|
|
532
538
|
lastDragCancelled: (_meta$lastDragCancell = meta === null || meta === void 0 ? void 0 : meta.lastDragCancelled) !== null && _meta$lastDragCancell !== void 0 ? _meta$lastDragCancell : lastDragCancelled,
|
|
533
|
-
isSelectedViaDragHandle
|
|
539
|
+
isSelectedViaDragHandle: isSelectedViaDragHandleNew
|
|
534
540
|
};
|
|
535
541
|
};
|
|
536
542
|
export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI) => {
|
|
@@ -244,7 +244,8 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
|
|
|
244
244
|
menuTriggerBy = currentState.menuTriggerBy,
|
|
245
245
|
isPMDragging = currentState.isPMDragging,
|
|
246
246
|
isShiftDown = currentState.isShiftDown,
|
|
247
|
-
lastDragCancelled = currentState.lastDragCancelled
|
|
247
|
+
lastDragCancelled = currentState.lastDragCancelled,
|
|
248
|
+
isSelectedViaDragHandle = currentState.isSelectedViaDragHandle;
|
|
248
249
|
var isActiveNodeDeleted = false;
|
|
249
250
|
var _getTrMetadata = getTrMetadata(tr),
|
|
250
251
|
from = _getTrMetadata.from,
|
|
@@ -506,7 +507,12 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
|
|
|
506
507
|
} else if (meta !== null && meta !== void 0 && meta.toggleMenu) {
|
|
507
508
|
isMenuOpenNew = !isMenuOpen;
|
|
508
509
|
}
|
|
509
|
-
var
|
|
510
|
+
var isSelectedViaDragHandleNew;
|
|
511
|
+
if (editorExperiment('platform_editor_controls', 'variant1') && expValEquals('platform_editor_controls_block_controls_state_fix', 'isEnabled', true)) {
|
|
512
|
+
isSelectedViaDragHandleNew = (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle) !== undefined ? meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle : isSelectedViaDragHandle;
|
|
513
|
+
} else {
|
|
514
|
+
isSelectedViaDragHandleNew = (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle) !== undefined && editorExperiment('platform_editor_controls', 'variant1') && (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle);
|
|
515
|
+
}
|
|
510
516
|
return {
|
|
511
517
|
decorations: decorations,
|
|
512
518
|
activeNode: newActiveNode,
|
|
@@ -523,7 +529,7 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
|
|
|
523
529
|
multiSelectDnD: multiSelectDnD,
|
|
524
530
|
isShiftDown: (_meta$isShiftDown = meta === null || meta === void 0 ? void 0 : meta.isShiftDown) !== null && _meta$isShiftDown !== void 0 ? _meta$isShiftDown : isShiftDown,
|
|
525
531
|
lastDragCancelled: (_meta$lastDragCancell = meta === null || meta === void 0 ? void 0 : meta.lastDragCancelled) !== null && _meta$lastDragCancell !== void 0 ? _meta$lastDragCancell : lastDragCancelled,
|
|
526
|
-
isSelectedViaDragHandle:
|
|
532
|
+
isSelectedViaDragHandle: isSelectedViaDragHandleNew
|
|
527
533
|
};
|
|
528
534
|
};
|
|
529
535
|
export { _apply as apply };
|
|
@@ -28,6 +28,6 @@ export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | und
|
|
|
28
28
|
multiSelectDnD: import("../blockControlsPluginType").MultiSelectDnD | undefined;
|
|
29
29
|
isShiftDown: any;
|
|
30
30
|
lastDragCancelled: any;
|
|
31
|
-
isSelectedViaDragHandle:
|
|
31
|
+
isSelectedViaDragHandle: any;
|
|
32
32
|
};
|
|
33
33
|
export declare const createPlugin: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<PluginState>;
|
|
@@ -28,6 +28,6 @@ export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | und
|
|
|
28
28
|
multiSelectDnD: import("../blockControlsPluginType").MultiSelectDnD | undefined;
|
|
29
29
|
isShiftDown: any;
|
|
30
30
|
lastDragCancelled: any;
|
|
31
|
-
isSelectedViaDragHandle:
|
|
31
|
+
isSelectedViaDragHandle: any;
|
|
32
32
|
};
|
|
33
33
|
export declare const createPlugin: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<PluginState>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.4",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
55
55
|
"@atlaskit/primitives": "^14.11.0",
|
|
56
56
|
"@atlaskit/theme": "^19.0.0",
|
|
57
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
57
|
+
"@atlaskit/tmp-editor-statsig": "^9.21.0",
|
|
58
58
|
"@atlaskit/tokens": "^5.6.0",
|
|
59
59
|
"@atlaskit/tooltip": "^20.4.0",
|
|
60
60
|
"@babel/runtime": "^7.0.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"uuid": "^3.1.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@atlaskit/editor-common": "^107.
|
|
69
|
+
"@atlaskit/editor-common": "^107.16.0",
|
|
70
70
|
"react": "^18.2.0",
|
|
71
71
|
"react-dom": "^18.2.0",
|
|
72
72
|
"react-intl-next": "npm:react-intl@^5.18.1"
|