@wordpress/block-library 9.44.1-next.v.202604201441.0 → 9.45.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 +2 -0
- package/build/accordion/edit.cjs +0 -2
- package/build/accordion/edit.cjs.map +2 -2
- package/build/accordion-item/block.json +1 -0
- package/build/categories/edit.cjs +5 -1
- package/build/categories/edit.cjs.map +2 -2
- package/build/embed/edit.cjs +38 -34
- package/build/embed/edit.cjs.map +3 -3
- package/build/embed/transforms.cjs +3 -1
- package/build/embed/transforms.cjs.map +2 -2
- package/build/embed/util.cjs +13 -2
- package/build/embed/util.cjs.map +2 -2
- package/build/form/block.json +1 -1
- package/build/form-input/block.json +1 -1
- package/build/form-submission-notification/block.json +1 -1
- package/build/form-submit-button/block.json +1 -1
- package/build/image/edit.cjs +1 -1
- package/build/image/edit.cjs.map +2 -2
- package/build/image/image.cjs +29 -10
- package/build/image/image.cjs.map +3 -3
- package/build/index.cjs +4 -4
- package/build/index.cjs.map +2 -2
- package/build/math/edit.cjs +2 -2
- package/build/math/edit.cjs.map +2 -2
- package/build/navigation/edit/accessible-description.cjs +2 -2
- package/build/navigation/edit/accessible-description.cjs.map +2 -2
- package/build/navigation/edit/overlay-template-part-selector.cjs.map +2 -2
- package/build/navigation-link/edit.cjs +2 -1
- package/build/navigation-link/edit.cjs.map +2 -2
- package/build/navigation-link/link-ui/dialog-wrapper.cjs +2 -1
- package/build/navigation-link/link-ui/dialog-wrapper.cjs.map +2 -2
- package/build/navigation-link/link-ui/index.cjs +2 -1
- package/build/navigation-link/link-ui/index.cjs.map +2 -2
- package/build/post-author/edit.cjs.map +3 -3
- package/build/post-comments-form/edit.cjs +2 -2
- package/build/post-comments-form/edit.cjs.map +2 -2
- package/build/query/edit/inspector-controls/author-control.cjs +1 -1
- package/build/query/edit/inspector-controls/author-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/format-controls.cjs +1 -1
- package/build/query/edit/inspector-controls/format-controls.cjs.map +2 -2
- package/build/query/edit/inspector-controls/parent-control.cjs +1 -1
- package/build/query/edit/inspector-controls/parent-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/taxonomy-controls.cjs +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.cjs.map +2 -2
- package/build/site-logo/edit.cjs +32 -18
- package/build/site-logo/edit.cjs.map +2 -2
- package/build/tab/block.json +23 -23
- package/build/tab/controls.cjs +5 -48
- package/build/tab/controls.cjs.map +3 -3
- package/build/tab/edit.cjs +77 -75
- package/build/tab/edit.cjs.map +3 -3
- package/build/tab/save.cjs +3 -3
- package/build/tab/save.cjs.map +2 -2
- package/{src/tabs-menu → build/tab-list}/block.json +3 -3
- package/build/{tabs-menu → tab-list}/edit.cjs +4 -4
- package/build/tab-list/edit.cjs.map +7 -0
- package/build/{tabs-menu → tab-list}/index.cjs +5 -5
- package/build/tab-list/index.cjs.map +7 -0
- package/build/{tabs-menu → tab-list}/save.cjs +1 -1
- package/build/{tabs-menu → tab-list}/save.cjs.map +1 -1
- package/build/{tab → tab-panel}/add-tab-toolbar-control.cjs +16 -16
- package/build/tab-panel/add-tab-toolbar-control.cjs.map +7 -0
- package/build/tab-panel/block.json +27 -37
- package/build/tab-panel/controls.cjs +89 -0
- package/build/tab-panel/controls.cjs.map +7 -0
- package/build/tab-panel/edit.cjs +90 -17
- package/build/tab-panel/edit.cjs.map +3 -3
- package/build/tab-panel/index.cjs +1 -1
- package/build/tab-panel/index.cjs.map +1 -1
- package/build/{tab → tab-panel}/init.cjs +1 -1
- package/build/{tab → tab-panel}/init.cjs.map +1 -1
- package/build/{tab → tab-panel}/remove-tab-toolbar-control.cjs +16 -16
- package/build/tab-panel/remove-tab-toolbar-control.cjs.map +7 -0
- package/build/tab-panel/save.cjs +4 -2
- package/build/tab-panel/save.cjs.map +2 -2
- package/build/tab-panels/block.json +66 -0
- package/build/{tabs-menu-item/controls.cjs → tab-panels/edit.cjs} +25 -11
- package/build/tab-panels/edit.cjs.map +7 -0
- package/build/{tabs-menu-item → tab-panels}/index.cjs +5 -5
- package/build/{tabs-menu → tab-panels}/index.cjs.map +2 -2
- package/build/{tabs-menu-item → tab-panels}/save.cjs +4 -6
- package/build/tab-panels/save.cjs.map +7 -0
- package/build/tabs/block.json +1 -1
- package/build/tabs/controls.cjs +2 -2
- package/build/tabs/controls.cjs.map +1 -1
- package/build/tabs/edit.cjs +24 -19
- package/build/tabs/edit.cjs.map +3 -3
- package/build/tabs/index.cjs +5 -5
- package/build/tabs/index.cjs.map +1 -1
- package/build/tabs/{use-tab-menu-sync.cjs → use-tab-list-sync.cjs} +78 -80
- package/build/tabs/use-tab-list-sync.cjs.map +7 -0
- package/build/terms-query/edit/inspector-controls/include-control.cjs +1 -1
- package/build/terms-query/edit/inspector-controls/include-control.cjs.map +2 -2
- package/build/video/tracks-editor.cjs +2 -2
- package/build/video/tracks-editor.cjs.map +2 -2
- package/build-module/accordion/edit.mjs +0 -2
- package/build-module/accordion/edit.mjs.map +2 -2
- package/build-module/accordion-item/block.json +1 -0
- package/build-module/categories/edit.mjs +5 -2
- package/build-module/categories/edit.mjs.map +2 -2
- package/build-module/embed/edit.mjs +45 -36
- package/build-module/embed/edit.mjs.map +2 -2
- package/build-module/embed/transforms.mjs +8 -2
- package/build-module/embed/transforms.mjs.map +2 -2
- package/build-module/embed/util.mjs +11 -1
- package/build-module/embed/util.mjs.map +2 -2
- package/build-module/form/block.json +1 -1
- package/build-module/form-input/block.json +1 -1
- package/build-module/form-submission-notification/block.json +1 -1
- package/build-module/form-submit-button/block.json +1 -1
- package/build-module/image/edit.mjs +1 -1
- package/build-module/image/edit.mjs.map +2 -2
- package/build-module/image/image.mjs +29 -10
- package/build-module/image/image.mjs.map +3 -3
- package/build-module/index.mjs +4 -4
- package/build-module/index.mjs.map +2 -2
- package/build-module/math/edit.mjs +2 -2
- package/build-module/math/edit.mjs.map +2 -2
- package/build-module/navigation/edit/accessible-description.mjs +1 -1
- package/build-module/navigation/edit/accessible-description.mjs.map +1 -1
- package/build-module/navigation/edit/overlay-template-part-selector.mjs +2 -2
- package/build-module/navigation/edit/overlay-template-part-selector.mjs.map +1 -1
- package/build-module/navigation-link/edit.mjs +2 -5
- package/build-module/navigation-link/edit.mjs.map +2 -2
- package/build-module/navigation-link/link-ui/dialog-wrapper.mjs +2 -1
- package/build-module/navigation-link/link-ui/dialog-wrapper.mjs.map +2 -2
- package/build-module/navigation-link/link-ui/index.mjs +1 -1
- package/build-module/navigation-link/link-ui/index.mjs.map +2 -2
- package/build-module/post-author/edit.mjs +2 -2
- package/build-module/post-author/edit.mjs.map +2 -2
- package/build-module/post-comments-form/edit.mjs +1 -1
- package/build-module/post-comments-form/edit.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/author-control.mjs +1 -1
- package/build-module/query/edit/inspector-controls/author-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/format-controls.mjs +1 -1
- package/build-module/query/edit/inspector-controls/format-controls.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/parent-control.mjs +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/taxonomy-controls.mjs +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.mjs.map +2 -2
- package/build-module/site-logo/edit.mjs +32 -18
- package/build-module/site-logo/edit.mjs.map +2 -2
- package/build-module/tab/block.json +23 -23
- package/build-module/tab/controls.mjs +7 -57
- package/build-module/tab/controls.mjs.map +2 -2
- package/build-module/tab/edit.mjs +81 -79
- package/build-module/tab/edit.mjs.map +3 -3
- package/build-module/tab/save.mjs +4 -4
- package/build-module/tab/save.mjs.map +2 -2
- package/build-module/{tabs-menu → tab-list}/block.json +3 -3
- package/build-module/{tabs-menu → tab-list}/edit.mjs +4 -4
- package/build-module/tab-list/edit.mjs.map +7 -0
- package/build-module/{tabs-menu → tab-list}/index.mjs +2 -2
- package/build-module/tab-list/index.mjs.map +7 -0
- package/build-module/{tabs-menu → tab-list}/save.mjs +1 -1
- package/build-module/{tabs-menu → tab-list}/save.mjs.map +1 -1
- package/build-module/{tab → tab-panel}/add-tab-toolbar-control.mjs +16 -16
- package/build-module/tab-panel/add-tab-toolbar-control.mjs.map +7 -0
- package/build-module/tab-panel/block.json +27 -37
- package/build-module/tab-panel/controls.mjs +65 -0
- package/build-module/tab-panel/controls.mjs.map +7 -0
- package/build-module/tab-panel/edit.mjs +92 -19
- package/build-module/tab-panel/edit.mjs.map +2 -2
- package/build-module/tab-panel/index.mjs +1 -1
- package/build-module/tab-panel/index.mjs.map +1 -1
- package/build-module/{tab → tab-panel}/init.mjs +1 -1
- package/build-module/{tab → tab-panel}/init.mjs.map +1 -1
- package/build-module/{tab → tab-panel}/remove-tab-toolbar-control.mjs +16 -16
- package/build-module/tab-panel/remove-tab-toolbar-control.mjs.map +7 -0
- package/build-module/tab-panel/save.mjs +4 -2
- package/build-module/tab-panel/save.mjs.map +2 -2
- package/build-module/tab-panels/block.json +66 -0
- package/build-module/tab-panels/edit.mjs +33 -0
- package/build-module/tab-panels/edit.mjs.map +7 -0
- package/build-module/{tabs-menu-item → tab-panels}/index.mjs +2 -2
- package/build-module/{tabs-menu → tab-panels}/index.mjs.map +2 -2
- package/build-module/tab-panels/save.mjs +12 -0
- package/build-module/tab-panels/save.mjs.map +7 -0
- package/build-module/tabs/block.json +1 -1
- package/build-module/tabs/controls.mjs +2 -2
- package/build-module/tabs/controls.mjs.map +1 -1
- package/build-module/tabs/edit.mjs +24 -19
- package/build-module/tabs/edit.mjs.map +2 -2
- package/build-module/tabs/index.mjs +5 -5
- package/build-module/tabs/index.mjs.map +1 -1
- package/build-module/tabs/use-tab-list-sync.mjs +169 -0
- package/build-module/tabs/use-tab-list-sync.mjs.map +7 -0
- package/build-module/terms-query/edit/inspector-controls/include-control.mjs +1 -1
- package/build-module/terms-query/edit/inspector-controls/include-control.mjs.map +2 -2
- package/build-module/video/tracks-editor.mjs +2 -2
- package/build-module/video/tracks-editor.mjs.map +2 -2
- package/build-style/classic-rtl.css +14 -0
- package/build-style/classic.css +14 -0
- package/build-style/editor-rtl.css +9 -5
- package/build-style/editor.css +9 -5
- package/build-style/style-rtl.css +40 -40
- package/build-style/style.css +40 -40
- package/build-style/tab/editor-rtl.css +11 -0
- package/build-style/tab/editor.css +11 -0
- package/build-style/tab/style-rtl.css +29 -16
- package/build-style/tab/style.css +29 -16
- package/build-style/tab-list/editor-rtl.css +6 -0
- package/build-style/tab-list/editor.css +6 -0
- package/build-style/tab-panel/style-rtl.css +17 -1
- package/build-style/tab-panel/style.css +17 -1
- package/build-style/tab-panels/style-rtl.css +4 -0
- package/build-style/tab-panels/style.css +4 -0
- package/build-style/video/editor-rtl.css +4 -0
- package/build-style/video/editor.css +4 -0
- package/package.json +39 -38
- package/src/accordion/edit.js +0 -2
- package/src/accordion-item/block.json +1 -0
- package/src/categories/edit.js +3 -2
- package/src/classic.scss +25 -0
- package/src/editor.scss +2 -2
- package/src/embed/edit.js +61 -52
- package/src/embed/edit.native.js +71 -57
- package/src/embed/transforms.js +8 -2
- package/src/embed/util.js +17 -0
- package/src/form/block.json +1 -1
- package/src/form-input/block.json +1 -1
- package/src/form-submission-notification/block.json +1 -1
- package/src/form-submit-button/block.json +1 -1
- package/src/image/edit.js +5 -1
- package/src/image/edit.native.js +3 -3
- package/src/image/image.js +30 -5
- package/src/index.js +4 -4
- package/src/math/edit.js +3 -3
- package/src/navigation/edit/accessible-description.js +1 -1
- package/src/navigation/edit/overlay-template-part-selector.js +3 -3
- package/src/navigation-link/edit.js +2 -5
- package/src/navigation-link/link-ui/dialog-wrapper.js +2 -1
- package/src/navigation-link/link-ui/index.js +1 -1
- package/src/post-author/edit.js +3 -5
- package/src/post-comments-form/edit.js +1 -1
- package/src/query/edit/inspector-controls/author-control.js +1 -1
- package/src/query/edit/inspector-controls/format-controls.js +1 -1
- package/src/query/edit/inspector-controls/parent-control.js +1 -1
- package/src/query/edit/inspector-controls/taxonomy-controls.js +1 -1
- package/src/site-logo/edit.js +38 -18
- package/src/style.scss +1 -1
- package/src/tab/block.json +23 -23
- package/src/tab/controls.js +6 -52
- package/src/tab/edit.js +99 -103
- package/src/{tabs-menu-item → tab}/editor.scss +3 -3
- package/src/tab/index.php +32 -51
- package/src/tab/save.js +4 -4
- package/src/tab/style.scss +34 -17
- package/{build/tabs-menu → src/tab-list}/block.json +3 -3
- package/src/{tabs-menu → tab-list}/edit.js +3 -3
- package/src/{tabs-menu → tab-list}/editor.scss +2 -2
- package/src/{tabs-menu → tab-list}/index.js +1 -1
- package/src/tab-list/index.php +80 -0
- package/src/{tab → tab-panel}/add-tab-toolbar-control.js +19 -19
- package/src/tab-panel/block.json +27 -37
- package/src/tab-panel/controls.js +65 -0
- package/src/tab-panel/edit.js +123 -20
- package/src/tab-panel/index.js +1 -1
- package/src/tab-panel/index.php +88 -0
- package/src/{tab → tab-panel}/remove-tab-toolbar-control.js +20 -19
- package/src/tab-panel/save.js +4 -2
- package/src/tab-panel/style.scss +20 -1
- package/src/tab-panels/block.json +66 -0
- package/src/tab-panels/edit.js +42 -0
- package/src/{tabs-menu-item → tab-panels}/index.js +1 -1
- package/src/tab-panels/save.js +11 -0
- package/src/tab-panels/style.scss +4 -0
- package/src/tabs/block.json +1 -1
- package/src/tabs/controls.js +2 -2
- package/src/tabs/edit.js +25 -20
- package/src/tabs/index.js +5 -5
- package/src/tabs/index.php +5 -5
- package/src/tabs/use-tab-list-sync.js +237 -0
- package/src/terms-query/edit/inspector-controls/include-control.js +1 -1
- package/src/video/editor.scss +5 -0
- package/src/video/tracks-editor.js +2 -2
- package/build/tab/add-tab-toolbar-control.cjs.map +0 -7
- package/build/tab/remove-tab-toolbar-control.cjs.map +0 -7
- package/build/tabs/use-tab-menu-sync.cjs.map +0 -7
- package/build/tabs-menu/edit.cjs.map +0 -7
- package/build/tabs-menu-item/block.json +0 -56
- package/build/tabs-menu-item/controls.cjs.map +0 -7
- package/build/tabs-menu-item/edit.cjs +0 -135
- package/build/tabs-menu-item/edit.cjs.map +0 -7
- package/build/tabs-menu-item/index.cjs.map +0 -7
- package/build/tabs-menu-item/save.cjs.map +0 -7
- package/build-module/tab/add-tab-toolbar-control.mjs.map +0 -7
- package/build-module/tab/remove-tab-toolbar-control.mjs.map +0 -7
- package/build-module/tabs/use-tab-menu-sync.mjs +0 -171
- package/build-module/tabs/use-tab-menu-sync.mjs.map +0 -7
- package/build-module/tabs-menu/edit.mjs.map +0 -7
- package/build-module/tabs-menu-item/block.json +0 -56
- package/build-module/tabs-menu-item/controls.mjs +0 -15
- package/build-module/tabs-menu-item/controls.mjs.map +0 -7
- package/build-module/tabs-menu-item/edit.mjs +0 -108
- package/build-module/tabs-menu-item/edit.mjs.map +0 -7
- package/build-module/tabs-menu-item/index.mjs.map +0 -7
- package/build-module/tabs-menu-item/save.mjs +0 -14
- package/build-module/tabs-menu-item/save.mjs.map +0 -7
- package/build-style/tabs-menu/editor-rtl.css +0 -6
- package/build-style/tabs-menu/editor.css +0 -6
- package/build-style/tabs-menu-item/editor-rtl.css +0 -11
- package/build-style/tabs-menu-item/editor.css +0 -11
- package/build-style/tabs-menu-item/style-rtl.css +0 -33
- package/build-style/tabs-menu-item/style.css +0 -33
- package/src/tabs/use-tab-menu-sync.js +0 -239
- package/src/tabs-menu/index.php +0 -80
- package/src/tabs-menu-item/block.json +0 -56
- package/src/tabs-menu-item/controls.js +0 -19
- package/src/tabs-menu-item/edit.js +0 -141
- package/src/tabs-menu-item/index.php +0 -70
- package/src/tabs-menu-item/save.js +0 -13
- package/src/tabs-menu-item/style.scss +0 -40
- /package/src/{tabs-menu → tab-list}/save.js +0 -0
- /package/src/{tab → tab-panel}/init.js +0 -0
package/src/embed/edit.js
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
10
|
+
import { useState, useEffect } from '@wordpress/element';
|
|
11
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
12
|
+
import {
|
|
13
|
+
useBlockProps,
|
|
14
|
+
store as blockEditorStore,
|
|
15
|
+
} from '@wordpress/block-editor';
|
|
16
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
17
|
+
import { View } from '@wordpress/primitives';
|
|
18
|
+
import { Caption } from '../utils/caption';
|
|
19
|
+
|
|
1
20
|
/**
|
|
2
21
|
* Internal dependencies
|
|
3
22
|
*/
|
|
4
23
|
import {
|
|
5
24
|
createUpgradedEmbedBlock,
|
|
25
|
+
findMoreSuitableBlock,
|
|
6
26
|
getClassNames,
|
|
27
|
+
rewriteXToTwitter,
|
|
7
28
|
removeAspectRatioClasses,
|
|
8
29
|
fallback,
|
|
9
30
|
getEmbedInfoByProvider,
|
|
@@ -15,23 +36,6 @@ import EmbedLoading from './embed-loading';
|
|
|
15
36
|
import EmbedPlaceholder from './embed-placeholder';
|
|
16
37
|
import EmbedPreview from './embed-preview';
|
|
17
38
|
|
|
18
|
-
/**
|
|
19
|
-
* External dependencies
|
|
20
|
-
*/
|
|
21
|
-
import clsx from 'clsx';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* WordPress dependencies
|
|
25
|
-
*/
|
|
26
|
-
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
27
|
-
import { useState, useEffect } from '@wordpress/element';
|
|
28
|
-
import { useDispatch, useSelect } from '@wordpress/data';
|
|
29
|
-
import { useBlockProps } from '@wordpress/block-editor';
|
|
30
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
31
|
-
import { View } from '@wordpress/primitives';
|
|
32
|
-
import { getAuthority } from '@wordpress/url';
|
|
33
|
-
import { Caption } from '../utils/caption';
|
|
34
|
-
|
|
35
39
|
const EmbedEdit = ( props ) => {
|
|
36
40
|
const {
|
|
37
41
|
attributes: {
|
|
@@ -58,6 +62,8 @@ const EmbedEdit = ( props ) => {
|
|
|
58
62
|
const [ url, setURL ] = useState( attributesUrl );
|
|
59
63
|
const [ isEditingURL, setIsEditingURL ] = useState( false );
|
|
60
64
|
const { invalidateResolution } = useDispatch( coreStore );
|
|
65
|
+
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
66
|
+
useDispatch( blockEditorStore );
|
|
61
67
|
|
|
62
68
|
const {
|
|
63
69
|
preview,
|
|
@@ -131,63 +137,61 @@ const EmbedEdit = ( props ) => {
|
|
|
131
137
|
} );
|
|
132
138
|
}
|
|
133
139
|
|
|
140
|
+
// When the preview can't be embedded, retry without any trailing slash.
|
|
134
141
|
useEffect( () => {
|
|
135
|
-
if (
|
|
142
|
+
if ( ! cannotEmbed || ! hasResolved || ! attributesUrl ) {
|
|
136
143
|
return;
|
|
137
144
|
}
|
|
138
145
|
|
|
139
|
-
// At this stage, we're not fetching the preview and know it can't be embedded,
|
|
140
|
-
// so try removing any trailing slash, and resubmit.
|
|
141
146
|
const newURL = attributesUrl.replace( /\/$/, '' );
|
|
147
|
+
if ( newURL === attributesUrl ) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
142
151
|
setURL( newURL );
|
|
143
152
|
setIsEditingURL( false );
|
|
153
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
144
154
|
setAttributes( { url: newURL } );
|
|
145
155
|
}, [
|
|
146
|
-
preview?.html,
|
|
147
156
|
attributesUrl,
|
|
148
157
|
cannotEmbed,
|
|
149
158
|
hasResolved,
|
|
150
159
|
setAttributes,
|
|
160
|
+
__unstableMarkNextChangeAsNotPersistent,
|
|
151
161
|
] );
|
|
152
162
|
|
|
153
|
-
//
|
|
163
|
+
// Apply preview-derived attributes once the preview resolves.
|
|
154
164
|
useEffect( () => {
|
|
155
|
-
if ( !
|
|
165
|
+
if ( ! preview || isEditingURL ) {
|
|
156
166
|
return;
|
|
157
167
|
}
|
|
158
168
|
|
|
159
|
-
|
|
160
|
-
if ( getAuthority( url ) === 'x.com' ) {
|
|
161
|
-
const newURL = new URL( url );
|
|
162
|
-
newURL.host = 'twitter.com';
|
|
163
|
-
setAttributes( { url: newURL.toString() } );
|
|
164
|
-
}
|
|
165
|
-
}, [ url, cannotEmbed, fetching, setAttributes ] );
|
|
169
|
+
const mergedAttributes = getMergedAttributes();
|
|
166
170
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
// we set the attributes derived from the preview data.
|
|
172
|
-
const mergedAttributes = getMergedAttributes();
|
|
173
|
-
const hasChanges = Object.keys( mergedAttributes ).some(
|
|
174
|
-
( key ) => mergedAttributes[ key ] !== attributes[ key ]
|
|
171
|
+
if ( onReplace ) {
|
|
172
|
+
const upgradedBlock = createUpgradedEmbedBlock(
|
|
173
|
+
props,
|
|
174
|
+
mergedAttributes
|
|
175
175
|
);
|
|
176
176
|
|
|
177
|
-
if (
|
|
178
|
-
setAttributes
|
|
177
|
+
if ( upgradedBlock ) {
|
|
178
|
+
// Mutate via setAttributes; onReplace would remount the
|
|
179
|
+
// block and clear the URL textbox on undo.
|
|
180
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
181
|
+
setAttributes( upgradedBlock.attributes );
|
|
182
|
+
return;
|
|
179
183
|
}
|
|
184
|
+
}
|
|
180
185
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
mergedAttributes
|
|
185
|
-
);
|
|
186
|
+
const hasChanges = Object.keys( mergedAttributes ).some(
|
|
187
|
+
( key ) => mergedAttributes[ key ] !== attributes[ key ]
|
|
188
|
+
);
|
|
186
189
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
190
|
+
if ( hasChanges ) {
|
|
191
|
+
// Merge into the URL-submit undo level so a single undo
|
|
192
|
+
// reverts both the submit and the preview-driven attributes.
|
|
193
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
194
|
+
setAttributes( mergedAttributes );
|
|
191
195
|
}
|
|
192
196
|
}, [ preview, isEditingURL ] );
|
|
193
197
|
|
|
@@ -219,14 +223,19 @@ const EmbedEdit = ( props ) => {
|
|
|
219
223
|
event.preventDefault();
|
|
220
224
|
}
|
|
221
225
|
|
|
222
|
-
|
|
223
|
-
// To do this we have to remove the existing ratio class so it can be recalculated.
|
|
226
|
+
const rewrittenURL = rewriteXToTwitter( url );
|
|
224
227
|
const blockClass = removeAspectRatioClasses(
|
|
225
228
|
attributes.className
|
|
226
229
|
);
|
|
227
230
|
|
|
231
|
+
setURL( rewrittenURL );
|
|
232
|
+
setAttributes( {
|
|
233
|
+
url: rewrittenURL,
|
|
234
|
+
...findMoreSuitableBlock( rewrittenURL )
|
|
235
|
+
?.attributes,
|
|
236
|
+
className: blockClass,
|
|
237
|
+
} );
|
|
228
238
|
setIsEditingURL( false );
|
|
229
|
-
setAttributes( { url, className: blockClass } );
|
|
230
239
|
} }
|
|
231
240
|
value={ url }
|
|
232
241
|
cannotEmbed={ cannotEmbed }
|
package/src/embed/edit.native.js
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal dependencies
|
|
3
|
-
*/
|
|
4
|
-
import {
|
|
5
|
-
createUpgradedEmbedBlock,
|
|
6
|
-
getClassNames,
|
|
7
|
-
removeAspectRatioClasses,
|
|
8
|
-
fallback,
|
|
9
|
-
getEmbedInfoByProvider,
|
|
10
|
-
getMergedAttributesWithPreview,
|
|
11
|
-
} from './util';
|
|
12
|
-
import EmbedControls from './embed-controls';
|
|
13
|
-
import { embedContentIcon } from './icons';
|
|
14
|
-
import EmbedLoading from './embed-loading';
|
|
15
|
-
import EmbedPlaceholder from './embed-placeholder';
|
|
16
|
-
import EmbedPreview from './embed-preview';
|
|
17
|
-
import EmbedLinkSettings from './embed-link-settings';
|
|
18
|
-
|
|
19
1
|
/**
|
|
20
2
|
* External dependencies
|
|
21
3
|
*/
|
|
@@ -33,7 +15,25 @@ import {
|
|
|
33
15
|
} from '@wordpress/block-editor';
|
|
34
16
|
import { store as coreStore } from '@wordpress/core-data';
|
|
35
17
|
import { View } from '@wordpress/primitives';
|
|
36
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Internal dependencies
|
|
20
|
+
*/
|
|
21
|
+
import {
|
|
22
|
+
createUpgradedEmbedBlock,
|
|
23
|
+
findMoreSuitableBlock,
|
|
24
|
+
getClassNames,
|
|
25
|
+
rewriteXToTwitter,
|
|
26
|
+
removeAspectRatioClasses,
|
|
27
|
+
fallback,
|
|
28
|
+
getEmbedInfoByProvider,
|
|
29
|
+
getMergedAttributesWithPreview,
|
|
30
|
+
} from './util';
|
|
31
|
+
import EmbedControls from './embed-controls';
|
|
32
|
+
import { embedContentIcon } from './icons';
|
|
33
|
+
import EmbedLoading from './embed-loading';
|
|
34
|
+
import EmbedPlaceholder from './embed-placeholder';
|
|
35
|
+
import EmbedPreview from './embed-preview';
|
|
36
|
+
import EmbedLinkSettings from './embed-link-settings';
|
|
37
37
|
|
|
38
38
|
// The inline preview feature will be released progressible, for this reason
|
|
39
39
|
// the embed will only be considered previewable for the following providers list.
|
|
@@ -77,6 +77,8 @@ const EmbedEdit = ( props ) => {
|
|
|
77
77
|
const [ showEmbedBottomSheet, setShowEmbedBottomSheet ] =
|
|
78
78
|
useState( isEditingURL );
|
|
79
79
|
const { invalidateResolution } = useDispatch( coreStore );
|
|
80
|
+
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
81
|
+
useDispatch( blockEditorStore );
|
|
80
82
|
|
|
81
83
|
const { preview, fetching, themeSupportsResponsive, cannotEmbed } =
|
|
82
84
|
useSelect(
|
|
@@ -150,50 +152,61 @@ const EmbedEdit = ( props ) => {
|
|
|
150
152
|
} );
|
|
151
153
|
};
|
|
152
154
|
|
|
155
|
+
// When the preview can't be embedded, retry without any trailing slash.
|
|
153
156
|
useEffect( () => {
|
|
154
|
-
if ( !
|
|
157
|
+
if ( ! cannotEmbed || fetching || ! url ) {
|
|
155
158
|
return;
|
|
156
159
|
}
|
|
157
|
-
|
|
158
|
-
// so try removing any trailing slash, and resubmit.
|
|
160
|
+
|
|
159
161
|
const newURL = url.replace( /\/$/, '' );
|
|
162
|
+
if ( newURL === url ) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
|
|
160
166
|
setIsEditingURL( false );
|
|
167
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
161
168
|
setAttributes( { url: newURL } );
|
|
162
|
-
}, [
|
|
169
|
+
}, [
|
|
170
|
+
url,
|
|
171
|
+
cannotEmbed,
|
|
172
|
+
fetching,
|
|
173
|
+
setAttributes,
|
|
174
|
+
__unstableMarkNextChangeAsNotPersistent,
|
|
175
|
+
] );
|
|
163
176
|
|
|
164
|
-
//
|
|
177
|
+
// Apply preview-derived attributes once the preview resolves.
|
|
165
178
|
useEffect( () => {
|
|
166
|
-
if ( !
|
|
179
|
+
if ( ! preview || isEditingURL ) {
|
|
167
180
|
return;
|
|
168
181
|
}
|
|
169
182
|
|
|
170
|
-
|
|
171
|
-
if ( getAuthority( url ) === 'x.com' ) {
|
|
172
|
-
const newURL = new URL( url );
|
|
173
|
-
newURL.host = 'twitter.com';
|
|
174
|
-
setAttributes( { url: newURL.toString() } );
|
|
175
|
-
}
|
|
176
|
-
}, [ url, cannotEmbed, fetching, setAttributes ] );
|
|
183
|
+
const mergedAttributes = getMergedAttributes();
|
|
177
184
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
const mergedAttributes = getMergedAttributes();
|
|
184
|
-
setAttributes( mergedAttributes );
|
|
185
|
+
if ( onReplace ) {
|
|
186
|
+
const upgradedBlock = createUpgradedEmbedBlock(
|
|
187
|
+
props,
|
|
188
|
+
mergedAttributes
|
|
189
|
+
);
|
|
185
190
|
|
|
186
|
-
if (
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
);
|
|
191
|
-
|
|
192
|
-
if ( upgradedBlock ) {
|
|
193
|
-
onReplace( upgradedBlock );
|
|
194
|
-
}
|
|
191
|
+
if ( upgradedBlock ) {
|
|
192
|
+
// Mutate via setAttributes; onReplace would remount the
|
|
193
|
+
// block and clear the URL textbox on undo.
|
|
194
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
195
|
+
setAttributes( upgradedBlock.attributes );
|
|
196
|
+
return;
|
|
195
197
|
}
|
|
196
198
|
}
|
|
199
|
+
|
|
200
|
+
const hasChanges = Object.keys( mergedAttributes ).some(
|
|
201
|
+
( key ) => mergedAttributes[ key ] !== attributes[ key ]
|
|
202
|
+
);
|
|
203
|
+
|
|
204
|
+
if ( hasChanges ) {
|
|
205
|
+
// Merge into the URL-submit undo level so a single undo
|
|
206
|
+
// reverts both the submit and the preview-driven attributes.
|
|
207
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
208
|
+
setAttributes( mergedAttributes );
|
|
209
|
+
}
|
|
197
210
|
}, [ preview, isEditingURL ] );
|
|
198
211
|
|
|
199
212
|
useEffect(
|
|
@@ -203,19 +216,20 @@ const EmbedEdit = ( props ) => {
|
|
|
203
216
|
|
|
204
217
|
const onEditURL = useCallback(
|
|
205
218
|
( value ) => {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
if ( attributes.url !== value ) {
|
|
209
|
-
const blockClass = removeAspectRatioClasses(
|
|
210
|
-
attributes.className
|
|
211
|
-
);
|
|
212
|
-
setAttributes( { className: blockClass } );
|
|
213
|
-
}
|
|
219
|
+
const rewrittenURL = rewriteXToTwitter( value );
|
|
220
|
+
const urlChanged = attributes.url !== rewrittenURL;
|
|
214
221
|
|
|
215
222
|
// The order of the following calls is important, we need to update the URL attribute before changing `isEditingURL`,
|
|
216
223
|
// otherwise the side-effect that potentially replaces the block when updating the local state won't use the new URL
|
|
217
224
|
// for creating the new block.
|
|
218
|
-
setAttributes( {
|
|
225
|
+
setAttributes( {
|
|
226
|
+
url: rewrittenURL,
|
|
227
|
+
...findMoreSuitableBlock( rewrittenURL )?.attributes,
|
|
228
|
+
// If the embed URL was changed, reset the aspect ratio class so it can be recalculated.
|
|
229
|
+
...( urlChanged && {
|
|
230
|
+
className: removeAspectRatioClasses( attributes.className ),
|
|
231
|
+
} ),
|
|
232
|
+
} );
|
|
219
233
|
setIsEditingURL( false );
|
|
220
234
|
},
|
|
221
235
|
[ attributes, setAttributes ]
|
package/src/embed/transforms.js
CHANGED
|
@@ -7,7 +7,11 @@ import { createBlock } from '@wordpress/blocks';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import metadata from './block.json';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
findMoreSuitableBlock,
|
|
12
|
+
rewriteXToTwitter,
|
|
13
|
+
removeAspectRatioClasses,
|
|
14
|
+
} from './util';
|
|
11
15
|
|
|
12
16
|
const { name: EMBED_BLOCK } = metadata;
|
|
13
17
|
|
|
@@ -23,8 +27,10 @@ const transforms = {
|
|
|
23
27
|
/^\s*(https?:\/\/\S+)\s*$/i.test( node.textContent ) &&
|
|
24
28
|
node.textContent?.match( /https/gi )?.length === 1,
|
|
25
29
|
transform: ( node ) => {
|
|
30
|
+
const url = rewriteXToTwitter( node.textContent.trim() );
|
|
26
31
|
return createBlock( EMBED_BLOCK, {
|
|
27
|
-
url
|
|
32
|
+
url,
|
|
33
|
+
...findMoreSuitableBlock( url )?.attributes,
|
|
28
34
|
} );
|
|
29
35
|
},
|
|
30
36
|
},
|
package/src/embed/util.js
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
getBlockType,
|
|
15
15
|
getBlockVariations,
|
|
16
16
|
} from '@wordpress/blocks';
|
|
17
|
+
import { getAuthority } from '@wordpress/url';
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Internal dependencies
|
|
@@ -60,6 +61,22 @@ export const findMoreSuitableBlock = ( url ) =>
|
|
|
60
61
|
matchesPatterns( url, patterns )
|
|
61
62
|
);
|
|
62
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Rewrites `x.com` URLs to `twitter.com` as a workaround while the
|
|
66
|
+
* WordPress oEmbed registry lacks an X provider. See: https://core.trac.wordpress.org/ticket/59142.
|
|
67
|
+
*
|
|
68
|
+
* @param {string} url The URL to rewrite.
|
|
69
|
+
* @return {string} The (possibly) rewritten URL.
|
|
70
|
+
*/
|
|
71
|
+
export function rewriteXToTwitter( url ) {
|
|
72
|
+
if ( ! url || getAuthority( url ) !== 'x.com' ) {
|
|
73
|
+
return url;
|
|
74
|
+
}
|
|
75
|
+
const rewritten = new URL( url );
|
|
76
|
+
rewritten.host = 'twitter.com';
|
|
77
|
+
return rewritten.toString();
|
|
78
|
+
}
|
|
79
|
+
|
|
63
80
|
export const isFromWordPress = ( html ) =>
|
|
64
81
|
html && html.includes( 'class="wp-embedded-content"' );
|
|
65
82
|
|
package/src/form/block.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"__experimental": true,
|
|
5
5
|
"name": "core/form-submission-notification",
|
|
6
6
|
"title": "Form Submission Notification",
|
|
7
|
-
"category": "
|
|
7
|
+
"category": "widgets",
|
|
8
8
|
"ancestor": [ "core/form" ],
|
|
9
9
|
"description": "Provide a notification message after the form has been submitted.",
|
|
10
10
|
"keywords": [ "form", "feedback", "notification", "message" ],
|
package/src/image/edit.js
CHANGED
|
@@ -353,7 +353,11 @@ export function ImageEdit( {
|
|
|
353
353
|
|
|
354
354
|
const isSideloading = useSelect(
|
|
355
355
|
( select ) => {
|
|
356
|
-
if (
|
|
356
|
+
if (
|
|
357
|
+
( ! window.__clientSideMediaProcessing &&
|
|
358
|
+
! window.__heicUploadSupport ) ||
|
|
359
|
+
! id
|
|
360
|
+
) {
|
|
357
361
|
return false;
|
|
358
362
|
}
|
|
359
363
|
return select( uploadStore ).isUploadingById( id );
|
package/src/image/edit.native.js
CHANGED
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
BottomSheetSelectControl,
|
|
35
35
|
FooterMessageControl,
|
|
36
36
|
FooterMessageLink,
|
|
37
|
-
|
|
37
|
+
WCBadge,
|
|
38
38
|
} from '@wordpress/components';
|
|
39
39
|
import {
|
|
40
40
|
BlockCaption,
|
|
@@ -803,7 +803,7 @@ export class ImageEdit extends Component {
|
|
|
803
803
|
}
|
|
804
804
|
|
|
805
805
|
const getImageComponent = ( openMediaOptions, getMediaOptions ) => (
|
|
806
|
-
<
|
|
806
|
+
<WCBadge label={ badgeLabelText } show={ badgeLabelShown }>
|
|
807
807
|
<TouchableWithoutFeedback
|
|
808
808
|
accessible={ ! isSelected }
|
|
809
809
|
onPress={ this.onImagePressed }
|
|
@@ -886,7 +886,7 @@ export class ImageEdit extends Component {
|
|
|
886
886
|
onBlur={ this.props.onBlur } // Always assign onBlur as props.
|
|
887
887
|
insertBlocksAfter={ this.props.insertBlocksAfter }
|
|
888
888
|
/>
|
|
889
|
-
</
|
|
889
|
+
</WCBadge>
|
|
890
890
|
);
|
|
891
891
|
|
|
892
892
|
return (
|
package/src/image/image.js
CHANGED
|
@@ -70,9 +70,12 @@ import {
|
|
|
70
70
|
} from './constants';
|
|
71
71
|
import { evalAspectRatio, mediaPosition } from './utils';
|
|
72
72
|
|
|
73
|
-
const {
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
const {
|
|
74
|
+
DimensionsTool,
|
|
75
|
+
ResolutionTool,
|
|
76
|
+
mediaEditKey,
|
|
77
|
+
openMediaEditorModalKey,
|
|
78
|
+
} = unlock( blockEditorPrivateApis );
|
|
76
79
|
|
|
77
80
|
const scaleOptions = [
|
|
78
81
|
{
|
|
@@ -390,7 +393,21 @@ export default function Image( {
|
|
|
390
393
|
[ clientId ]
|
|
391
394
|
);
|
|
392
395
|
const { getBlock, getSettings } = useSelect( blockEditorStore );
|
|
393
|
-
const
|
|
396
|
+
const settings = getSettings();
|
|
397
|
+
const { onNavigateToEntityRecord } = settings;
|
|
398
|
+
const openMediaEditorModal = settings[ openMediaEditorModalKey ];
|
|
399
|
+
|
|
400
|
+
const handleMediaUpdate = useCallback(
|
|
401
|
+
( { id: newId, url: newUrl } ) => {
|
|
402
|
+
if ( typeof newId === 'number' && newId !== id ) {
|
|
403
|
+
setAttributes( {
|
|
404
|
+
id: newId,
|
|
405
|
+
url: newUrl ?? url,
|
|
406
|
+
} );
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
[ id, url, setAttributes ]
|
|
410
|
+
);
|
|
394
411
|
|
|
395
412
|
const {
|
|
396
413
|
replaceBlocks,
|
|
@@ -875,7 +892,15 @@ export default function Image( {
|
|
|
875
892
|
) }
|
|
876
893
|
{ allowCrop && (
|
|
877
894
|
<ToolbarButton
|
|
878
|
-
onClick={
|
|
895
|
+
onClick={
|
|
896
|
+
openMediaEditorModal && id
|
|
897
|
+
? () =>
|
|
898
|
+
openMediaEditorModal( {
|
|
899
|
+
id,
|
|
900
|
+
onUpdate: handleMediaUpdate,
|
|
901
|
+
} )
|
|
902
|
+
: () => setIsEditingImage( true )
|
|
903
|
+
}
|
|
879
904
|
icon={ crop }
|
|
880
905
|
label={ __( 'Crop' ) }
|
|
881
906
|
/>
|
package/src/index.js
CHANGED
|
@@ -137,11 +137,11 @@ import * as socialLinks from './social-links';
|
|
|
137
137
|
import * as spacer from './spacer';
|
|
138
138
|
import * as tab from './tab';
|
|
139
139
|
import * as tabPanel from './tab-panel';
|
|
140
|
+
import * as tabPanels from './tab-panels';
|
|
140
141
|
import * as table from './table';
|
|
141
142
|
import * as tableOfContents from './table-of-contents';
|
|
143
|
+
import * as tabList from './tab-list';
|
|
142
144
|
import * as tabs from './tabs';
|
|
143
|
-
import * as tabsMenu from './tabs-menu';
|
|
144
|
-
import * as tabsMenuItem from './tabs-menu-item';
|
|
145
145
|
import * as tagCloud from './tag-cloud';
|
|
146
146
|
import * as templatePart from './template-part';
|
|
147
147
|
import * as termCount from './term-count';
|
|
@@ -288,10 +288,10 @@ const getAllBlocks = () => {
|
|
|
288
288
|
|
|
289
289
|
if ( window?.__experimentalEnableBlockExperiments ) {
|
|
290
290
|
blocks.push( tab );
|
|
291
|
+
blocks.push( tabList );
|
|
291
292
|
blocks.push( tabs );
|
|
292
|
-
blocks.push( tabsMenu );
|
|
293
|
-
blocks.push( tabsMenuItem );
|
|
294
293
|
blocks.push( tabPanel );
|
|
294
|
+
blocks.push( tabPanels );
|
|
295
295
|
blocks.push( playlist );
|
|
296
296
|
blocks.push( playlistTrack );
|
|
297
297
|
}
|
package/src/math/edit.js
CHANGED
|
@@ -21,7 +21,7 @@ import { speak } from '@wordpress/a11y';
|
|
|
21
21
|
*/
|
|
22
22
|
import { unlock } from '../lock-unlock';
|
|
23
23
|
|
|
24
|
-
const { Badge } = unlock( componentsPrivateApis );
|
|
24
|
+
const { Badge: WCBadge } = unlock( componentsPrivateApis );
|
|
25
25
|
|
|
26
26
|
export default function MathEdit( { attributes, setAttributes, isSelected } ) {
|
|
27
27
|
const { latex, mathML } = attributes;
|
|
@@ -116,7 +116,7 @@ export default function MathEdit( { attributes, setAttributes, isSelected } ) {
|
|
|
116
116
|
/>
|
|
117
117
|
{ error && (
|
|
118
118
|
<>
|
|
119
|
-
<
|
|
119
|
+
<WCBadge
|
|
120
120
|
intent="error"
|
|
121
121
|
className="wp-block-math__error"
|
|
122
122
|
>
|
|
@@ -125,7 +125,7 @@ export default function MathEdit( { attributes, setAttributes, isSelected } ) {
|
|
|
125
125
|
__( 'Error: %s' ),
|
|
126
126
|
error
|
|
127
127
|
) }
|
|
128
|
-
</
|
|
128
|
+
</WCBadge>
|
|
129
129
|
<style children=".wp-block-math__error .components-badge__content{white-space:normal}" />
|
|
130
130
|
</>
|
|
131
131
|
) }
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
FlexBlock,
|
|
12
12
|
FlexItem,
|
|
13
13
|
__experimentalHStack as HStack,
|
|
14
|
-
__experimentalText as
|
|
14
|
+
__experimentalText as WCText,
|
|
15
15
|
} from '@wordpress/components';
|
|
16
16
|
import { __, sprintf } from '@wordpress/i18n';
|
|
17
17
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
@@ -351,7 +351,7 @@ export default function OverlayTemplatePartSelector( {
|
|
|
351
351
|
alignment="flex-start"
|
|
352
352
|
className="wp-block-navigation__overlay-help-text-wrapper"
|
|
353
353
|
>
|
|
354
|
-
<
|
|
354
|
+
<WCText
|
|
355
355
|
variant="muted"
|
|
356
356
|
isBlock
|
|
357
357
|
className="wp-block-navigation__overlay-help-text"
|
|
@@ -359,7 +359,7 @@ export default function OverlayTemplatePartSelector( {
|
|
|
359
359
|
{ __(
|
|
360
360
|
'An overlay template allows you to customize the appearance of the dialog that opens when the menu button is pressed.'
|
|
361
361
|
) }
|
|
362
|
-
</
|
|
362
|
+
</WCText>
|
|
363
363
|
</HStack>
|
|
364
364
|
</div>
|
|
365
365
|
);
|
|
@@ -8,11 +8,7 @@ import clsx from 'clsx';
|
|
|
8
8
|
*/
|
|
9
9
|
import { createBlock } from '@wordpress/blocks';
|
|
10
10
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
11
|
-
import {
|
|
12
|
-
ToolbarButton,
|
|
13
|
-
ToolbarGroup,
|
|
14
|
-
VisuallyHidden,
|
|
15
|
-
} from '@wordpress/components';
|
|
11
|
+
import { ToolbarButton, ToolbarGroup } from '@wordpress/components';
|
|
16
12
|
import { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';
|
|
17
13
|
import { __, sprintf } from '@wordpress/i18n';
|
|
18
14
|
import {
|
|
@@ -26,6 +22,7 @@ import {
|
|
|
26
22
|
} from '@wordpress/block-editor';
|
|
27
23
|
import { isURL, prependHTTP } from '@wordpress/url';
|
|
28
24
|
import { useState, useEffect, useRef, useCallback } from '@wordpress/element';
|
|
25
|
+
import { VisuallyHidden } from '@wordpress/ui';
|
|
29
26
|
import { link as linkIcon, addSubmenu } from '@wordpress/icons';
|
|
30
27
|
import { useMergeRefs, useInstanceId } from '@wordpress/compose';
|
|
31
28
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { Button
|
|
4
|
+
import { Button } from '@wordpress/components';
|
|
5
5
|
import { __, isRTL } from '@wordpress/i18n';
|
|
6
6
|
import { chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';
|
|
7
7
|
import { useInstanceId, useFocusOnMount } from '@wordpress/compose';
|
|
8
|
+
import { VisuallyHidden } from '@wordpress/ui';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Shared BackButton component for consistent navigation across LinkUI sub-components.
|