@wordpress/block-editor 17.1.0 → 17.2.1-next.v.202609171837.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 +32 -0
- package/README.md +214 -214
- package/build/autocompleters/block.cjs.map +2 -2
- package/build/components/alignment-control/ui.cjs.map +2 -2
- package/build/components/background-image-control/index.cjs +1 -1
- package/build/components/background-image-control/index.cjs.map +2 -2
- package/build/components/block-alignment-control/ui.cjs +21 -7
- package/build/components/block-alignment-control/ui.cjs.map +3 -3
- package/build/components/block-alignment-control/use-available-alignments.cjs +60 -13
- package/build/components/block-alignment-control/use-available-alignments.cjs.map +2 -2
- package/build/components/block-allowed-blocks/allowed-blocks-control.cjs.map +2 -2
- package/build/components/block-bindings/attribute-control.cjs +30 -30
- package/build/components/block-bindings/attribute-control.cjs.map +3 -3
- package/build/components/block-bindings/source-fields-list.cjs +27 -32
- package/build/components/block-bindings/source-fields-list.cjs.map +3 -3
- package/build/components/block-canvas/index.cjs.map +2 -2
- package/build/components/block-card/index.cjs +1 -2
- package/build/components/block-card/index.cjs.map +3 -3
- package/build/components/block-edit/edit.cjs.map +2 -2
- package/build/components/block-heading-level-dropdown/index.cjs.map +2 -2
- package/build/components/block-icon/index.cjs.map +2 -2
- package/build/components/block-inspector/edit-contents.cjs.map +2 -2
- package/build/components/block-inspector/index.cjs +27 -8
- package/build/components/block-inspector/index.cjs.map +3 -3
- package/build/components/block-keyboard-shortcuts/index.cjs.map +2 -2
- package/build/components/block-list/block-html.cjs +1 -12
- package/build/components/block-list/block-html.cjs.map +3 -3
- package/build/components/block-list/block.cjs +2 -4
- package/build/components/block-list/block.cjs.map +2 -2
- package/build/components/block-list/layout.cjs +1 -1
- package/build/components/block-list/layout.cjs.map +2 -2
- package/build/components/block-list/use-block-props/index.cjs.map +2 -2
- package/build/components/block-lock/modal.cjs +1 -3
- package/build/components/block-lock/modal.cjs.map +2 -2
- package/build/components/block-parent-selector/index.cjs +8 -5
- package/build/components/block-parent-selector/index.cjs.map +2 -2
- package/build/components/block-popover/index.cjs.map +2 -2
- package/build/components/block-rename/modal.cjs.map +2 -2
- package/build/components/block-settings-menu/block-settings-dropdown.cjs.map +2 -2
- package/build/components/block-styles/utils.cjs.map +2 -2
- package/build/components/block-switcher/index.cjs.map +2 -2
- package/build/components/block-toolbar/edit-section-button.cjs.map +2 -2
- package/build/components/block-toolbar/index.cjs +6 -4
- package/build/components/block-toolbar/index.cjs.map +2 -2
- package/build/components/block-toolbar/switch-section-style.cjs.map +2 -2
- package/build/components/block-variation-transforms/index.cjs +28 -18
- package/build/components/block-variation-transforms/index.cjs.map +3 -3
- package/build/components/block-visibility/modal.cjs.map +2 -2
- package/build/components/block-visibility/viewport-visibility-info.cjs.map +2 -2
- package/build/components/border-radius-control/index.cjs.map +2 -2
- package/build/components/color-palette/with-color-context.cjs.map +2 -2
- package/build/components/colors/with-colors.cjs.map +2 -2
- package/build/components/colors-gradients/control.cjs.map +2 -2
- package/build/components/contrast-checker/index.cjs.map +2 -2
- package/build/components/date-format-picker/index.cjs.map +2 -2
- package/build/components/dimensions-tool/aspect-ratio-tool.cjs.map +3 -3
- package/build/components/dimensions-tool/width-height-tool.cjs.map +2 -2
- package/build/components/font-sizes/with-font-sizes.cjs.map +2 -2
- package/build/components/global-styles/background-panel.cjs +1 -1
- package/build/components/global-styles/background-panel.cjs.map +2 -2
- package/build/components/global-styles/border-panel.cjs +1 -1
- package/build/components/global-styles/border-panel.cjs.map +2 -2
- package/build/components/global-styles/color-gradient-dropdown-item.cjs +1 -1
- package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +2 -2
- package/build/components/global-styles/color-panel.cjs +1 -1
- package/build/components/global-styles/color-panel.cjs.map +2 -2
- package/build/components/global-styles/dimensions-panel.cjs +1 -1
- package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
- package/build/components/global-styles/filters-panel.cjs +1 -1
- package/build/components/global-styles/filters-panel.cjs.map +2 -2
- package/build/components/global-styles/hooks.cjs +1 -0
- package/build/components/global-styles/hooks.cjs.map +2 -2
- package/build/components/global-styles/inheritance/index.cjs +3 -3
- package/build/components/global-styles/inheritance/index.cjs.map +2 -2
- package/build/components/global-styles/inherited-value-context.cjs +0 -5
- package/build/components/global-styles/inherited-value-context.cjs.map +2 -2
- package/build/components/global-styles/state-control-badges.cjs +0 -1
- package/build/components/global-styles/state-control-badges.cjs.map +2 -2
- package/build/components/global-styles/state-control.cjs +6 -4
- package/build/components/global-styles/state-control.cjs.map +2 -2
- package/build/components/global-styles/text-shadow-panel.cjs +254 -0
- package/build/components/global-styles/text-shadow-panel.cjs.map +7 -0
- package/build/components/global-styles/typography-panel.cjs +46 -5
- package/build/components/global-styles/typography-panel.cjs.map +2 -2
- package/build/components/global-styles/typography-utils.cjs.map +2 -2
- package/build/components/global-styles/utils.cjs.map +2 -2
- package/build/components/html-element-control/index.cjs.map +3 -3
- package/build/components/iframe/index.cjs.map +2 -2
- package/build/components/iframe/use-scale-canvas.cjs.map +2 -2
- package/build/components/image-size-control/index.cjs.map +3 -3
- package/build/components/inner-blocks/index.cjs +6 -1
- package/build/components/inner-blocks/index.cjs.map +2 -2
- package/build/components/inner-content/index.cjs.map +2 -2
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.cjs +4 -23
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.cjs.map +2 -2
- package/build/components/inserter/block-patterns-tab/utils.cjs +26 -0
- package/build/components/inserter/block-patterns-tab/utils.cjs.map +2 -2
- package/build/components/inserter/hooks/use-block-types-state.cjs.map +2 -2
- package/build/components/inserter/hooks/use-insertion-point.cjs.map +2 -2
- package/build/components/inserter/hooks/use-patterns-state.cjs.map +2 -2
- package/build/components/inserter/media-tab/media-panel.cjs.map +2 -2
- package/build/components/inserter/media-tab/media-preview.cjs.map +2 -2
- package/build/components/inserter-list-item/index.cjs.map +2 -2
- package/build/components/inspector-controls/list-view-content-popover.cjs.map +2 -2
- package/build/components/link-control/search-results.cjs.map +2 -2
- package/build/components/link-control/use-search-handler.cjs +3 -0
- package/build/components/link-control/use-search-handler.cjs.map +2 -2
- package/build/components/list-view/branch.cjs.map +2 -2
- package/build/components/list-view/drop-indicator.cjs.map +2 -2
- package/build/components/list-view/index.cjs.map +2 -2
- package/build/components/list-view/use-list-view-drop-zone.cjs.map +2 -2
- package/build/components/list-view/utils.cjs.map +2 -2
- package/build/components/media-replace-flow/index.cjs +4 -1
- package/build/components/media-replace-flow/index.cjs.map +2 -2
- package/build/components/plain-text/index.cjs +1 -2
- package/build/components/plain-text/index.cjs.map +3 -3
- package/build/components/preset-input-control/index.cjs.map +2 -2
- package/build/components/provider/index.cjs +3 -1
- package/build/components/provider/index.cjs.map +2 -2
- package/build/components/provider/use-block-sync.cjs.map +2 -2
- package/build/components/publish-date-time-picker/index.cjs.map +2 -2
- package/build/components/resizable-box-popover/index.cjs +1 -1
- package/build/components/resizable-box-popover/index.cjs.map +1 -1
- package/build/components/resolution-tool/index.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/enter.cjs +8 -22
- package/build/components/rich-text/event-listeners/enter.cjs.map +2 -2
- package/build/components/rich-text/format-edit.cjs.map +2 -2
- package/build/components/rich-text/index.cjs +20 -0
- package/build/components/rich-text/index.cjs.map +2 -2
- package/build/components/rich-text/multiline.cjs +10 -2
- package/build/components/rich-text/multiline.cjs.map +2 -2
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.cjs.map +2 -2
- package/build/components/typewriter/index.cjs.map +2 -2
- package/build/components/use-block-commands/index.cjs.map +2 -2
- package/build/components/writing-flow/index.cjs +3 -0
- package/build/components/writing-flow/index.cjs.map +2 -2
- package/build/components/writing-flow/use-clipboard-handler.cjs.map +2 -2
- package/build/components/writing-flow/use-selection-observer.cjs +5 -3
- package/build/components/writing-flow/use-selection-observer.cjs.map +2 -2
- package/build/hooks/align.cjs +3 -5
- package/build/hooks/align.cjs.map +2 -2
- package/build/hooks/background.cjs.map +2 -2
- package/build/hooks/block-bindings.cjs.map +2 -2
- package/build/hooks/border.cjs.map +2 -2
- package/build/hooks/contrast-checker.cjs.map +2 -2
- package/build/hooks/dimensions.cjs.map +2 -2
- package/build/hooks/duotone.cjs.map +2 -2
- package/build/hooks/elements.cjs.map +2 -2
- package/build/hooks/fit-text.cjs.map +2 -2
- package/build/hooks/gap.cjs +2 -1
- package/build/hooks/gap.cjs.map +3 -3
- package/build/hooks/index.cjs +4 -2
- package/build/hooks/index.cjs.map +3 -3
- package/build/hooks/layout-child.cjs.map +2 -2
- package/build/hooks/layout.cjs +15 -14
- package/build/hooks/layout.cjs.map +3 -3
- package/build/hooks/position.cjs +3 -31
- package/build/hooks/position.cjs.map +2 -2
- package/build/hooks/states.cjs +3 -2
- package/build/hooks/states.cjs.map +2 -2
- package/build/hooks/text-shadow.cjs +100 -0
- package/build/hooks/text-shadow.cjs.map +7 -0
- package/build/hooks/typography.cjs +30 -6
- package/build/hooks/typography.cjs.map +2 -2
- package/build/hooks/utils.cjs +24 -2
- package/build/hooks/utils.cjs.map +2 -2
- package/build/layouts/grid.cjs.map +2 -2
- package/build/layouts/utils.cjs +7 -2
- package/build/layouts/utils.cjs.map +2 -2
- package/build/private-apis.cjs +9 -6
- package/build/private-apis.cjs.map +2 -2
- package/build/store/actions.cjs +26 -4
- package/build/store/actions.cjs.map +3 -3
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs.map +2 -2
- package/build/utils/get-font-styles-and-weights.cjs.map +2 -2
- package/build/utils/transform-styles/index.cjs.map +1 -1
- package/build-module/autocompleters/block.mjs.map +2 -2
- package/build-module/components/alignment-control/ui.mjs.map +2 -2
- package/build-module/components/background-image-control/index.mjs +2 -2
- package/build-module/components/background-image-control/index.mjs.map +2 -2
- package/build-module/components/block-alignment-control/ui.mjs +21 -7
- package/build-module/components/block-alignment-control/ui.mjs.map +2 -2
- package/build-module/components/block-alignment-control/use-available-alignments.mjs +56 -13
- package/build-module/components/block-alignment-control/use-available-alignments.mjs.map +2 -2
- package/build-module/components/block-allowed-blocks/allowed-blocks-control.mjs.map +2 -2
- package/build-module/components/block-bindings/attribute-control.mjs +31 -32
- package/build-module/components/block-bindings/attribute-control.mjs.map +2 -2
- package/build-module/components/block-bindings/source-fields-list.mjs +25 -30
- package/build-module/components/block-bindings/source-fields-list.mjs.map +2 -2
- package/build-module/components/block-canvas/index.mjs.map +2 -2
- package/build-module/components/block-card/index.mjs +3 -8
- package/build-module/components/block-card/index.mjs.map +2 -2
- package/build-module/components/block-edit/edit.mjs.map +2 -2
- package/build-module/components/block-heading-level-dropdown/index.mjs.map +2 -2
- package/build-module/components/block-icon/index.mjs.map +2 -2
- package/build-module/components/block-inspector/edit-contents.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +29 -10
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-keyboard-shortcuts/index.mjs.map +2 -2
- package/build-module/components/block-list/block-html.mjs +1 -2
- package/build-module/components/block-list/block-html.mjs.map +2 -2
- package/build-module/components/block-list/block.mjs +2 -4
- package/build-module/components/block-list/block.mjs.map +2 -2
- package/build-module/components/block-list/layout.mjs +1 -1
- package/build-module/components/block-list/layout.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
- package/build-module/components/block-lock/modal.mjs +1 -3
- package/build-module/components/block-lock/modal.mjs.map +2 -2
- package/build-module/components/block-parent-selector/index.mjs +8 -5
- package/build-module/components/block-parent-selector/index.mjs.map +2 -2
- package/build-module/components/block-popover/index.mjs.map +2 -2
- package/build-module/components/block-rename/modal.mjs.map +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.mjs.map +2 -2
- package/build-module/components/block-styles/utils.mjs.map +2 -2
- package/build-module/components/block-switcher/index.mjs.map +2 -2
- package/build-module/components/block-toolbar/edit-section-button.mjs.map +2 -2
- package/build-module/components/block-toolbar/index.mjs +6 -4
- package/build-module/components/block-toolbar/index.mjs.map +2 -2
- package/build-module/components/block-toolbar/switch-section-style.mjs.map +2 -2
- package/build-module/components/block-variation-transforms/index.mjs +30 -21
- package/build-module/components/block-variation-transforms/index.mjs.map +2 -2
- package/build-module/components/block-visibility/modal.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +2 -2
- package/build-module/components/border-radius-control/index.mjs.map +2 -2
- package/build-module/components/color-palette/with-color-context.mjs.map +2 -2
- package/build-module/components/colors/with-colors.mjs.map +2 -2
- package/build-module/components/colors-gradients/control.mjs.map +2 -2
- package/build-module/components/contrast-checker/index.mjs.map +2 -2
- package/build-module/components/date-format-picker/index.mjs.map +2 -2
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs +2 -2
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs.map +2 -2
- package/build-module/components/dimensions-tool/width-height-tool.mjs.map +2 -2
- package/build-module/components/font-sizes/with-font-sizes.mjs.map +2 -2
- package/build-module/components/global-styles/background-panel.mjs +2 -2
- package/build-module/components/global-styles/background-panel.mjs.map +2 -2
- package/build-module/components/global-styles/border-panel.mjs +2 -2
- package/build-module/components/global-styles/border-panel.mjs.map +2 -2
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs +2 -2
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +2 -2
- package/build-module/components/global-styles/color-panel.mjs +2 -2
- package/build-module/components/global-styles/color-panel.mjs.map +2 -2
- package/build-module/components/global-styles/dimensions-panel.mjs +2 -2
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/global-styles/filters-panel.mjs +2 -2
- package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
- package/build-module/components/global-styles/hooks.mjs +1 -0
- package/build-module/components/global-styles/hooks.mjs.map +2 -2
- package/build-module/components/global-styles/inheritance/index.mjs +2 -2
- package/build-module/components/global-styles/inheritance/index.mjs.map +2 -2
- package/build-module/components/global-styles/inherited-value-context.mjs +0 -5
- package/build-module/components/global-styles/inherited-value-context.mjs.map +2 -2
- package/build-module/components/global-styles/state-control-badges.mjs +0 -1
- package/build-module/components/global-styles/state-control-badges.mjs.map +2 -2
- package/build-module/components/global-styles/state-control.mjs +6 -4
- package/build-module/components/global-styles/state-control.mjs.map +2 -2
- package/build-module/components/global-styles/text-shadow-panel.mjs +224 -0
- package/build-module/components/global-styles/text-shadow-panel.mjs.map +7 -0
- package/build-module/components/global-styles/typography-panel.mjs +47 -6
- package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
- package/build-module/components/global-styles/typography-utils.mjs.map +2 -2
- package/build-module/components/global-styles/utils.mjs.map +2 -2
- package/build-module/components/html-element-control/index.mjs +2 -2
- package/build-module/components/html-element-control/index.mjs.map +2 -2
- package/build-module/components/iframe/index.mjs.map +2 -2
- package/build-module/components/iframe/use-scale-canvas.mjs.map +2 -2
- package/build-module/components/image-size-control/index.mjs +2 -2
- package/build-module/components/image-size-control/index.mjs.map +2 -2
- package/build-module/components/inner-blocks/index.mjs +6 -1
- package/build-module/components/inner-blocks/index.mjs.map +2 -2
- package/build-module/components/inner-content/index.mjs.map +2 -2
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.mjs +6 -24
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.mjs.map +2 -2
- package/build-module/components/inserter/block-patterns-tab/utils.mjs +25 -0
- package/build-module/components/inserter/block-patterns-tab/utils.mjs.map +2 -2
- package/build-module/components/inserter/hooks/use-block-types-state.mjs.map +2 -2
- package/build-module/components/inserter/hooks/use-insertion-point.mjs.map +2 -2
- package/build-module/components/inserter/hooks/use-patterns-state.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/media-panel.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/media-preview.mjs.map +2 -2
- package/build-module/components/inserter-list-item/index.mjs.map +2 -2
- package/build-module/components/inspector-controls/list-view-content-popover.mjs.map +2 -2
- package/build-module/components/link-control/search-results.mjs.map +2 -2
- package/build-module/components/link-control/use-search-handler.mjs +3 -0
- package/build-module/components/link-control/use-search-handler.mjs.map +2 -2
- package/build-module/components/list-view/branch.mjs.map +2 -2
- package/build-module/components/list-view/drop-indicator.mjs.map +2 -2
- package/build-module/components/list-view/index.mjs.map +2 -2
- package/build-module/components/list-view/use-list-view-drop-zone.mjs.map +2 -2
- package/build-module/components/list-view/utils.mjs.map +2 -2
- package/build-module/components/media-replace-flow/index.mjs +4 -1
- package/build-module/components/media-replace-flow/index.mjs.map +2 -2
- package/build-module/components/plain-text/index.mjs +1 -2
- package/build-module/components/plain-text/index.mjs.map +2 -2
- package/build-module/components/preset-input-control/index.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +3 -1
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/provider/use-block-sync.mjs.map +2 -2
- package/build-module/components/publish-date-time-picker/index.mjs.map +2 -2
- package/build-module/components/resizable-box-popover/index.mjs +1 -1
- package/build-module/components/resizable-box-popover/index.mjs.map +1 -1
- package/build-module/components/resolution-tool/index.mjs +2 -2
- package/build-module/components/resolution-tool/index.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/enter.mjs +8 -22
- package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
- package/build-module/components/rich-text/format-edit.mjs.map +2 -2
- package/build-module/components/rich-text/index.mjs +21 -0
- package/build-module/components/rich-text/index.mjs.map +2 -2
- package/build-module/components/rich-text/multiline.mjs +11 -3
- package/build-module/components/rich-text/multiline.mjs.map +2 -2
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.mjs.map +2 -2
- package/build-module/components/typewriter/index.mjs.map +2 -2
- package/build-module/components/use-block-commands/index.mjs.map +2 -2
- package/build-module/components/writing-flow/index.mjs +3 -0
- package/build-module/components/writing-flow/index.mjs.map +2 -2
- package/build-module/components/writing-flow/use-clipboard-handler.mjs.map +2 -2
- package/build-module/components/writing-flow/use-selection-observer.mjs +5 -3
- package/build-module/components/writing-flow/use-selection-observer.mjs.map +2 -2
- package/build-module/hooks/align.mjs +6 -6
- package/build-module/hooks/align.mjs.map +2 -2
- package/build-module/hooks/background.mjs.map +2 -2
- package/build-module/hooks/block-bindings.mjs.map +2 -2
- package/build-module/hooks/border.mjs.map +2 -2
- package/build-module/hooks/contrast-checker.mjs.map +2 -2
- package/build-module/hooks/dimensions.mjs.map +2 -2
- package/build-module/hooks/duotone.mjs.map +2 -2
- package/build-module/hooks/elements.mjs.map +2 -2
- package/build-module/hooks/fit-text.mjs.map +2 -2
- package/build-module/hooks/gap.mjs +2 -1
- package/build-module/hooks/gap.mjs.map +2 -2
- package/build-module/hooks/index.mjs +4 -2
- package/build-module/hooks/index.mjs.map +2 -2
- package/build-module/hooks/layout-child.mjs.map +2 -2
- package/build-module/hooks/layout.mjs +6 -5
- package/build-module/hooks/layout.mjs.map +2 -2
- package/build-module/hooks/position.mjs +5 -33
- package/build-module/hooks/position.mjs.map +2 -2
- package/build-module/hooks/states.mjs +3 -2
- package/build-module/hooks/states.mjs.map +2 -2
- package/build-module/hooks/text-shadow.mjs +65 -0
- package/build-module/hooks/text-shadow.mjs.map +7 -0
- package/build-module/hooks/typography.mjs +30 -6
- package/build-module/hooks/typography.mjs.map +2 -2
- package/build-module/hooks/utils.mjs +24 -2
- package/build-module/hooks/utils.mjs.map +2 -2
- package/build-module/layouts/grid.mjs.map +2 -2
- package/build-module/layouts/utils.mjs +5 -1
- package/build-module/layouts/utils.mjs.map +2 -2
- package/build-module/private-apis.mjs +6 -2
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/actions.mjs +28 -5
- package/build-module/store/actions.mjs.map +3 -3
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/get-font-styles-and-weights.mjs.map +2 -2
- package/build-module/utils/transform-styles/index.mjs.map +1 -1
- package/build-style/content-rtl.css +7 -2
- package/build-style/content.css +7 -2
- package/build-style/style-rtl.css +90 -25
- package/build-style/style.css +92 -25
- package/package.json +42 -43
- package/src/autocompleters/block.jsx +4 -4
- package/src/components/alignment-control/ui.jsx +1 -1
- package/src/components/background-image-control/index.jsx +3 -3
- package/src/components/block-alignment-control/test/index.jsdom.test.jsx +267 -0
- package/src/components/block-alignment-control/ui.jsx +47 -9
- package/src/components/block-alignment-control/use-available-alignments.js +106 -20
- package/src/components/block-allowed-blocks/allowed-blocks-control.jsx +1 -1
- package/src/components/block-bindings/attribute-control.jsx +27 -29
- package/src/components/block-bindings/source-fields-list.jsx +22 -32
- package/src/components/block-bindings/test/attribute-control.jsdom.test.jsx +115 -0
- package/src/components/block-canvas/index.jsx +1 -1
- package/src/components/block-card/index.jsx +5 -11
- package/src/components/block-card/style.scss +1 -0
- package/src/components/block-edit/edit.jsx +1 -1
- package/src/components/block-heading-level-dropdown/index.jsx +1 -1
- package/src/components/block-icon/index.jsx +1 -1
- package/src/components/block-icon/test/index.browser.test.jsx +74 -0
- package/src/components/block-inspector/edit-contents.jsx +2 -2
- package/src/components/block-inspector/index.jsx +46 -15
- package/src/components/block-inspector/style.scss +16 -0
- package/src/components/block-keyboard-shortcuts/index.jsx +2 -2
- package/src/components/block-list/block-html.jsx +2 -3
- package/src/components/block-list/block.jsx +7 -5
- package/src/components/block-list/content.scss +3 -2
- package/src/components/block-list/layout.jsx +4 -1
- package/src/components/block-list/test/layout.jsdom.test.js +40 -0
- package/src/components/block-list/use-block-props/index.js +1 -1
- package/src/components/block-lock/modal.jsx +2 -3
- package/src/components/block-lock/style.scss +1 -1
- package/src/components/block-mover/style.scss +0 -13
- package/src/components/block-parent-selector/index.jsx +12 -6
- package/src/components/block-patterns-list/style.scss +1 -1
- package/src/components/block-popover/index.jsx +1 -1
- package/src/components/block-rename/modal.jsx +3 -3
- package/src/components/block-settings-menu/block-settings-dropdown.jsx +1 -1
- package/src/components/block-styles/utils.js +1 -1
- package/src/components/block-switcher/index.jsx +3 -3
- package/src/components/block-toolbar/edit-section-button.jsx +2 -2
- package/src/components/block-toolbar/index.jsx +8 -4
- package/src/components/block-toolbar/switch-section-style.jsx +1 -1
- package/src/components/block-variation-transforms/index.jsx +24 -23
- package/src/components/block-variation-transforms/test/index.jsdom.test.jsx +93 -0
- package/src/components/block-visibility/modal.jsx +7 -7
- package/src/components/block-visibility/style.scss +1 -1
- package/src/components/block-visibility/viewport-visibility-info.jsx +5 -7
- package/src/components/border-radius-control/index.jsx +2 -2
- package/src/components/border-radius-control/test/index.jsdom.test.jsx +0 -22
- package/src/components/border-radius-control/test/select.browser.test.js +30 -0
- package/src/components/color-palette/with-color-context.jsx +1 -1
- package/src/components/colors/with-colors.jsx +1 -1
- package/src/components/colors-gradients/control.jsx +2 -2
- package/src/components/colors-gradients/test/{control.jsdom.test.jsx → control.browser.test.jsx} +6 -9
- package/src/components/contrast-checker/index.jsx +2 -2
- package/src/components/date-format-picker/index.jsx +2 -2
- package/src/components/dimensions-tool/aspect-ratio-tool.jsx +4 -4
- package/src/components/dimensions-tool/test/index.jsdom.test.jsx +17 -11
- package/src/components/dimensions-tool/width-height-tool.jsx +2 -2
- package/src/components/font-sizes/with-font-sizes.jsx +2 -3
- package/src/components/global-styles/background-panel.jsx +2 -2
- package/src/components/global-styles/border-panel.jsx +2 -2
- package/src/components/global-styles/color-gradient-dropdown-item.jsx +3 -3
- package/src/components/global-styles/color-panel.jsx +3 -3
- package/src/components/global-styles/dimensions-panel.jsx +6 -6
- package/src/components/global-styles/filters-panel.jsx +2 -2
- package/src/components/global-styles/hooks.js +1 -0
- package/src/components/global-styles/inheritance/index.jsx +9 -6
- package/src/components/global-styles/inheritance/test/{index.jsdom.test.jsx → index.browser.test.jsx} +34 -28
- package/src/components/global-styles/inherited-value-context.js +1 -9
- package/src/components/global-styles/state-control-badges.jsx +0 -1
- package/src/components/global-styles/state-control.jsx +12 -3
- package/src/components/global-styles/style.scss +68 -0
- package/src/components/global-styles/test/{color-panel.jsdom.test.jsx → color-panel.browser.test.jsx} +53 -54
- package/src/components/global-styles/test/inherited-value-context-core.jsdom.test.js +17 -26
- package/src/components/global-styles/test/{typography-panel-core.jsdom.test.jsx → typography-panel-core.browser.test.jsx} +84 -39
- package/src/components/global-styles/test/{typography-panel.jsdom.test.jsx → typography-panel.browser.test.jsx} +80 -122
- package/src/components/global-styles/text-shadow-panel.tsx +257 -0
- package/src/components/global-styles/typography-panel.jsx +52 -13
- package/src/components/global-styles/typography-utils.js +2 -2
- package/src/components/global-styles/utils.js +1 -1
- package/src/components/html-element-control/index.jsx +2 -2
- package/src/components/iframe/index.jsx +1 -1
- package/src/components/iframe/use-scale-canvas.js +1 -1
- package/src/components/image-size-control/index.jsx +2 -2
- package/src/components/inner-blocks/index.jsx +9 -1
- package/src/components/inner-content/index.jsx +1 -1
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +7 -33
- package/src/components/inserter/block-patterns-tab/utils.js +44 -0
- package/src/components/inserter/hooks/use-block-types-state.js +2 -2
- package/src/components/inserter/hooks/use-insertion-point.js +1 -1
- package/src/components/inserter/hooks/use-patterns-state.js +1 -1
- package/src/components/inserter/media-tab/media-panel.jsx +9 -9
- package/src/components/inserter/media-tab/media-preview.jsx +1 -1
- package/src/components/inserter-list-item/index.jsx +1 -1
- package/src/components/inserter-list-item/style.scss +2 -2
- package/src/components/inspector-controls/list-view-content-popover.jsx +1 -1
- package/src/components/link-control/search-results.jsx +1 -1
- package/src/components/link-control/style.scss +1 -1
- package/src/components/link-control/test/index.jsdom.test.jsx +38 -110
- package/src/components/link-control/test/keyboard-selection.browser.test.js +110 -0
- package/src/components/link-control/use-search-handler.js +8 -3
- package/src/components/list-view/branch.jsx +1 -1
- package/src/components/list-view/drop-indicator.jsx +3 -3
- package/src/components/list-view/index.jsx +1 -1
- package/src/components/list-view/style.scss +1 -9
- package/src/components/list-view/use-list-view-drop-zone.js +1 -1
- package/src/components/list-view/utils.js +1 -1
- package/src/components/media-replace-flow/index.jsx +4 -1
- package/src/components/navigable-toolbar/test/index.browser.test.js +6 -7
- package/src/components/plain-text/README.md +3 -2
- package/src/components/plain-text/content.scss +0 -1
- package/src/components/plain-text/index.jsx +2 -3
- package/src/components/plain-text/style.scss +4 -0
- package/src/components/preset-input-control/index.jsx +2 -2
- package/src/components/preset-input-control/test/index.jsdom.test.jsx +0 -56
- package/src/components/preset-input-control/test/interaction.browser.test.js +63 -0
- package/src/components/provider/index.jsx +5 -3
- package/src/components/provider/use-block-sync.js +5 -5
- package/src/components/publish-date-time-picker/index.jsx +1 -1
- package/src/components/resizable-box-popover/index.jsx +1 -1
- package/src/components/resolution-tool/index.jsx +2 -2
- package/src/components/responsive-block-control/style.scss +1 -2
- package/src/components/responsive-block-control/test/index.jsdom.test.jsx +2 -2
- package/src/components/rich-text/event-listeners/enter.js +16 -23
- package/src/components/rich-text/format-edit.jsx +1 -1
- package/src/components/rich-text/index.jsx +39 -2
- package/src/components/rich-text/multiline.jsx +11 -3
- package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
- package/src/components/spacing-sizes-control/test/index.jsdom.test.jsx +0 -21
- package/src/components/spacing-sizes-control/test/select.browser.test.js +58 -0
- package/src/components/typewriter/index.jsx +1 -1
- package/src/components/url-input/test/fixtures/validated-input-control-deprecation.js +1 -1
- package/src/components/use-block-commands/index.js +1 -1
- package/src/components/use-block-drop-zone/test/index.js +2 -2
- package/src/components/writing-flow/index.jsx +8 -0
- package/src/components/writing-flow/use-clipboard-handler.js +1 -1
- package/src/components/writing-flow/use-selection-observer.js +15 -6
- package/src/content.scss +1 -0
- package/src/hooks/align.jsx +22 -6
- package/src/hooks/background.jsx +1 -1
- package/src/hooks/block-bindings.jsx +1 -1
- package/src/hooks/block-hooks.scss +0 -6
- package/src/hooks/border.jsx +2 -2
- package/src/hooks/contrast-checker.js +1 -1
- package/src/hooks/dimensions.jsx +2 -2
- package/src/hooks/duotone.jsx +3 -3
- package/src/hooks/elements.jsx +3 -3
- package/src/hooks/fit-text.jsx +1 -1
- package/src/hooks/gap.js +2 -4
- package/src/hooks/index.js +3 -1
- package/src/hooks/layout-child.jsx +3 -4
- package/src/hooks/layout.jsx +17 -18
- package/src/hooks/position.jsx +5 -36
- package/src/hooks/states.jsx +6 -2
- package/src/hooks/test/layout.jsdom.test.js +44 -1
- package/src/hooks/text-shadow.ts +105 -0
- package/src/hooks/typography.jsx +58 -30
- package/src/hooks/utils.jsx +23 -1
- package/src/layouts/grid.jsx +2 -2
- package/src/layouts/test/flex.jsdom.test.jsx +4 -3
- package/src/layouts/test/utils.js +48 -1
- package/src/layouts/utils.js +19 -0
- package/src/private-apis.js +4 -0
- package/src/store/actions.js +50 -10
- package/src/store/private-selectors.js +5 -5
- package/src/store/reducer.js +6 -6
- package/src/store/selectors.js +3 -3
- package/src/store/test/actions.jsdom.test.js +60 -0
- package/src/style.scss +1 -0
- package/src/utils/get-font-styles-and-weights.ts +1 -1
- package/src/utils/transform-styles/index.ts +1 -1
- package/build/hooks/cross-origin-isolation.cjs +0 -56
- package/build/hooks/cross-origin-isolation.cjs.map +0 -7
- package/build-module/hooks/cross-origin-isolation.mjs +0 -54
- package/build-module/hooks/cross-origin-isolation.mjs.map +0 -7
- package/src/components/block-icon/test/__snapshots__/index.jsdom.test.jsx.snap +0 -27
- package/src/components/block-icon/test/index.jsdom.test.jsx +0 -67
- package/src/hooks/cross-origin-isolation.js +0 -73
- package/src/hooks/test/cross-origin-isolation.jsdom.test.js +0 -173
|
@@ -5,12 +5,14 @@ import {
|
|
|
5
5
|
store as blocksStore,
|
|
6
6
|
} from '@wordpress/blocks';
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
MenuGroup,
|
|
9
|
+
MenuItem,
|
|
10
10
|
__unstableMotion as motion,
|
|
11
11
|
} from '@wordpress/components';
|
|
12
12
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
13
13
|
import { useRef } from '@wordpress/element';
|
|
14
|
+
import { check } from '@wordpress/icons';
|
|
15
|
+
import { Text } from '@wordpress/ui';
|
|
14
16
|
import EditContents from './edit-contents';
|
|
15
17
|
import SkipToSelectedBlock from '../skip-to-selected-block';
|
|
16
18
|
import BlockCard from '../block-card';
|
|
@@ -193,7 +195,7 @@ function BlockInspector() {
|
|
|
193
195
|
const _renderedBlockClientId = isWithinEditedSection
|
|
194
196
|
? _selectedBlockClientId
|
|
195
197
|
: getParentSectionBlock( _selectedBlockClientId ) ||
|
|
196
|
-
|
|
198
|
+
_selectedBlockClientId;
|
|
197
199
|
const _renderedBlockName =
|
|
198
200
|
_renderedBlockClientId && getBlockName( _renderedBlockClientId );
|
|
199
201
|
const _blockType =
|
|
@@ -419,11 +421,13 @@ const BlockInspectorSingleBlock = ( {
|
|
|
419
421
|
} ) => {
|
|
420
422
|
const listViewRef = useRef( null );
|
|
421
423
|
const hasMultipleTabs = availableTabs?.length > 1;
|
|
422
|
-
const hasPseudoState = hasPseudoBlockStyleState( selectedBlockStyleState );
|
|
423
424
|
const isEditingStyleState =
|
|
424
425
|
( hasViewportBlockStyleState( selectedBlockStyleState ) &&
|
|
425
426
|
isResponsiveEditing ) ||
|
|
426
427
|
hasPseudoBlockStyleState( selectedBlockStyleState );
|
|
428
|
+
// When a style state is active, the badges replace the block description.
|
|
429
|
+
const showStateBadges =
|
|
430
|
+
blockEditingMode === 'default' && isEditingStyleState;
|
|
427
431
|
const hasParentChildBlockCards =
|
|
428
432
|
editedContentOnlySection &&
|
|
429
433
|
editedContentOnlySection !== renderedBlockClientId;
|
|
@@ -458,6 +462,9 @@ const BlockInspectorSingleBlock = ( {
|
|
|
458
462
|
) }
|
|
459
463
|
<BlockCard
|
|
460
464
|
{ ...blockInformation }
|
|
465
|
+
description={
|
|
466
|
+
showStateBadges ? undefined : blockInformation.description
|
|
467
|
+
}
|
|
461
468
|
allowParentNavigation
|
|
462
469
|
className={ isBlockSynced && 'is-synced' }
|
|
463
470
|
isChild={ hasParentChildBlockCards }
|
|
@@ -469,25 +476,49 @@ const BlockInspectorSingleBlock = ( {
|
|
|
469
476
|
name={ blockName }
|
|
470
477
|
value={ selectedBlockStyleState }
|
|
471
478
|
onChange={ onBlockStyleStateChange }
|
|
472
|
-
|
|
479
|
+
>
|
|
480
|
+
<MenuGroup>
|
|
481
|
+
<MenuItem
|
|
482
|
+
role="menuitemcheckbox"
|
|
483
|
+
isSelected={ showStateOnCanvas }
|
|
484
|
+
icon={ showStateOnCanvas ? check : null }
|
|
485
|
+
// Previewing is only meaningful while a
|
|
486
|
+
// non-default pseudo state is selected.
|
|
487
|
+
disabled={
|
|
488
|
+
! hasPseudoBlockStyleState(
|
|
489
|
+
selectedBlockStyleState
|
|
490
|
+
)
|
|
491
|
+
}
|
|
492
|
+
onClick={ () =>
|
|
493
|
+
onShowStateOnCanvasChange(
|
|
494
|
+
! showStateOnCanvas
|
|
495
|
+
)
|
|
496
|
+
}
|
|
497
|
+
>
|
|
498
|
+
{ __( 'Preview on canvas' ) }
|
|
499
|
+
</MenuItem>
|
|
500
|
+
</MenuGroup>
|
|
501
|
+
</BlockStatesControl>
|
|
473
502
|
)
|
|
474
503
|
}
|
|
475
504
|
/>
|
|
476
|
-
{
|
|
477
|
-
<
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
505
|
+
{ showStateBadges && (
|
|
506
|
+
<div className="block-editor-block-inspector__state-badges">
|
|
507
|
+
<Text
|
|
508
|
+
variant="body-sm"
|
|
509
|
+
className="block-editor-block-inspector__state-badges-text"
|
|
510
|
+
>
|
|
511
|
+
{
|
|
512
|
+
/* translators: Instructive text shown before the style state badges in the block inspector; the badges indicate the style states the user is currently editing. */
|
|
513
|
+
__( 'Editing:' )
|
|
514
|
+
}
|
|
515
|
+
</Text>
|
|
485
516
|
<BlockStateBadges
|
|
486
517
|
name={ blockName }
|
|
487
518
|
value={ selectedBlockStyleState }
|
|
488
519
|
isResponsiveEditing={ isResponsiveEditing }
|
|
489
520
|
/>
|
|
490
|
-
</
|
|
521
|
+
</div>
|
|
491
522
|
) }
|
|
492
523
|
<ViewportVisibilityInfo clientId={ renderedBlockClientId } />
|
|
493
524
|
<EditContents clientId={ renderedBlockClientId } />
|
|
@@ -51,6 +51,22 @@
|
|
|
51
51
|
text-align: center;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
// Styles for the style state badges row, shown when a style state is
|
|
55
|
+
// active. The badges replace the block description, so the row is pulled up
|
|
56
|
+
// against the block card to match the description's spacing.
|
|
57
|
+
.block-editor-block-inspector__state-badges {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
flex-wrap: wrap;
|
|
61
|
+
gap: $grid-unit-10;
|
|
62
|
+
padding: $grid-unit-10 $grid-unit-20;
|
|
63
|
+
margin-top: -$grid-unit-20;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.block-editor-block-inspector__state-badges-text {
|
|
67
|
+
white-space: nowrap;
|
|
68
|
+
}
|
|
69
|
+
|
|
54
70
|
.block-editor-block-inspector__no-block-tools {
|
|
55
71
|
border-top: $border-width solid $gray-300;
|
|
56
72
|
}
|
|
@@ -67,7 +67,7 @@ function useApplyBlockShortcut() {
|
|
|
67
67
|
const variation = variationName
|
|
68
68
|
? getBlockVariations( targetBlockName )?.find(
|
|
69
69
|
( { name } ) => name === variationName
|
|
70
|
-
|
|
70
|
+
)
|
|
71
71
|
: undefined;
|
|
72
72
|
|
|
73
73
|
// The block is already of the target type, so there is nothing to
|
|
@@ -111,7 +111,7 @@ function useApplyBlockShortcut() {
|
|
|
111
111
|
...newBlock.attributes,
|
|
112
112
|
...variation.attributes,
|
|
113
113
|
},
|
|
114
|
-
|
|
114
|
+
}
|
|
115
115
|
: newBlock
|
|
116
116
|
);
|
|
117
117
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import TextareaAutosize from 'react-autosize-textarea';
|
|
2
1
|
import { useEffect, useMemo, useState } from '@wordpress/element';
|
|
3
2
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
4
3
|
import {
|
|
@@ -49,7 +48,7 @@ function BlockHTML( { clientId } ) {
|
|
|
49
48
|
...block,
|
|
50
49
|
attributes,
|
|
51
50
|
originalContent: content,
|
|
52
|
-
|
|
51
|
+
} )
|
|
53
52
|
: [ true ];
|
|
54
53
|
|
|
55
54
|
updateBlock( clientId, {
|
|
@@ -69,7 +68,7 @@ function BlockHTML( { clientId } ) {
|
|
|
69
68
|
}, [ blockContent ] );
|
|
70
69
|
|
|
71
70
|
return (
|
|
72
|
-
<
|
|
71
|
+
<textarea
|
|
73
72
|
className="block-editor-block-list__block-html-textarea"
|
|
74
73
|
value={ html }
|
|
75
74
|
onBlur={ onChange }
|
|
@@ -391,12 +391,14 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
|
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
|
|
394
|
+
// The store might have already removed the wrapper if
|
|
395
|
+
// it was unmodified. However, we still want to remove
|
|
396
|
+
// the wrapper unless there is content like a cite.
|
|
397
|
+
const wrapper = getBlock( _clientId );
|
|
394
398
|
if (
|
|
399
|
+
wrapper &&
|
|
395
400
|
! getBlockOrder( _clientId ).length &&
|
|
396
|
-
isUnmodifiedBlock(
|
|
397
|
-
getBlock( _clientId ),
|
|
398
|
-
'content'
|
|
399
|
-
)
|
|
401
|
+
isUnmodifiedBlock( wrapper, 'content' )
|
|
400
402
|
) {
|
|
401
403
|
removeBlock( _clientId, false );
|
|
402
404
|
}
|
|
@@ -575,7 +577,7 @@ function BlockListBlockProvider( props ) {
|
|
|
575
577
|
clientId: ghostBlock.clientId,
|
|
576
578
|
name: ghostBlock.name,
|
|
577
579
|
isValid: true,
|
|
578
|
-
|
|
580
|
+
}
|
|
579
581
|
: undefined,
|
|
580
582
|
[ ghostBlock ]
|
|
581
583
|
);
|
|
@@ -369,7 +369,8 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection="true"] .b
|
|
|
369
369
|
box-sizing: border-box;
|
|
370
370
|
box-shadow: inset 0 0 0 $border-width $gray-900;
|
|
371
371
|
resize: none;
|
|
372
|
-
|
|
372
|
+
field-sizing: content;
|
|
373
|
+
overflow: auto;
|
|
373
374
|
font-family: $editor-html-font;
|
|
374
375
|
font-size: $text-editor-font-size;
|
|
375
376
|
line-height: 1.5;
|
|
@@ -402,7 +403,7 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection="true"] .b
|
|
|
402
403
|
font-size: $default-font-size;
|
|
403
404
|
font-family: $default-font;
|
|
404
405
|
color: $black;
|
|
405
|
-
font-weight:
|
|
406
|
+
font-weight: 400;
|
|
406
407
|
|
|
407
408
|
.is-zoomed-out & {
|
|
408
409
|
// Maintains an absolute font-size by counter-scaling based on the zoom level.
|
|
@@ -22,7 +22,10 @@ export function useLayout() {
|
|
|
22
22
|
export function LayoutStyle( { layout = {}, css, ...props } ) {
|
|
23
23
|
const layoutType = getLayoutType( layout.type );
|
|
24
24
|
const [ blockGapSupport ] = useSettings( 'spacing.blockGap' );
|
|
25
|
-
|
|
25
|
+
// Like the server's `isset()` check, an unset or `null` setting means the
|
|
26
|
+
// theme has not opted into block gap.
|
|
27
|
+
const hasBlockGapSupport =
|
|
28
|
+
blockGapSupport !== null && blockGapSupport !== undefined;
|
|
26
29
|
|
|
27
30
|
if ( layoutType ) {
|
|
28
31
|
if ( css ) {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { createElement } from '@wordpress/element';
|
|
4
|
+
import { LayoutStyle } from '../layout';
|
|
5
|
+
import { useSettings } from '../../use-settings';
|
|
6
|
+
|
|
7
|
+
vi.mock( import( '../../use-settings' ), async ( importOriginal ) => ( {
|
|
8
|
+
...( await importOriginal() ),
|
|
9
|
+
useSettings: vi.fn(),
|
|
10
|
+
} ) );
|
|
11
|
+
|
|
12
|
+
describe( 'LayoutStyle', () => {
|
|
13
|
+
const props = {
|
|
14
|
+
layout: { type: 'flex' },
|
|
15
|
+
style: { spacing: { blockGap: '10px' } },
|
|
16
|
+
selector: '.my-container',
|
|
17
|
+
blockName: 'test/block',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
it.each( [ null, undefined ] )(
|
|
21
|
+
'outputs no layout styles when the block gap setting is %s',
|
|
22
|
+
( blockGapSetting ) => {
|
|
23
|
+
useSettings.mockReturnValue( [ blockGapSetting ] );
|
|
24
|
+
|
|
25
|
+
const { container } = render( createElement( LayoutStyle, props ) );
|
|
26
|
+
|
|
27
|
+
expect( container ).toBeEmptyDOMElement();
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
it( 'outputs block gap styles when the theme opts into block gap', () => {
|
|
32
|
+
useSettings.mockReturnValue( [ true ] );
|
|
33
|
+
|
|
34
|
+
const { container } = render( createElement( LayoutStyle, props ) );
|
|
35
|
+
|
|
36
|
+
expect( container.innerHTML ).toContain(
|
|
37
|
+
'.my-container { gap: 10px; }'
|
|
38
|
+
);
|
|
39
|
+
} );
|
|
40
|
+
} );
|
|
@@ -190,7 +190,7 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
190
190
|
'--wp-admin-theme-color': 'var(--wp-block-synced-color)',
|
|
191
191
|
'--wp-admin-theme-color--rgb':
|
|
192
192
|
'var(--wp-block-synced-color--rgb)',
|
|
193
|
-
|
|
193
|
+
}
|
|
194
194
|
: {};
|
|
195
195
|
|
|
196
196
|
// Use block visibility hook with data from context to avoid extra subscription.
|
|
@@ -52,9 +52,8 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
52
52
|
},
|
|
53
53
|
[ clientId ]
|
|
54
54
|
);
|
|
55
|
-
const [ applyTemplateLock, setApplyTemplateLock ] =
|
|
56
|
-
!! templateLock
|
|
57
|
-
);
|
|
55
|
+
const [ applyTemplateLock, setApplyTemplateLock ] =
|
|
56
|
+
useState( !! templateLock );
|
|
58
57
|
const { updateBlockAttributes } = useDispatch( blockEditorStore );
|
|
59
58
|
const blockInformation = useBlockDisplayInformation( clientId );
|
|
60
59
|
|
|
@@ -96,17 +96,4 @@
|
|
|
96
96
|
animation-fill-mode: forwards;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
|
|
100
|
-
// Don't show the focus inherited by the Button component.
|
|
101
|
-
&:focus,
|
|
102
|
-
&:focus:enabled,
|
|
103
|
-
// Override focus styles from the block toolbar
|
|
104
|
-
&:focus::before {
|
|
105
|
-
box-shadow: none;
|
|
106
|
-
outline: none;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
&:focus-visible::before {
|
|
110
|
-
@include block-toolbar-button-style__focus();
|
|
111
|
-
}
|
|
112
99
|
}
|
|
@@ -25,6 +25,7 @@ export default function BlockParentSelector() {
|
|
|
25
25
|
getBlockParents,
|
|
26
26
|
getSelectedBlockClientIds,
|
|
27
27
|
getParentSectionBlock,
|
|
28
|
+
getEnabledBlockParents,
|
|
28
29
|
getBlockName,
|
|
29
30
|
getNextBlockClientId,
|
|
30
31
|
} = unlock( select( blockEditorStore ) );
|
|
@@ -37,7 +38,12 @@ export default function BlockParentSelector() {
|
|
|
37
38
|
);
|
|
38
39
|
const parents = getBlockParents( selectedBlockClientId );
|
|
39
40
|
const immediateParentClientId = parents[ parents.length - 1 ];
|
|
40
|
-
|
|
41
|
+
// The parent is the nearest one shown in List View and the
|
|
42
|
+
// breadcrumb, skipping any disabled blocks in between.
|
|
43
|
+
const _parentClientId = getEnabledBlockParents(
|
|
44
|
+
selectedBlockClientId,
|
|
45
|
+
true
|
|
46
|
+
)[ 0 ];
|
|
41
47
|
const parentBlockType = getBlockType(
|
|
42
48
|
getBlockName( _parentClientId )
|
|
43
49
|
);
|
|
@@ -53,12 +59,12 @@ export default function BlockParentSelector() {
|
|
|
53
59
|
nextSiblingClientId: getNextBlockClientId(
|
|
54
60
|
selectedBlockClientId
|
|
55
61
|
),
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
// nothing can be inserted, so no button.
|
|
62
|
+
// No button when the parent shown is not the direct parent, nor
|
|
63
|
+
// within a section, where the structure is locked.
|
|
59
64
|
showInserter:
|
|
60
65
|
!! _parentClientId &&
|
|
61
66
|
_parentClientId === immediateParentClientId &&
|
|
67
|
+
! parentSection &&
|
|
62
68
|
! isTextFlowWrapper,
|
|
63
69
|
};
|
|
64
70
|
},
|
|
@@ -129,11 +135,11 @@ export default function BlockParentSelector() {
|
|
|
129
135
|
'directly add the only allowed block'
|
|
130
136
|
),
|
|
131
137
|
blockTitle.toLowerCase()
|
|
132
|
-
|
|
138
|
+
)
|
|
133
139
|
: _x(
|
|
134
140
|
'Add block',
|
|
135
141
|
'Generic label for block inserter button'
|
|
136
|
-
|
|
142
|
+
)
|
|
137
143
|
}
|
|
138
144
|
showTooltip
|
|
139
145
|
icon={ plus }
|
|
@@ -59,12 +59,12 @@ export default function BlockRenameModal( { clientId, onClose } ) {
|
|
|
59
59
|
/* translators: %s: new name/label for the block */
|
|
60
60
|
__( 'Block name reset to: "%s".' ),
|
|
61
61
|
editedBlockName
|
|
62
|
-
|
|
62
|
+
)
|
|
63
63
|
: sprintf(
|
|
64
64
|
/* translators: %s: new name/label for the block */
|
|
65
65
|
__( 'Block name changed to: "%s".' ),
|
|
66
66
|
editedBlockName
|
|
67
|
-
|
|
67
|
+
);
|
|
68
68
|
|
|
69
69
|
// Must be assertive to immediately announce change.
|
|
70
70
|
speak( message, 'assertive' );
|
|
@@ -106,7 +106,7 @@ export default function BlockRenameModal( { clientId, onClose } ) {
|
|
|
106
106
|
hasOverridesWarning
|
|
107
107
|
? __(
|
|
108
108
|
'This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern.'
|
|
109
|
-
|
|
109
|
+
)
|
|
110
110
|
: undefined
|
|
111
111
|
}
|
|
112
112
|
placeholder={ originalBlockName }
|
|
@@ -131,11 +131,11 @@ function BlockSwitcherDropdownMenuContents( { onClose, clientIds } ) {
|
|
|
131
131
|
? _x(
|
|
132
132
|
'This block is connected.',
|
|
133
133
|
'block toolbar button label and description'
|
|
134
|
-
|
|
134
|
+
)
|
|
135
135
|
: _x(
|
|
136
136
|
'These blocks are connected.',
|
|
137
137
|
'block toolbar button label and description'
|
|
138
|
-
|
|
138
|
+
);
|
|
139
139
|
|
|
140
140
|
return (
|
|
141
141
|
<div className="block-editor-block-switcher__container">
|
|
@@ -199,7 +199,7 @@ export const BlockSwitcher = ( { children, clientIds, label, text } ) => {
|
|
|
199
199
|
clientIds.length
|
|
200
200
|
),
|
|
201
201
|
clientIds.length
|
|
202
|
-
|
|
202
|
+
);
|
|
203
203
|
return (
|
|
204
204
|
<ToolbarGroup>
|
|
205
205
|
<ToolbarItem>
|
|
@@ -53,9 +53,9 @@ export default function EditSectionButton( { clientId } ) {
|
|
|
53
53
|
<ToolbarButton onClick={ handleClick }>
|
|
54
54
|
{ isEditing
|
|
55
55
|
? /* translators: Button label to leave pattern editing mode. */
|
|
56
|
-
|
|
56
|
+
__( 'Exit pattern' )
|
|
57
57
|
: /* translators: Button label to enter pattern editing mode. */
|
|
58
|
-
|
|
58
|
+
__( 'Edit pattern' ) }
|
|
59
59
|
</ToolbarButton>
|
|
60
60
|
</ToolbarGroup>
|
|
61
61
|
);
|
|
@@ -75,7 +75,6 @@ export function PrivateBlockToolbar( {
|
|
|
75
75
|
const {
|
|
76
76
|
getBlockName,
|
|
77
77
|
getBlockMode,
|
|
78
|
-
getBlockParents,
|
|
79
78
|
getSelectedBlockClientIds,
|
|
80
79
|
isBlockValid,
|
|
81
80
|
getBlockEditingMode,
|
|
@@ -83,6 +82,7 @@ export function PrivateBlockToolbar( {
|
|
|
83
82
|
getSettings,
|
|
84
83
|
getTemplateLock,
|
|
85
84
|
getParentSectionBlock,
|
|
85
|
+
getEnabledBlockParents,
|
|
86
86
|
isZoomOut,
|
|
87
87
|
isSectionBlock,
|
|
88
88
|
isBlockHiddenAtViewport,
|
|
@@ -91,9 +91,13 @@ export function PrivateBlockToolbar( {
|
|
|
91
91
|
} = unlock( select( blockEditorStore ) );
|
|
92
92
|
const selectedBlockClientIds = getSelectedBlockClientIds();
|
|
93
93
|
const selectedBlockClientId = selectedBlockClientIds[ 0 ];
|
|
94
|
-
const parents = getBlockParents( selectedBlockClientId );
|
|
95
94
|
const parentSection = getParentSectionBlock( selectedBlockClientId );
|
|
96
|
-
|
|
95
|
+
// The parent is the nearest one shown in List View and the breadcrumb,
|
|
96
|
+
// skipping any disabled blocks in between.
|
|
97
|
+
const parentClientId = getEnabledBlockParents(
|
|
98
|
+
selectedBlockClientId,
|
|
99
|
+
true
|
|
100
|
+
)[ 0 ];
|
|
97
101
|
const parentBlockName = getBlockName( parentClientId );
|
|
98
102
|
const parentBlockType = getBlockType( parentBlockName );
|
|
99
103
|
const editingMode = getBlockEditingMode( selectedBlockClientId );
|
|
@@ -144,7 +148,7 @@ export function PrivateBlockToolbar( {
|
|
|
144
148
|
showParentSelector:
|
|
145
149
|
! _isZoomOut &&
|
|
146
150
|
parentBlockType &&
|
|
147
|
-
editingMode !== 'contentOnly' &&
|
|
151
|
+
( editingMode !== 'contentOnly' || !! parentSection ) &&
|
|
148
152
|
getBlockEditingMode( parentClientId ) !== 'disabled' &&
|
|
149
153
|
hasBlockSupport(
|
|
150
154
|
parentBlockType,
|
|
@@ -4,17 +4,15 @@ import {
|
|
|
4
4
|
Button,
|
|
5
5
|
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
6
6
|
__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,
|
|
7
|
-
privateApis as componentsPrivateApis,
|
|
8
7
|
} from '@wordpress/components';
|
|
9
|
-
|
|
8
|
+
// eslint-disable-next-line @wordpress/use-recommended-components -- Intentional early adoption of the new Menu, pending WordPress/gutenberg#76135.
|
|
9
|
+
import { Menu, VisuallyHidden } from '@wordpress/ui';
|
|
10
10
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
11
11
|
import { useMemo } from '@wordpress/element';
|
|
12
12
|
import BlockIcon from '../block-icon';
|
|
13
13
|
import { store as blockEditorStore } from '../../store';
|
|
14
14
|
import { unlock } from '../../lock-unlock';
|
|
15
15
|
|
|
16
|
-
const { Menu } = unlock( componentsPrivateApis );
|
|
17
|
-
|
|
18
16
|
function VariationsButtons( {
|
|
19
17
|
className,
|
|
20
18
|
onSelectVariation,
|
|
@@ -40,7 +38,7 @@ function VariationsButtons( {
|
|
|
40
38
|
/* translators: %s: Block or block variation name. */
|
|
41
39
|
__( 'Transform to %s' ),
|
|
42
40
|
variation.title
|
|
43
|
-
|
|
41
|
+
)
|
|
44
42
|
}
|
|
45
43
|
onClick={ () => onSelectVariation( variation.name ) }
|
|
46
44
|
aria-label={ variation.title }
|
|
@@ -59,42 +57,45 @@ function VariationsDropdown( {
|
|
|
59
57
|
} ) {
|
|
60
58
|
return (
|
|
61
59
|
<div className={ className }>
|
|
62
|
-
<Menu>
|
|
63
|
-
<Menu.
|
|
60
|
+
<Menu.Root>
|
|
61
|
+
<Menu.Trigger
|
|
64
62
|
render={
|
|
65
63
|
<Button
|
|
66
64
|
className="block-editor-block-variation-transforms__button"
|
|
67
65
|
__next40pxDefaultSize
|
|
68
66
|
variant="secondary"
|
|
69
|
-
|
|
70
|
-
{ __( 'Transform to variation' ) }
|
|
71
|
-
</Button>
|
|
67
|
+
/>
|
|
72
68
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
>
|
|
70
|
+
{ __( 'Transform to variation' ) }
|
|
71
|
+
</Menu.Trigger>
|
|
72
|
+
<Menu.Popup
|
|
73
|
+
positioner={
|
|
74
|
+
<Menu.Positioner side="bottom" align="start" />
|
|
75
|
+
}
|
|
76
|
+
>
|
|
77
|
+
<Menu.RadioGroup
|
|
78
|
+
value={ selectedValue ?? null }
|
|
79
|
+
onValueChange={ onSelectVariation }
|
|
80
|
+
>
|
|
76
81
|
{ variations.map( ( variation ) => (
|
|
77
82
|
<Menu.RadioItem
|
|
78
83
|
key={ variation.name }
|
|
79
84
|
value={ variation.name }
|
|
80
|
-
checked={ selectedValue === variation.name }
|
|
81
|
-
onChange={ () =>
|
|
82
|
-
onSelectVariation( variation.name )
|
|
83
|
-
}
|
|
84
85
|
>
|
|
85
86
|
<Menu.ItemLabel>
|
|
86
87
|
{ variation.title }
|
|
87
88
|
</Menu.ItemLabel>
|
|
88
89
|
{ variation.description && (
|
|
89
|
-
<Menu.
|
|
90
|
+
<Menu.ItemDescription>
|
|
90
91
|
{ variation.description }
|
|
91
|
-
</Menu.
|
|
92
|
+
</Menu.ItemDescription>
|
|
92
93
|
) }
|
|
93
94
|
</Menu.RadioItem>
|
|
94
95
|
) ) }
|
|
95
|
-
</Menu.
|
|
96
|
-
</Menu.
|
|
97
|
-
</Menu>
|
|
96
|
+
</Menu.RadioGroup>
|
|
97
|
+
</Menu.Popup>
|
|
98
|
+
</Menu.Root>
|
|
98
99
|
</div>
|
|
99
100
|
);
|
|
100
101
|
}
|
|
@@ -127,7 +128,7 @@ function VariationsToggleGroupControl( {
|
|
|
127
128
|
/* translators: %s: Block or block variation name. */
|
|
128
129
|
__( 'Transform to %s' ),
|
|
129
130
|
variation.title
|
|
130
|
-
|
|
131
|
+
)
|
|
131
132
|
}
|
|
132
133
|
/>
|
|
133
134
|
) ) }
|