@wordpress/block-editor 12.20.0 → 12.21.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 +2 -0
- package/build/components/block-actions/index.js +45 -32
- 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-inspector/index.js +5 -4
- package/build/components/block-inspector/index.js.map +1 -1
- 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 +0 -3
- 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-menu/block-settings-dropdown.js +12 -10
- package/build/components/block-settings-menu/block-settings-dropdown.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 +21 -10
- 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.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/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/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 +15 -15
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +1 -1
- 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 +61 -16
- 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/media-tab/media-preview.js.map +1 -1
- package/build/components/inserter/menu.js +9 -3
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/menu.native.js.map +1 -1
- package/build/components/inserter/mobile-tab-navigation.js +1 -1
- package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build/components/inserter/search-results.js +3 -2
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter/tabs.js +2 -1
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- 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 +10 -2
- package/build/components/list-view/block-select-button.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/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/url-popover/index.js +3 -3
- package/build/components/url-popover/index.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/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 +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout-child.js +39 -0
- package/build/hooks/layout-child.js.map +1 -1
- package/build/hooks/layout.js +11 -4
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/line-height.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/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 +3 -20
- 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/utils/calculate-scale.js +17 -0
- package/build/utils/calculate-scale.js.map +1 -0
- package/build-module/components/block-actions/index.js +45 -32
- 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-inspector/index.js +6 -5
- package/build-module/components/block-inspector/index.js.map +1 -1
- 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 +0 -3
- 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-menu/block-settings-dropdown.js +12 -10
- package/build-module/components/block-settings-menu/block-settings-dropdown.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 +21 -11
- 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.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/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/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 +16 -16
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +2 -2
- 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 +61 -16
- 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/media-tab/media-preview.js.map +1 -1
- package/build-module/components/inserter/menu.js +9 -3
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/menu.native.js.map +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build-module/components/inserter/search-results.js +3 -2
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter/tabs.js +2 -1
- package/build-module/components/inserter/tabs.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/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 +11 -3
- package/build-module/components/list-view/block-select-button.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/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/url-popover/index.js +3 -3
- package/build-module/components/url-popover/index.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/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 +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/layout-child.js +39 -0
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/hooks/layout.js +11 -4
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/line-height.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/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 +3 -20
- 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-module/utils/calculate-scale.js +11 -0
- package/build-module/utils/calculate-scale.js.map +1 -0
- package/build-style/content-rtl.css +8 -2
- package/build-style/content.css +8 -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 +113 -22
- package/build-style/style.css +113 -22
- package/package.json +31 -31
- package/src/components/block-actions/index.js +57 -47
- package/src/components/block-bindings-toolbar-indicator/index.js +20 -0
- package/src/components/block-bindings-toolbar-indicator/style.scss +14 -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-inspector/index.js +7 -5
- 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 +0 -3
- package/src/components/block-list/content.scss +5 -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-menu/block-settings-dropdown.js +12 -9
- 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 +19 -15
- package/src/components/block-toolbar/shuffle.js +93 -0
- 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 +1 -1
- 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/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/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/typography-utils.js +10 -7
- package/src/components/global-styles/use-global-styles-output.js +14 -16
- package/src/components/global-styles/utils.js +2 -8
- 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 +78 -31
- package/src/components/index.native.js +1 -0
- package/src/components/inner-blocks/use-nested-settings-update.js +12 -2
- package/src/components/inserter/media-tab/media-preview.js +1 -1
- package/src/components/inserter/menu.js +10 -4
- package/src/components/inserter/menu.native.js +3 -3
- package/src/components/inserter/mobile-tab-navigation.js +1 -1
- package/src/components/inserter/search-results.js +2 -1
- package/src/components/inserter/style.scss +10 -0
- package/src/components/inserter/tabs.js +2 -1
- package/src/components/inspector-controls/block-support-tools-panel.js +2 -2
- 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 -0
- package/src/components/list-view/block-select-button.js +16 -2
- 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 +8 -0
- package/src/components/list-view/use-clipboard-handler.js +3 -2
- 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/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/url-popover/index.js +5 -5
- package/src/components/url-popover/style.scss +1 -0
- package/src/components/writing-flow/use-clipboard-handler.js +3 -2
- package/src/components/writing-flow/utils.js +31 -16
- package/src/hooks/background.js +1 -1
- 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 +1 -0
- package/src/hooks/layout-child.js +38 -0
- package/src/hooks/layout.js +12 -1
- package/src/hooks/line-height.js +1 -1
- package/src/hooks/spacing-visualizer.js +126 -0
- package/src/hooks/{padding.scss → spacing.scss} +1 -1
- 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/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 +2 -23
- package/src/store/selectors.js +41 -46
- package/src/store/test/actions.js +0 -4
- package/src/style.scss +3 -1
- package/src/utils/calculate-scale.js +20 -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
|
},
|
|
@@ -104,14 +115,17 @@ export default function BlockActions( {
|
|
|
104
115
|
setBlockMovingClientId( clientIds[ 0 ] );
|
|
105
116
|
},
|
|
106
117
|
onGroup() {
|
|
107
|
-
if ( !
|
|
118
|
+
if ( ! clientIds.length ) {
|
|
108
119
|
return;
|
|
109
120
|
}
|
|
110
121
|
|
|
111
122
|
const groupingBlockName = getGroupingBlockName();
|
|
112
123
|
|
|
113
124
|
// Activate the `transform` on `core/group` which does the conversion.
|
|
114
|
-
const newBlocks = switchToBlockType(
|
|
125
|
+
const newBlocks = switchToBlockType(
|
|
126
|
+
getBlocksByClientId( clientIds ),
|
|
127
|
+
groupingBlockName
|
|
128
|
+
);
|
|
115
129
|
|
|
116
130
|
if ( ! newBlocks ) {
|
|
117
131
|
return;
|
|
@@ -119,12 +133,11 @@ export default function BlockActions( {
|
|
|
119
133
|
replaceBlocks( clientIds, newBlocks );
|
|
120
134
|
},
|
|
121
135
|
onUngroup() {
|
|
122
|
-
if ( !
|
|
136
|
+
if ( ! clientIds.length ) {
|
|
123
137
|
return;
|
|
124
138
|
}
|
|
125
139
|
|
|
126
|
-
const innerBlocks =
|
|
127
|
-
|
|
140
|
+
const innerBlocks = getBlocks( clientIds[ 0 ] );
|
|
128
141
|
if ( ! innerBlocks.length ) {
|
|
129
142
|
return;
|
|
130
143
|
}
|
|
@@ -132,16 +145,13 @@ export default function BlockActions( {
|
|
|
132
145
|
replaceBlocks( clientIds, innerBlocks );
|
|
133
146
|
},
|
|
134
147
|
onCopy() {
|
|
135
|
-
|
|
136
|
-
(
|
|
137
|
-
);
|
|
138
|
-
if ( blocks.length === 1 ) {
|
|
139
|
-
flashBlock( selectedBlockClientIds[ 0 ] );
|
|
148
|
+
if ( clientIds.length === 1 ) {
|
|
149
|
+
flashBlock( clientIds[ 0 ] );
|
|
140
150
|
}
|
|
141
|
-
notifyCopy( 'copy',
|
|
151
|
+
notifyCopy( 'copy', clientIds );
|
|
142
152
|
},
|
|
143
153
|
async onPasteStyles() {
|
|
144
|
-
await pasteStyles(
|
|
154
|
+
await pasteStyles( getBlocksByClientId( clientIds ) );
|
|
145
155
|
},
|
|
146
156
|
} );
|
|
147
157
|
}
|
|
@@ -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,14 @@
|
|
|
1
|
+
.block-editor-block-bindings-toolbar-indicator {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
height: 48px;
|
|
5
|
+
padding: 6px;
|
|
6
|
+
|
|
7
|
+
svg g {
|
|
8
|
+
stroke: var(--wp-bound-block-color);
|
|
9
|
+
fill: transparent;
|
|
10
|
+
stroke-width: 1.5;
|
|
11
|
+
stroke-linecap: round;
|
|
12
|
+
stroke-linejoin: round;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -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,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">
|
|
@@ -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 && [
|
|
@@ -93,7 +93,6 @@ function BlockWrapper( {
|
|
|
93
93
|
draggingEnabled,
|
|
94
94
|
hasInnerBlocks,
|
|
95
95
|
isDescendentBlockSelected,
|
|
96
|
-
isRootList,
|
|
97
96
|
isSelected,
|
|
98
97
|
isTouchable,
|
|
99
98
|
marginHorizontal,
|
|
@@ -137,7 +136,6 @@ function BlockWrapper( {
|
|
|
137
136
|
<BlockOutline
|
|
138
137
|
blockCategory={ blockCategory }
|
|
139
138
|
hasInnerBlocks={ hasInnerBlocks }
|
|
140
|
-
isRootList={ isRootList }
|
|
141
139
|
isSelected={ isSelected }
|
|
142
140
|
name={ name }
|
|
143
141
|
/>
|
|
@@ -361,7 +359,6 @@ function BlockListBlock( {
|
|
|
361
359
|
hasInnerBlocks={ hasInnerBlocks }
|
|
362
360
|
isDescendentBlockSelected={ isDescendentBlockSelected }
|
|
363
361
|
isFocused={ isFocused }
|
|
364
|
-
isRootList={ ! rootClientId }
|
|
365
362
|
isSelected={ isSelected }
|
|
366
363
|
isStackedHorizontally={ isStackedHorizontally }
|
|
367
364
|
isTouchable={ isTouchable }
|
|
@@ -453,7 +453,11 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
|
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
455
|
|
|
456
|
-
.block-editor-
|
|
456
|
+
.block-editor-iframe__html {
|
|
457
457
|
transition: all 0.3s;
|
|
458
458
|
transform-origin: top center;
|
|
459
459
|
}
|
|
460
|
+
|
|
461
|
+
.block-editor-iframe__html[style*="scale"] {
|
|
462
|
+
background-color: $gray-300;
|
|
463
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { render, screen } from 'test/helpers';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import BlockOutline from '../block-outline';
|
|
10
|
+
|
|
11
|
+
describe( 'BlockOutline', () => {
|
|
12
|
+
describe( 'containing an unselected block', () => {
|
|
13
|
+
it( 'should not render an outline', async () => {
|
|
14
|
+
render(
|
|
15
|
+
<BlockOutline
|
|
16
|
+
isSelected={ false }
|
|
17
|
+
blockCategory="design"
|
|
18
|
+
name="core/group"
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
expect( screen.queryByTestId( 'block-outline' ) ).toBeNull();
|
|
23
|
+
} );
|
|
24
|
+
} );
|
|
25
|
+
|
|
26
|
+
describe( 'containing a block with inner blocks', () => {
|
|
27
|
+
it( 'should render an outline', async () => {
|
|
28
|
+
render(
|
|
29
|
+
<BlockOutline
|
|
30
|
+
isSelected
|
|
31
|
+
blockCategory="design"
|
|
32
|
+
name="core/group"
|
|
33
|
+
hasInnerBlocks
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
expect( screen.getByTestId( 'block-outline' ) ).toBeVisible();
|
|
38
|
+
} );
|
|
39
|
+
} );
|
|
40
|
+
|
|
41
|
+
describe( 'containing a design category block', () => {
|
|
42
|
+
it( 'should render an outline', async () => {
|
|
43
|
+
render(
|
|
44
|
+
<BlockOutline
|
|
45
|
+
isSelected
|
|
46
|
+
blockCategory="design"
|
|
47
|
+
name="core/group"
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
expect( screen.getByTestId( 'block-outline' ) ).toBeVisible();
|
|
52
|
+
} );
|
|
53
|
+
} );
|
|
54
|
+
|
|
55
|
+
describe( 'containing a text category block', () => {
|
|
56
|
+
it( 'should not render an outline', async () => {
|
|
57
|
+
render(
|
|
58
|
+
<BlockOutline
|
|
59
|
+
isSelected
|
|
60
|
+
blockCategory="text"
|
|
61
|
+
name="core/paragraph"
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
expect( screen.queryByTestId( 'block-outline' ) ).toBeNull();
|
|
66
|
+
} );
|
|
67
|
+
|
|
68
|
+
describe( 'with inner blocks', () => {
|
|
69
|
+
it( 'should render an outline', async () => {
|
|
70
|
+
render(
|
|
71
|
+
<BlockOutline
|
|
72
|
+
isSelected
|
|
73
|
+
blockCategory="text"
|
|
74
|
+
name="core/list"
|
|
75
|
+
hasInnerBlocks
|
|
76
|
+
/>
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
expect( screen.getByTestId( 'block-outline' ) ).toBeVisible();
|
|
80
|
+
} );
|
|
81
|
+
} );
|
|
82
|
+
} );
|
|
83
|
+
|
|
84
|
+
describe( 'containing a widget category block', () => {
|
|
85
|
+
it( 'should render an outline', async () => {
|
|
86
|
+
render(
|
|
87
|
+
<BlockOutline
|
|
88
|
+
isSelected
|
|
89
|
+
blockCategory="widgets"
|
|
90
|
+
name="core/latest-posts"
|
|
91
|
+
/>
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
expect( screen.getByTestId( 'block-outline' ) ).toBeVisible();
|
|
95
|
+
} );
|
|
96
|
+
} );
|
|
97
|
+
|
|
98
|
+
describe( 'containing a spacer block', () => {
|
|
99
|
+
it( 'should not render an outline', async () => {
|
|
100
|
+
render(
|
|
101
|
+
<BlockOutline
|
|
102
|
+
isSelected
|
|
103
|
+
blockCategory="design"
|
|
104
|
+
name="core/spacer"
|
|
105
|
+
/>
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
expect( screen.queryByTestId( 'block-outline' ) ).toBeNull();
|
|
109
|
+
} );
|
|
110
|
+
} );
|
|
111
|
+
|
|
112
|
+
describe( 'containing a button block', () => {
|
|
113
|
+
it( 'should not render an outline', async () => {
|
|
114
|
+
render(
|
|
115
|
+
<BlockOutline
|
|
116
|
+
isSelected
|
|
117
|
+
blockCategory="design"
|
|
118
|
+
name="core/button"
|
|
119
|
+
/>
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
expect( screen.queryByTestId( 'block-outline' ) ).toBeNull();
|
|
123
|
+
} );
|
|
124
|
+
} );
|
|
125
|
+
|
|
126
|
+
describe( 'containing a social link block', () => {
|
|
127
|
+
it( 'should render an outline', async () => {
|
|
128
|
+
render(
|
|
129
|
+
<BlockOutline
|
|
130
|
+
isSelected
|
|
131
|
+
blockCategory="embed"
|
|
132
|
+
name="core/social-link"
|
|
133
|
+
/>
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
expect( screen.getByTestId( 'block-outline' ) ).toBeVisible();
|
|
137
|
+
} );
|
|
138
|
+
|
|
139
|
+
describe( 'when platform specific', () => {
|
|
140
|
+
it( 'should render an outline', async () => {
|
|
141
|
+
render(
|
|
142
|
+
<BlockOutline
|
|
143
|
+
isSelected
|
|
144
|
+
blockCategory="embed"
|
|
145
|
+
name="core/social-link-amazon"
|
|
146
|
+
/>
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
expect( screen.getByTestId( 'block-outline' ) ).toBeVisible();
|
|
150
|
+
} );
|
|
151
|
+
} );
|
|
152
|
+
} );
|
|
153
|
+
|
|
154
|
+
describe( 'containing a media block', () => {
|
|
155
|
+
it( 'should not render an outline', async () => {
|
|
156
|
+
render(
|
|
157
|
+
<BlockOutline
|
|
158
|
+
isSelected
|
|
159
|
+
blockCategory="media"
|
|
160
|
+
name="core/image"
|
|
161
|
+
/>
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
expect( screen.queryByTestId( 'block-outline' ) ).toBeNull();
|
|
165
|
+
} );
|
|
166
|
+
|
|
167
|
+
describe( 'with inner blocks', () => {
|
|
168
|
+
it( 'should render an outline', async () => {
|
|
169
|
+
render(
|
|
170
|
+
<BlockOutline
|
|
171
|
+
isSelected
|
|
172
|
+
blockCategory="media"
|
|
173
|
+
name="core/gallery"
|
|
174
|
+
hasInnerBlocks
|
|
175
|
+
/>
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
expect( screen.getByTestId( 'block-outline' ) ).toBeVisible();
|
|
179
|
+
} );
|
|
180
|
+
|
|
181
|
+
describe( 'when cover block', () => {
|
|
182
|
+
it( 'should not render an outline', async () => {
|
|
183
|
+
render(
|
|
184
|
+
<BlockOutline
|
|
185
|
+
isSelected
|
|
186
|
+
blockCategory="media"
|
|
187
|
+
name="core/cover"
|
|
188
|
+
hasInnerBlocks
|
|
189
|
+
/>
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
expect(
|
|
193
|
+
screen.queryByTestId( 'block-outline' )
|
|
194
|
+
).toBeNull();
|
|
195
|
+
} );
|
|
196
|
+
} );
|
|
197
|
+
} );
|
|
198
|
+
|
|
199
|
+
describe( 'when a file block', () => {
|
|
200
|
+
it( 'should render an outline', async () => {
|
|
201
|
+
render(
|
|
202
|
+
<BlockOutline
|
|
203
|
+
isSelected
|
|
204
|
+
blockCategory="media"
|
|
205
|
+
name="core/file"
|
|
206
|
+
/>
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
expect( screen.getByTestId( 'block-outline' ) ).toBeVisible();
|
|
210
|
+
} );
|
|
211
|
+
} );
|
|
212
|
+
|
|
213
|
+
describe( 'when an audio block', () => {
|
|
214
|
+
it( 'should render an outline', async () => {
|
|
215
|
+
render(
|
|
216
|
+
<BlockOutline
|
|
217
|
+
isSelected
|
|
218
|
+
blockCategory="media"
|
|
219
|
+
name="core/audio"
|
|
220
|
+
/>
|
|
221
|
+
);
|
|
222
|
+
|
|
223
|
+
expect( screen.getByTestId( 'block-outline' ) ).toBeVisible();
|
|
224
|
+
} );
|
|
225
|
+
} );
|
|
226
|
+
} );
|
|
227
|
+
|
|
228
|
+
describe( 'containing a freeform block', () => {
|
|
229
|
+
it( 'should render an outline', async () => {
|
|
230
|
+
render(
|
|
231
|
+
<BlockOutline
|
|
232
|
+
isSelected
|
|
233
|
+
blockCategory="text"
|
|
234
|
+
name="core/freeform"
|
|
235
|
+
/>
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
expect( screen.getByTestId( 'block-outline' ) ).toBeVisible();
|
|
239
|
+
} );
|
|
240
|
+
} );
|
|
241
|
+
|
|
242
|
+
describe( 'containing a missing block', () => {
|
|
243
|
+
it( 'should render an outline', async () => {
|
|
244
|
+
render(
|
|
245
|
+
<BlockOutline
|
|
246
|
+
isSelected
|
|
247
|
+
blockCategory="text"
|
|
248
|
+
name="core/missing"
|
|
249
|
+
/>
|
|
250
|
+
);
|
|
251
|
+
|
|
252
|
+
expect( screen.getByTestId( 'block-outline' ) ).toBeVisible();
|
|
253
|
+
} );
|
|
254
|
+
} );
|
|
255
|
+
} );
|