@wordpress/block-editor 11.3.6 → 11.5.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 +3 -1
- package/build/components/block-lock/modal.js +1 -0
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-popover/inbetween.js +10 -33
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +2 -2
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-styles/index.js +2 -1
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-types-list/index.native.js +2 -0
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/child-layout-control/index.js +107 -0
- package/build/components/child-layout-control/index.js.map +1 -0
- package/build/components/colors-gradients/control.js +6 -3
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/date-format-picker/index.js +3 -3
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/font-appearance-control/index.js +0 -3
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +594 -0
- package/build/components/global-styles/dimensions-panel.js.map +1 -0
- package/build/components/global-styles/hooks.js +142 -45
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +38 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +434 -0
- package/build/components/global-styles/typography-panel.js.map +1 -0
- package/build/components/global-styles/use-global-styles-output.js +7 -3
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +2 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/iframe/index.js +17 -11
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js +2 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build/components/image-size-control/index.js +6 -11
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/index.native.js +23 -0
- package/build/components/index.native.js.map +1 -1
- package/build/components/inserter/block-patterns-tab.js +9 -15
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js +4 -1
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.native.js +4 -1
- package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build/components/inserter/search-results.native.js +4 -1
- package/build/components/inserter/search-results.native.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls/fill.js +38 -9
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/link-control/index.js +55 -28
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/settings-drawer.js +72 -30
- package/build/components/link-control/settings-drawer.js.map +1 -1
- package/build/components/link-control/settings.js +53 -0
- package/build/components/link-control/settings.js.map +1 -0
- package/build/components/list-view/block.js +4 -2
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/expander.js +2 -1
- package/build/components/list-view/expander.js.map +1 -1
- package/build/components/list-view/index.js +6 -1
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/off-canvas-editor/appender.js +5 -10
- package/build/components/off-canvas-editor/appender.js.map +1 -1
- package/build/components/off-canvas-editor/block-contents.js +3 -2
- package/build/components/off-canvas-editor/block-contents.js.map +1 -1
- package/build/components/off-canvas-editor/branch.js +1 -0
- package/build/components/off-canvas-editor/branch.js.map +1 -1
- package/build/components/off-canvas-editor/index.js +7 -3
- package/build/components/off-canvas-editor/index.js.map +1 -1
- package/build/components/off-canvas-editor/leaf-more-menu.js +24 -4
- package/build/components/off-canvas-editor/leaf-more-menu.js.map +1 -1
- package/build/components/off-canvas-editor/link-ui.js +2 -0
- package/build/components/off-canvas-editor/link-ui.js.map +1 -1
- package/build/components/responsive-block-control/index.js +1 -0
- package/build/components/responsive-block-control/index.js.map +1 -1
- package/build/components/rich-text/index.js +9 -45
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/use-delete.js +73 -0
- package/build/components/rich-text/use-delete.js.map +1 -0
- package/build/components/rich-text/use-input-rules.js +14 -6
- package/build/components/rich-text/use-input-rules.js.map +1 -1
- package/build/components/url-input/index.js +2 -2
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/writing-flow/use-selection-observer.js +4 -1
- package/build/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build/hooks/align.js +3 -1
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/dimensions.js +78 -190
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +94 -25
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-family.js +2 -76
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +3 -51
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/gap.js +0 -201
- package/build/hooks/gap.js.map +1 -1
- package/build/hooks/index.js +2 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout.js +14 -5
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/line-height.js +0 -42
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/margin.js +7 -163
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/padding.js +7 -163
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/typography.js +98 -128
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/utils.js +75 -0
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/flex.js +1 -0
- package/build/layouts/flex.js.map +1 -1
- package/build/store/actions.js +24 -12
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +53 -47
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +22 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/parse-css-unit-to-px.js +36 -3
- package/build/utils/parse-css-unit-to-px.js.map +1 -1
- package/build-module/components/block-lock/modal.js +1 -0
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +10 -33
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-styles/index.js +2 -1
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js +2 -0
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +98 -0
- package/build-module/components/child-layout-control/index.js.map +1 -0
- package/build-module/components/colors-gradients/control.js +6 -3
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +4 -4
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +2 -1
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +574 -0
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -0
- package/build-module/components/global-styles/hooks.js +138 -46
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/index.js +3 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +415 -0
- package/build-module/components/global-styles/typography-panel.js.map +1 -0
- package/build-module/components/global-styles/use-global-styles-output.js +7 -3
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +2 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/iframe/index.js +17 -11
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +2 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build-module/components/image-size-control/index.js +7 -12
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/index.native.js +2 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab.js +9 -15
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.native.js +3 -1
- package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.native.js +3 -1
- package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build-module/components/inserter/search-results.native.js +3 -1
- package/build-module/components/inserter/search-results.native.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +39 -9
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/link-control/index.js +56 -28
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/settings-drawer.js +68 -30
- package/build-module/components/link-control/settings-drawer.js.map +1 -1
- package/build-module/components/link-control/settings.js +44 -0
- package/build-module/components/link-control/settings.js.map +1 -0
- package/build-module/components/list-view/block.js +4 -2
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/expander.js +2 -1
- package/build-module/components/list-view/expander.js.map +1 -1
- package/build-module/components/list-view/index.js +6 -1
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/off-canvas-editor/appender.js +5 -10
- package/build-module/components/off-canvas-editor/appender.js.map +1 -1
- package/build-module/components/off-canvas-editor/block-contents.js +3 -2
- package/build-module/components/off-canvas-editor/block-contents.js.map +1 -1
- package/build-module/components/off-canvas-editor/branch.js +1 -0
- package/build-module/components/off-canvas-editor/branch.js.map +1 -1
- package/build-module/components/off-canvas-editor/index.js +7 -3
- package/build-module/components/off-canvas-editor/index.js.map +1 -1
- package/build-module/components/off-canvas-editor/leaf-more-menu.js +27 -7
- package/build-module/components/off-canvas-editor/leaf-more-menu.js.map +1 -1
- package/build-module/components/off-canvas-editor/link-ui.js +2 -0
- package/build-module/components/off-canvas-editor/link-ui.js.map +1 -1
- package/build-module/components/responsive-block-control/index.js +1 -0
- package/build-module/components/responsive-block-control/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +9 -45
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/use-delete.js +62 -0
- package/build-module/components/rich-text/use-delete.js.map +1 -0
- package/build-module/components/rich-text/use-input-rules.js +14 -6
- package/build-module/components/rich-text/use-input-rules.js.map +1 -1
- package/build-module/components/url-input/index.js +2 -2
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/writing-flow/use-selection-observer.js +4 -1
- package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build-module/hooks/align.js +3 -1
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/dimensions.js +81 -187
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +86 -24
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-family.js +3 -69
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +6 -47
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/gap.js +0 -182
- package/build-module/hooks/gap.js.map +1 -1
- package/build-module/hooks/index.js +1 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/layout.js +14 -5
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/line-height.js +0 -38
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/margin.js +4 -143
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/padding.js +4 -143
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/typography.js +97 -123
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/utils.js +70 -0
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/flex.js +1 -0
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/store/actions.js +24 -12
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +53 -45
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +22 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/parse-css-unit-to-px.js +36 -3
- package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
- package/build-style/style-rtl.css +54 -64
- package/build-style/style.css +54 -64
- package/package.json +31 -31
- package/src/components/block-draggable/test/__snapshots__/index.native.js.snap +24 -24
- package/src/components/block-lock/modal.js +1 -0
- package/src/components/block-lock/style.scss +0 -9
- package/src/components/block-mobile-toolbar/test/__snapshots__/block-actions-menu.native.js.snap +20 -20
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +15 -15
- package/src/components/block-popover/inbetween.js +21 -53
- package/src/components/block-settings-menu/block-settings-dropdown.js +4 -1
- package/src/components/block-styles/index.js +5 -1
- package/src/components/block-types-list/index.native.js +2 -0
- package/src/components/child-layout-control/index.js +106 -0
- package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
- package/src/components/colors-gradients/control.js +3 -0
- package/src/components/date-format-picker/index.js +6 -8
- package/src/components/date-format-picker/style.scss +0 -5
- package/src/components/font-appearance-control/index.js +1 -1
- package/src/components/global-styles/dimensions-panel.js +627 -0
- package/src/components/global-styles/hooks.js +229 -66
- package/src/components/global-styles/index.js +9 -0
- package/src/components/global-styles/typography-panel.js +428 -0
- package/src/components/global-styles/use-global-styles-output.js +10 -5
- package/src/components/global-styles/utils.js +2 -0
- package/src/components/iframe/index.js +20 -18
- package/src/components/image-editor/aspect-ratio-dropdown.js +1 -0
- package/src/components/image-size-control/index.js +10 -12
- package/src/components/image-size-control/style.scss +3 -21
- package/src/components/index.native.js +5 -0
- package/src/components/inner-blocks/test/__snapshots__/index.js.snap +1 -1
- package/src/components/inserter/block-patterns-tab.js +9 -23
- package/src/components/inserter/block-types-tab.native.js +2 -0
- package/src/components/inserter/reusable-blocks-tab.native.js +2 -0
- package/src/components/inserter/search-results.native.js +2 -0
- package/src/components/inserter/test/__snapshots__/index.native.js.snap +15 -15
- package/src/components/inspector-controls/block-support-tools-panel.js +0 -1
- package/src/components/inspector-controls/fill.js +32 -8
- package/src/components/link-control/index.js +69 -34
- package/src/components/link-control/settings-drawer.js +85 -29
- package/src/components/link-control/settings.js +42 -0
- package/src/components/link-control/style.scss +63 -37
- package/src/components/link-control/test/index.js +347 -9
- package/src/components/list-view/block.js +7 -1
- package/src/components/list-view/expander.js +1 -0
- package/src/components/list-view/index.js +5 -0
- package/src/components/media-replace-flow/style.scss +7 -9
- package/src/components/media-replace-flow/test/index.js +1 -1
- package/src/components/off-canvas-editor/appender.js +13 -16
- package/src/components/off-canvas-editor/block-contents.js +2 -1
- package/src/components/off-canvas-editor/branch.js +1 -0
- package/src/components/off-canvas-editor/index.js +8 -2
- package/src/components/off-canvas-editor/leaf-more-menu.js +52 -15
- package/src/components/off-canvas-editor/link-ui.js +2 -0
- package/src/components/responsive-block-control/index.js +1 -0
- package/src/components/rich-text/index.js +8 -46
- package/src/components/rich-text/use-delete.js +59 -0
- package/src/components/rich-text/use-input-rules.js +13 -5
- package/src/components/url-input/index.js +3 -2
- package/src/components/url-popover/stories/index.js +1 -0
- package/src/components/writing-flow/use-selection-observer.js +5 -1
- package/src/hooks/align.js +1 -1
- package/src/hooks/dimensions.js +97 -269
- package/src/hooks/duotone.js +100 -30
- package/src/hooks/font-family.js +0 -58
- package/src/hooks/font-size.js +1 -36
- package/src/hooks/gap.js +0 -201
- package/src/hooks/index.js +1 -0
- package/src/hooks/layout.js +19 -6
- package/src/hooks/line-height.js +0 -33
- package/src/hooks/margin.js +1 -164
- package/src/hooks/padding.js +1 -163
- package/src/hooks/test/__snapshots__/align.native.js.snap +24 -24
- package/src/hooks/test/duotone.js +102 -0
- package/src/hooks/typography.js +112 -213
- package/src/hooks/utils.js +90 -0
- package/src/layouts/flex.js +1 -0
- package/src/store/actions.js +12 -4
- package/src/store/reducer.js +68 -43
- package/src/store/selectors.js +20 -1
- package/src/store/test/actions.js +4 -2
- package/src/utils/parse-css-unit-to-px.js +35 -5
- package/src/utils/test/parse-css-unit-to-px.js +12 -0
- package/build/hooks/child-layout.js +0 -213
- package/build/hooks/child-layout.js.map +0 -1
- package/build/hooks/font-appearance.js +0 -188
- package/build/hooks/font-appearance.js.map +0 -1
- package/build/hooks/letter-spacing.js +0 -129
- package/build/hooks/letter-spacing.js.map +0 -1
- package/build/hooks/min-height.js +0 -139
- package/build/hooks/min-height.js.map +0 -1
- package/build/hooks/text-decoration.js +0 -130
- package/build/hooks/text-decoration.js.map +0 -1
- package/build/hooks/text-transform.js +0 -130
- package/build/hooks/text-transform.js.map +0 -1
- package/build-module/hooks/child-layout.js +0 -193
- package/build-module/hooks/child-layout.js.map +0 -1
- package/build-module/hooks/font-appearance.js +0 -161
- package/build-module/hooks/font-appearance.js.map +0 -1
- package/build-module/hooks/letter-spacing.js +0 -107
- package/build-module/hooks/letter-spacing.js.map +0 -1
- package/build-module/hooks/min-height.js +0 -116
- package/build-module/hooks/min-height.js.map +0 -1
- package/build-module/hooks/text-decoration.js +0 -108
- package/build-module/hooks/text-decoration.js.map +0 -1
- package/build-module/hooks/text-transform.js +0 -108
- package/build-module/hooks/text-transform.js.map +0 -1
- package/src/hooks/child-layout.js +0 -195
- package/src/hooks/font-appearance.js +0 -146
- package/src/hooks/letter-spacing.js +0 -101
- package/src/hooks/min-height.js +0 -104
- package/src/hooks/text-decoration.js +0 -102
- package/src/hooks/text-transform.js +0 -101
|
@@ -5,28 +5,28 @@ exports[`BlockDraggable moves blocks: Initial order 1`] = `
|
|
|
5
5
|
<p>This is a paragraph.</p>
|
|
6
6
|
<!-- /wp:paragraph -->
|
|
7
7
|
|
|
8
|
-
<!-- wp:image {
|
|
9
|
-
<figure class
|
|
8
|
+
<!-- wp:image {"sizeSlug":"large"} -->
|
|
9
|
+
<figure class="wp-block-image size-large"><img src="https://cldup.com/cXyG__fTLN.jpg" alt=""/></figure>
|
|
10
10
|
<!-- /wp:image -->
|
|
11
11
|
|
|
12
12
|
<!-- wp:spacer -->
|
|
13
|
-
<div style
|
|
13
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
14
14
|
<!-- /wp:spacer -->
|
|
15
15
|
|
|
16
|
-
<!-- wp:gallery {
|
|
17
|
-
<figure class
|
|
18
|
-
<figure class
|
|
16
|
+
<!-- wp:gallery {"linkTo":"none"} -->
|
|
17
|
+
<figure class="wp-block-gallery has-nested-images columns-default is-cropped"><!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
|
|
18
|
+
<figure class="wp-block-image size-large"><img src="https://cldup.com/cXyG__fTLN.jpg" alt=""/></figure>
|
|
19
19
|
<!-- /wp:image -->
|
|
20
20
|
|
|
21
|
-
<!-- wp:image {
|
|
22
|
-
<figure class
|
|
21
|
+
<!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
|
|
22
|
+
<figure class="wp-block-image size-large"><img src="https://cldup.com/cXyG__fTLN.jpg" alt=""/></figure>
|
|
23
23
|
<!-- /wp:image --></figure>
|
|
24
24
|
<!-- /wp:gallery -->"
|
|
25
25
|
`;
|
|
26
26
|
|
|
27
27
|
exports[`BlockDraggable moves blocks: Paragraph block moved from first to second position 1`] = `
|
|
28
|
-
"<!-- wp:image {
|
|
29
|
-
<figure class
|
|
28
|
+
"<!-- wp:image {"sizeSlug":"large"} -->
|
|
29
|
+
<figure class="wp-block-image size-large"><img src="https://cldup.com/cXyG__fTLN.jpg" alt=""/></figure>
|
|
30
30
|
<!-- /wp:image -->
|
|
31
31
|
|
|
32
32
|
<!-- wp:paragraph -->
|
|
@@ -34,40 +34,40 @@ exports[`BlockDraggable moves blocks: Paragraph block moved from first to second
|
|
|
34
34
|
<!-- /wp:paragraph -->
|
|
35
35
|
|
|
36
36
|
<!-- wp:spacer -->
|
|
37
|
-
<div style
|
|
37
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
38
38
|
<!-- /wp:spacer -->
|
|
39
39
|
|
|
40
|
-
<!-- wp:gallery {
|
|
41
|
-
<figure class
|
|
42
|
-
<figure class
|
|
40
|
+
<!-- wp:gallery {"linkTo":"none"} -->
|
|
41
|
+
<figure class="wp-block-gallery has-nested-images columns-default is-cropped"><!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
|
|
42
|
+
<figure class="wp-block-image size-large"><img src="https://cldup.com/cXyG__fTLN.jpg" alt=""/></figure>
|
|
43
43
|
<!-- /wp:image -->
|
|
44
44
|
|
|
45
|
-
<!-- wp:image {
|
|
46
|
-
<figure class
|
|
45
|
+
<!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
|
|
46
|
+
<figure class="wp-block-image size-large"><img src="https://cldup.com/cXyG__fTLN.jpg" alt=""/></figure>
|
|
47
47
|
<!-- /wp:image --></figure>
|
|
48
48
|
<!-- /wp:gallery -->"
|
|
49
49
|
`;
|
|
50
50
|
|
|
51
51
|
exports[`BlockDraggable moves blocks: Spacer block moved from third to first position 1`] = `
|
|
52
52
|
"<!-- wp:spacer -->
|
|
53
|
-
<div style
|
|
53
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
54
54
|
<!-- /wp:spacer -->
|
|
55
55
|
|
|
56
|
-
<!-- wp:image {
|
|
57
|
-
<figure class
|
|
56
|
+
<!-- wp:image {"sizeSlug":"large"} -->
|
|
57
|
+
<figure class="wp-block-image size-large"><img src="https://cldup.com/cXyG__fTLN.jpg" alt=""/></figure>
|
|
58
58
|
<!-- /wp:image -->
|
|
59
59
|
|
|
60
60
|
<!-- wp:paragraph -->
|
|
61
61
|
<p>This is a paragraph.</p>
|
|
62
62
|
<!-- /wp:paragraph -->
|
|
63
63
|
|
|
64
|
-
<!-- wp:gallery {
|
|
65
|
-
<figure class
|
|
66
|
-
<figure class
|
|
64
|
+
<!-- wp:gallery {"linkTo":"none"} -->
|
|
65
|
+
<figure class="wp-block-gallery has-nested-images columns-default is-cropped"><!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
|
|
66
|
+
<figure class="wp-block-image size-large"><img src="https://cldup.com/cXyG__fTLN.jpg" alt=""/></figure>
|
|
67
67
|
<!-- /wp:image -->
|
|
68
68
|
|
|
69
|
-
<!-- wp:image {
|
|
70
|
-
<figure class
|
|
69
|
+
<!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
|
|
70
|
+
<figure class="wp-block-image size-large"><img src="https://cldup.com/cXyG__fTLN.jpg" alt=""/></figure>
|
|
71
71
|
<!-- /wp:image --></figure>
|
|
72
72
|
<!-- /wp:gallery -->"
|
|
73
73
|
`;
|
|
@@ -187,6 +187,7 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
187
187
|
</ul>
|
|
188
188
|
{ hasTemplateLock && (
|
|
189
189
|
<ToggleControl
|
|
190
|
+
__nextHasNoMarginBottom
|
|
190
191
|
className="block-editor-block-lock-modal__template-lock"
|
|
191
192
|
label={ __( 'Apply to all blocks inside' ) }
|
|
192
193
|
checked={ applyTemplateLock }
|
|
@@ -18,11 +18,6 @@
|
|
|
18
18
|
.components-checkbox-control__label {
|
|
19
19
|
font-weight: 600;
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
.components-base-control__field {
|
|
23
|
-
align-items: center;
|
|
24
|
-
display: flex;
|
|
25
|
-
}
|
|
26
21
|
}
|
|
27
22
|
.block-editor-block-lock-modal__checklist-item {
|
|
28
23
|
display: flex;
|
|
@@ -48,10 +43,6 @@
|
|
|
48
43
|
border-top: $border-width solid $gray-300;
|
|
49
44
|
margin-top: $grid-unit-20;
|
|
50
45
|
padding: $grid-unit-15 0;
|
|
51
|
-
|
|
52
|
-
.components-base-control__field {
|
|
53
|
-
margin: 0;
|
|
54
|
-
}
|
|
55
46
|
}
|
|
56
47
|
|
|
57
48
|
.block-editor-block-lock-modal__actions {
|
package/src/components/block-mobile-toolbar/test/__snapshots__/block-actions-menu.native.js.snap
CHANGED
|
@@ -6,25 +6,25 @@ exports[`Block Actions Menu block options copies and pastes a block 1`] = `
|
|
|
6
6
|
<!-- /wp:paragraph -->
|
|
7
7
|
|
|
8
8
|
<!-- wp:heading -->
|
|
9
|
-
<h2 class
|
|
9
|
+
<h2 class="wp-block-heading"></h2>
|
|
10
10
|
<!-- /wp:heading -->
|
|
11
11
|
|
|
12
12
|
<!-- wp:spacer -->
|
|
13
|
-
<div style
|
|
13
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
14
14
|
<!-- /wp:spacer -->
|
|
15
15
|
|
|
16
16
|
<!-- wp:heading -->
|
|
17
|
-
<h2 class
|
|
17
|
+
<h2 class="wp-block-heading"></h2>
|
|
18
18
|
<!-- /wp:heading -->"
|
|
19
19
|
`;
|
|
20
20
|
|
|
21
21
|
exports[`Block Actions Menu block options cuts and pastes a block 1`] = `
|
|
22
22
|
"<!-- wp:spacer -->
|
|
23
|
-
<div style
|
|
23
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
24
24
|
<!-- /wp:spacer -->
|
|
25
25
|
|
|
26
26
|
<!-- wp:heading -->
|
|
27
|
-
<h2 class
|
|
27
|
+
<h2 class="wp-block-heading"></h2>
|
|
28
28
|
<!-- /wp:heading -->
|
|
29
29
|
|
|
30
30
|
<!-- wp:paragraph -->
|
|
@@ -38,15 +38,15 @@ exports[`Block Actions Menu block options does not replace a non empty Paragraph
|
|
|
38
38
|
<!-- /wp:paragraph -->
|
|
39
39
|
|
|
40
40
|
<!-- wp:heading -->
|
|
41
|
-
<h2 class
|
|
41
|
+
<h2 class="wp-block-heading"></h2>
|
|
42
42
|
<!-- /wp:heading -->
|
|
43
43
|
|
|
44
44
|
<!-- wp:spacer -->
|
|
45
|
-
<div style
|
|
45
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
46
46
|
<!-- /wp:spacer -->
|
|
47
47
|
|
|
48
48
|
<!-- wp:heading -->
|
|
49
|
-
<h2 class
|
|
49
|
+
<h2 class="wp-block-heading"></h2>
|
|
50
50
|
<!-- /wp:heading -->"
|
|
51
51
|
`;
|
|
52
52
|
|
|
@@ -56,29 +56,29 @@ exports[`Block Actions Menu block options duplicates a block 1`] = `
|
|
|
56
56
|
<!-- /wp:paragraph -->
|
|
57
57
|
|
|
58
58
|
<!-- wp:spacer -->
|
|
59
|
-
<div style
|
|
59
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
60
60
|
<!-- /wp:spacer -->
|
|
61
61
|
|
|
62
62
|
<!-- wp:spacer -->
|
|
63
|
-
<div style
|
|
63
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
64
64
|
<!-- /wp:spacer -->
|
|
65
65
|
|
|
66
66
|
<!-- wp:heading -->
|
|
67
|
-
<h2 class
|
|
67
|
+
<h2 class="wp-block-heading"></h2>
|
|
68
68
|
<!-- /wp:heading -->"
|
|
69
69
|
`;
|
|
70
70
|
|
|
71
71
|
exports[`Block Actions Menu block options transforms a Paragraph block into a Pullquote block 1`] = `
|
|
72
72
|
"<!-- wp:pullquote -->
|
|
73
|
-
<figure class
|
|
73
|
+
<figure class="wp-block-pullquote"><blockquote><p>Hello!</p></blockquote></figure>
|
|
74
74
|
<!-- /wp:pullquote -->
|
|
75
75
|
|
|
76
76
|
<!-- wp:spacer -->
|
|
77
|
-
<div style
|
|
77
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
78
78
|
<!-- /wp:spacer -->
|
|
79
79
|
|
|
80
80
|
<!-- wp:heading -->
|
|
81
|
-
<h2 class
|
|
81
|
+
<h2 class="wp-block-heading"></h2>
|
|
82
82
|
<!-- /wp:heading -->"
|
|
83
83
|
`;
|
|
84
84
|
|
|
@@ -88,11 +88,11 @@ exports[`Block Actions Menu moving blocks disables the Move Down button for the
|
|
|
88
88
|
<!-- /wp:paragraph -->
|
|
89
89
|
|
|
90
90
|
<!-- wp:spacer -->
|
|
91
|
-
<div style
|
|
91
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
92
92
|
<!-- /wp:spacer -->
|
|
93
93
|
|
|
94
94
|
<!-- wp:heading -->
|
|
95
|
-
<h2 class
|
|
95
|
+
<h2 class="wp-block-heading"></h2>
|
|
96
96
|
<!-- /wp:heading -->"
|
|
97
97
|
`;
|
|
98
98
|
|
|
@@ -102,17 +102,17 @@ exports[`Block Actions Menu moving blocks disables the Move Up button for the fi
|
|
|
102
102
|
<!-- /wp:paragraph -->
|
|
103
103
|
|
|
104
104
|
<!-- wp:spacer -->
|
|
105
|
-
<div style
|
|
105
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
106
106
|
<!-- /wp:spacer -->
|
|
107
107
|
|
|
108
108
|
<!-- wp:heading -->
|
|
109
|
-
<h2 class
|
|
109
|
+
<h2 class="wp-block-heading"></h2>
|
|
110
110
|
<!-- /wp:heading -->"
|
|
111
111
|
`;
|
|
112
112
|
|
|
113
113
|
exports[`Block Actions Menu moving blocks moves blocks up and down 1`] = `
|
|
114
114
|
"<!-- wp:heading -->
|
|
115
|
-
<h2 class
|
|
115
|
+
<h2 class="wp-block-heading"></h2>
|
|
116
116
|
<!-- /wp:heading -->
|
|
117
117
|
|
|
118
118
|
<!-- wp:paragraph -->
|
|
@@ -120,6 +120,6 @@ exports[`Block Actions Menu moving blocks moves blocks up and down 1`] = `
|
|
|
120
120
|
<!-- /wp:paragraph -->
|
|
121
121
|
|
|
122
122
|
<!-- wp:spacer -->
|
|
123
|
-
<div style
|
|
123
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
124
124
|
<!-- /wp:spacer -->"
|
|
125
125
|
`;
|
|
@@ -6,11 +6,11 @@ exports[`Block Mover Picker moving blocks disables the Move Down button for the
|
|
|
6
6
|
<!-- /wp:paragraph -->
|
|
7
7
|
|
|
8
8
|
<!-- wp:spacer -->
|
|
9
|
-
<div style
|
|
9
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
10
10
|
<!-- /wp:spacer -->
|
|
11
11
|
|
|
12
12
|
<!-- wp:heading -->
|
|
13
|
-
<h2 class
|
|
13
|
+
<h2 class="wp-block-heading"></h2>
|
|
14
14
|
<!-- /wp:heading -->"
|
|
15
15
|
`;
|
|
16
16
|
|
|
@@ -20,17 +20,17 @@ exports[`Block Mover Picker moving blocks disables the Move Up button for the fi
|
|
|
20
20
|
<!-- /wp:paragraph -->
|
|
21
21
|
|
|
22
22
|
<!-- wp:spacer -->
|
|
23
|
-
<div style
|
|
23
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
24
24
|
<!-- /wp:spacer -->
|
|
25
25
|
|
|
26
26
|
<!-- wp:heading -->
|
|
27
|
-
<h2 class
|
|
27
|
+
<h2 class="wp-block-heading"></h2>
|
|
28
28
|
<!-- /wp:heading -->"
|
|
29
29
|
`;
|
|
30
30
|
|
|
31
31
|
exports[`Block Mover Picker moving blocks moves blocks up and down 1`] = `
|
|
32
32
|
"<!-- wp:heading -->
|
|
33
|
-
<h2 class
|
|
33
|
+
<h2 class="wp-block-heading"></h2>
|
|
34
34
|
<!-- /wp:heading -->
|
|
35
35
|
|
|
36
36
|
<!-- wp:paragraph -->
|
|
@@ -38,19 +38,19 @@ exports[`Block Mover Picker moving blocks moves blocks up and down 1`] = `
|
|
|
38
38
|
<!-- /wp:paragraph -->
|
|
39
39
|
|
|
40
40
|
<!-- wp:spacer -->
|
|
41
|
-
<div style
|
|
41
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
42
42
|
<!-- /wp:spacer -->"
|
|
43
43
|
`;
|
|
44
44
|
|
|
45
45
|
exports[`Block Mover Picker should match snapshot 1`] = `
|
|
46
|
-
|
|
46
|
+
[
|
|
47
47
|
<View>
|
|
48
48
|
<View
|
|
49
49
|
accessibilityHint="Double tap to move the block to the left"
|
|
50
50
|
accessibilityLabel="Move block left from position 2 to position 1"
|
|
51
51
|
accessibilityRole="button"
|
|
52
52
|
accessibilityState={
|
|
53
|
-
|
|
53
|
+
{
|
|
54
54
|
"disabled": false,
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -65,7 +65,7 @@ Array [
|
|
|
65
65
|
onResponderTerminationRequest={[Function]}
|
|
66
66
|
onStartShouldSetResponder={[Function]}
|
|
67
67
|
style={
|
|
68
|
-
|
|
68
|
+
{
|
|
69
69
|
"alignItems": "center",
|
|
70
70
|
"flex": 1,
|
|
71
71
|
"justifyContent": "center",
|
|
@@ -81,7 +81,7 @@ Array [
|
|
|
81
81
|
onGestureHandlerEvent={[Function]}
|
|
82
82
|
onGestureHandlerStateChange={[Function]}
|
|
83
83
|
style={
|
|
84
|
-
|
|
84
|
+
{
|
|
85
85
|
"alignItems": "center",
|
|
86
86
|
"aspectRatio": 1,
|
|
87
87
|
"flex": 1,
|
|
@@ -93,7 +93,7 @@ Array [
|
|
|
93
93
|
>
|
|
94
94
|
<View
|
|
95
95
|
style={
|
|
96
|
-
|
|
96
|
+
{
|
|
97
97
|
"flexDirection": "row",
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -109,7 +109,7 @@ Array [
|
|
|
109
109
|
accessibilityLabel="Move block right"
|
|
110
110
|
accessibilityRole="button"
|
|
111
111
|
accessibilityState={
|
|
112
|
-
|
|
112
|
+
{
|
|
113
113
|
"disabled": true,
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -124,7 +124,7 @@ Array [
|
|
|
124
124
|
onResponderTerminationRequest={[Function]}
|
|
125
125
|
onStartShouldSetResponder={[Function]}
|
|
126
126
|
style={
|
|
127
|
-
|
|
127
|
+
{
|
|
128
128
|
"alignItems": "center",
|
|
129
129
|
"flex": 1,
|
|
130
130
|
"justifyContent": "center",
|
|
@@ -140,7 +140,7 @@ Array [
|
|
|
140
140
|
onGestureHandlerEvent={[Function]}
|
|
141
141
|
onGestureHandlerStateChange={[Function]}
|
|
142
142
|
style={
|
|
143
|
-
|
|
143
|
+
{
|
|
144
144
|
"alignItems": "center",
|
|
145
145
|
"aspectRatio": 1,
|
|
146
146
|
"flex": 1,
|
|
@@ -152,7 +152,7 @@ Array [
|
|
|
152
152
|
>
|
|
153
153
|
<View
|
|
154
154
|
style={
|
|
155
|
-
|
|
155
|
+
{
|
|
156
156
|
"flexDirection": "row",
|
|
157
157
|
}
|
|
158
158
|
}
|
|
@@ -68,53 +68,6 @@ function BlockPopoverInbetween( {
|
|
|
68
68
|
const previousElement = useBlockElement( previousClientId );
|
|
69
69
|
const nextElement = useBlockElement( nextClientId );
|
|
70
70
|
const isVertical = orientation === 'vertical';
|
|
71
|
-
const style = useMemo( () => {
|
|
72
|
-
if (
|
|
73
|
-
// popoverRecomputeCounter is by definition always equal or greater than 0.
|
|
74
|
-
// This check is only there to satisfy the correctness of the
|
|
75
|
-
// exhaustive-deps rule for the `useMemo` hook.
|
|
76
|
-
popoverRecomputeCounter < 0 ||
|
|
77
|
-
( ! previousElement && ! nextElement ) ||
|
|
78
|
-
! isVisible
|
|
79
|
-
) {
|
|
80
|
-
return {};
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const previousRect = previousElement
|
|
84
|
-
? previousElement.getBoundingClientRect()
|
|
85
|
-
: null;
|
|
86
|
-
const nextRect = nextElement
|
|
87
|
-
? nextElement.getBoundingClientRect()
|
|
88
|
-
: null;
|
|
89
|
-
|
|
90
|
-
if ( isVertical ) {
|
|
91
|
-
return {
|
|
92
|
-
width: previousRect ? previousRect.width : nextRect.width,
|
|
93
|
-
height:
|
|
94
|
-
nextRect && previousRect
|
|
95
|
-
? nextRect.top - previousRect.bottom
|
|
96
|
-
: 0,
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
let width = 0;
|
|
101
|
-
if ( previousRect && nextRect ) {
|
|
102
|
-
width = isRTL()
|
|
103
|
-
? previousRect.left - nextRect.right
|
|
104
|
-
: nextRect.left - previousRect.right;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return {
|
|
108
|
-
width,
|
|
109
|
-
height: previousRect ? previousRect.height : nextRect.height,
|
|
110
|
-
};
|
|
111
|
-
}, [
|
|
112
|
-
previousElement,
|
|
113
|
-
nextElement,
|
|
114
|
-
isVertical,
|
|
115
|
-
popoverRecomputeCounter,
|
|
116
|
-
isVisible,
|
|
117
|
-
] );
|
|
118
71
|
|
|
119
72
|
const popoverAnchor = useMemo( () => {
|
|
120
73
|
if (
|
|
@@ -142,10 +95,17 @@ function BlockPopoverInbetween( {
|
|
|
142
95
|
|
|
143
96
|
let left = 0;
|
|
144
97
|
let top = 0;
|
|
98
|
+
let width = 0;
|
|
99
|
+
let height = 0;
|
|
145
100
|
|
|
146
101
|
if ( isVertical ) {
|
|
147
102
|
// vertical
|
|
148
103
|
top = previousRect ? previousRect.bottom : nextRect.top;
|
|
104
|
+
width = previousRect ? previousRect.width : nextRect.width;
|
|
105
|
+
height =
|
|
106
|
+
nextRect && previousRect
|
|
107
|
+
? nextRect.top - previousRect.bottom
|
|
108
|
+
: 0;
|
|
149
109
|
|
|
150
110
|
if ( isRTL() ) {
|
|
151
111
|
// vertical, rtl
|
|
@@ -158,21 +118,32 @@ function BlockPopoverInbetween( {
|
|
|
158
118
|
}
|
|
159
119
|
} else {
|
|
160
120
|
top = previousRect ? previousRect.top : nextRect.top;
|
|
121
|
+
height = previousRect
|
|
122
|
+
? previousRect.height
|
|
123
|
+
: nextRect.height;
|
|
161
124
|
|
|
162
125
|
if ( isRTL() ) {
|
|
163
126
|
// non vertical, rtl
|
|
164
127
|
left = previousRect
|
|
165
128
|
? previousRect.left
|
|
166
129
|
: nextRect.right;
|
|
130
|
+
width =
|
|
131
|
+
previousRect && nextRect
|
|
132
|
+
? previousRect.left - nextRect.right
|
|
133
|
+
: 0;
|
|
167
134
|
} else {
|
|
168
135
|
// non vertical, ltr
|
|
169
136
|
left = previousRect
|
|
170
137
|
? previousRect.right
|
|
171
138
|
: nextRect.left;
|
|
139
|
+
width =
|
|
140
|
+
previousRect && nextRect
|
|
141
|
+
? nextRect.left - previousRect.right
|
|
142
|
+
: 0;
|
|
172
143
|
}
|
|
173
144
|
}
|
|
174
145
|
|
|
175
|
-
return new window.DOMRect( left, top,
|
|
146
|
+
return new window.DOMRect( left, top, width, height );
|
|
176
147
|
},
|
|
177
148
|
};
|
|
178
149
|
}, [
|
|
@@ -267,13 +238,10 @@ function BlockPopoverInbetween( {
|
|
|
267
238
|
) }
|
|
268
239
|
resize={ false }
|
|
269
240
|
flip={ false }
|
|
270
|
-
placement="
|
|
241
|
+
placement="overlay"
|
|
271
242
|
variant="unstyled"
|
|
272
243
|
>
|
|
273
|
-
<div
|
|
274
|
-
className="block-editor-block-popover__inbetween-container"
|
|
275
|
-
style={ style }
|
|
276
|
-
>
|
|
244
|
+
<div className="block-editor-block-popover__inbetween-container">
|
|
277
245
|
{ children }
|
|
278
246
|
</div>
|
|
279
247
|
</Popover>
|
|
@@ -147,7 +147,9 @@ export function BlockSettingsDropdown( {
|
|
|
147
147
|
__experimentalSelectBlock
|
|
148
148
|
? () => {
|
|
149
149
|
const blockToSelect =
|
|
150
|
-
previousBlockClientId ||
|
|
150
|
+
previousBlockClientId ||
|
|
151
|
+
nextBlockClientId ||
|
|
152
|
+
firstParentClientId;
|
|
151
153
|
|
|
152
154
|
if (
|
|
153
155
|
blockToSelect &&
|
|
@@ -166,6 +168,7 @@ export function BlockSettingsDropdown( {
|
|
|
166
168
|
__experimentalSelectBlock,
|
|
167
169
|
previousBlockClientId,
|
|
168
170
|
nextBlockClientId,
|
|
171
|
+
firstParentClientId,
|
|
169
172
|
selectedBlockClientIds,
|
|
170
173
|
]
|
|
171
174
|
);
|
|
@@ -99,7 +99,11 @@ function BlockStyles( { clientId, onSwitch = noop, onHoverClassName = noop } ) {
|
|
|
99
99
|
} ) }
|
|
100
100
|
</div>
|
|
101
101
|
{ hoveredStyle && ! isMobileViewport && (
|
|
102
|
-
<Popover
|
|
102
|
+
<Popover
|
|
103
|
+
placement="left-start"
|
|
104
|
+
offset={ 20 }
|
|
105
|
+
focusOnMount={ false }
|
|
106
|
+
>
|
|
103
107
|
<div
|
|
104
108
|
className="block-editor-block-styles__preview-panel"
|
|
105
109
|
onMouseLeave={ () => styleItemHandler( null ) }
|
|
@@ -32,6 +32,7 @@ export default function BlockTypesList( {
|
|
|
32
32
|
name,
|
|
33
33
|
sections,
|
|
34
34
|
onSelect,
|
|
35
|
+
label,
|
|
35
36
|
listProps,
|
|
36
37
|
initialNumToRender = 3,
|
|
37
38
|
} ) {
|
|
@@ -154,6 +155,7 @@ export default function BlockTypesList( {
|
|
|
154
155
|
<SectionList
|
|
155
156
|
onLayout={ onLayout }
|
|
156
157
|
testID={ `InserterUI-${ name }` }
|
|
158
|
+
accessibilityLabel={ label }
|
|
157
159
|
keyboardShouldPersistTaps="always"
|
|
158
160
|
sections={ sections }
|
|
159
161
|
initialNumToRender={ initialNumToRender }
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
6
|
+
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
7
|
+
__experimentalUnitControl as UnitControl,
|
|
8
|
+
} from '@wordpress/components';
|
|
9
|
+
import { __ } from '@wordpress/i18n';
|
|
10
|
+
import { useEffect } from '@wordpress/element';
|
|
11
|
+
|
|
12
|
+
function helpText( selfStretch, parentLayout ) {
|
|
13
|
+
const { orientation = 'horizontal' } = parentLayout;
|
|
14
|
+
|
|
15
|
+
if ( selfStretch === 'fill' ) {
|
|
16
|
+
return __( 'Stretch to fill available space.' );
|
|
17
|
+
}
|
|
18
|
+
if ( selfStretch === 'fixed' && orientation === 'horizontal' ) {
|
|
19
|
+
return __( 'Specify a fixed width.' );
|
|
20
|
+
} else if ( selfStretch === 'fixed' ) {
|
|
21
|
+
return __( 'Specify a fixed height.' );
|
|
22
|
+
}
|
|
23
|
+
return __( 'Fit contents.' );
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Form to edit the child layout value.
|
|
28
|
+
*
|
|
29
|
+
* @param {Object} props Props.
|
|
30
|
+
* @param {Object} props.value The child layout value.
|
|
31
|
+
* @param {Function} props.onChange Function to update the child layout value.
|
|
32
|
+
* @param {Object} props.parentLayout The parent layout value.
|
|
33
|
+
*
|
|
34
|
+
* @return {WPElement} child layout edit element.
|
|
35
|
+
*/
|
|
36
|
+
export default function ChildLayoutControl( {
|
|
37
|
+
value: childLayout = {},
|
|
38
|
+
onChange,
|
|
39
|
+
parentLayout,
|
|
40
|
+
} ) {
|
|
41
|
+
const { selfStretch, flexSize } = childLayout;
|
|
42
|
+
|
|
43
|
+
useEffect( () => {
|
|
44
|
+
if ( selfStretch === 'fixed' && ! flexSize ) {
|
|
45
|
+
onChange( {
|
|
46
|
+
...childLayout,
|
|
47
|
+
selfStretch: 'fit',
|
|
48
|
+
} );
|
|
49
|
+
}
|
|
50
|
+
}, [] );
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
<ToggleGroupControl
|
|
55
|
+
__nextHasNoMarginBottom
|
|
56
|
+
size={ '__unstable-large' }
|
|
57
|
+
label={ childLayoutOrientation( parentLayout ) }
|
|
58
|
+
value={ selfStretch || 'fit' }
|
|
59
|
+
help={ helpText( selfStretch, parentLayout ) }
|
|
60
|
+
onChange={ ( value ) => {
|
|
61
|
+
const newFlexSize = value !== 'fixed' ? null : flexSize;
|
|
62
|
+
onChange( {
|
|
63
|
+
...childLayout,
|
|
64
|
+
selfStretch: value,
|
|
65
|
+
flexSize: newFlexSize,
|
|
66
|
+
} );
|
|
67
|
+
} }
|
|
68
|
+
isBlock={ true }
|
|
69
|
+
>
|
|
70
|
+
<ToggleGroupControlOption
|
|
71
|
+
key={ 'fit' }
|
|
72
|
+
value={ 'fit' }
|
|
73
|
+
label={ __( 'Fit' ) }
|
|
74
|
+
/>
|
|
75
|
+
<ToggleGroupControlOption
|
|
76
|
+
key={ 'fill' }
|
|
77
|
+
value={ 'fill' }
|
|
78
|
+
label={ __( 'Fill' ) }
|
|
79
|
+
/>
|
|
80
|
+
<ToggleGroupControlOption
|
|
81
|
+
key={ 'fixed' }
|
|
82
|
+
value={ 'fixed' }
|
|
83
|
+
label={ __( 'Fixed' ) }
|
|
84
|
+
/>
|
|
85
|
+
</ToggleGroupControl>
|
|
86
|
+
{ selfStretch === 'fixed' && (
|
|
87
|
+
<UnitControl
|
|
88
|
+
size={ '__unstable-large' }
|
|
89
|
+
onChange={ ( value ) => {
|
|
90
|
+
onChange( {
|
|
91
|
+
...childLayout,
|
|
92
|
+
flexSize: value,
|
|
93
|
+
} );
|
|
94
|
+
} }
|
|
95
|
+
value={ flexSize }
|
|
96
|
+
/>
|
|
97
|
+
) }
|
|
98
|
+
</>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function childLayoutOrientation( parentLayout ) {
|
|
103
|
+
const { orientation = 'horizontal' } = parentLayout;
|
|
104
|
+
|
|
105
|
+
return orientation === 'horizontal' ? __( 'Width' ) : __( 'Height' );
|
|
106
|
+
}
|
|
@@ -158,7 +158,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
|
|
|
158
158
|
<button
|
|
159
159
|
aria-expanded="false"
|
|
160
160
|
aria-haspopup="true"
|
|
161
|
-
aria-label="Custom color picker. The currently selected color is called
|
|
161
|
+
aria-label="Custom color picker. The currently selected color is called "red" and has a value of "f00"."
|
|
162
162
|
class="components-flex components-color-palette__custom-color emotion-10 emotion-5"
|
|
163
163
|
data-wp-c16t="true"
|
|
164
164
|
data-wp-component="Flex"
|