@wordpress/block-editor 14.9.0 → 14.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/LICENSE.md +1 -1
- package/README.md +40 -0
- package/build/components/audio-player/index.native.js +1 -1
- package/build/components/audio-player/index.native.js.map +1 -1
- package/build/components/background-image-control/index.js +4 -0
- package/build/components/background-image-control/index.js.map +1 -1
- package/build/components/block-alignment-matrix-control/index.js +32 -0
- package/build/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build/components/block-card/index.js +45 -8
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-edit/edit.js +147 -10
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-list/index.js +1 -2
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +2 -2
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/zoom-out-separator.js +20 -3
- package/build/components/block-list/zoom-out-separator.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +5 -8
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-styles/utils.js +3 -3
- package/build/components/block-styles/utils.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +19 -6
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/button-block-appender/index.js +1 -5
- package/build/components/button-block-appender/index.js.map +1 -1
- package/build/components/child-layout-control/index.js +6 -0
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +51 -11
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/contrast-checker/index.native.js +1 -1
- package/build/components/contrast-checker/index.native.js.map +1 -1
- package/build/components/date-format-picker/index.js +7 -16
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/font-appearance-control/index.js +9 -0
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/font-family/index.js +10 -1
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/global-styles/color-panel.js +3 -0
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +1 -1
- package/build/components/global-styles/typography-utils.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +2 -2
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/grid/grid-visualizer.js +9 -0
- package/build/components/grid/grid-visualizer.js.map +1 -1
- package/build/components/grid/utils.js +12 -1
- package/build/components/grid/utils.js.map +1 -1
- package/build/components/iframe/index.js +1 -1
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.js +11 -11
- package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/index.js +1 -1
- package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/index.js +1 -1
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -4
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js +2 -2
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build/components/inserter/category-tabs/index.js +1 -2
- package/build/components/inserter/category-tabs/index.js.map +1 -1
- package/build/components/inserter/index.js +6 -15
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +2 -13
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +2 -2
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/line-height-control/index.js +9 -0
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/media-placeholder/index.js +2 -2
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-replace-flow/index.js +26 -26
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/plain-text/index.js +34 -0
- package/build/components/plain-text/index.js.map +1 -1
- package/build/components/provider/index.js +61 -5
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-media-upload-settings.js +28 -0
- package/build/components/provider/use-media-upload-settings.js.map +1 -0
- package/build/components/resolution-tool/index.js +3 -1
- package/build/components/resolution-tool/index.js.map +1 -1
- package/build/components/responsive-block-control/index.js +1 -1
- package/build/components/responsive-block-control/index.js.map +1 -1
- package/build/components/rich-text/event-listeners/delete.js +7 -1
- package/build/components/rich-text/event-listeners/delete.js.map +1 -1
- package/build/components/rich-text/index.js +2 -2
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +2 -1
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/hooks/background.js +2 -0
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-bindings.js +15 -14
- package/build/hooks/block-bindings.js.map +1 -1
- package/build/hooks/border.js +3 -3
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +1 -1
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/dimensions.js +2 -2
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/font-family.js +1 -1
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/gap.js +2 -2
- package/build/hooks/gap.js.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +7 -0
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/style.js +7 -7
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +7 -7
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/typography.js +6 -6
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/use-zoom-out.js +12 -1
- package/build/hooks/use-zoom-out.js.map +1 -1
- package/build/hooks/utils.js +1 -1
- package/build/hooks/utils.js.map +1 -1
- package/build/store/private-actions.js +1 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +11 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +93 -12
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +6 -8
- package/build/store/selectors.js.map +1 -1
- package/build/utils/block-bindings.js +95 -0
- package/build/utils/block-bindings.js.map +1 -1
- package/build-module/components/audio-player/index.native.js +2 -2
- package/build-module/components/audio-player/index.native.js.map +1 -1
- package/build-module/components/background-image-control/index.js +5 -1
- package/build-module/components/background-image-control/index.js.map +1 -1
- package/build-module/components/block-alignment-matrix-control/index.js +32 -0
- package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build-module/components/block-card/index.js +45 -8
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-edit/edit.js +148 -11
- package/build-module/components/block-edit/edit.js.map +1 -1
- package/build-module/components/block-list/index.js +2 -3
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +1 -1
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/zoom-out-separator.js +20 -3
- package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +5 -8
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-styles/utils.js +3 -3
- package/build-module/components/block-styles/utils.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +19 -6
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/button-block-appender/index.js +2 -6
- package/build-module/components/button-block-appender/index.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +7 -1
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +51 -11
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/contrast-checker/index.native.js +2 -2
- package/build-module/components/contrast-checker/index.native.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +7 -16
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +8 -0
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/font-family/index.js +10 -1
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +3 -0
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +1 -1
- package/build-module/components/global-styles/typography-utils.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +2 -2
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/grid/grid-visualizer.js +9 -0
- package/build-module/components/grid/grid-visualizer.js.map +1 -1
- package/build-module/components/grid/utils.js +12 -1
- package/build-module/components/grid/utils.js.map +1 -1
- package/build-module/components/iframe/index.js +1 -1
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js +12 -12
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/index.js +1 -1
- package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/index.js +1 -1
- package/build-module/components/inserter/block-patterns-tab/index.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/patterns-filter.js +2 -2
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build-module/components/inserter/category-tabs/index.js +1 -2
- package/build-module/components/inserter/category-tabs/index.js.map +1 -1
- package/build-module/components/inserter/index.js +6 -15
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +2 -13
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +2 -2
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/line-height-control/index.js +8 -0
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +3 -3
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +28 -28
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/plain-text/index.js +34 -0
- package/build-module/components/plain-text/index.js.map +1 -1
- package/build-module/components/provider/index.js +62 -5
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-media-upload-settings.js +22 -0
- package/build-module/components/provider/use-media-upload-settings.js.map +1 -0
- package/build-module/components/resolution-tool/index.js +3 -1
- package/build-module/components/resolution-tool/index.js.map +1 -1
- package/build-module/components/responsive-block-control/index.js +1 -1
- package/build-module/components/responsive-block-control/index.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/delete.js +7 -1
- package/build-module/components/rich-text/event-listeners/delete.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +2 -1
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/hooks/background.js +2 -0
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-bindings.js +13 -12
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/hooks/border.js +3 -3
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +1 -1
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/dimensions.js +2 -2
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/font-family.js +1 -1
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/gap.js +2 -2
- package/build-module/hooks/gap.js.map +1 -1
- package/build-module/hooks/index.js +0 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +1 -0
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/style.js +7 -7
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +7 -7
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/typography.js +6 -6
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/use-zoom-out.js +12 -2
- package/build-module/hooks/use-zoom-out.js.map +1 -1
- package/build-module/hooks/utils.js +1 -1
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/store/private-actions.js +1 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +11 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +93 -12
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +6 -8
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/block-bindings.js +90 -0
- package/build-module/utils/block-bindings.js.map +1 -1
- package/build-style/style-rtl.css +27 -9
- package/build-style/style.css +27 -9
- package/package.json +33 -33
- package/src/components/audio-player/index.native.js +2 -2
- package/src/components/background-image-control/index.js +4 -0
- package/src/components/background-image-control/style.scss +4 -2
- package/src/components/block-alignment-matrix-control/README.md +29 -6
- package/src/components/block-alignment-matrix-control/index.js +31 -0
- package/src/components/block-alignment-matrix-control/stories/index.story.js +78 -0
- package/src/components/block-card/README.md +7 -0
- package/src/components/block-card/index.js +41 -12
- package/src/components/block-card/stories/index.story.js +79 -0
- package/src/components/block-card/style.scss +9 -1
- package/src/components/block-edit/edit.js +218 -11
- package/src/components/block-list/index.js +2 -7
- package/src/components/block-list/use-block-props/index.js +1 -1
- package/src/components/block-list/zoom-out-separator.js +30 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +17 -20
- package/src/components/block-styles/utils.js +3 -3
- package/src/components/block-title/stories/index.story.js +76 -0
- package/src/components/block-tools/style.scss +1 -0
- package/src/components/block-tools/zoom-out-mode-inserters.js +21 -3
- package/src/components/border-radius-control/README.md +59 -0
- package/src/components/border-radius-control/stories/index.story.js +58 -0
- package/src/components/button-block-appender/index.js +2 -7
- package/src/components/child-layout-control/index.js +14 -0
- package/src/components/colors-gradients/dropdown.js +57 -8
- package/src/components/colors-gradients/style.scss +5 -0
- package/src/components/contrast-checker/index.native.js +2 -2
- package/src/components/contrast-checker/stories/index.story.js +117 -0
- package/src/components/date-format-picker/README.md +6 -13
- package/src/components/date-format-picker/index.js +10 -17
- package/src/components/date-format-picker/stories/index.story.js +69 -0
- package/src/components/date-format-picker/style.scss +3 -1
- package/src/components/default-block-appender/content.scss +1 -0
- package/src/components/dimensions-tool/stories/aspect-ratio-tool.story.js +2 -1
- package/src/components/dimensions-tool/stories/index.story.js +2 -1
- package/src/components/dimensions-tool/stories/scale-tool.story.js +2 -1
- package/src/components/dimensions-tool/stories/width-height-tool.story.js +2 -1
- package/src/components/font-appearance-control/index.js +15 -0
- package/src/components/font-family/README.md +1 -0
- package/src/components/font-family/index.js +17 -1
- package/src/components/font-family/stories/index.story.js +1 -0
- package/src/components/global-styles/color-panel.js +3 -0
- package/src/components/global-styles/test/use-global-styles-output.js +1 -1
- package/src/components/global-styles/typography-utils.js +1 -1
- package/src/components/global-styles/use-global-styles-output.js +2 -2
- package/src/components/grid/grid-visualizer.js +11 -0
- package/src/components/grid/utils.js +19 -1
- package/src/components/iframe/index.js +1 -1
- package/src/components/inner-blocks/use-inner-block-template-sync.js +17 -10
- package/src/components/inserter/block-patterns-explorer/index.js +2 -3
- package/src/components/inserter/block-patterns-tab/index.js +3 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -4
- package/src/components/inserter/block-patterns-tab/patterns-filter.js +2 -2
- package/src/components/inserter/category-tabs/index.js +3 -2
- package/src/components/inserter/index.js +1 -13
- package/src/components/inserter/quick-inserter.js +2 -25
- package/src/components/keyboard-shortcuts/index.js +2 -2
- package/src/components/line-height-control/README.md +1 -0
- package/src/components/line-height-control/index.js +12 -0
- package/src/components/line-height-control/stories/index.story.js +1 -0
- package/src/components/line-height-control/test/index.js +7 -1
- package/src/components/list-view/style.scss +10 -5
- package/src/components/media-placeholder/index.js +3 -3
- package/src/components/media-replace-flow/README.md +7 -0
- package/src/components/media-replace-flow/index.js +28 -36
- package/src/components/media-replace-flow/style.scss +6 -6
- package/src/components/plain-text/README.md +2 -2
- package/src/components/plain-text/index.js +34 -0
- package/src/components/plain-text/stories/index.story.js +75 -0
- package/src/components/provider/index.js +81 -4
- package/src/components/provider/use-media-upload-settings.js +25 -0
- package/src/components/resolution-tool/index.js +2 -0
- package/src/components/resolution-tool/stories/index.story.js +36 -8
- package/src/components/responsive-block-control/index.js +1 -1
- package/src/components/rich-text/event-listeners/delete.js +6 -1
- package/src/components/rich-text/index.js +1 -1
- package/src/components/text-alignment-control/README.md +49 -0
- package/src/components/text-alignment-control/stories/index.story.js +56 -18
- package/src/components/text-decoration-control/README.md +0 -1
- package/src/components/text-decoration-control/stories/index.story.js +51 -16
- package/src/components/text-transform-control/README.md +3 -4
- package/src/components/text-transform-control/stories/index.story.js +53 -16
- package/src/components/use-block-drop-zone/index.js +8 -1
- package/src/components/warning/stories/index.story.js +86 -0
- package/src/hooks/background.js +6 -0
- package/src/hooks/block-bindings.js +17 -18
- package/src/hooks/border.js +9 -3
- package/src/hooks/color.js +1 -1
- package/src/hooks/dimensions.js +2 -2
- package/src/hooks/font-family.js +1 -1
- package/src/hooks/gap.js +2 -2
- package/src/hooks/index.js +0 -1
- package/src/hooks/index.native.js +1 -0
- package/src/hooks/style.js +13 -7
- package/src/hooks/supports.js +7 -7
- package/src/hooks/test/style.js +2 -1
- package/src/hooks/typography.js +6 -6
- package/src/hooks/use-zoom-out.js +10 -2
- package/src/hooks/utils.js +1 -1
- package/src/store/private-actions.js +1 -0
- package/src/store/private-selectors.js +15 -5
- package/src/store/reducer.js +112 -19
- package/src/store/selectors.js +6 -8
- package/src/store/test/private-selectors.js +53 -9
- package/src/store/test/reducer.js +172 -166
- package/src/store/test/selectors.js +23 -0
- package/src/utils/block-bindings.js +95 -0
- package/tsconfig.json +2 -5
- package/build/hooks/use-bindings-attributes.js +0 -262
- package/build/hooks/use-bindings-attributes.js.map +0 -1
- package/build-module/hooks/use-bindings-attributes.js +0 -253
- package/build-module/hooks/use-bindings-attributes.js.map +0 -1
- package/src/hooks/use-bindings-attributes.js +0 -322
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# TextAlignmentControl
|
|
2
|
+
|
|
3
|
+
The `TextAlignmentControl` component is responsible for rendering a control element that allows users to select and apply text alignment options to blocks or elements in the Gutenberg editor. It provides an intuitive interface for aligning text with options such as `left`, `center` and `right`.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Renders the Text Alignment Component with `left`, `center` and `right` alignment options.
|
|
8
|
+
|
|
9
|
+
```jsx
|
|
10
|
+
import { TextAlignmentControl } from '@wordpress/block-editor';
|
|
11
|
+
|
|
12
|
+
const MyTextAlignmentControlComponent = () => (
|
|
13
|
+
<TextAlignmentControl
|
|
14
|
+
value={ textAlign }
|
|
15
|
+
onChange={ ( value ) => {
|
|
16
|
+
setAttributes( { textAlign: value } );
|
|
17
|
+
} }
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Props
|
|
23
|
+
|
|
24
|
+
### `value`
|
|
25
|
+
|
|
26
|
+
- **Type:** `String`
|
|
27
|
+
- **Default:** `undefined`
|
|
28
|
+
- **Options:** `left`, `center`, `right`, `justify`
|
|
29
|
+
|
|
30
|
+
The current value of the text alignment setting. You may only choose from the `Options` listed above.
|
|
31
|
+
|
|
32
|
+
### `onChange`
|
|
33
|
+
|
|
34
|
+
- **Type:** `Function`
|
|
35
|
+
|
|
36
|
+
A callback function invoked when the text alignment value is changed via an interaction with any of the options. The function is called with the new alignment value (`left`, `center`, `right`) as the only argument.
|
|
37
|
+
|
|
38
|
+
### `className`
|
|
39
|
+
|
|
40
|
+
- **Type:** `String`
|
|
41
|
+
|
|
42
|
+
Class name to add to the control for custom styling.
|
|
43
|
+
|
|
44
|
+
### `options`
|
|
45
|
+
|
|
46
|
+
- **Type:** `Array`
|
|
47
|
+
- **Default:** [`left`, `center`, `right`]
|
|
48
|
+
|
|
49
|
+
An array that determines which alignment options will be available in the control. You can pass an array of alignment values to customize the options.
|
|
@@ -8,32 +8,70 @@ import { useState } from '@wordpress/element';
|
|
|
8
8
|
*/
|
|
9
9
|
import TextAlignmentControl from '../';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const meta = {
|
|
12
12
|
title: 'BlockEditor/TextAlignmentControl',
|
|
13
13
|
component: TextAlignmentControl,
|
|
14
|
+
tags: [ 'status-private' ],
|
|
15
|
+
parameters: {
|
|
16
|
+
docs: {
|
|
17
|
+
canvas: { sourceState: 'shown' },
|
|
18
|
+
description: {
|
|
19
|
+
component: 'Control to facilitate text alignment selections.',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
14
23
|
argTypes: {
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
value: {
|
|
25
|
+
control: { type: null },
|
|
26
|
+
description: 'Currently selected text alignment value.',
|
|
27
|
+
table: {
|
|
28
|
+
type: {
|
|
29
|
+
summary: 'string',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
onChange: {
|
|
34
|
+
action: 'onChange',
|
|
35
|
+
control: { type: null },
|
|
36
|
+
description: 'Handles change in text alignment selection.',
|
|
37
|
+
table: {
|
|
38
|
+
type: {
|
|
39
|
+
summary: 'function',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
17
43
|
options: {
|
|
18
44
|
control: 'check',
|
|
45
|
+
description: 'Array of text alignment options to display.',
|
|
19
46
|
options: [ 'left', 'center', 'right', 'justify' ],
|
|
47
|
+
table: {
|
|
48
|
+
type: { summary: 'array' },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
className: {
|
|
52
|
+
control: 'text',
|
|
53
|
+
description: 'Class name to add to the control.',
|
|
54
|
+
table: {
|
|
55
|
+
type: { summary: 'string' },
|
|
56
|
+
},
|
|
20
57
|
},
|
|
21
|
-
value: { control: false },
|
|
22
58
|
},
|
|
23
59
|
};
|
|
24
60
|
|
|
25
|
-
|
|
26
|
-
const [ value, setValue ] = useState();
|
|
27
|
-
return (
|
|
28
|
-
<TextAlignmentControl
|
|
29
|
-
{ ...args }
|
|
30
|
-
onChange={ ( ...changeArgs ) => {
|
|
31
|
-
onChange( ...changeArgs );
|
|
32
|
-
setValue( ...changeArgs );
|
|
33
|
-
} }
|
|
34
|
-
value={ value }
|
|
35
|
-
/>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
61
|
+
export default meta;
|
|
38
62
|
|
|
39
|
-
export const Default =
|
|
63
|
+
export const Default = {
|
|
64
|
+
render: function Template( { onChange, ...args } ) {
|
|
65
|
+
const [ value, setValue ] = useState();
|
|
66
|
+
return (
|
|
67
|
+
<TextAlignmentControl
|
|
68
|
+
{ ...args }
|
|
69
|
+
onChange={ ( ...changeArgs ) => {
|
|
70
|
+
onChange( ...changeArgs );
|
|
71
|
+
setValue( ...changeArgs );
|
|
72
|
+
} }
|
|
73
|
+
value={ value }
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
};
|
|
@@ -28,7 +28,6 @@ Then, you can use the component in your block editor UI:
|
|
|
28
28
|
### `value`
|
|
29
29
|
|
|
30
30
|
- **Type:** `String`
|
|
31
|
-
- **Default:** `none`
|
|
32
31
|
- **Options:** `none`, `underline`, `line-through`
|
|
33
32
|
|
|
34
33
|
The current value of the Text Decoration setting. You may only choose from the `Options` listed above.
|
|
@@ -8,26 +8,61 @@ import { useState } from '@wordpress/element';
|
|
|
8
8
|
*/
|
|
9
9
|
import TextDecorationControl from '../';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const meta = {
|
|
12
12
|
title: 'BlockEditor/TextDecorationControl',
|
|
13
13
|
component: TextDecorationControl,
|
|
14
|
+
parameters: {
|
|
15
|
+
docs: {
|
|
16
|
+
canvas: { sourceState: 'shown' },
|
|
17
|
+
description: {
|
|
18
|
+
component: 'Control to facilitate text decoration selections.',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
14
22
|
argTypes: {
|
|
15
|
-
|
|
23
|
+
value: {
|
|
24
|
+
control: { type: null },
|
|
25
|
+
description: 'Currently selected text decoration.',
|
|
26
|
+
table: {
|
|
27
|
+
type: {
|
|
28
|
+
summary: 'string',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
onChange: {
|
|
33
|
+
action: 'onChange',
|
|
34
|
+
control: { type: null },
|
|
35
|
+
description: 'Handles change in text decoration selection.',
|
|
36
|
+
table: {
|
|
37
|
+
type: {
|
|
38
|
+
summary: 'function',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
className: {
|
|
43
|
+
control: 'text',
|
|
44
|
+
description: 'Additional class name to apply.',
|
|
45
|
+
table: {
|
|
46
|
+
type: { summary: 'string' },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
16
49
|
},
|
|
17
50
|
};
|
|
18
51
|
|
|
19
|
-
|
|
20
|
-
const [ value, setValue ] = useState();
|
|
21
|
-
return (
|
|
22
|
-
<TextDecorationControl
|
|
23
|
-
{ ...args }
|
|
24
|
-
onChange={ ( ...changeArgs ) => {
|
|
25
|
-
onChange( ...changeArgs );
|
|
26
|
-
setValue( ...changeArgs );
|
|
27
|
-
} }
|
|
28
|
-
value={ value }
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
52
|
+
export default meta;
|
|
32
53
|
|
|
33
|
-
export const Default =
|
|
54
|
+
export const Default = {
|
|
55
|
+
render: function Template( { onChange, ...args } ) {
|
|
56
|
+
const [ value, setValue ] = useState();
|
|
57
|
+
return (
|
|
58
|
+
<TextDecorationControl
|
|
59
|
+
{ ...args }
|
|
60
|
+
onChange={ ( ...changeArgs ) => {
|
|
61
|
+
onChange( ...changeArgs );
|
|
62
|
+
setValue( ...changeArgs );
|
|
63
|
+
} }
|
|
64
|
+
value={ value }
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
},
|
|
68
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# TextTransformControl
|
|
2
2
|
|
|
3
3
|
The `TextTransformControl` component is responsible for rendering a control element that allows users to select and apply text transformation options to blocks or elements in the Gutenberg editor. It provides an intuitive interface for changing the text appearance by applying different transformations such as `none`, `uppercase`, `lowercase`, `capitalize`.
|
|
4
|
-
|
|
5
|
-

|
|
6
6
|
|
|
7
7
|
## Development guidelines
|
|
8
8
|
|
|
@@ -28,7 +28,6 @@ const MyTextTransformControlComponent = () => (
|
|
|
28
28
|
### `value`
|
|
29
29
|
|
|
30
30
|
- **Type:** `String`
|
|
31
|
-
- **Default:** `none`
|
|
32
31
|
- **Options:** `none`, `uppercase`, `lowercase`, `capitalize`
|
|
33
32
|
|
|
34
33
|
The current value of the Text Transform setting. You may only choose from the `Options` listed above.
|
|
@@ -37,4 +36,4 @@ The current value of the Text Transform setting. You may only choose from the `O
|
|
|
37
36
|
|
|
38
37
|
- **Type:** `Function`
|
|
39
38
|
|
|
40
|
-
A callback function invoked when the Text Transform value is changed via an interaction with any of the buttons. Called with the Text Transform value (`none`, `uppercase`, `lowercase`, `capitalize`) as the only argument.
|
|
39
|
+
A callback function invoked when the Text Transform value is changed via an interaction with any of the buttons. Called with the Text Transform value (`none`, `uppercase`, `lowercase`, `capitalize`) as the only argument.
|
|
@@ -8,26 +8,63 @@ import { useState } from '@wordpress/element';
|
|
|
8
8
|
*/
|
|
9
9
|
import TextTransformControl from '../';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const meta = {
|
|
12
12
|
title: 'BlockEditor/TextTransformControl',
|
|
13
13
|
component: TextTransformControl,
|
|
14
|
+
parameters: {
|
|
15
|
+
docs: {
|
|
16
|
+
canvas: { sourceState: 'shown' },
|
|
17
|
+
description: {
|
|
18
|
+
component:
|
|
19
|
+
'Control to facilitate text transformation selections.',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
14
23
|
argTypes: {
|
|
15
|
-
onChange: {
|
|
24
|
+
onChange: {
|
|
25
|
+
action: 'onChange',
|
|
26
|
+
control: {
|
|
27
|
+
type: null,
|
|
28
|
+
},
|
|
29
|
+
description: 'Handles change in text transform selection.',
|
|
30
|
+
table: {
|
|
31
|
+
type: {
|
|
32
|
+
summary: 'function',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
className: {
|
|
37
|
+
control: { type: 'text' },
|
|
38
|
+
description: 'Class name to add to the control.',
|
|
39
|
+
table: {
|
|
40
|
+
type: { summary: 'string' },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
value: {
|
|
44
|
+
control: { type: null },
|
|
45
|
+
description: 'Currently selected text transform.',
|
|
46
|
+
table: {
|
|
47
|
+
type: { summary: 'string' },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
16
50
|
},
|
|
17
51
|
};
|
|
18
52
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
onChange={ ( ...changeArgs ) => {
|
|
25
|
-
onChange( ...changeArgs );
|
|
26
|
-
setValue( ...changeArgs );
|
|
27
|
-
} }
|
|
28
|
-
value={ value }
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
53
|
+
export default meta;
|
|
54
|
+
|
|
55
|
+
export const Default = {
|
|
56
|
+
render: function Template( { onChange, ...args } ) {
|
|
57
|
+
const [ value, setValue ] = useState();
|
|
32
58
|
|
|
33
|
-
|
|
59
|
+
return (
|
|
60
|
+
<TextTransformControl
|
|
61
|
+
{ ...args }
|
|
62
|
+
onChange={ ( ...changeArgs ) => {
|
|
63
|
+
onChange( ...changeArgs );
|
|
64
|
+
setValue( ...changeArgs );
|
|
65
|
+
} }
|
|
66
|
+
value={ value }
|
|
67
|
+
/>
|
|
68
|
+
);
|
|
69
|
+
},
|
|
70
|
+
};
|
|
@@ -456,7 +456,14 @@ export default function useBlockDropZone( {
|
|
|
456
456
|
const [ targetIndex, operation, nearestSide ] =
|
|
457
457
|
dropTargetPosition;
|
|
458
458
|
|
|
459
|
-
|
|
459
|
+
const isTargetIndexEmptyDefaultBlock =
|
|
460
|
+
blocksData[ targetIndex ]?.isUnmodifiedDefaultBlock;
|
|
461
|
+
|
|
462
|
+
if (
|
|
463
|
+
isZoomOut() &&
|
|
464
|
+
! isTargetIndexEmptyDefaultBlock &&
|
|
465
|
+
operation !== 'insert'
|
|
466
|
+
) {
|
|
460
467
|
return;
|
|
461
468
|
}
|
|
462
469
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { Button } from '@wordpress/components';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import Warning from '../';
|
|
11
|
+
|
|
12
|
+
const meta = {
|
|
13
|
+
title: 'BlockEditor/Warning',
|
|
14
|
+
component: Warning,
|
|
15
|
+
parameters: {
|
|
16
|
+
docs: {
|
|
17
|
+
canvas: { sourceState: 'shown' },
|
|
18
|
+
description: {
|
|
19
|
+
component:
|
|
20
|
+
'Displays a warning message with optional action buttons and secondary actions dropdown.',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
argTypes: {
|
|
25
|
+
children: {
|
|
26
|
+
control: 'text',
|
|
27
|
+
description:
|
|
28
|
+
'Intended to represent the block to which the warning pertains.',
|
|
29
|
+
table: {
|
|
30
|
+
type: { summary: 'string|element' },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
className: {
|
|
34
|
+
control: 'text',
|
|
35
|
+
description: 'Classes to pass to element.',
|
|
36
|
+
table: {
|
|
37
|
+
type: { summary: 'string' },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
actions: {
|
|
41
|
+
control: 'object',
|
|
42
|
+
description:
|
|
43
|
+
'An array of elements to be rendered as action buttons in the warning element.',
|
|
44
|
+
table: {
|
|
45
|
+
type: { summary: 'Element[]' },
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
secondaryActions: {
|
|
49
|
+
control: 'object',
|
|
50
|
+
description:
|
|
51
|
+
'An array of { title, onClick } to be rendered as options in a dropdown of secondary actions.',
|
|
52
|
+
table: {
|
|
53
|
+
type: { summary: '{ title: string, onClick: Function }[]' },
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export default meta;
|
|
60
|
+
|
|
61
|
+
export const Default = {
|
|
62
|
+
args: {
|
|
63
|
+
children: __( 'This block ran into an issue.' ),
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const WithActions = {
|
|
68
|
+
args: {
|
|
69
|
+
...Default.args,
|
|
70
|
+
actions: [
|
|
71
|
+
<Button key="fix-issue" __next40pxDefaultSize variant="primary">
|
|
72
|
+
{ __( 'Fix issue' ) }
|
|
73
|
+
</Button>,
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const WithSecondaryActions = {
|
|
79
|
+
args: {
|
|
80
|
+
...Default.args,
|
|
81
|
+
secondaryActions: [
|
|
82
|
+
{ title: __( 'Get help' ) },
|
|
83
|
+
{ title: __( 'Remove block' ) },
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
};
|
package/src/hooks/background.js
CHANGED
|
@@ -177,6 +177,11 @@ export function BackgroundImagePanel( {
|
|
|
177
177
|
},
|
|
178
178
|
};
|
|
179
179
|
|
|
180
|
+
const defaultControls = getBlockSupport( name, [
|
|
181
|
+
BACKGROUND_SUPPORT_KEY,
|
|
182
|
+
'defaultControls',
|
|
183
|
+
] );
|
|
184
|
+
|
|
180
185
|
return (
|
|
181
186
|
<StylesBackgroundPanel
|
|
182
187
|
inheritedValue={ inheritedValue }
|
|
@@ -185,6 +190,7 @@ export function BackgroundImagePanel( {
|
|
|
185
190
|
defaultValues={ BACKGROUND_BLOCK_DEFAULT_VALUES }
|
|
186
191
|
settings={ updatedSettings }
|
|
187
192
|
onChange={ onChange }
|
|
193
|
+
defaultControls={ defaultControls }
|
|
188
194
|
value={ style }
|
|
189
195
|
/>
|
|
190
196
|
);
|
|
@@ -26,12 +26,12 @@ import { useViewportMatch } from '@wordpress/compose';
|
|
|
26
26
|
import {
|
|
27
27
|
canBindAttribute,
|
|
28
28
|
getBindableAttributes,
|
|
29
|
-
|
|
29
|
+
useBlockBindingsUtils,
|
|
30
|
+
} from '../utils/block-bindings';
|
|
30
31
|
import { unlock } from '../lock-unlock';
|
|
31
32
|
import InspectorControls from '../components/inspector-controls';
|
|
32
33
|
import BlockContext from '../components/block-context';
|
|
33
34
|
import { useBlockEditContext } from '../components/block-edit';
|
|
34
|
-
import { useBlockBindingsUtils } from '../utils/block-bindings';
|
|
35
35
|
import { store as blockEditorStore } from '../store';
|
|
36
36
|
|
|
37
37
|
const { Menu } = unlock( componentsPrivateApis );
|
|
@@ -51,7 +51,7 @@ const useToolsPanelDropdownMenuProps = () => {
|
|
|
51
51
|
: {};
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
function
|
|
54
|
+
function BlockBindingsPanelMenuContent( { fieldsList, attribute, binding } ) {
|
|
55
55
|
const { clientId } = useBlockEditContext();
|
|
56
56
|
const registeredSources = getBlockBindingsSources();
|
|
57
57
|
const { updateBlockBindings } = useBlockBindingsUtils();
|
|
@@ -179,22 +179,21 @@ function EditableBlockBindingsPanelItems( {
|
|
|
179
179
|
placement={
|
|
180
180
|
isMobile ? 'bottom-start' : 'left-start'
|
|
181
181
|
}
|
|
182
|
-
gutter={ isMobile ? 8 : 36 }
|
|
183
|
-
trigger={
|
|
184
|
-
<Item>
|
|
185
|
-
<BlockBindingsAttribute
|
|
186
|
-
attribute={ attribute }
|
|
187
|
-
binding={ binding }
|
|
188
|
-
fieldsList={ fieldsList }
|
|
189
|
-
/>
|
|
190
|
-
</Item>
|
|
191
|
-
}
|
|
192
182
|
>
|
|
193
|
-
<
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
183
|
+
<Menu.TriggerButton render={ <Item /> }>
|
|
184
|
+
<BlockBindingsAttribute
|
|
185
|
+
attribute={ attribute }
|
|
186
|
+
binding={ binding }
|
|
187
|
+
fieldsList={ fieldsList }
|
|
188
|
+
/>
|
|
189
|
+
</Menu.TriggerButton>
|
|
190
|
+
<Menu.Popover gutter={ isMobile ? 8 : 36 }>
|
|
191
|
+
<BlockBindingsPanelMenuContent
|
|
192
|
+
fieldsList={ fieldsList }
|
|
193
|
+
attribute={ attribute }
|
|
194
|
+
binding={ binding }
|
|
195
|
+
/>
|
|
196
|
+
</Menu.Popover>
|
|
198
197
|
</Menu>
|
|
199
198
|
</ToolsPanelItem>
|
|
200
199
|
);
|
package/src/hooks/border.js
CHANGED
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
import { store as blockEditorStore } from '../store';
|
|
32
32
|
import { __ } from '@wordpress/i18n';
|
|
33
33
|
|
|
34
|
-
export const BORDER_SUPPORT_KEY = '
|
|
34
|
+
export const BORDER_SUPPORT_KEY = '__experimentalBorder';
|
|
35
35
|
export const SHADOW_SUPPORT_KEY = 'shadow';
|
|
36
36
|
|
|
37
37
|
const getColorByProperty = ( colors, property, value ) => {
|
|
@@ -161,8 +161,14 @@ export function BorderPanel( { clientId, name, setAttributes, settings } ) {
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
const defaultControls = {
|
|
164
|
-
...getBlockSupport( name, [
|
|
165
|
-
|
|
164
|
+
...getBlockSupport( name, [
|
|
165
|
+
BORDER_SUPPORT_KEY,
|
|
166
|
+
'__experimentalDefaultControls',
|
|
167
|
+
] ),
|
|
168
|
+
...getBlockSupport( name, [
|
|
169
|
+
SHADOW_SUPPORT_KEY,
|
|
170
|
+
'__experimentalDefaultControls',
|
|
171
|
+
] ),
|
|
166
172
|
};
|
|
167
173
|
|
|
168
174
|
return (
|
package/src/hooks/color.js
CHANGED
|
@@ -290,7 +290,7 @@ export function ColorEdit( { clientId, name, setAttributes, settings } ) {
|
|
|
290
290
|
|
|
291
291
|
const defaultControls = getBlockSupport( name, [
|
|
292
292
|
COLOR_SUPPORT_KEY,
|
|
293
|
-
'
|
|
293
|
+
'__experimentalDefaultControls',
|
|
294
294
|
] );
|
|
295
295
|
|
|
296
296
|
const enableContrastChecking =
|
package/src/hooks/dimensions.js
CHANGED
|
@@ -88,11 +88,11 @@ export function DimensionsPanel( { clientId, name, setAttributes, settings } ) {
|
|
|
88
88
|
|
|
89
89
|
const defaultDimensionsControls = getBlockSupport( name, [
|
|
90
90
|
DIMENSIONS_SUPPORT_KEY,
|
|
91
|
-
'
|
|
91
|
+
'__experimentalDefaultControls',
|
|
92
92
|
] );
|
|
93
93
|
const defaultSpacingControls = getBlockSupport( name, [
|
|
94
94
|
SPACING_SUPPORT_KEY,
|
|
95
|
-
'
|
|
95
|
+
'__experimentalDefaultControls',
|
|
96
96
|
] );
|
|
97
97
|
const defaultControls = {
|
|
98
98
|
...defaultDimensionsControls,
|
package/src/hooks/font-family.js
CHANGED
|
@@ -13,7 +13,7 @@ import { shouldSkipSerialization } from './utils';
|
|
|
13
13
|
import { TYPOGRAPHY_SUPPORT_KEY } from './typography';
|
|
14
14
|
import { unlock } from '../lock-unlock';
|
|
15
15
|
|
|
16
|
-
export const FONT_FAMILY_SUPPORT_KEY = 'typography.
|
|
16
|
+
export const FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';
|
|
17
17
|
const { kebabCase } = unlock( componentsPrivateApis );
|
|
18
18
|
|
|
19
19
|
/**
|
package/src/hooks/gap.js
CHANGED
|
@@ -8,7 +8,7 @@ import { getSpacingPresetCssVar } from '../components/spacing-sizes-control/util
|
|
|
8
8
|
* The string check is for backwards compatibility before Gutenberg supported
|
|
9
9
|
* split gap values (row and column) and the value was a string n + unit.
|
|
10
10
|
*
|
|
11
|
-
* @param {string
|
|
11
|
+
* @param {?string | ?Object} blockGapValue A block gap string or axial object value, e.g., '10px' or { top: '10px', left: '10px'}.
|
|
12
12
|
* @return {Object|null} A value to pass to the BoxControl component.
|
|
13
13
|
*/
|
|
14
14
|
export function getGapBoxControlValueFromStyle( blockGapValue ) {
|
|
@@ -26,7 +26,7 @@ export function getGapBoxControlValueFromStyle( blockGapValue ) {
|
|
|
26
26
|
/**
|
|
27
27
|
* Returns a CSS value for the `gap` property from a given blockGap style.
|
|
28
28
|
*
|
|
29
|
-
* @param {string
|
|
29
|
+
* @param {?string | ?Object} blockGapValue A block gap string or axial object value, e.g., '10px' or { top: '10px', left: '10px'}.
|
|
30
30
|
* @param {?string} defaultValue A default gap value.
|
|
31
31
|
* @return {string|null} The concatenated gap value (row and column).
|
|
32
32
|
*/
|
package/src/hooks/index.js
CHANGED
|
@@ -33,3 +33,4 @@ export { getColorClassesAndStyles, useColorProps } from './use-color-props';
|
|
|
33
33
|
export { getSpacingClassesAndStyles } from './use-spacing-props';
|
|
34
34
|
export { useCachedTruthy } from './use-cached-truthy';
|
|
35
35
|
export { useEditorWrapperStyles } from './use-editor-wrapper-styles';
|
|
36
|
+
export { getTypographyClassesAndStyles } from './use-typography-props';
|
package/src/hooks/style.js
CHANGED
|
@@ -98,16 +98,22 @@ function addAttribute( settings ) {
|
|
|
98
98
|
* @type {Record<string, string[]>}
|
|
99
99
|
*/
|
|
100
100
|
const skipSerializationPathsEdit = {
|
|
101
|
-
[ `${ BORDER_SUPPORT_KEY }.
|
|
102
|
-
[ `${ COLOR_SUPPORT_KEY }.
|
|
103
|
-
|
|
101
|
+
[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],
|
|
102
|
+
[ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
|
|
103
|
+
COLOR_SUPPORT_KEY,
|
|
104
|
+
],
|
|
105
|
+
[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
|
|
104
106
|
TYPOGRAPHY_SUPPORT_KEY,
|
|
105
107
|
],
|
|
106
|
-
[ `${ DIMENSIONS_SUPPORT_KEY }.
|
|
108
|
+
[ `${ DIMENSIONS_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
|
|
107
109
|
DIMENSIONS_SUPPORT_KEY,
|
|
108
110
|
],
|
|
109
|
-
[ `${ SPACING_SUPPORT_KEY }.
|
|
110
|
-
|
|
111
|
+
[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
|
|
112
|
+
SPACING_SUPPORT_KEY,
|
|
113
|
+
],
|
|
114
|
+
[ `${ SHADOW_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
|
|
115
|
+
SHADOW_SUPPORT_KEY,
|
|
116
|
+
],
|
|
111
117
|
};
|
|
112
118
|
|
|
113
119
|
/**
|
|
@@ -245,7 +251,7 @@ export function omitStyle( style, paths, preserveReference = false ) {
|
|
|
245
251
|
|
|
246
252
|
let newStyle = style;
|
|
247
253
|
if ( ! preserveReference ) {
|
|
248
|
-
newStyle =
|
|
254
|
+
newStyle = JSON.parse( JSON.stringify( style ) );
|
|
249
255
|
}
|
|
250
256
|
|
|
251
257
|
if ( ! Array.isArray( paths ) ) {
|