@wordpress/block-editor 15.21.0 → 15.22.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/README.md +2 -2
- 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-editing-mode/index.cjs +13 -7
- package/build/components/block-editing-mode/index.cjs.map +2 -2
- package/build/components/block-inspector/index.cjs +35 -20
- 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-rename/modal.cjs +0 -1
- package/build/components/block-rename/modal.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/block-toolbar-icon.cjs +14 -6
- package/build/components/block-toolbar/block-toolbar-icon.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/colors-gradients/control.cjs +25 -14
- package/build/components/colors-gradients/control.cjs.map +2 -2
- package/build/components/colors-gradients/dropdown.cjs +4 -1
- package/build/components/colors-gradients/dropdown.cjs.map +3 -3
- package/build/components/contrast-checker/index.cjs +22 -4
- package/build/components/contrast-checker/index.cjs.map +2 -2
- package/build/components/date-format-picker/index.cjs +0 -1
- package/build/components/date-format-picker/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 +154 -26
- package/build/components/global-styles/background-panel.cjs.map +3 -3
- 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/color-gradient-dropdown-item.cjs +227 -0
- package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +7 -0
- package/build/components/global-styles/color-panel.cjs +98 -375
- package/build/components/global-styles/color-panel.cjs.map +3 -3
- package/build/components/global-styles/dimensions-panel.cjs +2 -5
- package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
- package/build/components/global-styles/hooks.cjs +34 -0
- package/build/components/global-styles/hooks.cjs.map +2 -2
- package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
- package/build/components/global-styles/typography-panel.cjs +82 -10
- package/build/components/global-styles/typography-panel.cjs.map +3 -3
- 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/groups.cjs +2 -0
- package/build/components/inspector-controls/groups.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/index.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/styles-tab.cjs +76 -32
- 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 +2 -3
- package/build/components/link-control/index.cjs.map +2 -2
- package/build/components/link-control/normalize-url.cjs.map +1 -1
- package/build/components/list-view/block-select-button.cjs +9 -20
- package/build/components/list-view/block-select-button.cjs.map +3 -3
- 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 +14 -3
- 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/url-popover/image-url-input-ui.cjs +0 -2
- package/build/components/url-popover/image-url-input-ui.cjs.map +2 -2
- package/build/components/use-block-commands/index.cjs +5 -5
- package/build/components/use-block-commands/index.cjs.map +2 -2
- package/build/components/use-block-display-information/index.cjs +10 -3
- package/build/components/use-block-display-information/index.cjs.map +2 -2
- package/build/components/writing-flow/use-tab-nav.cjs.map +1 -1
- package/build/hooks/anchor.cjs +12 -17
- package/build/hooks/anchor.cjs.map +2 -2
- package/build/hooks/background.cjs +124 -75
- package/build/hooks/background.cjs.map +3 -3
- 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 +0 -165
- package/build/hooks/color.cjs.map +3 -3
- package/build/hooks/contrast-checker.cjs +31 -28
- package/build/hooks/contrast-checker.cjs.map +3 -3
- package/build/hooks/custom-class-name.cjs +0 -1
- package/build/hooks/custom-class-name.cjs.map +2 -2
- package/build/hooks/dimensions.cjs +13 -5
- package/build/hooks/dimensions.cjs.map +2 -2
- package/build/hooks/elements.cjs +142 -0
- package/build/hooks/elements.cjs.map +7 -0
- package/build/hooks/fit-text.cjs +11 -0
- package/build/hooks/fit-text.cjs.map +2 -2
- package/build/hooks/grid-visualizer.cjs +21 -11
- package/build/hooks/grid-visualizer.cjs.map +2 -2
- package/build/hooks/layout-child.cjs +65 -10
- package/build/hooks/layout-child.cjs.map +2 -2
- package/build/hooks/layout.cjs +6 -3
- package/build/hooks/layout.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/states.cjs +2 -2
- package/build/hooks/states.cjs.map +2 -2
- package/build/hooks/style.cjs +50 -6
- 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/hooks/typography.cjs +62 -10
- package/build/hooks/typography.cjs.map +3 -3
- package/build/layouts/flex.cjs +99 -6
- package/build/layouts/flex.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/block-bindings.cjs +9 -9
- package/build/utils/block-bindings.cjs.map +3 -3
- package/build/utils/color-values.cjs +10 -1
- package/build/utils/color-values.cjs.map +3 -3
- package/build/utils/dom.cjs +2 -5
- package/build/utils/dom.cjs.map +3 -3
- package/build/utils/fit-text-frontend.cjs +6 -2
- package/build/utils/fit-text-frontend.cjs.map +3 -3
- package/build/utils/fit-text-utils.cjs +1 -1
- package/build/utils/fit-text-utils.cjs.map +3 -3
- package/build/utils/format-font-style.cjs +1 -1
- package/build/utils/format-font-style.cjs.map +3 -3
- package/build/utils/format-font-weight.cjs +1 -1
- package/build/utils/format-font-weight.cjs.map +3 -3
- package/build/utils/get-editor-region.cjs +4 -2
- package/build/utils/get-editor-region.cjs.map +3 -3
- package/build/utils/get-font-styles-and-weights.cjs +8 -12
- package/build/utils/get-font-styles-and-weights.cjs.map +3 -3
- package/build/utils/get-px-from-css-unit.cjs +1 -1
- package/build/utils/get-px-from-css-unit.cjs.map +1 -1
- package/build/utils/index.cjs +1 -1
- package/build/utils/index.cjs.map +1 -1
- package/build/utils/math.cjs +1 -1
- package/build/utils/math.cjs.map +3 -3
- package/build/utils/object.cjs +8 -8
- package/build/utils/object.cjs.map +3 -3
- package/build/utils/order-inserter-block-items.cjs +1 -1
- package/build/utils/order-inserter-block-items.cjs.map +3 -3
- package/build/utils/pasting.cjs +4 -2
- package/build/utils/pasting.cjs.map +3 -3
- package/build/utils/selection.cjs +3 -2
- package/build/utils/selection.cjs.map +3 -3
- package/build/utils/sorting.cjs +9 -3
- package/build/utils/sorting.cjs.map +3 -3
- package/build/utils/transform-styles/index.cjs +3 -2
- package/build/utils/transform-styles/index.cjs.map +3 -3
- package/build/utils/transform-styles/postcss-urlrebase.d.cjs +2 -0
- package/build/utils/transform-styles/postcss-urlrebase.d.cjs.map +7 -0
- package/build/{components/rich-text/native/index.cjs → utils/transform-styles/types.cjs} +4 -13
- package/build/utils/transform-styles/types.cjs.map +7 -0
- package/build/utils/types.cjs +19 -0
- package/build/utils/types.cjs.map +7 -0
- 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-editing-mode/index.mjs +14 -8
- package/build-module/components/block-editing-mode/index.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +35 -21
- 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-rename/modal.mjs +0 -1
- package/build-module/components/block-rename/modal.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/block-toolbar-icon.mjs +14 -6
- package/build-module/components/block-toolbar/block-toolbar-icon.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/colors-gradients/control.mjs +27 -15
- package/build-module/components/colors-gradients/control.mjs.map +2 -2
- package/build-module/components/colors-gradients/dropdown.mjs +4 -1
- package/build-module/components/colors-gradients/dropdown.mjs.map +2 -2
- package/build-module/components/contrast-checker/index.mjs +18 -4
- package/build-module/components/contrast-checker/index.mjs.map +2 -2
- package/build-module/components/date-format-picker/index.mjs +0 -1
- package/build-module/components/date-format-picker/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 +157 -29
- 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/color-gradient-dropdown-item.mjs +207 -0
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +7 -0
- package/build-module/components/global-styles/color-panel.mjs +106 -387
- package/build-module/components/global-styles/color-panel.mjs.map +3 -3
- package/build-module/components/global-styles/dimensions-panel.mjs +3 -7
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/global-styles/hooks.mjs +33 -0
- package/build-module/components/global-styles/hooks.mjs.map +2 -2
- package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
- package/build-module/components/global-styles/typography-panel.mjs +84 -10
- package/build-module/components/global-styles/typography-panel.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/groups.mjs +2 -0
- package/build-module/components/inspector-controls/groups.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 +76 -32
- 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 +2 -3
- package/build-module/components/link-control/index.mjs.map +2 -2
- package/build-module/components/link-control/normalize-url.mjs.map +1 -1
- package/build-module/components/list-view/block-select-button.mjs +10 -27
- 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 +14 -3
- 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/url-popover/image-url-input-ui.mjs +0 -2
- package/build-module/components/url-popover/image-url-input-ui.mjs.map +2 -2
- 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/use-block-display-information/index.mjs +10 -3
- package/build-module/components/use-block-display-information/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 -17
- package/build-module/hooks/anchor.mjs.map +2 -2
- package/build-module/hooks/background.mjs +123 -75
- package/build-module/hooks/background.mjs.map +2 -2
- 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 -178
- package/build-module/hooks/color.mjs.map +2 -2
- package/build-module/hooks/contrast-checker.mjs +32 -19
- package/build-module/hooks/contrast-checker.mjs.map +2 -2
- package/build-module/hooks/custom-class-name.mjs +0 -1
- package/build-module/hooks/custom-class-name.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/elements.mjs +115 -0
- package/build-module/hooks/elements.mjs.map +7 -0
- package/build-module/hooks/fit-text.mjs +11 -0
- package/build-module/hooks/fit-text.mjs.map +2 -2
- package/build-module/hooks/grid-visualizer.mjs +21 -11
- package/build-module/hooks/grid-visualizer.mjs.map +2 -2
- package/build-module/hooks/layout-child.mjs +68 -10
- package/build-module/hooks/layout-child.mjs.map +2 -2
- package/build-module/hooks/layout.mjs +6 -3
- package/build-module/hooks/layout.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/states.mjs +2 -2
- package/build-module/hooks/states.mjs.map +2 -2
- package/build-module/hooks/style.mjs +53 -8
- 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/hooks/typography.mjs +62 -10
- package/build-module/hooks/typography.mjs.map +2 -2
- package/build-module/layouts/flex.mjs +105 -7
- package/build-module/layouts/flex.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/block-bindings.mjs +9 -9
- package/build-module/utils/block-bindings.mjs.map +3 -3
- package/build-module/utils/color-values.mjs +9 -1
- package/build-module/utils/color-values.mjs.map +3 -3
- package/build-module/utils/dom.mjs +2 -5
- package/build-module/utils/dom.mjs.map +3 -3
- package/build-module/utils/fit-text-frontend.mjs +6 -2
- package/build-module/utils/fit-text-frontend.mjs.map +3 -3
- package/build-module/utils/fit-text-utils.mjs +1 -1
- package/build-module/utils/fit-text-utils.mjs.map +3 -3
- package/build-module/utils/format-font-style.mjs +1 -1
- package/build-module/utils/format-font-style.mjs.map +3 -3
- package/build-module/utils/format-font-weight.mjs +1 -1
- package/build-module/utils/format-font-weight.mjs.map +3 -3
- package/build-module/utils/get-editor-region.mjs +4 -2
- package/build-module/utils/get-editor-region.mjs.map +3 -3
- package/build-module/utils/get-font-styles-and-weights.mjs +8 -12
- package/build-module/utils/get-font-styles-and-weights.mjs.map +3 -3
- package/build-module/utils/get-px-from-css-unit.mjs +1 -1
- package/build-module/utils/get-px-from-css-unit.mjs.map +1 -1
- package/build-module/utils/index.mjs +1 -1
- package/build-module/utils/index.mjs.map +1 -1
- package/build-module/utils/math.mjs +1 -1
- package/build-module/utils/math.mjs.map +3 -3
- package/build-module/utils/object.mjs +8 -8
- package/build-module/utils/object.mjs.map +3 -3
- package/build-module/utils/order-inserter-block-items.mjs +1 -1
- package/build-module/utils/order-inserter-block-items.mjs.map +3 -3
- package/build-module/utils/pasting.mjs +4 -2
- package/build-module/utils/pasting.mjs.map +3 -3
- package/build-module/utils/selection.mjs +3 -2
- package/build-module/utils/selection.mjs.map +3 -3
- package/build-module/utils/sorting.mjs +9 -3
- package/build-module/utils/sorting.mjs.map +3 -3
- package/build-module/utils/transform-styles/index.mjs +3 -2
- package/build-module/utils/transform-styles/index.mjs.map +3 -3
- package/build-module/utils/transform-styles/postcss-urlrebase.d.mjs +1 -0
- package/build-module/utils/transform-styles/postcss-urlrebase.d.mjs.map +7 -0
- package/build-module/utils/transform-styles/types.mjs +1 -0
- package/build-module/utils/transform-styles/types.mjs.map +7 -0
- package/build-module/utils/types.mjs +1 -0
- package/build-module/utils/types.mjs.map +7 -0
- package/build-style/content-rtl.css +14 -0
- package/build-style/content.css +14 -0
- package/build-style/style-rtl.css +60 -49
- package/build-style/style.css +60 -49
- package/build-types/utils/block-bindings.d.ts +27 -0
- package/build-types/utils/block-bindings.d.ts.map +1 -0
- package/build-types/utils/color-values.d.ts +40 -0
- package/build-types/utils/color-values.d.ts.map +1 -0
- package/build-types/utils/dom.d.ts +19 -19
- package/build-types/utils/dom.d.ts.map +1 -1
- package/build-types/utils/fit-text-frontend.d.ts +7 -0
- package/build-types/utils/fit-text-frontend.d.ts.map +1 -0
- package/build-types/utils/fit-text-utils.d.ts +15 -0
- package/build-types/utils/fit-text-utils.d.ts.map +1 -0
- package/build-types/utils/format-font-style.d.ts +12 -0
- package/build-types/utils/format-font-style.d.ts.map +1 -0
- package/build-types/utils/format-font-weight.d.ts +12 -0
- package/build-types/utils/format-font-weight.d.ts.map +1 -0
- package/build-types/utils/get-editor-region.d.ts +9 -0
- package/build-types/utils/get-editor-region.d.ts.map +1 -0
- package/build-types/utils/get-font-styles-and-weights.d.ts +16 -0
- package/build-types/utils/get-font-styles-and-weights.d.ts.map +1 -0
- package/build-types/utils/get-px-from-css-unit.d.ts +10 -0
- package/build-types/utils/get-px-from-css-unit.d.ts.map +1 -0
- package/build-types/utils/index.d.ts +3 -0
- package/build-types/utils/index.d.ts.map +1 -0
- package/build-types/utils/math.d.ts +61 -0
- package/build-types/utils/math.d.ts.map +1 -0
- package/build-types/utils/object.d.ts +39 -0
- package/build-types/utils/object.d.ts.map +1 -0
- package/build-types/utils/order-inserter-block-items.d.ts +13 -0
- package/build-types/utils/order-inserter-block-items.d.ts.map +1 -0
- package/build-types/utils/pasting.d.ts +28 -0
- package/build-types/utils/pasting.d.ts.map +1 -0
- package/build-types/utils/selection.d.ts +21 -0
- package/build-types/utils/selection.d.ts.map +1 -0
- package/build-types/utils/sorting.d.ts +17 -0
- package/build-types/utils/sorting.d.ts.map +1 -0
- package/build-types/utils/transform-styles/index.d.ts +15 -0
- package/build-types/utils/transform-styles/index.d.ts.map +1 -0
- package/build-types/utils/transform-styles/types.d.ts +13 -0
- package/build-types/utils/transform-styles/types.d.ts.map +1 -0
- package/build-types/utils/types.d.ts +28 -0
- package/build-types/utils/types.d.ts.map +1 -0
- package/package.json +55 -46
- package/src/components/alignment-control/test/__snapshots__/index.js.snap +6 -0
- package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +5 -0
- 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-editing-mode/index.js +17 -9
- package/src/components/block-icon/test/__snapshots__/index.js.snap +1 -0
- package/src/components/block-inspector/index.js +22 -20
- 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-rename/modal.js +0 -1
- package/src/components/block-switcher/block-transformations-menu.js +16 -18
- package/src/components/block-switcher/index.js +4 -4
- package/src/components/block-toolbar/block-toolbar-icon.js +22 -6
- package/src/components/block-toolbar/test/block-toolbar-icon.js +99 -0
- 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/block-vertical-alignment-control/test/__snapshots__/index.js.snap +4 -0
- package/src/components/child-layout-control/index.js +65 -20
- package/src/components/child-layout-control/test/index.js +64 -0
- package/src/components/colors-gradients/control.js +29 -12
- package/src/components/colors-gradients/dropdown.js +4 -1
- package/src/components/colors-gradients/style.scss +39 -2
- package/src/components/contrast-checker/README.md +9 -0
- package/src/components/contrast-checker/index.js +42 -3
- package/src/components/date-format-picker/index.js +0 -1
- package/src/components/default-block-appender/content.scss +3 -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 +203 -36
- package/src/components/global-styles/border-panel.js +2 -0
- package/src/components/global-styles/color-gradient-dropdown-item.js +258 -0
- package/src/components/global-styles/color-panel.js +125 -487
- package/src/components/global-styles/dimensions-panel.js +13 -18
- package/src/components/global-styles/hooks.js +45 -0
- package/src/components/global-styles/shadow-panel-components.js +0 -1
- package/src/components/global-styles/test/background-panel.js +56 -0
- package/src/components/global-styles/test/color-panel.js +172 -118
- package/src/components/global-styles/test/typography-panel.js +167 -0
- package/src/components/global-styles/typography-panel.js +100 -11
- 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/README.md +0 -2
- package/src/components/inspector-controls/fill.js +6 -8
- package/src/components/inspector-controls/groups.js +2 -0
- package/src/components/inspector-controls-tabs/index.js +0 -1
- package/src/components/inspector-controls-tabs/styles-tab.js +78 -28
- package/src/components/justify-content-control/README.md +1 -1
- package/src/components/link-control/index.js +0 -1
- package/src/components/link-control/test/index.js +2 -3
- package/src/components/list-view/block-select-button.js +9 -29
- 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 +15 -3
- package/src/components/rich-text/content.scss +2 -0
- 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/url-popover/image-url-input-ui.js +0 -2
- package/src/components/use-block-commands/index.js +5 -5
- package/src/components/use-block-display-information/index.js +15 -2
- package/src/components/use-block-display-information/test/index.js +140 -0
- package/src/hooks/anchor.js +9 -18
- package/src/hooks/background.js +210 -133
- package/src/hooks/background.scss +0 -35
- package/src/hooks/block-fields/index.js +27 -2
- package/src/hooks/border.js +1 -5
- package/src/hooks/color.js +2 -210
- package/src/hooks/color.scss +3 -9
- package/src/hooks/contrast-checker.js +60 -17
- package/src/hooks/custom-class-name.js +0 -1
- package/src/hooks/dimensions.js +15 -8
- package/src/hooks/elements.js +140 -0
- package/src/hooks/elements.scss +8 -0
- package/src/hooks/fit-text.js +16 -0
- package/src/hooks/grid-visualizer.js +59 -45
- package/src/hooks/layout-child.js +92 -14
- package/src/hooks/layout.js +6 -3
- package/src/hooks/list-view.js +10 -11
- package/src/hooks/position.js +23 -27
- package/src/hooks/states.js +2 -2
- package/src/hooks/style.js +91 -9
- package/src/hooks/supports.js +0 -9
- package/src/hooks/test/background.js +59 -0
- package/src/hooks/test/block-style-state.js +14 -14
- package/src/hooks/test/dimensions.js +71 -0
- package/src/hooks/test/layout-child.js +165 -0
- package/src/hooks/test/layout.js +6 -6
- package/src/hooks/test/style.js +133 -11
- package/src/hooks/typography.js +70 -6
- package/src/layouts/flex.js +118 -15
- 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 +166 -7
- package/src/store/test/reducer.js +107 -10
- package/src/store/test/selectors.js +77 -0
- package/src/style.scss +1 -0
- package/src/utils/block-bindings.ts +51 -0
- package/src/utils/color-values.ts +63 -0
- package/src/utils/{dom.js → dom.ts} +27 -27
- package/src/utils/{fit-text-frontend.js → fit-text-frontend.ts} +12 -4
- package/src/utils/{fit-text-utils.js → fit-text-utils.ts} +15 -7
- package/src/utils/{format-font-style.js → format-font-style.ts} +10 -3
- package/src/utils/{format-font-weight.js → format-font-weight.ts} +10 -3
- package/src/utils/{get-editor-region.js → get-editor-region.ts} +10 -6
- package/src/utils/{get-font-styles-and-weights.js → get-font-styles-and-weights.ts} +21 -17
- package/src/utils/{math.js → math.ts} +37 -30
- package/src/utils/object.ts +89 -0
- package/src/utils/{order-inserter-block-items.js → order-inserter-block-items.ts} +8 -5
- package/src/utils/{pasting.js → pasting.ts} +18 -11
- package/src/utils/{selection.js → selection.ts} +11 -4
- package/src/utils/sorting.ts +81 -0
- package/src/utils/test/color-values.js +44 -1
- package/src/utils/transform-styles/{index.js → index.ts} +25 -25
- package/src/utils/transform-styles/postcss-urlrebase.d.ts +15 -0
- package/src/utils/transform-styles/types.ts +13 -0
- package/src/utils/types.ts +29 -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.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
- package/src/utils/block-bindings.js +0 -46
- package/src/utils/color-values.js +0 -28
- package/src/utils/object.js +0 -67
- package/src/utils/sorting.js +0 -54
- /package/src/utils/{get-px-from-css-unit.js → get-px-from-css-unit.ts} +0 -0
- /package/src/utils/{index.js → index.ts} +0 -0
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
Composite,
|
|
13
13
|
__experimentalHStack as HStack,
|
|
14
14
|
} from '@wordpress/components';
|
|
15
|
-
// eslint-disable-next-line @wordpress/use-recommended-components -- `Tooltip` is not yet on the recommended `@wordpress/ui` allow-list; landing as a migration step ahead of the wider rollout.
|
|
16
15
|
import { VisuallyHidden, Text, Tooltip } from '@wordpress/ui';
|
|
17
16
|
import { useInstanceId } from '@wordpress/compose';
|
|
18
17
|
import { __ } from '@wordpress/i18n';
|
|
@@ -195,8 +194,8 @@ function BlockPatternsList(
|
|
|
195
194
|
onHover,
|
|
196
195
|
onClickPattern,
|
|
197
196
|
orientation,
|
|
198
|
-
label = __( 'Block patterns' ),
|
|
199
197
|
category,
|
|
198
|
+
label = __( 'Patterns' ),
|
|
200
199
|
showTitlesAsTooltip,
|
|
201
200
|
pagingProps,
|
|
202
201
|
},
|
|
@@ -26,7 +26,7 @@ A block instance (object) or a blocks array you would like to render a preview.
|
|
|
26
26
|
|
|
27
27
|
Width of the preview container in pixels. Controls at what size the blocks will be rendered inside the preview.
|
|
28
28
|
|
|
29
|
-
`viewportWidth` can be used to simulate how blocks look on different device sizes or to make sure
|
|
29
|
+
`viewportWidth` can be used to simulate how blocks look on different device sizes or to make sure multiple previews will be rendered with the same scale, regardless of their content.
|
|
30
30
|
|
|
31
31
|
Set `viewportWidth` to `0` to make the viewport the same width as the container.
|
|
32
32
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { getBlockType } from '@wordpress/blocks';
|
|
5
5
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
6
|
import {
|
|
7
7
|
Button,
|
|
@@ -20,6 +20,7 @@ import { store as blockEditorStore } from '../../store';
|
|
|
20
20
|
import BlockIcon from '../block-icon';
|
|
21
21
|
import useBlockDisplayInformation from '../use-block-display-information';
|
|
22
22
|
import useBlockDisplayTitle from '../block-title/use-block-display-title';
|
|
23
|
+
import { unlock } from '../../lock-unlock';
|
|
23
24
|
|
|
24
25
|
export default function BlockQuickNavigation( {
|
|
25
26
|
clientIds,
|
|
@@ -52,7 +53,7 @@ function BlockQuickNavigationItem( {
|
|
|
52
53
|
hasListViewTab,
|
|
53
54
|
} ) {
|
|
54
55
|
const blockInformation = useBlockDisplayInformation( clientId );
|
|
55
|
-
const { isSelected, childBlocks,
|
|
56
|
+
const { isSelected, childBlocks, shouldRenderListView, blockName } =
|
|
56
57
|
useSelect(
|
|
57
58
|
( select ) => {
|
|
58
59
|
const {
|
|
@@ -60,7 +61,8 @@ function BlockQuickNavigationItem( {
|
|
|
60
61
|
hasSelectedInnerBlock,
|
|
61
62
|
getBlockOrder,
|
|
62
63
|
getBlockName,
|
|
63
|
-
|
|
64
|
+
shouldRenderBlockListView,
|
|
65
|
+
} = unlock( select( blockEditorStore ) );
|
|
64
66
|
|
|
65
67
|
const _blockName = getBlockName( clientId );
|
|
66
68
|
|
|
@@ -69,9 +71,7 @@ function BlockQuickNavigationItem( {
|
|
|
69
71
|
isBlockSelected( clientId ) ||
|
|
70
72
|
hasSelectedInnerBlock( clientId, /* deep: */ true ),
|
|
71
73
|
childBlocks: getBlockOrder( clientId ),
|
|
72
|
-
|
|
73
|
-
_blockName === 'core/navigation' ||
|
|
74
|
-
hasBlockSupport( _blockName, 'listView' ),
|
|
74
|
+
shouldRenderListView: shouldRenderBlockListView( clientId ),
|
|
75
75
|
blockName: _blockName,
|
|
76
76
|
};
|
|
77
77
|
},
|
|
@@ -88,7 +88,7 @@ function BlockQuickNavigationItem( {
|
|
|
88
88
|
|
|
89
89
|
const hasChildren = childBlocks && childBlocks.length > 0;
|
|
90
90
|
const canNavigateToListView =
|
|
91
|
-
hasChildren && hasListViewTab &&
|
|
91
|
+
hasChildren && hasListViewTab && shouldRenderListView;
|
|
92
92
|
|
|
93
93
|
return (
|
|
94
94
|
<Button
|
|
@@ -88,8 +88,7 @@ const BlockTransformationsMenu = ( {
|
|
|
88
88
|
onSelectVariation,
|
|
89
89
|
blocks,
|
|
90
90
|
} ) => {
|
|
91
|
-
const [
|
|
92
|
-
useState();
|
|
91
|
+
const [ hoveredTransformItem, setHoveredTransformItem ] = useState();
|
|
93
92
|
|
|
94
93
|
const { priorityTextTransformations, restTransformations } =
|
|
95
94
|
useGroupedTransforms( possibleBlockTransformations );
|
|
@@ -101,17 +100,18 @@ const BlockTransformationsMenu = ( {
|
|
|
101
100
|
<RestTransformationItems
|
|
102
101
|
restTransformations={ restTransformations }
|
|
103
102
|
onSelect={ onSelect }
|
|
104
|
-
|
|
103
|
+
setHoveredTransformItem={ setHoveredTransformItem }
|
|
105
104
|
/>
|
|
106
105
|
);
|
|
107
106
|
return (
|
|
108
107
|
<>
|
|
109
108
|
<MenuGroup label={ __( 'Transform to' ) } className={ className }>
|
|
110
|
-
{
|
|
109
|
+
{ hoveredTransformItem && (
|
|
111
110
|
<PreviewBlockPopover
|
|
112
111
|
blocks={ switchToBlockType(
|
|
113
112
|
blocks,
|
|
114
|
-
|
|
113
|
+
hoveredTransformItem.name,
|
|
114
|
+
hoveredTransformItem.variationName
|
|
115
115
|
) }
|
|
116
116
|
/>
|
|
117
117
|
) }
|
|
@@ -126,12 +126,10 @@ const BlockTransformationsMenu = ( {
|
|
|
126
126
|
) }
|
|
127
127
|
{ priorityTextTransformations.map( ( item ) => (
|
|
128
128
|
<BlockTransformationItem
|
|
129
|
-
key={ item.name }
|
|
129
|
+
key={ item.id || item.name }
|
|
130
130
|
item={ item }
|
|
131
131
|
onSelect={ onSelect }
|
|
132
|
-
|
|
133
|
-
setHoveredTransformItemName
|
|
134
|
-
}
|
|
132
|
+
setHoveredTransformItem={ setHoveredTransformItem }
|
|
135
133
|
/>
|
|
136
134
|
) ) }
|
|
137
135
|
{ ! hasBothContentTransformations && restTransformItems }
|
|
@@ -148,14 +146,14 @@ const BlockTransformationsMenu = ( {
|
|
|
148
146
|
function RestTransformationItems( {
|
|
149
147
|
restTransformations,
|
|
150
148
|
onSelect,
|
|
151
|
-
|
|
149
|
+
setHoveredTransformItem,
|
|
152
150
|
} ) {
|
|
153
151
|
return restTransformations.map( ( item ) => (
|
|
154
152
|
<BlockTransformationItem
|
|
155
|
-
key={ item.name }
|
|
153
|
+
key={ item.id || item.name }
|
|
156
154
|
item={ item }
|
|
157
155
|
onSelect={ onSelect }
|
|
158
|
-
|
|
156
|
+
setHoveredTransformItem={ setHoveredTransformItem }
|
|
159
157
|
/>
|
|
160
158
|
) );
|
|
161
159
|
}
|
|
@@ -163,7 +161,7 @@ function RestTransformationItems( {
|
|
|
163
161
|
function BlockTransformationItem( {
|
|
164
162
|
item,
|
|
165
163
|
onSelect,
|
|
166
|
-
|
|
164
|
+
setHoveredTransformItem,
|
|
167
165
|
} ) {
|
|
168
166
|
const { name, icon, title, isDisabled } = item;
|
|
169
167
|
return (
|
|
@@ -171,13 +169,13 @@ function BlockTransformationItem( {
|
|
|
171
169
|
className={ getBlockMenuDefaultClassName( name ) }
|
|
172
170
|
onClick={ ( event ) => {
|
|
173
171
|
event.preventDefault();
|
|
174
|
-
onSelect( name );
|
|
172
|
+
onSelect( name, item.variationName );
|
|
175
173
|
} }
|
|
176
174
|
disabled={ isDisabled }
|
|
177
|
-
onMouseLeave={ () =>
|
|
178
|
-
onMouseEnter={ () =>
|
|
179
|
-
onFocus={ () =>
|
|
180
|
-
onBlur={ () =>
|
|
175
|
+
onMouseLeave={ () => setHoveredTransformItem( null ) }
|
|
176
|
+
onMouseEnter={ () => setHoveredTransformItem( item ) }
|
|
177
|
+
onFocus={ () => setHoveredTransformItem( item ) }
|
|
178
|
+
onBlur={ () => setHoveredTransformItem( null ) }
|
|
181
179
|
>
|
|
182
180
|
<BlockIcon icon={ icon } showColors />
|
|
183
181
|
{ title }
|
|
@@ -87,8 +87,8 @@ function BlockSwitcherDropdownMenuContents( { onClose, clientIds } ) {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
// Simple block transformation based on the `Block Transforms` API.
|
|
90
|
-
function onBlockTransform( name ) {
|
|
91
|
-
const newBlocks = switchToBlockType( blocks, name );
|
|
90
|
+
function onBlockTransform( name, variationName ) {
|
|
91
|
+
const newBlocks = switchToBlockType( blocks, name, variationName );
|
|
92
92
|
replaceBlocks( clientIds, newBlocks );
|
|
93
93
|
selectForMultipleBlocks( newBlocks );
|
|
94
94
|
}
|
|
@@ -166,8 +166,8 @@ function BlockSwitcherDropdownMenuContents( { onClose, clientIds } ) {
|
|
|
166
166
|
blockVariationTransformations
|
|
167
167
|
}
|
|
168
168
|
blocks={ blocks }
|
|
169
|
-
onSelect={ ( name ) => {
|
|
170
|
-
onBlockTransform( name );
|
|
169
|
+
onSelect={ ( name, variationName ) => {
|
|
170
|
+
onBlockTransform( name, variationName );
|
|
171
171
|
onClose();
|
|
172
172
|
} }
|
|
173
173
|
onSelectVariation={ ( name ) => {
|
|
@@ -19,6 +19,7 @@ import useBlockDisplayTitle from '../block-title/use-block-display-title';
|
|
|
19
19
|
import { store as blockEditorStore } from '../../store';
|
|
20
20
|
import { hasPatternOverridesDefaultBinding } from '../../utils/block-bindings';
|
|
21
21
|
import { unlock } from '../../lock-unlock';
|
|
22
|
+
import { isIsolatedEditorKey } from '../../store/private-keys';
|
|
22
23
|
|
|
23
24
|
function getBlockIconVariant( { select, clientIds } ) {
|
|
24
25
|
const {
|
|
@@ -29,8 +30,11 @@ function getBlockIconVariant( { select, clientIds } ) {
|
|
|
29
30
|
getTemplateLock,
|
|
30
31
|
getBlockEditingMode,
|
|
31
32
|
canEditBlock,
|
|
33
|
+
isWithinEditedContentOnlySection,
|
|
34
|
+
getSettings,
|
|
32
35
|
} = unlock( select( blockEditorStore ) );
|
|
33
36
|
const { getBlockStyles } = select( blocksStore );
|
|
37
|
+
const isIsolatedEditor = !! getSettings()?.[ isIsolatedEditorKey ];
|
|
34
38
|
|
|
35
39
|
const hasTemplateLock = clientIds.some(
|
|
36
40
|
( id ) => getTemplateLock( id ) === 'contentOnly'
|
|
@@ -42,7 +46,10 @@ function getBlockIconVariant( { select, clientIds } ) {
|
|
|
42
46
|
const hasBlockStyles =
|
|
43
47
|
isSingleBlock && !! getBlockStyles( blockName )?.length;
|
|
44
48
|
const hasPatternNameInSelection = clientIds.some(
|
|
45
|
-
( id ) =>
|
|
49
|
+
( id ) =>
|
|
50
|
+
!! getBlockAttributes( id )?.metadata?.patternName &&
|
|
51
|
+
! isWithinEditedContentOnlySection( id ) &&
|
|
52
|
+
! isIsolatedEditor
|
|
46
53
|
);
|
|
47
54
|
const hasPatternOverrides = clientIds.every( ( clientId ) =>
|
|
48
55
|
hasPatternOverridesDefaultBinding(
|
|
@@ -86,20 +93,29 @@ function getBlockIconVariant( { select, clientIds } ) {
|
|
|
86
93
|
}
|
|
87
94
|
|
|
88
95
|
function getBlockIcon( { select, clientIds } ) {
|
|
89
|
-
const {
|
|
90
|
-
|
|
91
|
-
|
|
96
|
+
const {
|
|
97
|
+
getBlockName,
|
|
98
|
+
getBlockAttributes,
|
|
99
|
+
isWithinEditedContentOnlySection,
|
|
100
|
+
getSettings,
|
|
101
|
+
} = unlock( select( blockEditorStore ) );
|
|
102
|
+
const isIsolatedEditor = !! getSettings()?.[ isIsolatedEditorKey ];
|
|
92
103
|
|
|
93
104
|
const _isSingleBlock = clientIds.length === 1;
|
|
94
105
|
const firstClientId = clientIds[ 0 ];
|
|
106
|
+
|
|
95
107
|
const blockAttributes = getBlockAttributes( firstClientId );
|
|
96
|
-
if (
|
|
108
|
+
if (
|
|
109
|
+
_isSingleBlock &&
|
|
110
|
+
blockAttributes?.metadata?.patternName &&
|
|
111
|
+
! isWithinEditedContentOnlySection( firstClientId ) &&
|
|
112
|
+
! isIsolatedEditor
|
|
113
|
+
) {
|
|
97
114
|
return symbol;
|
|
98
115
|
}
|
|
99
116
|
|
|
100
117
|
const blockName = getBlockName( firstClientId );
|
|
101
118
|
const blockType = getBlockType( blockName );
|
|
102
|
-
|
|
103
119
|
if ( _isSingleBlock ) {
|
|
104
120
|
const { getActiveBlockVariation } = select( blocksStore );
|
|
105
121
|
const match = getActiveBlockVariation( blockName, blockAttributes );
|
|
@@ -13,11 +13,33 @@ import { paragraph } from '@wordpress/icons';
|
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
15
|
import BlockToolbarIcon from '../block-toolbar-icon';
|
|
16
|
+
import { isIsolatedEditorKey } from '../../../store/private-keys';
|
|
16
17
|
|
|
18
|
+
jest.mock( '@wordpress/blocks', () => {
|
|
19
|
+
const actualImplementation = jest.requireActual( '@wordpress/blocks' );
|
|
20
|
+
return {
|
|
21
|
+
...actualImplementation,
|
|
22
|
+
getBlockType: ( name ) => ( {
|
|
23
|
+
name,
|
|
24
|
+
title: name === 'core/template-part' ? 'Template Part' : 'Group',
|
|
25
|
+
icon: `${ name }-icon`,
|
|
26
|
+
} ),
|
|
27
|
+
};
|
|
28
|
+
} );
|
|
17
29
|
jest.mock( '@wordpress/data/src/components/use-select', () => jest.fn() );
|
|
30
|
+
jest.mock( '../../../lock-unlock', () => ( {
|
|
31
|
+
unlock: ( value ) => ( {
|
|
32
|
+
registerPrivateActions: jest.fn(),
|
|
33
|
+
registerPrivateSelectors: jest.fn(),
|
|
34
|
+
...value,
|
|
35
|
+
} ),
|
|
36
|
+
} ) );
|
|
18
37
|
jest.mock( '../../block-title/use-block-display-title', () =>
|
|
19
38
|
jest.fn().mockReturnValue( 'Block Name' )
|
|
20
39
|
);
|
|
40
|
+
jest.mock( '../../block-icon', () =>
|
|
41
|
+
jest.fn( ( { icon } ) => <span data-testid="block-icon">{ icon }</span> )
|
|
42
|
+
);
|
|
21
43
|
jest.mock( '../../block-switcher', () =>
|
|
22
44
|
jest.fn( ( { children } ) => (
|
|
23
45
|
<div data-testid="block-switcher">{ children }</div>
|
|
@@ -38,6 +60,34 @@ describe( 'BlockToolbarIcon', () => {
|
|
|
38
60
|
clientIds: [ 'test-client-id' ],
|
|
39
61
|
isSynced: false,
|
|
40
62
|
};
|
|
63
|
+
const setupToolbarSelectors = ( {
|
|
64
|
+
attributes = {
|
|
65
|
+
metadata: {
|
|
66
|
+
patternName: 'theme/hero',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
blockName = 'core/group',
|
|
70
|
+
getActiveBlockVariation = () => null,
|
|
71
|
+
settings = {},
|
|
72
|
+
isWithinEditedSection = false,
|
|
73
|
+
} = {} ) => {
|
|
74
|
+
useSelect.mockImplementation( ( mapSelect ) =>
|
|
75
|
+
mapSelect( () => ( {
|
|
76
|
+
get: () => false,
|
|
77
|
+
getBlockName: () => blockName,
|
|
78
|
+
getBlockAttributes: () => attributes,
|
|
79
|
+
getSettings: () => settings,
|
|
80
|
+
getBlockParentsByBlockName: () => [],
|
|
81
|
+
canRemoveBlocks: () => true,
|
|
82
|
+
getTemplateLock: () => undefined,
|
|
83
|
+
getBlockEditingMode: () => 'default',
|
|
84
|
+
canEditBlock: () => true,
|
|
85
|
+
getBlockStyles: () => [ {} ],
|
|
86
|
+
getActiveBlockVariation,
|
|
87
|
+
isWithinEditedContentOnlySection: () => isWithinEditedSection,
|
|
88
|
+
} ) )
|
|
89
|
+
);
|
|
90
|
+
};
|
|
41
91
|
|
|
42
92
|
beforeEach( () => {
|
|
43
93
|
jest.clearAllMocks();
|
|
@@ -144,6 +194,55 @@ describe( 'BlockToolbarIcon', () => {
|
|
|
144
194
|
} );
|
|
145
195
|
} );
|
|
146
196
|
|
|
197
|
+
describe( 'pattern sections', () => {
|
|
198
|
+
it( 'should not show the block switcher before the section is being edited', () => {
|
|
199
|
+
setupToolbarSelectors();
|
|
200
|
+
|
|
201
|
+
render( <BlockToolbarIcon { ...defaultProps } /> );
|
|
202
|
+
|
|
203
|
+
expect(
|
|
204
|
+
screen.queryByTestId( 'block-switcher' )
|
|
205
|
+
).not.toBeInTheDocument();
|
|
206
|
+
expect( screen.getByRole( 'button' ) ).toHaveAttribute(
|
|
207
|
+
'aria-disabled',
|
|
208
|
+
'true'
|
|
209
|
+
);
|
|
210
|
+
} );
|
|
211
|
+
|
|
212
|
+
it( 'should show the block switcher when the section is being edited', () => {
|
|
213
|
+
setupToolbarSelectors( { isWithinEditedSection: true } );
|
|
214
|
+
|
|
215
|
+
render( <BlockToolbarIcon { ...defaultProps } /> );
|
|
216
|
+
|
|
217
|
+
expect(
|
|
218
|
+
screen.getByTestId( 'block-switcher' )
|
|
219
|
+
).toBeInTheDocument();
|
|
220
|
+
} );
|
|
221
|
+
|
|
222
|
+
it( 'should show the block icon for pattern wrappers in isolated editors', () => {
|
|
223
|
+
setupToolbarSelectors( {
|
|
224
|
+
attributes: {
|
|
225
|
+
metadata: {
|
|
226
|
+
name: 'Header',
|
|
227
|
+
patternName: 'theme/header-wrapper',
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
settings: {
|
|
231
|
+
[ isIsolatedEditorKey ]: true,
|
|
232
|
+
},
|
|
233
|
+
} );
|
|
234
|
+
|
|
235
|
+
render( <BlockToolbarIcon { ...defaultProps } /> );
|
|
236
|
+
|
|
237
|
+
expect(
|
|
238
|
+
screen.getByTestId( 'block-switcher' )
|
|
239
|
+
).toBeInTheDocument();
|
|
240
|
+
expect( screen.getByTestId( 'block-icon' ) ).toHaveTextContent(
|
|
241
|
+
'core/group-icon'
|
|
242
|
+
);
|
|
243
|
+
} );
|
|
244
|
+
} );
|
|
245
|
+
|
|
147
246
|
describe( 'label calculation', () => {
|
|
148
247
|
it( 'should use block title for single block', () => {
|
|
149
248
|
useSelect.mockImplementation( () => ( {
|
|
@@ -157,7 +157,13 @@ export default function useBlockToolbarPopoverProps( {
|
|
|
157
157
|
isSticky
|
|
158
158
|
)
|
|
159
159
|
),
|
|
160
|
-
[
|
|
160
|
+
[
|
|
161
|
+
contentElement,
|
|
162
|
+
selectedBlockElement,
|
|
163
|
+
scrollContainer,
|
|
164
|
+
toolbarHeight,
|
|
165
|
+
isSticky,
|
|
166
|
+
]
|
|
161
167
|
);
|
|
162
168
|
|
|
163
169
|
// Update props when the block is moved. This also ensures the props are
|
|
@@ -173,18 +179,18 @@ export default function useBlockToolbarPopoverProps( {
|
|
|
173
179
|
|
|
174
180
|
// Update the toolbar props on viewport resize.
|
|
175
181
|
const contentView = contentElement?.ownerDocument?.defaultView;
|
|
176
|
-
contentView?.
|
|
182
|
+
contentView?.addEventListener?.( 'resize', updateProps );
|
|
177
183
|
|
|
178
184
|
// Update the toolbar props on block resize.
|
|
179
185
|
let resizeObserver;
|
|
180
186
|
const blockView = selectedBlockElement?.ownerDocument?.defaultView;
|
|
181
|
-
if ( blockView
|
|
187
|
+
if ( blockView?.ResizeObserver ) {
|
|
182
188
|
resizeObserver = new blockView.ResizeObserver( updateProps );
|
|
183
189
|
resizeObserver.observe( selectedBlockElement );
|
|
184
190
|
}
|
|
185
191
|
|
|
186
192
|
return () => {
|
|
187
|
-
contentView?.
|
|
193
|
+
contentView?.removeEventListener?.( 'resize', updateProps );
|
|
188
194
|
|
|
189
195
|
if ( resizeObserver ) {
|
|
190
196
|
resizeObserver.disconnect();
|
|
@@ -30,25 +30,6 @@ The blocks that will be displayed in the block list.
|
|
|
30
30
|
|
|
31
31
|
- Type: `Array<Block>`
|
|
32
32
|
- Required: Yes
|
|
33
|
-
- Platform: Web | Mobile
|
|
34
|
-
|
|
35
|
-
#### name
|
|
36
|
-
|
|
37
|
-
Name of the list to be used as part of component's key.
|
|
38
|
-
|
|
39
|
-
- Type: `String`
|
|
40
|
-
- Required: Yes
|
|
41
|
-
- Platform: Mobile
|
|
42
|
-
|
|
43
|
-
#### listProps
|
|
44
|
-
|
|
45
|
-
Extra `FlatList` props for customizing the list.
|
|
46
|
-
|
|
47
|
-
On Mobile usually this component is rendered inside `BottomSheet` component, which already [generates these props](<(https://github.com/WordPress/gutenberg/blob/1ca1fe0c64dfe1a385221399fc94b0fb14f34199/packages/components/src/mobile/bottom-sheet/index.native.js#L355-L372)>) for this component.
|
|
48
|
-
|
|
49
|
-
- Type: `String`
|
|
50
|
-
- Required: No
|
|
51
|
-
- Platform: Mobile
|
|
52
33
|
|
|
53
34
|
## Related components
|
|
54
35
|
|
|
@@ -16,6 +16,7 @@ exports[`BlockVerticalAlignmentUI should match snapshot when controls are hidden
|
|
|
16
16
|
>
|
|
17
17
|
<svg
|
|
18
18
|
aria-hidden="true"
|
|
19
|
+
fill="currentColor"
|
|
19
20
|
focusable="false"
|
|
20
21
|
height="24"
|
|
21
22
|
viewBox="0 0 24 24"
|
|
@@ -48,6 +49,7 @@ exports[`BlockVerticalAlignmentUI should match snapshot when controls are visibl
|
|
|
48
49
|
>
|
|
49
50
|
<svg
|
|
50
51
|
aria-hidden="true"
|
|
52
|
+
fill="currentColor"
|
|
51
53
|
focusable="false"
|
|
52
54
|
height="24"
|
|
53
55
|
viewBox="0 0 24 24"
|
|
@@ -70,6 +72,7 @@ exports[`BlockVerticalAlignmentUI should match snapshot when controls are visibl
|
|
|
70
72
|
>
|
|
71
73
|
<svg
|
|
72
74
|
aria-hidden="true"
|
|
75
|
+
fill="currentColor"
|
|
73
76
|
focusable="false"
|
|
74
77
|
height="24"
|
|
75
78
|
viewBox="0 0 24 24"
|
|
@@ -92,6 +95,7 @@ exports[`BlockVerticalAlignmentUI should match snapshot when controls are visibl
|
|
|
92
95
|
>
|
|
93
96
|
<svg
|
|
94
97
|
aria-hidden="true"
|
|
98
|
+
fill="currentColor"
|
|
95
99
|
focusable="false"
|
|
96
100
|
height="24"
|
|
97
101
|
viewBox="0 0 24 24"
|
|
@@ -23,15 +23,51 @@ import { useGetNumberOfBlocksBeforeCell } from '../grid/use-get-number-of-blocks
|
|
|
23
23
|
import { store as blockEditorStore } from '../../store';
|
|
24
24
|
import { useSettings } from '../use-settings';
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
// These are the serialized `selfStretch` values. `max` used to be called
|
|
27
|
+
// "Fixed" in the UI, but was renamed and replaced by `fixedNoShrink`.
|
|
28
|
+
const FLEX_CHILD_LAYOUT_VALUES = {
|
|
29
|
+
fit: 'fit',
|
|
30
|
+
grow: 'fill',
|
|
31
|
+
max: 'fixed',
|
|
32
|
+
fixed: 'fixedNoShrink',
|
|
33
|
+
};
|
|
28
34
|
|
|
29
|
-
|
|
35
|
+
const FLEX_SIZE_VALUES = [
|
|
36
|
+
FLEX_CHILD_LAYOUT_VALUES.max,
|
|
37
|
+
FLEX_CHILD_LAYOUT_VALUES.fixed,
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
function isFlexSizeValue( value ) {
|
|
41
|
+
return FLEX_SIZE_VALUES.includes( value );
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function maxSizeLabel( parentLayout ) {
|
|
45
|
+
const { orientation = 'horizontal' } = parentLayout ?? {};
|
|
46
|
+
return orientation === 'horizontal'
|
|
47
|
+
? _x( 'Max', 'Block with maximum width in flex layout' )
|
|
48
|
+
: _x( 'Max', 'Block with maximum height in flex layout' );
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function helpText( flexControlValue, parentLayout ) {
|
|
52
|
+
const { orientation = 'horizontal' } = parentLayout ?? {};
|
|
53
|
+
|
|
54
|
+
if ( flexControlValue === FLEX_CHILD_LAYOUT_VALUES.grow ) {
|
|
30
55
|
return __( 'Stretch to fill available space.' );
|
|
31
56
|
}
|
|
32
|
-
if (
|
|
57
|
+
if (
|
|
58
|
+
flexControlValue === FLEX_CHILD_LAYOUT_VALUES.max &&
|
|
59
|
+
orientation === 'horizontal'
|
|
60
|
+
) {
|
|
61
|
+
return __( 'Specify a maximum width.' );
|
|
62
|
+
} else if ( flexControlValue === FLEX_CHILD_LAYOUT_VALUES.max ) {
|
|
63
|
+
return __( 'Specify a maximum height.' );
|
|
64
|
+
}
|
|
65
|
+
if (
|
|
66
|
+
flexControlValue === FLEX_CHILD_LAYOUT_VALUES.fixed &&
|
|
67
|
+
orientation === 'horizontal'
|
|
68
|
+
) {
|
|
33
69
|
return __( 'Specify a fixed width.' );
|
|
34
|
-
} else if (
|
|
70
|
+
} else if ( flexControlValue === FLEX_CHILD_LAYOUT_VALUES.fixed ) {
|
|
35
71
|
return __( 'Specify a fixed height.' );
|
|
36
72
|
}
|
|
37
73
|
return __( 'Fit contents.' );
|
|
@@ -99,6 +135,8 @@ function FlexControls( {
|
|
|
99
135
|
} ) {
|
|
100
136
|
const { selfStretch, flexSize } = childLayout;
|
|
101
137
|
const { orientation = 'horizontal' } = parentLayout ?? {};
|
|
138
|
+
const flexControlValue = selfStretch || FLEX_CHILD_LAYOUT_VALUES.fit;
|
|
139
|
+
const hasFlexSizeValue = isFlexSizeValue( flexControlValue );
|
|
102
140
|
const hasFlexValue = () => !! selfStretch;
|
|
103
141
|
const flexResetLabel =
|
|
104
142
|
orientation === 'horizontal' ? __( 'Width' ) : __( 'Height' );
|
|
@@ -121,13 +159,13 @@ function FlexControls( {
|
|
|
121
159
|
};
|
|
122
160
|
|
|
123
161
|
useEffect( () => {
|
|
124
|
-
if ( selfStretch
|
|
162
|
+
if ( isFlexSizeValue( selfStretch ) && ! flexSize ) {
|
|
125
163
|
onChange( {
|
|
126
164
|
...childLayout,
|
|
127
|
-
selfStretch:
|
|
165
|
+
selfStretch: FLEX_CHILD_LAYOUT_VALUES.fit,
|
|
128
166
|
} );
|
|
129
167
|
}
|
|
130
|
-
}, [] );
|
|
168
|
+
}, [] ); // eslint-disable-line react-hooks/exhaustive-deps
|
|
131
169
|
|
|
132
170
|
return (
|
|
133
171
|
<VStack
|
|
@@ -142,10 +180,12 @@ function FlexControls( {
|
|
|
142
180
|
<ToggleGroupControl
|
|
143
181
|
size="__unstable-large"
|
|
144
182
|
label={ childLayoutOrientation( parentLayout ) }
|
|
145
|
-
value={
|
|
146
|
-
help={ helpText(
|
|
183
|
+
value={ flexControlValue }
|
|
184
|
+
help={ helpText( flexControlValue, parentLayout ) }
|
|
147
185
|
onChange={ ( value ) => {
|
|
148
|
-
const newFlexSize = value
|
|
186
|
+
const newFlexSize = isFlexSizeValue( value )
|
|
187
|
+
? flexSize
|
|
188
|
+
: null;
|
|
149
189
|
onChange( {
|
|
150
190
|
selfStretch: value,
|
|
151
191
|
flexSize: newFlexSize,
|
|
@@ -154,37 +194,42 @@ function FlexControls( {
|
|
|
154
194
|
isBlock
|
|
155
195
|
>
|
|
156
196
|
<ToggleGroupControlOption
|
|
157
|
-
key=
|
|
158
|
-
value=
|
|
197
|
+
key={ FLEX_CHILD_LAYOUT_VALUES.fit }
|
|
198
|
+
value={ FLEX_CHILD_LAYOUT_VALUES.fit }
|
|
159
199
|
label={ _x(
|
|
160
200
|
'Fit',
|
|
161
201
|
'Intrinsic block width in flex layout'
|
|
162
202
|
) }
|
|
163
203
|
/>
|
|
164
204
|
<ToggleGroupControlOption
|
|
165
|
-
key=
|
|
166
|
-
value=
|
|
205
|
+
key={ FLEX_CHILD_LAYOUT_VALUES.grow }
|
|
206
|
+
value={ FLEX_CHILD_LAYOUT_VALUES.grow }
|
|
167
207
|
label={ _x(
|
|
168
208
|
'Grow',
|
|
169
209
|
'Block with expanding width in flex layout'
|
|
170
210
|
) }
|
|
171
211
|
/>
|
|
172
212
|
<ToggleGroupControlOption
|
|
173
|
-
key=
|
|
174
|
-
value=
|
|
213
|
+
key={ FLEX_CHILD_LAYOUT_VALUES.max }
|
|
214
|
+
value={ FLEX_CHILD_LAYOUT_VALUES.max }
|
|
215
|
+
label={ maxSizeLabel( parentLayout ) }
|
|
216
|
+
/>
|
|
217
|
+
<ToggleGroupControlOption
|
|
218
|
+
key={ FLEX_CHILD_LAYOUT_VALUES.fixed }
|
|
219
|
+
value={ FLEX_CHILD_LAYOUT_VALUES.fixed }
|
|
175
220
|
label={ _x(
|
|
176
221
|
'Fixed',
|
|
177
222
|
'Block with fixed width in flex layout'
|
|
178
223
|
) }
|
|
179
224
|
/>
|
|
180
225
|
</ToggleGroupControl>
|
|
181
|
-
{
|
|
226
|
+
{ hasFlexSizeValue && (
|
|
182
227
|
<UnitControl
|
|
183
228
|
size="__unstable-large"
|
|
184
229
|
units={ units }
|
|
185
230
|
onChange={ ( value ) => {
|
|
186
231
|
onChange( {
|
|
187
|
-
selfStretch,
|
|
232
|
+
selfStretch: flexControlValue,
|
|
188
233
|
flexSize: value,
|
|
189
234
|
} );
|
|
190
235
|
} }
|
|
@@ -199,7 +244,7 @@ function FlexControls( {
|
|
|
199
244
|
}
|
|
200
245
|
|
|
201
246
|
export function childLayoutOrientation( parentLayout ) {
|
|
202
|
-
const { orientation = 'horizontal' } = parentLayout;
|
|
247
|
+
const { orientation = 'horizontal' } = parentLayout ?? {};
|
|
203
248
|
return orientation === 'horizontal' ? __( 'Width' ) : __( 'Height' );
|
|
204
249
|
}
|
|
205
250
|
|