@wordpress/block-editor 16.0.1-next.v.202607070741.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 +27 -1
- 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-canvas/index.cjs +6 -1
- package/build/components/block-canvas/index.cjs.map +2 -2
- package/build/components/block-controls/groups.cjs +3 -1
- package/build/components/block-controls/groups.cjs.map +2 -2
- package/build/components/block-edit/edit.cjs +10 -18
- package/build/components/block-edit/edit.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/block.cjs +9 -3
- package/build/components/block-list/block.cjs.map +3 -3
- package/build/components/block-list/index.cjs +1 -3
- package/build/components/block-list/index.cjs.map +2 -2
- package/build/components/block-list/use-block-props/index.cjs +7 -2
- package/build/components/block-list/use-block-props/index.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-focus-first-element.cjs +9 -4
- package/build/components/block-list/use-block-props/use-focus-first-element.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-focus-handler.cjs +11 -4
- 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/index.cjs +43 -24
- package/build/components/block-toolbar/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-tools/index.cjs +7 -2
- package/build/components/block-tools/index.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/block-visibility/modal.cjs +20 -6
- package/build/components/block-visibility/modal.cjs.map +2 -2
- package/build/components/block-visibility/use-block-visibility.cjs +16 -6
- package/build/components/block-visibility/use-block-visibility.cjs.map +3 -3
- package/build/components/block-visibility/utils.cjs +15 -2
- package/build/components/block-visibility/utils.cjs.map +3 -3
- package/build/components/block-visibility/viewport-menu-item.cjs +7 -1
- package/build/components/block-visibility/viewport-menu-item.cjs.map +2 -2
- package/build/components/block-visibility/viewport-toolbar.cjs +5 -0
- package/build/components/block-visibility/viewport-toolbar.cjs.map +2 -2
- package/build/components/block-visibility/viewport-visibility-info.cjs +5 -1
- package/build/components/block-visibility/viewport-visibility-info.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/child-layout-control/index.cjs +0 -4
- package/build/components/child-layout-control/index.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-badges.cjs +39 -3
- package/build/components/global-styles/state-control-badges.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 -79
- package/build/components/global-styles/typography-panel.cjs.map +3 -3
- package/build/components/image-size-control/index.cjs +2 -4
- package/build/components/image-size-control/index.cjs.map +2 -2
- package/build/components/inserter/media-tab/hooks.cjs +33 -6
- package/build/components/inserter/media-tab/hooks.cjs.map +2 -2
- package/build/components/inserter/media-tab/media-panel.cjs +78 -16
- package/build/components/inserter/media-tab/media-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/keyboard-shortcuts/index.cjs +19 -11
- package/build/components/keyboard-shortcuts/index.cjs.map +2 -2
- package/build/components/line-height-control/index.cjs +1 -2
- 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/list-view/block.cjs +13 -4
- package/build/components/list-view/block.cjs.map +2 -2
- package/build/components/media-placeholder/index.cjs +0 -1
- package/build/components/media-placeholder/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/event-listeners/before-input-rules.cjs +3 -4
- package/build/components/rich-text/event-listeners/before-input-rules.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/delete.cjs +2 -3
- package/build/components/rich-text/event-listeners/delete.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/enter.cjs +3 -2
- package/build/components/rich-text/event-listeners/enter.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/input-events.cjs +3 -3
- package/build/components/rich-text/event-listeners/input-events.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/input-rules.cjs +3 -4
- package/build/components/rich-text/event-listeners/input-rules.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/insert-replacement-text.cjs +3 -3
- package/build/components/rich-text/event-listeners/insert-replacement-text.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/paste-handler.cjs +2 -1
- package/build/components/rich-text/event-listeners/paste-handler.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs +3 -3
- package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/shortcuts.cjs +3 -3
- package/build/components/rich-text/event-listeners/shortcuts.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/undo-automatic-change.cjs +3 -3
- package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +3 -3
- package/build/components/rich-text/index.cjs +76 -17
- 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/typewriter/index.cjs +129 -136
- package/build/components/typewriter/index.cjs.map +3 -3
- package/build/components/url-input/index.cjs +303 -344
- package/build/components/url-input/index.cjs.map +3 -3
- package/build/components/use-block-commands/index.cjs +21 -17
- package/build/components/use-block-commands/index.cjs.map +2 -2
- package/build/components/use-on-block-drop/index.cjs +1 -1
- package/build/components/use-on-block-drop/index.cjs.map +2 -2
- package/build/components/writing-flow/index.cjs +14 -1
- package/build/components/writing-flow/index.cjs.map +3 -3
- package/build/components/writing-flow/use-arrow-nav.cjs +42 -6
- package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
- package/build/components/writing-flow/use-click-selection.cjs +29 -3
- package/build/components/writing-flow/use-click-selection.cjs.map +2 -2
- package/build/components/writing-flow/use-clipboard-handler.cjs +4 -1
- package/build/components/writing-flow/use-clipboard-handler.cjs.map +2 -2
- package/build/components/writing-flow/use-drag-selection.cjs +3 -8
- package/build/components/writing-flow/use-drag-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 +75 -0
- package/build/components/writing-flow/use-editable-root.cjs.map +7 -0
- package/build/components/writing-flow/use-home-end.cjs +64 -0
- package/build/components/writing-flow/use-home-end.cjs.map +7 -0
- package/build/components/writing-flow/use-input.cjs +15 -5
- package/build/components/writing-flow/use-input.cjs.map +2 -2
- package/build/components/writing-flow/use-multi-selection.cjs +2 -2
- package/build/components/writing-flow/use-multi-selection.cjs.map +2 -2
- package/build/components/writing-flow/use-select-all.cjs +14 -2
- package/build/components/writing-flow/use-select-all.cjs.map +2 -2
- package/build/components/writing-flow/use-selection-observer.cjs +132 -22
- package/build/components/writing-flow/use-selection-observer.cjs.map +3 -3
- package/build/components/writing-flow/utils.cjs +28 -2
- package/build/components/writing-flow/utils.cjs.map +2 -2
- package/build/hooks/background.cjs +14 -10
- package/build/hooks/background.cjs.map +2 -2
- package/build/hooks/block-fields/rich-text/index.cjs +2 -3
- package/build/hooks/block-fields/rich-text/index.cjs.map +3 -3
- 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 +15 -5
- package/build/hooks/elements.cjs.map +2 -2
- package/build/hooks/grid-visualizer.cjs +5 -3
- package/build/hooks/grid-visualizer.cjs.map +2 -2
- package/build/hooks/layout-child.cjs +22 -12
- package/build/hooks/layout-child.cjs.map +3 -3
- package/build/hooks/layout.cjs +28 -13
- package/build/hooks/layout.cjs.map +3 -3
- package/build/hooks/line-height.cjs +1 -2
- package/build/hooks/line-height.cjs.map +2 -2
- package/build/hooks/states.cjs +27 -7
- package/build/hooks/states.cjs.map +3 -3
- package/build/hooks/style.cjs +31 -9
- package/build/hooks/style.cjs.map +3 -3
- package/build/hooks/text-align.cjs +36 -6
- package/build/hooks/text-align.cjs.map +3 -3
- package/build/hooks/typography.cjs +14 -5
- package/build/hooks/typography.cjs.map +2 -2
- package/build/layouts/constrained.cjs +14 -6
- package/build/layouts/constrained.cjs.map +2 -2
- package/build/layouts/flex.cjs +27 -19
- package/build/layouts/flex.cjs.map +2 -2
- package/build/layouts/grid.cjs +0 -2
- package/build/layouts/grid.cjs.map +2 -2
- package/build/private-apis.cjs +9 -5
- package/build/private-apis.cjs.map +3 -3
- package/build/store/actions.cjs +11 -6
- package/build/store/actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +41 -3
- package/build/store/private-selectors.cjs.map +3 -3
- 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/block-bindings.cjs +29 -0
- package/build/utils/block-bindings.cjs.map +2 -2
- package/build/utils/dom.cjs +14 -0
- package/build/utils/dom.cjs.map +2 -2
- package/build/{components/rich-text/input-event.cjs → utils/native-undo.cjs} +29 -24
- 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-canvas/index.mjs +7 -2
- package/build-module/components/block-canvas/index.mjs.map +2 -2
- package/build-module/components/block-controls/groups.mjs +3 -1
- package/build-module/components/block-controls/groups.mjs.map +2 -2
- package/build-module/components/block-edit/edit.mjs +11 -18
- package/build-module/components/block-edit/edit.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/block.mjs +9 -3
- package/build-module/components/block-list/block.mjs.map +3 -3
- package/build-module/components/block-list/index.mjs +1 -3
- package/build-module/components/block-list/index.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/index.mjs +7 -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-first-element.mjs +9 -4
- package/build-module/components/block-list/use-block-props/use-focus-first-element.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/use-focus-handler.mjs +11 -4
- 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/index.mjs +43 -24
- package/build-module/components/block-toolbar/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-tools/index.mjs +7 -2
- package/build-module/components/block-tools/index.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/block-visibility/modal.mjs +22 -10
- package/build-module/components/block-visibility/modal.mjs.map +2 -2
- package/build-module/components/block-visibility/use-block-visibility.mjs +17 -7
- package/build-module/components/block-visibility/use-block-visibility.mjs.map +2 -2
- package/build-module/components/block-visibility/utils.mjs +18 -3
- package/build-module/components/block-visibility/utils.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-menu-item.mjs +7 -1
- package/build-module/components/block-visibility/viewport-menu-item.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-toolbar.mjs +5 -0
- package/build-module/components/block-visibility/viewport-toolbar.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-visibility-info.mjs +5 -1
- package/build-module/components/block-visibility/viewport-visibility-info.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/child-layout-control/index.mjs +0 -4
- package/build-module/components/child-layout-control/index.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-badges.mjs +41 -5
- package/build-module/components/global-styles/state-control-badges.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 -80
- package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
- package/build-module/components/image-size-control/index.mjs +2 -4
- package/build-module/components/image-size-control/index.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/hooks.mjs +33 -6
- package/build-module/components/inserter/media-tab/hooks.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/media-panel.mjs +86 -18
- package/build-module/components/inserter/media-tab/media-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/keyboard-shortcuts/index.mjs +19 -11
- package/build-module/components/keyboard-shortcuts/index.mjs.map +2 -2
- package/build-module/components/line-height-control/index.mjs +1 -2
- 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/list-view/block.mjs +13 -4
- package/build-module/components/list-view/block.mjs.map +2 -2
- package/build-module/components/media-placeholder/index.mjs +0 -1
- package/build-module/components/media-placeholder/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/event-listeners/before-input-rules.mjs +8 -5
- package/build-module/components/rich-text/event-listeners/before-input-rules.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/delete.mjs +7 -4
- package/build-module/components/rich-text/event-listeners/delete.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/enter.mjs +8 -3
- package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/input-events.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/input-events.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/input-rules.mjs +8 -5
- package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/paste-handler.mjs +8 -2
- package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/shortcuts.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/shortcuts.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +2 -2
- package/build-module/components/rich-text/index.mjs +79 -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/typewriter/index.mjs +129 -136
- package/build-module/components/typewriter/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/use-block-commands/index.mjs +21 -17
- package/build-module/components/use-block-commands/index.mjs.map +2 -2
- package/build-module/components/use-on-block-drop/index.mjs +2 -2
- package/build-module/components/use-on-block-drop/index.mjs.map +2 -2
- package/build-module/components/writing-flow/index.mjs +14 -1
- package/build-module/components/writing-flow/index.mjs.map +2 -2
- package/build-module/components/writing-flow/use-arrow-nav.mjs +43 -7
- package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
- package/build-module/components/writing-flow/use-click-selection.mjs +29 -3
- package/build-module/components/writing-flow/use-click-selection.mjs.map +2 -2
- package/build-module/components/writing-flow/use-clipboard-handler.mjs +5 -2
- package/build-module/components/writing-flow/use-clipboard-handler.mjs.map +2 -2
- package/build-module/components/writing-flow/use-drag-selection.mjs +1 -6
- package/build-module/components/writing-flow/use-drag-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 +54 -0
- package/build-module/components/writing-flow/use-editable-root.mjs.map +7 -0
- package/build-module/components/writing-flow/use-home-end.mjs +43 -0
- package/build-module/components/writing-flow/use-home-end.mjs.map +7 -0
- package/build-module/components/writing-flow/use-input.mjs +15 -5
- package/build-module/components/writing-flow/use-input.mjs.map +2 -2
- package/build-module/components/writing-flow/use-multi-selection.mjs +2 -2
- package/build-module/components/writing-flow/use-multi-selection.mjs.map +2 -2
- package/build-module/components/writing-flow/use-select-all.mjs +19 -3
- package/build-module/components/writing-flow/use-select-all.mjs.map +2 -2
- package/build-module/components/writing-flow/use-selection-observer.mjs +134 -21
- package/build-module/components/writing-flow/use-selection-observer.mjs.map +2 -2
- package/build-module/components/writing-flow/utils.mjs +26 -1
- package/build-module/components/writing-flow/utils.mjs.map +2 -2
- package/build-module/hooks/background.mjs +14 -10
- package/build-module/hooks/background.mjs.map +2 -2
- package/build-module/hooks/block-fields/rich-text/index.mjs +2 -6
- package/build-module/hooks/block-fields/rich-text/index.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 +15 -5
- package/build-module/hooks/elements.mjs.map +2 -2
- package/build-module/hooks/grid-visualizer.mjs +5 -3
- package/build-module/hooks/grid-visualizer.mjs.map +2 -2
- package/build-module/hooks/layout-child.mjs +22 -12
- package/build-module/hooks/layout-child.mjs.map +2 -2
- package/build-module/hooks/layout.mjs +28 -13
- package/build-module/hooks/layout.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/states.mjs +27 -7
- package/build-module/hooks/states.mjs.map +2 -2
- package/build-module/hooks/style.mjs +40 -11
- package/build-module/hooks/style.mjs.map +2 -2
- package/build-module/hooks/text-align.mjs +39 -10
- package/build-module/hooks/text-align.mjs.map +2 -2
- package/build-module/hooks/typography.mjs +14 -5
- package/build-module/hooks/typography.mjs.map +2 -2
- package/build-module/layouts/constrained.mjs +14 -6
- package/build-module/layouts/constrained.mjs.map +2 -2
- package/build-module/layouts/flex.mjs +27 -19
- package/build-module/layouts/flex.mjs.map +2 -2
- package/build-module/layouts/grid.mjs +0 -2
- package/build-module/layouts/grid.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 +12 -7
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +42 -3
- 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/block-bindings.mjs +28 -0
- package/build-module/utils/block-bindings.mjs.map +2 -2
- package/build-module/utils/dom.mjs +13 -0
- package/build-module/utils/dom.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 +14 -27
- package/build-style/content.css +14 -27
- package/build-style/default-editor-styles-rtl.css +1 -1
- package/build-style/default-editor-styles.css +1 -1
- package/build-style/style-rtl.css +191 -61
- package/build-style/style.css +191 -61
- package/build-types/components/block-context/index.d.ts +7 -0
- package/build-types/components/block-context/index.d.ts.map +1 -1
- package/build-types/utils/block-bindings.d.ts +19 -0
- package/build-types/utils/block-bindings.d.ts.map +1 -1
- package/build-types/utils/dom.d.ts +11 -0
- package/build-types/utils/dom.d.ts.map +1 -1
- package/build-types/utils/get-px-from-css-unit.d.ts +2 -2
- package/build-types/utils/get-px-from-css-unit.d.ts.map +1 -1
- package/build-types/utils/pasting.d.ts +1 -1
- package/build-types/utils/pasting.d.ts.map +1 -1
- package/package.json +43 -44
- 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-canvas/index.js +9 -2
- package/src/components/block-card/style.scss +1 -1
- package/src/components/block-compare/test/__snapshots__/block-view.js.snap +1 -1
- package/src/components/block-controls/groups.js +2 -0
- package/src/components/block-edit/edit.js +13 -31
- 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/block.js +6 -0
- package/src/components/block-list/content.scss +1 -11
- package/src/components/block-list/index.js +0 -2
- package/src/components/block-list/use-block-props/index.js +7 -1
- package/src/components/block-list/use-block-props/use-focus-first-element.js +23 -4
- package/src/components/block-list/use-block-props/use-focus-handler.js +35 -9
- package/src/components/block-list/use-block-props/use-register-block-event-handlers.js +45 -0
- package/src/components/block-lock/style.scss +1 -1
- package/src/components/block-manager/style.scss +1 -1
- package/src/components/block-navigation/style.scss +1 -1
- package/src/components/block-parent-selector/index.js +5 -2
- package/src/components/block-quick-navigation/style.scss +1 -3
- package/src/components/block-styles/style.scss +2 -2
- package/src/components/block-toolbar/index.js +41 -18
- 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-tools/index.js +7 -0
- package/src/components/block-types-list/style.scss +0 -1
- 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/block-visibility/modal.js +24 -10
- package/src/components/block-visibility/style.scss +1 -1
- package/src/components/block-visibility/test/use-block-visibility.js +128 -35
- package/src/components/block-visibility/test/utils.js +11 -0
- package/src/components/block-visibility/use-block-visibility.js +33 -11
- package/src/components/block-visibility/utils.js +31 -6
- package/src/components/block-visibility/viewport-menu-item.js +10 -1
- package/src/components/block-visibility/viewport-toolbar.js +6 -0
- package/src/components/block-visibility/viewport-visibility-info.js +5 -1
- 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 +7 -9
- package/src/components/child-layout-control/index.js +0 -4
- package/src/components/color-palette/test/__snapshots__/control.js.snap +3 -3
- 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/font-family/stories/index.story.jsx +1 -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-badges.js +45 -6
- package/src/components/global-styles/state-control.js +2 -2
- package/src/components/global-styles/style.scss +5 -0
- 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/state-control-badges.js +65 -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 -101
- package/src/components/image-editor/style.scss +33 -0
- package/src/components/image-size-control/index.js +0 -2
- package/src/components/inner-blocks/test/__snapshots__/index.js.snap +1 -1
- package/src/components/inserter/media-tab/hooks.js +55 -7
- package/src/components/inserter/media-tab/media-panel.js +117 -21
- package/src/components/inserter/media-tab/test/hooks.js +63 -0
- package/src/components/inserter/media-tab/test/media-panel.js +127 -0
- package/src/components/inserter/style.scss +19 -16
- package/src/components/inserter-list-item/style.scss +0 -15
- package/src/components/inspector-controls-tabs/styles-tab.js +5 -1
- package/src/components/keyboard-shortcuts/index.js +28 -11
- package/src/components/line-height-control/index.js +1 -2
- package/src/components/link-control/index.js +7 -2
- package/src/components/link-control/style.scss +2 -2
- package/src/components/link-control/test/index.js +6 -6
- package/src/components/link-picker/style.scss +1 -2
- package/src/components/list-view/block.js +13 -4
- package/src/components/list-view/style.scss +4 -5
- package/src/components/media-placeholder/index.js +0 -1
- package/src/components/multi-selection-inspector/style.scss +1 -1
- 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/responsive-block-control/style.scss +1 -1
- package/src/components/rich-text/event-listeners/before-input-rules.js +8 -5
- package/src/components/rich-text/event-listeners/delete.js +7 -4
- package/src/components/rich-text/event-listeners/enter.js +10 -4
- package/src/components/rich-text/event-listeners/input-events.js +4 -3
- package/src/components/rich-text/event-listeners/input-rules.js +8 -5
- package/src/components/rich-text/event-listeners/insert-replacement-text.js +4 -3
- package/src/components/rich-text/event-listeners/paste-handler.js +15 -3
- package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +4 -3
- package/src/components/rich-text/event-listeners/shortcuts.js +4 -3
- package/src/components/rich-text/event-listeners/undo-automatic-change.js +4 -3
- package/src/components/rich-text/index.js +116 -26
- package/src/components/skip-to-selected-block/style.scss +1 -1
- 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/typewriter/index.js +228 -224
- package/src/components/url-input/index.js +363 -431
- package/src/components/url-input/test/index.js +592 -0
- package/src/components/use-block-commands/index.js +27 -17
- package/src/components/use-on-block-drop/index.js +2 -2
- package/src/components/warning/test/__snapshots__/index.js.snap +1 -1
- package/src/components/writing-flow/index.js +17 -1
- package/src/components/writing-flow/use-arrow-nav.js +90 -13
- package/src/components/writing-flow/use-click-selection.js +55 -5
- package/src/components/writing-flow/use-clipboard-handler.js +5 -2
- package/src/components/writing-flow/use-drag-selection.js +1 -14
- package/src/components/writing-flow/use-editable-root-event-handlers.js +266 -0
- package/src/components/writing-flow/use-editable-root.js +112 -0
- package/src/components/writing-flow/use-home-end.js +71 -0
- package/src/components/writing-flow/use-input.js +25 -8
- package/src/components/writing-flow/use-multi-selection.js +2 -3
- package/src/components/writing-flow/use-select-all.js +33 -3
- package/src/components/writing-flow/use-selection-observer.js +218 -42
- package/src/components/writing-flow/utils.js +62 -0
- package/src/hooks/background.js +27 -24
- package/src/hooks/block-fields/link/styles.scss +1 -6
- package/src/hooks/block-fields/media/styles.scss +1 -6
- package/src/hooks/block-fields/rich-text/index.js +6 -9
- 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 -4
- package/src/hooks/grid-visualizer.js +40 -36
- package/src/hooks/layout-child.js +19 -9
- package/src/hooks/layout.js +48 -31
- package/src/hooks/line-height.js +0 -1
- package/src/hooks/states.js +38 -9
- package/src/hooks/style.js +67 -17
- package/src/hooks/test/inherited-value-wiring.js +411 -0
- package/src/hooks/test/preset-round-trip.js +456 -0
- package/src/hooks/test/style.js +29 -0
- package/src/hooks/test/text-align.js +34 -1
- package/src/hooks/text-align.js +41 -10
- package/src/hooks/typography.js +35 -24
- package/src/layouts/constrained.js +5 -1
- package/src/layouts/flex.js +5 -1
- package/src/layouts/grid.js +0 -2
- package/src/private-apis.js +11 -2
- package/src/store/actions.js +53 -19
- package/src/store/private-selectors.js +82 -6
- package/src/store/reducer.js +9 -9
- package/src/store/selectors.js +56 -8
- package/src/store/test/actions.js +1 -1
- package/src/store/test/private-selectors.js +271 -1
- package/src/style.scss +2 -0
- package/src/utils/block-bindings.ts +50 -0
- package/src/utils/dom.ts +33 -0
- package/src/utils/native-undo.js +56 -0
- package/src/utils/test/block-bindings.js +181 -0
- package/build/components/duotone/utils.cjs +0 -87
- package/build/components/duotone/utils.cjs.map +0 -7
- package/build/components/rich-text/input-event.cjs.map +0 -7
- package/build/components/rich-text/shortcut.cjs +0 -51
- package/build/components/rich-text/shortcut.cjs.map +0 -7
- package/build-module/components/duotone/utils.mjs +0 -59
- package/build-module/components/duotone/utils.mjs.map +0 -7
- package/build-module/components/rich-text/input-event.mjs +0 -25
- package/build-module/components/rich-text/input-event.mjs.map +0 -7
- package/build-module/components/rich-text/shortcut.mjs +0 -26
- package/build-module/components/rich-text/shortcut.mjs.map +0 -7
- package/src/components/duotone/utils.js +0 -90
- package/src/components/rich-text/input-event.js +0 -31
- package/src/components/rich-text/shortcut.js +0 -32
- package/src/hooks/test/get-variation-styles-with-ref-values.js +0 -91
|
@@ -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
|
}
|
|
@@ -622,6 +622,7 @@ function BlockListBlockProvider( props ) {
|
|
|
622
622
|
const blockVisibility = attributes?.metadata?.blockVisibility;
|
|
623
623
|
const deviceType =
|
|
624
624
|
settings?.[ deviceTypeKey ]?.toLowerCase() || 'desktop';
|
|
625
|
+
const viewportSettings = settings?.__experimentalFeatures?.viewport;
|
|
625
626
|
|
|
626
627
|
const hasLightBlockWrapper = blockType?.apiVersion > 1;
|
|
627
628
|
const isMultiSelected = isBlockMultiSelected( clientId );
|
|
@@ -645,6 +646,7 @@ function BlockListBlockProvider( props ) {
|
|
|
645
646
|
bindableAttributes,
|
|
646
647
|
blockVisibility,
|
|
647
648
|
deviceType,
|
|
649
|
+
viewportSettings,
|
|
648
650
|
isMultiSelected,
|
|
649
651
|
blockEditingMode,
|
|
650
652
|
isEditingDisabled: blockEditingMode === 'disabled',
|
|
@@ -736,6 +738,7 @@ function BlockListBlockProvider( props ) {
|
|
|
736
738
|
: false,
|
|
737
739
|
blockVisibility,
|
|
738
740
|
deviceType,
|
|
741
|
+
viewportSettings,
|
|
739
742
|
};
|
|
740
743
|
},
|
|
741
744
|
[ clientId, rootClientId ]
|
|
@@ -753,6 +756,7 @@ function BlockListBlockProvider( props ) {
|
|
|
753
756
|
const { isBlockCurrentlyHidden } = useBlockVisibility( {
|
|
754
757
|
blockVisibility: selectedProps?.blockVisibility,
|
|
755
758
|
deviceType: selectedProps?.deviceType,
|
|
759
|
+
viewportSettings: selectedProps?.viewportSettings,
|
|
756
760
|
view: defaultViewRef.current,
|
|
757
761
|
} );
|
|
758
762
|
|
|
@@ -817,6 +821,7 @@ function BlockListBlockProvider( props ) {
|
|
|
817
821
|
bindableAttributes,
|
|
818
822
|
blockVisibility,
|
|
819
823
|
deviceType,
|
|
824
|
+
viewportSettings,
|
|
820
825
|
} = selectedProps;
|
|
821
826
|
|
|
822
827
|
const privateContext = {
|
|
@@ -856,6 +861,7 @@ function BlockListBlockProvider( props ) {
|
|
|
856
861
|
bindableAttributes,
|
|
857
862
|
blockVisibility,
|
|
858
863
|
deviceType,
|
|
864
|
+
viewportSettings,
|
|
859
865
|
};
|
|
860
866
|
|
|
861
867
|
if (
|
|
@@ -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;
|
|
@@ -35,7 +35,6 @@ import {
|
|
|
35
35
|
BlockEditContextProvider,
|
|
36
36
|
DEFAULT_BLOCK_EDIT_CONTEXT,
|
|
37
37
|
} from '../block-edit/context';
|
|
38
|
-
import { useTypingObserver } from '../observe-typing';
|
|
39
38
|
import { ZoomOutSeparator } from './zoom-out-separator';
|
|
40
39
|
import { unlock } from '../../lock-unlock';
|
|
41
40
|
|
|
@@ -113,7 +112,6 @@ function Root( { className, ...settings } ) {
|
|
|
113
112
|
ref: useMergeRefs( [
|
|
114
113
|
useBlockSelectionClearer(),
|
|
115
114
|
useInBetweenInserter(),
|
|
116
|
-
useTypingObserver(),
|
|
117
115
|
] ),
|
|
118
116
|
className: clsx( 'is-root-container', className, {
|
|
119
117
|
'is-outline-mode': isOutlineMode,
|
|
@@ -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';
|
|
@@ -105,8 +106,12 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
105
106
|
canMove,
|
|
106
107
|
blockVisibility,
|
|
107
108
|
deviceType,
|
|
109
|
+
viewportSettings,
|
|
110
|
+
ariaLabel,
|
|
108
111
|
} = useContext( PrivateBlockContext );
|
|
109
112
|
|
|
113
|
+
useRegisterBlockEventHandlers( clientId, wrapperProps );
|
|
114
|
+
|
|
110
115
|
const defaultViewRef = useRefEffect( ( element ) => {
|
|
111
116
|
if ( element ) {
|
|
112
117
|
const { ownerDocument } = element;
|
|
@@ -153,6 +158,7 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
153
158
|
const { isBlockCurrentlyHidden } = useBlockVisibility( {
|
|
154
159
|
blockVisibility,
|
|
155
160
|
deviceType,
|
|
161
|
+
viewportSettings,
|
|
156
162
|
view: defaultViewRef.current,
|
|
157
163
|
} );
|
|
158
164
|
|
|
@@ -181,7 +187,7 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
181
187
|
ref: mergedRefs,
|
|
182
188
|
id: `block-${ clientId }${ htmlSuffix }`,
|
|
183
189
|
role: 'document',
|
|
184
|
-
'aria-label': blockLabel,
|
|
190
|
+
'aria-label': ariaLabel ?? blockLabel,
|
|
185
191
|
'data-block': clientId,
|
|
186
192
|
'data-type': name,
|
|
187
193
|
'data-title': blockTitle,
|
|
@@ -29,9 +29,8 @@ import { unlock } from '../../../lock-unlock';
|
|
|
29
29
|
*/
|
|
30
30
|
export function useFocusFirstElement( { clientId, initialPosition } ) {
|
|
31
31
|
const ref = useRef();
|
|
32
|
-
const { isBlockSelected, isMultiSelecting, isZoomOut } =
|
|
33
|
-
useSelect( blockEditorStore )
|
|
34
|
-
);
|
|
32
|
+
const { isBlockSelected, isMultiSelecting, isZoomOut, getSelectionStart } =
|
|
33
|
+
unlock( useSelect( blockEditorStore ) );
|
|
35
34
|
|
|
36
35
|
useEffect( () => {
|
|
37
36
|
// Check if the block is still selected at the time this effect runs.
|
|
@@ -87,7 +86,27 @@ export function useFocusFirstElement( { clientId, initialPosition } ) {
|
|
|
87
86
|
return;
|
|
88
87
|
}
|
|
89
88
|
}
|
|
90
|
-
|
|
89
|
+
// Do not place a caret when the target already contains one:
|
|
90
|
+
// while a focused editing host contains the target (the block
|
|
91
|
+
// supports `editableRoot`), the caret can be inside it without the
|
|
92
|
+
// target holding focus. Only a caret the rich text synchronized to
|
|
93
|
+
// the store (offsets present) is deliberate; a leftover one yields
|
|
94
|
+
// to an explicitly requested edge position (initialPosition -1).
|
|
95
|
+
const { activeElement } = ownerDocument;
|
|
96
|
+
const selection = ownerDocument.defaultView.getSelection();
|
|
97
|
+
const { clientId: selectionClientId, offset } = getSelectionStart();
|
|
98
|
+
const hasCaret =
|
|
99
|
+
activeElement?.isContentEditable &&
|
|
100
|
+
activeElement.contains( target ) &&
|
|
101
|
+
!! selection.anchorNode &&
|
|
102
|
+
target.contains( selection.anchorNode );
|
|
103
|
+
const isDeliberate =
|
|
104
|
+
initialPosition === 0 ||
|
|
105
|
+
( offset !== undefined && selectionClientId === clientId );
|
|
106
|
+
|
|
107
|
+
if ( ! ( hasCaret && isDeliberate ) ) {
|
|
108
|
+
placeCaretAtHorizontalEdge( target, isReverse );
|
|
109
|
+
}
|
|
91
110
|
}, [ initialPosition, clientId ] );
|
|
92
111
|
|
|
93
112
|
return ref;
|
|
@@ -22,7 +22,8 @@ const { subscribeDelegatedListener } = unlock( composePrivateApis );
|
|
|
22
22
|
* @param {string} clientId Block client ID.
|
|
23
23
|
*/
|
|
24
24
|
export function useFocusHandler( clientId ) {
|
|
25
|
-
const { isBlockSelected } =
|
|
25
|
+
const { isBlockSelected, isBlockMultiSelected, isMultiSelecting } =
|
|
26
|
+
useSelect( blockEditorStore );
|
|
26
27
|
const { selectBlock, selectionChange } = useDispatch( blockEditorStore );
|
|
27
28
|
|
|
28
29
|
return useRefEffect(
|
|
@@ -36,14 +37,6 @@ export function useFocusHandler( clientId ) {
|
|
|
36
37
|
* @param {FocusEvent} event Focus event.
|
|
37
38
|
*/
|
|
38
39
|
function onFocus( event ) {
|
|
39
|
-
// When the whole editor is editable, let writing flow handle
|
|
40
|
-
// selection.
|
|
41
|
-
if (
|
|
42
|
-
node.parentElement.closest( '[contenteditable="true"]' )
|
|
43
|
-
) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
40
|
// Check synchronously because a non-selected block might be
|
|
48
41
|
// getting data through `useSelect` asynchronously.
|
|
49
42
|
if ( isBlockSelected( clientId ) ) {
|
|
@@ -54,12 +47,45 @@ export function useFocusHandler( clientId ) {
|
|
|
54
47
|
return;
|
|
55
48
|
}
|
|
56
49
|
|
|
50
|
+
// Never select on the focus fired during a selection
|
|
51
|
+
// gesture (a shift+click, marked by the selection observer
|
|
52
|
+
// with startMultiSelect). The browser can focus the common
|
|
53
|
+
// editable ancestor of the range (e.g. a group block), and
|
|
54
|
+
// any selection re-render mid gesture destroys the native
|
|
55
|
+
// selection being made. The observer builds the
|
|
56
|
+
// multi-selection on mouseup.
|
|
57
|
+
if ( isMultiSelecting() ) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// A block that is part of the current multi-selection must
|
|
62
|
+
// not collapse it. Focus can land on the clicked block after
|
|
63
|
+
// the multi-selection was built: the focus event of a
|
|
64
|
+
// shift+click is not ordered consistently against its
|
|
65
|
+
// mouseup across browsers.
|
|
66
|
+
if ( isBlockMultiSelected( clientId ) ) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
57
70
|
// If an inner block is focussed, that block is responsible for
|
|
58
71
|
// setting the selected block.
|
|
59
72
|
if ( ! isInsideRootBlock( node, event.target ) ) {
|
|
60
73
|
return;
|
|
61
74
|
}
|
|
62
75
|
|
|
76
|
+
// For editable targets, select without initial caret
|
|
77
|
+
// placement: the caret is inside the target. Placement would
|
|
78
|
+
// move it, and would collapse a native selection in the
|
|
79
|
+
// making, e.g. a shift+click extending the selection across
|
|
80
|
+
// blocks while the wrapper is the editing host. The observer
|
|
81
|
+
// builds the multi-selection from the anchor it recorded at
|
|
82
|
+
// mousedown, so this dispatch overwriting the store anchor
|
|
83
|
+
// is harmless.
|
|
84
|
+
if ( event.target.isContentEditable ) {
|
|
85
|
+
selectBlock( clientId, null );
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
63
89
|
selectBlock( clientId );
|
|
64
90
|
}
|
|
65
91
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
useContext,
|
|
6
|
+
useEffect,
|
|
7
|
+
useInsertionEffect,
|
|
8
|
+
useRef,
|
|
9
|
+
} from '@wordpress/element';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import { getEventHandlers } from '../../writing-flow/use-editable-root-event-handlers';
|
|
15
|
+
import { BlockRefs } from '../../provider/block-refs-provider';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Registers the block's `wrapperProps` event handlers so the writing flow host
|
|
19
|
+
* can call them when a block that supports `editableRoot` is edited through the
|
|
20
|
+
* host and the events no longer reach the block.
|
|
21
|
+
*
|
|
22
|
+
* Handlers are keyed by client ID in the `BlockRefs` context, so the host
|
|
23
|
+
* resolves them from the block hierarchy. A ref is stored so the host always
|
|
24
|
+
* calls the latest render's handlers, and only blocks that have a handler are
|
|
25
|
+
* registered.
|
|
26
|
+
*
|
|
27
|
+
* @param {string} clientId Block client ID.
|
|
28
|
+
* @param {Object} wrapperProps The block's merged wrapper props.
|
|
29
|
+
*/
|
|
30
|
+
export function useRegisterBlockEventHandlers( clientId, wrapperProps ) {
|
|
31
|
+
const { eventHandlers } = useContext( BlockRefs );
|
|
32
|
+
const handlers = getEventHandlers( wrapperProps );
|
|
33
|
+
const handlersRef = useRef();
|
|
34
|
+
useInsertionEffect( () => {
|
|
35
|
+
handlersRef.current = handlers;
|
|
36
|
+
} );
|
|
37
|
+
|
|
38
|
+
const hasHandlers = !! handlers;
|
|
39
|
+
useEffect( () => {
|
|
40
|
+
if ( hasHandlers ) {
|
|
41
|
+
eventHandlers.set( clientId, handlersRef );
|
|
42
|
+
return () => eventHandlers.delete( clientId );
|
|
43
|
+
}
|
|
44
|
+
}, [ eventHandlers, clientId, hasHandlers ] );
|
|
45
|
+
}
|
|
@@ -26,10 +26,13 @@ export default function BlockParentSelector() {
|
|
|
26
26
|
const { parentClientId } = useSelect( ( select ) => {
|
|
27
27
|
const {
|
|
28
28
|
getBlockParents,
|
|
29
|
-
|
|
29
|
+
getSelectedBlockClientIds,
|
|
30
30
|
getParentSectionBlock,
|
|
31
31
|
} = unlock( select( blockEditorStore ) );
|
|
32
|
-
|
|
32
|
+
// Not getSelectedBlockClientId: a text selection crossing into a
|
|
33
|
+
// nested block resolves to the ancestor alone, but its selection
|
|
34
|
+
// start and end differ.
|
|
35
|
+
const [ selectedBlockClientId ] = getSelectedBlockClientIds();
|
|
33
36
|
const parentSection = getParentSectionBlock( selectedBlockClientId );
|
|
34
37
|
const parents = getBlockParents( selectedBlockClientId );
|
|
35
38
|
const _parentClientId = parentSection ?? parents[ parents.length - 1 ];
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
button.components-button.block-editor-block-styles__item {
|
|
32
32
|
color: $gray-900;
|
|
33
|
-
|
|
33
|
+
border-color: $gray-300;
|
|
34
34
|
display: inline-block;
|
|
35
35
|
width: calc(50% - #{$grid-unit-05});
|
|
36
36
|
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
|
|
53
53
|
&:focus,
|
|
54
54
|
&.is-active:focus {
|
|
55
|
-
@include
|
|
55
|
+
@include outset-ring__focus();
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -40,6 +40,7 @@ import EditSectionButton from './edit-section-button';
|
|
|
40
40
|
import { unlock } from '../../lock-unlock';
|
|
41
41
|
import { deviceTypeKey } from '../../store/private-keys';
|
|
42
42
|
import BlockToolbarIcon from './block-toolbar-icon';
|
|
43
|
+
import { hasViewportBlockStyleState } from '../../hooks/block-style-state';
|
|
43
44
|
|
|
44
45
|
/**
|
|
45
46
|
* Renders the block toolbar.
|
|
@@ -78,6 +79,7 @@ export function PrivateBlockToolbar( {
|
|
|
78
79
|
showBlockVisibilityButton,
|
|
79
80
|
showSwitchSectionStyleButton,
|
|
80
81
|
areSelectedBlocksHiddenOnViewport,
|
|
82
|
+
showStyleStateSlot,
|
|
81
83
|
canEdit,
|
|
82
84
|
} = useSelect( ( select ) => {
|
|
83
85
|
const { canEditBlock } = select( blockEditorStore );
|
|
@@ -95,6 +97,8 @@ export function PrivateBlockToolbar( {
|
|
|
95
97
|
isZoomOut,
|
|
96
98
|
isSectionBlock,
|
|
97
99
|
isBlockHiddenAtViewport,
|
|
100
|
+
getSelectedBlockStyleState,
|
|
101
|
+
isResponsiveEditing,
|
|
98
102
|
} = unlock( select( blockEditorStore ) );
|
|
99
103
|
const selectedBlockClientIds = getSelectedBlockClientIds();
|
|
100
104
|
const selectedBlockClientId = selectedBlockClientIds[ 0 ];
|
|
@@ -135,6 +139,11 @@ export function PrivateBlockToolbar( {
|
|
|
135
139
|
selectedBlockClientIds.every( ( id ) =>
|
|
136
140
|
isBlockHiddenAtViewport( id, _currentDeviceType )
|
|
137
141
|
);
|
|
142
|
+
const _isEditingResponsiveStyleState =
|
|
143
|
+
isResponsiveEditing() &&
|
|
144
|
+
hasViewportBlockStyleState(
|
|
145
|
+
getSelectedBlockStyleState( selectedBlockClientId )
|
|
146
|
+
);
|
|
138
147
|
|
|
139
148
|
return {
|
|
140
149
|
blockClientId: selectedBlockClientId,
|
|
@@ -158,7 +167,8 @@ export function PrivateBlockToolbar( {
|
|
|
158
167
|
isSectionContainer: _isSectionBlock,
|
|
159
168
|
hasContentOnlyLocking: _hasTemplateLock,
|
|
160
169
|
showShuffleButton: _isZoomOut,
|
|
161
|
-
showSlots: ! _isZoomOut,
|
|
170
|
+
showSlots: ! _isZoomOut && ! _isEditingResponsiveStyleState,
|
|
171
|
+
showStyleStateSlot: ! _isZoomOut && _isEditingResponsiveStyleState,
|
|
162
172
|
showGroupButtons: ! _isZoomOut,
|
|
163
173
|
showLockButtons: ! _isZoomOut,
|
|
164
174
|
showBlockVisibilityButton: ! _isZoomOut,
|
|
@@ -261,31 +271,44 @@ export function PrivateBlockToolbar( {
|
|
|
261
271
|
<SwitchSectionStyle clientId={ blockClientIds[ 0 ] } />
|
|
262
272
|
) }
|
|
263
273
|
{ ! areSelectedBlocksHiddenOnViewport &&
|
|
264
|
-
shouldShowVisualToolbar &&
|
|
265
|
-
showSlots && (
|
|
274
|
+
shouldShowVisualToolbar && (
|
|
266
275
|
<>
|
|
267
276
|
{ ! isSectionContainer && (
|
|
277
|
+
<>
|
|
278
|
+
{ showSlots && (
|
|
279
|
+
<>
|
|
280
|
+
<BlockControls.Slot
|
|
281
|
+
group="parent"
|
|
282
|
+
className="block-editor-block-toolbar__slot"
|
|
283
|
+
/>
|
|
284
|
+
<BlockControls.Slot
|
|
285
|
+
group="block"
|
|
286
|
+
className="block-editor-block-toolbar__slot"
|
|
287
|
+
/>
|
|
288
|
+
<BlockControls.Slot className="block-editor-block-toolbar__slot" />
|
|
289
|
+
<BlockControls.Slot
|
|
290
|
+
group="inline"
|
|
291
|
+
className="block-editor-block-toolbar__slot"
|
|
292
|
+
/>
|
|
293
|
+
</>
|
|
294
|
+
) }
|
|
295
|
+
{ showStyleStateSlot && (
|
|
296
|
+
<BlockControls.Slot
|
|
297
|
+
group="style-state"
|
|
298
|
+
className="block-editor-block-toolbar__slot"
|
|
299
|
+
/>
|
|
300
|
+
) }
|
|
301
|
+
</>
|
|
302
|
+
) }
|
|
303
|
+
{ showSlots && (
|
|
268
304
|
<>
|
|
269
305
|
<BlockControls.Slot
|
|
270
|
-
group="
|
|
271
|
-
className="block-editor-block-toolbar__slot"
|
|
272
|
-
/>
|
|
273
|
-
<BlockControls.Slot
|
|
274
|
-
group="block"
|
|
275
|
-
className="block-editor-block-toolbar__slot"
|
|
276
|
-
/>
|
|
277
|
-
<BlockControls.Slot className="block-editor-block-toolbar__slot" />
|
|
278
|
-
<BlockControls.Slot
|
|
279
|
-
group="inline"
|
|
306
|
+
group="other"
|
|
280
307
|
className="block-editor-block-toolbar__slot"
|
|
281
308
|
/>
|
|
309
|
+
<__unstableBlockToolbarLastItem.Slot />
|
|
282
310
|
</>
|
|
283
311
|
) }
|
|
284
|
-
<BlockControls.Slot
|
|
285
|
-
group="other"
|
|
286
|
-
className="block-editor-block-toolbar__slot"
|
|
287
|
-
/>
|
|
288
|
-
<__unstableBlockToolbarLastItem.Slot />
|
|
289
312
|
</>
|
|
290
313
|
) }
|
|
291
314
|
<BlockEditVisuallyButton clientIds={ blockClientIds } />
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
} from '@wordpress/components';
|
|
11
11
|
import { __ } from '@wordpress/i18n';
|
|
12
12
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
13
|
+
import { privateApis as globalStylesEnginePrivateApis } from '@wordpress/global-styles-engine';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Internal dependencies
|
|
@@ -18,7 +19,9 @@ import useStylesForBlocks from '../block-styles/use-styles-for-block';
|
|
|
18
19
|
import { replaceActiveStyle } from '../block-styles/utils';
|
|
19
20
|
import { store as blockEditorStore } from '../../store';
|
|
20
21
|
import { globalStylesDataKey } from '../../store/private-keys';
|
|
21
|
-
import {
|
|
22
|
+
import { unlock } from '../../lock-unlock';
|
|
23
|
+
|
|
24
|
+
const { getVariationStyle } = unlock( globalStylesEnginePrivateApis );
|
|
22
25
|
|
|
23
26
|
const styleIcon = (
|
|
24
27
|
<SVG
|
|
@@ -59,7 +62,7 @@ function SwitchSectionStyle( { clientId } ) {
|
|
|
59
62
|
|
|
60
63
|
// Get the background color for the active style
|
|
61
64
|
const activeStyleBackground = activeStyle?.name
|
|
62
|
-
?
|
|
65
|
+
? getVariationStyle(
|
|
63
66
|
{
|
|
64
67
|
settings: globalSettings,
|
|
65
68
|
styles: globalStyles,
|
|
@@ -15,12 +15,8 @@ export default function EmptyBlockInserter( {
|
|
|
15
15
|
clientId,
|
|
16
16
|
__unstableContentRef,
|
|
17
17
|
} ) {
|
|
18
|
-
const {
|
|
19
|
-
|
|
20
|
-
isInsertionPointVisible,
|
|
21
|
-
lastClientId,
|
|
22
|
-
rootClientId,
|
|
23
|
-
} = useSelectedBlockToolProps( clientId );
|
|
18
|
+
const { isInsertionPointVisible, lastClientId, rootClientId } =
|
|
19
|
+
useSelectedBlockToolProps( clientId );
|
|
24
20
|
|
|
25
21
|
const popoverProps = useBlockToolbarPopoverProps( {
|
|
26
22
|
contentElement: __unstableContentRef?.current,
|
|
@@ -29,7 +25,7 @@ export default function EmptyBlockInserter( {
|
|
|
29
25
|
|
|
30
26
|
return (
|
|
31
27
|
<BlockPopoverCover
|
|
32
|
-
clientId={
|
|
28
|
+
clientId={ clientId }
|
|
33
29
|
bottomClientId={ lastClientId }
|
|
34
30
|
className={ clsx(
|
|
35
31
|
'block-editor-block-list__block-side-inserter-popover',
|