@wordpress/block-editor 8.0.8 → 8.0.12-next.33ec3857e2.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/README.md +4 -0
- package/build/components/block-caption/index.native.js +14 -3
- package/build/components/block-caption/index.native.js.map +1 -1
- package/build/components/block-inspector/index.js +12 -23
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list-appender/index.js +3 -11
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-preview/auto.js +10 -2
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-preview/index.js +51 -0
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-settings/container.native.js +2 -1
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-styles/index.js +110 -134
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/menu-items.js +63 -0
- package/build/components/block-styles/menu-items.js.map +1 -0
- package/build/components/block-styles/preview-panel.js +45 -0
- package/build/components/block-styles/preview-panel.js.map +1 -0
- package/build/components/block-styles/use-styles-for-block.js +119 -0
- package/build/components/block-styles/use-styles-for-block.js.map +1 -0
- package/build/components/block-styles/utils.js +39 -0
- package/build/components/block-styles/utils.js.map +1 -1
- package/build/components/block-switcher/block-styles-menu.js +3 -23
- package/build/components/block-switcher/block-styles-menu.js.map +1 -1
- package/build/components/block-tools/back-compat.js +2 -1
- package/build/components/block-tools/back-compat.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +11 -1
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/button-block-appender/index.js +2 -1
- package/build/components/button-block-appender/index.js.map +1 -1
- package/build/components/colors-gradients/control.js +1 -0
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +51 -10
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/default-block-appender/index.js +16 -19
- package/build/components/default-block-appender/index.js.map +1 -1
- package/build/components/default-style-picker/index.js +18 -3
- package/build/components/default-style-picker/index.js.map +1 -1
- package/build/components/iframe/index.js +3 -4
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/index.js +17 -10
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/default-block-appender.js +2 -4
- package/build/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build/components/inserter/index.native.js +1 -1
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/tabs.native.js +7 -4
- package/build/components/inserter/tabs.native.js.map +1 -1
- package/build/components/inspector-controls/block-support-slot-container.js +2 -1
- package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
- package/build/components/inspector-controls/fill.native.js +3 -5
- package/build/components/inspector-controls/fill.native.js.map +1 -1
- package/build/components/inspector-controls/groups.js +2 -0
- package/build/components/inspector-controls/groups.js.map +1 -1
- package/build/components/inspector-controls/slot.js +1 -3
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/letter-spacing-control/index.js +6 -6
- package/build/components/letter-spacing-control/index.js.map +1 -1
- package/build/components/list-view/block-select-button.js +23 -3
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/media-placeholder/index.js +2 -0
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-replace-flow/index.js +2 -0
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/rich-text/file-paste-handler.js +1 -1
- package/build/components/rich-text/file-paste-handler.js.map +1 -1
- package/build/components/rich-text/prevent-event-discovery.js +33 -0
- package/build/components/rich-text/prevent-event-discovery.js.map +1 -0
- package/build/components/rich-text/use-input-rules.js +3 -1
- package/build/components/rich-text/use-input-rules.js.map +1 -1
- package/build/components/selection-scroll-into-view/index.js +2 -1
- package/build/components/selection-scroll-into-view/index.js.map +1 -1
- package/build/components/use-display-block-controls/index.native.js +45 -0
- package/build/components/use-display-block-controls/index.native.js.map +1 -0
- package/build/components/use-on-block-drop/index.js +7 -3
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/writing-flow/use-multi-selection.js +3 -1
- package/build/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build/hooks/border-color.js +63 -5
- package/build/hooks/border-color.js.map +1 -1
- package/build/hooks/border-radius.js +47 -0
- package/build/hooks/border-radius.js.map +1 -1
- package/build/hooks/border-style.js +41 -0
- package/build/hooks/border-style.js.map +1 -1
- package/build/hooks/border-width.js +70 -31
- package/build/hooks/border-width.js.map +1 -1
- package/build/hooks/border.js +81 -11
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/letter-spacing.js +1 -1
- package/build/hooks/letter-spacing.js.map +1 -1
- package/build/hooks/typography.js +1 -1
- package/build/hooks/typography.js.map +1 -1
- package/build/store/actions.js +1 -2
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +5 -1
- package/build/store/defaults.js.map +1 -1
- package/build/store/reducer.js +10 -82
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +25 -7
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-paste-event-data.js +1 -1
- package/build/utils/get-paste-event-data.js.map +1 -1
- package/build/utils/parse-css-unit-to-px.js +1 -1
- package/build/utils/parse-css-unit-to-px.js.map +1 -1
- package/build/utils/transform-styles/index.js +2 -3
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-caption/index.native.js +13 -3
- package/build-module/components/block-caption/index.native.js.map +1 -1
- package/build-module/components/block-inspector/index.js +12 -23
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list-appender/index.js +3 -10
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-preview/auto.js +10 -2
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-preview/index.js +46 -0
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-settings/container.native.js +2 -1
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-styles/index.js +112 -133
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/menu-items.js +50 -0
- package/build-module/components/block-styles/menu-items.js.map +1 -0
- package/build-module/components/block-styles/preview-panel.js +35 -0
- package/build-module/components/block-styles/preview-panel.js.map +1 -0
- package/build-module/components/block-styles/use-styles-for-block.js +107 -0
- package/build-module/components/block-styles/use-styles-for-block.js.map +1 -0
- package/build-module/components/block-styles/utils.js +34 -0
- package/build-module/components/block-styles/utils.js.map +1 -1
- package/build-module/components/block-switcher/block-styles-menu.js +3 -21
- package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
- package/build-module/components/block-tools/back-compat.js +2 -1
- package/build-module/components/block-tools/back-compat.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +11 -1
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/button-block-appender/index.js +2 -1
- package/build-module/components/button-block-appender/index.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +1 -0
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +54 -13
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build-module/components/default-block-appender/index.js +15 -18
- package/build-module/components/default-block-appender/index.js.map +1 -1
- package/build-module/components/default-style-picker/index.js +17 -3
- package/build-module/components/default-style-picker/index.js.map +1 -1
- package/build-module/components/iframe/index.js +3 -4
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/index.js +2 -2
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/default-block-appender.js +2 -4
- package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build-module/components/inserter/index.native.js +2 -2
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/tabs.native.js +7 -4
- package/build-module/components/inserter/tabs.native.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-slot-container.js +2 -1
- package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
- package/build-module/components/inspector-controls/fill.native.js +3 -5
- package/build-module/components/inspector-controls/fill.native.js.map +1 -1
- package/build-module/components/inspector-controls/groups.js +2 -0
- package/build-module/components/inspector-controls/groups.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +1 -3
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/letter-spacing-control/index.js +6 -6
- package/build-module/components/letter-spacing-control/index.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +22 -3
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +2 -0
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +2 -0
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/rich-text/file-paste-handler.js +1 -1
- package/build-module/components/rich-text/file-paste-handler.js.map +1 -1
- package/build-module/components/rich-text/prevent-event-discovery.js +25 -0
- package/build-module/components/rich-text/prevent-event-discovery.js.map +1 -0
- package/build-module/components/rich-text/use-input-rules.js +2 -1
- package/build-module/components/rich-text/use-input-rules.js.map +1 -1
- package/build-module/components/selection-scroll-into-view/index.js +2 -1
- package/build-module/components/selection-scroll-into-view/index.js.map +1 -1
- package/build-module/components/use-display-block-controls/index.native.js +34 -0
- package/build-module/components/use-display-block-controls/index.native.js.map +1 -0
- package/build-module/components/use-on-block-drop/index.js +7 -3
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/writing-flow/use-multi-selection.js +3 -4
- package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build-module/hooks/border-color.js +61 -7
- package/build-module/hooks/border-color.js.map +1 -1
- package/build-module/hooks/border-radius.js +42 -0
- package/build-module/hooks/border-radius.js.map +1 -1
- package/build-module/hooks/border-style.js +36 -0
- package/build-module/hooks/border-style.js.map +1 -1
- package/build-module/hooks/border-width.js +66 -32
- package/build-module/hooks/border-width.js.map +1 -1
- package/build-module/hooks/border.js +80 -12
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/letter-spacing.js +1 -1
- package/build-module/hooks/letter-spacing.js.map +1 -1
- package/build-module/hooks/typography.js +1 -1
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/store/actions.js +1 -2
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +5 -1
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/reducer.js +11 -83
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +24 -7
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-paste-event-data.js +1 -1
- package/build-module/utils/get-paste-event-data.js.map +1 -1
- package/build-module/utils/parse-css-unit-to-px.js +1 -1
- package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +2 -3
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/style-rtl.css +229 -182
- package/build-style/style.css +229 -182
- package/package.json +27 -27
- package/src/components/block-caption/index.native.js +22 -4
- package/src/components/block-inspector/index.js +14 -17
- package/src/components/block-list-appender/index.js +5 -21
- package/src/components/block-preview/auto.js +7 -2
- package/src/components/block-preview/index.js +60 -0
- package/src/components/block-preview/style.scss +23 -0
- package/src/components/block-preview/test/index.js +114 -0
- package/src/components/block-settings/container.native.js +1 -0
- package/src/components/block-styles/index.js +125 -145
- package/src/components/block-styles/menu-items.js +49 -0
- package/src/components/block-styles/preview-panel.js +36 -0
- package/src/components/block-styles/style.scss +59 -51
- package/src/components/block-styles/test/{index.js → utils.js} +60 -1
- package/src/components/block-styles/use-styles-for-block.js +99 -0
- package/src/components/block-styles/utils.js +39 -0
- package/src/components/block-switcher/block-styles-menu.js +3 -38
- package/src/components/block-tools/back-compat.js +1 -0
- package/src/components/block-tools/insertion-point.js +10 -1
- package/src/components/border-style-control/style.scss +3 -3
- package/src/components/button-block-appender/index.js +1 -0
- package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -0
- package/src/components/colors-gradients/control.js +3 -0
- package/src/components/colors-gradients/panel-color-gradient-settings.js +75 -19
- package/src/components/colors-gradients/style.scss +42 -5
- package/src/components/default-block-appender/index.js +17 -24
- package/src/components/default-block-appender/style.scss +4 -0
- package/src/components/default-block-appender/test/__snapshots__/index.js.snap +12 -24
- package/src/components/default-block-appender/test/index.js +4 -14
- package/src/components/default-style-picker/index.js +18 -6
- package/src/components/iframe/index.js +6 -3
- package/src/components/index.js +5 -2
- package/src/components/inner-blocks/README.md +2 -0
- package/src/components/inner-blocks/default-block-appender.js +2 -7
- package/src/components/inserter/index.native.js +2 -2
- package/src/components/inserter/tabs.native.js +5 -4
- package/src/components/inspector-controls/block-support-slot-container.js +3 -1
- package/src/components/inspector-controls/fill.native.js +4 -3
- package/src/components/inspector-controls/groups.js +2 -0
- package/src/components/inspector-controls/slot.js +2 -7
- package/src/components/letter-spacing-control/index.js +6 -6
- package/src/components/link-control/README.md +1 -1
- package/src/components/link-control/test/index.js +2 -0
- package/src/components/list-view/block-select-button.js +20 -1
- package/src/components/media-placeholder/index.js +2 -0
- package/src/components/media-replace-flow/index.js +2 -0
- package/src/components/rich-text/file-paste-handler.js +3 -1
- package/src/components/rich-text/prevent-event-discovery.js +23 -0
- package/src/components/rich-text/use-input-rules.js +2 -1
- package/src/components/selection-scroll-into-view/index.js +1 -0
- package/src/components/url-input/README.md +5 -0
- package/src/components/use-display-block-controls/index.native.js +38 -0
- package/src/components/use-on-block-drop/index.js +7 -3
- package/src/components/writing-flow/test/use-multi-selection.js +36 -0
- package/src/components/writing-flow/use-multi-selection.js +12 -9
- package/src/hooks/border-color.js +55 -3
- package/src/hooks/border-radius.js +32 -0
- package/src/hooks/border-style.js +26 -0
- package/src/hooks/border-width.js +56 -32
- package/src/hooks/border.js +115 -20
- package/src/hooks/border.scss +3 -17
- package/src/hooks/dimensions.scss +5 -0
- package/src/hooks/letter-spacing.js +1 -1
- package/src/hooks/typography.js +1 -1
- package/src/store/actions.js +1 -2
- package/src/store/defaults.js +2 -0
- package/src/store/reducer.js +13 -104
- package/src/store/selectors.js +37 -7
- package/src/style.scss +4 -3
- package/src/utils/get-paste-event-data.js +1 -1
- package/src/utils/parse-css-unit-to-px.js +1 -1
- package/src/utils/test/parse-css-unit-to-px.js +1 -0
- package/src/utils/transform-styles/index.js +13 -16
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/use-canvas-click-redirect/index.js +0 -66
- package/build/components/use-canvas-click-redirect/index.js.map +0 -1
- package/build-module/components/use-canvas-click-redirect/index.js +0 -54
- package/build-module/components/use-canvas-click-redirect/index.js.map +0 -1
- package/src/components/use-canvas-click-redirect/index.js +0 -57
|
@@ -6,6 +6,7 @@ import { find } from 'lodash';
|
|
|
6
6
|
* WordPress dependencies
|
|
7
7
|
*/
|
|
8
8
|
import TokenList from '@wordpress/token-list';
|
|
9
|
+
import { _x } from '@wordpress/i18n';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Returns the active style from the given className.
|
|
@@ -51,3 +52,41 @@ export function replaceActiveStyle( className, activeStyle, newStyle ) {
|
|
|
51
52
|
|
|
52
53
|
return list.value;
|
|
53
54
|
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Returns a collection of styles that can be represented on the frontend.
|
|
58
|
+
* The function checks a style collection for a default style. If none is found, it adds one to
|
|
59
|
+
* act as a fallback for when there is no active style applied to a block. The default item also serves
|
|
60
|
+
* as a switch on the frontend to deactivate non-default styles.
|
|
61
|
+
*
|
|
62
|
+
* @param {Array} styles Block style variations.
|
|
63
|
+
*
|
|
64
|
+
* @return {Array<Object?>} The style collection.
|
|
65
|
+
*/
|
|
66
|
+
export function getRenderedStyles( styles ) {
|
|
67
|
+
if ( ! styles || styles.length === 0 ) {
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return getDefaultStyle( styles )
|
|
72
|
+
? styles
|
|
73
|
+
: [
|
|
74
|
+
{
|
|
75
|
+
name: 'default',
|
|
76
|
+
label: _x( 'Default', 'block style' ),
|
|
77
|
+
isDefault: true,
|
|
78
|
+
},
|
|
79
|
+
...styles,
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Returns a style object from a collection of styles where that style object is the default block style.
|
|
85
|
+
*
|
|
86
|
+
* @param {Array} styles Block style variations.
|
|
87
|
+
*
|
|
88
|
+
* @return {Object?} The default style object, if found.
|
|
89
|
+
*/
|
|
90
|
+
export function getDefaultStyle( styles ) {
|
|
91
|
+
return find( styles, 'isDefault' );
|
|
92
|
+
}
|
|
@@ -3,56 +3,21 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { MenuGroup } from '@wordpress/components';
|
|
6
|
-
import { useState } from '@wordpress/element';
|
|
7
|
-
import { useSelect } from '@wordpress/data';
|
|
8
|
-
import {
|
|
9
|
-
cloneBlock,
|
|
10
|
-
getBlockFromExample,
|
|
11
|
-
store as blocksStore,
|
|
12
|
-
} from '@wordpress/blocks';
|
|
13
6
|
|
|
14
7
|
/**
|
|
15
8
|
* Internal dependencies
|
|
16
9
|
*/
|
|
17
|
-
import
|
|
18
|
-
import PreviewBlockPopover from './preview-block-popover';
|
|
10
|
+
import BlockStylesMenuItems from '../block-styles/menu-items';
|
|
19
11
|
|
|
20
12
|
export default function BlockStylesMenu( { hoveredBlock, onSwitch } ) {
|
|
21
|
-
const {
|
|
22
|
-
const [ hoveredClassName, setHoveredClassName ] = useState();
|
|
23
|
-
const blockType = useSelect(
|
|
24
|
-
( select ) => select( blocksStore ).getBlockType( name ),
|
|
25
|
-
[ name ]
|
|
26
|
-
);
|
|
13
|
+
const { clientId } = hoveredBlock;
|
|
27
14
|
|
|
28
15
|
return (
|
|
29
16
|
<MenuGroup
|
|
30
17
|
label={ __( 'Styles' ) }
|
|
31
18
|
className="block-editor-block-switcher__styles__menugroup"
|
|
32
19
|
>
|
|
33
|
-
{
|
|
34
|
-
<PreviewBlockPopover
|
|
35
|
-
blocks={
|
|
36
|
-
blockType && blockType.example
|
|
37
|
-
? getBlockFromExample( blockType.name, {
|
|
38
|
-
attributes: {
|
|
39
|
-
...blockType.example.attributes,
|
|
40
|
-
className: hoveredClassName,
|
|
41
|
-
},
|
|
42
|
-
innerBlocks: blockType.example.innerBlocks,
|
|
43
|
-
} )
|
|
44
|
-
: cloneBlock( hoveredBlock, {
|
|
45
|
-
className: hoveredClassName,
|
|
46
|
-
} )
|
|
47
|
-
}
|
|
48
|
-
/>
|
|
49
|
-
) }
|
|
50
|
-
<BlockStyles
|
|
51
|
-
clientId={ clientId }
|
|
52
|
-
onSwitch={ onSwitch }
|
|
53
|
-
onHoverClassName={ setHoveredClassName }
|
|
54
|
-
itemRole="menuitem"
|
|
55
|
-
/>
|
|
20
|
+
<BlockStylesMenuItems clientId={ clientId } onSwitch={ onSwitch } />
|
|
56
21
|
</MenuGroup>
|
|
57
22
|
);
|
|
58
23
|
}
|
|
@@ -32,7 +32,7 @@ function InsertionPointPopover( {
|
|
|
32
32
|
__unstablePopoverSlot,
|
|
33
33
|
__unstableContentRef,
|
|
34
34
|
} ) {
|
|
35
|
-
const { selectBlock } = useDispatch( blockEditorStore );
|
|
35
|
+
const { selectBlock, hideInsertionPoint } = useDispatch( blockEditorStore );
|
|
36
36
|
const openRef = useContext( InsertionPointOpenRef );
|
|
37
37
|
const ref = useRef();
|
|
38
38
|
const {
|
|
@@ -195,6 +195,14 @@ function InsertionPointPopover( {
|
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
+
function maybeHideInserterPoint( event ) {
|
|
199
|
+
// Only hide the inserter if it's triggered on the wrapper,
|
|
200
|
+
// and the inserter is not open.
|
|
201
|
+
if ( event.target === ref.current && ! openRef.current ) {
|
|
202
|
+
hideInsertionPoint();
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
198
206
|
// Only show the in-between inserter between blocks, so when there's a
|
|
199
207
|
// previous and a next element.
|
|
200
208
|
const showInsertionPointInserter =
|
|
@@ -309,6 +317,7 @@ function InsertionPointPopover( {
|
|
|
309
317
|
className={ classnames( className, {
|
|
310
318
|
'is-with-inserter': showInsertionPointInserter,
|
|
311
319
|
} ) }
|
|
320
|
+
onHoverEnd={ maybeHideInserterPoint }
|
|
312
321
|
style={ style }
|
|
313
322
|
>
|
|
314
323
|
<motion.div
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
.components-border-style-control {
|
|
2
2
|
legend {
|
|
3
|
-
line-height: 1.
|
|
4
|
-
|
|
3
|
+
line-height: 1.4;
|
|
4
|
+
margin-bottom: $grid-unit-10;
|
|
5
|
+
padding: 0;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
.components-border-style-control__buttons {
|
|
8
9
|
display: inline-flex;
|
|
9
|
-
margin-bottom: $grid-unit-30;
|
|
10
10
|
|
|
11
11
|
.components-button.has-icon {
|
|
12
12
|
min-width: 30px;
|
|
@@ -90,6 +90,7 @@ function ButtonBlockAppender(
|
|
|
90
90
|
export const ButtonBlockerAppender = forwardRef( ( props, ref ) => {
|
|
91
91
|
deprecated( `wp.blockEditor.ButtonBlockerAppender`, {
|
|
92
92
|
alternative: 'wp.blockEditor.ButtonBlockAppender',
|
|
93
|
+
since: '5.9',
|
|
93
94
|
} );
|
|
94
95
|
|
|
95
96
|
return ButtonBlockAppender( props, ref );
|
|
@@ -7,8 +7,17 @@ import { every, isEmpty } from 'lodash';
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
11
|
-
|
|
10
|
+
import {
|
|
11
|
+
__experimentalItemGroup as ItemGroup,
|
|
12
|
+
__experimentalItem as Item,
|
|
13
|
+
__experimentalHStack as HStack,
|
|
14
|
+
__experimentalSpacer as Spacer,
|
|
15
|
+
FlexItem,
|
|
16
|
+
ColorIndicator,
|
|
17
|
+
PanelBody,
|
|
18
|
+
Dropdown,
|
|
19
|
+
} from '@wordpress/components';
|
|
20
|
+
import { sprintf, __, isRTL } from '@wordpress/i18n';
|
|
12
21
|
|
|
13
22
|
/**
|
|
14
23
|
* Internal dependencies
|
|
@@ -127,6 +136,13 @@ export const PanelColorGradientSettingsInner = ( {
|
|
|
127
136
|
</span>
|
|
128
137
|
);
|
|
129
138
|
|
|
139
|
+
let dropdownPosition;
|
|
140
|
+
let popoverProps;
|
|
141
|
+
if ( __experimentalIsRenderedInSidebar ) {
|
|
142
|
+
dropdownPosition = isRTL() ? 'bottom right' : 'bottom left';
|
|
143
|
+
popoverProps = { __unstableForcePosition: true };
|
|
144
|
+
}
|
|
145
|
+
|
|
130
146
|
return (
|
|
131
147
|
<PanelBody
|
|
132
148
|
className={ classnames(
|
|
@@ -136,23 +152,63 @@ export const PanelColorGradientSettingsInner = ( {
|
|
|
136
152
|
title={ showTitle ? titleElement : undefined }
|
|
137
153
|
{ ...props }
|
|
138
154
|
>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
<ItemGroup
|
|
156
|
+
isBordered
|
|
157
|
+
isSeparated
|
|
158
|
+
className="block-editor-panel-color-gradient-settings__item-group"
|
|
159
|
+
>
|
|
160
|
+
{ settings.map( ( setting, index ) => (
|
|
161
|
+
<Dropdown
|
|
162
|
+
position={ dropdownPosition }
|
|
163
|
+
popoverProps={ popoverProps }
|
|
164
|
+
className="block-editor-panel-color-gradient-settings__dropdown"
|
|
165
|
+
key={ index }
|
|
166
|
+
contentClassName="block-editor-panel-color-gradient-settings__dropdown-content"
|
|
167
|
+
renderToggle={ ( { isOpen, onToggle } ) => {
|
|
168
|
+
return (
|
|
169
|
+
<Item
|
|
170
|
+
onClick={ onToggle }
|
|
171
|
+
className={ classnames(
|
|
172
|
+
'block-editor-panel-color-gradient-settings__item',
|
|
173
|
+
{ 'is-open': isOpen }
|
|
174
|
+
) }
|
|
175
|
+
>
|
|
176
|
+
<HStack justify="flex-start">
|
|
177
|
+
<ColorIndicator
|
|
178
|
+
className="block-editor-panel-color-gradient-settings__color-indicator"
|
|
179
|
+
colorValue={
|
|
180
|
+
setting.gradientValue ??
|
|
181
|
+
setting.colorValue
|
|
182
|
+
}
|
|
183
|
+
/>
|
|
184
|
+
<FlexItem>{ setting.label }</FlexItem>
|
|
185
|
+
</HStack>
|
|
186
|
+
</Item>
|
|
187
|
+
);
|
|
188
|
+
} }
|
|
189
|
+
renderContent={ () => (
|
|
190
|
+
<ColorGradientControl
|
|
191
|
+
showTitle={ false }
|
|
192
|
+
{ ...{
|
|
193
|
+
colors,
|
|
194
|
+
gradients,
|
|
195
|
+
disableCustomColors,
|
|
196
|
+
disableCustomGradients,
|
|
197
|
+
__experimentalHasMultipleOrigins,
|
|
198
|
+
__experimentalIsRenderedInSidebar,
|
|
199
|
+
enableAlpha,
|
|
200
|
+
...setting,
|
|
201
|
+
} }
|
|
202
|
+
/>
|
|
203
|
+
) }
|
|
204
|
+
/>
|
|
205
|
+
) ) }
|
|
206
|
+
</ItemGroup>
|
|
207
|
+
{ !! children && (
|
|
208
|
+
<>
|
|
209
|
+
<Spacer marginY={ 4 } /> { children }
|
|
210
|
+
</>
|
|
211
|
+
) }
|
|
156
212
|
</PanelBody>
|
|
157
213
|
);
|
|
158
214
|
};
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.block-editor-panel-color-gradient-settings {
|
|
8
|
-
.
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
.block-editor-panel-color-gradient-settings__panel-title {
|
|
9
|
+
display: flex;
|
|
10
|
+
gap: $grid-unit-15;
|
|
11
11
|
|
|
12
|
-
&__panel-title {
|
|
13
12
|
.component-color-indicator {
|
|
14
|
-
|
|
13
|
+
width: $grid-unit-15;
|
|
14
|
+
height: $grid-unit-15;
|
|
15
|
+
align-self: center;
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -37,4 +38,40 @@
|
|
|
37
38
|
.block-editor-block-inspector & .components-base-control {
|
|
38
39
|
margin-bottom: inherit;
|
|
39
40
|
}
|
|
41
|
+
|
|
42
|
+
.block-editor-panel-color-gradient-settings__dropdown {
|
|
43
|
+
display: block;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.block-editor-panel-color-gradient-settings__dropdown-content .components-popover__content {
|
|
48
|
+
& > div {
|
|
49
|
+
width: $sidebar-width;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@include break-medium() {
|
|
54
|
+
.block-editor-panel-color-gradient-settings__dropdown-content .components-popover__content {
|
|
55
|
+
margin-right: #{ math.div($sidebar-width, 2) + $grid-unit-20 } !important;
|
|
56
|
+
margin-top: #{ -($grid-unit-60 + $grid-unit-15) } !important;
|
|
57
|
+
}
|
|
40
58
|
}
|
|
59
|
+
|
|
60
|
+
.block-editor-panel-color-gradient-settings__dropdown:last-child > div {
|
|
61
|
+
border-bottom-width: 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.block-editor-panel-color-gradient-settings__item {
|
|
65
|
+
padding-top: $grid-unit-15 !important;
|
|
66
|
+
padding-bottom: $grid-unit-15 !important;
|
|
67
|
+
.block-editor-panel-color-gradient-settings__color-indicator {
|
|
68
|
+
// Show a diagonal line (crossed out) for empty swatches.
|
|
69
|
+
background: linear-gradient(-45deg, transparent 48%, $gray-300 48%, $gray-300 52%, transparent 52%);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&.is-open {
|
|
73
|
+
background: $gray-100;
|
|
74
|
+
color: var(--wp-admin-theme-color);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
@@ -8,9 +8,9 @@ import classnames from 'classnames';
|
|
|
8
8
|
*/
|
|
9
9
|
import { __ } from '@wordpress/i18n';
|
|
10
10
|
import { compose } from '@wordpress/compose';
|
|
11
|
-
import { getDefaultBlockName } from '@wordpress/blocks';
|
|
12
11
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
13
12
|
import { withSelect, withDispatch } from '@wordpress/data';
|
|
13
|
+
import { ENTER, SPACE } from '@wordpress/keycodes';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Internal dependencies
|
|
@@ -26,13 +26,12 @@ export const ZWNBSP = '\ufeff';
|
|
|
26
26
|
|
|
27
27
|
export function DefaultBlockAppender( {
|
|
28
28
|
isLocked,
|
|
29
|
-
isVisible,
|
|
30
29
|
onAppend,
|
|
31
30
|
showPrompt,
|
|
32
31
|
placeholder,
|
|
33
32
|
rootClientId,
|
|
34
33
|
} ) {
|
|
35
|
-
if ( isLocked
|
|
34
|
+
if ( isLocked ) {
|
|
36
35
|
return null;
|
|
37
36
|
}
|
|
38
37
|
|
|
@@ -48,20 +47,23 @@ export function DefaultBlockAppender( {
|
|
|
48
47
|
>
|
|
49
48
|
<p
|
|
50
49
|
tabIndex="0"
|
|
51
|
-
// Only necessary for `useCanvasClickRedirect` to consider it
|
|
52
|
-
// as a target. Ideally it should consider any tabbable target,
|
|
53
|
-
// but the inserter is rendered in place while it should be
|
|
54
|
-
// rendered in a popover, just like it does for an empty
|
|
55
|
-
// paragraph block.
|
|
56
|
-
contentEditable
|
|
57
|
-
suppressContentEditableWarning
|
|
58
50
|
// We want this element to be styled as a paragraph by themes.
|
|
59
51
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
|
|
60
52
|
role="button"
|
|
61
|
-
aria-label={ __( 'Add block' ) }
|
|
53
|
+
aria-label={ __( 'Add default block' ) }
|
|
62
54
|
// A wrapping container for this one already has the wp-block className.
|
|
63
55
|
className="block-editor-default-block-appender__content"
|
|
64
|
-
|
|
56
|
+
onKeyDown={ ( event ) => {
|
|
57
|
+
if ( ENTER === event.keyCode || SPACE === event.keyCode ) {
|
|
58
|
+
onAppend();
|
|
59
|
+
}
|
|
60
|
+
} }
|
|
61
|
+
onClick={ () => onAppend() }
|
|
62
|
+
onFocus={ () => {
|
|
63
|
+
if ( showPrompt ) {
|
|
64
|
+
onAppend();
|
|
65
|
+
}
|
|
66
|
+
} }
|
|
65
67
|
>
|
|
66
68
|
{ showPrompt ? value : ZWNBSP }
|
|
67
69
|
</p>
|
|
@@ -77,23 +79,14 @@ export function DefaultBlockAppender( {
|
|
|
77
79
|
|
|
78
80
|
export default compose(
|
|
79
81
|
withSelect( ( select, ownProps ) => {
|
|
80
|
-
const {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
isBlockValid,
|
|
84
|
-
getSettings,
|
|
85
|
-
getTemplateLock,
|
|
86
|
-
} = select( blockEditorStore );
|
|
82
|
+
const { getBlockCount, getSettings, getTemplateLock } = select(
|
|
83
|
+
blockEditorStore
|
|
84
|
+
);
|
|
87
85
|
|
|
88
86
|
const isEmpty = ! getBlockCount( ownProps.rootClientId );
|
|
89
|
-
const isLastBlockDefault =
|
|
90
|
-
getBlockName( ownProps.lastBlockClientId ) ===
|
|
91
|
-
getDefaultBlockName();
|
|
92
|
-
const isLastBlockValid = isBlockValid( ownProps.lastBlockClientId );
|
|
93
87
|
const { bodyPlaceholder } = getSettings();
|
|
94
88
|
|
|
95
89
|
return {
|
|
96
|
-
isVisible: isEmpty || ! isLastBlockDefault || ! isLastBlockValid,
|
|
97
90
|
showPrompt: isEmpty,
|
|
98
91
|
isLocked: !! getTemplateLock( ownProps.rootClientId ),
|
|
99
92
|
placeholder: bodyPlaceholder,
|
|
@@ -6,24 +6,12 @@ exports[`DefaultBlockAppender should append a default block when input focused 1
|
|
|
6
6
|
data-root-client-id=""
|
|
7
7
|
>
|
|
8
8
|
<p
|
|
9
|
-
aria-label="Add block"
|
|
9
|
+
aria-label="Add default block"
|
|
10
10
|
className="block-editor-default-block-appender__content"
|
|
11
|
-
|
|
12
|
-
onFocus={
|
|
13
|
-
|
|
14
|
-
"calls": Array [
|
|
15
|
-
Array [],
|
|
16
|
-
],
|
|
17
|
-
"results": Array [
|
|
18
|
-
Object {
|
|
19
|
-
"type": "return",
|
|
20
|
-
"value": undefined,
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
}
|
|
24
|
-
}
|
|
11
|
+
onClick={[Function]}
|
|
12
|
+
onFocus={[Function]}
|
|
13
|
+
onKeyDown={[Function]}
|
|
25
14
|
role="button"
|
|
26
|
-
suppressContentEditableWarning={true}
|
|
27
15
|
tabIndex="0"
|
|
28
16
|
>
|
|
29
17
|
Type / to choose a block
|
|
@@ -42,12 +30,12 @@ exports[`DefaultBlockAppender should match snapshot 1`] = `
|
|
|
42
30
|
data-root-client-id=""
|
|
43
31
|
>
|
|
44
32
|
<p
|
|
45
|
-
aria-label="Add block"
|
|
33
|
+
aria-label="Add default block"
|
|
46
34
|
className="block-editor-default-block-appender__content"
|
|
47
|
-
|
|
48
|
-
onFocus={[
|
|
35
|
+
onClick={[Function]}
|
|
36
|
+
onFocus={[Function]}
|
|
37
|
+
onKeyDown={[Function]}
|
|
49
38
|
role="button"
|
|
50
|
-
suppressContentEditableWarning={true}
|
|
51
39
|
tabIndex="0"
|
|
52
40
|
>
|
|
53
41
|
Type / to choose a block
|
|
@@ -66,12 +54,12 @@ exports[`DefaultBlockAppender should optionally show without prompt 1`] = `
|
|
|
66
54
|
data-root-client-id=""
|
|
67
55
|
>
|
|
68
56
|
<p
|
|
69
|
-
aria-label="Add block"
|
|
57
|
+
aria-label="Add default block"
|
|
70
58
|
className="block-editor-default-block-appender__content"
|
|
71
|
-
|
|
72
|
-
onFocus={[
|
|
59
|
+
onClick={[Function]}
|
|
60
|
+
onFocus={[Function]}
|
|
61
|
+
onKeyDown={[Function]}
|
|
73
62
|
role="button"
|
|
74
|
-
suppressContentEditableWarning={true}
|
|
75
63
|
tabIndex="0"
|
|
76
64
|
>
|
|
77
65
|
|
|
@@ -14,16 +14,10 @@ describe( 'DefaultBlockAppender', () => {
|
|
|
14
14
|
expect( onAppend ).toHaveBeenCalledWith();
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
it( 'should render nothing if not visible', () => {
|
|
18
|
-
const wrapper = shallow( <DefaultBlockAppender /> );
|
|
19
|
-
|
|
20
|
-
expect( wrapper.type() ).toBe( null );
|
|
21
|
-
} );
|
|
22
|
-
|
|
23
17
|
it( 'should match snapshot', () => {
|
|
24
18
|
const onAppend = jest.fn();
|
|
25
19
|
const wrapper = shallow(
|
|
26
|
-
<DefaultBlockAppender
|
|
20
|
+
<DefaultBlockAppender onAppend={ onAppend } showPrompt />
|
|
27
21
|
);
|
|
28
22
|
|
|
29
23
|
expect( wrapper ).toMatchSnapshot();
|
|
@@ -32,10 +26,10 @@ describe( 'DefaultBlockAppender', () => {
|
|
|
32
26
|
it( 'should append a default block when input focused', () => {
|
|
33
27
|
const onAppend = jest.fn();
|
|
34
28
|
const wrapper = shallow(
|
|
35
|
-
<DefaultBlockAppender
|
|
29
|
+
<DefaultBlockAppender onAppend={ onAppend } showPrompt />
|
|
36
30
|
);
|
|
37
31
|
|
|
38
|
-
wrapper.find( 'p' ).simulate( '
|
|
32
|
+
wrapper.find( 'p' ).simulate( 'click' );
|
|
39
33
|
|
|
40
34
|
expect( wrapper ).toMatchSnapshot();
|
|
41
35
|
|
|
@@ -45,11 +39,7 @@ describe( 'DefaultBlockAppender', () => {
|
|
|
45
39
|
it( 'should optionally show without prompt', () => {
|
|
46
40
|
const onAppend = jest.fn();
|
|
47
41
|
const wrapper = shallow(
|
|
48
|
-
<DefaultBlockAppender
|
|
49
|
-
isVisible
|
|
50
|
-
onAppend={ onAppend }
|
|
51
|
-
showPrompt={ false }
|
|
52
|
-
/>
|
|
42
|
+
<DefaultBlockAppender onAppend={ onAppend } showPrompt={ false } />
|
|
53
43
|
);
|
|
54
44
|
const input = wrapper.find( 'p' );
|
|
55
45
|
|
|
@@ -11,6 +11,7 @@ import { useSelect } from '@wordpress/data';
|
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
13
|
import { store as blockEditorStore } from '../../store';
|
|
14
|
+
import { getDefaultStyle } from '../block-styles/utils';
|
|
14
15
|
|
|
15
16
|
export default function DefaultStylePicker( { blockName } ) {
|
|
16
17
|
const {
|
|
@@ -38,6 +39,9 @@ export default function DefaultStylePicker( { blockName } ) {
|
|
|
38
39
|
],
|
|
39
40
|
[ styles ]
|
|
40
41
|
);
|
|
42
|
+
const defaultStyleName = useMemo( () => getDefaultStyle( styles )?.name, [
|
|
43
|
+
styles,
|
|
44
|
+
] );
|
|
41
45
|
const selectOnChange = useCallback(
|
|
42
46
|
( blockStyle ) => {
|
|
43
47
|
onUpdatePreferredStyleVariations( blockName, blockStyle );
|
|
@@ -45,14 +49,22 @@ export default function DefaultStylePicker( { blockName } ) {
|
|
|
45
49
|
[ blockName, onUpdatePreferredStyleVariations ]
|
|
46
50
|
);
|
|
47
51
|
|
|
52
|
+
// Until the functionality is migrated to global styles,
|
|
53
|
+
// only show the default style picker if a non-default style has already been selected.
|
|
54
|
+
if ( ! preferredStyle || preferredStyle === defaultStyleName ) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
|
|
48
58
|
return (
|
|
49
59
|
onUpdatePreferredStyleVariations && (
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
60
|
+
<div className="default-style-picker__default-switcher">
|
|
61
|
+
<SelectControl
|
|
62
|
+
options={ selectOptions }
|
|
63
|
+
value={ preferredStyle || '' }
|
|
64
|
+
label={ __( 'Default Style' ) }
|
|
65
|
+
onChange={ selectOnChange }
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
56
68
|
)
|
|
57
69
|
);
|
|
58
70
|
}
|
|
@@ -164,12 +164,15 @@ async function loadScript( head, { id, src } ) {
|
|
|
164
164
|
} );
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
function Iframe(
|
|
167
|
+
function Iframe(
|
|
168
|
+
{ contentRef, children, head, tabIndex = 0, assets, ...props },
|
|
169
|
+
ref
|
|
170
|
+
) {
|
|
168
171
|
const [ , forceRender ] = useReducer( () => ( {} ) );
|
|
169
172
|
const [ iframeDocument, setIframeDocument ] = useState();
|
|
170
173
|
const [ bodyClasses, setBodyClasses ] = useState( [] );
|
|
171
|
-
const styles = useParsedAssets(
|
|
172
|
-
const scripts = useParsedAssets(
|
|
174
|
+
const styles = useParsedAssets( assets?.styles );
|
|
175
|
+
const scripts = useParsedAssets( assets?.scripts );
|
|
173
176
|
const clearerRef = useBlockSelectionClearer();
|
|
174
177
|
const [ before, writingFlowRef, after ] = useWritingFlow();
|
|
175
178
|
const setRef = useRefEffect( ( node ) => {
|
package/src/components/index.js
CHANGED
|
@@ -24,6 +24,7 @@ export { default as BlockColorsStyleSelector } from './color-style-selector';
|
|
|
24
24
|
export { default as BlockEdit, useBlockEditContext } from './block-edit';
|
|
25
25
|
export { default as BlockIcon } from './block-icon';
|
|
26
26
|
export { default as BlockNavigationDropdown } from './block-navigation/dropdown';
|
|
27
|
+
export { default as BlockStyles } from './block-styles';
|
|
27
28
|
export { default as __experimentalBlockVariationPicker } from './block-variation-picker';
|
|
28
29
|
export { default as __experimentalBlockPatternSetup } from './block-pattern-setup';
|
|
29
30
|
export { default as __experimentalBlockVariationTransforms } from './block-variation-transforms';
|
|
@@ -103,7 +104,10 @@ export { default as BlockList } from './block-list';
|
|
|
103
104
|
export { useBlockProps } from './block-list/use-block-props';
|
|
104
105
|
export { LayoutStyle as __experimentalLayoutStyle } from './block-list/layout';
|
|
105
106
|
export { default as BlockMover } from './block-mover';
|
|
106
|
-
export {
|
|
107
|
+
export {
|
|
108
|
+
default as BlockPreview,
|
|
109
|
+
useBlockPreview as __experimentalUseBlockPreview,
|
|
110
|
+
} from './block-preview';
|
|
107
111
|
export {
|
|
108
112
|
default as BlockSelectionClearer,
|
|
109
113
|
useBlockSelectionClearer as __unstableUseBlockSelectionClearer,
|
|
@@ -137,7 +141,6 @@ export {
|
|
|
137
141
|
} from './typewriter';
|
|
138
142
|
export { default as Warning } from './warning';
|
|
139
143
|
export { default as WritingFlow } from './writing-flow';
|
|
140
|
-
export { useCanvasClickRedirect as __unstableUseCanvasClickRedirect } from './use-canvas-click-redirect';
|
|
141
144
|
export { default as useBlockDisplayInformation } from './use-block-display-information';
|
|
142
145
|
export { default as __unstableIframe } from './iframe';
|
|
143
146
|
export { default as __experimentalUseNoRecursiveRenders } from './use-no-recursive-renders';
|
|
@@ -41,6 +41,8 @@ _Note:_ A block can render at most a single `InnerBlocks` and `InnerBlocks.Conte
|
|
|
41
41
|
|
|
42
42
|
_Note:_ Because the save step will automatically apply props to the element returned by `save`, it is important to include the wrapping `div` in the above simple example even though we are applying no props of our own. In a real-world example, you may have your own attributes to apply to the saved markup, or sibling content adjacent to the rendered nested blocks.
|
|
43
43
|
|
|
44
|
+
_Note:_ Inner blocks, by default, are not visible inside a WordPress excerpt. If you wish your block to appear then it needs to be returned from the `excerpt_allowed_wrapper_blocks` filter. More details can be found on the [filter reference page](https://developer.wordpress.org/reference/hooks/excerpt_allowed_wrapper_blocks/) page, as well as the [excerpt_remove_blocks](https://developer.wordpress.org/reference/functions/excerpt_remove_blocks/) page.
|
|
45
|
+
|
|
44
46
|
## Props
|
|
45
47
|
|
|
46
48
|
### `allowedBlocks`
|