@wordpress/block-editor 16.0.0 → 16.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +8 -0
- package/build/components/alignment-control/ui.cjs +2 -4
- package/build/components/alignment-control/ui.cjs.map +2 -2
- package/build/components/background-image-control/index.cjs +40 -10
- package/build/components/background-image-control/index.cjs.map +2 -2
- package/build/components/block-alignment-control/ui.cjs +5 -3
- package/build/components/block-alignment-control/ui.cjs.map +2 -2
- package/build/components/block-inspector/index.cjs +73 -46
- package/build/components/block-inspector/index.cjs.map +2 -2
- package/build/components/block-list/block-html.cjs +4 -1
- package/build/components/block-list/block-html.cjs.map +2 -2
- package/build/components/block-list/use-block-props/index.cjs +5 -2
- package/build/components/block-list/use-block-props/index.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-focus-handler.cjs +2 -3
- package/build/components/block-list/use-block-props/use-focus-handler.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-register-block-event-handlers.cjs +48 -0
- package/build/components/block-list/use-block-props/use-register-block-event-handlers.cjs.map +7 -0
- package/build/components/block-parent-selector/index.cjs +2 -2
- package/build/components/block-parent-selector/index.cjs.map +2 -2
- package/build/components/block-toolbar/switch-section-style.cjs +4 -2
- package/build/components/block-toolbar/switch-section-style.cjs.map +3 -3
- package/build/components/block-tools/empty-block-inserter.cjs +2 -7
- package/build/components/block-tools/empty-block-inserter.cjs.map +2 -2
- package/build/components/block-vertical-alignment-control/ui.cjs +3 -5
- package/build/components/block-vertical-alignment-control/ui.cjs.map +2 -2
- package/build/components/border-radius-control/utils.cjs +8 -58
- package/build/components/border-radius-control/utils.cjs.map +2 -2
- package/build/components/colors-gradients/control.cjs +5 -3
- package/build/components/colors-gradients/control.cjs.map +2 -2
- package/build/components/dimension-control/index.cjs +30 -20
- package/build/components/dimension-control/index.cjs.map +3 -3
- package/build/components/dimensions-tool/aspect-ratio-tool.cjs +9 -2
- package/build/components/dimensions-tool/aspect-ratio-tool.cjs.map +3 -3
- package/build/components/editor-styles/index.cjs +9 -1
- package/build/components/editor-styles/index.cjs.map +2 -2
- package/build/components/global-styles/background-panel.cjs +66 -25
- package/build/components/global-styles/background-panel.cjs.map +3 -3
- package/build/components/global-styles/border-panel.cjs +153 -55
- package/build/components/global-styles/border-panel.cjs.map +3 -3
- package/build/components/global-styles/color-gradient-dropdown-item.cjs +46 -14
- package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +3 -3
- package/build/components/global-styles/color-panel.cjs +63 -17
- package/build/components/global-styles/color-panel.cjs.map +2 -2
- package/build/components/global-styles/dimensions-panel.cjs +242 -64
- package/build/components/global-styles/dimensions-panel.cjs.map +3 -3
- package/build/components/global-styles/filters-panel.cjs +59 -20
- package/build/components/global-styles/filters-panel.cjs.map +3 -3
- package/build/components/global-styles/hooks.cjs +4 -1
- package/build/components/global-styles/hooks.cjs.map +2 -2
- package/build/components/global-styles/inheritance/index.cjs +142 -0
- package/build/components/global-styles/inheritance/index.cjs.map +7 -0
- package/build/components/global-styles/inherited-value-context.cjs +173 -0
- package/build/components/global-styles/inherited-value-context.cjs.map +7 -0
- package/build/components/global-styles/shadow-panel-components.cjs +38 -20
- package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
- package/build/components/global-styles/state-control.cjs +1 -1
- package/build/components/global-styles/state-control.cjs.map +2 -2
- package/build/components/global-styles/typography-panel.cjs +271 -78
- package/build/components/global-styles/typography-panel.cjs.map +3 -3
- package/build/components/inspector-controls-tabs/styles-tab.cjs +10 -1
- package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
- package/build/components/line-height-control/index.cjs +1 -1
- package/build/components/line-height-control/index.cjs.map +2 -2
- package/build/components/link-control/index.cjs +3 -1
- package/build/components/link-control/index.cjs.map +2 -2
- package/build/components/preset-input-control/index.cjs +2 -1
- package/build/components/preset-input-control/index.cjs.map +2 -2
- package/build/components/provider/block-refs-provider.cjs +8 -2
- package/build/components/provider/block-refs-provider.cjs.map +2 -2
- package/build/components/provider/index.cjs +1 -1
- package/build/components/provider/index.cjs.map +2 -2
- package/build/components/provider/use-block-sync.cjs +18 -6
- package/build/components/provider/use-block-sync.cjs.map +2 -2
- package/build/components/provider/use-media-upload-settings.cjs +3 -1
- package/build/components/provider/use-media-upload-settings.cjs.map +2 -2
- package/build/components/rich-text/index.cjs +23 -13
- package/build/components/rich-text/index.cjs.map +2 -2
- package/build/components/spacing-sizes-control/utils.cjs +6 -19
- package/build/components/spacing-sizes-control/utils.cjs.map +2 -2
- package/build/components/text-indent-control/index.cjs +8 -2
- package/build/components/text-indent-control/index.cjs.map +2 -2
- package/build/components/url-input/index.cjs +303 -344
- package/build/components/url-input/index.cjs.map +3 -3
- package/build/components/writing-flow/index.cjs +2 -0
- package/build/components/writing-flow/index.cjs.map +3 -3
- package/build/components/writing-flow/use-arrow-nav.cjs +24 -1
- package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
- package/build/components/writing-flow/use-click-selection.cjs +28 -2
- package/build/components/writing-flow/use-click-selection.cjs.map +2 -2
- package/build/components/writing-flow/use-editable-root-event-handlers.cjs +179 -0
- package/build/components/writing-flow/use-editable-root-event-handlers.cjs.map +7 -0
- package/build/components/writing-flow/use-editable-root.cjs +5 -42
- package/build/components/writing-flow/use-editable-root.cjs.map +2 -2
- package/build/components/writing-flow/use-home-end.cjs +1 -1
- package/build/components/writing-flow/use-home-end.cjs.map +2 -2
- package/build/components/writing-flow/use-selection-observer.cjs +17 -13
- package/build/components/writing-flow/use-selection-observer.cjs.map +2 -2
- package/build/components/writing-flow/utils.cjs +3 -14
- package/build/components/writing-flow/utils.cjs.map +2 -2
- package/build/hooks/background.cjs +13 -10
- package/build/hooks/background.cjs.map +2 -2
- package/build/hooks/block-style-variation.cjs +4 -45
- package/build/hooks/block-style-variation.cjs.map +3 -3
- package/build/hooks/border.cjs +19 -4
- package/build/hooks/border.cjs.map +2 -2
- package/build/hooks/custom-css.cjs +6 -2
- package/build/hooks/custom-css.cjs.map +2 -2
- package/build/hooks/dimensions.cjs +15 -4
- package/build/hooks/dimensions.cjs.map +2 -2
- package/build/hooks/duotone.cjs +26 -14
- package/build/hooks/duotone.cjs.map +3 -3
- package/build/hooks/elements.cjs +14 -4
- package/build/hooks/elements.cjs.map +2 -2
- package/build/hooks/line-height.cjs +1 -2
- package/build/hooks/line-height.cjs.map +2 -2
- package/build/hooks/typography.cjs +13 -4
- package/build/hooks/typography.cjs.map +2 -2
- package/build/private-apis.cjs +9 -5
- package/build/private-apis.cjs.map +3 -3
- package/build/store/actions.cjs +9 -4
- package/build/store/actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +28 -1
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +6 -6
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +23 -0
- package/build/store/selectors.cjs.map +2 -2
- package/build/utils/native-undo.cjs +55 -0
- package/build/utils/native-undo.cjs.map +7 -0
- package/build-module/components/alignment-control/ui.mjs +2 -4
- package/build-module/components/alignment-control/ui.mjs.map +2 -2
- package/build-module/components/background-image-control/index.mjs +43 -10
- package/build-module/components/background-image-control/index.mjs.map +2 -2
- package/build-module/components/block-alignment-control/ui.mjs +5 -3
- package/build-module/components/block-alignment-control/ui.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +74 -46
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-list/block-html.mjs +4 -1
- package/build-module/components/block-list/block-html.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/index.mjs +5 -2
- package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/use-focus-handler.mjs +2 -3
- package/build-module/components/block-list/use-block-props/use-focus-handler.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/use-register-block-event-handlers.mjs +28 -0
- package/build-module/components/block-list/use-block-props/use-register-block-event-handlers.mjs.map +7 -0
- package/build-module/components/block-parent-selector/index.mjs +2 -2
- package/build-module/components/block-parent-selector/index.mjs.map +2 -2
- package/build-module/components/block-toolbar/switch-section-style.mjs +4 -2
- package/build-module/components/block-toolbar/switch-section-style.mjs.map +2 -2
- package/build-module/components/block-tools/empty-block-inserter.mjs +2 -7
- package/build-module/components/block-tools/empty-block-inserter.mjs.map +2 -2
- package/build-module/components/block-vertical-alignment-control/ui.mjs +4 -6
- package/build-module/components/block-vertical-alignment-control/ui.mjs.map +2 -2
- package/build-module/components/border-radius-control/utils.mjs +11 -53
- package/build-module/components/border-radius-control/utils.mjs.map +2 -2
- package/build-module/components/colors-gradients/control.mjs +5 -3
- package/build-module/components/colors-gradients/control.mjs.map +2 -2
- package/build-module/components/dimension-control/index.mjs +30 -20
- package/build-module/components/dimension-control/index.mjs.map +2 -2
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs +10 -6
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs.map +2 -2
- package/build-module/components/editor-styles/index.mjs +9 -1
- package/build-module/components/editor-styles/index.mjs.map +2 -2
- package/build-module/components/global-styles/background-panel.mjs +71 -29
- package/build-module/components/global-styles/background-panel.mjs.map +2 -2
- package/build-module/components/global-styles/border-panel.mjs +157 -56
- package/build-module/components/global-styles/border-panel.mjs.map +2 -2
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs +51 -15
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +2 -2
- package/build-module/components/global-styles/color-panel.mjs +63 -17
- package/build-module/components/global-styles/color-panel.mjs.map +2 -2
- package/build-module/components/global-styles/dimensions-panel.mjs +248 -66
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/global-styles/filters-panel.mjs +64 -21
- package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
- package/build-module/components/global-styles/hooks.mjs +4 -1
- package/build-module/components/global-styles/hooks.mjs.map +2 -2
- package/build-module/components/global-styles/inheritance/index.mjs +108 -0
- package/build-module/components/global-styles/inheritance/index.mjs.map +7 -0
- package/build-module/components/global-styles/inherited-value-context.mjs +141 -0
- package/build-module/components/global-styles/inherited-value-context.mjs.map +7 -0
- package/build-module/components/global-styles/shadow-panel-components.mjs +38 -20
- package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
- package/build-module/components/global-styles/state-control.mjs +1 -1
- package/build-module/components/global-styles/state-control.mjs.map +2 -2
- package/build-module/components/global-styles/typography-panel.mjs +276 -79
- package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs +6 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
- package/build-module/components/line-height-control/index.mjs +1 -1
- package/build-module/components/line-height-control/index.mjs.map +2 -2
- package/build-module/components/link-control/index.mjs +4 -2
- package/build-module/components/link-control/index.mjs.map +2 -2
- package/build-module/components/preset-input-control/index.mjs +2 -1
- package/build-module/components/preset-input-control/index.mjs.map +2 -2
- package/build-module/components/provider/block-refs-provider.mjs +8 -2
- package/build-module/components/provider/block-refs-provider.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +1 -1
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/provider/use-block-sync.mjs +18 -6
- package/build-module/components/provider/use-block-sync.mjs.map +2 -2
- package/build-module/components/provider/use-media-upload-settings.mjs +3 -1
- package/build-module/components/provider/use-media-upload-settings.mjs.map +2 -2
- package/build-module/components/rich-text/index.mjs +28 -14
- package/build-module/components/rich-text/index.mjs.map +2 -2
- package/build-module/components/spacing-sizes-control/utils.mjs +6 -18
- package/build-module/components/spacing-sizes-control/utils.mjs.map +2 -2
- package/build-module/components/text-indent-control/index.mjs +8 -2
- package/build-module/components/text-indent-control/index.mjs.map +2 -2
- package/build-module/components/url-input/index.mjs +306 -353
- package/build-module/components/url-input/index.mjs.map +2 -2
- package/build-module/components/writing-flow/index.mjs +2 -0
- package/build-module/components/writing-flow/index.mjs.map +2 -2
- package/build-module/components/writing-flow/use-arrow-nav.mjs +24 -1
- package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
- package/build-module/components/writing-flow/use-click-selection.mjs +28 -2
- package/build-module/components/writing-flow/use-click-selection.mjs.map +2 -2
- package/build-module/components/writing-flow/use-editable-root-event-handlers.mjs +154 -0
- package/build-module/components/writing-flow/use-editable-root-event-handlers.mjs.map +7 -0
- package/build-module/components/writing-flow/use-editable-root.mjs +5 -37
- package/build-module/components/writing-flow/use-editable-root.mjs.map +2 -2
- package/build-module/components/writing-flow/use-home-end.mjs +1 -1
- package/build-module/components/writing-flow/use-home-end.mjs.map +2 -2
- package/build-module/components/writing-flow/use-selection-observer.mjs +18 -14
- package/build-module/components/writing-flow/use-selection-observer.mjs.map +2 -2
- package/build-module/components/writing-flow/utils.mjs +2 -11
- package/build-module/components/writing-flow/utils.mjs.map +2 -2
- package/build-module/hooks/background.mjs +13 -10
- package/build-module/hooks/background.mjs.map +2 -2
- package/build-module/hooks/block-style-variation.mjs +8 -44
- package/build-module/hooks/block-style-variation.mjs.map +2 -2
- package/build-module/hooks/border.mjs +19 -4
- package/build-module/hooks/border.mjs.map +2 -2
- package/build-module/hooks/custom-css.mjs +7 -3
- package/build-module/hooks/custom-css.mjs.map +2 -2
- package/build-module/hooks/dimensions.mjs +15 -4
- package/build-module/hooks/dimensions.mjs.map +2 -2
- package/build-module/hooks/duotone.mjs +20 -9
- package/build-module/hooks/duotone.mjs.map +2 -2
- package/build-module/hooks/elements.mjs +14 -4
- package/build-module/hooks/elements.mjs.map +2 -2
- package/build-module/hooks/line-height.mjs +1 -2
- package/build-module/hooks/line-height.mjs.map +2 -2
- package/build-module/hooks/typography.mjs +13 -4
- package/build-module/hooks/typography.mjs.map +2 -2
- package/build-module/private-apis.mjs +7 -3
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/actions.mjs +9 -4
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +29 -1
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +6 -6
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +23 -0
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/native-undo.mjs +29 -0
- package/build-module/utils/native-undo.mjs.map +7 -0
- package/build-style/content-rtl.css +10 -18
- package/build-style/content.css +10 -18
- package/build-style/style-rtl.css +150 -7
- package/build-style/style.css +150 -7
- package/package.json +40 -41
- package/src/components/alignment-control/test/__snapshots__/index.js.snap +1 -1
- package/src/components/alignment-control/ui.js +2 -4
- package/src/components/background-image-control/index.js +74 -37
- package/src/components/background-image-control/style.scss +13 -4
- package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +3 -3
- package/src/components/block-alignment-control/test/index.js +1 -1
- package/src/components/block-alignment-control/ui.js +4 -2
- package/src/components/block-breadcrumb/test/__snapshots__/index.js.snap +1 -1
- package/src/components/block-compare/test/__snapshots__/block-view.js.snap +1 -1
- package/src/components/block-icon/test/__snapshots__/index.js.snap +1 -1
- package/src/components/block-inspector/index.js +60 -31
- package/src/components/block-list/block-html.js +5 -0
- package/src/components/block-list/content.scss +1 -11
- package/src/components/block-list/use-block-props/index.js +5 -1
- package/src/components/block-list/use-block-props/use-focus-handler.js +9 -8
- package/src/components/block-list/use-block-props/use-register-block-event-handlers.js +45 -0
- package/src/components/block-parent-selector/index.js +5 -2
- package/src/components/block-toolbar/switch-section-style.js +5 -2
- package/src/components/block-tools/empty-block-inserter.js +3 -7
- package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +3 -3
- package/src/components/block-vertical-alignment-control/test/index.js +18 -2
- package/src/components/block-vertical-alignment-control/ui.js +3 -5
- package/src/components/border-radius-control/test/utils.js +0 -41
- package/src/components/border-radius-control/utils.js +16 -107
- package/src/components/button-block-appender/content.scss +6 -2
- package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
- package/src/components/colors-gradients/control.js +6 -3
- package/src/components/default-block-appender/test/__snapshots__/index.js.snap +1 -1
- package/src/components/dimension-control/index.js +13 -1
- package/src/components/dimensions-tool/aspect-ratio-tool.js +13 -6
- package/src/components/editor-styles/index.js +16 -1
- package/src/components/global-styles/background-panel.js +107 -34
- package/src/components/global-styles/border-panel.js +219 -48
- package/src/components/global-styles/color-gradient-dropdown-item.js +93 -28
- package/src/components/global-styles/color-panel.js +92 -11
- package/src/components/global-styles/dimensions-panel.js +422 -71
- package/src/components/global-styles/filters-panel.js +88 -28
- package/src/components/global-styles/hooks.js +8 -1
- package/src/components/global-styles/inheritance/index.js +204 -0
- package/src/components/global-styles/inheritance/style.scss +184 -0
- package/src/components/global-styles/inheritance/test/index.js +281 -0
- package/src/components/global-styles/inherited-value-context.js +271 -0
- package/src/components/global-styles/shadow-panel-components.js +48 -26
- package/src/components/global-styles/state-control.js +2 -2
- package/src/components/global-styles/test/background-panel.js +338 -1
- package/src/components/global-styles/test/border-panel.js +441 -0
- package/src/components/global-styles/test/color-panel.js +182 -2
- package/src/components/global-styles/test/dimensions-panel.js +753 -0
- package/src/components/global-styles/test/filters-panel.js +194 -0
- package/src/components/global-styles/test/inherited-value-context-core.js +98 -0
- package/src/components/global-styles/test/inherited-value-context.js +454 -0
- package/src/components/global-styles/test/typography-panel-core.js +185 -0
- package/src/components/global-styles/test/typography-panel.js +849 -12
- package/src/components/global-styles/typography-panel.js +449 -100
- package/src/components/image-editor/style.scss +33 -0
- package/src/components/inner-blocks/test/__snapshots__/index.js.snap +1 -1
- package/src/components/inspector-controls-tabs/styles-tab.js +5 -1
- package/src/components/line-height-control/index.js +1 -1
- package/src/components/link-control/index.js +7 -2
- package/src/components/preset-input-control/index.js +4 -1
- package/src/components/provider/block-refs-provider.js +12 -2
- package/src/components/provider/index.js +2 -2
- package/src/components/provider/use-block-sync.js +18 -6
- package/src/components/provider/use-media-upload-settings.js +2 -0
- package/src/components/rich-text/index.js +37 -16
- package/src/components/spacing-sizes-control/test/utils.js +16 -5
- package/src/components/spacing-sizes-control/utils.js +11 -28
- package/src/components/text-indent-control/index.js +8 -0
- package/src/components/url-input/index.js +363 -431
- package/src/components/url-input/test/index.js +592 -0
- package/src/components/warning/test/__snapshots__/index.js.snap +1 -1
- package/src/components/writing-flow/index.js +2 -0
- package/src/components/writing-flow/use-arrow-nav.js +51 -1
- package/src/components/writing-flow/use-click-selection.js +54 -3
- package/src/components/writing-flow/use-editable-root-event-handlers.js +266 -0
- package/src/components/writing-flow/use-editable-root.js +7 -77
- package/src/components/writing-flow/use-home-end.js +17 -9
- package/src/components/writing-flow/use-selection-observer.js +32 -15
- package/src/components/writing-flow/utils.js +3 -24
- package/src/hooks/background.js +26 -21
- package/src/hooks/block-fields/rich-text/styles.scss +1 -1
- package/src/hooks/block-style-variation.js +8 -74
- package/src/hooks/border.js +19 -4
- package/src/hooks/custom-css.js +15 -6
- package/src/hooks/dimensions.js +17 -4
- package/src/hooks/duotone.js +26 -8
- package/src/hooks/elements.js +14 -3
- package/src/hooks/line-height.js +0 -1
- package/src/hooks/test/inherited-value-wiring.js +411 -0
- package/src/hooks/test/preset-round-trip.js +456 -0
- package/src/hooks/typography.js +35 -23
- package/src/private-apis.js +11 -2
- package/src/store/actions.js +10 -4
- package/src/store/private-selectors.js +57 -1
- package/src/store/reducer.js +9 -9
- package/src/store/selectors.js +56 -8
- package/src/store/test/private-selectors.js +160 -1
- package/src/style.scss +2 -0
- package/src/utils/native-undo.js +56 -0
- package/build/components/duotone/utils.cjs +0 -87
- package/build/components/duotone/utils.cjs.map +0 -7
- package/build-module/components/duotone/utils.mjs +0 -59
- package/build-module/components/duotone/utils.mjs.map +0 -7
- package/src/components/duotone/utils.js +0 -90
- package/src/hooks/test/get-variation-styles-with-ref-values.js +0 -91
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.1.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -60,50 +60,49 @@
|
|
|
60
60
|
],
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@react-spring/web": "^9.4.5",
|
|
63
|
-
"@wordpress/a11y": "^4.
|
|
64
|
-
"@wordpress/base-styles": "^
|
|
65
|
-
"@wordpress/blob": "^4.
|
|
66
|
-
"@wordpress/block-serialization-default-parser": "^5.
|
|
67
|
-
"@wordpress/blocks": "^15.
|
|
68
|
-
"@wordpress/commands": "^1.
|
|
69
|
-
"@wordpress/components": "^
|
|
70
|
-
"@wordpress/compose": "^8.
|
|
71
|
-
"@wordpress/data": "^10.
|
|
72
|
-
"@wordpress/dataviews": "^17.
|
|
73
|
-
"@wordpress/date": "^5.
|
|
74
|
-
"@wordpress/deprecated": "^4.
|
|
75
|
-
"@wordpress/dom": "^4.
|
|
76
|
-
"@wordpress/element": "^8.
|
|
77
|
-
"@wordpress/escape-html": "^3.
|
|
78
|
-
"@wordpress/global-styles-engine": "^1.
|
|
79
|
-
"@wordpress/hooks": "^4.
|
|
80
|
-
"@wordpress/html-entities": "^4.
|
|
81
|
-
"@wordpress/i18n": "^6.
|
|
82
|
-
"@wordpress/icons": "^15.
|
|
83
|
-
"@wordpress/image-cropper": "^1.
|
|
84
|
-
"@wordpress/interactivity": "^6.
|
|
85
|
-
"@wordpress/is-shallow-equal": "^5.
|
|
86
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
87
|
-
"@wordpress/keycodes": "^4.
|
|
88
|
-
"@wordpress/notices": "^5.
|
|
89
|
-
"@wordpress/preferences": "^4.
|
|
90
|
-
"@wordpress/priority-queue": "^3.
|
|
91
|
-
"@wordpress/private-apis": "^1.
|
|
92
|
-
"@wordpress/rich-text": "^7.
|
|
93
|
-
"@wordpress/style-engine": "^2.
|
|
94
|
-
"@wordpress/token-list": "^3.
|
|
95
|
-
"@wordpress/ui": "^0.
|
|
96
|
-
"@wordpress/upload-media": "^0.
|
|
97
|
-
"@wordpress/url": "^4.
|
|
98
|
-
"@wordpress/warning": "^3.
|
|
99
|
-
"@wordpress/wordcount": "^4.
|
|
63
|
+
"@wordpress/a11y": "^4.52.0",
|
|
64
|
+
"@wordpress/base-styles": "^12.0.0",
|
|
65
|
+
"@wordpress/blob": "^4.52.0",
|
|
66
|
+
"@wordpress/block-serialization-default-parser": "^5.52.0",
|
|
67
|
+
"@wordpress/blocks": "^15.25.0",
|
|
68
|
+
"@wordpress/commands": "^1.52.0",
|
|
69
|
+
"@wordpress/components": "^38.0.0",
|
|
70
|
+
"@wordpress/compose": "^8.5.0",
|
|
71
|
+
"@wordpress/data": "^10.52.0",
|
|
72
|
+
"@wordpress/dataviews": "^17.3.0",
|
|
73
|
+
"@wordpress/date": "^5.52.0",
|
|
74
|
+
"@wordpress/deprecated": "^4.52.0",
|
|
75
|
+
"@wordpress/dom": "^4.52.0",
|
|
76
|
+
"@wordpress/element": "^8.4.0",
|
|
77
|
+
"@wordpress/escape-html": "^3.52.0",
|
|
78
|
+
"@wordpress/global-styles-engine": "^1.19.0",
|
|
79
|
+
"@wordpress/hooks": "^4.52.0",
|
|
80
|
+
"@wordpress/html-entities": "^4.52.0",
|
|
81
|
+
"@wordpress/i18n": "^6.25.0",
|
|
82
|
+
"@wordpress/icons": "^15.3.0",
|
|
83
|
+
"@wordpress/image-cropper": "^1.16.0",
|
|
84
|
+
"@wordpress/interactivity": "^6.52.0",
|
|
85
|
+
"@wordpress/is-shallow-equal": "^5.52.0",
|
|
86
|
+
"@wordpress/keyboard-shortcuts": "^5.52.0",
|
|
87
|
+
"@wordpress/keycodes": "^4.52.0",
|
|
88
|
+
"@wordpress/notices": "^5.52.0",
|
|
89
|
+
"@wordpress/preferences": "^4.52.0",
|
|
90
|
+
"@wordpress/priority-queue": "^3.52.0",
|
|
91
|
+
"@wordpress/private-apis": "^1.52.0",
|
|
92
|
+
"@wordpress/rich-text": "^7.52.0",
|
|
93
|
+
"@wordpress/style-engine": "^2.52.0",
|
|
94
|
+
"@wordpress/token-list": "^3.52.0",
|
|
95
|
+
"@wordpress/ui": "^0.19.0",
|
|
96
|
+
"@wordpress/upload-media": "^0.37.0",
|
|
97
|
+
"@wordpress/url": "^4.52.0",
|
|
98
|
+
"@wordpress/warning": "^3.52.0",
|
|
99
|
+
"@wordpress/wordcount": "^4.52.0",
|
|
100
100
|
"change-case": "^4.1.2",
|
|
101
101
|
"clsx": "^2.1.1",
|
|
102
102
|
"colord": "^2.9.3",
|
|
103
103
|
"deepmerge": "^4.3.1",
|
|
104
104
|
"diff": "^8.0.3",
|
|
105
105
|
"fast-deep-equal": "^3.1.3",
|
|
106
|
-
"memize": "^2.1.0",
|
|
107
106
|
"parsel-js": "^1.1.2",
|
|
108
107
|
"postcss": "^8.4.38",
|
|
109
108
|
"postcss-prefix-selector": "^1.16.0",
|
|
@@ -118,7 +117,7 @@
|
|
|
118
117
|
"@testing-library/react": "^16.3.2",
|
|
119
118
|
"@testing-library/user-event": "^14.6.1",
|
|
120
119
|
"@types/postcss-prefix-selector": "^1.16.3",
|
|
121
|
-
"@wordpress/block-library": "^10.
|
|
120
|
+
"@wordpress/block-library": "^10.3.0",
|
|
122
121
|
"deep-freeze": "^0.0.1",
|
|
123
122
|
"storybook": "^10.4.3"
|
|
124
123
|
},
|
|
@@ -135,5 +134,5 @@
|
|
|
135
134
|
"publishConfig": {
|
|
136
135
|
"access": "public"
|
|
137
136
|
},
|
|
138
|
-
"gitHead": "
|
|
137
|
+
"gitHead": "7e8b17a983f9391d3ebc7717af2a1c9ed7efc7ab"
|
|
139
138
|
}
|
|
@@ -32,7 +32,7 @@ function AlignmentUI( {
|
|
|
32
32
|
onChange,
|
|
33
33
|
alignmentControls = DEFAULT_ALIGNMENT_CONTROLS,
|
|
34
34
|
label = __( 'Align text' ),
|
|
35
|
-
description
|
|
35
|
+
description,
|
|
36
36
|
isCollapsed = true,
|
|
37
37
|
isToolbar,
|
|
38
38
|
} ) {
|
|
@@ -55,9 +55,7 @@ function AlignmentUI( {
|
|
|
55
55
|
const extraProps = isToolbar
|
|
56
56
|
? { isCollapsed }
|
|
57
57
|
: {
|
|
58
|
-
toggleProps: {
|
|
59
|
-
description,
|
|
60
|
-
},
|
|
58
|
+
toggleProps: description ? { description } : {},
|
|
61
59
|
popoverProps: POPOVER_PROPS,
|
|
62
60
|
};
|
|
63
61
|
|
|
@@ -39,6 +39,10 @@ import { getResolvedValue } from '@wordpress/global-styles-engine';
|
|
|
39
39
|
* Internal dependencies
|
|
40
40
|
*/
|
|
41
41
|
import { hasBackgroundImageValue } from '../global-styles/background-panel';
|
|
42
|
+
import {
|
|
43
|
+
InheritanceResetButton,
|
|
44
|
+
isGlobalStylesInheritanceEnabled,
|
|
45
|
+
} from '../global-styles/inheritance';
|
|
42
46
|
import { setImmutably } from '../../utils/object';
|
|
43
47
|
import MediaReplaceFlow from '../media-replace-flow';
|
|
44
48
|
import { store as blockEditorStore } from '../../store';
|
|
@@ -193,6 +197,7 @@ function BackgroundControlsPanel( {
|
|
|
193
197
|
onToggle: onToggleCallback = noop,
|
|
194
198
|
hasImageValue,
|
|
195
199
|
onReset,
|
|
200
|
+
hasLocalOverride,
|
|
196
201
|
containerRef,
|
|
197
202
|
} ) {
|
|
198
203
|
if ( ! hasImageValue ) {
|
|
@@ -225,24 +230,38 @@ function BackgroundControlsPanel( {
|
|
|
225
230
|
as="button"
|
|
226
231
|
onToggleCallback={ onToggleCallback }
|
|
227
232
|
/>
|
|
228
|
-
{ onReset &&
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
233
|
+
{ onReset &&
|
|
234
|
+
( hasLocalOverride ? (
|
|
235
|
+
<InheritanceResetButton
|
|
236
|
+
className="block-editor-global-styles-background-panel__reset"
|
|
237
|
+
onResetToInherited={ () => {
|
|
238
|
+
onReset();
|
|
239
|
+
// Close the dropdown if open.
|
|
240
|
+
if ( isOpen ) {
|
|
241
|
+
onToggle();
|
|
242
|
+
}
|
|
243
|
+
// Focus the toggle button.
|
|
244
|
+
focusToggleButton( containerRef );
|
|
245
|
+
} }
|
|
246
|
+
/>
|
|
247
|
+
) : (
|
|
248
|
+
<Button
|
|
249
|
+
__next40pxDefaultSize
|
|
250
|
+
label={ __( 'Reset' ) }
|
|
251
|
+
className="block-editor-global-styles-background-panel__reset"
|
|
252
|
+
size="small"
|
|
253
|
+
icon={ resetIcon }
|
|
254
|
+
onClick={ () => {
|
|
255
|
+
onReset();
|
|
256
|
+
// Close the dropdown if open.
|
|
257
|
+
if ( isOpen ) {
|
|
258
|
+
onToggle();
|
|
259
|
+
}
|
|
260
|
+
// Focus the toggle button.
|
|
261
|
+
focusToggleButton( containerRef );
|
|
262
|
+
} }
|
|
263
|
+
/>
|
|
264
|
+
) ) }
|
|
246
265
|
</>
|
|
247
266
|
);
|
|
248
267
|
} }
|
|
@@ -434,22 +453,29 @@ function BackgroundSizeControls( {
|
|
|
434
453
|
inheritedValue,
|
|
435
454
|
defaultValues,
|
|
436
455
|
} ) {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
456
|
+
/*
|
|
457
|
+
* Read local and inherited values separately so each sub-control can
|
|
458
|
+
* show the inherited value while marking the control as inherited.
|
|
459
|
+
*/
|
|
460
|
+
const localSizeValue = style?.background?.backgroundSize;
|
|
461
|
+
const localRepeatValue = style?.background?.backgroundRepeat;
|
|
462
|
+
const localPositionValue = style?.background?.backgroundPosition;
|
|
463
|
+
const localAttachmentValue = style?.background?.backgroundAttachment;
|
|
464
|
+
const inheritedSizeValue = inheritedValue?.background?.backgroundSize;
|
|
465
|
+
const inheritedRepeatValue = inheritedValue?.background?.backgroundRepeat;
|
|
466
|
+
const inheritedPositionValue =
|
|
467
|
+
inheritedValue?.background?.backgroundPosition;
|
|
468
|
+
const inheritedAttachmentValue =
|
|
469
|
+
inheritedValue?.background?.backgroundAttachment;
|
|
470
|
+
|
|
471
|
+
const sizeValue = localSizeValue || inheritedSizeValue;
|
|
472
|
+
const repeatValue = localRepeatValue || inheritedRepeatValue;
|
|
443
473
|
const imageValue =
|
|
444
474
|
style?.background?.backgroundImage?.url ||
|
|
445
475
|
inheritedValue?.background?.backgroundImage?.url;
|
|
446
476
|
const isUploadedImage = style?.background?.backgroundImage?.id;
|
|
447
|
-
const positionValue =
|
|
448
|
-
|
|
449
|
-
inheritedValue?.background?.backgroundPosition;
|
|
450
|
-
const attachmentValue =
|
|
451
|
-
style?.background?.backgroundAttachment ||
|
|
452
|
-
inheritedValue?.background?.backgroundAttachment;
|
|
477
|
+
const positionValue = localPositionValue || inheritedPositionValue;
|
|
478
|
+
const attachmentValue = localAttachmentValue || inheritedAttachmentValue;
|
|
453
479
|
|
|
454
480
|
/*
|
|
455
481
|
* Set default values for uploaded images.
|
|
@@ -642,12 +668,10 @@ export default function BackgroundImagePanel( {
|
|
|
642
668
|
inheritedValue = value,
|
|
643
669
|
settings,
|
|
644
670
|
defaultValues = {},
|
|
671
|
+
showInheritanceLabelIndicators = isGlobalStylesInheritanceEnabled(),
|
|
645
672
|
} ) {
|
|
646
673
|
/*
|
|
647
|
-
* Resolve
|
|
648
|
-
* Should the block editor need resolved, inherited values
|
|
649
|
-
* across all controls, this could be abstracted into a hook,
|
|
650
|
-
* e.g., useResolveGlobalStyle
|
|
674
|
+
* Resolve inherited `ref` pointers for background controls.
|
|
651
675
|
*/
|
|
652
676
|
const { globalStyles, _links } = useSelect( ( select ) => {
|
|
653
677
|
const { getSettings } = select( blockEditorStore );
|
|
@@ -681,13 +705,25 @@ export default function BackgroundImagePanel( {
|
|
|
681
705
|
}, [ globalStyles, _links, inheritedValue ] );
|
|
682
706
|
|
|
683
707
|
const resetBackground = () =>
|
|
684
|
-
onChange(
|
|
708
|
+
onChange(
|
|
709
|
+
setImmutably( value, [ 'background' ], {
|
|
710
|
+
gradient: value?.background?.gradient,
|
|
711
|
+
} )
|
|
712
|
+
);
|
|
685
713
|
|
|
686
714
|
const { title, url } = value?.background?.backgroundImage || {
|
|
687
715
|
...resolvedInheritedValue?.background?.backgroundImage,
|
|
688
716
|
};
|
|
717
|
+
const localHasImageValue = hasBackgroundImageValue( value );
|
|
689
718
|
const hasImageValue =
|
|
690
|
-
hasBackgroundImageValue(
|
|
719
|
+
localHasImageValue || hasBackgroundImageValue( resolvedInheritedValue );
|
|
720
|
+
// The blue-dot local-override affordance is part of the inherited-value
|
|
721
|
+
// treatment. When that treatment is disabled (e.g. in the Global Styles
|
|
722
|
+
// panel, where the edited value *is* the global style rather than a local
|
|
723
|
+
// override of it), fall back to the plain reset control.
|
|
724
|
+
const hasLocalOverride =
|
|
725
|
+
showInheritanceLabelIndicators &&
|
|
726
|
+
localHasImageValue &&
|
|
691
727
|
hasBackgroundImageValue( resolvedInheritedValue );
|
|
692
728
|
|
|
693
729
|
const imageValue =
|
|
@@ -721,7 +757,8 @@ export default function BackgroundImagePanel( {
|
|
|
721
757
|
url={ url }
|
|
722
758
|
onToggle={ setIsDropDownOpen }
|
|
723
759
|
hasImageValue={ hasImageValue }
|
|
724
|
-
|
|
760
|
+
hasLocalOverride={ hasLocalOverride }
|
|
761
|
+
onReset={ localHasImageValue ? resetBackground : undefined }
|
|
725
762
|
containerRef={ containerRef }
|
|
726
763
|
>
|
|
727
764
|
<VStack spacing={ 3 } className="single-column">
|
|
@@ -58,10 +58,6 @@
|
|
|
58
58
|
&:hover {
|
|
59
59
|
color: var(--wp-admin-theme-color);
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
&:focus {
|
|
63
|
-
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
64
|
-
}
|
|
65
61
|
}
|
|
66
62
|
|
|
67
63
|
.block-editor-global-styles-background-panel__loading {
|
|
@@ -97,12 +93,25 @@
|
|
|
97
93
|
transition: opacity 0.1s ease-in-out;
|
|
98
94
|
}
|
|
99
95
|
|
|
96
|
+
&.has-local-override-from-global-styles__reset {
|
|
97
|
+
position: absolute;
|
|
98
|
+
display: inline-flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
top: 50%;
|
|
102
|
+
transform: translateY(-50%);
|
|
103
|
+
margin-block: 0;
|
|
104
|
+
margin-inline: 0 $grid-unit;
|
|
105
|
+
opacity: 1;
|
|
106
|
+
}
|
|
107
|
+
|
|
100
108
|
&.block-editor-global-styles-background-panel__reset {
|
|
101
109
|
border-radius: $radius-small;
|
|
102
110
|
}
|
|
103
111
|
|
|
104
112
|
.block-editor-global-styles-background-panel__dropdown-toggle:hover + &,
|
|
105
113
|
&:focus,
|
|
114
|
+
&:focus-within,
|
|
106
115
|
&:hover {
|
|
107
116
|
opacity: 1;
|
|
108
117
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
3
|
exports[`BlockAlignmentUI should match snapshot when controls are hidden 1`] = `
|
|
4
4
|
<div>
|
|
@@ -9,7 +9,7 @@ exports[`BlockAlignmentUI should match snapshot when controls are hidden 1`] = `
|
|
|
9
9
|
<button
|
|
10
10
|
aria-expanded="false"
|
|
11
11
|
aria-haspopup="true"
|
|
12
|
-
aria-label="Align"
|
|
12
|
+
aria-label="Align block"
|
|
13
13
|
class="components-button components-dropdown-menu__toggle has-icon"
|
|
14
14
|
data-toolbar-item="true"
|
|
15
15
|
type="button"
|
|
@@ -37,7 +37,7 @@ exports[`BlockAlignmentUI should match snapshot when controls are visible 1`] =
|
|
|
37
37
|
<div
|
|
38
38
|
class="components-toolbar"
|
|
39
39
|
icon="[object Object]"
|
|
40
|
-
label="Align"
|
|
40
|
+
label="Align block"
|
|
41
41
|
>
|
|
42
42
|
<div>
|
|
43
43
|
<button
|
|
@@ -26,6 +26,8 @@ function BlockAlignmentUI( {
|
|
|
26
26
|
controls,
|
|
27
27
|
isToolbar,
|
|
28
28
|
isCollapsed = true,
|
|
29
|
+
label = __( 'Align block' ),
|
|
30
|
+
description,
|
|
29
31
|
} ) {
|
|
30
32
|
const enabledControls = useAvailableAlignments( controls );
|
|
31
33
|
const hasEnabledControls = !! enabledControls.length;
|
|
@@ -47,7 +49,7 @@ function BlockAlignmentUI( {
|
|
|
47
49
|
icon: activeAlignmentControl
|
|
48
50
|
? activeAlignmentControl.icon
|
|
49
51
|
: defaultAlignmentControl.icon,
|
|
50
|
-
label
|
|
52
|
+
label,
|
|
51
53
|
};
|
|
52
54
|
const extraProps = isToolbar
|
|
53
55
|
? {
|
|
@@ -64,7 +66,7 @@ function BlockAlignmentUI( {
|
|
|
64
66
|
} ),
|
|
65
67
|
}
|
|
66
68
|
: {
|
|
67
|
-
toggleProps: { description
|
|
69
|
+
toggleProps: description ? { description } : {},
|
|
68
70
|
children: ( { onClose } ) => {
|
|
69
71
|
return (
|
|
70
72
|
<>
|
|
@@ -30,6 +30,7 @@ import { ListViewContentPopover } from '../inspector-controls/list-view-content-
|
|
|
30
30
|
import InspectorControls from '../inspector-controls';
|
|
31
31
|
import { BlockInspectorPreTabsSlot } from './inspector-pre-tabs-slot-fill';
|
|
32
32
|
import { default as InspectorControlsTabs } from '../inspector-controls-tabs';
|
|
33
|
+
import { SectionStyleControls } from '../inspector-controls-tabs/styles-tab';
|
|
33
34
|
import useInspectorControlsTabs from '../inspector-controls-tabs/use-inspector-controls-tabs';
|
|
34
35
|
import InspectorControlsLastItem from '../inspector-controls/last-item';
|
|
35
36
|
import AdvancedControls from '../inspector-controls-tabs/advanced-controls-panel';
|
|
@@ -41,6 +42,7 @@ import ContentTab from '../inspector-controls-tabs/content-tab';
|
|
|
41
42
|
import ViewportVisibilityInfo from '../block-visibility/viewport-visibility-info';
|
|
42
43
|
import { unlock } from '../../lock-unlock';
|
|
43
44
|
import {
|
|
45
|
+
BlockStyleStateProvider,
|
|
44
46
|
hasPseudoBlockStyleState,
|
|
45
47
|
hasViewportBlockStyleState,
|
|
46
48
|
isDefaultBlockStyleState,
|
|
@@ -95,43 +97,67 @@ function StyleInspectorSlots( {
|
|
|
95
97
|
);
|
|
96
98
|
}
|
|
97
99
|
|
|
98
|
-
function StyleStateInspectorSlots( {
|
|
100
|
+
function StyleStateInspectorSlots( {
|
|
101
|
+
blockName,
|
|
102
|
+
clientId,
|
|
103
|
+
contentClientIds,
|
|
104
|
+
isSectionBlock,
|
|
105
|
+
selectedBlockStyleState,
|
|
106
|
+
} ) {
|
|
99
107
|
const borderPanelLabel = useBorderPanelLabel( { blockName } );
|
|
100
108
|
const showLayoutControls =
|
|
101
109
|
hasViewportBlockStyleState( selectedBlockStyleState ) &&
|
|
102
110
|
! hasPseudoBlockStyleState( selectedBlockStyleState );
|
|
111
|
+
const showSectionStyleControls =
|
|
112
|
+
isSectionBlock && blockName !== 'core/template-part';
|
|
103
113
|
return (
|
|
104
114
|
<>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
115
|
+
{ showSectionStyleControls && (
|
|
116
|
+
<BlockStyleStateProvider value={ selectedBlockStyleState }>
|
|
117
|
+
<SectionStyleControls
|
|
118
|
+
blockName={ blockName }
|
|
119
|
+
clientId={ clientId }
|
|
120
|
+
contentClientIds={ contentClientIds }
|
|
121
|
+
/>
|
|
122
|
+
</BlockStyleStateProvider>
|
|
123
|
+
) }
|
|
124
|
+
{ ! showSectionStyleControls && (
|
|
125
|
+
<>
|
|
126
|
+
<InspectorControls.Slot
|
|
127
|
+
group="typography"
|
|
128
|
+
label={ __( 'Typography' ) }
|
|
129
|
+
/>
|
|
130
|
+
<InspectorControls.Slot
|
|
131
|
+
group="color"
|
|
132
|
+
label={ __( 'Color' ) }
|
|
133
|
+
className="color-block-support-panel__inner-wrapper"
|
|
134
|
+
/>
|
|
135
|
+
<InspectorControls.Slot
|
|
136
|
+
group="background"
|
|
137
|
+
label={ __( 'Background' ) }
|
|
138
|
+
className="background-block-support-panel__inner-wrapper"
|
|
139
|
+
/>
|
|
140
|
+
{ showLayoutControls && (
|
|
141
|
+
<InspectorControls.Slot
|
|
142
|
+
group="layout"
|
|
143
|
+
label={ __( 'Layout' ) }
|
|
144
|
+
/>
|
|
145
|
+
) }
|
|
146
|
+
<InspectorControls.Slot
|
|
147
|
+
group="dimensions"
|
|
148
|
+
label={ __( 'Dimensions' ) }
|
|
149
|
+
/>
|
|
150
|
+
<InspectorControls.Slot
|
|
151
|
+
group="border"
|
|
152
|
+
label={ borderPanelLabel }
|
|
153
|
+
/>
|
|
154
|
+
<InspectorControls.Slot
|
|
155
|
+
group="elements"
|
|
156
|
+
label={ __( 'Elements' ) }
|
|
157
|
+
className="elements-block-support-panel__inner-wrapper"
|
|
158
|
+
/>
|
|
159
|
+
</>
|
|
124
160
|
) }
|
|
125
|
-
<InspectorControls.Slot
|
|
126
|
-
group="dimensions"
|
|
127
|
-
label={ __( 'Dimensions' ) }
|
|
128
|
-
/>
|
|
129
|
-
<InspectorControls.Slot group="border" label={ borderPanelLabel } />
|
|
130
|
-
<InspectorControls.Slot
|
|
131
|
-
group="elements"
|
|
132
|
-
label={ __( 'Elements' ) }
|
|
133
|
-
className="elements-block-support-panel__inner-wrapper"
|
|
134
|
-
/>
|
|
135
161
|
</>
|
|
136
162
|
);
|
|
137
163
|
}
|
|
@@ -474,9 +500,12 @@ const BlockInspectorSingleBlock = ( {
|
|
|
474
500
|
/>
|
|
475
501
|
) }
|
|
476
502
|
<BlockInspectorPreTabsSlot />
|
|
477
|
-
{ isEditingStyleState &&
|
|
503
|
+
{ isEditingStyleState && (
|
|
478
504
|
<StyleStateInspectorSlots
|
|
479
505
|
blockName={ blockName }
|
|
506
|
+
clientId={ renderedBlockClientId }
|
|
507
|
+
contentClientIds={ contentClientIds }
|
|
508
|
+
isSectionBlock={ isSectionBlock }
|
|
480
509
|
selectedBlockStyleState={ selectedBlockStyleState }
|
|
481
510
|
/>
|
|
482
511
|
) }
|
|
@@ -20,9 +20,11 @@ import {
|
|
|
20
20
|
* Internal dependencies
|
|
21
21
|
*/
|
|
22
22
|
import { store as blockEditorStore } from '../../store';
|
|
23
|
+
import { useNativeUndo } from '../../utils/native-undo';
|
|
23
24
|
|
|
24
25
|
function BlockHTML( { clientId } ) {
|
|
25
26
|
const [ html, setHtml ] = useState( '' );
|
|
27
|
+
const nativeUndoRef = useNativeUndo();
|
|
26
28
|
const block = useSelect(
|
|
27
29
|
( select ) => select( blockEditorStore ).getBlock( clientId ),
|
|
28
30
|
[ clientId ]
|
|
@@ -83,6 +85,9 @@ function BlockHTML( { clientId } ) {
|
|
|
83
85
|
value={ html }
|
|
84
86
|
onBlur={ onChange }
|
|
85
87
|
onChange={ ( event ) => setHtml( event.target.value ) }
|
|
88
|
+
// The edits are local state until committed on blur, so undo
|
|
89
|
+
// and redo must remain the browser's own within the field.
|
|
90
|
+
ref={ nativeUndoRef }
|
|
86
91
|
/>
|
|
87
92
|
);
|
|
88
93
|
}
|
|
@@ -347,8 +347,7 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection="true"] .b
|
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
//
|
|
351
|
-
// unless the block itself, or a parent, is selected.
|
|
350
|
+
// Fade in the appender that sits at the end of block lists.
|
|
352
351
|
.wp-block .block-list-appender .block-editor-inserter__toggle {
|
|
353
352
|
@media not ( prefers-reduced-motion ) {
|
|
354
353
|
animation: block-editor-inserter__toggle__fade-in-animation 0.1s ease;
|
|
@@ -356,15 +355,6 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection="true"] .b
|
|
|
356
355
|
}
|
|
357
356
|
}
|
|
358
357
|
|
|
359
|
-
.block-editor-block-list__block:not(.is-selected):not(.has-child-selected) .block-editor-default-block-appender {
|
|
360
|
-
display: none;
|
|
361
|
-
|
|
362
|
-
.block-editor-inserter__toggle {
|
|
363
|
-
opacity: 0;
|
|
364
|
-
transform: scale(0);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
|
|
368
358
|
.block-editor-block-list__block .block-editor-block-list__block-html-textarea {
|
|
369
359
|
display: block;
|
|
370
360
|
margin: 0;
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
useBlockEditContext,
|
|
25
25
|
} from '../../block-edit/context';
|
|
26
26
|
import { useFocusHandler } from './use-focus-handler';
|
|
27
|
+
import { useRegisterBlockEventHandlers } from './use-register-block-event-handlers';
|
|
27
28
|
import { useEventHandlers } from './use-selected-block-event-handlers';
|
|
28
29
|
import { useBlockRefProvider } from './use-block-refs';
|
|
29
30
|
import { useIntersectionObserver } from './use-intersection-observer';
|
|
@@ -106,8 +107,11 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
106
107
|
blockVisibility,
|
|
107
108
|
deviceType,
|
|
108
109
|
viewportSettings,
|
|
110
|
+
ariaLabel,
|
|
109
111
|
} = useContext( PrivateBlockContext );
|
|
110
112
|
|
|
113
|
+
useRegisterBlockEventHandlers( clientId, wrapperProps );
|
|
114
|
+
|
|
111
115
|
const defaultViewRef = useRefEffect( ( element ) => {
|
|
112
116
|
if ( element ) {
|
|
113
117
|
const { ownerDocument } = element;
|
|
@@ -183,7 +187,7 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
183
187
|
ref: mergedRefs,
|
|
184
188
|
id: `block-${ clientId }${ htmlSuffix }`,
|
|
185
189
|
role: 'document',
|
|
186
|
-
'aria-label': blockLabel,
|
|
190
|
+
'aria-label': ariaLabel ?? blockLabel,
|
|
187
191
|
'data-block': clientId,
|
|
188
192
|
'data-type': name,
|
|
189
193
|
'data-title': blockTitle,
|