@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
package/src/hooks/test/align.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { render, screen } from '@testing-library/react';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -12,20 +7,11 @@ import {
|
|
|
12
7
|
registerBlockType,
|
|
13
8
|
unregisterBlockType,
|
|
14
9
|
} from '@wordpress/blocks';
|
|
15
|
-
import { SlotFillProvider } from '@wordpress/components';
|
|
16
10
|
|
|
17
11
|
/**
|
|
18
12
|
* Internal dependencies
|
|
19
13
|
*/
|
|
20
|
-
import
|
|
21
|
-
import BlockEdit from '../../components/block-edit';
|
|
22
|
-
import BlockEditorProvider from '../../components/provider';
|
|
23
|
-
import {
|
|
24
|
-
getValidAlignments,
|
|
25
|
-
withAlignmentControls,
|
|
26
|
-
withDataAlign,
|
|
27
|
-
addAssignedAlign,
|
|
28
|
-
} from '../align';
|
|
14
|
+
import { getValidAlignments, addAssignedAlign } from '../align';
|
|
29
15
|
|
|
30
16
|
const noop = () => {};
|
|
31
17
|
|
|
@@ -157,169 +143,6 @@ describe( 'align', () => {
|
|
|
157
143
|
} );
|
|
158
144
|
} );
|
|
159
145
|
|
|
160
|
-
describe( 'withAlignControls', () => {
|
|
161
|
-
const componentProps = {
|
|
162
|
-
name: 'core/foo',
|
|
163
|
-
attributes: {},
|
|
164
|
-
isSelected: true,
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
it( 'should do nothing if no valid alignments', () => {
|
|
168
|
-
registerBlockType( 'core/foo', blockSettings );
|
|
169
|
-
|
|
170
|
-
const EnhancedComponent = withAlignmentControls(
|
|
171
|
-
( { wrapperProps } ) => <div { ...wrapperProps } />
|
|
172
|
-
);
|
|
173
|
-
|
|
174
|
-
render(
|
|
175
|
-
<SlotFillProvider>
|
|
176
|
-
<BlockEdit { ...componentProps }>
|
|
177
|
-
<EnhancedComponent { ...componentProps } />
|
|
178
|
-
</BlockEdit>
|
|
179
|
-
<BlockControls.Slot group="block" />
|
|
180
|
-
</SlotFillProvider>
|
|
181
|
-
);
|
|
182
|
-
|
|
183
|
-
expect(
|
|
184
|
-
screen.queryByRole( 'button', {
|
|
185
|
-
name: 'Align',
|
|
186
|
-
expanded: false,
|
|
187
|
-
} )
|
|
188
|
-
).not.toBeInTheDocument();
|
|
189
|
-
} );
|
|
190
|
-
|
|
191
|
-
it( 'should render toolbar controls if valid alignments', () => {
|
|
192
|
-
registerBlockType( 'core/foo', {
|
|
193
|
-
...blockSettings,
|
|
194
|
-
supports: {
|
|
195
|
-
align: true,
|
|
196
|
-
alignWide: false,
|
|
197
|
-
},
|
|
198
|
-
} );
|
|
199
|
-
|
|
200
|
-
const EnhancedComponent = withAlignmentControls(
|
|
201
|
-
( { wrapperProps } ) => <div { ...wrapperProps } />
|
|
202
|
-
);
|
|
203
|
-
|
|
204
|
-
render(
|
|
205
|
-
<SlotFillProvider>
|
|
206
|
-
<BlockEdit { ...componentProps }>
|
|
207
|
-
<EnhancedComponent { ...componentProps } />
|
|
208
|
-
</BlockEdit>
|
|
209
|
-
<BlockControls.Slot group="block" />
|
|
210
|
-
</SlotFillProvider>
|
|
211
|
-
);
|
|
212
|
-
|
|
213
|
-
expect(
|
|
214
|
-
screen.getAllByRole( 'button', {
|
|
215
|
-
name: 'Align',
|
|
216
|
-
expanded: false,
|
|
217
|
-
} )
|
|
218
|
-
).toHaveLength( 2 );
|
|
219
|
-
} );
|
|
220
|
-
} );
|
|
221
|
-
|
|
222
|
-
describe( 'withDataAlign', () => {
|
|
223
|
-
it( 'should render with wrapper props', () => {
|
|
224
|
-
registerBlockType( 'core/foo', {
|
|
225
|
-
...blockSettings,
|
|
226
|
-
supports: {
|
|
227
|
-
align: true,
|
|
228
|
-
alignWide: true,
|
|
229
|
-
},
|
|
230
|
-
} );
|
|
231
|
-
|
|
232
|
-
const EnhancedComponent = withDataAlign( ( { wrapperProps } ) => (
|
|
233
|
-
<button { ...wrapperProps } />
|
|
234
|
-
) );
|
|
235
|
-
|
|
236
|
-
render(
|
|
237
|
-
<BlockEditorProvider
|
|
238
|
-
settings={ { alignWide: true, supportsLayout: false } }
|
|
239
|
-
value={ [] }
|
|
240
|
-
>
|
|
241
|
-
<EnhancedComponent
|
|
242
|
-
attributes={ {
|
|
243
|
-
align: 'wide',
|
|
244
|
-
} }
|
|
245
|
-
name="core/foo"
|
|
246
|
-
/>
|
|
247
|
-
</BlockEditorProvider>
|
|
248
|
-
);
|
|
249
|
-
|
|
250
|
-
expect( screen.getByRole( 'button' ) ).toHaveAttribute(
|
|
251
|
-
'data-align',
|
|
252
|
-
'wide'
|
|
253
|
-
);
|
|
254
|
-
} );
|
|
255
|
-
|
|
256
|
-
it( 'should not render wide/full wrapper props if wide controls are not enabled', () => {
|
|
257
|
-
registerBlockType( 'core/foo', {
|
|
258
|
-
...blockSettings,
|
|
259
|
-
supports: {
|
|
260
|
-
align: true,
|
|
261
|
-
alignWide: true,
|
|
262
|
-
},
|
|
263
|
-
} );
|
|
264
|
-
|
|
265
|
-
const EnhancedComponent = withDataAlign( ( { wrapperProps } ) => (
|
|
266
|
-
<button { ...wrapperProps } />
|
|
267
|
-
) );
|
|
268
|
-
|
|
269
|
-
render(
|
|
270
|
-
<BlockEditorProvider
|
|
271
|
-
settings={ { alignWide: false } }
|
|
272
|
-
value={ [] }
|
|
273
|
-
>
|
|
274
|
-
<EnhancedComponent
|
|
275
|
-
name="core/foo"
|
|
276
|
-
attributes={ {
|
|
277
|
-
align: 'wide',
|
|
278
|
-
} }
|
|
279
|
-
/>
|
|
280
|
-
</BlockEditorProvider>
|
|
281
|
-
);
|
|
282
|
-
|
|
283
|
-
expect( screen.getByRole( 'button' ) ).not.toHaveAttribute(
|
|
284
|
-
'data-align',
|
|
285
|
-
'wide'
|
|
286
|
-
);
|
|
287
|
-
} );
|
|
288
|
-
|
|
289
|
-
it( 'should not render invalid align', () => {
|
|
290
|
-
registerBlockType( 'core/foo', {
|
|
291
|
-
...blockSettings,
|
|
292
|
-
supports: {
|
|
293
|
-
align: true,
|
|
294
|
-
alignWide: false,
|
|
295
|
-
},
|
|
296
|
-
} );
|
|
297
|
-
|
|
298
|
-
const EnhancedComponent = withDataAlign( ( { wrapperProps } ) => (
|
|
299
|
-
<button { ...wrapperProps } />
|
|
300
|
-
) );
|
|
301
|
-
|
|
302
|
-
render(
|
|
303
|
-
<BlockEditorProvider
|
|
304
|
-
settings={ { alignWide: true } }
|
|
305
|
-
value={ [] }
|
|
306
|
-
>
|
|
307
|
-
<EnhancedComponent
|
|
308
|
-
name="core/foo"
|
|
309
|
-
attributes={ {
|
|
310
|
-
align: 'wide',
|
|
311
|
-
} }
|
|
312
|
-
/>
|
|
313
|
-
</BlockEditorProvider>
|
|
314
|
-
);
|
|
315
|
-
|
|
316
|
-
expect( screen.getByRole( 'button' ) ).not.toHaveAttribute(
|
|
317
|
-
'data-align',
|
|
318
|
-
'wide'
|
|
319
|
-
);
|
|
320
|
-
} );
|
|
321
|
-
} );
|
|
322
|
-
|
|
323
146
|
describe( 'addAssignedAlign', () => {
|
|
324
147
|
it( 'should do nothing if block does not support align', () => {
|
|
325
148
|
registerBlockType( 'core/foo', blockSettings );
|
package/src/hooks/typography.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';
|
|
5
5
|
import { useMemo, useCallback } from '@wordpress/element';
|
|
6
|
+
import { useSelect } from '@wordpress/data';
|
|
7
|
+
import { pure } from '@wordpress/compose';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* Internal dependencies
|
|
@@ -16,7 +18,8 @@ import {
|
|
|
16
18
|
import { LINE_HEIGHT_SUPPORT_KEY } from './line-height';
|
|
17
19
|
import { FONT_FAMILY_SUPPORT_KEY } from './font-family';
|
|
18
20
|
import { FONT_SIZE_SUPPORT_KEY } from './font-size';
|
|
19
|
-
import { cleanEmptyObject
|
|
21
|
+
import { cleanEmptyObject } from './utils';
|
|
22
|
+
import { store as blockEditorStore } from '../store';
|
|
20
23
|
|
|
21
24
|
function omit( object, keys ) {
|
|
22
25
|
return Object.fromEntries(
|
|
@@ -106,22 +109,18 @@ function TypographyInspectorControl( { children, resetAllFilter } ) {
|
|
|
106
109
|
);
|
|
107
110
|
}
|
|
108
111
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
} )
|
|
116
|
-
const settings = useBlockSettings( name, __unstableParentLayout );
|
|
112
|
+
function TypographyPanelPure( { clientId, name, setAttributes, settings } ) {
|
|
113
|
+
function selector( select ) {
|
|
114
|
+
const { style, fontFamily, fontSize } =
|
|
115
|
+
select( blockEditorStore ).getBlockAttributes( clientId ) || {};
|
|
116
|
+
return { style, fontFamily, fontSize };
|
|
117
|
+
}
|
|
118
|
+
const { style, fontFamily, fontSize } = useSelect( selector, [ clientId ] );
|
|
117
119
|
const isEnabled = useHasTypographyPanel( settings );
|
|
118
|
-
const value = useMemo(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
fontSize: attributes.fontSize,
|
|
123
|
-
} );
|
|
124
|
-
}, [ attributes.style, attributes.fontSize, attributes.fontFamily ] );
|
|
120
|
+
const value = useMemo(
|
|
121
|
+
() => attributesToStyle( { style, fontFamily, fontSize } ),
|
|
122
|
+
[ style, fontSize, fontFamily ]
|
|
123
|
+
);
|
|
125
124
|
|
|
126
125
|
const onChange = ( newStyle ) => {
|
|
127
126
|
setAttributes( styleToAttributes( newStyle ) );
|
|
@@ -148,6 +147,11 @@ export function TypographyPanel( {
|
|
|
148
147
|
);
|
|
149
148
|
}
|
|
150
149
|
|
|
150
|
+
// We don't want block controls to re-render when typing inside a block. `pure`
|
|
151
|
+
// will prevent re-renders unless props change, so only pass the needed props
|
|
152
|
+
// and not the whole attributes object.
|
|
153
|
+
export const TypographyPanel = pure( TypographyPanelPure );
|
|
154
|
+
|
|
151
155
|
export const hasTypographySupport = ( blockName ) => {
|
|
152
156
|
return TYPOGRAPHY_SUPPORT_KEYS.some( ( key ) =>
|
|
153
157
|
hasBlockSupport( blockName, key )
|
package/src/hooks/utils.js
CHANGED
|
@@ -2,17 +2,28 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { getBlockSupport } from '@wordpress/blocks';
|
|
5
|
-
import { useMemo, useEffect, useId } from '@wordpress/element';
|
|
5
|
+
import { useMemo, useEffect, useId, useState } from '@wordpress/element';
|
|
6
6
|
import { useDispatch } from '@wordpress/data';
|
|
7
|
+
import { createHigherOrderComponent, pure } from '@wordpress/compose';
|
|
8
|
+
import { addFilter } from '@wordpress/hooks';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* Internal dependencies
|
|
10
12
|
*/
|
|
13
|
+
import {
|
|
14
|
+
useBlockEditContext,
|
|
15
|
+
mayDisplayControlsKey,
|
|
16
|
+
mayDisplayParentControlsKey,
|
|
17
|
+
} from '../components/block-edit/context';
|
|
11
18
|
import { useSettings } from '../components';
|
|
12
19
|
import { useSettingsForBlockElement } from '../components/global-styles/hooks';
|
|
13
20
|
import { getValueFromObjectPath, setImmutably } from '../utils/object';
|
|
14
21
|
import { store as blockEditorStore } from '../store';
|
|
15
22
|
import { unlock } from '../lock-unlock';
|
|
23
|
+
/**
|
|
24
|
+
* External dependencies
|
|
25
|
+
*/
|
|
26
|
+
import classnames from 'classnames';
|
|
16
27
|
|
|
17
28
|
/**
|
|
18
29
|
* Removed falsy values from nested object.
|
|
@@ -101,14 +112,18 @@ export function transformStyles(
|
|
|
101
112
|
* Check whether serialization of specific block support feature or set should
|
|
102
113
|
* be skipped.
|
|
103
114
|
*
|
|
104
|
-
* @param {string|Object}
|
|
105
|
-
* @param {string} featureSet
|
|
106
|
-
* @param {string} feature
|
|
115
|
+
* @param {string|Object} blockNameOrType Block name or block type object.
|
|
116
|
+
* @param {string} featureSet Name of block support feature set.
|
|
117
|
+
* @param {string} feature Name of the individual feature to check.
|
|
107
118
|
*
|
|
108
119
|
* @return {boolean} Whether serialization should occur.
|
|
109
120
|
*/
|
|
110
|
-
export function shouldSkipSerialization(
|
|
111
|
-
|
|
121
|
+
export function shouldSkipSerialization(
|
|
122
|
+
blockNameOrType,
|
|
123
|
+
featureSet,
|
|
124
|
+
feature
|
|
125
|
+
) {
|
|
126
|
+
const support = getBlockSupport( blockNameOrType, featureSet );
|
|
112
127
|
const skipSerialization = support?.__experimentalSkipSerialization;
|
|
113
128
|
|
|
114
129
|
if ( Array.isArray( skipSerialization ) ) {
|
|
@@ -362,3 +377,169 @@ export function useBlockSettings( name, parentLayout ) {
|
|
|
362
377
|
|
|
363
378
|
return useSettingsForBlockElement( rawSettings, name );
|
|
364
379
|
}
|
|
380
|
+
|
|
381
|
+
export function createBlockEditFilter( features ) {
|
|
382
|
+
// We don't want block controls to re-render when typing inside a block.
|
|
383
|
+
// `pure` will prevent re-renders unless props change, so only pass the
|
|
384
|
+
// needed props and not the whole attributes object.
|
|
385
|
+
features = features.map( ( settings ) => {
|
|
386
|
+
return { ...settings, Edit: pure( settings.edit ) };
|
|
387
|
+
} );
|
|
388
|
+
const withBlockEditHooks = createHigherOrderComponent(
|
|
389
|
+
( OriginalBlockEdit ) => ( props ) => {
|
|
390
|
+
const context = useBlockEditContext();
|
|
391
|
+
// CAUTION: code added before this line will be executed for all
|
|
392
|
+
// blocks, not just those that support the feature! Code added
|
|
393
|
+
// above this line should be carefully evaluated for its impact on
|
|
394
|
+
// performance.
|
|
395
|
+
return [
|
|
396
|
+
...features.map( ( feature, i ) => {
|
|
397
|
+
const {
|
|
398
|
+
Edit,
|
|
399
|
+
hasSupport,
|
|
400
|
+
attributeKeys = [],
|
|
401
|
+
shareWithChildBlocks,
|
|
402
|
+
} = feature;
|
|
403
|
+
const shouldDisplayControls =
|
|
404
|
+
context[ mayDisplayControlsKey ] ||
|
|
405
|
+
( context[ mayDisplayParentControlsKey ] &&
|
|
406
|
+
shareWithChildBlocks );
|
|
407
|
+
|
|
408
|
+
if (
|
|
409
|
+
! shouldDisplayControls ||
|
|
410
|
+
! hasSupport( props.name )
|
|
411
|
+
) {
|
|
412
|
+
return null;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
const neededProps = {};
|
|
416
|
+
for ( const key of attributeKeys ) {
|
|
417
|
+
if ( props.attributes[ key ] ) {
|
|
418
|
+
neededProps[ key ] = props.attributes[ key ];
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
return (
|
|
422
|
+
<Edit
|
|
423
|
+
// We can use the index because the array length
|
|
424
|
+
// is fixed per page load right now.
|
|
425
|
+
key={ i }
|
|
426
|
+
name={ props.name }
|
|
427
|
+
clientId={ props.clientId }
|
|
428
|
+
setAttributes={ props.setAttributes }
|
|
429
|
+
__unstableParentLayout={
|
|
430
|
+
props.__unstableParentLayout
|
|
431
|
+
}
|
|
432
|
+
// This component is pure, so only pass needed
|
|
433
|
+
// props!!!
|
|
434
|
+
{ ...neededProps }
|
|
435
|
+
/>
|
|
436
|
+
);
|
|
437
|
+
} ),
|
|
438
|
+
<OriginalBlockEdit key="edit" { ...props } />,
|
|
439
|
+
];
|
|
440
|
+
},
|
|
441
|
+
'withBlockEditHooks'
|
|
442
|
+
);
|
|
443
|
+
addFilter( 'editor.BlockEdit', 'core/editor/hooks', withBlockEditHooks );
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
function BlockProps( { index, useBlockProps, setAllWrapperProps, ...props } ) {
|
|
447
|
+
const wrapperProps = useBlockProps( props );
|
|
448
|
+
const setWrapperProps = ( next ) =>
|
|
449
|
+
setAllWrapperProps( ( prev ) => {
|
|
450
|
+
const nextAll = [ ...prev ];
|
|
451
|
+
nextAll[ index ] = next;
|
|
452
|
+
return nextAll;
|
|
453
|
+
} );
|
|
454
|
+
// Setting state after every render is fine because this component is
|
|
455
|
+
// pure and will only re-render when needed props change.
|
|
456
|
+
useEffect( () => {
|
|
457
|
+
// We could shallow compare the props, but since this component only
|
|
458
|
+
// changes when needed attributes change, the benefit is probably small.
|
|
459
|
+
setWrapperProps( wrapperProps );
|
|
460
|
+
return () => {
|
|
461
|
+
setWrapperProps( undefined );
|
|
462
|
+
};
|
|
463
|
+
} );
|
|
464
|
+
return null;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
const BlockPropsPure = pure( BlockProps );
|
|
468
|
+
|
|
469
|
+
export function createBlockListBlockFilter( features ) {
|
|
470
|
+
const withBlockListBlockHooks = createHigherOrderComponent(
|
|
471
|
+
( BlockListBlock ) => ( props ) => {
|
|
472
|
+
const [ allWrapperProps, setAllWrapperProps ] = useState(
|
|
473
|
+
Array( features.length ).fill( undefined )
|
|
474
|
+
);
|
|
475
|
+
return [
|
|
476
|
+
...features.map( ( feature, i ) => {
|
|
477
|
+
const {
|
|
478
|
+
hasSupport,
|
|
479
|
+
attributeKeys = [],
|
|
480
|
+
useBlockProps,
|
|
481
|
+
} = feature;
|
|
482
|
+
|
|
483
|
+
const neededProps = {};
|
|
484
|
+
for ( const key of attributeKeys ) {
|
|
485
|
+
if ( props.attributes[ key ] ) {
|
|
486
|
+
neededProps[ key ] = props.attributes[ key ];
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
if (
|
|
491
|
+
! hasSupport( props.name ) ||
|
|
492
|
+
// Skip rendering if none of the needed attributes are
|
|
493
|
+
// set.
|
|
494
|
+
! Object.keys( neededProps ).length
|
|
495
|
+
) {
|
|
496
|
+
return null;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
return (
|
|
500
|
+
<BlockPropsPure
|
|
501
|
+
// We can use the index because the array length
|
|
502
|
+
// is fixed per page load right now.
|
|
503
|
+
key={ i }
|
|
504
|
+
index={ i }
|
|
505
|
+
useBlockProps={ useBlockProps }
|
|
506
|
+
// This component is pure, so we must pass a stable
|
|
507
|
+
// function reference.
|
|
508
|
+
setAllWrapperProps={ setAllWrapperProps }
|
|
509
|
+
name={ props.name }
|
|
510
|
+
// This component is pure, so only pass needed
|
|
511
|
+
// props!!!
|
|
512
|
+
{ ...neededProps }
|
|
513
|
+
/>
|
|
514
|
+
);
|
|
515
|
+
} ),
|
|
516
|
+
<BlockListBlock
|
|
517
|
+
key="edit"
|
|
518
|
+
{ ...props }
|
|
519
|
+
wrapperProps={ allWrapperProps
|
|
520
|
+
.filter( Boolean )
|
|
521
|
+
.reduce( ( acc, wrapperProps ) => {
|
|
522
|
+
return {
|
|
523
|
+
...acc,
|
|
524
|
+
...wrapperProps,
|
|
525
|
+
className: classnames(
|
|
526
|
+
acc.className,
|
|
527
|
+
wrapperProps.className
|
|
528
|
+
),
|
|
529
|
+
style: {
|
|
530
|
+
...acc.style,
|
|
531
|
+
...wrapperProps.style,
|
|
532
|
+
},
|
|
533
|
+
};
|
|
534
|
+
}, props.wrapperProps || {} ) }
|
|
535
|
+
/>,
|
|
536
|
+
];
|
|
537
|
+
},
|
|
538
|
+
'withBlockListBlockHooks'
|
|
539
|
+
);
|
|
540
|
+
addFilter(
|
|
541
|
+
'editor.BlockListBlock',
|
|
542
|
+
'core/editor/hooks',
|
|
543
|
+
withBlockListBlockHooks
|
|
544
|
+
);
|
|
545
|
+
}
|
|
@@ -36,7 +36,10 @@ export default {
|
|
|
36
36
|
layoutBlockSupport = {},
|
|
37
37
|
} ) {
|
|
38
38
|
const { wideSize, contentSize, justifyContent = 'center' } = layout;
|
|
39
|
-
const {
|
|
39
|
+
const {
|
|
40
|
+
allowJustification = true,
|
|
41
|
+
allowCustomContentAndWideSize = true,
|
|
42
|
+
} = layoutBlockSupport;
|
|
40
43
|
const onJustificationChange = ( value ) => {
|
|
41
44
|
onChange( {
|
|
42
45
|
...layout,
|
|
@@ -66,55 +69,59 @@ export default {
|
|
|
66
69
|
} );
|
|
67
70
|
return (
|
|
68
71
|
<>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<
|
|
72
|
-
className="block-editor-hooks__layout-controls-unit
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
className="block-editor-hooks__layout-controls-unit
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
72
|
+
{ allowCustomContentAndWideSize && (
|
|
73
|
+
<>
|
|
74
|
+
<div className="block-editor-hooks__layout-controls">
|
|
75
|
+
<div className="block-editor-hooks__layout-controls-unit">
|
|
76
|
+
<UnitControl
|
|
77
|
+
className="block-editor-hooks__layout-controls-unit-input"
|
|
78
|
+
label={ __( 'Content' ) }
|
|
79
|
+
labelPosition="top"
|
|
80
|
+
__unstableInputWidth="80px"
|
|
81
|
+
value={ contentSize || wideSize || '' }
|
|
82
|
+
onChange={ ( nextWidth ) => {
|
|
83
|
+
nextWidth =
|
|
84
|
+
0 > parseFloat( nextWidth )
|
|
85
|
+
? '0'
|
|
86
|
+
: nextWidth;
|
|
87
|
+
onChange( {
|
|
88
|
+
...layout,
|
|
89
|
+
contentSize: nextWidth,
|
|
90
|
+
} );
|
|
91
|
+
} }
|
|
92
|
+
units={ units }
|
|
93
|
+
/>
|
|
94
|
+
<Icon icon={ positionCenter } />
|
|
95
|
+
</div>
|
|
96
|
+
<div className="block-editor-hooks__layout-controls-unit">
|
|
97
|
+
<UnitControl
|
|
98
|
+
className="block-editor-hooks__layout-controls-unit-input"
|
|
99
|
+
label={ __( 'Wide' ) }
|
|
100
|
+
labelPosition="top"
|
|
101
|
+
__unstableInputWidth="80px"
|
|
102
|
+
value={ wideSize || contentSize || '' }
|
|
103
|
+
onChange={ ( nextWidth ) => {
|
|
104
|
+
nextWidth =
|
|
105
|
+
0 > parseFloat( nextWidth )
|
|
106
|
+
? '0'
|
|
107
|
+
: nextWidth;
|
|
108
|
+
onChange( {
|
|
109
|
+
...layout,
|
|
110
|
+
wideSize: nextWidth,
|
|
111
|
+
} );
|
|
112
|
+
} }
|
|
113
|
+
units={ units }
|
|
114
|
+
/>
|
|
115
|
+
<Icon icon={ stretchWide } />
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
<p className="block-editor-hooks__layout-controls-helptext">
|
|
119
|
+
{ __(
|
|
120
|
+
'Customize the width for all elements that are assigned to the center or wide columns.'
|
|
121
|
+
) }
|
|
122
|
+
</p>
|
|
123
|
+
</>
|
|
124
|
+
) }
|
|
118
125
|
{ allowJustification && (
|
|
119
126
|
<ToggleGroupControl
|
|
120
127
|
__nextHasNoMarginBottom
|
package/src/private-apis.js
CHANGED
|
@@ -10,7 +10,6 @@ import ResizableBoxPopover from './components/resizable-box-popover';
|
|
|
10
10
|
import { ComposedPrivateInserter as PrivateInserter } from './components/inserter';
|
|
11
11
|
import { PrivateListView } from './components/list-view';
|
|
12
12
|
import BlockInfo from './components/block-info-slot-fill';
|
|
13
|
-
import BlockContextualToolbar from './components/block-tools/block-contextual-toolbar';
|
|
14
13
|
import { useShouldContextualToolbarShow } from './utils/use-should-contextual-toolbar-show';
|
|
15
14
|
import { cleanEmptyObject, useStyleOverride } from './hooks/utils';
|
|
16
15
|
import BlockQuickNavigation from './components/block-quick-navigation';
|
|
@@ -42,7 +41,6 @@ lock( privateApis, {
|
|
|
42
41
|
PrivateListView,
|
|
43
42
|
ResizableBoxPopover,
|
|
44
43
|
BlockInfo,
|
|
45
|
-
BlockContextualToolbar,
|
|
46
44
|
useShouldContextualToolbarShow,
|
|
47
45
|
cleanEmptyObject,
|
|
48
46
|
useStyleOverride,
|
|
@@ -290,3 +290,11 @@ export function deleteStyleOverride( id ) {
|
|
|
290
290
|
id,
|
|
291
291
|
};
|
|
292
292
|
}
|
|
293
|
+
|
|
294
|
+
export function syncDerivedBlockAttributes( clientId, attributes ) {
|
|
295
|
+
return {
|
|
296
|
+
type: 'SYNC_DERIVED_BLOCK_ATTRIBUTES',
|
|
297
|
+
clientIds: [ clientId ],
|
|
298
|
+
attributes,
|
|
299
|
+
};
|
|
300
|
+
}
|
|
@@ -10,7 +10,12 @@ import {
|
|
|
10
10
|
getBlockOrder,
|
|
11
11
|
getBlockParents,
|
|
12
12
|
getBlockEditingMode,
|
|
13
|
+
getSettings,
|
|
14
|
+
__experimentalGetParsedPattern,
|
|
15
|
+
canInsertBlockType,
|
|
16
|
+
__experimentalGetAllowedPatterns,
|
|
13
17
|
} from './selectors';
|
|
18
|
+
import { getUserPatterns, checkAllowListRecursive } from './utils';
|
|
14
19
|
|
|
15
20
|
/**
|
|
16
21
|
* Returns true if the block interface is hidden, or false otherwise.
|
|
@@ -236,3 +241,43 @@ export const getInserterMediaCategories = createSelector(
|
|
|
236
241
|
state.registeredInserterMediaCategories,
|
|
237
242
|
]
|
|
238
243
|
);
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Returns whether there is at least one allowed pattern for inner blocks children.
|
|
247
|
+
* This is useful for deferring the parsing of all patterns until needed.
|
|
248
|
+
*
|
|
249
|
+
* @param {Object} state Editor state.
|
|
250
|
+
* @param {string} [rootClientId=null] Target root client ID.
|
|
251
|
+
*
|
|
252
|
+
* @return {boolean} If there is at least one allowed pattern.
|
|
253
|
+
*/
|
|
254
|
+
export const hasAllowedPatterns = createSelector(
|
|
255
|
+
( state, rootClientId = null ) => {
|
|
256
|
+
const patterns = state.settings.__experimentalBlockPatterns;
|
|
257
|
+
const userPatterns = getUserPatterns( state );
|
|
258
|
+
const { allowedBlockTypes } = getSettings( state );
|
|
259
|
+
return [ ...userPatterns, ...patterns ].some(
|
|
260
|
+
( { name, inserter = true } ) => {
|
|
261
|
+
if ( ! inserter ) {
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
const { blocks } = __experimentalGetParsedPattern(
|
|
265
|
+
state,
|
|
266
|
+
name
|
|
267
|
+
);
|
|
268
|
+
return (
|
|
269
|
+
checkAllowListRecursive( blocks, allowedBlockTypes ) &&
|
|
270
|
+
blocks.every( ( { name: blockName } ) =>
|
|
271
|
+
canInsertBlockType( state, blockName, rootClientId )
|
|
272
|
+
)
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
);
|
|
276
|
+
},
|
|
277
|
+
( state, rootClientId ) => [
|
|
278
|
+
...__experimentalGetAllowedPatterns.getDependants(
|
|
279
|
+
state,
|
|
280
|
+
rootClientId
|
|
281
|
+
),
|
|
282
|
+
]
|
|
283
|
+
);
|