@atlaskit/editor-plugin-block-controls 8.2.0 → 8.3.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 +15 -0
- package/dist/cjs/pm-plugins/decorations-drop-target.js +2 -2
- package/dist/cjs/ui/drag-handle.js +1 -1
- package/dist/es2019/pm-plugins/decorations-drop-target.js +2 -2
- package/dist/es2019/ui/drag-handle.js +1 -1
- package/dist/esm/pm-plugins/decorations-drop-target.js +2 -2
- package/dist/esm/ui/drag-handle.js +1 -1
- package/dist/types/pm-plugins/utils/getSelection.d.ts +2 -2
- package/dist/types/pm-plugins/utils/selection.d.ts +1 -1
- package/dist/types/ui/consts.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/getSelection.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/utils/selection.d.ts +1 -1
- package/dist/types-ts4.5/ui/consts.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 8.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`617747c789f4e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/617747c789f4e) -
|
|
8
|
+
Use correct editorExperiment instead of expVal for evaluating platform_synced_block
|
|
9
|
+
|
|
10
|
+
## 8.2.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`280d14e2d5518`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/280d14e2d5518) -
|
|
15
|
+
Clean up platform_editor_drag_handle_aria_label
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 8.2.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
|
@@ -46,7 +46,7 @@ var shouldCollapseMargin = function shouldCollapseMargin(prevNode, nextNode) {
|
|
|
46
46
|
return true;
|
|
47
47
|
};
|
|
48
48
|
var getGapAndOffset = function getGapAndOffset(prevNode, nextNode, parentNode) {
|
|
49
|
-
var isSyncBlockOffsetPatchEnabled = (0,
|
|
49
|
+
var isSyncBlockOffsetPatchEnabled = (0, _experiments.editorExperiment)('platform_synced_block', true) && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_2');
|
|
50
50
|
if (!prevNode && nextNode) {
|
|
51
51
|
// first node - adjust for bodied containers
|
|
52
52
|
var _offset = 0;
|
|
@@ -256,7 +256,7 @@ var dropTargetDecorations = exports.dropTargetDecorations = function dropTargetD
|
|
|
256
256
|
return false; //not valid pos, so nested not valid either
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
|
-
var parentTypesWithEndDropTarget = (0,
|
|
259
|
+
var parentTypesWithEndDropTarget = (0, _experiments.editorExperiment)('platform_synced_block', true) && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_2') ? PARENT_WITH_END_DROP_TARGET_NEXT : PARENT_WITH_END_DROP_TARGET;
|
|
260
260
|
if (parent.lastChild === node && !(0, _utils.isEmptyParagraph)(node) && parentTypesWithEndDropTarget.includes(parent.type.name)) {
|
|
261
261
|
endPos = pos + node.nodeSize;
|
|
262
262
|
}
|
|
@@ -1123,7 +1123,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref3) {
|
|
|
1123
1123
|
disabled: dragHandleDisabled,
|
|
1124
1124
|
"data-editor-block-ctrl-drag-handle": true,
|
|
1125
1125
|
"data-testid": "block-ctrl-drag-handle",
|
|
1126
|
-
"aria-label":
|
|
1126
|
+
"aria-label": dragHandleAriaLabel,
|
|
1127
1127
|
onBlur: (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) ? function () {
|
|
1128
1128
|
return setIsFocused(false);
|
|
1129
1129
|
} : undefined
|
|
@@ -37,7 +37,7 @@ const shouldCollapseMargin = (prevNode, nextNode) => {
|
|
|
37
37
|
return true;
|
|
38
38
|
};
|
|
39
39
|
const getGapAndOffset = (prevNode, nextNode, parentNode) => {
|
|
40
|
-
const isSyncBlockOffsetPatchEnabled =
|
|
40
|
+
const isSyncBlockOffsetPatchEnabled = editorExperiment('platform_synced_block', true) && fg('platform_synced_block_patch_2');
|
|
41
41
|
if (!prevNode && nextNode) {
|
|
42
42
|
// first node - adjust for bodied containers
|
|
43
43
|
let offset = 0;
|
|
@@ -245,7 +245,7 @@ export const dropTargetDecorations = (newState, api, formatMessage, nodeViewPort
|
|
|
245
245
|
return false; //not valid pos, so nested not valid either
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
const parentTypesWithEndDropTarget =
|
|
248
|
+
const parentTypesWithEndDropTarget = editorExperiment('platform_synced_block', true) && fg('platform_synced_block_patch_2') ? PARENT_WITH_END_DROP_TARGET_NEXT : PARENT_WITH_END_DROP_TARGET;
|
|
249
249
|
if (parent.lastChild === node && !isEmptyParagraph(node) && parentTypesWithEndDropTarget.includes(parent.type.name)) {
|
|
250
250
|
endPos = pos + node.nodeSize;
|
|
251
251
|
}
|
|
@@ -1111,7 +1111,7 @@ export const DragHandle = ({
|
|
|
1111
1111
|
disabled: dragHandleDisabled,
|
|
1112
1112
|
"data-editor-block-ctrl-drag-handle": true,
|
|
1113
1113
|
"data-testid": "block-ctrl-drag-handle",
|
|
1114
|
-
"aria-label":
|
|
1114
|
+
"aria-label": dragHandleAriaLabel,
|
|
1115
1115
|
onBlur: expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) ? () => setIsFocused(false) : undefined
|
|
1116
1116
|
}, jsx(Box, {
|
|
1117
1117
|
xcss: iconWrapperStyles
|
|
@@ -40,7 +40,7 @@ var shouldCollapseMargin = function shouldCollapseMargin(prevNode, nextNode) {
|
|
|
40
40
|
return true;
|
|
41
41
|
};
|
|
42
42
|
var getGapAndOffset = function getGapAndOffset(prevNode, nextNode, parentNode) {
|
|
43
|
-
var isSyncBlockOffsetPatchEnabled =
|
|
43
|
+
var isSyncBlockOffsetPatchEnabled = editorExperiment('platform_synced_block', true) && fg('platform_synced_block_patch_2');
|
|
44
44
|
if (!prevNode && nextNode) {
|
|
45
45
|
// first node - adjust for bodied containers
|
|
46
46
|
var _offset = 0;
|
|
@@ -250,7 +250,7 @@ export var dropTargetDecorations = function dropTargetDecorations(newState, api,
|
|
|
250
250
|
return false; //not valid pos, so nested not valid either
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
|
-
var parentTypesWithEndDropTarget =
|
|
253
|
+
var parentTypesWithEndDropTarget = editorExperiment('platform_synced_block', true) && fg('platform_synced_block_patch_2') ? PARENT_WITH_END_DROP_TARGET_NEXT : PARENT_WITH_END_DROP_TARGET;
|
|
254
254
|
if (parent.lastChild === node && !isEmptyParagraph(node) && parentTypesWithEndDropTarget.includes(parent.type.name)) {
|
|
255
255
|
endPos = pos + node.nodeSize;
|
|
256
256
|
}
|
|
@@ -1120,7 +1120,7 @@ export var DragHandle = function DragHandle(_ref3) {
|
|
|
1120
1120
|
disabled: dragHandleDisabled,
|
|
1121
1121
|
"data-editor-block-ctrl-drag-handle": true,
|
|
1122
1122
|
"data-testid": "block-ctrl-drag-handle",
|
|
1123
|
-
"aria-label":
|
|
1123
|
+
"aria-label": dragHandleAriaLabel,
|
|
1124
1124
|
onBlur: expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) ? function () {
|
|
1125
1125
|
return setIsFocused(false);
|
|
1126
1126
|
} : undefined
|
|
@@ -15,8 +15,8 @@ export declare const isNodeWithCodeBlock: (tr: Transaction, start: number, nodeS
|
|
|
15
15
|
* @param start The start position of the node.
|
|
16
16
|
* @returns The appropriate selection for the node.
|
|
17
17
|
*/
|
|
18
|
-
export declare const newGetSelection: (doc: PMNode, selectionEmpty: boolean, start: number) => false |
|
|
19
|
-
export declare const getSelection: (tr: Transaction, start: number, api?: ExtractInjectionAPI<BlockControlsPlugin>) => false |
|
|
18
|
+
export declare const newGetSelection: (doc: PMNode, selectionEmpty: boolean, start: number) => false | NodeSelection | TextSelection;
|
|
19
|
+
export declare const getSelection: (tr: Transaction, start: number, api?: ExtractInjectionAPI<BlockControlsPlugin>) => false | NodeSelection | TextSelection;
|
|
20
20
|
export declare const selectNode: (tr: Transaction, start: number, nodeType: string, api?: ExtractInjectionAPI<BlockControlsPlugin>) => Transaction;
|
|
21
21
|
export declare const setCursorPositionAtMovedNode: (tr: Transaction, start: number, api?: ExtractInjectionAPI<BlockControlsPlugin>) => Transaction;
|
|
22
22
|
/**
|
|
@@ -66,4 +66,4 @@ export declare const adjustSelectionBoundsForEdgePositions: ($from: ResolvedPos,
|
|
|
66
66
|
* @param $to The resolved position of the end of the selection
|
|
67
67
|
* @returns A Selection or undefined if selection is invalid
|
|
68
68
|
*/
|
|
69
|
-
export declare const createPreservedSelection: ($from: ResolvedPos, $to: ResolvedPos) => import("@atlaskit/editor-tables").CellSelection |
|
|
69
|
+
export declare const createPreservedSelection: ($from: ResolvedPos, $to: ResolvedPos) => NodeSelection | TextSelection | import("@atlaskit/editor-tables").CellSelection | undefined;
|
|
@@ -32,7 +32,7 @@ export declare const QUICK_INSERT_DIMENSIONS: {
|
|
|
32
32
|
export declare const QUICK_INSERT_LEFT_OFFSET = 16;
|
|
33
33
|
export declare const dragHandleGap: (nodeType: string, parentNodeType?: string) => number;
|
|
34
34
|
export declare const rootElementGap: (nodeType: string) => number;
|
|
35
|
-
export declare const getNestedNodeLeftPaddingMargin: (nodeType?: string) => "
|
|
35
|
+
export declare const getNestedNodeLeftPaddingMargin: (nodeType?: string) => "8px" | "16px" | "20px" | "24px" | "28px" | "40px";
|
|
36
36
|
export declare const topPositionAdjustment: (nodeType: string) => number;
|
|
37
37
|
export declare const dropTargetMarginMap: {
|
|
38
38
|
[key: number]: string;
|
|
@@ -15,8 +15,8 @@ export declare const isNodeWithCodeBlock: (tr: Transaction, start: number, nodeS
|
|
|
15
15
|
* @param start The start position of the node.
|
|
16
16
|
* @returns The appropriate selection for the node.
|
|
17
17
|
*/
|
|
18
|
-
export declare const newGetSelection: (doc: PMNode, selectionEmpty: boolean, start: number) => false |
|
|
19
|
-
export declare const getSelection: (tr: Transaction, start: number, api?: ExtractInjectionAPI<BlockControlsPlugin>) => false |
|
|
18
|
+
export declare const newGetSelection: (doc: PMNode, selectionEmpty: boolean, start: number) => false | NodeSelection | TextSelection;
|
|
19
|
+
export declare const getSelection: (tr: Transaction, start: number, api?: ExtractInjectionAPI<BlockControlsPlugin>) => false | NodeSelection | TextSelection;
|
|
20
20
|
export declare const selectNode: (tr: Transaction, start: number, nodeType: string, api?: ExtractInjectionAPI<BlockControlsPlugin>) => Transaction;
|
|
21
21
|
export declare const setCursorPositionAtMovedNode: (tr: Transaction, start: number, api?: ExtractInjectionAPI<BlockControlsPlugin>) => Transaction;
|
|
22
22
|
/**
|
|
@@ -66,4 +66,4 @@ export declare const adjustSelectionBoundsForEdgePositions: ($from: ResolvedPos,
|
|
|
66
66
|
* @param $to The resolved position of the end of the selection
|
|
67
67
|
* @returns A Selection or undefined if selection is invalid
|
|
68
68
|
*/
|
|
69
|
-
export declare const createPreservedSelection: ($from: ResolvedPos, $to: ResolvedPos) => import("@atlaskit/editor-tables").CellSelection |
|
|
69
|
+
export declare const createPreservedSelection: ($from: ResolvedPos, $to: ResolvedPos) => NodeSelection | TextSelection | import("@atlaskit/editor-tables").CellSelection | undefined;
|
|
@@ -32,7 +32,7 @@ export declare const QUICK_INSERT_DIMENSIONS: {
|
|
|
32
32
|
export declare const QUICK_INSERT_LEFT_OFFSET = 16;
|
|
33
33
|
export declare const dragHandleGap: (nodeType: string, parentNodeType?: string) => number;
|
|
34
34
|
export declare const rootElementGap: (nodeType: string) => number;
|
|
35
|
-
export declare const getNestedNodeLeftPaddingMargin: (nodeType?: string) => "
|
|
35
|
+
export declare const getNestedNodeLeftPaddingMargin: (nodeType?: string) => "8px" | "16px" | "20px" | "24px" | "28px" | "40px";
|
|
36
36
|
export declare const topPositionAdjustment: (nodeType: string) => number;
|
|
37
37
|
export declare const dropTargetMarginMap: {
|
|
38
38
|
[key: number]: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0",
|
|
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": "^18.0.0",
|
|
56
56
|
"@atlaskit/theme": "^21.0.0",
|
|
57
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
57
|
+
"@atlaskit/tmp-editor-statsig": "^23.0.0",
|
|
58
58
|
"@atlaskit/tokens": "^11.0.0",
|
|
59
59
|
"@atlaskit/tooltip": "^20.14.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": "^111.
|
|
69
|
+
"@atlaskit/editor-common": "^111.12.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"
|