@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
|
@@ -270,3 +270,26 @@
|
|
|
270
270
|
top: 50%;
|
|
271
271
|
left: 50%;
|
|
272
272
|
}
|
|
273
|
+
|
|
274
|
+
.zoom-out-toolbar {
|
|
275
|
+
|
|
276
|
+
.block-editor-block-mover-button.block-editor-block-mover-button:focus-visible::before,
|
|
277
|
+
.zoom-out-toolbar-button:focus::before,
|
|
278
|
+
.block-editor-block-toolbar-shuffle:focus::before,
|
|
279
|
+
.block-selection-button_drag-handle:focus::before {
|
|
280
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.block-editor-block-mover {
|
|
284
|
+
background: none;
|
|
285
|
+
border: none;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.block-editor-block-tools__zoom-out-mode-inserter-button {
|
|
290
|
+
visibility: hidden;
|
|
291
|
+
|
|
292
|
+
&.is-visible {
|
|
293
|
+
visibility: visible;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
@@ -29,10 +29,11 @@ export function useShowBlockTools() {
|
|
|
29
29
|
const clientId =
|
|
30
30
|
getSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();
|
|
31
31
|
|
|
32
|
-
const block = getBlock( clientId )
|
|
32
|
+
const block = getBlock( clientId );
|
|
33
33
|
const editorMode = __unstableGetEditorMode();
|
|
34
|
-
const hasSelectedBlock = clientId && block
|
|
35
|
-
const isEmptyDefaultBlock =
|
|
34
|
+
const hasSelectedBlock = !! clientId && !! block;
|
|
35
|
+
const isEmptyDefaultBlock =
|
|
36
|
+
hasSelectedBlock && isUnmodifiedDefaultBlock( block );
|
|
36
37
|
const _showEmptyBlockSideInserter =
|
|
37
38
|
clientId &&
|
|
38
39
|
! isTyping() &&
|
|
@@ -41,18 +42,28 @@ export function useShowBlockTools() {
|
|
|
41
42
|
const maybeShowBreadcrumb =
|
|
42
43
|
hasSelectedBlock &&
|
|
43
44
|
! hasMultiSelection() &&
|
|
44
|
-
|
|
45
|
+
editorMode === 'navigation';
|
|
46
|
+
|
|
47
|
+
const isZoomOut = editorMode === 'zoom-out';
|
|
48
|
+
const _showZoomOutToolbar =
|
|
49
|
+
isZoomOut &&
|
|
50
|
+
block?.attributes?.align === 'full' &&
|
|
51
|
+
! _showEmptyBlockSideInserter &&
|
|
52
|
+
! maybeShowBreadcrumb;
|
|
53
|
+
const _showBlockToolbarPopover =
|
|
54
|
+
! _showZoomOutToolbar &&
|
|
55
|
+
! getSettings().hasFixedToolbar &&
|
|
56
|
+
! _showEmptyBlockSideInserter &&
|
|
57
|
+
hasSelectedBlock &&
|
|
58
|
+
! isEmptyDefaultBlock &&
|
|
59
|
+
! maybeShowBreadcrumb;
|
|
45
60
|
|
|
46
61
|
return {
|
|
47
62
|
showEmptyBlockSideInserter: _showEmptyBlockSideInserter,
|
|
48
63
|
showBreadcrumb:
|
|
49
64
|
! _showEmptyBlockSideInserter && maybeShowBreadcrumb,
|
|
50
|
-
showBlockToolbarPopover:
|
|
51
|
-
|
|
52
|
-
! _showEmptyBlockSideInserter &&
|
|
53
|
-
hasSelectedBlock &&
|
|
54
|
-
! isEmptyDefaultBlock &&
|
|
55
|
-
! maybeShowBreadcrumb,
|
|
65
|
+
showBlockToolbarPopover: _showBlockToolbarPopover,
|
|
66
|
+
showZoomOutToolbar: _showZoomOutToolbar,
|
|
56
67
|
};
|
|
57
68
|
}, [] );
|
|
58
69
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { useState } from '@wordpress/element';
|
|
10
|
+
import { Button } from '@wordpress/components';
|
|
11
|
+
import { plus } from '@wordpress/icons';
|
|
12
|
+
import { _x } from '@wordpress/i18n';
|
|
13
|
+
|
|
14
|
+
function ZoomOutModeInserterButton( { isVisible, onClick } ) {
|
|
15
|
+
const [
|
|
16
|
+
zoomOutModeInserterButtonHovered,
|
|
17
|
+
setZoomOutModeInserterButtonHovered,
|
|
18
|
+
] = useState( false );
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Button
|
|
22
|
+
variant="primary"
|
|
23
|
+
icon={ plus }
|
|
24
|
+
size="compact"
|
|
25
|
+
className={ clsx(
|
|
26
|
+
'block-editor-button-pattern-inserter__button',
|
|
27
|
+
'block-editor-block-tools__zoom-out-mode-inserter-button',
|
|
28
|
+
{
|
|
29
|
+
'is-visible': isVisible || zoomOutModeInserterButtonHovered,
|
|
30
|
+
}
|
|
31
|
+
) }
|
|
32
|
+
onClick={ onClick }
|
|
33
|
+
onMouseOver={ () => {
|
|
34
|
+
setZoomOutModeInserterButtonHovered( true );
|
|
35
|
+
} }
|
|
36
|
+
onMouseOut={ () => {
|
|
37
|
+
setZoomOutModeInserterButtonHovered( false );
|
|
38
|
+
} }
|
|
39
|
+
label={ _x(
|
|
40
|
+
'Add pattern',
|
|
41
|
+
'Generic label for pattern inserter button'
|
|
42
|
+
) }
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default ZoomOutModeInserterButton;
|
|
@@ -2,28 +2,34 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect } from '@wordpress/data';
|
|
5
|
-
import { useEffect,
|
|
6
|
-
import { Button } from '@wordpress/components';
|
|
7
|
-
import { plus } from '@wordpress/icons';
|
|
8
|
-
import { _x } from '@wordpress/i18n';
|
|
5
|
+
import { useEffect, useState } from '@wordpress/element';
|
|
9
6
|
|
|
10
7
|
/**
|
|
11
8
|
* Internal dependencies
|
|
12
9
|
*/
|
|
13
10
|
import BlockPopoverInbetween from '../block-popover/inbetween';
|
|
11
|
+
import ZoomOutModeInserterButton from './zoom-out-mode-inserter-button';
|
|
14
12
|
import { store as blockEditorStore } from '../../store';
|
|
15
13
|
import { unlock } from '../../lock-unlock';
|
|
16
14
|
|
|
17
15
|
function ZoomOutModeInserters() {
|
|
18
16
|
const [ isReady, setIsReady ] = useState( false );
|
|
19
17
|
const {
|
|
18
|
+
hasSelection,
|
|
20
19
|
blockOrder,
|
|
21
|
-
sectionRootClientId,
|
|
22
20
|
insertionPoint,
|
|
23
21
|
setInserterIsOpened,
|
|
24
|
-
|
|
22
|
+
sectionRootClientId,
|
|
23
|
+
selectedBlockClientId,
|
|
24
|
+
hoveredBlockClientId,
|
|
25
25
|
} = useSelect( ( select ) => {
|
|
26
|
-
const {
|
|
26
|
+
const {
|
|
27
|
+
getSettings,
|
|
28
|
+
getBlockOrder,
|
|
29
|
+
getSelectionStart,
|
|
30
|
+
getSelectedBlockClientId,
|
|
31
|
+
getHoveredBlockClientId,
|
|
32
|
+
} = select( blockEditorStore );
|
|
27
33
|
const { sectionRootClientId: root } = unlock( getSettings() );
|
|
28
34
|
// To do: move ZoomOutModeInserters to core/editor.
|
|
29
35
|
// Or we perhaps we should move the insertion point state to the
|
|
@@ -33,26 +39,17 @@ function ZoomOutModeInserters() {
|
|
|
33
39
|
// eslint-disable-next-line @wordpress/data-no-store-string-literals
|
|
34
40
|
const editor = select( 'core/editor' );
|
|
35
41
|
return {
|
|
36
|
-
|
|
42
|
+
hasSelection: !! getSelectionStart().clientId,
|
|
37
43
|
blockOrder: getBlockOrder( root ),
|
|
38
44
|
insertionPoint: unlock( editor ).getInsertionPoint(),
|
|
39
45
|
sectionRootClientId: root,
|
|
40
46
|
setInserterIsOpened:
|
|
41
47
|
getSettings().__experimentalSetIsInserterOpened,
|
|
48
|
+
selectedBlockClientId: getSelectedBlockClientId(),
|
|
49
|
+
hoveredBlockClientId: getHoveredBlockClientId(),
|
|
42
50
|
};
|
|
43
51
|
}, [] );
|
|
44
52
|
|
|
45
|
-
const isMounted = useRef( false );
|
|
46
|
-
|
|
47
|
-
useEffect( () => {
|
|
48
|
-
if ( ! isMounted.current ) {
|
|
49
|
-
isMounted.current = true;
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
// reset insertion point when the block order changes
|
|
53
|
-
setInserterIsOpened( true );
|
|
54
|
-
}, [ blockOrder, setInserterIsOpened ] );
|
|
55
|
-
|
|
56
53
|
// Defer the initial rendering to avoid the jumps due to the animation.
|
|
57
54
|
useEffect( () => {
|
|
58
55
|
const timeout = setTimeout( () => {
|
|
@@ -63,18 +60,39 @@ function ZoomOutModeInserters() {
|
|
|
63
60
|
};
|
|
64
61
|
}, [] );
|
|
65
62
|
|
|
66
|
-
if ( ! isReady
|
|
63
|
+
if ( ! isReady ) {
|
|
67
64
|
return null;
|
|
68
65
|
}
|
|
69
66
|
|
|
70
67
|
return [ undefined, ...blockOrder ].map( ( clientId, index ) => {
|
|
68
|
+
const shouldRenderInserter = insertionPoint.insertionIndex !== index;
|
|
69
|
+
|
|
70
|
+
const shouldRenderInsertionPoint =
|
|
71
|
+
insertionPoint.insertionIndex === index;
|
|
72
|
+
|
|
73
|
+
if ( ! shouldRenderInserter && ! shouldRenderInsertionPoint ) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const previousClientId = clientId;
|
|
78
|
+
const nextClientId = blockOrder[ index ];
|
|
79
|
+
|
|
80
|
+
const isSelected =
|
|
81
|
+
hasSelection &&
|
|
82
|
+
( selectedBlockClientId === previousClientId ||
|
|
83
|
+
selectedBlockClientId === nextClientId );
|
|
84
|
+
|
|
85
|
+
const isHovered =
|
|
86
|
+
hoveredBlockClientId === previousClientId ||
|
|
87
|
+
hoveredBlockClientId === nextClientId;
|
|
88
|
+
|
|
71
89
|
return (
|
|
72
90
|
<BlockPopoverInbetween
|
|
73
91
|
key={ index }
|
|
74
|
-
previousClientId={
|
|
75
|
-
nextClientId={
|
|
92
|
+
previousClientId={ previousClientId }
|
|
93
|
+
nextClientId={ nextClientId }
|
|
76
94
|
>
|
|
77
|
-
{
|
|
95
|
+
{ shouldRenderInsertionPoint && (
|
|
78
96
|
<div
|
|
79
97
|
style={ {
|
|
80
98
|
borderRadius: '0',
|
|
@@ -86,12 +104,9 @@ function ZoomOutModeInserters() {
|
|
|
86
104
|
className="block-editor-block-list__insertion-point-indicator"
|
|
87
105
|
/>
|
|
88
106
|
) }
|
|
89
|
-
{
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
icon={ plus }
|
|
93
|
-
size="compact"
|
|
94
|
-
className="block-editor-button-pattern-inserter__button"
|
|
107
|
+
{ shouldRenderInserter && (
|
|
108
|
+
<ZoomOutModeInserterButton
|
|
109
|
+
isVisible={ isSelected || isHovered }
|
|
95
110
|
onClick={ () => {
|
|
96
111
|
setInserterIsOpened( {
|
|
97
112
|
rootClientId: sectionRootClientId,
|
|
@@ -100,10 +115,6 @@ function ZoomOutModeInserters() {
|
|
|
100
115
|
category: 'all',
|
|
101
116
|
} );
|
|
102
117
|
} }
|
|
103
|
-
label={ _x(
|
|
104
|
-
'Add pattern',
|
|
105
|
-
'Generic label for pattern inserter button'
|
|
106
|
-
) }
|
|
107
118
|
/>
|
|
108
119
|
) }
|
|
109
120
|
</BlockPopoverInbetween>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
/**
|
|
6
|
+
* Internal dependencies
|
|
7
|
+
*/
|
|
8
|
+
import BlockPopover from '../block-popover';
|
|
9
|
+
import useBlockToolbarPopoverProps from './use-block-toolbar-popover-props';
|
|
10
|
+
import useSelectedBlockToolProps from './use-selected-block-tool-props';
|
|
11
|
+
import ZoomOutToolbar from './zoom-out-toolbar';
|
|
12
|
+
|
|
13
|
+
export default function ZoomOutPopover( { clientId, __unstableContentRef } ) {
|
|
14
|
+
const {
|
|
15
|
+
capturingClientId,
|
|
16
|
+
isInsertionPointVisible,
|
|
17
|
+
lastClientId,
|
|
18
|
+
rootClientId,
|
|
19
|
+
} = useSelectedBlockToolProps( clientId );
|
|
20
|
+
|
|
21
|
+
const popoverProps = useBlockToolbarPopoverProps( {
|
|
22
|
+
contentElement: __unstableContentRef?.current,
|
|
23
|
+
clientId,
|
|
24
|
+
} );
|
|
25
|
+
|
|
26
|
+
// Override some of the popover props for the zoom-out toolbar.
|
|
27
|
+
const props = {
|
|
28
|
+
...popoverProps,
|
|
29
|
+
placement: 'left-start',
|
|
30
|
+
flip: false,
|
|
31
|
+
shift: true,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<BlockPopover
|
|
36
|
+
clientId={ capturingClientId || clientId }
|
|
37
|
+
bottomClientId={ lastClientId }
|
|
38
|
+
className={ clsx( 'zoom-out-toolbar-popover', {
|
|
39
|
+
'is-insertion-point-visible': isInsertionPointVisible,
|
|
40
|
+
} ) }
|
|
41
|
+
resize={ false }
|
|
42
|
+
{ ...props }
|
|
43
|
+
>
|
|
44
|
+
<ZoomOutToolbar
|
|
45
|
+
clientId={ clientId }
|
|
46
|
+
rootClientId={ rootClientId }
|
|
47
|
+
/>
|
|
48
|
+
</BlockPopover>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { dragHandle, trash } from '@wordpress/icons';
|
|
10
|
+
import { Button, ToolbarButton } from '@wordpress/components';
|
|
11
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
12
|
+
import { store as blocksStore } from '@wordpress/blocks';
|
|
13
|
+
import { __ } from '@wordpress/i18n';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
import { store as blockEditorStore } from '../../store';
|
|
19
|
+
import BlockDraggable from '../block-draggable';
|
|
20
|
+
import BlockMover from '../block-mover';
|
|
21
|
+
import Shuffle from '../block-toolbar/shuffle';
|
|
22
|
+
import NavigableToolbar from '../navigable-toolbar';
|
|
23
|
+
|
|
24
|
+
export default function ZoomOutToolbar( { clientId, rootClientId } ) {
|
|
25
|
+
const selected = useSelect(
|
|
26
|
+
( select ) => {
|
|
27
|
+
const {
|
|
28
|
+
getBlock,
|
|
29
|
+
hasBlockMovingClientId,
|
|
30
|
+
getNextBlockClientId,
|
|
31
|
+
getPreviousBlockClientId,
|
|
32
|
+
canRemoveBlock,
|
|
33
|
+
canMoveBlock,
|
|
34
|
+
} = select( blockEditorStore );
|
|
35
|
+
const { getBlockType } = select( blocksStore );
|
|
36
|
+
const { name } = getBlock( clientId );
|
|
37
|
+
const blockType = getBlockType( name );
|
|
38
|
+
const isBlockTemplatePart =
|
|
39
|
+
blockType?.name === 'core/template-part';
|
|
40
|
+
|
|
41
|
+
let isNextBlockTemplatePart = false;
|
|
42
|
+
const nextClientId = getNextBlockClientId();
|
|
43
|
+
if ( nextClientId ) {
|
|
44
|
+
const { name: nextName } = getBlock( nextClientId );
|
|
45
|
+
const nextBlockType = getBlockType( nextName );
|
|
46
|
+
isNextBlockTemplatePart =
|
|
47
|
+
nextBlockType?.name === 'core/template-part';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
let isPrevBlockTemplatePart = false;
|
|
51
|
+
const prevClientId = getPreviousBlockClientId();
|
|
52
|
+
if ( prevClientId ) {
|
|
53
|
+
const { name: prevName } = getBlock( prevClientId );
|
|
54
|
+
const prevBlockType = getBlockType( prevName );
|
|
55
|
+
isPrevBlockTemplatePart =
|
|
56
|
+
prevBlockType?.name === 'core/template-part';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
blockMovingMode: hasBlockMovingClientId(),
|
|
61
|
+
isBlockTemplatePart,
|
|
62
|
+
isNextBlockTemplatePart,
|
|
63
|
+
isPrevBlockTemplatePart,
|
|
64
|
+
canRemove: canRemoveBlock( clientId, rootClientId ),
|
|
65
|
+
canMove: canMoveBlock( clientId, rootClientId ),
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
[ clientId, rootClientId ]
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const {
|
|
72
|
+
blockMovingMode,
|
|
73
|
+
isBlockTemplatePart,
|
|
74
|
+
isNextBlockTemplatePart,
|
|
75
|
+
isPrevBlockTemplatePart,
|
|
76
|
+
canRemove,
|
|
77
|
+
canMove,
|
|
78
|
+
} = selected;
|
|
79
|
+
|
|
80
|
+
const { removeBlock } = useDispatch( blockEditorStore );
|
|
81
|
+
|
|
82
|
+
const classNames = clsx( 'zoom-out-toolbar', {
|
|
83
|
+
'is-block-moving-mode': !! blockMovingMode,
|
|
84
|
+
} );
|
|
85
|
+
|
|
86
|
+
const showBlockDraggable = canMove && ! isBlockTemplatePart;
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<NavigableToolbar
|
|
90
|
+
className={ classNames }
|
|
91
|
+
/* translators: accessibility text for the block toolbar */
|
|
92
|
+
aria-label={ __( 'Block tools' ) }
|
|
93
|
+
// The variant is applied as "toolbar" when undefined, which is the black border style of the dropdown from the toolbar popover.
|
|
94
|
+
variant="unstyled"
|
|
95
|
+
orientation="vertical"
|
|
96
|
+
>
|
|
97
|
+
{ showBlockDraggable && (
|
|
98
|
+
<BlockDraggable clientIds={ [ clientId ] }>
|
|
99
|
+
{ ( draggableProps ) => (
|
|
100
|
+
<Button
|
|
101
|
+
icon={ dragHandle }
|
|
102
|
+
className="block-selection-button_drag-handle zoom-out-toolbar-button"
|
|
103
|
+
aria-hidden="true"
|
|
104
|
+
label={ __( 'Drag' ) }
|
|
105
|
+
iconSize={ 24 }
|
|
106
|
+
size="compact"
|
|
107
|
+
// Should not be able to tab to drag handle as this
|
|
108
|
+
// button can only be used with a pointer device.
|
|
109
|
+
tabIndex="-1"
|
|
110
|
+
{ ...draggableProps }
|
|
111
|
+
/>
|
|
112
|
+
) }
|
|
113
|
+
</BlockDraggable>
|
|
114
|
+
) }
|
|
115
|
+
{ ! isBlockTemplatePart && (
|
|
116
|
+
<BlockMover
|
|
117
|
+
clientIds={ [ clientId ] }
|
|
118
|
+
hideDragHandle
|
|
119
|
+
isBlockMoverUpButtonDisabled={ isPrevBlockTemplatePart }
|
|
120
|
+
isBlockMoverDownButtonDisabled={ isNextBlockTemplatePart }
|
|
121
|
+
iconSize={ 24 }
|
|
122
|
+
size="compact"
|
|
123
|
+
/>
|
|
124
|
+
) }
|
|
125
|
+
{ canMove && canRemove && (
|
|
126
|
+
<Shuffle clientId={ clientId } as={ ToolbarButton } />
|
|
127
|
+
) }
|
|
128
|
+
{ canRemove && ! isBlockTemplatePart && (
|
|
129
|
+
<ToolbarButton
|
|
130
|
+
className="zoom-out-toolbar-button"
|
|
131
|
+
icon={ trash }
|
|
132
|
+
label={ __( 'Delete' ) }
|
|
133
|
+
onClick={ () => {
|
|
134
|
+
removeBlock( clientId );
|
|
135
|
+
} }
|
|
136
|
+
/>
|
|
137
|
+
) }
|
|
138
|
+
</NavigableToolbar>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
@@ -18,7 +18,7 @@ import deprecated from '@wordpress/deprecated';
|
|
|
18
18
|
import Inserter from '../inserter';
|
|
19
19
|
|
|
20
20
|
function ButtonBlockAppender(
|
|
21
|
-
{ rootClientId, className, onFocus, tabIndex },
|
|
21
|
+
{ rootClientId, className, onFocus, tabIndex, onSelect },
|
|
22
22
|
ref
|
|
23
23
|
) {
|
|
24
24
|
return (
|
|
@@ -26,6 +26,7 @@ function ButtonBlockAppender(
|
|
|
26
26
|
position="bottom center"
|
|
27
27
|
rootClientId={ rootClientId }
|
|
28
28
|
__experimentalIsQuick
|
|
29
|
+
onSelectOrClose={ onSelect }
|
|
29
30
|
renderToggle={ ( {
|
|
30
31
|
onToggle,
|
|
31
32
|
disabled,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
Flex,
|
|
13
13
|
FlexItem,
|
|
14
14
|
} from '@wordpress/components';
|
|
15
|
-
import { __ } from '@wordpress/i18n';
|
|
15
|
+
import { __, _x } from '@wordpress/i18n';
|
|
16
16
|
import { useEffect } from '@wordpress/element';
|
|
17
17
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
18
18
|
|
|
@@ -142,17 +142,26 @@ function FlexControls( {
|
|
|
142
142
|
<ToggleGroupControlOption
|
|
143
143
|
key="fit"
|
|
144
144
|
value="fit"
|
|
145
|
-
label={
|
|
145
|
+
label={ _x(
|
|
146
|
+
'Fit',
|
|
147
|
+
'Intrinsic block width in flex layout'
|
|
148
|
+
) }
|
|
146
149
|
/>
|
|
147
150
|
<ToggleGroupControlOption
|
|
148
151
|
key="fill"
|
|
149
152
|
value="fill"
|
|
150
|
-
label={
|
|
153
|
+
label={ _x(
|
|
154
|
+
'Grow',
|
|
155
|
+
'Block with expanding width in flex layout'
|
|
156
|
+
) }
|
|
151
157
|
/>
|
|
152
158
|
<ToggleGroupControlOption
|
|
153
159
|
key="fixed"
|
|
154
160
|
value="fixed"
|
|
155
|
-
label={
|
|
161
|
+
label={ _x(
|
|
162
|
+
'Fixed',
|
|
163
|
+
'Block with fixed width in flex layout'
|
|
164
|
+
) }
|
|
156
165
|
/>
|
|
157
166
|
</ToggleGroupControl>
|
|
158
167
|
{ selfStretch === 'fixed' && (
|
|
@@ -184,8 +193,7 @@ function GridControls( {
|
|
|
184
193
|
panelId,
|
|
185
194
|
} ) {
|
|
186
195
|
const { columnStart, rowStart, columnSpan, rowSpan } = childLayout;
|
|
187
|
-
const { columnCount } = parentLayout ?? {};
|
|
188
|
-
const gridColumnNumber = parseInt( columnCount, 10 ) || 3;
|
|
196
|
+
const { columnCount = 3, rowCount } = parentLayout ?? {};
|
|
189
197
|
const rootClientId = useSelect( ( select ) =>
|
|
190
198
|
select( blockEditorStore ).getBlockRootClientId( panelId )
|
|
191
199
|
);
|
|
@@ -193,7 +201,7 @@ function GridControls( {
|
|
|
193
201
|
useDispatch( blockEditorStore );
|
|
194
202
|
const getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(
|
|
195
203
|
rootClientId,
|
|
196
|
-
|
|
204
|
+
columnCount
|
|
197
205
|
);
|
|
198
206
|
const hasStartValue = () => !! columnStart || !! rowStart;
|
|
199
207
|
const hasSpanValue = () => !! columnSpan || !! rowSpan;
|
|
@@ -225,14 +233,17 @@ function GridControls( {
|
|
|
225
233
|
label={ __( 'Column span' ) }
|
|
226
234
|
type="number"
|
|
227
235
|
onChange={ ( value ) => {
|
|
236
|
+
// Don't allow unsetting.
|
|
237
|
+
const newColumnSpan =
|
|
238
|
+
value === '' ? 1 : parseInt( value, 10 );
|
|
228
239
|
onChange( {
|
|
229
240
|
columnStart,
|
|
230
241
|
rowStart,
|
|
231
242
|
rowSpan,
|
|
232
|
-
columnSpan:
|
|
243
|
+
columnSpan: newColumnSpan,
|
|
233
244
|
} );
|
|
234
245
|
} }
|
|
235
|
-
value={ columnSpan }
|
|
246
|
+
value={ columnSpan ?? 1 }
|
|
236
247
|
min={ 1 }
|
|
237
248
|
/>
|
|
238
249
|
<InputControl
|
|
@@ -240,14 +251,17 @@ function GridControls( {
|
|
|
240
251
|
label={ __( 'Row span' ) }
|
|
241
252
|
type="number"
|
|
242
253
|
onChange={ ( value ) => {
|
|
254
|
+
// Don't allow unsetting.
|
|
255
|
+
const newRowSpan =
|
|
256
|
+
value === '' ? 1 : parseInt( value, 10 );
|
|
243
257
|
onChange( {
|
|
244
258
|
columnStart,
|
|
245
259
|
rowStart,
|
|
246
260
|
columnSpan,
|
|
247
|
-
rowSpan:
|
|
261
|
+
rowSpan: newRowSpan,
|
|
248
262
|
} );
|
|
249
263
|
} }
|
|
250
|
-
value={ rowSpan }
|
|
264
|
+
value={ rowSpan ?? 1 }
|
|
251
265
|
min={ 1 }
|
|
252
266
|
/>
|
|
253
267
|
</HStack>
|
|
@@ -269,8 +283,11 @@ function GridControls( {
|
|
|
269
283
|
label={ __( 'Column' ) }
|
|
270
284
|
type="number"
|
|
271
285
|
onChange={ ( value ) => {
|
|
286
|
+
// Don't allow unsetting.
|
|
287
|
+
const newColumnStart =
|
|
288
|
+
value === '' ? 1 : parseInt( value, 10 );
|
|
272
289
|
onChange( {
|
|
273
|
-
columnStart:
|
|
290
|
+
columnStart: newColumnStart,
|
|
274
291
|
rowStart,
|
|
275
292
|
columnSpan,
|
|
276
293
|
rowSpan,
|
|
@@ -281,16 +298,16 @@ function GridControls( {
|
|
|
281
298
|
rootClientId,
|
|
282
299
|
rootClientId,
|
|
283
300
|
getNumberOfBlocksBeforeCell(
|
|
284
|
-
|
|
301
|
+
newColumnStart,
|
|
285
302
|
rowStart
|
|
286
303
|
)
|
|
287
304
|
);
|
|
288
305
|
} }
|
|
289
|
-
value={ columnStart }
|
|
306
|
+
value={ columnStart ?? 1 }
|
|
290
307
|
min={ 1 }
|
|
291
308
|
max={
|
|
292
|
-
|
|
293
|
-
?
|
|
309
|
+
columnCount
|
|
310
|
+
? columnCount - ( columnSpan ?? 1 ) + 1
|
|
294
311
|
: undefined
|
|
295
312
|
}
|
|
296
313
|
/>
|
|
@@ -301,9 +318,12 @@ function GridControls( {
|
|
|
301
318
|
label={ __( 'Row' ) }
|
|
302
319
|
type="number"
|
|
303
320
|
onChange={ ( value ) => {
|
|
321
|
+
// Don't allow unsetting.
|
|
322
|
+
const newRowStart =
|
|
323
|
+
value === '' ? 1 : parseInt( value, 10 );
|
|
304
324
|
onChange( {
|
|
305
325
|
columnStart,
|
|
306
|
-
rowStart:
|
|
326
|
+
rowStart: newRowStart,
|
|
307
327
|
columnSpan,
|
|
308
328
|
rowSpan,
|
|
309
329
|
} );
|
|
@@ -314,17 +334,15 @@ function GridControls( {
|
|
|
314
334
|
rootClientId,
|
|
315
335
|
getNumberOfBlocksBeforeCell(
|
|
316
336
|
columnStart,
|
|
317
|
-
|
|
337
|
+
newRowStart
|
|
318
338
|
)
|
|
319
339
|
);
|
|
320
340
|
} }
|
|
321
|
-
value={ rowStart }
|
|
341
|
+
value={ rowStart ?? 1 }
|
|
322
342
|
min={ 1 }
|
|
323
343
|
max={
|
|
324
|
-
|
|
325
|
-
?
|
|
326
|
-
( rowSpan ?? 1 ) +
|
|
327
|
-
1
|
|
344
|
+
rowCount
|
|
345
|
+
? rowCount - ( rowSpan ?? 1 ) + 1
|
|
328
346
|
: undefined
|
|
329
347
|
}
|
|
330
348
|
/>
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
TextControl,
|
|
9
9
|
ExternalLink,
|
|
10
10
|
VisuallyHidden,
|
|
11
|
-
CustomSelectControl,
|
|
12
11
|
ToggleControl,
|
|
13
12
|
__experimentalVStack as VStack,
|
|
13
|
+
CustomSelectControl,
|
|
14
14
|
} from '@wordpress/components';
|
|
15
15
|
|
|
16
16
|
// So that we illustrate the different formats in the dropdown properly, show a date that is
|
|
@@ -117,7 +117,7 @@ function NonDefaultControls( { format, onChange } ) {
|
|
|
117
117
|
name: __( 'Custom' ),
|
|
118
118
|
className:
|
|
119
119
|
'block-editor-date-format-picker__custom-format-select-control__custom-option',
|
|
120
|
-
|
|
120
|
+
hint: __( 'Enter your own date format' ),
|
|
121
121
|
};
|
|
122
122
|
|
|
123
123
|
const [ isCustom, setIsCustom ] = useState(
|
|
@@ -4,13 +4,4 @@
|
|
|
4
4
|
|
|
5
5
|
.block-editor-date-format-picker__custom-format-select-control__custom-option {
|
|
6
6
|
border-top: 1px solid $gray-300;
|
|
7
|
-
|
|
8
|
-
&.has-hint {
|
|
9
|
-
grid-template-columns: auto 30px;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.components-custom-select-control__item-hint {
|
|
13
|
-
grid-row: 2;
|
|
14
|
-
text-align: left;
|
|
15
|
-
}
|
|
16
7
|
}
|