@wordpress/block-editor 8.0.17 → 8.1.2-next.f435e9e01b.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/LICENSE.md +1 -1
- package/README.md +19 -6
- package/build/components/block-caption/index.native.js +14 -3
- package/build/components/block-caption/index.native.js.map +1 -1
- package/build/components/block-edit/index.js +9 -0
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-inspector/index.js +14 -19
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list-appender/index.js +3 -11
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-media-update-progress/index.native.js +2 -1
- package/build/components/block-media-update-progress/index.native.js.map +1 -1
- package/build/components/block-preview/auto.js +10 -2
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-settings/container.native.js +2 -1
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-styles/index.js +110 -134
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/menu-items.js +63 -0
- package/build/components/block-styles/menu-items.js.map +1 -0
- package/build/components/block-styles/preview-panel.js +45 -0
- package/build/components/block-styles/preview-panel.js.map +1 -0
- package/build/components/block-styles/preview.native.js +2 -2
- package/build/components/block-styles/preview.native.js.map +1 -1
- package/build/components/block-styles/use-styles-for-block.js +119 -0
- package/build/components/block-styles/use-styles-for-block.js.map +1 -0
- package/build/components/block-styles/utils.js +39 -0
- package/build/components/block-styles/utils.js.map +1 -1
- package/build/components/block-switcher/block-styles-menu.js +3 -23
- package/build/components/block-switcher/block-styles-menu.js.map +1 -1
- package/build/components/block-tools/back-compat.js +2 -1
- package/build/components/block-tools/back-compat.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +5 -1
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +11 -1
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-types-list/index.native.js +2 -2
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/button-block-appender/index.js +2 -1
- package/build/components/button-block-appender/index.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/colors-gradients/panel-color-gradient-settings.native.js +6 -3
- package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
- package/build/components/colors-gradients/tools-panel-color-dropdown.js +89 -0
- package/build/components/colors-gradients/tools-panel-color-dropdown.js.map +1 -0
- package/build/components/contrast-checker/index.js +80 -44
- package/build/components/contrast-checker/index.js.map +1 -1
- package/build/components/contrast-checker/index.native.js +108 -0
- package/build/components/contrast-checker/index.native.js.map +1 -0
- package/build/components/default-block-appender/index.js +16 -19
- package/build/components/default-block-appender/index.js.map +1 -1
- package/build/components/default-style-picker/index.js +18 -3
- package/build/components/default-style-picker/index.js.map +1 -1
- package/build/components/iframe/index.js +4 -5
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/index.js +18 -18
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +18 -0
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/default-block-appender.js +2 -4
- package/build/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +16 -14
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inserter/index.js +61 -3
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js +1 -1
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/library.js +5 -3
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/menu.js +11 -3
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/search-items.js +3 -1
- package/build/components/inserter/search-items.js.map +1 -1
- package/build/components/inserter/tabs.native.js +7 -4
- package/build/components/inserter/tabs.native.js.map +1 -1
- package/build/components/inspector-controls/block-support-slot-container.js +2 -1
- package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js +14 -44
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls/fill.native.js +3 -5
- package/build/components/inspector-controls/fill.native.js.map +1 -1
- package/build/components/inspector-controls/groups.js +4 -0
- package/build/components/inspector-controls/groups.js.map +1 -1
- package/build/components/inspector-controls/slot.js +1 -3
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/letter-spacing-control/index.js +6 -6
- package/build/components/letter-spacing-control/index.js.map +1 -1
- package/build/components/line-height-control/index.native.js +3 -2
- package/build/components/line-height-control/index.native.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-item.js +11 -1
- package/build/components/link-control/search-item.js.map +1 -1
- package/build/components/link-control/search-results.js +2 -1
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/link-control/use-search-handler.js +18 -5
- package/build/components/link-control/use-search-handler.js.map +1 -1
- package/build/components/list-view/block-contents.js +3 -1
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block-select-button.js +26 -4
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +10 -1
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/media-placeholder/index.js +3 -11
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-replace-flow/index.js +32 -6
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/media-replace-flow/index.native.js +13 -0
- package/build/components/media-replace-flow/index.native.js.map +1 -0
- package/build/components/media-upload-progress/index.native.js +2 -1
- package/build/components/media-upload-progress/index.native.js.map +1 -1
- package/build/components/panel-color-settings/index.js +7 -3
- package/build/components/panel-color-settings/index.js.map +1 -1
- package/build/components/provider/block-refs-provider.js +4 -1
- package/build/components/provider/block-refs-provider.js.map +1 -1
- package/build/components/rich-text/file-paste-handler.js +1 -1
- package/build/components/rich-text/file-paste-handler.js.map +1 -1
- package/build/components/rich-text/index.js +2 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +2 -1
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/prevent-event-discovery.js +33 -0
- package/build/components/rich-text/prevent-event-discovery.js.map +1 -0
- package/build/components/rich-text/use-input-rules.js +3 -1
- package/build/components/rich-text/use-input-rules.js.map +1 -1
- package/build/components/rich-text/use-paste-handler.js +14 -5
- package/build/components/rich-text/use-paste-handler.js.map +1 -1
- package/build/components/rich-text/utils.js +2 -1
- package/build/components/rich-text/utils.js.map +1 -1
- package/build/components/selection-scroll-into-view/index.js +2 -1
- package/build/components/selection-scroll-into-view/index.js.map +1 -1
- package/build/components/use-display-block-controls/index.native.js +45 -0
- package/build/components/use-display-block-controls/index.native.js.map +1 -0
- package/build/components/use-on-block-drop/index.js +7 -3
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/writing-flow/use-multi-selection.js +3 -1
- package/build/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build/hooks/border-color.js +63 -5
- package/build/hooks/border-color.js.map +1 -1
- package/build/hooks/border-radius.js +47 -0
- package/build/hooks/border-radius.js.map +1 -1
- package/build/hooks/border-style.js +41 -0
- package/build/hooks/border-style.js.map +1 -1
- package/build/hooks/border-width.js +70 -31
- package/build/hooks/border-width.js.map +1 -1
- package/build/hooks/border.js +81 -11
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color-panel.js +25 -16
- package/build/hooks/color-panel.js.map +1 -1
- package/build/hooks/color-panel.native.js +77 -0
- package/build/hooks/color-panel.native.js.map +1 -0
- package/build/hooks/color.js +179 -12
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/font-size.js +14 -0
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/index.native.js +2 -0
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/layout.native.js +20 -0
- package/build/hooks/layout.native.js.map +1 -0
- package/build/hooks/letter-spacing.js +1 -1
- package/build/hooks/letter-spacing.js.map +1 -1
- package/build/hooks/typography.js +1 -1
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/typography.native.js +2 -4
- package/build/hooks/typography.native.js.map +1 -1
- package/build/hooks/utils.js +55 -0
- package/build/hooks/utils.js.map +1 -1
- package/build/store/actions.js +1 -2
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +5 -2
- package/build/store/defaults.js.map +1 -1
- package/build/store/defaults.native.js +2 -6
- package/build/store/defaults.native.js.map +1 -1
- package/build/store/selectors.js +10 -5
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-paste-event-data.js +1 -1
- package/build/utils/get-paste-event-data.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/block-caption/index.native.js +13 -3
- package/build-module/components/block-caption/index.native.js.map +1 -1
- package/build-module/components/block-edit/index.js +9 -0
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +14 -19
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list-appender/index.js +3 -10
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-media-update-progress/index.native.js +2 -1
- package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
- package/build-module/components/block-preview/auto.js +10 -2
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-settings/container.native.js +2 -1
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-styles/index.js +112 -133
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/menu-items.js +50 -0
- package/build-module/components/block-styles/menu-items.js.map +1 -0
- package/build-module/components/block-styles/preview-panel.js +35 -0
- package/build-module/components/block-styles/preview-panel.js.map +1 -0
- package/build-module/components/block-styles/preview.native.js +2 -2
- package/build-module/components/block-styles/preview.native.js.map +1 -1
- package/build-module/components/block-styles/use-styles-for-block.js +107 -0
- package/build-module/components/block-styles/use-styles-for-block.js.map +1 -0
- package/build-module/components/block-styles/utils.js +34 -0
- package/build-module/components/block-styles/utils.js.map +1 -1
- package/build-module/components/block-switcher/block-styles-menu.js +3 -21
- package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
- package/build-module/components/block-tools/back-compat.js +2 -1
- package/build-module/components/block-tools/back-compat.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +5 -1
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +11 -1
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js +2 -2
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/button-block-appender/index.js +2 -1
- package/build-module/components/button-block-appender/index.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/colors-gradients/panel-color-gradient-settings.native.js +7 -4
- package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
- package/build-module/components/colors-gradients/tools-panel-color-dropdown.js +75 -0
- package/build-module/components/colors-gradients/tools-panel-color-dropdown.js.map +1 -0
- package/build-module/components/contrast-checker/index.js +80 -45
- package/build-module/components/contrast-checker/index.js.map +1 -1
- package/build-module/components/contrast-checker/index.native.js +90 -0
- package/build-module/components/contrast-checker/index.native.js.map +1 -0
- package/build-module/components/default-block-appender/index.js +15 -18
- package/build-module/components/default-block-appender/index.js.map +1 -1
- package/build-module/components/default-style-picker/index.js +17 -3
- package/build-module/components/default-style-picker/index.js.map +1 -1
- package/build-module/components/iframe/index.js +4 -5
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/index.js +2 -2
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +2 -0
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/default-block-appender.js +2 -4
- package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js +16 -14
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inserter/index.js +61 -3
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +2 -2
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/library.js +5 -3
- package/build-module/components/inserter/library.js.map +1 -1
- package/build-module/components/inserter/menu.js +11 -4
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/search-items.js +3 -1
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/components/inserter/tabs.native.js +7 -4
- package/build-module/components/inserter/tabs.native.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-slot-container.js +2 -1
- package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js +15 -44
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/inspector-controls/fill.native.js +3 -5
- package/build-module/components/inspector-controls/fill.native.js.map +1 -1
- package/build-module/components/inspector-controls/groups.js +4 -0
- package/build-module/components/inspector-controls/groups.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +1 -3
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/letter-spacing-control/index.js +6 -6
- package/build-module/components/letter-spacing-control/index.js.map +1 -1
- package/build-module/components/line-height-control/index.native.js +3 -2
- package/build-module/components/line-height-control/index.native.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-item.js +11 -1
- package/build-module/components/link-control/search-item.js.map +1 -1
- package/build-module/components/link-control/search-results.js +2 -1
- package/build-module/components/link-control/search-results.js.map +1 -1
- package/build-module/components/link-control/use-search-handler.js +18 -5
- package/build-module/components/link-control/use-search-handler.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +3 -1
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +25 -4
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +8 -1
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +3 -10
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +32 -6
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/media-replace-flow/index.native.js +4 -0
- package/build-module/components/media-replace-flow/index.native.js.map +1 -0
- package/build-module/components/media-upload-progress/index.native.js +2 -1
- package/build-module/components/media-upload-progress/index.native.js.map +1 -1
- package/build-module/components/panel-color-settings/index.js +7 -3
- package/build-module/components/panel-color-settings/index.js.map +1 -1
- package/build-module/components/provider/block-refs-provider.js +4 -1
- package/build-module/components/provider/block-refs-provider.js.map +1 -1
- package/build-module/components/rich-text/file-paste-handler.js +1 -1
- package/build-module/components/rich-text/file-paste-handler.js.map +1 -1
- package/build-module/components/rich-text/index.js +2 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +2 -1
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/prevent-event-discovery.js +25 -0
- package/build-module/components/rich-text/prevent-event-discovery.js.map +1 -0
- package/build-module/components/rich-text/use-input-rules.js +2 -1
- package/build-module/components/rich-text/use-input-rules.js.map +1 -1
- package/build-module/components/rich-text/use-paste-handler.js +14 -5
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/rich-text/utils.js +2 -1
- package/build-module/components/rich-text/utils.js.map +1 -1
- package/build-module/components/selection-scroll-into-view/index.js +2 -1
- package/build-module/components/selection-scroll-into-view/index.js.map +1 -1
- package/build-module/components/use-display-block-controls/index.native.js +34 -0
- package/build-module/components/use-display-block-controls/index.native.js.map +1 -0
- package/build-module/components/use-on-block-drop/index.js +7 -3
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/writing-flow/use-multi-selection.js +3 -4
- package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build-module/hooks/border-color.js +61 -7
- package/build-module/hooks/border-color.js.map +1 -1
- package/build-module/hooks/border-radius.js +42 -0
- package/build-module/hooks/border-radius.js.map +1 -1
- package/build-module/hooks/border-style.js +36 -0
- package/build-module/hooks/border-style.js.map +1 -1
- package/build-module/hooks/border-width.js +66 -32
- package/build-module/hooks/border-width.js.map +1 -1
- package/build-module/hooks/border.js +80 -12
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color-panel.js +24 -14
- package/build-module/hooks/color-panel.js.map +1 -1
- package/build-module/hooks/color-panel.native.js +62 -0
- package/build-module/hooks/color-panel.native.js.map +1 -0
- package/build-module/hooks/color.js +177 -13
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/font-size.js +12 -1
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/index.native.js +1 -0
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/layout.native.js +16 -0
- package/build-module/hooks/layout.native.js.map +1 -0
- package/build-module/hooks/letter-spacing.js +1 -1
- package/build-module/hooks/letter-spacing.js.map +1 -1
- package/build-module/hooks/typography.js +1 -1
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/typography.native.js +2 -4
- package/build-module/hooks/typography.native.js.map +1 -1
- package/build-module/hooks/utils.js +52 -1
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/store/actions.js +1 -2
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +5 -2
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/defaults.native.js +2 -5
- package/build-module/store/defaults.native.js.map +1 -1
- package/build-module/store/selectors.js +10 -5
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-paste-event-data.js +1 -1
- package/build-module/utils/get-paste-event-data.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 +256 -191
- package/build-style/style.css +256 -191
- package/package.json +30 -30
- package/src/components/block-caption/index.native.js +22 -4
- package/src/components/block-card/README.md +1 -1
- package/src/components/block-edit/index.js +8 -0
- package/src/components/block-edit/test/edit.native.js +10 -9
- package/src/components/block-inspector/index.js +18 -16
- package/src/components/block-list-appender/index.js +5 -21
- package/src/components/block-media-update-progress/index.native.js +1 -1
- package/src/components/block-media-update-progress/test/index.native.js +136 -93
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +108 -47
- package/src/components/block-mover/test/index.native.js +5 -5
- package/src/components/block-preview/README.md +14 -26
- package/src/components/block-preview/auto.js +7 -2
- package/src/components/block-preview/test/index.js +2 -0
- package/src/components/block-settings/container.native.js +1 -0
- package/src/components/block-styles/index.js +125 -145
- package/src/components/block-styles/menu-items.js +49 -0
- package/src/components/block-styles/preview-panel.js +36 -0
- package/src/components/block-styles/preview.native.js +5 -2
- package/src/components/block-styles/style.scss +59 -51
- package/src/components/block-styles/test/{index.js → utils.js} +60 -1
- package/src/components/block-styles/use-styles-for-block.js +99 -0
- package/src/components/block-styles/utils.js +39 -0
- package/src/components/block-switcher/block-styles-menu.js +3 -38
- package/src/components/block-tools/back-compat.js +1 -0
- package/src/components/block-tools/block-selection-button.js +7 -1
- package/src/components/block-tools/insertion-point.js +10 -1
- package/src/components/block-types-list/index.native.js +5 -2
- package/src/components/border-radius-control/style.scss +1 -1
- package/src/components/border-style-control/style.scss +0 -1
- package/src/components/button-block-appender/index.js +1 -0
- package/src/components/color-palette/test/__snapshots__/control.js.snap +9 -5
- package/src/components/colors-gradients/dropdown.js +48 -43
- package/src/components/colors-gradients/panel-color-gradient-settings.native.js +13 -2
- package/src/components/colors-gradients/style.scss +10 -5
- package/src/components/colors-gradients/tools-panel-color-dropdown.js +85 -0
- package/src/components/contrast-checker/README.md +3 -1
- package/src/components/contrast-checker/index.js +107 -64
- package/src/components/contrast-checker/index.native.js +113 -0
- package/src/components/contrast-checker/style.native.scss +26 -0
- package/src/components/contrast-checker/test/index.js +236 -2
- package/src/components/default-block-appender/index.js +17 -24
- package/src/components/default-block-appender/style.scss +4 -0
- package/src/components/default-block-appender/test/__snapshots__/index.js.snap +12 -24
- package/src/components/default-block-appender/test/index.js +4 -14
- package/src/components/default-style-picker/index.js +18 -6
- package/src/components/iframe/index.js +7 -3
- package/src/components/index.js +2 -2
- package/src/components/index.native.js +2 -0
- package/src/components/inner-blocks/README.md +2 -0
- package/src/components/inner-blocks/default-block-appender.js +2 -7
- package/src/components/inner-blocks/use-nested-settings-update.js +16 -14
- package/src/components/inserter/index.js +77 -5
- package/src/components/inserter/index.native.js +2 -2
- package/src/components/inserter/library.js +17 -12
- package/src/components/inserter/menu.js +31 -13
- package/src/components/inserter/search-items.js +3 -1
- package/src/components/inserter/tabs.native.js +5 -4
- package/src/components/inserter/test/block-types-tab.native.js +9 -10
- package/src/components/inserter/test/index.native.js +3 -7
- package/src/components/inserter/test/reusable-blocks-tab.native.js +8 -10
- package/src/components/inspector-controls/block-support-slot-container.js +3 -1
- package/src/components/inspector-controls/block-support-tools-panel.js +41 -58
- package/src/components/inspector-controls/fill.native.js +4 -3
- package/src/components/inspector-controls/groups.js +4 -0
- package/src/components/inspector-controls/slot.js +2 -7
- package/src/components/letter-spacing-control/index.js +6 -6
- package/src/components/line-height-control/index.native.js +2 -1
- package/src/components/link-control/README.md +1 -1
- package/src/components/link-control/link-preview.js +1 -1
- package/src/components/link-control/search-item.js +11 -2
- package/src/components/link-control/search-results.js +1 -0
- package/src/components/link-control/style.scss +5 -10
- package/src/components/link-control/test/index.js +4 -0
- package/src/components/link-control/use-search-handler.js +25 -4
- package/src/components/list-view/block-contents.js +2 -0
- package/src/components/list-view/block-select-button.js +22 -1
- package/src/components/list-view/block.js +11 -0
- package/src/components/media-placeholder/index.js +3 -10
- package/src/components/media-replace-flow/index.js +35 -5
- package/src/components/media-replace-flow/index.native.js +3 -0
- package/src/components/media-upload/test/index.native.js +28 -47
- package/src/components/media-upload-progress/index.native.js +1 -0
- package/src/components/media-upload-progress/test/index.native.js +60 -47
- package/src/components/panel-color-settings/index.js +8 -4
- package/src/components/provider/block-refs-provider.js +4 -1
- package/src/components/rich-text/file-paste-handler.js +3 -1
- package/src/components/rich-text/index.js +1 -0
- package/src/components/rich-text/index.native.js +1 -0
- package/src/components/rich-text/prevent-event-discovery.js +23 -0
- package/src/components/rich-text/use-input-rules.js +2 -1
- package/src/components/rich-text/use-paste-handler.js +16 -3
- package/src/components/rich-text/utils.js +1 -0
- package/src/components/selection-scroll-into-view/index.js +1 -0
- package/src/components/url-input/README.md +5 -0
- package/src/components/use-display-block-controls/index.native.js +38 -0
- package/src/components/use-on-block-drop/index.js +7 -3
- package/src/components/writing-flow/test/use-multi-selection.js +36 -0
- package/src/components/writing-flow/use-multi-selection.js +12 -9
- package/src/hooks/border-color.js +55 -3
- package/src/hooks/border-radius.js +32 -0
- package/src/hooks/border-style.js +26 -0
- package/src/hooks/border-width.js +56 -32
- package/src/hooks/border.js +115 -20
- package/src/hooks/border.scss +3 -17
- package/src/hooks/color-panel.js +25 -19
- package/src/hooks/color-panel.native.js +63 -0
- package/src/hooks/color.js +182 -12
- package/src/hooks/color.scss +85 -0
- package/src/hooks/font-size.js +29 -1
- package/src/hooks/index.native.js +1 -0
- package/src/hooks/layout.native.js +23 -0
- package/src/hooks/letter-spacing.js +1 -1
- package/src/hooks/typography.js +1 -1
- package/src/hooks/typography.native.js +1 -3
- package/src/hooks/utils.js +69 -1
- package/src/store/actions.js +1 -2
- package/src/store/defaults.js +2 -1
- package/src/store/defaults.native.js +2 -6
- package/src/store/selectors.js +10 -5
- package/src/style.scss +4 -3
- package/src/utils/get-paste-event-data.js +1 -1
- package/src/utils/parse-css-unit-to-px.js +1 -1
- package/src/utils/test/parse-css-unit-to-px.js +3 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/preserve-scroll-in-reorder/index.js +0 -22
- package/build/components/preserve-scroll-in-reorder/index.js.map +0 -1
- package/build/components/use-canvas-click-redirect/index.js +0 -66
- package/build/components/use-canvas-click-redirect/index.js.map +0 -1
- package/build-module/components/preserve-scroll-in-reorder/index.js +0 -12
- package/build-module/components/preserve-scroll-in-reorder/index.js.map +0 -1
- package/build-module/components/use-canvas-click-redirect/index.js +0 -54
- package/build-module/components/use-canvas-click-redirect/index.js.map +0 -1
- package/src/components/preserve-scroll-in-reorder/index.js +0 -12
- package/src/components/use-canvas-click-redirect/index.js +0 -57
|
@@ -63,7 +63,7 @@ function InserterTabs( {
|
|
|
63
63
|
}, [ tabIndex ] );
|
|
64
64
|
|
|
65
65
|
const { tabs, tabKeys } = useMemo( () => {
|
|
66
|
-
const filteredTabs = InserterTabs.
|
|
66
|
+
const filteredTabs = InserterTabs.getTabs().filter(
|
|
67
67
|
( { name } ) => showReusableBlocks || name !== 'reusable'
|
|
68
68
|
);
|
|
69
69
|
return {
|
|
@@ -114,8 +114,9 @@ function InserterTabs( {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
function TabsControl( { onChangeTab, showReusableBlocks } ) {
|
|
117
|
+
const tabs = InserterTabs.getTabs();
|
|
117
118
|
const segments = useMemo( () => {
|
|
118
|
-
const filteredTabs =
|
|
119
|
+
const filteredTabs = tabs.filter(
|
|
119
120
|
( { name } ) => showReusableBlocks || name !== 'reusable'
|
|
120
121
|
);
|
|
121
122
|
return filteredTabs.map( ( { title } ) => title );
|
|
@@ -123,7 +124,7 @@ function TabsControl( { onChangeTab, showReusableBlocks } ) {
|
|
|
123
124
|
|
|
124
125
|
const segmentHandler = useCallback(
|
|
125
126
|
( selectedTab ) => {
|
|
126
|
-
const tabTitles =
|
|
127
|
+
const tabTitles = tabs.map( ( { title } ) => title );
|
|
127
128
|
onChangeTab( tabTitles.indexOf( selectedTab ) );
|
|
128
129
|
},
|
|
129
130
|
[ onChangeTab ]
|
|
@@ -139,7 +140,7 @@ function TabsControl( { onChangeTab, showReusableBlocks } ) {
|
|
|
139
140
|
|
|
140
141
|
InserterTabs.Control = TabsControl;
|
|
141
142
|
|
|
142
|
-
InserterTabs.
|
|
143
|
+
InserterTabs.getTabs = () => [
|
|
143
144
|
{ name: 'blocks', title: __( 'Blocks' ), component: BlockTypesTab },
|
|
144
145
|
{ name: 'reusable', title: __( 'Reusable' ), component: ReusableBlocksTab },
|
|
145
146
|
];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { render } from 'test/helpers';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -13,9 +13,7 @@ import { useSelect } from '@wordpress/data';
|
|
|
13
13
|
*/
|
|
14
14
|
import items from './fixtures';
|
|
15
15
|
import BlockTypesTab from '../block-types-tab';
|
|
16
|
-
import BlockTypesList from '../../block-types-list';
|
|
17
16
|
|
|
18
|
-
jest.mock( '../../block-types-list' );
|
|
19
17
|
jest.mock( '../hooks/use-clipboard-block' );
|
|
20
18
|
jest.mock( '@wordpress/data/src/components/use-select' );
|
|
21
19
|
|
|
@@ -35,11 +33,11 @@ describe( 'BlockTypesTab component', () => {
|
|
|
35
33
|
} );
|
|
36
34
|
|
|
37
35
|
it( 'renders without crashing', () => {
|
|
38
|
-
const component =
|
|
36
|
+
const component = render(
|
|
39
37
|
<BlockTypesTab
|
|
40
38
|
rootClientId={ 0 }
|
|
41
39
|
onSelect={ jest.fn() }
|
|
42
|
-
listProps={ {} }
|
|
40
|
+
listProps={ { contentContainerStyle: {} } }
|
|
43
41
|
/>
|
|
44
42
|
);
|
|
45
43
|
expect( component ).toBeTruthy();
|
|
@@ -52,15 +50,16 @@ describe( 'BlockTypesTab component', () => {
|
|
|
52
50
|
( { id, category } ) =>
|
|
53
51
|
category !== 'reusable' && id !== 'core-embed/a-paragraph-embed'
|
|
54
52
|
);
|
|
55
|
-
const component =
|
|
53
|
+
const component = render(
|
|
56
54
|
<BlockTypesTab
|
|
57
55
|
rootClientId={ 0 }
|
|
58
56
|
onSelect={ jest.fn() }
|
|
59
|
-
listProps={ {} }
|
|
57
|
+
listProps={ { contentContainerStyle: {} } }
|
|
60
58
|
/>
|
|
61
59
|
);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
|
|
61
|
+
blockItems.forEach( ( item ) => {
|
|
62
|
+
expect( component.getByText( item.title ) ).toBeTruthy();
|
|
63
|
+
} );
|
|
65
64
|
} );
|
|
66
65
|
} );
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import { render } from 'test/helpers';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { Inserter } from '../index';
|
|
10
|
-
import '../../..'; // Ensure store dependencies are imported via root.
|
|
11
10
|
|
|
12
11
|
const getStylesFromColorScheme = () => {
|
|
13
12
|
return { color: 'white' };
|
|
@@ -15,13 +14,10 @@ const getStylesFromColorScheme = () => {
|
|
|
15
14
|
|
|
16
15
|
describe( 'Inserter', () => {
|
|
17
16
|
it( 'button contains the testID "add-block-button"', () => {
|
|
18
|
-
const
|
|
17
|
+
const screen = render(
|
|
19
18
|
<Inserter getStylesFromColorScheme={ getStylesFromColorScheme } />
|
|
20
19
|
);
|
|
21
|
-
const testInstance = testRenderer.root;
|
|
22
20
|
|
|
23
|
-
expect( ()
|
|
24
|
-
testInstance.findByProps( { testID: 'add-block-button' } );
|
|
25
|
-
} ).not.toThrow();
|
|
21
|
+
expect( screen.getByTestId( 'add-block-button' ) ).toBeTruthy();
|
|
26
22
|
} );
|
|
27
23
|
} );
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { render } from 'test/helpers';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -13,9 +13,7 @@ import { useSelect } from '@wordpress/data';
|
|
|
13
13
|
*/
|
|
14
14
|
import items from './fixtures';
|
|
15
15
|
import ReusableBlocksTab from '../reusable-blocks-tab';
|
|
16
|
-
import BlockTypesList from '../../block-types-list';
|
|
17
16
|
|
|
18
|
-
jest.mock( '../../block-types-list' );
|
|
19
17
|
jest.mock( '@wordpress/data/src/components/use-select' );
|
|
20
18
|
|
|
21
19
|
const fetchReusableBlocks = jest.fn();
|
|
@@ -34,11 +32,11 @@ describe( 'ReusableBlocksTab component', () => {
|
|
|
34
32
|
} );
|
|
35
33
|
|
|
36
34
|
it( 'renders without crashing', () => {
|
|
37
|
-
const component =
|
|
35
|
+
const component = render(
|
|
38
36
|
<ReusableBlocksTab
|
|
39
37
|
rootClientId={ 0 }
|
|
40
38
|
onSelect={ jest.fn() }
|
|
41
|
-
listProps={ {} }
|
|
39
|
+
listProps={ { contentContainerStyle: {} } }
|
|
42
40
|
/>
|
|
43
41
|
);
|
|
44
42
|
expect( component ).toBeTruthy();
|
|
@@ -50,15 +48,15 @@ describe( 'ReusableBlocksTab component', () => {
|
|
|
50
48
|
const reusableBlockItems = items.filter(
|
|
51
49
|
( { category } ) => category === 'reusable'
|
|
52
50
|
);
|
|
53
|
-
const component =
|
|
51
|
+
const component = render(
|
|
54
52
|
<ReusableBlocksTab
|
|
55
53
|
rootClientId={ 0 }
|
|
56
54
|
onSelect={ jest.fn() }
|
|
57
|
-
listProps={ {} }
|
|
55
|
+
listProps={ { contentContainerStyle: {} } }
|
|
58
56
|
/>
|
|
59
57
|
);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
);
|
|
58
|
+
reusableBlockItems.forEach( ( { title } ) => {
|
|
59
|
+
expect( component.getByText( title ) ).toBeTruthy();
|
|
60
|
+
} );
|
|
63
61
|
} );
|
|
64
62
|
} );
|
|
@@ -6,5 +6,7 @@ import { useContext } from '@wordpress/element';
|
|
|
6
6
|
|
|
7
7
|
export default function BlockSupportSlotContainer( { Slot, ...props } ) {
|
|
8
8
|
const toolsPanelContext = useContext( ToolsPanelContext );
|
|
9
|
-
return
|
|
9
|
+
return (
|
|
10
|
+
<Slot { ...props } fillProps={ toolsPanelContext } bubblesVirtually />
|
|
11
|
+
);
|
|
10
12
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __experimentalToolsPanel as ToolsPanel } from '@wordpress/components';
|
|
5
5
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
|
+
import { useCallback } from '@wordpress/element';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
@@ -11,74 +12,54 @@ import { store as blockEditorStore } from '../../store';
|
|
|
11
12
|
import { cleanEmptyObject } from '../../hooks/utils';
|
|
12
13
|
|
|
13
14
|
export default function BlockSupportToolsPanel( { children, group, label } ) {
|
|
14
|
-
const {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// When we currently have a multi-selection, the value returned from
|
|
23
|
-
// `getSelectedBlockClientId()` is `null`. When a `null` value is used
|
|
24
|
-
// for the `panelId`, a `ToolsPanel` will still allow panel items to
|
|
25
|
-
// register themselves despite their panelIds not matching.
|
|
26
|
-
const selectedBlockClientId = getSelectedBlockClientId();
|
|
27
|
-
|
|
28
|
-
if ( hasMultiSelection() ) {
|
|
29
|
-
const selectedBlockClientIds = getMultiSelectedBlockClientIds();
|
|
30
|
-
const selectedBlockAttributes = selectedBlockClientIds.reduce(
|
|
31
|
-
( blockAttributes, blockId ) => {
|
|
32
|
-
blockAttributes[ blockId ] = getBlockAttributes( blockId );
|
|
33
|
-
return blockAttributes;
|
|
34
|
-
},
|
|
35
|
-
{}
|
|
36
|
-
);
|
|
15
|
+
const { updateBlockAttributes } = useDispatch( blockEditorStore );
|
|
16
|
+
const {
|
|
17
|
+
getBlockAttributes,
|
|
18
|
+
getMultiSelectedBlockClientIds,
|
|
19
|
+
getSelectedBlockClientId,
|
|
20
|
+
hasMultiSelection,
|
|
21
|
+
} = useSelect( blockEditorStore );
|
|
37
22
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
};
|
|
43
|
-
}
|
|
23
|
+
const panelId = getSelectedBlockClientId();
|
|
24
|
+
const resetAll = useCallback(
|
|
25
|
+
( resetFilters = [] ) => {
|
|
26
|
+
const newAttributes = {};
|
|
44
27
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
attributes: {
|
|
49
|
-
[ selectedBlockClientId ]: getBlockAttributes(
|
|
50
|
-
selectedBlockClientId
|
|
51
|
-
),
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
}, [] );
|
|
55
|
-
const { updateBlockAttributes } = useDispatch( blockEditorStore );
|
|
28
|
+
const clientIds = hasMultiSelection()
|
|
29
|
+
? getMultiSelectedBlockClientIds()
|
|
30
|
+
: [ panelId ];
|
|
56
31
|
|
|
57
|
-
|
|
58
|
-
|
|
32
|
+
clientIds.forEach( ( clientId ) => {
|
|
33
|
+
const { style } = getBlockAttributes( clientId );
|
|
34
|
+
let newBlockAttributes = { style };
|
|
59
35
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
36
|
+
resetFilters.forEach( ( resetFilter ) => {
|
|
37
|
+
newBlockAttributes = {
|
|
38
|
+
...newBlockAttributes,
|
|
39
|
+
...resetFilter( newBlockAttributes ),
|
|
40
|
+
};
|
|
41
|
+
} );
|
|
63
42
|
|
|
64
|
-
|
|
43
|
+
// Enforce a cleaned style object.
|
|
65
44
|
newBlockAttributes = {
|
|
66
45
|
...newBlockAttributes,
|
|
67
|
-
|
|
46
|
+
style: cleanEmptyObject( newBlockAttributes.style ),
|
|
68
47
|
};
|
|
69
|
-
} );
|
|
70
|
-
|
|
71
|
-
// Enforce a cleaned style object.
|
|
72
|
-
newBlockAttributes = {
|
|
73
|
-
...newBlockAttributes,
|
|
74
|
-
style: cleanEmptyObject( newBlockAttributes.style ),
|
|
75
|
-
};
|
|
76
48
|
|
|
77
|
-
|
|
78
|
-
|
|
49
|
+
newAttributes[ clientId ] = newBlockAttributes;
|
|
50
|
+
} );
|
|
79
51
|
|
|
80
|
-
|
|
81
|
-
|
|
52
|
+
updateBlockAttributes( clientIds, newAttributes, true );
|
|
53
|
+
},
|
|
54
|
+
[
|
|
55
|
+
cleanEmptyObject,
|
|
56
|
+
getBlockAttributes,
|
|
57
|
+
getMultiSelectedBlockClientIds,
|
|
58
|
+
hasMultiSelection,
|
|
59
|
+
panelId,
|
|
60
|
+
updateBlockAttributes,
|
|
61
|
+
]
|
|
62
|
+
);
|
|
82
63
|
|
|
83
64
|
return (
|
|
84
65
|
<ToolsPanel
|
|
@@ -89,6 +70,8 @@ export default function BlockSupportToolsPanel( { children, group, label } ) {
|
|
|
89
70
|
panelId={ panelId }
|
|
90
71
|
hasInnerWrapper={ true }
|
|
91
72
|
shouldRenderPlaceholderItems={ true } // Required to maintain fills ordering.
|
|
73
|
+
__experimentalFirstVisibleItemClass="first"
|
|
74
|
+
__experimentalLastVisibleItemClass="last"
|
|
92
75
|
>
|
|
93
76
|
{ children }
|
|
94
77
|
</ToolsPanel>
|
|
@@ -14,7 +14,7 @@ import warning from '@wordpress/warning';
|
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
16
|
import groups from './groups';
|
|
17
|
-
import
|
|
17
|
+
import useDisplayBlockControls from '../use-display-block-controls';
|
|
18
18
|
import { BlockSettingsButton } from '../block-settings';
|
|
19
19
|
|
|
20
20
|
export default function InspectorControlsFill( {
|
|
@@ -22,13 +22,14 @@ export default function InspectorControlsFill( {
|
|
|
22
22
|
__experimentalGroup: group = 'default',
|
|
23
23
|
...props
|
|
24
24
|
} ) {
|
|
25
|
-
const
|
|
25
|
+
const isDisplayed = useDisplayBlockControls();
|
|
26
|
+
|
|
26
27
|
const Fill = groups[ group ]?.Fill;
|
|
27
28
|
if ( ! Fill ) {
|
|
28
29
|
warning( `Unknown InspectorControl group "${ group }" provided.` );
|
|
29
30
|
return null;
|
|
30
31
|
}
|
|
31
|
-
if ( !
|
|
32
|
+
if ( ! isDisplayed ) {
|
|
32
33
|
return null;
|
|
33
34
|
}
|
|
34
35
|
|
|
@@ -5,6 +5,8 @@ import { createSlotFill } from '@wordpress/components';
|
|
|
5
5
|
|
|
6
6
|
const InspectorControlsDefault = createSlotFill( 'InspectorControls' );
|
|
7
7
|
const InspectorControlsAdvanced = createSlotFill( 'InspectorAdvancedControls' );
|
|
8
|
+
const InspectorControlsBorder = createSlotFill( 'InspectorControlsBorder' );
|
|
9
|
+
const InspectorControlsColor = createSlotFill( 'InspectorControlsColor' );
|
|
8
10
|
const InspectorControlsDimensions = createSlotFill(
|
|
9
11
|
'InspectorControlsDimensions'
|
|
10
12
|
);
|
|
@@ -15,6 +17,8 @@ const InspectorControlsTypography = createSlotFill(
|
|
|
15
17
|
const groups = {
|
|
16
18
|
default: InspectorControlsDefault,
|
|
17
19
|
advanced: InspectorControlsAdvanced,
|
|
20
|
+
border: InspectorControlsBorder,
|
|
21
|
+
color: InspectorControlsColor,
|
|
18
22
|
dimensions: InspectorControlsDimensions,
|
|
19
23
|
typography: InspectorControlsTypography,
|
|
20
24
|
};
|
|
@@ -13,7 +13,6 @@ import groups from './groups';
|
|
|
13
13
|
|
|
14
14
|
export default function InspectorControlsSlot( {
|
|
15
15
|
__experimentalGroup: group = 'default',
|
|
16
|
-
bubblesVirtually = true,
|
|
17
16
|
label,
|
|
18
17
|
...props
|
|
19
18
|
} ) {
|
|
@@ -32,14 +31,10 @@ export default function InspectorControlsSlot( {
|
|
|
32
31
|
if ( label ) {
|
|
33
32
|
return (
|
|
34
33
|
<BlockSupportToolsPanel group={ group } label={ label }>
|
|
35
|
-
<BlockSupportSlotContainer
|
|
36
|
-
{ ...props }
|
|
37
|
-
bubblesVirtually={ bubblesVirtually }
|
|
38
|
-
Slot={ Slot }
|
|
39
|
-
/>
|
|
34
|
+
<BlockSupportSlotContainer { ...props } Slot={ Slot } />
|
|
40
35
|
</BlockSupportToolsPanel>
|
|
41
36
|
);
|
|
42
37
|
}
|
|
43
38
|
|
|
44
|
-
return <Slot { ...props } bubblesVirtually
|
|
39
|
+
return <Slot { ...props } bubblesVirtually />;
|
|
45
40
|
}
|
|
@@ -15,12 +15,12 @@ import useSetting from '../../components/use-setting';
|
|
|
15
15
|
/**
|
|
16
16
|
* Control for letter-spacing.
|
|
17
17
|
*
|
|
18
|
-
* @param {Object}
|
|
19
|
-
* @param {string}
|
|
20
|
-
* @param {Function}
|
|
21
|
-
* @param {
|
|
18
|
+
* @param {Object} props Component props.
|
|
19
|
+
* @param {string} props.value Currently selected letter-spacing.
|
|
20
|
+
* @param {Function} props.onChange Handles change in letter-spacing selection.
|
|
21
|
+
* @param {string|number|undefined} props.__unstableInputWidth Input width to pass through to inner UnitControl. Should be a valid CSS value.
|
|
22
22
|
*
|
|
23
|
-
* @return {WPElement}
|
|
23
|
+
* @return {WPElement} Letter-spacing control.
|
|
24
24
|
*/
|
|
25
25
|
export default function LetterSpacingControl( {
|
|
26
26
|
value,
|
|
@@ -33,7 +33,7 @@ export default function LetterSpacingControl( {
|
|
|
33
33
|
} );
|
|
34
34
|
return (
|
|
35
35
|
<UnitControl
|
|
36
|
-
label={ __( 'Letter
|
|
36
|
+
label={ __( 'Letter spacing' ) }
|
|
37
37
|
value={ value }
|
|
38
38
|
__unstableInputWidth={ __unstableInputWidth }
|
|
39
39
|
units={ units }
|
|
@@ -14,7 +14,8 @@ export default function LineHeightControl( { value: lineHeight, onChange } ) {
|
|
|
14
14
|
return (
|
|
15
15
|
<UnitControl
|
|
16
16
|
label={ __( 'Line Height' ) }
|
|
17
|
-
|
|
17
|
+
// Set minimun value of 1 since lower values break on Android
|
|
18
|
+
min={ 1 }
|
|
18
19
|
max={ 5 }
|
|
19
20
|
step={ STEP }
|
|
20
21
|
value={ value }
|
|
@@ -36,6 +36,7 @@ export const LinkControlSearchItem = ( {
|
|
|
36
36
|
icon={ globe }
|
|
37
37
|
/>
|
|
38
38
|
) }
|
|
39
|
+
|
|
39
40
|
<span className="block-editor-link-control__search-item-header">
|
|
40
41
|
<span className="block-editor-link-control__search-item-title">
|
|
41
42
|
<TextHighlight
|
|
@@ -57,12 +58,20 @@ export const LinkControlSearchItem = ( {
|
|
|
57
58
|
</span>
|
|
58
59
|
{ shouldShowType && suggestion.type && (
|
|
59
60
|
<span className="block-editor-link-control__search-item-type">
|
|
60
|
-
{
|
|
61
|
-
{ suggestion.type === 'post_tag' ? 'tag' : suggestion.type }
|
|
61
|
+
{ getVisualTypeName( suggestion ) }
|
|
62
62
|
</span>
|
|
63
63
|
) }
|
|
64
64
|
</Button>
|
|
65
65
|
);
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
+
function getVisualTypeName( suggestion ) {
|
|
69
|
+
if ( suggestion.isFrontPage ) {
|
|
70
|
+
return 'front page';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Rename 'post_tag' to 'tag'. Ideally, the API would return the localised CPT or taxonomy label.
|
|
74
|
+
return suggestion.type === 'post_tag' ? 'tag' : suggestion.type;
|
|
75
|
+
}
|
|
76
|
+
|
|
68
77
|
export default LinkControlSearchItem;
|
|
@@ -61,7 +61,7 @@ $preview-image-height: 140px;
|
|
|
61
61
|
// Specificity overide of URLInput defaults.
|
|
62
62
|
&.block-editor-url-input input[type="text"].block-editor-url-input__input {
|
|
63
63
|
@include input-control;
|
|
64
|
-
width: calc(100% - #{$grid-unit-20*2});
|
|
64
|
+
width: calc(100% - #{$grid-unit-20 * 2});
|
|
65
65
|
display: block;
|
|
66
66
|
padding: 11px $grid-unit-20;
|
|
67
67
|
padding-right: ( $button-size * $block-editor-link-control-number-of-actions ); // width of reset and submit buttons
|
|
@@ -287,6 +287,7 @@ $preview-image-height: 140px;
|
|
|
287
287
|
font-size: 0.9em;
|
|
288
288
|
background-color: $gray-100;
|
|
289
289
|
border-radius: 2px;
|
|
290
|
+
white-space: nowrap; // tags shouldn't go over two lines.
|
|
290
291
|
}
|
|
291
292
|
|
|
292
293
|
.block-editor-link-control__search-item-description {
|
|
@@ -482,16 +483,10 @@ $preview-image-height: 140px;
|
|
|
482
483
|
* Position spinner to the left of the actions.
|
|
483
484
|
*
|
|
484
485
|
* Compensate for:
|
|
485
|
-
* - Input
|
|
486
|
-
* - Border (1px)
|
|
487
|
-
* - Vertically, for the difference in height between the input (40px)
|
|
488
|
-
* and the spinner.
|
|
489
|
-
* - Horizontally, adjust for the width occupied by the icon buttons,
|
|
490
|
-
* then artificially create spacing that mimics as if the spinner
|
|
491
|
-
* were center-padded to the same width as an icon button.
|
|
486
|
+
* - Input padding right ($button-size)
|
|
492
487
|
*/
|
|
493
|
-
top:
|
|
494
|
-
right: $
|
|
488
|
+
top: calc(50% - #{$spinner-size} / 2);
|
|
489
|
+
right: $button-size;
|
|
495
490
|
}
|
|
496
491
|
}
|
|
497
492
|
|
|
@@ -51,6 +51,8 @@ jest.mock( '@wordpress/data/src/components/use-dispatch', () => ( {
|
|
|
51
51
|
useDispatch: () => ( { saveEntityRecords: jest.fn() } ),
|
|
52
52
|
} ) );
|
|
53
53
|
|
|
54
|
+
jest.useRealTimers();
|
|
55
|
+
|
|
54
56
|
/**
|
|
55
57
|
* Wait for next tick of event loop. This is required
|
|
56
58
|
* because the `fetchSearchSuggestions` Promise will
|
|
@@ -1634,6 +1636,7 @@ describe( 'Selecting links', () => {
|
|
|
1634
1636
|
);
|
|
1635
1637
|
|
|
1636
1638
|
// We should have highlighted the first item using the keyboard
|
|
1639
|
+
// eslint-disable-next-line jest/no-conditional-expect
|
|
1637
1640
|
expect( selectedSearchResultElement ).toEqual(
|
|
1638
1641
|
secondSearchSuggestion
|
|
1639
1642
|
);
|
|
@@ -1648,6 +1651,7 @@ describe( 'Selecting links', () => {
|
|
|
1648
1651
|
);
|
|
1649
1652
|
|
|
1650
1653
|
// We should be back to highlighting the first search result again
|
|
1654
|
+
// eslint-disable-next-line jest/no-conditional-expect
|
|
1651
1655
|
expect( selectedSearchResultElement ).toEqual(
|
|
1652
1656
|
firstSearchSuggestion
|
|
1653
1657
|
);
|
|
@@ -52,21 +52,39 @@ const handleEntitySearch = async (
|
|
|
52
52
|
fetchSearchSuggestions,
|
|
53
53
|
directEntryHandler,
|
|
54
54
|
withCreateSuggestion,
|
|
55
|
-
withURLSuggestion
|
|
55
|
+
withURLSuggestion,
|
|
56
|
+
pageOnFront
|
|
56
57
|
) => {
|
|
57
58
|
const { isInitialSuggestions } = suggestionsQuery;
|
|
59
|
+
let resultsIncludeFrontPage = false;
|
|
58
60
|
|
|
59
61
|
let results = await Promise.all( [
|
|
60
62
|
fetchSearchSuggestions( val, suggestionsQuery ),
|
|
61
63
|
directEntryHandler( val ),
|
|
62
64
|
] );
|
|
63
65
|
|
|
66
|
+
// Identify front page and update type to match.
|
|
67
|
+
results[ 0 ] = results[ 0 ].map( ( result ) => {
|
|
68
|
+
if ( Number( result.id ) === pageOnFront ) {
|
|
69
|
+
resultsIncludeFrontPage = true;
|
|
70
|
+
result.isFrontPage = true;
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return result;
|
|
75
|
+
} );
|
|
76
|
+
|
|
64
77
|
const couldBeURL = ! val.includes( ' ' );
|
|
65
78
|
|
|
66
79
|
// If it's potentially a URL search then concat on a URL search suggestion
|
|
67
80
|
// just for good measure. That way once the actual results run out we always
|
|
68
81
|
// have a URL option to fallback on.
|
|
69
|
-
if (
|
|
82
|
+
if (
|
|
83
|
+
! resultsIncludeFrontPage &&
|
|
84
|
+
couldBeURL &&
|
|
85
|
+
withURLSuggestion &&
|
|
86
|
+
! isInitialSuggestions
|
|
87
|
+
) {
|
|
70
88
|
results = results[ 0 ].concat( results[ 1 ] );
|
|
71
89
|
} else {
|
|
72
90
|
results = results[ 0 ];
|
|
@@ -109,9 +127,11 @@ export default function useSearchHandler(
|
|
|
109
127
|
withCreateSuggestion,
|
|
110
128
|
withURLSuggestion
|
|
111
129
|
) {
|
|
112
|
-
const { fetchSearchSuggestions } = useSelect( ( select ) => {
|
|
130
|
+
const { fetchSearchSuggestions, pageOnFront } = useSelect( ( select ) => {
|
|
113
131
|
const { getSettings } = select( blockEditorStore );
|
|
132
|
+
|
|
114
133
|
return {
|
|
134
|
+
pageOnFront: getSettings().pageOnFront,
|
|
115
135
|
fetchSearchSuggestions: getSettings()
|
|
116
136
|
.__experimentalFetchLinkSuggestions,
|
|
117
137
|
};
|
|
@@ -131,7 +151,8 @@ export default function useSearchHandler(
|
|
|
131
151
|
fetchSearchSuggestions,
|
|
132
152
|
directEntryHandler,
|
|
133
153
|
withCreateSuggestion,
|
|
134
|
-
withURLSuggestion
|
|
154
|
+
withURLSuggestion,
|
|
155
|
+
pageOnFront
|
|
135
156
|
);
|
|
136
157
|
},
|
|
137
158
|
[ directEntryHandler, fetchSearchSuggestions, withCreateSuggestion ]
|
|
@@ -26,6 +26,7 @@ const ListViewBlockContents = forwardRef(
|
|
|
26
26
|
position,
|
|
27
27
|
siblingBlockCount,
|
|
28
28
|
level,
|
|
29
|
+
isExpanded,
|
|
29
30
|
...props
|
|
30
31
|
},
|
|
31
32
|
ref
|
|
@@ -71,6 +72,7 @@ const ListViewBlockContents = forwardRef(
|
|
|
71
72
|
draggable={ draggable }
|
|
72
73
|
onDragStart={ onDragStart }
|
|
73
74
|
onDragEnd={ onDragEnd }
|
|
75
|
+
isExpanded={ isExpanded }
|
|
74
76
|
{ ...props }
|
|
75
77
|
/>
|
|
76
78
|
) }
|