@wordpress/block-editor 14.5.0 → 14.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +0 -8
- package/build/autocompleters/block.js +13 -5
- package/build/autocompleters/block.js.map +1 -1
- package/build/components/block-canvas/index.js +10 -0
- package/build/components/block-canvas/index.js.map +1 -1
- package/build/components/block-card/index.js +2 -2
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-full-height-alignment-control/index.js +1 -1
- package/build/components/block-full-height-alignment-control/index.js.map +1 -1
- package/build/components/block-list/block.js +15 -29
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +1 -7
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js +5 -5
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +1 -2
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -3
- package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -6
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +1 -1
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-patterns-list/index.js +23 -26
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-patterns-paging/index.js +1 -1
- package/build/components/block-patterns-paging/index.js.map +1 -1
- package/build/components/block-popover/index.js +3 -46
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/async.js +51 -0
- package/build/components/block-preview/async.js.map +1 -0
- package/build/components/block-preview/index.js +6 -3
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +5 -0
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu/index.js +4 -3
- package/build/components/block-settings-menu/index.js.map +1 -1
- package/build/components/block-toolbar/change-design.js +119 -0
- package/build/components/block-toolbar/change-design.js.map +1 -0
- package/build/components/block-toolbar/index.js +19 -7
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/index.js +16 -19
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +4 -3
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +7 -10
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +20 -29
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +2 -2
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/block-vertical-alignment-control/ui.js +6 -10
- package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build/components/border-radius-control/linked-button.js +7 -10
- package/build/components/border-radius-control/linked-button.js.map +1 -1
- package/build/components/collab/block-comment-icon-slot.js +18 -0
- package/build/components/collab/block-comment-icon-slot.js.map +1 -0
- package/build/components/collab/block-comment-icon-toolbar-slot.js +18 -0
- package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -0
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build/components/convert-to-group-buttons/toolbar.js +4 -4
- package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build/components/global-styles/color-panel.js +1 -4
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +26 -14
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-context.native.js +6 -0
- package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
- package/build/components/iframe/get-compatibility-styles.js +4 -4
- package/build/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build/components/iframe/index.js +33 -22
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-size-control/index.js +61 -20
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/inner-blocks/index.js +9 -5
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/index.js +1 -2
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -3
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +3 -0
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/utils.js +5 -1
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build/components/inserter/category-tabs/index.js +15 -2
- package/build/components/inserter/category-tabs/index.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-paging.js +0 -5
- package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -1
- package/build/components/inserter/menu.js +4 -2
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/search-results.js +0 -2
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter-button/index.native.js +1 -1
- package/build/components/inserter-button/index.native.js.map +1 -1
- package/build/components/inspector-controls-tabs/index.js +0 -2
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/inspector-controls-tabs/utils.js +3 -6
- package/build/components/inspector-controls-tabs/utils.js.map +1 -1
- package/build/components/link-control/link-preview.js +12 -9
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/list-view/appender.js +4 -3
- package/build/components/list-view/appender.js.map +1 -1
- package/build/components/list-view/branch.js +6 -5
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/index.js +1 -2
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/media-placeholder/index.js +4 -4
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/provider/index.js +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/rich-text/event-listeners/index.js +3 -1
- package/build/components/rich-text/event-listeners/index.js.map +1 -1
- package/build/components/rich-text/index.js +1 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +2 -6
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/spacing-sizes-control/index.js +2 -2
- package/build/components/spacing-sizes-control/index.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -3
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/spacing-sizes-control/linked-button.js +1 -5
- package/build/components/spacing-sizes-control/linked-button.js.map +1 -1
- package/build/components/tabbed-sidebar/index.js +1 -1
- package/build/components/tabbed-sidebar/index.js.map +1 -1
- package/build/components/tool-selector/index.js +1 -4
- package/build/components/tool-selector/index.js.map +1 -1
- package/build/components/url-input/index.js +4 -2
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-commands/index.js +6 -7
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +5 -5
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.native.js +0 -1
- package/build/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build/components/use-moving-animation/index.js +1 -3
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-settings/index.js +1 -3
- package/build/components/use-settings/index.js.map +1 -1
- package/build/components/writing-flow/index.js +5 -3
- package/build/components/writing-flow/index.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +2 -3
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/block-bindings.js +19 -8
- package/build/hooks/block-bindings.js.map +1 -1
- package/build/hooks/contrast-checker.js +0 -1
- package/build/hooks/contrast-checker.js.map +1 -1
- package/build/hooks/duotone.js +2 -2
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-family.js +1 -1
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/style.js +4 -1
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +6 -6
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/typography.js +5 -5
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/use-zoom-out.js +13 -22
- package/build/hooks/use-zoom-out.js.map +1 -1
- package/build/hooks/utils.js +2 -2
- package/build/hooks/utils.js.map +1 -1
- package/build/index.js +0 -7
- package/build/index.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +6 -3
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +2 -33
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +1 -1
- package/build/store/defaults.js.map +1 -1
- package/build/store/private-actions.js +57 -8
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +10 -22
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +16 -6
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +53 -15
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +5 -4
- package/build/store/utils.js.map +1 -1
- package/build/utils/dom.js +37 -17
- package/build/utils/dom.js.map +1 -1
- package/build/utils/get-font-styles-and-weights.js +1 -1
- package/build/utils/get-font-styles-and-weights.js.map +1 -1
- package/build/utils/transform-styles/index.js +4 -3
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/autocompleters/block.js +14 -6
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/components/block-canvas/index.js +11 -1
- package/build-module/components/block-canvas/index.js.map +1 -1
- package/build-module/components/block-card/index.js +3 -3
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-full-height-alignment-control/index.js +1 -1
- package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
- package/build-module/components/block-list/block.js +16 -28
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +1 -7
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +5 -5
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +1 -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-focus-first-element.js +4 -3
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -6
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +23 -26
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-patterns-paging/index.js +1 -1
- package/build-module/components/block-patterns-paging/index.js.map +1 -1
- package/build-module/components/block-popover/index.js +4 -47
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-preview/async.js +44 -0
- package/build-module/components/block-preview/async.js.map +1 -0
- package/build-module/components/block-preview/index.js +6 -3
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +5 -0
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu/index.js +5 -4
- package/build-module/components/block-settings-menu/index.js.map +1 -1
- package/build-module/components/block-toolbar/change-design.js +111 -0
- package/build-module/components/block-toolbar/change-design.js.map +1 -0
- package/build-module/components/block-toolbar/index.js +19 -7
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/index.js +17 -20
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +4 -3
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js +2 -2
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +7 -10
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +20 -29
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +2 -2
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/block-vertical-alignment-control/ui.js +6 -10
- package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build-module/components/border-radius-control/linked-button.js +8 -11
- package/build-module/components/border-radius-control/linked-button.js.map +1 -1
- package/build-module/components/collab/block-comment-icon-slot.js +11 -0
- package/build-module/components/collab/block-comment-icon-slot.js.map +1 -0
- package/build-module/components/collab/block-comment-icon-toolbar-slot.js +11 -0
- package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -0
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/toolbar.js +4 -4
- package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +2 -5
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +26 -14
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-context.native.js +6 -0
- package/build-module/components/global-styles/use-global-styles-context.native.js.map +1 -1
- package/build-module/components/iframe/get-compatibility-styles.js +4 -4
- package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build-module/components/iframe/index.js +33 -22
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-size-control/index.js +62 -21
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +9 -5
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/index.js +1 -2
- package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +6 -4
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +4 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/utils.js +4 -0
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build-module/components/inserter/category-tabs/index.js +15 -2
- package/build-module/components/inserter/category-tabs/index.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-paging.js +1 -6
- package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -1
- package/build-module/components/inserter/menu.js +5 -3
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/search-results.js +0 -2
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter-button/index.native.js +1 -1
- package/build-module/components/inserter-button/index.native.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +0 -2
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/utils.js +3 -6
- package/build-module/components/inspector-controls-tabs/utils.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +13 -10
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/list-view/appender.js +4 -3
- package/build-module/components/list-view/appender.js.map +1 -1
- package/build-module/components/list-view/branch.js +7 -6
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/index.js +1 -2
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +4 -4
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/provider/index.js +1 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/index.js +4 -2
- package/build-module/components/rich-text/event-listeners/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +2 -6
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/spacing-sizes-control/index.js +3 -3
- package/build-module/components/spacing-sizes-control/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -4
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/spacing-sizes-control/linked-button.js +2 -6
- package/build-module/components/spacing-sizes-control/linked-button.js.map +1 -1
- package/build-module/components/tabbed-sidebar/index.js +1 -1
- package/build-module/components/tabbed-sidebar/index.js.map +1 -1
- package/build-module/components/tool-selector/index.js +1 -4
- package/build-module/components/tool-selector/index.js.map +1 -1
- package/build-module/components/url-input/index.js +4 -2
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +5 -5
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +5 -5
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.native.js +0 -1
- package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +1 -3
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +1 -3
- package/build-module/components/use-settings/index.js.map +1 -1
- package/build-module/components/writing-flow/index.js +5 -3
- package/build-module/components/writing-flow/index.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +2 -3
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/block-bindings.js +20 -9
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/hooks/contrast-checker.js +0 -1
- package/build-module/hooks/contrast-checker.js.map +1 -1
- package/build-module/hooks/duotone.js +2 -2
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-family.js +1 -1
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/style.js +4 -1
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +6 -6
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/typography.js +5 -5
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/use-zoom-out.js +15 -23
- package/build-module/hooks/use-zoom-out.js.map +1 -1
- package/build-module/hooks/utils.js +2 -2
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js +7 -5
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +2 -33
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +1 -1
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/private-actions.js +54 -7
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +10 -21
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +16 -6
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +54 -16
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +3 -3
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/dom.js +35 -16
- package/build-module/utils/dom.js.map +1 -1
- package/build-module/utils/get-font-styles-and-weights.js +2 -2
- package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +3 -2
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +16 -10
- package/build-style/content.css +16 -10
- package/build-style/style-rtl.css +47 -25
- package/build-style/style.css +47 -25
- package/build-types/utils/dom.d.ts +7 -9
- package/build-types/utils/dom.d.ts.map +1 -1
- package/package.json +34 -32
- package/src/autocompleters/block.js +16 -7
- package/src/components/block-canvas/index.js +17 -1
- package/src/components/block-canvas/style.scss +3 -1
- package/src/components/block-card/index.js +3 -3
- package/src/components/block-full-height-alignment-control/index.js +1 -1
- package/src/components/block-inspector/style.scss +2 -7
- package/src/components/block-list/block.js +29 -50
- package/src/components/block-list/block.native.js +0 -4
- package/src/components/block-list/content.scss +1 -1
- package/src/components/block-list/index.js +4 -4
- package/src/components/block-list/use-block-props/index.js +0 -2
- package/src/components/block-list/use-block-props/use-focus-first-element.js +5 -3
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +7 -20
- package/src/components/block-list/use-in-between-inserter.js +1 -1
- package/src/components/block-patterns-list/README.md +8 -8
- package/src/components/block-patterns-list/index.js +35 -51
- package/src/components/block-patterns-list/stories/fixtures.js +834 -0
- package/src/components/block-patterns-list/stories/index.story.js +64 -0
- package/src/components/block-patterns-list/style.scss +2 -0
- package/src/components/block-patterns-paging/index.js +1 -1
- package/src/components/block-popover/index.js +4 -66
- package/src/components/block-preview/async.js +43 -0
- package/src/components/block-preview/index.js +8 -3
- package/src/components/block-settings-menu/block-settings-dropdown.js +4 -0
- package/src/components/block-settings-menu/index.js +3 -0
- package/src/components/block-toolbar/change-design.js +127 -0
- package/src/components/block-toolbar/index.js +25 -8
- package/src/components/block-toolbar/style.scss +16 -0
- package/src/components/block-tools/index.js +30 -27
- package/src/components/block-tools/insertion-point.js +4 -3
- package/src/components/block-tools/style.scss +12 -20
- package/src/components/block-tools/use-block-toolbar-popover-props.js +2 -2
- package/src/components/block-tools/use-show-block-tools.js +3 -14
- package/src/components/block-tools/zoom-out-mode-inserters.js +25 -40
- package/src/components/block-variation-transforms/index.js +2 -2
- package/src/components/block-vertical-alignment-control/ui.js +11 -15
- package/src/components/border-radius-control/linked-button.js +9 -11
- package/src/components/collab/block-comment-icon-slot.js +12 -0
- package/src/components/collab/block-comment-icon-toolbar-slot.js +12 -0
- package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
- package/src/components/convert-to-group-buttons/toolbar.js +4 -4
- package/src/components/default-block-appender/content.scss +13 -19
- package/src/components/global-styles/color-panel.js +2 -10
- package/src/components/global-styles/dimensions-panel.js +22 -16
- package/src/components/global-styles/test/use-global-styles-context.native.js +1 -0
- package/src/components/global-styles/use-global-styles-context.native.js +6 -0
- package/src/components/iframe/content.scss +4 -9
- package/src/components/iframe/get-compatibility-styles.js +4 -9
- package/src/components/iframe/index.js +48 -34
- package/src/components/iframe/style.scss +2 -3
- package/src/components/image-size-control/index.js +74 -43
- package/src/components/image-size-control/test/index.js +5 -63
- package/src/components/inner-blocks/index.js +12 -6
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +3 -6
- package/src/components/inserter/block-patterns-tab/index.js +0 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +10 -4
- package/src/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +8 -0
- package/src/components/inserter/block-patterns-tab/utils.js +5 -0
- package/src/components/inserter/category-tabs/index.js +16 -2
- package/src/components/inserter/hooks/use-block-types-state.js +6 -1
- package/src/components/inserter/hooks/use-patterns-paging.js +1 -6
- package/src/components/inserter/menu.js +6 -4
- package/src/components/inserter/search-results.js +0 -6
- package/src/components/inserter/style.scss +13 -0
- package/src/components/inserter-button/index.native.js +1 -1
- package/src/components/inspector-controls-tabs/index.js +1 -6
- package/src/components/inspector-controls-tabs/utils.js +0 -3
- package/src/components/link-control/link-preview.js +15 -8
- package/src/components/link-control/test/index.js +63 -24
- package/src/components/list-view/appender.js +5 -6
- package/src/components/list-view/branch.js +8 -6
- package/src/components/list-view/index.js +1 -2
- package/src/components/media-placeholder/index.js +4 -4
- package/src/components/provider/index.js +1 -3
- package/src/components/provider/test/experimental-provider.js +43 -1
- package/src/components/rich-text/event-listeners/index.js +4 -2
- package/src/components/rich-text/index.js +8 -1
- package/src/components/rich-text/index.native.js +0 -2
- package/src/components/spacing-sizes-control/index.js +3 -3
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -4
- package/src/components/spacing-sizes-control/linked-button.js +2 -12
- package/src/components/tabbed-sidebar/index.js +1 -1
- package/src/components/tabbed-sidebar/style.scss +1 -1
- package/src/components/tool-selector/index.js +1 -5
- package/src/components/url-input/index.js +4 -5
- package/src/components/use-block-commands/index.js +245 -234
- package/src/components/use-block-drop-zone/index.js +5 -5
- package/src/components/use-block-drop-zone/index.native.js +0 -1
- package/src/components/use-moving-animation/index.js +0 -1
- package/src/components/use-settings/index.js +0 -1
- package/src/components/writing-flow/index.js +5 -3
- package/src/components/writing-flow/use-tab-nav.js +1 -2
- package/src/hooks/block-bindings.js +48 -31
- package/src/hooks/contrast-checker.js +0 -1
- package/src/hooks/duotone.js +2 -2
- package/src/hooks/font-family.js +1 -1
- package/src/hooks/style.js +7 -3
- package/src/hooks/supports.js +6 -6
- package/src/hooks/typography.js +5 -5
- package/src/hooks/use-zoom-out.js +14 -34
- package/src/hooks/utils.js +7 -2
- package/src/index.js +0 -1
- package/src/private-apis.js +6 -3
- package/src/store/actions.js +3 -52
- package/src/store/defaults.js +2 -1
- package/src/store/private-actions.js +71 -8
- package/src/store/private-selectors.js +14 -25
- package/src/store/reducer.js +25 -11
- package/src/store/selectors.js +116 -53
- package/src/store/test/actions.js +41 -0
- package/src/store/test/private-selectors.js +5 -0
- package/src/store/test/reducer.js +23 -0
- package/src/store/utils.js +12 -11
- package/src/utils/dom.js +42 -17
- package/src/utils/get-font-styles-and-weights.js +2 -2
- package/src/utils/test/dom.js +224 -0
- package/src/utils/transform-styles/index.js +3 -2
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -57
- package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +0 -1
- package/build/components/block-toolbar/shuffle.js +0 -110
- package/build/components/block-toolbar/shuffle.js.map +0 -1
- package/build/components/block-tools/zoom-out-popover.js +0 -58
- package/build/components/block-tools/zoom-out-popover.js.map +0 -1
- package/build/components/block-tools/zoom-out-toolbar.js +0 -132
- package/build/components/block-tools/zoom-out-toolbar.js.map +0 -1
- package/build/components/block-vertical-alignment-control/icons.js +0 -48
- package/build/components/block-vertical-alignment-control/icons.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -51
- package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +0 -1
- package/build-module/components/block-toolbar/shuffle.js +0 -103
- package/build-module/components/block-toolbar/shuffle.js.map +0 -1
- package/build-module/components/block-tools/zoom-out-popover.js +0 -49
- package/build-module/components/block-tools/zoom-out-popover.js.map +0 -1
- package/build-module/components/block-tools/zoom-out-toolbar.js +0 -124
- package/build-module/components/block-tools/zoom-out-toolbar.js.map +0 -1
- package/build-module/components/block-vertical-alignment-control/icons.js +0 -41
- package/build-module/components/block-vertical-alignment-control/icons.js.map +0 -1
- package/src/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -65
- package/src/components/block-toolbar/shuffle.js +0 -111
- package/src/components/block-tools/zoom-out-popover.js +0 -47
- package/src/components/block-tools/zoom-out-toolbar.js +0 -135
- package/src/components/block-vertical-alignment-control/icons.js +0 -34
- /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
|
@@ -24,275 +24,286 @@ import {
|
|
|
24
24
|
import BlockIcon from '../block-icon';
|
|
25
25
|
import { store as blockEditorStore } from '../../store';
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
blocks,
|
|
31
|
-
clientIds,
|
|
32
|
-
canRemove,
|
|
33
|
-
possibleBlockTransformations,
|
|
34
|
-
invalidSelection,
|
|
35
|
-
} = useSelect( ( select ) => {
|
|
27
|
+
const getTransformCommands = () =>
|
|
28
|
+
function useTransformCommands() {
|
|
29
|
+
const { replaceBlocks, multiSelect } = useDispatch( blockEditorStore );
|
|
36
30
|
const {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} =
|
|
31
|
+
blocks,
|
|
32
|
+
clientIds,
|
|
33
|
+
canRemove,
|
|
34
|
+
possibleBlockTransformations,
|
|
35
|
+
invalidSelection,
|
|
36
|
+
} = useSelect( ( select ) => {
|
|
37
|
+
const {
|
|
38
|
+
getBlockRootClientId,
|
|
39
|
+
getBlockTransformItems,
|
|
40
|
+
getSelectedBlockClientIds,
|
|
41
|
+
getBlocksByClientId,
|
|
42
|
+
canRemoveBlocks,
|
|
43
|
+
} = select( blockEditorStore );
|
|
44
|
+
|
|
45
|
+
const selectedBlockClientIds = getSelectedBlockClientIds();
|
|
46
|
+
const selectedBlocks = getBlocksByClientId(
|
|
47
|
+
selectedBlockClientIds
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
// selectedBlocks can have `null`s when something tries to call `selectBlock` with an inexistent clientId.
|
|
51
|
+
// These nulls will cause fatal errors down the line.
|
|
52
|
+
// In order to prevent discrepancies between selectedBlockClientIds and selectedBlocks, we effectively treat the entire selection as invalid.
|
|
53
|
+
// @see https://github.com/WordPress/gutenberg/pull/59410#issuecomment-2006304536
|
|
54
|
+
if ( selectedBlocks.filter( ( block ) => ! block ).length > 0 ) {
|
|
55
|
+
return {
|
|
56
|
+
invalidSelection: true,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
43
59
|
|
|
44
|
-
|
|
45
|
-
|
|
60
|
+
const rootClientId = getBlockRootClientId(
|
|
61
|
+
selectedBlockClientIds[ 0 ]
|
|
62
|
+
);
|
|
63
|
+
return {
|
|
64
|
+
blocks: selectedBlocks,
|
|
65
|
+
clientIds: selectedBlockClientIds,
|
|
66
|
+
possibleBlockTransformations: getBlockTransformItems(
|
|
67
|
+
selectedBlocks,
|
|
68
|
+
rootClientId
|
|
69
|
+
),
|
|
70
|
+
canRemove: canRemoveBlocks( selectedBlockClientIds ),
|
|
71
|
+
invalidSelection: false,
|
|
72
|
+
};
|
|
73
|
+
}, [] );
|
|
46
74
|
|
|
47
|
-
|
|
48
|
-
// These nulls will cause fatal errors down the line.
|
|
49
|
-
// In order to prevent discrepancies between selectedBlockClientIds and selectedBlocks, we effectively treat the entire selection as invalid.
|
|
50
|
-
// @see https://github.com/WordPress/gutenberg/pull/59410#issuecomment-2006304536
|
|
51
|
-
if ( selectedBlocks.filter( ( block ) => ! block ).length > 0 ) {
|
|
75
|
+
if ( invalidSelection ) {
|
|
52
76
|
return {
|
|
53
|
-
|
|
77
|
+
isLoading: false,
|
|
78
|
+
commands: [],
|
|
54
79
|
};
|
|
55
80
|
}
|
|
81
|
+
const isTemplate = blocks.length === 1 && isTemplatePart( blocks[ 0 ] );
|
|
82
|
+
|
|
83
|
+
function selectForMultipleBlocks( insertedBlocks ) {
|
|
84
|
+
if ( insertedBlocks.length > 1 ) {
|
|
85
|
+
multiSelect(
|
|
86
|
+
insertedBlocks[ 0 ].clientId,
|
|
87
|
+
insertedBlocks[ insertedBlocks.length - 1 ].clientId
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
56
91
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
possibleBlockTransformations: getBlockTransformItems(
|
|
64
|
-
selectedBlocks,
|
|
65
|
-
rootClientId
|
|
66
|
-
),
|
|
67
|
-
canRemove: canRemoveBlocks( selectedBlockClientIds ),
|
|
68
|
-
invalidSelection: false,
|
|
69
|
-
};
|
|
70
|
-
}, [] );
|
|
92
|
+
// Simple block tranformation based on the `Block Transforms` API.
|
|
93
|
+
function onBlockTransform( name ) {
|
|
94
|
+
const newBlocks = switchToBlockType( blocks, name );
|
|
95
|
+
replaceBlocks( clientIds, newBlocks );
|
|
96
|
+
selectForMultipleBlocks( newBlocks );
|
|
97
|
+
}
|
|
71
98
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
99
|
+
/**
|
|
100
|
+
* The `isTemplate` check is a stopgap solution here.
|
|
101
|
+
* Ideally, the Transforms API should handle this
|
|
102
|
+
* by allowing to exclude blocks from wildcard transformations.
|
|
103
|
+
*/
|
|
104
|
+
const hasPossibleBlockTransformations =
|
|
105
|
+
!! possibleBlockTransformations.length && canRemove && ! isTemplate;
|
|
106
|
+
|
|
107
|
+
if (
|
|
108
|
+
! clientIds ||
|
|
109
|
+
clientIds.length < 1 ||
|
|
110
|
+
! hasPossibleBlockTransformations
|
|
111
|
+
) {
|
|
112
|
+
return { isLoading: false, commands: [] };
|
|
86
113
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
114
|
+
|
|
115
|
+
const commands = possibleBlockTransformations.map(
|
|
116
|
+
( transformation ) => {
|
|
117
|
+
const { name, title, icon } = transformation;
|
|
118
|
+
return {
|
|
119
|
+
name:
|
|
120
|
+
'core/block-editor/transform-to-' +
|
|
121
|
+
name.replace( '/', '-' ),
|
|
122
|
+
/* translators: %s: Block or block variation name. */
|
|
123
|
+
label: sprintf( __( 'Transform to %s' ), title ),
|
|
124
|
+
icon: <BlockIcon icon={ icon } />,
|
|
125
|
+
callback: ( { close } ) => {
|
|
126
|
+
onBlockTransform( name );
|
|
127
|
+
close();
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
return { isLoading: false, commands };
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const getQuickActionsCommands = () =>
|
|
137
|
+
function useQuickActionsCommands() {
|
|
138
|
+
const { clientIds, isUngroupable, isGroupable } = useSelect(
|
|
139
|
+
( select ) => {
|
|
140
|
+
const {
|
|
141
|
+
getSelectedBlockClientIds,
|
|
142
|
+
isUngroupable: _isUngroupable,
|
|
143
|
+
isGroupable: _isGroupable,
|
|
144
|
+
} = select( blockEditorStore );
|
|
145
|
+
const selectedBlockClientIds = getSelectedBlockClientIds();
|
|
146
|
+
|
|
147
|
+
return {
|
|
148
|
+
clientIds: selectedBlockClientIds,
|
|
149
|
+
isUngroupable: _isUngroupable(),
|
|
150
|
+
isGroupable: _isGroupable(),
|
|
151
|
+
};
|
|
122
152
|
},
|
|
123
|
-
|
|
124
|
-
|
|
153
|
+
[]
|
|
154
|
+
);
|
|
155
|
+
const {
|
|
156
|
+
canInsertBlockType,
|
|
157
|
+
getBlockRootClientId,
|
|
158
|
+
getBlocksByClientId,
|
|
159
|
+
canRemoveBlocks,
|
|
160
|
+
} = useSelect( blockEditorStore );
|
|
161
|
+
const { getDefaultBlockName, getGroupingBlockName } =
|
|
162
|
+
useSelect( blocksStore );
|
|
125
163
|
|
|
126
|
-
|
|
127
|
-
};
|
|
164
|
+
const blocks = getBlocksByClientId( clientIds );
|
|
128
165
|
|
|
129
|
-
const useQuickActionsCommands = () => {
|
|
130
|
-
const { clientIds, isUngroupable, isGroupable } = useSelect( ( select ) => {
|
|
131
166
|
const {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
167
|
+
removeBlocks,
|
|
168
|
+
replaceBlocks,
|
|
169
|
+
duplicateBlocks,
|
|
170
|
+
insertAfterBlock,
|
|
171
|
+
insertBeforeBlock,
|
|
172
|
+
} = useDispatch( blockEditorStore );
|
|
173
|
+
|
|
174
|
+
const onGroup = () => {
|
|
175
|
+
if ( ! blocks.length ) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
137
178
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
179
|
+
const groupingBlockName = getGroupingBlockName();
|
|
180
|
+
|
|
181
|
+
// Activate the `transform` on `core/group` which does the conversion.
|
|
182
|
+
const newBlocks = switchToBlockType( blocks, groupingBlockName );
|
|
183
|
+
|
|
184
|
+
if ( ! newBlocks ) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
replaceBlocks( clientIds, newBlocks );
|
|
142
188
|
};
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
getBlocksByClientId,
|
|
148
|
-
canRemoveBlocks,
|
|
149
|
-
} = useSelect( blockEditorStore );
|
|
150
|
-
const { getDefaultBlockName, getGroupingBlockName } =
|
|
151
|
-
useSelect( blocksStore );
|
|
152
|
-
|
|
153
|
-
const blocks = getBlocksByClientId( clientIds );
|
|
154
|
-
|
|
155
|
-
const {
|
|
156
|
-
removeBlocks,
|
|
157
|
-
replaceBlocks,
|
|
158
|
-
duplicateBlocks,
|
|
159
|
-
insertAfterBlock,
|
|
160
|
-
insertBeforeBlock,
|
|
161
|
-
} = useDispatch( blockEditorStore );
|
|
162
|
-
|
|
163
|
-
const onGroup = () => {
|
|
164
|
-
if ( ! blocks.length ) {
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
189
|
+
const onUngroup = () => {
|
|
190
|
+
if ( ! blocks.length ) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
167
193
|
|
|
168
|
-
|
|
194
|
+
const innerBlocks = blocks[ 0 ].innerBlocks;
|
|
169
195
|
|
|
170
|
-
|
|
171
|
-
|
|
196
|
+
if ( ! innerBlocks.length ) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
172
199
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
const onUngroup = () => {
|
|
179
|
-
if ( ! blocks.length ) {
|
|
180
|
-
return;
|
|
200
|
+
replaceBlocks( clientIds, innerBlocks );
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
if ( ! clientIds || clientIds.length < 1 ) {
|
|
204
|
+
return { isLoading: false, commands: [] };
|
|
181
205
|
}
|
|
182
206
|
|
|
183
|
-
const
|
|
207
|
+
const rootClientId = getBlockRootClientId( clientIds[ 0 ] );
|
|
208
|
+
const canInsertDefaultBlock = canInsertBlockType(
|
|
209
|
+
getDefaultBlockName(),
|
|
210
|
+
rootClientId
|
|
211
|
+
);
|
|
212
|
+
const canDuplicate = blocks.every( ( block ) => {
|
|
213
|
+
return (
|
|
214
|
+
!! block &&
|
|
215
|
+
hasBlockSupport( block.name, 'multiple', true ) &&
|
|
216
|
+
canInsertBlockType( block.name, rootClientId )
|
|
217
|
+
);
|
|
218
|
+
} );
|
|
219
|
+
const canRemove = canRemoveBlocks( clientIds );
|
|
184
220
|
|
|
185
|
-
|
|
186
|
-
|
|
221
|
+
const commands = [];
|
|
222
|
+
|
|
223
|
+
if ( canDuplicate ) {
|
|
224
|
+
commands.push( {
|
|
225
|
+
name: 'duplicate',
|
|
226
|
+
label: __( 'Duplicate' ),
|
|
227
|
+
callback: () => duplicateBlocks( clientIds, true ),
|
|
228
|
+
icon: copy,
|
|
229
|
+
} );
|
|
187
230
|
}
|
|
188
231
|
|
|
189
|
-
|
|
190
|
-
|
|
232
|
+
if ( canInsertDefaultBlock ) {
|
|
233
|
+
commands.push(
|
|
234
|
+
{
|
|
235
|
+
name: 'add-before',
|
|
236
|
+
label: __( 'Add before' ),
|
|
237
|
+
callback: () => {
|
|
238
|
+
const clientId = Array.isArray( clientIds )
|
|
239
|
+
? clientIds[ 0 ]
|
|
240
|
+
: clientId;
|
|
241
|
+
insertBeforeBlock( clientId );
|
|
242
|
+
},
|
|
243
|
+
icon: add,
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
name: 'add-after',
|
|
247
|
+
label: __( 'Add after' ),
|
|
248
|
+
callback: () => {
|
|
249
|
+
const clientId = Array.isArray( clientIds )
|
|
250
|
+
? clientIds[ clientIds.length - 1 ]
|
|
251
|
+
: clientId;
|
|
252
|
+
insertAfterBlock( clientId );
|
|
253
|
+
},
|
|
254
|
+
icon: add,
|
|
255
|
+
}
|
|
256
|
+
);
|
|
257
|
+
}
|
|
191
258
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
);
|
|
201
|
-
const canDuplicate = blocks.every( ( block ) => {
|
|
202
|
-
return (
|
|
203
|
-
!! block &&
|
|
204
|
-
hasBlockSupport( block.name, 'multiple', true ) &&
|
|
205
|
-
canInsertBlockType( block.name, rootClientId )
|
|
206
|
-
);
|
|
207
|
-
} );
|
|
208
|
-
const canRemove = canRemoveBlocks( clientIds );
|
|
259
|
+
if ( isGroupable ) {
|
|
260
|
+
commands.push( {
|
|
261
|
+
name: 'Group',
|
|
262
|
+
label: __( 'Group' ),
|
|
263
|
+
callback: onGroup,
|
|
264
|
+
icon: group,
|
|
265
|
+
} );
|
|
266
|
+
}
|
|
209
267
|
|
|
210
|
-
|
|
268
|
+
if ( isUngroupable ) {
|
|
269
|
+
commands.push( {
|
|
270
|
+
name: 'ungroup',
|
|
271
|
+
label: __( 'Ungroup' ),
|
|
272
|
+
callback: onUngroup,
|
|
273
|
+
icon: ungroup,
|
|
274
|
+
} );
|
|
275
|
+
}
|
|
211
276
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
{
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
callback: () => {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
: clientId;
|
|
230
|
-
insertBeforeBlock( clientId );
|
|
231
|
-
},
|
|
232
|
-
icon: add,
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
name: 'add-after',
|
|
236
|
-
label: __( 'Add after' ),
|
|
237
|
-
callback: () => {
|
|
238
|
-
const clientId = Array.isArray( clientIds )
|
|
239
|
-
? clientIds[ clientIds.length - 1 ]
|
|
240
|
-
: clientId;
|
|
241
|
-
insertAfterBlock( clientId );
|
|
277
|
+
if ( canRemove ) {
|
|
278
|
+
commands.push( {
|
|
279
|
+
name: 'remove',
|
|
280
|
+
label: __( 'Delete' ),
|
|
281
|
+
callback: () => removeBlocks( clientIds, true ),
|
|
282
|
+
icon: remove,
|
|
283
|
+
} );
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
return {
|
|
287
|
+
isLoading: false,
|
|
288
|
+
commands: commands.map( ( command ) => ( {
|
|
289
|
+
...command,
|
|
290
|
+
name: 'core/block-editor/action-' + command.name,
|
|
291
|
+
callback: ( { close } ) => {
|
|
292
|
+
command.callback();
|
|
293
|
+
close();
|
|
242
294
|
},
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
if ( isGroupable ) {
|
|
249
|
-
commands.push( {
|
|
250
|
-
name: 'Group',
|
|
251
|
-
label: __( 'Group' ),
|
|
252
|
-
callback: onGroup,
|
|
253
|
-
icon: group,
|
|
254
|
-
} );
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
if ( isUngroupable ) {
|
|
258
|
-
commands.push( {
|
|
259
|
-
name: 'ungroup',
|
|
260
|
-
label: __( 'Ungroup' ),
|
|
261
|
-
callback: onUngroup,
|
|
262
|
-
icon: ungroup,
|
|
263
|
-
} );
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
if ( canRemove ) {
|
|
267
|
-
commands.push( {
|
|
268
|
-
name: 'remove',
|
|
269
|
-
label: __( 'Delete' ),
|
|
270
|
-
callback: () => removeBlocks( clientIds, true ),
|
|
271
|
-
icon: remove,
|
|
272
|
-
} );
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
return {
|
|
276
|
-
isLoading: false,
|
|
277
|
-
commands: commands.map( ( command ) => ( {
|
|
278
|
-
...command,
|
|
279
|
-
name: 'core/block-editor/action-' + command.name,
|
|
280
|
-
callback: ( { close } ) => {
|
|
281
|
-
command.callback();
|
|
282
|
-
close();
|
|
283
|
-
},
|
|
284
|
-
} ) ),
|
|
295
|
+
} ) ),
|
|
296
|
+
};
|
|
285
297
|
};
|
|
286
|
-
};
|
|
287
298
|
|
|
288
299
|
export const useBlockCommands = () => {
|
|
289
300
|
useCommandLoader( {
|
|
290
301
|
name: 'core/block-editor/blockTransforms',
|
|
291
|
-
hook:
|
|
302
|
+
hook: getTransformCommands(),
|
|
292
303
|
} );
|
|
293
304
|
useCommandLoader( {
|
|
294
305
|
name: 'core/block-editor/blockQuickActions',
|
|
295
|
-
hook:
|
|
306
|
+
hook: getQuickActionsCommands(),
|
|
296
307
|
context: 'block-selection-edit',
|
|
297
308
|
} );
|
|
298
309
|
};
|
|
@@ -287,7 +287,7 @@ function isInsertionPoint( targetToCheck, ownerDocument ) {
|
|
|
287
287
|
return !! (
|
|
288
288
|
defaultView &&
|
|
289
289
|
targetToCheck instanceof defaultView.HTMLElement &&
|
|
290
|
-
targetToCheck.
|
|
290
|
+
targetToCheck.closest( '[data-is-insertion-point]' )
|
|
291
291
|
);
|
|
292
292
|
}
|
|
293
293
|
|
|
@@ -330,7 +330,7 @@ export default function useBlockDropZone( {
|
|
|
330
330
|
getAllowedBlocks,
|
|
331
331
|
isDragging,
|
|
332
332
|
isGroupable,
|
|
333
|
-
|
|
333
|
+
isZoomOut,
|
|
334
334
|
getSectionRootClientId,
|
|
335
335
|
} = unlock( useSelect( blockEditorStore ) );
|
|
336
336
|
const {
|
|
@@ -383,7 +383,7 @@ export default function useBlockDropZone( {
|
|
|
383
383
|
// do not allow dropping as the drop target is not within the root (that which is
|
|
384
384
|
// treated as "the content" by Zoom Out Mode).
|
|
385
385
|
if (
|
|
386
|
-
|
|
386
|
+
isZoomOut() &&
|
|
387
387
|
sectionRootClientId !== targetRootClientId
|
|
388
388
|
) {
|
|
389
389
|
return;
|
|
@@ -439,7 +439,7 @@ export default function useBlockDropZone( {
|
|
|
439
439
|
const [ targetIndex, operation, nearestSide ] =
|
|
440
440
|
dropTargetPosition;
|
|
441
441
|
|
|
442
|
-
if (
|
|
442
|
+
if ( isZoomOut() && operation !== 'insert' ) {
|
|
443
443
|
return;
|
|
444
444
|
}
|
|
445
445
|
|
|
@@ -514,7 +514,7 @@ export default function useBlockDropZone( {
|
|
|
514
514
|
getDraggedBlockClientIds,
|
|
515
515
|
getBlockType,
|
|
516
516
|
getSectionRootClientId,
|
|
517
|
-
|
|
517
|
+
isZoomOut,
|
|
518
518
|
getBlocks,
|
|
519
519
|
getBlockListSettings,
|
|
520
520
|
dropZoneElement,
|
|
@@ -132,7 +132,6 @@ export default function useBlockDropZone( {
|
|
|
132
132
|
const getSortedBlocksLayouts = useCallback( () => {
|
|
133
133
|
return getBlockLayoutsOrderedByYCoord( blocksLayouts.current );
|
|
134
134
|
// We use the value of `blocksLayouts` as the dependency.
|
|
135
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
136
135
|
}, [ blocksLayouts.current ] );
|
|
137
136
|
|
|
138
137
|
const isRTL = getSettings().isRTL;
|
|
@@ -61,7 +61,6 @@ function useMovingAnimation( { triggerAnimationOnChange, clientId } ) {
|
|
|
61
61
|
previous: ref.current && getAbsolutePosition( ref.current ),
|
|
62
62
|
prevRect: ref.current && ref.current.getBoundingClientRect(),
|
|
63
63
|
} ),
|
|
64
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
64
|
[ triggerAnimationOnChange ]
|
|
66
65
|
);
|
|
67
66
|
|
|
@@ -47,19 +47,21 @@ export function useWritingFlow() {
|
|
|
47
47
|
useRefEffect(
|
|
48
48
|
( node ) => {
|
|
49
49
|
node.tabIndex = 0;
|
|
50
|
+
node.dataset.hasMultiSelection = hasMultiSelection;
|
|
50
51
|
|
|
51
52
|
if ( ! hasMultiSelection ) {
|
|
52
|
-
return
|
|
53
|
+
return () => {
|
|
54
|
+
delete node.dataset.hasMultiSelection;
|
|
55
|
+
};
|
|
53
56
|
}
|
|
54
57
|
|
|
55
|
-
node.classList.add( 'has-multi-selection' );
|
|
56
58
|
node.setAttribute(
|
|
57
59
|
'aria-label',
|
|
58
60
|
__( 'Multiple selected blocks' )
|
|
59
61
|
);
|
|
60
62
|
|
|
61
63
|
return () => {
|
|
62
|
-
node.
|
|
64
|
+
delete node.dataset.hasMultiSelection;
|
|
63
65
|
node.removeAttribute( 'aria-label' );
|
|
64
66
|
};
|
|
65
67
|
},
|
|
@@ -27,7 +27,6 @@ export default function useTabNav() {
|
|
|
27
27
|
getLastFocus,
|
|
28
28
|
getSectionRootClientId,
|
|
29
29
|
isZoomOut,
|
|
30
|
-
__unstableGetEditorMode,
|
|
31
30
|
} = unlock( useSelect( blockEditorStore ) );
|
|
32
31
|
const { setLastFocus } = unlock( useDispatch( blockEditorStore ) );
|
|
33
32
|
|
|
@@ -54,7 +53,7 @@ export default function useTabNav() {
|
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
// In "compose" mode without a selected ID, we want to place focus on the section root when tabbing to the canvas.
|
|
57
|
-
else if (
|
|
56
|
+
else if ( isZoomOut() ) {
|
|
58
57
|
const sectionRootClientId = getSectionRootClientId();
|
|
59
58
|
const sectionBlocks = getBlockOrder( sectionRootClientId );
|
|
60
59
|
|