@wordpress/block-editor 11.8.0 → 12.1.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 +10 -0
- package/README.md +16 -4
- package/build/components/block-controls/slot.js +12 -4
- package/build/components/block-controls/slot.js.map +1 -1
- package/build/components/block-controls/slot.native.js +10 -1
- package/build/components/block-controls/slot.native.js.map +1 -1
- package/build/components/block-draggable/index.js +11 -7
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-draggable/use-scroll-when-dragging.js +2 -2
- package/build/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
- package/build/components/block-info-slot-fill/index.js +47 -0
- package/build/components/block-info-slot-fill/index.js.map +1 -0
- package/build/components/block-inspector/index.js +4 -2
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-invalid-warning.native.js +15 -7
- package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build/components/block-list/block-list-item-cell.native.js +15 -2
- package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build/components/block-list/block-list-item.native.js +158 -195
- package/build/components/block-list/block-list-item.native.js.map +1 -1
- package/build/components/block-list/block-outline.native.js +57 -0
- package/build/components/block-list/block-outline.native.js.map +1 -0
- package/build/components/block-list/block.native.js +343 -300
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.native.js +202 -298
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/insertion-point.native.js +4 -2
- package/build/components/block-list/insertion-point.native.js.map +1 -1
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +8 -10
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +15 -4
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +2 -1
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +40 -11
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +8 -30
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +3 -2
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build/components/editor-styles/index.js +4 -3
- package/build/components/editor-styles/index.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +21 -14
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/global-styles/advanced-panel.js +86 -0
- package/build/components/global-styles/advanced-panel.js.map +1 -0
- package/build/components/global-styles/border-panel.js +2 -32
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +16 -13
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.native.js +174 -0
- package/build/components/global-styles/color-panel.native.js.map +1 -0
- package/build/components/global-styles/dimensions-panel.js +12 -12
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/effects-panel.js +1 -1
- package/build/components/global-styles/effects-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +78 -14
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +1 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +24 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +10 -10
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +114 -81
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +30 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/image-editor/use-save-image.js +24 -8
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/index.js +7 -0
- package/build/components/index.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +12 -7
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/index.js +2 -1
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +5 -0
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inspector-controls/fill.js +1 -1
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/fill.native.js +1 -1
- package/build/components/inspector-controls/fill.native.js.map +1 -1
- package/build/components/inspector-controls/groups.js +2 -0
- package/build/components/inspector-controls/groups.js.map +1 -1
- package/build/components/inspector-controls/slot.js +3 -6
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls/slot.native.js +1 -1
- package/build/components/inspector-controls/slot.native.js.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js +2 -0
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/line-height-control/index.js +7 -2
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/link-control/use-internal-input-value.js +9 -8
- package/build/components/link-control/use-internal-input-value.js.map +1 -1
- package/build/components/list-view/block-contents.js +7 -2
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block-select-button.js +9 -3
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +16 -25
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/drop-indicator.js +37 -10
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/list-view/index.js +38 -18
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/leaf.js +2 -1
- package/build/components/list-view/leaf.js.map +1 -1
- package/build/components/list-view/use-block-selection.js +1 -1
- package/build/components/list-view/use-block-selection.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js +163 -11
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/media-placeholder/index.js +68 -7
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-replace-flow/index.js +5 -5
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/multi-selection-inspector/index.js +2 -2
- package/build/components/multi-selection-inspector/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +12 -4
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/off-canvas-editor/appender.js +2 -7
- package/build/components/off-canvas-editor/appender.js.map +1 -1
- package/build/components/off-canvas-editor/leaf-more-menu.js +3 -1
- package/build/components/off-canvas-editor/leaf-more-menu.js.map +1 -1
- package/build/components/preview-options/index.js +6 -1
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js +1 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build/components/url-input/index.js +1 -2
- package/build/components/url-input/index.js.map +1 -1
- package/build/hooks/align.js +1 -1
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/border.js +1 -1
- package/build/hooks/border.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 +8 -12
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/duotone.js +29 -4
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/index.native.js +8 -0
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/layout.js +2 -2
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/position.js +1 -1
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/style.js +1 -1
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/use-editor-wrapper-styles.native.js +255 -0
- package/build/hooks/use-editor-wrapper-styles.native.js.map +1 -0
- package/build/hooks/use-typography-props.js +14 -10
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/hooks/utils.js +15 -3
- package/build/hooks/utils.js.map +1 -1
- package/build/index.native.js +31 -0
- package/build/index.native.js.map +1 -0
- package/build/private-apis.js +10 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +7 -0
- package/build/store/actions.js.map +1 -1
- package/build/utils/object.js +5 -5
- package/build/utils/object.js.map +1 -1
- package/build/utils/transform-styles/index.js +2 -2
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build/utils/use-should-contextual-toolbar-show.js +72 -0
- package/build/utils/use-should-contextual-toolbar-show.js.map +1 -0
- package/build-module/components/block-controls/slot.js +11 -4
- package/build-module/components/block-controls/slot.js.map +1 -1
- package/build-module/components/block-controls/slot.native.js +9 -1
- package/build-module/components/block-controls/slot.native.js.map +1 -1
- package/build-module/components/block-draggable/index.js +10 -6
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-draggable/use-scroll-when-dragging.js +2 -2
- package/build-module/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
- package/build-module/components/block-info-slot-fill/index.js +34 -0
- package/build-module/components/block-info-slot-fill/index.js.map +1 -0
- package/build-module/components/block-inspector/index.js +3 -2
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-invalid-warning.native.js +16 -8
- package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build-module/components/block-list/block-list-item-cell.native.js +13 -2
- package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build-module/components/block-list/block-list-item.native.js +160 -190
- package/build-module/components/block-list/block-list-item.native.js.map +1 -1
- package/build-module/components/block-list/block-outline.native.js +44 -0
- package/build-module/components/block-list/block-outline.native.js.map +1 -0
- package/build-module/components/block-list/block.native.js +341 -299
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.native.js +203 -293
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/insertion-point.native.js +4 -2
- package/build-module/components/block-list/insertion-point.native.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +8 -9
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +13 -5
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +2 -1
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +37 -11
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +8 -29
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +3 -2
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build-module/components/editor-styles/index.js +4 -3
- package/build-module/components/editor-styles/index.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +21 -14
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/global-styles/advanced-panel.js +74 -0
- package/build-module/components/global-styles/advanced-panel.js.map +1 -0
- package/build-module/components/global-styles/border-panel.js +2 -32
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +18 -15
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.native.js +150 -0
- package/build-module/components/global-styles/color-panel.native.js.map +1 -0
- package/build-module/components/global-styles/dimensions-panel.js +13 -13
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/effects-panel.js +2 -2
- package/build-module/components/global-styles/effects-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +78 -16
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +1 -2
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/index.js +3 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +11 -11
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +112 -81
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +25 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/image-editor/use-save-image.js +24 -8
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/index.js +1 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +12 -6
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/index.js +2 -1
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +4 -0
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +1 -1
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls/fill.native.js +1 -1
- package/build-module/components/inspector-controls/fill.native.js.map +1 -1
- package/build-module/components/inspector-controls/groups.js +2 -0
- package/build-module/components/inspector-controls/groups.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +4 -7
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/inspector-controls/slot.native.js +1 -1
- package/build-module/components/inspector-controls/slot.native.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +2 -0
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/line-height-control/index.js +7 -2
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/link-control/use-internal-input-value.js +9 -8
- package/build-module/components/link-control/use-internal-input-value.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +7 -3
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +9 -3
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +18 -26
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js +36 -10
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/list-view/index.js +39 -19
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/leaf.js +2 -1
- package/build-module/components/list-view/leaf.js.map +1 -1
- package/build-module/components/list-view/use-block-selection.js +1 -1
- package/build-module/components/list-view/use-block-selection.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js +160 -11
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +66 -7
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +5 -5
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/multi-selection-inspector/index.js +2 -2
- package/build-module/components/multi-selection-inspector/index.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +12 -4
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/off-canvas-editor/appender.js +1 -5
- package/build-module/components/off-canvas-editor/appender.js.map +1 -1
- package/build-module/components/off-canvas-editor/leaf-more-menu.js +3 -1
- package/build-module/components/off-canvas-editor/leaf-more-menu.js.map +1 -1
- package/build-module/components/preview-options/index.js +7 -2
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/spacing-input-control.js +1 -1
- package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build-module/components/url-input/index.js +1 -2
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/hooks/align.js +1 -1
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/border.js +1 -1
- package/build-module/hooks/border.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 +8 -11
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/duotone.js +28 -5
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/index.native.js +1 -0
- package/build-module/hooks/index.native.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/position.js +1 -1
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/style.js +1 -1
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/use-editor-wrapper-styles.native.js +242 -0
- package/build-module/hooks/use-editor-wrapper-styles.native.js.map +1 -0
- package/build-module/hooks/use-typography-props.js +14 -10
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/hooks/utils.js +16 -4
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/index.native.js +6 -0
- package/build-module/index.native.js.map +1 -0
- package/build-module/private-apis.js +7 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +7 -0
- package/build-module/store/actions.js.map +1 -1
- package/build-module/utils/object.js +4 -4
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +2 -2
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-module/utils/use-should-contextual-toolbar-show.js +60 -0
- package/build-module/utils/use-should-contextual-toolbar-show.js.map +1 -0
- package/build-style/content-rtl.css +9 -7
- package/build-style/content.css +9 -7
- package/build-style/style-rtl.css +257 -56
- package/build-style/style.css +257 -56
- package/package.json +32 -32
- package/src/components/block-breadcrumb/style.scss +2 -1
- package/src/components/block-controls/slot.js +8 -4
- package/src/components/block-controls/slot.native.js +6 -1
- package/src/components/block-draggable/index.js +10 -6
- package/src/components/block-draggable/use-scroll-when-dragging.js +8 -2
- package/src/components/block-info-slot-fill/index.js +24 -0
- package/src/components/block-inspector/index.js +3 -0
- package/src/components/block-list/block-invalid-warning.native.js +17 -9
- package/src/components/block-list/block-list-item-cell.native.js +10 -1
- package/src/components/block-list/block-list-item.native.js +180 -208
- package/src/components/block-list/block-outline.native.js +58 -0
- package/src/components/block-list/block.native.js +564 -524
- package/src/components/block-list/content.scss +16 -16
- package/src/components/block-list/index.native.js +229 -298
- package/src/components/block-list/insertion-point.native.js +2 -2
- package/src/components/block-list/test/block-invalid-warning.native.js +48 -0
- package/src/components/block-list/test/index.native.js +205 -0
- package/src/components/block-mobile-toolbar/block-actions-menu.native.js +3 -1
- package/src/components/block-mobile-toolbar/test/block-actions-menu.native.js +9 -9
- package/src/components/block-mover/style.scss +10 -4
- package/src/components/block-mover/test/index.native.js +4 -4
- package/src/components/block-pattern-setup/style.scss +1 -4
- package/src/components/block-patterns-list/style.scss +1 -4
- package/src/components/block-settings-menu/block-settings-dropdown.js +10 -17
- package/src/components/block-settings-menu-controls/index.js +24 -4
- package/src/components/block-styles/style.scss +4 -4
- package/src/components/block-toolbar/index.js +4 -3
- package/src/components/block-toolbar/style.scss +56 -33
- package/src/components/block-tools/block-contextual-toolbar.js +64 -15
- package/src/components/block-tools/selected-block-popover.js +11 -46
- package/src/components/block-tools/style.scss +165 -3
- package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +16 -2
- package/src/components/editor-styles/index.js +9 -5
- package/src/components/font-sizes/fluid-utils.js +31 -14
- package/src/components/font-sizes/test/fluid-utils.js +5 -16
- package/src/components/global-styles/advanced-panel.js +82 -0
- package/src/components/global-styles/border-panel.js +1 -30
- package/src/components/global-styles/color-panel.js +19 -14
- package/src/components/global-styles/color-panel.native.js +207 -0
- package/src/components/global-styles/dimensions-panel.js +23 -13
- package/src/components/global-styles/effects-panel.js +2 -2
- package/src/components/global-styles/filters-panel.js +90 -17
- package/src/components/global-styles/hooks.js +1 -5
- package/src/components/global-styles/index.js +6 -1
- package/src/components/global-styles/style.scss +16 -1
- package/src/components/global-styles/test/typography-utils.js +63 -22
- package/src/components/global-styles/test/use-global-styles-output.js +126 -4
- package/src/components/global-styles/test/utils.js +57 -1
- package/src/components/global-styles/typography-panel.js +38 -12
- package/src/components/global-styles/use-global-styles-output.js +85 -67
- package/src/components/global-styles/utils.js +27 -0
- package/src/components/image-editor/use-save-image.js +20 -9
- package/src/components/index.js +1 -0
- package/src/components/inserter/block-types-tab.js +9 -6
- package/src/components/inserter/index.js +1 -1
- package/src/components/inserter-draggable-blocks/index.js +4 -0
- package/src/components/inspector-controls/fill.js +1 -1
- package/src/components/inspector-controls/fill.native.js +1 -1
- package/src/components/inspector-controls/groups.js +2 -0
- package/src/components/inspector-controls/slot.js +4 -9
- package/src/components/inspector-controls/slot.native.js +1 -1
- package/src/components/inspector-controls-tabs/styles-tab.js +1 -0
- package/src/components/line-height-control/index.js +7 -2
- package/src/components/line-height-control/stories/index.js +1 -1
- package/src/components/link-control/test/index.js +42 -0
- package/src/components/link-control/use-internal-input-value.js +8 -7
- package/src/components/list-view/block-contents.js +26 -20
- package/src/components/list-view/block-select-button.js +11 -2
- package/src/components/list-view/block.js +28 -33
- package/src/components/list-view/drop-indicator.js +67 -22
- package/src/components/list-view/index.js +33 -14
- package/src/components/list-view/leaf.js +1 -0
- package/src/components/list-view/style.scss +18 -3
- package/src/components/list-view/test/use-list-view-drop-zone.js +88 -12
- package/src/components/list-view/use-block-selection.js +1 -1
- package/src/components/list-view/use-list-view-drop-zone.js +194 -11
- package/src/components/media-placeholder/index.js +74 -1
- package/src/components/media-replace-flow/README.md +3 -2
- package/src/components/media-replace-flow/index.js +4 -5
- package/src/components/multi-selection-inspector/index.js +2 -2
- package/src/components/navigable-toolbar/index.js +12 -3
- package/src/components/off-canvas-editor/appender.js +1 -4
- package/src/components/off-canvas-editor/leaf-more-menu.js +2 -1
- package/src/components/preview-options/index.js +9 -2
- package/src/components/spacing-sizes-control/spacing-input-control.js +1 -0
- package/src/components/url-input/index.js +1 -2
- package/src/components/url-popover/test/__snapshots__/index.js.snap +3 -3
- package/src/hooks/align.js +2 -1
- package/src/hooks/border.js +2 -1
- package/src/hooks/color.js +2 -1
- package/src/hooks/content-lock-ui.js +3 -15
- package/src/hooks/duotone.js +47 -25
- package/src/hooks/index.native.js +1 -0
- package/src/hooks/layout.js +4 -2
- package/src/hooks/position.js +2 -1
- package/src/hooks/style.js +2 -1
- package/src/hooks/test/anchor.js +113 -0
- package/src/hooks/test/color.js +0 -9
- package/src/hooks/test/use-editor-wrapper-styles.native.js +282 -0
- package/src/hooks/test/use-typography-props.js +49 -4
- package/src/hooks/test/utils.js +20 -101
- package/src/hooks/use-editor-wrapper-styles.native.js +250 -0
- package/src/hooks/use-editor-wrapper-styles.native.scss +11 -0
- package/src/hooks/use-typography-props.js +10 -11
- package/src/hooks/utils.js +20 -3
- package/src/index.native.js +6 -0
- package/src/private-apis.js +6 -0
- package/src/store/actions.js +7 -0
- package/src/utils/object.js +4 -4
- package/src/utils/test/object.js +21 -21
- package/src/utils/transform-styles/index.js +2 -2
- package/src/utils/use-should-contextual-toolbar-show.js +85 -0
- package/tsconfig.json +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/hooks/color-panel.native.js +0 -77
- package/build/hooks/color-panel.native.js.map +0 -1
- package/build-module/hooks/color-panel.native.js +0 -62
- package/build-module/hooks/color-panel.native.js.map +0 -1
- package/src/hooks/color-panel.native.js +0 -63
|
@@ -14,7 +14,7 @@ import { withPreferredColorScheme } from '@wordpress/compose';
|
|
|
14
14
|
*/
|
|
15
15
|
import styles from './style.scss';
|
|
16
16
|
|
|
17
|
-
const BlockInsertionPoint = ( { getStylesFromColorScheme } ) => {
|
|
17
|
+
const BlockInsertionPoint = ( { getStylesFromColorScheme, testID } ) => {
|
|
18
18
|
const lineStyle = getStylesFromColorScheme(
|
|
19
19
|
styles.lineStyleAddHere,
|
|
20
20
|
styles.lineStyleAddHereDark
|
|
@@ -25,7 +25,7 @@ const BlockInsertionPoint = ( { getStylesFromColorScheme } ) => {
|
|
|
25
25
|
);
|
|
26
26
|
|
|
27
27
|
return (
|
|
28
|
-
<View style={ styles.containerStyleAddHere }>
|
|
28
|
+
<View style={ styles.containerStyleAddHere } testID={ testID }>
|
|
29
29
|
<View style={ lineStyle }></View>
|
|
30
30
|
<Text style={ labelStyle }>{ __( 'ADD BLOCK HERE' ) }</Text>
|
|
31
31
|
<View style={ lineStyle }></View>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
fireEvent,
|
|
6
|
+
getBlock,
|
|
7
|
+
getEditorHtml,
|
|
8
|
+
initializeEditor,
|
|
9
|
+
setupCoreBlocks,
|
|
10
|
+
} from 'test/helpers';
|
|
11
|
+
|
|
12
|
+
setupCoreBlocks();
|
|
13
|
+
|
|
14
|
+
describe( 'Block invalid warning', () => {
|
|
15
|
+
it( 'shows invalid placeholder', async () => {
|
|
16
|
+
// Arrange
|
|
17
|
+
const screen = await initializeEditor( {
|
|
18
|
+
initialHtml: `<!-- wp:spacer -->
|
|
19
|
+
<div styless="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
20
|
+
<!-- /wp:spacer -->`,
|
|
21
|
+
} );
|
|
22
|
+
|
|
23
|
+
// Assert
|
|
24
|
+
const warningElement = screen.getByText( /Problem displaying block./ );
|
|
25
|
+
expect( warningElement ).toBeVisible();
|
|
26
|
+
} );
|
|
27
|
+
|
|
28
|
+
it( 'recovers a block successfully', async () => {
|
|
29
|
+
// Arrange
|
|
30
|
+
const screen = await initializeEditor( {
|
|
31
|
+
initialHtml: `<!-- wp:spacer -->
|
|
32
|
+
<div styless="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
33
|
+
<!-- /wp:spacer -->`,
|
|
34
|
+
} );
|
|
35
|
+
|
|
36
|
+
// Act
|
|
37
|
+
fireEvent.press( screen.getByText( /Problem displaying block./ ) );
|
|
38
|
+
const spacerBlock = getBlock( screen, 'Spacer' );
|
|
39
|
+
fireEvent.press( spacerBlock );
|
|
40
|
+
|
|
41
|
+
// Assert
|
|
42
|
+
expect( getEditorHtml() ).toMatchInlineSnapshot( `
|
|
43
|
+
"<!-- wp:spacer -->
|
|
44
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
45
|
+
<!-- /wp:spacer -->"
|
|
46
|
+
` );
|
|
47
|
+
} );
|
|
48
|
+
} );
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
addBlock,
|
|
6
|
+
getBlock,
|
|
7
|
+
fireEvent,
|
|
8
|
+
initializeEditor,
|
|
9
|
+
screen,
|
|
10
|
+
setupCoreBlocks,
|
|
11
|
+
triggerBlockListLayout,
|
|
12
|
+
within,
|
|
13
|
+
} from 'test/helpers';
|
|
14
|
+
|
|
15
|
+
setupCoreBlocks();
|
|
16
|
+
|
|
17
|
+
describe( 'BlockList', () => {
|
|
18
|
+
describe( 'when empty', () => {
|
|
19
|
+
beforeEach( async () => {
|
|
20
|
+
// Arrange
|
|
21
|
+
await initializeEditor();
|
|
22
|
+
} );
|
|
23
|
+
|
|
24
|
+
it( 'renders a post title', async () => {
|
|
25
|
+
// Assert
|
|
26
|
+
expect( screen.getByPlaceholderText( 'Add title' ) ).toBeTruthy();
|
|
27
|
+
} );
|
|
28
|
+
|
|
29
|
+
it( 'renders a block appender as a content placeholder', async () => {
|
|
30
|
+
// Act
|
|
31
|
+
const appender = screen.getByPlaceholderText( /Start writing/ );
|
|
32
|
+
fireEvent.press( appender );
|
|
33
|
+
|
|
34
|
+
// Assert
|
|
35
|
+
expect( await getBlock( screen, 'Paragraph' ) ).toBeVisible();
|
|
36
|
+
} );
|
|
37
|
+
|
|
38
|
+
it( 'renders an end-of-list paragraph appender', async () => {
|
|
39
|
+
// Act
|
|
40
|
+
const appender = screen.getByLabelText( 'Add paragraph block' );
|
|
41
|
+
fireEvent.press( appender );
|
|
42
|
+
|
|
43
|
+
// Assert
|
|
44
|
+
expect( await getBlock( screen, 'Paragraph' ) ).toBeVisible();
|
|
45
|
+
} );
|
|
46
|
+
} );
|
|
47
|
+
|
|
48
|
+
describe( 'when not empty', () => {
|
|
49
|
+
it( 'renders a footer appender', async () => {
|
|
50
|
+
// Arrange
|
|
51
|
+
await initializeEditor();
|
|
52
|
+
await addBlock( screen, 'Social Icons' );
|
|
53
|
+
const socialLinksBlock = await getBlock( screen, 'Social Icons' );
|
|
54
|
+
fireEvent.press( socialLinksBlock );
|
|
55
|
+
triggerBlockListLayout( socialLinksBlock );
|
|
56
|
+
|
|
57
|
+
// Act
|
|
58
|
+
fireEvent.press(
|
|
59
|
+
within( socialLinksBlock ).getByTestId( 'appender-button' )
|
|
60
|
+
);
|
|
61
|
+
const blockList = screen.getByTestId( 'InserterUI-Blocks' );
|
|
62
|
+
fireEvent.scroll( blockList, {
|
|
63
|
+
nativeEvent: {
|
|
64
|
+
contentOffset: { y: 0, x: 0 },
|
|
65
|
+
contentSize: { width: 100, height: 100 },
|
|
66
|
+
layoutMeasurement: { width: 100, height: 100 },
|
|
67
|
+
},
|
|
68
|
+
} );
|
|
69
|
+
fireEvent.press( await screen.findByText( 'Amazon' ) );
|
|
70
|
+
|
|
71
|
+
// Assert
|
|
72
|
+
const amazonSettings = await screen.findByTestId(
|
|
73
|
+
'navigation-screen-LinkSettingsScreen'
|
|
74
|
+
);
|
|
75
|
+
expect( amazonSettings ).toBeVisible();
|
|
76
|
+
} );
|
|
77
|
+
} );
|
|
78
|
+
|
|
79
|
+
describe( 'for inner blocks', () => {
|
|
80
|
+
it( 'renders an inner block appender', async () => {
|
|
81
|
+
// Arrange
|
|
82
|
+
await initializeEditor();
|
|
83
|
+
await addBlock( screen, 'Group' );
|
|
84
|
+
const groupBlock = await getBlock( screen, 'Group' );
|
|
85
|
+
triggerBlockListLayout( groupBlock );
|
|
86
|
+
|
|
87
|
+
// Assert
|
|
88
|
+
expect(
|
|
89
|
+
within( groupBlock ).getByTestId( 'appender-button' )
|
|
90
|
+
).toBeTruthy();
|
|
91
|
+
} );
|
|
92
|
+
|
|
93
|
+
describe( 'when a non-last block is selected', () => {
|
|
94
|
+
beforeEach( async () => {
|
|
95
|
+
// Arrange
|
|
96
|
+
await initializeEditor();
|
|
97
|
+
await addBlock( screen, 'Group' );
|
|
98
|
+
const groupBlock = await getBlock( screen, 'Group' );
|
|
99
|
+
fireEvent.press(
|
|
100
|
+
within( groupBlock ).getByTestId( 'appender-button' )
|
|
101
|
+
);
|
|
102
|
+
await addBlock( screen, 'Paragraph', { isPickerOpened: true } );
|
|
103
|
+
fireEvent.press( screen.getByLabelText( 'Navigate Up' ) );
|
|
104
|
+
fireEvent.press(
|
|
105
|
+
within( groupBlock ).getByTestId( 'appender-button' )
|
|
106
|
+
);
|
|
107
|
+
await addBlock( screen, 'Paragraph', { isPickerOpened: true } );
|
|
108
|
+
} );
|
|
109
|
+
|
|
110
|
+
it( 'renders an insertion point before the block', async () => {
|
|
111
|
+
// Act
|
|
112
|
+
const paragraphBlock = await getBlock( screen, 'Paragraph', {
|
|
113
|
+
rowIndex: 1,
|
|
114
|
+
} );
|
|
115
|
+
fireEvent.press( paragraphBlock );
|
|
116
|
+
fireEvent( screen.getByLabelText( 'Add block' ), 'longPress' );
|
|
117
|
+
fireEvent.press( screen.getByText( 'Add Block Before' ) );
|
|
118
|
+
|
|
119
|
+
// Assert
|
|
120
|
+
expect( screen.getByText( 'ADD BLOCK HERE' ) ).toBeTruthy();
|
|
121
|
+
expect(
|
|
122
|
+
screen.getByTestId( 'block-insertion-point-before-row-1' )
|
|
123
|
+
).toBeTruthy();
|
|
124
|
+
} );
|
|
125
|
+
|
|
126
|
+
it( 'renders an insertion point after the block', async () => {
|
|
127
|
+
// Act
|
|
128
|
+
const paragraphBlock = await getBlock( screen, 'Paragraph', {
|
|
129
|
+
rowIndex: 1,
|
|
130
|
+
} );
|
|
131
|
+
fireEvent.press( paragraphBlock );
|
|
132
|
+
fireEvent( screen.getByLabelText( 'Add block' ), 'longPress' );
|
|
133
|
+
fireEvent.press( screen.getByText( 'Add Block After' ) );
|
|
134
|
+
|
|
135
|
+
// Assert
|
|
136
|
+
expect( screen.getByText( 'ADD BLOCK HERE' ) ).toBeTruthy();
|
|
137
|
+
expect(
|
|
138
|
+
screen.getByTestId( 'block-insertion-point-before-row-2' )
|
|
139
|
+
).toBeTruthy();
|
|
140
|
+
} );
|
|
141
|
+
} );
|
|
142
|
+
|
|
143
|
+
describe( 'when the last block is selected', () => {
|
|
144
|
+
it( 'renders an insertion point before the block', async () => {
|
|
145
|
+
// Arrange
|
|
146
|
+
await initializeEditor();
|
|
147
|
+
await addBlock( screen, 'Group' );
|
|
148
|
+
const groupBlock = await getBlock( screen, 'Group' );
|
|
149
|
+
fireEvent.press(
|
|
150
|
+
within( groupBlock ).getByTestId( 'appender-button' )
|
|
151
|
+
);
|
|
152
|
+
await addBlock( screen, 'Paragraph', { isPickerOpened: true } );
|
|
153
|
+
fireEvent.press( screen.getByLabelText( 'Navigate Up' ) );
|
|
154
|
+
fireEvent.press(
|
|
155
|
+
within( groupBlock ).getByTestId( 'appender-button' )
|
|
156
|
+
);
|
|
157
|
+
await addBlock( screen, 'Paragraph', { isPickerOpened: true } );
|
|
158
|
+
|
|
159
|
+
// Act
|
|
160
|
+
const paragraphBlock = await getBlock( screen, 'Paragraph', {
|
|
161
|
+
rowIndex: 2,
|
|
162
|
+
} );
|
|
163
|
+
fireEvent.press( paragraphBlock );
|
|
164
|
+
fireEvent( screen.getByLabelText( 'Add block' ), 'longPress' );
|
|
165
|
+
fireEvent.press( screen.getByText( 'Add Block Before' ) );
|
|
166
|
+
|
|
167
|
+
// Assert
|
|
168
|
+
expect( screen.getByText( 'ADD BLOCK HERE' ) ).toBeTruthy();
|
|
169
|
+
expect(
|
|
170
|
+
screen.getByTestId( 'block-insertion-point-before-row-2' )
|
|
171
|
+
).toBeTruthy();
|
|
172
|
+
} );
|
|
173
|
+
|
|
174
|
+
it( 'renders an insertion point after the block', async () => {
|
|
175
|
+
// Arrange
|
|
176
|
+
await initializeEditor();
|
|
177
|
+
await addBlock( screen, 'Group' );
|
|
178
|
+
const groupBlock = await getBlock( screen, 'Group' );
|
|
179
|
+
fireEvent.press(
|
|
180
|
+
within( groupBlock ).getByTestId( 'appender-button' )
|
|
181
|
+
);
|
|
182
|
+
await addBlock( screen, 'Paragraph', { isPickerOpened: true } );
|
|
183
|
+
fireEvent.press( screen.getByLabelText( 'Navigate Up' ) );
|
|
184
|
+
fireEvent.press(
|
|
185
|
+
within( groupBlock ).getByTestId( 'appender-button' )
|
|
186
|
+
);
|
|
187
|
+
await addBlock( screen, 'Paragraph', { isPickerOpened: true } );
|
|
188
|
+
|
|
189
|
+
// Act
|
|
190
|
+
const paragraphBlock = await getBlock( screen, 'Paragraph', {
|
|
191
|
+
rowIndex: 2,
|
|
192
|
+
} );
|
|
193
|
+
fireEvent.press( paragraphBlock );
|
|
194
|
+
fireEvent( screen.getByLabelText( 'Add block' ), 'longPress' );
|
|
195
|
+
fireEvent.press( screen.getByText( 'Add Block After' ) );
|
|
196
|
+
|
|
197
|
+
// Assert
|
|
198
|
+
expect( screen.getByText( 'ADD BLOCK HERE' ) ).toBeTruthy();
|
|
199
|
+
expect(
|
|
200
|
+
screen.getByTestId( 'block-insertion-point-after-row-2' )
|
|
201
|
+
).toBeTruthy();
|
|
202
|
+
} );
|
|
203
|
+
} );
|
|
204
|
+
} );
|
|
205
|
+
} );
|
|
@@ -229,7 +229,9 @@ const BlockActionsMenu = ( {
|
|
|
229
229
|
canDuplicate && allOptions.cutButton,
|
|
230
230
|
canDuplicate && isPasteEnabled && allOptions.pasteButton,
|
|
231
231
|
canDuplicate && allOptions.duplicateButton,
|
|
232
|
-
isReusableBlockType &&
|
|
232
|
+
isReusableBlockType &&
|
|
233
|
+
innerBlockCount > 0 &&
|
|
234
|
+
allOptions.convertToRegularBlocks,
|
|
233
235
|
! isLocked && allOptions.delete,
|
|
234
236
|
].filter( Boolean );
|
|
235
237
|
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
getBlock,
|
|
9
9
|
within,
|
|
10
10
|
getEditorHtml,
|
|
11
|
-
|
|
11
|
+
typeInRichText,
|
|
12
12
|
} from 'test/helpers';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -71,7 +71,7 @@ describe( 'Block Actions Menu', () => {
|
|
|
71
71
|
within( paragraphBlock ).getByPlaceholderText(
|
|
72
72
|
'Start writing…'
|
|
73
73
|
);
|
|
74
|
-
|
|
74
|
+
typeInRichText( paragraphField, 'Hello!' );
|
|
75
75
|
|
|
76
76
|
// Add Spacer block
|
|
77
77
|
await addBlock( screen, 'Spacer' );
|
|
@@ -132,7 +132,7 @@ describe( 'Block Actions Menu', () => {
|
|
|
132
132
|
within( paragraphBlock ).getByPlaceholderText(
|
|
133
133
|
'Start writing…'
|
|
134
134
|
);
|
|
135
|
-
|
|
135
|
+
typeInRichText( paragraphField, 'Hello!' );
|
|
136
136
|
|
|
137
137
|
// Add Spacer block
|
|
138
138
|
await addBlock( screen, 'Spacer' );
|
|
@@ -179,7 +179,7 @@ describe( 'Block Actions Menu', () => {
|
|
|
179
179
|
within( paragraphBlock ).getByPlaceholderText(
|
|
180
180
|
'Start writing…'
|
|
181
181
|
);
|
|
182
|
-
|
|
182
|
+
typeInRichText( paragraphField, 'Hello!' );
|
|
183
183
|
|
|
184
184
|
// Add Spacer block
|
|
185
185
|
await addBlock( screen, 'Spacer' );
|
|
@@ -228,7 +228,7 @@ describe( 'Block Actions Menu', () => {
|
|
|
228
228
|
within( paragraphBlock ).getByPlaceholderText(
|
|
229
229
|
'Start writing…'
|
|
230
230
|
);
|
|
231
|
-
|
|
231
|
+
typeInRichText( paragraphField, 'Hello!' );
|
|
232
232
|
|
|
233
233
|
// Add Spacer block
|
|
234
234
|
await addBlock( screen, 'Spacer' );
|
|
@@ -275,7 +275,7 @@ describe( 'Block Actions Menu', () => {
|
|
|
275
275
|
within( paragraphBlock ).getByPlaceholderText(
|
|
276
276
|
'Start writing…'
|
|
277
277
|
);
|
|
278
|
-
|
|
278
|
+
typeInRichText( paragraphField, 'Hello!' );
|
|
279
279
|
|
|
280
280
|
// Add Spacer block
|
|
281
281
|
await addBlock( screen, 'Spacer' );
|
|
@@ -322,7 +322,7 @@ describe( 'Block Actions Menu', () => {
|
|
|
322
322
|
within( paragraphBlock ).getByPlaceholderText(
|
|
323
323
|
'Start writing…'
|
|
324
324
|
);
|
|
325
|
-
|
|
325
|
+
typeInRichText( paragraphField, 'Hello!' );
|
|
326
326
|
|
|
327
327
|
// Add Spacer block
|
|
328
328
|
await addBlock( screen, 'Spacer' );
|
|
@@ -368,7 +368,7 @@ describe( 'Block Actions Menu', () => {
|
|
|
368
368
|
within( paragraphBlock ).getByPlaceholderText(
|
|
369
369
|
'Start writing…'
|
|
370
370
|
);
|
|
371
|
-
|
|
371
|
+
typeInRichText( paragraphField, 'Hello!' );
|
|
372
372
|
|
|
373
373
|
// Add Spacer block
|
|
374
374
|
await addBlock( screen, 'Spacer' );
|
|
@@ -405,7 +405,7 @@ describe( 'Block Actions Menu', () => {
|
|
|
405
405
|
within( paragraphBlock ).getByPlaceholderText(
|
|
406
406
|
'Start writing…'
|
|
407
407
|
);
|
|
408
|
-
|
|
408
|
+
typeInRichText( paragraphField, 'Hello!' );
|
|
409
409
|
|
|
410
410
|
// Add Spacer block
|
|
411
411
|
await addBlock( screen, 'Spacer' );
|
|
@@ -35,11 +35,14 @@
|
|
|
35
35
|
> * {
|
|
36
36
|
width: $block-toolbar-height * 0.5;
|
|
37
37
|
min-width: 0 !important; // overrides default button width.
|
|
38
|
-
padding-left: 0 !important;
|
|
39
|
-
padding-right: 0 !important;
|
|
40
38
|
overflow: hidden;
|
|
41
39
|
}
|
|
42
40
|
|
|
41
|
+
.block-editor-block-mover-button {
|
|
42
|
+
padding-left: 0;
|
|
43
|
+
padding-right: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
43
46
|
.block-editor-block-mover-button.is-up-button svg {
|
|
44
47
|
left: 5px;
|
|
45
48
|
}
|
|
@@ -55,9 +58,12 @@
|
|
|
55
58
|
@include break-small() {
|
|
56
59
|
width: $block-toolbar-height * 0.5;
|
|
57
60
|
min-width: 0 !important; // overrides default button width.
|
|
58
|
-
padding-left: 0 !important;
|
|
59
|
-
padding-right: 0 !important;
|
|
60
61
|
overflow: hidden;
|
|
62
|
+
|
|
63
|
+
.block-editor-block-mover &.has-icon.has-icon {
|
|
64
|
+
padding-left: 0;
|
|
65
|
+
padding-right: 0;
|
|
66
|
+
}
|
|
61
67
|
}
|
|
62
68
|
}
|
|
63
69
|
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
within,
|
|
10
10
|
getEditorHtml,
|
|
11
11
|
render,
|
|
12
|
-
|
|
12
|
+
typeInRichText,
|
|
13
13
|
} from 'test/helpers';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -89,7 +89,7 @@ describe( 'Block Mover Picker', () => {
|
|
|
89
89
|
within( paragraphBlock ).getByPlaceholderText(
|
|
90
90
|
'Start writing…'
|
|
91
91
|
);
|
|
92
|
-
|
|
92
|
+
typeInRichText( paragraphField, 'Hello!' );
|
|
93
93
|
|
|
94
94
|
// Add Spacer block
|
|
95
95
|
await addBlock( screen, 'Spacer' );
|
|
@@ -138,7 +138,7 @@ describe( 'Block Mover Picker', () => {
|
|
|
138
138
|
within( paragraphBlock ).getByPlaceholderText(
|
|
139
139
|
'Start writing…'
|
|
140
140
|
);
|
|
141
|
-
|
|
141
|
+
typeInRichText( paragraphField, 'Hello!' );
|
|
142
142
|
|
|
143
143
|
// Add Spacer block
|
|
144
144
|
await addBlock( screen, 'Spacer' );
|
|
@@ -176,7 +176,7 @@ describe( 'Block Mover Picker', () => {
|
|
|
176
176
|
within( paragraphBlock ).getByPlaceholderText(
|
|
177
177
|
'Start writing…'
|
|
178
178
|
);
|
|
179
|
-
|
|
179
|
+
typeInRichText( paragraphField, 'Hello!' );
|
|
180
180
|
|
|
181
181
|
// Add Spacer block
|
|
182
182
|
await addBlock( screen, 'Spacer' );
|
|
@@ -37,10 +37,7 @@
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
&:focus .block-editor-block-preview__container {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// Windows High Contrast mode will show this outline, but not the box-shadow.
|
|
43
|
-
outline: 2px solid transparent;
|
|
40
|
+
@include button-style-outset__focus(var(--wp-admin-theme-color));
|
|
44
41
|
}
|
|
45
42
|
&:hover .block-editor-block-pattern-setup-list__item-title,
|
|
46
43
|
&:focus .block-editor-block-pattern-setup-list__item-title {
|
|
@@ -37,10 +37,7 @@
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
&:focus .block-editor-block-preview__container {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// Windows High Contrast mode will show this outline, but not the box-shadow.
|
|
43
|
-
outline: 2px solid transparent;
|
|
40
|
+
@include button-style-outset__focus(var(--wp-admin-theme-color));
|
|
44
41
|
}
|
|
45
42
|
|
|
46
43
|
|
|
@@ -24,7 +24,6 @@ import { pipe, useCopyToClipboard } from '@wordpress/compose';
|
|
|
24
24
|
*/
|
|
25
25
|
import BlockActions from '../block-actions';
|
|
26
26
|
import BlockIcon from '../block-icon';
|
|
27
|
-
import BlockModeToggle from './block-mode-toggle';
|
|
28
27
|
import BlockHTMLConvertButton from './block-html-convert-button';
|
|
29
28
|
import __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item';
|
|
30
29
|
import BlockSettingsMenuControls from '../block-settings-menu-controls';
|
|
@@ -278,7 +277,7 @@ export function BlockSettingsDropdown( {
|
|
|
278
277
|
) }
|
|
279
278
|
shortcut={ shortcuts.insertBefore }
|
|
280
279
|
>
|
|
281
|
-
{ __( '
|
|
280
|
+
{ __( 'Add before' ) }
|
|
282
281
|
</MenuItem>
|
|
283
282
|
<MenuItem
|
|
284
283
|
onClick={ pipe(
|
|
@@ -287,23 +286,10 @@ export function BlockSettingsDropdown( {
|
|
|
287
286
|
) }
|
|
288
287
|
shortcut={ shortcuts.insertAfter }
|
|
289
288
|
>
|
|
290
|
-
{ __( '
|
|
289
|
+
{ __( 'Add after' ) }
|
|
291
290
|
</MenuItem>
|
|
292
291
|
</>
|
|
293
292
|
) }
|
|
294
|
-
{ canMove && ! onlyBlock && (
|
|
295
|
-
<MenuItem
|
|
296
|
-
onClick={ pipe( onClose, onMoveTo ) }
|
|
297
|
-
>
|
|
298
|
-
{ __( 'Move to' ) }
|
|
299
|
-
</MenuItem>
|
|
300
|
-
) }
|
|
301
|
-
{ count === 1 && (
|
|
302
|
-
<BlockModeToggle
|
|
303
|
-
clientId={ firstBlockClientId }
|
|
304
|
-
onToggle={ onClose }
|
|
305
|
-
/>
|
|
306
|
-
) }
|
|
307
293
|
</MenuGroup>
|
|
308
294
|
<MenuGroup>
|
|
309
295
|
<CopyMenuItem
|
|
@@ -316,7 +302,14 @@ export function BlockSettingsDropdown( {
|
|
|
316
302
|
</MenuItem>
|
|
317
303
|
</MenuGroup>
|
|
318
304
|
<BlockSettingsMenuControls.Slot
|
|
319
|
-
fillProps={ {
|
|
305
|
+
fillProps={ {
|
|
306
|
+
onClose,
|
|
307
|
+
canMove,
|
|
308
|
+
onMoveTo,
|
|
309
|
+
onlyBlock,
|
|
310
|
+
count,
|
|
311
|
+
firstBlockClientId,
|
|
312
|
+
} }
|
|
320
313
|
clientIds={ clientIds }
|
|
321
314
|
__unstableDisplayLocation={
|
|
322
315
|
__unstableDisplayLocation
|
|
@@ -4,9 +4,12 @@
|
|
|
4
4
|
import {
|
|
5
5
|
createSlotFill,
|
|
6
6
|
MenuGroup,
|
|
7
|
+
MenuItem,
|
|
7
8
|
__experimentalStyleProvider as StyleProvider,
|
|
8
9
|
} from '@wordpress/components';
|
|
9
10
|
import { useSelect } from '@wordpress/data';
|
|
11
|
+
import { pipe } from '@wordpress/compose';
|
|
12
|
+
import { __ } from '@wordpress/i18n';
|
|
10
13
|
|
|
11
14
|
/**
|
|
12
15
|
* Internal dependencies
|
|
@@ -17,6 +20,7 @@ import {
|
|
|
17
20
|
} from '../convert-to-group-buttons';
|
|
18
21
|
import { BlockLockMenuItem, useBlockLock } from '../block-lock';
|
|
19
22
|
import { store as blockEditorStore } from '../../store';
|
|
23
|
+
import BlockModeToggle from '../block-settings-menu/block-mode-toggle';
|
|
20
24
|
|
|
21
25
|
const { Fill, Slot } = createSlotFill( 'BlockSettingsMenuControls' );
|
|
22
26
|
|
|
@@ -74,16 +78,32 @@ const BlockSettingsMenuControlsSlot = ( {
|
|
|
74
78
|
|
|
75
79
|
return (
|
|
76
80
|
<MenuGroup>
|
|
81
|
+
{ showConvertToGroupButton && (
|
|
82
|
+
<ConvertToGroupButton
|
|
83
|
+
{ ...convertToGroupButtonProps }
|
|
84
|
+
onClose={ fillProps?.onClose }
|
|
85
|
+
/>
|
|
86
|
+
) }
|
|
77
87
|
{ showLockButton && (
|
|
78
88
|
<BlockLockMenuItem
|
|
79
89
|
clientId={ selectedClientIds[ 0 ] }
|
|
80
90
|
/>
|
|
81
91
|
) }
|
|
82
92
|
{ fills }
|
|
83
|
-
{
|
|
84
|
-
<
|
|
85
|
-
{
|
|
86
|
-
|
|
93
|
+
{ fillProps?.canMove && ! fillProps?.onlyBlock && (
|
|
94
|
+
<MenuItem
|
|
95
|
+
onClick={ pipe(
|
|
96
|
+
fillProps?.onClose,
|
|
97
|
+
fillProps?.onMoveTo
|
|
98
|
+
) }
|
|
99
|
+
>
|
|
100
|
+
{ __( 'Move to' ) }
|
|
101
|
+
</MenuItem>
|
|
102
|
+
) }
|
|
103
|
+
{ fillProps?.count === 1 && (
|
|
104
|
+
<BlockModeToggle
|
|
105
|
+
clientId={ fillProps?.firstBlockClientId }
|
|
106
|
+
onToggle={ fillProps?.onClose }
|
|
87
107
|
/>
|
|
88
108
|
) }
|
|
89
109
|
</MenuGroup>
|
|
@@ -37,16 +37,15 @@
|
|
|
37
37
|
justify-content: space-between;
|
|
38
38
|
gap: $grid-unit-10;
|
|
39
39
|
|
|
40
|
-
.block-editor-block-styles__item {
|
|
40
|
+
button.components-button.block-editor-block-styles__item {
|
|
41
41
|
color: $gray-900;
|
|
42
42
|
box-shadow: inset 0 0 0 1px $gray-400;
|
|
43
43
|
display: inline-block;
|
|
44
44
|
width: calc(50% - #{$grid-unit-05});
|
|
45
45
|
|
|
46
|
-
&:focus,
|
|
47
46
|
&:hover {
|
|
48
47
|
color: var(--wp-admin-theme-color);
|
|
49
|
-
box-shadow: inset 0 0 0
|
|
48
|
+
box-shadow: inset 0 0 0 1px $gray-400;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
&.is-active,
|
|
@@ -60,8 +59,9 @@
|
|
|
60
59
|
color: $white;
|
|
61
60
|
}
|
|
62
61
|
|
|
62
|
+
&:focus,
|
|
63
63
|
&.is-active:focus {
|
|
64
|
-
|
|
64
|
+
@include button-style__focus();
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -99,6 +99,7 @@ const BlockToolbar = ( { hideDragHandle } ) => {
|
|
|
99
99
|
// header area and not contextually to the block.
|
|
100
100
|
const displayHeaderToolbar =
|
|
101
101
|
useViewportMatch( 'medium', '<' ) || hasFixedToolbar;
|
|
102
|
+
const isLargeViewport = ! useViewportMatch( 'medium', '<' );
|
|
102
103
|
|
|
103
104
|
if ( blockType ) {
|
|
104
105
|
if ( ! hasBlockSupport( blockType, '__experimentalToolbar', true ) ) {
|
|
@@ -124,9 +125,9 @@ const BlockToolbar = ( { hideDragHandle } ) => {
|
|
|
124
125
|
|
|
125
126
|
return (
|
|
126
127
|
<div className={ classes }>
|
|
127
|
-
{ ! isMultiToolbar &&
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
{ ! isMultiToolbar && isLargeViewport && ! isContentLocked && (
|
|
129
|
+
<BlockParentSelector />
|
|
130
|
+
) }
|
|
130
131
|
<div ref={ nodeRef } { ...showMoversGestures }>
|
|
131
132
|
{ ( shouldShowVisualToolbar || isMultiToolbar ) &&
|
|
132
133
|
! isContentLocked && (
|