@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
package/src/store/actions.js
CHANGED
|
@@ -248,6 +248,13 @@ export const selectPreviousBlock =
|
|
|
248
248
|
const firstParentClientId = select.getBlockRootClientId( clientId );
|
|
249
249
|
if ( firstParentClientId ) {
|
|
250
250
|
dispatch.selectBlock( firstParentClientId, -1 );
|
|
251
|
+
} else {
|
|
252
|
+
// Fallback to next block when no previous block and no parent
|
|
253
|
+
const nextBlockClientId =
|
|
254
|
+
select.getNextBlockClientId( clientId );
|
|
255
|
+
if ( nextBlockClientId ) {
|
|
256
|
+
dispatch.selectBlock( nextBlockClientId, 0 );
|
|
257
|
+
}
|
|
251
258
|
}
|
|
252
259
|
}
|
|
253
260
|
};
|
package/src/store/defaults.js
CHANGED
|
@@ -157,6 +157,10 @@ export const SETTINGS_DEFAULTS = {
|
|
|
157
157
|
// Allows to disable block locking interface.
|
|
158
158
|
canLockBlocks: true,
|
|
159
159
|
|
|
160
|
+
// Whether the user can edit custom CSS (requires edit_css capability).
|
|
161
|
+
// Defaults to false for safety - PHP passes true when user has capability.
|
|
162
|
+
canEditCSS: false,
|
|
163
|
+
|
|
160
164
|
// Allows to disable Openverse media category in the inserter.
|
|
161
165
|
enableOpenverseMediaCategory: true,
|
|
162
166
|
|
|
@@ -36,12 +36,8 @@ import {
|
|
|
36
36
|
reusableBlocksSelectKey,
|
|
37
37
|
sectionRootClientIdKey,
|
|
38
38
|
isIsolatedEditorKey,
|
|
39
|
-
deviceTypeKey,
|
|
40
39
|
} from './private-keys';
|
|
41
|
-
import {
|
|
42
|
-
BLOCK_VISIBILITY_VIEWPORT_ENTRIES,
|
|
43
|
-
BLOCK_VISIBILITY_VIEWPORTS,
|
|
44
|
-
} from '../components/block-visibility/constants';
|
|
40
|
+
import { BLOCK_VISIBILITY_VIEWPORTS } from '../components/block-visibility/constants';
|
|
45
41
|
|
|
46
42
|
const { isContentBlock } = unlock( blocksPrivateApis );
|
|
47
43
|
|
|
@@ -527,7 +523,6 @@ export function isSectionBlock( state, clientId ) {
|
|
|
527
523
|
|
|
528
524
|
if (
|
|
529
525
|
( attributes?.metadata?.patternName || isTemplatePart ) &&
|
|
530
|
-
!! window?.__experimentalContentOnlyPatternInsertion &&
|
|
531
526
|
! isIsolatedEditor
|
|
532
527
|
) {
|
|
533
528
|
return true;
|
|
@@ -703,18 +698,22 @@ export function getInsertionPoint( state ) {
|
|
|
703
698
|
}
|
|
704
699
|
|
|
705
700
|
/**
|
|
706
|
-
* Returns true if the block is hidden, or false otherwise.
|
|
701
|
+
* Returns true if the block is hidden anywhere, or false otherwise.
|
|
702
|
+
*
|
|
703
|
+
* This selector checks whether a block has visibility metadata set that would
|
|
704
|
+
* hide it at any viewport or everywhere. It's useful for flagging blocks that
|
|
705
|
+
* have visibility restrictions.
|
|
707
706
|
*
|
|
708
|
-
* A block is considered hidden if:
|
|
707
|
+
* A block is considered hidden anywhere if:
|
|
709
708
|
* - blockVisibility is false (hidden everywhere)
|
|
710
|
-
* - blockVisibility
|
|
709
|
+
* - blockVisibility.viewport has any viewport set to false (hidden at specific screen sizes)
|
|
711
710
|
*
|
|
712
711
|
* @param {Object} state Global application state.
|
|
713
712
|
* @param {string} clientId Client ID of the block.
|
|
714
713
|
*
|
|
715
|
-
* @return {boolean} Whether the block is hidden.
|
|
714
|
+
* @return {boolean} Whether the block is hidden anywhere.
|
|
716
715
|
*/
|
|
717
|
-
export const
|
|
716
|
+
export const isBlockHiddenAnywhere = ( state, clientId ) => {
|
|
718
717
|
const blockName = getBlockName( state, clientId );
|
|
719
718
|
if ( ! hasBlockSupport( blockName, 'visibility', true ) ) {
|
|
720
719
|
return false;
|
|
@@ -726,79 +725,110 @@ export const isBlockHidden = ( state, clientId ) => {
|
|
|
726
725
|
return true;
|
|
727
726
|
}
|
|
728
727
|
|
|
729
|
-
if (
|
|
730
|
-
|
|
728
|
+
if (
|
|
729
|
+
typeof blockVisibility?.viewport === 'object' &&
|
|
730
|
+
blockVisibility?.viewport !== null
|
|
731
|
+
) {
|
|
732
|
+
// Check if the block is hidden at any viewport.
|
|
733
|
+
return Object.values( BLOCK_VISIBILITY_VIEWPORTS ).some(
|
|
734
|
+
( viewport ) =>
|
|
735
|
+
blockVisibility?.viewport?.[ viewport.key ] === false
|
|
736
|
+
);
|
|
731
737
|
}
|
|
738
|
+
return false;
|
|
739
|
+
};
|
|
732
740
|
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
+
/**
|
|
742
|
+
* Returns true if the block is hidden everywhere (blockVisibility is false).
|
|
743
|
+
*
|
|
744
|
+
* A block is considered hidden everywhere when blockVisibility is explicitly
|
|
745
|
+
* set to false, which means it's hidden on all viewports.
|
|
746
|
+
*
|
|
747
|
+
* @param {Object} state Global application state.
|
|
748
|
+
* @param {string} clientId Client ID of the block.
|
|
749
|
+
*
|
|
750
|
+
* @return {boolean} Whether the block is hidden everywhere.
|
|
751
|
+
*/
|
|
752
|
+
export const isBlockHiddenEverywhere = ( state, clientId ) => {
|
|
753
|
+
const blockName = getBlockName( state, clientId );
|
|
754
|
+
if ( ! hasBlockSupport( blockName, 'visibility', true ) ) {
|
|
755
|
+
return false;
|
|
741
756
|
}
|
|
757
|
+
const attributes = state.blocks.attributes.get( clientId );
|
|
758
|
+
const blockVisibility = attributes?.metadata?.blockVisibility;
|
|
742
759
|
|
|
760
|
+
if ( blockVisibility === false ) {
|
|
761
|
+
return true;
|
|
762
|
+
}
|
|
743
763
|
return false;
|
|
744
764
|
};
|
|
745
765
|
|
|
746
766
|
/**
|
|
747
|
-
* Returns true if any
|
|
767
|
+
* Returns true if any parent block (immediate or further up the chain) is hidden everywhere.
|
|
748
768
|
*
|
|
749
|
-
*
|
|
750
|
-
*
|
|
751
|
-
*
|
|
769
|
+
* Checks all parent blocks in the hierarchy and returns true if any of them
|
|
770
|
+
* is hidden everywhere.
|
|
771
|
+
*
|
|
772
|
+
* @param {Object} state Global application state.
|
|
773
|
+
* @param {string} clientId Client ID of the block.
|
|
774
|
+
*
|
|
775
|
+
* @return {boolean} Whether any parent block is hidden everywhere.
|
|
752
776
|
*/
|
|
753
|
-
export const
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
777
|
+
export const isBlockParentHiddenEverywhere = ( state, clientId ) => {
|
|
778
|
+
const parents = getBlockParents( state, clientId );
|
|
779
|
+
return parents.some( ( parentId ) =>
|
|
780
|
+
isBlockHiddenEverywhere( state, parentId )
|
|
781
|
+
);
|
|
758
782
|
};
|
|
759
783
|
|
|
760
784
|
/**
|
|
761
|
-
*
|
|
785
|
+
* Returns true if the block is hidden at the given viewport.
|
|
762
786
|
*
|
|
763
|
-
*
|
|
764
|
-
*
|
|
765
|
-
*
|
|
787
|
+
* A block is considered hidden at a viewport if:
|
|
788
|
+
* - blockVisibility is false (hidden everywhere)
|
|
789
|
+
* - blockVisibility is an object with the specified viewport set to false
|
|
766
790
|
*
|
|
767
|
-
*
|
|
768
|
-
*
|
|
769
|
-
*
|
|
791
|
+
* @param {Object} state Global application state.
|
|
792
|
+
* @param {string} clientId Client ID of the block.
|
|
793
|
+
* @param {string} viewport Viewport to check ('desktop', 'tablet', 'mobile').
|
|
770
794
|
*
|
|
771
|
-
* @
|
|
772
|
-
* @param {Array} clientIds Array of block client IDs to check.
|
|
773
|
-
* @return {boolean} `true` if at least one block meets the visibility criteria, `false` otherwise.
|
|
795
|
+
* @return {boolean} Whether the block is hidden at the viewport.
|
|
774
796
|
*/
|
|
775
|
-
export const
|
|
776
|
-
if (
|
|
777
|
-
return
|
|
797
|
+
export const isBlockHiddenAtViewport = ( state, clientId, viewport ) => {
|
|
798
|
+
if ( isBlockHiddenEverywhere( state, clientId ) ) {
|
|
799
|
+
return true;
|
|
778
800
|
}
|
|
779
|
-
return clientIds.some( ( clientId ) => {
|
|
780
|
-
if ( ! clientId ) {
|
|
781
|
-
return false;
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
const attributes = state.blocks.attributes.get( clientId );
|
|
785
|
-
const blockVisibility = attributes?.metadata?.blockVisibility;
|
|
786
|
-
|
|
787
|
-
// If explicitly hidden everywhere (false), return true.
|
|
788
|
-
if ( typeof blockVisibility === 'boolean' ) {
|
|
789
|
-
return blockVisibility === false;
|
|
790
|
-
}
|
|
791
801
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
802
|
+
const attributes = state.blocks.attributes.get( clientId );
|
|
803
|
+
const blockVisibilityViewport =
|
|
804
|
+
attributes?.metadata?.blockVisibility?.viewport;
|
|
805
|
+
if (
|
|
806
|
+
typeof blockVisibilityViewport === 'object' &&
|
|
807
|
+
blockVisibilityViewport !== null &&
|
|
808
|
+
typeof viewport === 'string'
|
|
809
|
+
) {
|
|
810
|
+
return blockVisibilityViewport?.[ viewport.toLowerCase() ] === false;
|
|
811
|
+
}
|
|
812
|
+
return false;
|
|
813
|
+
};
|
|
796
814
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
815
|
+
/**
|
|
816
|
+
* Returns true if any parent block (immediate or further up the chain) is hidden at the given viewport.
|
|
817
|
+
*
|
|
818
|
+
* Checks all parent blocks in the hierarchy and returns true if any of them
|
|
819
|
+
* is hidden at the specified viewport.
|
|
820
|
+
*
|
|
821
|
+
* @param {Object} state Global application state.
|
|
822
|
+
* @param {string} clientId Client ID of the block.
|
|
823
|
+
* @param {string} viewport Viewport to check ('desktop', 'tablet', 'mobile').
|
|
824
|
+
*
|
|
825
|
+
* @return {boolean} Whether any parent block is hidden at the viewport.
|
|
826
|
+
*/
|
|
827
|
+
export const isBlockParentHiddenAtViewport = ( state, clientId, viewport ) => {
|
|
828
|
+
const parents = getBlockParents( state, clientId );
|
|
829
|
+
return parents.some( ( parentId ) =>
|
|
830
|
+
isBlockHiddenAtViewport( state, parentId, viewport )
|
|
831
|
+
);
|
|
802
832
|
};
|
|
803
833
|
|
|
804
834
|
/**
|
package/src/store/reducer.js
CHANGED
|
@@ -2283,22 +2283,17 @@ function getDerivedBlockEditingModesForTree( state, treeClientId = '' ) {
|
|
|
2283
2283
|
|
|
2284
2284
|
// Use array.from for better back compat. Older versions of the iterator returned
|
|
2285
2285
|
// from `keys()` didn't have the `filter` method.
|
|
2286
|
-
const unsyncedPatternClientIds =
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
( clientId )
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
)
|
|
2294
|
-
: [];
|
|
2286
|
+
const unsyncedPatternClientIds = isIsolatedEditor
|
|
2287
|
+
? []
|
|
2288
|
+
: Array.from( state.blocks.attributes.keys() ).filter(
|
|
2289
|
+
( clientId ) =>
|
|
2290
|
+
state.blocks.attributes.get( clientId )?.metadata
|
|
2291
|
+
?.patternName
|
|
2292
|
+
);
|
|
2295
2293
|
const contentOnlyParents = [
|
|
2296
2294
|
...contentOnlyTemplateLockedClientIds,
|
|
2297
2295
|
...unsyncedPatternClientIds,
|
|
2298
|
-
...(
|
|
2299
|
-
! isIsolatedEditor
|
|
2300
|
-
? templatePartClientIds
|
|
2301
|
-
: [] ),
|
|
2296
|
+
...( isIsolatedEditor ? [] : templatePartClientIds ),
|
|
2302
2297
|
];
|
|
2303
2298
|
|
|
2304
2299
|
traverseBlockTree( state, treeClientId, ( block ) => {
|
|
@@ -2323,11 +2318,9 @@ function getDerivedBlockEditingModesForTree( state, treeClientId = '' ) {
|
|
|
2323
2318
|
return;
|
|
2324
2319
|
}
|
|
2325
2320
|
|
|
2326
|
-
//
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
return;
|
|
2330
|
-
}
|
|
2321
|
+
// Disable blocks that are outside of the edited section.
|
|
2322
|
+
derivedBlockEditingModes.set( clientId, 'disabled' );
|
|
2323
|
+
return;
|
|
2331
2324
|
}
|
|
2332
2325
|
|
|
2333
2326
|
// If the block already has an explicit block editing mode set,
|
package/src/store/selectors.js
CHANGED
|
@@ -1681,6 +1681,11 @@ const canInsertBlockTypeUnmemoized = (
|
|
|
1681
1681
|
blockName,
|
|
1682
1682
|
rootClientId = null
|
|
1683
1683
|
) => {
|
|
1684
|
+
// Disable insertion in preview mode.
|
|
1685
|
+
if ( state.settings.isPreviewMode ) {
|
|
1686
|
+
return false;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1684
1689
|
if ( ! isBlockVisibleInTheInserter( state, blockName, rootClientId ) ) {
|
|
1685
1690
|
return false;
|
|
1686
1691
|
}
|
|
@@ -1868,6 +1873,11 @@ export function canInsertBlocks( state, clientIds, rootClientId = null ) {
|
|
|
1868
1873
|
* @return {boolean} Whether the given block is allowed to be removed.
|
|
1869
1874
|
*/
|
|
1870
1875
|
export function canRemoveBlock( state, clientId ) {
|
|
1876
|
+
// Disable removal in preview mode.
|
|
1877
|
+
if ( state.settings.isPreviewMode ) {
|
|
1878
|
+
return false;
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1871
1881
|
const attributes = getBlockAttributes( state, clientId );
|
|
1872
1882
|
if ( attributes === null ) {
|
|
1873
1883
|
return true;
|
|
@@ -1930,6 +1940,11 @@ export function canRemoveBlocks( state, clientIds ) {
|
|
|
1930
1940
|
* @return {boolean} Whether the given block is allowed to be moved.
|
|
1931
1941
|
*/
|
|
1932
1942
|
export function canMoveBlock( state, clientId ) {
|
|
1943
|
+
// Disable moving in preview mode.
|
|
1944
|
+
if ( state.settings.isPreviewMode ) {
|
|
1945
|
+
return false;
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1933
1948
|
const attributes = getBlockAttributes( state, clientId );
|
|
1934
1949
|
if ( attributes === null ) {
|
|
1935
1950
|
return true;
|
|
@@ -1991,6 +2006,11 @@ export function canMoveBlocks( state, clientIds ) {
|
|
|
1991
2006
|
* @return {boolean} Whether the given block is allowed to be edited.
|
|
1992
2007
|
*/
|
|
1993
2008
|
export function canEditBlock( state, clientId ) {
|
|
2009
|
+
// Disable editing in preview mode.
|
|
2010
|
+
if ( state.settings.isPreviewMode ) {
|
|
2011
|
+
return false;
|
|
2012
|
+
}
|
|
2013
|
+
|
|
1994
2014
|
const attributes = getBlockAttributes( state, clientId );
|
|
1995
2015
|
if ( attributes === null ) {
|
|
1996
2016
|
return true;
|
|
@@ -2011,6 +2031,11 @@ export function canEditBlock( state, clientId ) {
|
|
|
2011
2031
|
* @return {boolean} Whether a given block type can be locked/unlocked.
|
|
2012
2032
|
*/
|
|
2013
2033
|
export function canLockBlockType( state, nameOrType ) {
|
|
2034
|
+
// Disable locking in preview mode.
|
|
2035
|
+
if ( state.settings.isPreviewMode ) {
|
|
2036
|
+
return false;
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2014
2039
|
if ( ! hasBlockSupport( nameOrType, 'lock', true ) ) {
|
|
2015
2040
|
return false;
|
|
2016
2041
|
}
|
|
@@ -60,6 +60,7 @@ const {
|
|
|
60
60
|
|
|
61
61
|
describe( 'actions', () => {
|
|
62
62
|
const defaultBlockSettings = {
|
|
63
|
+
apiVersion: 3,
|
|
63
64
|
attributes: {
|
|
64
65
|
content: {},
|
|
65
66
|
},
|
|
@@ -863,6 +864,7 @@ describe( 'actions', () => {
|
|
|
863
864
|
|
|
864
865
|
it( 'should merge the blocks if blocks of the same type', () => {
|
|
865
866
|
registerBlockType( 'core/test-block', {
|
|
867
|
+
apiVersion: 3,
|
|
866
868
|
attributes: {
|
|
867
869
|
content: {},
|
|
868
870
|
},
|
|
@@ -933,6 +935,7 @@ describe( 'actions', () => {
|
|
|
933
935
|
|
|
934
936
|
it( 'should not merge the blocks have different types without transformation', () => {
|
|
935
937
|
registerBlockType( 'core/test-block', {
|
|
938
|
+
apiVersion: 3,
|
|
936
939
|
attributes: {
|
|
937
940
|
content: {},
|
|
938
941
|
},
|
|
@@ -986,6 +989,7 @@ describe( 'actions', () => {
|
|
|
986
989
|
|
|
987
990
|
it( 'should transform and merge the blocks', () => {
|
|
988
991
|
registerBlockType( 'core/test-block', {
|
|
992
|
+
apiVersion: 3,
|
|
989
993
|
attributes: {
|
|
990
994
|
content: {
|
|
991
995
|
type: 'string',
|
|
@@ -1004,6 +1008,7 @@ describe( 'actions', () => {
|
|
|
1004
1008
|
title: 'test block',
|
|
1005
1009
|
} );
|
|
1006
1010
|
registerBlockType( 'core/test-block-2', {
|
|
1011
|
+
apiVersion: 3,
|
|
1007
1012
|
attributes: {
|
|
1008
1013
|
content2: {
|
|
1009
1014
|
type: 'string',
|
|
@@ -1081,6 +1086,7 @@ describe( 'actions', () => {
|
|
|
1081
1086
|
|
|
1082
1087
|
it( 'should not merge the blocks if blockB editing mode is `disabled`', () => {
|
|
1083
1088
|
registerBlockType( 'core/test-block', {
|
|
1089
|
+
apiVersion: 3,
|
|
1084
1090
|
attributes: {
|
|
1085
1091
|
content: {},
|
|
1086
1092
|
},
|
|
@@ -1140,6 +1146,7 @@ describe( 'actions', () => {
|
|
|
1140
1146
|
|
|
1141
1147
|
it( 'should not merge the blocks if blockA editing mode is `disabled`', () => {
|
|
1142
1148
|
registerBlockType( 'core/test-block', {
|
|
1149
|
+
apiVersion: 3,
|
|
1143
1150
|
attributes: {
|
|
1144
1151
|
content: {},
|
|
1145
1152
|
},
|