@wordpress/block-editor 12.14.0 → 12.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +10 -5
- package/build/components/block-canvas/index.js +22 -6
- package/build/components/block-canvas/index.js.map +1 -1
- package/build/components/block-card/index.js +1 -1
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-controls/hook.js +3 -23
- package/build/components/block-controls/hook.js.map +1 -1
- package/build/components/block-edit/context.js +5 -1
- package/build/components/block-edit/context.js.map +1 -1
- package/build/components/block-edit/index.js +18 -9
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-info-slot-fill/index.js +3 -4
- package/build/components/block-info-slot-fill/index.js.map +1 -1
- package/build/components/block-list/block.js +28 -9
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +16 -5
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +61 -18
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -29
- package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build/components/block-list/use-block-props/use-is-hovered.js +4 -14
- package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build/components/block-parent-selector/index.js +1 -1
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +25 -16
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +4 -2
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-patterns-list/index.js +37 -20
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +2 -9
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-rename/index.js +28 -0
- package/build/components/block-rename/index.js.map +1 -0
- package/build/components/block-rename/is-empty-string.js +10 -0
- package/build/components/block-rename/is-empty-string.js.map +1 -0
- package/build/components/block-rename/modal.js +90 -0
- package/build/components/block-rename/modal.js.map +1 -0
- package/build/components/block-rename/rename-control.js +74 -0
- package/build/components/block-rename/rename-control.js.map +1 -0
- package/build/components/block-rename/use-block-rename.js +17 -0
- package/build/components/block-rename/use-block-rename.js.map +1 -0
- package/build/components/block-settings/container.native.js +6 -4
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +33 -20
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +7 -0
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-styles/index.js +1 -1
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/index.native.js +3 -2
- package/build/components/block-styles/index.native.js.map +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build/components/block-toolbar/index.js +89 -27
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/block-toolbar-breadcrumb.js +49 -0
- package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
- package/build/components/block-tools/block-toolbar-popover.js +86 -0
- package/build/components/block-tools/block-toolbar-popover.js.map +1 -0
- package/build/components/block-tools/index.js +27 -24
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-types-list/index.js +6 -2
- package/build/components/block-types-list/index.js.map +1 -1
- package/build/components/block-types-list/index.native.js +4 -3
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/block-variation-picker/index.native.js +2 -1
- package/build/components/block-variation-picker/index.native.js.map +1 -1
- package/build/components/colors-gradients/control.js +28 -17
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/date-format-picker/index.js +8 -1
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/duotone-control/index.js +1 -4
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/global-styles/advanced-panel.js +1 -1
- package/build/components/global-styles/advanced-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +22 -20
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +9 -3
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +20 -31
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/image-link-destinations/index.native.js +118 -0
- package/build/components/image-link-destinations/index.native.js.map +1 -0
- package/build/components/image-size-control/index.js +0 -5
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/index.native.js +8 -0
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/index.js +3 -1
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/warning-max-depth-exceeded.native.js +29 -31
- package/build/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/utils.js +3 -4
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +2 -1
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/media-tab/media-panel.js +2 -2
- package/build/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build/components/inserter/menu.js +14 -7
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/preview-panel.js +2 -2
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter-button/index.native.js +98 -0
- package/build/components/inserter-button/index.native.js.map +1 -0
- package/build/components/inserter-button/sparkles.js +23 -0
- package/build/components/inserter-button/sparkles.js.map +1 -0
- package/build/components/inserter-draggable-blocks/index.js +8 -4
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inserter-listbox/index.js +11 -6
- package/build/components/inserter-listbox/index.js.map +1 -1
- package/build/components/inserter-listbox/item.js +24 -23
- package/build/components/inserter-listbox/item.js.map +1 -1
- package/build/components/inserter-listbox/row.js +5 -5
- package/build/components/inserter-listbox/row.js.map +1 -1
- package/build/components/inspector-controls/fill.js +3 -3
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/fill.native.js +3 -3
- package/build/components/inspector-controls/fill.native.js.map +1 -1
- package/build/components/list-view/use-list-view-expand-selected-item.js +2 -3
- package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +2 -2
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/preview-options/index.js +6 -60
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/rich-text/content.js +26 -23
- package/build/components/rich-text/content.js.map +1 -1
- package/build/components/rich-text/get-rich-text-values.js +2 -1
- package/build/components/rich-text/get-rich-text-values.js.map +1 -1
- package/build/components/rich-text/index.js +2 -30
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +10 -17
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/native/get-format-colors.native.js +22 -24
- package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +41 -37
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/rich-text/use-input-rules.js +35 -2
- package/build/components/rich-text/use-input-rules.js.map +1 -1
- package/build/components/rich-text/with-deprecations.js +50 -0
- package/build/components/rich-text/with-deprecations.js.map +1 -0
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +74 -9
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +2 -1
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +1 -1
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +4 -1
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/components/use-settings/index.js +16 -2
- package/build/components/use-settings/index.js.map +1 -1
- package/build/hooks/align.js +20 -68
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/align.native.js +11 -1
- package/build/hooks/align.native.js.map +1 -1
- package/build/hooks/anchor.js +13 -29
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/background.js +28 -31
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-hooks.js +24 -32
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-renaming.js +38 -0
- package/build/hooks/block-renaming.js.map +1 -1
- package/build/hooks/border.js +58 -80
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +76 -89
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/content-lock-ui.js +29 -29
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/custom-class-name.js +12 -29
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/custom-fields.js +64 -73
- package/build/hooks/custom-fields.js.map +1 -1
- package/build/hooks/dimensions.js +21 -17
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +31 -61
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-family.js +16 -25
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +51 -119
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/index.js +25 -15
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +10 -3
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/layout-child.js +68 -0
- package/build/hooks/layout-child.js.map +1 -0
- package/build/hooks/layout.js +29 -108
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/padding.js +2 -2
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/position.js +40 -62
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/style.js +51 -88
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/typography.js +34 -14
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/utils.js +154 -7
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +4 -3
- package/build/layouts/constrained.js.map +1 -1
- package/build/private-apis.js +0 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/private-actions.js +8 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +34 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +8 -0
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +10 -58
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +66 -0
- package/build/store/utils.js.map +1 -0
- package/build/utils/object.js +21 -61
- package/build/utils/object.js.map +1 -1
- package/build/utils/selection.js +9 -1
- package/build/utils/selection.js.map +1 -1
- package/build/utils/transform-styles/index.js +26 -6
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-canvas/index.js +23 -7
- package/build-module/components/block-canvas/index.js.map +1 -1
- package/build-module/components/block-card/index.js +1 -1
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-controls/hook.js +4 -24
- package/build-module/components/block-controls/hook.js.map +1 -1
- package/build-module/components/block-edit/context.js +2 -0
- package/build-module/components/block-edit/context.js.map +1 -1
- package/build-module/components/block-edit/index.js +19 -10
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-info-slot-fill/index.js +3 -3
- package/build-module/components/block-info-slot-fill/index.js.map +1 -1
- package/build-module/components/block-list/block.js +29 -10
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +16 -5
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +62 -19
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -29
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-is-hovered.js +4 -14
- package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +1 -1
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +24 -15
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +4 -2
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +37 -20
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +3 -10
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-rename/index.js +4 -0
- package/build-module/components/block-rename/index.js.map +1 -0
- package/build-module/components/block-rename/is-empty-string.js +4 -0
- package/build-module/components/block-rename/is-empty-string.js.map +1 -0
- package/build-module/components/block-rename/modal.js +82 -0
- package/build-module/components/block-rename/modal.js.map +1 -0
- package/build-module/components/block-rename/rename-control.js +66 -0
- package/build-module/components/block-rename/rename-control.js.map +1 -0
- package/build-module/components/block-rename/use-block-rename.js +10 -0
- package/build-module/components/block-rename/use-block-rename.js.map +1 -0
- package/build-module/components/block-settings/container.native.js +4 -2
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +34 -21
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +7 -0
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +1 -1
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/index.native.js +3 -2
- package/build-module/components/block-styles/index.native.js.map +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +88 -25
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js +41 -0
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
- package/build-module/components/block-tools/block-toolbar-popover.js +76 -0
- package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -0
- package/build-module/components/block-tools/index.js +27 -24
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-types-list/index.js +6 -2
- package/build-module/components/block-types-list/index.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js +2 -1
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/block-variation-picker/index.native.js +2 -1
- package/build-module/components/block-variation-picker/index.native.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +29 -18
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +8 -1
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/duotone-control/index.js +1 -4
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/global-styles/advanced-panel.js +1 -1
- package/build-module/components/global-styles/advanced-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +23 -21
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +10 -4
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +20 -31
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/image-link-destinations/index.native.js +109 -0
- package/build-module/components/image-link-destinations/index.native.js.map +1 -0
- package/build-module/components/image-size-control/index.js +0 -5
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/index.native.js +1 -0
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +3 -1
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js +30 -32
- package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -4
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +2 -2
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/utils.js +3 -4
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +2 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build-module/components/inserter/menu.js +14 -7
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +2 -2
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter-button/index.native.js +89 -0
- package/build-module/components/inserter-button/index.native.js.map +1 -0
- package/build-module/components/inserter-button/sparkles.js +15 -0
- package/build-module/components/inserter-button/sparkles.js.map +1 -0
- package/build-module/components/inserter-draggable-blocks/index.js +9 -5
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inserter-listbox/index.js +13 -8
- package/build-module/components/inserter-listbox/index.js.map +1 -1
- package/build-module/components/inserter-listbox/item.js +25 -23
- package/build-module/components/inserter-listbox/item.js.map +1 -1
- package/build-module/components/inserter-listbox/row.js +6 -5
- package/build-module/components/inserter-listbox/row.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +3 -3
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls/fill.native.js +3 -3
- package/build-module/components/inspector-controls/fill.native.js.map +1 -1
- package/build-module/components/list-view/use-list-view-expand-selected-item.js +2 -3
- package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +2 -2
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/preview-options/index.js +6 -60
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/rich-text/content.js +25 -21
- package/build-module/components/rich-text/content.js.map +1 -1
- package/build-module/components/rich-text/get-rich-text-values.js +2 -1
- package/build-module/components/rich-text/get-rich-text-values.js.map +1 -1
- package/build-module/components/rich-text/index.js +4 -32
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +11 -19
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/get-format-colors.native.js +22 -24
- package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +41 -37
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/rich-text/use-input-rules.js +36 -3
- package/build-module/components/rich-text/use-input-rules.js.map +1 -1
- package/build-module/components/rich-text/with-deprecations.js +42 -0
- package/build-module/components/rich-text/with-deprecations.js.map +1 -0
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +73 -9
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +2 -1
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +1 -1
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +4 -1
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +15 -3
- package/build-module/components/use-settings/index.js.map +1 -1
- package/build-module/hooks/align.js +19 -66
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/align.native.js +1 -0
- package/build-module/hooks/align.native.js.map +1 -1
- package/build-module/hooks/anchor.js +11 -26
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/background.js +26 -28
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-hooks.js +22 -30
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-renaming.js +36 -0
- package/build-module/hooks/block-renaming.js.map +1 -1
- package/build-module/hooks/border.js +57 -78
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +74 -86
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +27 -27
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/custom-class-name.js +11 -27
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/custom-fields.js +60 -74
- package/build-module/hooks/custom-fields.js.map +1 -1
- package/build-module/hooks/dimensions.js +21 -16
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +30 -61
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-family.js +14 -23
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +49 -119
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/index.js +18 -15
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +5 -3
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/layout-child.js +60 -0
- package/build-module/hooks/layout-child.js.map +1 -0
- package/build-module/hooks/layout.js +26 -105
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/padding.js +2 -2
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/position.js +38 -59
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/style.js +51 -84
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/typography.js +33 -12
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/utils.js +149 -6
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +4 -3
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/private-apis.js +0 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/private-actions.js +7 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +33 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +8 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +3 -51
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +56 -0
- package/build-module/store/utils.js.map +1 -0
- package/build-module/utils/object.js +21 -60
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/selection.js +9 -1
- package/build-module/utils/selection.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +24 -7
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +6 -6
- package/build-style/content.css +6 -6
- package/build-style/style-rtl.css +123 -298
- package/build-style/style.css +123 -298
- package/package.json +31 -31
- package/src/components/block-canvas/index.js +31 -17
- package/src/components/block-caption/README.md +2 -2
- package/src/components/block-card/index.js +5 -3
- package/src/components/block-card/style.scss +7 -3
- package/src/components/block-controls/hook.js +8 -30
- package/src/components/block-controls/test/index.js +3 -3
- package/src/components/block-edit/context.js +3 -0
- package/src/components/block-edit/index.js +36 -10
- package/src/components/block-info-slot-fill/index.js +6 -3
- package/src/components/block-inspector/style.scss +0 -4
- package/src/components/block-list/block.js +39 -5
- package/src/components/block-list/block.native.js +20 -4
- package/src/components/block-list/use-block-props/index.js +74 -21
- package/src/components/block-list/use-block-props/use-focus-first-element.js +1 -34
- package/src/components/block-list/use-block-props/use-is-hovered.js +2 -13
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +1 -5
- package/src/components/block-parent-selector/index.js +1 -1
- package/src/components/block-pattern-setup/index.js +38 -22
- package/src/components/block-pattern-setup/setup-toolbar.js +2 -0
- package/src/components/block-pattern-setup/style.scss +4 -1
- package/src/components/block-patterns-list/README.md +4 -4
- package/src/components/block-patterns-list/index.js +61 -35
- package/src/components/block-patterns-list/style.scss +7 -0
- package/src/components/block-removal-warning-modal/index.js +7 -14
- package/src/components/block-rename/index.js +3 -0
- package/src/components/block-rename/is-empty-string.js +3 -0
- package/src/components/block-rename/modal.js +121 -0
- package/src/components/block-rename/rename-control.js +80 -0
- package/src/components/block-rename/use-block-rename.js +10 -0
- package/src/components/block-settings/container.native.js +3 -5
- package/src/components/block-settings-menu/block-settings-dropdown.js +38 -34
- package/src/components/block-settings-menu-controls/index.js +9 -0
- package/src/components/block-styles/index.js +1 -1
- package/src/components/block-styles/index.native.js +4 -2
- package/src/components/block-styles/style.scss +0 -11
- package/src/components/block-switcher/test/__snapshots__/index.js.snap +3 -1
- package/src/components/block-toolbar/block-toolbar-menu.native.js +1 -4
- package/src/components/block-toolbar/index.js +180 -95
- package/src/components/block-toolbar/style.scss +50 -66
- package/src/components/block-tools/block-toolbar-breadcrumb.js +46 -0
- package/src/components/block-tools/block-toolbar-popover.js +90 -0
- package/src/components/block-tools/index.js +42 -29
- package/src/components/block-tools/style.scss +60 -172
- package/src/components/block-types-list/index.js +5 -4
- package/src/components/block-types-list/index.native.js +2 -1
- package/src/components/block-variation-picker/index.native.js +1 -1
- package/src/components/button-block-appender/content.scss +2 -2
- package/src/components/colors-gradients/control.js +49 -30
- package/src/components/colors-gradients/style.scss +0 -7
- package/src/components/date-format-picker/index.js +7 -0
- package/src/components/duotone-control/index.js +2 -5
- package/src/components/duotone-control/style.scss +1 -6
- package/src/components/editable-text/README.md +0 -36
- package/src/components/global-styles/advanced-panel.js +1 -1
- package/src/components/global-styles/color-panel.js +34 -25
- package/src/components/global-styles/filters-panel.js +8 -4
- package/src/components/global-styles/typography-panel.js +23 -43
- package/src/components/image-link-destinations/index.native.js +152 -0
- package/src/components/image-link-destinations/style.native.scss +16 -0
- package/src/components/image-size-control/index.js +0 -6
- package/src/components/index.native.js +1 -0
- package/src/components/inner-blocks/README.md +13 -2
- package/src/components/inner-blocks/index.js +6 -2
- package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +57 -33
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +5 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +7 -3
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +6 -1
- package/src/components/inserter/block-patterns-tab/utils.js +6 -4
- package/src/components/inserter/hooks/use-patterns-state.js +3 -1
- package/src/components/inserter/media-tab/media-panel.js +1 -1
- package/src/components/inserter/menu.js +16 -8
- package/src/components/inserter/preview-panel.js +2 -2
- package/src/components/inserter/style.scss +15 -17
- package/src/components/inserter-button/README.md +62 -0
- package/src/components/inserter-button/index.native.js +116 -0
- package/src/components/inserter-button/sparkles.js +15 -0
- package/src/components/inserter-button/style.native.scss +72 -0
- package/src/components/inserter-draggable-blocks/index.js +18 -5
- package/src/components/inserter-listbox/index.js +11 -7
- package/src/components/inserter-listbox/item.js +11 -12
- package/src/components/inserter-listbox/row.js +6 -12
- package/src/components/inspector-controls/fill.js +6 -3
- package/src/components/inspector-controls/fill.native.js +6 -3
- package/src/components/link-control/style.scss +1 -1
- package/src/components/link-control/test/index.js +1 -1
- package/src/components/list-view/use-list-view-expand-selected-item.js +7 -8
- package/src/components/navigable-toolbar/README.md +2 -0
- package/src/components/navigable-toolbar/index.js +2 -2
- package/src/components/plain-text/README.md +0 -28
- package/src/components/preview-options/index.js +6 -84
- package/src/components/rich-text/README.md +0 -58
- package/src/components/rich-text/content.js +27 -20
- package/src/components/rich-text/get-rich-text-values.js +6 -1
- package/src/components/rich-text/index.js +5 -46
- package/src/components/rich-text/index.native.js +9 -26
- package/src/components/rich-text/native/get-format-colors.native.js +33 -40
- package/src/components/rich-text/native/index.native.js +52 -50
- package/src/components/rich-text/use-input-rules.js +36 -3
- package/src/components/rich-text/with-deprecations.js +51 -0
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/src/components/url-input/README.md +1 -74
- package/src/components/use-block-drop-zone/index.js +118 -15
- package/src/components/use-moving-animation/index.js +1 -1
- package/src/components/use-on-block-drop/index.js +2 -1
- package/src/components/use-resize-canvas/README.md +3 -3
- package/src/components/use-resize-canvas/index.js +4 -1
- package/src/components/use-settings/index.js +17 -3
- package/src/components/use-settings/test/index.js +1 -1
- package/src/hooks/align.js +15 -76
- package/src/hooks/align.native.js +1 -0
- package/src/hooks/anchor.js +13 -33
- package/src/hooks/background.js +28 -23
- package/src/hooks/block-hooks.js +22 -51
- package/src/hooks/block-renaming.js +33 -0
- package/src/hooks/border.js +67 -118
- package/src/hooks/color.js +100 -132
- package/src/hooks/content-lock-ui.js +110 -122
- package/src/hooks/custom-class-name.js +8 -40
- package/src/hooks/custom-fields.js +70 -94
- package/src/hooks/dimensions.js +20 -16
- package/src/hooks/duotone.js +70 -127
- package/src/hooks/font-family.js +10 -29
- package/src/hooks/font-size.js +66 -162
- package/src/hooks/index.js +42 -15
- package/src/hooks/index.native.js +6 -3
- package/src/hooks/layout-child.js +53 -0
- package/src/hooks/layout.js +25 -110
- package/src/hooks/padding.js +2 -2
- package/src/hooks/position.js +50 -90
- package/src/hooks/style.js +117 -187
- package/src/hooks/test/__snapshots__/align.native.js.snap +5 -5
- package/src/hooks/test/align.js +1 -178
- package/src/hooks/typography.js +20 -16
- package/src/hooks/utils.js +187 -6
- package/src/layouts/constrained.js +57 -50
- package/src/private-apis.js +0 -2
- package/src/store/private-actions.js +8 -0
- package/src/store/private-selectors.js +45 -0
- package/src/store/reducer.js +8 -0
- package/src/store/selectors.js +5 -67
- package/src/store/utils.js +74 -0
- package/src/style.scss +1 -3
- package/src/utils/object.js +18 -69
- package/src/utils/selection.js +9 -2
- package/src/utils/test/transform-styles.js +49 -0
- package/src/utils/transform-styles/index.js +39 -13
- package/build/components/block-list/use-block-props/use-block-class-names.js +0 -67
- package/build/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js +0 -46
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
- package/build/components/block-list/use-block-props/use-block-default-class-name.js +0 -37
- package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
- package/build/components/block-tools/back-compat.js +0 -45
- package/build/components/block-tools/back-compat.js.map +0 -1
- package/build/components/block-tools/block-contextual-toolbar.js +0 -91
- package/build/components/block-tools/block-contextual-toolbar.js.map +0 -1
- package/build/components/block-tools/selected-block-tools.js +0 -113
- package/build/components/block-tools/selected-block-tools.js.map +0 -1
- package/build/components/inserter/hooks/use-debounced-input.js +0 -22
- package/build/components/inserter/hooks/use-debounced-input.js.map +0 -1
- package/build/components/use-display-block-controls/index.js +0 -39
- package/build/components/use-display-block-controls/index.js.map +0 -1
- package/build/components/use-display-block-controls/index.native.js +0 -39
- package/build/components/use-display-block-controls/index.native.js.map +0 -1
- package/build/hooks/block-rename-ui.js +0 -167
- package/build/hooks/block-rename-ui.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-class-names.js +0 -60
- package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +0 -40
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +0 -31
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
- package/build-module/components/block-tools/back-compat.js +0 -35
- package/build-module/components/block-tools/back-compat.js.map +0 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +0 -83
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +0 -1
- package/build-module/components/block-tools/selected-block-tools.js +0 -105
- package/build-module/components/block-tools/selected-block-tools.js.map +0 -1
- package/build-module/components/inserter/hooks/use-debounced-input.js +0 -15
- package/build-module/components/inserter/hooks/use-debounced-input.js.map +0 -1
- package/build-module/components/use-display-block-controls/index.js +0 -32
- package/build-module/components/use-display-block-controls/index.js.map +0 -1
- package/build-module/components/use-display-block-controls/index.native.js +0 -32
- package/build-module/components/use-display-block-controls/index.native.js.map +0 -1
- package/build-module/hooks/block-rename-ui.js +0 -159
- package/build-module/hooks/block-rename-ui.js.map +0 -1
- package/src/components/block-list/use-block-props/use-block-class-names.js +0 -66
- package/src/components/block-list/use-block-props/use-block-custom-class-name.js +0 -44
- package/src/components/block-list/use-block-props/use-block-default-class-name.js +0 -35
- package/src/components/block-parent-selector/style.scss +0 -11
- package/src/components/block-tools/back-compat.js +0 -35
- package/src/components/block-tools/block-contextual-toolbar.js +0 -100
- package/src/components/block-tools/selected-block-tools.js +0 -127
- package/src/components/inserter/hooks/use-debounced-input.js +0 -18
- package/src/components/preview-options/README.md +0 -94
- package/src/components/preview-options/style.scss +0 -64
- package/src/components/use-display-block-controls/index.js +0 -36
- package/src/components/use-display-block-controls/index.native.js +0 -37
- package/src/hooks/block-rename-ui.js +0 -228
- package/src/hooks/test/color.js +0 -112
- /package/src/{hooks/block-rename-ui.scss → components/block-rename/style.scss} +0 -0
package/src/hooks/font-size.js
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { addFilter } from '@wordpress/hooks';
|
|
5
5
|
import { hasBlockSupport } from '@wordpress/blocks';
|
|
6
6
|
import TokenList from '@wordpress/token-list';
|
|
7
|
-
import { createHigherOrderComponent } from '@wordpress/compose';
|
|
8
7
|
import { select } from '@wordpress/data';
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -59,19 +58,23 @@ function addAttributes( settings ) {
|
|
|
59
58
|
/**
|
|
60
59
|
* Override props assigned to save component to inject font size.
|
|
61
60
|
*
|
|
62
|
-
* @param {Object} props
|
|
63
|
-
* @param {Object}
|
|
64
|
-
* @param {Object} attributes
|
|
61
|
+
* @param {Object} props Additional props applied to save element.
|
|
62
|
+
* @param {Object} blockNameOrType Block type.
|
|
63
|
+
* @param {Object} attributes Block attributes.
|
|
65
64
|
*
|
|
66
65
|
* @return {Object} Filtered props applied to save element.
|
|
67
66
|
*/
|
|
68
|
-
function addSaveProps( props,
|
|
69
|
-
if ( ! hasBlockSupport(
|
|
67
|
+
function addSaveProps( props, blockNameOrType, attributes ) {
|
|
68
|
+
if ( ! hasBlockSupport( blockNameOrType, FONT_SIZE_SUPPORT_KEY ) ) {
|
|
70
69
|
return props;
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
if (
|
|
74
|
-
shouldSkipSerialization(
|
|
73
|
+
shouldSkipSerialization(
|
|
74
|
+
blockNameOrType,
|
|
75
|
+
TYPOGRAPHY_SUPPORT_KEY,
|
|
76
|
+
'fontSize'
|
|
77
|
+
)
|
|
75
78
|
) {
|
|
76
79
|
return props;
|
|
77
80
|
}
|
|
@@ -85,31 +88,6 @@ function addSaveProps( props, blockType, attributes ) {
|
|
|
85
88
|
return props;
|
|
86
89
|
}
|
|
87
90
|
|
|
88
|
-
/**
|
|
89
|
-
* Filters registered block settings to expand the block edit wrapper
|
|
90
|
-
* by applying the desired styles and classnames.
|
|
91
|
-
*
|
|
92
|
-
* @param {Object} settings Original block settings.
|
|
93
|
-
*
|
|
94
|
-
* @return {Object} Filtered block settings.
|
|
95
|
-
*/
|
|
96
|
-
function addEditProps( settings ) {
|
|
97
|
-
if ( ! hasBlockSupport( settings, FONT_SIZE_SUPPORT_KEY ) ) {
|
|
98
|
-
return settings;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const existingGetEditWrapperProps = settings.getEditWrapperProps;
|
|
102
|
-
settings.getEditWrapperProps = ( attributes ) => {
|
|
103
|
-
let props = {};
|
|
104
|
-
if ( existingGetEditWrapperProps ) {
|
|
105
|
-
props = existingGetEditWrapperProps( attributes );
|
|
106
|
-
}
|
|
107
|
-
return addSaveProps( props, settings, attributes );
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
return settings;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
91
|
/**
|
|
114
92
|
* Inspector control panel containing the font size related configuration
|
|
115
93
|
*
|
|
@@ -175,62 +153,69 @@ export function useIsFontSizeDisabled( { name: blockName } = {} ) {
|
|
|
175
153
|
);
|
|
176
154
|
}
|
|
177
155
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
* Ideally, this is not needed and themes load the font-size classes on the
|
|
181
|
-
* editor.
|
|
182
|
-
*
|
|
183
|
-
* @param {Function} BlockListBlock Original component.
|
|
184
|
-
*
|
|
185
|
-
* @return {Function} Wrapped component.
|
|
186
|
-
*/
|
|
187
|
-
const withFontSizeInlineStyles = createHigherOrderComponent(
|
|
188
|
-
( BlockListBlock ) => ( props ) => {
|
|
189
|
-
const [ fontSizes ] = useSettings( 'typography.fontSizes' );
|
|
190
|
-
const {
|
|
191
|
-
name: blockName,
|
|
192
|
-
attributes: { fontSize, style },
|
|
193
|
-
wrapperProps,
|
|
194
|
-
} = props;
|
|
156
|
+
function useBlockProps( { name, fontSize, style } ) {
|
|
157
|
+
const [ fontSizes ] = useSettings( 'typography.fontSizes' );
|
|
195
158
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
! fontSize ||
|
|
208
|
-
style?.typography?.fontSize
|
|
209
|
-
) {
|
|
210
|
-
return <BlockListBlock { ...props } />;
|
|
211
|
-
}
|
|
159
|
+
// Only add inline styles if the block supports font sizes,
|
|
160
|
+
// doesn't skip serialization of font sizes,
|
|
161
|
+
// doesn't already have an inline font size,
|
|
162
|
+
// and does have a class to extract the font size from.
|
|
163
|
+
if (
|
|
164
|
+
! hasBlockSupport( name, FONT_SIZE_SUPPORT_KEY ) ||
|
|
165
|
+
shouldSkipSerialization( name, TYPOGRAPHY_SUPPORT_KEY, 'fontSize' ) ||
|
|
166
|
+
! fontSize
|
|
167
|
+
) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
212
170
|
|
|
213
|
-
|
|
214
|
-
fontSizes,
|
|
215
|
-
fontSize,
|
|
216
|
-
style?.typography?.fontSize
|
|
217
|
-
).size;
|
|
171
|
+
let props = {};
|
|
218
172
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
fontSize
|
|
225
|
-
|
|
226
|
-
|
|
173
|
+
if ( ! style?.typography?.fontSize ) {
|
|
174
|
+
props = {
|
|
175
|
+
style: {
|
|
176
|
+
fontSize: getFontSize(
|
|
177
|
+
fontSizes,
|
|
178
|
+
fontSize,
|
|
179
|
+
style?.typography?.fontSize
|
|
180
|
+
).size,
|
|
227
181
|
},
|
|
228
182
|
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// TODO: This sucks! We should be using useSetting( 'typography.fluid' )
|
|
186
|
+
// or even useSelect( blockEditorStore ). We can't do either here
|
|
187
|
+
// because getEditWrapperProps is a plain JavaScript function called by
|
|
188
|
+
// BlockListBlock and not a React component rendered within
|
|
189
|
+
// BlockListContext.Provider. If we set fontSize using editor.
|
|
190
|
+
// BlockListBlock instead of using getEditWrapperProps then the value is
|
|
191
|
+
// clobbered when the core/style/addEditProps filter runs.
|
|
192
|
+
|
|
193
|
+
// TODO: We can do the thing above now.
|
|
194
|
+
const fluidTypographySettings = getFluidTypographyOptionsFromSettings(
|
|
195
|
+
select( blockEditorStore ).getSettings().__experimentalFeatures
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
if ( fontSize ) {
|
|
199
|
+
props = {
|
|
200
|
+
style: {
|
|
201
|
+
fontSize: getTypographyFontSizeValue(
|
|
202
|
+
{ size: fontSize },
|
|
203
|
+
fluidTypographySettings
|
|
204
|
+
),
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
}
|
|
229
208
|
|
|
230
|
-
|
|
209
|
+
return addSaveProps( props, name, { fontSize } );
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export default {
|
|
213
|
+
useBlockProps,
|
|
214
|
+
attributeKeys: [ 'fontSize', 'style' ],
|
|
215
|
+
hasSupport( name ) {
|
|
216
|
+
return hasBlockSupport( name, FONT_SIZE_SUPPORT_KEY );
|
|
231
217
|
},
|
|
232
|
-
|
|
233
|
-
);
|
|
218
|
+
};
|
|
234
219
|
|
|
235
220
|
const MIGRATION_PATHS = {
|
|
236
221
|
fontSize: [ [ 'fontSize' ], [ 'style', 'typography', 'fontSize' ] ],
|
|
@@ -254,70 +239,6 @@ function addTransforms( result, source, index, results ) {
|
|
|
254
239
|
);
|
|
255
240
|
}
|
|
256
241
|
|
|
257
|
-
/**
|
|
258
|
-
* Allow custom font sizes to appear fluid when fluid typography is enabled at
|
|
259
|
-
* the theme level.
|
|
260
|
-
*
|
|
261
|
-
* Adds a custom getEditWrapperProps() callback to all block types that support
|
|
262
|
-
* font sizes. Then, if fluid typography is enabled, this callback will swap any
|
|
263
|
-
* custom font size in style.fontSize with a fluid font size (i.e. one that uses
|
|
264
|
-
* clamp()).
|
|
265
|
-
*
|
|
266
|
-
* It's important that this hook runs after 'core/style/addEditProps' sets
|
|
267
|
-
* style.fontSize as otherwise fontSize will be overwritten.
|
|
268
|
-
*
|
|
269
|
-
* @param {Object} blockType Block settings object.
|
|
270
|
-
*/
|
|
271
|
-
function addEditPropsForFluidCustomFontSizes( blockType ) {
|
|
272
|
-
if (
|
|
273
|
-
! hasBlockSupport( blockType, FONT_SIZE_SUPPORT_KEY ) ||
|
|
274
|
-
shouldSkipSerialization( blockType, TYPOGRAPHY_SUPPORT_KEY, 'fontSize' )
|
|
275
|
-
) {
|
|
276
|
-
return blockType;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
const existingGetEditWrapperProps = blockType.getEditWrapperProps;
|
|
280
|
-
|
|
281
|
-
blockType.getEditWrapperProps = ( attributes ) => {
|
|
282
|
-
const wrapperProps = existingGetEditWrapperProps
|
|
283
|
-
? existingGetEditWrapperProps( attributes )
|
|
284
|
-
: {};
|
|
285
|
-
|
|
286
|
-
const fontSize = wrapperProps?.style?.fontSize;
|
|
287
|
-
|
|
288
|
-
// TODO: This sucks! We should be using useSetting( 'typography.fluid' )
|
|
289
|
-
// or even useSelect( blockEditorStore ). We can't do either here
|
|
290
|
-
// because getEditWrapperProps is a plain JavaScript function called by
|
|
291
|
-
// BlockListBlock and not a React component rendered within
|
|
292
|
-
// BlockListContext.Provider. If we set fontSize using editor.
|
|
293
|
-
// BlockListBlock instead of using getEditWrapperProps then the value is
|
|
294
|
-
// clobbered when the core/style/addEditProps filter runs.
|
|
295
|
-
const fluidTypographySettings = getFluidTypographyOptionsFromSettings(
|
|
296
|
-
select( blockEditorStore ).getSettings().__experimentalFeatures
|
|
297
|
-
);
|
|
298
|
-
const newFontSize = fontSize
|
|
299
|
-
? getTypographyFontSizeValue(
|
|
300
|
-
{ size: fontSize },
|
|
301
|
-
fluidTypographySettings
|
|
302
|
-
)
|
|
303
|
-
: null;
|
|
304
|
-
|
|
305
|
-
if ( newFontSize === null ) {
|
|
306
|
-
return wrapperProps;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
return {
|
|
310
|
-
...wrapperProps,
|
|
311
|
-
style: {
|
|
312
|
-
...wrapperProps?.style,
|
|
313
|
-
fontSize: newFontSize,
|
|
314
|
-
},
|
|
315
|
-
};
|
|
316
|
-
};
|
|
317
|
-
|
|
318
|
-
return blockType;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
242
|
addFilter(
|
|
322
243
|
'blocks.registerBlockType',
|
|
323
244
|
'core/font/addAttribute',
|
|
@@ -330,25 +251,8 @@ addFilter(
|
|
|
330
251
|
addSaveProps
|
|
331
252
|
);
|
|
332
253
|
|
|
333
|
-
addFilter( 'blocks.registerBlockType', 'core/font/addEditProps', addEditProps );
|
|
334
|
-
|
|
335
|
-
addFilter(
|
|
336
|
-
'editor.BlockListBlock',
|
|
337
|
-
'core/font-size/with-font-size-inline-styles',
|
|
338
|
-
withFontSizeInlineStyles
|
|
339
|
-
);
|
|
340
|
-
|
|
341
254
|
addFilter(
|
|
342
255
|
'blocks.switchToBlockType.transformedBlock',
|
|
343
256
|
'core/font-size/addTransforms',
|
|
344
257
|
addTransforms
|
|
345
258
|
);
|
|
346
|
-
|
|
347
|
-
addFilter(
|
|
348
|
-
'blocks.registerBlockType',
|
|
349
|
-
'core/font-size/addEditPropsForFluidCustomFontSizes',
|
|
350
|
-
addEditPropsForFluidCustomFontSizes,
|
|
351
|
-
// Run after 'core/style/addEditProps' so that the style object has already
|
|
352
|
-
// been translated into inline CSS.
|
|
353
|
-
11
|
|
354
|
-
);
|
package/src/hooks/index.js
CHANGED
|
@@ -1,28 +1,55 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
+
import { createBlockEditFilter, createBlockListBlockFilter } from './utils';
|
|
4
5
|
import './compat';
|
|
5
|
-
import './align';
|
|
6
|
+
import align from './align';
|
|
6
7
|
import './lock';
|
|
7
|
-
import './anchor';
|
|
8
|
+
import anchor from './anchor';
|
|
8
9
|
import './aria-label';
|
|
9
|
-
import './custom-class-name';
|
|
10
|
+
import customClassName from './custom-class-name';
|
|
10
11
|
import './generated-class-name';
|
|
11
|
-
import './style';
|
|
12
|
+
import style from './style';
|
|
12
13
|
import './settings';
|
|
13
|
-
import './color';
|
|
14
|
-
import './duotone';
|
|
15
|
-
import './font-family';
|
|
16
|
-
import './font-size';
|
|
17
|
-
import './border';
|
|
18
|
-
import './position';
|
|
19
|
-
import './layout';
|
|
14
|
+
import color from './color';
|
|
15
|
+
import duotone from './duotone';
|
|
16
|
+
import fontFamily from './font-family';
|
|
17
|
+
import fontSize from './font-size';
|
|
18
|
+
import border from './border';
|
|
19
|
+
import position from './position';
|
|
20
|
+
import layout from './layout';
|
|
21
|
+
import childLayout from './layout-child';
|
|
20
22
|
import './content-lock-ui';
|
|
21
23
|
import './metadata';
|
|
22
|
-
import './custom-fields';
|
|
23
|
-
import './block-hooks';
|
|
24
|
-
import './block-renaming';
|
|
25
|
-
|
|
24
|
+
import customFields from './custom-fields';
|
|
25
|
+
import blockHooks from './block-hooks';
|
|
26
|
+
import blockRenaming from './block-renaming';
|
|
27
|
+
|
|
28
|
+
createBlockEditFilter(
|
|
29
|
+
[
|
|
30
|
+
align,
|
|
31
|
+
anchor,
|
|
32
|
+
customClassName,
|
|
33
|
+
style,
|
|
34
|
+
duotone,
|
|
35
|
+
position,
|
|
36
|
+
layout,
|
|
37
|
+
window.__experimentalConnections ? customFields : null,
|
|
38
|
+
blockHooks,
|
|
39
|
+
blockRenaming,
|
|
40
|
+
].filter( Boolean )
|
|
41
|
+
);
|
|
42
|
+
createBlockListBlockFilter( [
|
|
43
|
+
align,
|
|
44
|
+
style,
|
|
45
|
+
color,
|
|
46
|
+
duotone,
|
|
47
|
+
fontFamily,
|
|
48
|
+
fontSize,
|
|
49
|
+
border,
|
|
50
|
+
position,
|
|
51
|
+
childLayout,
|
|
52
|
+
] );
|
|
26
53
|
|
|
27
54
|
export { useCustomSides } from './dimensions';
|
|
28
55
|
export { useLayoutClasses, useLayoutStyles } from './layout';
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
+
import { createBlockEditFilter } from './utils';
|
|
4
5
|
import './compat';
|
|
5
|
-
import './align';
|
|
6
|
-
import './anchor';
|
|
6
|
+
import align from './align';
|
|
7
|
+
import anchor from './anchor';
|
|
7
8
|
import './custom-class-name';
|
|
8
9
|
import './generated-class-name';
|
|
9
|
-
import './style';
|
|
10
|
+
import style from './style';
|
|
10
11
|
import './color';
|
|
11
12
|
import './font-size';
|
|
12
13
|
import './layout';
|
|
13
14
|
|
|
15
|
+
createBlockEditFilter( [ align, anchor, style ] );
|
|
16
|
+
|
|
14
17
|
export { getBorderClassesAndStyles, useBorderProps } from './use-border-props';
|
|
15
18
|
export { getColorClassesAndStyles, useColorProps } from './use-color-props';
|
|
16
19
|
export { getSpacingClassesAndStyles } from './use-spacing-props';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useInstanceId } from '@wordpress/compose';
|
|
5
|
+
import { useSelect } from '@wordpress/data';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { store as blockEditorStore } from '../store';
|
|
11
|
+
import { useStyleOverride } from './utils';
|
|
12
|
+
|
|
13
|
+
function useBlockPropsChildLayoutStyles( { style } ) {
|
|
14
|
+
const shouldRenderChildLayoutStyles = useSelect( ( select ) => {
|
|
15
|
+
return ! select( blockEditorStore ).getSettings().disableLayoutStyles;
|
|
16
|
+
} );
|
|
17
|
+
const layout = style?.layout ?? {};
|
|
18
|
+
const { selfStretch, flexSize } = layout;
|
|
19
|
+
const id = useInstanceId( useBlockPropsChildLayoutStyles );
|
|
20
|
+
const selector = `.wp-container-content-${ id }`;
|
|
21
|
+
|
|
22
|
+
let css = '';
|
|
23
|
+
if ( shouldRenderChildLayoutStyles ) {
|
|
24
|
+
if ( selfStretch === 'fixed' && flexSize ) {
|
|
25
|
+
css = `${ selector } {
|
|
26
|
+
flex-basis: ${ flexSize };
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
}`;
|
|
29
|
+
} else if ( selfStretch === 'fill' ) {
|
|
30
|
+
css = `${ selector } {
|
|
31
|
+
flex-grow: 1;
|
|
32
|
+
}`;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
useStyleOverride( { css } );
|
|
37
|
+
|
|
38
|
+
// Only attach a container class if there is generated CSS to be attached.
|
|
39
|
+
if ( ! css ) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Attach a `wp-container-content` id-based classname.
|
|
44
|
+
return { className: `wp-container-content-${ id }` };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default {
|
|
48
|
+
useBlockProps: useBlockPropsChildLayoutStyles,
|
|
49
|
+
attributeKeys: [ 'style' ],
|
|
50
|
+
hasSupport() {
|
|
51
|
+
return true;
|
|
52
|
+
},
|
|
53
|
+
};
|
package/src/hooks/layout.js
CHANGED
|
@@ -133,13 +133,11 @@ export function useLayoutStyles( blockAttributes = {}, blockName, selector ) {
|
|
|
133
133
|
return css;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
function
|
|
136
|
+
function LayoutPanelPure( { layout, setAttributes, name: blockName } ) {
|
|
137
137
|
const settings = useBlockSettings( blockName );
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
const { layout } = attributes;
|
|
138
|
+
// Block settings come from theme.json under settings.[blockName].
|
|
139
|
+
const { layout: layoutSettings } = settings;
|
|
140
|
+
// Layout comes from block attributes.
|
|
143
141
|
const [ defaultThemeLayout ] = useSettings( 'layout' );
|
|
144
142
|
const { themeSupportsLayout } = useSelect( ( select ) => {
|
|
145
143
|
const { getSettings } = select( blockEditorStore );
|
|
@@ -153,17 +151,22 @@ function LayoutPanel( { setAttributes, attributes, name: blockName } ) {
|
|
|
153
151
|
return null;
|
|
154
152
|
}
|
|
155
153
|
|
|
154
|
+
// Layout block support comes from the block's block.json.
|
|
156
155
|
const layoutBlockSupport = getBlockSupport(
|
|
157
156
|
blockName,
|
|
158
157
|
layoutBlockSupportKey,
|
|
159
158
|
{}
|
|
160
159
|
);
|
|
160
|
+
const blockSupportAndThemeSettings = {
|
|
161
|
+
...layoutSettings,
|
|
162
|
+
...layoutBlockSupport,
|
|
163
|
+
};
|
|
161
164
|
const {
|
|
162
165
|
allowSwitching,
|
|
163
|
-
allowEditing =
|
|
166
|
+
allowEditing = true,
|
|
164
167
|
allowInheriting = true,
|
|
165
168
|
default: defaultBlockLayout,
|
|
166
|
-
} =
|
|
169
|
+
} = blockSupportAndThemeSettings;
|
|
167
170
|
|
|
168
171
|
if ( ! allowEditing ) {
|
|
169
172
|
return null;
|
|
@@ -260,14 +263,14 @@ function LayoutPanel( { setAttributes, attributes, name: blockName } ) {
|
|
|
260
263
|
<layoutType.inspectorControls
|
|
261
264
|
layout={ usedLayout }
|
|
262
265
|
onChange={ onChangeLayout }
|
|
263
|
-
layoutBlockSupport={
|
|
266
|
+
layoutBlockSupport={ blockSupportAndThemeSettings }
|
|
264
267
|
/>
|
|
265
268
|
) }
|
|
266
269
|
{ constrainedType && displayControlsForLegacyLayouts && (
|
|
267
270
|
<constrainedType.inspectorControls
|
|
268
271
|
layout={ usedLayout }
|
|
269
272
|
onChange={ onChangeLayout }
|
|
270
|
-
layoutBlockSupport={
|
|
273
|
+
layoutBlockSupport={ blockSupportAndThemeSettings }
|
|
271
274
|
/>
|
|
272
275
|
) }
|
|
273
276
|
</PanelBody>
|
|
@@ -283,6 +286,15 @@ function LayoutPanel( { setAttributes, attributes, name: blockName } ) {
|
|
|
283
286
|
);
|
|
284
287
|
}
|
|
285
288
|
|
|
289
|
+
export default {
|
|
290
|
+
shareWithChildBlocks: true,
|
|
291
|
+
edit: LayoutPanelPure,
|
|
292
|
+
attributeKeys: [ 'layout' ],
|
|
293
|
+
hasSupport( name ) {
|
|
294
|
+
return hasLayoutBlockSupport( name );
|
|
295
|
+
},
|
|
296
|
+
};
|
|
297
|
+
|
|
286
298
|
function LayoutTypeSwitcher( { type, onChange } ) {
|
|
287
299
|
return (
|
|
288
300
|
<ButtonGroup>
|
|
@@ -324,25 +336,6 @@ export function addAttribute( settings ) {
|
|
|
324
336
|
return settings;
|
|
325
337
|
}
|
|
326
338
|
|
|
327
|
-
/**
|
|
328
|
-
* Override the default edit UI to include layout controls
|
|
329
|
-
*
|
|
330
|
-
* @param {Function} BlockEdit Original component.
|
|
331
|
-
*
|
|
332
|
-
* @return {Function} Wrapped component.
|
|
333
|
-
*/
|
|
334
|
-
export const withLayoutControls = createHigherOrderComponent(
|
|
335
|
-
( BlockEdit ) => ( props ) => {
|
|
336
|
-
const supportLayout = hasLayoutBlockSupport( props.name );
|
|
337
|
-
|
|
338
|
-
return [
|
|
339
|
-
supportLayout && <LayoutPanel key="layout" { ...props } />,
|
|
340
|
-
<BlockEdit key="edit" { ...props } />,
|
|
341
|
-
];
|
|
342
|
-
},
|
|
343
|
-
'withLayoutControls'
|
|
344
|
-
);
|
|
345
|
-
|
|
346
339
|
function BlockWithLayoutStyles( { block: BlockListBlock, props } ) {
|
|
347
340
|
const { name, attributes } = props;
|
|
348
341
|
const id = useInstanceId( BlockListBlock );
|
|
@@ -355,8 +348,9 @@ function BlockWithLayoutStyles( { block: BlockListBlock, props } ) {
|
|
|
355
348
|
: layout || defaultBlockLayout || {};
|
|
356
349
|
const layoutClasses = useLayoutClasses( attributes, name );
|
|
357
350
|
|
|
351
|
+
const selectorPrefix = `wp-container-${ kebabCase( name ) }-layout-`;
|
|
358
352
|
// Higher specificity to override defaults from theme.json.
|
|
359
|
-
const selector =
|
|
353
|
+
const selector = `.${ selectorPrefix }${ id }.${ selectorPrefix }${ id }`;
|
|
360
354
|
const [ blockGapSupport ] = useSettings( 'spacing.blockGap' );
|
|
361
355
|
const hasBlockGapSupport = blockGapSupport !== null;
|
|
362
356
|
|
|
@@ -374,7 +368,7 @@ function BlockWithLayoutStyles( { block: BlockListBlock, props } ) {
|
|
|
374
368
|
// Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`.
|
|
375
369
|
const layoutClassNames = classnames(
|
|
376
370
|
{
|
|
377
|
-
[
|
|
371
|
+
[ `${ selectorPrefix }${ id }` ]: !! css, // Only attach a container class if there is generated CSS to be attached.
|
|
378
372
|
},
|
|
379
373
|
layoutClasses
|
|
380
374
|
);
|
|
@@ -423,75 +417,6 @@ export const withLayoutStyles = createHigherOrderComponent(
|
|
|
423
417
|
'withLayoutStyles'
|
|
424
418
|
);
|
|
425
419
|
|
|
426
|
-
function BlockWithChildLayoutStyles( { block: BlockListBlock, props } ) {
|
|
427
|
-
const layout = props.attributes.style?.layout ?? {};
|
|
428
|
-
const { selfStretch, flexSize } = layout;
|
|
429
|
-
|
|
430
|
-
const id = useInstanceId( BlockListBlock );
|
|
431
|
-
const selector = `.wp-container-content-${ id }`;
|
|
432
|
-
|
|
433
|
-
let css = '';
|
|
434
|
-
if ( selfStretch === 'fixed' && flexSize ) {
|
|
435
|
-
css = `${ selector } {
|
|
436
|
-
flex-basis: ${ flexSize };
|
|
437
|
-
box-sizing: border-box;
|
|
438
|
-
}`;
|
|
439
|
-
} else if ( selfStretch === 'fill' ) {
|
|
440
|
-
css = `${ selector } {
|
|
441
|
-
flex-grow: 1;
|
|
442
|
-
}`;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
// Attach a `wp-container-content` id-based classname.
|
|
446
|
-
const className = classnames( props.className, {
|
|
447
|
-
[ `wp-container-content-${ id }` ]: !! css, // Only attach a container class if there is generated CSS to be attached.
|
|
448
|
-
} );
|
|
449
|
-
|
|
450
|
-
useStyleOverride( { css } );
|
|
451
|
-
|
|
452
|
-
return <BlockListBlock { ...props } className={ className } />;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
/**
|
|
456
|
-
* Override the default block element to add the child layout styles.
|
|
457
|
-
*
|
|
458
|
-
* @param {Function} BlockListBlock Original component.
|
|
459
|
-
*
|
|
460
|
-
* @return {Function} Wrapped component.
|
|
461
|
-
*/
|
|
462
|
-
export const withChildLayoutStyles = createHigherOrderComponent(
|
|
463
|
-
( BlockListBlock ) => ( props ) => {
|
|
464
|
-
const layout = props.attributes.style?.layout ?? {};
|
|
465
|
-
const { selfStretch, flexSize } = layout;
|
|
466
|
-
const hasChildLayout = selfStretch || flexSize;
|
|
467
|
-
|
|
468
|
-
const shouldRenderChildLayoutStyles = useSelect(
|
|
469
|
-
( select ) => {
|
|
470
|
-
// The callback returns early to avoid block editor subscription.
|
|
471
|
-
if ( ! hasChildLayout ) {
|
|
472
|
-
return false;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
return ! select( blockEditorStore ).getSettings()
|
|
476
|
-
.disableLayoutStyles;
|
|
477
|
-
},
|
|
478
|
-
[ hasChildLayout ]
|
|
479
|
-
);
|
|
480
|
-
|
|
481
|
-
if ( ! shouldRenderChildLayoutStyles ) {
|
|
482
|
-
return <BlockListBlock { ...props } />;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
return (
|
|
486
|
-
<BlockWithChildLayoutStyles
|
|
487
|
-
block={ BlockListBlock }
|
|
488
|
-
props={ props }
|
|
489
|
-
/>
|
|
490
|
-
);
|
|
491
|
-
},
|
|
492
|
-
'withChildLayoutStyles'
|
|
493
|
-
);
|
|
494
|
-
|
|
495
420
|
addFilter(
|
|
496
421
|
'blocks.registerBlockType',
|
|
497
422
|
'core/layout/addAttribute',
|
|
@@ -502,13 +427,3 @@ addFilter(
|
|
|
502
427
|
'core/editor/layout/with-layout-styles',
|
|
503
428
|
withLayoutStyles
|
|
504
429
|
);
|
|
505
|
-
addFilter(
|
|
506
|
-
'editor.BlockListBlock',
|
|
507
|
-
'core/editor/layout/with-child-layout-styles',
|
|
508
|
-
withChildLayoutStyles
|
|
509
|
-
);
|
|
510
|
-
addFilter(
|
|
511
|
-
'editor.BlockEdit',
|
|
512
|
-
'core/editor/layout/with-inspector-controls',
|
|
513
|
-
withLayoutControls
|
|
514
|
-
);
|
package/src/hooks/padding.js
CHANGED
|
@@ -16,11 +16,11 @@ function getComputedCSS( element, property ) {
|
|
|
16
16
|
.getPropertyValue( property );
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export function PaddingVisualizer( { clientId,
|
|
19
|
+
export function PaddingVisualizer( { clientId, value, forceShow } ) {
|
|
20
20
|
const blockElement = useBlockElement( clientId );
|
|
21
21
|
const [ style, setStyle ] = useState();
|
|
22
22
|
|
|
23
|
-
const padding =
|
|
23
|
+
const padding = value?.spacing?.padding;
|
|
24
24
|
|
|
25
25
|
useEffect( () => {
|
|
26
26
|
if (
|