@wordpress/block-editor 13.2.0 → 13.4.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 +4 -0
- package/README.md +0 -5
- package/build/components/alignment-control/ui.js +2 -2
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/ui.js +1 -1
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/ui.native.js +1 -1
- package/build/components/block-alignment-control/ui.native.js.map +1 -1
- package/build/components/block-breadcrumb/index.js +12 -1
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-inspector/index.js +6 -3
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +3 -1
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-refs.js +9 -2
- package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build/components/block-list/use-block-props/use-is-hovered.js +25 -9
- package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +3 -2
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-lock/modal.js +2 -0
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-lock/toolbar.js +0 -1
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-mover/button.js +1 -1
- package/build/components/block-mover/button.js.map +1 -1
- package/build/components/block-mover/index.js +1 -1
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +2 -2
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-patterns-paging/index.js +5 -7
- package/build/components/block-patterns-paging/index.js.map +1 -1
- package/build/components/block-quick-navigation/index.js +20 -17
- package/build/components/block-quick-navigation/index.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +2 -0
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-rename/modal.js +4 -12
- package/build/components/block-rename/modal.js.map +1 -1
- package/build/components/block-switcher/index.js +1 -1
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +11 -12
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/preview-block-popover.js +20 -17
- package/build/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build/components/block-toolbar/shuffle.js +6 -2
- package/build/components/block-toolbar/shuffle.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +7 -58
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/block-toolbar-breadcrumb.js +9 -2
- package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
- package/build/components/block-tools/index.js +14 -1
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +9 -8
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserter-button.js +45 -0
- package/build/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -0
- package/build/components/block-tools/zoom-out-mode-inserters.js +29 -28
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-tools/zoom-out-popover.js +58 -0
- package/build/components/block-tools/zoom-out-popover.js.map +1 -0
- package/build/components/block-tools/zoom-out-toolbar.js +138 -0
- package/build/components/block-tools/zoom-out-toolbar.js.map +1 -0
- package/build/components/button-block-appender/index.js +3 -1
- package/build/components/button-block-appender/index.js.map +1 -1
- package/build/components/child-layout-control/index.js +26 -18
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +1 -1
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/default-block-appender/index.js +7 -4
- package/build/components/default-block-appender/index.js.map +1 -1
- package/build/components/dimensions-tool/index.js +6 -4
- package/build/components/dimensions-tool/index.js.map +1 -1
- package/build/components/font-appearance-control/index.js +22 -62
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +185 -116
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/border-panel.js +2 -1
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +2 -1
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +2 -1
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +2 -1
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +13 -1
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +2 -1
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +45 -24
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +121 -0
- package/build/components/global-styles/typography-utils.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +47 -13
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +17 -7
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/grid/grid-item-movers.js +90 -48
- package/build/components/grid/grid-item-movers.js.map +1 -1
- package/build/components/grid/grid-item-resizer.js +2 -2
- package/build/components/grid/grid-item-resizer.js.map +1 -1
- package/build/components/grid/grid-visualizer.js +117 -37
- package/build/components/grid/grid-visualizer.js.map +1 -1
- package/build/components/grid/use-grid-layout-sync.js +60 -41
- package/build/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build/components/index.js +1 -9
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/index.js +2 -2
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -19
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js +20 -23
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build/components/inserter/media-tab/media-panel.js +1 -0
- package/build/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build/components/inserter/menu.js +26 -4
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/preview-panel.js +20 -3
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +2 -1
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +10 -3
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js +2 -1
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/settings-tab.js +1 -2
- package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
- package/build/components/link-control/link-preview.js +1 -1
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/list-view/block-select-button.js +2 -6
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +2 -2
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/utils.js +3 -1
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/media-placeholder/index.js +19 -23
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +3 -1
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.js +1 -1
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/index.js +1 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +9 -3
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/tabbed-sidebar/index.js +66 -0
- package/build/components/tabbed-sidebar/index.js.map +1 -0
- package/build/components/url-popover/image-url-input-ui.js +3 -3
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/url-popover/index.js +3 -0
- package/build/components/url-popover/index.js.map +1 -1
- package/build/hooks/background.js +26 -4
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-hooks.js +11 -17
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-style-variation.js +169 -4
- package/build/hooks/block-style-variation.js.map +1 -1
- package/build/hooks/duotone.js +16 -11
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/grid-visualizer.js +62 -0
- package/build/hooks/grid-visualizer.js.map +1 -0
- package/build/hooks/index.js +15 -2
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout-child.js +47 -23
- package/build/hooks/layout-child.js.map +1 -1
- package/build/hooks/position.js +4 -15
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +96 -55
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/hooks/utils.js +2 -0
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +50 -4
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/grid.js +92 -51
- package/build/layouts/grid.js.map +1 -1
- package/build/private-apis.js +6 -4
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +18 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +0 -2
- package/build/store/defaults.js.map +1 -1
- package/build/store/defaults.native.js +0 -3
- package/build/store/defaults.native.js.map +1 -1
- package/build/store/private-keys.js +2 -1
- package/build/store/private-keys.js.map +1 -1
- package/build/store/reducer.js +19 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +13 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/format-font-style.js +45 -0
- package/build/utils/format-font-style.js.map +1 -0
- package/build/utils/format-font-weight.js +68 -0
- package/build/utils/format-font-weight.js.map +1 -0
- package/build/utils/get-editor-region.js +34 -0
- package/build/utils/get-editor-region.js.map +1 -0
- package/build/utils/get-font-styles-and-weights.js +167 -0
- package/build/utils/get-font-styles-and-weights.js.map +1 -0
- package/build/utils/pasting.js +5 -13
- package/build/utils/pasting.js.map +1 -1
- package/build-module/components/alignment-control/ui.js +2 -2
- package/build-module/components/alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.js +1 -1
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.native.js +1 -1
- package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +12 -1
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +6 -3
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +3 -1
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-refs.js +11 -4
- package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-is-hovered.js +26 -9
- package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +3 -2
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-lock/modal.js +2 -0
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-lock/toolbar.js +0 -1
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-mover/button.js +1 -1
- package/build-module/components/block-mover/button.js.map +1 -1
- package/build-module/components/block-mover/index.js +1 -1
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +2 -2
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-patterns-paging/index.js +5 -7
- package/build-module/components/block-patterns-paging/index.js.map +1 -1
- package/build-module/components/block-quick-navigation/index.js +20 -17
- package/build-module/components/block-quick-navigation/index.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +2 -0
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-rename/modal.js +5 -13
- package/build-module/components/block-rename/modal.js.map +1 -1
- package/build-module/components/block-switcher/index.js +1 -1
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +12 -13
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/preview-block-popover.js +20 -17
- package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build-module/components/block-toolbar/shuffle.js +6 -2
- package/build-module/components/block-toolbar/shuffle.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +10 -61
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js +9 -2
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
- package/build-module/components/block-tools/index.js +14 -1
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +9 -8
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserter-button.js +37 -0
- package/build-module/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -0
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +30 -29
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-popover.js +49 -0
- package/build-module/components/block-tools/zoom-out-popover.js.map +1 -0
- package/build-module/components/block-tools/zoom-out-toolbar.js +131 -0
- package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -0
- package/build-module/components/button-block-appender/index.js +3 -1
- package/build-module/components/button-block-appender/index.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +27 -19
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +2 -2
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/default-block-appender/index.js +7 -4
- package/build-module/components/default-block-appender/index.js.map +1 -1
- package/build-module/components/dimensions-tool/index.js +6 -4
- package/build-module/components/dimensions-tool/index.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +24 -62
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +188 -119
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +3 -2
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +3 -2
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +3 -2
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +3 -2
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +13 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +3 -2
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +47 -26
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +117 -0
- package/build-module/components/global-styles/typography-utils.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +47 -13
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +15 -6
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/grid/grid-item-movers.js +93 -50
- package/build-module/components/grid/grid-item-movers.js.map +1 -1
- package/build-module/components/grid/grid-item-resizer.js +2 -2
- package/build-module/components/grid/grid-item-resizer.js.map +1 -1
- package/build-module/components/grid/grid-visualizer.js +118 -38
- package/build-module/components/grid/grid-visualizer.js.map +1 -1
- package/build-module/components/grid/use-grid-layout-sync.js +61 -42
- package/build-module/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build-module/components/index.js +0 -5
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +2 -2
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -19
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +20 -23
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js +1 -0
- package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build-module/components/inserter/menu.js +26 -4
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +20 -3
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +2 -1
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +10 -3
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js +3 -2
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/settings-tab.js +1 -2
- package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +1 -1
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +3 -7
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +2 -2
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/utils.js +3 -1
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +19 -23
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +3 -1
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +9 -3
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/tabbed-sidebar/index.js +60 -0
- package/build-module/components/tabbed-sidebar/index.js.map +1 -0
- package/build-module/components/url-popover/image-url-input-ui.js +3 -3
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/url-popover/index.js +3 -0
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/hooks/background.js +26 -4
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-hooks.js +11 -17
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-style-variation.js +168 -4
- package/build-module/hooks/block-style-variation.js.map +1 -1
- package/build-module/hooks/duotone.js +16 -11
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/grid-visualizer.js +61 -0
- package/build-module/hooks/grid-visualizer.js.map +1 -0
- package/build-module/hooks/index.js +3 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/layout-child.js +47 -23
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/hooks/position.js +4 -15
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +96 -56
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/hooks/utils.js +2 -0
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +50 -4
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/grid.js +92 -51
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/private-apis.js +8 -6
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +15 -0
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +0 -2
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/defaults.native.js +0 -3
- package/build-module/store/defaults.native.js.map +1 -1
- package/build-module/store/private-keys.js +1 -0
- package/build-module/store/private-keys.js.map +1 -1
- package/build-module/store/reducer.js +18 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +10 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/format-font-style.js +39 -0
- package/build-module/utils/format-font-style.js.map +1 -0
- package/build-module/utils/format-font-weight.js +62 -0
- package/build-module/utils/format-font-weight.js.map +1 -0
- package/build-module/utils/get-editor-region.js +28 -0
- package/build-module/utils/get-editor-region.js.map +1 -0
- package/build-module/utils/get-font-styles-and-weights.js +160 -0
- package/build-module/utils/get-font-styles-and-weights.js.map +1 -0
- package/build-module/utils/pasting.js +5 -13
- package/build-module/utils/pasting.js.map +1 -1
- package/build-style/content-rtl.css +7 -6
- package/build-style/content.css +7 -6
- package/build-style/style-rtl.css +356 -181
- package/build-style/style.css +356 -181
- package/build-types/components/block-context/index.d.ts +2 -2
- package/build-types/components/block-context/index.d.ts.map +1 -1
- package/build-types/utils/dom.d.ts.map +1 -1
- package/package.json +32 -32
- package/src/components/alignment-control/ui.js +2 -2
- package/src/components/block-alignment-control/ui.js +1 -1
- package/src/components/block-alignment-control/ui.native.js +1 -1
- package/src/components/block-breadcrumb/index.js +16 -1
- package/src/components/block-context/README.md +4 -4
- package/src/components/block-inspector/index.js +8 -4
- package/src/components/block-list/content.scss +2 -16
- package/src/components/block-list/use-block-props/index.js +1 -1
- package/src/components/block-list/use-block-props/use-block-refs.js +19 -3
- package/src/components/block-list/use-block-props/use-is-hovered.js +26 -11
- package/src/components/block-list/use-in-between-inserter.js +5 -1
- package/src/components/block-lock/modal.js +10 -2
- package/src/components/block-lock/style.scss +4 -8
- package/src/components/block-lock/toolbar.js +0 -1
- package/src/components/block-mover/button.js +1 -1
- package/src/components/block-mover/index.js +1 -1
- package/src/components/block-pattern-setup/setup-toolbar.js +2 -2
- package/src/components/block-patterns-paging/index.js +8 -11
- package/src/components/block-patterns-paging/style.scss +0 -5
- package/src/components/block-quick-navigation/index.js +21 -28
- package/src/components/block-removal-warning-modal/index.js +10 -2
- package/src/components/block-rename/modal.js +2 -8
- package/src/components/block-switcher/index.js +1 -1
- package/src/components/block-switcher/pattern-transformations-menu.js +17 -15
- package/src/components/block-switcher/preview-block-popover.js +20 -14
- package/src/components/block-switcher/style.scss +8 -17
- package/src/components/block-switcher/test/index.js +6 -6
- package/src/components/block-toolbar/shuffle.js +9 -1
- package/src/components/block-toolbar/style.scss +1 -11
- package/src/components/block-tools/block-selection-button.js +11 -83
- package/src/components/block-tools/block-toolbar-breadcrumb.js +9 -4
- package/src/components/block-tools/index.js +21 -1
- package/src/components/block-tools/style.scss +23 -0
- package/src/components/block-tools/use-show-block-tools.js +21 -10
- package/src/components/block-tools/zoom-out-mode-inserter-button.js +47 -0
- package/src/components/block-tools/zoom-out-mode-inserters.js +44 -33
- package/src/components/block-tools/zoom-out-popover.js +50 -0
- package/src/components/block-tools/zoom-out-toolbar.js +140 -0
- package/src/components/button-block-appender/index.js +2 -1
- package/src/components/child-layout-control/index.js +41 -23
- package/src/components/date-format-picker/index.js +2 -2
- package/src/components/date-format-picker/style.scss +0 -9
- package/src/components/default-block-appender/index.js +11 -4
- package/src/components/dimensions-tool/index.js +97 -89
- package/src/components/font-appearance-control/index.js +24 -82
- package/src/components/font-appearance-control/style.scss +3 -5
- package/src/components/global-styles/background-panel.js +266 -167
- package/src/components/global-styles/border-panel.js +3 -2
- package/src/components/global-styles/color-panel.js +3 -2
- package/src/components/global-styles/dimensions-panel.js +3 -2
- package/src/components/global-styles/filters-panel.js +3 -2
- package/src/components/global-styles/hooks.js +14 -1
- package/src/components/global-styles/image-settings-panel.js +3 -2
- package/src/components/global-styles/style.scss +116 -19
- package/src/components/global-styles/test/typography-utils.js +594 -0
- package/src/components/global-styles/test/use-global-styles-output.js +3 -1
- package/src/components/global-styles/typography-panel.js +56 -27
- package/src/components/global-styles/typography-utils.js +159 -0
- package/src/components/global-styles/use-global-styles-output.js +45 -10
- package/src/components/global-styles/utils.js +17 -6
- package/src/components/grid/grid-item-movers.js +140 -86
- package/src/components/grid/grid-item-resizer.js +3 -2
- package/src/components/grid/grid-visualizer.js +172 -55
- package/src/components/grid/style.scss +157 -8
- package/src/components/grid/use-grid-layout-sync.js +88 -46
- package/src/components/iframe/content.scss +2 -1
- package/src/components/index.js +0 -5
- package/src/components/inner-blocks/index.js +6 -2
- package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -16
- package/src/components/inserter/block-patterns-tab/patterns-filter.js +40 -44
- package/src/components/inserter/media-tab/media-panel.js +1 -0
- package/src/components/inserter/menu.js +47 -13
- package/src/components/inserter/preview-panel.js +27 -4
- package/src/components/inserter/quick-inserter.js +6 -1
- package/src/components/inserter/style.scss +58 -92
- package/src/components/inserter-draggable-blocks/index.js +11 -3
- package/src/components/inspector-controls/block-support-tools-panel.js +3 -3
- package/src/components/inspector-controls-tabs/settings-tab.js +0 -2
- package/src/components/inspector-controls-tabs/style.scss +0 -21
- package/src/components/link-control/link-preview.js +1 -1
- package/src/components/list-view/block-select-button.js +3 -13
- package/src/components/list-view/block.js +10 -3
- package/src/components/list-view/style.scss +2 -1
- package/src/components/list-view/utils.js +13 -2
- package/src/components/media-placeholder/index.js +22 -32
- package/src/components/navigable-toolbar/index.js +3 -1
- package/src/components/rich-text/format-toolbar/index.js +1 -1
- package/src/components/rich-text/index.js +1 -1
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +9 -2
- package/src/components/tabbed-sidebar/README.md +76 -0
- package/src/components/tabbed-sidebar/index.js +70 -0
- package/src/components/tabbed-sidebar/style.scss +53 -0
- package/src/components/url-popover/image-url-input-ui.js +3 -3
- package/src/components/url-popover/index.js +3 -0
- package/src/components/url-popover/style.scss +1 -0
- package/src/hooks/background.js +25 -10
- package/src/hooks/block-hooks.js +9 -16
- package/src/hooks/block-style-variation.js +202 -3
- package/src/hooks/duotone.js +16 -12
- package/src/hooks/grid-visualizer.js +62 -0
- package/src/hooks/index.js +3 -0
- package/src/hooks/layout-child.js +64 -39
- package/src/hooks/position.js +3 -20
- package/src/hooks/test/get-variation-styles-with-ref-values.js +91 -0
- package/src/hooks/use-bindings-attributes.js +107 -63
- package/src/hooks/utils.js +2 -0
- package/src/layouts/constrained.js +53 -4
- package/src/layouts/grid.js +148 -51
- package/src/private-apis.js +12 -7
- package/src/store/actions.js +15 -0
- package/src/store/defaults.js +0 -2
- package/src/store/defaults.native.js +0 -3
- package/src/store/private-keys.js +1 -0
- package/src/store/reducer.js +18 -0
- package/src/store/selectors.js +10 -0
- package/src/style.scss +1 -1
- package/src/utils/format-font-style.js +40 -0
- package/src/utils/format-font-weight.js +63 -0
- package/src/utils/get-editor-region.js +31 -0
- package/src/utils/get-font-styles-and-weights.js +191 -0
- package/src/utils/pasting.js +5 -12
- package/src/utils/test/format-font-style.js +34 -0
- package/src/utils/test/format-font-weight.js +66 -0
- package/src/utils/test/get-font-styles-and-weights.js +513 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/inserter/reusable-block-rename-hint.js +0 -71
- package/build/components/inserter/reusable-block-rename-hint.js.map +0 -1
- package/build/components/inspector-controls-tabs/settings-tab-hint.js +0 -53
- package/build/components/inspector-controls-tabs/settings-tab-hint.js.map +0 -1
- package/build-module/components/inserter/reusable-block-rename-hint.js +0 -64
- package/build-module/components/inserter/reusable-block-rename-hint.js.map +0 -1
- package/build-module/components/inspector-controls-tabs/settings-tab-hint.js +0 -47
- package/build-module/components/inspector-controls-tabs/settings-tab-hint.js.map +0 -1
- package/src/components/inserter/reusable-block-rename-hint.js +0 -69
- package/src/components/inspector-controls-tabs/settings-tab-hint.js +0 -52
- package/src/hooks/position.scss +0 -18
|
@@ -10,18 +10,16 @@ import {
|
|
|
10
10
|
FlexBlock,
|
|
11
11
|
FlexItem,
|
|
12
12
|
} from '@wordpress/components';
|
|
13
|
-
import {
|
|
14
|
-
__experimentalGetBlockLabel,
|
|
15
|
-
store as blocksStore,
|
|
16
|
-
} from '@wordpress/blocks';
|
|
17
13
|
|
|
18
14
|
/**
|
|
19
15
|
* Internal dependencies
|
|
20
16
|
*/
|
|
21
17
|
import { store as blockEditorStore } from '../../store';
|
|
22
18
|
import BlockIcon from '../block-icon';
|
|
19
|
+
import useBlockDisplayInformation from '../use-block-display-information';
|
|
20
|
+
import useBlockDisplayTitle from '../block-title/use-block-display-title';
|
|
23
21
|
|
|
24
|
-
export default function BlockQuickNavigation( { clientIds } ) {
|
|
22
|
+
export default function BlockQuickNavigation( { clientIds, onSelect } ) {
|
|
25
23
|
if ( ! clientIds.length ) {
|
|
26
24
|
return null;
|
|
27
25
|
}
|
|
@@ -29,6 +27,7 @@ export default function BlockQuickNavigation( { clientIds } ) {
|
|
|
29
27
|
<VStack spacing={ 1 }>
|
|
30
28
|
{ clientIds.map( ( clientId ) => (
|
|
31
29
|
<BlockQuickNavigationItem
|
|
30
|
+
onSelect={ onSelect }
|
|
32
31
|
key={ clientId }
|
|
33
32
|
clientId={ clientId }
|
|
34
33
|
/>
|
|
@@ -37,29 +36,18 @@ export default function BlockQuickNavigation( { clientIds } ) {
|
|
|
37
36
|
);
|
|
38
37
|
}
|
|
39
38
|
|
|
40
|
-
function BlockQuickNavigationItem( { clientId } ) {
|
|
41
|
-
const
|
|
39
|
+
function BlockQuickNavigationItem( { clientId, onSelect } ) {
|
|
40
|
+
const blockInformation = useBlockDisplayInformation( clientId );
|
|
41
|
+
const blockTitle = useBlockDisplayTitle( {
|
|
42
|
+
clientId,
|
|
43
|
+
context: 'list-view',
|
|
44
|
+
} );
|
|
45
|
+
const { isSelected } = useSelect(
|
|
42
46
|
( select ) => {
|
|
43
|
-
const {
|
|
44
|
-
|
|
45
|
-
getBlockAttributes,
|
|
46
|
-
isBlockSelected,
|
|
47
|
-
hasSelectedInnerBlock,
|
|
48
|
-
} = select( blockEditorStore );
|
|
49
|
-
const { getBlockType } = select( blocksStore );
|
|
50
|
-
|
|
51
|
-
const blockType = getBlockType( getBlockName( clientId ) );
|
|
52
|
-
const attributes = getBlockAttributes( clientId );
|
|
47
|
+
const { isBlockSelected, hasSelectedInnerBlock } =
|
|
48
|
+
select( blockEditorStore );
|
|
53
49
|
|
|
54
50
|
return {
|
|
55
|
-
name:
|
|
56
|
-
blockType &&
|
|
57
|
-
__experimentalGetBlockLabel(
|
|
58
|
-
blockType,
|
|
59
|
-
attributes,
|
|
60
|
-
'list-view'
|
|
61
|
-
),
|
|
62
|
-
icon: blockType?.icon,
|
|
63
51
|
isSelected:
|
|
64
52
|
isBlockSelected( clientId ) ||
|
|
65
53
|
hasSelectedInnerBlock( clientId, /* deep: */ true ),
|
|
@@ -72,14 +60,19 @@ function BlockQuickNavigationItem( { clientId } ) {
|
|
|
72
60
|
return (
|
|
73
61
|
<Button
|
|
74
62
|
isPressed={ isSelected }
|
|
75
|
-
onClick={ () =>
|
|
63
|
+
onClick={ async () => {
|
|
64
|
+
await selectBlock( clientId );
|
|
65
|
+
if ( onSelect ) {
|
|
66
|
+
onSelect( clientId );
|
|
67
|
+
}
|
|
68
|
+
} }
|
|
76
69
|
>
|
|
77
70
|
<Flex>
|
|
78
71
|
<FlexItem>
|
|
79
|
-
<BlockIcon icon={ icon } />
|
|
72
|
+
<BlockIcon icon={ blockInformation?.icon } />
|
|
80
73
|
</FlexItem>
|
|
81
74
|
<FlexBlock style={ { textAlign: 'left' } }>
|
|
82
|
-
<Truncate>{
|
|
75
|
+
<Truncate>{ blockTitle }</Truncate>
|
|
83
76
|
</FlexBlock>
|
|
84
77
|
</Flex>
|
|
85
78
|
</Button>
|
|
@@ -53,10 +53,18 @@ export function BlockRemovalWarningModal( { rules } ) {
|
|
|
53
53
|
>
|
|
54
54
|
<p>{ message }</p>
|
|
55
55
|
<HStack justify="right">
|
|
56
|
-
<Button
|
|
56
|
+
<Button
|
|
57
|
+
variant="tertiary"
|
|
58
|
+
onClick={ clearBlockRemovalPrompt }
|
|
59
|
+
__next40pxDefaultSize
|
|
60
|
+
>
|
|
57
61
|
{ __( 'Cancel' ) }
|
|
58
62
|
</Button>
|
|
59
|
-
<Button
|
|
63
|
+
<Button
|
|
64
|
+
variant="primary"
|
|
65
|
+
onClick={ onConfirmRemoval }
|
|
66
|
+
__next40pxDefaultSize
|
|
67
|
+
>
|
|
60
68
|
{ __( 'Delete' ) }
|
|
61
69
|
</Button>
|
|
62
70
|
</HStack>
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
Modal,
|
|
10
10
|
} from '@wordpress/components';
|
|
11
11
|
import { __, sprintf } from '@wordpress/i18n';
|
|
12
|
-
import { useState
|
|
12
|
+
import { useState } from '@wordpress/element';
|
|
13
13
|
import { speak } from '@wordpress/a11y';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -27,7 +27,6 @@ export default function BlockRenameModal( {
|
|
|
27
27
|
hasOverridesWarning,
|
|
28
28
|
} ) {
|
|
29
29
|
const [ editedBlockName, setEditedBlockName ] = useState( blockName );
|
|
30
|
-
const descriptionId = useId();
|
|
31
30
|
|
|
32
31
|
const nameHasChanged = editedBlockName !== blockName;
|
|
33
32
|
const nameIsOriginal = editedBlockName === originalBlockName;
|
|
@@ -65,7 +64,6 @@ export default function BlockRenameModal( {
|
|
|
65
64
|
onRequestClose={ onClose }
|
|
66
65
|
overlayClassName="block-editor-block-rename-modal"
|
|
67
66
|
focusOnMount="firstContentElement"
|
|
68
|
-
aria={ { describedby: descriptionId } }
|
|
69
67
|
size="small"
|
|
70
68
|
>
|
|
71
69
|
<form
|
|
@@ -79,16 +77,12 @@ export default function BlockRenameModal( {
|
|
|
79
77
|
handleSubmit();
|
|
80
78
|
} }
|
|
81
79
|
>
|
|
82
|
-
<p id={ descriptionId }>
|
|
83
|
-
{ __( 'Enter a custom name for this block.' ) }
|
|
84
|
-
</p>
|
|
85
80
|
<VStack spacing="3">
|
|
86
81
|
<TextControl
|
|
87
82
|
__nextHasNoMarginBottom
|
|
88
83
|
__next40pxDefaultSize
|
|
89
84
|
value={ editedBlockName }
|
|
90
|
-
label={ __( '
|
|
91
|
-
hideLabelFromVision
|
|
85
|
+
label={ __( 'Name' ) }
|
|
92
86
|
help={
|
|
93
87
|
hasOverridesWarning
|
|
94
88
|
? __(
|
|
@@ -306,7 +306,7 @@ export const BlockSwitcher = ( { clientIds, disabled, isUsingBindings } ) => {
|
|
|
306
306
|
</>
|
|
307
307
|
}
|
|
308
308
|
toggleProps={ {
|
|
309
|
-
|
|
309
|
+
description: blockSwitcherDescription,
|
|
310
310
|
...toggleProps,
|
|
311
311
|
} }
|
|
312
312
|
menuProps={ { orientation: 'both' } }
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { useState } from '@wordpress/element';
|
|
6
|
-
import { useInstanceId } from '@wordpress/compose';
|
|
6
|
+
import { useInstanceId, useViewportMatch } from '@wordpress/compose';
|
|
7
7
|
import { chevronRight } from '@wordpress/icons';
|
|
8
8
|
|
|
9
9
|
import {
|
|
@@ -34,6 +34,7 @@ function PatternTransformationsMenu( {
|
|
|
34
34
|
} ) {
|
|
35
35
|
const [ showTransforms, setShowTransforms ] = useState( false );
|
|
36
36
|
const patterns = useTransformedPatterns( statePatterns, blocks );
|
|
37
|
+
|
|
37
38
|
if ( ! patterns.length ) {
|
|
38
39
|
return null;
|
|
39
40
|
}
|
|
@@ -60,21 +61,22 @@ function PatternTransformationsMenu( {
|
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
function PreviewPatternsPopover( { patterns, onSelect } ) {
|
|
64
|
+
const isMobile = useViewportMatch( 'medium', '<' );
|
|
65
|
+
|
|
63
66
|
return (
|
|
64
|
-
<div className="block-editor-block-
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
</div>
|
|
67
|
+
<div className="block-editor-block-switcher__popover-preview-container">
|
|
68
|
+
<Popover
|
|
69
|
+
className="block-editor-block-switcher__popover-preview"
|
|
70
|
+
placement={ isMobile ? 'bottom' : 'right-start' }
|
|
71
|
+
offset={ 16 }
|
|
72
|
+
>
|
|
73
|
+
<div className="block-editor-block-switcher__preview is-pattern-list-preview">
|
|
74
|
+
<BlockPatternsList
|
|
75
|
+
patterns={ patterns }
|
|
76
|
+
onSelect={ onSelect }
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
</Popover>
|
|
78
80
|
</div>
|
|
79
81
|
);
|
|
80
82
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { Popover } from '@wordpress/components';
|
|
6
|
+
import { useViewportMatch } from '@wordpress/compose';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
@@ -10,22 +11,27 @@ import { Popover } from '@wordpress/components';
|
|
|
10
11
|
import BlockPreview from '../block-preview';
|
|
11
12
|
|
|
12
13
|
export default function PreviewBlockPopover( { blocks } ) {
|
|
14
|
+
const isMobile = useViewportMatch( 'medium', '<' );
|
|
15
|
+
|
|
16
|
+
if ( isMobile ) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
return (
|
|
14
|
-
<div className="block-editor-block-
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</div>
|
|
25
|
-
<BlockPreview viewportWidth={ 500 } blocks={ blocks } />
|
|
21
|
+
<div className="block-editor-block-switcher__popover-preview-container">
|
|
22
|
+
<Popover
|
|
23
|
+
className="block-editor-block-switcher__popover-preview"
|
|
24
|
+
placement="right-start"
|
|
25
|
+
focusOnMount={ false }
|
|
26
|
+
offset={ 16 }
|
|
27
|
+
>
|
|
28
|
+
<div className="block-editor-block-switcher__preview">
|
|
29
|
+
<div className="block-editor-block-switcher__preview-title">
|
|
30
|
+
{ __( 'Preview' ) }
|
|
26
31
|
</div>
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
<BlockPreview viewportWidth={ 500 } blocks={ blocks } />
|
|
33
|
+
</div>
|
|
34
|
+
</Popover>
|
|
29
35
|
</div>
|
|
30
36
|
);
|
|
31
37
|
}
|
|
@@ -84,27 +84,18 @@
|
|
|
84
84
|
min-width: 300px;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
.block-editor-block-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
.block-editor-block-switcher__popover-preview-container {
|
|
88
|
+
left: 0;
|
|
89
|
+
position: absolute;
|
|
90
|
+
top: -$border-width;
|
|
91
|
+
width: 100%;
|
|
92
|
+
bottom: 0;
|
|
93
|
+
pointer-events: none;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
.block-editor-block-
|
|
96
|
-
display: none;
|
|
96
|
+
.block-editor-block-switcher__popover-preview {
|
|
97
97
|
overflow: hidden;
|
|
98
98
|
|
|
99
|
-
// Position correctly. Needs specificity.
|
|
100
|
-
&.components-popover {
|
|
101
|
-
margin-top: $grid-unit-15 - $border-width;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
@include break-medium() {
|
|
105
|
-
display: block;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
99
|
.components-popover__content {
|
|
109
100
|
width: 300px;
|
|
110
101
|
border: $border-width solid $gray-900;
|
|
@@ -134,7 +134,7 @@ describe( 'BlockSwitcher', () => {
|
|
|
134
134
|
expect( items[ 1 ] ).toHaveTextContent( headingBlockType.title );
|
|
135
135
|
} );
|
|
136
136
|
|
|
137
|
-
test( 'should render disabled block switcher when we have a single selected block without styles and we cannot remove it', () => {
|
|
137
|
+
test( 'should render accessibly disabled block switcher when we have a single selected block without styles and we cannot remove it', () => {
|
|
138
138
|
useSelect.mockImplementation( () => ( {
|
|
139
139
|
blocks: [ headingBlock1 ],
|
|
140
140
|
icon: copy,
|
|
@@ -142,11 +142,11 @@ describe( 'BlockSwitcher', () => {
|
|
|
142
142
|
canRemove: false,
|
|
143
143
|
} ) );
|
|
144
144
|
render( <BlockSwitcher clientIds={ [ headingBlock1.clientId ] } /> );
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
).
|
|
145
|
+
const blockSwitcher = screen.getByRole( 'button', {
|
|
146
|
+
name: 'Block Name',
|
|
147
|
+
} );
|
|
148
|
+
expect( blockSwitcher ).toBeEnabled();
|
|
149
|
+
expect( blockSwitcher ).toHaveAttribute( 'aria-disabled', 'true' );
|
|
150
150
|
} );
|
|
151
151
|
|
|
152
152
|
test( 'should render message for no available transforms', async () => {
|
|
@@ -54,10 +54,16 @@ export default function Shuffle( { clientId, as = Container } ) {
|
|
|
54
54
|
return EMPTY_ARRAY;
|
|
55
55
|
}
|
|
56
56
|
return patterns.filter( ( pattern ) => {
|
|
57
|
+
const isCorePattern =
|
|
58
|
+
pattern.source === 'core' ||
|
|
59
|
+
( pattern.source?.startsWith( 'pattern-directory' ) &&
|
|
60
|
+
pattern.source !== 'pattern-directory/theme' );
|
|
57
61
|
return (
|
|
58
62
|
// Check if the pattern has only one top level block,
|
|
59
63
|
// otherwise we may shuffle to pattern that will not allow to continue shuffling.
|
|
60
64
|
pattern.blocks.length === 1 &&
|
|
65
|
+
// We exclude the core patterns and pattern directory patterns that are not theme patterns.
|
|
66
|
+
! isCorePattern &&
|
|
61
67
|
pattern.categories?.some( ( category ) => {
|
|
62
68
|
return categories.includes( category );
|
|
63
69
|
} ) &&
|
|
@@ -66,7 +72,8 @@ export default function Shuffle( { clientId, as = Container } ) {
|
|
|
66
72
|
);
|
|
67
73
|
} );
|
|
68
74
|
}, [ categories, patterns ] );
|
|
69
|
-
|
|
75
|
+
|
|
76
|
+
if ( sameCategoryPatternsWithSingleWrapper.length < 2 ) {
|
|
70
77
|
return null;
|
|
71
78
|
}
|
|
72
79
|
|
|
@@ -85,6 +92,7 @@ export default function Shuffle( { clientId, as = Container } ) {
|
|
|
85
92
|
<ComponentToUse
|
|
86
93
|
label={ __( 'Shuffle' ) }
|
|
87
94
|
icon={ shuffle }
|
|
95
|
+
className="block-editor-block-toolbar-shuffle"
|
|
88
96
|
onClick={ () => {
|
|
89
97
|
const nextPattern = getNextPattern();
|
|
90
98
|
nextPattern.blocks[ 0 ].attributes = {
|
|
@@ -24,8 +24,6 @@
|
|
|
24
24
|
.components-toolbar-group,
|
|
25
25
|
.components-toolbar {
|
|
26
26
|
background: none;
|
|
27
|
-
// IE11 has thick paddings without this.
|
|
28
|
-
line-height: 0;
|
|
29
27
|
|
|
30
28
|
// These margins make the buttons themselves overlap the chrome of the toolbar.
|
|
31
29
|
// This helps make them square, and maximize the hit area.
|
|
@@ -151,15 +149,7 @@
|
|
|
151
149
|
}
|
|
152
150
|
|
|
153
151
|
.block-editor-block-toolbar__slot {
|
|
154
|
-
|
|
155
|
-
display: inline-block;
|
|
156
|
-
// Fix for toolbar button misalignment on IE11
|
|
157
|
-
line-height: 0;
|
|
158
|
-
|
|
159
|
-
// IE11 doesn't read rules inside this query. They are applied only to modern browsers.
|
|
160
|
-
@supports (position: sticky) {
|
|
161
|
-
display: inline-flex;
|
|
162
|
-
}
|
|
152
|
+
display: inline-flex;
|
|
163
153
|
}
|
|
164
154
|
|
|
165
155
|
.show-icon-labels {
|
|
@@ -6,10 +6,10 @@ import clsx from 'clsx';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { dragHandle
|
|
10
|
-
import { Button, Flex, FlexItem
|
|
9
|
+
import { dragHandle } from '@wordpress/icons';
|
|
10
|
+
import { Button, Flex, FlexItem } from '@wordpress/components';
|
|
11
11
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
12
|
-
import {
|
|
12
|
+
import { forwardRef, useEffect } from '@wordpress/element';
|
|
13
13
|
import {
|
|
14
14
|
BACKSPACE,
|
|
15
15
|
DELETE,
|
|
@@ -38,8 +38,6 @@ import BlockIcon from '../block-icon';
|
|
|
38
38
|
import { store as blockEditorStore } from '../../store';
|
|
39
39
|
import BlockDraggable from '../block-draggable';
|
|
40
40
|
import { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
41
|
-
import BlockMover from '../block-mover';
|
|
42
|
-
import Shuffle from '../block-toolbar/shuffle';
|
|
43
41
|
|
|
44
42
|
/**
|
|
45
43
|
* Block selection button component, displaying the label of the block. If the block
|
|
@@ -48,10 +46,11 @@ import Shuffle from '../block-toolbar/shuffle';
|
|
|
48
46
|
*
|
|
49
47
|
* @param {string} props Component props.
|
|
50
48
|
* @param {string} props.clientId Client ID of block.
|
|
49
|
+
* @param {Object} ref Reference to the component.
|
|
51
50
|
*
|
|
52
51
|
* @return {Component} The component to be rendered.
|
|
53
52
|
*/
|
|
54
|
-
function BlockSelectionButton( { clientId, rootClientId } ) {
|
|
53
|
+
function BlockSelectionButton( { clientId, rootClientId }, ref ) {
|
|
55
54
|
const selected = useSelect(
|
|
56
55
|
( select ) => {
|
|
57
56
|
const {
|
|
@@ -62,7 +61,6 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
|
|
|
62
61
|
__unstableGetEditorMode,
|
|
63
62
|
getNextBlockClientId,
|
|
64
63
|
getPreviousBlockClientId,
|
|
65
|
-
canRemoveBlock,
|
|
66
64
|
canMoveBlock,
|
|
67
65
|
} = select( blockEditorStore );
|
|
68
66
|
const { getActiveBlockVariation, getBlockType } =
|
|
@@ -73,26 +71,6 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
|
|
|
73
71
|
const orientation =
|
|
74
72
|
getBlockListSettings( rootClientId )?.orientation;
|
|
75
73
|
const match = getActiveBlockVariation( name, attributes );
|
|
76
|
-
const isBlockTemplatePart =
|
|
77
|
-
blockType?.name === 'core/template-part';
|
|
78
|
-
|
|
79
|
-
let isNextBlockTemplatePart = false;
|
|
80
|
-
const nextClientId = getNextBlockClientId();
|
|
81
|
-
if ( nextClientId ) {
|
|
82
|
-
const { name: nextName } = getBlock( nextClientId );
|
|
83
|
-
const nextBlockType = getBlockType( nextName );
|
|
84
|
-
isNextBlockTemplatePart =
|
|
85
|
-
nextBlockType?.name === 'core/template-part';
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
let isPrevBlockTemplatePart = false;
|
|
89
|
-
const prevClientId = getPreviousBlockClientId();
|
|
90
|
-
if ( prevClientId ) {
|
|
91
|
-
const { name: prevName } = getBlock( prevClientId );
|
|
92
|
-
const prevBlockType = getBlockType( prevName );
|
|
93
|
-
isPrevBlockTemplatePart =
|
|
94
|
-
prevBlockType?.name === 'core/template-part';
|
|
95
|
-
}
|
|
96
74
|
|
|
97
75
|
return {
|
|
98
76
|
blockMovingMode: hasBlockMovingClientId(),
|
|
@@ -104,28 +82,15 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
|
|
|
104
82
|
index + 1,
|
|
105
83
|
orientation
|
|
106
84
|
),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
canRemove: canRemoveBlock( clientId ),
|
|
111
|
-
canMove: canMoveBlock( clientId ),
|
|
85
|
+
canMove: canMoveBlock( clientId, rootClientId ),
|
|
86
|
+
getNextBlockClientId,
|
|
87
|
+
getPreviousBlockClientId,
|
|
112
88
|
};
|
|
113
89
|
},
|
|
114
90
|
[ clientId, rootClientId ]
|
|
115
91
|
);
|
|
116
|
-
const {
|
|
117
|
-
label,
|
|
118
|
-
icon,
|
|
119
|
-
blockMovingMode,
|
|
120
|
-
editorMode,
|
|
121
|
-
isBlockTemplatePart,
|
|
122
|
-
isNextBlockTemplatePart,
|
|
123
|
-
isPrevBlockTemplatePart,
|
|
124
|
-
canRemove,
|
|
125
|
-
canMove,
|
|
126
|
-
} = selected;
|
|
92
|
+
const { label, icon, blockMovingMode, editorMode, canMove } = selected;
|
|
127
93
|
const { setNavigationMode, removeBlock } = useDispatch( blockEditorStore );
|
|
128
|
-
const ref = useRef();
|
|
129
94
|
|
|
130
95
|
// Focus the breadcrumb in navigation mode.
|
|
131
96
|
useEffect( () => {
|
|
@@ -164,11 +129,6 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
|
|
|
164
129
|
const isEnter = keyCode === ENTER;
|
|
165
130
|
const isSpace = keyCode === SPACE;
|
|
166
131
|
const isShift = event.shiftKey;
|
|
167
|
-
if ( isEscape && editorMode === 'navigation' ) {
|
|
168
|
-
setNavigationMode( false );
|
|
169
|
-
event.preventDefault();
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
132
|
|
|
173
133
|
if ( keyCode === BACKSPACE || keyCode === DELETE ) {
|
|
174
134
|
removeBlock( clientId );
|
|
@@ -281,9 +241,7 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
|
|
|
281
241
|
);
|
|
282
242
|
|
|
283
243
|
const dragHandleLabel = __( 'Drag' );
|
|
284
|
-
const showBlockDraggable =
|
|
285
|
-
( canMove && editorMode === 'navigation' ) ||
|
|
286
|
-
( editorMode === 'zoom-out' && canMove && ! isBlockTemplatePart );
|
|
244
|
+
const showBlockDraggable = canMove && editorMode === 'navigation';
|
|
287
245
|
|
|
288
246
|
return (
|
|
289
247
|
<div className={ classNames }>
|
|
@@ -312,36 +270,6 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
|
|
|
312
270
|
</BlockDraggable>
|
|
313
271
|
</FlexItem>
|
|
314
272
|
) }
|
|
315
|
-
{ editorMode === 'zoom-out' && ! isBlockTemplatePart && (
|
|
316
|
-
<FlexItem>
|
|
317
|
-
<BlockMover
|
|
318
|
-
clientIds={ [ clientId ] }
|
|
319
|
-
hideDragHandle
|
|
320
|
-
isBlockMoverUpButtonDisabled={
|
|
321
|
-
isPrevBlockTemplatePart
|
|
322
|
-
}
|
|
323
|
-
isBlockMoverDownButtonDisabled={
|
|
324
|
-
isNextBlockTemplatePart
|
|
325
|
-
}
|
|
326
|
-
/>
|
|
327
|
-
</FlexItem>
|
|
328
|
-
) }
|
|
329
|
-
{ canMove && canRemove && editorMode === 'zoom-out' && (
|
|
330
|
-
<Shuffle clientId={ clientId } as={ Button } />
|
|
331
|
-
) }
|
|
332
|
-
{ canRemove &&
|
|
333
|
-
editorMode === 'zoom-out' &&
|
|
334
|
-
! isBlockTemplatePart && (
|
|
335
|
-
<FlexItem>
|
|
336
|
-
<ToolbarButton
|
|
337
|
-
icon={ trash }
|
|
338
|
-
label="Delete"
|
|
339
|
-
onClick={ () => {
|
|
340
|
-
removeBlock( clientId );
|
|
341
|
-
} }
|
|
342
|
-
/>
|
|
343
|
-
</FlexItem>
|
|
344
|
-
) }
|
|
345
273
|
{ editorMode === 'navigation' && (
|
|
346
274
|
<FlexItem>
|
|
347
275
|
<Button
|
|
@@ -368,4 +296,4 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
|
|
|
368
296
|
);
|
|
369
297
|
}
|
|
370
298
|
|
|
371
|
-
export default BlockSelectionButton;
|
|
299
|
+
export default forwardRef( BlockSelectionButton );
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { forwardRef } from '@wordpress/element';
|
|
10
|
+
|
|
6
11
|
/**
|
|
7
12
|
* Internal dependencies
|
|
8
13
|
*/
|
|
@@ -11,10 +16,7 @@ import { PrivateBlockPopover } from '../block-popover';
|
|
|
11
16
|
import useBlockToolbarPopoverProps from './use-block-toolbar-popover-props';
|
|
12
17
|
import useSelectedBlockToolProps from './use-selected-block-tool-props';
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
clientId,
|
|
16
|
-
__unstableContentRef,
|
|
17
|
-
} ) {
|
|
19
|
+
function BlockToolbarBreadcrumb( { clientId, __unstableContentRef }, ref ) {
|
|
18
20
|
const {
|
|
19
21
|
capturingClientId,
|
|
20
22
|
isInsertionPointVisible,
|
|
@@ -38,9 +40,12 @@ export default function BlockToolbarBreadcrumb( {
|
|
|
38
40
|
{ ...popoverProps }
|
|
39
41
|
>
|
|
40
42
|
<BlockSelectionButton
|
|
43
|
+
ref={ ref }
|
|
41
44
|
clientId={ clientId }
|
|
42
45
|
rootClientId={ rootClientId }
|
|
43
46
|
/>
|
|
44
47
|
</PrivateBlockPopover>
|
|
45
48
|
);
|
|
46
49
|
}
|
|
50
|
+
|
|
51
|
+
export default forwardRef( BlockToolbarBreadcrumb );
|
|
@@ -20,11 +20,13 @@ import {
|
|
|
20
20
|
} from './insertion-point';
|
|
21
21
|
import BlockToolbarPopover from './block-toolbar-popover';
|
|
22
22
|
import BlockToolbarBreadcrumb from './block-toolbar-breadcrumb';
|
|
23
|
+
import ZoomOutPopover from './zoom-out-popover';
|
|
23
24
|
import { store as blockEditorStore } from '../../store';
|
|
24
25
|
import usePopoverScroll from '../block-popover/use-popover-scroll';
|
|
25
26
|
import ZoomOutModeInserters from './zoom-out-mode-inserters';
|
|
26
27
|
import { useShowBlockTools } from './use-show-block-tools';
|
|
27
28
|
import { unlock } from '../../lock-unlock';
|
|
29
|
+
import getEditorRegion from '../../utils/get-editor-region';
|
|
28
30
|
|
|
29
31
|
function selector( select ) {
|
|
30
32
|
const {
|
|
@@ -78,9 +80,11 @@ export default function BlockTools( {
|
|
|
78
80
|
showEmptyBlockSideInserter,
|
|
79
81
|
showBreadcrumb,
|
|
80
82
|
showBlockToolbarPopover,
|
|
83
|
+
showZoomOutToolbar,
|
|
81
84
|
} = useShowBlockTools();
|
|
82
85
|
|
|
83
86
|
const {
|
|
87
|
+
clearSelectedBlock,
|
|
84
88
|
duplicateBlocks,
|
|
85
89
|
removeBlocks,
|
|
86
90
|
replaceBlocks,
|
|
@@ -92,6 +96,8 @@ export default function BlockTools( {
|
|
|
92
96
|
expandBlock,
|
|
93
97
|
} = unlock( useDispatch( blockEditorStore ) );
|
|
94
98
|
|
|
99
|
+
const blockSelectionButtonRef = useRef();
|
|
100
|
+
|
|
95
101
|
function onKeyDown( event ) {
|
|
96
102
|
if ( event.defaultPrevented ) {
|
|
97
103
|
return;
|
|
@@ -152,6 +158,13 @@ export default function BlockTools( {
|
|
|
152
158
|
// block so that focus is directed back to the beginning of the selection.
|
|
153
159
|
// In effect, to the user this feels like deselecting the multi-selection.
|
|
154
160
|
selectBlock( clientIds[ 0 ] );
|
|
161
|
+
} else if (
|
|
162
|
+
clientIds.length === 1 &&
|
|
163
|
+
event.target === blockSelectionButtonRef?.current
|
|
164
|
+
) {
|
|
165
|
+
event.preventDefault();
|
|
166
|
+
clearSelectedBlock();
|
|
167
|
+
getEditorRegion( __unstableContentRef.current )?.focus();
|
|
155
168
|
}
|
|
156
169
|
} else if ( isMatch( 'core/block-editor/collapse-list-view', event ) ) {
|
|
157
170
|
// If focus is currently within a text field, such as a rich text block or other editable field,
|
|
@@ -182,7 +195,6 @@ export default function BlockTools( {
|
|
|
182
195
|
}
|
|
183
196
|
}
|
|
184
197
|
}
|
|
185
|
-
|
|
186
198
|
const blockToolbarRef = usePopoverScroll( __unstableContentRef );
|
|
187
199
|
const blockToolbarAfterRef = usePopoverScroll( __unstableContentRef );
|
|
188
200
|
|
|
@@ -213,6 +225,14 @@ export default function BlockTools( {
|
|
|
213
225
|
|
|
214
226
|
{ showBreadcrumb && (
|
|
215
227
|
<BlockToolbarBreadcrumb
|
|
228
|
+
ref={ blockSelectionButtonRef }
|
|
229
|
+
__unstableContentRef={ __unstableContentRef }
|
|
230
|
+
clientId={ clientId }
|
|
231
|
+
/>
|
|
232
|
+
) }
|
|
233
|
+
|
|
234
|
+
{ showZoomOutToolbar && (
|
|
235
|
+
<ZoomOutPopover
|
|
216
236
|
__unstableContentRef={ __unstableContentRef }
|
|
217
237
|
clientId={ clientId }
|
|
218
238
|
/>
|