@wordpress/block-editor 14.10.1 → 14.11.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/background-image-control/index.js +0 -1
- package/build/components/background-image-control/index.js.map +1 -1
- package/build/components/block-actions/index.js +0 -3
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-inspector/index.js +6 -11
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-focus-handler.js +1 -1
- package/build/components/block-list/use-block-props/use-focus-handler.js.map +1 -1
- package/build/components/block-rename/modal.js +36 -11
- package/build/components/block-rename/modal.js.map +1 -1
- package/build/components/block-rename/rename-control.js +2 -43
- package/build/components/block-rename/rename-control.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +12 -3
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-styles/preview.native.js +1 -1
- package/build/components/block-styles/preview.native.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js +7 -7
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/block-variation-transformations.js +2 -2
- package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build/components/block-switcher/index.js +1 -1
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/use-transformed-patterns.js +1 -1
- package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build/components/block-toolbar/index.native.js +2 -2
- package/build/components/block-toolbar/index.native.js.map +1 -1
- package/build/components/date-format-picker/index.js +1 -1
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +2 -2
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +2 -2
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +3 -3
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/iframe/get-compatibility-styles.js +1 -1
- package/build/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build/components/iframe/index.js +1 -1
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-size-control/index.js +2 -1
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.native.js +1 -1
- package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build/components/line-height-control/index.native.js +1 -1
- package/build/components/line-height-control/index.native.js.map +1 -1
- package/build/components/link-control/index.js +1 -1
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/use-search-handler.js +1 -1
- package/build/components/link-control/use-search-handler.js.map +1 -1
- package/build/components/list-view/block-select-button.js +5 -2
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/media-placeholder/index.js +1 -0
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/observe-typing/index.js +1 -1
- package/build/components/observe-typing/index.js.map +1 -1
- package/build/components/provider/index.js +0 -2
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-sync.js +2 -2
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/rich-text/event-listeners/input-rules.js +3 -3
- package/build/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build/components/rich-text/native/use-format-types.js +1 -1
- package/build/components/rich-text/native/use-format-types.js.map +1 -1
- package/build/components/rich-text/use-format-types.js +1 -1
- package/build/components/rich-text/use-format-types.js.map +1 -1
- package/build/components/tabbed-sidebar/index.js +39 -0
- package/build/components/tabbed-sidebar/index.js.map +1 -1
- package/build/components/typewriter/index.js +1 -1
- package/build/components/typewriter/index.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +3 -3
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/use-block-commands/index.js +1 -1
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +1 -1
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/store/actions.js +1 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +5 -5
- package/build/store/selectors.js.map +1 -1
- package/build/utils/transform-styles/index.js +1 -1
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build/utils/use-notify-copy.js +19 -11
- package/build/utils/use-notify-copy.js.map +1 -1
- package/build-module/components/background-image-control/index.js +0 -1
- package/build-module/components/background-image-control/index.js.map +1 -1
- package/build-module/components/block-actions/index.js +0 -3
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +6 -11
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-handler.js +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-handler.js.map +1 -1
- package/build-module/components/block-rename/modal.js +36 -11
- package/build-module/components/block-rename/modal.js.map +1 -1
- package/build-module/components/block-rename/rename-control.js +2 -43
- package/build-module/components/block-rename/rename-control.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +12 -3
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-styles/preview.native.js +1 -1
- package/build-module/components/block-styles/preview.native.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js +7 -7
- package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/block-variation-transformations.js +2 -2
- package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build-module/components/block-switcher/index.js +1 -1
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/use-transformed-patterns.js +1 -1
- package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build-module/components/block-toolbar/index.native.js +2 -2
- package/build-module/components/block-toolbar/index.native.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +1 -1
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +2 -2
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +2 -2
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +3 -3
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/iframe/get-compatibility-styles.js +1 -1
- package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build-module/components/iframe/index.js +1 -1
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-size-control/index.js +3 -2
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.native.js +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build-module/components/line-height-control/index.native.js +1 -1
- package/build-module/components/line-height-control/index.native.js.map +1 -1
- package/build-module/components/link-control/index.js +1 -1
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/use-search-handler.js +1 -1
- package/build-module/components/link-control/use-search-handler.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +6 -3
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +1 -0
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/observe-typing/index.js +1 -1
- package/build-module/components/observe-typing/index.js.map +1 -1
- package/build-module/components/provider/index.js +0 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +2 -2
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/input-rules.js +3 -3
- package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build-module/components/rich-text/native/use-format-types.js +1 -1
- package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
- package/build-module/components/rich-text/use-format-types.js +1 -1
- package/build-module/components/rich-text/use-format-types.js.map +1 -1
- package/build-module/components/tabbed-sidebar/index.js +39 -0
- package/build-module/components/tabbed-sidebar/index.js.map +1 -1
- package/build-module/components/typewriter/index.js +1 -1
- package/build-module/components/typewriter/index.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +3 -3
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +1 -1
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +1 -1
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/store/actions.js +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +5 -5
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +1 -1
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-module/utils/use-notify-copy.js +19 -11
- package/build-module/utils/use-notify-copy.js.map +1 -1
- package/build-style/content-rtl.css +0 -9
- package/build-style/content.css +0 -9
- package/build-style/style-rtl.css +18 -21
- package/build-style/style.css +18 -21
- package/package.json +34 -33
- package/src/components/background-image-control/index.js +0 -1
- package/src/components/block-actions/index.js +0 -3
- package/src/components/block-icon/content.scss +1 -1
- package/src/components/{block-card → block-icon}/stories/index.story.js +16 -26
- package/src/components/block-icon/style.scss +1 -1
- package/src/components/block-inspector/index.js +7 -10
- package/src/components/block-list/use-block-props/use-focus-handler.js +1 -1
- package/src/components/block-preview/style.scss +1 -1
- package/src/components/block-rename/modal.js +40 -12
- package/src/components/block-rename/rename-control.js +1 -53
- package/src/components/block-settings-menu/block-settings-dropdown.js +16 -2
- package/src/components/block-styles/preview.native.js +1 -1
- package/src/components/block-switcher/block-transformations-menu.js +9 -9
- package/src/components/block-switcher/block-variation-transformations.js +2 -2
- package/src/components/block-switcher/index.js +1 -1
- package/src/components/block-switcher/use-transformed-patterns.js +1 -1
- package/src/components/block-toolbar/index.native.js +2 -2
- package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
- package/src/components/colors-gradients/style.scss +1 -0
- package/src/components/colors-gradients/test/control.js +2 -2
- package/src/components/date-format-picker/index.js +1 -1
- package/src/components/duotone-control/style.scss +2 -2
- package/src/components/global-styles/filters-panel.js +4 -2
- package/src/components/global-styles/image-settings-panel.js +2 -2
- package/src/components/global-styles/test/typography-utils.js +1 -1
- package/src/components/global-styles/use-global-styles-output.js +3 -3
- package/src/components/iframe/get-compatibility-styles.js +1 -1
- package/src/components/iframe/index.js +1 -1
- package/src/components/image-size-control/index.js +6 -2
- package/src/components/inner-blocks/README.md +1 -1
- package/src/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
- package/src/components/inserter/reusable-blocks-tab.native.js +1 -1
- package/src/components/line-height-control/index.native.js +1 -1
- package/src/components/link-control/README.md +2 -2
- package/src/components/link-control/index.js +1 -1
- package/src/components/link-control/test/index.js +3 -3
- package/src/components/link-control/use-search-handler.js +1 -1
- package/src/components/list-view/README.md +1 -1
- package/src/components/list-view/block-select-button.js +5 -5
- package/src/components/list-view/style.scss +3 -7
- package/src/components/media-placeholder/content.scss +0 -8
- package/src/components/media-placeholder/index.js +1 -0
- package/src/components/media-placeholder/style.scss +7 -0
- package/src/components/observe-typing/index.js +1 -1
- package/src/components/provider/index.js +0 -1
- package/src/components/provider/use-block-sync.js +2 -2
- package/src/components/resolution-tool/stories/index.story.js +52 -2
- package/src/components/rich-text/README.md +1 -1
- package/src/components/rich-text/event-listeners/input-rules.js +3 -3
- package/src/components/rich-text/native/use-format-types.js +1 -1
- package/src/components/rich-text/use-format-types.js +1 -1
- package/src/components/tabbed-sidebar/README.md +24 -13
- package/src/components/tabbed-sidebar/index.js +38 -0
- package/src/components/tabbed-sidebar/stories/index.story.js +104 -0
- package/src/components/typewriter/index.js +1 -1
- package/src/components/unit-control/README.md +1 -1
- package/src/components/unit-control/stories/index.story.js +124 -0
- package/src/components/url-popover/image-url-input-ui.js +3 -3
- package/src/components/use-block-commands/index.js +1 -1
- package/src/components/use-moving-animation/index.js +1 -1
- package/src/components/use-settings/README.md +1 -1
- package/src/components/warning/content.scss +1 -1
- package/src/components/writing-flow/test/index.js +1 -1
- package/src/hooks/color.scss +0 -7
- package/src/store/actions.js +1 -1
- package/src/store/selectors.js +5 -5
- package/src/store/test/private-selectors.js +1 -1
- package/src/store/test/selectors.js +3 -3
- package/src/style.scss +1 -0
- package/src/utils/test/sorting.js +1 -1
- package/src/utils/transform-styles/index.js +1 -1
- package/src/utils/use-notify-copy.js +51 -43
- package/tsconfig.json +1 -0
|
@@ -11,24 +11,44 @@ import {
|
|
|
11
11
|
import { __, sprintf } from '@wordpress/i18n';
|
|
12
12
|
import { useState } from '@wordpress/element';
|
|
13
13
|
import { speak } from '@wordpress/a11y';
|
|
14
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Internal dependencies
|
|
17
18
|
*/
|
|
19
|
+
import { store as blockEditorStore } from '../../store';
|
|
20
|
+
import { useBlockDisplayInformation } from '..';
|
|
18
21
|
import isEmptyString from './is-empty-string';
|
|
19
22
|
|
|
20
|
-
export default function BlockRenameModal( {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
export default function BlockRenameModal( { clientId, onClose } ) {
|
|
24
|
+
const [ editedBlockName, setEditedBlockName ] = useState();
|
|
25
|
+
|
|
26
|
+
const blockInformation = useBlockDisplayInformation( clientId );
|
|
27
|
+
const { metadata } = useSelect(
|
|
28
|
+
( select ) => {
|
|
29
|
+
const { getBlockAttributes } = select( blockEditorStore );
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
metadata: getBlockAttributes( clientId )?.metadata,
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
[ clientId ]
|
|
36
|
+
);
|
|
37
|
+
const { updateBlockAttributes } = useDispatch( blockEditorStore );
|
|
38
|
+
|
|
39
|
+
const blockName = metadata?.name || '';
|
|
40
|
+
const originalBlockName = blockInformation?.title;
|
|
25
41
|
// Pattern Overrides is a WordPress-only feature but it also uses the Block Binding API.
|
|
26
42
|
// Ideally this should not be inside the block editor package, but we keep it here for simplicity.
|
|
27
|
-
hasOverridesWarning
|
|
28
|
-
|
|
29
|
-
|
|
43
|
+
const hasOverridesWarning =
|
|
44
|
+
!! blockName &&
|
|
45
|
+
!! metadata?.bindings &&
|
|
46
|
+
Object.values( metadata.bindings ).some(
|
|
47
|
+
( binding ) => binding.source === 'core/pattern-overrides'
|
|
48
|
+
);
|
|
30
49
|
|
|
31
|
-
const nameHasChanged =
|
|
50
|
+
const nameHasChanged =
|
|
51
|
+
editedBlockName !== undefined && editedBlockName !== blockName;
|
|
32
52
|
const nameIsOriginal = editedBlockName === originalBlockName;
|
|
33
53
|
const nameIsEmpty = isEmptyString( editedBlockName );
|
|
34
54
|
|
|
@@ -37,6 +57,8 @@ export default function BlockRenameModal( {
|
|
|
37
57
|
const autoSelectInputText = ( event ) => event.target.select();
|
|
38
58
|
|
|
39
59
|
const handleSubmit = () => {
|
|
60
|
+
const newName =
|
|
61
|
+
nameIsOriginal || nameIsEmpty ? undefined : editedBlockName;
|
|
40
62
|
const message =
|
|
41
63
|
nameIsOriginal || nameIsEmpty
|
|
42
64
|
? sprintf(
|
|
@@ -52,7 +74,12 @@ export default function BlockRenameModal( {
|
|
|
52
74
|
|
|
53
75
|
// Must be assertive to immediately announce change.
|
|
54
76
|
speak( message, 'assertive' );
|
|
55
|
-
|
|
77
|
+
updateBlockAttributes( [ clientId ], {
|
|
78
|
+
metadata: {
|
|
79
|
+
...metadata,
|
|
80
|
+
name: newName,
|
|
81
|
+
},
|
|
82
|
+
} );
|
|
56
83
|
|
|
57
84
|
// Immediate close avoids ability to hit save multiple times.
|
|
58
85
|
onClose();
|
|
@@ -81,7 +108,7 @@ export default function BlockRenameModal( {
|
|
|
81
108
|
<TextControl
|
|
82
109
|
__nextHasNoMarginBottom
|
|
83
110
|
__next40pxDefaultSize
|
|
84
|
-
value={ editedBlockName }
|
|
111
|
+
value={ editedBlockName ?? blockName }
|
|
85
112
|
label={ __( 'Name' ) }
|
|
86
113
|
help={
|
|
87
114
|
hasOverridesWarning
|
|
@@ -105,7 +132,8 @@ export default function BlockRenameModal( {
|
|
|
105
132
|
|
|
106
133
|
<Button
|
|
107
134
|
__next40pxDefaultSize
|
|
108
|
-
|
|
135
|
+
accessibleWhenDisabled
|
|
136
|
+
disabled={ ! isNameValid }
|
|
109
137
|
variant="primary"
|
|
110
138
|
type="submit"
|
|
111
139
|
>
|
|
@@ -2,54 +2,17 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { MenuItem } from '@wordpress/components';
|
|
5
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
5
|
import { __ } from '@wordpress/i18n';
|
|
7
6
|
import { useState } from '@wordpress/element';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Internal dependencies
|
|
11
10
|
*/
|
|
12
|
-
import { store as blockEditorStore } from '../../store';
|
|
13
|
-
import { useBlockDisplayInformation } from '..';
|
|
14
|
-
import isEmptyString from './is-empty-string';
|
|
15
11
|
import BlockRenameModal from './modal';
|
|
16
12
|
|
|
17
13
|
export default function BlockRenameControl( { clientId } ) {
|
|
18
14
|
const [ renamingBlock, setRenamingBlock ] = useState( false );
|
|
19
15
|
|
|
20
|
-
const { metadata } = useSelect(
|
|
21
|
-
( select ) => {
|
|
22
|
-
const { getBlockAttributes } = select( blockEditorStore );
|
|
23
|
-
|
|
24
|
-
const _metadata = getBlockAttributes( clientId )?.metadata;
|
|
25
|
-
return {
|
|
26
|
-
metadata: _metadata,
|
|
27
|
-
};
|
|
28
|
-
},
|
|
29
|
-
[ clientId ]
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
const { updateBlockAttributes } = useDispatch( blockEditorStore );
|
|
33
|
-
|
|
34
|
-
const customName = metadata?.name;
|
|
35
|
-
const hasPatternOverrides =
|
|
36
|
-
!! customName &&
|
|
37
|
-
!! metadata?.bindings &&
|
|
38
|
-
Object.values( metadata.bindings ).some(
|
|
39
|
-
( binding ) => binding.source === 'core/pattern-overrides'
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
function onChange( newName ) {
|
|
43
|
-
updateBlockAttributes( [ clientId ], {
|
|
44
|
-
metadata: {
|
|
45
|
-
...metadata,
|
|
46
|
-
name: newName,
|
|
47
|
-
},
|
|
48
|
-
} );
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const blockInformation = useBlockDisplayInformation( clientId );
|
|
52
|
-
|
|
53
16
|
return (
|
|
54
17
|
<>
|
|
55
18
|
<MenuItem
|
|
@@ -63,23 +26,8 @@ export default function BlockRenameControl( { clientId } ) {
|
|
|
63
26
|
</MenuItem>
|
|
64
27
|
{ renamingBlock && (
|
|
65
28
|
<BlockRenameModal
|
|
66
|
-
|
|
67
|
-
originalBlockName={ blockInformation?.title }
|
|
68
|
-
hasOverridesWarning={ hasPatternOverrides }
|
|
29
|
+
clientId={ clientId }
|
|
69
30
|
onClose={ () => setRenamingBlock( false ) }
|
|
70
|
-
onSave={ ( newName ) => {
|
|
71
|
-
// If the new value is the block's original name (e.g. `Group`)
|
|
72
|
-
// or it is an empty string then assume the intent is to reset
|
|
73
|
-
// the value. Therefore reset the metadata.
|
|
74
|
-
if (
|
|
75
|
-
newName === blockInformation?.title ||
|
|
76
|
-
isEmptyString( newName )
|
|
77
|
-
) {
|
|
78
|
-
newName = undefined;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
onChange( newName );
|
|
82
|
-
} }
|
|
83
31
|
/>
|
|
84
32
|
) }
|
|
85
33
|
</>
|
|
@@ -26,17 +26,30 @@ import BlockSettingsMenuControls from '../block-settings-menu-controls';
|
|
|
26
26
|
import BlockParentSelectorMenuItem from './block-parent-selector-menu-item';
|
|
27
27
|
import { store as blockEditorStore } from '../../store';
|
|
28
28
|
import { unlock } from '../../lock-unlock';
|
|
29
|
+
import { useNotifyCopy } from '../../utils/use-notify-copy';
|
|
29
30
|
|
|
30
31
|
const POPOVER_PROPS = {
|
|
31
32
|
className: 'block-editor-block-settings-menu__popover',
|
|
32
33
|
placement: 'bottom-start',
|
|
33
34
|
};
|
|
34
35
|
|
|
35
|
-
function CopyMenuItem( {
|
|
36
|
+
function CopyMenuItem( {
|
|
37
|
+
clientIds,
|
|
38
|
+
onCopy,
|
|
39
|
+
label,
|
|
40
|
+
shortcut,
|
|
41
|
+
eventType = 'copy',
|
|
42
|
+
} ) {
|
|
36
43
|
const { getBlocksByClientId } = useSelect( blockEditorStore );
|
|
44
|
+
const notifyCopy = useNotifyCopy();
|
|
37
45
|
const ref = useCopyToClipboard(
|
|
38
46
|
() => serialize( getBlocksByClientId( clientIds ) ),
|
|
39
|
-
|
|
47
|
+
() => {
|
|
48
|
+
if ( onCopy && eventType === 'copy' ) {
|
|
49
|
+
onCopy();
|
|
50
|
+
}
|
|
51
|
+
notifyCopy( eventType, clientIds );
|
|
52
|
+
}
|
|
40
53
|
);
|
|
41
54
|
const copyMenuItemLabel = label ? label : __( 'Copy' );
|
|
42
55
|
return (
|
|
@@ -305,6 +318,7 @@ export function BlockSettingsDropdown( {
|
|
|
305
318
|
clientIds={ clientIds }
|
|
306
319
|
onCopy={ onCopy }
|
|
307
320
|
label={ __( 'Copy styles' ) }
|
|
321
|
+
eventType="copyStyles"
|
|
308
322
|
/>
|
|
309
323
|
<MenuItem onClick={ onPasteStyles }>
|
|
310
324
|
{ __( 'Paste styles' ) }
|
|
@@ -33,7 +33,7 @@ function StylePreview( { onPress, isActive, style, url } ) {
|
|
|
33
33
|
|
|
34
34
|
function onLayout() {
|
|
35
35
|
const columnsNum =
|
|
36
|
-
// To indicate scroll
|
|
36
|
+
// To indicate scroll availability, there is a need to display additional half the column.
|
|
37
37
|
Math.floor( BottomSheet.getWidth() / MAX_ITEM_WIDTH ) + HALF_COLUMN;
|
|
38
38
|
setItemWidth( BottomSheet.getWidth() / columnsNum );
|
|
39
39
|
}
|
|
@@ -27,20 +27,20 @@ import BlockVariationTransformations from './block-variation-transformations';
|
|
|
27
27
|
* @return {Record<string, Object[]>} The grouped block transformations.
|
|
28
28
|
*/
|
|
29
29
|
function useGroupedTransforms( possibleBlockTransformations ) {
|
|
30
|
-
const
|
|
30
|
+
const priorityContentTransformationBlocks = {
|
|
31
31
|
'core/paragraph': 1,
|
|
32
32
|
'core/heading': 2,
|
|
33
33
|
'core/list': 3,
|
|
34
34
|
'core/quote': 4,
|
|
35
35
|
};
|
|
36
36
|
const transformations = useMemo( () => {
|
|
37
|
-
const
|
|
38
|
-
|
|
37
|
+
const priorityTextTransformsNames = Object.keys(
|
|
38
|
+
priorityContentTransformationBlocks
|
|
39
39
|
);
|
|
40
40
|
const groupedPossibleTransforms = possibleBlockTransformations.reduce(
|
|
41
41
|
( accumulator, item ) => {
|
|
42
42
|
const { name } = item;
|
|
43
|
-
if (
|
|
43
|
+
if ( priorityTextTransformsNames.includes( name ) ) {
|
|
44
44
|
accumulator.priorityTextTransformations.push( item );
|
|
45
45
|
} else {
|
|
46
46
|
accumulator.restTransformations.push( item );
|
|
@@ -71,8 +71,8 @@ function useGroupedTransforms( possibleBlockTransformations ) {
|
|
|
71
71
|
// Order the priority text transformations.
|
|
72
72
|
transformations.priorityTextTransformations.sort(
|
|
73
73
|
( { name: currentName }, { name: nextName } ) => {
|
|
74
|
-
return
|
|
75
|
-
|
|
74
|
+
return priorityContentTransformationBlocks[ currentName ] <
|
|
75
|
+
priorityContentTransformationBlocks[ nextName ]
|
|
76
76
|
? -1
|
|
77
77
|
: 1;
|
|
78
78
|
}
|
|
@@ -125,7 +125,7 @@ const BlockTransformationsMenu = ( {
|
|
|
125
125
|
/>
|
|
126
126
|
) }
|
|
127
127
|
{ priorityTextTransformations.map( ( item ) => (
|
|
128
|
-
<
|
|
128
|
+
<BlockTransformationItem
|
|
129
129
|
key={ item.name }
|
|
130
130
|
item={ item }
|
|
131
131
|
onSelect={ onSelect }
|
|
@@ -151,7 +151,7 @@ function RestTransformationItems( {
|
|
|
151
151
|
setHoveredTransformItemName,
|
|
152
152
|
} ) {
|
|
153
153
|
return restTransformations.map( ( item ) => (
|
|
154
|
-
<
|
|
154
|
+
<BlockTransformationItem
|
|
155
155
|
key={ item.name }
|
|
156
156
|
item={ item }
|
|
157
157
|
onSelect={ onSelect }
|
|
@@ -160,7 +160,7 @@ function RestTransformationItems( {
|
|
|
160
160
|
) );
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
function
|
|
163
|
+
function BlockTransformationItem( {
|
|
164
164
|
item,
|
|
165
165
|
onSelect,
|
|
166
166
|
setHoveredTransformItemName,
|
|
@@ -74,7 +74,7 @@ const BlockVariationTransformations = ( {
|
|
|
74
74
|
/>
|
|
75
75
|
) }
|
|
76
76
|
{ transformations?.map( ( item ) => (
|
|
77
|
-
<
|
|
77
|
+
<BlockVariationTransformationItem
|
|
78
78
|
key={ item.name }
|
|
79
79
|
item={ item }
|
|
80
80
|
onSelect={ onSelect }
|
|
@@ -85,7 +85,7 @@ const BlockVariationTransformations = ( {
|
|
|
85
85
|
);
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
function
|
|
88
|
+
function BlockVariationTransformationItem( {
|
|
89
89
|
item,
|
|
90
90
|
onSelect,
|
|
91
91
|
setHoveredTransformItemName,
|
|
@@ -82,7 +82,7 @@ function BlockSwitcherDropdownMenuContents( {
|
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
// Simple block
|
|
85
|
+
// Simple block transformation based on the `Block Transforms` API.
|
|
86
86
|
function onBlockTransform( name ) {
|
|
87
87
|
const newBlocks = switchToBlockType( blocks, name );
|
|
88
88
|
replaceBlocks( clientIds, newBlocks );
|
|
@@ -72,7 +72,7 @@ export const getPatternTransformedBlocks = (
|
|
|
72
72
|
// No need to loop through other pattern's blocks.
|
|
73
73
|
break;
|
|
74
74
|
}
|
|
75
|
-
// Bail
|
|
75
|
+
// Bail early if a selected block has not been matched.
|
|
76
76
|
if ( ! isMatch ) {
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
@@ -14,7 +14,7 @@ import UngroupButton from '../ungroup-button';
|
|
|
14
14
|
import { BlockSettingsButton } from '../block-settings';
|
|
15
15
|
import { store as blockEditorStore } from '../../store';
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const REMOVE_EMPTY_PARENT_BLOCKS = [
|
|
18
18
|
'core/buttons',
|
|
19
19
|
'core/columns',
|
|
20
20
|
'core/social-links',
|
|
@@ -69,7 +69,7 @@ export default function BlockToolbar( { anchorNodeRef } ) {
|
|
|
69
69
|
// have inner blocks, ideally we should match the behavior as in
|
|
70
70
|
// the Web editor and show a placeholder instead of removing the parent.
|
|
71
71
|
if (
|
|
72
|
-
|
|
72
|
+
REMOVE_EMPTY_PARENT_BLOCKS.includes( parentBlockName ) &&
|
|
73
73
|
parentNumberOfInnerBlocks === 1
|
|
74
74
|
) {
|
|
75
75
|
removeBlock( rootClientId );
|
|
@@ -217,7 +217,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
|
|
|
217
217
|
class="components-circular-option-picker__option-wrapper"
|
|
218
218
|
>
|
|
219
219
|
<button
|
|
220
|
-
aria-label="
|
|
220
|
+
aria-label="red"
|
|
221
221
|
aria-selected="true"
|
|
222
222
|
class="components-button components-circular-option-picker__option is-next-40px-default-size"
|
|
223
223
|
data-active-item="true"
|
|
@@ -51,7 +51,7 @@ describe( 'ColorPaletteControl', () => {
|
|
|
51
51
|
).toBeInTheDocument();
|
|
52
52
|
|
|
53
53
|
// Is showing the two predefined Colors.
|
|
54
|
-
expect( screen.
|
|
54
|
+
expect( screen.getAllByRole( 'option' ) ).toHaveLength( 2 );
|
|
55
55
|
} );
|
|
56
56
|
|
|
57
57
|
it( 'renders the color picker and does not render tabs if it is only possible to select a color', async () => {
|
|
@@ -80,7 +80,7 @@ describe( 'ColorPaletteControl', () => {
|
|
|
80
80
|
).not.toBeInTheDocument();
|
|
81
81
|
|
|
82
82
|
// Is showing the two predefined Colors.
|
|
83
|
-
expect( screen.
|
|
83
|
+
expect( screen.getAllByRole( 'option' ) ).toHaveLength( 2 );
|
|
84
84
|
} );
|
|
85
85
|
|
|
86
86
|
it( 'renders the gradient picker and does not render tabs if it is only possible to select a gradient', async () => {
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from '@wordpress/components';
|
|
15
15
|
|
|
16
16
|
// So that we illustrate the different formats in the dropdown properly, show a date that is
|
|
17
|
-
//
|
|
17
|
+
// somewhat recent, has a day greater than 12, and a month with more than three letters.
|
|
18
18
|
const exampleDate = new Date();
|
|
19
19
|
exampleDate.setDate( 20 );
|
|
20
20
|
exampleDate.setMonth( exampleDate.getMonth() - 3 );
|
|
@@ -4,11 +4,11 @@ $swatch-size: 28px;
|
|
|
4
4
|
$swatch-gap: 12px;
|
|
5
5
|
|
|
6
6
|
$popover-width: 260px;
|
|
7
|
-
$popover-padding: $grid-unit-
|
|
7
|
+
$popover-padding: $grid-unit-10;
|
|
8
8
|
|
|
9
9
|
$swatch-columns: math.floor(math.div($popover-width + $swatch-gap - 2 * $popover-padding, $swatch-size + $swatch-gap));
|
|
10
10
|
|
|
11
|
-
.block-editor-duotone-control__popover {
|
|
11
|
+
.block-editor-duotone-control__popover.components-popover {
|
|
12
12
|
> .components-popover__content {
|
|
13
13
|
padding: $popover-padding;
|
|
14
14
|
width: $popover-width;
|
|
@@ -144,10 +144,12 @@ export default function FiltersPanel( {
|
|
|
144
144
|
const duotonePreset = duotonePalette.find( ( { colors } ) => {
|
|
145
145
|
return colors === newValue;
|
|
146
146
|
} );
|
|
147
|
-
const
|
|
147
|
+
const duotoneValue = duotonePreset
|
|
148
148
|
? `var:preset|duotone|${ duotonePreset.slug }`
|
|
149
149
|
: newValue;
|
|
150
|
-
onChange(
|
|
150
|
+
onChange(
|
|
151
|
+
setImmutably( value, [ 'filter', 'duotone' ], duotoneValue )
|
|
152
|
+
);
|
|
151
153
|
};
|
|
152
154
|
const hasDuotone = () => !! value?.filter?.duotone;
|
|
153
155
|
const resetDuotone = () => setDuotone( undefined );
|
|
@@ -61,14 +61,14 @@ export default function ImageSettingsPanel( {
|
|
|
61
61
|
// "RESET" button ONLY when the user has explicitly set a value in the
|
|
62
62
|
// Global Styles.
|
|
63
63
|
hasValue={ () => !! value?.lightbox }
|
|
64
|
-
label={ __( '
|
|
64
|
+
label={ __( 'Enlarge on click' ) }
|
|
65
65
|
onDeselect={ resetLightbox }
|
|
66
66
|
isShownByDefault
|
|
67
67
|
panelId={ panelId }
|
|
68
68
|
>
|
|
69
69
|
<ToggleControl
|
|
70
70
|
__nextHasNoMarginBottom
|
|
71
|
-
label={ __( '
|
|
71
|
+
label={ __( 'Enlarge on click' ) }
|
|
72
72
|
checked={ lightboxChecked }
|
|
73
73
|
onChange={ onChangeLightbox }
|
|
74
74
|
/>
|
|
@@ -585,7 +585,7 @@ describe( 'typography utils', () => {
|
|
|
585
585
|
'clamp(14px, 0.875rem + ((1vw - 3.2px) * 0.078), 15px)',
|
|
586
586
|
},
|
|
587
587
|
|
|
588
|
-
// Equivalent custom config PHP unit tests in `
|
|
588
|
+
// Equivalent custom config PHP unit tests in `test_should_convert_font_sizes_to_fluid_values()`.
|
|
589
589
|
{
|
|
590
590
|
message: 'should return clamp value using custom fluid config',
|
|
591
591
|
preset: {
|
|
@@ -1337,12 +1337,12 @@ export function processCSSNesting( css, blockSelector ) {
|
|
|
1337
1337
|
processedCSS += `:root :where(${ blockSelector }){${ part.trim() }}`;
|
|
1338
1338
|
} else {
|
|
1339
1339
|
// If the part contains braces, it's a nested CSS rule.
|
|
1340
|
-
const
|
|
1341
|
-
if (
|
|
1340
|
+
const splitPart = part.replace( '}', '' ).split( '{' );
|
|
1341
|
+
if ( splitPart.length !== 2 ) {
|
|
1342
1342
|
return;
|
|
1343
1343
|
}
|
|
1344
1344
|
|
|
1345
|
-
const [ nestedSelector, cssValue ] =
|
|
1345
|
+
const [ nestedSelector, cssValue ] = splitPart;
|
|
1346
1346
|
|
|
1347
1347
|
// Handle pseudo elements such as ::before, ::after, etc. Regex will also
|
|
1348
1348
|
// capture any leading combinator such as >, +, or ~, as well as spaces.
|
|
@@ -2,7 +2,7 @@ let compatibilityStyles = null;
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Returns a list of stylesheets that target the editor canvas. A stylesheet is
|
|
5
|
-
* considered
|
|
5
|
+
* considered targeting the editor a canvas if it contains the
|
|
6
6
|
* `editor-styles-wrapper`, `wp-block`, or `wp-block-*` class selectors.
|
|
7
7
|
*
|
|
8
8
|
* Ideally, this hook should be removed in the future and styles should be added
|
|
@@ -330,7 +330,7 @@ function Iframe( {
|
|
|
330
330
|
>
|
|
331
331
|
{ iframeDocument &&
|
|
332
332
|
createPortal(
|
|
333
|
-
// We want to prevent React events from bubbling
|
|
333
|
+
// We want to prevent React events from bubbling through the iframe
|
|
334
334
|
// we bubble these manually.
|
|
335
335
|
/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */
|
|
336
336
|
<body
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
9
9
|
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
10
10
|
} from '@wordpress/components';
|
|
11
|
-
import { __ } from '@wordpress/i18n';
|
|
11
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Internal dependencies
|
|
@@ -137,7 +137,11 @@ export default function ImageSizeControl( {
|
|
|
137
137
|
<ToggleGroupControlOption
|
|
138
138
|
key={ scale }
|
|
139
139
|
value={ scale }
|
|
140
|
-
label={
|
|
140
|
+
label={ sprintf(
|
|
141
|
+
/* translators: Percentage value. */
|
|
142
|
+
__( '%d%%' ),
|
|
143
|
+
scale
|
|
144
|
+
) }
|
|
141
145
|
/>
|
|
142
146
|
);
|
|
143
147
|
} ) }
|
|
@@ -125,7 +125,7 @@ Template locking of `InnerBlocks` is similar to [Custom Post Type templates lock
|
|
|
125
125
|
Template locking allows locking the `InnerBlocks` area for the current template.
|
|
126
126
|
_Options:_
|
|
127
127
|
|
|
128
|
-
- `contentOnly` — prevents all operations. Additionally, the block types that don't have content are hidden from the list view and can't gain focus within the block list. Unlike the other lock types, this is not
|
|
128
|
+
- `contentOnly` — prevents all operations. Additionally, the block types that don't have content are hidden from the list view and can't gain focus within the block list. Unlike the other lock types, this is not overridable by children.
|
|
129
129
|
- `'all'` — prevents all operations. It is not possible to insert new blocks. Move existing blocks or delete them.
|
|
130
130
|
- `'insert'` — prevents inserting or removing blocks, but allows moving existing ones.
|
|
131
131
|
- `false` — prevents locking from being applied to an `InnerBlocks` area even if a parent block contains locking. ( Boolean )
|
|
@@ -57,7 +57,7 @@ export function PatternsFilter( {
|
|
|
57
57
|
} ) {
|
|
58
58
|
// If the category is `myPatterns` then we need to set the source filter to `user`, but
|
|
59
59
|
// we do this by deriving from props rather than calling setPatternSourceFilter otherwise
|
|
60
|
-
// the user may be confused when switching to another category if the haven't
|
|
60
|
+
// the user may be confused when switching to another category if the haven't explicitly set
|
|
61
61
|
// this filter themselves.
|
|
62
62
|
const currentPatternSourceFilter =
|
|
63
63
|
category?.name === myPatternsCategory.name
|
|
@@ -29,7 +29,7 @@ function ReusableBlocksTab( { onSelect, rootClientId, listProps } ) {
|
|
|
29
29
|
return filterInserterItems( inserterItems, { onlyReusable: true } );
|
|
30
30
|
}, [ inserterItems ] );
|
|
31
31
|
|
|
32
|
-
const sections = [ createInserterSection( { key: '
|
|
32
|
+
const sections = [ createInserterSection( { key: 'reusable', items } ) ];
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
35
|
<BlockTypesList
|
|
@@ -14,7 +14,7 @@ export default function LineHeightControl( { value: lineHeight, onChange } ) {
|
|
|
14
14
|
return (
|
|
15
15
|
<UnitControl
|
|
16
16
|
label={ __( 'Line Height' ) }
|
|
17
|
-
// Set
|
|
17
|
+
// Set minimum value of 1 since lower values break on Android
|
|
18
18
|
min={ 1 }
|
|
19
19
|
max={ 5 }
|
|
20
20
|
step={ STEP }
|
|
@@ -50,7 +50,7 @@ Consumers who which to take advantage of this functionality should ensure that t
|
|
|
50
50
|
When creating links the `LinkControl` component will handle two kinds of input from users:
|
|
51
51
|
|
|
52
52
|
1. Entity searches - the user may input free-text based search queries for entities retrieved from remote data sources (in the context of WordPress these are post-type entities). For example, a user might search for a `Page` they have just created by name (eg: About) and the UI will return a matching result if found.
|
|
53
|
-
2. Direct entry - the user may also enter any arbitrary URL-like text. This includes full URLs (https://), URL
|
|
53
|
+
2. Direct entry - the user may also enter any arbitrary URL-like text. This includes full URLs (https://), URL fragments (eg: `#myinternallink`), `tel` protocol links (eg: `tel: 0800 1234`) and `mailto` protocol links (eg: `mailto: hello@wordpress.org`).
|
|
54
54
|
|
|
55
55
|
In addition, `<LinkControl>` also allows for on the fly creation of links based on the **current content of the `<input>` element**. When enabled, a default "Create new" search suggestion is appended to all non-URL-like search results.
|
|
56
56
|
|
|
@@ -79,7 +79,7 @@ The resulting default properties of `value` include:
|
|
|
79
79
|
- `title` (`string`, optional): Link title.
|
|
80
80
|
- `opensInNewTab` (`boolean`, optional): Whether link should open in a new browser tab. This value is only assigned when not providing a custom `settings` prop.
|
|
81
81
|
|
|
82
|
-
Note: `<LinkControl>` maintains an internal state tracking temporary user edits to the link `value` prior to submission. To avoid unwanted synchronization of this internal value, it is advised that the `value` prop is
|
|
82
|
+
Note: `<LinkControl>` maintains an internal state tracking temporary user edits to the link `value` prior to submission. To avoid unwanted synchronization of this internal value, it is advised that the `value` prop is stabilized (likely via memozation) before it is passed to the component. This will avoid unwanted loss of any changes users have may made whilst interacting with the control.
|
|
83
83
|
|
|
84
84
|
```jsx
|
|
85
85
|
const memoizedValue = useMemo(
|
|
@@ -265,7 +265,7 @@ function LinkControl( {
|
|
|
265
265
|
|
|
266
266
|
const handleSelectSuggestion = ( updatedValue ) => {
|
|
267
267
|
// Suggestions may contains "settings" values (e.g. `opensInNewTab`)
|
|
268
|
-
// which should not
|
|
268
|
+
// which should not override any existing settings values set by the
|
|
269
269
|
// user. This filters out any settings values from the suggestion.
|
|
270
270
|
const nonSettingsChanges = Object.keys( updatedValue ).reduce(
|
|
271
271
|
( acc, key ) => {
|
|
@@ -31,7 +31,7 @@ const mockFetchSearchSuggestions = jest.fn();
|
|
|
31
31
|
/**
|
|
32
32
|
* The call to the real method `fetchRichUrlData` is wrapped in a promise in order to make it cancellable.
|
|
33
33
|
* Therefore if we pass any value as the mock of `fetchRichUrlData` then ALL of the tests will require
|
|
34
|
-
* addition code to handle the async nature of `fetchRichUrlData`. This is
|
|
34
|
+
* addition code to handle the async nature of `fetchRichUrlData`. This is unnecessary. Instead we default
|
|
35
35
|
* to an undefined value which will ensure that the code under test does not call `fetchRichUrlData`. Only
|
|
36
36
|
* when we are testing the "rich previews" to we update this value with a true mock.
|
|
37
37
|
*/
|
|
@@ -354,7 +354,7 @@ describe( 'Basic rendering', () => {
|
|
|
354
354
|
|
|
355
355
|
it( 'should display human friendly error message if value URL prop is empty when component is forced into no-editing (preview) mode', async () => {
|
|
356
356
|
// Why do we need this test?
|
|
357
|
-
// Occasionally `forceIsEditingLink` is set
|
|
357
|
+
// Occasionally `forceIsEditingLink` is set explicitly to `false` which causes the Link UI to render
|
|
358
358
|
// it's preview even if the `value` has no URL.
|
|
359
359
|
// for an example of this see the usage in the following file whereby forceIsEditingLink is used to start/stop editing mode:
|
|
360
360
|
// https://github.com/WordPress/gutenberg/blob/fa5728771df7cdc86369f7157d6aa763649937a7/packages/format-library/src/link/inline.js#L151.
|
|
@@ -2422,7 +2422,7 @@ describe( 'Controlling link title text', () => {
|
|
|
2422
2422
|
|
|
2423
2423
|
it.each( [
|
|
2424
2424
|
[ '', 'Testing' ],
|
|
2425
|
-
[ '(with leading and
|
|
2425
|
+
[ '(with leading and trailing whitespace)', ' Testing ' ],
|
|
2426
2426
|
[
|
|
2427
2427
|
// Note: link control should always preserve the original value.
|
|
2428
2428
|
// The consumer is responsible for filtering or otherwise handling the value.
|
|
@@ -94,7 +94,7 @@ const handleEntitySearch = async (
|
|
|
94
94
|
return isURLLike( val ) || ! withCreateSuggestion
|
|
95
95
|
? results
|
|
96
96
|
: results.concat( {
|
|
97
|
-
// the `id` prop is intentionally
|
|
97
|
+
// the `id` prop is intentionally omitted here because it
|
|
98
98
|
// is never exposed as part of the component's public API.
|
|
99
99
|
// see: https://github.com/WordPress/gutenberg/pull/19775#discussion_r378931316.
|
|
100
100
|
title: val, // Must match the existing `<input>`s text value.
|