@wordpress/block-editor 12.20.0 → 12.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/block-actions/index.js +47 -36
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-bindings-toolbar-indicator/index.js +25 -0
- package/build/components/block-bindings-toolbar-indicator/index.js.map +1 -0
- package/build/components/block-edit/context.js +2 -1
- package/build/components/block-edit/context.js.map +1 -1
- package/build/components/block-edit/index.js +8 -3
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-heading-level-dropdown/index.js +5 -5
- package/build/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build/components/block-heading-level-dropdown/index.native.js +5 -4
- package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
- package/build/components/block-inspector/index.js +5 -4
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-crash-boundary.native.js +49 -0
- package/build/components/block-list/block-crash-boundary.native.js.map +1 -0
- package/build/components/block-list/block-crash-warning.native.js +24 -0
- package/build/components/block-list/block-crash-warning.native.js.map +1 -0
- package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build/components/block-list/block-list-item.native.js +1 -1
- package/build/components/block-list/block-list-item.native.js.map +1 -1
- package/build/components/block-list/block-outline.native.js +23 -7
- package/build/components/block-list/block-outline.native.js.map +1 -1
- package/build/components/block-list/block-selection-button.native.js.map +1 -1
- package/build/components/block-list/block.native.js +7 -5
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +8 -1
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -3
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-popover/cover.js +68 -0
- package/build/components/block-popover/cover.js.map +1 -0
- package/build/components/block-popover/drop-zone.js +2 -3
- package/build/components/block-popover/drop-zone.js.map +1 -1
- package/build/components/block-popover/index.js +1 -19
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/index.js +2 -1
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +2 -4
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-rename/modal.js.map +1 -1
- package/build/components/block-settings/container.native.js +2 -1
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +41 -39
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +1 -3
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build/components/block-toolbar/index.js +24 -11
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/shuffle.js +89 -0
- package/build/components/block-toolbar/shuffle.js.map +1 -0
- package/build/components/block-toolbar/use-has-block-toolbar.js +43 -0
- package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -0
- package/build/components/block-tools/block-selection-button.js +5 -1
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/empty-block-inserter.js +2 -5
- package/build/components/block-tools/empty-block-inserter.js.map +1 -1
- package/build/components/block-tools/index.js +9 -26
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +60 -0
- package/build/components/block-tools/use-show-block-tools.js.map +1 -0
- package/build/components/caption/index.native.js.map +1 -1
- package/build/components/child-layout-control/index.js +108 -11
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/color-palette/control.js.map +1 -1
- package/build/components/colors-gradients/control.js +1 -1
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/convert-to-group-buttons/toolbar.js +11 -0
- package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build/components/global-styles/border-panel.js +21 -8
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +1 -1
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +8 -33
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/index.js +6 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/shadow-panel-components.js +80 -23
- package/build/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +7 -5
- package/build/components/global-styles/typography-utils.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +16 -16
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +2 -4
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/grid-visualizer/grid-item-resizer.js +77 -0
- package/build/components/grid-visualizer/grid-item-resizer.js.map +1 -0
- package/build/components/grid-visualizer/grid-visualizer.js +81 -0
- package/build/components/grid-visualizer/grid-visualizer.js.map +1 -0
- package/build/components/grid-visualizer/index.js +20 -0
- package/build/components/grid-visualizer/index.js.map +1 -0
- package/build/components/grid-visualizer/utils.js +10 -0
- package/build/components/grid-visualizer/utils.js.map +1 -0
- package/build/components/iframe/index.js +66 -17
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/index.native.js +7 -0
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +8 -2
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/index.js +3 -6
- package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +3 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build/components/inserter/menu.native.js.map +1 -1
- package/build/components/inserter/mobile-tab-navigation.js +2 -2
- package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/advanced-controls-panel.native.js +36 -0
- package/build/components/inspector-controls-tabs/advanced-controls-panel.native.js.map +1 -0
- package/build/components/inspector-controls-tabs/index.js +1 -1
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/link-control/link-preview.js +4 -1
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/list-view/block-select-button.js +0 -2
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +4 -11
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/use-clipboard-handler.js +2 -1
- package/build/components/list-view/use-clipboard-handler.js.map +1 -1
- package/build/components/list-view/utils.js +5 -3
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/panel-color-settings/index.js.map +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/resizable-box-popover/index.js +3 -5
- package/build/components/resizable-box-popover/index.js.map +1 -1
- package/build/components/responsive-block-control/index.js +1 -1
- package/build/components/responsive-block-control/index.js.map +1 -1
- package/build/components/rich-text/index.js +46 -26
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/use-enter.js +3 -0
- package/build/components/rich-text/use-enter.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
- package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
- package/build/components/url-popover/index.js +3 -3
- package/build/components/url-popover/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +4 -0
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/warning/index.native.js +9 -4
- package/build/components/warning/index.native.js.map +1 -1
- package/build/components/writing-flow/use-clipboard-handler.js +2 -1
- package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
- package/build/components/writing-flow/utils.js +23 -6
- package/build/components/writing-flow/utils.js.map +1 -1
- package/build/hooks/anchor.js +7 -8
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/background.js +39 -2
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-hooks.js +34 -8
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/border.js +6 -4
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/dimensions.js +3 -4
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/font-size.js +6 -7
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/index.js +3 -2
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout-child.js +67 -6
- package/build/hooks/layout-child.js.map +1 -1
- package/build/hooks/layout.js +32 -14
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/position.js +1 -1
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/spacing-visualizer.js +115 -0
- package/build/hooks/spacing-visualizer.js.map +1 -0
- package/build/hooks/use-bindings-attributes.js +171 -48
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/hooks/use-typography-props.js +1 -2
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/layouts/grid.js +6 -2
- package/build/layouts/grid.js.map +1 -1
- package/build/private-apis.js +7 -3
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +3 -1
- package/build/private-apis.native.js.map +1 -1
- package/build/store/actions.js +42 -12
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +29 -55
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +0 -8
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +34 -46
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +27 -15
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-actions/index.js +47 -36
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-bindings-toolbar-indicator/index.js +18 -0
- package/build-module/components/block-bindings-toolbar-indicator/index.js.map +1 -0
- package/build-module/components/block-edit/context.js +1 -0
- package/build-module/components/block-edit/context.js.map +1 -1
- package/build-module/components/block-edit/index.js +9 -4
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.js +5 -5
- package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.native.js +5 -4
- package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
- package/build-module/components/block-inspector/index.js +6 -5
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-crash-boundary.native.js +42 -0
- package/build-module/components/block-list/block-crash-boundary.native.js.map +1 -0
- package/build-module/components/block-list/block-crash-warning.native.js +15 -0
- package/build-module/components/block-list/block-crash-warning.native.js.map +1 -0
- package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build-module/components/block-list/block-list-item.native.js +1 -1
- package/build-module/components/block-list/block-list-item.native.js.map +1 -1
- package/build-module/components/block-list/block-outline.native.js +23 -7
- package/build-module/components/block-list/block-outline.native.js.map +1 -1
- package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
- package/build-module/components/block-list/block.native.js +7 -5
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +9 -2
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -3
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-popover/cover.js +60 -0
- package/build-module/components/block-popover/cover.js.map +1 -0
- package/build-module/components/block-popover/drop-zone.js +2 -3
- package/build-module/components/block-popover/drop-zone.js.map +1 -1
- package/build-module/components/block-popover/index.js +1 -19
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-preview/index.js +2 -1
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +3 -5
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-rename/modal.js.map +1 -1
- package/build-module/components/block-settings/container.native.js +3 -2
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +42 -40
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +1 -3
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +24 -12
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/shuffle.js +82 -0
- package/build-module/components/block-toolbar/shuffle.js.map +1 -0
- package/build-module/components/block-toolbar/use-has-block-toolbar.js +36 -0
- package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -0
- package/build-module/components/block-tools/block-selection-button.js +5 -1
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/empty-block-inserter.js +2 -5
- package/build-module/components/block-tools/empty-block-inserter.js.map +1 -1
- package/build-module/components/block-tools/index.js +9 -26
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +54 -0
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -0
- package/build-module/components/caption/index.native.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +109 -12
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/color-palette/control.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +1 -1
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/toolbar.js +12 -1
- package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +22 -10
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +1 -1
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +9 -34
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/index.js +1 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel-components.js +82 -24
- package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +7 -5
- package/build-module/components/global-styles/typography-utils.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +17 -17
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +2 -4
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/grid-visualizer/grid-item-resizer.js +69 -0
- package/build-module/components/grid-visualizer/grid-item-resizer.js.map +1 -0
- package/build-module/components/grid-visualizer/grid-visualizer.js +73 -0
- package/build-module/components/grid-visualizer/grid-visualizer.js.map +1 -0
- package/build-module/components/grid-visualizer/index.js +3 -0
- package/build-module/components/grid-visualizer/index.js.map +1 -0
- package/build-module/components/grid-visualizer/utils.js +4 -0
- package/build-module/components/grid-visualizer/utils.js.map +1 -0
- package/build-module/components/iframe/index.js +66 -17
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/index.native.js +1 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js +8 -2
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/index.js +3 -6
- package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +3 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build-module/components/inserter/menu.native.js.map +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js +2 -2
- package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/advanced-controls-panel.native.js +28 -0
- package/build-module/components/inspector-controls-tabs/advanced-controls-panel.native.js.map +1 -0
- package/build-module/components/inspector-controls-tabs/index.js +1 -1
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +2 -2
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +5 -2
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +0 -2
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +6 -13
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-clipboard-handler.js +3 -2
- package/build-module/components/list-view/use-clipboard-handler.js.map +1 -1
- package/build-module/components/list-view/utils.js +2 -1
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/panel-color-settings/index.js.map +1 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/resizable-box-popover/index.js +3 -5
- package/build-module/components/resizable-box-popover/index.js.map +1 -1
- package/build-module/components/responsive-block-control/index.js +1 -1
- package/build-module/components/responsive-block-control/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +47 -28
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/use-enter.js +3 -0
- package/build-module/components/rich-text/use-enter.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
- package/build-module/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
- package/build-module/components/url-popover/index.js +3 -3
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +4 -0
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/warning/index.native.js +9 -4
- package/build-module/components/warning/index.native.js.map +1 -1
- package/build-module/components/writing-flow/use-clipboard-handler.js +3 -2
- package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
- package/build-module/components/writing-flow/utils.js +22 -7
- package/build-module/components/writing-flow/utils.js.map +1 -1
- package/build-module/hooks/anchor.js +8 -9
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/background.js +38 -1
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-hooks.js +34 -8
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/border.js +7 -5
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/dimensions.js +1 -2
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/font-size.js +7 -8
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/index.js +3 -2
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/layout-child.js +67 -6
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/hooks/layout.js +32 -14
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/position.js +1 -1
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/spacing-visualizer.js +106 -0
- package/build-module/hooks/spacing-visualizer.js.map +1 -0
- package/build-module/hooks/use-bindings-attributes.js +172 -49
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/hooks/use-typography-props.js +2 -3
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/layouts/grid.js +6 -2
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/private-apis.js +7 -3
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +3 -1
- package/build-module/private-apis.native.js.map +1 -1
- package/build-module/store/actions.js +42 -12
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +29 -54
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +0 -6
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +34 -46
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +23 -13
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/content-rtl.css +22 -2
- package/build-style/content.css +22 -2
- package/build-style/default-editor-styles-rtl.css +1 -0
- package/build-style/default-editor-styles.css +1 -0
- package/build-style/style-rtl.css +106 -27
- package/build-style/style.css +106 -27
- package/package.json +31 -31
- package/src/components/block-actions/index.js +59 -55
- package/src/components/block-bindings-toolbar-indicator/index.js +20 -0
- package/src/components/block-bindings-toolbar-indicator/style.scss +16 -0
- package/src/components/block-draggable/test/index.native.js +2 -2
- package/src/components/block-edit/context.js +1 -0
- package/src/components/block-edit/index.js +5 -1
- package/src/components/block-heading-level-dropdown/README.md +5 -5
- package/src/components/block-heading-level-dropdown/index.js +5 -5
- package/src/components/block-heading-level-dropdown/index.native.js +5 -4
- package/src/components/block-inspector/index.js +7 -5
- package/src/components/block-list/block-crash-boundary.native.js +43 -0
- package/src/components/block-list/block-crash-warning.native.js +19 -0
- package/src/components/block-list/block-invalid-warning.native.js +1 -1
- package/src/components/block-list/block-list-item.native.js +1 -1
- package/src/components/block-list/block-outline.native.js +36 -21
- package/src/components/block-list/block-selection-button.native.js +1 -3
- package/src/components/block-list/block.native.js +14 -10
- package/src/components/block-list/content.scss +21 -1
- package/src/components/block-list/test/block-outline.native.js +255 -0
- package/src/components/block-list/use-block-props/index.js +12 -2
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -7
- package/src/components/block-mover/index.native.js +1 -1
- package/src/components/block-popover/cover.js +63 -0
- package/src/components/block-popover/drop-zone.js +3 -4
- package/src/components/block-popover/index.js +1 -28
- package/src/components/block-preview/index.js +3 -1
- package/src/components/block-removal-warning-modal/index.js +5 -19
- package/src/components/block-rename/modal.js +1 -1
- package/src/components/block-settings/container.native.js +5 -1
- package/src/components/block-settings-menu/block-settings-dropdown.js +53 -65
- package/src/components/block-settings-menu-controls/README.md +0 -9
- package/src/components/block-settings-menu-controls/index.js +1 -6
- package/src/components/block-switcher/block-transformations-menu.native.js +1 -1
- package/src/components/block-toolbar/block-toolbar-menu.native.js +2 -2
- package/src/components/block-toolbar/index.js +22 -16
- package/src/components/block-toolbar/shuffle.js +93 -0
- package/src/components/block-toolbar/test/index.native.js +1 -7
- package/src/components/block-toolbar/use-has-block-toolbar.js +49 -0
- package/src/components/block-tools/block-selection-button.js +4 -0
- package/src/components/block-tools/empty-block-inserter.js +3 -6
- package/src/components/block-tools/index.js +13 -36
- package/src/components/block-tools/use-show-block-tools.js +73 -0
- package/src/components/caption/index.native.js +1 -1
- package/src/components/child-layout-control/index.js +148 -36
- package/src/components/color-palette/control.js +1 -1
- package/src/components/colors-gradients/control.js +1 -1
- package/src/components/colors-gradients/test/control.js +2 -2
- package/src/components/contrast-checker/test/index.js +10 -10
- package/src/components/convert-to-group-buttons/toolbar.js +13 -1
- package/src/components/default-block-appender/content.scss +5 -2
- package/src/components/global-styles/border-panel.js +35 -24
- package/src/components/global-styles/color-panel.js +1 -1
- package/src/components/global-styles/dimensions-panel.js +9 -34
- package/src/components/global-styles/image-settings-panel.js +1 -1
- package/src/components/global-styles/index.js +5 -1
- package/src/components/global-styles/shadow-panel-components.js +92 -23
- package/src/components/global-styles/style.scss +33 -10
- package/src/components/global-styles/test/typography-utils.js +231 -81
- package/src/components/global-styles/test/use-global-styles-output.js +31 -0
- package/src/components/global-styles/typography-utils.js +10 -7
- package/src/components/global-styles/use-global-styles-output.js +17 -17
- package/src/components/global-styles/utils.js +2 -26
- package/src/components/grid-visualizer/grid-item-resizer.js +100 -0
- package/src/components/grid-visualizer/grid-visualizer.js +81 -0
- package/src/components/grid-visualizer/index.js +2 -0
- package/src/components/grid-visualizer/style.scss +33 -0
- package/src/components/grid-visualizer/utils.js +5 -0
- package/src/components/iframe/index.js +89 -26
- package/src/components/index.native.js +1 -0
- package/src/components/inner-blocks/use-nested-settings-update.js +12 -2
- package/src/components/inserter/block-patterns-explorer/index.js +2 -9
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +7 -1
- package/src/components/inserter/media-tab/media-preview.js +1 -1
- package/src/components/inserter/menu.native.js +3 -3
- package/src/components/inserter/mobile-tab-navigation.js +2 -2
- package/src/components/inserter/style.scss +10 -0
- package/src/components/inspector-controls/block-support-tools-panel.js +2 -2
- package/src/components/inspector-controls-tabs/advanced-controls-panel.native.js +31 -0
- package/src/components/inspector-controls-tabs/index.js +1 -1
- package/src/components/inspector-controls-tabs/styles-tab.js +2 -2
- package/src/components/line-height-control/test/index.js +1 -1
- package/src/components/link-control/link-preview.js +9 -2
- package/src/components/link-control/search-input.js +1 -1
- package/src/components/link-control/style.scss +9 -5
- package/src/components/list-view/block-select-button.js +0 -2
- package/src/components/list-view/block.js +12 -21
- package/src/components/list-view/branch.js +1 -1
- package/src/components/list-view/drop-indicator.js +1 -1
- package/src/components/list-view/index.js +1 -1
- package/src/components/list-view/style.scss +34 -16
- package/src/components/list-view/use-clipboard-handler.js +3 -2
- package/src/components/list-view/utils.js +4 -1
- package/src/components/panel-color-settings/index.js +1 -1
- package/src/components/panel-color-settings/test/index.js +3 -3
- package/src/components/provider/index.js +1 -4
- package/src/components/resizable-box-popover/index.js +4 -6
- package/src/components/responsive-block-control/README.md +4 -4
- package/src/components/responsive-block-control/index.js +1 -1
- package/src/components/responsive-block-control/test/index.js +5 -5
- package/src/components/rich-text/README.md +6 -0
- package/src/components/rich-text/index.js +76 -53
- package/src/components/rich-text/use-enter.js +4 -0
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -4
- package/src/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
- package/src/components/url-popover/index.js +5 -5
- package/src/components/url-popover/style.scss +1 -0
- package/src/components/use-moving-animation/index.js +1 -0
- package/src/components/warning/index.native.js +19 -15
- package/src/components/writing-flow/use-clipboard-handler.js +3 -2
- package/src/components/writing-flow/utils.js +31 -16
- package/src/hooks/anchor.js +41 -61
- package/src/hooks/background.js +49 -4
- package/src/hooks/block-hooks.js +47 -9
- package/src/hooks/block-hooks.scss +6 -0
- package/src/hooks/border.js +16 -4
- package/src/hooks/dimensions.js +1 -2
- package/src/hooks/font-size.js +7 -12
- package/src/hooks/index.js +3 -0
- package/src/hooks/layout-child.js +82 -8
- package/src/hooks/layout.js +34 -19
- package/src/hooks/line-height.js +1 -1
- package/src/hooks/position.js +1 -1
- package/src/hooks/spacing-visualizer.js +126 -0
- package/src/hooks/{padding.scss → spacing.scss} +1 -1
- package/src/hooks/test/__snapshots__/anchor.native.js.snap +7 -0
- package/src/hooks/test/anchor.native.js +32 -0
- package/src/hooks/use-bindings-attributes.js +215 -65
- package/src/hooks/use-typography-props.js +2 -8
- package/src/layouts/grid.js +8 -3
- package/src/private-apis.js +6 -2
- package/src/private-apis.native.js +2 -0
- package/src/store/actions.js +56 -18
- package/src/store/private-actions.js +34 -79
- package/src/store/private-selectors.js +0 -8
- package/src/store/reducer.js +43 -64
- package/src/store/selectors.js +41 -46
- package/src/store/test/actions.js +0 -4
- package/src/style.scss +3 -1
- package/tsconfig.json +1 -0
- package/build/hooks/margin.js +0 -86
- package/build/hooks/margin.js.map +0 -1
- package/build/hooks/padding.js +0 -78
- package/build/hooks/padding.js.map +0 -1
- package/build/utils/use-can-block-toolbar-be-focused.js +0 -46
- package/build/utils/use-can-block-toolbar-be-focused.js.map +0 -1
- package/build-module/hooks/margin.js +0 -78
- package/build-module/hooks/margin.js.map +0 -1
- package/build-module/hooks/padding.js +0 -70
- package/build-module/hooks/padding.js.map +0 -1
- package/build-module/utils/use-can-block-toolbar-be-focused.js +0 -40
- package/build-module/utils/use-can-block-toolbar-be-focused.js.map +0 -1
- package/src/hooks/margin.js +0 -91
- package/src/hooks/padding.js +0 -82
- package/src/utils/use-can-block-toolbar-be-focused.js +0 -48
|
@@ -20,42 +20,55 @@ export default function BlockActions( {
|
|
|
20
20
|
children,
|
|
21
21
|
__experimentalUpdateSelection: updateSelection,
|
|
22
22
|
} ) {
|
|
23
|
-
const {
|
|
24
|
-
canInsertBlockType,
|
|
25
|
-
getBlockRootClientId,
|
|
26
|
-
getBlocksByClientId,
|
|
27
|
-
canMoveBlocks,
|
|
28
|
-
canRemoveBlocks,
|
|
29
|
-
} = useSelect( blockEditorStore );
|
|
30
23
|
const { getDefaultBlockName, getGroupingBlockName } =
|
|
31
24
|
useSelect( blocksStore );
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
25
|
+
const selected = useSelect(
|
|
26
|
+
( select ) => {
|
|
27
|
+
const {
|
|
28
|
+
canInsertBlockType,
|
|
29
|
+
getBlockRootClientId,
|
|
30
|
+
getBlocksByClientId,
|
|
31
|
+
getDirectInsertBlock,
|
|
32
|
+
canMoveBlocks,
|
|
33
|
+
canRemoveBlocks,
|
|
34
|
+
} = select( blockEditorStore );
|
|
35
|
+
|
|
36
|
+
const blocks = getBlocksByClientId( clientIds );
|
|
37
|
+
const rootClientId = getBlockRootClientId( clientIds[ 0 ] );
|
|
38
|
+
const canInsertDefaultBlock = canInsertBlockType(
|
|
39
|
+
getDefaultBlockName(),
|
|
40
|
+
rootClientId
|
|
41
|
+
);
|
|
42
|
+
const directInsertBlock = rootClientId
|
|
43
|
+
? getDirectInsertBlock( rootClientId )
|
|
44
|
+
: null;
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
canMove: canMoveBlocks( clientIds, rootClientId ),
|
|
48
|
+
canRemove: canRemoveBlocks( clientIds, rootClientId ),
|
|
49
|
+
canInsertBlock: canInsertDefaultBlock || !! directInsertBlock,
|
|
50
|
+
canCopyStyles: blocks.every( ( block ) => {
|
|
51
|
+
return (
|
|
52
|
+
!! block &&
|
|
53
|
+
( hasBlockSupport( block.name, 'color' ) ||
|
|
54
|
+
hasBlockSupport( block.name, 'typography' ) )
|
|
55
|
+
);
|
|
56
|
+
} ),
|
|
57
|
+
canDuplicate: blocks.every( ( block ) => {
|
|
58
|
+
return (
|
|
59
|
+
!! block &&
|
|
60
|
+
hasBlockSupport( block.name, 'multiple', true ) &&
|
|
61
|
+
canInsertBlockType( block.name, rootClientId )
|
|
62
|
+
);
|
|
63
|
+
} ),
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
[ clientIds, getDefaultBlockName ]
|
|
55
67
|
);
|
|
68
|
+
const { getBlocksByClientId, getBlocks } = useSelect( blockEditorStore );
|
|
56
69
|
|
|
57
|
-
const canMove
|
|
58
|
-
|
|
70
|
+
const { canMove, canRemove, canInsertBlock, canCopyStyles, canDuplicate } =
|
|
71
|
+
selected;
|
|
59
72
|
|
|
60
73
|
const {
|
|
61
74
|
removeBlocks,
|
|
@@ -75,11 +88,9 @@ export default function BlockActions( {
|
|
|
75
88
|
return children( {
|
|
76
89
|
canCopyStyles,
|
|
77
90
|
canDuplicate,
|
|
78
|
-
|
|
91
|
+
canInsertBlock,
|
|
79
92
|
canMove,
|
|
80
93
|
canRemove,
|
|
81
|
-
rootClientId,
|
|
82
|
-
blocks,
|
|
83
94
|
onDuplicate() {
|
|
84
95
|
return duplicateBlocks( clientIds, updateSelection );
|
|
85
96
|
},
|
|
@@ -87,16 +98,10 @@ export default function BlockActions( {
|
|
|
87
98
|
return removeBlocks( clientIds, updateSelection );
|
|
88
99
|
},
|
|
89
100
|
onInsertBefore() {
|
|
90
|
-
|
|
91
|
-
? clientIds[ 0 ]
|
|
92
|
-
: clientId;
|
|
93
|
-
insertBeforeBlock( clientId );
|
|
101
|
+
insertBeforeBlock( clientIds[ 0 ] );
|
|
94
102
|
},
|
|
95
103
|
onInsertAfter() {
|
|
96
|
-
|
|
97
|
-
? clientIds[ clientIds.length - 1 ]
|
|
98
|
-
: clientId;
|
|
99
|
-
insertAfterBlock( clientId );
|
|
104
|
+
insertAfterBlock( clientIds[ clientIds.length - 1 ] );
|
|
100
105
|
},
|
|
101
106
|
onMoveTo() {
|
|
102
107
|
setNavigationMode( true );
|
|
@@ -104,14 +109,17 @@ export default function BlockActions( {
|
|
|
104
109
|
setBlockMovingClientId( clientIds[ 0 ] );
|
|
105
110
|
},
|
|
106
111
|
onGroup() {
|
|
107
|
-
if ( !
|
|
112
|
+
if ( ! clientIds.length ) {
|
|
108
113
|
return;
|
|
109
114
|
}
|
|
110
115
|
|
|
111
116
|
const groupingBlockName = getGroupingBlockName();
|
|
112
117
|
|
|
113
118
|
// Activate the `transform` on `core/group` which does the conversion.
|
|
114
|
-
const newBlocks = switchToBlockType(
|
|
119
|
+
const newBlocks = switchToBlockType(
|
|
120
|
+
getBlocksByClientId( clientIds ),
|
|
121
|
+
groupingBlockName
|
|
122
|
+
);
|
|
115
123
|
|
|
116
124
|
if ( ! newBlocks ) {
|
|
117
125
|
return;
|
|
@@ -119,12 +127,11 @@ export default function BlockActions( {
|
|
|
119
127
|
replaceBlocks( clientIds, newBlocks );
|
|
120
128
|
},
|
|
121
129
|
onUngroup() {
|
|
122
|
-
if ( !
|
|
130
|
+
if ( ! clientIds.length ) {
|
|
123
131
|
return;
|
|
124
132
|
}
|
|
125
133
|
|
|
126
|
-
const innerBlocks =
|
|
127
|
-
|
|
134
|
+
const innerBlocks = getBlocks( clientIds[ 0 ] );
|
|
128
135
|
if ( ! innerBlocks.length ) {
|
|
129
136
|
return;
|
|
130
137
|
}
|
|
@@ -132,16 +139,13 @@ export default function BlockActions( {
|
|
|
132
139
|
replaceBlocks( clientIds, innerBlocks );
|
|
133
140
|
},
|
|
134
141
|
onCopy() {
|
|
135
|
-
|
|
136
|
-
(
|
|
137
|
-
);
|
|
138
|
-
if ( blocks.length === 1 ) {
|
|
139
|
-
flashBlock( selectedBlockClientIds[ 0 ] );
|
|
142
|
+
if ( clientIds.length === 1 ) {
|
|
143
|
+
flashBlock( clientIds[ 0 ] );
|
|
140
144
|
}
|
|
141
|
-
notifyCopy( 'copy',
|
|
145
|
+
notifyCopy( 'copy', clientIds );
|
|
142
146
|
},
|
|
143
147
|
async onPasteStyles() {
|
|
144
|
-
await pasteStyles(
|
|
148
|
+
await pasteStyles( getBlocksByClientId( clientIds ) );
|
|
145
149
|
},
|
|
146
150
|
} );
|
|
147
151
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { ToolbarItem, ToolbarGroup, Icon } from '@wordpress/components';
|
|
5
|
+
import { connection } from '@wordpress/icons';
|
|
6
|
+
import { _x } from '@wordpress/i18n';
|
|
7
|
+
|
|
8
|
+
export default function BlockBindingsToolbarIndicator() {
|
|
9
|
+
return (
|
|
10
|
+
<ToolbarGroup>
|
|
11
|
+
<ToolbarItem
|
|
12
|
+
as={ 'div' }
|
|
13
|
+
aria-label={ _x( 'Connected', 'block toolbar button label' ) }
|
|
14
|
+
className="block-editor-block-bindings-toolbar-indicator"
|
|
15
|
+
>
|
|
16
|
+
<Icon icon={ connection } size={ 24 } />
|
|
17
|
+
</ToolbarItem>
|
|
18
|
+
</ToolbarGroup>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.block-editor-block-bindings-toolbar-indicator {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
padding: 6px;
|
|
6
|
+
svg {
|
|
7
|
+
fill: var(--wp-bound-block-color);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.edit-post-header__toolbar
|
|
12
|
+
.selected-block-tools-wrapper
|
|
13
|
+
.block-editor-block-toolbar
|
|
14
|
+
.block-editor-block-bindings-toolbar-indicator {
|
|
15
|
+
height: 32px;
|
|
16
|
+
}
|
|
@@ -382,7 +382,7 @@ describe( 'BlockDraggable', () => {
|
|
|
382
382
|
// activate the gesture. Since this not available in tests, the library
|
|
383
383
|
// displays a warning message.
|
|
384
384
|
expect( console ).toHaveWarnedWith(
|
|
385
|
-
'[Reanimated]
|
|
385
|
+
'[Reanimated] setGestureState() cannot be used with Jest.'
|
|
386
386
|
);
|
|
387
387
|
expect( getEditorHtml() ).toMatchSnapshot(
|
|
388
388
|
'Paragraph block moved from first to second position'
|
|
@@ -410,7 +410,7 @@ describe( 'BlockDraggable', () => {
|
|
|
410
410
|
// activate the gesture. Since this not available in tests, the library
|
|
411
411
|
// displays a warning message.
|
|
412
412
|
expect( console ).toHaveWarnedWith(
|
|
413
|
-
'[Reanimated]
|
|
413
|
+
'[Reanimated] setGestureState() cannot be used with Jest.'
|
|
414
414
|
);
|
|
415
415
|
expect( getEditorHtml() ).toMatchSnapshot(
|
|
416
416
|
'Spacer block moved from third to first position'
|
|
@@ -6,6 +6,7 @@ import { createContext, useContext } from '@wordpress/element';
|
|
|
6
6
|
export const mayDisplayControlsKey = Symbol( 'mayDisplayControls' );
|
|
7
7
|
export const mayDisplayParentControlsKey = Symbol( 'mayDisplayParentControls' );
|
|
8
8
|
export const blockEditingModeKey = Symbol( 'blockEditingMode' );
|
|
9
|
+
export const blockBindingsKey = Symbol( 'blockBindings' );
|
|
9
10
|
|
|
10
11
|
export const DEFAULT_BLOCK_EDIT_CONTEXT = {
|
|
11
12
|
name: '',
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
mayDisplayControlsKey,
|
|
15
15
|
mayDisplayParentControlsKey,
|
|
16
16
|
blockEditingModeKey,
|
|
17
|
+
blockBindingsKey,
|
|
17
18
|
} from './context';
|
|
18
19
|
|
|
19
20
|
/**
|
|
@@ -41,7 +42,8 @@ export default function BlockEdit( {
|
|
|
41
42
|
attributes = {},
|
|
42
43
|
__unstableLayoutClassNames,
|
|
43
44
|
} = props;
|
|
44
|
-
const { layout = null } = attributes;
|
|
45
|
+
const { layout = null, metadata = {} } = attributes;
|
|
46
|
+
const { bindings } = metadata;
|
|
45
47
|
const layoutSupport =
|
|
46
48
|
hasBlockSupport( name, 'layout', false ) ||
|
|
47
49
|
hasBlockSupport( name, '__experimentalLayout', false );
|
|
@@ -62,6 +64,7 @@ export default function BlockEdit( {
|
|
|
62
64
|
[ mayDisplayControlsKey ]: mayDisplayControls,
|
|
63
65
|
[ mayDisplayParentControlsKey ]: mayDisplayParentControls,
|
|
64
66
|
[ blockEditingModeKey ]: blockEditingMode,
|
|
67
|
+
[ blockBindingsKey ]: bindings,
|
|
65
68
|
} ),
|
|
66
69
|
[
|
|
67
70
|
name,
|
|
@@ -73,6 +76,7 @@ export default function BlockEdit( {
|
|
|
73
76
|
mayDisplayControls,
|
|
74
77
|
mayDisplayParentControls,
|
|
75
78
|
blockEditingMode,
|
|
79
|
+
bindings,
|
|
76
80
|
]
|
|
77
81
|
) }
|
|
78
82
|
>
|
|
@@ -28,23 +28,23 @@ const MyHeadingLevelToolbar = () => (
|
|
|
28
28
|
|
|
29
29
|
#### options
|
|
30
30
|
|
|
31
|
-
The list of available
|
|
31
|
+
The list of available heading levels, passed from the block.
|
|
32
32
|
|
|
33
33
|
- Type: `Object`
|
|
34
34
|
- Required: no
|
|
35
35
|
|
|
36
36
|
#### value
|
|
37
37
|
|
|
38
|
-
The chosen
|
|
38
|
+
The chosen heading level.
|
|
39
39
|
|
|
40
|
-
- Type: `
|
|
40
|
+
- Type: `number`
|
|
41
41
|
- Required: no
|
|
42
42
|
|
|
43
43
|
#### onChange
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Function called with the selected value changes.
|
|
46
46
|
|
|
47
|
-
- Type: `
|
|
47
|
+
- Type: `() => number`
|
|
48
48
|
- Required: yes
|
|
49
49
|
|
|
50
50
|
## Related components
|
|
@@ -22,10 +22,10 @@ const POPOVER_PROPS = {
|
|
|
22
22
|
*
|
|
23
23
|
* @typedef WPHeadingLevelDropdownProps
|
|
24
24
|
*
|
|
25
|
-
* @property {number}
|
|
26
|
-
* @property {number[]}
|
|
27
|
-
* @property {(
|
|
28
|
-
*
|
|
25
|
+
* @property {number} value The chosen heading level.
|
|
26
|
+
* @property {number[]} options An array of supported heading levels.
|
|
27
|
+
* @property {()=>number} onChange Function called with
|
|
28
|
+
* the selected value changes.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
31
|
/**
|
|
@@ -53,7 +53,7 @@ export default function HeadingLevelDropdown( {
|
|
|
53
53
|
targetLevel === 0
|
|
54
54
|
? __( 'Paragraph' )
|
|
55
55
|
: sprintf(
|
|
56
|
-
// translators: %
|
|
56
|
+
// translators: %d: heading level e.g: "1", "2", "3"
|
|
57
57
|
__( 'Heading %d' ),
|
|
58
58
|
targetLevel
|
|
59
59
|
),
|
|
@@ -18,9 +18,10 @@ const HEADING_LEVELS = [ 1, 2, 3, 4, 5, 6 ];
|
|
|
18
18
|
*
|
|
19
19
|
* @typedef WPHeadingLevelDropdownProps
|
|
20
20
|
*
|
|
21
|
-
* @property {number}
|
|
22
|
-
* @property {
|
|
23
|
-
*
|
|
21
|
+
* @property {number} value The chosen heading level.
|
|
22
|
+
* @property {number[]} options An array of supported heading levels.
|
|
23
|
+
* @property {()=>number} onChange Function called with
|
|
24
|
+
* the selected value changes.
|
|
24
25
|
*/
|
|
25
26
|
|
|
26
27
|
/**
|
|
@@ -48,7 +49,7 @@ export default function HeadingLevelDropdown( {
|
|
|
48
49
|
isPressed={ isActive }
|
|
49
50
|
/>
|
|
50
51
|
),
|
|
51
|
-
// translators: %
|
|
52
|
+
// translators: %d: heading level e.g: "1", "2", "3"
|
|
52
53
|
title: sprintf( __( 'Heading %d' ), targetLevel ),
|
|
53
54
|
isActive,
|
|
54
55
|
onClick: () => onChangeCallback( targetLevel ),
|
|
@@ -28,7 +28,7 @@ import PositionControls from '../inspector-controls-tabs/position-controls-panel
|
|
|
28
28
|
import useBlockInspectorAnimationSettings from './useBlockInspectorAnimationSettings';
|
|
29
29
|
import BlockInfo from '../block-info-slot-fill';
|
|
30
30
|
import BlockQuickNavigation from '../block-quick-navigation';
|
|
31
|
-
import {
|
|
31
|
+
import { useBorderPanelLabel } from '../../hooks/border';
|
|
32
32
|
|
|
33
33
|
function BlockInspectorLockedBlocks( { topLevelLockedBlock } ) {
|
|
34
34
|
const contentClientIds = useSelect(
|
|
@@ -114,6 +114,10 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
|
|
|
114
114
|
selectedBlockClientId
|
|
115
115
|
);
|
|
116
116
|
|
|
117
|
+
const borderPanelLabel = useBorderPanelLabel( {
|
|
118
|
+
blockName: selectedBlockName,
|
|
119
|
+
} );
|
|
120
|
+
|
|
117
121
|
if ( count > 1 ) {
|
|
118
122
|
return (
|
|
119
123
|
<div className="block-editor-block-inspector">
|
|
@@ -138,9 +142,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
|
|
|
138
142
|
/>
|
|
139
143
|
<InspectorControls.Slot
|
|
140
144
|
group="border"
|
|
141
|
-
label={
|
|
142
|
-
blockName: selectedBlockName,
|
|
143
|
-
} ) }
|
|
145
|
+
label={ borderPanelLabel }
|
|
144
146
|
/>
|
|
145
147
|
<InspectorControls.Slot group="styles" />
|
|
146
148
|
</>
|
|
@@ -249,7 +251,7 @@ const BlockInspectorSingleBlock = ( { clientId, blockName } ) => {
|
|
|
249
251
|
[ blockName ]
|
|
250
252
|
);
|
|
251
253
|
const blockInformation = useBlockDisplayInformation( clientId );
|
|
252
|
-
const borderPanelLabel =
|
|
254
|
+
const borderPanelLabel = useBorderPanelLabel( { blockName } );
|
|
253
255
|
|
|
254
256
|
return (
|
|
255
257
|
<div className="block-editor-block-inspector">
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { Component } from '@wordpress/element';
|
|
5
|
+
import { logException } from '@wordpress/react-native-bridge';
|
|
6
|
+
|
|
7
|
+
class BlockCrashBoundary extends Component {
|
|
8
|
+
constructor() {
|
|
9
|
+
super( ...arguments );
|
|
10
|
+
|
|
11
|
+
this.state = {
|
|
12
|
+
error: null,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
static getDerivedStateFromError( error ) {
|
|
17
|
+
return { error };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
componentDidCatch( error ) {
|
|
21
|
+
const { blockName } = this.props;
|
|
22
|
+
|
|
23
|
+
logException( error, {
|
|
24
|
+
context: {
|
|
25
|
+
component_stack: error.componentStack,
|
|
26
|
+
block_name: blockName,
|
|
27
|
+
},
|
|
28
|
+
isHandled: true,
|
|
29
|
+
handledBy: 'Block-level Error Boundary',
|
|
30
|
+
} );
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
render() {
|
|
34
|
+
const { error } = this.state;
|
|
35
|
+
if ( ! error ) {
|
|
36
|
+
return this.props.children;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return this.props.fallback;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default BlockCrashBoundary;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import Warning from '../warning';
|
|
10
|
+
|
|
11
|
+
const warning = (
|
|
12
|
+
<Warning
|
|
13
|
+
message={ __(
|
|
14
|
+
'This block has encountered an error and cannot be previewed.'
|
|
15
|
+
) }
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export default () => warning;
|
|
@@ -98,7 +98,7 @@ function BlockListItemContent( {
|
|
|
98
98
|
const name = getBlockName( clientId );
|
|
99
99
|
const parentName = getBlockName( rootClientId );
|
|
100
100
|
const { align } = getBlockAttributes( clientId ) || {};
|
|
101
|
-
const {
|
|
101
|
+
const { textAlign: parentBlockAlign } =
|
|
102
102
|
getBlockAttributes( rootClientId ) || {};
|
|
103
103
|
|
|
104
104
|
return {
|
|
@@ -14,16 +14,11 @@ import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
|
14
14
|
import styles from './block.scss';
|
|
15
15
|
|
|
16
16
|
const TEXT_BLOCKS_WITH_OUTLINE = [ 'core/missing', 'core/freeform' ];
|
|
17
|
+
const DESIGN_BLOCKS_WITHOUT_OUTLINE = [ 'core/button', 'core/spacer' ];
|
|
18
|
+
const MEDIA_BLOCKS_WITH_OUTLINE = [ 'core/audio', 'core/file' ];
|
|
17
19
|
|
|
18
|
-
function BlockOutline( {
|
|
19
|
-
blockCategory,
|
|
20
|
-
hasInnerBlocks,
|
|
21
|
-
isRootList,
|
|
22
|
-
isSelected,
|
|
23
|
-
name,
|
|
24
|
-
} ) {
|
|
20
|
+
function BlockOutline( { blockCategory, hasInnerBlocks, isSelected, name } ) {
|
|
25
21
|
const textBlockWithOutline = TEXT_BLOCKS_WITH_OUTLINE.includes( name );
|
|
26
|
-
const socialBlockWithOutline = name.includes( 'core/social-link' );
|
|
27
22
|
|
|
28
23
|
const hasBlockTextCategory =
|
|
29
24
|
blockCategory === 'text' && ! textBlockWithOutline;
|
|
@@ -44,19 +39,39 @@ function BlockOutline( {
|
|
|
44
39
|
hasBlockTextCategory && styles.solidBorderTextContent,
|
|
45
40
|
];
|
|
46
41
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
if ( ! isSelected ) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
let shouldShowOutline = true;
|
|
47
|
+
if ( hasBlockTextCategory && ! hasInnerBlocks ) {
|
|
48
|
+
shouldShowOutline = false;
|
|
49
|
+
} else if (
|
|
50
|
+
blockCategory === 'media' &&
|
|
51
|
+
! hasInnerBlocks &&
|
|
52
|
+
! MEDIA_BLOCKS_WITH_OUTLINE.includes( name )
|
|
53
|
+
) {
|
|
54
|
+
shouldShowOutline = false;
|
|
55
|
+
} else if ( blockCategory === 'media' && name === 'core/cover' ) {
|
|
56
|
+
shouldShowOutline = false;
|
|
57
|
+
} else if (
|
|
58
|
+
blockCategory === 'design' &&
|
|
59
|
+
DESIGN_BLOCKS_WITHOUT_OUTLINE.includes( name )
|
|
60
|
+
) {
|
|
61
|
+
shouldShowOutline = false;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if ( shouldShowOutline ) {
|
|
65
|
+
return (
|
|
66
|
+
<View
|
|
67
|
+
pointerEvents="box-none"
|
|
68
|
+
style={ styleSolidBorder }
|
|
69
|
+
testID="block-outline"
|
|
70
|
+
/>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return null;
|
|
60
75
|
}
|
|
61
76
|
|
|
62
77
|
export default BlockOutline;
|
|
@@ -40,9 +40,7 @@ const BlockSelectionButton = ( {
|
|
|
40
40
|
onPress={ () => {
|
|
41
41
|
/* Open BottomSheet with markup. */
|
|
42
42
|
} }
|
|
43
|
-
disabled
|
|
44
|
-
true
|
|
45
|
-
} /* Disable temporarily since onPress function is empty. */
|
|
43
|
+
disabled /* Disable temporarily since onPress function is empty. */
|
|
46
44
|
>
|
|
47
45
|
{ rootClientId &&
|
|
48
46
|
rootBlockIcon && [
|
|
@@ -49,6 +49,8 @@ import { useLayout } from './layout';
|
|
|
49
49
|
import useScrollUponInsertion from './use-scroll-upon-insertion';
|
|
50
50
|
import { useSettings } from '../use-settings';
|
|
51
51
|
import { unlock } from '../../lock-unlock';
|
|
52
|
+
import BlockCrashBoundary from './block-crash-boundary';
|
|
53
|
+
import BlockCrashWarning from './block-crash-warning';
|
|
52
54
|
|
|
53
55
|
const EMPTY_ARRAY = [];
|
|
54
56
|
|
|
@@ -93,7 +95,6 @@ function BlockWrapper( {
|
|
|
93
95
|
draggingEnabled,
|
|
94
96
|
hasInnerBlocks,
|
|
95
97
|
isDescendentBlockSelected,
|
|
96
|
-
isRootList,
|
|
97
98
|
isSelected,
|
|
98
99
|
isTouchable,
|
|
99
100
|
marginHorizontal,
|
|
@@ -137,18 +138,22 @@ function BlockWrapper( {
|
|
|
137
138
|
<BlockOutline
|
|
138
139
|
blockCategory={ blockCategory }
|
|
139
140
|
hasInnerBlocks={ hasInnerBlocks }
|
|
140
|
-
isRootList={ isRootList }
|
|
141
141
|
isSelected={ isSelected }
|
|
142
142
|
name={ name }
|
|
143
143
|
/>
|
|
144
|
-
<
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
enabled={ draggingEnabled }
|
|
148
|
-
testID="draggable-trigger-content"
|
|
144
|
+
<BlockCrashBoundary
|
|
145
|
+
blockName={ name }
|
|
146
|
+
fallback={ <BlockCrashWarning /> }
|
|
149
147
|
>
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
<BlockDraggable
|
|
149
|
+
clientId={ clientId }
|
|
150
|
+
draggingClientId={ draggingClientId }
|
|
151
|
+
enabled={ draggingEnabled }
|
|
152
|
+
testID="draggable-trigger-content"
|
|
153
|
+
>
|
|
154
|
+
{ children }
|
|
155
|
+
</BlockDraggable>
|
|
156
|
+
</BlockCrashBoundary>
|
|
152
157
|
</Pressable>
|
|
153
158
|
);
|
|
154
159
|
}
|
|
@@ -361,7 +366,6 @@ function BlockListBlock( {
|
|
|
361
366
|
hasInnerBlocks={ hasInnerBlocks }
|
|
362
367
|
isDescendentBlockSelected={ isDescendentBlockSelected }
|
|
363
368
|
isFocused={ isFocused }
|
|
364
|
-
isRootList={ ! rootClientId }
|
|
365
369
|
isSelected={ isSelected }
|
|
366
370
|
isStackedHorizontally={ isStackedHorizontally }
|
|
367
371
|
isTouchable={ isTouchable }
|
|
@@ -360,6 +360,22 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
|
|
|
360
360
|
z-index: z-index("{core/image aligned left or right} .wp-block");
|
|
361
361
|
}
|
|
362
362
|
|
|
363
|
+
body.is-zoomed-out {
|
|
364
|
+
display: flex;
|
|
365
|
+
flex-direction: column;
|
|
366
|
+
|
|
367
|
+
> .is-root-container {
|
|
368
|
+
flex: 1;
|
|
369
|
+
display: flex;
|
|
370
|
+
flex-direction: column;
|
|
371
|
+
height: 100%;
|
|
372
|
+
|
|
373
|
+
> main {
|
|
374
|
+
flex: 1;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
363
379
|
.wp-site-blocks > [data-align="left"] {
|
|
364
380
|
float: left;
|
|
365
381
|
margin-right: 2em;
|
|
@@ -453,7 +469,11 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
|
|
|
453
469
|
}
|
|
454
470
|
}
|
|
455
471
|
|
|
456
|
-
.block-editor-
|
|
472
|
+
.block-editor-iframe__html {
|
|
457
473
|
transition: all 0.3s;
|
|
458
474
|
transform-origin: top center;
|
|
459
475
|
}
|
|
476
|
+
|
|
477
|
+
.block-editor-iframe__html[style*="scale"] {
|
|
478
|
+
background-color: $gray-300;
|
|
479
|
+
}
|