@wordpress/block-editor 10.2.0 → 10.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 +12 -0
- package/README.md +41 -0
- package/build/components/block-draggable/draggable-chip.js +4 -2
- package/build/components/block-draggable/draggable-chip.js.map +1 -1
- package/build/components/block-inspector/index.js +4 -4
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-list-compact.native.js +1 -0
- package/build/components/block-list/block-list-compact.native.js.map +1 -1
- package/build/components/block-list/block.js +72 -14
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +79 -12
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +7 -23
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-lock/modal.js +9 -6
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-parent-selector/index.js +3 -3
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-patterns-list/index.js +5 -4
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-popover/drop-zone.js +85 -0
- package/build/components/block-popover/drop-zone.js.map +1 -0
- package/build/components/block-popover/index.js +2 -1
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/auto.js +2 -2
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-preview/index.js +6 -9
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-preview/live.js +3 -7
- package/build/components/block-preview/live.js.map +1 -1
- package/build/components/block-selection-clearer/index.js +9 -1
- package/build/components/block-selection-clearer/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +17 -11
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-styles/index.js +18 -42
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +4 -4
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/back-compat.js +2 -1
- package/build/components/block-tools/back-compat.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +50 -20
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +15 -3
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/colors-gradients/control.js +1 -1
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +2 -2
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +256 -0
- package/build/components/font-sizes/fluid-utils.js.map +1 -0
- package/build/components/font-sizes/index.js +8 -0
- package/build/components/font-sizes/index.js.map +1 -1
- package/build/components/index.js +0 -9
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.js +3 -2
- package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build/components/inserter/block-patterns-tab.js +151 -78
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/menu.js +14 -3
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +4 -2
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js +1 -14
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/preview-options/index.js +2 -3
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js +35 -5
- package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +98 -57
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +12 -12
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-on-block-drop/types.js +6 -0
- package/build/components/use-on-block-drop/types.js.map +1 -0
- package/build/hooks/align.js +1 -3
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/align.native.js +1 -7
- package/build/hooks/align.native.js.map +1 -1
- package/build/hooks/font-size.js +60 -0
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/margin.js +6 -5
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/padding.js +2 -1
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/style.js +126 -4
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/use-typography-props.js +17 -3
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/hooks/utils.js +1 -1
- package/build/hooks/utils.js.map +1 -1
- package/build/store/actions.js +59 -45
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +3 -0
- package/build/store/defaults.js.map +1 -1
- package/build/store/reducer.js +31 -15
- package/build/store/reducer.js.map +1 -1
- package/build/utils/math.js +14 -0
- package/build/utils/math.js.map +1 -1
- package/build/utils/pre-parse-patterns.js +19 -2
- package/build/utils/pre-parse-patterns.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.js +7 -3
- package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
- package/build-module/components/block-inspector/index.js +4 -4
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-list-compact.native.js +1 -0
- package/build-module/components/block-list/block-list-compact.native.js.map +1 -1
- package/build-module/components/block-list/block.js +72 -14
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +80 -13
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +8 -24
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-lock/modal.js +10 -8
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +3 -3
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +5 -4
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-popover/drop-zone.js +70 -0
- package/build-module/components/block-popover/drop-zone.js.map +1 -0
- package/build-module/components/block-popover/index.js +2 -1
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-preview/auto.js +1 -1
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-preview/index.js +6 -9
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-preview/live.js +3 -6
- package/build-module/components/block-preview/live.js.map +1 -1
- package/build-module/components/block-selection-clearer/index.js +9 -1
- package/build-module/components/block-selection-clearer/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +18 -12
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-styles/index.js +19 -44
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +4 -4
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/back-compat.js +2 -1
- package/build-module/components/block-tools/back-compat.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +48 -20
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +15 -3
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +2 -2
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +3 -3
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +245 -0
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -0
- package/build-module/components/font-sizes/index.js +1 -0
- package/build-module/components/font-sizes/index.js.map +1 -1
- package/build-module/components/index.js +0 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js +3 -2
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab.js +148 -81
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/menu.js +10 -3
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +4 -2
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js +1 -14
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/preview-options/index.js +2 -3
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/spacing-input-control.js +34 -5
- package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +98 -58
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +12 -12
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/types.js +2 -0
- package/build-module/components/use-on-block-drop/types.js.map +1 -0
- package/build-module/hooks/align.js +1 -2
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/align.native.js +1 -6
- package/build-module/hooks/align.native.js.map +1 -1
- package/build-module/hooks/font-size.js +59 -1
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/margin.js +6 -5
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/padding.js +2 -1
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/style.js +124 -3
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/use-typography-props.js +17 -4
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/hooks/utils.js +2 -2
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/store/actions.js +55 -42
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +3 -0
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/reducer.js +32 -16
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/utils/math.js +12 -0
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/pre-parse-patterns.js +19 -2
- package/build-module/utils/pre-parse-patterns.js.map +1 -1
- package/build-style/style-rtl.css +243 -144
- package/build-style/style.css +243 -144
- package/package.json +28 -28
- package/src/components/block-breadcrumb/test/index.js +1 -1
- package/src/components/block-draggable/draggable-chip.js +4 -2
- package/src/components/block-inspector/index.js +8 -7
- package/src/components/block-list/block-list-compact.native.js +1 -0
- package/src/components/block-list/block.js +111 -7
- package/src/components/block-list/block.native.js +123 -9
- package/src/components/block-list/style.scss +93 -126
- package/src/components/block-list/use-in-between-inserter.js +8 -19
- package/src/components/block-lock/modal.js +12 -7
- package/src/components/block-mover/style.scss +0 -1
- package/src/components/block-parent-selector/index.js +3 -3
- package/src/components/block-patterns-list/index.js +9 -5
- package/src/components/block-patterns-list/style.scss +7 -3
- package/src/components/block-popover/README.md +8 -0
- package/src/components/block-popover/drop-zone.js +63 -0
- package/src/components/block-popover/index.js +2 -1
- package/src/components/block-popover/style.scss +17 -1
- package/src/components/block-preview/auto.js +1 -1
- package/src/components/block-preview/index.js +7 -8
- package/src/components/block-preview/live.js +2 -7
- package/src/components/block-preview/test/index.js +1 -7
- package/src/components/block-selection-clearer/index.js +7 -2
- package/src/components/block-selection-clearer/test/index.js +118 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +25 -11
- package/src/components/block-settings-menu/test/block-mode-toggle.js +17 -17
- package/src/components/block-styles/index.js +26 -49
- package/src/components/block-switcher/test/index.js +2 -2
- package/src/components/block-toolbar/index.js +4 -6
- package/src/components/block-toolbar/style.scss +38 -14
- package/src/components/block-tools/back-compat.js +1 -0
- package/src/components/block-tools/insertion-point.js +42 -17
- package/src/components/block-tools/selected-block-popover.js +14 -1
- package/src/components/button-block-appender/style.scss +4 -2
- package/src/components/color-palette/test/__snapshots__/control.js.snap +32 -52
- package/src/components/color-palette/test/control.js +11 -15
- package/src/components/colors-gradients/control.js +2 -2
- package/src/components/colors-gradients/panel-color-gradient-settings.js +3 -4
- package/src/components/colors-gradients/test/control.js +49 -77
- package/src/components/font-sizes/fluid-utils.js +296 -0
- package/src/components/font-sizes/index.js +1 -0
- package/src/components/font-sizes/test/fluid-utils.js +168 -0
- package/src/components/image-size-control/test/index.js +47 -60
- package/src/components/index.js +0 -1
- package/src/components/inner-blocks/use-inner-block-template-sync.js +3 -2
- package/src/components/inserter/block-patterns-tab.js +232 -98
- package/src/components/inserter/menu.js +15 -2
- package/src/components/inserter/style.scss +94 -9
- package/src/components/inserter/test/reusable-blocks-tab.js +6 -6
- package/src/components/inserter-draggable-blocks/index.js +12 -2
- package/src/components/inserter-list-item/style.scss +20 -1
- package/src/components/link-control/test/index.js +1 -1
- package/src/components/list-view/use-list-view-drop-zone.js +4 -18
- package/src/components/panel-color-settings/test/index.js +4 -4
- package/src/components/preview-options/index.js +2 -2
- package/src/components/preview-options/style.scss +1 -1
- package/src/components/provider/test/use-block-sync.js +131 -165
- package/src/components/responsive-block-control/test/index.js +4 -4
- package/src/components/spacing-sizes-control/spacing-input-control.js +16 -2
- package/src/components/spacing-sizes-control/style.scss +26 -19
- package/src/components/use-block-drop-zone/index.js +136 -79
- package/src/components/use-block-drop-zone/test/index.js +333 -81
- package/src/components/use-on-block-drop/index.js +11 -12
- package/src/components/use-on-block-drop/types.ts +1 -0
- package/src/hooks/align.js +3 -2
- package/src/hooks/align.native.js +5 -8
- package/src/hooks/font-size.js +75 -0
- package/src/hooks/margin.js +5 -4
- package/src/hooks/padding.js +1 -0
- package/src/hooks/style.js +122 -3
- package/src/hooks/test/style.js +206 -1
- package/src/hooks/test/use-typography-props.js +22 -0
- package/src/hooks/use-typography-props.js +18 -3
- package/src/hooks/utils.js +6 -2
- package/src/store/actions.js +20 -12
- package/src/store/defaults.js +3 -0
- package/src/store/reducer.js +31 -24
- package/src/store/test/actions.js +0 -9
- package/src/utils/math.js +17 -0
- package/src/utils/pre-parse-patterns.js +12 -7
- package/build/components/inserter/pattern-panel.js +0 -87
- package/build/components/inserter/pattern-panel.js.map +0 -1
- package/build-module/components/inserter/pattern-panel.js +0 -74
- package/build-module/components/inserter/pattern-panel.js.map +0 -1
- package/src/components/inserter/pattern-panel.js +0 -93
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { getDropTargetPosition } from '..';
|
|
5
5
|
|
|
6
6
|
const elementData = [
|
|
7
7
|
{
|
|
@@ -31,19 +31,12 @@ const elementData = [
|
|
|
31
31
|
},
|
|
32
32
|
];
|
|
33
33
|
|
|
34
|
-
const createMockClassList = ( classes ) => {
|
|
35
|
-
return {
|
|
36
|
-
contains( textToMatch ) {
|
|
37
|
-
return classes.includes( textToMatch );
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
|
|
42
34
|
const mapElements =
|
|
43
35
|
( orientation ) =>
|
|
44
|
-
( { top, right, bottom, left }, index ) => {
|
|
36
|
+
( { top, right, bottom, left, isUnmodifiedDefaultBlock }, index ) => {
|
|
45
37
|
return {
|
|
46
|
-
|
|
38
|
+
isUnmodifiedDefaultBlock: !! isUnmodifiedDefaultBlock,
|
|
39
|
+
blockIndex: index,
|
|
47
40
|
getBoundingClientRect() {
|
|
48
41
|
return orientation === 'vertical'
|
|
49
42
|
? {
|
|
@@ -59,27 +52,21 @@ const mapElements =
|
|
|
59
52
|
right: bottom,
|
|
60
53
|
};
|
|
61
54
|
},
|
|
62
|
-
classList: createMockClassList( 'wp-block' ),
|
|
63
55
|
};
|
|
64
56
|
};
|
|
65
57
|
|
|
66
|
-
const
|
|
58
|
+
const verticalBlocksData = elementData.map( mapElements( 'vertical' ) );
|
|
67
59
|
// Flip the elementData to make a horizontal block list.
|
|
68
|
-
const
|
|
60
|
+
const horizontalBlocksData = elementData.map( mapElements( 'horizontal' ) );
|
|
69
61
|
|
|
70
|
-
describe( '
|
|
71
|
-
it( 'returns `
|
|
72
|
-
const emptyElementList = [];
|
|
62
|
+
describe( 'getDropTargetPosition', () => {
|
|
63
|
+
it( 'returns `0` for an empty list of elements', () => {
|
|
73
64
|
const position = { x: 0, y: 0 };
|
|
74
65
|
const orientation = 'horizontal';
|
|
75
66
|
|
|
76
|
-
const result =
|
|
77
|
-
emptyElementList,
|
|
78
|
-
position,
|
|
79
|
-
orientation
|
|
80
|
-
);
|
|
67
|
+
const result = getDropTargetPosition( [], position, orientation );
|
|
81
68
|
|
|
82
|
-
expect( result ).
|
|
69
|
+
expect( result ).toEqual( [ 0, 'insert' ] );
|
|
83
70
|
} );
|
|
84
71
|
|
|
85
72
|
describe( 'Vertical block lists', () => {
|
|
@@ -88,109 +75,109 @@ describe( 'getNearestBlockIndex', () => {
|
|
|
88
75
|
it( 'returns `0` when the position is nearest to the start of the first block', () => {
|
|
89
76
|
const position = { x: 0, y: 0 };
|
|
90
77
|
|
|
91
|
-
const result =
|
|
92
|
-
|
|
78
|
+
const result = getDropTargetPosition(
|
|
79
|
+
verticalBlocksData,
|
|
93
80
|
position,
|
|
94
81
|
orientation
|
|
95
82
|
);
|
|
96
83
|
|
|
97
|
-
expect( result ).
|
|
84
|
+
expect( result ).toEqual( [ 0, 'insert' ] );
|
|
98
85
|
} );
|
|
99
86
|
|
|
100
87
|
it( 'returns `1` when the position is nearest to the end of the first block', () => {
|
|
101
88
|
const position = { x: 0, y: 190 };
|
|
102
89
|
|
|
103
|
-
const result =
|
|
104
|
-
|
|
90
|
+
const result = getDropTargetPosition(
|
|
91
|
+
verticalBlocksData,
|
|
105
92
|
position,
|
|
106
93
|
orientation
|
|
107
94
|
);
|
|
108
95
|
|
|
109
|
-
expect( result ).
|
|
96
|
+
expect( result ).toEqual( [ 1, 'insert' ] );
|
|
110
97
|
} );
|
|
111
98
|
|
|
112
99
|
it( 'returns `1` when the position is nearest to the start of the second block', () => {
|
|
113
100
|
const position = { x: 0, y: 210 };
|
|
114
101
|
|
|
115
|
-
const result =
|
|
116
|
-
|
|
102
|
+
const result = getDropTargetPosition(
|
|
103
|
+
verticalBlocksData,
|
|
117
104
|
position,
|
|
118
105
|
orientation
|
|
119
106
|
);
|
|
120
107
|
|
|
121
|
-
expect( result ).
|
|
108
|
+
expect( result ).toEqual( [ 1, 'insert' ] );
|
|
122
109
|
} );
|
|
123
110
|
|
|
124
111
|
it( 'returns `2` when the position is nearest to the end of the second block', () => {
|
|
125
112
|
const position = { x: 0, y: 450 };
|
|
126
113
|
|
|
127
|
-
const result =
|
|
128
|
-
|
|
114
|
+
const result = getDropTargetPosition(
|
|
115
|
+
verticalBlocksData,
|
|
129
116
|
position,
|
|
130
117
|
orientation
|
|
131
118
|
);
|
|
132
119
|
|
|
133
|
-
expect( result ).
|
|
120
|
+
expect( result ).toEqual( [ 2, 'insert' ] );
|
|
134
121
|
} );
|
|
135
122
|
|
|
136
123
|
it( 'returns `2` when the position is nearest to the start of the third block', () => {
|
|
137
124
|
const position = { x: 0, y: 510 };
|
|
138
125
|
|
|
139
|
-
const result =
|
|
140
|
-
|
|
126
|
+
const result = getDropTargetPosition(
|
|
127
|
+
verticalBlocksData,
|
|
141
128
|
position,
|
|
142
129
|
orientation
|
|
143
130
|
);
|
|
144
131
|
|
|
145
|
-
expect( result ).
|
|
132
|
+
expect( result ).toEqual( [ 2, 'insert' ] );
|
|
146
133
|
} );
|
|
147
134
|
|
|
148
135
|
it( 'returns `3` when the position is nearest to the end of the third block', () => {
|
|
149
136
|
const position = { x: 0, y: 880 };
|
|
150
137
|
|
|
151
|
-
const result =
|
|
152
|
-
|
|
138
|
+
const result = getDropTargetPosition(
|
|
139
|
+
verticalBlocksData,
|
|
153
140
|
position,
|
|
154
141
|
orientation
|
|
155
142
|
);
|
|
156
143
|
|
|
157
|
-
expect( result ).
|
|
144
|
+
expect( result ).toEqual( [ 3, 'insert' ] );
|
|
158
145
|
} );
|
|
159
146
|
|
|
160
147
|
it( 'returns `3` when the position is past the end of the third block', () => {
|
|
161
148
|
const position = { x: 0, y: 920 };
|
|
162
149
|
|
|
163
|
-
const result =
|
|
164
|
-
|
|
150
|
+
const result = getDropTargetPosition(
|
|
151
|
+
verticalBlocksData,
|
|
165
152
|
position,
|
|
166
153
|
orientation
|
|
167
154
|
);
|
|
168
155
|
|
|
169
|
-
expect( result ).
|
|
156
|
+
expect( result ).toEqual( [ 3, 'insert' ] );
|
|
170
157
|
} );
|
|
171
158
|
|
|
172
|
-
it( 'returns `
|
|
159
|
+
it( 'returns `4` when the position is nearest to the start of the fourth block', () => {
|
|
173
160
|
const position = { x: 401, y: 0 };
|
|
174
161
|
|
|
175
|
-
const result =
|
|
176
|
-
|
|
162
|
+
const result = getDropTargetPosition(
|
|
163
|
+
verticalBlocksData,
|
|
177
164
|
position,
|
|
178
165
|
orientation
|
|
179
166
|
);
|
|
180
167
|
|
|
181
|
-
expect( result ).
|
|
168
|
+
expect( result ).toEqual( [ 3, 'insert' ] );
|
|
182
169
|
} );
|
|
183
170
|
|
|
184
|
-
it( 'returns `
|
|
171
|
+
it( 'returns `5` when the position is nearest to the end of the fourth block', () => {
|
|
185
172
|
const position = { x: 401, y: 300 };
|
|
186
173
|
|
|
187
|
-
const result =
|
|
188
|
-
|
|
174
|
+
const result = getDropTargetPosition(
|
|
175
|
+
verticalBlocksData,
|
|
189
176
|
position,
|
|
190
177
|
orientation
|
|
191
178
|
);
|
|
192
179
|
|
|
193
|
-
expect( result ).
|
|
180
|
+
expect( result ).toEqual( [ 4, 'insert' ] );
|
|
194
181
|
} );
|
|
195
182
|
} );
|
|
196
183
|
|
|
@@ -200,109 +187,374 @@ describe( 'getNearestBlockIndex', () => {
|
|
|
200
187
|
it( 'returns `0` when the position is nearest to the start of the first block', () => {
|
|
201
188
|
const position = { x: 0, y: 0 };
|
|
202
189
|
|
|
203
|
-
const result =
|
|
204
|
-
|
|
190
|
+
const result = getDropTargetPosition(
|
|
191
|
+
horizontalBlocksData,
|
|
205
192
|
position,
|
|
206
193
|
orientation
|
|
207
194
|
);
|
|
208
195
|
|
|
209
|
-
expect( result ).
|
|
196
|
+
expect( result ).toEqual( [ 0, 'insert' ] );
|
|
210
197
|
} );
|
|
211
198
|
|
|
212
199
|
it( 'returns `1` when the position is nearest to the end of the first block', () => {
|
|
213
200
|
const position = { x: 190, y: 0 };
|
|
214
201
|
|
|
215
|
-
const result =
|
|
216
|
-
|
|
202
|
+
const result = getDropTargetPosition(
|
|
203
|
+
horizontalBlocksData,
|
|
217
204
|
position,
|
|
218
205
|
orientation
|
|
219
206
|
);
|
|
220
207
|
|
|
221
|
-
expect( result ).
|
|
208
|
+
expect( result ).toEqual( [ 1, 'insert' ] );
|
|
222
209
|
} );
|
|
223
210
|
|
|
224
211
|
it( 'returns `1` when the position is nearest to the start of the second block', () => {
|
|
225
212
|
const position = { x: 210, y: 0 };
|
|
226
213
|
|
|
227
|
-
const result =
|
|
228
|
-
|
|
214
|
+
const result = getDropTargetPosition(
|
|
215
|
+
horizontalBlocksData,
|
|
229
216
|
position,
|
|
230
217
|
orientation
|
|
231
218
|
);
|
|
232
219
|
|
|
233
|
-
expect( result ).
|
|
220
|
+
expect( result ).toEqual( [ 1, 'insert' ] );
|
|
234
221
|
} );
|
|
235
222
|
|
|
236
223
|
it( 'returns `2` when the position is nearest to the end of the second block', () => {
|
|
237
224
|
const position = { x: 450, y: 0 };
|
|
238
225
|
|
|
239
|
-
const result =
|
|
240
|
-
|
|
226
|
+
const result = getDropTargetPosition(
|
|
227
|
+
horizontalBlocksData,
|
|
241
228
|
position,
|
|
242
229
|
orientation
|
|
243
230
|
);
|
|
244
231
|
|
|
245
|
-
expect( result ).
|
|
232
|
+
expect( result ).toEqual( [ 2, 'insert' ] );
|
|
246
233
|
} );
|
|
247
234
|
|
|
248
235
|
it( 'returns `2` when the position is nearest to the start of the third block', () => {
|
|
249
236
|
const position = { x: 510, y: 0 };
|
|
250
237
|
|
|
251
|
-
const result =
|
|
252
|
-
|
|
238
|
+
const result = getDropTargetPosition(
|
|
239
|
+
horizontalBlocksData,
|
|
253
240
|
position,
|
|
254
241
|
orientation
|
|
255
242
|
);
|
|
256
243
|
|
|
257
|
-
expect( result ).
|
|
244
|
+
expect( result ).toEqual( [ 2, 'insert' ] );
|
|
258
245
|
} );
|
|
259
246
|
|
|
260
247
|
it( 'returns `3` when the position is nearest to the end of the third block', () => {
|
|
261
248
|
const position = { x: 880, y: 0 };
|
|
262
249
|
|
|
263
|
-
const result =
|
|
264
|
-
|
|
250
|
+
const result = getDropTargetPosition(
|
|
251
|
+
horizontalBlocksData,
|
|
265
252
|
position,
|
|
266
253
|
orientation
|
|
267
254
|
);
|
|
268
255
|
|
|
269
|
-
expect( result ).
|
|
256
|
+
expect( result ).toEqual( [ 3, 'insert' ] );
|
|
270
257
|
} );
|
|
271
258
|
|
|
272
259
|
it( 'returns `3` when the position is past the end of the third block', () => {
|
|
273
260
|
const position = { x: 920, y: 0 };
|
|
274
261
|
|
|
275
|
-
const result =
|
|
276
|
-
|
|
262
|
+
const result = getDropTargetPosition(
|
|
263
|
+
horizontalBlocksData,
|
|
277
264
|
position,
|
|
278
265
|
orientation
|
|
279
266
|
);
|
|
280
267
|
|
|
281
|
-
expect( result ).
|
|
268
|
+
expect( result ).toEqual( [ 3, 'insert' ] );
|
|
282
269
|
} );
|
|
283
270
|
|
|
284
|
-
it( 'returns `3` when the position is nearest to the start of the
|
|
271
|
+
it( 'returns `3` when the position is nearest to the start of the last block', () => {
|
|
285
272
|
const position = { x: 0, y: 401 };
|
|
286
273
|
|
|
287
|
-
const result =
|
|
288
|
-
|
|
274
|
+
const result = getDropTargetPosition(
|
|
275
|
+
horizontalBlocksData,
|
|
289
276
|
position,
|
|
290
277
|
orientation
|
|
291
278
|
);
|
|
292
279
|
|
|
293
|
-
expect( result ).
|
|
280
|
+
expect( result ).toEqual( [ 3, 'insert' ] );
|
|
294
281
|
} );
|
|
295
282
|
|
|
296
|
-
it( 'returns `4` when the position is nearest to the end of the
|
|
283
|
+
it( 'returns `4` when the position is nearest to the end of the last block', () => {
|
|
297
284
|
const position = { x: 300, y: 401 };
|
|
298
285
|
|
|
299
|
-
const result =
|
|
300
|
-
|
|
286
|
+
const result = getDropTargetPosition(
|
|
287
|
+
horizontalBlocksData,
|
|
301
288
|
position,
|
|
302
289
|
orientation
|
|
303
290
|
);
|
|
304
291
|
|
|
305
|
-
expect( result ).
|
|
292
|
+
expect( result ).toEqual( [ 4, 'insert' ] );
|
|
293
|
+
} );
|
|
294
|
+
} );
|
|
295
|
+
|
|
296
|
+
describe( 'Unmodified default blocks', () => {
|
|
297
|
+
const orientation = 'vertical';
|
|
298
|
+
|
|
299
|
+
it( 'handles replacement index when only the first block is an unmodified default block', () => {
|
|
300
|
+
const blocksData = [
|
|
301
|
+
{
|
|
302
|
+
left: 0,
|
|
303
|
+
top: 10,
|
|
304
|
+
right: 400,
|
|
305
|
+
bottom: 210,
|
|
306
|
+
isUnmodifiedDefaultBlock: true,
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
left: 0,
|
|
310
|
+
top: 220,
|
|
311
|
+
right: 400,
|
|
312
|
+
bottom: 420,
|
|
313
|
+
isUnmodifiedDefaultBlock: false,
|
|
314
|
+
},
|
|
315
|
+
].map( mapElements( 'vertical' ) );
|
|
316
|
+
|
|
317
|
+
// Dropping above the first block.
|
|
318
|
+
expect(
|
|
319
|
+
getDropTargetPosition( blocksData, { x: 0, y: 0 }, orientation )
|
|
320
|
+
).toEqual( [ 0, 'replace' ] );
|
|
321
|
+
|
|
322
|
+
// Dropping on the top half of the first block.
|
|
323
|
+
expect(
|
|
324
|
+
getDropTargetPosition(
|
|
325
|
+
blocksData,
|
|
326
|
+
{ x: 0, y: 20 },
|
|
327
|
+
orientation
|
|
328
|
+
)
|
|
329
|
+
).toEqual( [ 0, 'replace' ] );
|
|
330
|
+
|
|
331
|
+
// Dropping on the bottom half of the first block.
|
|
332
|
+
expect(
|
|
333
|
+
getDropTargetPosition(
|
|
334
|
+
blocksData,
|
|
335
|
+
{ x: 0, y: 200 },
|
|
336
|
+
orientation
|
|
337
|
+
)
|
|
338
|
+
).toEqual( [ 0, 'replace' ] );
|
|
339
|
+
|
|
340
|
+
// Dropping slightly after the first block.
|
|
341
|
+
expect(
|
|
342
|
+
getDropTargetPosition(
|
|
343
|
+
blocksData,
|
|
344
|
+
{ x: 0, y: 211 },
|
|
345
|
+
orientation
|
|
346
|
+
)
|
|
347
|
+
).toEqual( [ 0, 'replace' ] );
|
|
348
|
+
|
|
349
|
+
// Dropping slightly above the second block.
|
|
350
|
+
expect(
|
|
351
|
+
getDropTargetPosition(
|
|
352
|
+
blocksData,
|
|
353
|
+
{ x: 0, y: 219 },
|
|
354
|
+
orientation
|
|
355
|
+
)
|
|
356
|
+
).toEqual( [ 0, 'replace' ] );
|
|
357
|
+
|
|
358
|
+
// Dropping on the top half of the second block.
|
|
359
|
+
expect(
|
|
360
|
+
getDropTargetPosition(
|
|
361
|
+
blocksData,
|
|
362
|
+
{ x: 0, y: 230 },
|
|
363
|
+
orientation
|
|
364
|
+
)
|
|
365
|
+
).toEqual( [ 0, 'replace' ] );
|
|
366
|
+
|
|
367
|
+
// Dropping on the bottom half of the second block.
|
|
368
|
+
expect(
|
|
369
|
+
getDropTargetPosition(
|
|
370
|
+
blocksData,
|
|
371
|
+
{ x: 0, y: 410 },
|
|
372
|
+
orientation
|
|
373
|
+
)
|
|
374
|
+
).toEqual( [ 2, 'insert' ] );
|
|
375
|
+
|
|
376
|
+
// Dropping below the second block.
|
|
377
|
+
expect(
|
|
378
|
+
getDropTargetPosition(
|
|
379
|
+
blocksData,
|
|
380
|
+
{ x: 0, y: 421 },
|
|
381
|
+
orientation
|
|
382
|
+
)
|
|
383
|
+
).toEqual( [ 2, 'insert' ] );
|
|
384
|
+
} );
|
|
385
|
+
|
|
386
|
+
it( 'handles replacement index when only the second block is an unmodified default block', () => {
|
|
387
|
+
const blocksData = [
|
|
388
|
+
{
|
|
389
|
+
left: 0,
|
|
390
|
+
top: 10,
|
|
391
|
+
right: 400,
|
|
392
|
+
bottom: 210,
|
|
393
|
+
isUnmodifiedDefaultBlock: false,
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
left: 0,
|
|
397
|
+
top: 220,
|
|
398
|
+
right: 400,
|
|
399
|
+
bottom: 420,
|
|
400
|
+
isUnmodifiedDefaultBlock: true,
|
|
401
|
+
},
|
|
402
|
+
].map( mapElements( 'vertical' ) );
|
|
403
|
+
|
|
404
|
+
// Dropping above the first block.
|
|
405
|
+
expect(
|
|
406
|
+
getDropTargetPosition( blocksData, { x: 0, y: 0 }, orientation )
|
|
407
|
+
).toEqual( [ 0, 'insert' ] );
|
|
408
|
+
|
|
409
|
+
// Dropping on the top half of the first block.
|
|
410
|
+
expect(
|
|
411
|
+
getDropTargetPosition(
|
|
412
|
+
blocksData,
|
|
413
|
+
{ x: 0, y: 20 },
|
|
414
|
+
orientation
|
|
415
|
+
)
|
|
416
|
+
).toEqual( [ 0, 'insert' ] );
|
|
417
|
+
|
|
418
|
+
// Dropping on the bottom half of the first block.
|
|
419
|
+
expect(
|
|
420
|
+
getDropTargetPosition(
|
|
421
|
+
blocksData,
|
|
422
|
+
{ x: 0, y: 200 },
|
|
423
|
+
orientation
|
|
424
|
+
)
|
|
425
|
+
).toEqual( [ 1, 'replace' ] );
|
|
426
|
+
|
|
427
|
+
// Dropping slightly after the first block.
|
|
428
|
+
expect(
|
|
429
|
+
getDropTargetPosition(
|
|
430
|
+
blocksData,
|
|
431
|
+
{ x: 0, y: 211 },
|
|
432
|
+
orientation
|
|
433
|
+
)
|
|
434
|
+
).toEqual( [ 1, 'replace' ] );
|
|
435
|
+
|
|
436
|
+
// Dropping slightly above the second block.
|
|
437
|
+
expect(
|
|
438
|
+
getDropTargetPosition(
|
|
439
|
+
blocksData,
|
|
440
|
+
{ x: 0, y: 219 },
|
|
441
|
+
orientation
|
|
442
|
+
)
|
|
443
|
+
).toEqual( [ 1, 'replace' ] );
|
|
444
|
+
|
|
445
|
+
// Dropping on the top half of the second block.
|
|
446
|
+
expect(
|
|
447
|
+
getDropTargetPosition(
|
|
448
|
+
blocksData,
|
|
449
|
+
{ x: 0, y: 230 },
|
|
450
|
+
orientation
|
|
451
|
+
)
|
|
452
|
+
).toEqual( [ 1, 'replace' ] );
|
|
453
|
+
|
|
454
|
+
// Dropping on the bottom half of the second block.
|
|
455
|
+
expect(
|
|
456
|
+
getDropTargetPosition(
|
|
457
|
+
blocksData,
|
|
458
|
+
{ x: 0, y: 410 },
|
|
459
|
+
orientation
|
|
460
|
+
)
|
|
461
|
+
).toEqual( [ 1, 'replace' ] );
|
|
462
|
+
|
|
463
|
+
// Dropping below the second block.
|
|
464
|
+
expect(
|
|
465
|
+
getDropTargetPosition(
|
|
466
|
+
blocksData,
|
|
467
|
+
{ x: 0, y: 421 },
|
|
468
|
+
orientation
|
|
469
|
+
)
|
|
470
|
+
).toEqual( [ 1, 'replace' ] );
|
|
471
|
+
} );
|
|
472
|
+
|
|
473
|
+
it( 'returns replacement index when both blocks are unmodified default blocks', () => {
|
|
474
|
+
const blocksData = [
|
|
475
|
+
{
|
|
476
|
+
left: 0,
|
|
477
|
+
top: 10,
|
|
478
|
+
right: 400,
|
|
479
|
+
bottom: 210,
|
|
480
|
+
isUnmodifiedDefaultBlock: true,
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
left: 0,
|
|
484
|
+
top: 220,
|
|
485
|
+
right: 400,
|
|
486
|
+
bottom: 420,
|
|
487
|
+
isUnmodifiedDefaultBlock: true,
|
|
488
|
+
},
|
|
489
|
+
].map( mapElements( 'vertical' ) );
|
|
490
|
+
|
|
491
|
+
// Dropping above the first block.
|
|
492
|
+
expect(
|
|
493
|
+
getDropTargetPosition( blocksData, { x: 0, y: 0 }, orientation )
|
|
494
|
+
).toEqual( [ 0, 'replace' ] );
|
|
495
|
+
|
|
496
|
+
// Dropping on the top half of the first block.
|
|
497
|
+
expect(
|
|
498
|
+
getDropTargetPosition(
|
|
499
|
+
blocksData,
|
|
500
|
+
{ x: 0, y: 20 },
|
|
501
|
+
orientation
|
|
502
|
+
)
|
|
503
|
+
).toEqual( [ 0, 'replace' ] );
|
|
504
|
+
|
|
505
|
+
// Dropping on the bottom half of the first block.
|
|
506
|
+
expect(
|
|
507
|
+
getDropTargetPosition(
|
|
508
|
+
blocksData,
|
|
509
|
+
{ x: 0, y: 200 },
|
|
510
|
+
orientation
|
|
511
|
+
)
|
|
512
|
+
).toEqual( [ 0, 'replace' ] );
|
|
513
|
+
|
|
514
|
+
// Dropping slightly after the first block.
|
|
515
|
+
expect(
|
|
516
|
+
getDropTargetPosition(
|
|
517
|
+
blocksData,
|
|
518
|
+
{ x: 0, y: 211 },
|
|
519
|
+
orientation
|
|
520
|
+
)
|
|
521
|
+
).toEqual( [ 0, 'replace' ] );
|
|
522
|
+
|
|
523
|
+
// Dropping slightly above the second block.
|
|
524
|
+
expect(
|
|
525
|
+
getDropTargetPosition(
|
|
526
|
+
blocksData,
|
|
527
|
+
{ x: 0, y: 219 },
|
|
528
|
+
orientation
|
|
529
|
+
)
|
|
530
|
+
).toEqual( [ 1, 'replace' ] );
|
|
531
|
+
|
|
532
|
+
// Dropping on the top half of the second block.
|
|
533
|
+
expect(
|
|
534
|
+
getDropTargetPosition(
|
|
535
|
+
blocksData,
|
|
536
|
+
{ x: 0, y: 230 },
|
|
537
|
+
orientation
|
|
538
|
+
)
|
|
539
|
+
).toEqual( [ 1, 'replace' ] );
|
|
540
|
+
|
|
541
|
+
// Dropping on the bottom half of the second block.
|
|
542
|
+
expect(
|
|
543
|
+
getDropTargetPosition(
|
|
544
|
+
blocksData,
|
|
545
|
+
{ x: 0, y: 410 },
|
|
546
|
+
orientation
|
|
547
|
+
)
|
|
548
|
+
).toEqual( [ 1, 'replace' ] );
|
|
549
|
+
|
|
550
|
+
// Dropping below the second block.
|
|
551
|
+
expect(
|
|
552
|
+
getDropTargetPosition(
|
|
553
|
+
blocksData,
|
|
554
|
+
{ x: 0, y: 421 },
|
|
555
|
+
orientation
|
|
556
|
+
)
|
|
557
|
+
).toEqual( [ 1, 'replace' ] );
|
|
306
558
|
} );
|
|
307
559
|
} );
|
|
308
560
|
} );
|
|
@@ -17,6 +17,7 @@ import { getFilesFromDataTransfer } from '@wordpress/dom';
|
|
|
17
17
|
import { store as blockEditorStore } from '../../store';
|
|
18
18
|
|
|
19
19
|
/** @typedef {import('@wordpress/element').WPSyntheticEvent} WPSyntheticEvent */
|
|
20
|
+
/** @typedef {import('./types').WPDropOperation} WPDropOperation */
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* Retrieve the data for a block drop event.
|
|
@@ -197,21 +198,19 @@ export function onHTMLDrop(
|
|
|
197
198
|
/**
|
|
198
199
|
* A React hook for handling block drop events.
|
|
199
200
|
*
|
|
200
|
-
* @
|
|
201
|
+
* @param {string} targetRootClientId The root client id where the block(s) will be inserted.
|
|
202
|
+
* @param {number} targetBlockIndex The index where the block(s) will be inserted.
|
|
203
|
+
* @param {Object} options The optional options.
|
|
204
|
+
* @param {WPDropOperation} [options.operation] The type of operation to perform on drop. Could be `insert` or `replace` for now.
|
|
201
205
|
*
|
|
202
|
-
* @
|
|
203
|
-
* @param {number} targetBlockIndex The index where the block(s) will be inserted.
|
|
204
|
-
* @param {Object} options The optional options.
|
|
205
|
-
* @param {DropAction} options.action The type of action to perform on drop. Could be `insert` or `replace` for now.
|
|
206
|
-
*
|
|
207
|
-
* @return {Object} An object that contains the event handlers `onDrop`, `onFilesDrop` and `onHTMLDrop`.
|
|
206
|
+
* @return {Function} A function to be passed to the onDrop handler.
|
|
208
207
|
*/
|
|
209
208
|
export default function useOnBlockDrop(
|
|
210
209
|
targetRootClientId,
|
|
211
210
|
targetBlockIndex,
|
|
212
211
|
options = {}
|
|
213
212
|
) {
|
|
214
|
-
const {
|
|
213
|
+
const { operation = 'insert' } = options;
|
|
215
214
|
const hasUploadPermissions = useSelect(
|
|
216
215
|
( select ) => select( blockEditorStore ).getSettings().mediaUpload,
|
|
217
216
|
[]
|
|
@@ -235,7 +234,7 @@ export default function useOnBlockDrop(
|
|
|
235
234
|
|
|
236
235
|
const insertOrReplaceBlocks = useCallback(
|
|
237
236
|
( blocks, updateSelection = true, initialPosition = 0 ) => {
|
|
238
|
-
if (
|
|
237
|
+
if ( operation === 'replace' ) {
|
|
239
238
|
const clientIds = getBlockOrder( targetRootClientId );
|
|
240
239
|
const clientId = clientIds[ targetBlockIndex ];
|
|
241
240
|
|
|
@@ -251,7 +250,7 @@ export default function useOnBlockDrop(
|
|
|
251
250
|
}
|
|
252
251
|
},
|
|
253
252
|
[
|
|
254
|
-
|
|
253
|
+
operation,
|
|
255
254
|
getBlockOrder,
|
|
256
255
|
insertBlocks,
|
|
257
256
|
replaceBlocks,
|
|
@@ -262,7 +261,7 @@ export default function useOnBlockDrop(
|
|
|
262
261
|
|
|
263
262
|
const moveBlocks = useCallback(
|
|
264
263
|
( sourceClientIds, sourceRootClientId, insertIndex ) => {
|
|
265
|
-
if (
|
|
264
|
+
if ( operation === 'replace' ) {
|
|
266
265
|
const sourceBlocks = getBlocksByClientId( sourceClientIds );
|
|
267
266
|
const targetBlockClientIds =
|
|
268
267
|
getBlockOrder( targetRootClientId );
|
|
@@ -290,7 +289,7 @@ export default function useOnBlockDrop(
|
|
|
290
289
|
}
|
|
291
290
|
},
|
|
292
291
|
[
|
|
293
|
-
|
|
292
|
+
operation,
|
|
294
293
|
getBlockOrder,
|
|
295
294
|
getBlocksByClientId,
|
|
296
295
|
insertBlocks,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type WPDropOperation = 'insert' | 'replace';
|
package/src/hooks/align.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { without } from 'lodash';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* WordPress dependencies
|
|
@@ -74,7 +73,9 @@ export function getValidAlignments(
|
|
|
74
73
|
! hasWideEnabled ||
|
|
75
74
|
( blockAlign === true && ! hasWideBlockSupport )
|
|
76
75
|
) {
|
|
77
|
-
return
|
|
76
|
+
return validAlignments.filter(
|
|
77
|
+
( alignment ) => ! WIDE_ALIGNMENTS.includes( alignment )
|
|
78
|
+
);
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
return validAlignments;
|