@wordpress/block-editor 9.7.0 → 9.8.1-next.957ca95e4c.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/build/components/block-alignment-control/use-available-alignments.js +1 -1
- package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build/components/block-edit-visually-button/index.js +46 -0
- package/build/components/block-edit-visually-button/index.js.map +1 -0
- package/build/components/block-list/block-list-compact.native.js +73 -0
- package/build/components/block-list/block-list-compact.native.js.map +1 -0
- package/build/components/block-list/use-block-props/use-focus-first-element.js +1 -1
- package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build/components/block-popover/inbetween.js +4 -2
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-popover/index.js +11 -7
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-settings-menu/index.js +2 -6
- package/build/components/block-settings-menu/index.js.map +1 -1
- package/build/components/block-switcher/index.js +10 -16
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +5 -1
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +10 -2
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js +126 -0
- package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -0
- package/build/components/border-radius-control/all-input-control.js +31 -3
- package/build/components/border-radius-control/all-input-control.js.map +1 -1
- package/build/components/border-radius-control/index.js +20 -6
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/border-radius-control/input-controls.js +21 -6
- package/build/components/border-radius-control/input-controls.js.map +1 -1
- package/build/components/border-radius-control/utils.js +13 -16
- package/build/components/border-radius-control/utils.js.map +1 -1
- package/build/components/colors/with-colors.js +17 -4
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/control.js +1 -0
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/copy-handler/index.js +6 -0
- package/build/components/copy-handler/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +2 -7
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/duotone/components.js +5 -5
- package/build/components/duotone/components.js.map +1 -1
- package/build/components/font-family/index.js +1 -1
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +17 -4
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/index.js +9 -0
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/index.native.js +6 -2
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inserter/search-items.js +22 -4
- package/build/components/inserter/search-items.js.map +1 -1
- package/build/components/link-control/link-preview.js +0 -1
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/list-view/block-select-button.js +5 -2
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/use-block-selection.js +1 -7
- package/build/components/list-view/use-block-selection.js.map +1 -1
- package/build/components/rich-text/index.js +10 -0
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/use-enter.js +0 -4
- package/build/components/rich-text/use-enter.js.map +1 -1
- package/build/components/rich-text/use-format-types.js +8 -11
- package/build/components/rich-text/use-format-types.js.map +1 -1
- package/build/components/spacing-sizes-control/all-input-control.js +53 -0
- package/build/components/spacing-sizes-control/all-input-control.js.map +1 -0
- package/build/components/spacing-sizes-control/axial-input-controls.js +69 -0
- package/build/components/spacing-sizes-control/axial-input-controls.js.map +1 -0
- package/build/components/spacing-sizes-control/index.js +100 -0
- package/build/components/spacing-sizes-control/index.js.map +1 -0
- package/build/components/spacing-sizes-control/input-controls.js +52 -0
- package/build/components/spacing-sizes-control/input-controls.js.map +1 -0
- package/build/components/spacing-sizes-control/linked-button.js +38 -0
- package/build/components/spacing-sizes-control/linked-button.js.map +1 -0
- package/build/components/spacing-sizes-control/spacing-input-control.js +213 -0
- package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -0
- package/build/components/spacing-sizes-control/utils.js +233 -0
- package/build/components/spacing-sizes-control/utils.js.map +1 -0
- package/build/components/text-decoration-control/index.js +28 -17
- package/build/components/text-decoration-control/index.js.map +1 -1
- package/build/components/text-transform-control/index.js +21 -14
- package/build/components/text-transform-control/index.js.map +1 -1
- package/build/components/url-input/index.js +1 -1
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/writing-flow/index.js +2 -0
- package/build/components/writing-flow/index.js.map +1 -1
- package/build/components/writing-flow/use-multi-selection.js +4 -2
- package/build/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build/components/writing-flow/use-select-all.js +7 -10
- package/build/components/writing-flow/use-select-all.js.map +1 -1
- package/build/components/writing-flow/use-selection-observer.js +10 -2
- package/build/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build/hooks/align.js +3 -1
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/anchor.js +3 -7
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/border-radius.js +2 -7
- package/build/hooks/border-radius.js.map +1 -1
- package/build/hooks/border.js +2 -2
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +4 -1
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/dimensions.js +15 -0
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +4 -4
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-appearance.js +2 -1
- package/build/hooks/font-appearance.js.map +1 -1
- package/build/hooks/font-family.js +3 -1
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +3 -1
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/gap.js +25 -6
- package/build/hooks/gap.js.map +1 -1
- package/build/hooks/generated-class-name.js +1 -7
- package/build/hooks/generated-class-name.js.map +1 -1
- package/build/hooks/layout.js +23 -13
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/letter-spacing.js +2 -1
- package/build/hooks/letter-spacing.js.map +1 -1
- package/build/hooks/line-height.js +2 -1
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/lock.js +3 -7
- package/build/hooks/lock.js.map +1 -1
- package/build/hooks/margin.js +28 -12
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/padding.js +19 -8
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/style.js +4 -50
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/text-decoration.js +2 -1
- package/build/hooks/text-decoration.js.map +1 -1
- package/build/hooks/text-transform.js +2 -1
- package/build/hooks/text-transform.js.map +1 -1
- package/build/layouts/constrained.js +225 -0
- package/build/layouts/constrained.js.map +1 -0
- package/build/layouts/flex.js +1 -1
- package/build/layouts/flex.js.map +1 -1
- package/build/layouts/flow.js +18 -152
- package/build/layouts/flow.js.map +1 -1
- package/build/layouts/index.js +3 -1
- package/build/layouts/index.js.map +1 -1
- package/build/layouts/utils.js +43 -0
- package/build/layouts/utils.js.map +1 -1
- package/build/store/actions.js +25 -3
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +4 -6
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js +1 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build-module/components/block-edit-visually-button/index.js +35 -0
- package/build-module/components/block-edit-visually-button/index.js.map +1 -0
- package/build-module/components/block-list/block-list-compact.native.js +58 -0
- package/build-module/components/block-list/block-list-compact.native.js.map +1 -0
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +4 -2
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-popover/index.js +9 -7
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-settings-menu/index.js +3 -6
- package/build-module/components/block-settings-menu/index.js.map +1 -1
- package/build-module/components/block-switcher/index.js +10 -16
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +4 -1
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +8 -2
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js +114 -0
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -0
- package/build-module/components/border-radius-control/all-input-control.js +32 -4
- package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +20 -6
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/border-radius-control/input-controls.js +22 -7
- package/build-module/components/border-radius-control/input-controls.js.map +1 -1
- package/build-module/components/border-radius-control/utils.js +13 -16
- package/build-module/components/border-radius-control/utils.js.map +1 -1
- package/build-module/components/colors/with-colors.js +16 -3
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +1 -0
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/copy-handler/index.js +7 -1
- package/build-module/components/copy-handler/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +2 -6
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/duotone/components.js +5 -5
- package/build-module/components/duotone/components.js.map +1 -1
- package/build-module/components/font-family/index.js +1 -1
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +16 -3
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/index.js +1 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.native.js +5 -2
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inserter/search-items.js +19 -5
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +0 -1
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +5 -2
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/use-block-selection.js +1 -6
- package/build-module/components/list-view/use-block-selection.js.map +1 -1
- package/build-module/components/rich-text/index.js +10 -0
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/use-enter.js +0 -4
- package/build-module/components/rich-text/use-enter.js.map +1 -1
- package/build-module/components/rich-text/use-format-types.js +8 -10
- package/build-module/components/rich-text/use-format-types.js.map +1 -1
- package/build-module/components/spacing-sizes-control/all-input-control.js +41 -0
- package/build-module/components/spacing-sizes-control/all-input-control.js.map +1 -0
- package/build-module/components/spacing-sizes-control/axial-input-controls.js +57 -0
- package/build-module/components/spacing-sizes-control/axial-input-controls.js.map +1 -0
- package/build-module/components/spacing-sizes-control/index.js +83 -0
- package/build-module/components/spacing-sizes-control/index.js.map +1 -0
- package/build-module/components/spacing-sizes-control/input-controls.js +41 -0
- package/build-module/components/spacing-sizes-control/input-controls.js.map +1 -0
- package/build-module/components/spacing-sizes-control/linked-button.js +28 -0
- package/build-module/components/spacing-sizes-control/linked-button.js.map +1 -0
- package/build-module/components/spacing-sizes-control/spacing-input-control.js +197 -0
- package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -0
- package/build-module/components/spacing-sizes-control/utils.js +203 -0
- package/build-module/components/spacing-sizes-control/utils.js.map +1 -0
- package/build-module/components/text-decoration-control/index.js +25 -18
- package/build-module/components/text-decoration-control/index.js.map +1 -1
- package/build-module/components/text-transform-control/index.js +19 -15
- package/build-module/components/text-transform-control/index.js.map +1 -1
- package/build-module/components/url-input/index.js +1 -1
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/writing-flow/index.js +2 -0
- package/build-module/components/writing-flow/index.js.map +1 -1
- package/build-module/components/writing-flow/use-multi-selection.js +4 -2
- package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-select-all.js +7 -10
- package/build-module/components/writing-flow/use-select-all.js.map +1 -1
- package/build-module/components/writing-flow/use-selection-observer.js +10 -2
- package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build-module/hooks/align.js +4 -2
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/anchor.js +3 -6
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/border-radius.js +2 -7
- package/build-module/hooks/border-radius.js.map +1 -1
- package/build-module/hooks/border.js +2 -2
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +4 -1
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/dimensions.js +13 -0
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +4 -4
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-appearance.js +2 -1
- package/build-module/hooks/font-appearance.js.map +1 -1
- package/build-module/hooks/font-family.js +3 -1
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +3 -1
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/gap.js +21 -4
- package/build-module/hooks/gap.js.map +1 -1
- package/build-module/hooks/generated-class-name.js +1 -6
- package/build-module/hooks/generated-class-name.js.map +1 -1
- package/build-module/hooks/layout.js +24 -14
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/letter-spacing.js +2 -1
- package/build-module/hooks/letter-spacing.js.map +1 -1
- package/build-module/hooks/line-height.js +2 -1
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/lock.js +3 -6
- package/build-module/hooks/lock.js.map +1 -1
- package/build-module/hooks/margin.js +26 -12
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/padding.js +17 -8
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/style.js +7 -53
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/text-decoration.js +2 -1
- package/build-module/hooks/text-decoration.js.map +1 -1
- package/build-module/hooks/text-transform.js +2 -1
- package/build-module/hooks/text-transform.js.map +1 -1
- package/build-module/layouts/constrained.js +207 -0
- package/build-module/layouts/constrained.js.map +1 -0
- package/build-module/layouts/flex.js +1 -1
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/layouts/flow.js +20 -147
- package/build-module/layouts/flow.js.map +1 -1
- package/build-module/layouts/index.js +2 -1
- package/build-module/layouts/index.js.map +1 -1
- package/build-module/layouts/utils.js +40 -0
- package/build-module/layouts/utils.js.map +1 -1
- package/build-module/store/actions.js +25 -3
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +5 -7
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +157 -61
- package/build-style/style.css +157 -61
- package/package.json +30 -28
- package/src/components/block-alignment-control/use-available-alignments.js +1 -1
- package/src/components/block-edit-visually-button/index.js +39 -0
- package/src/components/block-list/block-list-compact.native.js +62 -0
- package/src/components/block-list/style.scss +29 -6
- package/src/components/block-list/use-block-props/use-focus-first-element.js +1 -1
- package/src/components/block-popover/inbetween.js +4 -1
- package/src/components/block-popover/index.js +22 -15
- package/src/components/block-settings-menu/index.js +11 -15
- package/src/components/block-switcher/index.js +9 -13
- package/src/components/block-switcher/test/index.js +2 -2
- package/src/components/block-toolbar/index.js +2 -0
- package/src/components/block-tools/selected-block-popover.js +7 -0
- package/src/components/block-tools/use-block-toolbar-popover-props.js +123 -0
- package/src/components/border-radius-control/all-input-control.js +41 -4
- package/src/components/border-radius-control/index.js +25 -5
- package/src/components/border-radius-control/input-controls.js +40 -13
- package/src/components/border-radius-control/test/utils.js +22 -60
- package/src/components/border-radius-control/utils.js +12 -16
- package/src/components/button-block-appender/style.scss +23 -0
- package/src/components/colors/with-colors.js +11 -1
- package/src/components/colors-gradients/control.js +1 -0
- package/src/components/copy-handler/index.js +18 -0
- package/src/components/date-format-picker/index.js +12 -14
- package/src/components/date-format-picker/style.scss +0 -4
- package/src/components/duotone/components.js +5 -5
- package/src/components/duotone-control/style.scss +0 -4
- package/src/components/font-appearance-control/style.scss +0 -2
- package/src/components/font-family/index.js +1 -1
- package/src/components/font-sizes/with-font-sizes.js +11 -1
- package/src/components/index.js +1 -0
- package/src/components/inner-blocks/index.native.js +5 -1
- package/src/components/inserter/search-items.js +17 -5
- package/src/components/link-control/link-preview.js +0 -1
- package/src/components/link-control/test/index.js +540 -893
- package/src/components/list-view/block-select-button.js +7 -2
- package/src/components/list-view/style.scss +11 -4
- package/src/components/list-view/use-block-selection.js +2 -8
- package/src/components/media-replace-flow/style.scss +1 -0
- package/src/components/rich-text/index.js +9 -0
- package/src/components/rich-text/use-enter.js +0 -3
- package/src/components/rich-text/use-format-types.js +6 -6
- package/src/components/spacing-sizes-control/all-input-control.js +40 -0
- package/src/components/spacing-sizes-control/axial-input-controls.js +62 -0
- package/src/components/spacing-sizes-control/index.js +91 -0
- package/src/components/spacing-sizes-control/input-controls.js +46 -0
- package/src/components/spacing-sizes-control/linked-button.js +25 -0
- package/src/components/spacing-sizes-control/spacing-input-control.js +285 -0
- package/src/components/spacing-sizes-control/style.scss +122 -0
- package/src/components/spacing-sizes-control/test/utils.js +182 -0
- package/src/components/spacing-sizes-control/utils.js +222 -0
- package/src/components/text-decoration-control/index.js +41 -30
- package/src/components/text-decoration-control/stories/index.js +37 -0
- package/src/components/text-transform-control/index.js +27 -27
- package/src/components/text-transform-control/stories/index.js +37 -0
- package/src/components/url-input/index.js +1 -1
- package/src/components/url-input/style.scss +2 -2
- package/src/components/url-popover/style.scss +0 -3
- package/src/components/writing-flow/index.js +2 -0
- package/src/components/writing-flow/use-multi-selection.js +4 -1
- package/src/components/writing-flow/use-select-all.js +10 -13
- package/src/components/writing-flow/use-selection-observer.js +10 -2
- package/src/hooks/align.js +2 -2
- package/src/hooks/anchor.js +1 -6
- package/src/hooks/border-radius.js +2 -6
- package/src/hooks/border.js +2 -2
- package/src/hooks/color.js +13 -3
- package/src/hooks/dimensions.js +14 -0
- package/src/hooks/duotone.js +4 -4
- package/src/hooks/font-appearance.js +1 -0
- package/src/hooks/font-family.js +2 -0
- package/src/hooks/font-size.js +2 -0
- package/src/hooks/gap.js +42 -19
- package/src/hooks/generated-class-name.js +6 -9
- package/src/hooks/layout.js +47 -16
- package/src/hooks/letter-spacing.js +1 -0
- package/src/hooks/line-height.js +1 -0
- package/src/hooks/lock.js +1 -6
- package/src/hooks/margin.js +49 -17
- package/src/hooks/padding.js +41 -14
- package/src/hooks/style.js +5 -56
- package/src/hooks/test/gap.js +16 -0
- package/src/hooks/text-decoration.js +1 -0
- package/src/hooks/text-transform.js +1 -0
- package/src/hooks/typography.scss +0 -7
- package/src/layouts/constrained.js +220 -0
- package/src/layouts/flex.js +1 -1
- package/src/layouts/flow.js +17 -173
- package/src/layouts/index.js +2 -1
- package/src/layouts/test/constrained.js +21 -0
- package/src/layouts/utils.js +34 -0
- package/src/store/actions.js +32 -4
- package/src/store/selectors.js +5 -4
- package/src/style.scss +1 -2
- package/build/components/block-settings-menu/block-edit-visually-button.js +0 -70
- package/build/components/block-settings-menu/block-edit-visually-button.js.map +0 -1
- package/build-module/components/block-settings-menu/block-edit-visually-button.js +0 -56
- package/build-module/components/block-settings-menu/block-edit-visually-button.js.map +0 -1
- package/src/components/block-settings-menu/block-edit-visually-button.js +0 -52
- package/src/components/text-decoration-control/style.scss +0 -18
- package/src/components/text-transform-control/style.scss +0 -18
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
1
4
|
/**
|
|
2
5
|
* WordPress dependencies
|
|
3
6
|
*/
|
|
4
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
9
|
+
__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,
|
|
10
|
+
} from '@wordpress/components';
|
|
5
11
|
import { __ } from '@wordpress/i18n';
|
|
6
12
|
import {
|
|
7
13
|
formatCapitalize,
|
|
@@ -36,32 +42,26 @@ const TEXT_TRANSFORMS = [
|
|
|
36
42
|
*
|
|
37
43
|
* @return {WPElement} Text transform control.
|
|
38
44
|
*/
|
|
39
|
-
export default function TextTransformControl( { value, onChange } ) {
|
|
45
|
+
export default function TextTransformControl( { value, onChange, ...props } ) {
|
|
40
46
|
return (
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
/>
|
|
62
|
-
);
|
|
63
|
-
} ) }
|
|
64
|
-
</div>
|
|
65
|
-
</fieldset>
|
|
47
|
+
<ToggleGroupControl
|
|
48
|
+
{ ...props }
|
|
49
|
+
className="block-editor-text-transform-control"
|
|
50
|
+
__experimentalIsIconGroup
|
|
51
|
+
label={ __( 'Letter case' ) }
|
|
52
|
+
value={ value }
|
|
53
|
+
onChange={ onChange }
|
|
54
|
+
>
|
|
55
|
+
{ TEXT_TRANSFORMS.map( ( textTransform ) => {
|
|
56
|
+
return (
|
|
57
|
+
<ToggleGroupControlOptionIcon
|
|
58
|
+
key={ textTransform.value }
|
|
59
|
+
value={ textTransform.value }
|
|
60
|
+
icon={ textTransform.icon }
|
|
61
|
+
label={ textTransform.name }
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
} ) }
|
|
65
|
+
</ToggleGroupControl>
|
|
66
66
|
);
|
|
67
67
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useState } from '@wordpress/element';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import TextTransformControl from '../';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'BlockEditor/TextTransformControl',
|
|
13
|
+
component: TextTransformControl,
|
|
14
|
+
argTypes: {
|
|
15
|
+
onChange: { action: 'onChange' },
|
|
16
|
+
size: {
|
|
17
|
+
options: [ 'default', '__unstable-large' ],
|
|
18
|
+
control: { type: 'radio' },
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const Template = ( { onChange, ...args } ) => {
|
|
24
|
+
const [ value, setValue ] = useState();
|
|
25
|
+
return (
|
|
26
|
+
<TextTransformControl
|
|
27
|
+
{ ...args }
|
|
28
|
+
onChange={ ( ...changeArgs ) => {
|
|
29
|
+
onChange( ...changeArgs );
|
|
30
|
+
setValue( ...changeArgs );
|
|
31
|
+
} }
|
|
32
|
+
value={ value }
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Default = Template.bind( {} );
|
|
@@ -462,7 +462,7 @@ class URLInput extends Component {
|
|
|
462
462
|
'aria-label': label ? undefined : __( 'URL' ), // Ensure input always has an accessible label
|
|
463
463
|
'aria-expanded': showSuggestions,
|
|
464
464
|
'aria-autocomplete': 'list',
|
|
465
|
-
'aria-
|
|
465
|
+
'aria-controls': suggestionsListboxId,
|
|
466
466
|
'aria-activedescendant':
|
|
467
467
|
selectedSuggestion !== null
|
|
468
468
|
? `${ suggestionOptionIdPrefix }-${ selectedSuggestion }`
|
|
@@ -51,12 +51,14 @@ export function useWritingFlow() {
|
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
node.classList.add( 'has-multi-selection' );
|
|
54
55
|
node.setAttribute(
|
|
55
56
|
'aria-label',
|
|
56
57
|
__( 'Multiple selected blocks' )
|
|
57
58
|
);
|
|
58
59
|
|
|
59
60
|
return () => {
|
|
61
|
+
node.classList.remove( 'has-multi-selection' );
|
|
60
62
|
node.removeAttribute( 'aria-label' );
|
|
61
63
|
};
|
|
62
64
|
},
|
|
@@ -75,8 +75,11 @@ export default function useMultiSelection() {
|
|
|
75
75
|
// able to select across instances immediately.
|
|
76
76
|
node.contentEditable = true;
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
// For some browsers, like Safari, it is important that focus
|
|
79
|
+
// happens BEFORE selection removal.
|
|
79
80
|
node.focus();
|
|
81
|
+
|
|
82
|
+
defaultView.getSelection().removeAllRanges();
|
|
80
83
|
},
|
|
81
84
|
[
|
|
82
85
|
hasMultiSelection,
|
|
@@ -37,28 +37,25 @@ export default function useSelectAll() {
|
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
|
|
40
42
|
const [ firstSelectedClientId ] = selectedClientIds;
|
|
41
43
|
const rootClientId = getBlockRootClientId( firstSelectedClientId );
|
|
42
|
-
|
|
44
|
+
const blockClientIds = getBlockOrder( rootClientId );
|
|
43
45
|
|
|
44
46
|
// If we have selected all sibling nested blocks, try selecting up a
|
|
45
47
|
// level. See: https://github.com/WordPress/gutenberg/pull/31859/
|
|
46
48
|
if ( selectedClientIds.length === blockClientIds.length ) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const lastClientId = last( blockClientIds );
|
|
54
|
-
|
|
55
|
-
if ( firstClientId === lastClientId ) {
|
|
56
|
-
selectBlock( firstClientId );
|
|
49
|
+
if ( rootClientId ) {
|
|
50
|
+
node.ownerDocument.defaultView
|
|
51
|
+
.getSelection()
|
|
52
|
+
.removeAllRanges();
|
|
53
|
+
selectBlock( rootClientId );
|
|
54
|
+
}
|
|
57
55
|
return;
|
|
58
56
|
}
|
|
59
57
|
|
|
60
|
-
multiSelect(
|
|
61
|
-
event.preventDefault();
|
|
58
|
+
multiSelect( first( blockClientIds ), last( blockClientIds ) );
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
node.addEventListener( 'keydown', onKeyDown );
|
|
@@ -25,7 +25,11 @@ function extractSelectionStartNode( selection ) {
|
|
|
25
25
|
return anchorNode;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
if ( anchorOffset === 0 ) {
|
|
29
|
+
return anchorNode;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return anchorNode.childNodes[ anchorOffset - 1 ];
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
/**
|
|
@@ -44,7 +48,11 @@ function extractSelectionEndNode( selection ) {
|
|
|
44
48
|
return focusNode;
|
|
45
49
|
}
|
|
46
50
|
|
|
47
|
-
|
|
51
|
+
if ( focusOffset === focusNode.childNodes.length ) {
|
|
52
|
+
return focusNode;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return focusNode.childNodes[ focusOffset ];
|
|
48
56
|
}
|
|
49
57
|
|
|
50
58
|
function findDepth( a, b ) {
|
package/src/hooks/align.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import {
|
|
5
|
+
import { without } from 'lodash';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
@@ -87,7 +87,7 @@ export function getValidAlignments(
|
|
|
87
87
|
*/
|
|
88
88
|
export function addAttribute( settings ) {
|
|
89
89
|
// Allow blocks to specify their own attribute definition with default values if needed.
|
|
90
|
-
if (
|
|
90
|
+
if ( 'type' in ( settings.attributes?.align ?? {} ) ) {
|
|
91
91
|
return settings;
|
|
92
92
|
}
|
|
93
93
|
if ( hasBlockSupport( settings, 'align' ) ) {
|
package/src/hooks/anchor.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { has } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -42,7 +37,7 @@ const ANCHOR_SCHEMA = {
|
|
|
42
37
|
*/
|
|
43
38
|
export function addAttribute( settings ) {
|
|
44
39
|
// Allow blocks to specify their own attribute definition with default values if needed.
|
|
45
|
-
if (
|
|
40
|
+
if ( 'type' in ( settings.attributes?.anchor ?? {} ) ) {
|
|
46
41
|
return settings;
|
|
47
42
|
}
|
|
48
43
|
if ( hasBlockSupport( settings, 'anchor' ) ) {
|
|
@@ -19,17 +19,13 @@ export function BorderRadiusEdit( props ) {
|
|
|
19
19
|
} = props;
|
|
20
20
|
|
|
21
21
|
const onChange = ( newRadius ) => {
|
|
22
|
-
|
|
22
|
+
const newStyle = cleanEmptyObject( {
|
|
23
23
|
...style,
|
|
24
24
|
border: {
|
|
25
25
|
...style?.border,
|
|
26
26
|
radius: newRadius,
|
|
27
27
|
},
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
if ( newRadius === undefined || newRadius === '' ) {
|
|
31
|
-
newStyle = cleanEmptyObject( newStyle );
|
|
32
|
-
}
|
|
28
|
+
} );
|
|
33
29
|
|
|
34
30
|
setAttributes( { style: newStyle } );
|
|
35
31
|
};
|
package/src/hooks/border.js
CHANGED
|
@@ -268,10 +268,10 @@ export function BorderPanel( props ) {
|
|
|
268
268
|
<BorderBoxControl
|
|
269
269
|
colors={ colors }
|
|
270
270
|
enableAlpha={ true }
|
|
271
|
+
enableStyle={ isStyleSupported }
|
|
271
272
|
onChange={ onBorderChange }
|
|
272
|
-
popoverPlacement="left-start"
|
|
273
273
|
popoverOffset={ 40 }
|
|
274
|
-
|
|
274
|
+
popoverPlacement="left-start"
|
|
275
275
|
value={ hydratedBorder }
|
|
276
276
|
__experimentalHasMultipleOrigins={ true }
|
|
277
277
|
__experimentalIsRenderedInSidebar={ true }
|
package/src/hooks/color.js
CHANGED
|
@@ -450,14 +450,24 @@ export function ColorEdit( props ) {
|
|
|
450
450
|
};
|
|
451
451
|
};
|
|
452
452
|
|
|
453
|
-
const enableContrastChecking =
|
|
454
|
-
Platform.OS === 'web' && ! gradient && ! style?.color?.gradient;
|
|
455
|
-
|
|
456
453
|
const defaultColorControls = getBlockSupport( props.name, [
|
|
457
454
|
COLOR_SUPPORT_KEY,
|
|
458
455
|
'__experimentalDefaultControls',
|
|
459
456
|
] );
|
|
460
457
|
|
|
458
|
+
const enableContrastChecking =
|
|
459
|
+
Platform.OS === 'web' &&
|
|
460
|
+
! gradient &&
|
|
461
|
+
! style?.color?.gradient &&
|
|
462
|
+
// Contrast checking is enabled by default.
|
|
463
|
+
// Deactivating it requires `enableContrastChecker` to have
|
|
464
|
+
// an explicit value of `false`.
|
|
465
|
+
false !==
|
|
466
|
+
getBlockSupport( props.name, [
|
|
467
|
+
COLOR_SUPPORT_KEY,
|
|
468
|
+
'enableContrastChecker',
|
|
469
|
+
] );
|
|
470
|
+
|
|
461
471
|
return (
|
|
462
472
|
<ColorPanel
|
|
463
473
|
enableContrastChecking={ enableContrastChecking }
|
package/src/hooks/dimensions.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
@@ -33,6 +38,7 @@ import {
|
|
|
33
38
|
resetPadding,
|
|
34
39
|
useIsPaddingDisabled,
|
|
35
40
|
} from './padding';
|
|
41
|
+
import useSetting from '../components/use-setting';
|
|
36
42
|
|
|
37
43
|
export const SPACING_SUPPORT_KEY = 'spacing';
|
|
38
44
|
export const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];
|
|
@@ -51,6 +57,7 @@ export function DimensionsPanel( props ) {
|
|
|
51
57
|
const isMarginDisabled = useIsMarginDisabled( props );
|
|
52
58
|
const isDisabled = useIsDimensionsDisabled( props );
|
|
53
59
|
const isSupported = hasDimensionsSupport( props.name );
|
|
60
|
+
const spacingSizes = useSetting( 'spacing.spacingSizes' );
|
|
54
61
|
|
|
55
62
|
if ( isDisabled || ! isSupported ) {
|
|
56
63
|
return null;
|
|
@@ -72,11 +79,16 @@ export function DimensionsPanel( props ) {
|
|
|
72
79
|
},
|
|
73
80
|
} );
|
|
74
81
|
|
|
82
|
+
const spacingClassnames = classnames( {
|
|
83
|
+
'tools-panel-item-spacing': spacingSizes && spacingSizes.length > 0,
|
|
84
|
+
} );
|
|
85
|
+
|
|
75
86
|
return (
|
|
76
87
|
<>
|
|
77
88
|
<InspectorControls __experimentalGroup="dimensions">
|
|
78
89
|
{ ! isPaddingDisabled && (
|
|
79
90
|
<ToolsPanelItem
|
|
91
|
+
className={ spacingClassnames }
|
|
80
92
|
hasValue={ () => hasPaddingValue( props ) }
|
|
81
93
|
label={ __( 'Padding' ) }
|
|
82
94
|
onDeselect={ () => resetPadding( props ) }
|
|
@@ -89,6 +101,7 @@ export function DimensionsPanel( props ) {
|
|
|
89
101
|
) }
|
|
90
102
|
{ ! isMarginDisabled && (
|
|
91
103
|
<ToolsPanelItem
|
|
104
|
+
className={ spacingClassnames }
|
|
92
105
|
hasValue={ () => hasMarginValue( props ) }
|
|
93
106
|
label={ __( 'Margin' ) }
|
|
94
107
|
onDeselect={ () => resetMargin( props ) }
|
|
@@ -101,6 +114,7 @@ export function DimensionsPanel( props ) {
|
|
|
101
114
|
) }
|
|
102
115
|
{ ! isGapDisabled && (
|
|
103
116
|
<ToolsPanelItem
|
|
117
|
+
className={ spacingClassnames }
|
|
104
118
|
hasValue={ () => hasGapValue( props ) }
|
|
105
119
|
label={ __( 'Block spacing' ) }
|
|
106
120
|
onDeselect={ () => resetGap( props ) }
|
package/src/hooks/duotone.js
CHANGED
|
@@ -35,10 +35,10 @@ extend( [ namesPlugin ] );
|
|
|
35
35
|
/**
|
|
36
36
|
* SVG and stylesheet needed for rendering the duotone filter.
|
|
37
37
|
*
|
|
38
|
-
* @param {Object}
|
|
39
|
-
* @param {string}
|
|
40
|
-
* @param {string}
|
|
41
|
-
* @param {string[]|"unset"} props.colors
|
|
38
|
+
* @param {Object} props Duotone props.
|
|
39
|
+
* @param {string} props.selector Selector to apply the filter to.
|
|
40
|
+
* @param {string} props.id Unique id for this duotone filter.
|
|
41
|
+
* @param {string[]|"unset"} props.colors Array of RGB color strings ordered from dark to light.
|
|
42
42
|
*
|
|
43
43
|
* @return {WPElement} Duotone element.
|
|
44
44
|
*/
|
package/src/hooks/font-family.js
CHANGED
package/src/hooks/font-size.js
CHANGED
package/src/hooks/gap.js
CHANGED
|
@@ -14,6 +14,8 @@ import {
|
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
16
|
import { __unstableUseBlockRef as useBlockRef } from '../components/block-list/use-block-props/use-block-refs';
|
|
17
|
+
import { getSpacingPresetCssVar } from '../components/spacing-sizes-control/utils';
|
|
18
|
+
import SpacingSizesControl from '../components/spacing-sizes-control';
|
|
17
19
|
import useSetting from '../components/use-setting';
|
|
18
20
|
import { AXIAL_SIDES, SPACING_SUPPORT_KEY, useCustomSides } from './dimensions';
|
|
19
21
|
import { cleanEmptyObject } from './utils';
|
|
@@ -73,8 +75,10 @@ export function getGapCSSValue( blockGapValue, defaultValue = '0' ) {
|
|
|
73
75
|
return null;
|
|
74
76
|
}
|
|
75
77
|
|
|
76
|
-
const row =
|
|
77
|
-
|
|
78
|
+
const row =
|
|
79
|
+
getSpacingPresetCssVar( blockGapBoxControlValue?.top ) || defaultValue;
|
|
80
|
+
const column =
|
|
81
|
+
getSpacingPresetCssVar( blockGapBoxControlValue?.left ) || defaultValue;
|
|
78
82
|
|
|
79
83
|
return row === column ? row : `${ row } ${ column }`;
|
|
80
84
|
}
|
|
@@ -127,6 +131,8 @@ export function GapEdit( props ) {
|
|
|
127
131
|
setAttributes,
|
|
128
132
|
} = props;
|
|
129
133
|
|
|
134
|
+
const spacingSizes = useSetting( 'spacing.spacingSizes' );
|
|
135
|
+
|
|
130
136
|
const units = useCustomUnits( {
|
|
131
137
|
availableUnits: useSetting( 'spacing.units' ) || [
|
|
132
138
|
'%',
|
|
@@ -152,6 +158,9 @@ export function GapEdit( props ) {
|
|
|
152
158
|
// If splitOnAxis activated we need to return a BoxControl object to the BoxControl component.
|
|
153
159
|
if ( !! next && splitOnAxis ) {
|
|
154
160
|
blockGap = { ...getGapBoxControlValueFromStyle( next ) };
|
|
161
|
+
} else if ( next?.hasOwnProperty( 'top' ) ) {
|
|
162
|
+
// If splitOnAxis is not enabled, treat the 'top' value as the shorthand gap value.
|
|
163
|
+
blockGap = next.top;
|
|
155
164
|
}
|
|
156
165
|
|
|
157
166
|
const newStyle = {
|
|
@@ -190,32 +199,46 @@ export function GapEdit( props ) {
|
|
|
190
199
|
right: gapValue?.left,
|
|
191
200
|
bottom: gapValue?.top,
|
|
192
201
|
}
|
|
193
|
-
:
|
|
202
|
+
: {
|
|
203
|
+
top: gapValue?.top,
|
|
204
|
+
};
|
|
194
205
|
|
|
195
206
|
return Platform.select( {
|
|
196
207
|
web: (
|
|
197
208
|
<>
|
|
198
|
-
{
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
209
|
+
{ ( ! spacingSizes || spacingSizes?.length === 0 ) &&
|
|
210
|
+
( splitOnAxis ? (
|
|
211
|
+
<BoxControl
|
|
212
|
+
label={ __( 'Block spacing' ) }
|
|
213
|
+
min={ 0 }
|
|
214
|
+
onChange={ onChange }
|
|
215
|
+
units={ units }
|
|
216
|
+
sides={ sides }
|
|
217
|
+
values={ boxControlGapValue }
|
|
218
|
+
allowReset={ false }
|
|
219
|
+
splitOnAxis={ splitOnAxis }
|
|
220
|
+
/>
|
|
221
|
+
) : (
|
|
222
|
+
<UnitControl
|
|
223
|
+
label={ __( 'Block spacing' ) }
|
|
224
|
+
__unstableInputWidth="80px"
|
|
225
|
+
min={ 0 }
|
|
226
|
+
onChange={ onChange }
|
|
227
|
+
units={ units }
|
|
228
|
+
// Default to `row` for combined values.
|
|
229
|
+
value={ boxControlGapValue }
|
|
230
|
+
/>
|
|
231
|
+
) ) }
|
|
232
|
+
{ spacingSizes?.length > 0 && (
|
|
233
|
+
<SpacingSizesControl
|
|
234
|
+
values={ boxControlGapValue }
|
|
202
235
|
onChange={ onChange }
|
|
236
|
+
label={ __( 'Block spacing' ) }
|
|
237
|
+
sides={ splitOnAxis ? sides : [ 'top' ] } // Use 'top' as the shorthand property in non-axial configurations.
|
|
203
238
|
units={ units }
|
|
204
|
-
sides={ sides }
|
|
205
|
-
values={ boxControlGapValue }
|
|
206
239
|
allowReset={ false }
|
|
207
240
|
splitOnAxis={ splitOnAxis }
|
|
208
241
|
/>
|
|
209
|
-
) : (
|
|
210
|
-
<UnitControl
|
|
211
|
-
label={ __( 'Block spacing' ) }
|
|
212
|
-
__unstableInputWidth="80px"
|
|
213
|
-
min={ 0 }
|
|
214
|
-
onChange={ onChange }
|
|
215
|
-
units={ units }
|
|
216
|
-
// Default to `row` for combined values.
|
|
217
|
-
value={ boxControlGapValue }
|
|
218
|
-
/>
|
|
219
242
|
) }
|
|
220
243
|
</>
|
|
221
244
|
),
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { uniq } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -26,10 +21,12 @@ export function addGeneratedClassName( extraProps, blockType ) {
|
|
|
26
21
|
// We have some extra classes and want to add the default classname
|
|
27
22
|
// We use uniq to prevent duplicate classnames.
|
|
28
23
|
|
|
29
|
-
extraProps.className =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
extraProps.className = [
|
|
25
|
+
...new Set( [
|
|
26
|
+
getBlockDefaultClassName( blockType.name ),
|
|
27
|
+
...extraProps.className.split( ' ' ),
|
|
28
|
+
] ),
|
|
29
|
+
]
|
|
33
30
|
.join( ' ' )
|
|
34
31
|
.trim();
|
|
35
32
|
} else {
|