@wordpress/block-editor 9.7.1-next.d6164808d3.0 → 10.0.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 +8 -0
- package/README.md +13 -1
- package/build/components/alignment-control/ui.js +6 -5
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/block-actions/index.js +5 -9
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-alignment-control/ui.js +5 -5
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-content-overlay/index.js +2 -4
- package/build/components/block-content-overlay/index.js.map +1 -1
- package/build/components/block-draggable/draggable-chip.js +2 -1
- package/build/components/block-draggable/draggable-chip.js.map +1 -1
- package/build/components/block-edit/edit.js +1 -1
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-inspector/index.js +125 -17
- package/build/components/block-inspector/index.js.map +1 -1
- 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/block.js +40 -9
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/index.js +4 -4
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +14 -11
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-class-names.js +3 -2
- package/build/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
- package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -10
- 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 +1 -2
- package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +7 -12
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-list-appender/index.js +20 -21
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-list-appender/index.native.js +1 -7
- package/build/components/block-list-appender/index.native.js.map +1 -1
- package/build/components/block-lock/use-block-lock.js +3 -1
- package/build/components/block-lock/use-block-lock.js.map +1 -1
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js +20 -10
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build/components/block-mover/button.js +4 -6
- package/build/components/block-mover/button.js.map +1 -1
- package/build/components/block-mover/index.js +4 -6
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-mover/index.native.js +24 -8
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-popover/inbetween.js +58 -16
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-popover/index.js +14 -9
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/auto.js +4 -2
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +3 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +3 -1
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-styles/preview-panel.js +7 -1
- package/build/components/block-styles/preview-panel.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js +114 -25
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-toolbar/index.js +9 -8
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +3 -2
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +13 -5
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/index.js +33 -15
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +4 -9
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +19 -10
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js +131 -0
- package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -0
- package/build/components/block-tools/zoom-out-mode-inserters.js +71 -0
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -0
- package/build/components/block-vertical-alignment-control/ui.js +5 -2
- package/build/components/block-vertical-alignment-control/ui.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/colors-gradients/dropdown.js +1 -1
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/iframe/index.js +31 -4
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/inner-blocks/default-block-appender.js +1 -7
- package/build/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build/components/inner-blocks/index.js +2 -2
- package/build/components/inner-blocks/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/inner-blocks/use-inner-block-template-sync.js +5 -5
- package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inserter/index.js +3 -6
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/library.js +14 -3
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/menu.js +21 -8
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/preview-panel.js +1 -1
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter/tabs.js +11 -4
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/link-control/link-preview.js +1 -1
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/link-control/search-input.js +6 -3
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/search-item.js +36 -5
- package/build/components/link-control/search-item.js.map +1 -1
- package/build/components/list-view/block.js +23 -11
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +19 -2
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/index.js +8 -4
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/use-block-selection.js +0 -1
- package/build/components/list-view/use-block-selection.js.map +1 -1
- package/build/components/provider/use-block-sync.js +1 -7
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/publish-date-time-picker/index.js +1 -1
- package/build/components/publish-date-time-picker/index.js.map +1 -1
- package/build/components/rich-text/index.js +37 -19
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +11 -20
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js +6 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build/components/spacing-sizes-control/utils.js +32 -1
- package/build/components/spacing-sizes-control/utils.js.map +1 -1
- 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/tool-selector/index.js +6 -11
- package/build/components/tool-selector/index.js.map +1 -1
- package/build/components/url-popover/index.js +1 -1
- package/build/components/url-popover/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +7 -4
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +9 -28
- package/build/components/use-moving-animation/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-select-all.js +7 -16
- package/build/components/writing-flow/use-select-all.js.map +1 -1
- package/build/hooks/align.js +17 -3
- 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/color-panel.js +2 -1
- package/build/hooks/color-panel.js.map +1 -1
- package/build/hooks/content-lock-ui.js +145 -0
- package/build/hooks/content-lock-ui.js.map +1 -0
- package/build/hooks/dimensions.js +6 -6
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +8 -1
- 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 +23 -6
- package/build/hooks/gap.js.map +1 -1
- package/build/hooks/index.js +14 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout.js +14 -10
- 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/metadata-name.js +55 -0
- package/build/hooks/metadata-name.js.map +1 -0
- package/build/hooks/metadata.js +65 -0
- package/build/hooks/metadata.js.map +1 -0
- 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/hooks/use-typography-props.js +51 -0
- package/build/hooks/use-typography-props.js.map +1 -0
- package/build/hooks/utils.js +3 -1
- package/build/hooks/utils.js.map +1 -1
- package/build/index.js +7 -0
- package/build/index.js.map +1 -1
- package/build/layouts/constrained.js +71 -22
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/flow.js +30 -2
- package/build/layouts/flow.js.map +1 -1
- package/build/store/actions.js +65 -21
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +39 -18
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +95 -9
- package/build/store/selectors.js.map +1 -1
- package/build/utils/parse-css-unit-to-px.js +1 -1
- package/build/utils/parse-css-unit-to-px.js.map +1 -1
- package/build-module/components/alignment-control/ui.js +6 -5
- package/build-module/components/alignment-control/ui.js.map +1 -1
- package/build-module/components/block-actions/index.js +5 -8
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.js +5 -5
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-content-overlay/index.js +2 -4
- package/build-module/components/block-content-overlay/index.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.js +2 -1
- package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
- package/build-module/components/block-edit/edit.js +1 -1
- package/build-module/components/block-edit/edit.js.map +1 -1
- package/build-module/components/block-inspector/index.js +127 -19
- package/build-module/components/block-inspector/index.js.map +1 -1
- 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/block.js +41 -9
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/index.js +4 -4
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +13 -11
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-class-names.js +3 -2
- package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -9
- 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 +1 -2
- package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +7 -12
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-list-appender/index.js +20 -20
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-list-appender/index.native.js +1 -6
- package/build-module/components/block-list-appender/index.native.js.map +1 -1
- package/build-module/components/block-lock/use-block-lock.js +3 -1
- package/build-module/components/block-lock/use-block-lock.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +20 -9
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build-module/components/block-mover/button.js +4 -5
- package/build-module/components/block-mover/button.js.map +1 -1
- package/build-module/components/block-mover/index.js +4 -5
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-mover/index.native.js +24 -7
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +59 -17
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-popover/index.js +12 -9
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-preview/auto.js +4 -2
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +3 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +3 -1
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-styles/preview-panel.js +6 -1
- package/build-module/components/block-styles/preview-panel.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js +115 -27
- package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +9 -8
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +3 -2
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +12 -5
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/index.js +30 -15
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +4 -9
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +17 -10
- 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 +119 -0
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -0
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +59 -0
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -0
- package/build-module/components/block-vertical-alignment-control/ui.js +5 -2
- package/build-module/components/block-vertical-alignment-control/ui.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/colors-gradients/dropdown.js +1 -1
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/iframe/index.js +32 -5
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/inner-blocks/default-block-appender.js +1 -6
- package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +2 -2
- package/build-module/components/inner-blocks/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/inner-blocks/use-inner-block-template-sync.js +5 -5
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inserter/index.js +3 -6
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/library.js +14 -3
- package/build-module/components/inserter/library.js.map +1 -1
- package/build-module/components/inserter/menu.js +20 -8
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +1 -1
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter/tabs.js +11 -4
- package/build-module/components/inserter/tabs.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +1 -1
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/link-control/search-input.js +6 -2
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/link-control/search-item.js +37 -6
- package/build-module/components/link-control/search-item.js.map +1 -1
- package/build-module/components/list-view/block.js +23 -11
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +19 -3
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/index.js +8 -4
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-block-selection.js +0 -1
- package/build-module/components/list-view/use-block-selection.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +1 -6
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/publish-date-time-picker/index.js +1 -1
- package/build-module/components/publish-date-time-picker/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +37 -18
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +11 -18
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/spacing-sizes-control/spacing-input-control.js +7 -2
- package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build-module/components/spacing-sizes-control/utils.js +30 -1
- package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
- 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/tool-selector/index.js +6 -11
- package/build-module/components/tool-selector/index.js.map +1 -1
- package/build-module/components/url-popover/index.js +1 -1
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +7 -4
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +9 -28
- package/build-module/components/use-moving-animation/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-select-all.js +7 -15
- package/build-module/components/writing-flow/use-select-all.js.map +1 -1
- package/build-module/hooks/align.js +16 -4
- 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/color-panel.js +2 -1
- package/build-module/hooks/color-panel.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +128 -0
- package/build-module/hooks/content-lock-ui.js.map +1 -0
- package/build-module/hooks/dimensions.js +6 -6
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +6 -1
- 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 +22 -6
- package/build-module/hooks/gap.js.map +1 -1
- package/build-module/hooks/index.js +4 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/layout.js +15 -11
- 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/metadata-name.js +45 -0
- package/build-module/hooks/metadata-name.js.map +1 -0
- package/build-module/hooks/metadata.js +50 -0
- package/build-module/hooks/metadata.js.map +1 -0
- 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/hooks/use-typography-props.js +38 -0
- package/build-module/hooks/use-typography-props.js.map +1 -0
- package/build-module/hooks/utils.js +4 -2
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/layouts/constrained.js +74 -25
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/flow.js +31 -3
- package/build-module/layouts/flow.js.map +1 -1
- package/build-module/store/actions.js +58 -20
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +37 -18
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +80 -9
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/parse-css-unit-to-px.js +1 -1
- package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
- package/build-style/style-rtl.css +137 -86
- package/build-style/style.css +137 -86
- package/package.json +28 -28
- package/src/components/alignment-control/test/__snapshots__/index.js.snap +137 -108
- package/src/components/alignment-control/test/index.js +124 -33
- package/src/components/alignment-control/ui.js +8 -3
- package/src/components/block-actions/index.js +9 -8
- package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +108 -65
- package/src/components/block-alignment-control/test/index.js +95 -31
- package/src/components/block-alignment-control/ui.js +2 -2
- package/src/components/block-compare/test/__snapshots__/block-view.js.snap +28 -26
- package/src/components/block-compare/test/block-view.js +3 -3
- package/src/components/block-content-overlay/index.js +2 -6
- package/src/components/block-content-overlay/style.scss +24 -3
- package/src/components/block-draggable/draggable-chip.js +4 -1
- package/src/components/block-edit/edit.js +5 -1
- package/src/components/block-edit/test/edit.js +23 -21
- package/src/components/block-icon/test/__snapshots__/index.js.snap +22 -0
- package/src/components/block-icon/test/index.js +31 -16
- package/src/components/block-inspector/index.js +126 -12
- package/src/components/block-inspector/style.scss +7 -1
- package/src/components/block-list/block-list-compact.native.js +62 -0
- package/src/components/block-list/block.js +53 -13
- package/src/components/block-list/index.js +4 -4
- package/src/components/block-list/style.scss +68 -18
- package/src/components/block-list/test/block-list-context.native.js +11 -13
- package/src/components/block-list/use-block-props/index.js +10 -10
- package/src/components/block-list/use-block-props/use-block-class-names.js +4 -1
- package/src/components/block-list/use-block-props/use-focus-first-element.js +4 -9
- package/src/components/block-list/use-block-props/use-is-hovered.js +2 -2
- package/src/components/block-list/use-in-between-inserter.js +11 -13
- package/src/components/block-list-appender/index.js +27 -18
- package/src/components/block-list-appender/index.native.js +3 -6
- package/src/components/block-lock/use-block-lock.js +2 -0
- package/src/components/block-mobile-toolbar/block-actions-menu.native.js +15 -9
- package/src/components/block-mover/button.js +6 -5
- package/src/components/block-mover/index.js +8 -7
- package/src/components/block-mover/index.native.js +20 -13
- package/src/components/block-popover/inbetween.js +85 -21
- package/src/components/block-popover/index.js +25 -17
- package/src/components/block-popover/style.scss +3 -4
- package/src/components/block-preview/auto.js +4 -2
- package/src/components/block-settings-menu/block-settings-dropdown.js +4 -0
- package/src/components/block-settings-menu-controls/README.md +9 -0
- package/src/components/block-settings-menu-controls/index.js +13 -2
- package/src/components/block-styles/preview-panel.js +3 -0
- package/src/components/block-switcher/block-transformations-menu.js +127 -33
- package/src/components/block-switcher/style.scss +4 -2
- package/src/components/block-switcher/test/index.js +1 -2
- package/src/components/block-title/test/index.js +28 -25
- package/src/components/block-toolbar/index.js +27 -17
- package/src/components/block-tools/block-contextual-toolbar.js +10 -3
- package/src/components/block-tools/block-selection-button.js +35 -16
- package/src/components/block-tools/index.js +40 -24
- package/src/components/block-tools/insertion-point.js +3 -7
- package/src/components/block-tools/selected-block-popover.js +16 -7
- package/src/components/block-tools/style.scss +5 -0
- package/src/components/block-tools/use-block-toolbar-popover-props.js +136 -0
- package/src/components/block-tools/zoom-out-mode-inserters.js +57 -0
- package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +91 -51
- package/src/components/block-vertical-alignment-control/test/index.js +92 -23
- package/src/components/block-vertical-alignment-control/ui.js +3 -2
- package/src/components/button-block-appender/style.scss +23 -0
- package/src/components/color-palette/test/__snapshots__/control.js.snap +3 -12
- package/src/components/colors/test/with-colors.js +37 -12
- package/src/components/colors-gradients/control.js +1 -0
- package/src/components/colors-gradients/dropdown.js +1 -1
- package/src/components/contrast-checker/test/index.js +135 -116
- package/src/components/default-block-appender/test/__snapshots__/index.js.snap +39 -57
- package/src/components/default-block-appender/test/index.js +32 -18
- package/src/components/font-sizes/README.MD +9 -0
- package/src/components/iframe/index.js +64 -5
- package/src/components/inner-blocks/README.md +2 -1
- package/src/components/inner-blocks/default-block-appender.js +1 -6
- package/src/components/inner-blocks/index.js +3 -2
- package/src/components/inner-blocks/index.native.js +5 -1
- package/src/components/inner-blocks/use-inner-block-template-sync.js +9 -5
- package/src/components/inner-blocks/use-nested-settings-update.js +3 -1
- package/src/components/inserter/index.js +2 -8
- package/src/components/inserter/library.js +11 -5
- package/src/components/inserter/menu.js +42 -29
- package/src/components/inserter/preview-panel.js +1 -1
- package/src/components/inserter/stories/fixtures.js +44 -0
- package/src/components/inserter/stories/index.js +90 -0
- package/src/components/inserter/style.scss +21 -27
- package/src/components/inserter/tabs.js +8 -4
- package/src/components/link-control/link-preview.js +5 -3
- package/src/components/link-control/search-input.js +2 -2
- package/src/components/link-control/search-item.js +39 -7
- package/src/components/list-view/block.js +29 -10
- package/src/components/list-view/branch.js +27 -4
- package/src/components/list-view/index.js +8 -3
- package/src/components/list-view/use-block-selection.js +0 -1
- package/src/components/media-placeholder/test/index.js +2 -2
- package/src/components/media-replace-flow/README.md +1 -1
- package/src/components/provider/use-block-sync.js +3 -6
- package/src/components/publish-date-time-picker/index.js +1 -1
- package/src/components/rich-text/index.js +33 -35
- package/src/components/rich-text/index.native.js +8 -21
- package/src/components/spacing-sizes-control/spacing-input-control.js +5 -0
- package/src/components/spacing-sizes-control/test/utils.js +26 -0
- package/src/components/spacing-sizes-control/utils.js +36 -9
- 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/tool-selector/index.js +9 -11
- package/src/components/url-input/test/button.js +145 -71
- package/src/components/url-popover/index.js +1 -1
- package/src/components/url-popover/test/__snapshots__/index.js.snap +108 -80
- package/src/components/url-popover/test/index.js +14 -12
- package/src/components/use-block-drop-zone/index.js +15 -4
- package/src/components/use-moving-animation/index.js +9 -24
- package/src/components/warning/test/__snapshots__/index.js.snap +11 -14
- package/src/components/warning/test/index.js +32 -29
- package/src/components/writing-flow/index.js +2 -0
- package/src/components/writing-flow/use-select-all.js +13 -18
- package/src/hooks/align.js +24 -15
- package/src/hooks/anchor.js +1 -6
- package/src/hooks/color-panel.js +2 -1
- package/src/hooks/content-lock-ui.js +161 -0
- package/src/hooks/dimensions.js +7 -8
- package/src/hooks/duotone.js +13 -1
- 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 +43 -25
- package/src/hooks/index.js +4 -0
- package/src/hooks/layout.js +27 -21
- package/src/hooks/layout.scss +7 -1
- 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/metadata-name.js +48 -0
- package/src/hooks/metadata.js +64 -0
- package/src/hooks/test/gap.js +16 -22
- package/src/hooks/test/use-typography-props.js +28 -0
- package/src/hooks/text-decoration.js +1 -0
- package/src/hooks/text-transform.js +1 -0
- package/src/hooks/typography.scss +0 -6
- package/src/hooks/use-typography-props.js +41 -0
- package/src/hooks/utils.js +2 -11
- package/src/index.js +1 -0
- package/src/layouts/constrained.js +85 -33
- package/src/layouts/flow.js +21 -10
- package/src/store/actions.js +45 -4
- package/src/store/reducer.js +33 -21
- package/src/store/selectors.js +98 -19
- package/src/store/test/reducer.js +8 -5
- package/src/style.scss +0 -2
- package/src/utils/parse-css-unit-to-px.js +1 -1
- package/src/components/colors/test/__snapshots__/with-colors.js.snap +0 -23
- package/src/components/text-decoration-control/style.scss +0 -18
- package/src/components/text-transform-control/style.scss +0 -18
package/src/hooks/test/gap.js
CHANGED
|
@@ -27,28 +27,6 @@ describe( 'gap', () => {
|
|
|
27
27
|
...blockGapValue,
|
|
28
28
|
} );
|
|
29
29
|
} );
|
|
30
|
-
it( 'should unwrap var: values from a string into a CSS var() function', () => {
|
|
31
|
-
const expectedValue = {
|
|
32
|
-
top: 'var(--wp--preset--spacing--60)',
|
|
33
|
-
left: 'var(--wp--preset--spacing--60)',
|
|
34
|
-
};
|
|
35
|
-
expect(
|
|
36
|
-
getGapBoxControlValueFromStyle( 'var:preset|spacing|60' )
|
|
37
|
-
).toEqual( expectedValue );
|
|
38
|
-
} );
|
|
39
|
-
it( 'should unwrap var: values from an object into a CSS var() function', () => {
|
|
40
|
-
const expectedValue = {
|
|
41
|
-
top: 'var(--wp--preset--spacing--20)',
|
|
42
|
-
left: 'var(--wp--preset--spacing--60)',
|
|
43
|
-
};
|
|
44
|
-
const blockGapValue = {
|
|
45
|
-
top: 'var:preset|spacing|20',
|
|
46
|
-
left: 'var:preset|spacing|60',
|
|
47
|
-
};
|
|
48
|
-
expect( getGapBoxControlValueFromStyle( blockGapValue ) ).toEqual(
|
|
49
|
-
expectedValue
|
|
50
|
-
);
|
|
51
|
-
} );
|
|
52
30
|
} );
|
|
53
31
|
describe( 'getGapCSSValue()', () => {
|
|
54
32
|
it( 'should return `null` if argument is falsey', () => {
|
|
@@ -84,5 +62,21 @@ describe( 'gap', () => {
|
|
|
84
62
|
'88px 1px'
|
|
85
63
|
);
|
|
86
64
|
} );
|
|
65
|
+
|
|
66
|
+
it( 'should unwrap var: values from a string into a CSS var() function', () => {
|
|
67
|
+
expect( getGapCSSValue( 'var:preset|spacing|60' ) ).toEqual(
|
|
68
|
+
'var(--wp--preset--spacing--60)'
|
|
69
|
+
);
|
|
70
|
+
} );
|
|
71
|
+
|
|
72
|
+
it( 'should unwrap var: values from an object into a CSS var() function and return shorthand values', () => {
|
|
73
|
+
const blockGapValue = {
|
|
74
|
+
top: 'var:preset|spacing|20',
|
|
75
|
+
left: 'var:preset|spacing|60',
|
|
76
|
+
};
|
|
77
|
+
expect( getGapCSSValue( blockGapValue ) ).toEqual(
|
|
78
|
+
'var(--wp--preset--spacing--20) var(--wp--preset--spacing--60)'
|
|
79
|
+
);
|
|
80
|
+
} );
|
|
87
81
|
} );
|
|
88
82
|
} );
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { getTypographyClassesAndStyles } from '../use-typography-props';
|
|
5
|
+
|
|
6
|
+
describe( 'getTypographyClassesAndStyles', () => {
|
|
7
|
+
it( 'should return styles and classes', () => {
|
|
8
|
+
const attributes = {
|
|
9
|
+
fontFamily: 'tofu',
|
|
10
|
+
fontSize: 'large',
|
|
11
|
+
style: {
|
|
12
|
+
typography: {
|
|
13
|
+
letterSpacing: '22px',
|
|
14
|
+
fontSize: '2rem',
|
|
15
|
+
textTransform: 'uppercase',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
expect( getTypographyClassesAndStyles( attributes ) ).toEqual( {
|
|
20
|
+
className: 'has-tofu-font-family has-large-font-size',
|
|
21
|
+
style: {
|
|
22
|
+
letterSpacing: '22px',
|
|
23
|
+
fontSize: '2rem',
|
|
24
|
+
textTransform: 'uppercase',
|
|
25
|
+
},
|
|
26
|
+
} );
|
|
27
|
+
} );
|
|
28
|
+
} );
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { kebabCase } from 'lodash';
|
|
5
|
+
import classnames from 'classnames';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { getInlineStyles } from './style';
|
|
11
|
+
import { getFontSizeClass } from '../components/font-sizes';
|
|
12
|
+
|
|
13
|
+
// This utility is intended to assist where the serialization of the typography
|
|
14
|
+
// block support is being skipped for a block but the typography related CSS
|
|
15
|
+
// styles still need to be generated so they can be applied to inner elements.
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Provides the CSS class names and inline styles for a block's typography support
|
|
19
|
+
* attributes.
|
|
20
|
+
*
|
|
21
|
+
* @param {Object} attributes Block attributes.
|
|
22
|
+
*
|
|
23
|
+
* @return {Object} Typography block support derived CSS classes & styles.
|
|
24
|
+
*/
|
|
25
|
+
export function getTypographyClassesAndStyles( attributes ) {
|
|
26
|
+
const typographyStyles = attributes?.style?.typography || {};
|
|
27
|
+
const style = getInlineStyles( { typography: typographyStyles } );
|
|
28
|
+
const fontFamilyClassName = !! attributes?.fontFamily
|
|
29
|
+
? `has-${ kebabCase( attributes.fontFamily ) }-font-family`
|
|
30
|
+
: '';
|
|
31
|
+
|
|
32
|
+
const className = classnames(
|
|
33
|
+
fontFamilyClassName,
|
|
34
|
+
getFontSizeClass( attributes?.fontSize )
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
className,
|
|
39
|
+
style,
|
|
40
|
+
};
|
|
41
|
+
}
|
package/src/hooks/utils.js
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
pickBy,
|
|
6
|
-
isEmpty,
|
|
7
|
-
mapValues,
|
|
8
|
-
forEach,
|
|
9
|
-
get,
|
|
10
|
-
setWith,
|
|
11
|
-
clone,
|
|
12
|
-
every,
|
|
13
|
-
} from 'lodash';
|
|
4
|
+
import { pickBy, isEmpty, mapValues, get, setWith, clone, every } from 'lodash';
|
|
14
5
|
|
|
15
6
|
/**
|
|
16
7
|
* WordPress dependencies
|
|
@@ -77,7 +68,7 @@ export function transformStyles(
|
|
|
77
68
|
}
|
|
78
69
|
}
|
|
79
70
|
let returnBlock = result;
|
|
80
|
-
|
|
71
|
+
Object.entries( activeSupports ).forEach( ( [ support, isActive ] ) => {
|
|
81
72
|
if ( isActive ) {
|
|
82
73
|
migrationPaths[ support ].forEach( ( path ) => {
|
|
83
74
|
const styleValue = get( referenceBlockAttributes, path );
|
package/src/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export {
|
|
|
6
6
|
getBorderClassesAndStyles as __experimentalGetBorderClassesAndStyles,
|
|
7
7
|
useBorderProps as __experimentalUseBorderProps,
|
|
8
8
|
getColorClassesAndStyles as __experimentalGetColorClassesAndStyles,
|
|
9
|
+
getTypographyClassesAndStyles,
|
|
9
10
|
useColorProps as __experimentalUseColorProps,
|
|
10
11
|
useCustomSides as __experimentalUseCustomSides,
|
|
11
12
|
getSpacingClassesAndStyles as __experimentalGetSpacingClassesAndStyles,
|
|
@@ -2,12 +2,20 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
|
-
Button,
|
|
6
5
|
__experimentalUseCustomUnits as useCustomUnits,
|
|
7
6
|
__experimentalUnitControl as UnitControl,
|
|
7
|
+
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
8
|
+
__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,
|
|
8
9
|
} from '@wordpress/components';
|
|
9
10
|
import { __ } from '@wordpress/i18n';
|
|
10
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
Icon,
|
|
13
|
+
positionCenter,
|
|
14
|
+
stretchWide,
|
|
15
|
+
justifyLeft,
|
|
16
|
+
justifyCenter,
|
|
17
|
+
justifyRight,
|
|
18
|
+
} from '@wordpress/icons';
|
|
11
19
|
import { getCSSRules } from '@wordpress/style-engine';
|
|
12
20
|
|
|
13
21
|
/**
|
|
@@ -15,7 +23,7 @@ import { getCSSRules } from '@wordpress/style-engine';
|
|
|
15
23
|
*/
|
|
16
24
|
import useSetting from '../components/use-setting';
|
|
17
25
|
import { appendSelectors, getBlockGapCSS, getAlignmentsInfo } from './utils';
|
|
18
|
-
import {
|
|
26
|
+
import { getGapCSSValue } from '../hooks/gap';
|
|
19
27
|
import { shouldSkipSerialization } from '../hooks/utils';
|
|
20
28
|
|
|
21
29
|
export default {
|
|
@@ -25,7 +33,30 @@ export default {
|
|
|
25
33
|
layout,
|
|
26
34
|
onChange,
|
|
27
35
|
} ) {
|
|
28
|
-
const { wideSize, contentSize } = layout;
|
|
36
|
+
const { wideSize, contentSize, justifyContent = 'center' } = layout;
|
|
37
|
+
const onJustificationChange = ( value ) => {
|
|
38
|
+
onChange( {
|
|
39
|
+
...layout,
|
|
40
|
+
justifyContent: value,
|
|
41
|
+
} );
|
|
42
|
+
};
|
|
43
|
+
const justificationOptions = [
|
|
44
|
+
{
|
|
45
|
+
value: 'left',
|
|
46
|
+
icon: justifyLeft,
|
|
47
|
+
label: __( 'Justify items left' ),
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: 'center',
|
|
51
|
+
icon: justifyCenter,
|
|
52
|
+
label: __( 'Justify items center' ),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
value: 'right',
|
|
56
|
+
icon: justifyRight,
|
|
57
|
+
label: __( 'Justify items right' ),
|
|
58
|
+
},
|
|
59
|
+
];
|
|
29
60
|
const units = useCustomUnits( {
|
|
30
61
|
availableUnits: useSetting( 'spacing.units' ) || [
|
|
31
62
|
'%',
|
|
@@ -35,7 +66,6 @@ export default {
|
|
|
35
66
|
'vw',
|
|
36
67
|
],
|
|
37
68
|
} );
|
|
38
|
-
|
|
39
69
|
return (
|
|
40
70
|
<>
|
|
41
71
|
<div className="block-editor-hooks__layout-controls">
|
|
@@ -80,28 +110,28 @@ export default {
|
|
|
80
110
|
<Icon icon={ stretchWide } />
|
|
81
111
|
</div>
|
|
82
112
|
</div>
|
|
83
|
-
<div className="block-editor-hooks__layout-controls-reset">
|
|
84
|
-
<Button
|
|
85
|
-
variant="secondary"
|
|
86
|
-
isSmall
|
|
87
|
-
disabled={ ! contentSize && ! wideSize }
|
|
88
|
-
onClick={ () =>
|
|
89
|
-
onChange( {
|
|
90
|
-
contentSize: undefined,
|
|
91
|
-
wideSize: undefined,
|
|
92
|
-
inherit: false,
|
|
93
|
-
} )
|
|
94
|
-
}
|
|
95
|
-
>
|
|
96
|
-
{ __( 'Reset' ) }
|
|
97
|
-
</Button>
|
|
98
|
-
</div>
|
|
99
|
-
|
|
100
113
|
<p className="block-editor-hooks__layout-controls-helptext">
|
|
101
114
|
{ __(
|
|
102
115
|
'Customize the width for all elements that are assigned to the center or wide columns.'
|
|
103
116
|
) }
|
|
104
117
|
</p>
|
|
118
|
+
<ToggleGroupControl
|
|
119
|
+
__experimentalIsBorderless
|
|
120
|
+
label={ __( 'Justification' ) }
|
|
121
|
+
value={ justifyContent }
|
|
122
|
+
onChange={ onJustificationChange }
|
|
123
|
+
>
|
|
124
|
+
{ justificationOptions.map( ( { value, icon, label } ) => {
|
|
125
|
+
return (
|
|
126
|
+
<ToggleGroupControlOptionIcon
|
|
127
|
+
key={ value }
|
|
128
|
+
value={ value }
|
|
129
|
+
icon={ icon }
|
|
130
|
+
label={ label }
|
|
131
|
+
/>
|
|
132
|
+
);
|
|
133
|
+
} ) }
|
|
134
|
+
</ToggleGroupControl>
|
|
105
135
|
</>
|
|
106
136
|
);
|
|
107
137
|
},
|
|
@@ -116,17 +146,25 @@ export default {
|
|
|
116
146
|
hasBlockGapSupport,
|
|
117
147
|
layoutDefinitions,
|
|
118
148
|
} ) {
|
|
119
|
-
const { contentSize, wideSize } = layout;
|
|
120
|
-
const blockGapStyleValue =
|
|
121
|
-
|
|
122
|
-
);
|
|
149
|
+
const { contentSize, wideSize, justifyContent } = layout;
|
|
150
|
+
const blockGapStyleValue = getGapCSSValue( style?.spacing?.blockGap );
|
|
151
|
+
|
|
123
152
|
// If a block's block.json skips serialization for spacing or
|
|
124
153
|
// spacing.blockGap, don't apply the user-defined value to the styles.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
154
|
+
let blockGapValue = '';
|
|
155
|
+
if ( ! shouldSkipSerialization( blockName, 'spacing', 'blockGap' ) ) {
|
|
156
|
+
// If an object is provided only use the 'top' value for this kind of gap.
|
|
157
|
+
if ( blockGapStyleValue?.top ) {
|
|
158
|
+
blockGapValue = getGapCSSValue( blockGapStyleValue?.top );
|
|
159
|
+
} else if ( typeof blockGapStyleValue === 'string' ) {
|
|
160
|
+
blockGapValue = getGapCSSValue( blockGapStyleValue );
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const marginLeft =
|
|
165
|
+
justifyContent === 'left' ? '0 !important' : 'auto !important';
|
|
166
|
+
const marginRight =
|
|
167
|
+
justifyContent === 'right' ? '0 !important' : 'auto !important';
|
|
130
168
|
|
|
131
169
|
let output =
|
|
132
170
|
!! contentSize || !! wideSize
|
|
@@ -136,8 +174,8 @@ export default {
|
|
|
136
174
|
'> :where(:not(.alignleft):not(.alignright):not(.alignfull))'
|
|
137
175
|
) } {
|
|
138
176
|
max-width: ${ contentSize ?? wideSize };
|
|
139
|
-
margin-left:
|
|
140
|
-
margin-right:
|
|
177
|
+
margin-left: ${ marginLeft };
|
|
178
|
+
margin-right: ${ marginRight }t;
|
|
141
179
|
}
|
|
142
180
|
${ appendSelectors( selector, '> .alignwide' ) } {
|
|
143
181
|
max-width: ${ wideSize ?? contentSize };
|
|
@@ -148,6 +186,20 @@ export default {
|
|
|
148
186
|
`
|
|
149
187
|
: '';
|
|
150
188
|
|
|
189
|
+
if ( justifyContent === 'left' ) {
|
|
190
|
+
output += `${ appendSelectors(
|
|
191
|
+
selector,
|
|
192
|
+
'> :where(:not(.alignleft):not(.alignright):not(.alignfull))'
|
|
193
|
+
) }
|
|
194
|
+
{ margin-left: ${ marginLeft }; }`;
|
|
195
|
+
} else if ( justifyContent === 'right' ) {
|
|
196
|
+
output += `${ appendSelectors(
|
|
197
|
+
selector,
|
|
198
|
+
'> :where(:not(.alignleft):not(.alignright):not(.alignfull))'
|
|
199
|
+
) }
|
|
200
|
+
{ margin-right: ${ marginRight }; }`;
|
|
201
|
+
}
|
|
202
|
+
|
|
151
203
|
// If there is custom padding, add negative margins for alignfull blocks.
|
|
152
204
|
if ( style?.spacing?.padding ) {
|
|
153
205
|
// The style object might be storing a preset so we need to make sure we get a usable value.
|
package/src/layouts/flow.js
CHANGED
|
@@ -6,9 +6,8 @@ import { __ } from '@wordpress/i18n';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
9
|
import { getBlockGapCSS, getAlignmentsInfo } from './utils';
|
|
11
|
-
import {
|
|
10
|
+
import { getGapCSSValue } from '../hooks/gap';
|
|
12
11
|
import { shouldSkipSerialization } from '../hooks/utils';
|
|
13
12
|
|
|
14
13
|
export default {
|
|
@@ -27,16 +26,19 @@ export default {
|
|
|
27
26
|
hasBlockGapSupport,
|
|
28
27
|
layoutDefinitions,
|
|
29
28
|
} ) {
|
|
30
|
-
const blockGapStyleValue =
|
|
31
|
-
|
|
32
|
-
);
|
|
29
|
+
const blockGapStyleValue = getGapCSSValue( style?.spacing?.blockGap );
|
|
30
|
+
|
|
33
31
|
// If a block's block.json skips serialization for spacing or
|
|
34
32
|
// spacing.blockGap, don't apply the user-defined value to the styles.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
let blockGapValue = '';
|
|
34
|
+
if ( ! shouldSkipSerialization( blockName, 'spacing', 'blockGap' ) ) {
|
|
35
|
+
// If an object is provided only use the 'top' value for this kind of gap.
|
|
36
|
+
if ( blockGapStyleValue?.top ) {
|
|
37
|
+
blockGapValue = getGapCSSValue( blockGapStyleValue?.top );
|
|
38
|
+
} else if ( typeof blockGapStyleValue === 'string' ) {
|
|
39
|
+
blockGapValue = getGapCSSValue( blockGapStyleValue );
|
|
40
|
+
}
|
|
41
|
+
}
|
|
40
42
|
|
|
41
43
|
let output = '';
|
|
42
44
|
|
|
@@ -65,6 +67,7 @@ export default {
|
|
|
65
67
|
info: alignmentInfo[ alignment ],
|
|
66
68
|
} ) );
|
|
67
69
|
}
|
|
70
|
+
const { contentSize, wideSize } = layout;
|
|
68
71
|
|
|
69
72
|
const alignments = [
|
|
70
73
|
{ name: 'left' },
|
|
@@ -72,6 +75,14 @@ export default {
|
|
|
72
75
|
{ name: 'right' },
|
|
73
76
|
];
|
|
74
77
|
|
|
78
|
+
if ( contentSize ) {
|
|
79
|
+
alignments.unshift( { name: 'full' } );
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if ( wideSize ) {
|
|
83
|
+
alignments.unshift( { name: 'wide', info: alignmentInfo.wide } );
|
|
84
|
+
}
|
|
85
|
+
|
|
75
86
|
alignments.unshift( { name: 'none', info: alignmentInfo.none } );
|
|
76
87
|
|
|
77
88
|
return alignments;
|
package/src/store/actions.js
CHANGED
|
@@ -1474,25 +1474,52 @@ export const __unstableMarkAutomaticChange =
|
|
|
1474
1474
|
/**
|
|
1475
1475
|
* Action that enables or disables the navigation mode.
|
|
1476
1476
|
*
|
|
1477
|
-
* @param {
|
|
1477
|
+
* @param {boolean} isNavigationMode Enable/Disable navigation mode.
|
|
1478
1478
|
*/
|
|
1479
1479
|
export const setNavigationMode =
|
|
1480
1480
|
( isNavigationMode = true ) =>
|
|
1481
1481
|
( { dispatch } ) => {
|
|
1482
|
-
dispatch(
|
|
1482
|
+
dispatch.__unstableSetEditorMode(
|
|
1483
|
+
isNavigationMode ? 'navigation' : 'edit'
|
|
1484
|
+
);
|
|
1485
|
+
};
|
|
1486
|
+
|
|
1487
|
+
/**
|
|
1488
|
+
* Action that sets the editor mode
|
|
1489
|
+
*
|
|
1490
|
+
* @param {string} mode Editor mode
|
|
1491
|
+
*/
|
|
1492
|
+
export const __unstableSetEditorMode =
|
|
1493
|
+
( mode ) =>
|
|
1494
|
+
( { dispatch, select } ) => {
|
|
1495
|
+
// When switching to zoom-out mode, we need to select the root block
|
|
1496
|
+
if ( mode === 'zoom-out' ) {
|
|
1497
|
+
const firstSelectedClientId = select.getBlockSelectionStart();
|
|
1498
|
+
if ( firstSelectedClientId ) {
|
|
1499
|
+
dispatch.selectBlock(
|
|
1500
|
+
select.getBlockHierarchyRootClientId(
|
|
1501
|
+
firstSelectedClientId
|
|
1502
|
+
)
|
|
1503
|
+
);
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1483
1506
|
|
|
1484
|
-
|
|
1507
|
+
dispatch( { type: 'SET_EDITOR_MODE', mode } );
|
|
1508
|
+
|
|
1509
|
+
if ( mode === 'navigation' ) {
|
|
1485
1510
|
speak(
|
|
1486
1511
|
__(
|
|
1487
1512
|
'You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.'
|
|
1488
1513
|
)
|
|
1489
1514
|
);
|
|
1490
|
-
} else {
|
|
1515
|
+
} else if ( mode === 'edit' ) {
|
|
1491
1516
|
speak(
|
|
1492
1517
|
__(
|
|
1493
1518
|
'You are currently in edit mode. To return to the navigation mode, press Escape.'
|
|
1494
1519
|
)
|
|
1495
1520
|
);
|
|
1521
|
+
} else if ( mode === 'zoom-out' ) {
|
|
1522
|
+
speak( __( 'You are currently in zoom-out mode.' ) );
|
|
1496
1523
|
}
|
|
1497
1524
|
};
|
|
1498
1525
|
|
|
@@ -1673,3 +1700,17 @@ export function setBlockVisibility( updates ) {
|
|
|
1673
1700
|
updates,
|
|
1674
1701
|
};
|
|
1675
1702
|
}
|
|
1703
|
+
|
|
1704
|
+
/**
|
|
1705
|
+
* Action that sets whether a block is being temporaritly edited as blocks.
|
|
1706
|
+
*
|
|
1707
|
+
* @param {?string} temporarilyEditingAsBlocks The block's clientId being temporaritly edited as blocks.
|
|
1708
|
+
*/
|
|
1709
|
+
export function __unstableSetTemporarilyEditingAsBlocks(
|
|
1710
|
+
temporarilyEditingAsBlocks
|
|
1711
|
+
) {
|
|
1712
|
+
return {
|
|
1713
|
+
type: 'SET_TEMPORARILY_EDITING_AS_BLOCKS',
|
|
1714
|
+
temporarilyEditingAsBlocks,
|
|
1715
|
+
};
|
|
1716
|
+
}
|
package/src/store/reducer.js
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
import {
|
|
5
5
|
flow,
|
|
6
6
|
reduce,
|
|
7
|
-
first,
|
|
8
|
-
last,
|
|
9
7
|
omit,
|
|
10
8
|
without,
|
|
11
9
|
mapValues,
|
|
@@ -1004,13 +1002,10 @@ export const blocks = flow(
|
|
|
1004
1002
|
|
|
1005
1003
|
case 'MOVE_BLOCKS_UP': {
|
|
1006
1004
|
const { clientIds, rootClientId = '' } = action;
|
|
1007
|
-
const firstClientId =
|
|
1005
|
+
const firstClientId = clientIds[ 0 ];
|
|
1008
1006
|
const subState = state[ rootClientId ];
|
|
1009
1007
|
|
|
1010
|
-
if (
|
|
1011
|
-
! subState.length ||
|
|
1012
|
-
firstClientId === first( subState )
|
|
1013
|
-
) {
|
|
1008
|
+
if ( ! subState.length || firstClientId === subState[ 0 ] ) {
|
|
1014
1009
|
return state;
|
|
1015
1010
|
}
|
|
1016
1011
|
|
|
@@ -1029,11 +1024,14 @@ export const blocks = flow(
|
|
|
1029
1024
|
|
|
1030
1025
|
case 'MOVE_BLOCKS_DOWN': {
|
|
1031
1026
|
const { clientIds, rootClientId = '' } = action;
|
|
1032
|
-
const firstClientId =
|
|
1033
|
-
const lastClientId =
|
|
1027
|
+
const firstClientId = clientIds[ 0 ];
|
|
1028
|
+
const lastClientId = clientIds[ clientIds.length - 1 ];
|
|
1034
1029
|
const subState = state[ rootClientId ];
|
|
1035
1030
|
|
|
1036
|
-
if (
|
|
1031
|
+
if (
|
|
1032
|
+
! subState.length ||
|
|
1033
|
+
lastClientId === subState[ subState.length - 1 ]
|
|
1034
|
+
) {
|
|
1037
1035
|
return state;
|
|
1038
1036
|
}
|
|
1039
1037
|
|
|
@@ -1610,21 +1608,21 @@ export const blockListSettings = ( state = {}, action ) => {
|
|
|
1610
1608
|
};
|
|
1611
1609
|
|
|
1612
1610
|
/**
|
|
1613
|
-
* Reducer returning
|
|
1611
|
+
* Reducer returning which mode is enabled.
|
|
1614
1612
|
*
|
|
1615
1613
|
* @param {string} state Current state.
|
|
1616
1614
|
* @param {Object} action Dispatched action.
|
|
1617
1615
|
*
|
|
1618
1616
|
* @return {string} Updated state.
|
|
1619
1617
|
*/
|
|
1620
|
-
export function
|
|
1621
|
-
// Let inserting block always trigger Edit mode.
|
|
1622
|
-
if ( action.type === 'INSERT_BLOCKS' ) {
|
|
1623
|
-
return
|
|
1618
|
+
export function editorMode( state = 'edit', action ) {
|
|
1619
|
+
// Let inserting block in navigation mode always trigger Edit mode.
|
|
1620
|
+
if ( action.type === 'INSERT_BLOCKS' && state === 'navigation' ) {
|
|
1621
|
+
return 'edit';
|
|
1624
1622
|
}
|
|
1625
1623
|
|
|
1626
|
-
if ( action.type === '
|
|
1627
|
-
return action.
|
|
1624
|
+
if ( action.type === 'SET_EDITOR_MODE' ) {
|
|
1625
|
+
return action.mode;
|
|
1628
1626
|
}
|
|
1629
1627
|
|
|
1630
1628
|
return state;
|
|
@@ -1639,13 +1637,11 @@ export function isNavigationMode( state = false, action ) {
|
|
|
1639
1637
|
* @return {string|null} Updated state.
|
|
1640
1638
|
*/
|
|
1641
1639
|
export function hasBlockMovingClientId( state = null, action ) {
|
|
1642
|
-
// Let inserting block always trigger Edit mode.
|
|
1643
|
-
|
|
1644
1640
|
if ( action.type === 'SET_BLOCK_MOVING_MODE' ) {
|
|
1645
1641
|
return action.hasBlockMovingClientId;
|
|
1646
1642
|
}
|
|
1647
1643
|
|
|
1648
|
-
if ( action.type === '
|
|
1644
|
+
if ( action.type === 'SET_EDITOR_MODE' ) {
|
|
1649
1645
|
return null;
|
|
1650
1646
|
}
|
|
1651
1647
|
|
|
@@ -1778,6 +1774,21 @@ export function lastBlockInserted( state = {}, action ) {
|
|
|
1778
1774
|
return state;
|
|
1779
1775
|
}
|
|
1780
1776
|
|
|
1777
|
+
/**
|
|
1778
|
+
* Reducer returning the block that is eding temporarily edited as blocks.
|
|
1779
|
+
*
|
|
1780
|
+
* @param {Object} state Current state.
|
|
1781
|
+
* @param {Object} action Dispatched action.
|
|
1782
|
+
*
|
|
1783
|
+
* @return {Object} Updated state.
|
|
1784
|
+
*/
|
|
1785
|
+
export function temporarilyEditingAsBlocks( state = '', action ) {
|
|
1786
|
+
if ( action.type === 'SET_TEMPORARILY_EDITING_AS_BLOCKS' ) {
|
|
1787
|
+
return action.temporarilyEditingAsBlocks;
|
|
1788
|
+
}
|
|
1789
|
+
return state;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1781
1792
|
export default combineReducers( {
|
|
1782
1793
|
blocks,
|
|
1783
1794
|
isTyping,
|
|
@@ -1793,9 +1804,10 @@ export default combineReducers( {
|
|
|
1793
1804
|
settings,
|
|
1794
1805
|
preferences,
|
|
1795
1806
|
lastBlockAttributesChange,
|
|
1796
|
-
|
|
1807
|
+
editorMode,
|
|
1797
1808
|
hasBlockMovingClientId,
|
|
1798
1809
|
automaticChangeStatus,
|
|
1799
1810
|
highlightedBlock,
|
|
1800
1811
|
lastBlockInserted,
|
|
1812
|
+
temporarilyEditingAsBlocks,
|
|
1801
1813
|
} );
|