@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
|
@@ -22,11 +22,19 @@ import {
|
|
|
22
22
|
__experimentalItemGroup as ItemGroup,
|
|
23
23
|
__experimentalHStack as HStack,
|
|
24
24
|
__experimentalTruncate as Truncate,
|
|
25
|
+
Dropdown,
|
|
26
|
+
__experimentalDropdownContentWrapper as DropdownContentWrapper,
|
|
25
27
|
} from '@wordpress/components';
|
|
26
28
|
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
27
29
|
import { store as noticesStore } from '@wordpress/notices';
|
|
28
30
|
import { getFilename } from '@wordpress/url';
|
|
29
|
-
import {
|
|
31
|
+
import {
|
|
32
|
+
useCallback,
|
|
33
|
+
Platform,
|
|
34
|
+
useRef,
|
|
35
|
+
useState,
|
|
36
|
+
useEffect,
|
|
37
|
+
} from '@wordpress/element';
|
|
30
38
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
31
39
|
import { focus } from '@wordpress/dom';
|
|
32
40
|
import { isBlobURL } from '@wordpress/blob';
|
|
@@ -34,7 +42,7 @@ import { isBlobURL } from '@wordpress/blob';
|
|
|
34
42
|
/**
|
|
35
43
|
* Internal dependencies
|
|
36
44
|
*/
|
|
37
|
-
import {
|
|
45
|
+
import { useToolsPanelDropdownMenuProps } from './utils';
|
|
38
46
|
import { setImmutably } from '../../utils/object';
|
|
39
47
|
import MediaReplaceFlow from '../media-replace-flow';
|
|
40
48
|
import { store as blockEditorStore } from '../../store';
|
|
@@ -43,8 +51,14 @@ import { getResolvedThemeFilePath } from './theme-file-uri-utils';
|
|
|
43
51
|
const IMAGE_BACKGROUND_TYPE = 'image';
|
|
44
52
|
const DEFAULT_CONTROLS = {
|
|
45
53
|
backgroundImage: true,
|
|
46
|
-
backgroundSize: false,
|
|
47
54
|
};
|
|
55
|
+
const BACKGROUND_POPOVER_PROPS = {
|
|
56
|
+
placement: 'left-start',
|
|
57
|
+
offset: 36,
|
|
58
|
+
shift: true,
|
|
59
|
+
className: 'block-editor-global-styles-background-panel__popover',
|
|
60
|
+
};
|
|
61
|
+
const noop = () => {};
|
|
48
62
|
|
|
49
63
|
/**
|
|
50
64
|
* Checks site settings to see if the background panel may be used.
|
|
@@ -141,21 +155,30 @@ export const backgroundPositionToCoords = ( value ) => {
|
|
|
141
155
|
return { x, y };
|
|
142
156
|
};
|
|
143
157
|
|
|
144
|
-
function
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
158
|
+
function InspectorImagePreviewItem( {
|
|
159
|
+
as = 'span',
|
|
160
|
+
imgUrl,
|
|
161
|
+
toggleProps = {},
|
|
162
|
+
filename,
|
|
163
|
+
label,
|
|
164
|
+
className,
|
|
165
|
+
onToggleCallback = noop,
|
|
166
|
+
} ) {
|
|
167
|
+
useEffect( () => {
|
|
168
|
+
if ( typeof toggleProps?.isOpen !== 'undefined' ) {
|
|
169
|
+
onToggleCallback( toggleProps?.isOpen );
|
|
170
|
+
}
|
|
171
|
+
}, [ toggleProps?.isOpen, onToggleCallback ] );
|
|
148
172
|
return (
|
|
149
|
-
<ItemGroup as=
|
|
150
|
-
<HStack
|
|
173
|
+
<ItemGroup as={ as } className={ className } { ...toggleProps }>
|
|
174
|
+
<HStack
|
|
175
|
+
justify="flex-start"
|
|
176
|
+
as="span"
|
|
177
|
+
className="block-editor-global-styles-background-panel__inspector-preview-inner"
|
|
178
|
+
>
|
|
151
179
|
{ imgUrl && (
|
|
152
180
|
<span
|
|
153
|
-
className=
|
|
154
|
-
'block-editor-global-styles-background-panel__inspector-image-indicator-wrapper',
|
|
155
|
-
{
|
|
156
|
-
'has-image': imgUrl,
|
|
157
|
-
}
|
|
158
|
-
) }
|
|
181
|
+
className="block-editor-global-styles-background-panel__inspector-image-indicator-wrapper"
|
|
159
182
|
aria-hidden
|
|
160
183
|
>
|
|
161
184
|
<span
|
|
@@ -166,19 +189,19 @@ function InspectorImagePreview( { label, filename, url: imgUrl } ) {
|
|
|
166
189
|
/>
|
|
167
190
|
</span>
|
|
168
191
|
) }
|
|
169
|
-
<FlexItem as="span">
|
|
192
|
+
<FlexItem as="span" style={ imgUrl ? {} : { flexGrow: 1 } }>
|
|
170
193
|
<Truncate
|
|
171
194
|
numberOfLines={ 1 }
|
|
172
195
|
className="block-editor-global-styles-background-panel__inspector-media-replace-title"
|
|
173
196
|
>
|
|
174
|
-
{
|
|
197
|
+
{ label }
|
|
175
198
|
</Truncate>
|
|
176
199
|
<VisuallyHidden as="span">
|
|
177
200
|
{ imgUrl
|
|
178
201
|
? sprintf(
|
|
179
202
|
/* translators: %s: file name */
|
|
180
203
|
__( 'Background image: %s' ),
|
|
181
|
-
filename ||
|
|
204
|
+
filename || label
|
|
182
205
|
)
|
|
183
206
|
: __( 'No background image selected' ) }
|
|
184
207
|
</VisuallyHidden>
|
|
@@ -188,12 +211,64 @@ function InspectorImagePreview( { label, filename, url: imgUrl } ) {
|
|
|
188
211
|
);
|
|
189
212
|
}
|
|
190
213
|
|
|
191
|
-
function
|
|
192
|
-
|
|
193
|
-
|
|
214
|
+
function BackgroundControlsPanel( {
|
|
215
|
+
label,
|
|
216
|
+
filename,
|
|
217
|
+
url: imgUrl,
|
|
218
|
+
children,
|
|
219
|
+
onToggle: onToggleCallback = noop,
|
|
220
|
+
hasImageValue,
|
|
221
|
+
} ) {
|
|
222
|
+
if ( ! hasImageValue ) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const imgLabel =
|
|
227
|
+
label || getFilename( imgUrl ) || __( 'Add background image' );
|
|
228
|
+
|
|
229
|
+
return (
|
|
230
|
+
<Dropdown
|
|
231
|
+
popoverProps={ BACKGROUND_POPOVER_PROPS }
|
|
232
|
+
renderToggle={ ( { onToggle, isOpen } ) => {
|
|
233
|
+
const toggleProps = {
|
|
234
|
+
onClick: onToggle,
|
|
235
|
+
className:
|
|
236
|
+
'block-editor-global-styles-background-panel__dropdown-toggle',
|
|
237
|
+
'aria-expanded': isOpen,
|
|
238
|
+
'aria-label': __(
|
|
239
|
+
'Background size, position and repeat options.'
|
|
240
|
+
),
|
|
241
|
+
isOpen,
|
|
242
|
+
};
|
|
243
|
+
return (
|
|
244
|
+
<InspectorImagePreviewItem
|
|
245
|
+
imgUrl={ imgUrl }
|
|
246
|
+
filename={ filename }
|
|
247
|
+
label={ imgLabel }
|
|
248
|
+
toggleProps={ toggleProps }
|
|
249
|
+
as="button"
|
|
250
|
+
onToggleCallback={ onToggleCallback }
|
|
251
|
+
/>
|
|
252
|
+
);
|
|
253
|
+
} }
|
|
254
|
+
renderContent={ () => (
|
|
255
|
+
<DropdownContentWrapper
|
|
256
|
+
className="block-editor-global-styles-background-panel__dropdown-content-wrapper"
|
|
257
|
+
paddingSize="medium"
|
|
258
|
+
>
|
|
259
|
+
{ children }
|
|
260
|
+
</DropdownContentWrapper>
|
|
261
|
+
) }
|
|
262
|
+
/>
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function BackgroundImageControls( {
|
|
194
267
|
onChange,
|
|
195
268
|
style,
|
|
196
269
|
inheritedValue,
|
|
270
|
+
onRemoveImage = noop,
|
|
271
|
+
displayInPanel,
|
|
197
272
|
themeFileURIs,
|
|
198
273
|
} ) {
|
|
199
274
|
const mediaUpload = useSelect(
|
|
@@ -204,9 +279,7 @@ function BackgroundImageToolsPanelItem( {
|
|
|
204
279
|
const { id, title, url } = style?.background?.backgroundImage || {
|
|
205
280
|
...inheritedValue?.background?.backgroundImage,
|
|
206
281
|
};
|
|
207
|
-
|
|
208
282
|
const replaceContainerRef = useRef();
|
|
209
|
-
|
|
210
283
|
const { createErrorNotice } = useDispatch( noticesStore );
|
|
211
284
|
const onUploadError = ( message ) => {
|
|
212
285
|
createErrorNotice( message, { type: 'snackbar' } );
|
|
@@ -279,16 +352,6 @@ function BackgroundImageToolsPanelItem( {
|
|
|
279
352
|
} );
|
|
280
353
|
};
|
|
281
354
|
|
|
282
|
-
const resetAllFilter = useCallback( ( previousValue ) => {
|
|
283
|
-
return {
|
|
284
|
-
...previousValue,
|
|
285
|
-
style: {
|
|
286
|
-
...previousValue.style,
|
|
287
|
-
background: undefined,
|
|
288
|
-
},
|
|
289
|
-
};
|
|
290
|
-
}, [] );
|
|
291
|
-
|
|
292
355
|
const hasValue = hasBackgroundImageValue( style );
|
|
293
356
|
|
|
294
357
|
const closeAndFocus = () => {
|
|
@@ -307,72 +370,69 @@ function BackgroundImageToolsPanelItem( {
|
|
|
307
370
|
setImmutably( style, [ 'background', 'backgroundImage' ], 'none' )
|
|
308
371
|
);
|
|
309
372
|
const canRemove = ! hasValue && hasBackgroundImageValue( inheritedValue );
|
|
373
|
+
const imgLabel =
|
|
374
|
+
title || getFilename( url ) || __( 'Add background image' );
|
|
310
375
|
|
|
311
376
|
return (
|
|
312
|
-
<
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
label={ __( 'Background image' ) }
|
|
316
|
-
onDeselect={ resetBackgroundImage }
|
|
317
|
-
isShownByDefault={ isShownByDefault }
|
|
318
|
-
resetAllFilter={ resetAllFilter }
|
|
319
|
-
panelId={ panelId }
|
|
377
|
+
<div
|
|
378
|
+
ref={ replaceContainerRef }
|
|
379
|
+
className="block-editor-global-styles-background-panel__image-tools-panel-item"
|
|
320
380
|
>
|
|
321
|
-
<
|
|
322
|
-
|
|
323
|
-
|
|
381
|
+
<MediaReplaceFlow
|
|
382
|
+
mediaId={ id }
|
|
383
|
+
mediaURL={ url }
|
|
384
|
+
allowedTypes={ [ IMAGE_BACKGROUND_TYPE ] }
|
|
385
|
+
accept="image/*"
|
|
386
|
+
onSelect={ onSelectMedia }
|
|
387
|
+
popoverProps={ {
|
|
388
|
+
className: clsx( {
|
|
389
|
+
'block-editor-global-styles-background-panel__media-replace-popover':
|
|
390
|
+
displayInPanel,
|
|
391
|
+
} ),
|
|
392
|
+
} }
|
|
393
|
+
name={
|
|
394
|
+
<InspectorImagePreviewItem
|
|
395
|
+
className="block-editor-global-styles-background-panel__image-preview"
|
|
396
|
+
imgUrl={ getResolvedThemeFilePath(
|
|
397
|
+
url,
|
|
398
|
+
themeFileURIs
|
|
399
|
+
) }
|
|
400
|
+
filename={ title }
|
|
401
|
+
label={ imgLabel }
|
|
402
|
+
/>
|
|
403
|
+
}
|
|
404
|
+
variant="secondary"
|
|
324
405
|
>
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
)
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
</MenuItem>
|
|
352
|
-
) }
|
|
353
|
-
{ hasValue && (
|
|
354
|
-
<MenuItem
|
|
355
|
-
onClick={ () => {
|
|
356
|
-
closeAndFocus();
|
|
357
|
-
resetBackgroundImage();
|
|
358
|
-
} }
|
|
359
|
-
>
|
|
360
|
-
{ __( 'Reset ' ) }
|
|
361
|
-
</MenuItem>
|
|
362
|
-
) }
|
|
363
|
-
</MediaReplaceFlow>
|
|
364
|
-
<DropZone
|
|
365
|
-
onFilesDrop={ onFilesDrop }
|
|
366
|
-
label={ __( 'Drop to upload' ) }
|
|
367
|
-
/>
|
|
368
|
-
</div>
|
|
369
|
-
</ToolsPanelItem>
|
|
406
|
+
{ canRemove && (
|
|
407
|
+
<MenuItem
|
|
408
|
+
onClick={ () => {
|
|
409
|
+
closeAndFocus();
|
|
410
|
+
onRemove();
|
|
411
|
+
} }
|
|
412
|
+
>
|
|
413
|
+
{ __( 'Remove' ) }
|
|
414
|
+
</MenuItem>
|
|
415
|
+
) }
|
|
416
|
+
{ hasValue && (
|
|
417
|
+
<MenuItem
|
|
418
|
+
onClick={ () => {
|
|
419
|
+
closeAndFocus();
|
|
420
|
+
onRemoveImage();
|
|
421
|
+
} }
|
|
422
|
+
>
|
|
423
|
+
{ __( 'Reset ' ) }
|
|
424
|
+
</MenuItem>
|
|
425
|
+
) }
|
|
426
|
+
</MediaReplaceFlow>
|
|
427
|
+
<DropZone
|
|
428
|
+
onFilesDrop={ onFilesDrop }
|
|
429
|
+
label={ __( 'Drop to upload' ) }
|
|
430
|
+
/>
|
|
431
|
+
</div>
|
|
370
432
|
);
|
|
371
433
|
}
|
|
372
434
|
|
|
373
|
-
function
|
|
374
|
-
panelId,
|
|
375
|
-
isShownByDefault,
|
|
435
|
+
function BackgroundSizeControls( {
|
|
376
436
|
onChange,
|
|
377
437
|
style,
|
|
378
438
|
inheritedValue,
|
|
@@ -391,6 +451,9 @@ function BackgroundSizeToolsPanelItem( {
|
|
|
391
451
|
const positionValue =
|
|
392
452
|
style?.background?.backgroundPosition ||
|
|
393
453
|
inheritedValue?.background?.backgroundPosition;
|
|
454
|
+
const attachmentValue =
|
|
455
|
+
style?.background?.backgroundAttachment ||
|
|
456
|
+
inheritedValue?.background?.backgroundAttachment;
|
|
394
457
|
|
|
395
458
|
/*
|
|
396
459
|
* An `undefined` value is replaced with any supplied
|
|
@@ -417,22 +480,6 @@ function BackgroundSizeToolsPanelItem( {
|
|
|
417
480
|
( currentValueForToggle === 'cover' && repeatValue === undefined )
|
|
418
481
|
);
|
|
419
482
|
|
|
420
|
-
const hasValue = hasBackgroundSizeValue( style );
|
|
421
|
-
|
|
422
|
-
const resetAllFilter = useCallback( ( previousValue ) => {
|
|
423
|
-
return {
|
|
424
|
-
...previousValue,
|
|
425
|
-
style: {
|
|
426
|
-
...previousValue.style,
|
|
427
|
-
background: {
|
|
428
|
-
...previousValue.style?.background,
|
|
429
|
-
backgroundRepeat: undefined,
|
|
430
|
-
backgroundSize: undefined,
|
|
431
|
-
},
|
|
432
|
-
},
|
|
433
|
-
};
|
|
434
|
-
}, [] );
|
|
435
|
-
|
|
436
483
|
const updateBackgroundSize = ( next ) => {
|
|
437
484
|
// When switching to 'contain' toggle the repeat off.
|
|
438
485
|
let nextRepeat = repeatValue;
|
|
@@ -502,35 +549,33 @@ function BackgroundSizeToolsPanelItem( {
|
|
|
502
549
|
)
|
|
503
550
|
);
|
|
504
551
|
|
|
505
|
-
const
|
|
552
|
+
const toggleScrollWithPage = () =>
|
|
506
553
|
onChange(
|
|
507
|
-
setImmutably(
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
} )
|
|
554
|
+
setImmutably(
|
|
555
|
+
style,
|
|
556
|
+
[ 'background', 'backgroundAttachment' ],
|
|
557
|
+
attachmentValue === 'fixed' ? 'scroll' : 'fixed'
|
|
558
|
+
)
|
|
513
559
|
);
|
|
514
560
|
|
|
515
561
|
return (
|
|
516
|
-
<VStack
|
|
517
|
-
as={ ToolsPanelItem }
|
|
518
|
-
spacing={ 2 }
|
|
519
|
-
className="single-column"
|
|
520
|
-
hasValue={ () => hasValue }
|
|
521
|
-
label={ __( 'Size' ) }
|
|
522
|
-
onDeselect={ resetBackgroundSize }
|
|
523
|
-
isShownByDefault={ isShownByDefault }
|
|
524
|
-
resetAllFilter={ resetAllFilter }
|
|
525
|
-
panelId={ panelId }
|
|
526
|
-
>
|
|
562
|
+
<VStack spacing={ 4 } className="single-column">
|
|
527
563
|
<FocalPointPicker
|
|
528
564
|
__next40pxDefaultSize
|
|
529
|
-
|
|
565
|
+
__nextHasNoMarginBottom
|
|
566
|
+
label={ __( 'Focal point' ) }
|
|
530
567
|
url={ getResolvedThemeFilePath( imageValue, themeFileURIs ) }
|
|
531
568
|
value={ backgroundPositionToCoords( positionValue ) }
|
|
532
569
|
onChange={ updateBackgroundPosition }
|
|
533
570
|
/>
|
|
571
|
+
<ToggleControl
|
|
572
|
+
label={ __( 'Fixed background' ) }
|
|
573
|
+
checked={ attachmentValue === 'fixed' }
|
|
574
|
+
onChange={ toggleScrollWithPage }
|
|
575
|
+
help={ __(
|
|
576
|
+
'Whether your image should scroll with the page or stay fixed in place.'
|
|
577
|
+
) }
|
|
578
|
+
/>
|
|
534
579
|
<ToggleGroupControl
|
|
535
580
|
size="__unstable-large"
|
|
536
581
|
label={ __( 'Size' ) }
|
|
@@ -567,26 +612,25 @@ function BackgroundSizeToolsPanelItem( {
|
|
|
567
612
|
/>
|
|
568
613
|
</ToggleGroupControl>
|
|
569
614
|
<HStack justify="flex-start" spacing={ 2 } as="span">
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
) }
|
|
615
|
+
<UnitControl
|
|
616
|
+
aria-label={ __( 'Background image width' ) }
|
|
617
|
+
onChange={ updateBackgroundSize }
|
|
618
|
+
value={ sizeValue }
|
|
619
|
+
size="__unstable-large"
|
|
620
|
+
__unstableInputWidth="100px"
|
|
621
|
+
min={ 0 }
|
|
622
|
+
placeholder={ __( 'Auto' ) }
|
|
623
|
+
disabled={
|
|
624
|
+
currentValueForToggle !== 'auto' ||
|
|
625
|
+
currentValueForToggle === undefined
|
|
626
|
+
}
|
|
627
|
+
/>
|
|
628
|
+
<ToggleControl
|
|
629
|
+
label={ __( 'Repeat' ) }
|
|
630
|
+
checked={ repeatCheckedValue }
|
|
631
|
+
onChange={ toggleIsRepeated }
|
|
632
|
+
disabled={ currentValueForToggle === 'cover' }
|
|
633
|
+
/>
|
|
590
634
|
</HStack>
|
|
591
635
|
</VStack>
|
|
592
636
|
);
|
|
@@ -600,6 +644,7 @@ function BackgroundToolsPanel( {
|
|
|
600
644
|
children,
|
|
601
645
|
headerLabel,
|
|
602
646
|
} ) {
|
|
647
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
603
648
|
const resetAll = () => {
|
|
604
649
|
const updatedValue = resetAllFilter( value );
|
|
605
650
|
onChange( updatedValue );
|
|
@@ -612,7 +657,7 @@ function BackgroundToolsPanel( {
|
|
|
612
657
|
label={ headerLabel }
|
|
613
658
|
resetAll={ resetAll }
|
|
614
659
|
panelId={ panelId }
|
|
615
|
-
dropdownMenuProps={
|
|
660
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
616
661
|
>
|
|
617
662
|
{ children }
|
|
618
663
|
</VStack>
|
|
@@ -637,8 +682,24 @@ export default function BackgroundPanel( {
|
|
|
637
682
|
background: {},
|
|
638
683
|
};
|
|
639
684
|
}, [] );
|
|
640
|
-
|
|
641
|
-
|
|
685
|
+
|
|
686
|
+
const resetBackground = () =>
|
|
687
|
+
onChange( setImmutably( value, [ 'background' ], {} ) );
|
|
688
|
+
|
|
689
|
+
const { title, url } = value?.background?.backgroundImage || {
|
|
690
|
+
...inheritedValue?.background?.backgroundImage,
|
|
691
|
+
};
|
|
692
|
+
const hasImageValue =
|
|
693
|
+
hasBackgroundImageValue( value ) ||
|
|
694
|
+
hasBackgroundImageValue( inheritedValue );
|
|
695
|
+
|
|
696
|
+
const shouldShowBackgroundImageControls =
|
|
697
|
+
hasImageValue &&
|
|
698
|
+
( settings?.background?.backgroundSize ||
|
|
699
|
+
settings?.background?.backgroundPosition ||
|
|
700
|
+
settings?.background?.backgroundRepeat );
|
|
701
|
+
|
|
702
|
+
const [ isDropDownOpen, setIsDropDownOpen ] = useState( false );
|
|
642
703
|
|
|
643
704
|
return (
|
|
644
705
|
<Wrapper
|
|
@@ -648,25 +709,63 @@ export default function BackgroundPanel( {
|
|
|
648
709
|
panelId={ panelId }
|
|
649
710
|
headerLabel={ headerLabel }
|
|
650
711
|
>
|
|
651
|
-
<
|
|
652
|
-
|
|
653
|
-
|
|
712
|
+
<div
|
|
713
|
+
className={ clsx(
|
|
714
|
+
'block-editor-global-styles-background-panel__inspector-media-replace-container',
|
|
715
|
+
{
|
|
716
|
+
'is-open': isDropDownOpen,
|
|
717
|
+
}
|
|
718
|
+
) }
|
|
719
|
+
>
|
|
720
|
+
{ shouldShowBackgroundImageControls ? (
|
|
721
|
+
<BackgroundControlsPanel
|
|
722
|
+
label={ title }
|
|
723
|
+
filename={ title }
|
|
724
|
+
url={ getResolvedThemeFilePath( url, themeFileURIs ) }
|
|
725
|
+
onToggle={ setIsDropDownOpen }
|
|
726
|
+
hasImageValue={ hasImageValue }
|
|
727
|
+
>
|
|
728
|
+
<VStack spacing={ 3 } className="single-column">
|
|
729
|
+
<BackgroundImageControls
|
|
730
|
+
onChange={ onChange }
|
|
731
|
+
style={ value }
|
|
732
|
+
inheritedValue={ inheritedValue }
|
|
733
|
+
themeFileURIs={ themeFileURIs }
|
|
734
|
+
displayInPanel
|
|
735
|
+
onRemoveImage={ () => {
|
|
736
|
+
setIsDropDownOpen( false );
|
|
737
|
+
resetBackground();
|
|
738
|
+
} }
|
|
739
|
+
/>
|
|
740
|
+
<BackgroundSizeControls
|
|
741
|
+
onChange={ onChange }
|
|
742
|
+
panelId={ panelId }
|
|
743
|
+
style={ value }
|
|
744
|
+
defaultValues={ defaultValues }
|
|
745
|
+
inheritedValue={ inheritedValue }
|
|
746
|
+
themeFileURIs={ themeFileURIs }
|
|
747
|
+
/>
|
|
748
|
+
</VStack>
|
|
749
|
+
</BackgroundControlsPanel>
|
|
750
|
+
) : (
|
|
751
|
+
<BackgroundImageControls
|
|
752
|
+
onChange={ onChange }
|
|
753
|
+
style={ value }
|
|
754
|
+
inheritedValue={ inheritedValue }
|
|
755
|
+
themeFileURIs={ themeFileURIs }
|
|
756
|
+
/>
|
|
757
|
+
) }
|
|
758
|
+
</div>
|
|
759
|
+
|
|
760
|
+
{ /* Dummy ToolsPanel items, so we can control what's in the dropdown popover */ }
|
|
761
|
+
<ToolsPanelItem
|
|
762
|
+
hasValue={ () => hasImageValue }
|
|
763
|
+
label={ __( 'Image' ) }
|
|
764
|
+
onDeselect={ resetBackground }
|
|
654
765
|
isShownByDefault={ defaultControls.backgroundImage }
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
themeFileURIs={ themeFileURIs }
|
|
766
|
+
panelId={ panelId }
|
|
767
|
+
className="block-editor-global-styles-background-panel__hidden-tools-panel-item"
|
|
658
768
|
/>
|
|
659
|
-
{ shouldShowBackgroundSizeControls && (
|
|
660
|
-
<BackgroundSizeToolsPanelItem
|
|
661
|
-
onChange={ onChange }
|
|
662
|
-
panelId={ panelId }
|
|
663
|
-
isShownByDefault={ defaultControls.backgroundSize }
|
|
664
|
-
style={ value }
|
|
665
|
-
inheritedValue={ inheritedValue }
|
|
666
|
-
defaultValues={ defaultValues }
|
|
667
|
-
themeFileURIs={ themeFileURIs }
|
|
668
|
-
/>
|
|
669
|
-
) }
|
|
670
769
|
</Wrapper>
|
|
671
770
|
);
|
|
672
771
|
}
|
|
@@ -18,7 +18,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
18
18
|
*/
|
|
19
19
|
import BorderRadiusControl from '../border-radius-control';
|
|
20
20
|
import { useColorsPerOrigin } from './hooks';
|
|
21
|
-
import { getValueFromVariable,
|
|
21
|
+
import { getValueFromVariable, useToolsPanelDropdownMenuProps } from './utils';
|
|
22
22
|
import { setImmutably } from '../../utils/object';
|
|
23
23
|
import { useBorderPanelLabel } from '../../hooks/border';
|
|
24
24
|
import { ShadowPopover, useShadowPresets } from './shadow-panel-components';
|
|
@@ -69,6 +69,7 @@ function BorderToolsPanel( {
|
|
|
69
69
|
children,
|
|
70
70
|
label,
|
|
71
71
|
} ) {
|
|
72
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
72
73
|
const resetAll = () => {
|
|
73
74
|
const updatedValue = resetAllFilter( value );
|
|
74
75
|
onChange( updatedValue );
|
|
@@ -79,7 +80,7 @@ function BorderToolsPanel( {
|
|
|
79
80
|
label={ label }
|
|
80
81
|
resetAll={ resetAll }
|
|
81
82
|
panelId={ panelId }
|
|
82
|
-
dropdownMenuProps={
|
|
83
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
83
84
|
>
|
|
84
85
|
{ children }
|
|
85
86
|
</ToolsPanel>
|
|
@@ -27,7 +27,7 @@ import { __, sprintf } from '@wordpress/i18n';
|
|
|
27
27
|
*/
|
|
28
28
|
import ColorGradientControl from '../colors-gradients/control';
|
|
29
29
|
import { useColorsPerOrigin, useGradientsPerOrigin } from './hooks';
|
|
30
|
-
import { getValueFromVariable,
|
|
30
|
+
import { getValueFromVariable, useToolsPanelDropdownMenuProps } from './utils';
|
|
31
31
|
import { setImmutably } from '../../utils/object';
|
|
32
32
|
import { unlock } from '../../lock-unlock';
|
|
33
33
|
|
|
@@ -116,6 +116,7 @@ function ColorToolsPanel( {
|
|
|
116
116
|
panelId,
|
|
117
117
|
children,
|
|
118
118
|
} ) {
|
|
119
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
119
120
|
const resetAll = () => {
|
|
120
121
|
const updatedValue = resetAllFilter( value );
|
|
121
122
|
onChange( updatedValue );
|
|
@@ -131,7 +132,7 @@ function ColorToolsPanel( {
|
|
|
131
132
|
className="color-block-support-panel"
|
|
132
133
|
__experimentalFirstVisibleItemClass="first"
|
|
133
134
|
__experimentalLastVisibleItemClass="last"
|
|
134
|
-
dropdownMenuProps={
|
|
135
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
135
136
|
>
|
|
136
137
|
<div className="color-block-support-panel__inner-wrapper">
|
|
137
138
|
{ children }
|
|
@@ -22,7 +22,7 @@ import { useCallback, useState, Platform } from '@wordpress/element';
|
|
|
22
22
|
/**
|
|
23
23
|
* Internal dependencies
|
|
24
24
|
*/
|
|
25
|
-
import { getValueFromVariable,
|
|
25
|
+
import { getValueFromVariable, useToolsPanelDropdownMenuProps } from './utils';
|
|
26
26
|
import SpacingSizesControl from '../spacing-sizes-control';
|
|
27
27
|
import HeightControl from '../height-control';
|
|
28
28
|
import ChildLayoutControl from '../child-layout-control';
|
|
@@ -175,6 +175,7 @@ function DimensionsToolsPanel( {
|
|
|
175
175
|
panelId,
|
|
176
176
|
children,
|
|
177
177
|
} ) {
|
|
178
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
178
179
|
const resetAll = () => {
|
|
179
180
|
const updatedValue = resetAllFilter( value );
|
|
180
181
|
onChange( updatedValue );
|
|
@@ -185,7 +186,7 @@ function DimensionsToolsPanel( {
|
|
|
185
186
|
label={ __( 'Dimensions' ) }
|
|
186
187
|
resetAll={ resetAll }
|
|
187
188
|
panelId={ panelId }
|
|
188
|
-
dropdownMenuProps={
|
|
189
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
189
190
|
>
|
|
190
191
|
{ children }
|
|
191
192
|
</ToolsPanel>
|
|
@@ -28,7 +28,7 @@ import { useCallback, useMemo } from '@wordpress/element';
|
|
|
28
28
|
/**
|
|
29
29
|
* Internal dependencies
|
|
30
30
|
*/
|
|
31
|
-
import { getValueFromVariable,
|
|
31
|
+
import { getValueFromVariable, useToolsPanelDropdownMenuProps } from './utils';
|
|
32
32
|
import { setImmutably } from '../../utils/object';
|
|
33
33
|
|
|
34
34
|
const EMPTY_ARRAY = [];
|
|
@@ -72,6 +72,7 @@ function FiltersToolsPanel( {
|
|
|
72
72
|
panelId,
|
|
73
73
|
children,
|
|
74
74
|
} ) {
|
|
75
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
75
76
|
const resetAll = () => {
|
|
76
77
|
const updatedValue = resetAllFilter( value );
|
|
77
78
|
onChange( updatedValue );
|
|
@@ -82,7 +83,7 @@ function FiltersToolsPanel( {
|
|
|
82
83
|
label={ _x( 'Filters', 'Name for applying graphical effects' ) }
|
|
83
84
|
resetAll={ resetAll }
|
|
84
85
|
panelId={ panelId }
|
|
85
|
-
dropdownMenuProps={
|
|
86
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
86
87
|
>
|
|
87
88
|
{ children }
|
|
88
89
|
</ToolsPanel>
|