@wordpress/block-editor 12.4.0 → 12.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +1 -0
- package/build/components/block-draggable/index.js +6 -3
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-draggable/index.native.js +2 -2
- package/build/components/block-draggable/index.native.js.map +1 -1
- package/build/components/block-edit/edit.js +25 -13
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-heading-level-dropdown/heading-level-icon.js +10 -2
- package/build/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
- package/build/components/block-heading-level-dropdown/index.native.js +4 -3
- package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
- package/build/components/block-list/block-outline.native.js +14 -18
- package/build/components/block-list/block-outline.native.js.map +1 -1
- package/build/components/block-list/block.native.js +21 -42
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-lock/toolbar.js +25 -6
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-mover/index.native.js +1 -1
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-parent-selector/index.js +8 -5
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +15 -25
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-settings/button.native.js +2 -2
- package/build/components/block-settings/button.native.js.map +1 -1
- package/build/components/{block-mobile-toolbar/block-actions-menu.native.js → block-toolbar/block-toolbar-menu.native.js} +10 -11
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -0
- package/build/components/block-toolbar/index.js +12 -8
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/index.native.js +62 -3
- package/build/components/block-toolbar/index.native.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +7 -11
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/colors-gradients/control.js +4 -2
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/dimensions-tool/aspect-ratio-tool.js +99 -0
- package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -0
- package/build/components/dimensions-tool/index.js +207 -0
- package/build/components/dimensions-tool/index.js.map +1 -0
- package/build/components/dimensions-tool/scale-tool.js +111 -0
- package/build/components/dimensions-tool/scale-tool.js.map +1 -0
- package/build/components/dimensions-tool/width-height-tool.js +125 -0
- package/build/components/dimensions-tool/width-height-tool.js.map +1 -0
- package/build/components/global-styles/color-panel.js +22 -16
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +13 -2
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +1 -1
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/get-block-css-selector.js +4 -8
- package/build/components/global-styles/get-block-css-selector.js.map +1 -1
- package/build/components/global-styles/hooks.js +15 -25
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +52 -5
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +12 -18
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +6 -6
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/iframe/index.js +36 -48
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/iframe/use-compatibility-styles.js +5 -0
- package/build/components/iframe/use-compatibility-styles.js.map +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build/components/image-editor/use-save-image.js +1 -2
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/image-size-control/index.js +6 -0
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/index.js +9 -0
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/index.js +3 -1
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/index.native.js +3 -1
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +33 -7
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/patterns-list.js +2 -2
- package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab.js +7 -35
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +3 -4
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +9 -3
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/index.js +2 -4
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js +21 -32
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/media-tab/hooks.js +2 -21
- package/build/components/inserter/media-tab/hooks.js.map +1 -1
- package/build/components/inserter/reusable-block-rename-hint.js +82 -0
- package/build/components/inserter/reusable-block-rename-hint.js.map +1 -0
- package/build/components/inserter/reusable-blocks-tab.js +6 -2
- package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.native.js +2 -2
- package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build/components/inserter/tabs.native.js +1 -1
- package/build/components/inserter/tabs.native.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +9 -1
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/link-control/constants.js +1 -1
- package/build/components/link-control/constants.js.map +1 -1
- package/build/components/link-control/index.js +21 -16
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/search-create-button.js +5 -21
- package/build/components/link-control/search-create-button.js.map +1 -1
- package/build/components/link-control/search-input.js +4 -4
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/search-item.js +13 -30
- package/build/components/link-control/search-item.js.map +1 -1
- package/build/components/link-control/search-results.js +2 -2
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/link-control/settings-drawer.js +2 -3
- package/build/components/link-control/settings-drawer.js.map +1 -1
- package/build/components/list-view/appender.js +2 -6
- package/build/components/list-view/appender.js.map +1 -1
- package/build/components/list-view/use-list-view-client-ids.js +2 -2
- package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build/components/media-placeholder/index.native.js +65 -31
- package/build/components/media-placeholder/index.native.js.map +1 -1
- package/build/components/preview-options/index.js +2 -2
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/provider/index.js +5 -2
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-sync.js +21 -0
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/resolution-tool/index.js +55 -0
- package/build/components/resolution-tool/index.js.map +1 -0
- package/build/components/rich-text/content.js +0 -36
- package/build/components/rich-text/content.js.map +1 -1
- package/build/components/rich-text/get-rich-text-values.js +118 -0
- package/build/components/rich-text/get-rich-text-values.js.map +1 -0
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/axial.js +6 -2
- package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/separated.js +5 -1
- package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/single.js +5 -1
- package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
- package/build/components/spacing-sizes-control/utils.js +1 -1
- package/build/components/spacing-sizes-control/utils.js.map +1 -1
- package/build/components/url-input/index.js +4 -2
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-display-information/index.js +7 -3
- package/build/components/use-block-display-information/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.native.js +49 -8
- package/build/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build/components/use-setting/index.js +5 -9
- package/build/components/use-setting/index.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +10 -27
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/components/writing-mode-control/index.js +70 -0
- package/build/components/writing-mode-control/index.js.map +1 -0
- package/build/hooks/behaviors.js +25 -20
- package/build/hooks/behaviors.js.map +1 -1
- package/build/hooks/margin.js +1 -1
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/padding.js +1 -1
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/supports.js +7 -1
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/typography.js +2 -1
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/utils.js +5 -9
- package/build/hooks/utils.js.map +1 -1
- package/build/private-apis.js +16 -3
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +3 -0
- package/build/private-apis.native.js.map +1 -1
- package/build/store/actions.js +196 -2
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +1 -0
- package/build/store/defaults.js.map +1 -1
- package/build/store/index.js +10 -1
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +46 -40
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +8 -9
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +22 -9
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +52 -23
- package/build/store/selectors.js.map +1 -1
- package/build/utils/object.js +38 -2
- package/build/utils/object.js.map +1 -1
- package/build-module/components/block-draggable/index.js +6 -3
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-draggable/index.native.js +2 -2
- package/build-module/components/block-draggable/index.native.js.map +1 -1
- package/build-module/components/block-edit/edit.js +27 -10
- package/build-module/components/block-edit/edit.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/heading-level-icon.js +9 -2
- package/build-module/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.native.js +4 -3
- package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
- package/build-module/components/block-list/block-outline.native.js +14 -18
- package/build-module/components/block-list/block-outline.native.js.map +1 -1
- package/build-module/components/block-list/block.native.js +24 -43
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-lock/toolbar.js +25 -7
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-mover/index.native.js +3 -3
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +7 -5
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +17 -24
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-settings/button.native.js +3 -3
- package/build-module/components/block-settings/button.native.js.map +1 -1
- package/build-module/components/{block-mobile-toolbar/block-actions-menu.native.js → block-toolbar/block-toolbar-menu.native.js} +13 -13
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -0
- package/build-module/components/block-toolbar/index.js +12 -8
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.native.js +60 -4
- package/build-module/components/block-toolbar/index.native.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +8 -11
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +3 -2
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/dimensions-tool/aspect-ratio-tool.js +87 -0
- package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -0
- package/build-module/components/dimensions-tool/index.js +195 -0
- package/build-module/components/dimensions-tool/index.js.map +1 -0
- package/build-module/components/dimensions-tool/scale-tool.js +103 -0
- package/build-module/components/dimensions-tool/scale-tool.js.map +1 -0
- package/build-module/components/dimensions-tool/width-height-tool.js +122 -0
- package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -0
- package/build-module/components/global-styles/color-panel.js +22 -16
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +13 -2
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +2 -2
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/get-block-css-selector.js +4 -8
- package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +14 -24
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +51 -5
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +13 -18
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +5 -5
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/iframe/index.js +37 -49
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/iframe/use-compatibility-styles.js +5 -0
- package/build-module/components/iframe/use-compatibility-styles.js.map +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build-module/components/image-editor/use-save-image.js +1 -2
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/image-size-control/index.js +5 -0
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/index.js +1 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +3 -1
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.native.js +3 -1
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js +30 -7
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +2 -2
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab.js +7 -33
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js +3 -4
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +9 -3
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/index.js +2 -4
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +22 -33
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/media-tab/hooks.js +2 -21
- package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
- package/build-module/components/inserter/reusable-block-rename-hint.js +67 -0
- package/build-module/components/inserter/reusable-block-rename-hint.js.map +1 -0
- package/build-module/components/inserter/reusable-blocks-tab.js +5 -2
- package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.native.js +2 -2
- package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build-module/components/inserter/tabs.native.js +1 -1
- package/build-module/components/inserter/tabs.native.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +9 -2
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/link-control/constants.js +1 -1
- package/build-module/components/link-control/constants.js.map +1 -1
- package/build-module/components/link-control/index.js +21 -16
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/search-create-button.js +7 -20
- package/build-module/components/link-control/search-create-button.js.map +1 -1
- package/build-module/components/link-control/search-input.js +4 -4
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/link-control/search-item.js +14 -28
- package/build-module/components/link-control/search-item.js.map +1 -1
- package/build-module/components/link-control/search-results.js +3 -3
- package/build-module/components/link-control/search-results.js.map +1 -1
- package/build-module/components/link-control/settings-drawer.js +4 -5
- package/build-module/components/link-control/settings-drawer.js.map +1 -1
- package/build-module/components/list-view/appender.js +2 -6
- package/build-module/components/list-view/appender.js.map +1 -1
- package/build-module/components/list-view/use-list-view-client-ids.js +2 -2
- package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build-module/components/media-placeholder/index.native.js +66 -33
- package/build-module/components/media-placeholder/index.native.js.map +1 -1
- package/build-module/components/preview-options/index.js +2 -2
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/provider/index.js +5 -2
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +21 -0
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/resolution-tool/index.js +45 -0
- package/build-module/components/resolution-tool/index.js.map +1 -0
- package/build-module/components/rich-text/content.js +1 -36
- package/build-module/components/rich-text/content.js.map +1 -1
- package/build-module/components/rich-text/get-rich-text-values.js +105 -0
- package/build-module/components/rich-text/get-rich-text-values.js.map +1 -0
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/axial.js +7 -3
- package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/separated.js +6 -2
- package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/single.js +6 -2
- package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -1
- package/build-module/components/spacing-sizes-control/utils.js +1 -1
- package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
- package/build-module/components/url-input/index.js +4 -2
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-display-information/index.js +7 -3
- package/build-module/components/use-block-display-information/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.native.js +50 -8
- package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build-module/components/use-setting/index.js +5 -9
- package/build-module/components/use-setting/index.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +8 -26
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/components/writing-mode-control/index.js +57 -0
- package/build-module/components/writing-mode-control/index.js.map +1 -0
- package/build-module/hooks/behaviors.js +26 -20
- package/build-module/hooks/behaviors.js.map +1 -1
- package/build-module/hooks/margin.js +1 -1
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/padding.js +1 -1
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/supports.js +7 -1
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/typography.js +2 -1
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/utils.js +6 -9
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/private-apis.js +11 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +2 -0
- package/build-module/private-apis.native.js.map +1 -1
- package/build-module/store/actions.js +193 -3
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +1 -0
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/index.js +10 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/private-actions.js +45 -36
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +5 -5
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +22 -9
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +49 -21
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/object.js +34 -2
- package/build-module/utils/object.js.map +1 -1
- package/build-style/content-rtl.css +4 -0
- package/build-style/content.css +4 -0
- package/build-style/style-rtl.css +137 -129
- package/build-style/style.css +137 -129
- package/package.json +33 -32
- package/src/components/alignment-control/test/__snapshots__/index.js.snap +6 -6
- package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +5 -5
- package/src/components/block-controls/README.md +89 -0
- package/src/components/block-draggable/index.js +13 -4
- package/src/components/block-draggable/index.native.js +7 -3
- package/src/components/block-draggable/style.scss +1 -0
- package/src/components/block-draggable/test/index.native.js +0 -54
- package/src/components/block-edit/edit.js +26 -9
- package/src/components/block-edit/test/edit.js +1 -1
- package/src/components/block-heading-level-dropdown/heading-level-icon.js +6 -1
- package/src/components/block-heading-level-dropdown/index.native.js +8 -4
- package/src/components/block-inspector/style.scss +2 -1
- package/src/components/block-list/block-outline.native.js +26 -25
- package/src/components/block-list/block.native.js +24 -38
- package/src/components/block-list/block.native.scss +18 -40
- package/src/components/block-list/style.native.scss +3 -3
- package/src/components/block-lock/toolbar.js +34 -6
- package/src/components/block-mover/index.native.js +3 -3
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +16 -6
- package/src/components/block-parent-selector/index.js +13 -8
- package/src/components/block-removal-warning-modal/index.js +17 -33
- package/src/components/block-settings/button.native.js +12 -6
- package/src/components/{block-mobile-toolbar/block-actions-menu.native.js → block-toolbar/block-toolbar-menu.native.js} +19 -18
- package/src/components/block-toolbar/index.js +11 -9
- package/src/components/block-toolbar/index.native.js +86 -6
- package/src/components/{block-mobile-toolbar/test/block-actions-menu.native.js → block-toolbar/test/block-toolbar-menu.native.js} +20 -54
- package/src/components/block-toolbar/test/index.native.js +42 -0
- package/src/components/block-tools/block-contextual-toolbar.js +5 -11
- package/src/components/block-tools/style.scss +73 -26
- package/src/components/button-block-appender/styles.native.scss +2 -2
- package/src/components/caption/README.md +49 -0
- package/src/components/colors-gradients/control.js +3 -2
- package/src/components/default-block-appender/content.scss +11 -0
- package/src/components/dimensions-tool/aspect-ratio-tool.js +124 -0
- package/src/components/dimensions-tool/index.js +212 -0
- package/src/components/dimensions-tool/scale-tool.js +124 -0
- package/src/components/dimensions-tool/stories/aspect-ratio-tool.js +52 -0
- package/src/components/dimensions-tool/stories/index.js +54 -0
- package/src/components/dimensions-tool/stories/scale-tool.js +48 -0
- package/src/components/dimensions-tool/stories/width-height-tool.js +54 -0
- package/src/components/dimensions-tool/test/index.js +641 -0
- package/src/components/dimensions-tool/width-height-tool.js +113 -0
- package/src/components/font-family/README.md +71 -0
- package/src/components/global-styles/color-panel.js +24 -17
- package/src/components/global-styles/dimensions-panel.js +8 -2
- package/src/components/global-styles/filters-panel.js +2 -2
- package/src/components/global-styles/get-block-css-selector.js +5 -9
- package/src/components/global-styles/hooks.js +22 -26
- package/src/components/global-styles/typography-panel.js +57 -5
- package/src/components/global-styles/use-global-styles-output.js +36 -18
- package/src/components/global-styles/utils.js +15 -6
- package/src/components/iframe/index.js +30 -56
- package/src/components/iframe/use-compatibility-styles.js +5 -0
- package/src/components/image-editor/aspect-ratio-dropdown.js +1 -1
- package/src/components/image-editor/use-save-image.js +0 -1
- package/src/components/image-size-control/index.js +6 -0
- package/src/components/index.js +1 -0
- package/src/components/inner-blocks/README.md +10 -0
- package/src/components/inner-blocks/index.js +4 -0
- package/src/components/inner-blocks/index.native.js +4 -0
- package/src/components/inner-blocks/use-nested-settings-update.js +32 -5
- package/src/components/inserter/block-patterns-explorer/patterns-list.js +8 -2
- package/src/components/inserter/block-patterns-tab.js +8 -56
- package/src/components/inserter/hooks/use-block-types-state.js +3 -4
- package/src/components/inserter/hooks/use-patterns-state.js +35 -19
- package/src/components/inserter/index.js +2 -3
- package/src/components/inserter/index.native.js +17 -36
- package/src/components/inserter/media-tab/hooks.js +2 -22
- package/src/components/inserter/reusable-block-rename-hint.js +69 -0
- package/src/components/inserter/reusable-blocks-tab.js +5 -1
- package/src/components/inserter/reusable-blocks-tab.native.js +2 -2
- package/src/components/inserter/style.native.scss +10 -15
- package/src/components/inserter/style.scss +28 -0
- package/src/components/inserter/tabs.native.js +5 -1
- package/src/components/inserter-draggable-blocks/index.js +13 -2
- package/src/components/link-control/constants.js +1 -1
- package/src/components/link-control/index.js +36 -29
- package/src/components/link-control/search-create-button.js +8 -26
- package/src/components/link-control/search-input.js +4 -3
- package/src/components/link-control/search-item.js +21 -43
- package/src/components/link-control/search-results.js +48 -46
- package/src/components/link-control/settings-drawer.js +6 -5
- package/src/components/link-control/style.scss +58 -123
- package/src/components/link-control/test/index.js +161 -123
- package/src/components/list-view/appender.js +5 -6
- package/src/components/list-view/style.scss +1 -2
- package/src/components/list-view/use-list-view-client-ids.js +2 -2
- package/src/components/media-placeholder/index.native.js +108 -59
- package/src/components/media-placeholder/styles.native.scss +59 -24
- package/src/components/media-replace-flow/test/index.js +1 -1
- package/src/components/panel-color-settings/README.md +98 -0
- package/src/components/preview-options/README.md +18 -17
- package/src/components/preview-options/index.js +2 -2
- package/src/components/provider/index.js +9 -2
- package/src/components/provider/test/use-block-sync.js +21 -6
- package/src/components/provider/use-block-sync.js +19 -0
- package/src/components/recursion-provider/README.md +101 -0
- package/src/components/resolution-tool/index.js +56 -0
- package/src/components/resolution-tool/stories/index.js +48 -0
- package/src/components/rich-text/content.js +1 -46
- package/src/components/rich-text/get-rich-text-values.js +105 -0
- package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
- package/src/components/spacing-sizes-control/input-controls/axial.js +17 -2
- package/src/components/spacing-sizes-control/input-controls/separated.js +17 -2
- package/src/components/spacing-sizes-control/input-controls/single.js +12 -2
- package/src/components/spacing-sizes-control/utils.js +1 -1
- package/src/components/text-transform-control/README.md +44 -0
- package/src/components/url-input/index.js +2 -0
- package/src/components/use-block-display-information/index.js +12 -5
- package/src/components/use-block-drop-zone/index.native.js +65 -28
- package/src/components/use-setting/index.js +8 -8
- package/src/components/writing-flow/use-tab-nav.js +10 -33
- package/src/components/writing-mode-control/index.js +68 -0
- package/src/components/writing-mode-control/style.scss +18 -0
- package/src/hooks/behaviors.js +25 -16
- package/src/hooks/margin.js +4 -1
- package/src/hooks/padding.js +4 -1
- package/src/hooks/supports.js +7 -0
- package/src/hooks/typography.js +2 -0
- package/src/hooks/utils.js +8 -7
- package/src/private-apis.js +13 -1
- package/src/private-apis.native.js +2 -0
- package/src/store/actions.js +195 -3
- package/src/store/defaults.js +1 -0
- package/src/store/index.js +10 -0
- package/src/store/private-actions.js +39 -39
- package/src/store/private-selectors.js +5 -8
- package/src/store/reducer.js +22 -9
- package/src/store/selectors.js +87 -25
- package/src/store/test/actions.js +114 -0
- package/src/store/test/private-actions.js +56 -0
- package/src/store/test/private-selectors.js +5 -5
- package/src/store/test/reducer.js +14 -7
- package/src/store/test/selectors.js +1 -1
- package/src/utils/object.js +32 -2
- package/src/utils/test/object.js +36 -0
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +0 -1
- package/build/components/block-mobile-toolbar/index.native.js +0 -135
- package/build/components/block-mobile-toolbar/index.native.js.map +0 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +0 -1
- package/build-module/components/block-mobile-toolbar/index.native.js +0 -116
- package/build-module/components/block-mobile-toolbar/index.native.js.map +0 -1
- package/src/components/block-mobile-toolbar/index.native.js +0 -127
- package/src/components/block-mobile-toolbar/style.native.scss +0 -16
- /package/src/components/{block-mobile-toolbar/test/__snapshots__/block-actions-menu.native.js.snap → block-toolbar/test/__snapshots__/block-toolbar-menu.native.js.snap} +0 -0
|
@@ -138,7 +138,7 @@ describe( 'Basic rendering', () => {
|
|
|
138
138
|
render( <LinkControl /> );
|
|
139
139
|
|
|
140
140
|
// Search Input UI.
|
|
141
|
-
const searchInput = screen.getByRole( 'combobox', { name: '
|
|
141
|
+
const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
142
142
|
|
|
143
143
|
expect( searchInput ).toBeVisible();
|
|
144
144
|
} );
|
|
@@ -147,7 +147,7 @@ describe( 'Basic rendering', () => {
|
|
|
147
147
|
render( <LinkControl /> );
|
|
148
148
|
|
|
149
149
|
// Search Input UI.
|
|
150
|
-
const searchInput = screen.getByRole( 'combobox', { name: '
|
|
150
|
+
const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
151
151
|
|
|
152
152
|
expect( searchInput ).toBeVisible();
|
|
153
153
|
// Make sure we use the ARIA 1.0 pattern with aria-owns.
|
|
@@ -170,7 +170,7 @@ describe( 'Basic rendering', () => {
|
|
|
170
170
|
render( <LinkControl /> );
|
|
171
171
|
|
|
172
172
|
// Search Input UI.
|
|
173
|
-
const searchInput = screen.getByRole( 'combobox', { name: '
|
|
173
|
+
const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
174
174
|
|
|
175
175
|
// Simulate searching for a term.
|
|
176
176
|
await user.type( searchInput, 'Hello' );
|
|
@@ -283,7 +283,7 @@ describe( 'Basic rendering', () => {
|
|
|
283
283
|
render( <LinkControl /> );
|
|
284
284
|
|
|
285
285
|
// Search Input UI.
|
|
286
|
-
const searchInput = screen.getByRole( 'combobox', { name: '
|
|
286
|
+
const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
287
287
|
|
|
288
288
|
// Simulate searching for a term.
|
|
289
289
|
await user.type( searchInput, searchTerm );
|
|
@@ -296,7 +296,7 @@ describe( 'Basic rendering', () => {
|
|
|
296
296
|
render( <LinkControl value={ { url: 'https://example.com' } } /> );
|
|
297
297
|
|
|
298
298
|
expect(
|
|
299
|
-
screen.queryByRole( 'combobox', { name: '
|
|
299
|
+
screen.queryByRole( 'combobox', { name: 'Link' } )
|
|
300
300
|
).not.toBeInTheDocument();
|
|
301
301
|
} );
|
|
302
302
|
|
|
@@ -309,7 +309,7 @@ describe( 'Basic rendering', () => {
|
|
|
309
309
|
);
|
|
310
310
|
|
|
311
311
|
expect(
|
|
312
|
-
screen.getByRole( 'combobox', { name: '
|
|
312
|
+
screen.getByRole( 'combobox', { name: 'Link' } )
|
|
313
313
|
).toBeVisible();
|
|
314
314
|
} );
|
|
315
315
|
|
|
@@ -327,7 +327,7 @@ describe( 'Basic rendering', () => {
|
|
|
327
327
|
await user.click( editButton );
|
|
328
328
|
|
|
329
329
|
expect(
|
|
330
|
-
screen.getByRole( 'combobox', { name: '
|
|
330
|
+
screen.getByRole( 'combobox', { name: 'Link' } )
|
|
331
331
|
).toBeVisible();
|
|
332
332
|
|
|
333
333
|
// If passed `forceIsEditingLink` of `false` while editing, should
|
|
@@ -340,7 +340,7 @@ describe( 'Basic rendering', () => {
|
|
|
340
340
|
);
|
|
341
341
|
|
|
342
342
|
expect(
|
|
343
|
-
screen.queryByRole( 'combobox', { name: '
|
|
343
|
+
screen.queryByRole( 'combobox', { name: 'Link' } )
|
|
344
344
|
).not.toBeInTheDocument();
|
|
345
345
|
} );
|
|
346
346
|
|
|
@@ -405,6 +405,32 @@ describe( 'Basic rendering', () => {
|
|
|
405
405
|
|
|
406
406
|
expect( mockOnRemove ).toHaveBeenCalled();
|
|
407
407
|
} );
|
|
408
|
+
|
|
409
|
+
it( 'should revert to "editing" mode when onRemove is triggered', async () => {
|
|
410
|
+
const user = userEvent.setup();
|
|
411
|
+
const mockOnRemove = jest.fn();
|
|
412
|
+
|
|
413
|
+
render(
|
|
414
|
+
<LinkControl
|
|
415
|
+
value={ { url: 'https://example.com' } }
|
|
416
|
+
onRemove={ mockOnRemove }
|
|
417
|
+
/>
|
|
418
|
+
);
|
|
419
|
+
|
|
420
|
+
const unLinkButton = screen.queryByRole( 'button', {
|
|
421
|
+
name: 'Unlink',
|
|
422
|
+
} );
|
|
423
|
+
expect( unLinkButton ).toBeVisible();
|
|
424
|
+
|
|
425
|
+
await user.click( unLinkButton );
|
|
426
|
+
|
|
427
|
+
expect( mockOnRemove ).toHaveBeenCalled();
|
|
428
|
+
|
|
429
|
+
// Should revert back to editing mode.
|
|
430
|
+
expect(
|
|
431
|
+
screen.getByRole( 'combobox', { name: 'Link' } )
|
|
432
|
+
).toBeVisible();
|
|
433
|
+
} );
|
|
408
434
|
} );
|
|
409
435
|
} );
|
|
410
436
|
|
|
@@ -424,7 +450,7 @@ describe( 'Searching for a link', () => {
|
|
|
424
450
|
render( <LinkControl /> );
|
|
425
451
|
|
|
426
452
|
// Search Input UI.
|
|
427
|
-
const searchInput = screen.getByRole( 'combobox', { name: '
|
|
453
|
+
const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
428
454
|
|
|
429
455
|
// Simulate searching for a term.
|
|
430
456
|
await user.type( searchInput, searchTerm );
|
|
@@ -448,7 +474,9 @@ describe( 'Searching for a link', () => {
|
|
|
448
474
|
render( <LinkControl /> );
|
|
449
475
|
|
|
450
476
|
// Search Input UI.
|
|
451
|
-
const searchInput = screen.getByRole( 'combobox', {
|
|
477
|
+
const searchInput = screen.getByRole( 'combobox', {
|
|
478
|
+
name: 'Link',
|
|
479
|
+
} );
|
|
452
480
|
|
|
453
481
|
// Simulate searching for a term.
|
|
454
482
|
await user.type( searchInput, searchTerm );
|
|
@@ -476,16 +504,16 @@ describe( 'Searching for a link', () => {
|
|
|
476
504
|
// The fallback URL suggestion should not be shown when input is not URL-like.
|
|
477
505
|
expect(
|
|
478
506
|
searchResultElements[ searchResultElements.length - 1 ]
|
|
479
|
-
).not.toHaveTextContent( '
|
|
507
|
+
).not.toHaveTextContent( 'Press ENTER to add this link' );
|
|
480
508
|
}
|
|
481
509
|
);
|
|
482
510
|
|
|
483
511
|
it.each( [
|
|
484
|
-
[ 'https://wordpress.org', '
|
|
485
|
-
[ 'http://wordpress.org', '
|
|
486
|
-
[ 'www.wordpress.org', '
|
|
487
|
-
[ 'wordpress.org', '
|
|
488
|
-
[ 'ftp://wordpress.org', '
|
|
512
|
+
[ 'https://wordpress.org', 'link' ],
|
|
513
|
+
[ 'http://wordpress.org', 'link' ],
|
|
514
|
+
[ 'www.wordpress.org', 'link' ],
|
|
515
|
+
[ 'wordpress.org', 'link' ],
|
|
516
|
+
[ 'ftp://wordpress.org', 'link' ],
|
|
489
517
|
[ 'mailto:hello@wordpress.org', 'mailto' ],
|
|
490
518
|
[ 'tel:123456789', 'tel' ],
|
|
491
519
|
[ '#internal', 'internal' ],
|
|
@@ -497,7 +525,9 @@ describe( 'Searching for a link', () => {
|
|
|
497
525
|
render( <LinkControl /> );
|
|
498
526
|
|
|
499
527
|
// Search Input UI.
|
|
500
|
-
const searchInput = screen.getByRole( 'combobox', {
|
|
528
|
+
const searchInput = screen.getByRole( 'combobox', {
|
|
529
|
+
name: 'Link',
|
|
530
|
+
} );
|
|
501
531
|
|
|
502
532
|
// Simulate searching for a term.
|
|
503
533
|
await user.type( searchInput, searchTerm );
|
|
@@ -528,7 +558,7 @@ describe( 'Searching for a link', () => {
|
|
|
528
558
|
render( <LinkControl /> );
|
|
529
559
|
|
|
530
560
|
// Search Input UI.
|
|
531
|
-
const searchInput = screen.getByRole( 'combobox', { name: '
|
|
561
|
+
const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
532
562
|
|
|
533
563
|
// Simulate searching for a term.
|
|
534
564
|
await user.type( searchInput, searchTerm );
|
|
@@ -571,7 +601,7 @@ describe( 'Searching for a link', () => {
|
|
|
571
601
|
render( <LinkControl showSuggestions={ false } /> );
|
|
572
602
|
|
|
573
603
|
// Search Input UI.
|
|
574
|
-
const searchInput = screen.getByRole( 'combobox', { name: '
|
|
604
|
+
const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
575
605
|
|
|
576
606
|
// Simulate searching for a term.
|
|
577
607
|
await user.type( searchInput, 'anything' );
|
|
@@ -582,12 +612,43 @@ describe( 'Searching for a link', () => {
|
|
|
582
612
|
expect( mockFetchSearchSuggestions ).not.toHaveBeenCalled();
|
|
583
613
|
} );
|
|
584
614
|
|
|
615
|
+
it( 'should not display a URL suggestion when input is not likely to be a URL.', async () => {
|
|
616
|
+
const searchTerm = 'unlikelytobeaURL';
|
|
617
|
+
const user = userEvent.setup();
|
|
618
|
+
render( <LinkControl /> );
|
|
619
|
+
|
|
620
|
+
// Search Input UI.
|
|
621
|
+
const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
622
|
+
|
|
623
|
+
// Simulate searching for a term.
|
|
624
|
+
await user.type( searchInput, searchTerm );
|
|
625
|
+
|
|
626
|
+
const searchResultElements = within(
|
|
627
|
+
await screen.findByRole( 'listbox', {
|
|
628
|
+
name: /Search results for.*/,
|
|
629
|
+
} )
|
|
630
|
+
).getAllByRole( 'option' );
|
|
631
|
+
|
|
632
|
+
const lastSearchResultItem =
|
|
633
|
+
searchResultElements[ searchResultElements.length - 1 ];
|
|
634
|
+
|
|
635
|
+
// We should see a search result for each of the expect search suggestions.
|
|
636
|
+
expect( searchResultElements ).toHaveLength(
|
|
637
|
+
fauxEntitySuggestions.length
|
|
638
|
+
);
|
|
639
|
+
|
|
640
|
+
// The URL search suggestion should not exist.
|
|
641
|
+
expect( lastSearchResultItem ).not.toHaveTextContent(
|
|
642
|
+
'Press ENTER to add this link'
|
|
643
|
+
);
|
|
644
|
+
} );
|
|
645
|
+
|
|
585
646
|
it( 'should not display a URL suggestion as a default fallback when noURLSuggestion is passed.', async () => {
|
|
586
647
|
const user = userEvent.setup();
|
|
587
648
|
render( <LinkControl noURLSuggestion /> );
|
|
588
649
|
|
|
589
650
|
// Search Input UI.
|
|
590
|
-
const searchInput = screen.getByRole( 'combobox', { name: '
|
|
651
|
+
const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
591
652
|
|
|
592
653
|
// Simulate searching for a term.
|
|
593
654
|
await user.type( searchInput, 'couldbeurlorentitysearchterm' );
|
|
@@ -617,7 +678,9 @@ describe( 'Manual link entry', () => {
|
|
|
617
678
|
render( <LinkControl /> );
|
|
618
679
|
|
|
619
680
|
// Search Input UI.
|
|
620
|
-
const searchInput = screen.getByRole( 'combobox', {
|
|
681
|
+
const searchInput = screen.getByRole( 'combobox', {
|
|
682
|
+
name: 'Link',
|
|
683
|
+
} );
|
|
621
684
|
|
|
622
685
|
// Simulate searching for a term.
|
|
623
686
|
await user.type( searchInput, searchTerm );
|
|
@@ -630,7 +693,6 @@ describe( 'Manual link entry', () => {
|
|
|
630
693
|
|
|
631
694
|
expect( searchResultElements ).toBeVisible();
|
|
632
695
|
expect( searchResultElements ).toHaveTextContent( searchTerm );
|
|
633
|
-
expect( searchResultElements ).toHaveTextContent( 'URL' );
|
|
634
696
|
expect( searchResultElements ).toHaveTextContent(
|
|
635
697
|
'Press ENTER to add this link'
|
|
636
698
|
);
|
|
@@ -653,19 +715,9 @@ describe( 'Manual link entry', () => {
|
|
|
653
715
|
|
|
654
716
|
// Search Input UI.
|
|
655
717
|
const searchInput = screen.getByRole( 'combobox', {
|
|
656
|
-
name: '
|
|
657
|
-
} );
|
|
658
|
-
|
|
659
|
-
let submitButton = screen.getByRole( 'button', {
|
|
660
|
-
name: 'Save',
|
|
718
|
+
name: 'Link',
|
|
661
719
|
} );
|
|
662
720
|
|
|
663
|
-
expect( submitButton ).toHaveAttribute(
|
|
664
|
-
'aria-disabled',
|
|
665
|
-
'true'
|
|
666
|
-
);
|
|
667
|
-
expect( submitButton ).toBeVisible();
|
|
668
|
-
|
|
669
721
|
if ( searchString.length ) {
|
|
670
722
|
// Simulate searching for a term.
|
|
671
723
|
await user.type( searchInput, searchString );
|
|
@@ -677,102 +729,74 @@ describe( 'Manual link entry', () => {
|
|
|
677
729
|
// Attempt to submit the empty search value in the input.
|
|
678
730
|
await user.keyboard( '[Enter]' );
|
|
679
731
|
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
} );
|
|
683
|
-
|
|
684
|
-
// Verify the UI hasn't allowed submission.
|
|
732
|
+
// Verify the UI hasn't allowed submission because
|
|
733
|
+
// the search input is still visible.
|
|
685
734
|
expect( searchInput ).toBeVisible();
|
|
686
|
-
expect( submitButton ).toHaveAttribute(
|
|
687
|
-
'aria-disabled',
|
|
688
|
-
'true'
|
|
689
|
-
);
|
|
690
|
-
expect( submitButton ).toBeVisible();
|
|
691
735
|
}
|
|
692
736
|
);
|
|
693
737
|
|
|
694
738
|
it.each( testTable )(
|
|
695
|
-
'should not allow
|
|
739
|
+
'should not allow editing of links to a new link %s via the UI "submit" button',
|
|
696
740
|
async ( _desc, searchString ) => {
|
|
697
741
|
const user = userEvent.setup();
|
|
698
742
|
|
|
699
|
-
render(
|
|
743
|
+
render(
|
|
744
|
+
<LinkControl
|
|
745
|
+
value={ fauxEntitySuggestions[ 0 ] }
|
|
746
|
+
forceIsEditingLink
|
|
747
|
+
/>
|
|
748
|
+
);
|
|
700
749
|
|
|
701
750
|
// Search Input UI.
|
|
702
751
|
const searchInput = screen.getByRole( 'combobox', {
|
|
703
|
-
name: '
|
|
752
|
+
name: 'Link',
|
|
704
753
|
} );
|
|
705
754
|
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
} );
|
|
755
|
+
// Remove the existing link.
|
|
756
|
+
await user.clear( searchInput );
|
|
709
757
|
|
|
710
|
-
expect( submitButton ).toHaveAttribute(
|
|
711
|
-
'aria-disabled',
|
|
712
|
-
'true'
|
|
713
|
-
);
|
|
714
|
-
expect( submitButton ).toBeVisible();
|
|
715
|
-
|
|
716
|
-
// Simulate searching for a term.
|
|
717
758
|
if ( searchString.length ) {
|
|
718
|
-
// Simulate searching for a term.
|
|
719
759
|
await user.type( searchInput, searchString );
|
|
720
760
|
} else {
|
|
721
761
|
// Simulate clearing the search term.
|
|
722
762
|
await user.clear( searchInput );
|
|
723
763
|
}
|
|
724
764
|
|
|
725
|
-
|
|
726
|
-
await user.click( submitButton );
|
|
727
|
-
|
|
728
|
-
submitButton = screen.queryByRole( 'button', {
|
|
765
|
+
const submitButton = screen.queryByRole( 'button', {
|
|
729
766
|
name: 'Save',
|
|
730
767
|
} );
|
|
731
768
|
|
|
732
|
-
//
|
|
733
|
-
|
|
769
|
+
// debug the UI state
|
|
770
|
+
// screen.debug();
|
|
771
|
+
|
|
772
|
+
// Verify the submission UI is disabled.
|
|
773
|
+
expect( submitButton ).toBeVisible();
|
|
734
774
|
expect( submitButton ).toHaveAttribute(
|
|
735
775
|
'aria-disabled',
|
|
736
776
|
'true'
|
|
737
777
|
);
|
|
738
|
-
|
|
778
|
+
|
|
779
|
+
// Attempt to submit the empty search value in the input.
|
|
780
|
+
await user.click( submitButton );
|
|
781
|
+
|
|
782
|
+
// Verify the UI hasn't allowed submission because
|
|
783
|
+
// the search input is still visible.
|
|
784
|
+
expect( searchInput ).toBeVisible();
|
|
739
785
|
}
|
|
740
786
|
);
|
|
741
787
|
} );
|
|
742
788
|
|
|
743
789
|
describe( 'Handling cancellation', () => {
|
|
744
|
-
it( 'should
|
|
745
|
-
const user = userEvent.setup();
|
|
790
|
+
it( 'should not show cancellation button during link creation', async () => {
|
|
746
791
|
const mockOnRemove = jest.fn();
|
|
747
|
-
const mockOnCancel = jest.fn();
|
|
748
792
|
|
|
749
793
|
render( <LinkControl onRemove={ mockOnRemove } /> );
|
|
750
794
|
|
|
751
|
-
// Search Input UI.
|
|
752
|
-
const searchInput = screen.getByRole( 'combobox', {
|
|
753
|
-
name: 'URL',
|
|
754
|
-
} );
|
|
755
|
-
|
|
756
795
|
const cancelButton = screen.queryByRole( 'button', {
|
|
757
796
|
name: 'Cancel',
|
|
758
797
|
} );
|
|
759
798
|
|
|
760
|
-
expect( cancelButton ).
|
|
761
|
-
expect( cancelButton ).toBeVisible();
|
|
762
|
-
|
|
763
|
-
// Simulate adding a link for a term.
|
|
764
|
-
await user.type( searchInput, 'https://www.wordpress.org' );
|
|
765
|
-
|
|
766
|
-
// Attempt to submit the empty search value in the input.
|
|
767
|
-
await user.click( cancelButton );
|
|
768
|
-
|
|
769
|
-
// Verify the consumer can handle the cancellation.
|
|
770
|
-
expect( mockOnRemove ).toHaveBeenCalled();
|
|
771
|
-
|
|
772
|
-
// Ensure optional callback is not called.
|
|
773
|
-
expect( mockOnCancel ).not.toHaveBeenCalled();
|
|
774
|
-
|
|
775
|
-
expect( searchInput ).toHaveValue( '' );
|
|
799
|
+
expect( cancelButton ).not.toBeInTheDocument();
|
|
776
800
|
} );
|
|
777
801
|
|
|
778
802
|
it( 'should allow cancellation of the link editing process and reset any entered values', async () => {
|
|
@@ -809,7 +833,7 @@ describe( 'Manual link entry', () => {
|
|
|
809
833
|
await toggleSettingsDrawer( user );
|
|
810
834
|
|
|
811
835
|
let searchInput = screen.getByRole( 'combobox', {
|
|
812
|
-
name: '
|
|
836
|
+
name: 'Link',
|
|
813
837
|
} );
|
|
814
838
|
|
|
815
839
|
let textInput = screen.getByRole( 'textbox', {
|
|
@@ -844,7 +868,7 @@ describe( 'Manual link entry', () => {
|
|
|
844
868
|
|
|
845
869
|
// Re-query the inputs as they have been replaced.
|
|
846
870
|
searchInput = screen.getByRole( 'combobox', {
|
|
847
|
-
name: '
|
|
871
|
+
name: 'Link',
|
|
848
872
|
} );
|
|
849
873
|
|
|
850
874
|
textInput = screen.getByRole( 'textbox', {
|
|
@@ -860,7 +884,13 @@ describe( 'Manual link entry', () => {
|
|
|
860
884
|
const user = userEvent.setup();
|
|
861
885
|
const mockOnCancel = jest.fn();
|
|
862
886
|
|
|
863
|
-
render(
|
|
887
|
+
render(
|
|
888
|
+
<LinkControl
|
|
889
|
+
value={ fauxEntitySuggestions[ 0 ] }
|
|
890
|
+
onCancel={ mockOnCancel }
|
|
891
|
+
forceIsEditingLink
|
|
892
|
+
/>
|
|
893
|
+
);
|
|
864
894
|
|
|
865
895
|
const cancelButton = screen.queryByRole( 'button', {
|
|
866
896
|
name: 'Cancel',
|
|
@@ -886,7 +916,7 @@ describe( 'Manual link entry', () => {
|
|
|
886
916
|
|
|
887
917
|
// Search Input UI.
|
|
888
918
|
const searchInput = screen.getByRole( 'combobox', {
|
|
889
|
-
name: '
|
|
919
|
+
name: 'Link',
|
|
890
920
|
} );
|
|
891
921
|
|
|
892
922
|
// Simulate searching for a term.
|
|
@@ -922,7 +952,7 @@ describe( 'Default search suggestions', () => {
|
|
|
922
952
|
// Verify input has no value has default suggestions should only show
|
|
923
953
|
// when this does not have a value.
|
|
924
954
|
// Search Input UI.
|
|
925
|
-
expect( screen.getByRole( 'combobox', { name: '
|
|
955
|
+
expect( screen.getByRole( 'combobox', { name: 'Link' } ) ).toHaveValue(
|
|
926
956
|
''
|
|
927
957
|
);
|
|
928
958
|
|
|
@@ -951,7 +981,7 @@ describe( 'Default search suggestions', () => {
|
|
|
951
981
|
} );
|
|
952
982
|
await user.click( currentLinkBtn );
|
|
953
983
|
|
|
954
|
-
const searchInput = screen.getByRole( 'combobox', { name: '
|
|
984
|
+
const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
955
985
|
|
|
956
986
|
// Search input is set to the URL value.
|
|
957
987
|
expect( searchInput ).toHaveValue( initialValue.url );
|
|
@@ -973,7 +1003,7 @@ describe( 'Default search suggestions', () => {
|
|
|
973
1003
|
render( <LinkControl showInitialSuggestions /> );
|
|
974
1004
|
|
|
975
1005
|
// Search Input UI.
|
|
976
|
-
const searchInput = screen.getByRole( 'combobox', { name: '
|
|
1006
|
+
const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
977
1007
|
|
|
978
1008
|
// Simulate searching for a term.
|
|
979
1009
|
await user.type( searchInput, searchTerm );
|
|
@@ -1011,7 +1041,7 @@ describe( 'Default search suggestions', () => {
|
|
|
1011
1041
|
|
|
1012
1042
|
render( <LinkControl showInitialSuggestions /> );
|
|
1013
1043
|
|
|
1014
|
-
const searchInput = screen.getByRole( 'combobox', { name: '
|
|
1044
|
+
const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
1015
1045
|
|
|
1016
1046
|
const searchResultsField = screen.queryByRole( 'listbox', {
|
|
1017
1047
|
name: 'Suggestions',
|
|
@@ -1069,7 +1099,9 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1069
1099
|
render( <LinkControlConsumer /> );
|
|
1070
1100
|
|
|
1071
1101
|
// Search Input UI.
|
|
1072
|
-
const searchInput = screen.getByRole( 'combobox', {
|
|
1102
|
+
const searchInput = screen.getByRole( 'combobox', {
|
|
1103
|
+
name: 'Link',
|
|
1104
|
+
} );
|
|
1073
1105
|
|
|
1074
1106
|
// Simulate searching for a term.
|
|
1075
1107
|
await user.type( searchInput, entityNameText );
|
|
@@ -1136,7 +1168,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1136
1168
|
render( <LinkControlConsumer /> );
|
|
1137
1169
|
|
|
1138
1170
|
// Search Input UI.
|
|
1139
|
-
const searchInput = screen.getByRole( 'combobox', { name: '
|
|
1171
|
+
const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
1140
1172
|
|
|
1141
1173
|
// Simulate searching for a term.
|
|
1142
1174
|
await user.type( searchInput, 'Some new page to create' );
|
|
@@ -1185,7 +1217,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1185
1217
|
render( <LinkControlConsumer /> );
|
|
1186
1218
|
|
|
1187
1219
|
// Search Input UI.
|
|
1188
|
-
const searchInput = screen.getByRole( 'combobox', { name: '
|
|
1220
|
+
const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
1189
1221
|
|
|
1190
1222
|
// Simulate searching for a term.
|
|
1191
1223
|
await user.type( searchInput, entityNameText );
|
|
@@ -1228,7 +1260,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1228
1260
|
render( <LinkControlConsumer /> );
|
|
1229
1261
|
|
|
1230
1262
|
// Search Input UI.
|
|
1231
|
-
const searchInput = screen.getByRole( 'combobox', { name: '
|
|
1263
|
+
const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
1232
1264
|
|
|
1233
1265
|
// Simulate searching for a term.
|
|
1234
1266
|
await user.type( searchInput, entityNameText );
|
|
@@ -1252,7 +1284,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1252
1284
|
|
|
1253
1285
|
// Search Input UI.
|
|
1254
1286
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1255
|
-
name: '
|
|
1287
|
+
name: 'Link',
|
|
1256
1288
|
} );
|
|
1257
1289
|
|
|
1258
1290
|
const searchResultsField = screen.queryByRole( 'listbox' );
|
|
@@ -1272,7 +1304,9 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1272
1304
|
);
|
|
1273
1305
|
|
|
1274
1306
|
// Search Input UI.
|
|
1275
|
-
const searchInput = screen.getByRole( 'combobox', {
|
|
1307
|
+
const searchInput = screen.getByRole( 'combobox', {
|
|
1308
|
+
name: 'Link',
|
|
1309
|
+
} );
|
|
1276
1310
|
|
|
1277
1311
|
const searchResultsField = screen.queryByRole( 'listbox' );
|
|
1278
1312
|
|
|
@@ -1295,7 +1329,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1295
1329
|
|
|
1296
1330
|
// Search Input UI.
|
|
1297
1331
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1298
|
-
name: '
|
|
1332
|
+
name: 'Link',
|
|
1299
1333
|
} );
|
|
1300
1334
|
|
|
1301
1335
|
// Simulate searching for a term.
|
|
@@ -1329,7 +1363,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1329
1363
|
render( <LinkControl createSuggestion={ createSuggestion } /> );
|
|
1330
1364
|
|
|
1331
1365
|
// Search Input UI.
|
|
1332
|
-
searchInput = screen.getByRole( 'combobox', { name: '
|
|
1366
|
+
searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
1333
1367
|
|
|
1334
1368
|
// Simulate searching for a term.
|
|
1335
1369
|
await user.type( searchInput, searchText );
|
|
@@ -1344,7 +1378,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1344
1378
|
|
|
1345
1379
|
await user.click( createButton );
|
|
1346
1380
|
|
|
1347
|
-
searchInput = screen.getByRole( 'combobox', { name: '
|
|
1381
|
+
searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
1348
1382
|
|
|
1349
1383
|
const errorNotice = screen.getAllByText(
|
|
1350
1384
|
'API response returned invalid entity.'
|
|
@@ -1417,7 +1451,7 @@ describe( 'Selecting links', () => {
|
|
|
1417
1451
|
// Simulate searching for a term.
|
|
1418
1452
|
await user.click( currentLinkBtn );
|
|
1419
1453
|
|
|
1420
|
-
const searchInput = screen.getByRole( 'combobox', { name: '
|
|
1454
|
+
const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
1421
1455
|
currentLinkUI = screen.queryByLabelText( 'Currently selected' );
|
|
1422
1456
|
|
|
1423
1457
|
// We should be back to showing the search input.
|
|
@@ -1458,7 +1492,7 @@ describe( 'Selecting links', () => {
|
|
|
1458
1492
|
|
|
1459
1493
|
// Search Input UI.
|
|
1460
1494
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1461
|
-
name: '
|
|
1495
|
+
name: 'Link',
|
|
1462
1496
|
} );
|
|
1463
1497
|
|
|
1464
1498
|
// Simulate searching for a term.
|
|
@@ -1520,7 +1554,7 @@ describe( 'Selecting links', () => {
|
|
|
1520
1554
|
|
|
1521
1555
|
// Search Input UI.
|
|
1522
1556
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1523
|
-
name: '
|
|
1557
|
+
name: 'Link',
|
|
1524
1558
|
} );
|
|
1525
1559
|
|
|
1526
1560
|
// Simulate searching for a term.
|
|
@@ -1609,7 +1643,9 @@ describe( 'Selecting links', () => {
|
|
|
1609
1643
|
).toBeVisible();
|
|
1610
1644
|
|
|
1611
1645
|
// Search Input UI.
|
|
1612
|
-
const searchInput = screen.getByRole( 'combobox', {
|
|
1646
|
+
const searchInput = screen.getByRole( 'combobox', {
|
|
1647
|
+
name: 'Link',
|
|
1648
|
+
} );
|
|
1613
1649
|
|
|
1614
1650
|
// Step down into the search results, highlighting the first result item.
|
|
1615
1651
|
triggerArrowDown( searchInput );
|
|
@@ -1665,7 +1701,9 @@ describe( 'Selecting links', () => {
|
|
|
1665
1701
|
render( <LinkControl value={ selectedLink } forceIsEditingLink /> );
|
|
1666
1702
|
|
|
1667
1703
|
// focus the search input
|
|
1668
|
-
const searchInput = screen.getByRole( 'combobox', {
|
|
1704
|
+
const searchInput = screen.getByRole( 'combobox', {
|
|
1705
|
+
name: 'Link',
|
|
1706
|
+
} );
|
|
1669
1707
|
|
|
1670
1708
|
fireEvent.focus( searchInput );
|
|
1671
1709
|
|
|
@@ -1707,10 +1745,7 @@ describe( 'Addition Settings UI', () => {
|
|
|
1707
1745
|
|
|
1708
1746
|
render( <LinkControlConsumer /> );
|
|
1709
1747
|
|
|
1710
|
-
const settingsToggle =
|
|
1711
|
-
name: 'Link Settings',
|
|
1712
|
-
ariaControls: 'link-settings-1',
|
|
1713
|
-
} );
|
|
1748
|
+
const settingsToggle = getSettingsDrawerToggle();
|
|
1714
1749
|
|
|
1715
1750
|
expect( settingsToggle ).not.toBeInTheDocument();
|
|
1716
1751
|
} );
|
|
@@ -1727,10 +1762,7 @@ describe( 'Addition Settings UI', () => {
|
|
|
1727
1762
|
|
|
1728
1763
|
const user = userEvent.setup();
|
|
1729
1764
|
|
|
1730
|
-
const settingsToggle =
|
|
1731
|
-
name: 'Link Settings',
|
|
1732
|
-
ariaControls: 'link-settings-1',
|
|
1733
|
-
} );
|
|
1765
|
+
const settingsToggle = getSettingsDrawerToggle();
|
|
1734
1766
|
|
|
1735
1767
|
expect( settingsToggle ).toHaveAttribute( 'aria-expanded', 'false' );
|
|
1736
1768
|
|
|
@@ -1891,7 +1923,7 @@ describe( 'Post types', () => {
|
|
|
1891
1923
|
render( <LinkControl /> );
|
|
1892
1924
|
|
|
1893
1925
|
// Search Input UI.
|
|
1894
|
-
const searchInput = screen.getByRole( 'combobox', { name: '
|
|
1926
|
+
const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
|
|
1895
1927
|
|
|
1896
1928
|
// Simulate searching for a term.
|
|
1897
1929
|
await user.type( searchInput, searchTerm );
|
|
@@ -1918,7 +1950,9 @@ describe( 'Post types', () => {
|
|
|
1918
1950
|
render( <LinkControl suggestionsQuery={ { type: postType } } /> );
|
|
1919
1951
|
|
|
1920
1952
|
// Search Input UI.
|
|
1921
|
-
const searchInput = screen.getByRole( 'combobox', {
|
|
1953
|
+
const searchInput = screen.getByRole( 'combobox', {
|
|
1954
|
+
name: 'Link',
|
|
1955
|
+
} );
|
|
1922
1956
|
|
|
1923
1957
|
// Simulate searching for a term.
|
|
1924
1958
|
await user.type( searchInput, searchTerm );
|
|
@@ -2376,10 +2410,14 @@ describe( 'Controlling link title text', () => {
|
|
|
2376
2410
|
} );
|
|
2377
2411
|
} );
|
|
2378
2412
|
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
name: '
|
|
2413
|
+
function getSettingsDrawerToggle() {
|
|
2414
|
+
return screen.queryByRole( 'button', {
|
|
2415
|
+
name: 'Advanced',
|
|
2382
2416
|
} );
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2419
|
+
async function toggleSettingsDrawer( user ) {
|
|
2420
|
+
const settingsToggle = getSettingsDrawerToggle();
|
|
2383
2421
|
|
|
2384
2422
|
await user.click( settingsToggle );
|
|
2385
2423
|
}
|
|
@@ -21,16 +21,15 @@ export const Appender = forwardRef(
|
|
|
21
21
|
const { insertedBlock, setInsertedBlock } = useListViewContext();
|
|
22
22
|
|
|
23
23
|
const instanceId = useInstanceId( Appender );
|
|
24
|
-
const
|
|
24
|
+
const hideInserter = useSelect(
|
|
25
25
|
( select ) => {
|
|
26
26
|
const { getTemplateLock, __unstableGetEditorMode } =
|
|
27
27
|
select( blockEditorStore );
|
|
28
28
|
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
29
|
+
return (
|
|
30
|
+
!! getTemplateLock( clientId ) ||
|
|
31
|
+
__unstableGetEditorMode() === 'zoom-out'
|
|
32
|
+
);
|
|
34
33
|
},
|
|
35
34
|
[ clientId ]
|
|
36
35
|
);
|