@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.16.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -35,35 +35,35 @@
|
|
|
35
35
|
"@emotion/react": "^11.7.1",
|
|
36
36
|
"@emotion/styled": "^11.6.0",
|
|
37
37
|
"@react-spring/web": "^9.4.5",
|
|
38
|
-
"@wordpress/a11y": "^3.
|
|
39
|
-
"@wordpress/api-fetch": "^6.
|
|
40
|
-
"@wordpress/blob": "^3.
|
|
41
|
-
"@wordpress/blocks": "^12.
|
|
42
|
-
"@wordpress/commands": "^0.
|
|
43
|
-
"@wordpress/components": "^25.
|
|
44
|
-
"@wordpress/compose": "^6.
|
|
45
|
-
"@wordpress/data": "^9.
|
|
46
|
-
"@wordpress/date": "^4.
|
|
47
|
-
"@wordpress/deprecated": "^3.
|
|
48
|
-
"@wordpress/dom": "^3.
|
|
49
|
-
"@wordpress/element": "^5.
|
|
50
|
-
"@wordpress/escape-html": "^2.
|
|
51
|
-
"@wordpress/hooks": "^3.
|
|
52
|
-
"@wordpress/html-entities": "^3.
|
|
53
|
-
"@wordpress/i18n": "^4.
|
|
54
|
-
"@wordpress/icons": "^9.
|
|
55
|
-
"@wordpress/is-shallow-equal": "^4.
|
|
56
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
57
|
-
"@wordpress/keycodes": "^3.
|
|
58
|
-
"@wordpress/notices": "^4.
|
|
59
|
-
"@wordpress/preferences": "^3.
|
|
60
|
-
"@wordpress/private-apis": "^0.
|
|
61
|
-
"@wordpress/rich-text": "^6.
|
|
62
|
-
"@wordpress/style-engine": "^1.
|
|
63
|
-
"@wordpress/token-list": "^2.
|
|
64
|
-
"@wordpress/url": "^3.
|
|
65
|
-
"@wordpress/warning": "^2.
|
|
66
|
-
"@wordpress/wordcount": "^3.
|
|
38
|
+
"@wordpress/a11y": "^3.48.0",
|
|
39
|
+
"@wordpress/api-fetch": "^6.45.0",
|
|
40
|
+
"@wordpress/blob": "^3.48.0",
|
|
41
|
+
"@wordpress/blocks": "^12.25.0",
|
|
42
|
+
"@wordpress/commands": "^0.19.0",
|
|
43
|
+
"@wordpress/components": "^25.14.0",
|
|
44
|
+
"@wordpress/compose": "^6.25.0",
|
|
45
|
+
"@wordpress/data": "^9.18.0",
|
|
46
|
+
"@wordpress/date": "^4.48.0",
|
|
47
|
+
"@wordpress/deprecated": "^3.48.0",
|
|
48
|
+
"@wordpress/dom": "^3.48.0",
|
|
49
|
+
"@wordpress/element": "^5.25.0",
|
|
50
|
+
"@wordpress/escape-html": "^2.48.0",
|
|
51
|
+
"@wordpress/hooks": "^3.48.0",
|
|
52
|
+
"@wordpress/html-entities": "^3.48.0",
|
|
53
|
+
"@wordpress/i18n": "^4.48.0",
|
|
54
|
+
"@wordpress/icons": "^9.39.0",
|
|
55
|
+
"@wordpress/is-shallow-equal": "^4.48.0",
|
|
56
|
+
"@wordpress/keyboard-shortcuts": "^4.25.0",
|
|
57
|
+
"@wordpress/keycodes": "^3.48.0",
|
|
58
|
+
"@wordpress/notices": "^4.16.0",
|
|
59
|
+
"@wordpress/preferences": "^3.25.0",
|
|
60
|
+
"@wordpress/private-apis": "^0.30.0",
|
|
61
|
+
"@wordpress/rich-text": "^6.25.0",
|
|
62
|
+
"@wordpress/style-engine": "^1.31.0",
|
|
63
|
+
"@wordpress/token-list": "^2.48.0",
|
|
64
|
+
"@wordpress/url": "^3.49.0",
|
|
65
|
+
"@wordpress/warning": "^2.48.0",
|
|
66
|
+
"@wordpress/wordcount": "^3.48.0",
|
|
67
67
|
"change-case": "^4.1.2",
|
|
68
68
|
"classnames": "^2.3.1",
|
|
69
69
|
"colord": "^2.7.0",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"access": "public"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "fcf61b4beff747222c2c81d09d757ca1a0abd925"
|
|
91
91
|
}
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useMergeRefs } from '@wordpress/compose';
|
|
5
|
+
import { useRef } from '@wordpress/element';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
8
9
|
*/
|
|
9
10
|
import BlockList from '../block-list';
|
|
11
|
+
import BlockTools from '../block-tools';
|
|
10
12
|
import EditorStyles from '../editor-styles';
|
|
11
13
|
import Iframe from '../iframe';
|
|
12
14
|
import WritingFlow from '../writing-flow';
|
|
@@ -23,11 +25,15 @@ export function ExperimentalBlockCanvas( {
|
|
|
23
25
|
} ) {
|
|
24
26
|
const resetTypingRef = useMouseMoveTypingReset();
|
|
25
27
|
const clearerRef = useBlockSelectionClearer();
|
|
26
|
-
const
|
|
28
|
+
const localRef = useRef();
|
|
29
|
+
const contentRef = useMergeRefs( [ contentRefProp, clearerRef, localRef ] );
|
|
27
30
|
|
|
28
31
|
if ( ! shouldIframe ) {
|
|
29
32
|
return (
|
|
30
|
-
|
|
33
|
+
<BlockTools
|
|
34
|
+
__unstableContentRef={ localRef }
|
|
35
|
+
style={ { height, display: 'flex' } }
|
|
36
|
+
>
|
|
31
37
|
<EditorStyles
|
|
32
38
|
styles={ styles }
|
|
33
39
|
scope=".editor-styles-wrapper"
|
|
@@ -36,29 +42,37 @@ export function ExperimentalBlockCanvas( {
|
|
|
36
42
|
ref={ contentRef }
|
|
37
43
|
className="editor-styles-wrapper"
|
|
38
44
|
tabIndex={ -1 }
|
|
39
|
-
style={ {
|
|
45
|
+
style={ {
|
|
46
|
+
height: '100%',
|
|
47
|
+
width: '100%',
|
|
48
|
+
} }
|
|
40
49
|
>
|
|
41
50
|
{ children }
|
|
42
51
|
</WritingFlow>
|
|
43
|
-
|
|
52
|
+
</BlockTools>
|
|
44
53
|
);
|
|
45
54
|
}
|
|
46
55
|
|
|
47
56
|
return (
|
|
48
|
-
<
|
|
49
|
-
{
|
|
50
|
-
|
|
51
|
-
contentRef={ contentRef }
|
|
52
|
-
style={ {
|
|
53
|
-
width: '100%',
|
|
54
|
-
height,
|
|
55
|
-
...iframeProps?.style,
|
|
56
|
-
} }
|
|
57
|
-
name="editor-canvas"
|
|
57
|
+
<BlockTools
|
|
58
|
+
__unstableContentRef={ localRef }
|
|
59
|
+
style={ { height, display: 'flex' } }
|
|
58
60
|
>
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
<Iframe
|
|
62
|
+
{ ...iframeProps }
|
|
63
|
+
ref={ resetTypingRef }
|
|
64
|
+
contentRef={ contentRef }
|
|
65
|
+
style={ {
|
|
66
|
+
width: '100%',
|
|
67
|
+
height: '100%',
|
|
68
|
+
...iframeProps?.style,
|
|
69
|
+
} }
|
|
70
|
+
name="editor-canvas"
|
|
71
|
+
>
|
|
72
|
+
<EditorStyles styles={ styles } />
|
|
73
|
+
{ children }
|
|
74
|
+
</Iframe>
|
|
75
|
+
</BlockTools>
|
|
62
76
|
);
|
|
63
77
|
}
|
|
64
78
|
|
|
@@ -16,7 +16,7 @@ The `BlockCaption` component renders block-level UI for adding and editing capti
|
|
|
16
16
|
Renders an editable caption field designed specifically for block-level use.
|
|
17
17
|
|
|
18
18
|
```jsx
|
|
19
|
-
import { BlockCaption } from '@wordpress/block-editor';
|
|
19
|
+
import { BlockCaption, RichText } from '@wordpress/block-editor';
|
|
20
20
|
|
|
21
21
|
const MyBlockCaption = (
|
|
22
22
|
clientId,
|
|
@@ -29,7 +29,7 @@ const MyBlockCaption = (
|
|
|
29
29
|
clientId={ clientId }
|
|
30
30
|
accessible={ true }
|
|
31
31
|
accessibilityLabelCreator={ ( caption ) =>
|
|
32
|
-
|
|
32
|
+
RichText.isEmpty( caption )
|
|
33
33
|
? /* translators: accessibility text. Empty caption. */
|
|
34
34
|
'Caption. Empty'
|
|
35
35
|
: sprintf(
|
|
@@ -62,9 +62,11 @@ function BlockCard( { title, icon, description, blockType, className } ) {
|
|
|
62
62
|
<BlockIcon icon={ icon } showColors />
|
|
63
63
|
<div className="block-editor-block-card__content">
|
|
64
64
|
<h2 className="block-editor-block-card__title">{ title }</h2>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
{ description && (
|
|
66
|
+
<span className="block-editor-block-card__description">
|
|
67
|
+
{ description }
|
|
68
|
+
</span>
|
|
69
|
+
) }
|
|
68
70
|
</div>
|
|
69
71
|
</div>
|
|
70
72
|
);
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
.block-editor-block-card {
|
|
2
|
-
display: flex;
|
|
3
2
|
align-items: flex-start;
|
|
3
|
+
color: $gray-900;
|
|
4
|
+
display: flex;
|
|
5
|
+
padding: $grid-unit-20;
|
|
4
6
|
}
|
|
5
7
|
|
|
6
8
|
.block-editor-block-card__content {
|
|
7
9
|
flex-grow: 1;
|
|
8
|
-
margin-bottom: $grid-unit-05;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
.block-editor-block-card__title {
|
|
12
13
|
font-weight: 500;
|
|
13
14
|
|
|
14
15
|
&.block-editor-block-card__title {
|
|
16
|
+
font-size: $default-font-size;
|
|
15
17
|
line-height: $button-size-small;
|
|
16
|
-
margin: 0
|
|
18
|
+
margin: 0;
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
.block-editor-block-card__description {
|
|
23
|
+
display: block;
|
|
21
24
|
font-size: $default-font-size;
|
|
25
|
+
margin-top: $grid-unit-05;
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
.block-editor-block-card .block-editor-block-icon {
|
|
@@ -1,45 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { store as blocksStore } from '@wordpress/blocks';
|
|
5
|
-
import { useSelect } from '@wordpress/data';
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* Internal dependencies
|
|
9
7
|
*/
|
|
10
8
|
import groups from './groups';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
import {
|
|
10
|
+
useBlockEditContext,
|
|
11
|
+
mayDisplayControlsKey,
|
|
12
|
+
mayDisplayParentControlsKey,
|
|
13
|
+
} from '../block-edit/context';
|
|
14
14
|
|
|
15
15
|
export default function useBlockControlsFill( group, shareWithChildBlocks ) {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const isParentDisplayed = useSelect(
|
|
19
|
-
( select ) => {
|
|
20
|
-
if ( ! shareWithChildBlocks ) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const { getBlockName, hasSelectedInnerBlock } =
|
|
25
|
-
select( blockEditorStore );
|
|
26
|
-
const { hasBlockSupport } = select( blocksStore );
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
hasBlockSupport(
|
|
30
|
-
getBlockName( clientId ),
|
|
31
|
-
'__experimentalExposeControlsToChildren',
|
|
32
|
-
false
|
|
33
|
-
) && hasSelectedInnerBlock( clientId )
|
|
34
|
-
);
|
|
35
|
-
},
|
|
36
|
-
[ shareWithChildBlocks, clientId ]
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
if ( isDisplayed ) {
|
|
16
|
+
const context = useBlockEditContext();
|
|
17
|
+
if ( context[ mayDisplayControlsKey ] ) {
|
|
40
18
|
return groups[ group ]?.Fill;
|
|
41
19
|
}
|
|
42
|
-
if (
|
|
20
|
+
if ( context[ mayDisplayParentControlsKey ] && shareWithChildBlocks ) {
|
|
43
21
|
return groups.parent.Fill;
|
|
44
22
|
}
|
|
45
23
|
return null;
|
|
@@ -59,7 +59,7 @@ describe( 'BlockControls', () => {
|
|
|
59
59
|
it( 'should render a dynamic toolbar of controls', () => {
|
|
60
60
|
render(
|
|
61
61
|
<SlotFillProvider>
|
|
62
|
-
<BlockEdit name="core/test-block"
|
|
62
|
+
<BlockEdit name="core/test-block" mayDisplayControls>
|
|
63
63
|
<BlockControls controls={ controls }>
|
|
64
64
|
<p>Child</p>
|
|
65
65
|
</BlockControls>
|
|
@@ -84,7 +84,7 @@ describe( 'BlockControls', () => {
|
|
|
84
84
|
it( 'should render its children', () => {
|
|
85
85
|
render(
|
|
86
86
|
<SlotFillProvider>
|
|
87
|
-
<BlockEdit name="core/test-block"
|
|
87
|
+
<BlockEdit name="core/test-block" mayDisplayControls>
|
|
88
88
|
<BlockControls controls={ controls }>
|
|
89
89
|
<p>Child</p>
|
|
90
90
|
</BlockControls>
|
|
@@ -99,7 +99,7 @@ describe( 'BlockControls', () => {
|
|
|
99
99
|
it( 'should a dynamic toolbar when passed as children', () => {
|
|
100
100
|
render(
|
|
101
101
|
<SlotFillProvider>
|
|
102
|
-
<BlockEdit name="core/test-block"
|
|
102
|
+
<BlockEdit name="core/test-block" mayDisplayControls>
|
|
103
103
|
<BlockControls>
|
|
104
104
|
<ToolbarGroup controls={ controls } />
|
|
105
105
|
</BlockControls>
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { createContext, useContext } from '@wordpress/element';
|
|
5
5
|
|
|
6
|
+
export const mayDisplayControlsKey = Symbol( 'mayDisplayControls' );
|
|
7
|
+
export const mayDisplayParentControlsKey = Symbol( 'mayDisplayParentControls' );
|
|
8
|
+
|
|
6
9
|
export const DEFAULT_BLOCK_EDIT_CONTEXT = {
|
|
7
10
|
name: '',
|
|
8
11
|
isSelected: false,
|
|
@@ -8,7 +8,12 @@ import { hasBlockSupport } from '@wordpress/blocks';
|
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
10
|
import Edit from './edit';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
BlockEditContextProvider,
|
|
13
|
+
useBlockEditContext,
|
|
14
|
+
mayDisplayControlsKey,
|
|
15
|
+
mayDisplayParentControlsKey,
|
|
16
|
+
} from './context';
|
|
12
17
|
|
|
13
18
|
/**
|
|
14
19
|
* The `useBlockEditContext` hook provides information about the block this hook is being used in.
|
|
@@ -20,7 +25,13 @@ import { BlockEditContextProvider, useBlockEditContext } from './context';
|
|
|
20
25
|
*/
|
|
21
26
|
export { useBlockEditContext };
|
|
22
27
|
|
|
23
|
-
export default function BlockEdit(
|
|
28
|
+
export default function BlockEdit( {
|
|
29
|
+
mayDisplayControls,
|
|
30
|
+
mayDisplayParentControls,
|
|
31
|
+
// The remaining props are passed through the BlockEdit filters and are thus
|
|
32
|
+
// public API!
|
|
33
|
+
...props
|
|
34
|
+
} ) {
|
|
24
35
|
const {
|
|
25
36
|
name,
|
|
26
37
|
isSelected,
|
|
@@ -32,19 +43,34 @@ export default function BlockEdit( props ) {
|
|
|
32
43
|
const layoutSupport =
|
|
33
44
|
hasBlockSupport( name, 'layout', false ) ||
|
|
34
45
|
hasBlockSupport( name, '__experimentalLayout', false );
|
|
35
|
-
const context = {
|
|
36
|
-
name,
|
|
37
|
-
isSelected,
|
|
38
|
-
clientId,
|
|
39
|
-
layout: layoutSupport ? layout : null,
|
|
40
|
-
__unstableLayoutClassNames,
|
|
41
|
-
};
|
|
42
46
|
return (
|
|
43
47
|
<BlockEditContextProvider
|
|
44
48
|
// It is important to return the same object if props haven't
|
|
45
49
|
// changed to avoid unnecessary rerenders.
|
|
46
50
|
// See https://reactjs.org/docs/context.html#caveats.
|
|
47
|
-
value={ useMemo(
|
|
51
|
+
value={ useMemo(
|
|
52
|
+
() => ( {
|
|
53
|
+
name,
|
|
54
|
+
isSelected,
|
|
55
|
+
clientId,
|
|
56
|
+
layout: layoutSupport ? layout : null,
|
|
57
|
+
__unstableLayoutClassNames,
|
|
58
|
+
// We use symbols in favour of an __unstable prefix to avoid
|
|
59
|
+
// usage outside of the package (this context is exposed).
|
|
60
|
+
[ mayDisplayControlsKey ]: mayDisplayControls,
|
|
61
|
+
[ mayDisplayParentControlsKey ]: mayDisplayParentControls,
|
|
62
|
+
} ),
|
|
63
|
+
[
|
|
64
|
+
name,
|
|
65
|
+
isSelected,
|
|
66
|
+
clientId,
|
|
67
|
+
layoutSupport,
|
|
68
|
+
layout,
|
|
69
|
+
__unstableLayoutClassNames,
|
|
70
|
+
mayDisplayControls,
|
|
71
|
+
mayDisplayParentControls,
|
|
72
|
+
]
|
|
73
|
+
) }
|
|
48
74
|
>
|
|
49
75
|
<Edit { ...props } />
|
|
50
76
|
</BlockEditContextProvider>
|
|
@@ -7,14 +7,17 @@ import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { unlock } from '../../lock-unlock';
|
|
10
|
-
import
|
|
10
|
+
import {
|
|
11
|
+
useBlockEditContext,
|
|
12
|
+
mayDisplayControlsKey,
|
|
13
|
+
} from '../block-edit/context';
|
|
11
14
|
|
|
12
15
|
const { createPrivateSlotFill } = unlock( componentsPrivateApis );
|
|
13
16
|
const { Fill, Slot } = createPrivateSlotFill( 'BlockInformation' );
|
|
14
17
|
|
|
15
18
|
const BlockInfo = ( props ) => {
|
|
16
|
-
const
|
|
17
|
-
if ( !
|
|
19
|
+
const context = useBlockEditContext();
|
|
20
|
+
if ( ! context[ mayDisplayControlsKey ] ) {
|
|
18
21
|
return null;
|
|
19
22
|
}
|
|
20
23
|
return <Fill { ...props } />;
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
switchToBlockType,
|
|
16
16
|
getDefaultBlockName,
|
|
17
17
|
isUnmodifiedBlock,
|
|
18
|
+
store as blocksStore,
|
|
18
19
|
} from '@wordpress/blocks';
|
|
19
20
|
import { withFilters } from '@wordpress/components';
|
|
20
21
|
import {
|
|
@@ -53,10 +54,18 @@ function mergeWrapperProps( propsA, propsB ) {
|
|
|
53
54
|
...propsB,
|
|
54
55
|
};
|
|
55
56
|
|
|
56
|
-
|
|
57
|
+
// May be set to undefined, so check if the property is set!
|
|
58
|
+
if (
|
|
59
|
+
propsA?.hasOwnProperty( 'className' ) &&
|
|
60
|
+
propsB?.hasOwnProperty( 'className' )
|
|
61
|
+
) {
|
|
57
62
|
newProps.className = classnames( propsA.className, propsB.className );
|
|
58
63
|
}
|
|
59
|
-
|
|
64
|
+
|
|
65
|
+
if (
|
|
66
|
+
propsA?.hasOwnProperty( 'style' ) &&
|
|
67
|
+
propsB?.hasOwnProperty( 'style' )
|
|
68
|
+
) {
|
|
60
69
|
newProps.style = { ...propsA.style, ...propsB.style };
|
|
61
70
|
}
|
|
62
71
|
|
|
@@ -95,21 +104,40 @@ function BlockListBlock( {
|
|
|
95
104
|
themeSupportsLayout,
|
|
96
105
|
isTemporarilyEditingAsBlocks,
|
|
97
106
|
blockEditingMode,
|
|
107
|
+
mayDisplayControls,
|
|
108
|
+
mayDisplayParentControls,
|
|
98
109
|
} = useSelect(
|
|
99
110
|
( select ) => {
|
|
100
111
|
const {
|
|
101
112
|
getSettings,
|
|
102
113
|
__unstableGetTemporarilyEditingAsBlocks,
|
|
103
114
|
getBlockEditingMode,
|
|
115
|
+
getBlockName,
|
|
116
|
+
isFirstMultiSelectedBlock,
|
|
117
|
+
getMultiSelectedBlockClientIds,
|
|
118
|
+
hasSelectedInnerBlock,
|
|
104
119
|
} = select( blockEditorStore );
|
|
120
|
+
const { hasBlockSupport } = select( blocksStore );
|
|
105
121
|
return {
|
|
106
122
|
themeSupportsLayout: getSettings().supportsLayout,
|
|
107
123
|
isTemporarilyEditingAsBlocks:
|
|
108
124
|
__unstableGetTemporarilyEditingAsBlocks() === clientId,
|
|
109
125
|
blockEditingMode: getBlockEditingMode( clientId ),
|
|
126
|
+
mayDisplayControls:
|
|
127
|
+
isSelected ||
|
|
128
|
+
( isFirstMultiSelectedBlock( clientId ) &&
|
|
129
|
+
getMultiSelectedBlockClientIds().every(
|
|
130
|
+
( id ) => getBlockName( id ) === name
|
|
131
|
+
) ),
|
|
132
|
+
mayDisplayParentControls:
|
|
133
|
+
hasBlockSupport(
|
|
134
|
+
getBlockName( clientId ),
|
|
135
|
+
'__experimentalExposeControlsToChildren',
|
|
136
|
+
false
|
|
137
|
+
) && hasSelectedInnerBlock( clientId ),
|
|
110
138
|
};
|
|
111
139
|
},
|
|
112
|
-
[ clientId ]
|
|
140
|
+
[ clientId, isSelected, name ]
|
|
113
141
|
);
|
|
114
142
|
const { removeBlock } = useDispatch( blockEditorStore );
|
|
115
143
|
const onRemove = useCallback( () => removeBlock( clientId ), [ clientId ] );
|
|
@@ -137,6 +165,8 @@ function BlockListBlock( {
|
|
|
137
165
|
__unstableParentLayout={
|
|
138
166
|
Object.keys( parentLayout ).length ? parentLayout : undefined
|
|
139
167
|
}
|
|
168
|
+
mayDisplayControls={ mayDisplayControls }
|
|
169
|
+
mayDisplayParentControls={ mayDisplayParentControls }
|
|
140
170
|
/>
|
|
141
171
|
);
|
|
142
172
|
|
|
@@ -161,6 +191,10 @@ function BlockListBlock( {
|
|
|
161
191
|
!! wrapperProps[ 'data-align' ] &&
|
|
162
192
|
! themeSupportsLayout;
|
|
163
193
|
|
|
194
|
+
// Support for sticky position in classic themes with alignment wrappers.
|
|
195
|
+
|
|
196
|
+
const isSticky = className?.includes( 'is-position-sticky' );
|
|
197
|
+
|
|
164
198
|
// For aligned blocks, provide a wrapper element so the block can be
|
|
165
199
|
// positioned relative to the block column.
|
|
166
200
|
// This is only kept for classic themes that don't support layout
|
|
@@ -172,7 +206,7 @@ function BlockListBlock( {
|
|
|
172
206
|
if ( isAligned ) {
|
|
173
207
|
blockEdit = (
|
|
174
208
|
<div
|
|
175
|
-
className=
|
|
209
|
+
className={ classnames( 'wp-block', isSticky && className ) }
|
|
176
210
|
data-align={ wrapperProps[ 'data-align' ] }
|
|
177
211
|
>
|
|
178
212
|
{ blockEdit }
|
|
@@ -221,7 +255,7 @@ function BlockListBlock( {
|
|
|
221
255
|
isTemporarilyEditingAsBlocks,
|
|
222
256
|
},
|
|
223
257
|
dataAlign && themeSupportsLayout && `align${ dataAlign }`,
|
|
224
|
-
className
|
|
258
|
+
! ( dataAlign && isSticky ) && className
|
|
225
259
|
),
|
|
226
260
|
wrapperProps: restWrapperProps,
|
|
227
261
|
isAligned,
|
|
@@ -148,6 +148,7 @@ function BlockListBlock( {
|
|
|
148
148
|
isDescendentBlockSelected,
|
|
149
149
|
isParentSelected,
|
|
150
150
|
order,
|
|
151
|
+
mayDisplayControls,
|
|
151
152
|
} = useSelect(
|
|
152
153
|
( select ) => {
|
|
153
154
|
const {
|
|
@@ -158,6 +159,9 @@ function BlockListBlock( {
|
|
|
158
159
|
getSelectedBlockClientId,
|
|
159
160
|
getSettings,
|
|
160
161
|
hasSelectedInnerBlock,
|
|
162
|
+
getBlockName,
|
|
163
|
+
isFirstMultiSelectedBlock,
|
|
164
|
+
getMultiSelectedBlockClientIds,
|
|
161
165
|
} = select( blockEditorStore );
|
|
162
166
|
const currentBlockType = getBlockType( name || 'core/missing' );
|
|
163
167
|
const currentBlockCategory = currentBlockType?.category;
|
|
@@ -205,6 +209,12 @@ function BlockListBlock( {
|
|
|
205
209
|
isDescendentBlockSelected: descendentBlockSelected,
|
|
206
210
|
isParentSelected: parentSelected,
|
|
207
211
|
order: blockOrder,
|
|
212
|
+
mayDisplayControls:
|
|
213
|
+
isSelected ||
|
|
214
|
+
( isFirstMultiSelectedBlock( clientId ) &&
|
|
215
|
+
getMultiSelectedBlockClientIds().every(
|
|
216
|
+
( id ) => getBlockName( id ) === name
|
|
217
|
+
) ),
|
|
208
218
|
};
|
|
209
219
|
},
|
|
210
220
|
[ clientId, isSelected, name, rootClientId ]
|
|
@@ -243,10 +253,13 @@ function BlockListBlock( {
|
|
|
243
253
|
);
|
|
244
254
|
|
|
245
255
|
// Block level styles.
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
256
|
+
let wrapperProps = {};
|
|
257
|
+
if ( blockType?.getEditWrapperProps ) {
|
|
258
|
+
wrapperProps = getWrapperProps(
|
|
259
|
+
attributes,
|
|
260
|
+
blockType.getEditWrapperProps
|
|
261
|
+
);
|
|
262
|
+
}
|
|
250
263
|
|
|
251
264
|
// Inherited styles merged with block level styles.
|
|
252
265
|
const mergedStyle = useMemo( () => {
|
|
@@ -346,6 +359,7 @@ function BlockListBlock( {
|
|
|
346
359
|
: undefined
|
|
347
360
|
}
|
|
348
361
|
wrapperProps={ wrapperProps }
|
|
362
|
+
mayDisplayControls={ mayDisplayControls }
|
|
349
363
|
/>
|
|
350
364
|
<View onLayout={ onLayout } />
|
|
351
365
|
</GlobalStylesContext.Provider>
|
|
@@ -605,6 +619,8 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
|
|
|
605
619
|
}
|
|
606
620
|
|
|
607
621
|
moveFirstItemUp( rootClientId );
|
|
622
|
+
} else {
|
|
623
|
+
removeBlock( clientId );
|
|
608
624
|
}
|
|
609
625
|
}
|
|
610
626
|
},
|