@wordpress/block-editor 11.4.0 → 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 +6 -0
- package/build/components/block-inspector/index.js +11 -10
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-inspector/useBlockInspectorAnimationSettings.js +46 -0
- package/build/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -0
- package/build/components/block-lock/modal.js +1 -0
- package/build/components/block-lock/modal.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/child-layout-control/index.js +107 -0
- package/build/components/child-layout-control/index.js.map +1 -0
- package/build/components/date-format-picker/index.js +3 -3
- package/build/components/date-format-picker/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 +72 -36
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +20 -6
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +25 -12
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +1 -1
- 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/index.native.js +23 -0
- package/build/components/index.native.js.map +1 -1
- package/build/components/inserter/media-tab/hooks.js +10 -11
- package/build/components/inserter/media-tab/hooks.js.map +1 -1
- package/build/components/inserter/media-tab/media-list.js +5 -108
- package/build/components/inserter/media-tab/media-list.js.map +1 -1
- package/build/components/inserter/media-tab/media-preview.js +242 -0
- package/build/components/inserter/media-tab/media-preview.js.map +1 -0
- 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/settings-drawer.js +1 -1
- package/build/components/link-control/settings-drawer.js.map +1 -1
- package/build/components/link-control/settings.js +1 -0
- package/build/components/link-control/settings.js.map +1 -1
- package/build/components/list-view/block.js +17 -3
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +2 -2
- package/build/components/list-view/branch.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/leaf.js +10 -6
- package/build/components/list-view/leaf.js.map +1 -1
- package/build/components/list-view/use-list-view-scroll-into-view.js +51 -0
- package/build/components/list-view/use-list-view-scroll-into-view.js.map +1 -0
- 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/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 +34 -4
- package/build/components/off-canvas-editor/leaf-more-menu.js.map +1 -1
- package/build/components/off-canvas-editor/link-ui.js +1 -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 -43
- 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/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 +72 -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/gap.js +0 -202
- package/build/hooks/gap.js.map +1 -1
- package/build/hooks/layout.js +14 -5
- package/build/hooks/layout.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 +50 -65
- 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/defaults.js +28 -1
- package/build/store/defaults.js.map +1 -1
- package/build/store/reducer.js +53 -47
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +5 -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-inspector/index.js +9 -9
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js +37 -0
- package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -0
- 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-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/child-layout-control/index.js +98 -0
- package/build-module/components/child-layout-control/index.js.map +1 -0
- 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/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 +71 -33
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/index.js +2 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +26 -11
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +1 -1
- 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/index.native.js +2 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inserter/media-tab/hooks.js +10 -11
- package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-list.js +6 -105
- package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-preview.js +222 -0
- package/build-module/components/inserter/media-tab/media-preview.js.map +1 -0
- 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/settings-drawer.js +1 -1
- package/build-module/components/link-control/settings-drawer.js.map +1 -1
- package/build-module/components/link-control/settings.js +1 -0
- package/build-module/components/link-control/settings.js.map +1 -1
- package/build-module/components/list-view/block.js +16 -3
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +2 -2
- package/build-module/components/list-view/branch.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/leaf.js +8 -4
- package/build-module/components/list-view/leaf.js.map +1 -1
- package/build-module/components/list-view/use-list-view-scroll-into-view.js +42 -0
- package/build-module/components/list-view/use-list-view-scroll-into-view.js.map +1 -0
- 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/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 +36 -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 +1 -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 -43
- 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/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 +75 -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/gap.js +0 -183
- package/build-module/hooks/gap.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/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 +52 -65
- 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/defaults.js +28 -1
- package/build-module/store/defaults.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 +5 -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 +33 -21
- package/build-style/style.css +33 -21
- package/package.json +31 -31
- package/src/components/block-draggable/test/__snapshots__/index.native.js.snap +24 -24
- package/src/components/block-inspector/index.js +11 -14
- package/src/components/block-inspector/useBlockInspectorAnimationSettings.js +53 -0
- 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-settings-menu/block-settings-dropdown.js +4 -1
- package/src/components/block-styles/index.js +5 -1
- 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/date-format-picker/index.js +6 -8
- package/src/components/date-format-picker/style.scss +0 -5
- package/src/components/global-styles/dimensions-panel.js +627 -0
- package/src/components/global-styles/hooks.js +88 -45
- package/src/components/global-styles/index.js +5 -1
- package/src/components/global-styles/typography-panel.js +33 -8
- package/src/components/global-styles/use-global-styles-output.js +4 -3
- package/src/components/global-styles/utils.js +2 -0
- package/src/components/index.native.js +5 -0
- package/src/components/inner-blocks/test/__snapshots__/index.js.snap +1 -1
- package/src/components/inserter/media-tab/hooks.js +9 -8
- package/src/components/inserter/media-tab/media-list.js +3 -122
- package/src/components/inserter/media-tab/media-preview.js +268 -0
- package/src/components/inserter/style.scss +22 -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/settings-drawer.js +2 -1
- package/src/components/link-control/settings.js +1 -0
- package/src/components/link-control/style.scss +18 -8
- package/src/components/link-control/test/index.js +3 -3
- package/src/components/list-view/block.js +19 -1
- package/src/components/list-view/branch.js +1 -2
- package/src/components/list-view/expander.js +1 -0
- package/src/components/list-view/leaf.js +43 -29
- package/src/components/list-view/use-list-view-scroll-into-view.js +48 -0
- package/src/components/media-replace-flow/style.scss +7 -9
- package/src/components/off-canvas-editor/appender.js +13 -16
- 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 +57 -15
- package/src/components/off-canvas-editor/link-ui.js +1 -0
- package/src/components/responsive-block-control/index.js +1 -0
- package/src/components/rich-text/index.js +8 -44
- package/src/components/rich-text/use-delete.js +59 -0
- package/src/components/rich-text/use-input-rules.js +13 -5
- package/src/components/spacing-sizes-control/style.scss +1 -1
- 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 +85 -269
- package/src/hooks/duotone.js +100 -30
- package/src/hooks/gap.js +0 -208
- package/src/hooks/layout.js +19 -6
- 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 +66 -88
- package/src/hooks/utils.js +90 -0
- package/src/layouts/flex.js +1 -0
- package/src/store/actions.js +12 -4
- package/src/store/defaults.js +14 -1
- package/src/store/reducer.js +68 -43
- package/src/store/selectors.js +8 -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/tsconfig.tsbuildinfo +1 -1
- package/build/hooks/child-layout.js +0 -213
- package/build/hooks/child-layout.js.map +0 -1
- package/build/hooks/min-height.js +0 -139
- package/build/hooks/min-height.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/min-height.js +0 -116
- package/build-module/hooks/min-height.js.map +0 -1
- package/src/hooks/child-layout.js +0 -195
- package/src/hooks/min-height.js +0 -104
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect } from '@wordpress/data';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { store as blockEditorStore } from '../../store';
|
|
10
|
+
|
|
11
|
+
export default function useBlockInspectorAnimationSettings(
|
|
12
|
+
blockType,
|
|
13
|
+
selectedBlockClientId
|
|
14
|
+
) {
|
|
15
|
+
return useSelect(
|
|
16
|
+
( select ) => {
|
|
17
|
+
if ( blockType ) {
|
|
18
|
+
const globalBlockInspectorAnimationSettings =
|
|
19
|
+
select( blockEditorStore ).getSettings()
|
|
20
|
+
.blockInspectorAnimation;
|
|
21
|
+
|
|
22
|
+
// Get the name of the block that will allow it's children to be animated.
|
|
23
|
+
const animationParent =
|
|
24
|
+
globalBlockInspectorAnimationSettings?.animationParent;
|
|
25
|
+
|
|
26
|
+
// Determine whether the animationParent block is a parent of the selected block.
|
|
27
|
+
const { getSelectedBlockClientId, getBlockParentsByBlockName } =
|
|
28
|
+
select( blockEditorStore );
|
|
29
|
+
const _selectedBlockClientId = getSelectedBlockClientId();
|
|
30
|
+
const animationParentBlockClientId = getBlockParentsByBlockName(
|
|
31
|
+
_selectedBlockClientId,
|
|
32
|
+
animationParent,
|
|
33
|
+
true
|
|
34
|
+
)[ 0 ];
|
|
35
|
+
|
|
36
|
+
// If the selected block is not a child of the animationParent block,
|
|
37
|
+
// and not an animationParent block itself, don't animate.
|
|
38
|
+
if (
|
|
39
|
+
! animationParentBlockClientId &&
|
|
40
|
+
blockType.name !== animationParent
|
|
41
|
+
) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return globalBlockInspectorAnimationSettings?.[
|
|
46
|
+
blockType.name
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
},
|
|
51
|
+
[ selectedBlockClientId, blockType ]
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -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
|
}
|
|
@@ -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 ) }
|
|
@@ -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"
|
|
@@ -50,14 +50,12 @@ export default function DateFormatPicker( {
|
|
|
50
50
|
<fieldset className="block-editor-date-format-picker">
|
|
51
51
|
<VisuallyHidden as="legend">{ __( 'Date format' ) }</VisuallyHidden>
|
|
52
52
|
<ToggleControl
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</>
|
|
60
|
-
}
|
|
53
|
+
__nextHasNoMarginBottom
|
|
54
|
+
label={ __( 'Default format' ) }
|
|
55
|
+
help={ `${ __( 'Example:' ) } ${ dateI18n(
|
|
56
|
+
defaultFormat,
|
|
57
|
+
EXAMPLE_DATE
|
|
58
|
+
) }` }
|
|
61
59
|
checked={ ! format }
|
|
62
60
|
onChange={ ( checked ) =>
|
|
63
61
|
onChange( checked ? null : defaultFormat )
|
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
margin-bottom: $grid-unit-20;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.block-editor-date-format-picker__default-format-toggle-control__hint {
|
|
6
|
-
color: $gray-700;
|
|
7
|
-
display: block;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
5
|
.block-editor-date-format-picker__custom-format-select-control__custom-option {
|
|
11
6
|
border-top: 1px solid $gray-300;
|
|
12
7
|
|