@wordpress/block-editor 10.4.0 → 10.5.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 +7 -0
- package/README.md +0 -1
- package/build/components/block-lock/menu-item.js +1 -1
- package/build/components/block-lock/menu-item.js.map +1 -1
- package/build/components/block-lock/modal.js +16 -9
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-styles/utils.js +3 -3
- package/build/components/block-styles/utils.js.map +1 -1
- package/build/components/block-switcher/index.js +19 -4
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +27 -4
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/colors/with-colors.js +4 -3
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +24 -40
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +7 -5
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/index.js +9 -0
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/index.js +5 -3
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.js +4 -1
- package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build/components/link-control/index.js +18 -34
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/search-input.js +1 -1
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/use-internal-input-value.js +26 -0
- package/build/components/link-control/use-internal-input-value.js.map +1 -0
- package/build/components/list-view/block.js +5 -3
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +9 -3
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/off-canvas-editor/block-contents.js +100 -0
- package/build/components/off-canvas-editor/block-contents.js.map +1 -0
- package/build/components/off-canvas-editor/block-select-button.js +119 -0
- package/build/components/off-canvas-editor/block-select-button.js.map +1 -0
- package/build/components/off-canvas-editor/block.js +292 -0
- package/build/components/off-canvas-editor/block.js.map +1 -0
- package/build/components/off-canvas-editor/branch.js +181 -0
- package/build/components/off-canvas-editor/branch.js.map +1 -0
- package/build/components/off-canvas-editor/context.js +19 -0
- package/build/components/off-canvas-editor/context.js.map +1 -0
- package/build/components/off-canvas-editor/drop-indicator.js +118 -0
- package/build/components/off-canvas-editor/drop-indicator.js.map +1 -0
- package/build/components/off-canvas-editor/expander.js +41 -0
- package/build/components/off-canvas-editor/expander.js.map +1 -0
- package/build/components/off-canvas-editor/index.js +204 -0
- package/build/components/off-canvas-editor/index.js.map +1 -0
- package/build/components/off-canvas-editor/leaf.js +60 -0
- package/build/components/off-canvas-editor/leaf.js.map +1 -0
- package/build/components/off-canvas-editor/use-block-selection.js +139 -0
- package/build/components/off-canvas-editor/use-block-selection.js.map +1 -0
- package/build/components/off-canvas-editor/use-list-view-client-ids.js +33 -0
- package/build/components/off-canvas-editor/use-list-view-client-ids.js.map +1 -0
- package/build/components/off-canvas-editor/use-list-view-drop-zone.js +235 -0
- package/build/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -0
- package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js +60 -0
- package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +1 -0
- package/build/components/off-canvas-editor/utils.js +60 -0
- package/build/components/off-canvas-editor/utils.js.map +1 -0
- package/build/components/url-popover/index.js +31 -2
- package/build/components/url-popover/index.js.map +1 -1
- package/build/components/use-setting/index.js +1 -1
- package/build/components/use-setting/index.js.map +1 -1
- package/build/hooks/color-panel.js +17 -1
- package/build/hooks/color-panel.js.map +1 -1
- package/build/hooks/color.js +1 -1
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/content-lock-ui.js +13 -6
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/dimensions.js +44 -13
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/layout.js +2 -2
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/margin.js +4 -2
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/min-height.js +145 -0
- package/build/hooks/min-height.js.map +1 -0
- package/build/hooks/padding.js +4 -2
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/style.js +3 -2
- package/build/hooks/style.js.map +1 -1
- package/build/layouts/flex.js +22 -21
- package/build/layouts/flex.js.map +1 -1
- package/build/store/actions.js +26 -0
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +46 -14
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +16 -2
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-lock/menu-item.js +2 -2
- package/build-module/components/block-lock/menu-item.js.map +1 -1
- package/build-module/components/block-lock/modal.js +17 -10
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-styles/utils.js +3 -3
- package/build-module/components/block-styles/utils.js.map +1 -1
- package/build-module/components/block-switcher/index.js +19 -4
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +27 -5
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/colors/with-colors.js +5 -4
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +24 -40
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +8 -6
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/index.js +1 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +5 -3
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.js +3 -1
- package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build-module/components/link-control/index.js +17 -34
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/search-input.js +1 -1
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/link-control/use-internal-input-value.js +18 -0
- package/build-module/components/link-control/use-internal-input-value.js.map +1 -0
- package/build-module/components/list-view/block.js +5 -3
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +9 -3
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/off-canvas-editor/block-contents.js +85 -0
- package/build-module/components/off-canvas-editor/block-contents.js.map +1 -0
- package/build-module/components/off-canvas-editor/block-select-button.js +101 -0
- package/build-module/components/off-canvas-editor/block-select-button.js.map +1 -0
- package/build-module/components/off-canvas-editor/block.js +268 -0
- package/build-module/components/off-canvas-editor/block.js.map +1 -0
- package/build-module/components/off-canvas-editor/branch.js +165 -0
- package/build-module/components/off-canvas-editor/branch.js.map +1 -0
- package/build-module/components/off-canvas-editor/context.js +7 -0
- package/build-module/components/off-canvas-editor/context.js.map +1 -0
- package/build-module/components/off-canvas-editor/drop-indicator.js +111 -0
- package/build-module/components/off-canvas-editor/drop-indicator.js.map +1 -0
- package/build-module/components/off-canvas-editor/expander.js +32 -0
- package/build-module/components/off-canvas-editor/expander.js.map +1 -0
- package/build-module/components/off-canvas-editor/index.js +181 -0
- package/build-module/components/off-canvas-editor/index.js.map +1 -0
- package/build-module/components/off-canvas-editor/leaf.js +45 -0
- package/build-module/components/off-canvas-editor/leaf.js.map +1 -0
- package/build-module/components/off-canvas-editor/use-block-selection.js +124 -0
- package/build-module/components/off-canvas-editor/use-block-selection.js.map +1 -0
- package/build-module/components/off-canvas-editor/use-list-view-client-ids.js +24 -0
- package/build-module/components/off-canvas-editor/use-list-view-client-ids.js.map +1 -0
- package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js +220 -0
- package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -0
- package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js +50 -0
- package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +1 -0
- package/build-module/components/off-canvas-editor/utils.js +44 -0
- package/build-module/components/off-canvas-editor/utils.js.map +1 -0
- package/build-module/components/url-popover/index.js +30 -3
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/components/use-setting/index.js +1 -1
- package/build-module/components/use-setting/index.js.map +1 -1
- package/build-module/hooks/color-panel.js +17 -1
- package/build-module/hooks/color-panel.js.map +1 -1
- package/build-module/hooks/color.js +1 -1
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +15 -8
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/dimensions.js +39 -12
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/layout.js +2 -2
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/margin.js +4 -2
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/min-height.js +122 -0
- package/build-module/hooks/min-height.js.map +1 -0
- package/build-module/hooks/padding.js +4 -2
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/style.js +4 -3
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/layouts/flex.js +23 -22
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/store/actions.js +22 -0
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +44 -14
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +13 -2
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +39 -26
- package/build-style/style.css +39 -26
- package/package.json +28 -28
- package/src/components/alignment-control/README.md +1 -1
- package/src/components/block-alignment-control/test/index.native.js +4 -4
- package/src/components/block-draggable/test/helpers.native.js +3 -3
- package/src/components/block-draggable/test/index.native.js +27 -27
- package/src/components/block-list/style.scss +10 -5
- package/src/components/block-lock/menu-item.js +5 -2
- package/src/components/block-lock/modal.js +19 -36
- package/src/components/block-lock/style.scss +8 -17
- package/src/components/block-mover/style.scss +0 -1
- package/src/components/block-popover/style.scss +1 -1
- package/src/components/block-styles/utils.js +3 -3
- package/src/components/block-switcher/index.js +19 -4
- package/src/components/block-tools/selected-block-popover.js +80 -34
- package/src/components/block-tools/style.scss +15 -0
- package/src/components/colors/with-colors.js +13 -23
- package/src/components/default-block-appender/style.scss +1 -0
- package/src/components/font-sizes/fluid-utils.js +37 -64
- package/src/components/font-sizes/test/fluid-utils.js +5 -5
- package/src/components/font-sizes/with-font-sizes.js +14 -11
- package/src/components/index.js +1 -0
- package/src/components/inner-blocks/index.js +7 -4
- package/src/components/inserter/reusable-blocks-tab.js +4 -2
- package/src/components/inserter/style.scss +8 -7
- package/src/components/inserter/test/reusable-blocks-tab.js +14 -57
- package/src/components/link-control/index.js +23 -39
- package/src/components/link-control/search-input.js +1 -1
- package/src/components/link-control/test/index.js +272 -241
- package/src/components/link-control/use-internal-input-value.js +22 -0
- package/src/components/list-view/block.js +4 -3
- package/src/components/list-view/branch.js +11 -6
- package/src/components/off-canvas-editor/README.md +5 -0
- package/src/components/off-canvas-editor/block-contents.js +89 -0
- package/src/components/off-canvas-editor/block-select-button.js +113 -0
- package/src/components/off-canvas-editor/block.js +335 -0
- package/src/components/off-canvas-editor/branch.js +210 -0
- package/src/components/off-canvas-editor/context.js +8 -0
- package/src/components/off-canvas-editor/drop-indicator.js +126 -0
- package/src/components/off-canvas-editor/expander.js +26 -0
- package/src/components/off-canvas-editor/index.js +216 -0
- package/src/components/off-canvas-editor/leaf.js +48 -0
- package/src/components/off-canvas-editor/style.scss +397 -0
- package/src/components/off-canvas-editor/test/utils.js +50 -0
- package/src/components/off-canvas-editor/use-block-selection.js +169 -0
- package/src/components/off-canvas-editor/use-list-view-client-ids.js +29 -0
- package/src/components/off-canvas-editor/use-list-view-drop-zone.js +260 -0
- package/src/components/off-canvas-editor/use-list-view-expand-selected-item.js +58 -0
- package/src/components/off-canvas-editor/utils.js +58 -0
- package/src/components/responsive-block-control/test/index.js +69 -92
- package/src/components/url-popover/README.md +12 -3
- package/src/components/url-popover/index.js +33 -3
- package/src/components/use-setting/index.js +7 -1
- package/src/hooks/color-panel.js +13 -1
- package/src/hooks/color.js +2 -0
- package/src/hooks/content-lock-ui.js +46 -34
- package/src/hooks/dimensions.js +76 -16
- package/src/hooks/layout.js +2 -3
- package/src/hooks/margin.js +4 -3
- package/src/hooks/min-height.js +121 -0
- package/src/hooks/padding.js +4 -3
- package/src/hooks/style.js +10 -2
- package/src/hooks/test/style.js +4 -0
- package/src/hooks/test/use-typography-props.js +1 -1
- package/src/layouts/flex.js +43 -38
- package/src/store/actions.js +22 -0
- package/src/store/reducer.js +50 -40
- package/src/store/selectors.js +16 -9
- package/src/store/test/actions.js +18 -0
- package/src/store/test/reducer.js +40 -0
- package/src/store/test/selectors.js +19 -0
|
@@ -364,14 +364,20 @@
|
|
|
364
364
|
}
|
|
365
365
|
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected {
|
|
366
366
|
cursor: default;
|
|
367
|
-
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
368
|
-
border-radius: 2px;
|
|
369
367
|
}
|
|
370
368
|
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected.rich-text {
|
|
371
369
|
cursor: unset;
|
|
372
370
|
}
|
|
373
|
-
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected
|
|
374
|
-
|
|
371
|
+
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected::after {
|
|
372
|
+
content: "";
|
|
373
|
+
position: absolute;
|
|
374
|
+
pointer-events: none;
|
|
375
|
+
top: 1px;
|
|
376
|
+
right: 1px;
|
|
377
|
+
left: 1px;
|
|
378
|
+
bottom: 1px;
|
|
379
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
380
|
+
border-radius: 2px;
|
|
375
381
|
}
|
|
376
382
|
|
|
377
383
|
.is-focus-mode .block-editor-block-list__block:not(.has-child-selected) {
|
|
@@ -545,6 +551,14 @@
|
|
|
545
551
|
}
|
|
546
552
|
}
|
|
547
553
|
|
|
554
|
+
.block-editor-block-list__block-side-inserter-popover .components-popover__content > div {
|
|
555
|
+
pointer-events: none;
|
|
556
|
+
}
|
|
557
|
+
.block-editor-block-list__block-side-inserter-popover .components-popover__content > div > * {
|
|
558
|
+
pointer-events: all;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.block-editor-block-list__empty-block-inserter .block-editor-inserter__toggle.components-button.has-icon,
|
|
548
562
|
.block-editor-default-block-appender .block-editor-inserter__toggle.components-button.has-icon,
|
|
549
563
|
.block-editor-block-list__insertion-point-inserter .block-editor-inserter__toggle.components-button.has-icon {
|
|
550
564
|
background: #1e1e1e;
|
|
@@ -554,6 +568,7 @@
|
|
|
554
568
|
min-width: 24px;
|
|
555
569
|
height: 24px;
|
|
556
570
|
}
|
|
571
|
+
.block-editor-block-list__empty-block-inserter .block-editor-inserter__toggle.components-button.has-icon:hover,
|
|
557
572
|
.block-editor-default-block-appender .block-editor-inserter__toggle.components-button.has-icon:hover,
|
|
558
573
|
.block-editor-block-list__insertion-point-inserter .block-editor-inserter__toggle.components-button.has-icon:hover {
|
|
559
574
|
color: #fff;
|
|
@@ -645,6 +660,9 @@
|
|
|
645
660
|
.block-editor-block-list__block-selection-button .components-button:active {
|
|
646
661
|
color: #fff;
|
|
647
662
|
}
|
|
663
|
+
.block-editor-block-list__block-selection-button .components-button[aria-disabled=true]:hover {
|
|
664
|
+
color: #fff;
|
|
665
|
+
}
|
|
648
666
|
.block-editor-block-list__block-selection-button .block-selection-button_select-button.components-button {
|
|
649
667
|
padding: 0;
|
|
650
668
|
}
|
|
@@ -715,25 +733,18 @@
|
|
|
715
733
|
.block-editor-block-lock-modal__options-title .components-base-control__field {
|
|
716
734
|
align-items: center;
|
|
717
735
|
display: flex;
|
|
718
|
-
margin: 0;
|
|
719
736
|
}
|
|
720
737
|
|
|
721
738
|
.block-editor-block-lock-modal__checklist-item {
|
|
722
|
-
margin-bottom: 0;
|
|
723
|
-
padding: 12px 32px 12px 0;
|
|
724
|
-
}
|
|
725
|
-
.block-editor-block-lock-modal__checklist-item .components-base-control__field {
|
|
726
|
-
align-items: center;
|
|
727
|
-
display: flex;
|
|
728
|
-
margin: 0;
|
|
729
|
-
}
|
|
730
|
-
.block-editor-block-lock-modal__checklist-item .components-checkbox-control__label {
|
|
731
739
|
display: flex;
|
|
732
|
-
align-items: center;
|
|
733
740
|
justify-content: space-between;
|
|
734
|
-
|
|
741
|
+
align-items: center;
|
|
742
|
+
gap: 12px;
|
|
743
|
+
margin-bottom: 0;
|
|
744
|
+
padding: 12px 32px 12px 0;
|
|
735
745
|
}
|
|
736
|
-
.block-editor-block-lock-modal__checklist-item .
|
|
746
|
+
.block-editor-block-lock-modal__checklist-item .block-editor-block-lock-modal__lock-icon {
|
|
747
|
+
flex-shrink: 0;
|
|
737
748
|
margin-left: 12px;
|
|
738
749
|
fill: #1e1e1e;
|
|
739
750
|
}
|
|
@@ -1014,7 +1025,6 @@
|
|
|
1014
1025
|
}
|
|
1015
1026
|
.block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container > *::before {
|
|
1016
1027
|
height: calc(100% - 4px);
|
|
1017
|
-
width: calc(100% - 4px);
|
|
1018
1028
|
}
|
|
1019
1029
|
.block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container .block-editor-block-mover-button.is-up-button svg {
|
|
1020
1030
|
top: 5px;
|
|
@@ -1151,7 +1161,7 @@
|
|
|
1151
1161
|
width: max-content;
|
|
1152
1162
|
overflow-y: visible;
|
|
1153
1163
|
}
|
|
1154
|
-
.components-popover.block-editor-block-popover:not(.block-editor-block-popover__inbetween, .block-editor-block-popover__drop-zone) .components-popover__content * {
|
|
1164
|
+
.components-popover.block-editor-block-popover:not(.block-editor-block-popover__inbetween, .block-editor-block-popover__drop-zone, .block-editor-block-list__block-side-inserter-popover) .components-popover__content * {
|
|
1155
1165
|
pointer-events: all;
|
|
1156
1166
|
}
|
|
1157
1167
|
|
|
@@ -1907,12 +1917,14 @@
|
|
|
1907
1917
|
display: none;
|
|
1908
1918
|
}
|
|
1909
1919
|
|
|
1920
|
+
.block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter,
|
|
1910
1921
|
.block-editor-default-block-appender .block-editor-inserter {
|
|
1911
1922
|
position: absolute;
|
|
1912
1923
|
top: 0;
|
|
1913
1924
|
left: 0;
|
|
1914
1925
|
line-height: 0;
|
|
1915
1926
|
}
|
|
1927
|
+
.block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter:disabled,
|
|
1916
1928
|
.block-editor-default-block-appender .block-editor-inserter:disabled {
|
|
1917
1929
|
display: none;
|
|
1918
1930
|
}
|
|
@@ -4081,9 +4093,13 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
|
|
|
4081
4093
|
text-align: left;
|
|
4082
4094
|
}
|
|
4083
4095
|
|
|
4096
|
+
.block-editor-inserter__manage-reusable-blocks-container {
|
|
4097
|
+
margin: auto 16px 16px;
|
|
4098
|
+
}
|
|
4099
|
+
|
|
4084
4100
|
.block-editor-inserter__manage-reusable-blocks {
|
|
4085
|
-
|
|
4086
|
-
|
|
4101
|
+
justify-content: center;
|
|
4102
|
+
width: 100%;
|
|
4087
4103
|
}
|
|
4088
4104
|
|
|
4089
4105
|
.block-editor-inserter__no-results {
|
|
@@ -4240,10 +4256,6 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
|
|
|
4240
4256
|
position: relative;
|
|
4241
4257
|
}
|
|
4242
4258
|
|
|
4243
|
-
.block-editor-inserter__manage-reusable-blocks-container {
|
|
4244
|
-
padding: 16px;
|
|
4245
|
-
}
|
|
4246
|
-
|
|
4247
4259
|
.block-editor-inserter__quick-inserter {
|
|
4248
4260
|
width: 100%;
|
|
4249
4261
|
max-width: 100%;
|
|
@@ -4328,7 +4340,8 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
|
|
|
4328
4340
|
padding-bottom: 32px;
|
|
4329
4341
|
}
|
|
4330
4342
|
.block-editor-block-patterns-explorer__list {
|
|
4331
|
-
margin-right:
|
|
4343
|
+
margin-right: 280px;
|
|
4344
|
+
padding: 24px 0 32px;
|
|
4332
4345
|
}
|
|
4333
4346
|
.block-editor-block-patterns-explorer .block-editor-block-patterns-list {
|
|
4334
4347
|
display: grid;
|
package/build-style/style.css
CHANGED
|
@@ -364,14 +364,20 @@
|
|
|
364
364
|
}
|
|
365
365
|
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected {
|
|
366
366
|
cursor: default;
|
|
367
|
-
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
368
|
-
border-radius: 2px;
|
|
369
367
|
}
|
|
370
368
|
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected.rich-text {
|
|
371
369
|
cursor: unset;
|
|
372
370
|
}
|
|
373
|
-
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected
|
|
374
|
-
|
|
371
|
+
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected::after {
|
|
372
|
+
content: "";
|
|
373
|
+
position: absolute;
|
|
374
|
+
pointer-events: none;
|
|
375
|
+
top: 1px;
|
|
376
|
+
left: 1px;
|
|
377
|
+
right: 1px;
|
|
378
|
+
bottom: 1px;
|
|
379
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
380
|
+
border-radius: 2px;
|
|
375
381
|
}
|
|
376
382
|
|
|
377
383
|
.is-focus-mode .block-editor-block-list__block:not(.has-child-selected) {
|
|
@@ -545,6 +551,14 @@
|
|
|
545
551
|
}
|
|
546
552
|
}
|
|
547
553
|
|
|
554
|
+
.block-editor-block-list__block-side-inserter-popover .components-popover__content > div {
|
|
555
|
+
pointer-events: none;
|
|
556
|
+
}
|
|
557
|
+
.block-editor-block-list__block-side-inserter-popover .components-popover__content > div > * {
|
|
558
|
+
pointer-events: all;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.block-editor-block-list__empty-block-inserter .block-editor-inserter__toggle.components-button.has-icon,
|
|
548
562
|
.block-editor-default-block-appender .block-editor-inserter__toggle.components-button.has-icon,
|
|
549
563
|
.block-editor-block-list__insertion-point-inserter .block-editor-inserter__toggle.components-button.has-icon {
|
|
550
564
|
background: #1e1e1e;
|
|
@@ -554,6 +568,7 @@
|
|
|
554
568
|
min-width: 24px;
|
|
555
569
|
height: 24px;
|
|
556
570
|
}
|
|
571
|
+
.block-editor-block-list__empty-block-inserter .block-editor-inserter__toggle.components-button.has-icon:hover,
|
|
557
572
|
.block-editor-default-block-appender .block-editor-inserter__toggle.components-button.has-icon:hover,
|
|
558
573
|
.block-editor-block-list__insertion-point-inserter .block-editor-inserter__toggle.components-button.has-icon:hover {
|
|
559
574
|
color: #fff;
|
|
@@ -645,6 +660,9 @@
|
|
|
645
660
|
.block-editor-block-list__block-selection-button .components-button:active {
|
|
646
661
|
color: #fff;
|
|
647
662
|
}
|
|
663
|
+
.block-editor-block-list__block-selection-button .components-button[aria-disabled=true]:hover {
|
|
664
|
+
color: #fff;
|
|
665
|
+
}
|
|
648
666
|
.block-editor-block-list__block-selection-button .block-selection-button_select-button.components-button {
|
|
649
667
|
padding: 0;
|
|
650
668
|
}
|
|
@@ -715,25 +733,18 @@
|
|
|
715
733
|
.block-editor-block-lock-modal__options-title .components-base-control__field {
|
|
716
734
|
align-items: center;
|
|
717
735
|
display: flex;
|
|
718
|
-
margin: 0;
|
|
719
736
|
}
|
|
720
737
|
|
|
721
738
|
.block-editor-block-lock-modal__checklist-item {
|
|
722
|
-
margin-bottom: 0;
|
|
723
|
-
padding: 12px 0 12px 32px;
|
|
724
|
-
}
|
|
725
|
-
.block-editor-block-lock-modal__checklist-item .components-base-control__field {
|
|
726
|
-
align-items: center;
|
|
727
|
-
display: flex;
|
|
728
|
-
margin: 0;
|
|
729
|
-
}
|
|
730
|
-
.block-editor-block-lock-modal__checklist-item .components-checkbox-control__label {
|
|
731
739
|
display: flex;
|
|
732
|
-
align-items: center;
|
|
733
740
|
justify-content: space-between;
|
|
734
|
-
|
|
741
|
+
align-items: center;
|
|
742
|
+
gap: 12px;
|
|
743
|
+
margin-bottom: 0;
|
|
744
|
+
padding: 12px 0 12px 32px;
|
|
735
745
|
}
|
|
736
|
-
.block-editor-block-lock-modal__checklist-item .
|
|
746
|
+
.block-editor-block-lock-modal__checklist-item .block-editor-block-lock-modal__lock-icon {
|
|
747
|
+
flex-shrink: 0;
|
|
737
748
|
margin-right: 12px;
|
|
738
749
|
fill: #1e1e1e;
|
|
739
750
|
}
|
|
@@ -1014,7 +1025,6 @@
|
|
|
1014
1025
|
}
|
|
1015
1026
|
.block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container > *::before {
|
|
1016
1027
|
height: calc(100% - 4px);
|
|
1017
|
-
width: calc(100% - 4px);
|
|
1018
1028
|
}
|
|
1019
1029
|
.block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container .block-editor-block-mover-button.is-up-button svg {
|
|
1020
1030
|
top: 5px;
|
|
@@ -1151,7 +1161,7 @@
|
|
|
1151
1161
|
width: max-content;
|
|
1152
1162
|
overflow-y: visible;
|
|
1153
1163
|
}
|
|
1154
|
-
.components-popover.block-editor-block-popover:not(.block-editor-block-popover__inbetween, .block-editor-block-popover__drop-zone) .components-popover__content * {
|
|
1164
|
+
.components-popover.block-editor-block-popover:not(.block-editor-block-popover__inbetween, .block-editor-block-popover__drop-zone, .block-editor-block-list__block-side-inserter-popover) .components-popover__content * {
|
|
1155
1165
|
pointer-events: all;
|
|
1156
1166
|
}
|
|
1157
1167
|
|
|
@@ -1907,12 +1917,14 @@
|
|
|
1907
1917
|
display: none;
|
|
1908
1918
|
}
|
|
1909
1919
|
|
|
1920
|
+
.block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter,
|
|
1910
1921
|
.block-editor-default-block-appender .block-editor-inserter {
|
|
1911
1922
|
position: absolute;
|
|
1912
1923
|
top: 0;
|
|
1913
1924
|
right: 0;
|
|
1914
1925
|
line-height: 0;
|
|
1915
1926
|
}
|
|
1927
|
+
.block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter:disabled,
|
|
1916
1928
|
.block-editor-default-block-appender .block-editor-inserter:disabled {
|
|
1917
1929
|
display: none;
|
|
1918
1930
|
}
|
|
@@ -4081,9 +4093,13 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
|
|
|
4081
4093
|
text-align: right;
|
|
4082
4094
|
}
|
|
4083
4095
|
|
|
4096
|
+
.block-editor-inserter__manage-reusable-blocks-container {
|
|
4097
|
+
margin: auto 16px 16px;
|
|
4098
|
+
}
|
|
4099
|
+
|
|
4084
4100
|
.block-editor-inserter__manage-reusable-blocks {
|
|
4085
|
-
|
|
4086
|
-
|
|
4101
|
+
justify-content: center;
|
|
4102
|
+
width: 100%;
|
|
4087
4103
|
}
|
|
4088
4104
|
|
|
4089
4105
|
.block-editor-inserter__no-results {
|
|
@@ -4240,10 +4256,6 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
|
|
|
4240
4256
|
position: relative;
|
|
4241
4257
|
}
|
|
4242
4258
|
|
|
4243
|
-
.block-editor-inserter__manage-reusable-blocks-container {
|
|
4244
|
-
padding: 16px;
|
|
4245
|
-
}
|
|
4246
|
-
|
|
4247
4259
|
.block-editor-inserter__quick-inserter {
|
|
4248
4260
|
width: 100%;
|
|
4249
4261
|
max-width: 100%;
|
|
@@ -4328,7 +4340,8 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
|
|
|
4328
4340
|
padding-bottom: 32px;
|
|
4329
4341
|
}
|
|
4330
4342
|
.block-editor-block-patterns-explorer__list {
|
|
4331
|
-
margin-left:
|
|
4343
|
+
margin-left: 280px;
|
|
4344
|
+
padding: 24px 0 32px;
|
|
4332
4345
|
}
|
|
4333
4346
|
.block-editor-block-patterns-explorer .block-editor-block-patterns-list {
|
|
4334
4347
|
display: grid;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.5.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -33,32 +33,32 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.16.0",
|
|
35
35
|
"@react-spring/web": "^9.4.5",
|
|
36
|
-
"@wordpress/a11y": "^3.
|
|
37
|
-
"@wordpress/api-fetch": "^6.
|
|
38
|
-
"@wordpress/blob": "^3.
|
|
39
|
-
"@wordpress/blocks": "^11.
|
|
40
|
-
"@wordpress/components": "^22.
|
|
41
|
-
"@wordpress/compose": "^5.
|
|
42
|
-
"@wordpress/data": "^7.
|
|
43
|
-
"@wordpress/date": "^4.
|
|
44
|
-
"@wordpress/deprecated": "^3.
|
|
45
|
-
"@wordpress/dom": "^3.
|
|
46
|
-
"@wordpress/element": "^4.
|
|
47
|
-
"@wordpress/hooks": "^3.
|
|
48
|
-
"@wordpress/html-entities": "^3.
|
|
49
|
-
"@wordpress/i18n": "^4.
|
|
50
|
-
"@wordpress/icons": "^9.
|
|
51
|
-
"@wordpress/is-shallow-equal": "^4.
|
|
52
|
-
"@wordpress/keyboard-shortcuts": "^3.
|
|
53
|
-
"@wordpress/keycodes": "^3.
|
|
54
|
-
"@wordpress/notices": "^3.
|
|
55
|
-
"@wordpress/rich-text": "^5.
|
|
56
|
-
"@wordpress/shortcode": "^3.
|
|
57
|
-
"@wordpress/style-engine": "^1.
|
|
58
|
-
"@wordpress/token-list": "^2.
|
|
59
|
-
"@wordpress/url": "^3.
|
|
60
|
-
"@wordpress/warning": "^2.
|
|
61
|
-
"@wordpress/wordcount": "^3.
|
|
36
|
+
"@wordpress/a11y": "^3.22.0",
|
|
37
|
+
"@wordpress/api-fetch": "^6.19.0",
|
|
38
|
+
"@wordpress/blob": "^3.22.0",
|
|
39
|
+
"@wordpress/blocks": "^11.21.0",
|
|
40
|
+
"@wordpress/components": "^22.1.0",
|
|
41
|
+
"@wordpress/compose": "^5.20.0",
|
|
42
|
+
"@wordpress/data": "^7.6.0",
|
|
43
|
+
"@wordpress/date": "^4.22.0",
|
|
44
|
+
"@wordpress/deprecated": "^3.22.0",
|
|
45
|
+
"@wordpress/dom": "^3.22.0",
|
|
46
|
+
"@wordpress/element": "^4.20.0",
|
|
47
|
+
"@wordpress/hooks": "^3.22.0",
|
|
48
|
+
"@wordpress/html-entities": "^3.22.0",
|
|
49
|
+
"@wordpress/i18n": "^4.22.0",
|
|
50
|
+
"@wordpress/icons": "^9.13.0",
|
|
51
|
+
"@wordpress/is-shallow-equal": "^4.22.0",
|
|
52
|
+
"@wordpress/keyboard-shortcuts": "^3.20.0",
|
|
53
|
+
"@wordpress/keycodes": "^3.22.0",
|
|
54
|
+
"@wordpress/notices": "^3.22.0",
|
|
55
|
+
"@wordpress/rich-text": "^5.20.0",
|
|
56
|
+
"@wordpress/shortcode": "^3.22.0",
|
|
57
|
+
"@wordpress/style-engine": "^1.5.0",
|
|
58
|
+
"@wordpress/token-list": "^2.22.0",
|
|
59
|
+
"@wordpress/url": "^3.23.0",
|
|
60
|
+
"@wordpress/warning": "^2.22.0",
|
|
61
|
+
"@wordpress/wordcount": "^3.22.0",
|
|
62
62
|
"change-case": "^4.1.2",
|
|
63
63
|
"classnames": "^2.3.1",
|
|
64
64
|
"colord": "^2.7.0",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "7ac04f446242452d3cb24372f9ca58f0cae97715"
|
|
83
83
|
}
|
|
@@ -40,7 +40,7 @@ _Note:_ In this example that we render `AlignmentControl` as a child of the `Blo
|
|
|
40
40
|
|
|
41
41
|
- **Type:** `String`
|
|
42
42
|
- **Default:** `undefined`
|
|
43
|
-
- **Options
|
|
43
|
+
- **Options:** `left`, `center`, `right`
|
|
44
44
|
|
|
45
45
|
The current value of the alignment setting. You may only choose from the `Options` listed above.
|
|
46
46
|
|
|
@@ -13,9 +13,9 @@ it( 'should call onChange with undefined when the control is already active', ()
|
|
|
13
13
|
const screen = render(
|
|
14
14
|
<BlockAlignmentUI value="right" onChange={ onChangeMock } />
|
|
15
15
|
);
|
|
16
|
-
const alignButton = screen.
|
|
16
|
+
const alignButton = screen.getByLabelText( 'Align' );
|
|
17
17
|
fireEvent.press( alignButton );
|
|
18
|
-
const rightAlignmentButton = screen.
|
|
18
|
+
const rightAlignmentButton = screen.getByLabelText( 'Align right' );
|
|
19
19
|
fireEvent.press( rightAlignmentButton );
|
|
20
20
|
|
|
21
21
|
expect( onChangeMock ).toHaveBeenCalledTimes( 1 );
|
|
@@ -27,9 +27,9 @@ it( 'should call onChange with alignment value when the control is inactive', ()
|
|
|
27
27
|
const screen = render(
|
|
28
28
|
<BlockAlignmentUI value="left" onChange={ onChangeMock } />
|
|
29
29
|
);
|
|
30
|
-
const alignButton = screen.
|
|
30
|
+
const alignButton = screen.getByLabelText( 'Align' );
|
|
31
31
|
fireEvent.press( alignButton );
|
|
32
|
-
const centerAlignmentButton = screen.
|
|
32
|
+
const centerAlignmentButton = screen.getByLabelText( 'Align center' );
|
|
33
33
|
fireEvent.press( centerAlignmentButton );
|
|
34
34
|
|
|
35
35
|
expect( onChangeMock ).toHaveBeenCalledTimes( 1 );
|
|
@@ -53,14 +53,14 @@ export const initializeWithBlocksLayouts = async ( blocks ) => {
|
|
|
53
53
|
const initialHtml = blocks.map( ( block ) => block.html ).join( '\n' );
|
|
54
54
|
|
|
55
55
|
const screen = await initializeEditor( { initialHtml } );
|
|
56
|
-
const {
|
|
56
|
+
const { getByLabelText } = screen;
|
|
57
57
|
|
|
58
58
|
const waitPromises = [];
|
|
59
59
|
blocks.forEach( ( block, index ) => {
|
|
60
60
|
const a11yLabel = new RegExp(
|
|
61
61
|
`${ block.name } Block\\. Row ${ index + 1 }`
|
|
62
62
|
);
|
|
63
|
-
const element =
|
|
63
|
+
const element = getByLabelText( a11yLabel );
|
|
64
64
|
// "onLayout" event will populate the blocks layouts data.
|
|
65
65
|
fireEvent( element, 'layout', {
|
|
66
66
|
nativeEvent: { layout: block.layout },
|
|
@@ -92,7 +92,7 @@ export const initializeWithBlocksLayouts = async ( blocks ) => {
|
|
|
92
92
|
`${ nestedBlock.name } Block\\. Row ${ nestedIndex + 1 }`
|
|
93
93
|
);
|
|
94
94
|
fireEvent(
|
|
95
|
-
within( element ).
|
|
95
|
+
within( element ).getByLabelText( nestedA11yLabel ),
|
|
96
96
|
'layout',
|
|
97
97
|
{
|
|
98
98
|
nativeEvent: { layout: nestedBlock.layout },
|
|
@@ -93,11 +93,11 @@ describe( 'BlockDraggable', () => {
|
|
|
93
93
|
it( 'enables drag mode when unselected', async () =>
|
|
94
94
|
withReanimatedTimer( async () => {
|
|
95
95
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
96
|
-
const {
|
|
96
|
+
const { getByLabelText } = screen;
|
|
97
97
|
|
|
98
98
|
// Start dragging from block's content
|
|
99
99
|
fireLongPress(
|
|
100
|
-
|
|
100
|
+
getByLabelText( /Paragraph Block\. Row 1/ ),
|
|
101
101
|
'draggable-trigger-content'
|
|
102
102
|
);
|
|
103
103
|
expect( getDraggableChip( screen ) ).toBeVisible();
|
|
@@ -112,12 +112,12 @@ describe( 'BlockDraggable', () => {
|
|
|
112
112
|
it( 'enables drag mode when selected', async () =>
|
|
113
113
|
withReanimatedTimer( async () => {
|
|
114
114
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
115
|
-
const {
|
|
115
|
+
const { getByLabelText } = screen;
|
|
116
116
|
const blockDraggableWrapper = getByGestureTestId(
|
|
117
117
|
'block-draggable-wrapper'
|
|
118
118
|
);
|
|
119
119
|
|
|
120
|
-
const paragraphBlock =
|
|
120
|
+
const paragraphBlock = getByLabelText(
|
|
121
121
|
/Paragraph Block\. Row 1/
|
|
122
122
|
);
|
|
123
123
|
fireEvent.press( paragraphBlock );
|
|
@@ -146,9 +146,9 @@ describe( 'BlockDraggable', () => {
|
|
|
146
146
|
it( 'does not enable drag mode when selected and editing text', async () =>
|
|
147
147
|
withReanimatedTimer( async () => {
|
|
148
148
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
149
|
-
const {
|
|
149
|
+
const { getByLabelText } = screen;
|
|
150
150
|
|
|
151
|
-
const paragraphBlock =
|
|
151
|
+
const paragraphBlock = getByLabelText(
|
|
152
152
|
/Paragraph Block\. Row 1/
|
|
153
153
|
);
|
|
154
154
|
|
|
@@ -178,13 +178,13 @@ describe( 'BlockDraggable', () => {
|
|
|
178
178
|
it( 'finishes editing text and enables drag mode when long-pressing over a different block', async () =>
|
|
179
179
|
withReanimatedTimer( async () => {
|
|
180
180
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
181
|
-
const {
|
|
181
|
+
const { getByLabelText } = screen;
|
|
182
182
|
|
|
183
|
-
const paragraphBlock =
|
|
183
|
+
const paragraphBlock = getByLabelText(
|
|
184
184
|
/Paragraph Block\. Row 1/
|
|
185
185
|
);
|
|
186
186
|
const spacerBlock =
|
|
187
|
-
|
|
187
|
+
getByLabelText( /Spacer Block\. Row 3/ );
|
|
188
188
|
|
|
189
189
|
// Select Paragraph block and start editing text
|
|
190
190
|
fireEvent.press( paragraphBlock );
|
|
@@ -208,12 +208,12 @@ describe( 'BlockDraggable', () => {
|
|
|
208
208
|
it( 'enables drag mode when unselected', async () =>
|
|
209
209
|
withReanimatedTimer( async () => {
|
|
210
210
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
211
|
-
const {
|
|
211
|
+
const { getAllByLabelText } = screen;
|
|
212
212
|
|
|
213
213
|
// We select the first Image block as the Gallery block
|
|
214
214
|
// also contains Image blocks.
|
|
215
215
|
const imageBlock =
|
|
216
|
-
|
|
216
|
+
getAllByLabelText( /Image Block\. Row 2/ )[ 0 ];
|
|
217
217
|
// Start dragging from block's content
|
|
218
218
|
fireLongPress( imageBlock, 'draggable-trigger-content' );
|
|
219
219
|
expect( getDraggableChip( screen ) ).toBeVisible();
|
|
@@ -228,7 +228,7 @@ describe( 'BlockDraggable', () => {
|
|
|
228
228
|
it( 'enables drag mode when selected', async () =>
|
|
229
229
|
withReanimatedTimer( async () => {
|
|
230
230
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
231
|
-
const {
|
|
231
|
+
const { getAllByLabelText } = screen;
|
|
232
232
|
const blockDraggableWrapper = getByGestureTestId(
|
|
233
233
|
'block-draggable-wrapper'
|
|
234
234
|
);
|
|
@@ -236,7 +236,7 @@ describe( 'BlockDraggable', () => {
|
|
|
236
236
|
// We select the first Image block as the Gallery block
|
|
237
237
|
// also contains Image blocks.
|
|
238
238
|
const imageBlock =
|
|
239
|
-
|
|
239
|
+
getAllByLabelText( /Image Block\. Row 2/ )[ 0 ];
|
|
240
240
|
fireEvent.press( imageBlock );
|
|
241
241
|
|
|
242
242
|
// Start dragging from block's content
|
|
@@ -262,12 +262,12 @@ describe( 'BlockDraggable', () => {
|
|
|
262
262
|
it( 'enables drag mode when unselected', async () =>
|
|
263
263
|
withReanimatedTimer( async () => {
|
|
264
264
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
265
|
-
const {
|
|
265
|
+
const { getByLabelText } = screen;
|
|
266
266
|
|
|
267
267
|
// Start dragging from block's content, specifically the first
|
|
268
268
|
// trigger index, which corresponds to the Gallery block content.
|
|
269
269
|
fireLongPress(
|
|
270
|
-
|
|
270
|
+
getByLabelText( /Gallery Block\. Row 4/ ),
|
|
271
271
|
'draggable-trigger-content',
|
|
272
272
|
{ triggerIndex: 0 }
|
|
273
273
|
);
|
|
@@ -283,12 +283,12 @@ describe( 'BlockDraggable', () => {
|
|
|
283
283
|
it( 'enables drag mode when selected', async () =>
|
|
284
284
|
withReanimatedTimer( async () => {
|
|
285
285
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
286
|
-
const {
|
|
286
|
+
const { getByLabelText } = screen;
|
|
287
287
|
const blockDraggableWrapper = getByGestureTestId(
|
|
288
288
|
'block-draggable-wrapper'
|
|
289
289
|
);
|
|
290
290
|
|
|
291
|
-
const galleryBlock =
|
|
291
|
+
const galleryBlock = getByLabelText(
|
|
292
292
|
/Gallery Block\. Row 4/
|
|
293
293
|
);
|
|
294
294
|
await waitForStoreResolvers( () =>
|
|
@@ -319,16 +319,16 @@ describe( 'BlockDraggable', () => {
|
|
|
319
319
|
it( 'enables drag mode when nested block is selected', async () =>
|
|
320
320
|
withReanimatedTimer( async () => {
|
|
321
321
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
322
|
-
const {
|
|
322
|
+
const { getByLabelText } = screen;
|
|
323
323
|
const blockDraggableWrapper = getByGestureTestId(
|
|
324
324
|
'block-draggable-wrapper'
|
|
325
325
|
);
|
|
326
326
|
|
|
327
|
-
const galleryBlock =
|
|
327
|
+
const galleryBlock = getByLabelText(
|
|
328
328
|
/Gallery Block\. Row 4/
|
|
329
329
|
);
|
|
330
330
|
const galleryItem =
|
|
331
|
-
within( galleryBlock ).
|
|
331
|
+
within( galleryBlock ).getByLabelText(
|
|
332
332
|
/Image Block\. Row 2/
|
|
333
333
|
);
|
|
334
334
|
fireEvent.press( galleryBlock );
|
|
@@ -361,11 +361,11 @@ describe( 'BlockDraggable', () => {
|
|
|
361
361
|
it( 'enables drag mode when unselected', async () =>
|
|
362
362
|
withReanimatedTimer( async () => {
|
|
363
363
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
364
|
-
const {
|
|
364
|
+
const { getByLabelText } = screen;
|
|
365
365
|
|
|
366
366
|
// Start dragging from block's content
|
|
367
367
|
fireLongPress(
|
|
368
|
-
|
|
368
|
+
getByLabelText( /Spacer Block\. Row 3/ ),
|
|
369
369
|
'draggable-trigger-content'
|
|
370
370
|
);
|
|
371
371
|
expect( getDraggableChip( screen ) ).toBeVisible();
|
|
@@ -380,13 +380,13 @@ describe( 'BlockDraggable', () => {
|
|
|
380
380
|
it( 'enables drag mode when selected', async () =>
|
|
381
381
|
withReanimatedTimer( async () => {
|
|
382
382
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
383
|
-
const {
|
|
383
|
+
const { getByLabelText } = screen;
|
|
384
384
|
const blockDraggableWrapper = getByGestureTestId(
|
|
385
385
|
'block-draggable-wrapper'
|
|
386
386
|
);
|
|
387
387
|
|
|
388
388
|
const spacerBlock =
|
|
389
|
-
|
|
389
|
+
getByLabelText( /Spacer Block\. Row 3/ );
|
|
390
390
|
await waitForStoreResolvers( () =>
|
|
391
391
|
fireEvent.press( spacerBlock )
|
|
392
392
|
);
|
|
@@ -413,7 +413,7 @@ describe( 'BlockDraggable', () => {
|
|
|
413
413
|
|
|
414
414
|
it( 'moves blocks', async () =>
|
|
415
415
|
withReanimatedTimer( async () => {
|
|
416
|
-
const {
|
|
416
|
+
const { getByLabelText } = await initializeWithBlocksLayouts(
|
|
417
417
|
BLOCKS
|
|
418
418
|
);
|
|
419
419
|
const blockDraggableWrapper = getByGestureTestId(
|
|
@@ -424,7 +424,7 @@ describe( 'BlockDraggable', () => {
|
|
|
424
424
|
|
|
425
425
|
// Move Paragraph block from first to second position
|
|
426
426
|
fireLongPress(
|
|
427
|
-
|
|
427
|
+
getByLabelText( /Paragraph Block\. Row 1/ ),
|
|
428
428
|
'draggable-trigger-content'
|
|
429
429
|
);
|
|
430
430
|
firePanGesture( blockDraggableWrapper, [
|
|
@@ -454,7 +454,7 @@ describe( 'BlockDraggable', () => {
|
|
|
454
454
|
|
|
455
455
|
// Move Spacer block from third to first position
|
|
456
456
|
fireLongPress(
|
|
457
|
-
|
|
457
|
+
getByLabelText( /Spacer Block\. Row 3/ ),
|
|
458
458
|
'draggable-trigger-content'
|
|
459
459
|
);
|
|
460
460
|
firePanGesture( blockDraggableWrapper, [
|
|
@@ -290,11 +290,16 @@
|
|
|
290
290
|
cursor: unset;
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
293
|
+
&::after {
|
|
294
|
+
content: "";
|
|
295
|
+
position: absolute;
|
|
296
|
+
pointer-events: none;
|
|
297
|
+
top: $border-width;
|
|
298
|
+
left: $border-width;
|
|
299
|
+
right: $border-width;
|
|
300
|
+
bottom: $border-width;
|
|
301
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
302
|
+
border-radius: $radius-block-ui;
|
|
298
303
|
}
|
|
299
304
|
}
|
|
300
305
|
}
|