@wordpress/block-editor 12.15.0 → 12.16.1-next.79a6196f.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/LICENSE.md +1 -1
- package/README.md +12 -10
- package/build/components/block-canvas/index.js +21 -7
- package/build/components/block-canvas/index.js.map +1 -1
- package/build/components/block-card/index.js +2 -2
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-controls/hook.js +3 -23
- package/build/components/block-controls/hook.js.map +1 -1
- package/build/components/block-draggable/draggable-chip.js +6 -1
- package/build/components/block-draggable/draggable-chip.js.map +1 -1
- package/build/components/block-draggable/index.js +76 -6
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-draggable/index.native.js +0 -6
- package/build/components/block-draggable/index.native.js.map +1 -1
- package/build/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
- package/build/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
- package/build/components/block-edit/context.js +5 -1
- package/build/components/block-edit/context.js.map +1 -1
- package/build/components/block-edit/index.js +18 -9
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-editing-mode/index.js +2 -3
- package/build/components/block-editing-mode/index.js.map +1 -1
- package/build/components/block-info-slot-fill/index.js +3 -4
- package/build/components/block-info-slot-fill/index.js.map +1 -1
- package/build/components/block-inspector/index.js +1 -1
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-list-item-cell.native.js +1 -0
- package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build/components/block-list/block.js +257 -95
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +58 -23
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.native.js +3 -5
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/private-block-context.js +14 -0
- package/build/components/block-list/private-block-context.js.map +1 -0
- package/build/components/block-list/use-block-props/index.js +49 -69
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -29
- package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build/components/block-list/use-block-props/use-is-hovered.js +4 -14
- package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +3 -2
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-list/use-scroll-upon-insertion.native.js +41 -0
- package/build/components/block-list/use-scroll-upon-insertion.native.js.map +1 -0
- package/build/components/block-lock/toolbar.js +21 -27
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-mover/index.js +2 -1
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-patterns-list/index.js +5 -5
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +2 -9
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-rename/modal.js +3 -0
- package/build/components/block-rename/modal.js.map +1 -1
- package/build/components/block-settings/container.native.js +6 -4
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-styles/index.js +1 -1
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/index.native.js +3 -2
- package/build/components/block-styles/index.native.js.map +1 -1
- package/build/components/block-switcher/index.js +4 -4
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +90 -29
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/block-toolbar-breadcrumb.js +49 -0
- package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
- package/build/components/block-tools/block-toolbar-popover.js +84 -0
- package/build/components/block-tools/block-toolbar-popover.js.map +1 -0
- package/build/components/block-tools/index.js +27 -24
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-types-list/index.native.js +4 -3
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/block-variation-picker/index.native.js +2 -1
- package/build/components/block-variation-picker/index.native.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +29 -2
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/border-radius-control/linked-button.js +1 -1
- package/build/components/border-radius-control/linked-button.js.map +1 -1
- package/build/components/colors/utils.js +10 -2
- package/build/components/colors/utils.js.map +1 -1
- package/build/components/colors/with-colors.js +6 -2
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/control.js +28 -17
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/duotone-control/index.js +1 -4
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/font-sizes/utils.js +10 -2
- package/build/components/font-sizes/utils.js.map +1 -1
- package/build/components/global-styles/border-panel.js +2 -1
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +24 -21
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +4 -3
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/effects-panel.js +2 -1
- package/build/components/global-styles/effects-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +6 -3
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/get-global-styles-changes.js +192 -0
- package/build/components/global-styles/get-global-styles-changes.js.map +1 -0
- package/build/components/global-styles/hooks.js +3 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +7 -1
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/index.js +7 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +43 -36
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +22 -8
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +8 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/height-control/index.js +6 -2
- package/build/components/height-control/index.js.map +1 -1
- package/build/components/image-link-destinations/index.native.js +118 -0
- package/build/components/image-link-destinations/index.native.js.map +1 -0
- package/build/components/image-size-control/index.js +2 -2
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/index.native.js +14 -5
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/index.js +61 -22
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/index.native.js +18 -4
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.js +5 -6
- package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +5 -9
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +10 -9
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js +10 -10
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +9 -9
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/utils.js +10 -14
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +4 -14
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/index.js +1 -2
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/library.js +3 -7
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/media-tab/media-panel.js +2 -2
- package/build/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build/components/inserter/menu.js +26 -33
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/preview-panel.js +2 -2
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter/tabs.js +21 -21
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/inserter-button/index.native.js +98 -0
- package/build/components/inserter-button/index.native.js.map +1 -0
- package/build/components/inserter-button/sparkles.js +23 -0
- package/build/components/inserter-button/sparkles.js.map +1 -0
- package/build/components/inserter-draggable-blocks/index.js +8 -4
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inserter-list-item/index.js +2 -4
- package/build/components/inserter-list-item/index.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js +3 -1
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls/fill.js +3 -3
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/fill.native.js +3 -3
- package/build/components/inspector-controls/fill.native.js.map +1 -1
- package/build/components/inspector-controls-tabs/index.js +34 -23
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/list-view/block-select-button.js +4 -0
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +57 -3
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/media-upload-progress/constants.js +19 -0
- package/build/components/media-upload-progress/constants.js.map +1 -0
- package/build/components/media-upload-progress/index.native.js +42 -17
- package/build/components/media-upload-progress/index.native.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +11 -16
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/plain-text/index.native.js +8 -3
- package/build/components/plain-text/index.native.js.map +1 -1
- package/build/components/preview-options/index.js +6 -62
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/provider/index.js +3 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-sync.js +7 -1
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/rich-text/content.js +26 -23
- package/build/components/rich-text/content.js.map +1 -1
- package/build/components/rich-text/get-rich-text-values.js +2 -1
- package/build/components/rich-text/get-rich-text-values.js.map +1 -1
- package/build/components/rich-text/index.js +19 -37
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +9 -16
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/native/get-format-colors.native.js +22 -24
- package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +22 -57
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/rich-text/use-input-rules.js +7 -3
- package/build/components/rich-text/use-input-rules.js.map +1 -1
- package/build/components/rich-text/use-mark-persistent.js +1 -1
- package/build/components/rich-text/use-mark-persistent.js.map +1 -1
- package/build/components/rich-text/with-deprecations.js +50 -0
- package/build/components/rich-text/with-deprecations.js.map +1 -0
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/url-input/index.js +9 -6
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-commands/index.js +14 -18
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +108 -17
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +100 -92
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +9 -12
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +4 -1
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/components/use-settings/index.js +14 -0
- package/build/components/use-settings/index.js.map +1 -1
- package/build/components/writing-flow/index.js +0 -1
- package/build/components/writing-flow/index.js.map +1 -1
- package/build/components/writing-flow/use-drag-selection.js +15 -4
- package/build/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build/components/writing-flow/use-selection-observer.js +73 -27
- package/build/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +7 -4
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/align.js +21 -69
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/align.native.js +11 -1
- package/build/hooks/align.native.js.map +1 -1
- package/build/hooks/anchor.js +14 -30
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/aria-label.js +9 -1
- package/build/hooks/aria-label.js.map +1 -1
- package/build/hooks/background.js +198 -36
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-hooks.js +24 -32
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-renaming.js +18 -22
- package/build/hooks/block-renaming.js.map +1 -1
- package/build/hooks/border.js +53 -80
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +79 -90
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/content-lock-ui.js +29 -29
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/custom-class-name.js +13 -30
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/custom-class-name.native.js +9 -1
- package/build/hooks/custom-class-name.native.js.map +1 -1
- package/build/hooks/dimensions.js +13 -14
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +31 -61
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-family.js +23 -28
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +52 -120
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/index.js +27 -16
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +15 -6
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/layout-child.js +68 -0
- package/build/hooks/layout-child.js.map +1 -0
- package/build/hooks/layout.js +25 -104
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/padding.js +2 -2
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/position.js +40 -62
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/style.js +52 -89
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/typography.js +25 -10
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/typography.native.js +43 -18
- package/build/hooks/typography.native.js.map +1 -1
- package/build/hooks/use-typography-props.js +10 -2
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/hooks/utils.js +200 -10
- package/build/hooks/utils.js.map +1 -1
- package/build/private-apis.js +2 -6
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +0 -2
- package/build/private-apis.native.js.map +1 -1
- package/build/store/actions.js +0 -16
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +54 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +46 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +18 -2
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +11 -73
- package/build/store/selectors.js.map +1 -1
- package/build/store/undo-ignore.js +12 -0
- package/build/store/undo-ignore.js.map +1 -0
- package/build/store/utils.js +66 -0
- package/build/store/utils.js.map +1 -0
- package/build/utils/get-px-from-css-unit.js +16 -0
- package/build/utils/get-px-from-css-unit.js.map +1 -0
- package/build/utils/index.js +2 -2
- package/build/utils/index.js.map +1 -1
- package/build/utils/object.js +38 -99
- package/build/utils/object.js.map +1 -1
- package/build/utils/selection.js +9 -1
- package/build/utils/selection.js.map +1 -1
- package/build/utils/use-can-block-toolbar-be-focused.js +46 -0
- package/build/utils/use-can-block-toolbar-be-focused.js.map +1 -0
- package/build-module/components/block-canvas/index.js +22 -8
- package/build-module/components/block-canvas/index.js.map +1 -1
- package/build-module/components/block-card/index.js +2 -2
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-controls/hook.js +4 -24
- package/build-module/components/block-controls/hook.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.js +6 -1
- package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
- package/build-module/components/block-draggable/index.js +76 -6
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-draggable/index.native.js +1 -7
- package/build-module/components/block-draggable/index.native.js.map +1 -1
- package/build-module/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
- package/build-module/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
- package/build-module/components/block-edit/context.js +2 -0
- package/build-module/components/block-edit/context.js.map +1 -1
- package/build-module/components/block-edit/index.js +19 -10
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-editing-mode/index.js +3 -4
- package/build-module/components/block-editing-mode/index.js.map +1 -1
- package/build-module/components/block-info-slot-fill/index.js +3 -3
- package/build-module/components/block-info-slot-fill/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +1 -1
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-list-item-cell.native.js +1 -0
- package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build-module/components/block-list/block.js +261 -99
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +60 -25
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.native.js +3 -5
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/private-block-context.js +6 -0
- package/build-module/components/block-list/private-block-context.js.map +1 -0
- package/build-module/components/block-list/use-block-props/index.js +50 -70
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -29
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-is-hovered.js +4 -14
- package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +3 -2
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-list/use-scroll-upon-insertion.native.js +33 -0
- package/build-module/components/block-list/use-scroll-upon-insertion.native.js.map +1 -0
- package/build-module/components/block-lock/toolbar.js +22 -28
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-mover/index.js +2 -1
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +6 -6
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +3 -10
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-rename/modal.js +3 -0
- package/build-module/components/block-rename/modal.js.map +1 -1
- package/build-module/components/block-settings/container.native.js +4 -2
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-styles/index.js +1 -1
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/index.native.js +3 -2
- package/build-module/components/block-styles/index.native.js.map +1 -1
- package/build-module/components/block-switcher/index.js +4 -4
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +89 -27
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js +41 -0
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
- package/build-module/components/block-tools/block-toolbar-popover.js +74 -0
- package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -0
- package/build-module/components/block-tools/index.js +27 -24
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js +2 -1
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/block-variation-picker/index.native.js +2 -1
- package/build-module/components/block-variation-picker/index.native.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +30 -3
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/border-radius-control/linked-button.js +1 -1
- package/build-module/components/border-radius-control/linked-button.js.map +1 -1
- package/build-module/components/colors/utils.js +9 -1
- package/build-module/components/colors/utils.js.map +1 -1
- package/build-module/components/colors/with-colors.js +5 -1
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +29 -18
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/duotone-control/index.js +1 -4
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/font-sizes/utils.js +9 -1
- package/build-module/components/font-sizes/utils.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +3 -2
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +26 -23
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +5 -4
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/effects-panel.js +3 -2
- package/build-module/components/global-styles/effects-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +8 -5
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/get-global-styles-changes.js +184 -0
- package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -0
- package/build-module/components/global-styles/hooks.js +3 -2
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +7 -1
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/index.js +1 -0
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +45 -38
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +15 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +7 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/height-control/index.js +6 -2
- package/build-module/components/height-control/index.js.map +1 -1
- package/build-module/components/image-link-destinations/index.native.js +109 -0
- package/build-module/components/image-link-destinations/index.native.js.map +1 -0
- package/build-module/components/image-size-control/index.js +2 -2
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/index.native.js +3 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +62 -23
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.native.js +18 -4
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js +5 -6
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js +6 -10
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +11 -10
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +11 -11
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +11 -11
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/utils.js +7 -11
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js +4 -14
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +2 -2
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/index.js +1 -2
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/library.js +3 -7
- package/build-module/components/inserter/library.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build-module/components/inserter/menu.js +26 -33
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +2 -2
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter/tabs.js +22 -22
- package/build-module/components/inserter/tabs.js.map +1 -1
- package/build-module/components/inserter-button/index.native.js +89 -0
- package/build-module/components/inserter-button/index.native.js.map +1 -0
- package/build-module/components/inserter-button/sparkles.js +15 -0
- package/build-module/components/inserter-button/sparkles.js.map +1 -0
- package/build-module/components/inserter-draggable-blocks/index.js +9 -5
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inserter-list-item/index.js +2 -4
- package/build-module/components/inserter-list-item/index.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js +3 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +3 -3
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls/fill.native.js +3 -3
- package/build-module/components/inspector-controls/fill.native.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +35 -24
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +4 -0
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +58 -4
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/media-upload-progress/constants.js +7 -0
- package/build-module/components/media-upload-progress/constants.js.map +1 -0
- package/build-module/components/media-upload-progress/index.native.js +37 -8
- package/build-module/components/media-upload-progress/index.native.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +11 -16
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/plain-text/index.native.js +6 -1
- package/build-module/components/plain-text/index.native.js.map +1 -1
- package/build-module/components/preview-options/index.js +6 -62
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/provider/index.js +3 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +7 -1
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/rich-text/content.js +25 -21
- package/build-module/components/rich-text/content.js.map +1 -1
- package/build-module/components/rich-text/get-rich-text-values.js +2 -1
- package/build-module/components/rich-text/get-rich-text-values.js.map +1 -1
- package/build-module/components/rich-text/index.js +21 -39
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +10 -18
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/get-format-colors.native.js +22 -24
- package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +22 -56
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/rich-text/use-input-rules.js +7 -3
- package/build-module/components/rich-text/use-input-rules.js.map +1 -1
- package/build-module/components/rich-text/use-mark-persistent.js +1 -1
- package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
- package/build-module/components/rich-text/with-deprecations.js +42 -0
- package/build-module/components/rich-text/with-deprecations.js.map +1 -0
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/url-input/index.js +9 -6
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +14 -18
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +107 -18
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +102 -94
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +9 -12
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +4 -1
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +13 -1
- package/build-module/components/use-settings/index.js.map +1 -1
- package/build-module/components/writing-flow/index.js +0 -1
- package/build-module/components/writing-flow/index.js.map +1 -1
- package/build-module/components/writing-flow/use-drag-selection.js +15 -4
- package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-selection-observer.js +73 -27
- package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +7 -4
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/align.js +20 -67
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/align.native.js +1 -0
- package/build-module/hooks/align.native.js.map +1 -1
- package/build-module/hooks/anchor.js +12 -27
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/aria-label.js +7 -1
- package/build-module/hooks/aria-label.js.map +1 -1
- package/build-module/hooks/background.js +197 -37
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-hooks.js +22 -30
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-renaming.js +17 -21
- package/build-module/hooks/block-renaming.js.map +1 -1
- package/build-module/hooks/border.js +52 -79
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +78 -88
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +27 -27
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/custom-class-name.js +12 -28
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/custom-class-name.native.js +7 -1
- package/build-module/hooks/custom-class-name.native.js.map +1 -1
- package/build-module/hooks/dimensions.js +15 -16
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +30 -61
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-family.js +20 -25
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +50 -120
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/index.js +20 -16
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +10 -6
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/layout-child.js +60 -0
- package/build-module/hooks/layout-child.js.map +1 -0
- package/build-module/hooks/layout.js +21 -100
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/padding.js +2 -2
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/position.js +38 -59
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/style.js +52 -85
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/typography.js +26 -11
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/typography.native.js +43 -17
- package/build-module/hooks/typography.native.js.map +1 -1
- package/build-module/hooks/use-typography-props.js +9 -1
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/hooks/utils.js +194 -9
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/private-apis.js +2 -6
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +0 -2
- package/build-module/private-apis.native.js.map +1 -1
- package/build-module/store/actions.js +0 -15
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +52 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +44 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +18 -2
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +4 -65
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/undo-ignore.js +5 -0
- package/build-module/store/undo-ignore.js.map +1 -0
- package/build-module/store/utils.js +56 -0
- package/build-module/store/utils.js.map +1 -0
- package/build-module/utils/get-px-from-css-unit.js +9 -0
- package/build-module/utils/get-px-from-css-unit.js.map +1 -0
- package/build-module/utils/index.js +1 -1
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/object.js +37 -97
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/selection.js +9 -1
- package/build-module/utils/selection.js.map +1 -1
- package/build-module/utils/use-can-block-toolbar-be-focused.js +40 -0
- package/build-module/utils/use-can-block-toolbar-be-focused.js.map +1 -0
- package/build-style/content-rtl.css +7 -6
- package/build-style/content.css +7 -6
- package/build-style/style-rtl.css +164 -301
- package/build-style/style.css +164 -301
- package/package.json +31 -31
- package/src/components/alignment-control/README.md +0 -5
- package/src/components/block-alignment-control/README.md +0 -5
- package/src/components/block-alignment-matrix-control/README.md +0 -10
- package/src/components/block-breadcrumb/README.md +0 -5
- package/src/components/block-canvas/index.js +29 -17
- package/src/components/block-canvas/style.scss +6 -0
- package/src/components/block-caption/README.md +2 -7
- package/src/components/block-card/README.md +0 -5
- package/src/components/block-card/index.js +6 -4
- package/src/components/block-card/style.scss +7 -3
- package/src/components/block-controls/hook.js +8 -30
- package/src/components/block-controls/test/index.js +3 -3
- package/src/components/block-draggable/draggable-chip.js +11 -1
- package/src/components/block-draggable/index.js +116 -4
- package/src/components/block-draggable/index.native.js +0 -5
- package/src/components/block-draggable/style.scss +35 -0
- package/src/components/block-draggable/test/helpers.native.js +8 -7
- package/src/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
- package/src/components/block-edit/context.js +3 -0
- package/src/components/block-edit/index.js +36 -10
- package/src/components/block-editing-mode/index.js +3 -3
- package/src/components/block-icon/README.md +0 -5
- package/src/components/block-info-slot-fill/index.js +6 -3
- package/src/components/block-inspector/README.md +0 -5
- package/src/components/block-inspector/index.js +3 -1
- package/src/components/block-inspector/style.scss +0 -4
- package/src/components/block-list/block-list-item-cell.native.js +5 -1
- package/src/components/block-list/block.js +309 -104
- package/src/components/block-list/block.native.js +69 -21
- package/src/components/block-list/content.scss +14 -10
- package/src/components/block-list/index.native.js +3 -5
- package/src/components/block-list/{block-list-block-context.js → private-block-context.js} +1 -1
- package/src/components/block-list/use-block-props/index.js +43 -86
- package/src/components/block-list/use-block-props/use-focus-first-element.js +1 -34
- package/src/components/block-list/use-block-props/use-is-hovered.js +2 -13
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +1 -5
- package/src/components/block-list/use-in-between-inserter.js +4 -1
- package/src/components/block-list/use-scroll-upon-insertion.native.js +52 -0
- package/src/components/block-lock/toolbar.js +23 -34
- package/src/components/block-mover/README.md +0 -5
- package/src/components/block-mover/index.js +1 -1
- package/src/components/block-parent-selector/README.md +0 -5
- package/src/components/block-patterns-list/README.md +0 -5
- package/src/components/block-patterns-list/index.js +9 -6
- package/src/components/block-removal-warning-modal/index.js +7 -14
- package/src/components/block-rename/modal.js +7 -1
- package/src/components/block-settings/container.native.js +3 -5
- package/src/components/block-styles/index.js +1 -1
- package/src/components/block-styles/index.native.js +4 -2
- package/src/components/block-styles/style.scss +0 -11
- package/src/components/block-switcher/index.js +49 -59
- package/src/components/block-switcher/test/__snapshots__/index.js.snap +3 -1
- package/src/components/block-toolbar/README.md +0 -5
- package/src/components/block-toolbar/index.js +179 -95
- package/src/components/block-toolbar/style.scss +50 -66
- package/src/components/block-tools/block-toolbar-breadcrumb.js +46 -0
- package/src/components/block-tools/block-toolbar-popover.js +84 -0
- package/src/components/block-tools/index.js +42 -29
- package/src/components/block-tools/style.scss +60 -172
- package/src/components/block-types-list/README.md +0 -5
- package/src/components/block-types-list/index.native.js +2 -1
- package/src/components/block-variation-picker/README.md +0 -5
- package/src/components/block-variation-picker/index.native.js +1 -1
- package/src/components/block-variation-transforms/README.md +0 -5
- package/src/components/block-variation-transforms/index.js +49 -3
- package/src/components/border-radius-control/linked-button.js +1 -1
- package/src/components/caption/README.md +0 -5
- package/src/components/color-palette/test/__snapshots__/control.js.snap +0 -1
- package/src/components/colors/utils.js +8 -1
- package/src/components/colors/with-colors.js +3 -1
- package/src/components/colors-gradients/control.js +49 -30
- package/src/components/colors-gradients/style.scss +0 -7
- package/src/components/contrast-checker/README.md +0 -4
- package/src/components/copy-handler/README.md +0 -10
- package/src/components/duotone-control/index.js +2 -5
- package/src/components/duotone-control/style.scss +1 -6
- package/src/components/font-sizes/utils.js +7 -1
- package/src/components/global-styles/border-panel.js +2 -1
- package/src/components/global-styles/color-panel.js +36 -26
- package/src/components/global-styles/dimensions-panel.js +4 -3
- package/src/components/global-styles/effects-panel.js +2 -1
- package/src/components/global-styles/filters-panel.js +6 -5
- package/src/components/global-styles/get-global-styles-changes.js +210 -0
- package/src/components/global-styles/hooks.js +5 -0
- package/src/components/global-styles/image-settings-panel.js +6 -0
- package/src/components/global-styles/index.js +1 -0
- package/src/components/global-styles/test/get-global-styles-changes.js +234 -0
- package/src/components/global-styles/typography-panel.js +60 -47
- package/src/components/global-styles/use-global-styles-output.js +9 -5
- package/src/components/global-styles/utils.js +7 -0
- package/src/components/height-control/README.md +2 -7
- package/src/components/height-control/index.js +4 -0
- package/src/components/image-link-destinations/index.native.js +152 -0
- package/src/components/image-link-destinations/style.native.scss +16 -0
- package/src/components/image-size-control/index.js +5 -2
- package/src/components/index.native.js +3 -2
- package/src/components/inner-blocks/README.md +13 -2
- package/src/components/inner-blocks/index.js +68 -29
- package/src/components/inner-blocks/index.native.js +19 -7
- package/src/components/inner-blocks/use-inner-block-template-sync.js +5 -7
- package/src/components/inner-blocks/use-nested-settings-update.js +6 -13
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +15 -15
- package/src/components/inserter/block-patterns-tab/patterns-filter.js +15 -13
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +15 -18
- package/src/components/inserter/block-patterns-tab/utils.js +11 -12
- package/src/components/inserter/hooks/use-block-types-state.js +9 -11
- package/src/components/inserter/hooks/use-patterns-state.js +2 -2
- package/src/components/inserter/index.js +0 -1
- package/src/components/inserter/library.js +2 -8
- package/src/components/inserter/media-tab/media-panel.js +1 -1
- package/src/components/inserter/menu.js +26 -36
- package/src/components/inserter/preview-panel.js +2 -2
- package/src/components/inserter/style.scss +21 -21
- package/src/components/inserter/tabs.js +34 -25
- package/src/components/inserter-button/README.md +62 -0
- package/src/components/inserter-button/index.native.js +116 -0
- package/src/components/inserter-button/sparkles.js +15 -0
- package/src/components/inserter-button/style.native.scss +72 -0
- package/src/components/inserter-draggable-blocks/index.js +18 -5
- package/src/components/inserter-list-item/index.js +6 -6
- package/src/components/inspector-controls/block-support-tools-panel.js +2 -0
- package/src/components/inspector-controls/fill.js +6 -3
- package/src/components/inspector-controls/fill.native.js +6 -3
- package/src/components/inspector-controls-tabs/index.js +39 -28
- package/src/components/inspector-controls-tabs/style.scss +3 -2
- package/src/components/letter-spacing-control/README.md +0 -5
- package/src/components/line-height-control/README.md +0 -5
- package/src/components/link-control/style.scss +1 -1
- package/src/components/link-control/test/index.js +1 -1
- package/src/components/list-view/README.md +0 -5
- package/src/components/list-view/block-select-button.js +4 -0
- package/src/components/list-view/block.js +73 -2
- package/src/components/list-view/style.scss +6 -0
- package/src/components/media-upload-progress/constants.js +6 -0
- package/src/components/media-upload-progress/index.native.js +66 -14
- package/src/components/media-upload-progress/test/index.native.js +2 -2
- package/src/components/multi-selection-inspector/README.md +0 -5
- package/src/components/navigable-toolbar/README.md +2 -0
- package/src/components/navigable-toolbar/index.js +15 -13
- package/src/components/plain-text/index.native.js +6 -1
- package/src/components/preview-options/index.js +6 -86
- package/src/components/provider/index.js +1 -1
- package/src/components/provider/test/use-block-sync.js +20 -17
- package/src/components/provider/use-block-sync.js +6 -0
- package/src/components/rich-text/content.js +27 -20
- package/src/components/rich-text/get-rich-text-values.js +6 -1
- package/src/components/rich-text/index.js +23 -52
- package/src/components/rich-text/index.native.js +8 -25
- package/src/components/rich-text/native/get-format-colors.native.js +33 -40
- package/src/components/rich-text/native/index.native.js +22 -71
- package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +3 -3
- package/src/components/rich-text/native/test/index.native.js +72 -5
- package/src/components/rich-text/use-input-rules.js +8 -3
- package/src/components/rich-text/use-mark-persistent.js +1 -2
- package/src/components/rich-text/with-deprecations.js +51 -0
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/src/components/text-decoration-control/README.md +40 -0
- package/src/components/text-transform-control/README.md +0 -4
- package/src/components/ungroup-button/README.md +0 -5
- package/src/components/unit-control/README.md +0 -4
- package/src/components/url-input/index.js +11 -11
- package/src/components/use-block-commands/index.js +18 -21
- package/src/components/use-block-drop-zone/index.js +181 -30
- package/src/components/use-moving-animation/index.js +107 -103
- package/src/components/use-on-block-drop/index.js +9 -24
- package/src/components/use-on-block-drop/test/index.js +12 -26
- package/src/components/use-resize-canvas/README.md +3 -7
- package/src/components/use-resize-canvas/index.js +4 -1
- package/src/components/use-settings/README.md +0 -4
- package/src/components/use-settings/index.js +15 -1
- package/src/components/writing-flow/index.js +0 -1
- package/src/components/writing-flow/use-drag-selection.js +18 -4
- package/src/components/writing-flow/use-selection-observer.js +99 -37
- package/src/components/writing-flow/use-tab-nav.js +7 -7
- package/src/hooks/align.js +16 -81
- package/src/hooks/align.native.js +1 -0
- package/src/hooks/anchor.js +14 -38
- package/src/hooks/aria-label.js +8 -5
- package/src/hooks/background.js +269 -32
- package/src/hooks/block-hooks.js +22 -51
- package/src/hooks/block-renaming.js +23 -37
- package/src/hooks/border.js +62 -124
- package/src/hooks/color.js +111 -138
- package/src/hooks/content-lock-ui.js +110 -122
- package/src/hooks/custom-class-name.js +9 -45
- package/src/hooks/custom-class-name.native.js +8 -5
- package/src/hooks/dimensions.js +14 -16
- package/src/hooks/duotone.js +70 -127
- package/src/hooks/font-family.js +14 -36
- package/src/hooks/font-size.js +67 -168
- package/src/hooks/index.js +58 -16
- package/src/hooks/index.native.js +22 -6
- package/src/hooks/layout-child.js +53 -0
- package/src/hooks/layout.js +17 -103
- package/src/hooks/padding.js +2 -2
- package/src/hooks/position.js +50 -90
- package/src/hooks/style.js +118 -193
- package/src/hooks/test/align.js +1 -178
- package/src/hooks/test/anchor.js +4 -9
- package/src/hooks/test/custom-class-name.js +3 -8
- package/src/hooks/test/style.js +4 -14
- package/src/hooks/typography.js +14 -16
- package/src/hooks/typography.native.js +31 -33
- package/src/hooks/use-typography-props.js +7 -1
- package/src/hooks/utils.js +261 -10
- package/src/private-apis.js +2 -6
- package/src/private-apis.native.js +0 -2
- package/src/store/actions.js +0 -15
- package/src/store/private-actions.js +48 -0
- package/src/store/private-selectors.js +56 -0
- package/src/store/reducer.js +20 -1
- package/src/store/selectors.js +10 -82
- package/src/store/undo-ignore.js +4 -0
- package/src/store/utils.js +74 -0
- package/src/style.scss +1 -2
- package/src/utils/get-px-from-css-unit.js +8 -0
- package/src/utils/index.js +1 -1
- package/src/utils/object.js +34 -104
- package/src/utils/selection.js +9 -2
- package/src/utils/test/object.js +1 -96
- package/src/utils/use-can-block-toolbar-be-focused.js +48 -0
- package/build/components/block-list/block-list-block-context.js +0 -14
- package/build/components/block-list/block-list-block-context.js.map +0 -1
- package/build/components/block-list/use-block-props/use-block-class-names.js +0 -67
- package/build/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js +0 -46
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
- package/build/components/block-list/use-block-props/use-block-default-class-name.js +0 -37
- package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
- package/build/components/block-tools/back-compat.js +0 -45
- package/build/components/block-tools/back-compat.js.map +0 -1
- package/build/components/block-tools/block-contextual-toolbar.js +0 -91
- package/build/components/block-tools/block-contextual-toolbar.js.map +0 -1
- package/build/components/block-tools/selected-block-tools.js +0 -113
- package/build/components/block-tools/selected-block-tools.js.map +0 -1
- package/build/components/inserter/hooks/use-debounced-input.js +0 -22
- package/build/components/inserter/hooks/use-debounced-input.js.map +0 -1
- package/build/components/use-display-block-controls/index.js +0 -39
- package/build/components/use-display-block-controls/index.js.map +0 -1
- package/build/components/use-display-block-controls/index.native.js +0 -39
- package/build/components/use-display-block-controls/index.native.js.map +0 -1
- package/build/hooks/custom-fields.js +0 -120
- package/build/hooks/custom-fields.js.map +0 -1
- package/build/utils/parse-css-unit-to-px.js +0 -302
- package/build/utils/parse-css-unit-to-px.js.map +0 -1
- package/build/utils/use-should-contextual-toolbar-show.js +0 -63
- package/build/utils/use-should-contextual-toolbar-show.js.map +0 -1
- package/build-module/components/block-list/block-list-block-context.js +0 -6
- package/build-module/components/block-list/block-list-block-context.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-class-names.js +0 -60
- package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +0 -40
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +0 -31
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
- package/build-module/components/block-tools/back-compat.js +0 -35
- package/build-module/components/block-tools/back-compat.js.map +0 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +0 -83
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +0 -1
- package/build-module/components/block-tools/selected-block-tools.js +0 -105
- package/build-module/components/block-tools/selected-block-tools.js.map +0 -1
- package/build-module/components/inserter/hooks/use-debounced-input.js +0 -15
- package/build-module/components/inserter/hooks/use-debounced-input.js.map +0 -1
- package/build-module/components/use-display-block-controls/index.js +0 -32
- package/build-module/components/use-display-block-controls/index.js.map +0 -1
- package/build-module/components/use-display-block-controls/index.native.js +0 -32
- package/build-module/components/use-display-block-controls/index.native.js.map +0 -1
- package/build-module/hooks/custom-fields.js +0 -118
- package/build-module/hooks/custom-fields.js.map +0 -1
- package/build-module/utils/parse-css-unit-to-px.js +0 -294
- package/build-module/utils/parse-css-unit-to-px.js.map +0 -1
- package/build-module/utils/use-should-contextual-toolbar-show.js +0 -57
- package/build-module/utils/use-should-contextual-toolbar-show.js.map +0 -1
- package/src/components/block-list/use-block-props/use-block-class-names.js +0 -66
- package/src/components/block-list/use-block-props/use-block-custom-class-name.js +0 -44
- package/src/components/block-list/use-block-props/use-block-default-class-name.js +0 -35
- package/src/components/block-parent-selector/style.scss +0 -11
- package/src/components/block-tools/back-compat.js +0 -35
- package/src/components/block-tools/block-contextual-toolbar.js +0 -100
- package/src/components/block-tools/selected-block-tools.js +0 -127
- package/src/components/inserter/hooks/use-debounced-input.js +0 -18
- package/src/components/preview-options/README.md +0 -94
- package/src/components/preview-options/style.scss +0 -64
- package/src/components/use-display-block-controls/index.js +0 -36
- package/src/components/use-display-block-controls/index.native.js +0 -37
- package/src/hooks/custom-fields.js +0 -142
- package/src/hooks/test/color.js +0 -112
- package/src/utils/parse-css-unit-to-px.js +0 -329
- package/src/utils/test/parse-css-unit-to-px.js +0 -172
- package/src/utils/use-should-contextual-toolbar-show.js +0 -85
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.16.1-next.79a6196f.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.1-next.79a6196f.0",
|
|
39
|
+
"@wordpress/api-fetch": "^6.45.1-next.79a6196f.0",
|
|
40
|
+
"@wordpress/blob": "^3.48.1-next.79a6196f.0",
|
|
41
|
+
"@wordpress/blocks": "^12.25.1-next.79a6196f.0",
|
|
42
|
+
"@wordpress/commands": "^0.19.1-next.79a6196f.0",
|
|
43
|
+
"@wordpress/components": "^25.15.1-next.79a6196f.0",
|
|
44
|
+
"@wordpress/compose": "^6.25.1-next.79a6196f.0",
|
|
45
|
+
"@wordpress/data": "^9.18.1-next.79a6196f.0",
|
|
46
|
+
"@wordpress/date": "^4.48.1-next.79a6196f.0",
|
|
47
|
+
"@wordpress/deprecated": "^3.48.1-next.79a6196f.0",
|
|
48
|
+
"@wordpress/dom": "^3.48.1-next.79a6196f.0",
|
|
49
|
+
"@wordpress/element": "^5.25.1-next.79a6196f.0",
|
|
50
|
+
"@wordpress/escape-html": "^2.48.1-next.79a6196f.0",
|
|
51
|
+
"@wordpress/hooks": "^3.48.1-next.79a6196f.0",
|
|
52
|
+
"@wordpress/html-entities": "^3.48.1-next.79a6196f.0",
|
|
53
|
+
"@wordpress/i18n": "^4.48.1-next.79a6196f.0",
|
|
54
|
+
"@wordpress/icons": "^9.39.1-next.79a6196f.0",
|
|
55
|
+
"@wordpress/is-shallow-equal": "^4.48.1-next.79a6196f.0",
|
|
56
|
+
"@wordpress/keyboard-shortcuts": "^4.25.1-next.79a6196f.0",
|
|
57
|
+
"@wordpress/keycodes": "^3.48.1-next.79a6196f.0",
|
|
58
|
+
"@wordpress/notices": "^4.16.1-next.79a6196f.0",
|
|
59
|
+
"@wordpress/preferences": "^3.25.1-next.79a6196f.0",
|
|
60
|
+
"@wordpress/private-apis": "^0.30.1-next.79a6196f.0",
|
|
61
|
+
"@wordpress/rich-text": "^6.25.1-next.79a6196f.0",
|
|
62
|
+
"@wordpress/style-engine": "^1.31.1-next.79a6196f.0",
|
|
63
|
+
"@wordpress/token-list": "^2.48.1-next.79a6196f.0",
|
|
64
|
+
"@wordpress/url": "^3.49.1-next.79a6196f.0",
|
|
65
|
+
"@wordpress/warning": "^2.48.1-next.79a6196f.0",
|
|
66
|
+
"@wordpress/wordcount": "^3.48.1-next.79a6196f.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": "1e74b942ac0119a22ceaaf5c9594263f3ec516ab"
|
|
91
91
|
}
|
|
@@ -6,11 +6,6 @@ This component is mostly used for blocks that display text, such as Heading, Par
|
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
9
|
-
## Table of contents
|
|
10
|
-
|
|
11
|
-
1. [Development guidelines](#development-guidelines)
|
|
12
|
-
2. [Related components](#related-components)
|
|
13
|
-
|
|
14
9
|
## Development guidelines
|
|
15
10
|
|
|
16
11
|
### Usage
|
|
@@ -4,11 +4,6 @@ The `BlockAlignmentToolbar` component is used to render block alignment options
|
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
## Table of contents
|
|
8
|
-
|
|
9
|
-
1. [Development guidelines](#development-guidelines)
|
|
10
|
-
2. [Related components](#related-components)
|
|
11
|
-
|
|
12
7
|
## Development guidelines
|
|
13
8
|
|
|
14
9
|
### Usage
|
|
@@ -4,16 +4,6 @@ The alignment matrix control allows users to quickly adjust inner block alignmen
|
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
## Table of contents
|
|
8
|
-
|
|
9
|
-
- [Alignment Matrix Control](#alignment-matrix-control)
|
|
10
|
-
- [Table of contents](#table-of-contents)
|
|
11
|
-
- [Design guidelines](#design-guidelines)
|
|
12
|
-
- [Usage](#usage)
|
|
13
|
-
- [Development guidelines](#development-guidelines)
|
|
14
|
-
- [Usage](#usage-1)
|
|
15
|
-
- [Props](#props)
|
|
16
|
-
|
|
17
7
|
## Design guidelines
|
|
18
8
|
|
|
19
9
|
### Usage
|
|
@@ -6,11 +6,6 @@ The block breadcrumb trail displays the hierarchy of the current block selection
|
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
9
|
-
## Table of contents
|
|
10
|
-
|
|
11
|
-
1. [Development guidelines](#development-guidelines)
|
|
12
|
-
2. [Related components](#related-components)
|
|
13
|
-
|
|
14
9
|
## Development guidelines
|
|
15
10
|
|
|
16
11
|
#### Props
|
|
@@ -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,35 @@ 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
|
+
...iframeProps?.style,
|
|
67
|
+
} }
|
|
68
|
+
name="editor-canvas"
|
|
69
|
+
>
|
|
70
|
+
<EditorStyles styles={ styles } />
|
|
71
|
+
{ children }
|
|
72
|
+
</Iframe>
|
|
73
|
+
</BlockTools>
|
|
62
74
|
);
|
|
63
75
|
}
|
|
64
76
|
|
|
@@ -4,11 +4,6 @@ The `BlockCaption` component renders block-level UI for adding and editing capti
|
|
|
4
4
|
|
|
5
5
|
`BlockCaption` is used in several native blocks, including `Video`, `Image`, `Audio`, etc.
|
|
6
6
|
|
|
7
|
-
## Table of contents
|
|
8
|
-
|
|
9
|
-
1. [Development guidelines](#development-guidelines)
|
|
10
|
-
2. [Related components](#related-components)
|
|
11
|
-
|
|
12
7
|
## Development guidelines
|
|
13
8
|
|
|
14
9
|
### Usage
|
|
@@ -16,7 +11,7 @@ The `BlockCaption` component renders block-level UI for adding and editing capti
|
|
|
16
11
|
Renders an editable caption field designed specifically for block-level use.
|
|
17
12
|
|
|
18
13
|
```jsx
|
|
19
|
-
import { BlockCaption } from '@wordpress/block-editor';
|
|
14
|
+
import { BlockCaption, RichText } from '@wordpress/block-editor';
|
|
20
15
|
|
|
21
16
|
const MyBlockCaption = (
|
|
22
17
|
clientId,
|
|
@@ -29,7 +24,7 @@ const MyBlockCaption = (
|
|
|
29
24
|
clientId={ clientId }
|
|
30
25
|
accessible={ true }
|
|
31
26
|
accessibilityLabelCreator={ ( caption ) =>
|
|
32
|
-
|
|
27
|
+
RichText.isEmpty( caption )
|
|
33
28
|
? /* translators: accessibility text. Empty caption. */
|
|
34
29
|
'Caption. Empty'
|
|
35
30
|
: sprintf(
|
|
@@ -6,11 +6,6 @@ In the editor, this component is displayed in two different places: in the block
|
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
9
|
-
## Table of contents
|
|
10
|
-
|
|
11
|
-
1. [Development guidelines](#development-guidelines)
|
|
12
|
-
2. [Related components](#related-components)
|
|
13
|
-
|
|
14
9
|
## Development guidelines
|
|
15
10
|
|
|
16
11
|
### Usage
|
|
@@ -56,15 +56,17 @@ function BlockCard( { title, icon, description, blockType, className } ) {
|
|
|
56
56
|
{ minWidth: 24, padding: 0 }
|
|
57
57
|
}
|
|
58
58
|
icon={ isRTL() ? chevronRight : chevronLeft }
|
|
59
|
-
|
|
59
|
+
size="small"
|
|
60
60
|
/>
|
|
61
61
|
) }
|
|
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>
|
|
@@ -10,7 +10,12 @@ import { dragHandle } from '@wordpress/icons';
|
|
|
10
10
|
*/
|
|
11
11
|
import BlockIcon from '../block-icon';
|
|
12
12
|
|
|
13
|
-
export default function BlockDraggableChip( {
|
|
13
|
+
export default function BlockDraggableChip( {
|
|
14
|
+
count,
|
|
15
|
+
icon,
|
|
16
|
+
isPattern,
|
|
17
|
+
fadeWhenDisabled,
|
|
18
|
+
} ) {
|
|
14
19
|
const patternLabel = isPattern && __( 'Pattern' );
|
|
15
20
|
return (
|
|
16
21
|
<div className="block-editor-block-draggable-chip-wrapper">
|
|
@@ -37,6 +42,11 @@ export default function BlockDraggableChip( { count, icon, isPattern } ) {
|
|
|
37
42
|
<FlexItem>
|
|
38
43
|
<BlockIcon icon={ dragHandle } />
|
|
39
44
|
</FlexItem>
|
|
45
|
+
{ fadeWhenDisabled && (
|
|
46
|
+
<FlexItem className="block-editor-block-draggable-chip__disabled">
|
|
47
|
+
<span className="block-editor-block-draggable-chip__disabled-icon"></span>
|
|
48
|
+
</FlexItem>
|
|
49
|
+
) }
|
|
40
50
|
</Flex>
|
|
41
51
|
</div>
|
|
42
52
|
</div>
|
|
@@ -5,6 +5,7 @@ import { store as blocksStore } from '@wordpress/blocks';
|
|
|
5
5
|
import { Draggable } from '@wordpress/components';
|
|
6
6
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
7
|
import { useEffect, useRef } from '@wordpress/element';
|
|
8
|
+
import { throttle } from '@wordpress/compose';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Internal dependencies
|
|
@@ -12,6 +13,8 @@ import { useEffect, useRef } from '@wordpress/element';
|
|
|
12
13
|
import BlockDraggableChip from './draggable-chip';
|
|
13
14
|
import useScrollWhenDragging from './use-scroll-when-dragging';
|
|
14
15
|
import { store as blockEditorStore } from '../../store';
|
|
16
|
+
import { __unstableUseBlockRef as useBlockRef } from '../block-list/use-block-props/use-block-refs';
|
|
17
|
+
import { isDropTargetValid } from '../use-block-drop-zone';
|
|
15
18
|
|
|
16
19
|
const BlockDraggable = ( {
|
|
17
20
|
children,
|
|
@@ -19,16 +22,24 @@ const BlockDraggable = ( {
|
|
|
19
22
|
cloneClassname,
|
|
20
23
|
onDragStart,
|
|
21
24
|
onDragEnd,
|
|
25
|
+
fadeWhenDisabled = false,
|
|
22
26
|
} ) => {
|
|
23
|
-
const {
|
|
27
|
+
const {
|
|
28
|
+
srcRootClientId,
|
|
29
|
+
isDraggable,
|
|
30
|
+
icon,
|
|
31
|
+
visibleInserter,
|
|
32
|
+
getBlockType,
|
|
33
|
+
} = useSelect(
|
|
24
34
|
( select ) => {
|
|
25
35
|
const {
|
|
26
36
|
canMoveBlocks,
|
|
27
37
|
getBlockRootClientId,
|
|
28
38
|
getBlockName,
|
|
29
39
|
getBlockAttributes,
|
|
40
|
+
isBlockInsertionPointVisible,
|
|
30
41
|
} = select( blockEditorStore );
|
|
31
|
-
const { getBlockType, getActiveBlockVariation } =
|
|
42
|
+
const { getBlockType: _getBlockType, getActiveBlockVariation } =
|
|
32
43
|
select( blocksStore );
|
|
33
44
|
const rootClientId = getBlockRootClientId( clientIds[ 0 ] );
|
|
34
45
|
const blockName = getBlockName( clientIds[ 0 ] );
|
|
@@ -40,15 +51,21 @@ const BlockDraggable = ( {
|
|
|
40
51
|
return {
|
|
41
52
|
srcRootClientId: rootClientId,
|
|
42
53
|
isDraggable: canMoveBlocks( clientIds, rootClientId ),
|
|
43
|
-
icon: variation?.icon ||
|
|
54
|
+
icon: variation?.icon || _getBlockType( blockName )?.icon,
|
|
55
|
+
visibleInserter: isBlockInsertionPointVisible(),
|
|
56
|
+
getBlockType: _getBlockType,
|
|
44
57
|
};
|
|
45
58
|
},
|
|
46
59
|
[ clientIds ]
|
|
47
60
|
);
|
|
61
|
+
|
|
48
62
|
const isDragging = useRef( false );
|
|
49
63
|
const [ startScrolling, scrollOnDragOver, stopScrolling ] =
|
|
50
64
|
useScrollWhenDragging();
|
|
51
65
|
|
|
66
|
+
const { getAllowedBlocks, getBlockNamesByClientId, getBlockRootClientId } =
|
|
67
|
+
useSelect( blockEditorStore );
|
|
68
|
+
|
|
52
69
|
const { startDraggingBlocks, stopDraggingBlocks } =
|
|
53
70
|
useDispatch( blockEditorStore );
|
|
54
71
|
|
|
@@ -61,6 +78,97 @@ const BlockDraggable = ( {
|
|
|
61
78
|
};
|
|
62
79
|
}, [] );
|
|
63
80
|
|
|
81
|
+
// Find the root of the editor iframe.
|
|
82
|
+
const blockRef = useBlockRef( clientIds[ 0 ] );
|
|
83
|
+
const editorRoot = blockRef.current?.closest( 'body' );
|
|
84
|
+
|
|
85
|
+
/*
|
|
86
|
+
* Add a dragover event listener to the editor root to track the blocks being dragged over.
|
|
87
|
+
* The listener has to be inside the editor iframe otherwise the target isn't accessible.
|
|
88
|
+
*/
|
|
89
|
+
useEffect( () => {
|
|
90
|
+
if ( ! editorRoot || ! fadeWhenDisabled ) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const onDragOver = ( event ) => {
|
|
95
|
+
if ( ! event.target.closest( '[data-block]' ) ) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const draggedBlockNames = getBlockNamesByClientId( clientIds );
|
|
99
|
+
const targetClientId = event.target
|
|
100
|
+
.closest( '[data-block]' )
|
|
101
|
+
.getAttribute( 'data-block' );
|
|
102
|
+
|
|
103
|
+
const allowedBlocks = getAllowedBlocks( targetClientId );
|
|
104
|
+
const targetBlockName = getBlockNamesByClientId( [
|
|
105
|
+
targetClientId,
|
|
106
|
+
] )[ 0 ];
|
|
107
|
+
|
|
108
|
+
/*
|
|
109
|
+
* Check if the target is valid to drop in.
|
|
110
|
+
* If the target's allowedBlocks is an empty array,
|
|
111
|
+
* it isn't a container block, in which case we check
|
|
112
|
+
* its parent's validity instead.
|
|
113
|
+
*/
|
|
114
|
+
let dropTargetValid;
|
|
115
|
+
if ( allowedBlocks?.length === 0 ) {
|
|
116
|
+
const targetRootClientId =
|
|
117
|
+
getBlockRootClientId( targetClientId );
|
|
118
|
+
const targetRootBlockName = getBlockNamesByClientId( [
|
|
119
|
+
targetRootClientId,
|
|
120
|
+
] )[ 0 ];
|
|
121
|
+
const rootAllowedBlocks =
|
|
122
|
+
getAllowedBlocks( targetRootClientId );
|
|
123
|
+
dropTargetValid = isDropTargetValid(
|
|
124
|
+
getBlockType,
|
|
125
|
+
rootAllowedBlocks,
|
|
126
|
+
draggedBlockNames,
|
|
127
|
+
targetRootBlockName
|
|
128
|
+
);
|
|
129
|
+
} else {
|
|
130
|
+
dropTargetValid = isDropTargetValid(
|
|
131
|
+
getBlockType,
|
|
132
|
+
allowedBlocks,
|
|
133
|
+
draggedBlockNames,
|
|
134
|
+
targetBlockName
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/*
|
|
139
|
+
* Update the body class to reflect if drop target is valid.
|
|
140
|
+
* This has to be done on the document body because the draggable
|
|
141
|
+
* chip is rendered outside of the editor iframe.
|
|
142
|
+
*/
|
|
143
|
+
if ( ! dropTargetValid && ! visibleInserter ) {
|
|
144
|
+
window?.document?.body?.classList?.add(
|
|
145
|
+
'block-draggable-invalid-drag-token'
|
|
146
|
+
);
|
|
147
|
+
} else {
|
|
148
|
+
window?.document?.body?.classList?.remove(
|
|
149
|
+
'block-draggable-invalid-drag-token'
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const throttledOnDragOver = throttle( onDragOver, 200 );
|
|
155
|
+
|
|
156
|
+
editorRoot.addEventListener( 'dragover', throttledOnDragOver );
|
|
157
|
+
|
|
158
|
+
return () => {
|
|
159
|
+
editorRoot.removeEventListener( 'dragover', throttledOnDragOver );
|
|
160
|
+
};
|
|
161
|
+
}, [
|
|
162
|
+
clientIds,
|
|
163
|
+
editorRoot,
|
|
164
|
+
fadeWhenDisabled,
|
|
165
|
+
getAllowedBlocks,
|
|
166
|
+
getBlockNamesByClientId,
|
|
167
|
+
getBlockRootClientId,
|
|
168
|
+
getBlockType,
|
|
169
|
+
visibleInserter,
|
|
170
|
+
] );
|
|
171
|
+
|
|
64
172
|
if ( ! isDraggable ) {
|
|
65
173
|
return children( { draggable: false } );
|
|
66
174
|
}
|
|
@@ -102,7 +210,11 @@ const BlockDraggable = ( {
|
|
|
102
210
|
}
|
|
103
211
|
} }
|
|
104
212
|
__experimentalDragComponent={
|
|
105
|
-
<BlockDraggableChip
|
|
213
|
+
<BlockDraggableChip
|
|
214
|
+
count={ clientIds.length }
|
|
215
|
+
icon={ icon }
|
|
216
|
+
fadeWhenDisabled
|
|
217
|
+
/>
|
|
106
218
|
}
|
|
107
219
|
>
|
|
108
220
|
{ ( { onDraggableStart, onDraggableEnd } ) => {
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
import Animated, {
|
|
10
10
|
runOnJS,
|
|
11
11
|
runOnUI,
|
|
12
|
-
useAnimatedRef,
|
|
13
12
|
useAnimatedStyle,
|
|
14
13
|
useSharedValue,
|
|
15
14
|
withDelay,
|
|
@@ -39,7 +38,6 @@ import RCTAztecView from '@wordpress/react-native-aztec';
|
|
|
39
38
|
import useScrollWhenDragging from './use-scroll-when-dragging';
|
|
40
39
|
import DraggableChip from './draggable-chip';
|
|
41
40
|
import { store as blockEditorStore } from '../../store';
|
|
42
|
-
import { useBlockListContext } from '../block-list/block-list-context';
|
|
43
41
|
import DroppingInsertionPoint from './dropping-insertion-point';
|
|
44
42
|
import useBlockDropZone from '../use-block-drop-zone';
|
|
45
43
|
import styles from './style.scss';
|
|
@@ -74,13 +72,10 @@ const BlockDraggableWrapper = ( { children, isRTL } ) => {
|
|
|
74
72
|
const { selectBlock, startDraggingBlocks, stopDraggingBlocks } =
|
|
75
73
|
useDispatch( blockEditorStore );
|
|
76
74
|
|
|
77
|
-
const { scrollRef } = useBlockListContext();
|
|
78
|
-
const animatedScrollRef = useAnimatedRef();
|
|
79
75
|
const { left, right } = useSafeAreaInsets();
|
|
80
76
|
const { width } = useSafeAreaFrame();
|
|
81
77
|
const safeAreaOffset = left + right;
|
|
82
78
|
const contentWidth = width - safeAreaOffset;
|
|
83
|
-
animatedScrollRef( scrollRef );
|
|
84
79
|
|
|
85
80
|
const scroll = {
|
|
86
81
|
offsetY: useSharedValue( 0 ),
|