@wordpress/block-editor 12.13.0 → 12.15.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 -1
- package/build/components/block-heading-level-dropdown/index.js +1 -1
- package/build/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build/components/block-list/block.native.js +2 -0
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js +2 -9
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list-appender/index.js +16 -3
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-parent-selector/index.js +1 -1
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +25 -16
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +4 -2
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-patterns-list/index.js +36 -19
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-quick-navigation/index.js +6 -4
- package/build/components/block-quick-navigation/index.js.map +1 -1
- package/build/components/block-rename/index.js +28 -0
- package/build/components/block-rename/index.js.map +1 -0
- package/build/components/block-rename/is-empty-string.js +10 -0
- package/build/components/block-rename/is-empty-string.js.map +1 -0
- package/build/components/block-rename/modal.js +87 -0
- package/build/components/block-rename/modal.js.map +1 -0
- package/build/components/block-rename/rename-control.js +74 -0
- package/build/components/block-rename/rename-control.js.map +1 -0
- package/build/components/block-rename/use-block-rename.js +17 -0
- package/build/components/block-rename/use-block-rename.js.map +1 -0
- package/build/components/block-settings-menu/block-settings-dropdown.js +33 -20
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +7 -0
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-styles/index.js +0 -8
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +18 -14
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build/components/block-tools/back-compat.js +2 -2
- package/build/components/block-tools/back-compat.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +11 -81
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/empty-block-inserter.js +56 -0
- package/build/components/block-tools/empty-block-inserter.js.map +1 -0
- package/build/components/block-tools/index.js +48 -9
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/selected-block-tools.js +113 -0
- package/build/components/block-tools/selected-block-tools.js.map +1 -0
- package/build/components/block-tools/use-selected-block-tool-props.js +56 -0
- package/build/components/block-tools/use-selected-block-tool-props.js.map +1 -0
- package/build/components/block-types-list/index.js +6 -2
- package/build/components/block-types-list/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +8 -1
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/editable-text/index.js +1 -2
- package/build/components/editable-text/index.js.map +1 -1
- package/build/components/global-styles/advanced-panel.js +1 -1
- package/build/components/global-styles/advanced-panel.js.map +1 -1
- package/build/components/iframe/index.js +4 -3
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-size-control/index.js +0 -5
- package/build/components/image-size-control/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/warning-max-depth-exceeded.native.js +29 -31
- package/build/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/{explorer.js → index.js} +7 -7
- package/build/components/inserter/block-patterns-explorer/index.js.map +1 -0
- package/build/components/inserter/block-patterns-explorer/{sidebar.js → pattern-explorer-sidebar.js} +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -0
- package/build/components/inserter/block-patterns-explorer/{patterns-list.js → pattern-list.js} +4 -4
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -0
- package/build/components/inserter/block-patterns-tab/index.js +75 -0
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -0
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +48 -0
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -0
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +108 -0
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -0
- package/build/components/inserter/{block-patterns-filter.js → block-patterns-tab/patterns-filter.js} +18 -34
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -0
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +55 -0
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -0
- package/build/components/inserter/block-patterns-tab/utils.js +69 -0
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -0
- package/build/components/inserter/hooks/use-patterns-state.js +2 -1
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/media-tab/media-list.js +9 -5
- package/build/components/inserter/media-tab/media-list.js.map +1 -1
- package/build/components/inserter/media-tab/media-preview.js +15 -12
- package/build/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build/components/inserter/menu.js +3 -4
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter-listbox/index.js +11 -6
- package/build/components/inserter-listbox/index.js.map +1 -1
- package/build/components/inserter-listbox/item.js +24 -23
- package/build/components/inserter-listbox/item.js.map +1 -1
- package/build/components/inserter-listbox/row.js +5 -5
- package/build/components/inserter-listbox/row.js.map +1 -1
- package/build/components/link-control/index.js +6 -5
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/list-view/block-select-button.js +39 -0
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +16 -3
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/index.js +3 -2
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/use-list-view-expand-selected-item.js +2 -3
- package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +69 -18
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/preview-options/index.js +4 -2
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/provider/use-block-sync.js +1 -14
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/rich-text/index.js +0 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +4 -2
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/native/format-edit.js +45 -0
- package/build/components/rich-text/native/format-edit.js.map +1 -0
- package/build/components/rich-text/native/get-format-colors.native.js +41 -0
- package/build/components/rich-text/native/get-format-colors.native.js.map +1 -0
- package/build/components/rich-text/native/index.js +9 -0
- package/build/components/rich-text/native/index.js.map +1 -0
- package/build/components/rich-text/native/index.native.js +1189 -0
- package/build/components/rich-text/native/index.native.js.map +1 -0
- package/build/components/rich-text/native/toolbar-button-with-options.native.js +58 -0
- package/build/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -0
- package/build/components/rich-text/native/use-format-types.js +111 -0
- package/build/components/rich-text/native/use-format-types.js.map +1 -0
- package/build/components/rich-text/use-input-rules.js +30 -1
- package/build/components/rich-text/use-input-rules.js.map +1 -1
- package/build/components/rich-text/use-paste-handler.js +2 -5
- package/build/components/rich-text/use-paste-handler.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +2 -1
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +4 -1
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +2 -1
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-settings/index.js +2 -2
- package/build/components/use-settings/index.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +7 -3
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/align.js +10 -10
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/align.native.js +2 -2
- package/build/hooks/align.native.js.map +1 -1
- package/build/hooks/anchor.js +7 -6
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/background.js +16 -4
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-hooks.js +7 -8
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-renaming.js +42 -0
- package/build/hooks/block-renaming.js.map +1 -1
- package/build/hooks/content-lock-ui.js +5 -5
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/custom-class-name.js +8 -7
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/custom-fields.js +57 -52
- package/build/hooks/custom-fields.js.map +1 -1
- package/build/hooks/duotone.js +9 -20
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout.js +103 -93
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/position.js +10 -9
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/style.js +10 -13
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/utils.js +30 -0
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +4 -3
- package/build/layouts/constrained.js.map +1 -1
- package/build/private-apis.js +3 -0
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +30 -37
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +18 -0
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +18 -13
- package/build/store/selectors.js.map +1 -1
- package/build/utils/transform-styles/index.js +26 -6
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.js +1 -1
- package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build-module/components/block-list/block.native.js +2 -0
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +3 -10
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list-appender/index.js +16 -3
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +1 -1
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +24 -15
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +4 -2
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +36 -19
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-quick-navigation/index.js +7 -5
- package/build-module/components/block-quick-navigation/index.js.map +1 -1
- package/build-module/components/block-rename/index.js +4 -0
- package/build-module/components/block-rename/index.js.map +1 -0
- package/build-module/components/block-rename/is-empty-string.js +4 -0
- package/build-module/components/block-rename/is-empty-string.js.map +1 -0
- package/build-module/components/block-rename/modal.js +79 -0
- package/build-module/components/block-rename/modal.js.map +1 -0
- package/build-module/components/block-rename/rename-control.js +66 -0
- package/build-module/components/block-rename/rename-control.js.map +1 -0
- package/build-module/components/block-rename/use-block-rename.js +10 -0
- package/build-module/components/block-rename/use-block-rename.js.map +1 -0
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +34 -21
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +7 -0
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +0 -8
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +17 -13
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build-module/components/block-tools/back-compat.js +1 -1
- package/build-module/components/block-tools/back-compat.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +11 -80
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-tools/empty-block-inserter.js +48 -0
- package/build-module/components/block-tools/empty-block-inserter.js.map +1 -0
- package/build-module/components/block-tools/index.js +48 -9
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/selected-block-tools.js +105 -0
- package/build-module/components/block-tools/selected-block-tools.js.map +1 -0
- package/build-module/components/block-tools/use-selected-block-tool-props.js +50 -0
- package/build-module/components/block-tools/use-selected-block-tool-props.js.map +1 -0
- package/build-module/components/block-types-list/index.js +6 -2
- package/build-module/components/block-types-list/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +8 -1
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/editable-text/index.js +1 -2
- package/build-module/components/editable-text/index.js.map +1 -1
- package/build-module/components/global-styles/advanced-panel.js +1 -1
- package/build-module/components/global-styles/advanced-panel.js.map +1 -1
- package/build-module/components/iframe/index.js +4 -3
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-size-control/index.js +0 -5
- package/build-module/components/image-size-control/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/warning-max-depth-exceeded.native.js +30 -32
- package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/{explorer.js → index.js} +5 -5
- package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -0
- package/build-module/components/inserter/block-patterns-explorer/{sidebar.js → pattern-explorer-sidebar.js} +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -0
- package/build-module/components/inserter/block-patterns-explorer/{patterns-list.js → pattern-list.js} +3 -3
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab/index.js +66 -0
- package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +42 -0
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +100 -0
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -0
- package/build-module/components/inserter/{block-patterns-filter.js → block-patterns-tab/patterns-filter.js} +7 -20
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +47 -0
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab/utils.js +57 -0
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -0
- package/build-module/components/inserter/hooks/use-patterns-state.js +2 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-list.js +9 -5
- package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-preview.js +15 -12
- package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build-module/components/inserter/menu.js +4 -3
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter-listbox/index.js +13 -8
- package/build-module/components/inserter-listbox/index.js.map +1 -1
- package/build-module/components/inserter-listbox/item.js +25 -23
- package/build-module/components/inserter-listbox/item.js.map +1 -1
- package/build-module/components/inserter-listbox/row.js +6 -5
- package/build-module/components/inserter-listbox/row.js.map +1 -1
- package/build-module/components/link-control/index.js +7 -6
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +39 -0
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +16 -3
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/index.js +3 -2
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-list-view-expand-selected-item.js +2 -3
- package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +69 -17
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/preview-options/index.js +4 -2
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +1 -14
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/rich-text/index.js +0 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +4 -2
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/format-edit.js +38 -0
- package/build-module/components/rich-text/native/format-edit.js.map +1 -0
- package/build-module/components/rich-text/native/get-format-colors.native.js +34 -0
- package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -0
- package/build-module/components/rich-text/native/index.js +2 -0
- package/build-module/components/rich-text/native/index.js.map +1 -0
- package/build-module/components/rich-text/native/index.native.js +1179 -0
- package/build-module/components/rich-text/native/index.native.js.map +1 -0
- package/build-module/components/rich-text/native/toolbar-button-with-options.native.js +51 -0
- package/build-module/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -0
- package/build-module/components/rich-text/native/use-format-types.js +104 -0
- package/build-module/components/rich-text/native/use-format-types.js.map +1 -0
- package/build-module/components/rich-text/use-input-rules.js +31 -2
- package/build-module/components/rich-text/use-input-rules.js.map +1 -1
- package/build-module/components/rich-text/use-paste-handler.js +2 -5
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +2 -1
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +4 -1
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +2 -1
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +2 -2
- package/build-module/components/use-settings/index.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +7 -3
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/align.js +8 -8
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/align.native.js +2 -2
- package/build-module/hooks/align.native.js.map +1 -1
- package/build-module/hooks/anchor.js +5 -4
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/background.js +17 -5
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-hooks.js +5 -6
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-renaming.js +40 -0
- package/build-module/hooks/block-renaming.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +3 -3
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/custom-class-name.js +6 -5
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/custom-fields.js +57 -52
- package/build-module/hooks/custom-fields.js.map +1 -1
- package/build-module/hooks/duotone.js +10 -21
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/index.js +0 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/layout.js +103 -93
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/position.js +11 -10
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/style.js +10 -13
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/utils.js +30 -1
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +4 -3
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/private-apis.js +4 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +29 -37
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +17 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +17 -13
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +24 -7
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +6 -6
- package/build-style/content.css +6 -6
- package/build-style/style-rtl.css +26 -20
- package/build-style/style.css +26 -20
- package/package.json +31 -31
- package/src/components/block-heading-level-dropdown/index.js +1 -1
- package/src/components/block-list/block.native.js +2 -0
- package/src/components/block-list/index.js +4 -18
- package/src/components/block-list-appender/index.js +20 -4
- package/src/components/block-parent-selector/index.js +1 -1
- package/src/components/block-pattern-setup/index.js +38 -22
- package/src/components/block-pattern-setup/setup-toolbar.js +2 -0
- package/src/components/block-pattern-setup/style.scss +4 -1
- package/src/components/block-patterns-list/README.md +4 -4
- package/src/components/block-patterns-list/index.js +60 -34
- package/src/components/block-patterns-list/style.scss +7 -0
- package/src/components/block-quick-navigation/index.js +11 -5
- package/src/components/block-rename/index.js +3 -0
- package/src/components/block-rename/is-empty-string.js +3 -0
- package/src/components/block-rename/modal.js +115 -0
- package/src/components/block-rename/rename-control.js +80 -0
- package/src/components/block-rename/use-block-rename.js +10 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +38 -34
- package/src/components/block-settings-menu-controls/index.js +9 -0
- package/src/components/block-styles/index.js +0 -10
- package/src/components/block-switcher/pattern-transformations-menu.js +20 -14
- package/src/components/block-toolbar/block-toolbar-menu.native.js +1 -4
- package/src/components/block-toolbar/style.scss +8 -0
- package/src/components/block-tools/back-compat.js +1 -1
- package/src/components/block-tools/block-contextual-toolbar.js +11 -134
- package/src/components/block-tools/empty-block-inserter.js +56 -0
- package/src/components/block-tools/index.js +72 -16
- package/src/components/block-tools/selected-block-tools.js +127 -0
- package/src/components/block-tools/style.scss +0 -10
- package/src/components/block-tools/use-selected-block-tool-props.js +66 -0
- package/src/components/block-types-list/index.js +5 -4
- package/src/components/button-block-appender/content.scss +2 -2
- package/src/components/date-format-picker/index.js +7 -0
- package/src/components/editable-text/README.md +0 -36
- package/src/components/editable-text/index.js +1 -8
- package/src/components/global-styles/advanced-panel.js +1 -1
- package/src/components/iframe/index.js +4 -3
- package/src/components/image-size-control/index.js +0 -6
- package/src/components/inner-blocks/index.js +6 -2
- package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +57 -33
- package/src/components/inserter/block-patterns-explorer/{explorer.js → index.js} +4 -4
- package/src/components/inserter/block-patterns-explorer/{patterns-list.js → pattern-list.js} +9 -2
- package/src/components/inserter/block-patterns-tab/index.js +118 -0
- package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +48 -0
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +179 -0
- package/src/components/inserter/{block-patterns-filter.js → block-patterns-tab/patterns-filter.js} +15 -21
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +101 -0
- package/src/components/inserter/block-patterns-tab/utils.js +78 -0
- package/src/components/inserter/hooks/use-patterns-state.js +3 -1
- package/src/components/inserter/media-tab/media-list.js +7 -7
- package/src/components/inserter/media-tab/media-preview.js +27 -22
- package/src/components/inserter/menu.js +4 -5
- package/src/components/inserter-listbox/index.js +11 -7
- package/src/components/inserter-listbox/item.js +11 -12
- package/src/components/inserter-listbox/row.js +6 -12
- package/src/components/link-control/README.md +2 -2
- package/src/components/link-control/index.js +15 -6
- package/src/components/link-control/style.scss +8 -5
- package/src/components/list-view/block-select-button.js +44 -1
- package/src/components/list-view/block.js +11 -11
- package/src/components/list-view/index.js +2 -0
- package/src/components/list-view/use-list-view-expand-selected-item.js +7 -8
- package/src/components/media-replace-flow/style.scss +2 -2
- package/src/components/navigable-toolbar/index.js +71 -25
- package/src/components/plain-text/README.md +2 -30
- package/src/components/preview-options/index.js +2 -0
- package/src/components/provider/use-block-sync.js +2 -21
- package/src/components/rich-text/README.md +6 -63
- package/src/components/rich-text/index.js +0 -1
- package/src/components/rich-text/index.native.js +4 -2
- package/src/components/rich-text/native/format-edit.js +44 -0
- package/src/components/rich-text/native/get-format-colors.native.js +54 -0
- package/src/components/rich-text/native/index.js +1 -0
- package/src/components/rich-text/native/index.native.js +1406 -0
- package/src/components/rich-text/native/style.native.scss +28 -0
- package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +79 -0
- package/src/components/rich-text/native/test/index.native.js +278 -0
- package/src/components/rich-text/native/test/performance/rich-text.native.js +44 -0
- package/src/components/rich-text/native/toolbar-button-with-options.native.js +61 -0
- package/src/components/rich-text/native/use-format-types.js +146 -0
- package/src/components/rich-text/use-input-rules.js +30 -2
- package/src/components/rich-text/use-paste-handler.js +1 -6
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/src/components/url-input/README.md +1 -74
- package/src/components/url-popover/image-url-input-ui.js +1 -0
- package/src/components/use-block-drop-zone/index.js +4 -1
- package/src/components/use-moving-animation/index.js +1 -1
- package/src/components/use-settings/index.js +2 -2
- package/src/components/use-settings/test/index.js +1 -1
- package/src/components/writing-flow/use-tab-nav.js +8 -3
- package/src/hooks/align.js +8 -8
- package/src/hooks/align.native.js +2 -2
- package/src/hooks/anchor.js +21 -23
- package/src/hooks/background.js +28 -6
- package/src/hooks/block-hooks.js +20 -16
- package/src/hooks/block-renaming.js +47 -0
- package/src/hooks/content-lock-ui.js +3 -3
- package/src/hooks/custom-class-name.js +7 -6
- package/src/hooks/custom-fields.js +73 -70
- package/src/hooks/duotone.js +23 -33
- package/src/hooks/index.js +0 -1
- package/src/hooks/layout.js +126 -113
- package/src/hooks/position.js +8 -21
- package/src/hooks/style.js +17 -31
- package/src/hooks/test/__snapshots__/align.native.js.snap +5 -5
- package/src/hooks/test/align.js +4 -4
- package/src/hooks/utils.js +33 -1
- package/src/layouts/constrained.js +57 -50
- package/src/private-apis.js +4 -1
- package/src/store/actions.js +26 -72
- package/src/store/reducer.js +19 -0
- package/src/store/selectors.js +15 -19
- package/src/style.scss +1 -1
- package/src/utils/test/transform-styles.js +49 -0
- package/src/utils/transform-styles/index.js +39 -13
- package/build/components/block-tools/selected-block-popover.js +0 -221
- package/build/components/block-tools/selected-block-popover.js.map +0 -1
- package/build/components/inserter/block-patterns-explorer/explorer.js.map +0 -1
- package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +0 -1
- package/build/components/inserter/block-patterns-explorer/sidebar.js.map +0 -1
- package/build/components/inserter/block-patterns-filter.js.map +0 -1
- package/build/components/inserter/block-patterns-tab.js +0 -270
- package/build/components/inserter/block-patterns-tab.js.map +0 -1
- package/build/hooks/block-rename-ui.js +0 -165
- package/build/hooks/block-rename-ui.js.map +0 -1
- package/build/store/utils.js +0 -22
- package/build/store/utils.js.map +0 -1
- package/build-module/components/block-tools/selected-block-popover.js +0 -213
- package/build-module/components/block-tools/selected-block-popover.js.map +0 -1
- package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +0 -1
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +0 -1
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +0 -1
- package/build-module/components/inserter/block-patterns-filter.js.map +0 -1
- package/build-module/components/inserter/block-patterns-tab.js +0 -254
- package/build-module/components/inserter/block-patterns-tab.js.map +0 -1
- package/build-module/hooks/block-rename-ui.js +0 -157
- package/build-module/hooks/block-rename-ui.js.map +0 -1
- package/build-module/store/utils.js +0 -16
- package/build-module/store/utils.js.map +0 -1
- package/src/components/block-tools/selected-block-popover.js +0 -265
- package/src/components/inserter/block-patterns-tab.js +0 -448
- package/src/hooks/block-rename-ui.js +0 -226
- package/src/store/utils.js +0 -12
- /package/src/{hooks/block-rename-ui.scss → components/block-rename/style.scss} +0 -0
- /package/src/components/inserter/block-patterns-explorer/{sidebar.js → pattern-explorer-sidebar.js} +0 -0
|
@@ -7,7 +7,6 @@ import classnames from 'classnames';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import {
|
|
10
|
-
__unstableCompositeItem as CompositeItem,
|
|
11
10
|
Tooltip,
|
|
12
11
|
DropdownMenu,
|
|
13
12
|
MenuGroup,
|
|
@@ -17,6 +16,7 @@ import {
|
|
|
17
16
|
Flex,
|
|
18
17
|
FlexItem,
|
|
19
18
|
Button,
|
|
19
|
+
privateApis as componentsPrivateApis,
|
|
20
20
|
__experimentalVStack as VStack,
|
|
21
21
|
} from '@wordpress/components';
|
|
22
22
|
import { __, sprintf } from '@wordpress/i18n';
|
|
@@ -33,6 +33,7 @@ import { isBlobURL } from '@wordpress/blob';
|
|
|
33
33
|
import InserterDraggableBlocks from '../../inserter-draggable-blocks';
|
|
34
34
|
import { getBlockAndPreviewFromMedia } from './utils';
|
|
35
35
|
import { store as blockEditorStore } from '../../../store';
|
|
36
|
+
import { unlock } from '../../../lock-unlock';
|
|
36
37
|
|
|
37
38
|
const ALLOWED_MEDIA_TYPES = [ 'image' ];
|
|
38
39
|
const MAXIMUM_TITLE_LENGTH = 25;
|
|
@@ -42,6 +43,8 @@ const MEDIA_OPTIONS_POPOVER_PROPS = {
|
|
|
42
43
|
'block-editor-inserter__media-list__item-preview-options__popover',
|
|
43
44
|
};
|
|
44
45
|
|
|
46
|
+
const { CompositeItemV2: CompositeItem } = unlock( componentsPrivateApis );
|
|
47
|
+
|
|
45
48
|
function MediaPreviewOptions( { category, media } ) {
|
|
46
49
|
if ( ! category.getReportUrl ) {
|
|
47
50
|
return null;
|
|
@@ -113,7 +116,7 @@ function InsertExternalImageModal( { onClose, onSubmit } ) {
|
|
|
113
116
|
);
|
|
114
117
|
}
|
|
115
118
|
|
|
116
|
-
export function MediaPreview( { media, onClick,
|
|
119
|
+
export function MediaPreview( { media, onClick, category } ) {
|
|
117
120
|
const [ showExternalUploadModal, setShowExternalUploadModal ] =
|
|
118
121
|
useState( false );
|
|
119
122
|
const [ isHovered, setIsHovered ] = useState( false );
|
|
@@ -216,20 +219,22 @@ export function MediaPreview( { media, onClick, composite, category } ) {
|
|
|
216
219
|
onDragStart={ onDragStart }
|
|
217
220
|
onDragEnd={ onDragEnd }
|
|
218
221
|
>
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
>
|
|
222
|
+
{ /* Adding `is-hovered` class to the wrapper element is needed
|
|
223
|
+
because the options Popover is rendered outside of this node. */ }
|
|
224
|
+
<div
|
|
225
|
+
onMouseEnter={ onMouseEnter }
|
|
226
|
+
onMouseLeave={ onMouseLeave }
|
|
227
|
+
>
|
|
228
|
+
<Tooltip text={ truncatedTitle || title }>
|
|
226
229
|
<CompositeItem
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
230
|
+
render={
|
|
231
|
+
<div
|
|
232
|
+
aria-label={ title }
|
|
233
|
+
role="option"
|
|
234
|
+
className="block-editor-inserter__media-list__item"
|
|
235
|
+
/>
|
|
236
|
+
}
|
|
231
237
|
onClick={ () => onMediaInsert( block ) }
|
|
232
|
-
aria-label={ title }
|
|
233
238
|
>
|
|
234
239
|
<div className="block-editor-inserter__media-list__item-preview">
|
|
235
240
|
{ preview }
|
|
@@ -240,14 +245,14 @@ export function MediaPreview( { media, onClick, composite, category } ) {
|
|
|
240
245
|
) }
|
|
241
246
|
</div>
|
|
242
247
|
</CompositeItem>
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
</
|
|
248
|
+
</Tooltip>
|
|
249
|
+
{ ! isInserting && (
|
|
250
|
+
<MediaPreviewOptions
|
|
251
|
+
category={ category }
|
|
252
|
+
media={ media }
|
|
253
|
+
/>
|
|
254
|
+
) }
|
|
255
|
+
</div>
|
|
251
256
|
</div>
|
|
252
257
|
) }
|
|
253
258
|
</InserterDraggableBlocks>
|
|
@@ -24,9 +24,8 @@ import { useSelect } from '@wordpress/data';
|
|
|
24
24
|
import Tips from './tips';
|
|
25
25
|
import InserterPreviewPanel from './preview-panel';
|
|
26
26
|
import BlockTypesTab from './block-types-tab';
|
|
27
|
-
import
|
|
28
|
-
|
|
29
|
-
} from './block-patterns-tab';
|
|
27
|
+
import BlockPatternsTab from './block-patterns-tab';
|
|
28
|
+
import { PatternCategoryPreviewPanel } from './block-patterns-tab/pattern-category-preview-panel';
|
|
30
29
|
import { MediaTab, MediaCategoryDialog, useMediaCategories } from './media-tab';
|
|
31
30
|
import InserterSearchResults from './search-results';
|
|
32
31
|
import useDebouncedInput from './hooks/use-debounced-input';
|
|
@@ -160,7 +159,7 @@ function InserterMenu(
|
|
|
160
159
|
|
|
161
160
|
const patternsTab = useMemo(
|
|
162
161
|
() => (
|
|
163
|
-
<
|
|
162
|
+
<BlockPatternsTab
|
|
164
163
|
rootClientId={ destinationRootClientId }
|
|
165
164
|
onInsert={ onInsertPattern }
|
|
166
165
|
onSelectCategory={ onClickPatternCategory }
|
|
@@ -297,7 +296,7 @@ function InserterMenu(
|
|
|
297
296
|
<InserterPreviewPanel item={ hoveredItem } />
|
|
298
297
|
) }
|
|
299
298
|
{ showPatternPanel && (
|
|
300
|
-
<
|
|
299
|
+
<PatternCategoryPreviewPanel
|
|
301
300
|
rootClientId={ destinationRootClientId }
|
|
302
301
|
onInsert={ onInsertPattern }
|
|
303
302
|
onHover={ onHoverPattern }
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import
|
|
9
|
+
import { unlock } from '../../lock-unlock';
|
|
10
10
|
|
|
11
11
|
export { default as InserterListboxGroup } from './group';
|
|
12
12
|
export { default as InserterListboxRow } from './row';
|
|
13
13
|
export { default as InserterListboxItem } from './item';
|
|
14
14
|
|
|
15
|
+
const { CompositeV2: Composite, useCompositeStoreV2: useCompositeStore } =
|
|
16
|
+
unlock( componentsPrivateApis );
|
|
17
|
+
|
|
15
18
|
function InserterListbox( { children } ) {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
const store = useCompositeStore( {
|
|
20
|
+
focusShift: true,
|
|
21
|
+
focusWrap: 'horizontal',
|
|
19
22
|
} );
|
|
23
|
+
|
|
20
24
|
return (
|
|
21
|
-
<
|
|
25
|
+
<Composite store={ store } render={ <></> }>
|
|
22
26
|
{ children }
|
|
23
|
-
</
|
|
27
|
+
</Composite>
|
|
24
28
|
);
|
|
25
29
|
}
|
|
26
30
|
|
|
@@ -3,32 +3,31 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
5
|
Button,
|
|
6
|
-
|
|
6
|
+
privateApis as componentsPrivateApis,
|
|
7
7
|
} from '@wordpress/components';
|
|
8
|
-
import { forwardRef
|
|
8
|
+
import { forwardRef } from '@wordpress/element';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
|
-
import
|
|
13
|
+
import { unlock } from '../../lock-unlock';
|
|
14
|
+
|
|
15
|
+
const { CompositeItemV2: CompositeItem } = unlock( componentsPrivateApis );
|
|
14
16
|
|
|
15
17
|
function InserterListboxItem(
|
|
16
18
|
{ isFirst, as: Component, children, ...props },
|
|
17
19
|
ref
|
|
18
20
|
) {
|
|
19
|
-
const state = useContext( InserterListboxContext );
|
|
20
21
|
return (
|
|
21
22
|
<CompositeItem
|
|
22
23
|
ref={ ref }
|
|
23
|
-
state={ state }
|
|
24
24
|
role="option"
|
|
25
|
-
// Use the CompositeItem `
|
|
26
|
-
// isFocusable
|
|
27
|
-
// with tab order in the inserter list.
|
|
28
|
-
|
|
25
|
+
// Use the CompositeItem `accessibleWhenDisabled` prop
|
|
26
|
+
// over Button's `isFocusable`. The latter was shown to
|
|
27
|
+
// cause an issue with tab order in the inserter list.
|
|
28
|
+
accessibleWhenDisabled
|
|
29
29
|
{ ...props }
|
|
30
|
-
|
|
31
|
-
{ ( htmlProps ) => {
|
|
30
|
+
render={ ( htmlProps ) => {
|
|
32
31
|
const propsWithTabIndex = {
|
|
33
32
|
...htmlProps,
|
|
34
33
|
tabIndex: isFirst ? 0 : htmlProps.tabIndex,
|
|
@@ -45,7 +44,7 @@ function InserterListboxItem(
|
|
|
45
44
|
}
|
|
46
45
|
return <Button { ...propsWithTabIndex }>{ children }</Button>;
|
|
47
46
|
} }
|
|
48
|
-
|
|
47
|
+
/>
|
|
49
48
|
);
|
|
50
49
|
}
|
|
51
50
|
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { forwardRef
|
|
5
|
-
import {
|
|
4
|
+
import { forwardRef } from '@wordpress/element';
|
|
5
|
+
import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import
|
|
10
|
+
import { unlock } from '../../lock-unlock';
|
|
11
|
+
|
|
12
|
+
const { CompositeGroupV2: CompositeGroup } = unlock( componentsPrivateApis );
|
|
11
13
|
|
|
12
14
|
function InserterListboxRow( props, ref ) {
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<CompositeGroup
|
|
16
|
-
state={ state }
|
|
17
|
-
role="presentation"
|
|
18
|
-
ref={ ref }
|
|
19
|
-
{ ...props }
|
|
20
|
-
/>
|
|
21
|
-
);
|
|
15
|
+
return <CompositeGroup role="presentation" ref={ ref } { ...props } />;
|
|
22
16
|
}
|
|
23
17
|
|
|
24
18
|
export default forwardRef( InserterListboxRow );
|
|
@@ -275,14 +275,14 @@ If passed, children are rendered after the input.
|
|
|
275
275
|
|
|
276
276
|
```jsx
|
|
277
277
|
<LinkControlSearchInput>
|
|
278
|
-
<
|
|
278
|
+
<HStack justify="right">
|
|
279
279
|
<Button
|
|
280
280
|
type="submit"
|
|
281
281
|
label={ __( 'Submit' ) }
|
|
282
282
|
icon={ keyboardReturn }
|
|
283
283
|
className="block-editor-link-control__search-submit"
|
|
284
284
|
/>
|
|
285
|
-
</
|
|
285
|
+
</HStack>
|
|
286
286
|
</LinkControlSearchInput>
|
|
287
287
|
```
|
|
288
288
|
|
|
@@ -6,7 +6,13 @@ import classnames from 'classnames';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
Button,
|
|
11
|
+
Spinner,
|
|
12
|
+
Notice,
|
|
13
|
+
TextControl,
|
|
14
|
+
__experimentalHStack as HStack,
|
|
15
|
+
} from '@wordpress/components';
|
|
10
16
|
import { __ } from '@wordpress/i18n';
|
|
11
17
|
import { useRef, useState, useEffect } from '@wordpress/element';
|
|
12
18
|
import { focus } from '@wordpress/dom';
|
|
@@ -467,7 +473,13 @@ function LinkControl( {
|
|
|
467
473
|
) }
|
|
468
474
|
|
|
469
475
|
{ showActions && (
|
|
470
|
-
<
|
|
476
|
+
<HStack
|
|
477
|
+
justify="right"
|
|
478
|
+
className="block-editor-link-control__search-actions"
|
|
479
|
+
>
|
|
480
|
+
<Button variant="tertiary" onClick={ handleCancel }>
|
|
481
|
+
{ __( 'Cancel' ) }
|
|
482
|
+
</Button>
|
|
471
483
|
<Button
|
|
472
484
|
variant="primary"
|
|
473
485
|
onClick={ isDisabled ? noop : handleSubmit }
|
|
@@ -476,10 +488,7 @@ function LinkControl( {
|
|
|
476
488
|
>
|
|
477
489
|
{ __( 'Save' ) }
|
|
478
490
|
</Button>
|
|
479
|
-
|
|
480
|
-
{ __( 'Cancel' ) }
|
|
481
|
-
</Button>
|
|
482
|
-
</div>
|
|
491
|
+
</HStack>
|
|
483
492
|
) }
|
|
484
493
|
|
|
485
494
|
{ renderControlBottom && renderControlBottom() }
|
|
@@ -61,6 +61,10 @@ $preview-image-height: 140px;
|
|
|
61
61
|
.block-editor-link-control__field {
|
|
62
62
|
margin: $grid-unit-20; // allow margin collapse for vertical spacing.
|
|
63
63
|
|
|
64
|
+
.components-base-control__label {
|
|
65
|
+
color: $gray-900;
|
|
66
|
+
}
|
|
67
|
+
|
|
64
68
|
input[type="text"],
|
|
65
69
|
// Specificity overide of URLInput defaults.
|
|
66
70
|
&.block-editor-url-input input[type="text"].block-editor-url-input__input {
|
|
@@ -92,12 +96,7 @@ $preview-image-height: 140px;
|
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
.block-editor-link-control__search-actions {
|
|
95
|
-
display: flex;
|
|
96
|
-
flex-direction: row-reverse; // put "Cancel" on the left but retain DOM order.
|
|
97
|
-
justify-content: flex-start;
|
|
98
|
-
gap: $grid-unit-10;
|
|
99
99
|
padding: $grid-unit-10 $grid-unit-20 $grid-unit-20;
|
|
100
|
-
order: 20;
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
.block-editor-link-control__search-results-wrapper {
|
|
@@ -419,6 +418,10 @@ $preview-image-height: 140px;
|
|
|
419
418
|
|
|
420
419
|
.components-base-control__field {
|
|
421
420
|
display: flex; // don't allow label to wrap under checkbox.
|
|
421
|
+
|
|
422
|
+
.components-checkbox-control__label {
|
|
423
|
+
color: $gray-900;
|
|
424
|
+
}
|
|
422
425
|
}
|
|
423
426
|
|
|
424
427
|
// Cancel left margin inherited from WP Admin Forms CSS.
|
|
@@ -19,6 +19,7 @@ import { SPACE, ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';
|
|
|
19
19
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
20
20
|
import { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordpress/keyboard-shortcuts';
|
|
21
21
|
import { __, sprintf } from '@wordpress/i18n';
|
|
22
|
+
import isShallowEqual from '@wordpress/is-shallow-equal';
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* Internal dependencies
|
|
@@ -30,6 +31,7 @@ import ListViewExpander from './expander';
|
|
|
30
31
|
import { useBlockLock } from '../block-lock';
|
|
31
32
|
import { store as blockEditorStore } from '../../store';
|
|
32
33
|
import useListViewImages from './use-list-view-images';
|
|
34
|
+
import { useListViewContext } from './context';
|
|
33
35
|
|
|
34
36
|
function ListViewBlockSelectButton(
|
|
35
37
|
{
|
|
@@ -64,10 +66,12 @@ function ListViewBlockSelectButton(
|
|
|
64
66
|
getBlocksByClientId,
|
|
65
67
|
canRemoveBlocks,
|
|
66
68
|
} = useSelect( blockEditorStore );
|
|
67
|
-
const { duplicateBlocks, removeBlocks } =
|
|
69
|
+
const { duplicateBlocks, multiSelect, removeBlocks } =
|
|
70
|
+
useDispatch( blockEditorStore );
|
|
68
71
|
const isMatch = useShortcutEventMatch();
|
|
69
72
|
const isSticky = blockInformation?.positionType === 'sticky';
|
|
70
73
|
const images = useListViewImages( { clientId, isExpanded } );
|
|
74
|
+
const { rootClientId } = useListViewContext();
|
|
71
75
|
|
|
72
76
|
const positionLabel = blockInformation?.positionLabel
|
|
73
77
|
? sprintf(
|
|
@@ -183,6 +187,45 @@ function ListViewBlockSelectButton(
|
|
|
183
187
|
updateFocusAndSelection( updatedBlocks[ 0 ], false );
|
|
184
188
|
}
|
|
185
189
|
}
|
|
190
|
+
} else if ( isMatch( 'core/block-editor/select-all', event ) ) {
|
|
191
|
+
if ( event.defaultPrevented ) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
event.preventDefault();
|
|
195
|
+
|
|
196
|
+
const { firstBlockRootClientId, selectedBlockClientIds } =
|
|
197
|
+
getBlocksToUpdate();
|
|
198
|
+
const blockClientIds = getBlockOrder( firstBlockRootClientId );
|
|
199
|
+
if ( ! blockClientIds.length ) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// If we have selected all sibling nested blocks, try selecting up a level.
|
|
204
|
+
// This is a similar implementation to that used by `useSelectAll`.
|
|
205
|
+
// `isShallowEqual` is used for the list view instead of a length check,
|
|
206
|
+
// as the array of siblings of the currently focused block may be a different
|
|
207
|
+
// set of blocks from the current block selection if the user is focused
|
|
208
|
+
// on a different part of the list view from the block selection.
|
|
209
|
+
if ( isShallowEqual( selectedBlockClientIds, blockClientIds ) ) {
|
|
210
|
+
// Only select up a level if the first block is not the root block.
|
|
211
|
+
// This ensures that the block selection can't break out of the root block
|
|
212
|
+
// used by the list view, if the list view is only showing a partial hierarchy.
|
|
213
|
+
if (
|
|
214
|
+
firstBlockRootClientId &&
|
|
215
|
+
firstBlockRootClientId !== rootClientId
|
|
216
|
+
) {
|
|
217
|
+
updateFocusAndSelection( firstBlockRootClientId, true );
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Select all while passing `null` to skip focusing to the editor canvas,
|
|
223
|
+
// and retain focus within the list view.
|
|
224
|
+
multiSelect(
|
|
225
|
+
blockClientIds[ 0 ],
|
|
226
|
+
blockClientIds[ blockClientIds.length - 1 ],
|
|
227
|
+
null
|
|
228
|
+
);
|
|
186
229
|
}
|
|
187
230
|
}
|
|
188
231
|
|
|
@@ -69,17 +69,17 @@ function ListViewBlock( {
|
|
|
69
69
|
const blockTitle =
|
|
70
70
|
blockInformation?.name || blockInformation?.title || __( 'Untitled' );
|
|
71
71
|
|
|
72
|
-
const block = useSelect(
|
|
73
|
-
( select ) =>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
72
|
+
const { block, blockName, blockEditingMode } = useSelect(
|
|
73
|
+
( select ) => {
|
|
74
|
+
const { getBlock, getBlockName, getBlockEditingMode } =
|
|
75
|
+
select( blockEditorStore );
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
block: getBlock( clientId ),
|
|
79
|
+
blockName: getBlockName( clientId ),
|
|
80
|
+
blockEditingMode: getBlockEditingMode( clientId ),
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
83
|
[ clientId ]
|
|
84
84
|
);
|
|
85
85
|
|
|
@@ -222,6 +222,7 @@ function ListViewComponent(
|
|
|
222
222
|
insertedBlock,
|
|
223
223
|
setInsertedBlock,
|
|
224
224
|
treeGridElementRef: elementRef,
|
|
225
|
+
rootClientId,
|
|
225
226
|
} ),
|
|
226
227
|
[
|
|
227
228
|
draggedClientIds,
|
|
@@ -233,6 +234,7 @@ function ListViewComponent(
|
|
|
233
234
|
AdditionalBlockContent,
|
|
234
235
|
insertedBlock,
|
|
235
236
|
setInsertedBlock,
|
|
237
|
+
rootClientId,
|
|
236
238
|
]
|
|
237
239
|
);
|
|
238
240
|
|
|
@@ -27,12 +27,6 @@ export default function useListViewExpandSelectedItem( {
|
|
|
27
27
|
[ firstSelectedBlockClientId ]
|
|
28
28
|
);
|
|
29
29
|
|
|
30
|
-
const parentClientIds =
|
|
31
|
-
Array.isArray( selectedBlockParentClientIds ) &&
|
|
32
|
-
selectedBlockParentClientIds.length
|
|
33
|
-
? selectedBlockParentClientIds
|
|
34
|
-
: null;
|
|
35
|
-
|
|
36
30
|
// Expand tree when a block is selected.
|
|
37
31
|
useEffect( () => {
|
|
38
32
|
// If the selectedTreeId is the same as the selected block,
|
|
@@ -42,7 +36,7 @@ export default function useListViewExpandSelectedItem( {
|
|
|
42
36
|
}
|
|
43
37
|
|
|
44
38
|
// If the selected block has parents, get the top-level parent.
|
|
45
|
-
if (
|
|
39
|
+
if ( selectedBlockParentClientIds?.length ) {
|
|
46
40
|
// If the selected block has parents,
|
|
47
41
|
// expand the tree branch.
|
|
48
42
|
setExpandedState( {
|
|
@@ -50,7 +44,12 @@ export default function useListViewExpandSelectedItem( {
|
|
|
50
44
|
clientIds: selectedBlockParentClientIds,
|
|
51
45
|
} );
|
|
52
46
|
}
|
|
53
|
-
}, [
|
|
47
|
+
}, [
|
|
48
|
+
firstSelectedBlockClientId,
|
|
49
|
+
selectedBlockParentClientIds,
|
|
50
|
+
selectedTreeId,
|
|
51
|
+
setExpandedState,
|
|
52
|
+
] );
|
|
54
53
|
|
|
55
54
|
return {
|
|
56
55
|
setSelectedTreeId,
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
&.has-siblings {
|
|
18
18
|
border-top: $border-width solid $gray-900;
|
|
19
19
|
margin-top: $grid-unit-10;
|
|
20
|
+
padding-bottom: $grid-unit-10;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
.block-editor-media-replace-flow__image-url-label {
|
|
@@ -55,8 +56,7 @@
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
.block-editor-link-control__search-actions {
|
|
58
|
-
|
|
59
|
-
right: 4px;
|
|
59
|
+
padding: $grid-unit-10 0 0;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}
|