@wordpress/block-editor 15.22.1 → 16.0.1-next.v.202607070741.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 +27 -0
- package/build/autocompleters/block.cjs +10 -2
- package/build/autocompleters/block.cjs.map +2 -2
- package/build/components/background-image-control/index.cjs +0 -2
- package/build/components/background-image-control/index.cjs.map +2 -2
- package/build/components/block-inspector/edit-contents.cjs +3 -0
- package/build/components/block-inspector/edit-contents.cjs.map +3 -3
- package/build/components/block-inspector/index.cjs +18 -36
- package/build/components/block-inspector/index.cjs.map +2 -2
- package/build/components/block-list/block-invalid-warning.cjs +8 -19
- package/build/components/block-list/block-invalid-warning.cjs.map +2 -2
- package/build/components/block-styles/use-styles-for-block.cjs +2 -1
- package/build/components/block-styles/use-styles-for-block.cjs.map +2 -2
- package/build/components/block-title/use-block-display-title.cjs +7 -2
- package/build/components/block-title/use-block-display-title.cjs.map +2 -2
- package/build/components/block-toolbar/block-toolbar-icon.cjs +10 -14
- package/build/components/block-toolbar/block-toolbar-icon.cjs.map +2 -2
- package/build/components/block-variation-transforms/index.cjs +0 -1
- package/build/components/block-variation-transforms/index.cjs.map +2 -2
- package/build/components/child-layout-control/index.cjs +0 -2
- package/build/components/child-layout-control/index.cjs.map +2 -2
- package/build/components/colors-gradients/control.cjs +5 -5
- package/build/components/colors-gradients/control.cjs.map +2 -2
- package/build/components/date-format-picker/index.cjs +0 -1
- package/build/components/date-format-picker/index.cjs.map +2 -2
- package/build/components/dimensions-tool/aspect-ratio-tool.cjs +1 -2
- package/build/components/dimensions-tool/aspect-ratio-tool.cjs.map +2 -2
- package/build/components/dimensions-tool/scale-tool.cjs +0 -1
- package/build/components/dimensions-tool/scale-tool.cjs.map +2 -2
- package/build/components/dimensions-tool/width-height-tool.cjs +2 -4
- package/build/components/dimensions-tool/width-height-tool.cjs.map +2 -2
- package/build/components/font-appearance-control/index.cjs +6 -25
- package/build/components/font-appearance-control/index.cjs.map +3 -3
- package/build/components/font-family/index.cjs +6 -15
- package/build/components/font-family/index.cjs.map +3 -3
- package/build/components/font-sizes/font-size-picker.cjs +1 -2
- package/build/components/font-sizes/font-size-picker.cjs.map +2 -2
- package/build/components/global-styles/border-panel.cjs +0 -1
- package/build/components/global-styles/border-panel.cjs.map +2 -2
- package/build/components/global-styles/dimensions-panel.cjs +0 -3
- package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
- package/build/components/global-styles/typography-panel.cjs +4 -10
- package/build/components/global-styles/typography-panel.cjs.map +2 -2
- package/build/components/height-control/index.cjs +0 -2
- package/build/components/height-control/index.cjs.map +2 -2
- package/build/components/html-element-control/index.cjs +0 -1
- package/build/components/html-element-control/index.cjs.map +2 -2
- package/build/components/image-editor/index.cjs +5 -0
- package/build/components/image-editor/index.cjs.map +3 -3
- package/build/components/image-editor/zoom-dropdown.cjs +0 -1
- package/build/components/image-editor/zoom-dropdown.cjs.map +2 -2
- package/build/components/image-size-control/index.cjs +1 -3
- package/build/components/image-size-control/index.cjs.map +2 -2
- package/build/components/inner-content/index.cjs +107 -0
- package/build/components/inner-content/index.cjs.map +7 -0
- package/build/components/inserter/hooks/use-block-types-state.cjs +10 -2
- package/build/components/inserter/hooks/use-block-types-state.cjs.map +2 -2
- package/build/components/inserter/media-tab/hooks.cjs +34 -6
- package/build/components/inserter/media-tab/hooks.cjs.map +2 -2
- package/build/components/inserter/media-tab/media-list.cjs +3 -1
- package/build/components/inserter/media-tab/media-list.cjs.map +2 -2
- package/build/components/inserter/media-tab/media-panel.cjs +224 -27
- package/build/components/inserter/media-tab/media-panel.cjs.map +3 -3
- package/build/components/inserter/media-tab/media-preview.cjs +32 -17
- package/build/components/inserter/media-tab/media-preview.cjs.map +2 -2
- package/build/components/inserter/media-tab/media-tab.cjs +26 -6
- package/build/components/inserter/media-tab/media-tab.cjs.map +2 -2
- package/build/components/inserter/mobile-tab-navigation.cjs +6 -1
- package/build/components/inserter/mobile-tab-navigation.cjs.map +2 -2
- package/build/components/inserter/no-results.cjs +2 -2
- package/build/components/inserter/no-results.cjs.map +2 -2
- package/build/components/inserter/preview-panel.cjs +2 -1
- package/build/components/inserter/preview-panel.cjs.map +2 -2
- package/build/components/inserter-list-item/index.cjs +8 -2
- package/build/components/inserter-list-item/index.cjs.map +2 -2
- package/build/components/letter-spacing-control/index.cjs +0 -24
- package/build/components/letter-spacing-control/index.cjs.map +3 -3
- package/build/components/line-height-control/index.cjs +7 -22
- package/build/components/line-height-control/index.cjs.map +3 -3
- package/build/components/list-view/block-select-button.cjs +90 -84
- package/build/components/list-view/block-select-button.cjs.map +2 -2
- package/build/components/list-view/block.cjs +51 -20
- package/build/components/list-view/block.cjs.map +2 -2
- package/build/components/list-view/expander.cjs +1 -1
- package/build/components/list-view/expander.cjs.map +2 -2
- package/build/components/list-view/use-list-view-client-ids.cjs +2 -2
- package/build/components/list-view/use-list-view-client-ids.cjs.map +2 -2
- package/build/components/observe-typing/index.cjs +4 -3
- package/build/components/observe-typing/index.cjs.map +2 -2
- package/build/components/preset-input-control/custom-value-controls.cjs +1 -3
- package/build/components/preset-input-control/custom-value-controls.cjs.map +2 -2
- package/build/components/preset-input-control/index.cjs +1 -3
- package/build/components/preset-input-control/index.cjs.map +2 -2
- package/build/components/resolution-tool/index.cjs +1 -2
- package/build/components/resolution-tool/index.cjs.map +2 -2
- package/build/components/text-alignment-control/index.cjs +0 -1
- package/build/components/text-alignment-control/index.cjs.map +2 -2
- package/build/components/text-decoration-control/index.cjs +0 -1
- package/build/components/text-decoration-control/index.cjs.map +2 -2
- package/build/components/text-indent-control/index.cjs +0 -8
- package/build/components/text-indent-control/index.cjs.map +2 -2
- package/build/components/text-transform-control/index.cjs +0 -1
- package/build/components/text-transform-control/index.cjs.map +2 -2
- package/build/components/use-block-display-information/index.cjs +10 -8
- package/build/components/use-block-display-information/index.cjs.map +2 -2
- package/build/components/use-on-block-drop/index.cjs +3 -7
- package/build/components/use-on-block-drop/index.cjs.map +2 -2
- package/build/components/use-resize-canvas/index.cjs +16 -53
- package/build/components/use-resize-canvas/index.cjs.map +3 -3
- package/build/components/writing-mode-control/index.cjs +0 -1
- package/build/components/writing-mode-control/index.cjs.map +2 -2
- package/build/hooks/font-size.cjs +1 -2
- package/build/hooks/font-size.cjs.map +2 -2
- package/build/hooks/layout.cjs +5 -3
- package/build/hooks/layout.cjs.map +2 -2
- package/build/hooks/position.cjs +36 -16
- package/build/hooks/position.cjs.map +2 -2
- package/build/hooks/states.cjs +10 -21
- package/build/hooks/states.cjs.map +2 -2
- package/build/layouts/constrained.cjs +21 -21
- package/build/layouts/constrained.cjs.map +2 -2
- package/build/layouts/flex.cjs +0 -3
- package/build/layouts/flex.cjs.map +2 -2
- package/build/layouts/grid.cjs +51 -9
- package/build/layouts/grid.cjs.map +2 -2
- package/build/private-apis.cjs +4 -2
- package/build/private-apis.cjs.map +3 -3
- package/build/store/actions.cjs.map +2 -2
- package/build/store/private-actions.cjs +16 -0
- package/build/store/private-actions.cjs.map +2 -2
- package/build/store/private-keys.cjs +3 -3
- package/build/store/private-keys.cjs.map +2 -2
- package/build/store/private-selectors.cjs +96 -10
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +19 -3
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +13 -0
- package/build/store/selectors.cjs.map +2 -2
- package/build-module/autocompleters/block.mjs +10 -2
- package/build-module/autocompleters/block.mjs.map +2 -2
- package/build-module/components/background-image-control/index.mjs +0 -2
- package/build-module/components/background-image-control/index.mjs.map +2 -2
- package/build-module/components/block-inspector/edit-contents.mjs +4 -1
- package/build-module/components/block-inspector/edit-contents.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +18 -36
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-list/block-invalid-warning.mjs +8 -19
- package/build-module/components/block-list/block-invalid-warning.mjs.map +2 -2
- package/build-module/components/block-styles/use-styles-for-block.mjs +2 -1
- package/build-module/components/block-styles/use-styles-for-block.mjs.map +2 -2
- package/build-module/components/block-title/use-block-display-title.mjs +7 -2
- package/build-module/components/block-title/use-block-display-title.mjs.map +2 -2
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs +10 -14
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs.map +2 -2
- package/build-module/components/block-variation-transforms/index.mjs +0 -1
- package/build-module/components/block-variation-transforms/index.mjs.map +2 -2
- package/build-module/components/child-layout-control/index.mjs +0 -2
- package/build-module/components/child-layout-control/index.mjs.map +2 -2
- package/build-module/components/colors-gradients/control.mjs +5 -5
- package/build-module/components/colors-gradients/control.mjs.map +2 -2
- package/build-module/components/date-format-picker/index.mjs +0 -1
- package/build-module/components/date-format-picker/index.mjs.map +2 -2
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs +1 -2
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs.map +2 -2
- package/build-module/components/dimensions-tool/scale-tool.mjs +0 -1
- package/build-module/components/dimensions-tool/scale-tool.mjs.map +2 -2
- package/build-module/components/dimensions-tool/width-height-tool.mjs +2 -4
- package/build-module/components/dimensions-tool/width-height-tool.mjs.map +2 -2
- package/build-module/components/font-appearance-control/index.mjs +6 -15
- package/build-module/components/font-appearance-control/index.mjs.map +2 -2
- package/build-module/components/font-family/index.mjs +6 -15
- package/build-module/components/font-family/index.mjs.map +2 -2
- package/build-module/components/font-sizes/font-size-picker.mjs +1 -2
- package/build-module/components/font-sizes/font-size-picker.mjs.map +2 -2
- package/build-module/components/global-styles/border-panel.mjs +0 -1
- package/build-module/components/global-styles/border-panel.mjs.map +2 -2
- package/build-module/components/global-styles/dimensions-panel.mjs +0 -3
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/global-styles/typography-panel.mjs +4 -10
- package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
- package/build-module/components/height-control/index.mjs +0 -2
- package/build-module/components/height-control/index.mjs.map +2 -2
- package/build-module/components/html-element-control/index.mjs +0 -1
- package/build-module/components/html-element-control/index.mjs.map +2 -2
- package/build-module/components/image-editor/index.mjs +5 -0
- package/build-module/components/image-editor/index.mjs.map +2 -2
- package/build-module/components/image-editor/zoom-dropdown.mjs +0 -1
- package/build-module/components/image-editor/zoom-dropdown.mjs.map +2 -2
- package/build-module/components/image-size-control/index.mjs +1 -3
- package/build-module/components/image-size-control/index.mjs.map +2 -2
- package/build-module/components/inner-content/index.mjs +82 -0
- package/build-module/components/inner-content/index.mjs.map +7 -0
- package/build-module/components/inserter/hooks/use-block-types-state.mjs +10 -2
- package/build-module/components/inserter/hooks/use-block-types-state.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/hooks.mjs +33 -6
- package/build-module/components/inserter/media-tab/hooks.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/media-list.mjs +3 -1
- package/build-module/components/inserter/media-tab/media-list.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/media-panel.mjs +227 -30
- package/build-module/components/inserter/media-tab/media-panel.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/media-preview.mjs +33 -18
- package/build-module/components/inserter/media-tab/media-preview.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/media-tab.mjs +27 -7
- package/build-module/components/inserter/media-tab/media-tab.mjs.map +2 -2
- package/build-module/components/inserter/mobile-tab-navigation.mjs +6 -1
- package/build-module/components/inserter/mobile-tab-navigation.mjs.map +2 -2
- package/build-module/components/inserter/no-results.mjs +2 -2
- package/build-module/components/inserter/no-results.mjs.map +2 -2
- package/build-module/components/inserter/preview-panel.mjs +2 -1
- package/build-module/components/inserter/preview-panel.mjs.map +2 -2
- package/build-module/components/inserter-list-item/index.mjs +8 -2
- package/build-module/components/inserter-list-item/index.mjs.map +2 -2
- package/build-module/components/letter-spacing-control/index.mjs +0 -14
- package/build-module/components/letter-spacing-control/index.mjs.map +2 -2
- package/build-module/components/line-height-control/index.mjs +7 -12
- package/build-module/components/line-height-control/index.mjs.map +2 -2
- package/build-module/components/list-view/block-select-button.mjs +90 -84
- package/build-module/components/list-view/block-select-button.mjs.map +2 -2
- package/build-module/components/list-view/block.mjs +51 -20
- package/build-module/components/list-view/block.mjs.map +2 -2
- package/build-module/components/list-view/expander.mjs +1 -1
- package/build-module/components/list-view/expander.mjs.map +2 -2
- package/build-module/components/list-view/use-list-view-client-ids.mjs +2 -2
- package/build-module/components/list-view/use-list-view-client-ids.mjs.map +2 -2
- package/build-module/components/observe-typing/index.mjs +4 -3
- package/build-module/components/observe-typing/index.mjs.map +2 -2
- package/build-module/components/preset-input-control/custom-value-controls.mjs +1 -3
- package/build-module/components/preset-input-control/custom-value-controls.mjs.map +2 -2
- package/build-module/components/preset-input-control/index.mjs +1 -3
- package/build-module/components/preset-input-control/index.mjs.map +2 -2
- package/build-module/components/resolution-tool/index.mjs +1 -2
- package/build-module/components/resolution-tool/index.mjs.map +2 -2
- package/build-module/components/text-alignment-control/index.mjs +0 -1
- package/build-module/components/text-alignment-control/index.mjs.map +2 -2
- package/build-module/components/text-decoration-control/index.mjs +0 -1
- package/build-module/components/text-decoration-control/index.mjs.map +2 -2
- package/build-module/components/text-indent-control/index.mjs +0 -8
- package/build-module/components/text-indent-control/index.mjs.map +2 -2
- package/build-module/components/text-transform-control/index.mjs +0 -1
- package/build-module/components/text-transform-control/index.mjs.map +2 -2
- package/build-module/components/use-block-display-information/index.mjs +10 -8
- package/build-module/components/use-block-display-information/index.mjs.map +2 -2
- package/build-module/components/use-on-block-drop/index.mjs +4 -7
- package/build-module/components/use-on-block-drop/index.mjs.map +2 -2
- package/build-module/components/use-resize-canvas/index.mjs +6 -53
- package/build-module/components/use-resize-canvas/index.mjs.map +2 -2
- package/build-module/components/writing-mode-control/index.mjs +0 -1
- package/build-module/components/writing-mode-control/index.mjs.map +2 -2
- package/build-module/hooks/font-size.mjs +1 -2
- package/build-module/hooks/font-size.mjs.map +2 -2
- package/build-module/hooks/layout.mjs +4 -3
- package/build-module/hooks/layout.mjs.map +2 -2
- package/build-module/hooks/position.mjs +38 -18
- package/build-module/hooks/position.mjs.map +2 -2
- package/build-module/hooks/states.mjs +10 -21
- package/build-module/hooks/states.mjs.map +2 -2
- package/build-module/layouts/constrained.mjs +21 -21
- package/build-module/layouts/constrained.mjs.map +2 -2
- package/build-module/layouts/flex.mjs +0 -3
- package/build-module/layouts/flex.mjs.map +2 -2
- package/build-module/layouts/grid.mjs +52 -9
- package/build-module/layouts/grid.mjs.map +2 -2
- package/build-module/private-apis.mjs +5 -3
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +14 -0
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-keys.mjs +2 -2
- package/build-module/store/private-keys.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +93 -10
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +17 -3
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +13 -0
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-style/content-rtl.css +11 -5
- package/build-style/content.css +11 -5
- package/build-style/style-rtl.css +113 -3
- package/build-style/style.css +113 -3
- package/package.json +43 -41
- package/src/autocompleters/block.js +10 -3
- package/src/autocompleters/test/block.js +53 -0
- package/src/components/background-image-control/index.js +0 -2
- package/src/components/block-inspector/edit-contents.js +5 -1
- package/src/components/block-inspector/index.js +25 -44
- package/src/components/block-list/block-invalid-warning.js +8 -19
- package/src/components/block-patterns-list/stories/index.story.jsx +1 -1
- package/src/components/block-styles/use-styles-for-block.js +1 -0
- package/src/components/block-title/use-block-display-title.js +7 -2
- package/src/components/block-toolbar/block-toolbar-icon.js +11 -16
- package/src/components/block-toolbar/test/block-toolbar-icon.js +32 -9
- package/src/components/block-variation-transforms/index.js +0 -1
- package/src/components/child-layout-control/index.js +0 -2
- package/src/components/color-palette/test/__snapshots__/control.js.snap +11 -106
- package/src/components/colors-gradients/control.js +4 -4
- package/src/components/colors-gradients/style.scss +2 -2
- package/src/components/date-format-picker/index.js +0 -1
- package/src/components/dimensions-tool/aspect-ratio-tool.js +0 -1
- package/src/components/dimensions-tool/scale-tool.js +0 -1
- package/src/components/dimensions-tool/width-height-tool.js +0 -2
- package/src/components/font-appearance-control/index.js +6 -19
- package/src/components/font-family/README.md +0 -9
- package/src/components/font-family/index.js +6 -19
- package/src/components/font-family/stories/index.story.jsx +0 -1
- package/src/components/font-sizes/font-size-picker.js +0 -1
- package/src/components/global-styles/border-panel.js +0 -1
- package/src/components/global-styles/dimensions-panel.js +0 -3
- package/src/components/global-styles/typography-panel.js +0 -6
- package/src/components/height-control/index.js +0 -2
- package/src/components/html-element-control/index.js +0 -1
- package/src/components/iframe/content.scss +3 -3
- package/src/components/image-editor/index.js +22 -0
- package/src/components/image-editor/zoom-dropdown.js +0 -1
- package/src/components/image-size-control/index.js +0 -2
- package/src/components/inner-content/index.js +119 -0
- package/src/components/inner-content/test/index.js +81 -0
- package/src/components/inserter/hooks/use-block-types-state.js +10 -2
- package/src/components/inserter/media-tab/hooks.js +59 -9
- package/src/components/inserter/media-tab/media-list.js +2 -0
- package/src/components/inserter/media-tab/media-panel.js +256 -17
- package/src/components/inserter/media-tab/media-preview.js +34 -17
- package/src/components/inserter/media-tab/media-tab.js +20 -2
- package/src/components/inserter/media-tab/test/hooks.js +204 -0
- package/src/components/inserter/mobile-tab-navigation.js +6 -1
- package/src/components/inserter/no-results.js +2 -2
- package/src/components/inserter/preview-panel.js +1 -0
- package/src/components/inserter/style.scss +110 -1
- package/src/components/inserter-list-item/index.js +8 -2
- package/src/components/letter-spacing-control/README.md +0 -8
- package/src/components/letter-spacing-control/index.js +5 -23
- package/src/components/letter-spacing-control/stories/index.story.jsx +0 -12
- package/src/components/line-height-control/README.md +0 -8
- package/src/components/line-height-control/index.js +7 -16
- package/src/components/line-height-control/stories/index.story.jsx +0 -1
- package/src/components/line-height-control/test/index.js +1 -7
- package/src/components/link-picker/test/index.js +3 -1
- package/src/components/list-view/block-select-button.js +5 -1
- package/src/components/list-view/block.js +57 -20
- package/src/components/list-view/expander.js +5 -1
- package/src/components/list-view/style.scss +19 -0
- package/src/components/list-view/use-list-view-client-ids.js +2 -2
- package/src/components/observe-typing/index.js +9 -4
- package/src/components/preset-input-control/custom-value-controls.js +0 -2
- package/src/components/preset-input-control/index.js +0 -2
- package/src/components/resolution-tool/index.js +0 -1
- package/src/components/responsive-block-control/test/index.js +1 -5
- package/src/components/text-alignment-control/index.js +0 -1
- package/src/components/text-decoration-control/index.js +0 -1
- package/src/components/text-indent-control/index.js +7 -16
- package/src/components/text-transform-control/index.js +0 -1
- package/src/components/use-block-display-information/index.js +9 -13
- package/src/components/use-block-display-information/test/index.js +47 -9
- package/src/components/use-on-block-drop/index.js +4 -7
- package/src/components/use-resize-canvas/index.js +10 -71
- package/src/components/writing-mode-control/index.js +0 -1
- package/src/hooks/block-hooks.scss +15 -0
- package/src/hooks/font-size.js +0 -1
- package/src/hooks/layout.js +5 -4
- package/src/hooks/position.js +44 -23
- package/src/hooks/states.js +24 -26
- package/src/hooks/test/cross-origin-isolation.js +0 -4
- package/src/hooks/test/layout.js +75 -1
- package/src/layouts/constrained.js +51 -28
- package/src/layouts/flex.js +0 -3
- package/src/layouts/grid.js +59 -7
- package/src/layouts/test/constrained.js +91 -0
- package/src/layouts/test/grid.js +71 -0
- package/src/private-apis.js +4 -2
- package/src/store/actions.js +1 -0
- package/src/store/private-actions.js +31 -0
- package/src/store/private-keys.js +1 -1
- package/src/store/private-selectors.js +184 -11
- package/src/store/reducer.js +37 -2
- package/src/store/selectors.js +41 -0
- package/src/store/test/private-selectors.js +436 -10
- package/src/store/test/reducer.js +41 -13
- package/src/store/test/selectors.js +133 -0
- package/src/style.scss +1 -0
- package/src/components/use-resize-canvas/README.md +0 -37
|
@@ -45,7 +45,6 @@ import {
|
|
|
45
45
|
hasViewportBlockStyleState,
|
|
46
46
|
isDefaultBlockStyleState,
|
|
47
47
|
} from '../../hooks/block-style-state';
|
|
48
|
-
import { onViewportStateChangeKey } from '../../store/private-keys';
|
|
49
48
|
|
|
50
49
|
function StyleInspectorSlots( {
|
|
51
50
|
blockName,
|
|
@@ -150,7 +149,7 @@ function BlockInspector() {
|
|
|
150
149
|
blockEditingMode,
|
|
151
150
|
selectedBlockStyleState,
|
|
152
151
|
showStateOnCanvas,
|
|
153
|
-
|
|
152
|
+
isResponsiveEditing,
|
|
154
153
|
} = useSelect( ( select ) => {
|
|
155
154
|
const {
|
|
156
155
|
getSelectedBlockClientId,
|
|
@@ -164,8 +163,8 @@ function BlockInspector() {
|
|
|
164
163
|
getBlockEditingMode,
|
|
165
164
|
getSelectedBlockStyleState,
|
|
166
165
|
isSelectedBlockStyleStateShownOnCanvas,
|
|
166
|
+
isResponsiveEditing: _isResponsiveEditing,
|
|
167
167
|
} = unlock( select( blockEditorStore ) );
|
|
168
|
-
const blockEditorSettings = select( blockEditorStore ).getSettings();
|
|
169
168
|
const { getBlockStyles } = select( blocksStore );
|
|
170
169
|
const _selectedBlockClientId = getSelectedBlockClientId();
|
|
171
170
|
const isWithinEditedSection = isWithinEditedContentOnlySection(
|
|
@@ -203,8 +202,7 @@ function BlockInspector() {
|
|
|
203
202
|
showStateOnCanvas: isSelectedBlockStyleStateShownOnCanvas(
|
|
204
203
|
_renderedBlockClientId
|
|
205
204
|
),
|
|
206
|
-
|
|
207
|
-
blockEditorSettings?.[ onViewportStateChangeKey ],
|
|
205
|
+
isResponsiveEditing: _isResponsiveEditing(),
|
|
208
206
|
};
|
|
209
207
|
}, [] );
|
|
210
208
|
|
|
@@ -339,7 +337,7 @@ function BlockInspector() {
|
|
|
339
337
|
blockEditingMode={ blockEditingMode }
|
|
340
338
|
selectedBlockStyleState={ selectedBlockStyleState }
|
|
341
339
|
showStateOnCanvas={ showStateOnCanvas }
|
|
342
|
-
|
|
340
|
+
isResponsiveEditing={ isResponsiveEditing }
|
|
343
341
|
isBlockStyleStateSelected={ isBlockStyleStateSelected }
|
|
344
342
|
/>
|
|
345
343
|
</BlockInspectorSingleBlockWrapper>
|
|
@@ -395,11 +393,15 @@ const BlockInspectorSingleBlock = ( {
|
|
|
395
393
|
blockEditingMode,
|
|
396
394
|
selectedBlockStyleState,
|
|
397
395
|
showStateOnCanvas,
|
|
398
|
-
|
|
399
|
-
isBlockStyleStateSelected,
|
|
396
|
+
isResponsiveEditing,
|
|
400
397
|
} ) => {
|
|
401
398
|
const listViewRef = useRef( null );
|
|
402
399
|
const hasMultipleTabs = availableTabs?.length > 1;
|
|
400
|
+
const hasPseudoState = hasPseudoBlockStyleState( selectedBlockStyleState );
|
|
401
|
+
const isEditingStyleState =
|
|
402
|
+
( hasViewportBlockStyleState( selectedBlockStyleState ) &&
|
|
403
|
+
isResponsiveEditing ) ||
|
|
404
|
+
hasPseudoBlockStyleState( selectedBlockStyleState );
|
|
403
405
|
const hasParentChildBlockCards =
|
|
404
406
|
editedContentOnlySection &&
|
|
405
407
|
editedContentOnlySection !== renderedBlockClientId;
|
|
@@ -415,32 +417,10 @@ const BlockInspectorSingleBlock = ( {
|
|
|
415
417
|
setSelectedBlockStyleStateCanvasPreview,
|
|
416
418
|
} = unlock( useDispatch( blockEditorStore ) );
|
|
417
419
|
const onBlockStyleStateChange = ( value ) => {
|
|
418
|
-
|
|
419
|
-
...selectedBlockStyleState,
|
|
420
|
-
...value,
|
|
421
|
-
};
|
|
422
|
-
|
|
423
|
-
setSelectedBlockStyleState(
|
|
424
|
-
renderedBlockClientId,
|
|
425
|
-
nextSelectedBlockStyleState
|
|
426
|
-
);
|
|
427
|
-
|
|
428
|
-
if ( value.viewport ) {
|
|
429
|
-
onViewportStateChange?.( {
|
|
430
|
-
viewport: nextSelectedBlockStyleState.viewport,
|
|
431
|
-
showStateOnCanvas,
|
|
432
|
-
} );
|
|
433
|
-
}
|
|
420
|
+
setSelectedBlockStyleState( renderedBlockClientId, value );
|
|
434
421
|
};
|
|
435
422
|
const onShowStateOnCanvasChange = ( value ) => {
|
|
436
423
|
setSelectedBlockStyleStateCanvasPreview( renderedBlockClientId, value );
|
|
437
|
-
|
|
438
|
-
if ( value ) {
|
|
439
|
-
onViewportStateChange?.( {
|
|
440
|
-
viewport: selectedBlockStyleState.viewport,
|
|
441
|
-
showStateOnCanvas: value,
|
|
442
|
-
} );
|
|
443
|
-
}
|
|
444
424
|
};
|
|
445
425
|
|
|
446
426
|
return (
|
|
@@ -470,34 +450,37 @@ const BlockInspectorSingleBlock = ( {
|
|
|
470
450
|
)
|
|
471
451
|
}
|
|
472
452
|
/>
|
|
473
|
-
{ blockEditingMode === 'default' &&
|
|
453
|
+
{ blockEditingMode === 'default' && isEditingStyleState && (
|
|
474
454
|
<Spacer paddingX={ 4 } paddingY={ 2 }>
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
455
|
+
{ hasPseudoState && (
|
|
456
|
+
<ToggleControl
|
|
457
|
+
label={ __( 'Show state on canvas' ) }
|
|
458
|
+
checked={ showStateOnCanvas }
|
|
459
|
+
onChange={ onShowStateOnCanvasChange }
|
|
460
|
+
/>
|
|
461
|
+
) }
|
|
480
462
|
<BlockStateBadges
|
|
481
463
|
name={ blockName }
|
|
482
464
|
value={ selectedBlockStyleState }
|
|
465
|
+
isResponsiveEditing={ isResponsiveEditing }
|
|
483
466
|
/>
|
|
484
467
|
</Spacer>
|
|
485
468
|
) }
|
|
486
469
|
<ViewportVisibilityInfo clientId={ renderedBlockClientId } />
|
|
487
470
|
<EditContents clientId={ renderedBlockClientId } />
|
|
488
|
-
{ !
|
|
471
|
+
{ ! isEditingStyleState && (
|
|
489
472
|
<BlockVariationTransforms
|
|
490
473
|
blockClientId={ renderedBlockClientId }
|
|
491
474
|
/>
|
|
492
475
|
) }
|
|
493
476
|
<BlockInspectorPreTabsSlot />
|
|
494
|
-
{
|
|
477
|
+
{ isEditingStyleState && ! isSectionBlock && (
|
|
495
478
|
<StyleStateInspectorSlots
|
|
496
479
|
blockName={ blockName }
|
|
497
480
|
selectedBlockStyleState={ selectedBlockStyleState }
|
|
498
481
|
/>
|
|
499
482
|
) }
|
|
500
|
-
{ !
|
|
483
|
+
{ ! isEditingStyleState && hasMultipleTabs && (
|
|
501
484
|
<>
|
|
502
485
|
<InspectorControlsTabs
|
|
503
486
|
hasBlockStyles={ hasBlockStyles }
|
|
@@ -509,7 +492,7 @@ const BlockInspectorSingleBlock = ( {
|
|
|
509
492
|
/>
|
|
510
493
|
</>
|
|
511
494
|
) }
|
|
512
|
-
{ !
|
|
495
|
+
{ ! isEditingStyleState && ! hasMultipleTabs && (
|
|
513
496
|
<>
|
|
514
497
|
{ hasBlockStyles && (
|
|
515
498
|
<BlockStyles clientId={ renderedBlockClientId } />
|
|
@@ -523,9 +506,7 @@ const BlockInspectorSingleBlock = ( {
|
|
|
523
506
|
) }
|
|
524
507
|
</>
|
|
525
508
|
) }
|
|
526
|
-
{ !
|
|
527
|
-
<InspectorControlsLastItem.Slot />
|
|
528
|
-
) }
|
|
509
|
+
{ ! isEditingStyleState && <InspectorControlsLastItem.Slot /> }
|
|
529
510
|
<SkipToSelectedBlock key="back" />
|
|
530
511
|
</div>
|
|
531
512
|
);
|
|
@@ -20,7 +20,7 @@ const blockToBlocks = ( block ) =>
|
|
|
20
20
|
} );
|
|
21
21
|
|
|
22
22
|
export default function BlockInvalidWarning( { clientId } ) {
|
|
23
|
-
const { block, canInsertHTMLBlock
|
|
23
|
+
const { block, canInsertHTMLBlock } = useSelect(
|
|
24
24
|
( select ) => {
|
|
25
25
|
const { canInsertBlockType, getBlock, getBlockRootClientId } =
|
|
26
26
|
select( blockEditorStore );
|
|
@@ -33,10 +33,6 @@ export default function BlockInvalidWarning( { clientId } ) {
|
|
|
33
33
|
'core/html',
|
|
34
34
|
rootClientId
|
|
35
35
|
),
|
|
36
|
-
canInsertClassicBlock: canInsertBlockType(
|
|
37
|
-
'core/freeform',
|
|
38
|
-
rootClientId
|
|
39
|
-
),
|
|
40
36
|
};
|
|
41
37
|
},
|
|
42
38
|
[ clientId ]
|
|
@@ -48,16 +44,13 @@ export default function BlockInvalidWarning( { clientId } ) {
|
|
|
48
44
|
|
|
49
45
|
const convert = useMemo(
|
|
50
46
|
() => ( {
|
|
51
|
-
toClassic() {
|
|
52
|
-
const classicBlock = createBlock( 'core/freeform', {
|
|
53
|
-
content: block.originalContent,
|
|
54
|
-
} );
|
|
55
|
-
return replaceBlock( block.clientId, classicBlock );
|
|
56
|
-
},
|
|
57
47
|
toHTML() {
|
|
58
|
-
const htmlBlock = createBlock(
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
const htmlBlock = createBlock(
|
|
49
|
+
'core/html',
|
|
50
|
+
{},
|
|
51
|
+
[],
|
|
52
|
+
[ block.originalContent ]
|
|
53
|
+
);
|
|
61
54
|
return replaceBlock( block.clientId, htmlBlock );
|
|
62
55
|
},
|
|
63
56
|
toBlocks() {
|
|
@@ -88,12 +81,8 @@ export default function BlockInvalidWarning( { clientId } ) {
|
|
|
88
81
|
title: __( 'Convert to HTML' ),
|
|
89
82
|
onClick: convert.toHTML,
|
|
90
83
|
},
|
|
91
|
-
canInsertClassicBlock && {
|
|
92
|
-
title: __( 'Convert to Classic Block' ),
|
|
93
|
-
onClick: convert.toClassic,
|
|
94
|
-
},
|
|
95
84
|
].filter( Boolean ),
|
|
96
|
-
[ canInsertHTMLBlock,
|
|
85
|
+
[ canInsertHTMLBlock, convert ]
|
|
97
86
|
);
|
|
98
87
|
|
|
99
88
|
return (
|
|
@@ -11,7 +11,7 @@ import { ExperimentalBlockEditorProvider } from '../../provider';
|
|
|
11
11
|
import patterns from './fixtures';
|
|
12
12
|
// Reason: Styles are contained in ExperimentalBlockEditorProvider iframe.
|
|
13
13
|
// eslint-disable-next-line @wordpress/no-non-module-stylesheet-imports
|
|
14
|
-
import blockLibraryStyles from '
|
|
14
|
+
import blockLibraryStyles from '@wordpress/block-library/build-style/style.css?raw';
|
|
15
15
|
|
|
16
16
|
const blockEditorSettings = {
|
|
17
17
|
styles: [ { css: blockLibraryStyles } ],
|
|
@@ -39,7 +39,7 @@ export default function useBlockDisplayTitle( {
|
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
const { getBlockName, getBlockAttributes } =
|
|
42
|
+
const { getBlockName, getBlockAttributes, getBlock } =
|
|
43
43
|
select( blockEditorStore );
|
|
44
44
|
const { getBlockType, getActiveBlockVariation } =
|
|
45
45
|
select( blocksStore );
|
|
@@ -57,7 +57,12 @@ export default function useBlockDisplayTitle( {
|
|
|
57
57
|
return label;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
const match = getActiveBlockVariation(
|
|
60
|
+
const match = getActiveBlockVariation(
|
|
61
|
+
blockName,
|
|
62
|
+
attributes,
|
|
63
|
+
undefined,
|
|
64
|
+
getBlock?.( clientId )?.innerContent
|
|
65
|
+
);
|
|
61
66
|
// Label will fallback to the title if no label is defined for the current label context.
|
|
62
67
|
return match?.title || blockType.title;
|
|
63
68
|
},
|
|
@@ -19,7 +19,6 @@ import useBlockDisplayTitle from '../block-title/use-block-display-title';
|
|
|
19
19
|
import { store as blockEditorStore } from '../../store';
|
|
20
20
|
import { hasPatternOverridesDefaultBinding } from '../../utils/block-bindings';
|
|
21
21
|
import { unlock } from '../../lock-unlock';
|
|
22
|
-
import { isIsolatedEditorKey } from '../../store/private-keys';
|
|
23
22
|
|
|
24
23
|
function getBlockIconVariant( { select, clientIds } ) {
|
|
25
24
|
const {
|
|
@@ -30,11 +29,9 @@ function getBlockIconVariant( { select, clientIds } ) {
|
|
|
30
29
|
getTemplateLock,
|
|
31
30
|
getBlockEditingMode,
|
|
32
31
|
canEditBlock,
|
|
33
|
-
|
|
34
|
-
getSettings,
|
|
32
|
+
isSectionBlock,
|
|
35
33
|
} = unlock( select( blockEditorStore ) );
|
|
36
34
|
const { getBlockStyles } = select( blocksStore );
|
|
37
|
-
const isIsolatedEditor = !! getSettings()?.[ isIsolatedEditorKey ];
|
|
38
35
|
|
|
39
36
|
const hasTemplateLock = clientIds.some(
|
|
40
37
|
( id ) => getTemplateLock( id ) === 'contentOnly'
|
|
@@ -48,8 +45,7 @@ function getBlockIconVariant( { select, clientIds } ) {
|
|
|
48
45
|
const hasPatternNameInSelection = clientIds.some(
|
|
49
46
|
( id ) =>
|
|
50
47
|
!! getBlockAttributes( id )?.metadata?.patternName &&
|
|
51
|
-
|
|
52
|
-
! isIsolatedEditor
|
|
48
|
+
isSectionBlock( id )
|
|
53
49
|
);
|
|
54
50
|
const hasPatternOverrides = clientIds.every( ( clientId ) =>
|
|
55
51
|
hasPatternOverridesDefaultBinding(
|
|
@@ -93,13 +89,8 @@ function getBlockIconVariant( { select, clientIds } ) {
|
|
|
93
89
|
}
|
|
94
90
|
|
|
95
91
|
function getBlockIcon( { select, clientIds } ) {
|
|
96
|
-
const {
|
|
97
|
-
|
|
98
|
-
getBlockAttributes,
|
|
99
|
-
isWithinEditedContentOnlySection,
|
|
100
|
-
getSettings,
|
|
101
|
-
} = unlock( select( blockEditorStore ) );
|
|
102
|
-
const isIsolatedEditor = !! getSettings()?.[ isIsolatedEditorKey ];
|
|
92
|
+
const { getBlockName, getBlockAttributes, getBlock, isSectionBlock } =
|
|
93
|
+
unlock( select( blockEditorStore ) );
|
|
103
94
|
|
|
104
95
|
const _isSingleBlock = clientIds.length === 1;
|
|
105
96
|
const firstClientId = clientIds[ 0 ];
|
|
@@ -108,8 +99,7 @@ function getBlockIcon( { select, clientIds } ) {
|
|
|
108
99
|
if (
|
|
109
100
|
_isSingleBlock &&
|
|
110
101
|
blockAttributes?.metadata?.patternName &&
|
|
111
|
-
|
|
112
|
-
! isIsolatedEditor
|
|
102
|
+
isSectionBlock( firstClientId )
|
|
113
103
|
) {
|
|
114
104
|
return symbol;
|
|
115
105
|
}
|
|
@@ -118,7 +108,12 @@ function getBlockIcon( { select, clientIds } ) {
|
|
|
118
108
|
const blockType = getBlockType( blockName );
|
|
119
109
|
if ( _isSingleBlock ) {
|
|
120
110
|
const { getActiveBlockVariation } = select( blocksStore );
|
|
121
|
-
const match = getActiveBlockVariation(
|
|
111
|
+
const match = getActiveBlockVariation(
|
|
112
|
+
blockName,
|
|
113
|
+
blockAttributes,
|
|
114
|
+
undefined,
|
|
115
|
+
getBlock?.( firstClientId )?.innerContent
|
|
116
|
+
);
|
|
122
117
|
return match?.icon || blockType?.icon;
|
|
123
118
|
}
|
|
124
119
|
|
|
@@ -13,7 +13,6 @@ import { paragraph } from '@wordpress/icons';
|
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
15
|
import BlockToolbarIcon from '../block-toolbar-icon';
|
|
16
|
-
import { isIsolatedEditorKey } from '../../../store/private-keys';
|
|
17
16
|
|
|
18
17
|
jest.mock( '@wordpress/blocks', () => {
|
|
19
18
|
const actualImplementation = jest.requireActual( '@wordpress/blocks' );
|
|
@@ -68,15 +67,13 @@ describe( 'BlockToolbarIcon', () => {
|
|
|
68
67
|
},
|
|
69
68
|
blockName = 'core/group',
|
|
70
69
|
getActiveBlockVariation = () => null,
|
|
71
|
-
|
|
72
|
-
isWithinEditedSection = false,
|
|
70
|
+
isSectionBlock = true,
|
|
73
71
|
} = {} ) => {
|
|
74
72
|
useSelect.mockImplementation( ( mapSelect ) =>
|
|
75
73
|
mapSelect( () => ( {
|
|
76
74
|
get: () => false,
|
|
77
75
|
getBlockName: () => blockName,
|
|
78
76
|
getBlockAttributes: () => attributes,
|
|
79
|
-
getSettings: () => settings,
|
|
80
77
|
getBlockParentsByBlockName: () => [],
|
|
81
78
|
canRemoveBlocks: () => true,
|
|
82
79
|
getTemplateLock: () => undefined,
|
|
@@ -84,7 +81,7 @@ describe( 'BlockToolbarIcon', () => {
|
|
|
84
81
|
canEditBlock: () => true,
|
|
85
82
|
getBlockStyles: () => [ {} ],
|
|
86
83
|
getActiveBlockVariation,
|
|
87
|
-
|
|
84
|
+
isSectionBlock: () => isSectionBlock,
|
|
88
85
|
} ) )
|
|
89
86
|
);
|
|
90
87
|
};
|
|
@@ -210,7 +207,7 @@ describe( 'BlockToolbarIcon', () => {
|
|
|
210
207
|
} );
|
|
211
208
|
|
|
212
209
|
it( 'should show the block switcher when the section is being edited', () => {
|
|
213
|
-
setupToolbarSelectors( {
|
|
210
|
+
setupToolbarSelectors( { isSectionBlock: false } );
|
|
214
211
|
|
|
215
212
|
render( <BlockToolbarIcon { ...defaultProps } /> );
|
|
216
213
|
|
|
@@ -227,9 +224,7 @@ describe( 'BlockToolbarIcon', () => {
|
|
|
227
224
|
patternName: 'theme/header-wrapper',
|
|
228
225
|
},
|
|
229
226
|
},
|
|
230
|
-
|
|
231
|
-
[ isIsolatedEditorKey ]: true,
|
|
232
|
-
},
|
|
227
|
+
isSectionBlock: false,
|
|
233
228
|
} );
|
|
234
229
|
|
|
235
230
|
render( <BlockToolbarIcon { ...defaultProps } /> );
|
|
@@ -241,6 +236,34 @@ describe( 'BlockToolbarIcon', () => {
|
|
|
241
236
|
'core/group-icon'
|
|
242
237
|
);
|
|
243
238
|
} );
|
|
239
|
+
|
|
240
|
+
it( 'should show the block switcher when content-only editing is disabled', () => {
|
|
241
|
+
setupToolbarSelectors( {
|
|
242
|
+
isSectionBlock: false,
|
|
243
|
+
} );
|
|
244
|
+
|
|
245
|
+
render( <BlockToolbarIcon { ...defaultProps } /> );
|
|
246
|
+
|
|
247
|
+
expect(
|
|
248
|
+
screen.getByTestId( 'block-switcher' )
|
|
249
|
+
).toBeInTheDocument();
|
|
250
|
+
expect( screen.getByTestId( 'block-icon' ) ).toHaveTextContent(
|
|
251
|
+
'core/group-icon'
|
|
252
|
+
);
|
|
253
|
+
} );
|
|
254
|
+
|
|
255
|
+
it( 'should show the block icon for section blocks without pattern metadata', () => {
|
|
256
|
+
setupToolbarSelectors( {
|
|
257
|
+
attributes: {},
|
|
258
|
+
blockName: 'core/template-part',
|
|
259
|
+
} );
|
|
260
|
+
|
|
261
|
+
render( <BlockToolbarIcon { ...defaultProps } /> );
|
|
262
|
+
|
|
263
|
+
expect( screen.getByTestId( 'block-icon' ) ).toHaveTextContent(
|
|
264
|
+
'core/template-part-icon'
|
|
265
|
+
);
|
|
266
|
+
} );
|
|
244
267
|
} );
|
|
245
268
|
|
|
246
269
|
describe( 'label calculation', () => {
|
|
@@ -178,7 +178,6 @@ function FlexControls( {
|
|
|
178
178
|
panelId={ panelId }
|
|
179
179
|
>
|
|
180
180
|
<ToggleGroupControl
|
|
181
|
-
size="__unstable-large"
|
|
182
181
|
label={ childLayoutOrientation( parentLayout ) }
|
|
183
182
|
value={ flexControlValue }
|
|
184
183
|
help={ helpText( flexControlValue, parentLayout ) }
|
|
@@ -225,7 +224,6 @@ function FlexControls( {
|
|
|
225
224
|
</ToggleGroupControl>
|
|
226
225
|
{ hasFlexSizeValue && (
|
|
227
226
|
<UnitControl
|
|
228
|
-
size="__unstable-large"
|
|
229
227
|
units={ units }
|
|
230
228
|
onChange={ ( value ) => {
|
|
231
229
|
onChange( {
|
|
@@ -18,29 +18,6 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.emotion-4 {
|
|
21
|
-
display: -webkit-box;
|
|
22
|
-
display: -webkit-flex;
|
|
23
|
-
display: -ms-flexbox;
|
|
24
|
-
display: flex;
|
|
25
|
-
-webkit-align-items: stretch;
|
|
26
|
-
-webkit-box-align: stretch;
|
|
27
|
-
-ms-flex-align: stretch;
|
|
28
|
-
align-items: stretch;
|
|
29
|
-
-webkit-flex-direction: column;
|
|
30
|
-
-ms-flex-direction: column;
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
gap: calc(4px * 1);
|
|
33
|
-
-webkit-box-pack: center;
|
|
34
|
-
-ms-flex-pack: center;
|
|
35
|
-
-webkit-justify-content: center;
|
|
36
|
-
justify-content: center;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.emotion-4>* {
|
|
40
|
-
min-height: 0;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.emotion-6 {
|
|
44
21
|
font-size: 11px;
|
|
45
22
|
font-weight: 499;
|
|
46
23
|
line-height: 1.4;
|
|
@@ -50,82 +27,6 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
|
|
|
50
27
|
padding: 0;
|
|
51
28
|
}
|
|
52
29
|
|
|
53
|
-
.emotion-8 {
|
|
54
|
-
display: -webkit-box;
|
|
55
|
-
display: -webkit-flex;
|
|
56
|
-
display: -ms-flexbox;
|
|
57
|
-
display: flex;
|
|
58
|
-
-webkit-align-items: stretch;
|
|
59
|
-
-webkit-box-align: stretch;
|
|
60
|
-
-ms-flex-align: stretch;
|
|
61
|
-
align-items: stretch;
|
|
62
|
-
-webkit-flex-direction: column;
|
|
63
|
-
-ms-flex-direction: column;
|
|
64
|
-
flex-direction: column;
|
|
65
|
-
gap: calc(4px * 3);
|
|
66
|
-
-webkit-box-pack: center;
|
|
67
|
-
-ms-flex-pack: center;
|
|
68
|
-
-webkit-justify-content: center;
|
|
69
|
-
justify-content: center;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.emotion-8>* {
|
|
73
|
-
min-height: 0;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.emotion-10 {
|
|
77
|
-
display: -webkit-box;
|
|
78
|
-
display: -webkit-flex;
|
|
79
|
-
display: -ms-flexbox;
|
|
80
|
-
display: flex;
|
|
81
|
-
-webkit-align-items: stretch;
|
|
82
|
-
-webkit-box-align: stretch;
|
|
83
|
-
-ms-flex-align: stretch;
|
|
84
|
-
align-items: stretch;
|
|
85
|
-
-webkit-flex-direction: column;
|
|
86
|
-
-ms-flex-direction: column;
|
|
87
|
-
flex-direction: column;
|
|
88
|
-
gap: 0;
|
|
89
|
-
-webkit-box-pack: center;
|
|
90
|
-
-ms-flex-pack: center;
|
|
91
|
-
-webkit-justify-content: center;
|
|
92
|
-
justify-content: center;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.emotion-10>* {
|
|
96
|
-
min-height: 0;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.emotion-12 {
|
|
100
|
-
display: -webkit-box;
|
|
101
|
-
display: -webkit-flex;
|
|
102
|
-
display: -ms-flexbox;
|
|
103
|
-
display: flex;
|
|
104
|
-
-webkit-align-items: stretch;
|
|
105
|
-
-webkit-box-align: stretch;
|
|
106
|
-
-ms-flex-align: stretch;
|
|
107
|
-
align-items: stretch;
|
|
108
|
-
-webkit-flex-direction: column;
|
|
109
|
-
-ms-flex-direction: column;
|
|
110
|
-
flex-direction: column;
|
|
111
|
-
gap: calc(4px * 0.5);
|
|
112
|
-
-webkit-box-pack: center;
|
|
113
|
-
-ms-flex-pack: center;
|
|
114
|
-
-webkit-justify-content: center;
|
|
115
|
-
justify-content: center;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.emotion-12>* {
|
|
119
|
-
min-height: 0;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.emotion-14 {
|
|
123
|
-
display: block;
|
|
124
|
-
overflow: hidden;
|
|
125
|
-
text-overflow: ellipsis;
|
|
126
|
-
white-space: nowrap;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
30
|
<div>
|
|
130
31
|
<div
|
|
131
32
|
class="components-base-control block-editor-color-gradient-control emotion-0 emotion-1"
|
|
@@ -137,16 +38,17 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
|
|
|
137
38
|
class="block-editor-color-gradient-control__fieldset"
|
|
138
39
|
>
|
|
139
40
|
<div
|
|
140
|
-
class="components-flex components-h-stack components-v-stack
|
|
41
|
+
class="style-flex style-items-column components-flex components-h-stack components-v-stack"
|
|
141
42
|
data-wp-c16t="true"
|
|
142
43
|
data-wp-component="VStack"
|
|
44
|
+
style="--wp-components-flex-align: stretch; --wp-components-flex-direction: column; --wp-components-flex-wrap: nowrap; --wp-components-flex-gap: calc(4px * 1); --wp-components-flex-justify: center;"
|
|
143
45
|
>
|
|
144
46
|
<legend>
|
|
145
47
|
<div
|
|
146
48
|
class="block-editor-color-gradient-control__color-indicator"
|
|
147
49
|
>
|
|
148
50
|
<span
|
|
149
|
-
class="components-base-control__label emotion-
|
|
51
|
+
class="components-base-control__label emotion-4 emotion-5"
|
|
150
52
|
>
|
|
151
53
|
Test Color
|
|
152
54
|
</span>
|
|
@@ -156,18 +58,20 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
|
|
|
156
58
|
class="block-editor-color-gradient-control__panel"
|
|
157
59
|
>
|
|
158
60
|
<div
|
|
159
|
-
class="components-flex components-h-stack components-v-stack
|
|
61
|
+
class="style-flex style-items-column components-flex components-h-stack components-v-stack"
|
|
160
62
|
data-wp-c16t="true"
|
|
161
63
|
data-wp-component="VStack"
|
|
64
|
+
style="--wp-components-flex-align: stretch; --wp-components-flex-direction: column; --wp-components-flex-wrap: nowrap; --wp-components-flex-gap: calc(4px * 3); --wp-components-flex-justify: center;"
|
|
162
65
|
>
|
|
163
66
|
<div
|
|
164
67
|
class="components-dropdown"
|
|
165
68
|
tabindex="-1"
|
|
166
69
|
>
|
|
167
70
|
<div
|
|
168
|
-
class="components-flex components-h-stack components-v-stack components-color-palette__custom-color-wrapper
|
|
71
|
+
class="style-flex style-items-column components-flex components-h-stack components-v-stack components-color-palette__custom-color-wrapper"
|
|
169
72
|
data-wp-c16t="true"
|
|
170
73
|
data-wp-component="VStack"
|
|
74
|
+
style="--wp-components-flex-align: stretch; --wp-components-flex-direction: column; --wp-components-flex-wrap: nowrap; --wp-components-flex-gap: 0; --wp-components-flex-justify: center;"
|
|
171
75
|
>
|
|
172
76
|
<button
|
|
173
77
|
aria-expanded="false"
|
|
@@ -178,19 +82,20 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
|
|
|
178
82
|
type="button"
|
|
179
83
|
/>
|
|
180
84
|
<div
|
|
181
|
-
class="components-flex components-h-stack components-v-stack components-color-palette__custom-color-text-wrapper
|
|
85
|
+
class="style-flex style-items-column components-flex components-h-stack components-v-stack components-color-palette__custom-color-text-wrapper"
|
|
182
86
|
data-wp-c16t="true"
|
|
183
87
|
data-wp-component="VStack"
|
|
88
|
+
style="--wp-components-flex-align: stretch; --wp-components-flex-direction: column; --wp-components-flex-wrap: nowrap; --wp-components-flex-gap: calc(4px * 0.5); --wp-components-flex-justify: center;"
|
|
184
89
|
>
|
|
185
90
|
<span
|
|
186
|
-
class="components-truncate components-color-palette__custom-color-name
|
|
91
|
+
class="style-truncate components-truncate components-color-palette__custom-color-name"
|
|
187
92
|
data-wp-c16t="true"
|
|
188
93
|
data-wp-component="Truncate"
|
|
189
94
|
>
|
|
190
95
|
red
|
|
191
96
|
</span>
|
|
192
97
|
<span
|
|
193
|
-
class="components-truncate components-color-palette__custom-color-value components-color-palette__custom-color-value--is-hex
|
|
98
|
+
class="style-truncate components-truncate components-color-palette__custom-color-value components-color-palette__custom-color-value--is-hex"
|
|
194
99
|
data-wp-c16t="true"
|
|
195
100
|
data-wp-component="Truncate"
|
|
196
101
|
>
|
|
@@ -88,15 +88,15 @@ function ColorGradientControlInner( {
|
|
|
88
88
|
// The `ColorPalette` must stay at a stable position in the tree whether
|
|
89
89
|
// or not a notice is present. Wrapping it in a `VStack` only when a
|
|
90
90
|
// notice appears remounts it, which resets the custom color picker back
|
|
91
|
-
// to the swatch view mid-edit. Keep `ColorPalette`
|
|
92
|
-
// the notice
|
|
93
|
-
//
|
|
91
|
+
// to the swatch view mid-edit. Keep `ColorPalette` first and toggle only
|
|
92
|
+
// the trailing notice after it, so the palette holds a stable index and
|
|
93
|
+
// the notice sits at the bottom of the popover.
|
|
94
94
|
[ TAB_IDS.color ]: (
|
|
95
95
|
<>
|
|
96
|
+
{ colorPalette }
|
|
96
97
|
{ noticeProps && (
|
|
97
98
|
<Notice isDismissible={ false } { ...noticeProps } />
|
|
98
99
|
) }
|
|
99
|
-
{ colorPalette }
|
|
100
100
|
</>
|
|
101
101
|
),
|
|
102
102
|
[ TAB_IDS.gradient ]: (
|
|
@@ -68,9 +68,9 @@ $swatch-gap: 12px;
|
|
|
68
68
|
background: linear-gradient(-45deg, transparent 48%, $gray-300 48%, $gray-300 52%, transparent 52%);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
// Space the in-popover contrast notice away from the color palette
|
|
71
|
+
// Space the in-popover contrast notice away from the color palette above it.
|
|
72
72
|
.block-editor-panel-color-gradient-settings__contrast-notice {
|
|
73
|
-
margin-
|
|
73
|
+
margin-top: $grid-unit-20;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
/**
|