@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
package/src/hooks/typography.jsx
CHANGED
|
@@ -37,6 +37,7 @@ const TEXT_INDENT_SUPPORT_KEY = 'typography.textIndent';
|
|
|
37
37
|
const TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';
|
|
38
38
|
const FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';
|
|
39
39
|
const FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';
|
|
40
|
+
const TEXT_SHADOW_SUPPORT_KEY = 'typography.textShadow';
|
|
40
41
|
const WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';
|
|
41
42
|
export const TYPOGRAPHY_SUPPORT_KEY = 'typography';
|
|
42
43
|
export const TYPOGRAPHY_SUPPORT_KEYS = [
|
|
@@ -52,6 +53,7 @@ export const TYPOGRAPHY_SUPPORT_KEYS = [
|
|
|
52
53
|
WRITING_MODE_SUPPORT_KEY,
|
|
53
54
|
TEXT_TRANSFORM_SUPPORT_KEY,
|
|
54
55
|
LETTER_SPACING_SUPPORT_KEY,
|
|
56
|
+
TEXT_SHADOW_SUPPORT_KEY,
|
|
55
57
|
FIT_TEXT_SUPPORT_KEY,
|
|
56
58
|
];
|
|
57
59
|
|
|
@@ -60,6 +62,7 @@ function styleToAttributes( style ) {
|
|
|
60
62
|
const fontSizeValue = style?.typography?.fontSize;
|
|
61
63
|
const fontFamilyValue = style?.typography?.fontFamily;
|
|
62
64
|
const textColorValue = style?.color?.text;
|
|
65
|
+
const textShadowValue = style?.typography?.textShadow;
|
|
63
66
|
const fontSizeSlug =
|
|
64
67
|
typeof fontSizeValue === 'string' &&
|
|
65
68
|
fontSizeValue?.startsWith( 'var:preset|font-size|' )
|
|
@@ -71,9 +74,15 @@ function styleToAttributes( style ) {
|
|
|
71
74
|
? fontFamilyValue.substring( 'var:preset|font-family|'.length )
|
|
72
75
|
: undefined;
|
|
73
76
|
const textColorSlug = extractPresetSlug( textColorValue, 'color' );
|
|
77
|
+
const textShadowSlug =
|
|
78
|
+
typeof textShadowValue === 'string' &&
|
|
79
|
+
textShadowValue?.startsWith( 'var:preset|text-shadow|' )
|
|
80
|
+
? textShadowValue.substring( 'var:preset|text-shadow|'.length )
|
|
81
|
+
: undefined;
|
|
74
82
|
updatedStyle.typography = {
|
|
75
83
|
...omit( updatedStyle.typography, [ 'fontFamily' ] ),
|
|
76
84
|
fontSize: fontSizeSlug ? undefined : fontSizeValue,
|
|
85
|
+
textShadow: textShadowSlug ? undefined : textShadowValue,
|
|
77
86
|
};
|
|
78
87
|
updatedStyle.color = {
|
|
79
88
|
...updatedStyle.color,
|
|
@@ -84,6 +93,7 @@ function styleToAttributes( style ) {
|
|
|
84
93
|
fontFamily: fontFamilySlug,
|
|
85
94
|
fontSize: fontSizeSlug,
|
|
86
95
|
textColor: textColorSlug,
|
|
96
|
+
textShadow: textShadowSlug,
|
|
87
97
|
};
|
|
88
98
|
}
|
|
89
99
|
|
|
@@ -98,6 +108,9 @@ function attributesToStyle( attributes ) {
|
|
|
98
108
|
fontSize: attributes.fontSize
|
|
99
109
|
? 'var:preset|font-size|' + attributes.fontSize
|
|
100
110
|
: attributes.style?.typography?.fontSize,
|
|
111
|
+
textShadow: attributes.textShadow
|
|
112
|
+
? 'var:preset|text-shadow|' + attributes.textShadow
|
|
113
|
+
: attributes.style?.typography?.textShadow,
|
|
101
114
|
},
|
|
102
115
|
color: {
|
|
103
116
|
...attributes.style?.color,
|
|
@@ -144,33 +157,41 @@ export function TypographyPanel( {
|
|
|
144
157
|
const selectedState = useBlockStyleState();
|
|
145
158
|
const isEnabled = useHasTypographyPanel( settings );
|
|
146
159
|
|
|
147
|
-
const {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
160
|
+
const {
|
|
161
|
+
style,
|
|
162
|
+
fontFamily,
|
|
163
|
+
fontSize,
|
|
164
|
+
fitText,
|
|
165
|
+
textColor,
|
|
166
|
+
textShadow,
|
|
167
|
+
className,
|
|
168
|
+
} = useSelect(
|
|
169
|
+
( select ) => {
|
|
170
|
+
// Early return to avoid subscription when disabled.
|
|
171
|
+
if ( ! isEnabled ) {
|
|
172
|
+
return {};
|
|
173
|
+
}
|
|
174
|
+
const {
|
|
175
|
+
style: _style,
|
|
176
|
+
fontFamily: _fontFamily,
|
|
177
|
+
fontSize: _fontSize,
|
|
178
|
+
textShadow: _textShadow,
|
|
179
|
+
fitText: _fitText,
|
|
180
|
+
textColor: _textColor,
|
|
181
|
+
className: _className,
|
|
182
|
+
} = select( blockEditorStore ).getBlockAttributes( clientId ) || {};
|
|
183
|
+
return {
|
|
184
|
+
style: _style,
|
|
185
|
+
fontFamily: _fontFamily,
|
|
186
|
+
fontSize: _fontSize,
|
|
187
|
+
fitText: _fitText,
|
|
188
|
+
textColor: _textColor,
|
|
189
|
+
textShadow: _textShadow,
|
|
190
|
+
className: _className,
|
|
191
|
+
};
|
|
192
|
+
},
|
|
193
|
+
[ clientId, isEnabled ]
|
|
194
|
+
);
|
|
174
195
|
|
|
175
196
|
const isStateSelected = ! isDefaultBlockStyleState( selectedState );
|
|
176
197
|
|
|
@@ -184,7 +205,13 @@ export function TypographyPanel( {
|
|
|
184
205
|
if ( isStateSelected ) {
|
|
185
206
|
return getStyleForState( style, selectedState );
|
|
186
207
|
}
|
|
187
|
-
return attributesToStyle( {
|
|
208
|
+
return attributesToStyle( {
|
|
209
|
+
style,
|
|
210
|
+
fontFamily,
|
|
211
|
+
fontSize,
|
|
212
|
+
textColor,
|
|
213
|
+
textShadow,
|
|
214
|
+
} );
|
|
188
215
|
}, [
|
|
189
216
|
isStateSelected,
|
|
190
217
|
selectedState,
|
|
@@ -192,6 +219,7 @@ export function TypographyPanel( {
|
|
|
192
219
|
fontSize,
|
|
193
220
|
fontFamily,
|
|
194
221
|
textColor,
|
|
222
|
+
textShadow,
|
|
195
223
|
] );
|
|
196
224
|
|
|
197
225
|
const onChange = isStateSelected
|
|
@@ -199,7 +227,7 @@ export function TypographyPanel( {
|
|
|
199
227
|
setAttributes( {
|
|
200
228
|
style: setStyleForState( style, selectedState, newStyle ),
|
|
201
229
|
} );
|
|
202
|
-
|
|
230
|
+
}
|
|
203
231
|
: ( newStyle ) => {
|
|
204
232
|
const newAttributes = styleToAttributes( newStyle );
|
|
205
233
|
|
|
@@ -212,7 +240,7 @@ export function TypographyPanel( {
|
|
|
212
240
|
}
|
|
213
241
|
|
|
214
242
|
setAttributes( newAttributes );
|
|
215
|
-
|
|
243
|
+
};
|
|
216
244
|
|
|
217
245
|
// Link color failures are reported by the Elements panel, which owns the
|
|
218
246
|
// link color selection.
|
package/src/hooks/utils.jsx
CHANGED
|
@@ -243,6 +243,7 @@ export function useBlockSettings( name, parentLayout ) {
|
|
|
243
243
|
textColumns,
|
|
244
244
|
textDecoration,
|
|
245
245
|
textIndent,
|
|
246
|
+
textShadow,
|
|
246
247
|
writingMode,
|
|
247
248
|
textTransform,
|
|
248
249
|
letterSpacing,
|
|
@@ -288,6 +289,10 @@ export function useBlockSettings( name, parentLayout ) {
|
|
|
288
289
|
isHeadingEnabled,
|
|
289
290
|
isButtonEnabled,
|
|
290
291
|
shadow,
|
|
292
|
+
defaultTextShadowPresetsEnabled,
|
|
293
|
+
customTextShadowPresets,
|
|
294
|
+
defaultTextShadowPresets,
|
|
295
|
+
themeTextShadowPresets,
|
|
291
296
|
] = useSettings(
|
|
292
297
|
'background.backgroundImage',
|
|
293
298
|
'background.backgroundSize',
|
|
@@ -307,6 +312,7 @@ export function useBlockSettings( name, parentLayout ) {
|
|
|
307
312
|
'typography.textColumns',
|
|
308
313
|
'typography.textDecoration',
|
|
309
314
|
'typography.textIndent',
|
|
315
|
+
'typography.textShadow',
|
|
310
316
|
'typography.writingMode',
|
|
311
317
|
'typography.textTransform',
|
|
312
318
|
'typography.letterSpacing',
|
|
@@ -351,7 +357,11 @@ export function useBlockSettings( name, parentLayout ) {
|
|
|
351
357
|
'color.text',
|
|
352
358
|
'color.heading',
|
|
353
359
|
'color.button',
|
|
354
|
-
'shadow'
|
|
360
|
+
'shadow',
|
|
361
|
+
'typography.defaultTextShadowPresets',
|
|
362
|
+
'typography.textShadowPresets.custom',
|
|
363
|
+
'typography.textShadowPresets.default',
|
|
364
|
+
'typography.textShadowPresets.theme'
|
|
355
365
|
);
|
|
356
366
|
|
|
357
367
|
const rawSettings = useMemo( () => {
|
|
@@ -409,6 +419,13 @@ export function useBlockSettings( name, parentLayout ) {
|
|
|
409
419
|
textColumns,
|
|
410
420
|
textDecoration,
|
|
411
421
|
textIndent,
|
|
422
|
+
textShadow,
|
|
423
|
+
textShadowPresets: {
|
|
424
|
+
custom: customTextShadowPresets,
|
|
425
|
+
default: defaultTextShadowPresets,
|
|
426
|
+
theme: themeTextShadowPresets,
|
|
427
|
+
},
|
|
428
|
+
defaultTextShadowPresets: defaultTextShadowPresetsEnabled,
|
|
412
429
|
textTransform,
|
|
413
430
|
letterSpacing,
|
|
414
431
|
writingMode,
|
|
@@ -464,6 +481,11 @@ export function useBlockSettings( name, parentLayout ) {
|
|
|
464
481
|
textColumns,
|
|
465
482
|
textDecoration,
|
|
466
483
|
textIndent,
|
|
484
|
+
textShadow,
|
|
485
|
+
customTextShadowPresets,
|
|
486
|
+
defaultTextShadowPresets,
|
|
487
|
+
themeTextShadowPresets,
|
|
488
|
+
defaultTextShadowPresetsEnabled,
|
|
467
489
|
textTransform,
|
|
468
490
|
letterSpacing,
|
|
469
491
|
writingMode,
|
package/src/layouts/grid.jsx
CHANGED
|
@@ -579,10 +579,10 @@ function GridLayoutTypeControl( { layout, onChange } ) {
|
|
|
579
579
|
gridPlacement === 'manual'
|
|
580
580
|
? __(
|
|
581
581
|
'Grid items can be manually placed in any position on the grid.'
|
|
582
|
-
|
|
582
|
+
)
|
|
583
583
|
: __(
|
|
584
584
|
'Grid items are placed automatically depending on their order.'
|
|
585
|
-
|
|
585
|
+
);
|
|
586
586
|
|
|
587
587
|
return (
|
|
588
588
|
<ToggleGroupControl
|
|
@@ -87,8 +87,9 @@ describe( 'getLayoutStyle', () => {
|
|
|
87
87
|
} );
|
|
88
88
|
|
|
89
89
|
describe( 'FlexLayoutInspectorControls', () => {
|
|
90
|
-
it( 'should not render the wrap toggle by default', () => {
|
|
90
|
+
it( 'should not render the wrap toggle by default', async () => {
|
|
91
91
|
renderInspectorControls();
|
|
92
|
+
await screen.findByRole( 'radio', { name: 'Justify items left' } );
|
|
92
93
|
|
|
93
94
|
expect(
|
|
94
95
|
screen.queryByRole( 'checkbox', {
|
|
@@ -97,13 +98,13 @@ describe( 'FlexLayoutInspectorControls', () => {
|
|
|
97
98
|
).not.toBeInTheDocument();
|
|
98
99
|
} );
|
|
99
100
|
|
|
100
|
-
it( 'should render the wrap toggle when it has a value', () => {
|
|
101
|
+
it( 'should render the wrap toggle when it has a value', async () => {
|
|
101
102
|
renderInspectorControls( {
|
|
102
103
|
layout: { flexWrap: 'nowrap' },
|
|
103
104
|
} );
|
|
104
105
|
|
|
105
106
|
expect(
|
|
106
|
-
screen.
|
|
107
|
+
await screen.findByRole( 'checkbox', {
|
|
107
108
|
name: 'Allow to wrap to multiple lines',
|
|
108
109
|
} )
|
|
109
110
|
).toBeInTheDocument();
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
appendSelectors,
|
|
4
|
+
getBlockGapCSS,
|
|
5
|
+
normalizeLegacyLayout,
|
|
6
|
+
} from '../utils';
|
|
3
7
|
|
|
4
8
|
const layoutDefinitions = {
|
|
5
9
|
default: {
|
|
@@ -127,3 +131,46 @@ describe( 'appendSelectors', () => {
|
|
|
127
131
|
).toBe( '.first-selector .appended,.second-selector .appended' );
|
|
128
132
|
} );
|
|
129
133
|
} );
|
|
134
|
+
|
|
135
|
+
describe( 'normalizeLegacyLayout', () => {
|
|
136
|
+
it( 'should promote a layout using the legacy inherit flag to constrained', () => {
|
|
137
|
+
expect( normalizeLegacyLayout( { inherit: true } ) ).toEqual( {
|
|
138
|
+
inherit: true,
|
|
139
|
+
type: 'constrained',
|
|
140
|
+
} );
|
|
141
|
+
} );
|
|
142
|
+
|
|
143
|
+
it( 'should promote a layout with only a content size to constrained', () => {
|
|
144
|
+
expect( normalizeLegacyLayout( { contentSize: '600px' } ) ).toEqual( {
|
|
145
|
+
contentSize: '600px',
|
|
146
|
+
type: 'constrained',
|
|
147
|
+
} );
|
|
148
|
+
} );
|
|
149
|
+
|
|
150
|
+
it( 'should promote a layout with only a wide size to constrained', () => {
|
|
151
|
+
expect( normalizeLegacyLayout( { wideSize: '1200px' } ) ).toEqual( {
|
|
152
|
+
wideSize: '1200px',
|
|
153
|
+
type: 'constrained',
|
|
154
|
+
} );
|
|
155
|
+
} );
|
|
156
|
+
|
|
157
|
+
it( 'should return a typed layout unchanged', () => {
|
|
158
|
+
const layout = { type: 'flex', orientation: 'vertical' };
|
|
159
|
+
|
|
160
|
+
expect( normalizeLegacyLayout( layout ) ).toBe( layout );
|
|
161
|
+
} );
|
|
162
|
+
|
|
163
|
+
it( 'should return an explicitly flow layout unchanged', () => {
|
|
164
|
+
const layout = { type: 'default' };
|
|
165
|
+
|
|
166
|
+
expect( normalizeLegacyLayout( layout ) ).toBe( layout );
|
|
167
|
+
} );
|
|
168
|
+
|
|
169
|
+
it( 'should return an empty or missing layout unchanged', () => {
|
|
170
|
+
const layout = {};
|
|
171
|
+
|
|
172
|
+
expect( normalizeLegacyLayout( layout ) ).toBe( layout );
|
|
173
|
+
expect( normalizeLegacyLayout( null ) ).toBeNull();
|
|
174
|
+
expect( normalizeLegacyLayout( undefined ) ).toBeUndefined();
|
|
175
|
+
} );
|
|
176
|
+
} );
|
package/src/layouts/utils.js
CHANGED
|
@@ -87,3 +87,22 @@ export function getAlignmentsInfo( layout ) {
|
|
|
87
87
|
}
|
|
88
88
|
return alignmentInfo;
|
|
89
89
|
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Resolves the legacy layout shape to a typed one.
|
|
93
|
+
*
|
|
94
|
+
* Before layout types existed, a constrained layout was expressed as
|
|
95
|
+
* `inherit: true` or as bare `contentSize` / `wideSize` values with no `type`.
|
|
96
|
+
* Markup saved that way, such as a theme template's Post Content block, is
|
|
97
|
+
* still around, and consumers that read `type` alone would resolve it to the
|
|
98
|
+
* flow layout.
|
|
99
|
+
*
|
|
100
|
+
* @param {Object} layout The layout object.
|
|
101
|
+
* @return {Object} The layout, with `type: 'constrained'` set when it was
|
|
102
|
+
* expressed in the legacy form; otherwise the same object.
|
|
103
|
+
*/
|
|
104
|
+
export function normalizeLegacyLayout( layout ) {
|
|
105
|
+
return layout?.inherit || layout?.contentSize || layout?.wideSize
|
|
106
|
+
? { ...layout, type: 'constrained' }
|
|
107
|
+
: layout;
|
|
108
|
+
}
|
package/src/private-apis.js
CHANGED
|
@@ -9,7 +9,9 @@ import {
|
|
|
9
9
|
extractWords,
|
|
10
10
|
getNormalizedSearchTerms,
|
|
11
11
|
normalizeString,
|
|
12
|
+
searchItems,
|
|
12
13
|
} from './components/inserter/search-items';
|
|
14
|
+
import { getPopulatedCategories } from './components/inserter/block-patterns-tab/utils';
|
|
13
15
|
import { PrivateListView } from './components/list-view';
|
|
14
16
|
import InspectorControlsLastItem from './components/inspector-controls/last-item';
|
|
15
17
|
import { useHasBlockToolbar } from './components/block-toolbar/use-has-block-toolbar';
|
|
@@ -161,4 +163,6 @@ lock( privateApis, {
|
|
|
161
163
|
useNativeUndo,
|
|
162
164
|
usesNativeUndo,
|
|
163
165
|
isElementVisible,
|
|
166
|
+
getPopulatedCategories,
|
|
167
|
+
searchItems,
|
|
164
168
|
} );
|
package/src/store/actions.js
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
getBlockSupport,
|
|
13
13
|
isUnmodifiedDefaultBlock,
|
|
14
14
|
isUnmodifiedBlock,
|
|
15
|
+
privateApis as blocksPrivateApis,
|
|
15
16
|
} from '@wordpress/blocks';
|
|
16
17
|
import { speak } from '@wordpress/a11y';
|
|
17
18
|
import { __, _n, sprintf } from '@wordpress/i18n';
|
|
@@ -29,9 +30,12 @@ import {
|
|
|
29
30
|
editContentOnlySection,
|
|
30
31
|
} from './private-actions';
|
|
31
32
|
import { getSiblingBlockAttributes } from '../utils/sibling-block-attributes';
|
|
33
|
+
import { unlock } from '../lock-unlock';
|
|
32
34
|
|
|
33
35
|
/** @typedef {import('../components/use-on-block-drop/types').WPDropOperation} WPDropOperation */
|
|
34
36
|
|
|
37
|
+
const { editableRootKey } = unlock( blocksPrivateApis );
|
|
38
|
+
|
|
35
39
|
const castArray = ( maybeArray ) =>
|
|
36
40
|
Array.isArray( maybeArray ) ? maybeArray : [ maybeArray ];
|
|
37
41
|
|
|
@@ -336,7 +340,7 @@ export const multiSelect =
|
|
|
336
340
|
),
|
|
337
341
|
blockCount,
|
|
338
342
|
blockCount + nestedBlockCount
|
|
339
|
-
|
|
343
|
+
)
|
|
340
344
|
: sprintf(
|
|
341
345
|
/* translators: %s: number of selected blocks */
|
|
342
346
|
_n(
|
|
@@ -345,7 +349,7 @@ export const multiSelect =
|
|
|
345
349
|
blockCount
|
|
346
350
|
),
|
|
347
351
|
blockCount
|
|
348
|
-
|
|
352
|
+
),
|
|
349
353
|
'assertive'
|
|
350
354
|
);
|
|
351
355
|
};
|
|
@@ -721,6 +725,28 @@ export const insertBlocks =
|
|
|
721
725
|
blocksWithTemplates,
|
|
722
726
|
initialPosition
|
|
723
727
|
);
|
|
728
|
+
// Select the start of the inserted block's text when the block
|
|
729
|
+
// opts into the editable root, so its single field places the
|
|
730
|
+
// caret as it mounts. Focusing the field later would move focus
|
|
731
|
+
// off the host and back, which resets the iOS keyboard's
|
|
732
|
+
// capitalization.
|
|
733
|
+
if ( updateSelection && initialPosition === 0 ) {
|
|
734
|
+
const clientId = select.getSelectedBlockClientId();
|
|
735
|
+
const blockType =
|
|
736
|
+
clientId &&
|
|
737
|
+
getBlockType( select.getBlockName( clientId ) );
|
|
738
|
+
const attributeKey =
|
|
739
|
+
blockType?.[ editableRootKey ] &&
|
|
740
|
+
findRichTextAttributeKey( blockType );
|
|
741
|
+
if ( attributeKey ) {
|
|
742
|
+
dispatch.selectionChange(
|
|
743
|
+
clientId,
|
|
744
|
+
attributeKey,
|
|
745
|
+
0,
|
|
746
|
+
0
|
|
747
|
+
);
|
|
748
|
+
}
|
|
749
|
+
}
|
|
724
750
|
} );
|
|
725
751
|
}
|
|
726
752
|
};
|
|
@@ -1163,10 +1189,24 @@ export const __unstableSplitSelection =
|
|
|
1163
1189
|
}
|
|
1164
1190
|
|
|
1165
1191
|
if ( ! blocks.length ) {
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1192
|
+
registry.batch( () => {
|
|
1193
|
+
dispatch.replaceBlocks( select.getSelectedBlockClientIds(), [
|
|
1194
|
+
head,
|
|
1195
|
+
tail,
|
|
1196
|
+
] );
|
|
1197
|
+
// Select the start of the tail field in the same batch, like
|
|
1198
|
+
// the branches below, so the field places the caret as it
|
|
1199
|
+
// mounts rather than being focused later. Only for blocks
|
|
1200
|
+
// that opt into the editable root. The tail may have changed
|
|
1201
|
+
// block type, so read the key from its type.
|
|
1202
|
+
const tailType = getBlockType( tail.name );
|
|
1203
|
+
const tailKey =
|
|
1204
|
+
tailType?.[ editableRootKey ] &&
|
|
1205
|
+
findRichTextAttributeKey( tailType );
|
|
1206
|
+
if ( tailKey ) {
|
|
1207
|
+
dispatch.selectionChange( tail.clientId, tailKey, 0, 0 );
|
|
1208
|
+
}
|
|
1209
|
+
} );
|
|
1170
1210
|
return;
|
|
1171
1211
|
}
|
|
1172
1212
|
|
|
@@ -1927,7 +1967,7 @@ export const insertBeforeBlock =
|
|
|
1927
1967
|
|
|
1928
1968
|
const blockIndex = select.getBlockIndex( clientId );
|
|
1929
1969
|
const { defaultBlock: directInsertBlock } = rootClientId
|
|
1930
|
-
? select.getBlockListSettings( rootClientId ) ?? {}
|
|
1970
|
+
? ( select.getBlockListSettings( rootClientId ) ?? {} )
|
|
1931
1971
|
: {};
|
|
1932
1972
|
|
|
1933
1973
|
if ( ! directInsertBlock ) {
|
|
@@ -1940,7 +1980,7 @@ export const insertBeforeBlock =
|
|
|
1940
1980
|
? getSiblingBlockAttributes(
|
|
1941
1981
|
directInsertBlock.name,
|
|
1942
1982
|
select.getBlockAttributes( clientId )
|
|
1943
|
-
|
|
1983
|
+
)
|
|
1944
1984
|
: {} ),
|
|
1945
1985
|
} );
|
|
1946
1986
|
return dispatch.insertBlock( block, blockIndex, rootClientId );
|
|
@@ -1961,7 +2001,7 @@ export const insertAfterBlock =
|
|
|
1961
2001
|
|
|
1962
2002
|
const blockIndex = select.getBlockIndex( clientId );
|
|
1963
2003
|
const { defaultBlock: directInsertBlock } = rootClientId
|
|
1964
|
-
? select.getBlockListSettings( rootClientId ) ?? {}
|
|
2004
|
+
? ( select.getBlockListSettings( rootClientId ) ?? {} )
|
|
1965
2005
|
: {};
|
|
1966
2006
|
|
|
1967
2007
|
if ( ! directInsertBlock ) {
|
|
@@ -1978,7 +2018,7 @@ export const insertAfterBlock =
|
|
|
1978
2018
|
? getSiblingBlockAttributes(
|
|
1979
2019
|
directInsertBlock.name,
|
|
1980
2020
|
select.getBlockAttributes( clientId )
|
|
1981
|
-
|
|
2021
|
+
)
|
|
1982
2022
|
: {} ),
|
|
1983
2023
|
} );
|
|
1984
2024
|
return dispatch.insertBlock( block, blockIndex + 1, rootClientId );
|
|
@@ -400,7 +400,7 @@ export const getListViewClientIdsTree = createSelector(
|
|
|
400
400
|
state.blocks.attributes,
|
|
401
401
|
state.blockListSettings,
|
|
402
402
|
state.settings,
|
|
403
|
-
|
|
403
|
+
]
|
|
404
404
|
: [] ),
|
|
405
405
|
]
|
|
406
406
|
);
|
|
@@ -633,11 +633,11 @@ export const getPatternBySlug = createRegistrySelector( ( select ) =>
|
|
|
633
633
|
? [
|
|
634
634
|
unlock( select( STORE_NAME ) ).getReusableBlocks(),
|
|
635
635
|
state.settings.__experimentalReusableBlocks,
|
|
636
|
-
|
|
636
|
+
]
|
|
637
637
|
: [
|
|
638
638
|
state.settings.__experimentalBlockPatterns,
|
|
639
639
|
state.settings[ selectBlockPatternsKey ]?.( select ),
|
|
640
|
-
|
|
640
|
+
]
|
|
641
641
|
)
|
|
642
642
|
);
|
|
643
643
|
|
|
@@ -1427,8 +1427,8 @@ export const getSelectedBlockStyleState = createSelector(
|
|
|
1427
1427
|
( state, clientId ) => {
|
|
1428
1428
|
const perBlockState =
|
|
1429
1429
|
state.selectedBlockStyleState?.clientId === clientId
|
|
1430
|
-
? state.selectedBlockStyleState.value ??
|
|
1431
|
-
|
|
1430
|
+
? ( state.selectedBlockStyleState.value ??
|
|
1431
|
+
DEFAULT_BLOCK_STYLE_STATE )
|
|
1432
1432
|
: DEFAULT_BLOCK_STYLE_STATE;
|
|
1433
1433
|
|
|
1434
1434
|
return {
|
package/src/store/reducer.js
CHANGED
|
@@ -416,7 +416,7 @@ function withPersistentBlockChange( reducer ) {
|
|
|
416
416
|
const pendingHistoryMode = nextHistoryMode;
|
|
417
417
|
nextHistoryMode =
|
|
418
418
|
action.type === 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT'
|
|
419
|
-
? action.history ?? 'merge'
|
|
419
|
+
? ( action.history ?? 'merge' )
|
|
420
420
|
: undefined;
|
|
421
421
|
|
|
422
422
|
const isExplicitPersistentChange =
|
|
@@ -883,7 +883,7 @@ export const blocks = pipe(
|
|
|
883
883
|
const updatedAttributeEntries = Object.entries(
|
|
884
884
|
!! action.options?.uniqueByBlock
|
|
885
885
|
? action.attributes[ clientId ]
|
|
886
|
-
: action.attributes ?? {}
|
|
886
|
+
: ( action.attributes ?? {} )
|
|
887
887
|
);
|
|
888
888
|
if ( updatedAttributeEntries.length === 0 ) {
|
|
889
889
|
continue;
|
|
@@ -1722,11 +1722,11 @@ export function settings( state = SETTINGS_DEFAULTS, action ) {
|
|
|
1722
1722
|
? {
|
|
1723
1723
|
...SETTINGS_DEFAULTS,
|
|
1724
1724
|
...action.settings,
|
|
1725
|
-
|
|
1725
|
+
}
|
|
1726
1726
|
: {
|
|
1727
1727
|
...state,
|
|
1728
1728
|
...action.settings,
|
|
1729
|
-
|
|
1729
|
+
};
|
|
1730
1730
|
|
|
1731
1731
|
Object.defineProperty( updatedSettings, '__unstableIsPreviewMode', {
|
|
1732
1732
|
get() {
|
|
@@ -2292,7 +2292,7 @@ export function selectedBlockStyleState( state = undefined, action ) {
|
|
|
2292
2292
|
}
|
|
2293
2293
|
const showStateOnCanvas =
|
|
2294
2294
|
state?.clientId === action.clientId
|
|
2295
|
-
? state.showStateOnCanvas ?? true
|
|
2295
|
+
? ( state.showStateOnCanvas ?? true )
|
|
2296
2296
|
: true;
|
|
2297
2297
|
const previousValue =
|
|
2298
2298
|
state?.clientId === action.clientId ? state.value : {};
|
|
@@ -2616,7 +2616,7 @@ function getDerivedBlockEditingModesForTree( state, treeClientId = '' ) {
|
|
|
2616
2616
|
( clientId ) =>
|
|
2617
2617
|
state.blocks.attributes.get( clientId )?.metadata
|
|
2618
2618
|
?.patternName
|
|
2619
|
-
|
|
2619
|
+
);
|
|
2620
2620
|
const disableContentOnlyForTemplateParts =
|
|
2621
2621
|
state.settings?.disableContentOnlyForTemplateParts;
|
|
2622
2622
|
|
package/src/store/selectors.js
CHANGED
|
@@ -2448,7 +2448,7 @@ export const getInserterItems = createRegistrySelector( ( select ) =>
|
|
|
2448
2448
|
? {
|
|
2449
2449
|
src: symbol,
|
|
2450
2450
|
foreground: 'var(--wp-block-synced-color)',
|
|
2451
|
-
|
|
2451
|
+
}
|
|
2452
2452
|
: symbol;
|
|
2453
2453
|
const userPattern = mapUserPattern( reusableBlock );
|
|
2454
2454
|
const { time, count = 0 } =
|
|
@@ -2864,12 +2864,12 @@ export const __experimentalGetAllowedPatterns = createRegistrySelector(
|
|
|
2864
2864
|
state,
|
|
2865
2865
|
name,
|
|
2866
2866
|
rootClientId
|
|
2867
|
-
|
|
2867
|
+
)
|
|
2868
2868
|
: isBlockVisibleInTheInserter(
|
|
2869
2869
|
state,
|
|
2870
2870
|
name,
|
|
2871
2871
|
rootClientId
|
|
2872
|
-
|
|
2872
|
+
)
|
|
2873
2873
|
)
|
|
2874
2874
|
);
|
|
2875
2875
|
|