@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/src/hooks/test/style.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { applyFilters } from '@wordpress/hooks';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* Internal dependencies
|
|
8
3
|
*/
|
|
9
|
-
import { getInlineStyles, omitStyle } from '../style';
|
|
4
|
+
import _style, { getInlineStyles, omitStyle } from '../style';
|
|
10
5
|
|
|
11
6
|
describe( 'getInlineStyles', () => {
|
|
12
7
|
it( 'should return an empty object when called with undefined', () => {
|
|
@@ -120,11 +115,6 @@ describe( 'getInlineStyles', () => {
|
|
|
120
115
|
} );
|
|
121
116
|
|
|
122
117
|
describe( 'addSaveProps', () => {
|
|
123
|
-
const addSaveProps = applyFilters.bind(
|
|
124
|
-
null,
|
|
125
|
-
'blocks.getSaveContent.extraProps'
|
|
126
|
-
);
|
|
127
|
-
|
|
128
118
|
const blockSettings = {
|
|
129
119
|
save: () => <div className="default" />,
|
|
130
120
|
category: 'text',
|
|
@@ -166,7 +156,7 @@ describe( 'addSaveProps', () => {
|
|
|
166
156
|
};
|
|
167
157
|
|
|
168
158
|
it( 'should serialize all styles by default', () => {
|
|
169
|
-
const extraProps = addSaveProps( {}, blockSettings, attributes );
|
|
159
|
+
const extraProps = _style.addSaveProps( {}, blockSettings, attributes );
|
|
170
160
|
|
|
171
161
|
expect( extraProps.style ).toEqual( {
|
|
172
162
|
background:
|
|
@@ -183,7 +173,7 @@ describe( 'addSaveProps', () => {
|
|
|
183
173
|
const settings = applySkipSerialization( {
|
|
184
174
|
typography: true,
|
|
185
175
|
} );
|
|
186
|
-
const extraProps = addSaveProps( {}, settings, attributes );
|
|
176
|
+
const extraProps = _style.addSaveProps( {}, settings, attributes );
|
|
187
177
|
|
|
188
178
|
expect( extraProps.style ).toEqual( {
|
|
189
179
|
background:
|
|
@@ -198,7 +188,7 @@ describe( 'addSaveProps', () => {
|
|
|
198
188
|
color: [ 'gradient' ],
|
|
199
189
|
typography: [ 'textDecoration', 'textTransform' ],
|
|
200
190
|
} );
|
|
201
|
-
const extraProps = addSaveProps( {}, settings, attributes );
|
|
191
|
+
const extraProps = _style.addSaveProps( {}, settings, attributes );
|
|
202
192
|
|
|
203
193
|
expect( extraProps.style ).toEqual( {
|
|
204
194
|
color: '#d92828',
|
package/src/hooks/typography.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';
|
|
5
5
|
import { useMemo, useCallback } from '@wordpress/element';
|
|
6
|
+
import { useSelect } from '@wordpress/data';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
@@ -16,7 +17,8 @@ import {
|
|
|
16
17
|
import { LINE_HEIGHT_SUPPORT_KEY } from './line-height';
|
|
17
18
|
import { FONT_FAMILY_SUPPORT_KEY } from './font-family';
|
|
18
19
|
import { FONT_SIZE_SUPPORT_KEY } from './font-size';
|
|
19
|
-
import { cleanEmptyObject
|
|
20
|
+
import { cleanEmptyObject } from './utils';
|
|
21
|
+
import { store as blockEditorStore } from '../store';
|
|
20
22
|
|
|
21
23
|
function omit( object, keys ) {
|
|
22
24
|
return Object.fromEntries(
|
|
@@ -106,22 +108,18 @@ function TypographyInspectorControl( { children, resetAllFilter } ) {
|
|
|
106
108
|
);
|
|
107
109
|
}
|
|
108
110
|
|
|
109
|
-
export function TypographyPanel( {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
} )
|
|
116
|
-
const settings = useBlockSettings( name, __unstableParentLayout );
|
|
111
|
+
export function TypographyPanel( { clientId, name, setAttributes, settings } ) {
|
|
112
|
+
function selector( select ) {
|
|
113
|
+
const { style, fontFamily, fontSize } =
|
|
114
|
+
select( blockEditorStore ).getBlockAttributes( clientId ) || {};
|
|
115
|
+
return { style, fontFamily, fontSize };
|
|
116
|
+
}
|
|
117
|
+
const { style, fontFamily, fontSize } = useSelect( selector, [ clientId ] );
|
|
117
118
|
const isEnabled = useHasTypographyPanel( settings );
|
|
118
|
-
const value = useMemo(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
fontSize: attributes.fontSize,
|
|
123
|
-
} );
|
|
124
|
-
}, [ attributes.style, attributes.fontSize, attributes.fontFamily ] );
|
|
119
|
+
const value = useMemo(
|
|
120
|
+
() => attributesToStyle( { style, fontFamily, fontSize } ),
|
|
121
|
+
[ style, fontSize, fontFamily ]
|
|
122
|
+
);
|
|
125
123
|
|
|
126
124
|
const onChange = ( newStyle ) => {
|
|
127
125
|
setAttributes( styleToAttributes( newStyle ) );
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
* External dependencies
|
|
7
|
-
*/
|
|
4
|
+
import { useSelect } from '@wordpress/data';
|
|
5
|
+
import { pure } from '@wordpress/compose';
|
|
8
6
|
import { PanelBody } from '@wordpress/components';
|
|
9
7
|
import { __ } from '@wordpress/i18n';
|
|
10
8
|
|
|
@@ -12,17 +10,12 @@ import { __ } from '@wordpress/i18n';
|
|
|
12
10
|
* Internal dependencies
|
|
13
11
|
*/
|
|
14
12
|
import InspectorControls from '../components/inspector-controls';
|
|
13
|
+
import { useHasTypographyPanel } from '../components/global-styles/typography-panel';
|
|
15
14
|
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} from './line-height';
|
|
21
|
-
import {
|
|
22
|
-
FONT_SIZE_SUPPORT_KEY,
|
|
23
|
-
FontSizeEdit,
|
|
24
|
-
useIsFontSizeDisabled,
|
|
25
|
-
} from './font-size';
|
|
15
|
+
import { store as blockEditorStore } from '../store';
|
|
16
|
+
|
|
17
|
+
import { LINE_HEIGHT_SUPPORT_KEY, LineHeightEdit } from './line-height';
|
|
18
|
+
import { FONT_SIZE_SUPPORT_KEY, FontSizeEdit } from './font-size';
|
|
26
19
|
|
|
27
20
|
export const TYPOGRAPHY_SUPPORT_KEY = 'typography';
|
|
28
21
|
export const TYPOGRAPHY_SUPPORT_KEYS = [
|
|
@@ -30,11 +23,26 @@ export const TYPOGRAPHY_SUPPORT_KEYS = [
|
|
|
30
23
|
FONT_SIZE_SUPPORT_KEY,
|
|
31
24
|
];
|
|
32
25
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
function TypographyPanelPure( { clientId, setAttributes, settings } ) {
|
|
27
|
+
function selector( select ) {
|
|
28
|
+
const { style, fontFamily, fontSize } =
|
|
29
|
+
select( blockEditorStore ).getBlockAttributes( clientId ) || {};
|
|
30
|
+
return { style, fontFamily, fontSize };
|
|
31
|
+
}
|
|
32
|
+
const { style, fontSize } = useSelect( selector, [ clientId ] );
|
|
33
|
+
const isEnabled = useHasTypographyPanel( settings );
|
|
34
|
+
|
|
35
|
+
if ( ! isEnabled ) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const props = {
|
|
40
|
+
attributes: {
|
|
41
|
+
fontSize,
|
|
42
|
+
style,
|
|
43
|
+
},
|
|
44
|
+
setAttributes,
|
|
45
|
+
};
|
|
38
46
|
|
|
39
47
|
return (
|
|
40
48
|
<InspectorControls>
|
|
@@ -46,17 +54,7 @@ export function TypographyPanel( props ) {
|
|
|
46
54
|
);
|
|
47
55
|
}
|
|
48
56
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
function useIsTypographyDisabled( props = {} ) {
|
|
56
|
-
const configs = [
|
|
57
|
-
useIsFontSizeDisabled( props ),
|
|
58
|
-
useIsLineHeightDisabled( props ),
|
|
59
|
-
];
|
|
60
|
-
|
|
61
|
-
return configs.filter( Boolean ).length === configs.length;
|
|
62
|
-
}
|
|
57
|
+
// We don't want block controls to re-render when typing inside a block. `pure`
|
|
58
|
+
// will prevent re-renders unless props change, so only pass the needed props
|
|
59
|
+
// and not the whole attributes object.
|
|
60
|
+
export const TypographyPanel = pure( TypographyPanelPure );
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
10
|
+
|
|
6
11
|
/**
|
|
7
12
|
* Internal dependencies
|
|
8
13
|
*/
|
|
@@ -12,7 +17,7 @@ import {
|
|
|
12
17
|
getTypographyFontSizeValue,
|
|
13
18
|
getFluidTypographyOptionsFromSettings,
|
|
14
19
|
} from '../components/global-styles/typography-utils';
|
|
15
|
-
import {
|
|
20
|
+
import { unlock } from '../lock-unlock';
|
|
16
21
|
|
|
17
22
|
/*
|
|
18
23
|
* This utility is intended to assist where the serialization of the typography
|
|
@@ -29,6 +34,7 @@ import { kebabCase } from '../utils/object';
|
|
|
29
34
|
* @return {Object} Typography block support derived CSS classes & styles.
|
|
30
35
|
*/
|
|
31
36
|
export function getTypographyClassesAndStyles( attributes, settings ) {
|
|
37
|
+
const { kebabCase } = unlock( componentsPrivateApis );
|
|
32
38
|
let typographyStyles = attributes?.style?.typography || {};
|
|
33
39
|
const fluidTypographySettings =
|
|
34
40
|
getFluidTypographyOptionsFromSettings( settings );
|
package/src/hooks/utils.js
CHANGED
|
@@ -2,17 +2,28 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { getBlockSupport } from '@wordpress/blocks';
|
|
5
|
-
import { useMemo, useEffect, useId } from '@wordpress/element';
|
|
5
|
+
import { useMemo, useEffect, useId, useState } from '@wordpress/element';
|
|
6
6
|
import { useDispatch } from '@wordpress/data';
|
|
7
|
+
import { createHigherOrderComponent, pure } from '@wordpress/compose';
|
|
8
|
+
import { addFilter } from '@wordpress/hooks';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* Internal dependencies
|
|
10
12
|
*/
|
|
13
|
+
import {
|
|
14
|
+
useBlockEditContext,
|
|
15
|
+
mayDisplayControlsKey,
|
|
16
|
+
mayDisplayParentControlsKey,
|
|
17
|
+
} from '../components/block-edit/context';
|
|
11
18
|
import { useSettings } from '../components';
|
|
12
19
|
import { useSettingsForBlockElement } from '../components/global-styles/hooks';
|
|
13
20
|
import { getValueFromObjectPath, setImmutably } from '../utils/object';
|
|
14
21
|
import { store as blockEditorStore } from '../store';
|
|
15
22
|
import { unlock } from '../lock-unlock';
|
|
23
|
+
/**
|
|
24
|
+
* External dependencies
|
|
25
|
+
*/
|
|
26
|
+
import classnames from 'classnames';
|
|
16
27
|
|
|
17
28
|
/**
|
|
18
29
|
* Removed falsy values from nested object.
|
|
@@ -101,14 +112,18 @@ export function transformStyles(
|
|
|
101
112
|
* Check whether serialization of specific block support feature or set should
|
|
102
113
|
* be skipped.
|
|
103
114
|
*
|
|
104
|
-
* @param {string|Object}
|
|
105
|
-
* @param {string} featureSet
|
|
106
|
-
* @param {string} feature
|
|
115
|
+
* @param {string|Object} blockNameOrType Block name or block type object.
|
|
116
|
+
* @param {string} featureSet Name of block support feature set.
|
|
117
|
+
* @param {string} feature Name of the individual feature to check.
|
|
107
118
|
*
|
|
108
119
|
* @return {boolean} Whether serialization should occur.
|
|
109
120
|
*/
|
|
110
|
-
export function shouldSkipSerialization(
|
|
111
|
-
|
|
121
|
+
export function shouldSkipSerialization(
|
|
122
|
+
blockNameOrType,
|
|
123
|
+
featureSet,
|
|
124
|
+
feature
|
|
125
|
+
) {
|
|
126
|
+
const support = getBlockSupport( blockNameOrType, featureSet );
|
|
112
127
|
const skipSerialization = support?.__experimentalSkipSerialization;
|
|
113
128
|
|
|
114
129
|
if ( Array.isArray( skipSerialization ) ) {
|
|
@@ -159,8 +174,13 @@ export function useStyleOverride( { id, css, assets, __unstableType } = {} ) {
|
|
|
159
174
|
*/
|
|
160
175
|
export function useBlockSettings( name, parentLayout ) {
|
|
161
176
|
const [
|
|
177
|
+
backgroundImage,
|
|
178
|
+
backgroundSize,
|
|
162
179
|
fontFamilies,
|
|
163
|
-
|
|
180
|
+
userFontSizes,
|
|
181
|
+
themeFontSizes,
|
|
182
|
+
defaultFontSizes,
|
|
183
|
+
defaultFontSizesEnabled,
|
|
164
184
|
customFontSize,
|
|
165
185
|
fontStyle,
|
|
166
186
|
fontWeight,
|
|
@@ -202,8 +222,13 @@ export function useBlockSettings( name, parentLayout ) {
|
|
|
202
222
|
isHeadingEnabled,
|
|
203
223
|
isButtonEnabled,
|
|
204
224
|
] = useSettings(
|
|
225
|
+
'background.backgroundImage',
|
|
226
|
+
'background.backgroundSize',
|
|
205
227
|
'typography.fontFamilies',
|
|
206
|
-
'typography.fontSizes',
|
|
228
|
+
'typography.fontSizes.custom',
|
|
229
|
+
'typography.fontSizes.theme',
|
|
230
|
+
'typography.fontSizes.default',
|
|
231
|
+
'typography.defaultFontSizes',
|
|
207
232
|
'typography.customFontSize',
|
|
208
233
|
'typography.fontStyle',
|
|
209
234
|
'typography.fontWeight',
|
|
@@ -248,6 +273,10 @@ export function useBlockSettings( name, parentLayout ) {
|
|
|
248
273
|
|
|
249
274
|
const rawSettings = useMemo( () => {
|
|
250
275
|
return {
|
|
276
|
+
background: {
|
|
277
|
+
backgroundImage,
|
|
278
|
+
backgroundSize,
|
|
279
|
+
},
|
|
251
280
|
color: {
|
|
252
281
|
palette: {
|
|
253
282
|
custom: customColors,
|
|
@@ -281,9 +310,12 @@ export function useBlockSettings( name, parentLayout ) {
|
|
|
281
310
|
custom: fontFamilies,
|
|
282
311
|
},
|
|
283
312
|
fontSizes: {
|
|
284
|
-
custom:
|
|
313
|
+
custom: userFontSizes,
|
|
314
|
+
theme: themeFontSizes,
|
|
315
|
+
default: defaultFontSizes,
|
|
285
316
|
},
|
|
286
317
|
customFontSize,
|
|
318
|
+
defaultFontSizes: defaultFontSizesEnabled,
|
|
287
319
|
fontStyle,
|
|
288
320
|
fontWeight,
|
|
289
321
|
lineHeight,
|
|
@@ -315,8 +347,13 @@ export function useBlockSettings( name, parentLayout ) {
|
|
|
315
347
|
parentLayout,
|
|
316
348
|
};
|
|
317
349
|
}, [
|
|
350
|
+
backgroundImage,
|
|
351
|
+
backgroundSize,
|
|
318
352
|
fontFamilies,
|
|
319
|
-
|
|
353
|
+
userFontSizes,
|
|
354
|
+
themeFontSizes,
|
|
355
|
+
defaultFontSizes,
|
|
356
|
+
defaultFontSizesEnabled,
|
|
320
357
|
customFontSize,
|
|
321
358
|
fontStyle,
|
|
322
359
|
fontWeight,
|
|
@@ -362,3 +399,217 @@ export function useBlockSettings( name, parentLayout ) {
|
|
|
362
399
|
|
|
363
400
|
return useSettingsForBlockElement( rawSettings, name );
|
|
364
401
|
}
|
|
402
|
+
|
|
403
|
+
export function createBlockEditFilter( features ) {
|
|
404
|
+
// We don't want block controls to re-render when typing inside a block.
|
|
405
|
+
// `pure` will prevent re-renders unless props change, so only pass the
|
|
406
|
+
// needed props and not the whole attributes object.
|
|
407
|
+
features = features.map( ( settings ) => {
|
|
408
|
+
return { ...settings, Edit: pure( settings.edit ) };
|
|
409
|
+
} );
|
|
410
|
+
const withBlockEditHooks = createHigherOrderComponent(
|
|
411
|
+
( OriginalBlockEdit ) => ( props ) => {
|
|
412
|
+
const context = useBlockEditContext();
|
|
413
|
+
// CAUTION: code added before this line will be executed for all
|
|
414
|
+
// blocks, not just those that support the feature! Code added
|
|
415
|
+
// above this line should be carefully evaluated for its impact on
|
|
416
|
+
// performance.
|
|
417
|
+
return [
|
|
418
|
+
...features.map( ( feature, i ) => {
|
|
419
|
+
const {
|
|
420
|
+
Edit,
|
|
421
|
+
hasSupport,
|
|
422
|
+
attributeKeys = [],
|
|
423
|
+
shareWithChildBlocks,
|
|
424
|
+
} = feature;
|
|
425
|
+
const shouldDisplayControls =
|
|
426
|
+
context[ mayDisplayControlsKey ] ||
|
|
427
|
+
( context[ mayDisplayParentControlsKey ] &&
|
|
428
|
+
shareWithChildBlocks );
|
|
429
|
+
|
|
430
|
+
if (
|
|
431
|
+
! shouldDisplayControls ||
|
|
432
|
+
! hasSupport( props.name )
|
|
433
|
+
) {
|
|
434
|
+
return null;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
const neededProps = {};
|
|
438
|
+
for ( const key of attributeKeys ) {
|
|
439
|
+
if ( props.attributes[ key ] ) {
|
|
440
|
+
neededProps[ key ] = props.attributes[ key ];
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
return (
|
|
445
|
+
<Edit
|
|
446
|
+
// We can use the index because the array length
|
|
447
|
+
// is fixed per page load right now.
|
|
448
|
+
key={ i }
|
|
449
|
+
name={ props.name }
|
|
450
|
+
isSelected={ props.isSelected }
|
|
451
|
+
clientId={ props.clientId }
|
|
452
|
+
setAttributes={ props.setAttributes }
|
|
453
|
+
__unstableParentLayout={
|
|
454
|
+
props.__unstableParentLayout
|
|
455
|
+
}
|
|
456
|
+
// This component is pure, so only pass needed
|
|
457
|
+
// props!!!
|
|
458
|
+
{ ...neededProps }
|
|
459
|
+
/>
|
|
460
|
+
);
|
|
461
|
+
} ),
|
|
462
|
+
<OriginalBlockEdit key="edit" { ...props } />,
|
|
463
|
+
];
|
|
464
|
+
},
|
|
465
|
+
'withBlockEditHooks'
|
|
466
|
+
);
|
|
467
|
+
addFilter( 'editor.BlockEdit', 'core/editor/hooks', withBlockEditHooks );
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
function BlockProps( { index, useBlockProps, setAllWrapperProps, ...props } ) {
|
|
471
|
+
const wrapperProps = useBlockProps( props );
|
|
472
|
+
const setWrapperProps = ( next ) =>
|
|
473
|
+
setAllWrapperProps( ( prev ) => {
|
|
474
|
+
const nextAll = [ ...prev ];
|
|
475
|
+
nextAll[ index ] = next;
|
|
476
|
+
return nextAll;
|
|
477
|
+
} );
|
|
478
|
+
// Setting state after every render is fine because this component is
|
|
479
|
+
// pure and will only re-render when needed props change.
|
|
480
|
+
useEffect( () => {
|
|
481
|
+
// We could shallow compare the props, but since this component only
|
|
482
|
+
// changes when needed attributes change, the benefit is probably small.
|
|
483
|
+
setWrapperProps( wrapperProps );
|
|
484
|
+
return () => {
|
|
485
|
+
setWrapperProps( undefined );
|
|
486
|
+
};
|
|
487
|
+
} );
|
|
488
|
+
return null;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
const BlockPropsPure = pure( BlockProps );
|
|
492
|
+
|
|
493
|
+
export function createBlockListBlockFilter( features ) {
|
|
494
|
+
const withBlockListBlockHooks = createHigherOrderComponent(
|
|
495
|
+
( BlockListBlock ) => ( props ) => {
|
|
496
|
+
const [ allWrapperProps, setAllWrapperProps ] = useState(
|
|
497
|
+
Array( features.length ).fill( undefined )
|
|
498
|
+
);
|
|
499
|
+
return [
|
|
500
|
+
...features.map( ( feature, i ) => {
|
|
501
|
+
const {
|
|
502
|
+
hasSupport,
|
|
503
|
+
attributeKeys = [],
|
|
504
|
+
useBlockProps,
|
|
505
|
+
} = feature;
|
|
506
|
+
|
|
507
|
+
const neededProps = {};
|
|
508
|
+
for ( const key of attributeKeys ) {
|
|
509
|
+
if ( props.attributes[ key ] ) {
|
|
510
|
+
neededProps[ key ] = props.attributes[ key ];
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
if (
|
|
515
|
+
// Skip rendering if none of the needed attributes are
|
|
516
|
+
// set.
|
|
517
|
+
! Object.keys( neededProps ).length ||
|
|
518
|
+
! hasSupport( props.name )
|
|
519
|
+
) {
|
|
520
|
+
return null;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
return (
|
|
524
|
+
<BlockPropsPure
|
|
525
|
+
// We can use the index because the array length
|
|
526
|
+
// is fixed per page load right now.
|
|
527
|
+
key={ i }
|
|
528
|
+
index={ i }
|
|
529
|
+
useBlockProps={ useBlockProps }
|
|
530
|
+
// This component is pure, so we must pass a stable
|
|
531
|
+
// function reference.
|
|
532
|
+
setAllWrapperProps={ setAllWrapperProps }
|
|
533
|
+
name={ props.name }
|
|
534
|
+
// This component is pure, so only pass needed
|
|
535
|
+
// props!!!
|
|
536
|
+
{ ...neededProps }
|
|
537
|
+
/>
|
|
538
|
+
);
|
|
539
|
+
} ),
|
|
540
|
+
<BlockListBlock
|
|
541
|
+
key="edit"
|
|
542
|
+
{ ...props }
|
|
543
|
+
wrapperProps={ allWrapperProps
|
|
544
|
+
.filter( Boolean )
|
|
545
|
+
.reduce( ( acc, wrapperProps ) => {
|
|
546
|
+
return {
|
|
547
|
+
...acc,
|
|
548
|
+
...wrapperProps,
|
|
549
|
+
className: classnames(
|
|
550
|
+
acc.className,
|
|
551
|
+
wrapperProps.className
|
|
552
|
+
),
|
|
553
|
+
style: {
|
|
554
|
+
...acc.style,
|
|
555
|
+
...wrapperProps.style,
|
|
556
|
+
},
|
|
557
|
+
};
|
|
558
|
+
}, props.wrapperProps || {} ) }
|
|
559
|
+
/>,
|
|
560
|
+
];
|
|
561
|
+
},
|
|
562
|
+
'withBlockListBlockHooks'
|
|
563
|
+
);
|
|
564
|
+
addFilter(
|
|
565
|
+
'editor.BlockListBlock',
|
|
566
|
+
'core/editor/hooks',
|
|
567
|
+
withBlockListBlockHooks
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
export function createBlockSaveFilter( features ) {
|
|
572
|
+
function extraPropsFromHooks( props, name, attributes ) {
|
|
573
|
+
return features.reduce( ( accu, feature ) => {
|
|
574
|
+
const { hasSupport, attributeKeys = [], addSaveProps } = feature;
|
|
575
|
+
|
|
576
|
+
const neededAttributes = {};
|
|
577
|
+
for ( const key of attributeKeys ) {
|
|
578
|
+
if ( attributes[ key ] ) {
|
|
579
|
+
neededAttributes[ key ] = attributes[ key ];
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
if (
|
|
584
|
+
// Skip rendering if none of the needed attributes are
|
|
585
|
+
// set.
|
|
586
|
+
! Object.keys( neededAttributes ).length ||
|
|
587
|
+
! hasSupport( name )
|
|
588
|
+
) {
|
|
589
|
+
return accu;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
return addSaveProps( accu, name, neededAttributes );
|
|
593
|
+
}, props );
|
|
594
|
+
}
|
|
595
|
+
addFilter(
|
|
596
|
+
'blocks.getSaveContent.extraProps',
|
|
597
|
+
'core/editor/hooks',
|
|
598
|
+
extraPropsFromHooks,
|
|
599
|
+
0
|
|
600
|
+
);
|
|
601
|
+
addFilter(
|
|
602
|
+
'blocks.getSaveContent.extraProps',
|
|
603
|
+
'core/editor/hooks',
|
|
604
|
+
( props ) => {
|
|
605
|
+
// Previously we had a filter deleting the className if it was an empty
|
|
606
|
+
// string. That filter is no longer running, so now we need to delete it
|
|
607
|
+
// here.
|
|
608
|
+
if ( props.hasOwnProperty( 'className' ) && ! props.className ) {
|
|
609
|
+
delete props.className;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
return props;
|
|
613
|
+
}
|
|
614
|
+
);
|
|
615
|
+
}
|
package/src/private-apis.js
CHANGED
|
@@ -5,13 +5,11 @@ import * as globalStyles from './components/global-styles';
|
|
|
5
5
|
import { ExperimentalBlockEditorProvider } from './components/provider';
|
|
6
6
|
import { lock } from './lock-unlock';
|
|
7
7
|
import { getRichTextValues } from './components/rich-text/get-rich-text-values';
|
|
8
|
-
import { kebabCase } from './utils/object';
|
|
9
8
|
import ResizableBoxPopover from './components/resizable-box-popover';
|
|
10
9
|
import { ComposedPrivateInserter as PrivateInserter } from './components/inserter';
|
|
11
10
|
import { PrivateListView } from './components/list-view';
|
|
12
11
|
import BlockInfo from './components/block-info-slot-fill';
|
|
13
|
-
import
|
|
14
|
-
import { useShouldContextualToolbarShow } from './utils/use-should-contextual-toolbar-show';
|
|
12
|
+
import { useCanBlockToolbarBeFocused } from './utils/use-can-block-toolbar-be-focused';
|
|
15
13
|
import { cleanEmptyObject, useStyleOverride } from './hooks/utils';
|
|
16
14
|
import BlockQuickNavigation from './components/block-quick-navigation';
|
|
17
15
|
import { LayoutStyle } from './components/block-list/layout';
|
|
@@ -37,13 +35,11 @@ lock( privateApis, {
|
|
|
37
35
|
ExperimentalBlockEditorProvider,
|
|
38
36
|
getDuotoneFilter,
|
|
39
37
|
getRichTextValues,
|
|
40
|
-
kebabCase,
|
|
41
38
|
PrivateInserter,
|
|
42
39
|
PrivateListView,
|
|
43
40
|
ResizableBoxPopover,
|
|
44
41
|
BlockInfo,
|
|
45
|
-
|
|
46
|
-
useShouldContextualToolbarShow,
|
|
42
|
+
useCanBlockToolbarBeFocused,
|
|
47
43
|
cleanEmptyObject,
|
|
48
44
|
useStyleOverride,
|
|
49
45
|
BlockQuickNavigation,
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as globalStyles from './components/global-styles';
|
|
5
5
|
import { ExperimentalBlockEditorProvider } from './components/provider';
|
|
6
|
-
import { kebabCase } from './utils/object';
|
|
7
6
|
import { lock } from './lock-unlock';
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -12,6 +11,5 @@ import { lock } from './lock-unlock';
|
|
|
12
11
|
export const privateApis = {};
|
|
13
12
|
lock( privateApis, {
|
|
14
13
|
...globalStyles,
|
|
15
|
-
kebabCase,
|
|
16
14
|
ExperimentalBlockEditorProvider,
|
|
17
15
|
} );
|
package/src/store/actions.js
CHANGED
|
@@ -1919,18 +1919,3 @@ export function unsetBlockEditingMode( clientId = '' ) {
|
|
|
1919
1919
|
clientId,
|
|
1920
1920
|
};
|
|
1921
1921
|
}
|
|
1922
|
-
|
|
1923
|
-
/**
|
|
1924
|
-
* Action that sets the element that had focus when focus leaves the editor canvas.
|
|
1925
|
-
*
|
|
1926
|
-
* @param {Object} lastFocus The last focused element.
|
|
1927
|
-
*
|
|
1928
|
-
*
|
|
1929
|
-
* @return {Object} Action object.
|
|
1930
|
-
*/
|
|
1931
|
-
export function setLastFocus( lastFocus = null ) {
|
|
1932
|
-
return {
|
|
1933
|
-
type: 'LAST_FOCUS',
|
|
1934
|
-
lastFocus,
|
|
1935
|
-
};
|
|
1936
|
-
}
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Platform } from '@wordpress/element';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { undoIgnoreBlocks } from './undo-ignore';
|
|
10
|
+
|
|
6
11
|
const castArray = ( maybeArray ) =>
|
|
7
12
|
Array.isArray( maybeArray ) ? maybeArray : [ maybeArray ];
|
|
8
13
|
|
|
@@ -290,3 +295,46 @@ export function deleteStyleOverride( id ) {
|
|
|
290
295
|
id,
|
|
291
296
|
};
|
|
292
297
|
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* A higher-order action that mark every change inside a callback as "non-persistent"
|
|
301
|
+
* and ignore pushing to the undo history stack. It's primarily used for synchronized
|
|
302
|
+
* derived updates from the block editor without affecting the undo history.
|
|
303
|
+
*
|
|
304
|
+
* @param {() => void} callback The synchronous callback to derive updates.
|
|
305
|
+
*/
|
|
306
|
+
export function syncDerivedUpdates( callback ) {
|
|
307
|
+
return ( { dispatch, select, registry } ) => {
|
|
308
|
+
registry.batch( () => {
|
|
309
|
+
// Mark every change in the `callback` as non-persistent.
|
|
310
|
+
dispatch( {
|
|
311
|
+
type: 'SET_EXPLICIT_PERSISTENT',
|
|
312
|
+
isPersistentChange: false,
|
|
313
|
+
} );
|
|
314
|
+
callback();
|
|
315
|
+
dispatch( {
|
|
316
|
+
type: 'SET_EXPLICIT_PERSISTENT',
|
|
317
|
+
isPersistentChange: undefined,
|
|
318
|
+
} );
|
|
319
|
+
|
|
320
|
+
// Ignore pushing undo stack for the updated blocks.
|
|
321
|
+
const updatedBlocks = select.getBlocks();
|
|
322
|
+
undoIgnoreBlocks.add( updatedBlocks );
|
|
323
|
+
} );
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Action that sets the element that had focus when focus leaves the editor canvas.
|
|
329
|
+
*
|
|
330
|
+
* @param {Object} lastFocus The last focused element.
|
|
331
|
+
*
|
|
332
|
+
*
|
|
333
|
+
* @return {Object} Action object.
|
|
334
|
+
*/
|
|
335
|
+
export function setLastFocus( lastFocus = null ) {
|
|
336
|
+
return {
|
|
337
|
+
type: 'LAST_FOCUS',
|
|
338
|
+
lastFocus,
|
|
339
|
+
};
|
|
340
|
+
}
|