@wordpress/block-editor 15.11.0 → 15.12.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 +2 -0
- package/build/components/block-breadcrumb/index.cjs +10 -2
- package/build/components/block-breadcrumb/index.cjs.map +2 -2
- package/build/components/block-controls/index.cjs +1 -1
- package/build/components/block-controls/index.cjs.map +2 -2
- package/build/components/block-inspector/index.cjs +8 -21
- package/build/components/block-inspector/index.cjs.map +3 -3
- package/build/components/block-list/block.cjs +6 -3
- package/build/components/block-list/block.cjs.map +3 -3
- package/build/components/block-list/index.cjs +26 -18
- package/build/components/block-list/index.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.cjs +39 -19
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.cjs.map +2 -2
- package/build/components/block-list/use-in-between-inserter.cjs +4 -4
- package/build/components/block-list/use-in-between-inserter.cjs.map +2 -2
- package/build/components/block-settings-menu/block-settings-dropdown.cjs +10 -7
- package/build/components/block-settings-menu/block-settings-dropdown.cjs.map +2 -2
- package/build/components/block-settings-menu-controls/edit-section-menu-item.cjs +1 -1
- package/build/components/block-settings-menu-controls/edit-section-menu-item.cjs.map +2 -2
- package/build/components/block-settings-menu-controls/index.cjs +11 -16
- package/build/components/block-settings-menu-controls/index.cjs.map +2 -2
- package/build/components/block-toolbar/block-toolbar-icon.cjs +6 -4
- package/build/components/block-toolbar/block-toolbar-icon.cjs.map +2 -2
- package/build/components/block-toolbar/index.cjs +2 -2
- package/build/components/block-toolbar/index.cjs.map +2 -2
- package/build/components/block-tools/index.cjs +2 -26
- package/build/components/block-tools/index.cjs.map +2 -2
- package/build/components/block-variation-transforms/index.cjs +1 -2
- package/build/components/block-variation-transforms/index.cjs.map +2 -2
- package/build/components/block-visibility/index.cjs +7 -9
- package/build/components/block-visibility/index.cjs.map +3 -3
- package/build/components/block-visibility/modal.cjs +18 -103
- package/build/components/block-visibility/modal.cjs.map +2 -2
- package/build/components/block-visibility/use-block-visibility.cjs +1 -1
- package/build/components/block-visibility/use-block-visibility.cjs.map +2 -2
- package/build/components/block-visibility/utils.cjs +5 -1
- package/build/components/block-visibility/utils.cjs.map +2 -2
- package/build/components/block-visibility/viewport-menu-item.cjs +11 -4
- package/build/components/block-visibility/viewport-menu-item.cjs.map +2 -2
- package/build/components/block-visibility/viewport-toolbar.cjs +4 -6
- package/build/components/block-visibility/viewport-toolbar.cjs.map +2 -2
- package/build/components/block-visibility/viewport-visibility-info.cjs +121 -0
- package/build/components/block-visibility/viewport-visibility-info.cjs.map +7 -0
- package/build/components/color-palette/with-color-context.cjs +1 -1
- package/build/components/color-palette/with-color-context.cjs.map +2 -2
- package/build/components/color-style-selector/index.cjs +1 -1
- package/build/components/color-style-selector/index.cjs.map +2 -2
- package/build/components/colors/with-colors.cjs +5 -3
- package/build/components/colors/with-colors.cjs.map +2 -2
- package/build/components/colors-gradients/dropdown.cjs +1 -1
- package/build/components/colors-gradients/dropdown.cjs.map +2 -2
- package/build/components/editable-text/index.cjs +5 -1
- package/build/components/editable-text/index.cjs.map +2 -2
- package/build/components/font-sizes/with-font-sizes.cjs +5 -3
- package/build/components/font-sizes/with-font-sizes.cjs.map +2 -2
- package/build/components/global-styles/advanced-panel.cjs +26 -13
- package/build/components/global-styles/advanced-panel.cjs.map +2 -2
- package/build/components/global-styles/filters-panel.cjs +1 -1
- package/build/components/global-styles/filters-panel.cjs.map +2 -2
- package/build/components/global-styles/shadow-panel-components.cjs +1 -1
- package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
- package/build/components/gradients/with-gradient.cjs +1 -1
- package/build/components/gradients/with-gradient.cjs.map +2 -2
- package/build/components/inserter/index.cjs +1 -0
- package/build/components/inserter/index.cjs.map +2 -2
- package/build/components/inspector-controls/fill.cjs +12 -2
- package/build/components/inspector-controls/fill.cjs.map +2 -2
- package/build/components/inspector-controls/index.cjs +1 -1
- package/build/components/inspector-controls/index.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/index.cjs +3 -3
- package/build/components/inspector-controls-tabs/index.cjs.map +3 -3
- package/build/components/inspector-controls-tabs/styles-tab.cjs +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs +2 -2
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs.map +2 -2
- package/build/components/list-view/block-select-button.cjs +8 -16
- package/build/components/list-view/block-select-button.cjs.map +2 -2
- package/build/components/list-view/block.cjs +29 -34
- package/build/components/list-view/block.cjs.map +3 -3
- package/build/components/list-view/utils.cjs +3 -1
- package/build/components/list-view/utils.cjs.map +2 -2
- package/build/components/media-replace-flow/index.cjs +2 -2
- package/build/components/media-replace-flow/index.cjs.map +2 -2
- package/build/components/provider/index.cjs +7 -8
- package/build/components/provider/index.cjs.map +2 -2
- package/build/components/provider/with-registry-provider.cjs +1 -1
- package/build/components/provider/with-registry-provider.cjs.map +2 -2
- package/build/components/rich-text/index.cjs +1 -1
- package/build/components/rich-text/index.cjs.map +2 -2
- package/build/components/use-block-commands/index.cjs +2 -34
- package/build/components/use-block-commands/index.cjs.map +2 -2
- package/build/components/use-block-display-information/index.cjs +1 -1
- package/build/components/use-block-display-information/index.cjs.map +2 -2
- package/build/components/writing-flow/index.cjs +2 -0
- package/build/components/writing-flow/index.cjs.map +2 -2
- package/build/components/writing-flow/use-arrow-nav.cjs +3 -0
- package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
- package/build/components/writing-flow/use-drag-selection.cjs +2 -1
- package/build/components/writing-flow/use-drag-selection.cjs.map +2 -2
- package/build/components/writing-flow/use-preview-mode-nav.cjs +92 -0
- package/build/components/writing-flow/use-preview-mode-nav.cjs.map +7 -0
- package/build/hooks/block-renaming.cjs +1 -1
- package/build/hooks/block-renaming.cjs.map +2 -2
- package/build/hooks/cross-origin-isolation.cjs +1 -1
- package/build/hooks/cross-origin-isolation.cjs.map +2 -2
- package/build/hooks/custom-css.cjs +141 -0
- package/build/hooks/custom-css.cjs.map +7 -0
- package/build/hooks/fit-text.cjs +14 -7
- package/build/hooks/fit-text.cjs.map +2 -2
- package/build/hooks/grid-visualizer.cjs +1 -1
- package/build/hooks/grid-visualizer.cjs.map +2 -2
- package/build/hooks/index.cjs +4 -2
- package/build/hooks/index.cjs.map +3 -3
- package/build/hooks/layout.cjs +10 -4
- package/build/hooks/layout.cjs.map +2 -2
- package/build/hooks/list-view.cjs +9 -5
- package/build/hooks/list-view.cjs.map +3 -3
- package/build/hooks/utils.cjs +2 -2
- package/build/hooks/utils.cjs.map +2 -2
- package/build/layouts/grid.cjs +12 -1
- package/build/layouts/grid.cjs.map +2 -2
- package/build/store/actions.cjs +5 -0
- package/build/store/actions.cjs.map +2 -2
- package/build/store/defaults.cjs +3 -0
- package/build/store/defaults.cjs.map +2 -2
- package/build/store/private-selectors.cjs +46 -38
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +5 -7
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +15 -0
- package/build/store/selectors.cjs.map +2 -2
- package/build/utils/fit-text-utils.cjs +18 -4
- package/build/utils/fit-text-utils.cjs.map +2 -2
- package/build-module/components/block-breadcrumb/index.mjs +10 -2
- package/build-module/components/block-breadcrumb/index.mjs.map +2 -2
- package/build-module/components/block-controls/index.mjs +1 -1
- package/build-module/components/block-controls/index.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +8 -21
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-list/block.mjs +6 -3
- package/build-module/components/block-list/block.mjs.map +3 -3
- package/build-module/components/block-list/index.mjs +26 -18
- package/build-module/components/block-list/index.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.mjs +39 -19
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.mjs.map +2 -2
- package/build-module/components/block-list/use-in-between-inserter.mjs +4 -4
- package/build-module/components/block-list/use-in-between-inserter.mjs.map +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.mjs +10 -7
- package/build-module/components/block-settings-menu/block-settings-dropdown.mjs.map +2 -2
- package/build-module/components/block-settings-menu-controls/edit-section-menu-item.mjs +1 -1
- package/build-module/components/block-settings-menu-controls/edit-section-menu-item.mjs.map +2 -2
- package/build-module/components/block-settings-menu-controls/index.mjs +12 -17
- package/build-module/components/block-settings-menu-controls/index.mjs.map +2 -2
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs +6 -4
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs.map +2 -2
- package/build-module/components/block-toolbar/index.mjs +3 -3
- package/build-module/components/block-toolbar/index.mjs.map +2 -2
- package/build-module/components/block-tools/index.mjs +2 -26
- package/build-module/components/block-tools/index.mjs.map +2 -2
- package/build-module/components/block-variation-transforms/index.mjs +1 -2
- package/build-module/components/block-variation-transforms/index.mjs.map +2 -2
- package/build-module/components/block-visibility/index.mjs +6 -9
- package/build-module/components/block-visibility/index.mjs.map +2 -2
- package/build-module/components/block-visibility/modal.mjs +18 -103
- package/build-module/components/block-visibility/modal.mjs.map +2 -2
- package/build-module/components/block-visibility/use-block-visibility.mjs +1 -1
- package/build-module/components/block-visibility/use-block-visibility.mjs.map +2 -2
- package/build-module/components/block-visibility/utils.mjs +5 -1
- package/build-module/components/block-visibility/utils.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-menu-item.mjs +11 -4
- package/build-module/components/block-visibility/viewport-menu-item.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-toolbar.mjs +4 -6
- package/build-module/components/block-visibility/viewport-toolbar.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-visibility-info.mjs +95 -0
- package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +7 -0
- package/build-module/components/color-palette/with-color-context.mjs +1 -1
- package/build-module/components/color-palette/with-color-context.mjs.map +2 -2
- package/build-module/components/color-style-selector/index.mjs +1 -1
- package/build-module/components/color-style-selector/index.mjs.map +2 -2
- package/build-module/components/colors/with-colors.mjs +5 -3
- package/build-module/components/colors/with-colors.mjs.map +2 -2
- package/build-module/components/colors-gradients/dropdown.mjs +1 -1
- package/build-module/components/colors-gradients/dropdown.mjs.map +2 -2
- package/build-module/components/editable-text/index.mjs +5 -1
- package/build-module/components/editable-text/index.mjs.map +2 -2
- package/build-module/components/font-sizes/with-font-sizes.mjs +5 -3
- package/build-module/components/font-sizes/with-font-sizes.mjs.map +2 -2
- package/build-module/components/global-styles/advanced-panel.mjs +22 -13
- package/build-module/components/global-styles/advanced-panel.mjs.map +2 -2
- package/build-module/components/global-styles/filters-panel.mjs +1 -1
- package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
- package/build-module/components/global-styles/shadow-panel-components.mjs +1 -1
- package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
- package/build-module/components/gradients/with-gradient.mjs +1 -1
- package/build-module/components/gradients/with-gradient.mjs.map +2 -2
- package/build-module/components/inserter/index.mjs +1 -0
- package/build-module/components/inserter/index.mjs.map +2 -2
- package/build-module/components/inspector-controls/fill.mjs +12 -2
- package/build-module/components/inspector-controls/fill.mjs.map +2 -2
- package/build-module/components/inspector-controls/index.mjs +1 -1
- package/build-module/components/inspector-controls/index.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/index.mjs +3 -3
- package/build-module/components/inspector-controls-tabs/index.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs +2 -2
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs.map +2 -2
- package/build-module/components/list-view/block-select-button.mjs +8 -16
- package/build-module/components/list-view/block-select-button.mjs.map +2 -2
- package/build-module/components/list-view/block.mjs +31 -36
- package/build-module/components/list-view/block.mjs.map +2 -2
- package/build-module/components/list-view/utils.mjs +3 -1
- package/build-module/components/list-view/utils.mjs.map +2 -2
- package/build-module/components/media-replace-flow/index.mjs +2 -2
- package/build-module/components/media-replace-flow/index.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +7 -8
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/provider/with-registry-provider.mjs +1 -1
- package/build-module/components/provider/with-registry-provider.mjs.map +2 -2
- package/build-module/components/rich-text/index.mjs +1 -1
- package/build-module/components/rich-text/index.mjs.map +2 -2
- package/build-module/components/use-block-commands/index.mjs +3 -37
- package/build-module/components/use-block-commands/index.mjs.map +2 -2
- package/build-module/components/use-block-display-information/index.mjs +1 -1
- package/build-module/components/use-block-display-information/index.mjs.map +2 -2
- package/build-module/components/writing-flow/index.mjs +2 -0
- package/build-module/components/writing-flow/index.mjs.map +2 -2
- package/build-module/components/writing-flow/use-arrow-nav.mjs +3 -0
- package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
- package/build-module/components/writing-flow/use-drag-selection.mjs +2 -1
- package/build-module/components/writing-flow/use-drag-selection.mjs.map +2 -2
- package/build-module/components/writing-flow/use-preview-mode-nav.mjs +67 -0
- package/build-module/components/writing-flow/use-preview-mode-nav.mjs.map +7 -0
- package/build-module/hooks/block-renaming.mjs +1 -1
- package/build-module/hooks/block-renaming.mjs.map +2 -2
- package/build-module/hooks/cross-origin-isolation.mjs +1 -1
- package/build-module/hooks/cross-origin-isolation.mjs.map +2 -2
- package/build-module/hooks/custom-css.mjs +112 -0
- package/build-module/hooks/custom-css.mjs.map +7 -0
- package/build-module/hooks/fit-text.mjs +14 -7
- package/build-module/hooks/fit-text.mjs.map +2 -2
- package/build-module/hooks/grid-visualizer.mjs +1 -1
- package/build-module/hooks/grid-visualizer.mjs.map +2 -2
- package/build-module/hooks/index.mjs +4 -2
- package/build-module/hooks/index.mjs.map +2 -2
- package/build-module/hooks/layout.mjs +10 -4
- package/build-module/hooks/layout.mjs.map +2 -2
- package/build-module/hooks/list-view.mjs +10 -6
- package/build-module/hooks/list-view.mjs.map +2 -2
- package/build-module/hooks/utils.mjs +2 -2
- package/build-module/hooks/utils.mjs.map +2 -2
- package/build-module/layouts/grid.mjs +12 -1
- package/build-module/layouts/grid.mjs.map +2 -2
- package/build-module/store/actions.mjs +5 -0
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/defaults.mjs +3 -0
- package/build-module/store/defaults.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +43 -41
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +5 -7
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +15 -0
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/fit-text-utils.mjs +18 -4
- package/build-module/utils/fit-text-utils.mjs.map +2 -2
- package/build-style/content-rtl.css +10 -0
- package/build-style/content.css +10 -0
- package/build-style/style-rtl.css +3 -0
- package/build-style/style.css +3 -0
- package/package.json +39 -39
- package/src/components/block-breadcrumb/index.js +6 -1
- package/src/components/block-controls/index.js +1 -1
- package/src/components/block-controls/test/index.js +1 -0
- package/src/components/block-edit/test/edit.js +10 -0
- package/src/components/block-inspector/index.js +15 -36
- package/src/components/block-list/block.js +5 -2
- package/src/components/block-list/content.scss +11 -0
- package/src/components/block-list/index.js +25 -17
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +51 -36
- package/src/components/block-list/use-in-between-inserter.js +8 -6
- package/src/components/block-preview/test/index.js +11 -7
- package/src/components/block-settings-menu/block-settings-dropdown.js +11 -6
- package/src/components/block-settings-menu-controls/edit-section-menu-item.js +1 -7
- package/src/components/block-settings-menu-controls/index.js +16 -18
- package/src/components/block-switcher/test/index.js +2 -0
- package/src/components/block-switcher/test/use-transformed.patterns.js +2 -0
- package/src/components/block-switcher/test/utils.js +2 -0
- package/src/components/block-toolbar/block-toolbar-icon.js +6 -10
- package/src/components/block-toolbar/index.js +3 -9
- package/src/components/block-tools/index.js +2 -29
- package/src/components/block-variation-transforms/index.js +1 -4
- package/src/components/block-visibility/index.js +3 -19
- package/src/components/block-visibility/modal.js +16 -14
- package/src/components/block-visibility/test/use-block-visibility.js +27 -25
- package/src/components/block-visibility/test/utils.js +24 -8
- package/src/components/block-visibility/use-block-visibility.js +1 -4
- package/src/components/block-visibility/utils.js +9 -1
- package/src/components/block-visibility/viewport-menu-item.js +11 -5
- package/src/components/block-visibility/viewport-toolbar.js +5 -6
- package/src/components/block-visibility/viewport-visibility-info.js +131 -0
- package/src/components/color-palette/with-color-context.js +1 -1
- package/src/components/color-style-selector/index.js +2 -3
- package/src/components/colors/with-colors.js +23 -20
- package/src/components/colors-gradients/dropdown.js +2 -3
- package/src/components/editable-text/index.js +5 -1
- package/src/components/font-sizes/with-font-sizes.js +13 -10
- package/src/components/global-styles/advanced-panel.js +35 -16
- package/src/components/global-styles/filters-panel.js +2 -3
- package/src/components/global-styles/shadow-panel-components.js +1 -1
- package/src/components/global-styles/style.scss +9 -5
- package/src/components/gradients/with-gradient.js +7 -4
- package/src/components/inner-blocks/test/index.js +2 -0
- package/src/components/inserter/index.js +1 -0
- package/src/components/inserter/stories/index.story.jsx +31 -24
- package/src/components/inspector-controls/fill.js +25 -5
- package/src/components/inspector-controls/index.js +1 -1
- package/src/components/inspector-controls-tabs/index.js +6 -2
- package/src/components/inspector-controls-tabs/styles-tab.js +7 -8
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -4
- package/src/components/link-control/test/index.js +6 -1
- package/src/components/list-view/block-select-button.js +16 -25
- package/src/components/list-view/block.js +38 -43
- package/src/components/list-view/utils.js +4 -2
- package/src/components/media-replace-flow/index.js +3 -3
- package/src/components/media-replace-flow/test/index.js +13 -11
- package/src/components/provider/index.js +11 -10
- package/src/components/provider/test/use-block-sync.js +1 -0
- package/src/components/provider/with-registry-provider.js +1 -1
- package/src/components/rich-text/index.js +1 -1
- package/src/components/use-block-commands/index.js +0 -41
- package/src/components/use-block-display-information/index.js +1 -5
- package/src/components/writing-flow/index.js +2 -0
- package/src/components/writing-flow/use-arrow-nav.js +5 -0
- package/src/components/writing-flow/use-drag-selection.js +7 -1
- package/src/components/writing-flow/use-preview-mode-nav.js +102 -0
- package/src/hooks/block-renaming.js +5 -2
- package/src/hooks/cross-origin-isolation.js +19 -18
- package/src/hooks/custom-css.js +176 -0
- package/src/hooks/fit-text.js +20 -5
- package/src/hooks/grid-visualizer.js +15 -14
- package/src/hooks/index.js +4 -2
- package/src/hooks/layout.js +55 -43
- package/src/hooks/list-view.js +10 -6
- package/src/hooks/test/align.js +1 -0
- package/src/hooks/test/allowed-blocks.js +8 -0
- package/src/hooks/test/auto-inspector-controls.js +4 -0
- package/src/hooks/test/font-size.js +1 -0
- package/src/hooks/test/metadata.js +4 -0
- package/src/hooks/test/text-align.js +1 -0
- package/src/hooks/utils.js +123 -119
- package/src/layouts/grid.js +19 -3
- package/src/layouts/test/grid.js +1 -1
- package/src/store/actions.js +7 -0
- package/src/store/defaults.js +4 -0
- package/src/store/private-selectors.js +94 -64
- package/src/store/reducer.js +11 -18
- package/src/store/selectors.js +25 -0
- package/src/store/test/actions.js +7 -0
- package/src/store/test/private-selectors.js +116 -119
- package/src/store/test/reducer.js +262 -266
- package/src/store/test/registry-selectors.js +2 -0
- package/src/store/test/selectors.js +19 -0
- package/src/utils/fit-text-utils.js +31 -5
- package/build/components/block-visibility/block-visibility-info.cjs +0 -63
- package/build/components/block-visibility/block-visibility-info.cjs.map +0 -7
- package/build/components/block-visibility/menu-item.cjs +0 -109
- package/build/components/block-visibility/menu-item.cjs.map +0 -7
- package/build/components/block-visibility/toolbar.cjs +0 -92
- package/build/components/block-visibility/toolbar.cjs.map +0 -7
- package/build/components/content-lock/index.cjs +0 -31
- package/build/components/content-lock/index.cjs.map +0 -7
- package/build/components/content-lock/modify-content-lock-menu-item.cjs +0 -70
- package/build/components/content-lock/modify-content-lock-menu-item.cjs.map +0 -7
- package/build/hooks/content-lock-ui.cjs +0 -68
- package/build/hooks/content-lock-ui.cjs.map +0 -7
- package/build-module/components/block-visibility/block-visibility-info.mjs +0 -47
- package/build-module/components/block-visibility/block-visibility-info.mjs.map +0 -7
- package/build-module/components/block-visibility/menu-item.mjs +0 -88
- package/build-module/components/block-visibility/menu-item.mjs.map +0 -7
- package/build-module/components/block-visibility/toolbar.mjs +0 -71
- package/build-module/components/block-visibility/toolbar.mjs.map +0 -7
- package/build-module/components/content-lock/index.mjs +0 -6
- package/build-module/components/content-lock/index.mjs.map +0 -7
- package/build-module/components/content-lock/modify-content-lock-menu-item.mjs +0 -45
- package/build-module/components/content-lock/modify-content-lock-menu-item.mjs.map +0 -7
- package/build-module/hooks/content-lock-ui.mjs +0 -47
- package/build-module/hooks/content-lock-ui.mjs.map +0 -7
- package/src/components/block-visibility/block-visibility-info.js +0 -62
- package/src/components/block-visibility/menu-item.js +0 -96
- package/src/components/block-visibility/toolbar.js +0 -88
- package/src/components/content-lock/index.js +0 -1
- package/src/components/content-lock/modify-content-lock-menu-item.js +0 -67
- package/src/hooks/content-lock-ui.js +0 -76
|
@@ -136,7 +136,7 @@ export function ShadowPopover( { shadow, onShadowChange, settings } ) {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
function renderShadowToggle( shadow, onShadowChange ) {
|
|
139
|
-
return ( { onToggle, isOpen } )
|
|
139
|
+
return function ShadowToggle( { onToggle, isOpen } ) {
|
|
140
140
|
const shadowButtonRef = useRef( undefined );
|
|
141
141
|
|
|
142
142
|
const toggleProps = {
|
|
@@ -100,11 +100,15 @@
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
.block-editor-global-styles-advanced-panel__custom-css-input
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
103
|
+
.block-editor-global-styles-advanced-panel__custom-css-input {
|
|
104
|
+
margin-bottom: $grid-unit-20;
|
|
105
|
+
|
|
106
|
+
textarea {
|
|
107
|
+
font-family: $editor_html_font;
|
|
108
|
+
// CSS input is always LTR regardless of language.
|
|
109
|
+
/*rtl:ignore*/
|
|
110
|
+
direction: ltr;
|
|
111
|
+
}
|
|
108
112
|
}
|
|
109
113
|
|
|
110
114
|
.block-editor-panel-duotone-settings__reset {
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __experimentalUseGradient } from './use-gradient';
|
|
5
5
|
|
|
6
|
-
export const withGradient = ( WrappedComponent ) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
export const withGradient = ( WrappedComponent ) =>
|
|
7
|
+
function WithGradient( props ) {
|
|
8
|
+
const { gradientValue } = __experimentalUseGradient();
|
|
9
|
+
return (
|
|
10
|
+
<WrappedComponent { ...props } gradientValue={ gradientValue } />
|
|
11
|
+
);
|
|
12
|
+
};
|
|
@@ -27,6 +27,7 @@ describe( 'InnerBlocks', () => {
|
|
|
27
27
|
|
|
28
28
|
it( 'should return element as string, with inner blocks', () => {
|
|
29
29
|
registerBlockType( 'core/fruit', {
|
|
30
|
+
apiVersion: 3,
|
|
30
31
|
category: 'text',
|
|
31
32
|
|
|
32
33
|
title: 'fruit',
|
|
@@ -62,6 +63,7 @@ describe( 'InnerBlocks', () => {
|
|
|
62
63
|
|
|
63
64
|
it( 'should force serialize for invalid block with inner blocks', () => {
|
|
64
65
|
const blockType = {
|
|
66
|
+
apiVersion: 3,
|
|
65
67
|
attributes: {
|
|
66
68
|
throw: {
|
|
67
69
|
type: 'boolean',
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { registerCoreBlocks } from '@wordpress/block-library';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* Internal dependencies
|
|
3
8
|
*/
|
|
@@ -8,13 +13,17 @@ import Inserter from '../';
|
|
|
8
13
|
|
|
9
14
|
export default { title: 'BlockEditor/Inserter' };
|
|
10
15
|
|
|
16
|
+
// For the purpose of this story, we need to register the core blocks samples.
|
|
17
|
+
registerCoreBlocks();
|
|
18
|
+
|
|
19
|
+
const wrapperStyle = {
|
|
20
|
+
margin: '24px',
|
|
21
|
+
height: 400,
|
|
22
|
+
border: '1px solid #f3f3f3',
|
|
23
|
+
display: 'inline-block',
|
|
24
|
+
};
|
|
25
|
+
|
|
11
26
|
export const LibraryWithoutPatterns = () => {
|
|
12
|
-
const wrapperStyle = {
|
|
13
|
-
margin: '24px',
|
|
14
|
-
height: 400,
|
|
15
|
-
border: '1px solid #f3f3f3',
|
|
16
|
-
display: 'inline-block',
|
|
17
|
-
};
|
|
18
27
|
return (
|
|
19
28
|
<ExperimentalBlockEditorProvider>
|
|
20
29
|
<div style={ wrapperStyle }>
|
|
@@ -25,12 +34,6 @@ export const LibraryWithoutPatterns = () => {
|
|
|
25
34
|
};
|
|
26
35
|
|
|
27
36
|
export const LibraryWithPatterns = () => {
|
|
28
|
-
const wrapperStyle = {
|
|
29
|
-
margin: '24px',
|
|
30
|
-
height: 400,
|
|
31
|
-
border: '1px solid #f3f3f3',
|
|
32
|
-
display: 'inline-block',
|
|
33
|
-
};
|
|
34
37
|
return (
|
|
35
38
|
<ExperimentalBlockEditorProvider
|
|
36
39
|
settings={ {
|
|
@@ -46,12 +49,6 @@ export const LibraryWithPatterns = () => {
|
|
|
46
49
|
};
|
|
47
50
|
|
|
48
51
|
export const LibraryWithPatternsAndReusableBlocks = () => {
|
|
49
|
-
const wrapperStyle = {
|
|
50
|
-
margin: '24px',
|
|
51
|
-
height: 400,
|
|
52
|
-
border: '1px solid #f3f3f3',
|
|
53
|
-
display: 'inline-block',
|
|
54
|
-
};
|
|
55
52
|
return (
|
|
56
53
|
<ExperimentalBlockEditorProvider
|
|
57
54
|
settings={ {
|
|
@@ -67,13 +64,23 @@ export const LibraryWithPatternsAndReusableBlocks = () => {
|
|
|
67
64
|
);
|
|
68
65
|
};
|
|
69
66
|
|
|
67
|
+
export const FullInserter = () => {
|
|
68
|
+
return (
|
|
69
|
+
<ExperimentalBlockEditorProvider
|
|
70
|
+
settings={ {
|
|
71
|
+
__experimentalBlockPatternCategories: patternCategories,
|
|
72
|
+
__experimentalBlockPatterns: patterns,
|
|
73
|
+
__experimentalReusableBlocks: reusableBlocks,
|
|
74
|
+
} }
|
|
75
|
+
>
|
|
76
|
+
<div style={ wrapperStyle }>
|
|
77
|
+
<Inserter />
|
|
78
|
+
</div>
|
|
79
|
+
</ExperimentalBlockEditorProvider>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
|
|
70
83
|
export const QuickInserter = () => {
|
|
71
|
-
const wrapperStyle = {
|
|
72
|
-
margin: '24px',
|
|
73
|
-
height: 400,
|
|
74
|
-
border: '1px solid #f3f3f3',
|
|
75
|
-
display: 'inline-block',
|
|
76
|
-
};
|
|
77
84
|
return (
|
|
78
85
|
<ExperimentalBlockEditorProvider
|
|
79
86
|
settings={ {
|
|
@@ -19,6 +19,9 @@ import {
|
|
|
19
19
|
} from '../block-edit/context';
|
|
20
20
|
import groups from './groups';
|
|
21
21
|
|
|
22
|
+
const PATTERN_EDITING_GROUPS = [ 'content', 'list' ];
|
|
23
|
+
const TEMPLATE_PART_GROUPS = [ 'default', 'settings', 'advanced' ];
|
|
24
|
+
|
|
22
25
|
export default function InspectorControlsFill( {
|
|
23
26
|
children,
|
|
24
27
|
group = 'default',
|
|
@@ -43,13 +46,30 @@ export default function InspectorControlsFill( {
|
|
|
43
46
|
warning( `Unknown InspectorControls group "${ group }" provided.` );
|
|
44
47
|
return null;
|
|
45
48
|
}
|
|
46
|
-
const shouldDisplayForPatternEditing =
|
|
47
|
-
context[ mayDisplayPatternEditingControlsKey ] &&
|
|
48
|
-
( group === 'list' || group === 'content' );
|
|
49
49
|
|
|
50
|
+
// During pattern editing:
|
|
51
|
+
// - All blocks can show pattern editing groups (content, list).
|
|
52
|
+
// - Template parts can show a settings tab (default, settings, advanced groups).
|
|
53
|
+
// - Other blocks cannot show a settings tab.
|
|
54
|
+
if ( context[ mayDisplayPatternEditingControlsKey ] ) {
|
|
55
|
+
// Template parts are allowed to show a settings tab to allow access to the
|
|
56
|
+
// 'Design' and 'Advanced' panels.
|
|
57
|
+
const isTemplatePart = context.name === 'core/template-part';
|
|
58
|
+
const isTemplatePartGroup = TEMPLATE_PART_GROUPS.includes( group );
|
|
59
|
+
const isPatternEditingGroup = PATTERN_EDITING_GROUPS.includes( group );
|
|
60
|
+
|
|
61
|
+
const canShowGroup =
|
|
62
|
+
( isTemplatePart && isTemplatePartGroup ) || isPatternEditingGroup;
|
|
63
|
+
|
|
64
|
+
if ( ! canShowGroup ) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Outside pattern editing, use the standard rules for displaying controls.
|
|
50
70
|
if (
|
|
51
|
-
! context[
|
|
52
|
-
!
|
|
71
|
+
! context[ mayDisplayPatternEditingControlsKey ] &&
|
|
72
|
+
! context[ mayDisplayControlsKey ]
|
|
53
73
|
) {
|
|
54
74
|
return null;
|
|
55
75
|
}
|
|
@@ -12,7 +12,7 @@ InspectorControls.Slot = InspectorControlsSlot;
|
|
|
12
12
|
export const InspectorAdvancedControls = ( props ) => {
|
|
13
13
|
return <InspectorControlsFill { ...props } group="advanced" />;
|
|
14
14
|
};
|
|
15
|
-
InspectorAdvancedControls.Slot = ( props )
|
|
15
|
+
InspectorAdvancedControls.Slot = function Slot( props ) {
|
|
16
16
|
return <InspectorControlsSlot { ...props } group="advanced" />;
|
|
17
17
|
};
|
|
18
18
|
InspectorAdvancedControls.slotName = 'InspectorAdvancedControls';
|
|
@@ -44,7 +44,11 @@ export default function InspectorControlsTabs( {
|
|
|
44
44
|
|
|
45
45
|
// Auto-select first available tab unless user has made a selection
|
|
46
46
|
useEffect( () => {
|
|
47
|
-
if (
|
|
47
|
+
if (
|
|
48
|
+
! tabs?.length ||
|
|
49
|
+
( hasUserSelectionRef.current &&
|
|
50
|
+
tabs.some( ( tab ) => tab.name === selectedTabId ) )
|
|
51
|
+
) {
|
|
48
52
|
return;
|
|
49
53
|
}
|
|
50
54
|
|
|
@@ -97,8 +101,8 @@ export default function InspectorControlsTabs( {
|
|
|
97
101
|
/>
|
|
98
102
|
</Tabs.TabPanel>
|
|
99
103
|
<Tabs.TabPanel tabId={ TAB_CONTENT.name } focusable={ false }>
|
|
100
|
-
<InspectorControls.Slot group="content" />
|
|
101
104
|
<ContentTab contentClientIds={ contentClientIds } />
|
|
105
|
+
<InspectorControls.Slot group="content" />
|
|
102
106
|
</Tabs.TabPanel>
|
|
103
107
|
<Tabs.TabPanel tabId={ TAB_LIST_VIEW.name } focusable={ false }>
|
|
104
108
|
<InspectorControls.Slot group="list" />
|
|
@@ -71,14 +71,13 @@ const StylesTab = ( {
|
|
|
71
71
|
return (
|
|
72
72
|
<>
|
|
73
73
|
{ hasBlockStyles && <BlockStyles clientId={ clientId } /> }
|
|
74
|
-
{ isSectionBlock &&
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
) }
|
|
74
|
+
{ isSectionBlock && (
|
|
75
|
+
<SectionBlockColorControls
|
|
76
|
+
blockName={ blockName }
|
|
77
|
+
clientId={ clientId }
|
|
78
|
+
contentClientIds={ contentClientIds }
|
|
79
|
+
/>
|
|
80
|
+
) }
|
|
82
81
|
{ ! isSectionBlock && (
|
|
83
82
|
<>
|
|
84
83
|
<InspectorControls.Slot
|
|
@@ -104,10 +104,9 @@ export default function useInspectorControlsTabs(
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
if (
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
! isSectionBlock
|
|
107
|
+
settingsFills.length ||
|
|
108
|
+
// Advanced fills show up in settings tab if available or they blend into the default tab, if there's only one tab.
|
|
109
|
+
( advancedFills.length && ( hasContentTab || hasListFills ) )
|
|
111
110
|
) {
|
|
112
111
|
tabs.push( TAB_SETTINGS );
|
|
113
112
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
5
|
fireEvent,
|
|
6
|
-
render,
|
|
6
|
+
render as baseRender,
|
|
7
7
|
screen,
|
|
8
8
|
waitFor,
|
|
9
9
|
within,
|
|
@@ -13,6 +13,7 @@ import userEvent from '@testing-library/user-event';
|
|
|
13
13
|
/**
|
|
14
14
|
* WordPress dependencies
|
|
15
15
|
*/
|
|
16
|
+
import { SlotFillProvider } from '@wordpress/components';
|
|
16
17
|
import { useState, createElement } from '@wordpress/element';
|
|
17
18
|
import { useSelect } from '@wordpress/data';
|
|
18
19
|
|
|
@@ -79,6 +80,10 @@ afterEach( () => {
|
|
|
79
80
|
mockFetchRichUrlData?.mockReset(); // Conditionally reset as it may NOT be a mock.
|
|
80
81
|
} );
|
|
81
82
|
|
|
83
|
+
function render( ui ) {
|
|
84
|
+
return baseRender( ui, { wrapper: SlotFillProvider } );
|
|
85
|
+
}
|
|
86
|
+
|
|
82
87
|
/**
|
|
83
88
|
* Workaround to trigger an arrow up keypress event.
|
|
84
89
|
*
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
} from '@wordpress/icons';
|
|
22
22
|
import { SPACE, ENTER } from '@wordpress/keycodes';
|
|
23
23
|
import { useSelect } from '@wordpress/data';
|
|
24
|
-
import { hasBlockSupport } from '@wordpress/blocks';
|
|
25
24
|
|
|
26
25
|
/**
|
|
27
26
|
* Internal dependencies
|
|
@@ -61,30 +60,22 @@ function ListViewBlockSelectButton(
|
|
|
61
60
|
context: 'list-view',
|
|
62
61
|
} );
|
|
63
62
|
const { isLocked } = useBlockLock( clientId );
|
|
64
|
-
const {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
isBlockHidden: areBlocksHiddenAnywhere( [ clientId ] ),
|
|
80
|
-
hasPatternName: !! blockAttributes?.metadata?.patternName,
|
|
81
|
-
};
|
|
82
|
-
},
|
|
83
|
-
[ clientId ]
|
|
84
|
-
);
|
|
63
|
+
const { isBlockHidden, hasPatternName } = useSelect(
|
|
64
|
+
( select ) => {
|
|
65
|
+
const {
|
|
66
|
+
isBlockHiddenAnywhere: _isBlockHidden,
|
|
67
|
+
getBlockAttributes,
|
|
68
|
+
} = unlock( select( blockEditorStore ) );
|
|
69
|
+
return {
|
|
70
|
+
isBlockHidden: _isBlockHidden( clientId ),
|
|
71
|
+
hasPatternName:
|
|
72
|
+
!! getBlockAttributes( clientId )?.metadata?.patternName,
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
[ clientId ]
|
|
76
|
+
);
|
|
77
|
+
|
|
85
78
|
const shouldShowLockIcon = isLocked;
|
|
86
|
-
const shouldShowBlockVisibilityIcon =
|
|
87
|
-
canToggleBlockVisibility && isBlockHidden;
|
|
88
79
|
const isSticky = blockInformation?.positionType === 'sticky';
|
|
89
80
|
const images = useListViewImages( { clientId, isExpanded } );
|
|
90
81
|
|
|
@@ -170,7 +161,7 @@ function ListViewBlockSelectButton(
|
|
|
170
161
|
) ) }
|
|
171
162
|
</span>
|
|
172
163
|
) : null }
|
|
173
|
-
{
|
|
164
|
+
{ isBlockHidden && (
|
|
174
165
|
<span className="block-editor-list-view-block-select-button__block-visibility">
|
|
175
166
|
<Icon icon={ unseen } />
|
|
176
167
|
</span>
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
memo,
|
|
26
26
|
} from '@wordpress/element';
|
|
27
27
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
28
|
-
import { __ } from '@wordpress/i18n';
|
|
28
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
29
29
|
import { BACKSPACE, DELETE } from '@wordpress/keycodes';
|
|
30
30
|
import { isShallowEqual } from '@wordpress/is-shallow-equal';
|
|
31
31
|
import { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordpress/keyboard-shortcuts';
|
|
@@ -53,8 +53,9 @@ import { useBlockLock } from '../block-lock';
|
|
|
53
53
|
import AriaReferencedText from './aria-referenced-text';
|
|
54
54
|
import { unlock } from '../../lock-unlock';
|
|
55
55
|
import usePasteStyles from '../use-paste-styles';
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
56
|
+
import { useBlockVisibility, BlockVisibilityModal } from '../block-visibility';
|
|
57
|
+
import { deviceTypeKey } from '../../store/private-keys';
|
|
58
|
+
import { BLOCK_VISIBILITY_VIEWPORTS } from '../block-visibility/constants';
|
|
58
59
|
|
|
59
60
|
function ListViewBlock( {
|
|
60
61
|
block: { clientId },
|
|
@@ -98,7 +99,6 @@ function ListViewBlock( {
|
|
|
98
99
|
removeBlocks,
|
|
99
100
|
insertAfterBlock,
|
|
100
101
|
insertBeforeBlock,
|
|
101
|
-
updateBlockAttributes,
|
|
102
102
|
} = unlock( useDispatch( blockEditorStore ) );
|
|
103
103
|
|
|
104
104
|
const debouncedToggleBlockHighlight = useDebounce(
|
|
@@ -125,29 +125,52 @@ function ListViewBlock( {
|
|
|
125
125
|
|
|
126
126
|
const pasteStyles = usePasteStyles();
|
|
127
127
|
|
|
128
|
-
const { block, blockName, allowRightClickOverrides,
|
|
128
|
+
const { block, blockName, allowRightClickOverrides, selectedDeviceType } =
|
|
129
129
|
useSelect(
|
|
130
130
|
( select ) => {
|
|
131
|
-
const {
|
|
132
|
-
getBlock,
|
|
133
|
-
getBlockName: _getBlockName,
|
|
134
|
-
getSettings,
|
|
135
|
-
} = select( blockEditorStore );
|
|
136
|
-
const { isBlockHidden: _isBlockHidden } = unlock(
|
|
131
|
+
const { getBlock, getBlockName, getSettings } = unlock(
|
|
137
132
|
select( blockEditorStore )
|
|
138
133
|
);
|
|
139
134
|
|
|
140
135
|
return {
|
|
141
136
|
block: getBlock( clientId ),
|
|
142
|
-
blockName:
|
|
137
|
+
blockName: getBlockName( clientId ),
|
|
143
138
|
allowRightClickOverrides:
|
|
144
139
|
getSettings().allowRightClickOverrides,
|
|
145
|
-
|
|
140
|
+
selectedDeviceType:
|
|
141
|
+
getSettings()?.[ deviceTypeKey ]?.toLowerCase() ||
|
|
142
|
+
BLOCK_VISIBILITY_VIEWPORTS.desktop.value,
|
|
146
143
|
};
|
|
147
144
|
},
|
|
148
145
|
[ clientId ]
|
|
149
146
|
);
|
|
150
147
|
|
|
148
|
+
// Use hook to get current viewport and if block is currently hidden (accurate viewport detection)
|
|
149
|
+
const { isBlockCurrentlyHidden, currentViewport } = useBlockVisibility( {
|
|
150
|
+
blockVisibility: block?.attributes?.metadata?.blockVisibility,
|
|
151
|
+
deviceType: selectedDeviceType,
|
|
152
|
+
} );
|
|
153
|
+
|
|
154
|
+
// Determine label based on whether block or parent is hidden
|
|
155
|
+
const blockVisibilityDescription = useMemo( () => {
|
|
156
|
+
if ( isBlockCurrentlyHidden ) {
|
|
157
|
+
if ( block?.attributes?.metadata?.blockVisibility === false ) {
|
|
158
|
+
return __( 'Block is hidden' );
|
|
159
|
+
}
|
|
160
|
+
return sprintf(
|
|
161
|
+
/* translators: %s: viewport name (Desktop, Tablet, Mobile) */
|
|
162
|
+
__( 'Block is hidden on %s' ),
|
|
163
|
+
BLOCK_VISIBILITY_VIEWPORTS[ currentViewport ]?.label ||
|
|
164
|
+
currentViewport
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
return null;
|
|
168
|
+
}, [
|
|
169
|
+
isBlockCurrentlyHidden,
|
|
170
|
+
block?.attributes?.metadata?.blockVisibility,
|
|
171
|
+
currentViewport,
|
|
172
|
+
] );
|
|
173
|
+
|
|
151
174
|
const showBlockActions =
|
|
152
175
|
// When a block hides its toolbar it also hides the block settings menu,
|
|
153
176
|
// since that menu is part of the toolbar in the editor canvas.
|
|
@@ -387,32 +410,8 @@ function ListViewBlock( {
|
|
|
387
410
|
return;
|
|
388
411
|
}
|
|
389
412
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
setVisibilityModalClientIds( blocksToUpdate );
|
|
393
|
-
} else {
|
|
394
|
-
const hasHiddenBlock = blocks.some(
|
|
395
|
-
( blockToUpdate ) =>
|
|
396
|
-
blockToUpdate.attributes.metadata?.blockVisibility ===
|
|
397
|
-
false
|
|
398
|
-
);
|
|
399
|
-
const attributesByClientId = Object.fromEntries(
|
|
400
|
-
blocks.map( ( { clientId: mapClientId, attributes } ) => [
|
|
401
|
-
mapClientId,
|
|
402
|
-
{
|
|
403
|
-
metadata: cleanEmptyObject( {
|
|
404
|
-
...attributes?.metadata,
|
|
405
|
-
blockVisibility: hasHiddenBlock
|
|
406
|
-
? undefined
|
|
407
|
-
: false,
|
|
408
|
-
} ),
|
|
409
|
-
},
|
|
410
|
-
] )
|
|
411
|
-
);
|
|
412
|
-
updateBlockAttributes( blocksToUpdate, attributesByClientId, {
|
|
413
|
-
uniqueByBlock: true,
|
|
414
|
-
} );
|
|
415
|
-
}
|
|
413
|
+
// Open the visibility breakpoints modal.
|
|
414
|
+
setVisibilityModalClientIds( blocksToUpdate );
|
|
416
415
|
}
|
|
417
416
|
}
|
|
418
417
|
|
|
@@ -540,10 +539,6 @@ function ListViewBlock( {
|
|
|
540
539
|
isLocked
|
|
541
540
|
);
|
|
542
541
|
|
|
543
|
-
const blockVisibilityDescription = isBlockHidden
|
|
544
|
-
? __( 'Block is hidden.' )
|
|
545
|
-
: null;
|
|
546
|
-
|
|
547
542
|
const hasSiblings = siblingBlockCount > 0;
|
|
548
543
|
const hasRenderedMovers = showBlockMovers && hasSiblings;
|
|
549
544
|
const moverCellClassName = clsx(
|
|
@@ -113,8 +113,10 @@ export function focusListItem( focusClientId, treeGridElement ) {
|
|
|
113
113
|
resolve( null );
|
|
114
114
|
}, 3000 );
|
|
115
115
|
} ).then( ( element ) => {
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
if ( element && element.isConnected ) {
|
|
117
|
+
// Focus the first focusable in the row, which is the ListViewBlockSelectButton.
|
|
118
|
+
focus.focusable.find( element )?.[ 0 ]?.focus();
|
|
119
|
+
}
|
|
118
120
|
} );
|
|
119
121
|
}
|
|
120
122
|
|
|
@@ -239,6 +239,9 @@ const MediaReplaceFlow = ( {
|
|
|
239
239
|
{ __( 'Use featured image' ) }
|
|
240
240
|
</MenuItem>
|
|
241
241
|
) }
|
|
242
|
+
{ typeof children === 'function'
|
|
243
|
+
? children( { onClose } )
|
|
244
|
+
: children }
|
|
242
245
|
{ mediaURL && onReset && (
|
|
243
246
|
<MenuItem
|
|
244
247
|
onClick={ () => {
|
|
@@ -249,9 +252,6 @@ const MediaReplaceFlow = ( {
|
|
|
249
252
|
{ __( 'Reset' ) }
|
|
250
253
|
</MenuItem>
|
|
251
254
|
) }
|
|
252
|
-
{ typeof children === 'function'
|
|
253
|
-
? children( { onClose } )
|
|
254
|
-
: children }
|
|
255
255
|
</NavigableMenu>
|
|
256
256
|
{ onSelectURL && (
|
|
257
257
|
<form className="block-editor-media-flow__url-input">
|
|
@@ -8,7 +8,7 @@ import userEvent from '@testing-library/user-event';
|
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
10
|
import { useState } from '@wordpress/element';
|
|
11
|
-
|
|
11
|
+
import { SlotFillProvider } from '@wordpress/components';
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
@@ -19,16 +19,18 @@ const noop = () => {};
|
|
|
19
19
|
function TestWrapper() {
|
|
20
20
|
const [ mediaURL, setMediaURL ] = useState( 'https://example.media' );
|
|
21
21
|
return (
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
<SlotFillProvider>
|
|
23
|
+
<MediaReplaceFlow
|
|
24
|
+
mediaId={ 1 }
|
|
25
|
+
mediaURL={ mediaURL }
|
|
26
|
+
allowedTypes={ [ 'png' ] }
|
|
27
|
+
accept="image/*"
|
|
28
|
+
onSelect={ noop }
|
|
29
|
+
onSelectURL={ setMediaURL }
|
|
30
|
+
onError={ noop }
|
|
31
|
+
onCloseModal={ noop }
|
|
32
|
+
/>
|
|
33
|
+
</SlotFillProvider>
|
|
32
34
|
);
|
|
33
35
|
}
|
|
34
36
|
|
|
@@ -71,18 +71,19 @@ export const ExperimentalBlockEditorProvider = withRegistryProvider(
|
|
|
71
71
|
|
|
72
72
|
const mediaUploadSettings = useMediaUploadSettings( _settings );
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
const settings = useMemo( () => {
|
|
75
|
+
if (
|
|
76
|
+
window.__experimentalMediaProcessing &&
|
|
77
|
+
_settings?.mediaUpload
|
|
78
|
+
) {
|
|
79
|
+
// Create a new object so that the original props.settings.mediaUpload is not modified.
|
|
80
|
+
return {
|
|
80
81
|
..._settings,
|
|
81
82
|
mediaUpload: mediaUpload.bind( null, registry ),
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return _settings;
|
|
86
|
+
}, [ _settings, registry ] );
|
|
86
87
|
|
|
87
88
|
const { __experimentalUpdateSettings } = unlock(
|
|
88
89
|
useDispatch( blockEditorStore )
|
|
@@ -26,7 +26,7 @@ function getSubRegistry( subRegistries, registry, useSubRegistry ) {
|
|
|
26
26
|
|
|
27
27
|
const withRegistryProvider = createHigherOrderComponent(
|
|
28
28
|
( WrappedComponent ) =>
|
|
29
|
-
( { useSubRegistry = true, ...props } )
|
|
29
|
+
function WithRegistryProvider( { useSubRegistry = true, ...props } ) {
|
|
30
30
|
const registry = useRegistry();
|
|
31
31
|
const [ subRegistries ] = useState( () => new WeakMap() );
|
|
32
32
|
const subRegistry = getSubRegistry(
|
|
@@ -583,7 +583,7 @@ const PublicForwardedRichTextContainer = forwardRef( ( props, ref ) => {
|
|
|
583
583
|
ref={ ref }
|
|
584
584
|
{ ...contentProps }
|
|
585
585
|
dangerouslySetInnerHTML={ {
|
|
586
|
-
__html: valueToHTMLString( value, multiline ),
|
|
586
|
+
__html: valueToHTMLString( value, multiline ) || '<br>',
|
|
587
587
|
} }
|
|
588
588
|
/>
|
|
589
589
|
);
|