@wordpress/block-editor 12.15.0 → 12.16.1-next.79a6196f.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/LICENSE.md +1 -1
- package/README.md +12 -10
- package/build/components/block-canvas/index.js +21 -7
- 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-controls/hook.js +3 -23
- package/build/components/block-controls/hook.js.map +1 -1
- package/build/components/block-draggable/draggable-chip.js +6 -1
- package/build/components/block-draggable/draggable-chip.js.map +1 -1
- package/build/components/block-draggable/index.js +76 -6
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-draggable/index.native.js +0 -6
- package/build/components/block-draggable/index.native.js.map +1 -1
- package/build/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
- package/build/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
- package/build/components/block-edit/context.js +5 -1
- package/build/components/block-edit/context.js.map +1 -1
- package/build/components/block-edit/index.js +18 -9
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-editing-mode/index.js +2 -3
- package/build/components/block-editing-mode/index.js.map +1 -1
- package/build/components/block-info-slot-fill/index.js +3 -4
- package/build/components/block-info-slot-fill/index.js.map +1 -1
- package/build/components/block-inspector/index.js +1 -1
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-list-item-cell.native.js +1 -0
- package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build/components/block-list/block.js +257 -95
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +58 -23
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.native.js +3 -5
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/private-block-context.js +14 -0
- package/build/components/block-list/private-block-context.js.map +1 -0
- package/build/components/block-list/use-block-props/index.js +49 -69
- 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 -29
- 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-is-hovered.js +4 -14
- package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
- 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 +3 -2
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-list/use-scroll-upon-insertion.native.js +41 -0
- package/build/components/block-list/use-scroll-upon-insertion.native.js.map +1 -0
- package/build/components/block-lock/toolbar.js +21 -27
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-mover/index.js +2 -1
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-patterns-list/index.js +5 -5
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +2 -9
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-rename/modal.js +3 -0
- package/build/components/block-rename/modal.js.map +1 -1
- package/build/components/block-settings/container.native.js +6 -4
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-styles/index.js +1 -1
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/index.native.js +3 -2
- package/build/components/block-styles/index.native.js.map +1 -1
- package/build/components/block-switcher/index.js +4 -4
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +90 -29
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/block-toolbar-breadcrumb.js +49 -0
- package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
- package/build/components/block-tools/block-toolbar-popover.js +84 -0
- package/build/components/block-tools/block-toolbar-popover.js.map +1 -0
- package/build/components/block-tools/index.js +27 -24
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-types-list/index.native.js +4 -3
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/block-variation-picker/index.native.js +2 -1
- package/build/components/block-variation-picker/index.native.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +29 -2
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/border-radius-control/linked-button.js +1 -1
- package/build/components/border-radius-control/linked-button.js.map +1 -1
- package/build/components/colors/utils.js +10 -2
- package/build/components/colors/utils.js.map +1 -1
- package/build/components/colors/with-colors.js +6 -2
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/control.js +28 -17
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/duotone-control/index.js +1 -4
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/font-sizes/utils.js +10 -2
- package/build/components/font-sizes/utils.js.map +1 -1
- package/build/components/global-styles/border-panel.js +2 -1
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +24 -21
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +4 -3
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/effects-panel.js +2 -1
- package/build/components/global-styles/effects-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +6 -3
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/get-global-styles-changes.js +192 -0
- package/build/components/global-styles/get-global-styles-changes.js.map +1 -0
- package/build/components/global-styles/hooks.js +3 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +7 -1
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/index.js +7 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +43 -36
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +22 -8
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +8 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/height-control/index.js +6 -2
- package/build/components/height-control/index.js.map +1 -1
- package/build/components/image-link-destinations/index.native.js +118 -0
- package/build/components/image-link-destinations/index.native.js.map +1 -0
- package/build/components/image-size-control/index.js +2 -2
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/index.native.js +14 -5
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/index.js +61 -22
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/index.native.js +18 -4
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.js +5 -6
- package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +5 -9
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +10 -9
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js +10 -10
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +9 -9
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/utils.js +10 -14
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +4 -14
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/index.js +1 -2
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/library.js +3 -7
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/media-tab/media-panel.js +2 -2
- package/build/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build/components/inserter/menu.js +26 -33
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/preview-panel.js +2 -2
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter/tabs.js +21 -21
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/inserter-button/index.native.js +98 -0
- package/build/components/inserter-button/index.native.js.map +1 -0
- package/build/components/inserter-button/sparkles.js +23 -0
- package/build/components/inserter-button/sparkles.js.map +1 -0
- package/build/components/inserter-draggable-blocks/index.js +8 -4
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inserter-list-item/index.js +2 -4
- package/build/components/inserter-list-item/index.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js +3 -1
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls/fill.js +3 -3
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/fill.native.js +3 -3
- package/build/components/inspector-controls/fill.native.js.map +1 -1
- package/build/components/inspector-controls-tabs/index.js +34 -23
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/list-view/block-select-button.js +4 -0
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +57 -3
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/media-upload-progress/constants.js +19 -0
- package/build/components/media-upload-progress/constants.js.map +1 -0
- package/build/components/media-upload-progress/index.native.js +42 -17
- package/build/components/media-upload-progress/index.native.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +11 -16
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/plain-text/index.native.js +8 -3
- package/build/components/plain-text/index.native.js.map +1 -1
- package/build/components/preview-options/index.js +6 -62
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/provider/index.js +3 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-sync.js +7 -1
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/rich-text/content.js +26 -23
- package/build/components/rich-text/content.js.map +1 -1
- package/build/components/rich-text/get-rich-text-values.js +2 -1
- package/build/components/rich-text/get-rich-text-values.js.map +1 -1
- package/build/components/rich-text/index.js +19 -37
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +9 -16
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/native/get-format-colors.native.js +22 -24
- package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +22 -57
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/rich-text/use-input-rules.js +7 -3
- package/build/components/rich-text/use-input-rules.js.map +1 -1
- package/build/components/rich-text/use-mark-persistent.js +1 -1
- package/build/components/rich-text/use-mark-persistent.js.map +1 -1
- package/build/components/rich-text/with-deprecations.js +50 -0
- package/build/components/rich-text/with-deprecations.js.map +1 -0
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/url-input/index.js +9 -6
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-commands/index.js +14 -18
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +108 -17
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +100 -92
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +9 -12
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +4 -1
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/components/use-settings/index.js +14 -0
- package/build/components/use-settings/index.js.map +1 -1
- package/build/components/writing-flow/index.js +0 -1
- package/build/components/writing-flow/index.js.map +1 -1
- package/build/components/writing-flow/use-drag-selection.js +15 -4
- package/build/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build/components/writing-flow/use-selection-observer.js +73 -27
- package/build/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +7 -4
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/align.js +21 -69
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/align.native.js +11 -1
- package/build/hooks/align.native.js.map +1 -1
- package/build/hooks/anchor.js +14 -30
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/aria-label.js +9 -1
- package/build/hooks/aria-label.js.map +1 -1
- package/build/hooks/background.js +198 -36
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-hooks.js +24 -32
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-renaming.js +18 -22
- package/build/hooks/block-renaming.js.map +1 -1
- package/build/hooks/border.js +53 -80
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +79 -90
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/content-lock-ui.js +29 -29
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/custom-class-name.js +13 -30
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/custom-class-name.native.js +9 -1
- package/build/hooks/custom-class-name.native.js.map +1 -1
- package/build/hooks/dimensions.js +13 -14
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +31 -61
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-family.js +23 -28
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +52 -120
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/index.js +27 -16
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +15 -6
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/layout-child.js +68 -0
- package/build/hooks/layout-child.js.map +1 -0
- package/build/hooks/layout.js +25 -104
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/padding.js +2 -2
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/position.js +40 -62
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/style.js +52 -89
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/typography.js +25 -10
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/typography.native.js +43 -18
- package/build/hooks/typography.native.js.map +1 -1
- package/build/hooks/use-typography-props.js +10 -2
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/hooks/utils.js +200 -10
- package/build/hooks/utils.js.map +1 -1
- package/build/private-apis.js +2 -6
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +0 -2
- package/build/private-apis.native.js.map +1 -1
- package/build/store/actions.js +0 -16
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +54 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +46 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +18 -2
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +11 -73
- package/build/store/selectors.js.map +1 -1
- package/build/store/undo-ignore.js +12 -0
- package/build/store/undo-ignore.js.map +1 -0
- package/build/store/utils.js +66 -0
- package/build/store/utils.js.map +1 -0
- package/build/utils/get-px-from-css-unit.js +16 -0
- package/build/utils/get-px-from-css-unit.js.map +1 -0
- package/build/utils/index.js +2 -2
- package/build/utils/index.js.map +1 -1
- package/build/utils/object.js +38 -99
- package/build/utils/object.js.map +1 -1
- package/build/utils/selection.js +9 -1
- package/build/utils/selection.js.map +1 -1
- package/build/utils/use-can-block-toolbar-be-focused.js +46 -0
- package/build/utils/use-can-block-toolbar-be-focused.js.map +1 -0
- package/build-module/components/block-canvas/index.js +22 -8
- package/build-module/components/block-canvas/index.js.map +1 -1
- package/build-module/components/block-card/index.js +2 -2
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-controls/hook.js +4 -24
- package/build-module/components/block-controls/hook.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.js +6 -1
- package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
- package/build-module/components/block-draggable/index.js +76 -6
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-draggable/index.native.js +1 -7
- package/build-module/components/block-draggable/index.native.js.map +1 -1
- package/build-module/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
- package/build-module/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
- package/build-module/components/block-edit/context.js +2 -0
- package/build-module/components/block-edit/context.js.map +1 -1
- package/build-module/components/block-edit/index.js +19 -10
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-editing-mode/index.js +3 -4
- package/build-module/components/block-editing-mode/index.js.map +1 -1
- package/build-module/components/block-info-slot-fill/index.js +3 -3
- package/build-module/components/block-info-slot-fill/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +1 -1
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-list-item-cell.native.js +1 -0
- package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build-module/components/block-list/block.js +261 -99
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +60 -25
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.native.js +3 -5
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/private-block-context.js +6 -0
- package/build-module/components/block-list/private-block-context.js.map +1 -0
- package/build-module/components/block-list/use-block-props/index.js +50 -70
- 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 -29
- 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-is-hovered.js +4 -14
- package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
- 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 +3 -2
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-list/use-scroll-upon-insertion.native.js +33 -0
- package/build-module/components/block-list/use-scroll-upon-insertion.native.js.map +1 -0
- package/build-module/components/block-lock/toolbar.js +22 -28
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-mover/index.js +2 -1
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +6 -6
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +3 -10
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-rename/modal.js +3 -0
- package/build-module/components/block-rename/modal.js.map +1 -1
- package/build-module/components/block-settings/container.native.js +4 -2
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-styles/index.js +1 -1
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/index.native.js +3 -2
- package/build-module/components/block-styles/index.native.js.map +1 -1
- package/build-module/components/block-switcher/index.js +4 -4
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +89 -27
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js +41 -0
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
- package/build-module/components/block-tools/block-toolbar-popover.js +74 -0
- package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -0
- package/build-module/components/block-tools/index.js +27 -24
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js +2 -1
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/block-variation-picker/index.native.js +2 -1
- package/build-module/components/block-variation-picker/index.native.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +30 -3
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/border-radius-control/linked-button.js +1 -1
- package/build-module/components/border-radius-control/linked-button.js.map +1 -1
- package/build-module/components/colors/utils.js +9 -1
- package/build-module/components/colors/utils.js.map +1 -1
- package/build-module/components/colors/with-colors.js +5 -1
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +29 -18
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/duotone-control/index.js +1 -4
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/font-sizes/utils.js +9 -1
- package/build-module/components/font-sizes/utils.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +3 -2
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +26 -23
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +5 -4
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/effects-panel.js +3 -2
- package/build-module/components/global-styles/effects-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +8 -5
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/get-global-styles-changes.js +184 -0
- package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -0
- package/build-module/components/global-styles/hooks.js +3 -2
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +7 -1
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/index.js +1 -0
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +45 -38
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +15 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +7 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/height-control/index.js +6 -2
- package/build-module/components/height-control/index.js.map +1 -1
- package/build-module/components/image-link-destinations/index.native.js +109 -0
- package/build-module/components/image-link-destinations/index.native.js.map +1 -0
- package/build-module/components/image-size-control/index.js +2 -2
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/index.native.js +3 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +62 -23
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.native.js +18 -4
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js +5 -6
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js +6 -10
- package/build-module/components/inner-blocks/use-nested-settings-update.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/pattern-category-previews.js +11 -10
- 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 +11 -11
- 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 +11 -11
- 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 +7 -11
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js +4 -14
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +2 -2
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/index.js +1 -2
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/library.js +3 -7
- package/build-module/components/inserter/library.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build-module/components/inserter/menu.js +26 -33
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +2 -2
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter/tabs.js +22 -22
- package/build-module/components/inserter/tabs.js.map +1 -1
- package/build-module/components/inserter-button/index.native.js +89 -0
- package/build-module/components/inserter-button/index.native.js.map +1 -0
- package/build-module/components/inserter-button/sparkles.js +15 -0
- package/build-module/components/inserter-button/sparkles.js.map +1 -0
- package/build-module/components/inserter-draggable-blocks/index.js +9 -5
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inserter-list-item/index.js +2 -4
- package/build-module/components/inserter-list-item/index.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js +3 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +3 -3
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls/fill.native.js +3 -3
- package/build-module/components/inspector-controls/fill.native.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +35 -24
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +4 -0
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +58 -4
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/media-upload-progress/constants.js +7 -0
- package/build-module/components/media-upload-progress/constants.js.map +1 -0
- package/build-module/components/media-upload-progress/index.native.js +37 -8
- package/build-module/components/media-upload-progress/index.native.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +11 -16
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/plain-text/index.native.js +6 -1
- package/build-module/components/plain-text/index.native.js.map +1 -1
- package/build-module/components/preview-options/index.js +6 -62
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/provider/index.js +3 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +7 -1
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/rich-text/content.js +25 -21
- package/build-module/components/rich-text/content.js.map +1 -1
- package/build-module/components/rich-text/get-rich-text-values.js +2 -1
- package/build-module/components/rich-text/get-rich-text-values.js.map +1 -1
- package/build-module/components/rich-text/index.js +21 -39
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +10 -18
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/get-format-colors.native.js +22 -24
- package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +22 -56
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/rich-text/use-input-rules.js +7 -3
- package/build-module/components/rich-text/use-input-rules.js.map +1 -1
- package/build-module/components/rich-text/use-mark-persistent.js +1 -1
- package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
- package/build-module/components/rich-text/with-deprecations.js +42 -0
- package/build-module/components/rich-text/with-deprecations.js.map +1 -0
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/url-input/index.js +9 -6
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +14 -18
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +107 -18
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +102 -94
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +9 -12
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +4 -1
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +13 -1
- package/build-module/components/use-settings/index.js.map +1 -1
- package/build-module/components/writing-flow/index.js +0 -1
- package/build-module/components/writing-flow/index.js.map +1 -1
- package/build-module/components/writing-flow/use-drag-selection.js +15 -4
- package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-selection-observer.js +73 -27
- package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +7 -4
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/align.js +20 -67
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/align.native.js +1 -0
- package/build-module/hooks/align.native.js.map +1 -1
- package/build-module/hooks/anchor.js +12 -27
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/aria-label.js +7 -1
- package/build-module/hooks/aria-label.js.map +1 -1
- package/build-module/hooks/background.js +197 -37
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-hooks.js +22 -30
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-renaming.js +17 -21
- package/build-module/hooks/block-renaming.js.map +1 -1
- package/build-module/hooks/border.js +52 -79
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +78 -88
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +27 -27
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/custom-class-name.js +12 -28
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/custom-class-name.native.js +7 -1
- package/build-module/hooks/custom-class-name.native.js.map +1 -1
- package/build-module/hooks/dimensions.js +15 -16
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +30 -61
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-family.js +20 -25
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +50 -120
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/index.js +20 -16
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +10 -6
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/layout-child.js +60 -0
- package/build-module/hooks/layout-child.js.map +1 -0
- package/build-module/hooks/layout.js +21 -100
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/padding.js +2 -2
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/position.js +38 -59
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/style.js +52 -85
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/typography.js +26 -11
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/typography.native.js +43 -17
- package/build-module/hooks/typography.native.js.map +1 -1
- package/build-module/hooks/use-typography-props.js +9 -1
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/hooks/utils.js +194 -9
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/private-apis.js +2 -6
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +0 -2
- package/build-module/private-apis.native.js.map +1 -1
- package/build-module/store/actions.js +0 -15
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +52 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +44 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +18 -2
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +4 -65
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/undo-ignore.js +5 -0
- package/build-module/store/undo-ignore.js.map +1 -0
- package/build-module/store/utils.js +56 -0
- package/build-module/store/utils.js.map +1 -0
- package/build-module/utils/get-px-from-css-unit.js +9 -0
- package/build-module/utils/get-px-from-css-unit.js.map +1 -0
- package/build-module/utils/index.js +1 -1
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/object.js +37 -97
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/selection.js +9 -1
- package/build-module/utils/selection.js.map +1 -1
- package/build-module/utils/use-can-block-toolbar-be-focused.js +40 -0
- package/build-module/utils/use-can-block-toolbar-be-focused.js.map +1 -0
- package/build-style/content-rtl.css +7 -6
- package/build-style/content.css +7 -6
- package/build-style/style-rtl.css +164 -301
- package/build-style/style.css +164 -301
- package/package.json +31 -31
- package/src/components/alignment-control/README.md +0 -5
- package/src/components/block-alignment-control/README.md +0 -5
- package/src/components/block-alignment-matrix-control/README.md +0 -10
- package/src/components/block-breadcrumb/README.md +0 -5
- package/src/components/block-canvas/index.js +29 -17
- package/src/components/block-canvas/style.scss +6 -0
- package/src/components/block-caption/README.md +2 -7
- package/src/components/block-card/README.md +0 -5
- package/src/components/block-card/index.js +6 -4
- package/src/components/block-card/style.scss +7 -3
- package/src/components/block-controls/hook.js +8 -30
- package/src/components/block-controls/test/index.js +3 -3
- package/src/components/block-draggable/draggable-chip.js +11 -1
- package/src/components/block-draggable/index.js +116 -4
- package/src/components/block-draggable/index.native.js +0 -5
- package/src/components/block-draggable/style.scss +35 -0
- package/src/components/block-draggable/test/helpers.native.js +8 -7
- package/src/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
- package/src/components/block-edit/context.js +3 -0
- package/src/components/block-edit/index.js +36 -10
- package/src/components/block-editing-mode/index.js +3 -3
- package/src/components/block-icon/README.md +0 -5
- package/src/components/block-info-slot-fill/index.js +6 -3
- package/src/components/block-inspector/README.md +0 -5
- package/src/components/block-inspector/index.js +3 -1
- package/src/components/block-inspector/style.scss +0 -4
- package/src/components/block-list/block-list-item-cell.native.js +5 -1
- package/src/components/block-list/block.js +309 -104
- package/src/components/block-list/block.native.js +69 -21
- package/src/components/block-list/content.scss +14 -10
- package/src/components/block-list/index.native.js +3 -5
- package/src/components/block-list/{block-list-block-context.js → private-block-context.js} +1 -1
- package/src/components/block-list/use-block-props/index.js +43 -86
- package/src/components/block-list/use-block-props/use-focus-first-element.js +1 -34
- package/src/components/block-list/use-block-props/use-is-hovered.js +2 -13
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +1 -5
- package/src/components/block-list/use-in-between-inserter.js +4 -1
- package/src/components/block-list/use-scroll-upon-insertion.native.js +52 -0
- package/src/components/block-lock/toolbar.js +23 -34
- package/src/components/block-mover/README.md +0 -5
- package/src/components/block-mover/index.js +1 -1
- package/src/components/block-parent-selector/README.md +0 -5
- package/src/components/block-patterns-list/README.md +0 -5
- package/src/components/block-patterns-list/index.js +9 -6
- package/src/components/block-removal-warning-modal/index.js +7 -14
- package/src/components/block-rename/modal.js +7 -1
- package/src/components/block-settings/container.native.js +3 -5
- package/src/components/block-styles/index.js +1 -1
- package/src/components/block-styles/index.native.js +4 -2
- package/src/components/block-styles/style.scss +0 -11
- package/src/components/block-switcher/index.js +49 -59
- package/src/components/block-switcher/test/__snapshots__/index.js.snap +3 -1
- package/src/components/block-toolbar/README.md +0 -5
- package/src/components/block-toolbar/index.js +179 -95
- package/src/components/block-toolbar/style.scss +50 -66
- package/src/components/block-tools/block-toolbar-breadcrumb.js +46 -0
- package/src/components/block-tools/block-toolbar-popover.js +84 -0
- package/src/components/block-tools/index.js +42 -29
- package/src/components/block-tools/style.scss +60 -172
- package/src/components/block-types-list/README.md +0 -5
- package/src/components/block-types-list/index.native.js +2 -1
- package/src/components/block-variation-picker/README.md +0 -5
- package/src/components/block-variation-picker/index.native.js +1 -1
- package/src/components/block-variation-transforms/README.md +0 -5
- package/src/components/block-variation-transforms/index.js +49 -3
- package/src/components/border-radius-control/linked-button.js +1 -1
- package/src/components/caption/README.md +0 -5
- package/src/components/color-palette/test/__snapshots__/control.js.snap +0 -1
- package/src/components/colors/utils.js +8 -1
- package/src/components/colors/with-colors.js +3 -1
- package/src/components/colors-gradients/control.js +49 -30
- package/src/components/colors-gradients/style.scss +0 -7
- package/src/components/contrast-checker/README.md +0 -4
- package/src/components/copy-handler/README.md +0 -10
- package/src/components/duotone-control/index.js +2 -5
- package/src/components/duotone-control/style.scss +1 -6
- package/src/components/font-sizes/utils.js +7 -1
- package/src/components/global-styles/border-panel.js +2 -1
- package/src/components/global-styles/color-panel.js +36 -26
- package/src/components/global-styles/dimensions-panel.js +4 -3
- package/src/components/global-styles/effects-panel.js +2 -1
- package/src/components/global-styles/filters-panel.js +6 -5
- package/src/components/global-styles/get-global-styles-changes.js +210 -0
- package/src/components/global-styles/hooks.js +5 -0
- package/src/components/global-styles/image-settings-panel.js +6 -0
- package/src/components/global-styles/index.js +1 -0
- package/src/components/global-styles/test/get-global-styles-changes.js +234 -0
- package/src/components/global-styles/typography-panel.js +60 -47
- package/src/components/global-styles/use-global-styles-output.js +9 -5
- package/src/components/global-styles/utils.js +7 -0
- package/src/components/height-control/README.md +2 -7
- package/src/components/height-control/index.js +4 -0
- package/src/components/image-link-destinations/index.native.js +152 -0
- package/src/components/image-link-destinations/style.native.scss +16 -0
- package/src/components/image-size-control/index.js +5 -2
- package/src/components/index.native.js +3 -2
- package/src/components/inner-blocks/README.md +13 -2
- package/src/components/inner-blocks/index.js +68 -29
- package/src/components/inner-blocks/index.native.js +19 -7
- package/src/components/inner-blocks/use-inner-block-template-sync.js +5 -7
- package/src/components/inner-blocks/use-nested-settings-update.js +6 -13
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +15 -15
- package/src/components/inserter/block-patterns-tab/patterns-filter.js +15 -13
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +15 -18
- package/src/components/inserter/block-patterns-tab/utils.js +11 -12
- package/src/components/inserter/hooks/use-block-types-state.js +9 -11
- package/src/components/inserter/hooks/use-patterns-state.js +2 -2
- package/src/components/inserter/index.js +0 -1
- package/src/components/inserter/library.js +2 -8
- package/src/components/inserter/media-tab/media-panel.js +1 -1
- package/src/components/inserter/menu.js +26 -36
- package/src/components/inserter/preview-panel.js +2 -2
- package/src/components/inserter/style.scss +21 -21
- package/src/components/inserter/tabs.js +34 -25
- package/src/components/inserter-button/README.md +62 -0
- package/src/components/inserter-button/index.native.js +116 -0
- package/src/components/inserter-button/sparkles.js +15 -0
- package/src/components/inserter-button/style.native.scss +72 -0
- package/src/components/inserter-draggable-blocks/index.js +18 -5
- package/src/components/inserter-list-item/index.js +6 -6
- package/src/components/inspector-controls/block-support-tools-panel.js +2 -0
- package/src/components/inspector-controls/fill.js +6 -3
- package/src/components/inspector-controls/fill.native.js +6 -3
- package/src/components/inspector-controls-tabs/index.js +39 -28
- package/src/components/inspector-controls-tabs/style.scss +3 -2
- package/src/components/letter-spacing-control/README.md +0 -5
- package/src/components/line-height-control/README.md +0 -5
- package/src/components/link-control/style.scss +1 -1
- package/src/components/link-control/test/index.js +1 -1
- package/src/components/list-view/README.md +0 -5
- package/src/components/list-view/block-select-button.js +4 -0
- package/src/components/list-view/block.js +73 -2
- package/src/components/list-view/style.scss +6 -0
- package/src/components/media-upload-progress/constants.js +6 -0
- package/src/components/media-upload-progress/index.native.js +66 -14
- package/src/components/media-upload-progress/test/index.native.js +2 -2
- package/src/components/multi-selection-inspector/README.md +0 -5
- package/src/components/navigable-toolbar/README.md +2 -0
- package/src/components/navigable-toolbar/index.js +15 -13
- package/src/components/plain-text/index.native.js +6 -1
- package/src/components/preview-options/index.js +6 -86
- package/src/components/provider/index.js +1 -1
- package/src/components/provider/test/use-block-sync.js +20 -17
- package/src/components/provider/use-block-sync.js +6 -0
- package/src/components/rich-text/content.js +27 -20
- package/src/components/rich-text/get-rich-text-values.js +6 -1
- package/src/components/rich-text/index.js +23 -52
- package/src/components/rich-text/index.native.js +8 -25
- package/src/components/rich-text/native/get-format-colors.native.js +33 -40
- package/src/components/rich-text/native/index.native.js +22 -71
- package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +3 -3
- package/src/components/rich-text/native/test/index.native.js +72 -5
- package/src/components/rich-text/use-input-rules.js +8 -3
- package/src/components/rich-text/use-mark-persistent.js +1 -2
- package/src/components/rich-text/with-deprecations.js +51 -0
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/src/components/text-decoration-control/README.md +40 -0
- package/src/components/text-transform-control/README.md +0 -4
- package/src/components/ungroup-button/README.md +0 -5
- package/src/components/unit-control/README.md +0 -4
- package/src/components/url-input/index.js +11 -11
- package/src/components/use-block-commands/index.js +18 -21
- package/src/components/use-block-drop-zone/index.js +181 -30
- package/src/components/use-moving-animation/index.js +107 -103
- package/src/components/use-on-block-drop/index.js +9 -24
- package/src/components/use-on-block-drop/test/index.js +12 -26
- package/src/components/use-resize-canvas/README.md +3 -7
- package/src/components/use-resize-canvas/index.js +4 -1
- package/src/components/use-settings/README.md +0 -4
- package/src/components/use-settings/index.js +15 -1
- package/src/components/writing-flow/index.js +0 -1
- package/src/components/writing-flow/use-drag-selection.js +18 -4
- package/src/components/writing-flow/use-selection-observer.js +99 -37
- package/src/components/writing-flow/use-tab-nav.js +7 -7
- package/src/hooks/align.js +16 -81
- package/src/hooks/align.native.js +1 -0
- package/src/hooks/anchor.js +14 -38
- package/src/hooks/aria-label.js +8 -5
- package/src/hooks/background.js +269 -32
- package/src/hooks/block-hooks.js +22 -51
- package/src/hooks/block-renaming.js +23 -37
- package/src/hooks/border.js +62 -124
- package/src/hooks/color.js +111 -138
- package/src/hooks/content-lock-ui.js +110 -122
- package/src/hooks/custom-class-name.js +9 -45
- package/src/hooks/custom-class-name.native.js +8 -5
- package/src/hooks/dimensions.js +14 -16
- package/src/hooks/duotone.js +70 -127
- package/src/hooks/font-family.js +14 -36
- package/src/hooks/font-size.js +67 -168
- package/src/hooks/index.js +58 -16
- package/src/hooks/index.native.js +22 -6
- package/src/hooks/layout-child.js +53 -0
- package/src/hooks/layout.js +17 -103
- package/src/hooks/padding.js +2 -2
- package/src/hooks/position.js +50 -90
- package/src/hooks/style.js +118 -193
- package/src/hooks/test/align.js +1 -178
- package/src/hooks/test/anchor.js +4 -9
- package/src/hooks/test/custom-class-name.js +3 -8
- package/src/hooks/test/style.js +4 -14
- package/src/hooks/typography.js +14 -16
- package/src/hooks/typography.native.js +31 -33
- package/src/hooks/use-typography-props.js +7 -1
- package/src/hooks/utils.js +261 -10
- package/src/private-apis.js +2 -6
- package/src/private-apis.native.js +0 -2
- package/src/store/actions.js +0 -15
- package/src/store/private-actions.js +48 -0
- package/src/store/private-selectors.js +56 -0
- package/src/store/reducer.js +20 -1
- package/src/store/selectors.js +10 -82
- package/src/store/undo-ignore.js +4 -0
- package/src/store/utils.js +74 -0
- package/src/style.scss +1 -2
- package/src/utils/get-px-from-css-unit.js +8 -0
- package/src/utils/index.js +1 -1
- package/src/utils/object.js +34 -104
- package/src/utils/selection.js +9 -2
- package/src/utils/test/object.js +1 -96
- package/src/utils/use-can-block-toolbar-be-focused.js +48 -0
- package/build/components/block-list/block-list-block-context.js +0 -14
- package/build/components/block-list/block-list-block-context.js.map +0 -1
- package/build/components/block-list/use-block-props/use-block-class-names.js +0 -67
- package/build/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js +0 -46
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
- package/build/components/block-list/use-block-props/use-block-default-class-name.js +0 -37
- package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
- package/build/components/block-tools/back-compat.js +0 -45
- package/build/components/block-tools/back-compat.js.map +0 -1
- package/build/components/block-tools/block-contextual-toolbar.js +0 -91
- package/build/components/block-tools/block-contextual-toolbar.js.map +0 -1
- package/build/components/block-tools/selected-block-tools.js +0 -113
- package/build/components/block-tools/selected-block-tools.js.map +0 -1
- package/build/components/inserter/hooks/use-debounced-input.js +0 -22
- package/build/components/inserter/hooks/use-debounced-input.js.map +0 -1
- package/build/components/use-display-block-controls/index.js +0 -39
- package/build/components/use-display-block-controls/index.js.map +0 -1
- package/build/components/use-display-block-controls/index.native.js +0 -39
- package/build/components/use-display-block-controls/index.native.js.map +0 -1
- package/build/hooks/custom-fields.js +0 -120
- package/build/hooks/custom-fields.js.map +0 -1
- package/build/utils/parse-css-unit-to-px.js +0 -302
- package/build/utils/parse-css-unit-to-px.js.map +0 -1
- package/build/utils/use-should-contextual-toolbar-show.js +0 -63
- package/build/utils/use-should-contextual-toolbar-show.js.map +0 -1
- package/build-module/components/block-list/block-list-block-context.js +0 -6
- package/build-module/components/block-list/block-list-block-context.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-class-names.js +0 -60
- package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +0 -40
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +0 -31
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
- package/build-module/components/block-tools/back-compat.js +0 -35
- package/build-module/components/block-tools/back-compat.js.map +0 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +0 -83
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +0 -1
- package/build-module/components/block-tools/selected-block-tools.js +0 -105
- package/build-module/components/block-tools/selected-block-tools.js.map +0 -1
- package/build-module/components/inserter/hooks/use-debounced-input.js +0 -15
- package/build-module/components/inserter/hooks/use-debounced-input.js.map +0 -1
- package/build-module/components/use-display-block-controls/index.js +0 -32
- package/build-module/components/use-display-block-controls/index.js.map +0 -1
- package/build-module/components/use-display-block-controls/index.native.js +0 -32
- package/build-module/components/use-display-block-controls/index.native.js.map +0 -1
- package/build-module/hooks/custom-fields.js +0 -118
- package/build-module/hooks/custom-fields.js.map +0 -1
- package/build-module/utils/parse-css-unit-to-px.js +0 -294
- package/build-module/utils/parse-css-unit-to-px.js.map +0 -1
- package/build-module/utils/use-should-contextual-toolbar-show.js +0 -57
- package/build-module/utils/use-should-contextual-toolbar-show.js.map +0 -1
- package/src/components/block-list/use-block-props/use-block-class-names.js +0 -66
- package/src/components/block-list/use-block-props/use-block-custom-class-name.js +0 -44
- package/src/components/block-list/use-block-props/use-block-default-class-name.js +0 -35
- package/src/components/block-parent-selector/style.scss +0 -11
- package/src/components/block-tools/back-compat.js +0 -35
- package/src/components/block-tools/block-contextual-toolbar.js +0 -100
- package/src/components/block-tools/selected-block-tools.js +0 -127
- package/src/components/inserter/hooks/use-debounced-input.js +0 -18
- package/src/components/preview-options/README.md +0 -94
- package/src/components/preview-options/style.scss +0 -64
- package/src/components/use-display-block-controls/index.js +0 -36
- package/src/components/use-display-block-controls/index.native.js +0 -37
- package/src/hooks/custom-fields.js +0 -142
- package/src/hooks/test/color.js +0 -112
- package/src/utils/parse-css-unit-to-px.js +0 -329
- package/src/utils/test/parse-css-unit-to-px.js +0 -172
- package/src/utils/use-should-contextual-toolbar-show.js +0 -85
|
@@ -6,7 +6,7 @@ import classnames from 'classnames';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { useCallback, RawHTML, useContext } from '@wordpress/element';
|
|
10
10
|
import {
|
|
11
11
|
getBlockType,
|
|
12
12
|
getSaveContent,
|
|
@@ -15,15 +15,13 @@ import {
|
|
|
15
15
|
switchToBlockType,
|
|
16
16
|
getDefaultBlockName,
|
|
17
17
|
isUnmodifiedBlock,
|
|
18
|
+
isReusableBlock,
|
|
19
|
+
getBlockDefaultClassName,
|
|
20
|
+
store as blocksStore,
|
|
18
21
|
} from '@wordpress/blocks';
|
|
19
22
|
import { withFilters } from '@wordpress/components';
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
withSelect,
|
|
23
|
-
useDispatch,
|
|
24
|
-
useSelect,
|
|
25
|
-
} from '@wordpress/data';
|
|
26
|
-
import { compose, pure, ifCondition } from '@wordpress/compose';
|
|
23
|
+
import { withDispatch, useDispatch, useSelect } from '@wordpress/data';
|
|
24
|
+
import { compose, pure } from '@wordpress/compose';
|
|
27
25
|
import { safeHTML } from '@wordpress/dom';
|
|
28
26
|
|
|
29
27
|
/**
|
|
@@ -37,7 +35,9 @@ import BlockHtml from './block-html';
|
|
|
37
35
|
import { useBlockProps } from './use-block-props';
|
|
38
36
|
import { store as blockEditorStore } from '../../store';
|
|
39
37
|
import { useLayout } from './layout';
|
|
40
|
-
import {
|
|
38
|
+
import { PrivateBlockContext } from './private-block-context';
|
|
39
|
+
|
|
40
|
+
import { unlock } from '../../lock-unlock';
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Merges wrapper props with special handling for classNames and styles.
|
|
@@ -53,10 +53,18 @@ function mergeWrapperProps( propsA, propsB ) {
|
|
|
53
53
|
...propsB,
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
// May be set to undefined, so check if the property is set!
|
|
57
|
+
if (
|
|
58
|
+
propsA?.hasOwnProperty( 'className' ) &&
|
|
59
|
+
propsB?.hasOwnProperty( 'className' )
|
|
60
|
+
) {
|
|
57
61
|
newProps.className = classnames( propsA.className, propsB.className );
|
|
58
62
|
}
|
|
59
|
-
|
|
63
|
+
|
|
64
|
+
if (
|
|
65
|
+
propsA?.hasOwnProperty( 'style' ) &&
|
|
66
|
+
propsB?.hasOwnProperty( 'style' )
|
|
67
|
+
) {
|
|
60
68
|
newProps.style = { ...propsA.style, ...propsB.style };
|
|
61
69
|
}
|
|
62
70
|
|
|
@@ -92,25 +100,11 @@ function BlockListBlock( {
|
|
|
92
100
|
toggleSelection,
|
|
93
101
|
} ) {
|
|
94
102
|
const {
|
|
103
|
+
mayDisplayControls,
|
|
104
|
+
mayDisplayParentControls,
|
|
95
105
|
themeSupportsLayout,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
} = useSelect(
|
|
99
|
-
( select ) => {
|
|
100
|
-
const {
|
|
101
|
-
getSettings,
|
|
102
|
-
__unstableGetTemporarilyEditingAsBlocks,
|
|
103
|
-
getBlockEditingMode,
|
|
104
|
-
} = select( blockEditorStore );
|
|
105
|
-
return {
|
|
106
|
-
themeSupportsLayout: getSettings().supportsLayout,
|
|
107
|
-
isTemporarilyEditingAsBlocks:
|
|
108
|
-
__unstableGetTemporarilyEditingAsBlocks() === clientId,
|
|
109
|
-
blockEditingMode: getBlockEditingMode( clientId ),
|
|
110
|
-
};
|
|
111
|
-
},
|
|
112
|
-
[ clientId ]
|
|
113
|
-
);
|
|
106
|
+
...context
|
|
107
|
+
} = useContext( PrivateBlockContext );
|
|
114
108
|
const { removeBlock } = useDispatch( blockEditorStore );
|
|
115
109
|
const onRemove = useCallback( () => removeBlock( clientId ), [ clientId ] );
|
|
116
110
|
|
|
@@ -137,17 +131,13 @@ function BlockListBlock( {
|
|
|
137
131
|
__unstableParentLayout={
|
|
138
132
|
Object.keys( parentLayout ).length ? parentLayout : undefined
|
|
139
133
|
}
|
|
134
|
+
mayDisplayControls={ mayDisplayControls }
|
|
135
|
+
mayDisplayParentControls={ mayDisplayParentControls }
|
|
140
136
|
/>
|
|
141
137
|
);
|
|
142
138
|
|
|
143
139
|
const blockType = getBlockType( name );
|
|
144
140
|
|
|
145
|
-
if ( blockEditingMode === 'disabled' ) {
|
|
146
|
-
wrapperProps = {
|
|
147
|
-
...wrapperProps,
|
|
148
|
-
tabIndex: -1,
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
141
|
// Determine whether the block has props to apply to the wrapper.
|
|
152
142
|
if ( blockType?.getEditWrapperProps ) {
|
|
153
143
|
wrapperProps = mergeWrapperProps(
|
|
@@ -161,6 +151,10 @@ function BlockListBlock( {
|
|
|
161
151
|
!! wrapperProps[ 'data-align' ] &&
|
|
162
152
|
! themeSupportsLayout;
|
|
163
153
|
|
|
154
|
+
// Support for sticky position in classic themes with alignment wrappers.
|
|
155
|
+
|
|
156
|
+
const isSticky = className?.includes( 'is-position-sticky' );
|
|
157
|
+
|
|
164
158
|
// For aligned blocks, provide a wrapper element so the block can be
|
|
165
159
|
// positioned relative to the block column.
|
|
166
160
|
// This is only kept for classic themes that don't support layout
|
|
@@ -172,7 +166,7 @@ function BlockListBlock( {
|
|
|
172
166
|
if ( isAligned ) {
|
|
173
167
|
blockEdit = (
|
|
174
168
|
<div
|
|
175
|
-
className=
|
|
169
|
+
className={ classnames( 'wp-block', isSticky && className ) }
|
|
176
170
|
data-align={ wrapperProps[ 'data-align' ] }
|
|
177
171
|
>
|
|
178
172
|
{ blockEdit }
|
|
@@ -207,30 +201,28 @@ function BlockListBlock( {
|
|
|
207
201
|
} else if ( blockType?.apiVersion > 1 ) {
|
|
208
202
|
block = blockEdit;
|
|
209
203
|
} else {
|
|
210
|
-
block = <Block
|
|
204
|
+
block = <Block>{ blockEdit }</Block>;
|
|
211
205
|
}
|
|
212
206
|
|
|
213
207
|
const { 'data-align': dataAlign, ...restWrapperProps } = wrapperProps ?? {};
|
|
214
208
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
'is-content-locked-temporarily-editing-as-blocks':
|
|
221
|
-
isTemporarilyEditingAsBlocks,
|
|
222
|
-
},
|
|
223
|
-
dataAlign && themeSupportsLayout && `align${ dataAlign }`,
|
|
224
|
-
className
|
|
225
|
-
),
|
|
226
|
-
wrapperProps: restWrapperProps,
|
|
227
|
-
isAligned,
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
const memoizedValue = useMemo( () => value, Object.values( value ) );
|
|
209
|
+
restWrapperProps.className = classnames(
|
|
210
|
+
restWrapperProps.className,
|
|
211
|
+
dataAlign && themeSupportsLayout && `align${ dataAlign }`,
|
|
212
|
+
! ( dataAlign && isSticky ) && className
|
|
213
|
+
);
|
|
231
214
|
|
|
215
|
+
// We set a new context with the adjusted and filtered wrapperProps (through
|
|
216
|
+
// `editor.BlockListBlock`), which the `BlockListBlockProvider` did not have
|
|
217
|
+
// access to.
|
|
232
218
|
return (
|
|
233
|
-
<
|
|
219
|
+
<PrivateBlockContext.Provider
|
|
220
|
+
value={ {
|
|
221
|
+
wrapperProps: restWrapperProps,
|
|
222
|
+
isAligned,
|
|
223
|
+
...context,
|
|
224
|
+
} }
|
|
225
|
+
>
|
|
234
226
|
<BlockCrashBoundary
|
|
235
227
|
fallback={
|
|
236
228
|
<Block className="has-warning">
|
|
@@ -240,52 +232,10 @@ function BlockListBlock( {
|
|
|
240
232
|
>
|
|
241
233
|
{ block }
|
|
242
234
|
</BlockCrashBoundary>
|
|
243
|
-
</
|
|
235
|
+
</PrivateBlockContext.Provider>
|
|
244
236
|
);
|
|
245
237
|
}
|
|
246
238
|
|
|
247
|
-
const applyWithSelect = withSelect( ( select, { clientId, rootClientId } ) => {
|
|
248
|
-
const {
|
|
249
|
-
isBlockSelected,
|
|
250
|
-
getBlockMode,
|
|
251
|
-
isSelectionEnabled,
|
|
252
|
-
getTemplateLock,
|
|
253
|
-
__unstableGetBlockWithoutInnerBlocks,
|
|
254
|
-
canRemoveBlock,
|
|
255
|
-
canMoveBlock,
|
|
256
|
-
} = select( blockEditorStore );
|
|
257
|
-
const block = __unstableGetBlockWithoutInnerBlocks( clientId );
|
|
258
|
-
const isSelected = isBlockSelected( clientId );
|
|
259
|
-
const templateLock = getTemplateLock( rootClientId );
|
|
260
|
-
const canRemove = canRemoveBlock( clientId, rootClientId );
|
|
261
|
-
const canMove = canMoveBlock( clientId, rootClientId );
|
|
262
|
-
|
|
263
|
-
// The fallback to `{}` is a temporary fix.
|
|
264
|
-
// This function should never be called when a block is not present in
|
|
265
|
-
// the state. It happens now because the order in withSelect rendering
|
|
266
|
-
// is not correct.
|
|
267
|
-
const { name, attributes, isValid } = block || {};
|
|
268
|
-
|
|
269
|
-
// Do not add new properties here, use `useSelect` instead to avoid
|
|
270
|
-
// leaking new props to the public API (editor.BlockListBlock filter).
|
|
271
|
-
return {
|
|
272
|
-
mode: getBlockMode( clientId ),
|
|
273
|
-
isSelectionEnabled: isSelectionEnabled(),
|
|
274
|
-
isLocked: !! templateLock,
|
|
275
|
-
canRemove,
|
|
276
|
-
canMove,
|
|
277
|
-
// Users of the editor.BlockListBlock filter used to be able to
|
|
278
|
-
// access the block prop.
|
|
279
|
-
// Ideally these blocks would rely on the clientId prop only.
|
|
280
|
-
// This is kept for backward compatibility reasons.
|
|
281
|
-
block,
|
|
282
|
-
name,
|
|
283
|
-
attributes,
|
|
284
|
-
isValid,
|
|
285
|
-
isSelected,
|
|
286
|
-
};
|
|
287
|
-
} );
|
|
288
|
-
|
|
289
239
|
const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
|
|
290
240
|
const {
|
|
291
241
|
updateBlockAttributes,
|
|
@@ -524,13 +474,268 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
|
|
|
524
474
|
};
|
|
525
475
|
} );
|
|
526
476
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
477
|
+
// This component is used by the BlockListBlockProvider component below. It will
|
|
478
|
+
// add the props necessary for the `editor.BlockListBlock` filters.
|
|
479
|
+
BlockListBlock = compose(
|
|
530
480
|
applyWithDispatch,
|
|
531
|
-
// Block is sometimes not mounted at the right time, causing it be undefined
|
|
532
|
-
// see issue for more info
|
|
533
|
-
// https://github.com/WordPress/gutenberg/issues/17013
|
|
534
|
-
ifCondition( ( { block } ) => !! block ),
|
|
535
481
|
withFilters( 'editor.BlockListBlock' )
|
|
536
482
|
)( BlockListBlock );
|
|
483
|
+
|
|
484
|
+
// This component provides all the information we need through a single store
|
|
485
|
+
// subscription (useSelect mapping). Only the necesssary props are passed down
|
|
486
|
+
// to the BlockListBlock component, which is a filtered component, so these
|
|
487
|
+
// props are public API. To avoid adding to the public API, we use a private
|
|
488
|
+
// context to pass the rest of the information to the filtered BlockListBlock
|
|
489
|
+
// component, and useBlockProps.
|
|
490
|
+
function BlockListBlockProvider( props ) {
|
|
491
|
+
const { clientId, rootClientId } = props;
|
|
492
|
+
const selectedProps = useSelect(
|
|
493
|
+
( select ) => {
|
|
494
|
+
const {
|
|
495
|
+
isBlockSelected,
|
|
496
|
+
getBlockMode,
|
|
497
|
+
isSelectionEnabled,
|
|
498
|
+
getTemplateLock,
|
|
499
|
+
__unstableGetBlockWithoutInnerBlocks,
|
|
500
|
+
canRemoveBlock,
|
|
501
|
+
canMoveBlock,
|
|
502
|
+
|
|
503
|
+
getSettings,
|
|
504
|
+
__unstableGetTemporarilyEditingAsBlocks,
|
|
505
|
+
getBlockEditingMode,
|
|
506
|
+
getBlockName,
|
|
507
|
+
isFirstMultiSelectedBlock,
|
|
508
|
+
getMultiSelectedBlockClientIds,
|
|
509
|
+
hasSelectedInnerBlock,
|
|
510
|
+
|
|
511
|
+
getBlockIndex,
|
|
512
|
+
isTyping,
|
|
513
|
+
isBlockMultiSelected,
|
|
514
|
+
isBlockSubtreeDisabled,
|
|
515
|
+
isBlockHighlighted,
|
|
516
|
+
__unstableIsFullySelected,
|
|
517
|
+
__unstableSelectionHasUnmergeableBlock,
|
|
518
|
+
isBlockBeingDragged,
|
|
519
|
+
hasBlockMovingClientId,
|
|
520
|
+
canInsertBlockType,
|
|
521
|
+
getBlockRootClientId,
|
|
522
|
+
__unstableHasActiveBlockOverlayActive,
|
|
523
|
+
__unstableGetEditorMode,
|
|
524
|
+
getSelectedBlocksInitialCaretPosition,
|
|
525
|
+
} = unlock( select( blockEditorStore ) );
|
|
526
|
+
const block = __unstableGetBlockWithoutInnerBlocks( clientId );
|
|
527
|
+
|
|
528
|
+
// This is a temporary fix.
|
|
529
|
+
// This function should never be called when a block is not
|
|
530
|
+
// present in the state. It happens now because the order in
|
|
531
|
+
// withSelect rendering is not correct.
|
|
532
|
+
if ( ! block ) {
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
const {
|
|
537
|
+
hasBlockSupport: _hasBlockSupport,
|
|
538
|
+
getActiveBlockVariation,
|
|
539
|
+
} = select( blocksStore );
|
|
540
|
+
const _isSelected = isBlockSelected( clientId );
|
|
541
|
+
const templateLock = getTemplateLock( rootClientId );
|
|
542
|
+
const canRemove = canRemoveBlock( clientId, rootClientId );
|
|
543
|
+
const canMove = canMoveBlock( clientId, rootClientId );
|
|
544
|
+
const { name: blockName, attributes, isValid } = block;
|
|
545
|
+
const blockType = getBlockType( blockName );
|
|
546
|
+
const match = getActiveBlockVariation( blockName, attributes );
|
|
547
|
+
const { outlineMode, supportsLayout } = getSettings();
|
|
548
|
+
const isMultiSelected = isBlockMultiSelected( clientId );
|
|
549
|
+
const checkDeep = true;
|
|
550
|
+
const isAncestorOfSelectedBlock = hasSelectedInnerBlock(
|
|
551
|
+
clientId,
|
|
552
|
+
checkDeep
|
|
553
|
+
);
|
|
554
|
+
const typing = isTyping();
|
|
555
|
+
const hasLightBlockWrapper = blockType?.apiVersion > 1;
|
|
556
|
+
const movingClientId = hasBlockMovingClientId();
|
|
557
|
+
|
|
558
|
+
return {
|
|
559
|
+
mode: getBlockMode( clientId ),
|
|
560
|
+
isSelectionEnabled: isSelectionEnabled(),
|
|
561
|
+
isLocked: !! templateLock,
|
|
562
|
+
canRemove,
|
|
563
|
+
canMove,
|
|
564
|
+
// Users of the editor.BlockListBlock filter used to be able to
|
|
565
|
+
// access the block prop.
|
|
566
|
+
// Ideally these blocks would rely on the clientId prop only.
|
|
567
|
+
// This is kept for backward compatibility reasons.
|
|
568
|
+
block,
|
|
569
|
+
name: blockName,
|
|
570
|
+
attributes,
|
|
571
|
+
isValid,
|
|
572
|
+
isSelected: _isSelected,
|
|
573
|
+
themeSupportsLayout: supportsLayout,
|
|
574
|
+
isTemporarilyEditingAsBlocks:
|
|
575
|
+
__unstableGetTemporarilyEditingAsBlocks() === clientId,
|
|
576
|
+
blockEditingMode: getBlockEditingMode( clientId ),
|
|
577
|
+
mayDisplayControls:
|
|
578
|
+
_isSelected ||
|
|
579
|
+
( isFirstMultiSelectedBlock( clientId ) &&
|
|
580
|
+
getMultiSelectedBlockClientIds().every(
|
|
581
|
+
( id ) => getBlockName( id ) === blockName
|
|
582
|
+
) ),
|
|
583
|
+
mayDisplayParentControls:
|
|
584
|
+
_hasBlockSupport(
|
|
585
|
+
getBlockName( clientId ),
|
|
586
|
+
'__experimentalExposeControlsToChildren',
|
|
587
|
+
false
|
|
588
|
+
) && hasSelectedInnerBlock( clientId ),
|
|
589
|
+
index: getBlockIndex( clientId ),
|
|
590
|
+
blockApiVersion: blockType?.apiVersion || 1,
|
|
591
|
+
blockTitle: match?.title || blockType?.title,
|
|
592
|
+
isSubtreeDisabled: isBlockSubtreeDisabled( clientId ),
|
|
593
|
+
isOutlineEnabled: outlineMode,
|
|
594
|
+
hasOverlay: __unstableHasActiveBlockOverlayActive( clientId ),
|
|
595
|
+
initialPosition:
|
|
596
|
+
_isSelected && __unstableGetEditorMode() === 'edit'
|
|
597
|
+
? getSelectedBlocksInitialCaretPosition()
|
|
598
|
+
: undefined,
|
|
599
|
+
isHighlighted: isBlockHighlighted( clientId ),
|
|
600
|
+
isMultiSelected,
|
|
601
|
+
isPartiallySelected:
|
|
602
|
+
isMultiSelected &&
|
|
603
|
+
! __unstableIsFullySelected() &&
|
|
604
|
+
! __unstableSelectionHasUnmergeableBlock(),
|
|
605
|
+
isReusable: isReusableBlock( blockType ),
|
|
606
|
+
isDragging: isBlockBeingDragged( clientId ),
|
|
607
|
+
hasChildSelected: isAncestorOfSelectedBlock,
|
|
608
|
+
removeOutline: _isSelected && outlineMode && typing,
|
|
609
|
+
isBlockMovingMode: !! movingClientId,
|
|
610
|
+
canInsertMovingBlock:
|
|
611
|
+
movingClientId &&
|
|
612
|
+
canInsertBlockType(
|
|
613
|
+
getBlockName( movingClientId ),
|
|
614
|
+
getBlockRootClientId( clientId )
|
|
615
|
+
),
|
|
616
|
+
isEditingDisabled:
|
|
617
|
+
getBlockEditingMode( clientId ) === 'disabled',
|
|
618
|
+
className: hasLightBlockWrapper
|
|
619
|
+
? attributes.className
|
|
620
|
+
: undefined,
|
|
621
|
+
defaultClassName: hasLightBlockWrapper
|
|
622
|
+
? getBlockDefaultClassName( blockName )
|
|
623
|
+
: undefined,
|
|
624
|
+
};
|
|
625
|
+
},
|
|
626
|
+
[ clientId, rootClientId ]
|
|
627
|
+
);
|
|
628
|
+
|
|
629
|
+
const {
|
|
630
|
+
mode,
|
|
631
|
+
isSelectionEnabled,
|
|
632
|
+
isLocked,
|
|
633
|
+
canRemove,
|
|
634
|
+
canMove,
|
|
635
|
+
block,
|
|
636
|
+
name,
|
|
637
|
+
attributes,
|
|
638
|
+
isValid,
|
|
639
|
+
isSelected,
|
|
640
|
+
themeSupportsLayout,
|
|
641
|
+
isTemporarilyEditingAsBlocks,
|
|
642
|
+
blockEditingMode,
|
|
643
|
+
mayDisplayControls,
|
|
644
|
+
mayDisplayParentControls,
|
|
645
|
+
index,
|
|
646
|
+
blockApiVersion,
|
|
647
|
+
blockTitle,
|
|
648
|
+
isSubtreeDisabled,
|
|
649
|
+
isOutlineEnabled,
|
|
650
|
+
hasOverlay,
|
|
651
|
+
initialPosition,
|
|
652
|
+
isHighlighted,
|
|
653
|
+
isMultiSelected,
|
|
654
|
+
isPartiallySelected,
|
|
655
|
+
isReusable,
|
|
656
|
+
isDragging,
|
|
657
|
+
hasChildSelected,
|
|
658
|
+
removeOutline,
|
|
659
|
+
isBlockMovingMode,
|
|
660
|
+
canInsertMovingBlock,
|
|
661
|
+
isEditingDisabled,
|
|
662
|
+
className,
|
|
663
|
+
defaultClassName,
|
|
664
|
+
} = selectedProps;
|
|
665
|
+
|
|
666
|
+
// Block is sometimes not mounted at the right time, causing it be
|
|
667
|
+
// undefined see issue for more info
|
|
668
|
+
// https://github.com/WordPress/gutenberg/issues/17013
|
|
669
|
+
if ( ! selectedProps ) {
|
|
670
|
+
return null;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
const privateContext = {
|
|
674
|
+
clientId,
|
|
675
|
+
className,
|
|
676
|
+
index,
|
|
677
|
+
mode,
|
|
678
|
+
name,
|
|
679
|
+
blockApiVersion,
|
|
680
|
+
blockTitle,
|
|
681
|
+
isSelected,
|
|
682
|
+
isSubtreeDisabled,
|
|
683
|
+
isOutlineEnabled,
|
|
684
|
+
hasOverlay,
|
|
685
|
+
initialPosition,
|
|
686
|
+
blockEditingMode,
|
|
687
|
+
isHighlighted,
|
|
688
|
+
isMultiSelected,
|
|
689
|
+
isPartiallySelected,
|
|
690
|
+
isReusable,
|
|
691
|
+
isDragging,
|
|
692
|
+
hasChildSelected,
|
|
693
|
+
removeOutline,
|
|
694
|
+
isBlockMovingMode,
|
|
695
|
+
canInsertMovingBlock,
|
|
696
|
+
isEditingDisabled,
|
|
697
|
+
isTemporarilyEditingAsBlocks,
|
|
698
|
+
defaultClassName,
|
|
699
|
+
mayDisplayControls,
|
|
700
|
+
mayDisplayParentControls,
|
|
701
|
+
themeSupportsLayout,
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
// Here we separate between the props passed to BlockListBlock and any other
|
|
705
|
+
// information we selected for internal use. BlockListBlock is a filtered
|
|
706
|
+
// component and thus ALL the props are PUBLIC API.
|
|
707
|
+
|
|
708
|
+
// Note that the context value doesn't have to be memoized in this case
|
|
709
|
+
// because when it changes, this component will be re-rendered anyway, and
|
|
710
|
+
// none of the consumers (BlockListBlock and useBlockProps) are memoized or
|
|
711
|
+
// "pure". This is different from the public BlockEditContext, where
|
|
712
|
+
// consumers might be memoized or "pure".
|
|
713
|
+
return (
|
|
714
|
+
<PrivateBlockContext.Provider value={ privateContext }>
|
|
715
|
+
<BlockListBlock
|
|
716
|
+
{ ...props }
|
|
717
|
+
// WARNING: all the following props are public API (through the
|
|
718
|
+
// editor.BlockListBlock filter) and normally nothing new should
|
|
719
|
+
// be added to it.
|
|
720
|
+
{ ...{
|
|
721
|
+
mode,
|
|
722
|
+
isSelectionEnabled,
|
|
723
|
+
isLocked,
|
|
724
|
+
canRemove,
|
|
725
|
+
canMove,
|
|
726
|
+
// Users of the editor.BlockListBlock filter used to be able
|
|
727
|
+
// to access the block prop. Ideally these blocks would rely
|
|
728
|
+
// on the clientId prop only. This is kept for backward
|
|
729
|
+
// compatibility reasons.
|
|
730
|
+
block,
|
|
731
|
+
name,
|
|
732
|
+
attributes,
|
|
733
|
+
isValid,
|
|
734
|
+
isSelected,
|
|
735
|
+
} }
|
|
736
|
+
/>
|
|
737
|
+
</PrivateBlockContext.Provider>
|
|
738
|
+
);
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
export default pure( BlockListBlockProvider );
|
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { Pressable, View } from 'react-native';
|
|
5
|
+
import classnames from 'classnames';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* WordPress dependencies
|
|
8
9
|
*/
|
|
9
|
-
import { useCallback, useMemo, useState } from '@wordpress/element';
|
|
10
|
+
import { useCallback, useMemo, useState, useRef } from '@wordpress/element';
|
|
10
11
|
import {
|
|
11
12
|
GlobalStylesContext,
|
|
12
13
|
getMergedGlobalStyles,
|
|
13
14
|
useMobileGlobalStylesColors,
|
|
14
15
|
useGlobalStyles,
|
|
16
|
+
withFilters,
|
|
15
17
|
} from '@wordpress/components';
|
|
16
18
|
import {
|
|
17
19
|
__experimentalGetAccessibleBlockLabel as getAccessibleBlockLabel,
|
|
@@ -38,24 +40,41 @@ import BlockInvalidWarning from './block-invalid-warning';
|
|
|
38
40
|
import BlockOutline from './block-outline';
|
|
39
41
|
import { store as blockEditorStore } from '../../store';
|
|
40
42
|
import { useLayout } from './layout';
|
|
43
|
+
import useScrollUponInsertion from './use-scroll-upon-insertion';
|
|
41
44
|
import { useSettings } from '../use-settings';
|
|
42
45
|
|
|
43
46
|
const EMPTY_ARRAY = [];
|
|
44
47
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Merges wrapper props with special handling for classNames and styles.
|
|
50
|
+
*
|
|
51
|
+
* @param {Object} propsA
|
|
52
|
+
* @param {Object} propsB
|
|
53
|
+
*
|
|
54
|
+
* @return {Object} Merged props.
|
|
55
|
+
*/
|
|
56
|
+
function mergeWrapperProps( propsA, propsB ) {
|
|
57
|
+
const newProps = {
|
|
58
|
+
...propsA,
|
|
59
|
+
...propsB,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// May be set to undefined, so check if the property is set!
|
|
63
|
+
if (
|
|
64
|
+
propsA?.hasOwnProperty( 'className' ) &&
|
|
65
|
+
propsB?.hasOwnProperty( 'className' )
|
|
66
|
+
) {
|
|
67
|
+
newProps.className = classnames( propsA.className, propsB.className );
|
|
51
68
|
}
|
|
52
|
-
|
|
53
|
-
if (
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
69
|
+
|
|
70
|
+
if (
|
|
71
|
+
propsA?.hasOwnProperty( 'style' ) &&
|
|
72
|
+
propsB?.hasOwnProperty( 'style' )
|
|
73
|
+
) {
|
|
74
|
+
newProps.style = { ...propsA.style, ...propsB.style };
|
|
57
75
|
}
|
|
58
|
-
|
|
76
|
+
|
|
77
|
+
return newProps;
|
|
59
78
|
}
|
|
60
79
|
|
|
61
80
|
function BlockWrapper( {
|
|
@@ -85,6 +104,18 @@ function BlockWrapper( {
|
|
|
85
104
|
];
|
|
86
105
|
const accessible = ! ( isSelected || isDescendentBlockSelected );
|
|
87
106
|
|
|
107
|
+
const ref = useRef();
|
|
108
|
+
const [ isLayoutCalculated, setIsLayoutCalculated ] = useState();
|
|
109
|
+
useScrollUponInsertion( {
|
|
110
|
+
clientId,
|
|
111
|
+
isSelected,
|
|
112
|
+
isLayoutCalculated,
|
|
113
|
+
elementRef: ref,
|
|
114
|
+
} );
|
|
115
|
+
const onLayout = useCallback( () => {
|
|
116
|
+
setIsLayoutCalculated( true );
|
|
117
|
+
}, [] );
|
|
118
|
+
|
|
88
119
|
return (
|
|
89
120
|
<Pressable
|
|
90
121
|
accessibilityLabel={ accessibilityLabel }
|
|
@@ -93,6 +124,8 @@ function BlockWrapper( {
|
|
|
93
124
|
disabled={ ! isTouchable }
|
|
94
125
|
onPress={ onFocus }
|
|
95
126
|
style={ blockWrapperStyle }
|
|
127
|
+
ref={ ref }
|
|
128
|
+
onLayout={ onLayout }
|
|
96
129
|
>
|
|
97
130
|
<BlockOutline
|
|
98
131
|
blockCategory={ blockCategory }
|
|
@@ -136,6 +169,7 @@ function BlockListBlock( {
|
|
|
136
169
|
rootClientId,
|
|
137
170
|
setAttributes,
|
|
138
171
|
toggleSelection,
|
|
172
|
+
wrapperProps,
|
|
139
173
|
} ) {
|
|
140
174
|
const {
|
|
141
175
|
baseGlobalStyles,
|
|
@@ -148,6 +182,7 @@ function BlockListBlock( {
|
|
|
148
182
|
isDescendentBlockSelected,
|
|
149
183
|
isParentSelected,
|
|
150
184
|
order,
|
|
185
|
+
mayDisplayControls,
|
|
151
186
|
} = useSelect(
|
|
152
187
|
( select ) => {
|
|
153
188
|
const {
|
|
@@ -158,6 +193,9 @@ function BlockListBlock( {
|
|
|
158
193
|
getSelectedBlockClientId,
|
|
159
194
|
getSettings,
|
|
160
195
|
hasSelectedInnerBlock,
|
|
196
|
+
getBlockName,
|
|
197
|
+
isFirstMultiSelectedBlock,
|
|
198
|
+
getMultiSelectedBlockClientIds,
|
|
161
199
|
} = select( blockEditorStore );
|
|
162
200
|
const currentBlockType = getBlockType( name || 'core/missing' );
|
|
163
201
|
const currentBlockCategory = currentBlockType?.category;
|
|
@@ -205,6 +243,12 @@ function BlockListBlock( {
|
|
|
205
243
|
isDescendentBlockSelected: descendentBlockSelected,
|
|
206
244
|
isParentSelected: parentSelected,
|
|
207
245
|
order: blockOrder,
|
|
246
|
+
mayDisplayControls:
|
|
247
|
+
isSelected ||
|
|
248
|
+
( isFirstMultiSelectedBlock( clientId ) &&
|
|
249
|
+
getMultiSelectedBlockClientIds().every(
|
|
250
|
+
( id ) => getBlockName( id ) === name
|
|
251
|
+
) ),
|
|
208
252
|
};
|
|
209
253
|
},
|
|
210
254
|
[ clientId, isSelected, name, rootClientId ]
|
|
@@ -242,18 +286,20 @@ function BlockListBlock( {
|
|
|
242
286
|
[ blockWidth, setBlockWidth ]
|
|
243
287
|
);
|
|
244
288
|
|
|
245
|
-
//
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
289
|
+
// Determine whether the block has props to apply to the wrapper.
|
|
290
|
+
if ( blockType?.getEditWrapperProps ) {
|
|
291
|
+
wrapperProps = mergeWrapperProps(
|
|
292
|
+
wrapperProps,
|
|
293
|
+
blockType.getEditWrapperProps( attributes )
|
|
294
|
+
);
|
|
295
|
+
}
|
|
250
296
|
|
|
251
297
|
// Inherited styles merged with block level styles.
|
|
252
298
|
const mergedStyle = useMemo( () => {
|
|
253
299
|
return getMergedGlobalStyles(
|
|
254
300
|
baseGlobalStyles,
|
|
255
301
|
globalStyle,
|
|
256
|
-
wrapperProps
|
|
302
|
+
wrapperProps?.style,
|
|
257
303
|
attributes,
|
|
258
304
|
defaultColors,
|
|
259
305
|
name,
|
|
@@ -271,7 +317,7 @@ function BlockListBlock( {
|
|
|
271
317
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
272
318
|
JSON.stringify( globalStyle ),
|
|
273
319
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
274
|
-
JSON.stringify( wrapperProps
|
|
320
|
+
JSON.stringify( wrapperProps?.style ),
|
|
275
321
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
276
322
|
JSON.stringify(
|
|
277
323
|
Object.fromEntries(
|
|
@@ -346,6 +392,7 @@ function BlockListBlock( {
|
|
|
346
392
|
: undefined
|
|
347
393
|
}
|
|
348
394
|
wrapperProps={ wrapperProps }
|
|
395
|
+
mayDisplayControls={ mayDisplayControls }
|
|
349
396
|
/>
|
|
350
397
|
<View onLayout={ onLayout } />
|
|
351
398
|
</GlobalStylesContext.Provider>
|
|
@@ -637,5 +684,6 @@ export default compose(
|
|
|
637
684
|
// Block is sometimes not mounted at the right time, causing it be undefined
|
|
638
685
|
// see issue for more info
|
|
639
686
|
// https://github.com/WordPress/gutenberg/issues/17013
|
|
640
|
-
ifCondition( ( { block } ) => !! block )
|
|
687
|
+
ifCondition( ( { block } ) => !! block ),
|
|
688
|
+
withFilters( 'editor.BlockListBlock' )
|
|
641
689
|
)( BlockListBlock );
|