@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
|
@@ -51,36 +51,6 @@ inputEventContext.displayName = 'inputEventContext';
|
|
|
51
51
|
|
|
52
52
|
const instanceIdKey = Symbol( 'instanceId' );
|
|
53
53
|
|
|
54
|
-
/**
|
|
55
|
-
* Removes props used for the native version of RichText so that they are not
|
|
56
|
-
* passed to the DOM element and log warnings.
|
|
57
|
-
*
|
|
58
|
-
* @param {Object} props Props to filter.
|
|
59
|
-
*
|
|
60
|
-
* @return {Object} Filtered props.
|
|
61
|
-
*/
|
|
62
|
-
function removeNativeProps( props ) {
|
|
63
|
-
const {
|
|
64
|
-
__unstableMobileNoFocusOnMount,
|
|
65
|
-
deleteEnter,
|
|
66
|
-
placeholderTextColor,
|
|
67
|
-
textAlign,
|
|
68
|
-
selectionColor,
|
|
69
|
-
tagsToEliminate,
|
|
70
|
-
disableEditingMenu,
|
|
71
|
-
fontSize,
|
|
72
|
-
fontFamily,
|
|
73
|
-
fontWeight,
|
|
74
|
-
fontStyle,
|
|
75
|
-
minWidth,
|
|
76
|
-
maxWidth,
|
|
77
|
-
disableSuggestions,
|
|
78
|
-
disableAutocorrection,
|
|
79
|
-
...restProps
|
|
80
|
-
} = props;
|
|
81
|
-
return restProps;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
54
|
export function RichTextWrapper(
|
|
85
55
|
{
|
|
86
56
|
children,
|
|
@@ -113,8 +83,6 @@ export function RichTextWrapper(
|
|
|
113
83
|
},
|
|
114
84
|
forwardedRef
|
|
115
85
|
) {
|
|
116
|
-
props = removeNativeProps( props );
|
|
117
|
-
|
|
118
86
|
if ( onSplit ) {
|
|
119
87
|
deprecated( 'wp.blockEditor.RichText onSplit prop', {
|
|
120
88
|
since: '6.4',
|
|
@@ -532,7 +500,7 @@ const PublicForwardedRichTextContainer = forwardRef( ( props, ref ) => {
|
|
|
532
500
|
__unstableAllowPrefixTransformations,
|
|
533
501
|
readOnly,
|
|
534
502
|
...contentProps
|
|
535
|
-
} =
|
|
503
|
+
} = props;
|
|
536
504
|
return (
|
|
537
505
|
<Tag
|
|
538
506
|
ref={ ref }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# UnitControl
|
|
2
2
|
|
|
3
|
-
UnitControl component allows the user to set a value as well as a unit (e.g. `px`). The allowed units are derived from the (experimental) `theme.json` settings file
|
|
3
|
+
UnitControl component allows the user to set a value as well as a unit (e.g. `px`). The allowed units are derived from the (experimental) `theme.json` settings file.
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
6
|
// theme.json
|
|
@@ -123,7 +123,7 @@ drawer.
|
|
|
123
123
|
## Useful UI pieces
|
|
124
124
|
|
|
125
125
|
The URLPopover exposes two components that may be used as child components to make the UI creation process easier.
|
|
126
|
-
Although in the editor these components are used inside URLPopover and they were built with URLPopover use cases in mind, it
|
|
126
|
+
Although in the editor these components are used inside URLPopover and they were built with URLPopover use cases in mind, it may be possible and perfectly fine to use them standalone if they fit a use-case.
|
|
127
127
|
|
|
128
128
|
### LinkViewer
|
|
129
129
|
|
|
@@ -93,8 +93,8 @@ const getTransformCommands = () =>
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
// Simple block transformation based on the `Block Transforms` API.
|
|
96
|
-
function onBlockTransform( name ) {
|
|
97
|
-
const newBlocks = switchToBlockType( blocks, name );
|
|
96
|
+
function onBlockTransform( name, variationName ) {
|
|
97
|
+
const newBlocks = switchToBlockType( blocks, name, variationName );
|
|
98
98
|
replaceBlocks( clientIds, newBlocks );
|
|
99
99
|
selectForMultipleBlocks( newBlocks );
|
|
100
100
|
}
|
|
@@ -117,7 +117,7 @@ const getTransformCommands = () =>
|
|
|
117
117
|
|
|
118
118
|
const commands = possibleBlockTransformations.map(
|
|
119
119
|
( transformation ) => {
|
|
120
|
-
const { name, title, icon } = transformation;
|
|
120
|
+
const { id, name, title, icon, variationName } = transformation;
|
|
121
121
|
/*
|
|
122
122
|
* Command menu uses Icon from @wordpress/icons, which expects a ReactElement
|
|
123
123
|
* (cloneElement). Normalize to blockDefaultIcon to avoid crash. See #55668 / PR #55676.
|
|
@@ -132,13 +132,13 @@ const getTransformCommands = () =>
|
|
|
132
132
|
return {
|
|
133
133
|
name:
|
|
134
134
|
'core/block-editor/transform-to-' +
|
|
135
|
-
name.replace(
|
|
135
|
+
( id || name ).replace( /\//g, '-' ),
|
|
136
136
|
/* translators: %s: Block or block variation name. */
|
|
137
137
|
label: sprintf( __( 'Transform to %s' ), title ),
|
|
138
138
|
icon: blockIcon?.src,
|
|
139
139
|
category: 'command',
|
|
140
140
|
callback: ( { close } ) => {
|
|
141
|
-
onBlockTransform( name );
|
|
141
|
+
onBlockTransform( name, variationName );
|
|
142
142
|
close();
|
|
143
143
|
},
|
|
144
144
|
};
|
package/src/hooks/anchor.js
CHANGED
|
@@ -5,7 +5,6 @@ import { addFilter } from '@wordpress/hooks';
|
|
|
5
5
|
import { TextControl, ExternalLink } from '@wordpress/components';
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
import { hasBlockSupport } from '@wordpress/blocks';
|
|
8
|
-
import { Platform } from '@wordpress/element';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Internal dependencies
|
|
@@ -53,8 +52,6 @@ function BlockEditAnchorControlPure( { anchor, setAttributes } ) {
|
|
|
53
52
|
return null;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
const isWeb = Platform.OS === 'web';
|
|
57
|
-
|
|
58
55
|
return (
|
|
59
56
|
<InspectorControls group="advanced">
|
|
60
57
|
<TextControl
|
|
@@ -65,23 +62,18 @@ function BlockEditAnchorControlPure( { anchor, setAttributes } ) {
|
|
|
65
62
|
<>
|
|
66
63
|
{ __(
|
|
67
64
|
'Enter a word or two—without spaces—to make a unique web address just for this block, called an “anchor”. Then, you’ll be able to link directly to this section of your page.'
|
|
68
|
-
) }
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
>
|
|
77
|
-
{ __( 'Learn more about anchors' ) }
|
|
78
|
-
</ExternalLink>
|
|
79
|
-
</>
|
|
80
|
-
) }
|
|
65
|
+
) }{ ' ' }
|
|
66
|
+
<ExternalLink
|
|
67
|
+
href={ __(
|
|
68
|
+
'https://wordpress.org/documentation/article/page-jumps/'
|
|
69
|
+
) }
|
|
70
|
+
>
|
|
71
|
+
{ __( 'Learn more about anchors' ) }
|
|
72
|
+
</ExternalLink>
|
|
81
73
|
</>
|
|
82
74
|
}
|
|
83
75
|
value={ anchor || '' }
|
|
84
|
-
placeholder={
|
|
76
|
+
placeholder={ null }
|
|
85
77
|
onChange={ ( nextValue ) => {
|
|
86
78
|
nextValue = nextValue.replace( ANCHOR_REGEX, '-' );
|
|
87
79
|
setAttributes( {
|
|
@@ -14,6 +14,7 @@ import { useContext, useState, useMemo } from '@wordpress/element';
|
|
|
14
14
|
import { __ } from '@wordpress/i18n';
|
|
15
15
|
import { store as blockEditorStore } from '../../store';
|
|
16
16
|
import { unlock } from '../../lock-unlock';
|
|
17
|
+
import { replacePatternOverridesDefaultBinding } from '../../utils/block-bindings';
|
|
17
18
|
import BlockContext from '../../components/block-context';
|
|
18
19
|
import BlockIcon from '../../components/block-icon';
|
|
19
20
|
import useBlockDisplayTitle from '../../components/block-title/use-block-display-title';
|
|
@@ -80,15 +81,39 @@ function BlockFields( {
|
|
|
80
81
|
return _attributes;
|
|
81
82
|
}
|
|
82
83
|
|
|
84
|
+
/*
|
|
85
|
+
* The pattern overrides `__default` binding is a placeholder, not
|
|
86
|
+
* a real attribute: expand it to the block's bindable attributes
|
|
87
|
+
* before resolving values, as other bindings consumers do.
|
|
88
|
+
*/
|
|
89
|
+
const { __experimentalBlockBindingsSupportedAttributes } =
|
|
90
|
+
select( blockEditorStore ).getSettings();
|
|
91
|
+
const bindableAttributes =
|
|
92
|
+
__experimentalBlockBindingsSupportedAttributes?.[
|
|
93
|
+
blockType?.name
|
|
94
|
+
];
|
|
95
|
+
const bindings = bindableAttributes
|
|
96
|
+
? replacePatternOverridesDefaultBinding(
|
|
97
|
+
_attributes.metadata.bindings,
|
|
98
|
+
bindableAttributes
|
|
99
|
+
)
|
|
100
|
+
: _attributes.metadata.bindings;
|
|
101
|
+
|
|
83
102
|
const { getBlockBindingsSource } = unlock( select( blocksStore ) );
|
|
84
|
-
return Object.entries(
|
|
103
|
+
return Object.entries( bindings ).reduce(
|
|
85
104
|
( acc, [ attribute, binding ] ) => {
|
|
105
|
+
// Skip a `__default` binding that could not be expanded:
|
|
106
|
+
// it is not a real block attribute.
|
|
107
|
+
if ( attribute === '__default' ) {
|
|
108
|
+
return acc;
|
|
109
|
+
}
|
|
86
110
|
const source = getBlockBindingsSource( binding.source );
|
|
87
111
|
if ( ! source ) {
|
|
88
112
|
return acc;
|
|
89
113
|
}
|
|
90
114
|
const values = source.getValues( {
|
|
91
115
|
select,
|
|
116
|
+
clientId,
|
|
92
117
|
context: blockContext,
|
|
93
118
|
bindings: { [ attribute ]: binding },
|
|
94
119
|
} );
|
|
@@ -97,7 +122,7 @@ function BlockFields( {
|
|
|
97
122
|
_attributes
|
|
98
123
|
);
|
|
99
124
|
},
|
|
100
|
-
[ blockContext, clientId ]
|
|
125
|
+
[ blockContext, clientId, blockType?.name ]
|
|
101
126
|
);
|
|
102
127
|
const { selectBlock, toggleBlockHighlight } =
|
|
103
128
|
useDispatch( blockEditorStore );
|
package/src/hooks/border.js
CHANGED
|
@@ -8,7 +8,7 @@ import clsx from 'clsx';
|
|
|
8
8
|
*/
|
|
9
9
|
import { hasBlockSupport, getBlockSupport } from '@wordpress/blocks';
|
|
10
10
|
import { __experimentalHasSplitBorders as hasSplitBorders } from '@wordpress/components';
|
|
11
|
-
import {
|
|
11
|
+
import { useCallback, useMemo } from '@wordpress/element';
|
|
12
12
|
import { addFilter } from '@wordpress/hooks';
|
|
13
13
|
import { useSelect } from '@wordpress/data';
|
|
14
14
|
import { __ } from '@wordpress/i18n';
|
|
@@ -217,10 +217,6 @@ export function BorderPanel( { clientId, name, setAttributes, settings } ) {
|
|
|
217
217
|
* @return {boolean} Whether there is support.
|
|
218
218
|
*/
|
|
219
219
|
export function hasBorderSupport( blockName, feature = 'any' ) {
|
|
220
|
-
if ( Platform.OS !== 'web' ) {
|
|
221
|
-
return false;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
220
|
const support = getBlockSupport( blockName, BORDER_SUPPORT_KEY );
|
|
225
221
|
|
|
226
222
|
if ( support === true ) {
|
package/src/hooks/color.js
CHANGED
|
@@ -8,7 +8,7 @@ import clsx from 'clsx';
|
|
|
8
8
|
*/
|
|
9
9
|
import { addFilter } from '@wordpress/hooks';
|
|
10
10
|
import { getBlockSupport } from '@wordpress/blocks';
|
|
11
|
-
import { useMemo,
|
|
11
|
+
import { useMemo, useCallback } from '@wordpress/element';
|
|
12
12
|
import { useSelect } from '@wordpress/data';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -55,10 +55,6 @@ const hasColorSupport = ( blockNameOrType ) => {
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
const hasLinkColorSupport = ( blockType ) => {
|
|
58
|
-
if ( Platform.OS !== 'web' ) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
58
|
const colorSupport = getBlockSupport( blockType, COLOR_SUPPORT_KEY );
|
|
63
59
|
|
|
64
60
|
return (
|
|
@@ -342,7 +338,6 @@ export function ColorEdit( {
|
|
|
342
338
|
|
|
343
339
|
const enableContrastChecking =
|
|
344
340
|
! isStateSelected &&
|
|
345
|
-
Platform.OS === 'web' &&
|
|
346
341
|
! value?.color?.gradient &&
|
|
347
342
|
( settings?.color?.text || settings?.color?.link ) &&
|
|
348
343
|
// Contrast checking is enabled by default.
|
package/src/hooks/dimensions.js
CHANGED
|
@@ -6,7 +6,7 @@ import clsx from 'clsx';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { useState, useEffect, useCallback } from '@wordpress/element';
|
|
10
10
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
11
11
|
import { getBlockSupport } from '@wordpress/blocks';
|
|
12
12
|
import deprecated from '@wordpress/deprecated';
|
|
@@ -171,10 +171,6 @@ export function DimensionsPanel( { clientId, name, setAttributes, settings } ) {
|
|
|
171
171
|
* @return {boolean} Whether there is support.
|
|
172
172
|
*/
|
|
173
173
|
export function hasDimensionsSupport( blockName, feature = 'any' ) {
|
|
174
|
-
if ( Platform.OS !== 'web' ) {
|
|
175
|
-
return false;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
174
|
const support = getBlockSupport( blockName, DIMENSIONS_SUPPORT_KEY );
|
|
179
175
|
|
|
180
176
|
if ( support === true ) {
|
|
@@ -194,6 +190,14 @@ export function hasDimensionsSupport( blockName, feature = 'any' ) {
|
|
|
194
190
|
return !! support?.[ feature ];
|
|
195
191
|
}
|
|
196
192
|
|
|
193
|
+
export function isExplicitAspectRatio( aspectRatio ) {
|
|
194
|
+
if ( ! aspectRatio ) {
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return `${ aspectRatio }`.trim().toLowerCase() !== 'auto';
|
|
199
|
+
}
|
|
200
|
+
|
|
197
201
|
export default {
|
|
198
202
|
useBlockProps,
|
|
199
203
|
attributeKeys: [ 'height', 'minHeight', 'width', 'style' ],
|
|
@@ -210,8 +214,11 @@ function useBlockProps( { name, height, minHeight, style } ) {
|
|
|
210
214
|
return {};
|
|
211
215
|
}
|
|
212
216
|
|
|
217
|
+
const hasExplicitAspectRatio = isExplicitAspectRatio(
|
|
218
|
+
style?.dimensions?.aspectRatio
|
|
219
|
+
);
|
|
213
220
|
const className = clsx( {
|
|
214
|
-
'has-aspect-ratio':
|
|
221
|
+
'has-aspect-ratio': hasExplicitAspectRatio,
|
|
215
222
|
} );
|
|
216
223
|
|
|
217
224
|
// Allow dimensions-based inline style overrides to override any global styles rules that
|
|
@@ -219,12 +226,12 @@ function useBlockProps( { name, height, minHeight, style } ) {
|
|
|
219
226
|
const inlineStyleOverrides = {};
|
|
220
227
|
|
|
221
228
|
// Apply rules to unset incompatible styles.
|
|
222
|
-
// Note that
|
|
229
|
+
// Note that an explicit `aspectRatio` will win out if both an aspect ratio and height-related properties are set.
|
|
223
230
|
// This is because the aspect ratio is a newer block support, so (in theory) any aspect ratio
|
|
224
231
|
// that is set should be intentional and should override any existing height properties. The Cover block
|
|
225
232
|
// and dimensions controls have logic that will manually clear the aspect ratio if height properties
|
|
226
233
|
// are set.
|
|
227
|
-
if (
|
|
234
|
+
if ( hasExplicitAspectRatio ) {
|
|
228
235
|
// To ensure the aspect ratio does not get overridden by `minHeight` or `height` unset any existing rule.
|
|
229
236
|
inlineStyleOverrides.minHeight = 'unset';
|
|
230
237
|
inlineStyleOverrides.height = 'unset';
|
package/src/hooks/fit-text.js
CHANGED
|
@@ -23,6 +23,7 @@ import { store as blockEditorStore } from '../store';
|
|
|
23
23
|
import { useBlockElement } from '../components/block-list/use-block-props/use-block-refs';
|
|
24
24
|
import InspectorControls from '../components/inspector-controls';
|
|
25
25
|
import FitTextSizeWarning from '../components/fit-text-size-warning';
|
|
26
|
+
import { unlock } from '../lock-unlock';
|
|
26
27
|
|
|
27
28
|
export const FIT_TEXT_SUPPORT_KEY = 'typography.fitText';
|
|
28
29
|
|
|
@@ -248,9 +249,24 @@ export function FitTextControl( {
|
|
|
248
249
|
fontSize,
|
|
249
250
|
style,
|
|
250
251
|
} ) {
|
|
252
|
+
const hasSelectedStyleState = useSelect(
|
|
253
|
+
( select ) => {
|
|
254
|
+
const { hasSelectedStyleState: hasSelectedBlockStyleState } =
|
|
255
|
+
unlock( select( blockEditorStore ) );
|
|
256
|
+
|
|
257
|
+
return hasSelectedBlockStyleState( clientId );
|
|
258
|
+
},
|
|
259
|
+
[ clientId ]
|
|
260
|
+
);
|
|
261
|
+
|
|
251
262
|
if ( ! hasBlockSupport( name, FIT_TEXT_SUPPORT_KEY ) ) {
|
|
252
263
|
return null;
|
|
253
264
|
}
|
|
265
|
+
|
|
266
|
+
if ( hasSelectedStyleState ) {
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
|
|
254
270
|
return (
|
|
255
271
|
<ToolsPanelItem
|
|
256
272
|
hasValue={ () => fitText }
|
|
@@ -28,6 +28,24 @@ const RESPONSIVE_BREAKPOINTS = {
|
|
|
28
28
|
tablet: '@media (480px < width <= 782px)',
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
+
// These are the serialized `selfStretch` values. `max` used to be called
|
|
32
|
+
// "Fixed" in the UI, but was renamed and replaced by `fixedNoShrink`.
|
|
33
|
+
const FLEX_CHILD_LAYOUT_VALUES = {
|
|
34
|
+
fit: 'fit',
|
|
35
|
+
grow: 'fill',
|
|
36
|
+
max: 'fixed',
|
|
37
|
+
fixed: 'fixedNoShrink',
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const FLEX_SIZE_VALUES = [
|
|
41
|
+
FLEX_CHILD_LAYOUT_VALUES.max,
|
|
42
|
+
FLEX_CHILD_LAYOUT_VALUES.fixed,
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
function isFlexSizeValue( value ) {
|
|
46
|
+
return FLEX_SIZE_VALUES.includes( value );
|
|
47
|
+
}
|
|
48
|
+
|
|
31
49
|
function serializeRule( { selector, declarations } ) {
|
|
32
50
|
return `${ selector } {
|
|
33
51
|
${ Object.entries( declarations )
|
|
@@ -60,6 +78,7 @@ export function getChildLayoutStyleRules( {
|
|
|
60
78
|
columnSpan,
|
|
61
79
|
rowSpan,
|
|
62
80
|
} = effectiveLayout;
|
|
81
|
+
const baseSelfStretch = layout.selfStretch;
|
|
63
82
|
const { columnCount, minimumColumnWidth } = parentLayout;
|
|
64
83
|
const rules = [];
|
|
65
84
|
|
|
@@ -69,10 +88,30 @@ export function getChildLayoutStyleRules( {
|
|
|
69
88
|
hasViewportOverride( 'selfStretch' ) ||
|
|
70
89
|
hasViewportOverride( 'flexSize' )
|
|
71
90
|
) {
|
|
72
|
-
if (
|
|
91
|
+
if (
|
|
92
|
+
hasViewportOverrides &&
|
|
93
|
+
( selfStretch === FLEX_CHILD_LAYOUT_VALUES.fit ||
|
|
94
|
+
selfStretch === FLEX_CHILD_LAYOUT_VALUES.grow ) &&
|
|
95
|
+
isFlexSizeValue( baseSelfStretch ) &&
|
|
96
|
+
layout.flexSize
|
|
97
|
+
) {
|
|
98
|
+
declarations[ 'flex-basis' ] = 'unset';
|
|
99
|
+
if ( baseSelfStretch === FLEX_CHILD_LAYOUT_VALUES.fixed ) {
|
|
100
|
+
declarations[ 'flex-shrink' ] = 'unset';
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if ( isFlexSizeValue( selfStretch ) && flexSize ) {
|
|
73
104
|
declarations[ 'flex-basis' ] = flexSize;
|
|
105
|
+
if ( selfStretch === FLEX_CHILD_LAYOUT_VALUES.fixed ) {
|
|
106
|
+
declarations[ 'flex-shrink' ] = '0';
|
|
107
|
+
} else if (
|
|
108
|
+
hasViewportOverrides &&
|
|
109
|
+
baseSelfStretch === FLEX_CHILD_LAYOUT_VALUES.fixed
|
|
110
|
+
) {
|
|
111
|
+
declarations[ 'flex-shrink' ] = 'unset';
|
|
112
|
+
}
|
|
74
113
|
declarations[ 'box-sizing' ] = 'border-box';
|
|
75
|
-
} else if ( selfStretch ===
|
|
114
|
+
} else if ( selfStretch === FLEX_CHILD_LAYOUT_VALUES.grow ) {
|
|
76
115
|
declarations[ 'flex-grow' ] = '1';
|
|
77
116
|
}
|
|
78
117
|
}
|
package/src/hooks/list-view.js
CHANGED
|
@@ -50,26 +50,25 @@ export function ListViewPanel( { clientId, name } ) {
|
|
|
50
50
|
useDispatch( blockEditorStore )
|
|
51
51
|
);
|
|
52
52
|
|
|
53
|
-
const isEnabled =
|
|
54
|
-
const { hasChildren, isNestedListView } = useSelect(
|
|
53
|
+
const { isEnabled, hasChildren, isNestedListView } = useSelect(
|
|
55
54
|
( select ) => {
|
|
56
|
-
const {
|
|
57
|
-
|
|
55
|
+
const {
|
|
56
|
+
getBlockCount,
|
|
57
|
+
getBlockParents,
|
|
58
|
+
shouldRenderBlockListView,
|
|
59
|
+
} = unlock( select( blockEditorStore ) );
|
|
58
60
|
|
|
59
61
|
// Avoid showing List Views for both parent and child blocks that have support.
|
|
60
62
|
// In this situation the parent will show the child in its list already.
|
|
61
63
|
// Search parents to see if there's one that also has support, and if so skip rendering.
|
|
62
64
|
// This matches closely the logic in the `BlockCard` component.
|
|
63
65
|
const parents = getBlockParents( clientId, false );
|
|
64
|
-
const _isNestedListView = parents.find( ( parentId ) =>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
parentName === 'core/navigation' ||
|
|
68
|
-
hasBlockSupport( parentName, 'listView' )
|
|
69
|
-
);
|
|
70
|
-
} );
|
|
66
|
+
const _isNestedListView = parents.find( ( parentId ) =>
|
|
67
|
+
shouldRenderBlockListView( parentId )
|
|
68
|
+
);
|
|
71
69
|
|
|
72
70
|
return {
|
|
71
|
+
isEnabled: shouldRenderBlockListView( clientId ),
|
|
73
72
|
hasChildren: !! getBlockCount( clientId ),
|
|
74
73
|
isNestedListView: _isNestedListView,
|
|
75
74
|
};
|
package/src/hooks/position.js
CHANGED
|
@@ -11,7 +11,7 @@ import { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';
|
|
|
11
11
|
import { BaseControl, CustomSelectControl } from '@wordpress/components';
|
|
12
12
|
import { useInstanceId } from '@wordpress/compose';
|
|
13
13
|
import { useSelect } from '@wordpress/data';
|
|
14
|
-
import { useMemo
|
|
14
|
+
import { useMemo } from '@wordpress/element';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Internal dependencies
|
|
@@ -264,32 +264,28 @@ export function PositionPanelPure( {
|
|
|
264
264
|
: DEFAULT_OPTION;
|
|
265
265
|
|
|
266
266
|
// Only display position controls if there is at least one option to choose from.
|
|
267
|
-
return
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
<
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
</InspectorControls>
|
|
290
|
-
) : null,
|
|
291
|
-
native: null,
|
|
292
|
-
} );
|
|
267
|
+
return options.length > 1 ? (
|
|
268
|
+
<InspectorControls group="position">
|
|
269
|
+
<BaseControl help={ stickyHelpText }>
|
|
270
|
+
<CustomSelectControl
|
|
271
|
+
__next40pxDefaultSize
|
|
272
|
+
label={ __( 'Position' ) }
|
|
273
|
+
hideLabelFromVision
|
|
274
|
+
describedBy={ sprintf(
|
|
275
|
+
// translators: %s: Currently selected position.
|
|
276
|
+
__( 'Currently selected position: %s' ),
|
|
277
|
+
selectedOption.name
|
|
278
|
+
) }
|
|
279
|
+
options={ options }
|
|
280
|
+
value={ selectedOption }
|
|
281
|
+
onChange={ ( { selectedItem } ) => {
|
|
282
|
+
onChangeType( selectedItem.value );
|
|
283
|
+
} }
|
|
284
|
+
size="__unstable-large"
|
|
285
|
+
/>
|
|
286
|
+
</BaseControl>
|
|
287
|
+
</InspectorControls>
|
|
288
|
+
) : null;
|
|
293
289
|
}
|
|
294
290
|
|
|
295
291
|
export default {
|
package/src/hooks/style.js
CHANGED
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
DIMENSIONS_SUPPORT_KEY,
|
|
30
30
|
SPACING_SUPPORT_KEY,
|
|
31
31
|
DimensionsPanel,
|
|
32
|
+
isExplicitAspectRatio,
|
|
32
33
|
} from './dimensions';
|
|
33
34
|
import {
|
|
34
35
|
cleanEmptyObject,
|
|
@@ -134,6 +135,72 @@ function getStateFallbackBorderStyles( stateStyles ) {
|
|
|
134
135
|
return cleanEmptyObject( { border: cleanEmptyObject( fallbackBorder ) } );
|
|
135
136
|
}
|
|
136
137
|
|
|
138
|
+
/**
|
|
139
|
+
* Returns background reset CSS for a state that sets a solid background color.
|
|
140
|
+
*
|
|
141
|
+
* When a state sets `color.background` (a solid color) without also setting a
|
|
142
|
+
* gradient (`color.gradient` or `background.gradient`), any gradient applied to
|
|
143
|
+
* the default state via an inline `background` shorthand or `background-image`
|
|
144
|
+
* declaration must be explicitly cleared. Without this, the gradient image layer
|
|
145
|
+
* remains visible even though the solid hover color wins `background-color`.
|
|
146
|
+
*
|
|
147
|
+
* @param {Object} stateStyles State style object.
|
|
148
|
+
* @param {string} selector CSS selector for the generated style.
|
|
149
|
+
* @return {string|undefined} CSS string with background-image reset, or undefined.
|
|
150
|
+
*/
|
|
151
|
+
function getStateBackgroundResetCSS( stateStyles, selector ) {
|
|
152
|
+
const hasSolidBackground = !! stateStyles?.color?.background;
|
|
153
|
+
|
|
154
|
+
if ( ! hasSolidBackground ) {
|
|
155
|
+
return undefined;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const hasColorGradient = !! stateStyles?.color?.gradient;
|
|
159
|
+
const hasBackgroundGradient =
|
|
160
|
+
!! stateStyles?.background?.gradient ||
|
|
161
|
+
!! stateStyles?.background?.backgroundImage;
|
|
162
|
+
|
|
163
|
+
if ( hasColorGradient || hasBackgroundGradient ) {
|
|
164
|
+
return undefined;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const declaration = 'background-image: unset !important';
|
|
168
|
+
return selector
|
|
169
|
+
? `${ selector } { ${ declaration }; }`
|
|
170
|
+
: `${ declaration };`;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Returns fallback dimension styles that keep state styles aligned with the
|
|
175
|
+
* default dimensions block-support output.
|
|
176
|
+
*
|
|
177
|
+
* @param {Object} stateStyles State style object.
|
|
178
|
+
* @return {Object|undefined} Style object containing fallback dimension styles.
|
|
179
|
+
*/
|
|
180
|
+
function getStateFallbackDimensionStyles( stateStyles ) {
|
|
181
|
+
const dimensions = stateStyles?.dimensions;
|
|
182
|
+
if ( ! dimensions ) {
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if ( isExplicitAspectRatio( dimensions.aspectRatio ) ) {
|
|
187
|
+
return {
|
|
188
|
+
dimensions: {
|
|
189
|
+
minHeight: 'unset',
|
|
190
|
+
height: 'unset',
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if ( dimensions.minHeight || dimensions.height ) {
|
|
196
|
+
return {
|
|
197
|
+
dimensions: {
|
|
198
|
+
aspectRatio: 'unset',
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
137
204
|
/**
|
|
138
205
|
* Generates CSS for a block instance state style object.
|
|
139
206
|
*
|
|
@@ -146,14 +213,25 @@ function getStateFallbackBorderStyles( stateStyles ) {
|
|
|
146
213
|
* @return {string} Generated stylesheet.
|
|
147
214
|
*/
|
|
148
215
|
export function getStateStylesCSS( stateStyles, selector ) {
|
|
149
|
-
const
|
|
216
|
+
const fallbackDimensionStyles =
|
|
217
|
+
getStateFallbackDimensionStyles( stateStyles );
|
|
218
|
+
const stylesWithDimensionFallbacks = fallbackDimensionStyles
|
|
219
|
+
? mergeStyleObjects( stateStyles, fallbackDimensionStyles )
|
|
220
|
+
: stateStyles;
|
|
221
|
+
const css = compileCSS( stylesWithDimensionFallbacks, { selector } );
|
|
150
222
|
const importantCSS = css ? css.replace( /;/g, ' !important;' ) : undefined;
|
|
151
223
|
const fallbackBorderStyles = getStateFallbackBorderStyles( stateStyles );
|
|
152
224
|
const fallbackCSS = fallbackBorderStyles
|
|
153
225
|
? compileCSS( fallbackBorderStyles, { selector } )
|
|
154
226
|
: undefined;
|
|
227
|
+
const backgroundResetCSS = getStateBackgroundResetCSS(
|
|
228
|
+
stateStyles,
|
|
229
|
+
selector
|
|
230
|
+
);
|
|
155
231
|
|
|
156
|
-
return [ importantCSS, fallbackCSS ]
|
|
232
|
+
return [ importantCSS, fallbackCSS, backgroundResetCSS ]
|
|
233
|
+
.filter( Boolean )
|
|
234
|
+
.join( '\n' );
|
|
157
235
|
}
|
|
158
236
|
|
|
159
237
|
function isPlainObject( value ) {
|
package/src/hooks/supports.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';
|
|
5
|
-
import { Platform } from '@wordpress/element';
|
|
6
5
|
|
|
7
6
|
const ALIGN_SUPPORT_KEY = 'align';
|
|
8
7
|
const ALIGN_WIDE_SUPPORT_KEY = 'alignWide';
|
|
@@ -120,10 +119,6 @@ export const getAlignWideSupport = ( nameOrType ) =>
|
|
|
120
119
|
* @return {boolean} Whether there is support.
|
|
121
120
|
*/
|
|
122
121
|
export function hasBorderSupport( nameOrType, feature = 'any' ) {
|
|
123
|
-
if ( Platform.OS !== 'web' ) {
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
122
|
const support = getBlockSupport( nameOrType, BORDER_SUPPORT_KEY );
|
|
128
123
|
|
|
129
124
|
if ( support === true ) {
|
|
@@ -177,10 +172,6 @@ export const hasColorSupport = ( nameOrType ) => {
|
|
|
177
172
|
* @return {boolean} Whether the block supports the feature.
|
|
178
173
|
*/
|
|
179
174
|
export const hasLinkColorSupport = ( nameOrType ) => {
|
|
180
|
-
if ( Platform.OS !== 'web' ) {
|
|
181
|
-
return false;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
175
|
const colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );
|
|
185
176
|
|
|
186
177
|
return (
|