@wordpress/block-editor 12.16.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/LICENSE.md +1 -1
- package/README.md +3 -6
- package/build/components/block-canvas/index.js +0 -2
- package/build/components/block-canvas/index.js.map +1 -1
- package/build/components/block-card/index.js +1 -1
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-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-editing-mode/index.js +2 -3
- package/build/components/block-editing-mode/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 +245 -102
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +46 -20
- 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 +33 -96
- package/build/components/block-list/use-block-props/index.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 +4 -4
- package/build/components/block-patterns-list/index.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 +1 -2
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/block-toolbar-popover.js +0 -2
- package/build/components/block-tools/block-toolbar-popover.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/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 +2 -1
- 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 +1 -4
- 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 +33 -15
- 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-size-control/index.js +2 -2
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/index.native.js +6 -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/menu.js +14 -28
- package/build/components/inserter/menu.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-draggable-blocks/index.js +1 -1
- 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-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 +9 -14
- 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/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/index.js +17 -7
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +16 -24
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/rich-text/use-input-rules.js +2 -2
- 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/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 +51 -22
- 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 +8 -11
- package/build/components/use-on-block-drop/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 +1 -1
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/anchor.js +1 -1
- 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 +185 -20
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/border.js +5 -10
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +13 -11
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/custom-class-name.js +1 -1
- 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 +4 -9
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/font-family.js +7 -3
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +1 -1
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/index.js +4 -4
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +5 -3
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/layout.js +10 -4
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/style.js +1 -1
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/typography.js +4 -9
- 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 +48 -5
- package/build/hooks/utils.js.map +1 -1
- package/build/private-apis.js +2 -4
- 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 +51 -5
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +12 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +14 -6
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +1 -13
- 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 +1 -1
- package/build/store/utils.js.map +1 -1
- 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 +17 -38
- package/build/utils/object.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 +0 -2
- package/build-module/components/block-canvas/index.js.map +1 -1
- package/build-module/components/block-card/index.js +1 -1
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-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-editing-mode/index.js +3 -4
- package/build-module/components/block-editing-mode/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 +249 -106
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +48 -22
- 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 +34 -97
- package/build-module/components/block-list/use-block-props/index.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 +5 -5
- package/build-module/components/block-patterns-list/index.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 +1 -2
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/block-toolbar-popover.js +0 -2
- package/build-module/components/block-tools/block-toolbar-popover.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/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 +3 -2
- 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 +2 -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 +35 -17
- 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-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 +2 -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/menu.js +14 -28
- package/build-module/components/inserter/menu.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-draggable-blocks/index.js +2 -2
- 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-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 +9 -14
- 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/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/index.js +17 -7
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +16 -23
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/rich-text/use-input-rules.js +2 -2
- 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/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 +51 -23
- 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 +8 -11
- package/build-module/components/use-on-block-drop/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 +1 -1
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/anchor.js +1 -1
- 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 +181 -19
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/border.js +2 -8
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +11 -9
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/custom-class-name.js +1 -1
- 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 +1 -7
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/font-family.js +6 -2
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +1 -1
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/index.js +5 -5
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +6 -4
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/layout.js +9 -3
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/style.js +1 -1
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/typography.js +1 -7
- 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 +47 -5
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/private-apis.js +2 -4
- 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 +49 -4
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +11 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +14 -6
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +1 -12
- 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 +2 -2
- package/build-module/store/utils.js.map +1 -1
- 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 +16 -37
- package/build-module/utils/object.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 +51 -8
- package/build-style/style.css +51 -8
- 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 +0 -2
- package/src/components/block-canvas/style.scss +6 -0
- package/src/components/block-caption/README.md +0 -5
- package/src/components/block-card/README.md +0 -5
- package/src/components/block-card/index.js +1 -1
- 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-editing-mode/index.js +3 -3
- package/src/components/block-icon/README.md +0 -5
- package/src/components/block-inspector/README.md +0 -5
- package/src/components/block-inspector/index.js +3 -1
- package/src/components/block-list/block-list-item-cell.native.js +5 -1
- package/src/components/block-list/block.js +290 -119
- package/src/components/block-list/block.native.js +55 -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 +32 -128
- 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 +8 -5
- package/src/components/block-switcher/index.js +49 -59
- package/src/components/block-toolbar/README.md +0 -5
- package/src/components/block-toolbar/index.js +1 -2
- package/src/components/block-tools/block-toolbar-popover.js +4 -10
- package/src/components/block-types-list/README.md +0 -5
- package/src/components/block-variation-picker/README.md +0 -5
- 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/contrast-checker/README.md +0 -4
- package/src/components/copy-handler/README.md +0 -10
- 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 +2 -1
- 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 +2 -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 +47 -14
- 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-size-control/index.js +5 -2
- package/src/components/index.native.js +2 -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/menu.js +13 -31
- package/src/components/inserter/style.scss +6 -4
- package/src/components/inserter/tabs.js +34 -25
- package/src/components/inserter-draggable-blocks/index.js +2 -2
- 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-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/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/index.js +13 -11
- package/src/components/plain-text/index.native.js +6 -1
- 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/index.js +18 -6
- package/src/components/rich-text/native/index.native.js +16 -24
- 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 +2 -2
- package/src/components/rich-text/use-mark-persistent.js +1 -2
- 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 +85 -34
- package/src/components/use-moving-animation/index.js +107 -103
- package/src/components/use-on-block-drop/index.js +7 -23
- package/src/components/use-on-block-drop/test/index.js +12 -26
- package/src/components/use-resize-canvas/README.md +0 -4
- package/src/components/use-settings/README.md +0 -4
- 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 +1 -5
- package/src/hooks/anchor.js +1 -5
- package/src/hooks/aria-label.js +8 -5
- package/src/hooks/background.js +253 -21
- package/src/hooks/border.js +2 -13
- package/src/hooks/color.js +19 -14
- package/src/hooks/custom-class-name.js +1 -5
- package/src/hooks/custom-class-name.native.js +8 -5
- package/src/hooks/dimensions.js +1 -7
- package/src/hooks/font-family.js +4 -7
- package/src/hooks/font-size.js +1 -6
- package/src/hooks/index.js +19 -5
- package/src/hooks/index.native.js +17 -4
- package/src/hooks/layout.js +5 -2
- package/src/hooks/style.js +1 -6
- 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 +1 -7
- package/src/hooks/typography.native.js +31 -33
- package/src/hooks/use-typography-props.js +7 -1
- package/src/hooks/utils.js +76 -6
- package/src/private-apis.js +2 -4
- package/src/private-apis.native.js +0 -2
- package/src/store/actions.js +0 -15
- package/src/store/private-actions.js +44 -4
- package/src/store/private-selectors.js +11 -0
- package/src/store/reducer.js +16 -5
- package/src/store/selectors.js +5 -13
- package/src/store/undo-ignore.js +4 -0
- package/src/store/utils.js +2 -2
- package/src/style.scss +1 -0
- package/src/utils/get-px-from-css-unit.js +8 -0
- package/src/utils/index.js +1 -1
- package/src/utils/object.js +16 -35
- 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/hooks/custom-fields.js +0 -106
- 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/hooks/custom-fields.js +0 -99
- 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/hooks/custom-fields.js +0 -115
- 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/background.js
CHANGED
|
@@ -10,7 +10,12 @@ import { isBlobURL } from '@wordpress/blob';
|
|
|
10
10
|
import { getBlockSupport } from '@wordpress/blocks';
|
|
11
11
|
import { focus } from '@wordpress/dom';
|
|
12
12
|
import {
|
|
13
|
+
ToggleControl,
|
|
14
|
+
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
15
|
+
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
13
16
|
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
17
|
+
__experimentalUnitControl as UnitControl,
|
|
18
|
+
__experimentalVStack as VStack,
|
|
14
19
|
DropZone,
|
|
15
20
|
FlexItem,
|
|
16
21
|
MenuItem,
|
|
@@ -24,7 +29,6 @@ import { Platform, useCallback, useRef } from '@wordpress/element';
|
|
|
24
29
|
import { __, sprintf } from '@wordpress/i18n';
|
|
25
30
|
import { store as noticesStore } from '@wordpress/notices';
|
|
26
31
|
import { getFilename } from '@wordpress/url';
|
|
27
|
-
import { pure } from '@wordpress/compose';
|
|
28
32
|
|
|
29
33
|
/**
|
|
30
34
|
* Internal dependencies
|
|
@@ -53,6 +57,17 @@ export function hasBackgroundImageValue( style ) {
|
|
|
53
57
|
return hasValue;
|
|
54
58
|
}
|
|
55
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Checks if there is a current value in the background size block support
|
|
62
|
+
* attributes.
|
|
63
|
+
*
|
|
64
|
+
* @param {Object} style Style attribute.
|
|
65
|
+
* @return {boolean} Whether or not the block has a background size value set.
|
|
66
|
+
*/
|
|
67
|
+
export function hasBackgroundSizeValue( style ) {
|
|
68
|
+
return style?.background?.backgroundSize !== undefined;
|
|
69
|
+
}
|
|
70
|
+
|
|
56
71
|
/**
|
|
57
72
|
* Determine whether there is block support for background.
|
|
58
73
|
*
|
|
@@ -73,7 +88,11 @@ export function hasBackgroundSupport( blockName, feature = 'any' ) {
|
|
|
73
88
|
}
|
|
74
89
|
|
|
75
90
|
if ( feature === 'any' ) {
|
|
76
|
-
return
|
|
91
|
+
return (
|
|
92
|
+
!! support?.backgroundImage ||
|
|
93
|
+
!! support?.backgroundSize ||
|
|
94
|
+
!! support?.backgroundRepeat
|
|
95
|
+
);
|
|
77
96
|
}
|
|
78
97
|
|
|
79
98
|
return !! support?.[ feature ];
|
|
@@ -98,6 +117,37 @@ export function resetBackgroundImage( style = {}, setAttributes ) {
|
|
|
98
117
|
} );
|
|
99
118
|
}
|
|
100
119
|
|
|
120
|
+
/**
|
|
121
|
+
* Resets the background size block support attributes. This can be used when disabling
|
|
122
|
+
* the background size controls for a block via a `ToolsPanel`.
|
|
123
|
+
*
|
|
124
|
+
* @param {Object} style Style attribute.
|
|
125
|
+
* @param {Function} setAttributes Function to set block's attributes.
|
|
126
|
+
*/
|
|
127
|
+
function resetBackgroundSize( style = {}, setAttributes ) {
|
|
128
|
+
setAttributes( {
|
|
129
|
+
style: cleanEmptyObject( {
|
|
130
|
+
...style,
|
|
131
|
+
background: {
|
|
132
|
+
...style?.background,
|
|
133
|
+
backgroundRepeat: undefined,
|
|
134
|
+
backgroundSize: undefined,
|
|
135
|
+
},
|
|
136
|
+
} ),
|
|
137
|
+
} );
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Generates a CSS class name if an background image is set.
|
|
142
|
+
*
|
|
143
|
+
* @param {Object} style A block's style attribute.
|
|
144
|
+
*
|
|
145
|
+
* @return {string} CSS class name.
|
|
146
|
+
*/
|
|
147
|
+
export function getBackgroundImageClasses( style ) {
|
|
148
|
+
return hasBackgroundImageValue( style ) ? 'has-background' : '';
|
|
149
|
+
}
|
|
150
|
+
|
|
101
151
|
function InspectorImagePreview( { label, filename, url: imgUrl } ) {
|
|
102
152
|
const imgLabel = label || getFilename( imgUrl );
|
|
103
153
|
return (
|
|
@@ -143,22 +193,27 @@ function InspectorImagePreview( { label, filename, url: imgUrl } ) {
|
|
|
143
193
|
);
|
|
144
194
|
}
|
|
145
195
|
|
|
146
|
-
function BackgroundImagePanelItem( {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
196
|
+
function BackgroundImagePanelItem( {
|
|
197
|
+
clientId,
|
|
198
|
+
isShownByDefault,
|
|
199
|
+
setAttributes,
|
|
200
|
+
} ) {
|
|
201
|
+
const { style, mediaUpload } = useSelect(
|
|
202
|
+
( select ) => {
|
|
203
|
+
const { getBlockAttributes, getSettings } =
|
|
204
|
+
select( blockEditorStore );
|
|
205
|
+
|
|
206
|
+
return {
|
|
207
|
+
style: getBlockAttributes( clientId )?.style,
|
|
208
|
+
mediaUpload: getSettings().mediaUpload,
|
|
209
|
+
};
|
|
210
|
+
},
|
|
150
211
|
[ clientId ]
|
|
151
212
|
);
|
|
152
213
|
const { id, title, url } = style?.background?.backgroundImage || {};
|
|
153
214
|
|
|
154
215
|
const replaceContainerRef = useRef();
|
|
155
216
|
|
|
156
|
-
const { mediaUpload } = useSelect( ( select ) => {
|
|
157
|
-
return {
|
|
158
|
-
mediaUpload: select( blockEditorStore ).getSettings().mediaUpload,
|
|
159
|
-
};
|
|
160
|
-
} );
|
|
161
|
-
|
|
162
217
|
const { createErrorNotice } = useDispatch( noticesStore );
|
|
163
218
|
const onUploadError = ( message ) => {
|
|
164
219
|
createErrorNotice( message, { type: 'snackbar' } );
|
|
@@ -252,7 +307,7 @@ function BackgroundImagePanelItem( { clientId, setAttributes } ) {
|
|
|
252
307
|
hasValue={ () => hasValue }
|
|
253
308
|
label={ __( 'Background image' ) }
|
|
254
309
|
onDeselect={ () => resetBackgroundImage( style, setAttributes ) }
|
|
255
|
-
isShownByDefault={
|
|
310
|
+
isShownByDefault={ isShownByDefault }
|
|
256
311
|
resetAllFilter={ resetAllFilter }
|
|
257
312
|
panelId={ clientId }
|
|
258
313
|
>
|
|
@@ -302,8 +357,172 @@ function BackgroundImagePanelItem( { clientId, setAttributes } ) {
|
|
|
302
357
|
);
|
|
303
358
|
}
|
|
304
359
|
|
|
305
|
-
function
|
|
306
|
-
|
|
360
|
+
function backgroundSizeHelpText( value ) {
|
|
361
|
+
if ( value === 'cover' || value === undefined ) {
|
|
362
|
+
return __( 'Stretch image to cover the block.' );
|
|
363
|
+
}
|
|
364
|
+
if ( value === 'contain' ) {
|
|
365
|
+
return __( 'Resize image to fit without cropping.' );
|
|
366
|
+
}
|
|
367
|
+
return __( 'Set a fixed width.' );
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
function BackgroundSizePanelItem( {
|
|
371
|
+
clientId,
|
|
372
|
+
isShownByDefault,
|
|
373
|
+
setAttributes,
|
|
374
|
+
} ) {
|
|
375
|
+
const style = useSelect(
|
|
376
|
+
( select ) =>
|
|
377
|
+
select( blockEditorStore ).getBlockAttributes( clientId )?.style,
|
|
378
|
+
[ clientId ]
|
|
379
|
+
);
|
|
380
|
+
|
|
381
|
+
const sizeValue = style?.background?.backgroundSize;
|
|
382
|
+
const repeatValue = style?.background?.backgroundRepeat;
|
|
383
|
+
|
|
384
|
+
// An `undefined` value is treated as `cover` by the toggle group control.
|
|
385
|
+
// An empty string is treated as `auto` by the toggle group control. This
|
|
386
|
+
// allows a user to select "Size" and then enter a custom value, with an
|
|
387
|
+
// empty value being treated as `auto`.
|
|
388
|
+
const currentValueForToggle =
|
|
389
|
+
( sizeValue !== undefined &&
|
|
390
|
+
sizeValue !== 'cover' &&
|
|
391
|
+
sizeValue !== 'contain' ) ||
|
|
392
|
+
sizeValue === ''
|
|
393
|
+
? 'auto'
|
|
394
|
+
: sizeValue || 'cover';
|
|
395
|
+
|
|
396
|
+
// If the current value is `cover` and the repeat value is `undefined`, then
|
|
397
|
+
// the toggle should be unchecked as the default state. Otherwise, the toggle
|
|
398
|
+
// should reflect the current repeat value.
|
|
399
|
+
const repeatCheckedValue =
|
|
400
|
+
repeatValue === 'no-repeat' ||
|
|
401
|
+
( currentValueForToggle === 'cover' && repeatValue === undefined )
|
|
402
|
+
? false
|
|
403
|
+
: true;
|
|
404
|
+
|
|
405
|
+
const hasValue = hasBackgroundSizeValue( style );
|
|
406
|
+
|
|
407
|
+
const resetAllFilter = useCallback( ( previousValue ) => {
|
|
408
|
+
return {
|
|
409
|
+
...previousValue,
|
|
410
|
+
style: {
|
|
411
|
+
...previousValue.style,
|
|
412
|
+
background: {
|
|
413
|
+
...previousValue.style?.background,
|
|
414
|
+
backgroundRepeat: undefined,
|
|
415
|
+
backgroundSize: undefined,
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
};
|
|
419
|
+
}, [] );
|
|
420
|
+
|
|
421
|
+
const updateBackgroundSize = ( next ) => {
|
|
422
|
+
// When switching to 'contain' toggle the repeat off.
|
|
423
|
+
let nextRepeat = repeatValue;
|
|
424
|
+
|
|
425
|
+
if ( next === 'contain' ) {
|
|
426
|
+
nextRepeat = 'no-repeat';
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
if (
|
|
430
|
+
( currentValueForToggle === 'cover' ||
|
|
431
|
+
currentValueForToggle === 'contain' ) &&
|
|
432
|
+
next === 'auto'
|
|
433
|
+
) {
|
|
434
|
+
nextRepeat = undefined;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
setAttributes( {
|
|
438
|
+
style: cleanEmptyObject( {
|
|
439
|
+
...style,
|
|
440
|
+
background: {
|
|
441
|
+
...style?.background,
|
|
442
|
+
backgroundRepeat: nextRepeat,
|
|
443
|
+
backgroundSize: next,
|
|
444
|
+
},
|
|
445
|
+
} ),
|
|
446
|
+
} );
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
const toggleIsRepeated = () => {
|
|
450
|
+
setAttributes( {
|
|
451
|
+
style: cleanEmptyObject( {
|
|
452
|
+
...style,
|
|
453
|
+
background: {
|
|
454
|
+
...style?.background,
|
|
455
|
+
backgroundRepeat:
|
|
456
|
+
repeatCheckedValue === true ? 'no-repeat' : undefined,
|
|
457
|
+
},
|
|
458
|
+
} ),
|
|
459
|
+
} );
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
return (
|
|
463
|
+
<VStack
|
|
464
|
+
as={ ToolsPanelItem }
|
|
465
|
+
spacing={ 2 }
|
|
466
|
+
className="single-column"
|
|
467
|
+
hasValue={ () => hasValue }
|
|
468
|
+
label={ __( 'Size' ) }
|
|
469
|
+
onDeselect={ () => resetBackgroundSize( style, setAttributes ) }
|
|
470
|
+
isShownByDefault={ isShownByDefault }
|
|
471
|
+
resetAllFilter={ resetAllFilter }
|
|
472
|
+
panelId={ clientId }
|
|
473
|
+
>
|
|
474
|
+
<ToggleGroupControl
|
|
475
|
+
__nextHasNoMarginBottom
|
|
476
|
+
size={ '__unstable-large' }
|
|
477
|
+
label={ __( 'Size' ) }
|
|
478
|
+
value={ currentValueForToggle }
|
|
479
|
+
onChange={ updateBackgroundSize }
|
|
480
|
+
isBlock={ true }
|
|
481
|
+
help={ backgroundSizeHelpText( sizeValue ) }
|
|
482
|
+
>
|
|
483
|
+
<ToggleGroupControlOption
|
|
484
|
+
key={ 'cover' }
|
|
485
|
+
value={ 'cover' }
|
|
486
|
+
label={ __( 'Cover' ) }
|
|
487
|
+
/>
|
|
488
|
+
<ToggleGroupControlOption
|
|
489
|
+
key={ 'contain' }
|
|
490
|
+
value={ 'contain' }
|
|
491
|
+
label={ __( 'Contain' ) }
|
|
492
|
+
/>
|
|
493
|
+
<ToggleGroupControlOption
|
|
494
|
+
key={ 'fixed' }
|
|
495
|
+
value={ 'auto' }
|
|
496
|
+
label={ __( 'Fixed' ) }
|
|
497
|
+
/>
|
|
498
|
+
</ToggleGroupControl>
|
|
499
|
+
{ sizeValue !== undefined &&
|
|
500
|
+
sizeValue !== 'cover' &&
|
|
501
|
+
sizeValue !== 'contain' ? (
|
|
502
|
+
<UnitControl
|
|
503
|
+
size={ '__unstable-large' }
|
|
504
|
+
onChange={ updateBackgroundSize }
|
|
505
|
+
value={ sizeValue }
|
|
506
|
+
/>
|
|
507
|
+
) : null }
|
|
508
|
+
{ currentValueForToggle !== 'cover' && (
|
|
509
|
+
<ToggleControl
|
|
510
|
+
__nextHasNoMarginBottom
|
|
511
|
+
label={ __( 'Repeat image' ) }
|
|
512
|
+
checked={ repeatCheckedValue }
|
|
513
|
+
onChange={ toggleIsRepeated }
|
|
514
|
+
/>
|
|
515
|
+
) }
|
|
516
|
+
</VStack>
|
|
517
|
+
);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export function BackgroundImagePanel( props ) {
|
|
521
|
+
const [ backgroundImage, backgroundSize ] = useSettings(
|
|
522
|
+
'background.backgroundImage',
|
|
523
|
+
'background.backgroundSize'
|
|
524
|
+
);
|
|
525
|
+
|
|
307
526
|
if (
|
|
308
527
|
! backgroundImage ||
|
|
309
528
|
! hasBackgroundSupport( props.name, 'backgroundImage' )
|
|
@@ -311,14 +530,27 @@ function BackgroundImagePanelPure( props ) {
|
|
|
311
530
|
return null;
|
|
312
531
|
}
|
|
313
532
|
|
|
533
|
+
const showBackgroundSize = !! (
|
|
534
|
+
backgroundSize && hasBackgroundSupport( props.name, 'backgroundSize' )
|
|
535
|
+
);
|
|
536
|
+
|
|
537
|
+
const defaultControls = getBlockSupport( props.name, [
|
|
538
|
+
BACKGROUND_SUPPORT_KEY,
|
|
539
|
+
'__experimentalDefaultControls',
|
|
540
|
+
] );
|
|
541
|
+
|
|
314
542
|
return (
|
|
315
543
|
<InspectorControls group="background">
|
|
316
|
-
<BackgroundImagePanelItem
|
|
544
|
+
<BackgroundImagePanelItem
|
|
545
|
+
isShownByDefault={ defaultControls?.backgroundImage }
|
|
546
|
+
{ ...props }
|
|
547
|
+
/>
|
|
548
|
+
{ showBackgroundSize && (
|
|
549
|
+
<BackgroundSizePanelItem
|
|
550
|
+
isShownByDefault={ defaultControls?.backgroundSize }
|
|
551
|
+
{ ...props }
|
|
552
|
+
/>
|
|
553
|
+
) }
|
|
317
554
|
</InspectorControls>
|
|
318
555
|
);
|
|
319
556
|
}
|
|
320
|
-
|
|
321
|
-
// We don't want block controls to re-render when typing inside a block. `pure`
|
|
322
|
-
// will prevent re-renders unless props change, so only pass the needed props
|
|
323
|
-
// and not the whole attributes object.
|
|
324
|
-
export const BackgroundImagePanel = pure( BackgroundImagePanelPure );
|
package/src/hooks/border.js
CHANGED
|
@@ -8,7 +8,6 @@ import classnames from 'classnames';
|
|
|
8
8
|
*/
|
|
9
9
|
import { getBlockSupport } from '@wordpress/blocks';
|
|
10
10
|
import { __experimentalHasSplitBorders as hasSplitBorders } from '@wordpress/components';
|
|
11
|
-
import { pure } from '@wordpress/compose';
|
|
12
11
|
import { Platform, useCallback, useMemo } from '@wordpress/element';
|
|
13
12
|
import { addFilter } from '@wordpress/hooks';
|
|
14
13
|
import { useSelect } from '@wordpress/data';
|
|
@@ -133,7 +132,7 @@ function BordersInspectorControl( { children, resetAllFilter } ) {
|
|
|
133
132
|
);
|
|
134
133
|
}
|
|
135
134
|
|
|
136
|
-
function
|
|
135
|
+
export function BorderPanel( { clientId, name, setAttributes, settings } ) {
|
|
137
136
|
const isEnabled = useHasBorderPanel( settings );
|
|
138
137
|
function selector( select ) {
|
|
139
138
|
const { style, borderColor } =
|
|
@@ -170,11 +169,6 @@ function BorderPanelPure( { clientId, name, setAttributes, settings } ) {
|
|
|
170
169
|
);
|
|
171
170
|
}
|
|
172
171
|
|
|
173
|
-
// We don't want block controls to re-render when typing inside a block. `pure`
|
|
174
|
-
// will prevent re-renders unless props change, so only pass the needed props
|
|
175
|
-
// and not the whole attributes object.
|
|
176
|
-
export const BorderPanel = pure( BorderPanelPure );
|
|
177
|
-
|
|
178
172
|
/**
|
|
179
173
|
* Determine whether there is block support for border properties.
|
|
180
174
|
*
|
|
@@ -348,6 +342,7 @@ function useBlockProps( { name, borderColor, style } ) {
|
|
|
348
342
|
|
|
349
343
|
export default {
|
|
350
344
|
useBlockProps,
|
|
345
|
+
addSaveProps,
|
|
351
346
|
attributeKeys: [ 'borderColor', 'style' ],
|
|
352
347
|
hasSupport( name ) {
|
|
353
348
|
return hasBorderSupport( name, 'color' );
|
|
@@ -359,9 +354,3 @@ addFilter(
|
|
|
359
354
|
'core/border/addAttributes',
|
|
360
355
|
addAttributes
|
|
361
356
|
);
|
|
362
|
-
|
|
363
|
-
addFilter(
|
|
364
|
-
'blocks.getSaveContent.extraProps',
|
|
365
|
-
'core/border/addSaveProps',
|
|
366
|
-
addSaveProps
|
|
367
|
-
);
|
package/src/hooks/color.js
CHANGED
|
@@ -9,7 +9,6 @@ import classnames from 'classnames';
|
|
|
9
9
|
import { addFilter } from '@wordpress/hooks';
|
|
10
10
|
import { getBlockSupport } from '@wordpress/blocks';
|
|
11
11
|
import { useMemo, Platform, useCallback } from '@wordpress/element';
|
|
12
|
-
import { pure } from '@wordpress/compose';
|
|
13
12
|
import { useSelect } from '@wordpress/data';
|
|
14
13
|
|
|
15
14
|
/**
|
|
@@ -25,6 +24,7 @@ import {
|
|
|
25
24
|
transformStyles,
|
|
26
25
|
shouldSkipSerialization,
|
|
27
26
|
} from './utils';
|
|
27
|
+
import { getBackgroundImageClasses } from './background';
|
|
28
28
|
import { useSettings } from '../components/use-settings';
|
|
29
29
|
import InspectorControls from '../components/inspector-controls';
|
|
30
30
|
import {
|
|
@@ -267,7 +267,7 @@ function ColorInspectorControl( { children, resetAllFilter } ) {
|
|
|
267
267
|
);
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
function
|
|
270
|
+
export function ColorEdit( { clientId, name, setAttributes, settings } ) {
|
|
271
271
|
const isEnabled = useHasColorPanel( settings );
|
|
272
272
|
function selector( select ) {
|
|
273
273
|
const { style, textColor, backgroundColor, gradient } =
|
|
@@ -336,11 +336,6 @@ function ColorEditPure( { clientId, name, setAttributes, settings } ) {
|
|
|
336
336
|
);
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
-
// We don't want block controls to re-render when typing inside a block. `pure`
|
|
340
|
-
// will prevent re-renders unless props change, so only pass the needed props
|
|
341
|
-
// and not the whole attributes object.
|
|
342
|
-
export const ColorEdit = pure( ColorEditPure );
|
|
343
|
-
|
|
344
339
|
function useBlockProps( {
|
|
345
340
|
name,
|
|
346
341
|
backgroundColor,
|
|
@@ -389,16 +384,32 @@ function useBlockProps( {
|
|
|
389
384
|
)?.color;
|
|
390
385
|
}
|
|
391
386
|
|
|
392
|
-
|
|
387
|
+
const saveProps = addSaveProps( { style: extraStyles }, name, {
|
|
393
388
|
textColor,
|
|
394
389
|
backgroundColor,
|
|
395
390
|
gradient,
|
|
396
391
|
style,
|
|
397
392
|
} );
|
|
393
|
+
|
|
394
|
+
const hasBackgroundValue =
|
|
395
|
+
backgroundColor ||
|
|
396
|
+
style?.color?.background ||
|
|
397
|
+
gradient ||
|
|
398
|
+
style?.color?.gradient;
|
|
399
|
+
|
|
400
|
+
return {
|
|
401
|
+
...saveProps,
|
|
402
|
+
className: classnames(
|
|
403
|
+
saveProps.className,
|
|
404
|
+
// Add background image classes in the editor, if not already handled by background color values.
|
|
405
|
+
! hasBackgroundValue && getBackgroundImageClasses( style )
|
|
406
|
+
),
|
|
407
|
+
};
|
|
398
408
|
}
|
|
399
409
|
|
|
400
410
|
export default {
|
|
401
411
|
useBlockProps,
|
|
412
|
+
addSaveProps,
|
|
402
413
|
attributeKeys: [ 'backgroundColor', 'textColor', 'gradient', 'style' ],
|
|
403
414
|
hasSupport: hasColorSupport,
|
|
404
415
|
};
|
|
@@ -437,12 +448,6 @@ addFilter(
|
|
|
437
448
|
addAttributes
|
|
438
449
|
);
|
|
439
450
|
|
|
440
|
-
addFilter(
|
|
441
|
-
'blocks.getSaveContent.extraProps',
|
|
442
|
-
'core/color/addSaveProps',
|
|
443
|
-
addSaveProps
|
|
444
|
-
);
|
|
445
|
-
|
|
446
451
|
addFilter(
|
|
447
452
|
'blocks.switchToBlockType.transformedBlock',
|
|
448
453
|
'core/color/addTransforms',
|
|
@@ -65,6 +65,7 @@ function CustomClassNameControlsPure( { className, setAttributes } ) {
|
|
|
65
65
|
|
|
66
66
|
export default {
|
|
67
67
|
edit: CustomClassNameControlsPure,
|
|
68
|
+
addSaveProps,
|
|
68
69
|
attributeKeys: [ 'className' ],
|
|
69
70
|
hasSupport( name ) {
|
|
70
71
|
return hasBlockSupport( name, 'customClassName', true );
|
|
@@ -140,11 +141,6 @@ addFilter(
|
|
|
140
141
|
'core/editor/custom-class-name/attribute',
|
|
141
142
|
addAttribute
|
|
142
143
|
);
|
|
143
|
-
addFilter(
|
|
144
|
-
'blocks.getSaveContent.extraProps',
|
|
145
|
-
'core/editor/custom-class-name/save-props',
|
|
146
|
-
addSaveProps
|
|
147
|
-
);
|
|
148
144
|
|
|
149
145
|
addFilter(
|
|
150
146
|
'blocks.switchToBlockType.transformedBlock',
|
|
@@ -60,8 +60,11 @@ addFilter(
|
|
|
60
60
|
'core/custom-class-name/attribute',
|
|
61
61
|
addAttribute
|
|
62
62
|
);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
)
|
|
63
|
+
|
|
64
|
+
export default {
|
|
65
|
+
addSaveProps,
|
|
66
|
+
attributeKeys: [ 'className' ],
|
|
67
|
+
hasSupport( name ) {
|
|
68
|
+
return hasBlockSupport( name, 'customClassName', true );
|
|
69
|
+
},
|
|
70
|
+
};
|
package/src/hooks/dimensions.js
CHANGED
|
@@ -5,7 +5,6 @@ import { useState, useEffect, useCallback } from '@wordpress/element';
|
|
|
5
5
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
6
|
import { getBlockSupport } from '@wordpress/blocks';
|
|
7
7
|
import deprecated from '@wordpress/deprecated';
|
|
8
|
-
import { pure } from '@wordpress/compose';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Internal dependencies
|
|
@@ -66,7 +65,7 @@ function DimensionsInspectorControl( { children, resetAllFilter } ) {
|
|
|
66
65
|
);
|
|
67
66
|
}
|
|
68
67
|
|
|
69
|
-
function
|
|
68
|
+
export function DimensionsPanel( { clientId, name, setAttributes, settings } ) {
|
|
70
69
|
const isEnabled = useHasDimensionsPanel( settings );
|
|
71
70
|
const value = useSelect(
|
|
72
71
|
( select ) =>
|
|
@@ -126,11 +125,6 @@ function DimensionsPanelPure( { clientId, name, setAttributes, settings } ) {
|
|
|
126
125
|
);
|
|
127
126
|
}
|
|
128
127
|
|
|
129
|
-
// We don't want block controls to re-render when typing inside a block. `pure`
|
|
130
|
-
// will prevent re-renders unless props change, so only pass the needed props
|
|
131
|
-
// and not the whole attributes object.
|
|
132
|
-
export const DimensionsPanel = pure( DimensionsPanelPure );
|
|
133
|
-
|
|
134
128
|
/**
|
|
135
129
|
* @deprecated
|
|
136
130
|
*/
|
package/src/hooks/font-family.js
CHANGED
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
import { addFilter } from '@wordpress/hooks';
|
|
5
5
|
import { hasBlockSupport } from '@wordpress/blocks';
|
|
6
6
|
import TokenList from '@wordpress/token-list';
|
|
7
|
+
import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Internal dependencies
|
|
10
11
|
*/
|
|
11
12
|
import { shouldSkipSerialization } from './utils';
|
|
12
13
|
import { TYPOGRAPHY_SUPPORT_KEY } from './typography';
|
|
13
|
-
import {
|
|
14
|
+
import { unlock } from '../lock-unlock';
|
|
14
15
|
|
|
15
16
|
export const FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';
|
|
16
17
|
|
|
@@ -67,6 +68,7 @@ function addSaveProps( props, blockType, attributes ) {
|
|
|
67
68
|
|
|
68
69
|
// Use TokenList to dedupe classes.
|
|
69
70
|
const classes = new TokenList( props.className );
|
|
71
|
+
const { kebabCase } = unlock( componentsPrivateApis );
|
|
70
72
|
classes.add( `has-${ kebabCase( attributes?.fontFamily ) }-font-family` );
|
|
71
73
|
const newClassName = classes.value;
|
|
72
74
|
props.className = newClassName ? newClassName : undefined;
|
|
@@ -80,6 +82,7 @@ function useBlockProps( { name, fontFamily } ) {
|
|
|
80
82
|
|
|
81
83
|
export default {
|
|
82
84
|
useBlockProps,
|
|
85
|
+
addSaveProps,
|
|
83
86
|
attributeKeys: [ 'fontFamily' ],
|
|
84
87
|
hasSupport( name ) {
|
|
85
88
|
return hasBlockSupport( name, FONT_FAMILY_SUPPORT_KEY );
|
|
@@ -103,9 +106,3 @@ addFilter(
|
|
|
103
106
|
'core/fontFamily/addAttribute',
|
|
104
107
|
addAttributes
|
|
105
108
|
);
|
|
106
|
-
|
|
107
|
-
addFilter(
|
|
108
|
-
'blocks.getSaveContent.extraProps',
|
|
109
|
-
'core/fontFamily/addSaveProps',
|
|
110
|
-
addSaveProps
|
|
111
|
-
);
|
package/src/hooks/font-size.js
CHANGED
|
@@ -211,6 +211,7 @@ function useBlockProps( { name, fontSize, style } ) {
|
|
|
211
211
|
|
|
212
212
|
export default {
|
|
213
213
|
useBlockProps,
|
|
214
|
+
addSaveProps,
|
|
214
215
|
attributeKeys: [ 'fontSize', 'style' ],
|
|
215
216
|
hasSupport( name ) {
|
|
216
217
|
return hasBlockSupport( name, FONT_SIZE_SUPPORT_KEY );
|
|
@@ -245,12 +246,6 @@ addFilter(
|
|
|
245
246
|
addAttributes
|
|
246
247
|
);
|
|
247
248
|
|
|
248
|
-
addFilter(
|
|
249
|
-
'blocks.getSaveContent.extraProps',
|
|
250
|
-
'core/font/addSaveProps',
|
|
251
|
-
addSaveProps
|
|
252
|
-
);
|
|
253
|
-
|
|
254
249
|
addFilter(
|
|
255
250
|
'blocks.switchToBlockType.transformedBlock',
|
|
256
251
|
'core/font-size/addTransforms',
|
package/src/hooks/index.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
createBlockEditFilter,
|
|
6
|
+
createBlockListBlockFilter,
|
|
7
|
+
createBlockSaveFilter,
|
|
8
|
+
} from './utils';
|
|
5
9
|
import './compat';
|
|
6
10
|
import align from './align';
|
|
7
11
|
import './lock';
|
|
8
12
|
import anchor from './anchor';
|
|
9
|
-
import './aria-label';
|
|
13
|
+
import ariaLabel from './aria-label';
|
|
10
14
|
import customClassName from './custom-class-name';
|
|
11
15
|
import './generated-class-name';
|
|
12
16
|
import style from './style';
|
|
@@ -19,9 +23,8 @@ import border from './border';
|
|
|
19
23
|
import position from './position';
|
|
20
24
|
import layout from './layout';
|
|
21
25
|
import childLayout from './layout-child';
|
|
22
|
-
import './content-lock-ui';
|
|
26
|
+
import contentLockUI from './content-lock-ui';
|
|
23
27
|
import './metadata';
|
|
24
|
-
import customFields from './custom-fields';
|
|
25
28
|
import blockHooks from './block-hooks';
|
|
26
29
|
import blockRenaming from './block-renaming';
|
|
27
30
|
|
|
@@ -34,7 +37,7 @@ createBlockEditFilter(
|
|
|
34
37
|
duotone,
|
|
35
38
|
position,
|
|
36
39
|
layout,
|
|
37
|
-
|
|
40
|
+
contentLockUI,
|
|
38
41
|
blockHooks,
|
|
39
42
|
blockRenaming,
|
|
40
43
|
].filter( Boolean )
|
|
@@ -50,6 +53,17 @@ createBlockListBlockFilter( [
|
|
|
50
53
|
position,
|
|
51
54
|
childLayout,
|
|
52
55
|
] );
|
|
56
|
+
createBlockSaveFilter( [
|
|
57
|
+
align,
|
|
58
|
+
anchor,
|
|
59
|
+
ariaLabel,
|
|
60
|
+
customClassName,
|
|
61
|
+
border,
|
|
62
|
+
color,
|
|
63
|
+
style,
|
|
64
|
+
fontFamily,
|
|
65
|
+
fontSize,
|
|
66
|
+
] );
|
|
53
67
|
|
|
54
68
|
export { useCustomSides } from './dimensions';
|
|
55
69
|
export { useLayoutClasses, useLayoutStyles } from './layout';
|
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
createBlockEditFilter,
|
|
6
|
+
createBlockListBlockFilter,
|
|
7
|
+
createBlockSaveFilter,
|
|
8
|
+
} from './utils';
|
|
5
9
|
import './compat';
|
|
6
10
|
import align from './align';
|
|
7
11
|
import anchor from './anchor';
|
|
8
|
-
import './custom-class-name';
|
|
12
|
+
import customClassName from './custom-class-name';
|
|
9
13
|
import './generated-class-name';
|
|
10
14
|
import style from './style';
|
|
11
|
-
import './color';
|
|
12
|
-
import './font-size';
|
|
15
|
+
import color from './color';
|
|
16
|
+
import fontSize from './font-size';
|
|
13
17
|
import './layout';
|
|
14
18
|
|
|
15
19
|
createBlockEditFilter( [ align, anchor, style ] );
|
|
20
|
+
createBlockListBlockFilter( [ align, style, color, fontSize ] );
|
|
21
|
+
createBlockSaveFilter( [
|
|
22
|
+
align,
|
|
23
|
+
anchor,
|
|
24
|
+
customClassName,
|
|
25
|
+
color,
|
|
26
|
+
style,
|
|
27
|
+
fontSize,
|
|
28
|
+
] );
|
|
16
29
|
|
|
17
30
|
export { getBorderClassesAndStyles, useBorderProps } from './use-border-props';
|
|
18
31
|
export { getColorClassesAndStyles, useColorProps } from './use-color-props';
|