@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
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import { render } from 'react-dom';
|
|
6
|
-
import { act } from 'react-dom/test-utils';
|
|
4
|
+
import { render, screen } from '@testing-library/react';
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* WordPress dependencies
|
|
10
8
|
*/
|
|
11
|
-
import { Notice } from '@wordpress/components';
|
|
12
9
|
import { speak } from '@wordpress/a11y';
|
|
13
10
|
|
|
14
11
|
/**
|
|
@@ -32,12 +29,13 @@ describe( 'ContrastChecker', () => {
|
|
|
32
29
|
speak.mockReset();
|
|
33
30
|
} );
|
|
34
31
|
|
|
35
|
-
test( 'should render
|
|
36
|
-
|
|
32
|
+
test( 'should render nothing when no colors are provided', () => {
|
|
33
|
+
const { container } = render( <ContrastChecker /> );
|
|
34
|
+
expect( container ).toBeEmptyDOMElement();
|
|
37
35
|
} );
|
|
38
36
|
|
|
39
|
-
test( 'should render
|
|
40
|
-
const
|
|
37
|
+
test( 'should render nothing when no background or fallback background color is provided', () => {
|
|
38
|
+
const { container } = render(
|
|
41
39
|
<ContrastChecker
|
|
42
40
|
textColor={ textColor }
|
|
43
41
|
linkColor={ linkColor }
|
|
@@ -46,11 +44,11 @@ describe( 'ContrastChecker', () => {
|
|
|
46
44
|
);
|
|
47
45
|
|
|
48
46
|
expect( speak ).not.toHaveBeenCalled();
|
|
49
|
-
expect(
|
|
47
|
+
expect( container ).toBeEmptyDOMElement();
|
|
50
48
|
} );
|
|
51
49
|
|
|
52
|
-
test( 'should render
|
|
53
|
-
const
|
|
50
|
+
test( 'should render nothing when the colors meet AA WCAG guidelines.', () => {
|
|
51
|
+
const { container } = render(
|
|
54
52
|
<ContrastChecker
|
|
55
53
|
backgroundColor={ backgroundColor }
|
|
56
54
|
textColor={ textColor }
|
|
@@ -62,11 +60,11 @@ describe( 'ContrastChecker', () => {
|
|
|
62
60
|
);
|
|
63
61
|
|
|
64
62
|
expect( speak ).not.toHaveBeenCalled();
|
|
65
|
-
expect(
|
|
63
|
+
expect( container ).toBeEmptyDOMElement();
|
|
66
64
|
} );
|
|
67
65
|
|
|
68
66
|
test( 'should render component when the text and background colors do not meet AA WCAG guidelines.', () => {
|
|
69
|
-
|
|
67
|
+
render(
|
|
70
68
|
<ContrastChecker
|
|
71
69
|
backgroundColor={ sameShade }
|
|
72
70
|
textColor={ sameShade }
|
|
@@ -79,13 +77,16 @@ describe( 'ContrastChecker', () => {
|
|
|
79
77
|
expect( speak ).toHaveBeenCalledWith(
|
|
80
78
|
'This color combination may be hard for people to read.'
|
|
81
79
|
);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
|
|
81
|
+
expect(
|
|
82
|
+
screen.getByText(
|
|
83
|
+
'This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color.'
|
|
84
|
+
)
|
|
85
|
+
).toBeVisible();
|
|
85
86
|
} );
|
|
86
87
|
|
|
87
88
|
test( 'should render component when the link and background colors do not meet AA WCAG guidelines.', () => {
|
|
88
|
-
|
|
89
|
+
render(
|
|
89
90
|
<ContrastChecker
|
|
90
91
|
backgroundColor={ sameShade }
|
|
91
92
|
textColor={ textColor }
|
|
@@ -99,13 +100,15 @@ describe( 'ContrastChecker', () => {
|
|
|
99
100
|
expect( speak ).toHaveBeenCalledWith(
|
|
100
101
|
'This color combination may be hard for people to read.'
|
|
101
102
|
);
|
|
102
|
-
expect(
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
expect(
|
|
104
|
+
screen.getByText(
|
|
105
|
+
'This color combination may be hard for people to read. Try using a brighter background color and/or a darker link color.'
|
|
106
|
+
)
|
|
107
|
+
).toBeVisible();
|
|
105
108
|
} );
|
|
106
109
|
|
|
107
110
|
test( 'should render component when the link and text and background colors do not meet AA WCAG guidelines.', () => {
|
|
108
|
-
|
|
111
|
+
render(
|
|
109
112
|
<ContrastChecker
|
|
110
113
|
backgroundColor={ sameShade }
|
|
111
114
|
textColor={ sameShade }
|
|
@@ -119,13 +122,15 @@ describe( 'ContrastChecker', () => {
|
|
|
119
122
|
expect( speak ).toHaveBeenCalledWith(
|
|
120
123
|
'This color combination may be hard for people to read.'
|
|
121
124
|
);
|
|
122
|
-
expect(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
expect(
|
|
126
|
+
screen.getByText(
|
|
127
|
+
'This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color.'
|
|
128
|
+
)
|
|
129
|
+
).toBeVisible();
|
|
125
130
|
} );
|
|
126
131
|
|
|
127
|
-
test( 'should render
|
|
128
|
-
const
|
|
132
|
+
test( 'should render nothing if background color contains a transparency', () => {
|
|
133
|
+
const { container } = render(
|
|
129
134
|
<ContrastChecker
|
|
130
135
|
backgroundColor={ colorWithTransparency }
|
|
131
136
|
textColor={ sameShade }
|
|
@@ -137,11 +142,11 @@ describe( 'ContrastChecker', () => {
|
|
|
137
142
|
);
|
|
138
143
|
|
|
139
144
|
expect( speak ).not.toHaveBeenCalled();
|
|
140
|
-
expect(
|
|
145
|
+
expect( container ).toBeEmptyDOMElement();
|
|
141
146
|
} );
|
|
142
147
|
|
|
143
|
-
test( 'should render
|
|
144
|
-
const
|
|
148
|
+
test( 'should render nothing if text color contains a transparency', () => {
|
|
149
|
+
const { container } = render(
|
|
145
150
|
<ContrastChecker
|
|
146
151
|
backgroundColor={ sameShade }
|
|
147
152
|
textColor={ colorWithTransparency }
|
|
@@ -152,11 +157,11 @@ describe( 'ContrastChecker', () => {
|
|
|
152
157
|
);
|
|
153
158
|
|
|
154
159
|
expect( speak ).not.toHaveBeenCalled();
|
|
155
|
-
expect(
|
|
160
|
+
expect( container ).toBeEmptyDOMElement();
|
|
156
161
|
} );
|
|
157
162
|
|
|
158
|
-
test( 'should render
|
|
159
|
-
const
|
|
163
|
+
test( 'should render nothing if link color contains a transparency', () => {
|
|
164
|
+
const { container } = render(
|
|
160
165
|
<ContrastChecker
|
|
161
166
|
backgroundColor={ backgroundColor }
|
|
162
167
|
textColor={ textColor }
|
|
@@ -168,13 +173,13 @@ describe( 'ContrastChecker', () => {
|
|
|
168
173
|
);
|
|
169
174
|
|
|
170
175
|
expect( speak ).not.toHaveBeenCalled();
|
|
171
|
-
expect(
|
|
176
|
+
expect( container ).toBeEmptyDOMElement();
|
|
172
177
|
} );
|
|
173
178
|
|
|
174
179
|
test( 'should render different message matching snapshot when background color has less brightness than text color.', () => {
|
|
175
180
|
const darkerShade = '#555';
|
|
176
181
|
|
|
177
|
-
|
|
182
|
+
render(
|
|
178
183
|
<ContrastChecker
|
|
179
184
|
backgroundColor={ darkerShade }
|
|
180
185
|
textColor={ sameShade }
|
|
@@ -187,13 +192,15 @@ describe( 'ContrastChecker', () => {
|
|
|
187
192
|
expect( speak ).toHaveBeenCalledWith(
|
|
188
193
|
'This color combination may be hard for people to read.'
|
|
189
194
|
);
|
|
190
|
-
expect(
|
|
191
|
-
|
|
192
|
-
|
|
195
|
+
expect(
|
|
196
|
+
screen.getByText(
|
|
197
|
+
'This color combination may be hard for people to read. Try using a darker background color and/or a brighter text color.'
|
|
198
|
+
)
|
|
199
|
+
).toBeVisible();
|
|
193
200
|
} );
|
|
194
201
|
|
|
195
202
|
test( 'should take into consideration wherever text is large or not', () => {
|
|
196
|
-
const
|
|
203
|
+
const { container, rerender } = render(
|
|
197
204
|
<ContrastChecker
|
|
198
205
|
backgroundColor="#C44B4B"
|
|
199
206
|
textColor="#000000"
|
|
@@ -204,11 +211,13 @@ describe( 'ContrastChecker', () => {
|
|
|
204
211
|
expect( speak ).toHaveBeenCalledWith(
|
|
205
212
|
'This color combination may be hard for people to read.'
|
|
206
213
|
);
|
|
207
|
-
expect(
|
|
208
|
-
|
|
209
|
-
|
|
214
|
+
expect(
|
|
215
|
+
screen.getByText(
|
|
216
|
+
'This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color.'
|
|
217
|
+
)
|
|
218
|
+
).toBeVisible();
|
|
210
219
|
|
|
211
|
-
|
|
220
|
+
rerender(
|
|
212
221
|
<ContrastChecker
|
|
213
222
|
backgroundColor="#C44B4B"
|
|
214
223
|
textColor="#000000"
|
|
@@ -216,11 +225,11 @@ describe( 'ContrastChecker', () => {
|
|
|
216
225
|
/>
|
|
217
226
|
);
|
|
218
227
|
|
|
219
|
-
expect(
|
|
228
|
+
expect( container ).toBeEmptyDOMElement();
|
|
220
229
|
} );
|
|
221
230
|
|
|
222
231
|
test( 'should take into consideration the font size passed', () => {
|
|
223
|
-
const
|
|
232
|
+
const { container, rerender } = render(
|
|
224
233
|
<ContrastChecker
|
|
225
234
|
backgroundColor="#C44B4B"
|
|
226
235
|
textColor="#000000"
|
|
@@ -231,11 +240,13 @@ describe( 'ContrastChecker', () => {
|
|
|
231
240
|
expect( speak ).toHaveBeenCalledWith(
|
|
232
241
|
'This color combination may be hard for people to read.'
|
|
233
242
|
);
|
|
234
|
-
expect(
|
|
235
|
-
|
|
236
|
-
|
|
243
|
+
expect(
|
|
244
|
+
screen.getByText(
|
|
245
|
+
'This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color.'
|
|
246
|
+
)
|
|
247
|
+
).toBeVisible();
|
|
237
248
|
|
|
238
|
-
|
|
249
|
+
rerender(
|
|
239
250
|
<ContrastChecker
|
|
240
251
|
backgroundColor="#C44B4B"
|
|
241
252
|
textColor="#000000"
|
|
@@ -243,11 +254,11 @@ describe( 'ContrastChecker', () => {
|
|
|
243
254
|
/>
|
|
244
255
|
);
|
|
245
256
|
|
|
246
|
-
expect(
|
|
257
|
+
expect( container ).toBeEmptyDOMElement();
|
|
247
258
|
} );
|
|
248
259
|
|
|
249
260
|
test( 'should use isLargeText to make decisions if both isLargeText and fontSize props are passed', () => {
|
|
250
|
-
const
|
|
261
|
+
const { container, rerender } = render(
|
|
251
262
|
<ContrastChecker
|
|
252
263
|
backgroundColor="#C44B4B"
|
|
253
264
|
textColor="#000000"
|
|
@@ -257,9 +268,9 @@ describe( 'ContrastChecker', () => {
|
|
|
257
268
|
);
|
|
258
269
|
|
|
259
270
|
expect( speak ).not.toHaveBeenCalled();
|
|
260
|
-
expect(
|
|
271
|
+
expect( container ).toBeEmptyDOMElement();
|
|
261
272
|
|
|
262
|
-
|
|
273
|
+
rerender(
|
|
263
274
|
<ContrastChecker
|
|
264
275
|
backgroundColor="#C44B4B"
|
|
265
276
|
textColor="#000000"
|
|
@@ -271,13 +282,15 @@ describe( 'ContrastChecker', () => {
|
|
|
271
282
|
expect( speak ).toHaveBeenCalledWith(
|
|
272
283
|
'This color combination may be hard for people to read.'
|
|
273
284
|
);
|
|
274
|
-
expect(
|
|
275
|
-
|
|
276
|
-
|
|
285
|
+
expect(
|
|
286
|
+
screen.getByText(
|
|
287
|
+
'This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color.'
|
|
288
|
+
)
|
|
289
|
+
).toBeVisible();
|
|
277
290
|
} );
|
|
278
291
|
|
|
279
|
-
test( 'should render
|
|
280
|
-
const
|
|
292
|
+
test( 'should render nothing when the colors meet AA WCAG guidelines, with only fallback colors.', () => {
|
|
293
|
+
const { container } = render(
|
|
281
294
|
<ContrastChecker
|
|
282
295
|
isLargeText={ isLargeText }
|
|
283
296
|
fallbackBackgroundColor={ fallbackBackgroundColor }
|
|
@@ -286,11 +299,11 @@ describe( 'ContrastChecker', () => {
|
|
|
286
299
|
);
|
|
287
300
|
|
|
288
301
|
expect( speak ).not.toHaveBeenCalled();
|
|
289
|
-
expect(
|
|
302
|
+
expect( container ).toBeEmptyDOMElement();
|
|
290
303
|
} );
|
|
291
304
|
|
|
292
305
|
test( 'should render messages when the textColor is valid, but the fallback backgroundColor conflicts.', () => {
|
|
293
|
-
|
|
306
|
+
render(
|
|
294
307
|
<ContrastChecker
|
|
295
308
|
textColor={ textColor }
|
|
296
309
|
fallbackBackgroundColor={ textColor }
|
|
@@ -300,13 +313,15 @@ describe( 'ContrastChecker', () => {
|
|
|
300
313
|
expect( speak ).toHaveBeenCalledWith(
|
|
301
314
|
'This color combination may be hard for people to read.'
|
|
302
315
|
);
|
|
303
|
-
expect(
|
|
304
|
-
|
|
305
|
-
|
|
316
|
+
expect(
|
|
317
|
+
screen.getByText(
|
|
318
|
+
'This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color.'
|
|
319
|
+
)
|
|
320
|
+
).toBeVisible();
|
|
306
321
|
} );
|
|
307
322
|
|
|
308
323
|
test( 'should render messages when the linkColor is valid, but the fallback backgroundColor conflicts.', () => {
|
|
309
|
-
|
|
324
|
+
render(
|
|
310
325
|
<ContrastChecker
|
|
311
326
|
linkColor={ linkColor }
|
|
312
327
|
fallbackBackgroundColor={ linkColor }
|
|
@@ -316,40 +331,34 @@ describe( 'ContrastChecker', () => {
|
|
|
316
331
|
expect( speak ).toHaveBeenCalledWith(
|
|
317
332
|
'This color combination may be hard for people to read.'
|
|
318
333
|
);
|
|
319
|
-
expect(
|
|
320
|
-
|
|
321
|
-
|
|
334
|
+
expect(
|
|
335
|
+
screen.getByText(
|
|
336
|
+
'This color combination may be hard for people to read. Try using a brighter background color and/or a darker link color.'
|
|
337
|
+
)
|
|
338
|
+
).toBeVisible();
|
|
322
339
|
} );
|
|
323
340
|
|
|
324
341
|
test( 'should re-announce if colors change, but still insufficient contrast', () => {
|
|
325
|
-
const
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
render(
|
|
339
|
-
<ContrastChecker
|
|
340
|
-
textColor={ backgroundColor }
|
|
341
|
-
fallbackBackgroundColor={ backgroundColor }
|
|
342
|
-
/>,
|
|
343
|
-
appRoot
|
|
344
|
-
);
|
|
345
|
-
} );
|
|
342
|
+
const { rerender } = render(
|
|
343
|
+
<ContrastChecker
|
|
344
|
+
textColor={ textColor }
|
|
345
|
+
fallbackBackgroundColor={ textColor }
|
|
346
|
+
/>
|
|
347
|
+
);
|
|
348
|
+
|
|
349
|
+
rerender(
|
|
350
|
+
<ContrastChecker
|
|
351
|
+
textColor={ backgroundColor }
|
|
352
|
+
fallbackBackgroundColor={ backgroundColor }
|
|
353
|
+
/>
|
|
354
|
+
);
|
|
346
355
|
|
|
347
356
|
expect( speak ).toHaveBeenCalledTimes( 2 );
|
|
348
357
|
} );
|
|
349
358
|
|
|
350
359
|
// enableAlphaChecker tests
|
|
351
|
-
test( 'should render
|
|
352
|
-
const
|
|
360
|
+
test( 'should render nothing when the colors meet AA WCAG guidelines and alpha checker enabled.', () => {
|
|
361
|
+
const { container } = render(
|
|
353
362
|
<ContrastChecker
|
|
354
363
|
backgroundColor={ backgroundColor }
|
|
355
364
|
textColor={ textColor }
|
|
@@ -359,11 +368,11 @@ describe( 'ContrastChecker', () => {
|
|
|
359
368
|
);
|
|
360
369
|
|
|
361
370
|
expect( speak ).not.toHaveBeenCalled();
|
|
362
|
-
expect(
|
|
371
|
+
expect( container ).toBeEmptyDOMElement();
|
|
363
372
|
} );
|
|
364
373
|
|
|
365
374
|
test( 'should render component when the colors meet AA WCAG guidelines but the text color only has alpha transparency with alpha checker enabled.', () => {
|
|
366
|
-
|
|
375
|
+
render(
|
|
367
376
|
<ContrastChecker
|
|
368
377
|
backgroundColor={ backgroundColor }
|
|
369
378
|
textColor={ 'rgba(0,0,0,0.9)' }
|
|
@@ -376,13 +385,15 @@ describe( 'ContrastChecker', () => {
|
|
|
376
385
|
expect( speak ).toHaveBeenCalledWith(
|
|
377
386
|
'Transparent text may be hard for people to read.'
|
|
378
387
|
);
|
|
379
|
-
expect(
|
|
380
|
-
|
|
381
|
-
|
|
388
|
+
expect(
|
|
389
|
+
screen.getByText(
|
|
390
|
+
'Transparent text may be hard for people to read.'
|
|
391
|
+
)
|
|
392
|
+
).toBeVisible();
|
|
382
393
|
} );
|
|
383
394
|
|
|
384
395
|
test( 'should render component when the colors meet AA WCAG guidelines but the link color only has alpha transparency with alpha checker enabled.', () => {
|
|
385
|
-
|
|
396
|
+
render(
|
|
386
397
|
<ContrastChecker
|
|
387
398
|
backgroundColor={ backgroundColor }
|
|
388
399
|
linkColor={ 'rgba(0,0,0,0.9)' }
|
|
@@ -395,13 +406,15 @@ describe( 'ContrastChecker', () => {
|
|
|
395
406
|
expect( speak ).toHaveBeenCalledWith(
|
|
396
407
|
'Transparent text may be hard for people to read.'
|
|
397
408
|
);
|
|
398
|
-
expect(
|
|
399
|
-
|
|
400
|
-
|
|
409
|
+
expect(
|
|
410
|
+
screen.getByText(
|
|
411
|
+
'Transparent text may be hard for people to read.'
|
|
412
|
+
)
|
|
413
|
+
).toBeVisible();
|
|
401
414
|
} );
|
|
402
415
|
|
|
403
|
-
test( 'should render
|
|
404
|
-
const
|
|
416
|
+
test( 'should render nothing when the colors meet AA WCAG guidelines but the background color only has alpha transparency with alpha checker enabled.', () => {
|
|
417
|
+
const { container } = render(
|
|
405
418
|
<ContrastChecker
|
|
406
419
|
backgroundColor={ 'rgba(255,255,255,0.7)' }
|
|
407
420
|
textColor={ textColor }
|
|
@@ -412,11 +425,11 @@ describe( 'ContrastChecker', () => {
|
|
|
412
425
|
);
|
|
413
426
|
|
|
414
427
|
expect( speak ).not.toHaveBeenCalled();
|
|
415
|
-
expect(
|
|
428
|
+
expect( container ).toBeEmptyDOMElement();
|
|
416
429
|
} );
|
|
417
430
|
|
|
418
|
-
test( 'should render
|
|
419
|
-
const
|
|
431
|
+
test( 'should render nothing if background color contains a transparency with alpha checker enabled.', () => {
|
|
432
|
+
const { container } = render(
|
|
420
433
|
<ContrastChecker
|
|
421
434
|
backgroundColor={ colorWithTransparency }
|
|
422
435
|
textColor={ sameShade }
|
|
@@ -429,11 +442,11 @@ describe( 'ContrastChecker', () => {
|
|
|
429
442
|
);
|
|
430
443
|
|
|
431
444
|
expect( speak ).not.toHaveBeenCalled();
|
|
432
|
-
expect(
|
|
445
|
+
expect( container ).toBeEmptyDOMElement();
|
|
433
446
|
} );
|
|
434
447
|
|
|
435
448
|
test( 'should render transparency warning only if one text is not readable but the other is transparent and the background color contains a transparency with alpha checker enabled.', () => {
|
|
436
|
-
|
|
449
|
+
render(
|
|
437
450
|
<ContrastChecker
|
|
438
451
|
backgroundColor={ colorWithTransparency }
|
|
439
452
|
textColor={ sameShade }
|
|
@@ -448,13 +461,15 @@ describe( 'ContrastChecker', () => {
|
|
|
448
461
|
expect( speak ).toHaveBeenCalledWith(
|
|
449
462
|
'Transparent text may be hard for people to read.'
|
|
450
463
|
);
|
|
451
|
-
expect(
|
|
452
|
-
|
|
453
|
-
|
|
464
|
+
expect(
|
|
465
|
+
screen.getByText(
|
|
466
|
+
'Transparent text may be hard for people to read.'
|
|
467
|
+
)
|
|
468
|
+
).toBeVisible();
|
|
454
469
|
} );
|
|
455
470
|
|
|
456
471
|
test( 'should render component and prioritize contrast warning when the colors do no meet AA WCAG guidelines and text has alpha transparency with the alpha checker enabled.', () => {
|
|
457
|
-
|
|
472
|
+
render(
|
|
458
473
|
<ContrastChecker
|
|
459
474
|
backgroundColor={ sameShade }
|
|
460
475
|
textColor={ 'rgba(0,0,0,0.9)' }
|
|
@@ -469,13 +484,15 @@ describe( 'ContrastChecker', () => {
|
|
|
469
484
|
expect( speak ).toHaveBeenCalledWith(
|
|
470
485
|
'This color combination may be hard for people to read.'
|
|
471
486
|
);
|
|
472
|
-
expect(
|
|
473
|
-
|
|
474
|
-
|
|
487
|
+
expect(
|
|
488
|
+
screen.getByText(
|
|
489
|
+
'This color combination may be hard for people to read. Try using a brighter background color and/or a darker link color.'
|
|
490
|
+
)
|
|
491
|
+
).toBeVisible();
|
|
475
492
|
} );
|
|
476
493
|
|
|
477
494
|
test( 'should render component when the colors meet AA WCAG guidelines but all colors have alpha transparency with alpha checker enabled.', () => {
|
|
478
|
-
|
|
495
|
+
render(
|
|
479
496
|
<ContrastChecker
|
|
480
497
|
backgroundColor={ 'rgba(255,255,255,0.7)' }
|
|
481
498
|
linkColor={ 'rgba(0,0,0,0.7)' }
|
|
@@ -488,8 +505,10 @@ describe( 'ContrastChecker', () => {
|
|
|
488
505
|
expect( speak ).toHaveBeenCalledWith(
|
|
489
506
|
'Transparent text may be hard for people to read.'
|
|
490
507
|
);
|
|
491
|
-
expect(
|
|
492
|
-
|
|
493
|
-
|
|
508
|
+
expect(
|
|
509
|
+
screen.getByText(
|
|
510
|
+
'Transparent text may be hard for people to read.'
|
|
511
|
+
)
|
|
512
|
+
).toBeVisible();
|
|
494
513
|
} );
|
|
495
514
|
} );
|
|
@@ -1,73 +1,55 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`DefaultBlockAppender should append a default block when input focused 1`] = `
|
|
4
|
-
<div
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<p
|
|
9
|
-
aria-label="Add default block"
|
|
10
|
-
className="block-editor-default-block-appender__content"
|
|
11
|
-
onClick={[Function]}
|
|
12
|
-
onFocus={[Function]}
|
|
13
|
-
onKeyDown={[Function]}
|
|
14
|
-
role="button"
|
|
15
|
-
tabIndex="0"
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="block-editor-default-block-appender has-visible-prompt"
|
|
7
|
+
data-root-client-id=""
|
|
16
8
|
>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
<p
|
|
10
|
+
aria-label="Add default block"
|
|
11
|
+
class="block-editor-default-block-appender__content"
|
|
12
|
+
role="button"
|
|
13
|
+
tabindex="0"
|
|
14
|
+
>
|
|
15
|
+
Type / to choose a block
|
|
16
|
+
</p>
|
|
17
|
+
</div>
|
|
24
18
|
</div>
|
|
25
19
|
`;
|
|
26
20
|
|
|
27
21
|
exports[`DefaultBlockAppender should match snapshot 1`] = `
|
|
28
|
-
<div
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<p
|
|
33
|
-
aria-label="Add default block"
|
|
34
|
-
className="block-editor-default-block-appender__content"
|
|
35
|
-
onClick={[Function]}
|
|
36
|
-
onFocus={[Function]}
|
|
37
|
-
onKeyDown={[Function]}
|
|
38
|
-
role="button"
|
|
39
|
-
tabIndex="0"
|
|
22
|
+
<div>
|
|
23
|
+
<div
|
|
24
|
+
class="block-editor-default-block-appender has-visible-prompt"
|
|
25
|
+
data-root-client-id=""
|
|
40
26
|
>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
27
|
+
<p
|
|
28
|
+
aria-label="Add default block"
|
|
29
|
+
class="block-editor-default-block-appender__content"
|
|
30
|
+
role="button"
|
|
31
|
+
tabindex="0"
|
|
32
|
+
>
|
|
33
|
+
Type / to choose a block
|
|
34
|
+
</p>
|
|
35
|
+
</div>
|
|
48
36
|
</div>
|
|
49
37
|
`;
|
|
50
38
|
|
|
51
39
|
exports[`DefaultBlockAppender should optionally show without prompt 1`] = `
|
|
52
|
-
<div
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<p
|
|
57
|
-
aria-label="Add default block"
|
|
58
|
-
className="block-editor-default-block-appender__content"
|
|
59
|
-
onClick={[Function]}
|
|
60
|
-
onFocus={[Function]}
|
|
61
|
-
onKeyDown={[Function]}
|
|
62
|
-
role="button"
|
|
63
|
-
tabIndex="0"
|
|
40
|
+
<div>
|
|
41
|
+
<div
|
|
42
|
+
class="block-editor-default-block-appender"
|
|
43
|
+
data-root-client-id=""
|
|
64
44
|
>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
45
|
+
<p
|
|
46
|
+
aria-label="Add default block"
|
|
47
|
+
class="block-editor-default-block-appender__content"
|
|
48
|
+
role="button"
|
|
49
|
+
tabindex="0"
|
|
50
|
+
>
|
|
51
|
+
|
|
52
|
+
</p>
|
|
53
|
+
</div>
|
|
72
54
|
</div>
|
|
73
55
|
`;
|