@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
|
@@ -19,10 +19,9 @@ import { store as blockEditorStore } from '../../../store';
|
|
|
19
19
|
*
|
|
20
20
|
* @param {string=} rootClientId Insertion's root client ID.
|
|
21
21
|
* @param {Function} onInsert function called when inserter a list of blocks.
|
|
22
|
-
* @param {?string} syncStatus Optional sync status to filter pattern blocks by.
|
|
23
22
|
* @return {Array} Returns the block types state. (block types, categories, collections, onSelect handler)
|
|
24
23
|
*/
|
|
25
|
-
const useBlockTypesState = ( rootClientId, onInsert
|
|
24
|
+
const useBlockTypesState = ( rootClientId, onInsert ) => {
|
|
26
25
|
const { categories, collections, items } = useSelect(
|
|
27
26
|
( select ) => {
|
|
28
27
|
const { getInserterItems } = select( blockEditorStore );
|
|
@@ -31,10 +30,10 @@ const useBlockTypesState = ( rootClientId, onInsert, syncStatus ) => {
|
|
|
31
30
|
return {
|
|
32
31
|
categories: getCategories(),
|
|
33
32
|
collections: getCollections(),
|
|
34
|
-
items: getInserterItems( rootClientId
|
|
33
|
+
items: getInserterItems( rootClientId ),
|
|
35
34
|
};
|
|
36
35
|
},
|
|
37
|
-
[ rootClientId
|
|
36
|
+
[ rootClientId ]
|
|
38
37
|
);
|
|
39
38
|
|
|
40
39
|
const onSelectItem = useCallback(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useCallback } from '@wordpress/element';
|
|
4
|
+
import { useCallback, useMemo } from '@wordpress/element';
|
|
5
5
|
import { cloneBlock } from '@wordpress/blocks';
|
|
6
6
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
7
7
|
import { __, sprintf } from '@wordpress/i18n';
|
|
@@ -12,6 +12,12 @@ import { store as noticesStore } from '@wordpress/notices';
|
|
|
12
12
|
*/
|
|
13
13
|
import { store as blockEditorStore } from '../../../store';
|
|
14
14
|
|
|
15
|
+
const CUSTOM_CATEGORY = {
|
|
16
|
+
name: 'custom',
|
|
17
|
+
label: __( 'My patterns' ),
|
|
18
|
+
description: __( 'Custom patterns add by site users' ),
|
|
19
|
+
};
|
|
20
|
+
|
|
15
21
|
/**
|
|
16
22
|
* Retrieves the block patterns inserter state.
|
|
17
23
|
*
|
|
@@ -25,6 +31,7 @@ const usePatternsState = ( onInsert, rootClientId ) => {
|
|
|
25
31
|
( select ) => {
|
|
26
32
|
const { __experimentalGetAllowedPatterns, getSettings } =
|
|
27
33
|
select( blockEditorStore );
|
|
34
|
+
|
|
28
35
|
return {
|
|
29
36
|
patterns: __experimentalGetAllowedPatterns( rootClientId ),
|
|
30
37
|
patternCategories:
|
|
@@ -33,25 +40,34 @@ const usePatternsState = ( onInsert, rootClientId ) => {
|
|
|
33
40
|
},
|
|
34
41
|
[ rootClientId ]
|
|
35
42
|
);
|
|
43
|
+
|
|
44
|
+
const allCategories = useMemo(
|
|
45
|
+
() => [ ...patternCategories, CUSTOM_CATEGORY ],
|
|
46
|
+
[ patternCategories ]
|
|
47
|
+
);
|
|
48
|
+
|
|
36
49
|
const { createSuccessNotice } = useDispatch( noticesStore );
|
|
37
|
-
const onClickPattern = useCallback(
|
|
38
|
-
|
|
39
|
-
(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
const onClickPattern = useCallback(
|
|
51
|
+
( pattern, blocks ) => {
|
|
52
|
+
onInsert(
|
|
53
|
+
( blocks ?? [] ).map( ( block ) => cloneBlock( block ) ),
|
|
54
|
+
pattern.name
|
|
55
|
+
);
|
|
56
|
+
createSuccessNotice(
|
|
57
|
+
sprintf(
|
|
58
|
+
/* translators: %s: block pattern title. */
|
|
59
|
+
__( 'Block pattern "%s" inserted.' ),
|
|
60
|
+
pattern.title
|
|
61
|
+
),
|
|
62
|
+
{
|
|
63
|
+
type: 'snackbar',
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
},
|
|
67
|
+
[ createSuccessNotice, onInsert ]
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
return [ patterns, allCategories, onClickPattern ];
|
|
55
71
|
};
|
|
56
72
|
|
|
57
73
|
export default usePatternsState;
|
|
@@ -231,7 +231,7 @@ export const ComposedPrivateInserter = compose( [
|
|
|
231
231
|
getBlockRootClientId,
|
|
232
232
|
hasInserterItems,
|
|
233
233
|
getAllowedBlocks,
|
|
234
|
-
|
|
234
|
+
getDirectInsertBlock,
|
|
235
235
|
getSettings,
|
|
236
236
|
} = select( blockEditorStore );
|
|
237
237
|
|
|
@@ -243,8 +243,7 @@ export const ComposedPrivateInserter = compose( [
|
|
|
243
243
|
const allowedBlocks = getAllowedBlocks( rootClientId );
|
|
244
244
|
|
|
245
245
|
const directInsertBlock =
|
|
246
|
-
shouldDirectInsert &&
|
|
247
|
-
__experimentalGetDirectInsertBlock( rootClientId );
|
|
246
|
+
shouldDirectInsert && getDirectInsertBlock( rootClientId );
|
|
248
247
|
|
|
249
248
|
const settings = getSettings();
|
|
250
249
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { AccessibilityInfo, Platform
|
|
4
|
+
import { AccessibilityInfo, Platform } from 'react-native';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -35,33 +35,17 @@ const VOICE_OVER_ANNOUNCEMENT_DELAY = 1000;
|
|
|
35
35
|
const defaultRenderToggle = ( {
|
|
36
36
|
onToggle,
|
|
37
37
|
disabled,
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
iconStyle,
|
|
39
|
+
buttonStyle,
|
|
40
40
|
onLongPress,
|
|
41
|
-
useExpandedMode,
|
|
42
41
|
} ) => {
|
|
43
|
-
// The "expanded mode" refers to the editor's appearance when no blocks
|
|
44
|
-
// are currently selected. The "add block" button has a separate style
|
|
45
|
-
// for the "expanded mode", which are added via the below "expandedModeViewProps"
|
|
46
|
-
// and "expandedModeViewText" variables.
|
|
47
|
-
const expandedModeViewProps = useExpandedMode && {
|
|
48
|
-
icon: <Icon icon={ plus } style={ style } />,
|
|
49
|
-
customContainerStyles: containerStyle,
|
|
50
|
-
fixedRatio: false,
|
|
51
|
-
};
|
|
52
|
-
const expandedModeViewText = (
|
|
53
|
-
<Text style={ styles[ 'inserter-menu__add-block-button-text' ] }>
|
|
54
|
-
{ __( 'Add blocks' ) }
|
|
55
|
-
</Text>
|
|
56
|
-
);
|
|
57
|
-
|
|
58
42
|
return (
|
|
59
43
|
<ToolbarButton
|
|
60
44
|
title={ _x(
|
|
61
45
|
'Add block',
|
|
62
46
|
'Generic label for block inserter button'
|
|
63
47
|
) }
|
|
64
|
-
icon={ <Icon icon={
|
|
48
|
+
icon={ <Icon icon={ plus } style={ iconStyle } /> }
|
|
65
49
|
onClick={ onToggle }
|
|
66
50
|
extraProps={ {
|
|
67
51
|
hint: __( 'Double tap to add a block' ),
|
|
@@ -69,12 +53,12 @@ const defaultRenderToggle = ( {
|
|
|
69
53
|
// usually required for components. See: https://github.com/WordPress/gutenberg/pull/18832#issuecomment-561411389.
|
|
70
54
|
testID: 'add-block-button',
|
|
71
55
|
onLongPress,
|
|
56
|
+
hitSlop: { top: 10, bottom: 10, left: 10, right: 10 },
|
|
72
57
|
} }
|
|
73
58
|
isDisabled={ disabled }
|
|
74
|
-
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
</ToolbarButton>
|
|
59
|
+
customContainerStyles={ buttonStyle }
|
|
60
|
+
fixedRatio={ false }
|
|
61
|
+
/>
|
|
78
62
|
);
|
|
79
63
|
};
|
|
80
64
|
|
|
@@ -249,23 +233,21 @@ export class Inserter extends Component {
|
|
|
249
233
|
renderToggle = defaultRenderToggle,
|
|
250
234
|
getStylesFromColorScheme,
|
|
251
235
|
showSeparator,
|
|
252
|
-
useExpandedMode,
|
|
253
236
|
} = this.props;
|
|
254
237
|
if ( showSeparator && isOpen ) {
|
|
255
238
|
return <BlockInsertionPoint />;
|
|
256
239
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
: getStylesFromColorScheme(
|
|
260
|
-
styles[ 'inserter-menu__add-block-button-icon' ],
|
|
261
|
-
styles[ 'inserter-menu__add-block-button-icon--dark' ]
|
|
262
|
-
);
|
|
263
|
-
|
|
264
|
-
const containerStyle = getStylesFromColorScheme(
|
|
240
|
+
|
|
241
|
+
const buttonStyle = getStylesFromColorScheme(
|
|
265
242
|
styles[ 'inserter-menu__add-block-button' ],
|
|
266
243
|
styles[ 'inserter-menu__add-block-button--dark' ]
|
|
267
244
|
);
|
|
268
245
|
|
|
246
|
+
const iconStyle = getStylesFromColorScheme(
|
|
247
|
+
styles[ 'inserter-menu__add-block-button-icon' ],
|
|
248
|
+
styles[ 'inserter-menu__add-block-button-icon--dark' ]
|
|
249
|
+
);
|
|
250
|
+
|
|
269
251
|
const onPress = () => {
|
|
270
252
|
this.setState(
|
|
271
253
|
{
|
|
@@ -301,10 +283,9 @@ export class Inserter extends Component {
|
|
|
301
283
|
onToggle: onPress,
|
|
302
284
|
isOpen,
|
|
303
285
|
disabled,
|
|
304
|
-
|
|
305
|
-
|
|
286
|
+
iconStyle,
|
|
287
|
+
buttonStyle,
|
|
306
288
|
onLongPress,
|
|
307
|
-
useExpandedMode,
|
|
308
289
|
} ) }
|
|
309
290
|
<Picker
|
|
310
291
|
ref={ ( instance ) => ( this.picker = instance ) }
|
|
@@ -9,28 +9,8 @@ import { useSelect } from '@wordpress/data';
|
|
|
9
9
|
*/
|
|
10
10
|
import { store as blockEditorStore } from '../../../store';
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
* @typedef {Object} InserterMediaRequest
|
|
16
|
-
* @property {number} per_page How many items to fetch per page.
|
|
17
|
-
* @property {string} search The search term to use for filtering the results.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Interface for inserter media responses. Any media resource should
|
|
22
|
-
* map their response to this interface, in order to create the core
|
|
23
|
-
* WordPress media blocks (image, video, audio).
|
|
24
|
-
*
|
|
25
|
-
* @typedef {Object} InserterMediaItem
|
|
26
|
-
* @property {string} title The title of the media item.
|
|
27
|
-
* @property {string} url The source url of the media item.
|
|
28
|
-
* @property {string} [previewUrl] The preview source url of the media item to display in the media list.
|
|
29
|
-
* @property {number} [id] The WordPress id of the media item.
|
|
30
|
-
* @property {number|string} [sourceId] The id of the media item from external source.
|
|
31
|
-
* @property {string} [alt] The alt text of the media item.
|
|
32
|
-
* @property {string} [caption] The caption of the media item.
|
|
33
|
-
*/
|
|
12
|
+
/** @typedef {import('./api').InserterMediaRequest} InserterMediaRequest */
|
|
13
|
+
/** @typedef {import('./api').InserterMediaItem} InserterMediaItem */
|
|
34
14
|
|
|
35
15
|
/**
|
|
36
16
|
* Fetches media items based on the provided category.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { Button } from '@wordpress/components';
|
|
5
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
|
+
import { focus } from '@wordpress/dom';
|
|
7
|
+
import { useRef } from '@wordpress/element';
|
|
8
|
+
import { __ } from '@wordpress/i18n';
|
|
9
|
+
import { close } from '@wordpress/icons';
|
|
10
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
11
|
+
|
|
12
|
+
const PREFERENCE_NAME = 'isResuableBlocksrRenameHintVisible';
|
|
13
|
+
/*
|
|
14
|
+
* This hook was added in 6.3 to help users with the transition from Reusable blocks to Patterns.
|
|
15
|
+
* It is only exported for use in the reusable-blocks package as well as block-editor.
|
|
16
|
+
* It will be removed in 6.4. and should not be used in any new code.
|
|
17
|
+
*/
|
|
18
|
+
export function useReusableBlocksRenameHint() {
|
|
19
|
+
return useSelect(
|
|
20
|
+
( select ) =>
|
|
21
|
+
select( preferencesStore ).get( 'core', PREFERENCE_NAME ) ?? true,
|
|
22
|
+
[]
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* This component was added in 6.3 to help users with the transition from Reusable blocks to Patterns.
|
|
28
|
+
* It is only exported for use in the reusable-blocks package as well as block-editor.
|
|
29
|
+
* It will be removed in 6.4. and should not be used in any new code.
|
|
30
|
+
*/
|
|
31
|
+
export default function ReusableBlocksRenameHint() {
|
|
32
|
+
const isReusableBlocksRenameHint = useSelect(
|
|
33
|
+
( select ) =>
|
|
34
|
+
select( preferencesStore ).get( 'core', PREFERENCE_NAME ) ?? true,
|
|
35
|
+
[]
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const ref = useRef();
|
|
39
|
+
|
|
40
|
+
const { set: setPreference } = useDispatch( preferencesStore );
|
|
41
|
+
if ( ! isReusableBlocksRenameHint ) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<div ref={ ref } className="reusable-blocks-menu-items__rename-hint">
|
|
47
|
+
<div className="reusable-blocks-menu-items__rename-hint-content">
|
|
48
|
+
{ __(
|
|
49
|
+
'Reusable blocks are now synced patterns. A synced pattern will behave in exactly the same way as a reusable block.'
|
|
50
|
+
) }
|
|
51
|
+
</div>
|
|
52
|
+
<Button
|
|
53
|
+
className="reusable-blocks-menu-items__rename-hint-dismiss"
|
|
54
|
+
icon={ close }
|
|
55
|
+
iconSize="16"
|
|
56
|
+
label={ __( 'Dismiss hint' ) }
|
|
57
|
+
onClick={ () => {
|
|
58
|
+
// Retain focus when dismissing the element.
|
|
59
|
+
const previousElement = focus.tabbable.findPrevious(
|
|
60
|
+
ref.current
|
|
61
|
+
);
|
|
62
|
+
previousElement?.focus();
|
|
63
|
+
setPreference( 'core', PREFERENCE_NAME, false );
|
|
64
|
+
} }
|
|
65
|
+
showTooltip={ false }
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -13,6 +13,7 @@ import BlockTypesList from '../block-types-list';
|
|
|
13
13
|
import InserterPanel from './panel';
|
|
14
14
|
import InserterNoResults from './no-results';
|
|
15
15
|
import useBlockTypesState from './hooks/use-block-types-state';
|
|
16
|
+
import ReusableBlocksRenameHint from './reusable-block-rename-hint';
|
|
16
17
|
|
|
17
18
|
function ReusableBlocksList( { onHover, onInsert, rootClientId } ) {
|
|
18
19
|
const [ items, , , onSelectItem ] = useBlockTypesState(
|
|
@@ -54,6 +55,9 @@ function ReusableBlocksList( { onHover, onInsert, rootClientId } ) {
|
|
|
54
55
|
export function ReusableBlocksTab( { rootClientId, onInsert, onHover } ) {
|
|
55
56
|
return (
|
|
56
57
|
<>
|
|
58
|
+
<div className="block-editor-inserter__hint">
|
|
59
|
+
<ReusableBlocksRenameHint />
|
|
60
|
+
</div>
|
|
57
61
|
<ReusableBlocksList
|
|
58
62
|
onHover={ onHover }
|
|
59
63
|
onInsert={ onInsert }
|
|
@@ -67,7 +71,7 @@ export function ReusableBlocksTab( { rootClientId, onInsert, onHover } ) {
|
|
|
67
71
|
post_type: 'wp_block',
|
|
68
72
|
} ) }
|
|
69
73
|
>
|
|
70
|
-
{ __( 'Manage
|
|
74
|
+
{ __( 'Manage my patterns' ) }
|
|
71
75
|
</Button>
|
|
72
76
|
</div>
|
|
73
77
|
</>
|
|
@@ -28,11 +28,11 @@ function ReusableBlocksTab( { onSelect, rootClientId, listProps } ) {
|
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
30
|
<BlockTypesList
|
|
31
|
-
name="
|
|
31
|
+
name="SyncedPatterns"
|
|
32
32
|
sections={ sections }
|
|
33
33
|
onSelect={ onSelect }
|
|
34
34
|
listProps={ listProps }
|
|
35
|
-
label={ __( '
|
|
35
|
+
label={ __( 'Synced patterns' ) }
|
|
36
36
|
/>
|
|
37
37
|
);
|
|
38
38
|
}
|
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
/** @format */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
color: $
|
|
2
|
+
.inserter-menu__add-block-button {
|
|
3
|
+
border-radius: 2px;
|
|
4
|
+
background-color: $black;
|
|
5
|
+
margin: 9px $grid-unit-20 10px $grid-unit-20;
|
|
6
|
+
padding: 0;
|
|
5
7
|
}
|
|
6
8
|
|
|
7
|
-
.inserter-menu__add-block-button
|
|
8
|
-
color: $
|
|
9
|
+
.inserter-menu__add-block-button--dark {
|
|
10
|
+
background-color: $white;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
|
-
.inserter-menu__add-block-button-icon
|
|
13
|
+
.inserter-menu__add-block-button-icon {
|
|
12
14
|
color: $white;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
|
-
.inserter-menu__add-block-button {
|
|
16
|
-
|
|
17
|
-
background-color: $blue-50;
|
|
18
|
-
margin: 8px;
|
|
19
|
-
padding: 6px 16px 6px 12px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.inserter-menu__add-block-button--dark {
|
|
23
|
-
background-color: $blue-30;
|
|
17
|
+
.inserter-menu__add-block-button-icon--dark {
|
|
18
|
+
color: $black;
|
|
24
19
|
}
|
|
25
20
|
|
|
26
21
|
.inserter-menu__add-block-button-text {
|
|
@@ -711,3 +711,31 @@ $block-inserter-tabs-height: 44px;
|
|
|
711
711
|
margin: 0;
|
|
712
712
|
}
|
|
713
713
|
}
|
|
714
|
+
|
|
715
|
+
.block-editor-inserter__hint {
|
|
716
|
+
margin: $grid-unit-20 $grid-unit-20 0;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
.reusable-blocks-menu-items__rename-hint {
|
|
720
|
+
align-items: top;
|
|
721
|
+
background: $gray-100;
|
|
722
|
+
border-radius: $radius-block-ui;
|
|
723
|
+
color: $gray-900;
|
|
724
|
+
display: flex;
|
|
725
|
+
flex-direction: row;
|
|
726
|
+
max-width: 380px;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
.reusable-blocks-menu-items__rename-hint-content {
|
|
730
|
+
margin: $grid-unit-15 0 $grid-unit-15 $grid-unit-15;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
.reusable-blocks-menu-items__rename-hint-dismiss {
|
|
734
|
+
// The dismiss button has a lot of empty space through its padding.
|
|
735
|
+
// Apply margin to visually align the icon with the top of the text to its left.
|
|
736
|
+
margin: $grid-unit-05 $grid-unit-05 $grid-unit-05 0;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
.components-menu-group .reusable-blocks-menu-items__rename-hint {
|
|
740
|
+
margin: 0;
|
|
741
|
+
}
|
|
@@ -142,7 +142,11 @@ InserterTabs.Control = TabsControl;
|
|
|
142
142
|
|
|
143
143
|
InserterTabs.getTabs = () => [
|
|
144
144
|
{ name: 'blocks', title: __( 'Blocks' ), component: BlockTypesTab },
|
|
145
|
-
{
|
|
145
|
+
{
|
|
146
|
+
name: 'reusable',
|
|
147
|
+
title: __( 'Synced patterns' ),
|
|
148
|
+
component: ReusableBlocksTab,
|
|
149
|
+
},
|
|
146
150
|
];
|
|
147
151
|
|
|
148
152
|
export default InserterTabs;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { Draggable } from '@wordpress/components';
|
|
5
|
-
import { serialize } from '@wordpress/blocks';
|
|
5
|
+
import { serialize, store as blocksStore } from '@wordpress/blocks';
|
|
6
|
+
import { useSelect } from '@wordpress/data';
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
8
9
|
*/
|
|
@@ -20,6 +21,16 @@ const InserterDraggableBlocks = ( {
|
|
|
20
21
|
blocks,
|
|
21
22
|
};
|
|
22
23
|
|
|
24
|
+
const blockTypeIcon = useSelect(
|
|
25
|
+
( select ) => {
|
|
26
|
+
const { getBlockType } = select( blocksStore );
|
|
27
|
+
return (
|
|
28
|
+
blocks.length === 1 && getBlockType( blocks[ 0 ].name )?.icon
|
|
29
|
+
);
|
|
30
|
+
},
|
|
31
|
+
[ blocks ]
|
|
32
|
+
);
|
|
33
|
+
|
|
23
34
|
return (
|
|
24
35
|
<Draggable
|
|
25
36
|
__experimentalTransferDataType="wp-blocks"
|
|
@@ -30,7 +41,7 @@ const InserterDraggableBlocks = ( {
|
|
|
30
41
|
__experimentalDragComponent={
|
|
31
42
|
<BlockDraggableChip
|
|
32
43
|
count={ blocks.length }
|
|
33
|
-
icon={ icon }
|
|
44
|
+
icon={ icon || ( ! isPattern && blockTypeIcon ) }
|
|
34
45
|
isPattern={ isPattern }
|
|
35
46
|
/>
|
|
36
47
|
}
|
|
@@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
8
8
|
// order to handle it as a unique case.
|
|
9
9
|
export const CREATE_TYPE = '__CREATE__';
|
|
10
10
|
export const TEL_TYPE = 'tel';
|
|
11
|
-
export const URL_TYPE = '
|
|
11
|
+
export const URL_TYPE = 'link';
|
|
12
12
|
export const MAILTO_TYPE = 'mailto';
|
|
13
13
|
export const INTERNAL_TYPE = 'internal';
|
|
14
14
|
|
|
@@ -292,7 +292,8 @@ function LinkControl( {
|
|
|
292
292
|
const shownUnlinkControl =
|
|
293
293
|
onRemove && value && ! isEditingLink && ! isCreatingPage;
|
|
294
294
|
|
|
295
|
-
const showSettings = !! settings?.length;
|
|
295
|
+
const showSettings = !! settings?.length && isEditingLink && hasLinkValue;
|
|
296
|
+
const showActions = isEditingLink && hasLinkValue;
|
|
296
297
|
|
|
297
298
|
// Only show text control once a URL value has been committed
|
|
298
299
|
// and it isn't just empty whitespace.
|
|
@@ -322,6 +323,18 @@ function LinkControl( {
|
|
|
322
323
|
'has-text-control': showTextControl,
|
|
323
324
|
} ) }
|
|
324
325
|
>
|
|
326
|
+
{ showTextControl && (
|
|
327
|
+
<TextControl
|
|
328
|
+
__nextHasNoMarginBottom
|
|
329
|
+
ref={ textInputRef }
|
|
330
|
+
className="block-editor-link-control__field block-editor-link-control__text-content"
|
|
331
|
+
label={ __( 'Text' ) }
|
|
332
|
+
value={ internalControlValue?.title }
|
|
333
|
+
onChange={ setInternalTextInputValue }
|
|
334
|
+
onKeyDown={ handleSubmitWithEnter }
|
|
335
|
+
size="__unstable-large"
|
|
336
|
+
/>
|
|
337
|
+
) }
|
|
325
338
|
<LinkControlSearchInput
|
|
326
339
|
currentLink={ value }
|
|
327
340
|
className="block-editor-link-control__field block-editor-link-control__search-input"
|
|
@@ -339,19 +352,8 @@ function LinkControl( {
|
|
|
339
352
|
createSuggestionButtonText={
|
|
340
353
|
createSuggestionButtonText
|
|
341
354
|
}
|
|
342
|
-
|
|
355
|
+
hideLabelFromVision={ ! showTextControl }
|
|
343
356
|
/>
|
|
344
|
-
{ showTextControl && (
|
|
345
|
-
<TextControl
|
|
346
|
-
__nextHasNoMarginBottom
|
|
347
|
-
ref={ textInputRef }
|
|
348
|
-
className="block-editor-link-control__field block-editor-link-control__text-content"
|
|
349
|
-
label={ __( 'Text' ) }
|
|
350
|
-
value={ internalControlValue?.title }
|
|
351
|
-
onChange={ setInternalTextInputValue }
|
|
352
|
-
onKeyDown={ handleSubmitWithEnter }
|
|
353
|
-
/>
|
|
354
|
-
) }
|
|
355
357
|
</div>
|
|
356
358
|
{ errorMessage && (
|
|
357
359
|
<Notice
|
|
@@ -372,13 +374,16 @@ function LinkControl( {
|
|
|
372
374
|
onEditClick={ () => setIsEditingLink( true ) }
|
|
373
375
|
hasRichPreviews={ hasRichPreviews }
|
|
374
376
|
hasUnlinkControl={ shownUnlinkControl }
|
|
375
|
-
onRemove={
|
|
377
|
+
onRemove={ () => {
|
|
378
|
+
onRemove();
|
|
379
|
+
setIsEditingLink( true );
|
|
380
|
+
} }
|
|
376
381
|
/>
|
|
377
382
|
) }
|
|
378
383
|
|
|
379
|
-
{
|
|
384
|
+
{ showSettings && (
|
|
380
385
|
<div className="block-editor-link-control__tools">
|
|
381
|
-
{
|
|
386
|
+
{ ! currentInputIsEmpty && (
|
|
382
387
|
<LinkControlSettingsDrawer
|
|
383
388
|
settingsOpen={ settingsOpen }
|
|
384
389
|
setSettingsOpen={ setSettingsOpen }
|
|
@@ -392,20 +397,22 @@ function LinkControl( {
|
|
|
392
397
|
/>
|
|
393
398
|
</LinkControlSettingsDrawer>
|
|
394
399
|
) }
|
|
400
|
+
</div>
|
|
401
|
+
) }
|
|
395
402
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
</
|
|
403
|
+
{ showActions && (
|
|
404
|
+
<div className="block-editor-link-control__search-actions">
|
|
405
|
+
<Button
|
|
406
|
+
variant="primary"
|
|
407
|
+
onClick={ isDisabled ? noop : handleSubmit }
|
|
408
|
+
className="block-editor-link-control__search-submit"
|
|
409
|
+
aria-disabled={ isDisabled }
|
|
410
|
+
>
|
|
411
|
+
{ __( 'Save' ) }
|
|
412
|
+
</Button>
|
|
413
|
+
<Button variant="tertiary" onClick={ handleCancel }>
|
|
414
|
+
{ __( 'Cancel' ) }
|
|
415
|
+
</Button>
|
|
409
416
|
</div>
|
|
410
417
|
) }
|
|
411
418
|
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import classnames from 'classnames';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
9
4
|
import { __, sprintf } from '@wordpress/i18n';
|
|
10
|
-
import {
|
|
5
|
+
import { MenuItem } from '@wordpress/components';
|
|
11
6
|
import { createInterpolateElement } from '@wordpress/element';
|
|
12
|
-
import {
|
|
7
|
+
import { plus } from '@wordpress/icons';
|
|
13
8
|
|
|
14
9
|
export const LinkControlSearchCreate = ( {
|
|
15
10
|
searchTerm,
|
|
16
11
|
onClick,
|
|
17
12
|
itemProps,
|
|
18
|
-
isSelected,
|
|
19
13
|
buttonText,
|
|
20
14
|
} ) => {
|
|
21
15
|
if ( ! searchTerm ) {
|
|
@@ -40,27 +34,15 @@ export const LinkControlSearchCreate = ( {
|
|
|
40
34
|
}
|
|
41
35
|
|
|
42
36
|
return (
|
|
43
|
-
<
|
|
37
|
+
<MenuItem
|
|
44
38
|
{ ...itemProps }
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
'is-selected': isSelected,
|
|
49
|
-
}
|
|
50
|
-
) }
|
|
39
|
+
iconPosition="left"
|
|
40
|
+
icon={ plus }
|
|
41
|
+
className="block-editor-link-control__search-item"
|
|
51
42
|
onClick={ onClick }
|
|
52
43
|
>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
icon={ plus }
|
|
56
|
-
/>
|
|
57
|
-
|
|
58
|
-
<span className="block-editor-link-control__search-item-header">
|
|
59
|
-
<span className="block-editor-link-control__search-item-title">
|
|
60
|
-
{ text }
|
|
61
|
-
</span>
|
|
62
|
-
</span>
|
|
63
|
-
</Button>
|
|
44
|
+
{ text }
|
|
45
|
+
</MenuItem>
|
|
64
46
|
);
|
|
65
47
|
};
|
|
66
48
|
|