@wordpress/block-editor 15.21.0 → 15.22.1-next.v.202606191442.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 +23 -1
- package/build/components/block-card/index.cjs +4 -5
- package/build/components/block-card/index.cjs.map +2 -2
- package/build/components/block-compare/index.cjs +2 -2
- package/build/components/block-compare/index.cjs.map +2 -2
- package/build/components/block-inspector/index.cjs +3 -4
- package/build/components/block-inspector/index.cjs.map +2 -2
- package/build/components/block-mover/mover-description.cjs +6 -6
- package/build/components/block-mover/mover-description.cjs.map +1 -1
- package/build/components/block-patterns-list/index.cjs +1 -1
- package/build/components/block-patterns-list/index.cjs.map +2 -2
- package/build/components/block-patterns-paging/index.cjs +4 -4
- package/build/components/block-patterns-paging/index.cjs.map +2 -2
- package/build/components/block-popover/use-popover-scroll.cjs.map +1 -1
- package/build/components/block-quick-navigation/index.cjs +7 -5
- package/build/components/block-quick-navigation/index.cjs.map +2 -2
- package/build/components/block-switcher/block-transformations-menu.cjs +16 -15
- package/build/components/block-switcher/block-transformations-menu.cjs.map +2 -2
- package/build/components/block-switcher/index.cjs +4 -4
- package/build/components/block-switcher/index.cjs.map +2 -2
- package/build/components/block-toolbar/edit-section-button.cjs.map +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.cjs +10 -4
- package/build/components/block-tools/use-block-toolbar-popover-props.cjs.map +2 -2
- package/build/components/child-layout-control/index.cjs +51 -19
- package/build/components/child-layout-control/index.cjs.map +2 -2
- package/build/components/dimensions-tool/index.cjs +4 -5
- package/build/components/dimensions-tool/index.cjs.map +2 -2
- package/build/components/dimensions-tool/scale-tool.cjs +1 -1
- package/build/components/dimensions-tool/scale-tool.cjs.map +2 -2
- package/build/components/global-styles/advanced-panel.cjs +23 -15
- package/build/components/global-styles/advanced-panel.cjs.map +2 -2
- package/build/components/global-styles/background-panel.cjs +2 -2
- package/build/components/global-styles/background-panel.cjs.map +2 -2
- package/build/components/global-styles/border-panel.cjs +2 -0
- package/build/components/global-styles/border-panel.cjs.map +2 -2
- package/build/components/global-styles/dimensions-panel.cjs +2 -2
- package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
- package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
- package/build/components/grid/grid-item-resizer.cjs.map +1 -1
- package/build/components/grid/grid-visualizer.cjs.map +1 -1
- package/build/components/iframe/index.cjs +6 -3
- package/build/components/iframe/index.cjs.map +3 -3
- package/build/components/image-editor/use-transform-image.cjs.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.cjs +3 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.cjs.map +2 -2
- package/build/components/inserter/get-appender-label.cjs.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.cjs +1 -1
- package/build/components/inserter/hooks/use-patterns-state.cjs.map +2 -2
- package/build/components/inserter/index.cjs +179 -220
- package/build/components/inserter/index.cjs.map +3 -3
- package/build/components/inserter/media-tab/media-preview.cjs.map +2 -2
- package/build/components/inserter/search-items.cjs.map +1 -1
- package/build/components/inserter/search-results.cjs +1 -1
- package/build/components/inserter/search-results.cjs.map +2 -2
- package/build/components/inspector-controls/fill.cjs +1 -3
- package/build/components/inspector-controls/fill.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/index.cjs.map +2 -2
- 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/keyboard-shortcuts/index.cjs.map +1 -1
- package/build/components/line-height-control/index.cjs.map +1 -1
- package/build/components/link-control/index.cjs +1 -1
- package/build/components/link-control/index.cjs.map +1 -1
- package/build/components/link-control/normalize-url.cjs.map +1 -1
- package/build/components/list-view/block-select-button.cjs +10 -12
- package/build/components/list-view/block-select-button.cjs.map +2 -2
- package/build/components/list-view/block.cjs +2 -1
- package/build/components/list-view/block.cjs.map +2 -2
- package/build/components/list-view/utils.cjs.map +1 -1
- package/build/components/preset-input-control/custom-value-controls.cjs.map +2 -2
- package/build/components/provider/index.cjs.map +1 -1
- package/build/components/provider/use-block-sync.cjs +11 -2
- package/build/components/provider/use-block-sync.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/before-input-rules.cjs +5 -5
- package/build/components/rich-text/event-listeners/before-input-rules.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/delete.cjs +4 -4
- package/build/components/rich-text/event-listeners/delete.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/enter.cjs +7 -2
- package/build/components/rich-text/event-listeners/enter.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/input-events.cjs +4 -4
- package/build/components/rich-text/event-listeners/input-events.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/input-rules.cjs +17 -4
- package/build/components/rich-text/event-listeners/input-rules.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/insert-replacement-text.cjs +4 -4
- package/build/components/rich-text/event-listeners/insert-replacement-text.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/paste-handler.cjs.map +1 -1
- package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs +4 -4
- package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/shortcuts.cjs +4 -4
- package/build/components/rich-text/event-listeners/shortcuts.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/undo-automatic-change.cjs +4 -4
- package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +3 -3
- package/build/components/rich-text/index.cjs +1 -23
- package/build/components/rich-text/index.cjs.map +2 -2
- package/build/components/rich-text/prevent-event-discovery.cjs +1 -1
- package/build/components/rich-text/prevent-event-discovery.cjs.map +1 -1
- package/build/components/use-block-commands/index.cjs +5 -5
- package/build/components/use-block-commands/index.cjs.map +2 -2
- package/build/components/writing-flow/use-tab-nav.cjs.map +1 -1
- package/build/hooks/anchor.cjs +12 -16
- package/build/hooks/anchor.cjs.map +2 -2
- package/build/hooks/background.cjs.map +1 -1
- package/build/hooks/block-fields/index.cjs +13 -2
- package/build/hooks/block-fields/index.cjs.map +2 -2
- package/build/hooks/border.cjs +0 -3
- package/build/hooks/border.cjs.map +2 -2
- package/build/hooks/color.cjs +1 -4
- package/build/hooks/color.cjs.map +2 -2
- package/build/hooks/dimensions.cjs +13 -5
- package/build/hooks/dimensions.cjs.map +2 -2
- package/build/hooks/fit-text.cjs +11 -0
- package/build/hooks/fit-text.cjs.map +2 -2
- package/build/hooks/layout-child.cjs +27 -2
- package/build/hooks/layout-child.cjs.map +2 -2
- package/build/hooks/list-view.cjs +10 -7
- package/build/hooks/list-view.cjs.map +2 -2
- package/build/hooks/position.cjs +19 -22
- package/build/hooks/position.cjs.map +2 -2
- package/build/hooks/spacing-visualizer.cjs.map +1 -1
- package/build/hooks/state-utils.cjs.map +1 -1
- package/build/hooks/style.cjs +42 -2
- package/build/hooks/style.cjs.map +2 -2
- package/build/hooks/supports.cjs +0 -7
- package/build/hooks/supports.cjs.map +2 -2
- package/build/private-apis.cjs +4 -0
- package/build/private-apis.cjs.map +2 -2
- package/build/store/actions.cjs +7 -3
- package/build/store/actions.cjs.map +2 -2
- package/build/store/private-actions.cjs +1 -2
- package/build/store/private-actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +42 -2
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +14 -6
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +60 -41
- package/build/store/selectors.cjs.map +2 -2
- package/build/utils/dom.cjs.map +1 -1
- package/build/utils/selection.cjs +1 -1
- package/build-module/components/block-card/index.mjs +5 -6
- package/build-module/components/block-card/index.mjs.map +2 -2
- package/build-module/components/block-compare/index.mjs +1 -1
- package/build-module/components/block-compare/index.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +3 -5
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-mover/mover-description.mjs +6 -6
- package/build-module/components/block-mover/mover-description.mjs.map +1 -1
- package/build-module/components/block-patterns-list/index.mjs +1 -1
- package/build-module/components/block-patterns-list/index.mjs.map +2 -2
- package/build-module/components/block-patterns-paging/index.mjs +4 -4
- package/build-module/components/block-patterns-paging/index.mjs.map +2 -2
- package/build-module/components/block-popover/use-popover-scroll.mjs.map +1 -1
- package/build-module/components/block-quick-navigation/index.mjs +8 -6
- package/build-module/components/block-quick-navigation/index.mjs.map +2 -2
- package/build-module/components/block-switcher/block-transformations-menu.mjs +16 -15
- package/build-module/components/block-switcher/block-transformations-menu.mjs.map +2 -2
- package/build-module/components/block-switcher/index.mjs +4 -4
- package/build-module/components/block-switcher/index.mjs.map +2 -2
- package/build-module/components/block-toolbar/edit-section-button.mjs.map +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.mjs +10 -4
- package/build-module/components/block-tools/use-block-toolbar-popover-props.mjs.map +2 -2
- package/build-module/components/child-layout-control/index.mjs +51 -19
- package/build-module/components/child-layout-control/index.mjs.map +2 -2
- package/build-module/components/dimensions-tool/index.mjs +4 -5
- package/build-module/components/dimensions-tool/index.mjs.map +2 -2
- package/build-module/components/dimensions-tool/scale-tool.mjs +1 -1
- package/build-module/components/dimensions-tool/scale-tool.mjs.map +2 -2
- package/build-module/components/global-styles/advanced-panel.mjs +23 -15
- package/build-module/components/global-styles/advanced-panel.mjs.map +2 -2
- package/build-module/components/global-styles/background-panel.mjs +3 -3
- package/build-module/components/global-styles/background-panel.mjs.map +2 -2
- package/build-module/components/global-styles/border-panel.mjs +2 -0
- package/build-module/components/global-styles/border-panel.mjs.map +2 -2
- package/build-module/components/global-styles/dimensions-panel.mjs +3 -4
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
- package/build-module/components/grid/grid-item-resizer.mjs.map +1 -1
- package/build-module/components/grid/grid-visualizer.mjs.map +1 -1
- package/build-module/components/iframe/index.mjs +6 -3
- package/build-module/components/iframe/index.mjs.map +2 -2
- package/build-module/components/image-editor/use-transform-image.mjs.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs +3 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs.map +2 -2
- package/build-module/components/inserter/get-appender-label.mjs.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.mjs +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.mjs.map +2 -2
- package/build-module/components/inserter/index.mjs +185 -222
- package/build-module/components/inserter/index.mjs.map +3 -3
- package/build-module/components/inserter/media-tab/media-preview.mjs.map +2 -2
- package/build-module/components/inserter/search-items.mjs.map +1 -1
- package/build-module/components/inserter/search-results.mjs +1 -1
- package/build-module/components/inserter/search-results.mjs.map +2 -2
- package/build-module/components/inspector-controls/fill.mjs +1 -3
- package/build-module/components/inspector-controls/fill.mjs.map +2 -2
- 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/keyboard-shortcuts/index.mjs.map +1 -1
- package/build-module/components/line-height-control/index.mjs.map +1 -1
- package/build-module/components/link-control/index.mjs +1 -1
- package/build-module/components/link-control/index.mjs.map +1 -1
- package/build-module/components/link-control/normalize-url.mjs.map +1 -1
- package/build-module/components/list-view/block-select-button.mjs +10 -12
- package/build-module/components/list-view/block-select-button.mjs.map +2 -2
- package/build-module/components/list-view/block.mjs +2 -1
- package/build-module/components/list-view/block.mjs.map +2 -2
- package/build-module/components/list-view/utils.mjs.map +1 -1
- package/build-module/components/preset-input-control/custom-value-controls.mjs.map +2 -2
- package/build-module/components/provider/index.mjs.map +1 -1
- package/build-module/components/provider/use-block-sync.mjs +11 -2
- package/build-module/components/provider/use-block-sync.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/before-input-rules.mjs +5 -5
- package/build-module/components/rich-text/event-listeners/before-input-rules.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/delete.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/delete.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/enter.mjs +7 -2
- package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/input-events.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/input-events.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/input-rules.mjs +17 -4
- package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +1 -1
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/shortcuts.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/shortcuts.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +2 -2
- package/build-module/components/rich-text/index.mjs +1 -23
- package/build-module/components/rich-text/index.mjs.map +2 -2
- package/build-module/components/rich-text/prevent-event-discovery.mjs +1 -1
- package/build-module/components/rich-text/prevent-event-discovery.mjs.map +1 -1
- package/build-module/components/use-block-commands/index.mjs +5 -5
- package/build-module/components/use-block-commands/index.mjs.map +2 -2
- package/build-module/components/writing-flow/use-tab-nav.mjs.map +1 -1
- package/build-module/hooks/anchor.mjs +12 -16
- package/build-module/hooks/anchor.mjs.map +2 -2
- package/build-module/hooks/background.mjs.map +1 -1
- package/build-module/hooks/block-fields/index.mjs +13 -2
- package/build-module/hooks/block-fields/index.mjs.map +2 -2
- package/build-module/hooks/border.mjs +1 -4
- package/build-module/hooks/border.mjs.map +2 -2
- package/build-module/hooks/color.mjs +2 -5
- package/build-module/hooks/color.mjs.map +2 -2
- package/build-module/hooks/dimensions.mjs +13 -6
- package/build-module/hooks/dimensions.mjs.map +2 -2
- package/build-module/hooks/fit-text.mjs +11 -0
- package/build-module/hooks/fit-text.mjs.map +2 -2
- package/build-module/hooks/layout-child.mjs +27 -2
- package/build-module/hooks/layout-child.mjs.map +2 -2
- package/build-module/hooks/list-view.mjs +10 -7
- package/build-module/hooks/list-view.mjs.map +2 -2
- package/build-module/hooks/position.mjs +20 -23
- package/build-module/hooks/position.mjs.map +2 -2
- package/build-module/hooks/spacing-visualizer.mjs.map +1 -1
- package/build-module/hooks/state-utils.mjs.map +1 -1
- package/build-module/hooks/style.mjs +44 -3
- package/build-module/hooks/style.mjs.map +2 -2
- package/build-module/hooks/supports.mjs +0 -7
- package/build-module/hooks/supports.mjs.map +2 -2
- package/build-module/private-apis.mjs +8 -0
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/actions.mjs +7 -3
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +1 -2
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +39 -1
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +14 -6
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +62 -42
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/dom.mjs.map +1 -1
- package/build-module/utils/selection.mjs +1 -1
- package/build-style/content-rtl.css +12 -0
- package/build-style/content.css +12 -0
- package/build-style/style-rtl.css +26 -8
- package/build-style/style.css +26 -8
- package/package.json +54 -46
- package/src/components/block-breadcrumb/README.md +2 -2
- package/src/components/block-card/index.js +7 -13
- package/src/components/block-compare/README.md +6 -6
- package/src/components/block-compare/index.js +1 -3
- package/src/components/block-inspector/index.js +2 -10
- package/src/components/block-patterns-list/index.js +1 -2
- package/src/components/block-preview/README.md +1 -1
- package/src/components/block-quick-navigation/index.js +7 -7
- package/src/components/block-switcher/block-transformations-menu.js +16 -18
- package/src/components/block-switcher/index.js +4 -4
- package/src/components/block-tools/use-block-toolbar-popover-props.js +10 -4
- package/src/components/block-types-list/README.md +0 -19
- package/src/components/child-layout-control/index.js +65 -20
- package/src/components/child-layout-control/test/index.js +64 -0
- package/src/components/dimensions-tool/index.js +4 -9
- package/src/components/dimensions-tool/scale-tool.js +1 -2
- package/src/components/dimensions-tool/test/index.js +89 -11
- package/src/components/global-styles/advanced-panel.js +5 -1
- package/src/components/global-styles/background-panel.js +3 -3
- package/src/components/global-styles/border-panel.js +2 -0
- package/src/components/global-styles/dimensions-panel.js +13 -15
- package/src/components/global-styles/shadow-panel-components.js +0 -1
- package/src/components/iframe/index.js +8 -3
- package/src/components/inner-blocks/use-inner-block-template-sync.js +3 -1
- package/src/components/inserter/hooks/use-patterns-state.js +1 -1
- package/src/components/inserter/index.js +257 -288
- package/src/components/inserter/media-tab/media-preview.js +0 -1
- package/src/components/inserter/search-results.js +1 -3
- package/src/components/inspector-controls/fill.js +6 -8
- package/src/components/inspector-controls-tabs/index.js +0 -1
- package/src/components/inspector-controls-tabs/styles-tab.js +5 -1
- package/src/components/justify-content-control/README.md +1 -1
- package/src/components/list-view/block-select-button.js +9 -14
- package/src/components/list-view/block.js +1 -0
- package/src/components/media-placeholder/README.md +1 -29
- package/src/components/media-upload/README.md +0 -19
- package/src/components/preset-input-control/custom-value-controls.js +0 -1
- package/src/components/provider/test/use-block-sync.js +40 -0
- package/src/components/provider/use-block-sync.js +12 -2
- package/src/components/rich-text/event-listeners/before-input-rules.js +5 -4
- package/src/components/rich-text/event-listeners/delete.js +9 -4
- package/src/components/rich-text/event-listeners/enter.js +9 -2
- package/src/components/rich-text/event-listeners/input-events.js +13 -4
- package/src/components/rich-text/event-listeners/input-rules.js +20 -4
- package/src/components/rich-text/event-listeners/insert-replacement-text.js +9 -4
- package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +9 -4
- package/src/components/rich-text/event-listeners/shortcuts.js +13 -4
- package/src/components/rich-text/event-listeners/undo-automatic-change.js +5 -4
- package/src/components/rich-text/index.js +1 -33
- package/src/components/unit-control/README.md +1 -1
- package/src/components/url-popover/README.md +1 -1
- package/src/components/use-block-commands/index.js +5 -5
- package/src/hooks/anchor.js +9 -17
- package/src/hooks/block-fields/index.js +27 -2
- package/src/hooks/border.js +1 -5
- package/src/hooks/color.js +1 -6
- package/src/hooks/dimensions.js +15 -8
- package/src/hooks/fit-text.js +16 -0
- package/src/hooks/layout-child.js +41 -2
- package/src/hooks/list-view.js +10 -11
- package/src/hooks/position.js +23 -27
- package/src/hooks/style.js +80 -2
- package/src/hooks/supports.js +0 -9
- package/src/hooks/test/dimensions.js +71 -0
- package/src/hooks/test/layout-child.js +165 -0
- package/src/hooks/test/style.js +126 -4
- package/src/private-apis.js +8 -0
- package/src/store/actions.js +13 -3
- package/src/store/private-actions.js +1 -4
- package/src/store/private-selectors.js +89 -0
- package/src/store/reducer.js +19 -7
- package/src/store/selectors.js +91 -53
- package/src/store/test/actions.js +21 -0
- package/src/store/test/private-selectors.js +138 -0
- package/src/store/test/reducer.js +46 -0
- package/src/store/test/selectors.js +77 -0
- package/build/components/media-upload-progress/constants.cjs +0 -46
- package/build/components/media-upload-progress/constants.cjs.map +0 -7
- package/build/components/rich-text/native/format-edit.cjs +0 -60
- package/build/components/rich-text/native/format-edit.cjs.map +0 -7
- package/build/components/rich-text/native/index.cjs +0 -28
- package/build/components/rich-text/native/index.cjs.map +0 -7
- package/build/components/rich-text/native/use-format-types.cjs +0 -139
- package/build/components/rich-text/native/use-format-types.cjs.map +0 -7
- package/build-module/components/media-upload-progress/constants.mjs +0 -16
- package/build-module/components/media-upload-progress/constants.mjs.map +0 -7
- package/build-module/components/rich-text/native/format-edit.mjs +0 -39
- package/build-module/components/rich-text/native/format-edit.mjs.map +0 -7
- package/build-module/components/rich-text/native/index.mjs +0 -7
- package/build-module/components/rich-text/native/index.mjs.map +0 -7
- package/build-module/components/rich-text/native/use-format-types.mjs +0 -114
- package/build-module/components/rich-text/native/use-format-types.mjs.map +0 -7
- package/src/components/audio-player/audio-url-parser.native.js +0 -20
- package/src/components/audio-player/index.native.js +0 -225
- package/src/components/audio-player/styles.native.scss +0 -114
- package/src/components/audio-player/test/audio-url-parser.native.js +0 -53
- package/src/components/block-alignment-control/test/index.native.js +0 -37
- package/src/components/block-alignment-control/ui.native.js +0 -86
- package/src/components/block-caption/README.md +0 -104
- package/src/components/block-caption/index.native.js +0 -89
- package/src/components/block-caption/styles.native.scss +0 -7
- package/src/components/block-controls/slot.native.js +0 -33
- package/src/components/block-draggable/draggable-chip.native.js +0 -49
- package/src/components/block-draggable/dropping-insertion-point.native.js +0 -181
- package/src/components/block-draggable/dropping-insertion-point.native.scss +0 -8
- package/src/components/block-draggable/index.native.js +0 -467
- package/src/components/block-draggable/style.native.scss +0 -19
- package/src/components/block-draggable/test/__snapshots__/index.native.js.snap +0 -73
- package/src/components/block-draggable/test/helpers.native.js +0 -182
- package/src/components/block-draggable/test/index.native.js +0 -419
- package/src/components/block-draggable/use-scroll-when-dragging.native.js +0 -135
- package/src/components/block-edit/edit.native.js +0 -49
- package/src/components/block-edit/test/edit.native.js +0 -65
- package/src/components/block-heading-level-dropdown/index.native.js +0 -68
- package/src/components/block-icon/index.native.js +0 -47
- package/src/components/block-icon/style.native.scss +0 -7
- package/src/components/block-list/block-crash-boundary.native.js +0 -43
- package/src/components/block-list/block-crash-warning.native.js +0 -21
- package/src/components/block-list/block-invalid-warning.native.js +0 -70
- package/src/components/block-list/block-list-context.native.js +0 -172
- package/src/components/block-list/block-list-item-cell.native.js +0 -62
- package/src/components/block-list/block-list-item.native.js +0 -209
- package/src/components/block-list/block-list-item.native.scss +0 -16
- package/src/components/block-list/block-outline.native.js +0 -77
- package/src/components/block-list/block-selection-button.native.js +0 -100
- package/src/components/block-list/block-selection-button.native.scss +0 -34
- package/src/components/block-list/block.native.js +0 -716
- package/src/components/block-list/block.native.scss +0 -62
- package/src/components/block-list/grid-item.native.js +0 -58
- package/src/components/block-list/index.native.js +0 -437
- package/src/components/block-list/insertion-point.native.js +0 -36
- package/src/components/block-list/style.native.scss +0 -117
- package/src/components/block-list/test/block-invalid-warning.native.js +0 -62
- package/src/components/block-list/test/block-list-context.native.js +0 -243
- package/src/components/block-list/test/block-outline.native.js +0 -255
- package/src/components/block-list/test/fixtures/block-list-context.native.js +0 -79
- package/src/components/block-list/test/index.native.js +0 -205
- package/src/components/block-list/use-block-props/index.native.js +0 -10
- package/src/components/block-list/use-scroll-upon-insertion.native.js +0 -52
- package/src/components/block-list-appender/index.native.js +0 -70
- package/src/components/block-list-appender/style.native.scss +0 -8
- package/src/components/block-media-update-progress/README.md +0 -100
- package/src/components/block-media-update-progress/index.native.js +0 -299
- package/src/components/block-media-update-progress/styles.native.scss +0 -9
- package/src/components/block-media-update-progress/test/index.native.js +0 -543
- package/src/components/block-mover/index.native.js +0 -193
- package/src/components/block-mover/mover-description.native.js +0 -155
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +0 -218
- package/src/components/block-mover/test/index.native.js +0 -186
- package/src/components/block-settings/button.native.js +0 -41
- package/src/components/block-settings/container.native.js +0 -91
- package/src/components/block-settings/container.native.scss +0 -4
- package/src/components/block-settings/index.native.js +0 -5
- package/src/components/block-styles/index.native.js +0 -94
- package/src/components/block-styles/preview.native.js +0 -109
- package/src/components/block-styles/style.native.scss +0 -64
- package/src/components/block-switcher/block-transformations-menu.native.js +0 -91
- package/src/components/block-toolbar/block-toolbar-menu.native.js +0 -477
- package/src/components/block-toolbar/index.native.js +0 -126
- package/src/components/block-toolbar/test/__snapshots__/block-toolbar-menu.native.js.snap +0 -125
- package/src/components/block-toolbar/test/block-toolbar-menu.native.js +0 -405
- package/src/components/block-toolbar/test/index.native.js +0 -36
- package/src/components/block-types-list/index.native.js +0 -175
- package/src/components/block-types-list/style.native.scss +0 -25
- package/src/components/block-variation-picker/index.native.js +0 -107
- package/src/components/block-variation-picker/style.native.scss +0 -32
- package/src/components/button-block-appender/index.native.js +0 -92
- package/src/components/button-block-appender/styles.native.scss +0 -43
- package/src/components/caption/README.md +0 -44
- package/src/components/caption/index.native.js +0 -61
- package/src/components/colors-gradients/panel-color-gradient-settings.native.js +0 -59
- package/src/components/contrast-checker/index.native.js +0 -113
- package/src/components/contrast-checker/style.native.scss +0 -26
- package/src/components/convert-to-group-buttons/index.native.js +0 -79
- package/src/components/default-block-appender/index.native.js +0 -113
- package/src/components/default-block-appender/style.native.scss +0 -18
- package/src/components/floating-toolbar/floatingToolbar.android.scss +0 -4
- package/src/components/floating-toolbar/floatingToolbar.ios.scss +0 -3
- package/src/components/floating-toolbar/index.native.js +0 -141
- package/src/components/floating-toolbar/styles.native.scss +0 -43
- package/src/components/font-sizes/index.native.js +0 -7
- package/src/components/global-styles/color-panel.native.js +0 -207
- package/src/components/global-styles/test/use-global-styles-context.native.js +0 -435
- package/src/components/global-styles/use-global-styles-context.native.js +0 -592
- package/src/components/gradients/index.native.js +0 -2
- package/src/components/image-link-destinations/index.native.js +0 -152
- package/src/components/image-link-destinations/style.native.scss +0 -16
- package/src/components/index.native.js +0 -108
- package/src/components/inner-blocks/constants.native.js +0 -5
- package/src/components/inner-blocks/index.native.js +0 -221
- package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +0 -124
- package/src/components/inserter/block-types-tab.native.js +0 -76
- package/src/components/inserter/hooks/use-block-type-impressions.native.js +0 -47
- package/src/components/inserter/hooks/use-clipboard-block.native.js +0 -40
- package/src/components/inserter/index.native.js +0 -424
- package/src/components/inserter/menu.native.js +0 -237
- package/src/components/inserter/no-results.native.js +0 -49
- package/src/components/inserter/reusable-blocks-tab.native.js +0 -45
- package/src/components/inserter/search-results.native.js +0 -67
- package/src/components/inserter/style.native.scss +0 -83
- package/src/components/inserter/tabs.native.js +0 -152
- package/src/components/inserter/test/__snapshots__/index.native.js.snap +0 -117
- package/src/components/inserter/test/fixtures/index.native.js +0 -12
- package/src/components/inserter/test/index.native.js +0 -273
- package/src/components/inserter/test/reusable-blocks-tab.native.js +0 -62
- package/src/components/inserter/test/utils.native.js +0 -37
- package/src/components/inserter/utils.native.js +0 -46
- package/src/components/inserter-button/index.native.js +0 -108
- package/src/components/inserter-button/style.native.scss +0 -72
- package/src/components/inspector-controls/fill.native.js +0 -62
- package/src/components/inspector-controls/slot.native.js +0 -35
- package/src/components/inspector-controls-tabs/advanced-controls-panel.native.js +0 -31
- package/src/components/line-height-control/index.native.js +0 -28
- package/src/components/media-placeholder/index.native.js +0 -258
- package/src/components/media-placeholder/styles.native.scss +0 -108
- package/src/components/media-replace-flow/index.native.js +0 -12
- package/src/components/media-upload/constants.native.js +0 -14
- package/src/components/media-upload/index.native.js +0 -356
- package/src/components/media-upload/style.native.scss +0 -4
- package/src/components/media-upload/test/index.native.js +0 -172
- package/src/components/media-upload-progress/README.md +0 -100
- package/src/components/media-upload-progress/constants.js +0 -6
- package/src/components/media-upload-progress/index.native.js +0 -233
- package/src/components/media-upload-progress/styles.native.scss +0 -15
- package/src/components/media-upload-progress/test/index.native.js +0 -220
- package/src/components/plain-text/index.native.js +0 -164
- package/src/components/plain-text/style.native.scss +0 -10
- package/src/components/provider/index.native.js +0 -32
- package/src/components/rich-text/embed-handler-picker.native.js +0 -65
- package/src/components/rich-text/file-paste-handler.native.js +0 -3
- package/src/components/rich-text/format-toolbar/index.native.js +0 -21
- package/src/components/rich-text/format-toolbar-container.native.js +0 -16
- package/src/components/rich-text/index.native.js +0 -701
- package/src/components/rich-text/input-event.native.js +0 -10
- package/src/components/rich-text/native/format-edit.js +0 -44
- package/src/components/rich-text/native/get-format-colors.native.js +0 -47
- package/src/components/rich-text/native/index.js +0 -1
- package/src/components/rich-text/native/index.native.js +0 -1389
- package/src/components/rich-text/native/style.native.scss +0 -28
- package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +0 -79
- package/src/components/rich-text/native/test/index.native.js +0 -345
- package/src/components/rich-text/native/test/performance/rich-text.native.js +0 -44
- package/src/components/rich-text/native/toolbar-button-with-options.native.js +0 -61
- package/src/components/rich-text/native/use-format-types.js +0 -146
- package/src/components/rich-text/remove-browser-shortcuts.native.js +0 -1
- package/src/components/rich-text/shortcut.native.js +0 -10
- package/src/components/ungroup-button/README.md +0 -23
- package/src/components/ungroup-button/index.native.js +0 -77
- package/src/components/unsupported-block-details/index.native.js +0 -187
- package/src/components/unsupported-block-details/style.native.scss +0 -56
- package/src/components/url-input/index.native.js +0 -33
- package/src/components/use-block-drop-zone/index.native.js +0 -207
- package/src/components/use-on-block-drop/index.native.js +0 -115
- package/src/components/use-unsupported-block-editor/index.native.js +0 -59
- package/src/components/video-player/gridicon-play.native.js +0 -13
- package/src/components/video-player/index.native.js +0 -133
- package/src/components/video-player/styles.native.scss +0 -29
- package/src/components/warning/index.native.js +0 -64
- package/src/components/warning/style.native.scss +0 -47
- package/src/hooks/align.native.js +0 -49
- package/src/hooks/custom-class-name.native.js +0 -70
- package/src/hooks/index.native.js +0 -36
- package/src/hooks/layout.native.js +0 -23
- package/src/hooks/test/__snapshots__/align.native.js.snap +0 -73
- package/src/hooks/test/__snapshots__/anchor.native.js.snap +0 -7
- package/src/hooks/test/align.native.js +0 -134
- package/src/hooks/test/anchor.native.js +0 -32
- package/src/hooks/test/use-editor-wrapper-styles.native.js +0 -282
- package/src/hooks/typography.native.js +0 -60
- package/src/hooks/use-editor-wrapper-styles.native.js +0 -250
- package/src/hooks/use-editor-wrapper-styles.native.scss +0 -12
- package/src/index.native.js +0 -6
- package/src/private-apis.native.js +0 -21
- package/src/store/defaults.native.js +0 -23
|
@@ -1,6 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
getBlockType,
|
|
6
|
+
registerBlockType,
|
|
7
|
+
unregisterBlockType,
|
|
8
|
+
} from '@wordpress/blocks';
|
|
9
|
+
|
|
1
10
|
/**
|
|
2
11
|
* Internal dependencies
|
|
3
12
|
*/
|
|
13
|
+
import dimensions from '../dimensions';
|
|
4
14
|
import { getDimensionsClassesAndStyles } from '../use-dimensions-props';
|
|
5
15
|
|
|
6
16
|
describe( 'getDimensionsClassesAndStyles', () => {
|
|
@@ -126,3 +136,64 @@ describe( 'getDimensionsClassesAndStyles', () => {
|
|
|
126
136
|
} );
|
|
127
137
|
} );
|
|
128
138
|
} );
|
|
139
|
+
|
|
140
|
+
describe( 'useBlockProps', () => {
|
|
141
|
+
const blockName = 'test/dimensions-with-aspect-ratio';
|
|
142
|
+
|
|
143
|
+
afterEach( () => {
|
|
144
|
+
if ( getBlockType( blockName ) ) {
|
|
145
|
+
unregisterBlockType( blockName );
|
|
146
|
+
}
|
|
147
|
+
} );
|
|
148
|
+
|
|
149
|
+
const registerDimensionsBlock = () =>
|
|
150
|
+
registerBlockType( blockName, {
|
|
151
|
+
apiVersion: 3,
|
|
152
|
+
title: 'Dimensions with aspect ratio',
|
|
153
|
+
category: 'text',
|
|
154
|
+
supports: {
|
|
155
|
+
dimensions: {
|
|
156
|
+
aspectRatio: true,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
} );
|
|
160
|
+
|
|
161
|
+
it( 'unsets height styles when aspect ratio is explicit', () => {
|
|
162
|
+
registerDimensionsBlock();
|
|
163
|
+
|
|
164
|
+
expect(
|
|
165
|
+
dimensions.useBlockProps( {
|
|
166
|
+
name: blockName,
|
|
167
|
+
style: {
|
|
168
|
+
dimensions: {
|
|
169
|
+
aspectRatio: '16/9',
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
} )
|
|
173
|
+
).toEqual( {
|
|
174
|
+
className: 'has-aspect-ratio',
|
|
175
|
+
style: {
|
|
176
|
+
minHeight: 'unset',
|
|
177
|
+
height: 'unset',
|
|
178
|
+
},
|
|
179
|
+
} );
|
|
180
|
+
} );
|
|
181
|
+
|
|
182
|
+
it( 'does not unset height styles when aspect ratio is the default', () => {
|
|
183
|
+
registerDimensionsBlock();
|
|
184
|
+
|
|
185
|
+
expect(
|
|
186
|
+
dimensions.useBlockProps( {
|
|
187
|
+
name: blockName,
|
|
188
|
+
style: {
|
|
189
|
+
dimensions: {
|
|
190
|
+
aspectRatio: 'auto',
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
} )
|
|
194
|
+
).toEqual( {
|
|
195
|
+
className: '',
|
|
196
|
+
style: {},
|
|
197
|
+
} );
|
|
198
|
+
} );
|
|
199
|
+
} );
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { getChildLayoutStyleRules } from '../layout-child';
|
|
5
|
+
|
|
6
|
+
describe( 'layout child', () => {
|
|
7
|
+
describe( 'getChildLayoutStyleRules()', () => {
|
|
8
|
+
it( 'preserves legacy fixed sizing as shrinkable max width', () => {
|
|
9
|
+
expect(
|
|
10
|
+
getChildLayoutStyleRules( {
|
|
11
|
+
selector: '.wp-container-content-test',
|
|
12
|
+
layout: {
|
|
13
|
+
selfStretch: 'fixed',
|
|
14
|
+
flexSize: '320px',
|
|
15
|
+
},
|
|
16
|
+
} )
|
|
17
|
+
).toEqual( [
|
|
18
|
+
{
|
|
19
|
+
selector: '.wp-container-content-test',
|
|
20
|
+
declarations: {
|
|
21
|
+
'flex-basis': '320px',
|
|
22
|
+
'box-sizing': 'border-box',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
] );
|
|
26
|
+
} );
|
|
27
|
+
|
|
28
|
+
it( 'adds flex-shrink for fixedNoShrink sizing', () => {
|
|
29
|
+
expect(
|
|
30
|
+
getChildLayoutStyleRules( {
|
|
31
|
+
selector: '.wp-container-content-test',
|
|
32
|
+
layout: {
|
|
33
|
+
selfStretch: 'fixedNoShrink',
|
|
34
|
+
flexSize: '320px',
|
|
35
|
+
},
|
|
36
|
+
} )
|
|
37
|
+
).toEqual( [
|
|
38
|
+
{
|
|
39
|
+
selector: '.wp-container-content-test',
|
|
40
|
+
declarations: {
|
|
41
|
+
'flex-basis': '320px',
|
|
42
|
+
'flex-shrink': '0',
|
|
43
|
+
'box-sizing': 'border-box',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
] );
|
|
47
|
+
} );
|
|
48
|
+
|
|
49
|
+
it( 'allows viewport overrides to switch fixedNoShrink to max', () => {
|
|
50
|
+
expect(
|
|
51
|
+
getChildLayoutStyleRules( {
|
|
52
|
+
selector: '.wp-container-content-test',
|
|
53
|
+
layout: {
|
|
54
|
+
selfStretch: 'fixedNoShrink',
|
|
55
|
+
flexSize: '320px',
|
|
56
|
+
},
|
|
57
|
+
viewportOverrides: {
|
|
58
|
+
selfStretch: 'fixed',
|
|
59
|
+
},
|
|
60
|
+
} )
|
|
61
|
+
).toEqual( [
|
|
62
|
+
{
|
|
63
|
+
selector: '.wp-container-content-test',
|
|
64
|
+
declarations: {
|
|
65
|
+
'flex-basis': '320px',
|
|
66
|
+
'flex-shrink': 'unset',
|
|
67
|
+
'box-sizing': 'border-box',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
] );
|
|
71
|
+
} );
|
|
72
|
+
|
|
73
|
+
it( 'allows viewport overrides to switch fixedNoShrink to fit', () => {
|
|
74
|
+
expect(
|
|
75
|
+
getChildLayoutStyleRules( {
|
|
76
|
+
selector: '.wp-container-content-test',
|
|
77
|
+
layout: {
|
|
78
|
+
selfStretch: 'fixedNoShrink',
|
|
79
|
+
flexSize: '320px',
|
|
80
|
+
},
|
|
81
|
+
viewportOverrides: {
|
|
82
|
+
selfStretch: 'fit',
|
|
83
|
+
},
|
|
84
|
+
} )
|
|
85
|
+
).toEqual( [
|
|
86
|
+
{
|
|
87
|
+
selector: '.wp-container-content-test',
|
|
88
|
+
declarations: {
|
|
89
|
+
'flex-basis': 'unset',
|
|
90
|
+
'flex-shrink': 'unset',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
] );
|
|
94
|
+
} );
|
|
95
|
+
|
|
96
|
+
it( 'allows viewport overrides to switch fixed to fit', () => {
|
|
97
|
+
expect(
|
|
98
|
+
getChildLayoutStyleRules( {
|
|
99
|
+
selector: '.wp-container-content-test',
|
|
100
|
+
layout: {
|
|
101
|
+
selfStretch: 'fixed',
|
|
102
|
+
flexSize: '320px',
|
|
103
|
+
},
|
|
104
|
+
viewportOverrides: {
|
|
105
|
+
selfStretch: 'fit',
|
|
106
|
+
},
|
|
107
|
+
} )
|
|
108
|
+
).toEqual( [
|
|
109
|
+
{
|
|
110
|
+
selector: '.wp-container-content-test',
|
|
111
|
+
declarations: {
|
|
112
|
+
'flex-basis': 'unset',
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
] );
|
|
116
|
+
} );
|
|
117
|
+
|
|
118
|
+
it( 'allows viewport overrides to switch fixedNoShrink to grow', () => {
|
|
119
|
+
expect(
|
|
120
|
+
getChildLayoutStyleRules( {
|
|
121
|
+
selector: '.wp-container-content-test',
|
|
122
|
+
layout: {
|
|
123
|
+
selfStretch: 'fixedNoShrink',
|
|
124
|
+
flexSize: '320px',
|
|
125
|
+
},
|
|
126
|
+
viewportOverrides: {
|
|
127
|
+
selfStretch: 'fill',
|
|
128
|
+
},
|
|
129
|
+
} )
|
|
130
|
+
).toEqual( [
|
|
131
|
+
{
|
|
132
|
+
selector: '.wp-container-content-test',
|
|
133
|
+
declarations: {
|
|
134
|
+
'flex-basis': 'unset',
|
|
135
|
+
'flex-shrink': 'unset',
|
|
136
|
+
'flex-grow': '1',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
] );
|
|
140
|
+
} );
|
|
141
|
+
|
|
142
|
+
it( 'allows viewport overrides to switch fixed to grow', () => {
|
|
143
|
+
expect(
|
|
144
|
+
getChildLayoutStyleRules( {
|
|
145
|
+
selector: '.wp-container-content-test',
|
|
146
|
+
layout: {
|
|
147
|
+
selfStretch: 'fixed',
|
|
148
|
+
flexSize: '320px',
|
|
149
|
+
},
|
|
150
|
+
viewportOverrides: {
|
|
151
|
+
selfStretch: 'fill',
|
|
152
|
+
},
|
|
153
|
+
} )
|
|
154
|
+
).toEqual( [
|
|
155
|
+
{
|
|
156
|
+
selector: '.wp-container-content-test',
|
|
157
|
+
declarations: {
|
|
158
|
+
'flex-basis': 'unset',
|
|
159
|
+
'flex-grow': '1',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
] );
|
|
163
|
+
} );
|
|
164
|
+
} );
|
|
165
|
+
} );
|
package/src/hooks/test/style.js
CHANGED
|
@@ -208,6 +208,98 @@ describe( 'getStateStylesCSS', () => {
|
|
|
208
208
|
'.wp-block-test:hover { border-top-color: #0000ff !important; }\n.wp-block-test:hover { border-top-style: solid; }'
|
|
209
209
|
);
|
|
210
210
|
} );
|
|
211
|
+
|
|
212
|
+
it( 'adds background-image reset when state sets solid background-color', () => {
|
|
213
|
+
expect(
|
|
214
|
+
getStateStylesCSS(
|
|
215
|
+
{
|
|
216
|
+
color: {
|
|
217
|
+
background: '#ff0000',
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
'.wp-block-test:hover'
|
|
221
|
+
)
|
|
222
|
+
).toBe(
|
|
223
|
+
'.wp-block-test:hover { background-color: #ff0000 !important; }\n.wp-block-test:hover { background-image: unset !important; }'
|
|
224
|
+
);
|
|
225
|
+
} );
|
|
226
|
+
|
|
227
|
+
it( 'does not add background-image reset when state also sets a legacy gradient', () => {
|
|
228
|
+
expect(
|
|
229
|
+
getStateStylesCSS(
|
|
230
|
+
{
|
|
231
|
+
color: {
|
|
232
|
+
background: '#ff0000',
|
|
233
|
+
gradient: 'linear-gradient(135deg, #ff0000, #0000ff)',
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
'.wp-block-test:hover'
|
|
237
|
+
)
|
|
238
|
+
).toBe(
|
|
239
|
+
'.wp-block-test:hover { background: linear-gradient(135deg, #ff0000, #0000ff) !important; background-color: #ff0000 !important; }'
|
|
240
|
+
);
|
|
241
|
+
} );
|
|
242
|
+
|
|
243
|
+
it( 'does not add background-image reset when state also sets a modern gradient', () => {
|
|
244
|
+
expect(
|
|
245
|
+
getStateStylesCSS(
|
|
246
|
+
{
|
|
247
|
+
color: {
|
|
248
|
+
background: '#ff0000',
|
|
249
|
+
},
|
|
250
|
+
background: {
|
|
251
|
+
gradient: 'linear-gradient(135deg, #ff0000, #0000ff)',
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
'.wp-block-test:hover'
|
|
255
|
+
)
|
|
256
|
+
).toBe(
|
|
257
|
+
'.wp-block-test:hover { background-color: #ff0000 !important; background-image: linear-gradient(135deg, #ff0000, #0000ff) !important; }'
|
|
258
|
+
);
|
|
259
|
+
} );
|
|
260
|
+
|
|
261
|
+
it( 'adds important fallback dimensions when aspect ratio is set', () => {
|
|
262
|
+
expect(
|
|
263
|
+
getStateStylesCSS(
|
|
264
|
+
{
|
|
265
|
+
dimensions: {
|
|
266
|
+
aspectRatio: '16/9',
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
'.wp-block-test'
|
|
270
|
+
)
|
|
271
|
+
).toBe(
|
|
272
|
+
'.wp-block-test { height: unset !important; min-height: unset !important; aspect-ratio: 16/9 !important; }'
|
|
273
|
+
);
|
|
274
|
+
} );
|
|
275
|
+
|
|
276
|
+
it( 'does not add fallback dimensions when aspect ratio is the default', () => {
|
|
277
|
+
expect(
|
|
278
|
+
getStateStylesCSS(
|
|
279
|
+
{
|
|
280
|
+
dimensions: {
|
|
281
|
+
aspectRatio: 'auto',
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
'.wp-block-test'
|
|
285
|
+
)
|
|
286
|
+
).toBe( '.wp-block-test { aspect-ratio: auto !important; }' );
|
|
287
|
+
} );
|
|
288
|
+
|
|
289
|
+
it( 'adds important fallback aspect ratio when height is set', () => {
|
|
290
|
+
expect(
|
|
291
|
+
getStateStylesCSS(
|
|
292
|
+
{
|
|
293
|
+
dimensions: {
|
|
294
|
+
height: '20rem',
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
'.wp-block-test'
|
|
298
|
+
)
|
|
299
|
+
).toBe(
|
|
300
|
+
'.wp-block-test { height: 20rem !important; aspect-ratio: unset !important; }'
|
|
301
|
+
);
|
|
302
|
+
} );
|
|
211
303
|
} );
|
|
212
304
|
|
|
213
305
|
describe( 'getBlockStateStylesCSS', () => {
|
|
@@ -247,7 +339,7 @@ describe( 'getBlockStateStylesCSS', () => {
|
|
|
247
339
|
}
|
|
248
340
|
)
|
|
249
341
|
).toBe(
|
|
250
|
-
'.wp-elements-abc123 .wp-block-button__link:hover { background-color: #ff00d0 !important; }\n.wp-elements-abc123:hover { width: 50% !important; }'
|
|
342
|
+
'.wp-elements-abc123 .wp-block-button__link:hover { background-color: #ff00d0 !important; }\n.wp-elements-abc123 .wp-block-button__link:hover { background-image: unset !important; }\n.wp-elements-abc123:hover { width: 50% !important; }'
|
|
251
343
|
);
|
|
252
344
|
} );
|
|
253
345
|
|
|
@@ -264,7 +356,7 @@ describe( 'getBlockStateStylesCSS', () => {
|
|
|
264
356
|
}
|
|
265
357
|
)
|
|
266
358
|
).toBe(
|
|
267
|
-
'[data-block="client-id"] .wp-block-button__link { background-color: #ff00d0 !important; }\n[data-block="client-id"] { width: 50% !important; }'
|
|
359
|
+
'[data-block="client-id"] .wp-block-button__link { background-color: #ff00d0 !important; }\n[data-block="client-id"] .wp-block-button__link { background-image: unset !important; }\n[data-block="client-id"] { width: 50% !important; }'
|
|
268
360
|
);
|
|
269
361
|
} );
|
|
270
362
|
} );
|
|
@@ -286,10 +378,24 @@ describe( 'getResponsiveStateCSSRules', () => {
|
|
|
286
378
|
},
|
|
287
379
|
},
|
|
288
380
|
} );
|
|
381
|
+
|
|
382
|
+
registerBlockType( 'test/state-image', {
|
|
383
|
+
apiVersion: 3,
|
|
384
|
+
title: 'State Image',
|
|
385
|
+
category: 'media',
|
|
386
|
+
attributes: {},
|
|
387
|
+
edit: () => null,
|
|
388
|
+
save: () => null,
|
|
389
|
+
selectors: {
|
|
390
|
+
root: '.wp-block-test-state-image',
|
|
391
|
+
dimensions: '.wp-block-test-state-image img',
|
|
392
|
+
},
|
|
393
|
+
} );
|
|
289
394
|
} );
|
|
290
395
|
|
|
291
396
|
afterEach( () => {
|
|
292
397
|
unregisterBlockType( 'test/state-button' );
|
|
398
|
+
unregisterBlockType( 'test/state-image' );
|
|
293
399
|
} );
|
|
294
400
|
|
|
295
401
|
it( 'generates media-query scoped root styles for viewport states', () => {
|
|
@@ -321,7 +427,23 @@ describe( 'getResponsiveStateCSSRules', () => {
|
|
|
321
427
|
'.wp-elements-1'
|
|
322
428
|
)
|
|
323
429
|
).toEqual( [
|
|
324
|
-
'@media (width <= 480px){.wp-elements-1 .wp-block-button__link { background-color: #ff00d0 !important; }\n.wp-elements-1 { width: 50% !important; }}',
|
|
430
|
+
'@media (width <= 480px){.wp-elements-1 .wp-block-button__link { background-color: #ff00d0 !important; }\n.wp-elements-1 .wp-block-button__link { background-image: unset !important; }\n.wp-elements-1 { width: 50% !important; }}',
|
|
431
|
+
] );
|
|
432
|
+
} );
|
|
433
|
+
|
|
434
|
+
it( 'outputs explicit fill object fit for viewport states', () => {
|
|
435
|
+
expect(
|
|
436
|
+
getResponsiveStateCSSRules(
|
|
437
|
+
{
|
|
438
|
+
mobile: {
|
|
439
|
+
dimensions: { objectFit: 'fill' },
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
'test/state-image',
|
|
443
|
+
'.wp-elements-1'
|
|
444
|
+
)
|
|
445
|
+
).toEqual( [
|
|
446
|
+
'@media (width <= 480px){.wp-elements-1 img { object-fit: fill !important; }}',
|
|
325
447
|
] );
|
|
326
448
|
} );
|
|
327
449
|
|
|
@@ -339,7 +461,7 @@ describe( 'getResponsiveStateCSSRules', () => {
|
|
|
339
461
|
'.wp-elements-1'
|
|
340
462
|
)
|
|
341
463
|
).toEqual( [
|
|
342
|
-
'@media (width <= 480px){.wp-elements-1:hover { background-color: black !important; }}',
|
|
464
|
+
'@media (width <= 480px){.wp-elements-1:hover { background-color: black !important; }\n.wp-elements-1:hover { background-image: unset !important; }}',
|
|
343
465
|
] );
|
|
344
466
|
} );
|
|
345
467
|
|
package/src/private-apis.js
CHANGED
|
@@ -16,6 +16,11 @@ import { PrivateListView } from './components/list-view';
|
|
|
16
16
|
import InspectorControlsLastItem from './components/inspector-controls/last-item';
|
|
17
17
|
import { useHasBlockToolbar } from './components/block-toolbar/use-has-block-toolbar';
|
|
18
18
|
import { cleanEmptyObject, usePrivateStyleOverride } from './hooks/utils';
|
|
19
|
+
import {
|
|
20
|
+
getStyleForState,
|
|
21
|
+
isDefaultBlockStyleState,
|
|
22
|
+
setStyleForState,
|
|
23
|
+
} from './hooks/block-style-state';
|
|
19
24
|
import BlockQuickNavigation from './components/block-quick-navigation';
|
|
20
25
|
import { LayoutStyle } from './components/block-list/layout';
|
|
21
26
|
import BlockManager from './components/block-manager';
|
|
@@ -98,6 +103,9 @@ lock( privateApis, {
|
|
|
98
103
|
InspectorControlsLastItem,
|
|
99
104
|
useHasBlockToolbar,
|
|
100
105
|
cleanEmptyObject,
|
|
106
|
+
getStyleForState,
|
|
107
|
+
isDefaultBlockStyleState,
|
|
108
|
+
setStyleForState,
|
|
101
109
|
usePrivateStyleOverride,
|
|
102
110
|
BlockQuickNavigation,
|
|
103
111
|
LayoutStyle,
|
package/src/store/actions.js
CHANGED
|
@@ -822,6 +822,8 @@ export const __unstableDeleteSelection =
|
|
|
822
822
|
...targetBlock.attributes,
|
|
823
823
|
...updatedAttributes,
|
|
824
824
|
},
|
|
825
|
+
// Block A's inner blocks sit inside the selection; only B's survive.
|
|
826
|
+
innerBlocks: blockB.innerBlocks,
|
|
825
827
|
},
|
|
826
828
|
...( isForward ? [] : blocksWithTheSameType ),
|
|
827
829
|
];
|
|
@@ -1646,12 +1648,20 @@ export function __unstableMarkLastChangeAsPersistent() {
|
|
|
1646
1648
|
}
|
|
1647
1649
|
|
|
1648
1650
|
/**
|
|
1649
|
-
* Action that signals that the next block change should be marked explicitly
|
|
1651
|
+
* Action that signals that the next block change should be marked explicitly
|
|
1652
|
+
* as not persistent.
|
|
1650
1653
|
*
|
|
1654
|
+
* By default, non-persistent changes may still merge into undo history. Use
|
|
1655
|
+
* `history: 'ignore'` for derived changes that should never be captured by undo.
|
|
1656
|
+
*
|
|
1657
|
+
* @param {Object} options Options object.
|
|
1658
|
+
* @param {string} options.history How the change should interact with history.
|
|
1651
1659
|
* @return {Object} Action object.
|
|
1652
1660
|
*/
|
|
1653
|
-
export function __unstableMarkNextChangeAsNotPersistent(
|
|
1654
|
-
|
|
1661
|
+
export function __unstableMarkNextChangeAsNotPersistent( {
|
|
1662
|
+
history = 'merge',
|
|
1663
|
+
} = {} ) {
|
|
1664
|
+
return { type: 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT', history };
|
|
1655
1665
|
}
|
|
1656
1666
|
|
|
1657
1667
|
/**
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { Platform } from '@wordpress/element';
|
|
5
4
|
import deprecated from '@wordpress/deprecated';
|
|
6
5
|
import { speak } from '@wordpress/a11y';
|
|
7
6
|
import { __ } from '@wordpress/i18n';
|
|
@@ -56,9 +55,7 @@ export function __experimentalUpdateSettings(
|
|
|
56
55
|
|
|
57
56
|
let cleanSettings = incomingSettings;
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
// need to strip the experimental settings:
|
|
61
|
-
if ( stripExperimentalSettings && Platform.OS === 'web' ) {
|
|
58
|
+
if ( stripExperimentalSettings ) {
|
|
62
59
|
cleanSettings = {};
|
|
63
60
|
for ( const key in incomingSettings ) {
|
|
64
61
|
if ( ! privateSettings.includes( key ) ) {
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
getBlockOrder,
|
|
15
15
|
getBlockParents,
|
|
16
16
|
getBlockEditingMode,
|
|
17
|
+
getBlockListSettings,
|
|
17
18
|
getSettings,
|
|
18
19
|
canInsertBlockType,
|
|
19
20
|
getBlockName,
|
|
@@ -116,6 +117,48 @@ export function isContainerInsertableToInContentOnlyMode(
|
|
|
116
117
|
);
|
|
117
118
|
}
|
|
118
119
|
|
|
120
|
+
function getClientIdWithClientIdsTreeUnmemoized( state, clientId ) {
|
|
121
|
+
return {
|
|
122
|
+
clientId,
|
|
123
|
+
innerBlocks: getClientIdsTreeUnmemoized( state, clientId ),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function getClientIdsTreeUnmemoized( state, rootClientId = '' ) {
|
|
128
|
+
return getBlockOrder( state, rootClientId ).map( ( clientId ) =>
|
|
129
|
+
getClientIdWithClientIdsTreeUnmemoized( state, clientId )
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Returns a stripped down block object containing only its client ID,
|
|
135
|
+
* and its inner blocks' client IDs.
|
|
136
|
+
*
|
|
137
|
+
* @param {Object} state Editor state.
|
|
138
|
+
* @param {string} clientId Client ID of the block to get.
|
|
139
|
+
*
|
|
140
|
+
* @return {Object} Client IDs of the post blocks.
|
|
141
|
+
*/
|
|
142
|
+
export const getClientIdWithClientIdsTree = createSelector(
|
|
143
|
+
getClientIdWithClientIdsTreeUnmemoized,
|
|
144
|
+
( state ) => [ state.blocks.order ]
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Returns the block tree represented in the block-editor store from the
|
|
149
|
+
* given root, consisting of stripped down block objects containing only
|
|
150
|
+
* their client IDs, and their inner blocks' client IDs.
|
|
151
|
+
*
|
|
152
|
+
* @param {Object} state Editor state.
|
|
153
|
+
* @param {?string} rootClientId Optional root client ID of block list.
|
|
154
|
+
*
|
|
155
|
+
* @return {Object[]} Client IDs of the post blocks.
|
|
156
|
+
*/
|
|
157
|
+
export const getClientIdsTree = createSelector(
|
|
158
|
+
getClientIdsTreeUnmemoized,
|
|
159
|
+
( state ) => [ state.blocks.order ]
|
|
160
|
+
);
|
|
161
|
+
|
|
119
162
|
function getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {
|
|
120
163
|
const blockOrder = getBlockOrder( state, rootClientId );
|
|
121
164
|
const result = [];
|
|
@@ -1035,6 +1078,52 @@ export function getListViewExpandRevision( state ) {
|
|
|
1035
1078
|
return state.listViewExpandRevision || 0;
|
|
1036
1079
|
}
|
|
1037
1080
|
|
|
1081
|
+
/**
|
|
1082
|
+
* Returns whether a block instance participates in List View-specific UI for
|
|
1083
|
+
* its inner blocks.
|
|
1084
|
+
*
|
|
1085
|
+
* Intentionally private: this is the derived participation logic (block type
|
|
1086
|
+
* `listView` support and the `core/navigation` special case) shared by the List
|
|
1087
|
+
* View consumers. A `listView`-supporting block drops out when it has no inner
|
|
1088
|
+
* blocks and its `allowedBlocks` (`[]` or `false`) permits no block: the nested
|
|
1089
|
+
* List View panel would render no rows and no appender, so it is hidden rather
|
|
1090
|
+
* than shown empty. This is a signal, not a guarantee — a child naming this
|
|
1091
|
+
* block as its `parent` stays insertable regardless (see `canInsertBlockType`);
|
|
1092
|
+
* that edge case is accepted to keep the check cheap. Keeping the read internal
|
|
1093
|
+
* lets this computation evolve without a back-compat commitment.
|
|
1094
|
+
*
|
|
1095
|
+
* @param {Object} state Global application state.
|
|
1096
|
+
* @param {string} clientId Client ID of the block.
|
|
1097
|
+
*
|
|
1098
|
+
* @return {boolean} Whether the block participates in List View-specific UI.
|
|
1099
|
+
*/
|
|
1100
|
+
export function shouldRenderBlockListView( state, clientId ) {
|
|
1101
|
+
const blockName = getBlockName( state, clientId );
|
|
1102
|
+
|
|
1103
|
+
// The navigation block always participates; its List View is core to how it
|
|
1104
|
+
// is edited, regardless of how its menu is locked or populated.
|
|
1105
|
+
if ( blockName === 'core/navigation' ) {
|
|
1106
|
+
return true;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
if ( ! hasBlockSupport( blockName, 'listView' ) ) {
|
|
1110
|
+
return false;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
// `allowedBlocks` permits no block when it is `[]` or `false`; an unset value
|
|
1114
|
+
// is unrestricted and is intentionally not matched.
|
|
1115
|
+
const allowedBlocks = getBlockListSettings(
|
|
1116
|
+
state,
|
|
1117
|
+
clientId
|
|
1118
|
+
)?.allowedBlocks;
|
|
1119
|
+
const isEmptyAndNoAllowedBlocks =
|
|
1120
|
+
getBlockOrder( state, clientId ).length === 0 &&
|
|
1121
|
+
( allowedBlocks === false ||
|
|
1122
|
+
( Array.isArray( allowedBlocks ) && allowedBlocks.length === 0 ) );
|
|
1123
|
+
|
|
1124
|
+
return ! isEmptyAndNoAllowedBlocks;
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1038
1127
|
/**
|
|
1039
1128
|
* Returns the client IDs for the viewport modal, or null if
|
|
1040
1129
|
* the modal is not open.
|
package/src/store/reducer.js
CHANGED
|
@@ -419,18 +419,20 @@ const withBlockTree =
|
|
|
419
419
|
*/
|
|
420
420
|
function withPersistentBlockChange( reducer ) {
|
|
421
421
|
let lastAction;
|
|
422
|
-
let
|
|
422
|
+
let nextHistoryMode;
|
|
423
423
|
|
|
424
424
|
return ( state, action ) => {
|
|
425
425
|
const nextState = reducer( state, action );
|
|
426
426
|
|
|
427
|
-
const
|
|
428
|
-
|
|
429
|
-
action.type === 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT'
|
|
427
|
+
const pendingHistoryMode = nextHistoryMode;
|
|
428
|
+
nextHistoryMode =
|
|
429
|
+
action.type === 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT'
|
|
430
|
+
? action.history ?? 'merge'
|
|
431
|
+
: undefined;
|
|
430
432
|
|
|
431
433
|
const isExplicitPersistentChange =
|
|
432
434
|
action.type === 'MARK_LAST_CHANGE_AS_PERSISTENT' ||
|
|
433
|
-
|
|
435
|
+
pendingHistoryMode;
|
|
434
436
|
|
|
435
437
|
// Defer to previous state value (or default) unless changing or
|
|
436
438
|
// explicitly marking as persistent.
|
|
@@ -442,7 +444,7 @@ function withPersistentBlockChange( reducer ) {
|
|
|
442
444
|
}
|
|
443
445
|
|
|
444
446
|
const isPersistentChange = isExplicitPersistentChange
|
|
445
|
-
? !
|
|
447
|
+
? ! pendingHistoryMode
|
|
446
448
|
: ! isUpdatingSameBlockAttribute( action, lastAction );
|
|
447
449
|
|
|
448
450
|
// In comparing against the previous action, consider only those which
|
|
@@ -450,7 +452,17 @@ function withPersistentBlockChange( reducer ) {
|
|
|
450
452
|
// have resulted in a changed state.
|
|
451
453
|
lastAction = action;
|
|
452
454
|
|
|
453
|
-
|
|
455
|
+
if ( pendingHistoryMode === 'ignore' ) {
|
|
456
|
+
return {
|
|
457
|
+
...nextState,
|
|
458
|
+
isPersistentChange,
|
|
459
|
+
lastBlockChangeHistoryMode: 'ignore',
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
const { lastBlockChangeHistoryMode, ...blockChange } = nextState;
|
|
464
|
+
|
|
465
|
+
return { ...blockChange, isPersistentChange };
|
|
454
466
|
};
|
|
455
467
|
}
|
|
456
468
|
|