@wordpress/block-editor 12.14.0 → 12.16.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 +10 -5
- package/build/components/block-canvas/index.js +22 -6
- package/build/components/block-canvas/index.js.map +1 -1
- package/build/components/block-card/index.js +1 -1
- 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-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-info-slot-fill/index.js +3 -4
- package/build/components/block-info-slot-fill/index.js.map +1 -1
- package/build/components/block-list/block.js +28 -9
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +16 -5
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +61 -18
- 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-parent-selector/index.js +1 -1
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +25 -16
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +4 -2
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-patterns-list/index.js +37 -20
- 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/index.js +28 -0
- package/build/components/block-rename/index.js.map +1 -0
- package/build/components/block-rename/is-empty-string.js +10 -0
- package/build/components/block-rename/is-empty-string.js.map +1 -0
- package/build/components/block-rename/modal.js +90 -0
- package/build/components/block-rename/modal.js.map +1 -0
- package/build/components/block-rename/rename-control.js +74 -0
- package/build/components/block-rename/rename-control.js.map +1 -0
- package/build/components/block-rename/use-block-rename.js +17 -0
- package/build/components/block-rename/use-block-rename.js.map +1 -0
- 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-settings-menu/block-settings-dropdown.js +33 -20
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +7 -0
- package/build/components/block-settings-menu-controls/index.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-toolbar/block-toolbar-menu.native.js +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build/components/block-toolbar/index.js +89 -27
- 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 +86 -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.js +6 -2
- package/build/components/block-types-list/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/colors-gradients/control.js +28 -17
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/date-format-picker/index.js +8 -1
- package/build/components/date-format-picker/index.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/global-styles/advanced-panel.js +1 -1
- package/build/components/global-styles/advanced-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +22 -20
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +9 -3
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +20 -31
- package/build/components/global-styles/typography-panel.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 +0 -5
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/index.native.js +8 -0
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/index.js +3 -1
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/warning-max-depth-exceeded.native.js +29 -31
- package/build/components/inner-blocks/warning-max-depth-exceeded.native.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 +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/utils.js +3 -4
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +2 -1
- package/build/components/inserter/hooks/use-patterns-state.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 +14 -7
- 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-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-listbox/index.js +11 -6
- package/build/components/inserter-listbox/index.js.map +1 -1
- package/build/components/inserter-listbox/item.js +24 -23
- package/build/components/inserter-listbox/item.js.map +1 -1
- package/build/components/inserter-listbox/row.js +5 -5
- package/build/components/inserter-listbox/row.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/list-view/use-list-view-expand-selected-item.js +2 -3
- package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +2 -2
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/preview-options/index.js +6 -60
- package/build/components/preview-options/index.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 +2 -30
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +10 -17
- 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 +41 -37
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/rich-text/use-input-rules.js +35 -2
- package/build/components/rich-text/use-input-rules.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/use-block-drop-zone/index.js +74 -9
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +2 -1
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +1 -1
- 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 +16 -2
- package/build/components/use-settings/index.js.map +1 -1
- package/build/hooks/align.js +20 -68
- 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 +13 -29
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/background.js +28 -31
- 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 +38 -0
- package/build/hooks/block-renaming.js.map +1 -1
- package/build/hooks/border.js +58 -80
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +76 -89
- 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 +12 -29
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/custom-fields.js +64 -73
- package/build/hooks/custom-fields.js.map +1 -1
- package/build/hooks/dimensions.js +21 -17
- 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 +16 -25
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +51 -119
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/index.js +25 -15
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +10 -3
- 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 +29 -108
- 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 +51 -88
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/typography.js +34 -14
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/utils.js +154 -7
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +4 -3
- package/build/layouts/constrained.js.map +1 -1
- package/build/private-apis.js +0 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/private-actions.js +8 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +34 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +8 -0
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +10 -58
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +66 -0
- package/build/store/utils.js.map +1 -0
- package/build/utils/object.js +21 -61
- 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/transform-styles/index.js +26 -6
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-canvas/index.js +23 -7
- package/build-module/components/block-canvas/index.js.map +1 -1
- package/build-module/components/block-card/index.js +1 -1
- 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-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-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-list/block.js +29 -10
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +16 -5
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +62 -19
- 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-parent-selector/index.js +1 -1
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +24 -15
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +4 -2
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +37 -20
- 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/index.js +4 -0
- package/build-module/components/block-rename/index.js.map +1 -0
- package/build-module/components/block-rename/is-empty-string.js +4 -0
- package/build-module/components/block-rename/is-empty-string.js.map +1 -0
- package/build-module/components/block-rename/modal.js +82 -0
- package/build-module/components/block-rename/modal.js.map +1 -0
- package/build-module/components/block-rename/rename-control.js +66 -0
- package/build-module/components/block-rename/rename-control.js.map +1 -0
- package/build-module/components/block-rename/use-block-rename.js +10 -0
- package/build-module/components/block-rename/use-block-rename.js.map +1 -0
- 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-settings-menu/block-settings-dropdown.js +34 -21
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +7 -0
- package/build-module/components/block-settings-menu-controls/index.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-toolbar/block-toolbar-menu.native.js +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +88 -25
- 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 +76 -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.js +6 -2
- package/build-module/components/block-types-list/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/colors-gradients/control.js +29 -18
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +8 -1
- package/build-module/components/date-format-picker/index.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/global-styles/advanced-panel.js +1 -1
- package/build-module/components/global-styles/advanced-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +23 -21
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +10 -4
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +20 -31
- package/build-module/components/global-styles/typography-panel.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 +0 -5
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/index.native.js +1 -0
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +3 -1
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js +30 -32
- package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.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 +4 -4
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +2 -2
- 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 +3 -4
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +2 -1
- package/build-module/components/inserter/hooks/use-patterns-state.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 +14 -7
- 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-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-listbox/index.js +13 -8
- package/build-module/components/inserter-listbox/index.js.map +1 -1
- package/build-module/components/inserter-listbox/item.js +25 -23
- package/build-module/components/inserter-listbox/item.js.map +1 -1
- package/build-module/components/inserter-listbox/row.js +6 -5
- package/build-module/components/inserter-listbox/row.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/list-view/use-list-view-expand-selected-item.js +2 -3
- package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +2 -2
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/preview-options/index.js +6 -60
- package/build-module/components/preview-options/index.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 +4 -32
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +11 -19
- 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 +41 -37
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/rich-text/use-input-rules.js +36 -3
- package/build-module/components/rich-text/use-input-rules.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/use-block-drop-zone/index.js +73 -9
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +2 -1
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +1 -1
- 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 +15 -3
- package/build-module/components/use-settings/index.js.map +1 -1
- package/build-module/hooks/align.js +19 -66
- 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 +11 -26
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/background.js +26 -28
- 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 +36 -0
- package/build-module/hooks/block-renaming.js.map +1 -1
- package/build-module/hooks/border.js +57 -78
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +74 -86
- 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 +11 -27
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/custom-fields.js +60 -74
- package/build-module/hooks/custom-fields.js.map +1 -1
- package/build-module/hooks/dimensions.js +21 -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 +14 -23
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +49 -119
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/index.js +18 -15
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +5 -3
- 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 +26 -105
- 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 +51 -84
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/typography.js +33 -12
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/utils.js +149 -6
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +4 -3
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/private-apis.js +0 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/private-actions.js +7 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +33 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +8 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +3 -51
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +56 -0
- package/build-module/store/utils.js.map +1 -0
- package/build-module/utils/object.js +21 -60
- 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/transform-styles/index.js +24 -7
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +6 -6
- package/build-style/content.css +6 -6
- package/build-style/style-rtl.css +123 -298
- package/build-style/style.css +123 -298
- package/package.json +31 -31
- package/src/components/block-canvas/index.js +31 -17
- package/src/components/block-caption/README.md +2 -2
- package/src/components/block-card/index.js +5 -3
- 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-edit/context.js +3 -0
- package/src/components/block-edit/index.js +36 -10
- package/src/components/block-info-slot-fill/index.js +6 -3
- package/src/components/block-inspector/style.scss +0 -4
- package/src/components/block-list/block.js +39 -5
- package/src/components/block-list/block.native.js +20 -4
- package/src/components/block-list/use-block-props/index.js +74 -21
- 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-parent-selector/index.js +1 -1
- package/src/components/block-pattern-setup/index.js +38 -22
- package/src/components/block-pattern-setup/setup-toolbar.js +2 -0
- package/src/components/block-pattern-setup/style.scss +4 -1
- package/src/components/block-patterns-list/README.md +4 -4
- package/src/components/block-patterns-list/index.js +61 -35
- package/src/components/block-patterns-list/style.scss +7 -0
- package/src/components/block-removal-warning-modal/index.js +7 -14
- package/src/components/block-rename/index.js +3 -0
- package/src/components/block-rename/is-empty-string.js +3 -0
- package/src/components/block-rename/modal.js +121 -0
- package/src/components/block-rename/rename-control.js +80 -0
- package/src/components/block-rename/use-block-rename.js +10 -0
- package/src/components/block-settings/container.native.js +3 -5
- package/src/components/block-settings-menu/block-settings-dropdown.js +38 -34
- package/src/components/block-settings-menu-controls/index.js +9 -0
- 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/test/__snapshots__/index.js.snap +3 -1
- package/src/components/block-toolbar/block-toolbar-menu.native.js +1 -4
- package/src/components/block-toolbar/index.js +180 -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 +90 -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/index.js +5 -4
- package/src/components/block-types-list/index.native.js +2 -1
- package/src/components/block-variation-picker/index.native.js +1 -1
- package/src/components/button-block-appender/content.scss +2 -2
- package/src/components/colors-gradients/control.js +49 -30
- package/src/components/colors-gradients/style.scss +0 -7
- package/src/components/date-format-picker/index.js +7 -0
- package/src/components/duotone-control/index.js +2 -5
- package/src/components/duotone-control/style.scss +1 -6
- package/src/components/editable-text/README.md +0 -36
- package/src/components/global-styles/advanced-panel.js +1 -1
- package/src/components/global-styles/color-panel.js +34 -25
- package/src/components/global-styles/filters-panel.js +8 -4
- package/src/components/global-styles/typography-panel.js +23 -43
- 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 +0 -6
- package/src/components/index.native.js +1 -0
- package/src/components/inner-blocks/README.md +13 -2
- package/src/components/inner-blocks/index.js +6 -2
- package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +57 -33
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +5 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +7 -3
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +6 -1
- package/src/components/inserter/block-patterns-tab/utils.js +6 -4
- package/src/components/inserter/hooks/use-patterns-state.js +3 -1
- package/src/components/inserter/media-tab/media-panel.js +1 -1
- package/src/components/inserter/menu.js +16 -8
- package/src/components/inserter/preview-panel.js +2 -2
- package/src/components/inserter/style.scss +15 -17
- 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-listbox/index.js +11 -7
- package/src/components/inserter-listbox/item.js +11 -12
- package/src/components/inserter-listbox/row.js +6 -12
- package/src/components/inspector-controls/fill.js +6 -3
- package/src/components/inspector-controls/fill.native.js +6 -3
- package/src/components/link-control/style.scss +1 -1
- package/src/components/link-control/test/index.js +1 -1
- package/src/components/list-view/use-list-view-expand-selected-item.js +7 -8
- package/src/components/navigable-toolbar/README.md +2 -0
- package/src/components/navigable-toolbar/index.js +2 -2
- package/src/components/plain-text/README.md +0 -28
- package/src/components/preview-options/index.js +6 -84
- package/src/components/rich-text/README.md +0 -58
- 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 +5 -46
- package/src/components/rich-text/index.native.js +9 -26
- package/src/components/rich-text/native/get-format-colors.native.js +33 -40
- package/src/components/rich-text/native/index.native.js +52 -50
- package/src/components/rich-text/use-input-rules.js +36 -3
- 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/url-input/README.md +1 -74
- package/src/components/use-block-drop-zone/index.js +118 -15
- package/src/components/use-moving-animation/index.js +1 -1
- package/src/components/use-on-block-drop/index.js +2 -1
- package/src/components/use-resize-canvas/README.md +3 -3
- package/src/components/use-resize-canvas/index.js +4 -1
- package/src/components/use-settings/index.js +17 -3
- package/src/components/use-settings/test/index.js +1 -1
- package/src/hooks/align.js +15 -76
- package/src/hooks/align.native.js +1 -0
- package/src/hooks/anchor.js +13 -33
- package/src/hooks/background.js +28 -23
- package/src/hooks/block-hooks.js +22 -51
- package/src/hooks/block-renaming.js +33 -0
- package/src/hooks/border.js +67 -118
- package/src/hooks/color.js +100 -132
- package/src/hooks/content-lock-ui.js +110 -122
- package/src/hooks/custom-class-name.js +8 -40
- package/src/hooks/custom-fields.js +70 -94
- package/src/hooks/dimensions.js +20 -16
- package/src/hooks/duotone.js +70 -127
- package/src/hooks/font-family.js +10 -29
- package/src/hooks/font-size.js +66 -162
- package/src/hooks/index.js +42 -15
- package/src/hooks/index.native.js +6 -3
- package/src/hooks/layout-child.js +53 -0
- package/src/hooks/layout.js +25 -110
- package/src/hooks/padding.js +2 -2
- package/src/hooks/position.js +50 -90
- package/src/hooks/style.js +117 -187
- package/src/hooks/test/__snapshots__/align.native.js.snap +5 -5
- package/src/hooks/test/align.js +1 -178
- package/src/hooks/typography.js +20 -16
- package/src/hooks/utils.js +187 -6
- package/src/layouts/constrained.js +57 -50
- package/src/private-apis.js +0 -2
- package/src/store/private-actions.js +8 -0
- package/src/store/private-selectors.js +45 -0
- package/src/store/reducer.js +8 -0
- package/src/store/selectors.js +5 -67
- package/src/store/utils.js +74 -0
- package/src/style.scss +1 -3
- package/src/utils/object.js +18 -69
- package/src/utils/selection.js +9 -2
- package/src/utils/test/transform-styles.js +49 -0
- package/src/utils/transform-styles/index.js +39 -13
- 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/block-rename-ui.js +0 -167
- package/build/hooks/block-rename-ui.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/block-rename-ui.js +0 -159
- package/build-module/hooks/block-rename-ui.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/block-rename-ui.js +0 -228
- package/src/hooks/test/color.js +0 -112
- /package/src/{hooks/block-rename-ui.scss → components/block-rename/style.scss} +0 -0
|
@@ -36,41 +36,6 @@ This prop is passed directly to the `URLInput` component.
|
|
|
36
36
|
|
|
37
37
|
## Example
|
|
38
38
|
|
|
39
|
-
{% codetabs %}
|
|
40
|
-
{% ES5 %}
|
|
41
|
-
|
|
42
|
-
```js
|
|
43
|
-
wp.blocks.registerBlockType( /* ... */, {
|
|
44
|
-
// ...
|
|
45
|
-
|
|
46
|
-
attributes: {
|
|
47
|
-
url: {
|
|
48
|
-
type: 'string'
|
|
49
|
-
},
|
|
50
|
-
text: {
|
|
51
|
-
type: 'string'
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
edit: function( props ) {
|
|
56
|
-
return React.createElement( wp.blockEditor.URLInputButton, {
|
|
57
|
-
className: props.className,
|
|
58
|
-
url: props.attributes.url,
|
|
59
|
-
onChange: function( url, post ) {
|
|
60
|
-
props.setAttributes( { url: url, text: (post && post.title) || 'Click here' } );
|
|
61
|
-
}
|
|
62
|
-
} );
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
save: function( props ) {
|
|
66
|
-
return React.createElement( 'a', {
|
|
67
|
-
href: props.attributes.url,
|
|
68
|
-
}, props.attributes.text );
|
|
69
|
-
}
|
|
70
|
-
} );
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
{% ESNext %}
|
|
74
39
|
|
|
75
40
|
```js
|
|
76
41
|
import { registerBlockType } from '@wordpress/blocks';
|
|
@@ -103,7 +68,6 @@ registerBlockType( /* ... */, {
|
|
|
103
68
|
} );
|
|
104
69
|
```
|
|
105
70
|
|
|
106
|
-
{% end %}
|
|
107
71
|
|
|
108
72
|
# `URLInput`
|
|
109
73
|
|
|
@@ -139,7 +103,7 @@ _Required._ Called when the value changes. The second parameter is `null` unless
|
|
|
139
103
|
}
|
|
140
104
|
```
|
|
141
105
|
|
|
142
|
-
### `
|
|
106
|
+
### `onKeyDown`: `( event: KeyboardEvent ) => void`
|
|
143
107
|
|
|
144
108
|
A callback invoked on the keydown event.
|
|
145
109
|
|
|
@@ -172,41 +136,6 @@ Start opting into the new margin-free styles that will become the default in a f
|
|
|
172
136
|
|
|
173
137
|
## Example
|
|
174
138
|
|
|
175
|
-
{% codetabs %}
|
|
176
|
-
{% ES5 %}
|
|
177
|
-
|
|
178
|
-
```js
|
|
179
|
-
wp.blocks.registerBlockType( /* ... */, {
|
|
180
|
-
// ...
|
|
181
|
-
|
|
182
|
-
attributes: {
|
|
183
|
-
url: {
|
|
184
|
-
type: 'string'
|
|
185
|
-
},
|
|
186
|
-
text: {
|
|
187
|
-
type: 'string'
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
edit: function( props ) {
|
|
192
|
-
return React.createElement( wp.blockEditor.URLInput, {
|
|
193
|
-
className: props.className,
|
|
194
|
-
value: props.attributes.url,
|
|
195
|
-
onChange: function( url, post ) {
|
|
196
|
-
props.setAttributes( { url: url, text: (post && post.title) || 'Click here' } );
|
|
197
|
-
}
|
|
198
|
-
} );
|
|
199
|
-
},
|
|
200
|
-
|
|
201
|
-
save: function( props ) {
|
|
202
|
-
return React.createElement( 'a', {
|
|
203
|
-
href: props.attributes.url,
|
|
204
|
-
}, props.attributes.text );
|
|
205
|
-
}
|
|
206
|
-
} );
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
{% ESNext %}
|
|
210
139
|
|
|
211
140
|
```js
|
|
212
141
|
import { registerBlockType } from '@wordpress/blocks';
|
|
@@ -240,5 +169,3 @@ registerBlockType( /* ... */, {
|
|
|
240
169
|
}
|
|
241
170
|
} );
|
|
242
171
|
```
|
|
243
|
-
|
|
244
|
-
{% end %}
|
|
@@ -20,6 +20,10 @@ import {
|
|
|
20
20
|
} from '../../utils/math';
|
|
21
21
|
import { store as blockEditorStore } from '../../store';
|
|
22
22
|
|
|
23
|
+
const THRESHOLD_DISTANCE = 30;
|
|
24
|
+
const MINIMUM_HEIGHT_FOR_THRESHOLD = 120;
|
|
25
|
+
const MINIMUM_WIDTH_FOR_THRESHOLD = 120;
|
|
26
|
+
|
|
23
27
|
/** @typedef {import('../../utils/math').WPPoint} WPPoint */
|
|
24
28
|
/** @typedef {import('../use-on-block-drop/types').WPDropOperation} WPDropOperation */
|
|
25
29
|
|
|
@@ -48,24 +52,86 @@ import { store as blockEditorStore } from '../../store';
|
|
|
48
52
|
* @param {WPBlockData[]} blocksData The block data list.
|
|
49
53
|
* @param {WPPoint} position The position of the item being dragged.
|
|
50
54
|
* @param {WPBlockListOrientation} orientation The orientation of the block list.
|
|
55
|
+
* @param {Object} options Additional options.
|
|
51
56
|
* @return {[number, WPDropOperation]} The drop target position.
|
|
52
57
|
*/
|
|
53
58
|
export function getDropTargetPosition(
|
|
54
59
|
blocksData,
|
|
55
60
|
position,
|
|
56
|
-
orientation = 'vertical'
|
|
61
|
+
orientation = 'vertical',
|
|
62
|
+
options = {}
|
|
57
63
|
) {
|
|
58
64
|
const allowedEdges =
|
|
59
65
|
orientation === 'horizontal'
|
|
60
66
|
? [ 'left', 'right' ]
|
|
61
67
|
: [ 'top', 'bottom' ];
|
|
62
68
|
|
|
63
|
-
const isRightToLeft = isRTL();
|
|
64
|
-
|
|
65
69
|
let nearestIndex = 0;
|
|
66
70
|
let insertPosition = 'before';
|
|
67
71
|
let minDistance = Infinity;
|
|
68
72
|
|
|
73
|
+
const {
|
|
74
|
+
dropZoneElement,
|
|
75
|
+
parentBlockOrientation,
|
|
76
|
+
rootBlockIndex = 0,
|
|
77
|
+
} = options;
|
|
78
|
+
|
|
79
|
+
// Allow before/after when dragging over the top/bottom edges of the drop zone.
|
|
80
|
+
if ( dropZoneElement && parentBlockOrientation !== 'horizontal' ) {
|
|
81
|
+
const rect = dropZoneElement.getBoundingClientRect();
|
|
82
|
+
const [ distance, edge ] = getDistanceToNearestEdge( position, rect, [
|
|
83
|
+
'top',
|
|
84
|
+
'bottom',
|
|
85
|
+
] );
|
|
86
|
+
|
|
87
|
+
// If dragging over the top or bottom of the drop zone, insert the block
|
|
88
|
+
// before or after the parent block. This only applies to blocks that use
|
|
89
|
+
// a drop zone element, typically container blocks such as Group or Cover.
|
|
90
|
+
if (
|
|
91
|
+
rect.height > MINIMUM_HEIGHT_FOR_THRESHOLD &&
|
|
92
|
+
distance < THRESHOLD_DISTANCE
|
|
93
|
+
) {
|
|
94
|
+
if ( edge === 'top' ) {
|
|
95
|
+
return [ rootBlockIndex, 'before' ];
|
|
96
|
+
}
|
|
97
|
+
if ( edge === 'bottom' ) {
|
|
98
|
+
return [ rootBlockIndex + 1, 'after' ];
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const isRightToLeft = isRTL();
|
|
104
|
+
|
|
105
|
+
// Allow before/after when dragging over the left/right edges of the drop zone.
|
|
106
|
+
if ( dropZoneElement && parentBlockOrientation === 'horizontal' ) {
|
|
107
|
+
const rect = dropZoneElement.getBoundingClientRect();
|
|
108
|
+
const [ distance, edge ] = getDistanceToNearestEdge( position, rect, [
|
|
109
|
+
'left',
|
|
110
|
+
'right',
|
|
111
|
+
] );
|
|
112
|
+
|
|
113
|
+
// If dragging over the left or right of the drop zone, insert the block
|
|
114
|
+
// before or after the parent block. This only applies to blocks that use
|
|
115
|
+
// a drop zone element, typically container blocks such as Group.
|
|
116
|
+
if (
|
|
117
|
+
rect.width > MINIMUM_WIDTH_FOR_THRESHOLD &&
|
|
118
|
+
distance < THRESHOLD_DISTANCE
|
|
119
|
+
) {
|
|
120
|
+
if (
|
|
121
|
+
( isRightToLeft && edge === 'right' ) ||
|
|
122
|
+
( ! isRightToLeft && edge === 'left' )
|
|
123
|
+
) {
|
|
124
|
+
return [ rootBlockIndex, 'before' ];
|
|
125
|
+
}
|
|
126
|
+
if (
|
|
127
|
+
( isRightToLeft && edge === 'left' ) ||
|
|
128
|
+
( ! isRightToLeft && edge === 'right' )
|
|
129
|
+
) {
|
|
130
|
+
return [ rootBlockIndex + 1, 'after' ];
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
69
135
|
blocksData.forEach(
|
|
70
136
|
( { isUnmodifiedDefaultBlock, getBoundingClientRect, blockIndex } ) => {
|
|
71
137
|
const rect = getBoundingClientRect();
|
|
@@ -127,7 +193,8 @@ export function getDropTargetPosition(
|
|
|
127
193
|
|
|
128
194
|
/**
|
|
129
195
|
* @typedef {Object} WPBlockDropZoneConfig
|
|
130
|
-
* @property {
|
|
196
|
+
* @property {?HTMLElement} dropZoneElement Optional element to be used as the drop zone.
|
|
197
|
+
* @property {string} rootClientId The root client id for the block list.
|
|
131
198
|
*/
|
|
132
199
|
|
|
133
200
|
/**
|
|
@@ -136,6 +203,7 @@ export function getDropTargetPosition(
|
|
|
136
203
|
* @param {WPBlockDropZoneConfig} dropZoneConfig configuration data for the drop zone.
|
|
137
204
|
*/
|
|
138
205
|
export default function useBlockDropZone( {
|
|
206
|
+
dropZoneElement,
|
|
139
207
|
// An undefined value represents a top-level block. Default to an empty
|
|
140
208
|
// string for this so that `targetRootClientId` can be easily compared to
|
|
141
209
|
// values returned by the `getRootBlockClientId` selector, which also uses
|
|
@@ -148,19 +216,27 @@ export default function useBlockDropZone( {
|
|
|
148
216
|
operation: 'insert',
|
|
149
217
|
} );
|
|
150
218
|
|
|
151
|
-
const isDisabled = useSelect(
|
|
219
|
+
const { isDisabled, parentBlockClientId, rootBlockIndex } = useSelect(
|
|
152
220
|
( select ) => {
|
|
153
221
|
const {
|
|
154
222
|
__unstableIsWithinBlockOverlay,
|
|
155
223
|
__unstableHasActiveBlockOverlayActive,
|
|
224
|
+
getBlockIndex,
|
|
225
|
+
getBlockParents,
|
|
156
226
|
getBlockEditingMode,
|
|
157
227
|
} = select( blockEditorStore );
|
|
158
228
|
const blockEditingMode = getBlockEditingMode( targetRootClientId );
|
|
159
|
-
return
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
229
|
+
return {
|
|
230
|
+
parentBlockClientId:
|
|
231
|
+
getBlockParents( targetRootClientId, true )[ 0 ] || '',
|
|
232
|
+
rootBlockIndex: getBlockIndex( targetRootClientId ),
|
|
233
|
+
isDisabled:
|
|
234
|
+
blockEditingMode !== 'default' ||
|
|
235
|
+
__unstableHasActiveBlockOverlayActive(
|
|
236
|
+
targetRootClientId
|
|
237
|
+
) ||
|
|
238
|
+
__unstableIsWithinBlockOverlay( targetRootClientId ),
|
|
239
|
+
};
|
|
164
240
|
},
|
|
165
241
|
[ targetRootClientId ]
|
|
166
242
|
);
|
|
@@ -170,9 +246,15 @@ export default function useBlockDropZone( {
|
|
|
170
246
|
const { showInsertionPoint, hideInsertionPoint } =
|
|
171
247
|
useDispatch( blockEditorStore );
|
|
172
248
|
|
|
173
|
-
const onBlockDrop = useOnBlockDrop(
|
|
174
|
-
operation
|
|
175
|
-
|
|
249
|
+
const onBlockDrop = useOnBlockDrop(
|
|
250
|
+
dropTarget.operation === 'before' || dropTarget.operation === 'after'
|
|
251
|
+
? parentBlockClientId
|
|
252
|
+
: targetRootClientId,
|
|
253
|
+
dropTarget.index,
|
|
254
|
+
{
|
|
255
|
+
operation: dropTarget.operation,
|
|
256
|
+
}
|
|
257
|
+
);
|
|
176
258
|
const throttled = useThrottle(
|
|
177
259
|
useCallback(
|
|
178
260
|
( event, ownerDocument ) => {
|
|
@@ -209,7 +291,16 @@ export default function useBlockDropZone( {
|
|
|
209
291
|
const [ targetIndex, operation ] = getDropTargetPosition(
|
|
210
292
|
blocksData,
|
|
211
293
|
{ x: event.clientX, y: event.clientY },
|
|
212
|
-
getBlockListSettings( targetRootClientId )?.orientation
|
|
294
|
+
getBlockListSettings( targetRootClientId )?.orientation,
|
|
295
|
+
{
|
|
296
|
+
dropZoneElement,
|
|
297
|
+
parentBlockClientId,
|
|
298
|
+
parentBlockOrientation: parentBlockClientId
|
|
299
|
+
? getBlockListSettings( parentBlockClientId )
|
|
300
|
+
?.orientation
|
|
301
|
+
: undefined,
|
|
302
|
+
rootBlockIndex,
|
|
303
|
+
}
|
|
213
304
|
);
|
|
214
305
|
|
|
215
306
|
registry.batch( () => {
|
|
@@ -217,24 +308,36 @@ export default function useBlockDropZone( {
|
|
|
217
308
|
index: targetIndex,
|
|
218
309
|
operation,
|
|
219
310
|
} );
|
|
220
|
-
|
|
311
|
+
|
|
312
|
+
const insertionPointClientId = [
|
|
313
|
+
'before',
|
|
314
|
+
'after',
|
|
315
|
+
].includes( operation )
|
|
316
|
+
? parentBlockClientId
|
|
317
|
+
: targetRootClientId;
|
|
318
|
+
|
|
319
|
+
showInsertionPoint( insertionPointClientId, targetIndex, {
|
|
221
320
|
operation,
|
|
222
321
|
} );
|
|
223
322
|
} );
|
|
224
323
|
},
|
|
225
324
|
[
|
|
325
|
+
dropZoneElement,
|
|
226
326
|
getBlocks,
|
|
227
327
|
targetRootClientId,
|
|
228
328
|
getBlockListSettings,
|
|
229
329
|
registry,
|
|
230
330
|
showInsertionPoint,
|
|
231
331
|
getBlockIndex,
|
|
332
|
+
parentBlockClientId,
|
|
333
|
+
rootBlockIndex,
|
|
232
334
|
]
|
|
233
335
|
),
|
|
234
336
|
200
|
|
235
337
|
);
|
|
236
338
|
|
|
237
339
|
return useDropZone( {
|
|
340
|
+
dropZoneElement,
|
|
238
341
|
isDisabled,
|
|
239
342
|
onDrop: onBlockDrop,
|
|
240
343
|
onDragOver( event ) {
|
|
@@ -129,7 +129,7 @@ function useMovingAnimation( {
|
|
|
129
129
|
const finishedMoving = x === 0 && y === 0;
|
|
130
130
|
ref.current.style.transformOrigin = 'center center';
|
|
131
131
|
ref.current.style.transform = finishedMoving
|
|
132
|
-
?
|
|
132
|
+
? null // Set to `null` to explicitly remove the transform.
|
|
133
133
|
: `translate3d(${ x }px,${ y }px,0)`;
|
|
134
134
|
ref.current.style.zIndex = isSelected ? '1' : '';
|
|
135
135
|
|
|
@@ -292,9 +292,10 @@ export default function useOnBlockDrop(
|
|
|
292
292
|
operation,
|
|
293
293
|
getBlockOrder,
|
|
294
294
|
getBlocksByClientId,
|
|
295
|
-
insertBlocks,
|
|
296
295
|
moveBlocksToPosition,
|
|
296
|
+
registry,
|
|
297
297
|
removeBlocks,
|
|
298
|
+
replaceBlocks,
|
|
298
299
|
targetBlockIndex,
|
|
299
300
|
targetRootClientId,
|
|
300
301
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# useResizeCanvas
|
|
2
2
|
|
|
3
|
-
This React hook generates inline CSS suitable for resizing a container to fit a device's dimensions. It adjusts the CSS according to the current device dimensions.
|
|
3
|
+
This React hook generates inline CSS suitable for resizing a container to fit a device's dimensions. It adjusts the CSS according to the current device dimensions.
|
|
4
4
|
|
|
5
5
|
On-page CSS media queries are also updated to match the width of the device.
|
|
6
6
|
|
|
@@ -14,14 +14,14 @@ Note that this is currently experimental, and is available as `__experimentalUse
|
|
|
14
14
|
|
|
15
15
|
### Usage
|
|
16
16
|
|
|
17
|
-
The hook returns a style object which can be applied to a container. It is passed the current device type, which can be obtained from `
|
|
17
|
+
The hook returns a style object which can be applied to a container. It is passed the current device type, which can be obtained from `getDeviceType`.
|
|
18
18
|
|
|
19
19
|
```jsx
|
|
20
20
|
import { __experimentalUseResizeCanvas as useResizeCanvas } from '@wordpress/block-editor';
|
|
21
21
|
|
|
22
22
|
function ResizedContainer() {
|
|
23
23
|
const deviceType = useSelect( ( select ) => {
|
|
24
|
-
return select( 'core/
|
|
24
|
+
return select( 'core/editor' ).getDeviceType();
|
|
25
25
|
}, [] );
|
|
26
26
|
const inlineStyles = useResizeCanvas( deviceType );
|
|
27
27
|
|
|
@@ -103,7 +103,7 @@ const removeCustomPrefixes = ( path ) => {
|
|
|
103
103
|
* @param {Object} value Object to merge
|
|
104
104
|
* @return {Array} Array of merged items
|
|
105
105
|
*/
|
|
106
|
-
function mergeOrigins( value ) {
|
|
106
|
+
export function mergeOrigins( value ) {
|
|
107
107
|
let result = mergeCache.get( value );
|
|
108
108
|
if ( ! result ) {
|
|
109
109
|
result = [ 'default', 'theme', 'custom' ].flatMap(
|
|
@@ -115,6 +115,20 @@ function mergeOrigins( value ) {
|
|
|
115
115
|
}
|
|
116
116
|
const mergeCache = new WeakMap();
|
|
117
117
|
|
|
118
|
+
/**
|
|
119
|
+
* For settings like `color.palette`, which have a value that is an object
|
|
120
|
+
* with `default`, `theme`, `custom`, with field values that are arrays of
|
|
121
|
+
* items, see if any of the three origins have values.
|
|
122
|
+
*
|
|
123
|
+
* @param {Object} value Object to check
|
|
124
|
+
* @return {boolean} Whether the object has values in any of the three origins
|
|
125
|
+
*/
|
|
126
|
+
export function hasMergedOrigins( value ) {
|
|
127
|
+
return [ 'default', 'theme', 'custom' ].some(
|
|
128
|
+
( key ) => value?.[ key ]?.length
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
118
132
|
/**
|
|
119
133
|
* Hook that retrieves the given settings for the block instance in use.
|
|
120
134
|
*
|
|
@@ -254,7 +268,7 @@ export function useSettings( ...paths ) {
|
|
|
254
268
|
*
|
|
255
269
|
* @param {string} path The path to the setting.
|
|
256
270
|
* @return {any} Returns the value defined for the setting.
|
|
257
|
-
* @deprecated 6.
|
|
271
|
+
* @deprecated 6.5.0 Use useSettings instead.
|
|
258
272
|
* @example
|
|
259
273
|
* ```js
|
|
260
274
|
* const isEnabled = useSetting( 'typography.dropCap' );
|
|
@@ -262,7 +276,7 @@ export function useSettings( ...paths ) {
|
|
|
262
276
|
*/
|
|
263
277
|
export function useSetting( path ) {
|
|
264
278
|
deprecated( 'wp.blockEditor.useSetting', {
|
|
265
|
-
since: '6.
|
|
279
|
+
since: '6.5',
|
|
266
280
|
alternative: 'wp.blockEditor.useSettings',
|
|
267
281
|
note: 'The new useSettings function can retrieve multiple settings at once, with better performance.',
|
|
268
282
|
} );
|
|
@@ -135,7 +135,7 @@ describe( 'useSettings', () => {
|
|
|
135
135
|
const result = runHook( () => useSetting( 'layout.contentSize' ) );
|
|
136
136
|
expect( result ).toBe( '840px' );
|
|
137
137
|
expect( console ).toHaveWarnedWith(
|
|
138
|
-
'wp.blockEditor.useSetting is deprecated since version 6.
|
|
138
|
+
'wp.blockEditor.useSetting is deprecated since version 6.5. Please use wp.blockEditor.useSettings instead.'
|
|
139
139
|
);
|
|
140
140
|
} );
|
|
141
141
|
} );
|
package/src/hooks/align.js
CHANGED
|
@@ -6,7 +6,6 @@ import classnames from 'classnames';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { createHigherOrderComponent } from '@wordpress/compose';
|
|
10
9
|
import { addFilter } from '@wordpress/hooks';
|
|
11
10
|
import {
|
|
12
11
|
getBlockSupport,
|
|
@@ -108,9 +107,9 @@ export function addAttribute( settings ) {
|
|
|
108
107
|
return settings;
|
|
109
108
|
}
|
|
110
109
|
|
|
111
|
-
function
|
|
112
|
-
blockName,
|
|
113
|
-
|
|
110
|
+
function BlockEditAlignmentToolbarControlsPure( {
|
|
111
|
+
name: blockName,
|
|
112
|
+
align,
|
|
114
113
|
setAttributes,
|
|
115
114
|
} ) {
|
|
116
115
|
// Compute the block valid alignments by taking into account,
|
|
@@ -144,7 +143,7 @@ function BlockEditAlignmentToolbarControls( {
|
|
|
144
143
|
return (
|
|
145
144
|
<BlockControls group="block" __experimentalShareWithChildBlocks>
|
|
146
145
|
<BlockAlignmentControl
|
|
147
|
-
value={
|
|
146
|
+
value={ align }
|
|
148
147
|
onChange={ updateAlignment }
|
|
149
148
|
controls={ validAlignments }
|
|
150
149
|
/>
|
|
@@ -152,80 +151,30 @@ function BlockEditAlignmentToolbarControls( {
|
|
|
152
151
|
);
|
|
153
152
|
}
|
|
154
153
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
*/
|
|
163
|
-
export const withAlignmentControls = createHigherOrderComponent(
|
|
164
|
-
( BlockEdit ) => ( props ) => {
|
|
165
|
-
const hasAlignmentSupport = hasBlockSupport(
|
|
166
|
-
props.name,
|
|
167
|
-
'align',
|
|
168
|
-
false
|
|
169
|
-
);
|
|
170
|
-
|
|
171
|
-
return (
|
|
172
|
-
<>
|
|
173
|
-
{ hasAlignmentSupport && (
|
|
174
|
-
<BlockEditAlignmentToolbarControls
|
|
175
|
-
blockName={ props.name }
|
|
176
|
-
attributes={ props.attributes }
|
|
177
|
-
setAttributes={ props.setAttributes }
|
|
178
|
-
/>
|
|
179
|
-
) }
|
|
180
|
-
<BlockEdit key="edit" { ...props } />
|
|
181
|
-
</>
|
|
182
|
-
);
|
|
154
|
+
export default {
|
|
155
|
+
shareWithChildBlocks: true,
|
|
156
|
+
edit: BlockEditAlignmentToolbarControlsPure,
|
|
157
|
+
useBlockProps,
|
|
158
|
+
attributeKeys: [ 'align' ],
|
|
159
|
+
hasSupport( name ) {
|
|
160
|
+
return hasBlockSupport( name, 'align', false );
|
|
183
161
|
},
|
|
184
|
-
|
|
185
|
-
);
|
|
162
|
+
};
|
|
186
163
|
|
|
187
|
-
function
|
|
188
|
-
const { name, attributes } = props;
|
|
189
|
-
const { align } = attributes;
|
|
164
|
+
function useBlockProps( { name, align } ) {
|
|
190
165
|
const blockAllowedAlignments = getValidAlignments(
|
|
191
166
|
getBlockSupport( name, 'align' ),
|
|
192
167
|
hasBlockSupport( name, 'alignWide', true )
|
|
193
168
|
);
|
|
194
169
|
const validAlignments = useAvailableAlignments( blockAllowedAlignments );
|
|
195
170
|
|
|
196
|
-
let wrapperProps = props.wrapperProps;
|
|
197
171
|
if ( validAlignments.some( ( alignment ) => alignment.name === align ) ) {
|
|
198
|
-
|
|
172
|
+
return { 'data-align': align };
|
|
199
173
|
}
|
|
200
174
|
|
|
201
|
-
return
|
|
175
|
+
return {};
|
|
202
176
|
}
|
|
203
177
|
|
|
204
|
-
/**
|
|
205
|
-
* Override the default block element to add alignment wrapper props.
|
|
206
|
-
*
|
|
207
|
-
* @param {Function} BlockListBlock Original component.
|
|
208
|
-
*
|
|
209
|
-
* @return {Function} Wrapped component.
|
|
210
|
-
*/
|
|
211
|
-
export const withDataAlign = createHigherOrderComponent(
|
|
212
|
-
( BlockListBlock ) => ( props ) => {
|
|
213
|
-
// If an alignment is not assigned, there's no need to go through the
|
|
214
|
-
// effort to validate or assign its value.
|
|
215
|
-
if ( props.attributes.align === undefined ) {
|
|
216
|
-
return <BlockListBlock { ...props } />;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
return (
|
|
220
|
-
<BlockListBlockWithDataAlign
|
|
221
|
-
block={ BlockListBlock }
|
|
222
|
-
props={ props }
|
|
223
|
-
/>
|
|
224
|
-
);
|
|
225
|
-
},
|
|
226
|
-
'withDataAlign'
|
|
227
|
-
);
|
|
228
|
-
|
|
229
178
|
/**
|
|
230
179
|
* Override props assigned to save component to inject alignment class name if
|
|
231
180
|
* block supports it.
|
|
@@ -260,16 +209,6 @@ addFilter(
|
|
|
260
209
|
'core/editor/align/addAttribute',
|
|
261
210
|
addAttribute
|
|
262
211
|
);
|
|
263
|
-
addFilter(
|
|
264
|
-
'editor.BlockListBlock',
|
|
265
|
-
'core/editor/align/with-data-align',
|
|
266
|
-
withDataAlign
|
|
267
|
-
);
|
|
268
|
-
addFilter(
|
|
269
|
-
'editor.BlockEdit',
|
|
270
|
-
'core/editor/align/with-toolbar-controls',
|
|
271
|
-
withAlignmentControls
|
|
272
|
-
);
|
|
273
212
|
addFilter(
|
|
274
213
|
'blocks.getSaveContent.extraProps',
|
|
275
214
|
'core/editor/align/addAssignedAlign',
|
|
@@ -8,6 +8,7 @@ import { WIDE_ALIGNMENTS } from '@wordpress/components';
|
|
|
8
8
|
const ALIGNMENTS = [ 'left', 'center', 'right' ];
|
|
9
9
|
|
|
10
10
|
export * from './align.js';
|
|
11
|
+
export { default } from './align.js';
|
|
11
12
|
|
|
12
13
|
// Used to filter out blocks that don't support wide/full alignment on mobile
|
|
13
14
|
addFilter(
|
package/src/hooks/anchor.js
CHANGED
|
@@ -5,7 +5,6 @@ import { addFilter } from '@wordpress/hooks';
|
|
|
5
5
|
import { PanelBody, TextControl, ExternalLink } from '@wordpress/components';
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
import { hasBlockSupport } from '@wordpress/blocks';
|
|
8
|
-
import { createHigherOrderComponent } from '@wordpress/compose';
|
|
9
8
|
import { Platform } from '@wordpress/element';
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -52,7 +51,11 @@ export function addAttribute( settings ) {
|
|
|
52
51
|
return settings;
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
function
|
|
54
|
+
function BlockEditAnchorControlPure( {
|
|
55
|
+
name: blockName,
|
|
56
|
+
anchor,
|
|
57
|
+
setAttributes,
|
|
58
|
+
} ) {
|
|
56
59
|
const blockEditingMode = useBlockEditingMode();
|
|
57
60
|
|
|
58
61
|
const isWeb = Platform.OS === 'web';
|
|
@@ -79,7 +82,7 @@ function BlockEditAnchorControl( { blockName, attributes, setAttributes } ) {
|
|
|
79
82
|
) }
|
|
80
83
|
</>
|
|
81
84
|
}
|
|
82
|
-
value={
|
|
85
|
+
value={ anchor || '' }
|
|
83
86
|
placeholder={ ! isWeb ? __( 'Add an anchor' ) : null }
|
|
84
87
|
onChange={ ( nextValue ) => {
|
|
85
88
|
nextValue = nextValue.replace( ANCHOR_REGEX, '-' );
|
|
@@ -116,31 +119,13 @@ function BlockEditAnchorControl( { blockName, attributes, setAttributes } ) {
|
|
|
116
119
|
);
|
|
117
120
|
}
|
|
118
121
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
*/
|
|
127
|
-
export const withAnchorControls = createHigherOrderComponent( ( BlockEdit ) => {
|
|
128
|
-
return ( props ) => {
|
|
129
|
-
return (
|
|
130
|
-
<>
|
|
131
|
-
<BlockEdit { ...props } />
|
|
132
|
-
{ props.isSelected &&
|
|
133
|
-
hasBlockSupport( props.name, 'anchor' ) && (
|
|
134
|
-
<BlockEditAnchorControl
|
|
135
|
-
blockName={ props.name }
|
|
136
|
-
attributes={ props.attributes }
|
|
137
|
-
setAttributes={ props.setAttributes }
|
|
138
|
-
/>
|
|
139
|
-
) }
|
|
140
|
-
</>
|
|
141
|
-
);
|
|
142
|
-
};
|
|
143
|
-
}, 'withAnchorControls' );
|
|
122
|
+
export default {
|
|
123
|
+
edit: BlockEditAnchorControlPure,
|
|
124
|
+
attributeKeys: [ 'anchor' ],
|
|
125
|
+
hasSupport( name ) {
|
|
126
|
+
return hasBlockSupport( name, 'anchor' );
|
|
127
|
+
},
|
|
128
|
+
};
|
|
144
129
|
|
|
145
130
|
/**
|
|
146
131
|
* Override props assigned to save component to inject anchor ID, if block
|
|
@@ -162,11 +147,6 @@ export function addSaveProps( extraProps, blockType, attributes ) {
|
|
|
162
147
|
}
|
|
163
148
|
|
|
164
149
|
addFilter( 'blocks.registerBlockType', 'core/anchor/attribute', addAttribute );
|
|
165
|
-
addFilter(
|
|
166
|
-
'editor.BlockEdit',
|
|
167
|
-
'core/editor/anchor/with-inspector-controls',
|
|
168
|
-
withAnchorControls
|
|
169
|
-
);
|
|
170
150
|
addFilter(
|
|
171
151
|
'blocks.getSaveContent.extraProps',
|
|
172
152
|
'core/editor/anchor/save-props',
|