@wordpress/block-library 9.44.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/button/constants.cjs +1 -1
- package/build/button/constants.cjs.map +1 -1
- 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/group/block.json +2 -1
- package/build/image/constants.cjs +1 -1
- package/build/image/constants.cjs.map +2 -2
- package/build/image/edit.cjs +2 -4
- package/build/image/edit.cjs.map +2 -2
- package/build/image/image.cjs +49 -19
- package/build/image/image.cjs.map +3 -3
- package/build/index.cjs +4 -4
- package/build/index.cjs.map +2 -2
- package/build/latest-posts/edit.cjs +1 -1
- package/build/latest-posts/edit.cjs.map +1 -1
- 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/paragraph/use-enter.cjs +12 -23
- package/build/paragraph/use-enter.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/post-featured-image/edit.cjs +2 -5
- package/build/post-featured-image/edit.cjs.map +2 -2
- package/build/post-template/edit.cjs +8 -2
- package/build/post-template/edit.cjs.map +2 -2
- package/build/pullquote/block.json +1 -4
- 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 +34 -20
- 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 +76 -92
- 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 +4 -4
- package/build/{tabs-menu → tab-list}/edit.cjs +9 -14
- 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 +88 -18
- 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 -2
- package/build/tabs/controls.cjs +2 -2
- package/build/tabs/controls.cjs.map +1 -1
- package/build/tabs/edit.cjs +29 -100
- 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-list-sync.cjs +190 -0
- 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/button/constants.mjs +1 -1
- package/build-module/button/constants.mjs.map +1 -1
- 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/group/block.json +2 -1
- package/build-module/image/constants.mjs +1 -1
- package/build-module/image/constants.mjs.map +2 -2
- package/build-module/image/edit.mjs +2 -4
- package/build-module/image/edit.mjs.map +2 -2
- package/build-module/image/image.mjs +49 -19
- 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/latest-posts/edit.mjs +1 -1
- package/build-module/latest-posts/edit.mjs.map +1 -1
- 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/paragraph/use-enter.mjs +13 -23
- package/build-module/paragraph/use-enter.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/post-featured-image/edit.mjs +2 -5
- package/build-module/post-featured-image/edit.mjs.map +2 -2
- package/build-module/post-template/edit.mjs +8 -2
- package/build-module/post-template/edit.mjs.map +2 -2
- package/build-module/pullquote/block.json +1 -4
- 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 +34 -20
- 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 +80 -96
- 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 +4 -4
- package/build-module/{tabs-menu → tab-list}/edit.mjs +9 -14
- 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 +90 -20
- 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 -2
- package/build-module/tabs/controls.mjs +2 -2
- package/build-module/tabs/controls.mjs.map +1 -1
- package/build-module/tabs/edit.mjs +31 -102
- 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/latest-comments/style-rtl.css +4 -4
- package/build-style/latest-comments/style.css +4 -4
- package/build-style/post-template/style-rtl.css +1 -1
- package/build-style/post-template/style.css +1 -1
- package/build-style/style-rtl.css +45 -48
- package/build-style/style.css +45 -48
- 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/tabs/style-rtl.css +0 -3
- package/build-style/tabs/style.css +0 -3
- 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/block/test/edit.native.js +1 -1
- package/src/button/constants.js +1 -1
- package/src/button/test/get-updated-link-attributes.js +6 -10
- 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/group/block.json +2 -1
- package/src/image/constants.js +1 -1
- package/src/image/edit.js +5 -3
- package/src/image/edit.native.js +3 -3
- package/src/image/image.js +63 -27
- package/src/image/test/edit.native.js +2 -2
- package/src/index.js +4 -4
- package/src/latest-comments/style.scss +7 -7
- package/src/latest-posts/edit.js +1 -1
- package/src/latest-posts/index.php +1 -1
- 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/edit/test/overlay-template-part-selector.js +1 -0
- 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/paragraph/use-enter.js +18 -24
- package/src/post-author/edit.js +3 -5
- package/src/post-comments-form/edit.js +1 -1
- package/src/post-featured-image/edit.js +2 -9
- package/src/post-template/edit.js +7 -1
- package/src/post-template/index.php +3 -0
- package/src/post-template/style.scss +2 -2
- package/src/pullquote/block.json +1 -4
- 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 +40 -20
- 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 +94 -123
- 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 +4 -4
- package/src/{tabs-menu → tab-list}/edit.js +9 -18
- 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 +121 -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 -2
- package/src/tabs/controls.js +2 -2
- package/src/tabs/edit.js +32 -150
- package/src/tabs/index.js +5 -5
- package/src/tabs/index.php +5 -5
- package/src/tabs/style.scss +0 -3
- 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/tab/slug-from-label.cjs +0 -37
- package/build/tab/slug-from-label.cjs.map +0 -7
- package/build/tabs-menu/edit.cjs.map +0 -7
- package/build/tabs-menu-item/block.json +0 -59
- package/build/tabs-menu-item/controls.cjs.map +0 -7
- package/build/tabs-menu-item/edit.cjs +0 -144
- 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/tab/slug-from-label.mjs +0 -16
- package/build-module/tab/slug-from-label.mjs.map +0 -7
- package/build-module/tabs-menu/edit.mjs.map +0 -7
- package/build-module/tabs-menu-item/block.json +0 -59
- 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 -117
- 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/tab/slug-from-label.js +0 -26
- package/src/tabs-menu/index.php +0 -80
- package/src/tabs-menu-item/block.json +0 -59
- package/src/tabs-menu-item/controls.js +0 -19
- package/src/tabs-menu-item/edit.js +0 -150
- 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.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/group/block.json
CHANGED
package/src/image/constants.js
CHANGED
|
@@ -3,7 +3,7 @@ export const LINK_DESTINATION_NONE = 'none';
|
|
|
3
3
|
export const LINK_DESTINATION_MEDIA = 'media';
|
|
4
4
|
export const LINK_DESTINATION_ATTACHMENT = 'attachment';
|
|
5
5
|
export const LINK_DESTINATION_CUSTOM = 'custom';
|
|
6
|
-
export const NEW_TAB_REL = [ '
|
|
6
|
+
export const NEW_TAB_REL = [ 'noopener' ];
|
|
7
7
|
export const ALLOWED_MEDIA_TYPES = [ 'image' ];
|
|
8
8
|
export const MEDIA_ID_NO_FEATURED_IMAGE_SET = 0;
|
|
9
9
|
export const SIZED_LAYOUTS = [ 'flex', 'grid' ];
|
package/src/image/edit.js
CHANGED
|
@@ -142,8 +142,6 @@ export function ImageEdit( {
|
|
|
142
142
|
setAttributes( {
|
|
143
143
|
width: undefined,
|
|
144
144
|
height: undefined,
|
|
145
|
-
aspectRatio: undefined,
|
|
146
|
-
scale: undefined,
|
|
147
145
|
} );
|
|
148
146
|
}
|
|
149
147
|
}, [ __unstableMarkNextChangeAsNotPersistent, align, setAttributes ] );
|
|
@@ -355,7 +353,11 @@ export function ImageEdit( {
|
|
|
355
353
|
|
|
356
354
|
const isSideloading = useSelect(
|
|
357
355
|
( select ) => {
|
|
358
|
-
if (
|
|
356
|
+
if (
|
|
357
|
+
( ! window.__clientSideMediaProcessing &&
|
|
358
|
+
! window.__heicUploadSupport ) ||
|
|
359
|
+
! id
|
|
360
|
+
) {
|
|
359
361
|
return false;
|
|
360
362
|
}
|
|
361
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
|
{
|
|
@@ -362,27 +365,6 @@ export default function Image( {
|
|
|
362
365
|
[ id, isSingleSelected ]
|
|
363
366
|
);
|
|
364
367
|
|
|
365
|
-
// If the image has an id but the attachment doesn't exist on this site,
|
|
366
|
-
// clear the id so Gutenberg treats the image as external.
|
|
367
|
-
// This handles content copied between WordPress sites.
|
|
368
|
-
//
|
|
369
|
-
// Known limitation: if a different attachment with the same id happens to
|
|
370
|
-
// exist on the destination site, the lookup will succeed and the wrong
|
|
371
|
-
// local image will be used. URL matching could address this in a follow-up.
|
|
372
|
-
// See: https://github.com/WordPress/gutenberg/issues/74156
|
|
373
|
-
useEffect( () => {
|
|
374
|
-
if ( ! id || ! isSingleSelected ) {
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
// Only clear for confirmed 404s. apiFetch throws the Response object
|
|
378
|
-
// for HTTP errors, so checking .status === 404 avoids incorrectly
|
|
379
|
-
// clearing the id on 403, 500, or network failures, which would
|
|
380
|
-
// cause data loss for valid local attachments.
|
|
381
|
-
if ( attachmentResolutionError?.status === 404 ) {
|
|
382
|
-
setAttributes( { id: undefined } );
|
|
383
|
-
}
|
|
384
|
-
}, [ id, isSingleSelected, attachmentResolutionError, setAttributes ] );
|
|
385
|
-
|
|
386
368
|
const {
|
|
387
369
|
canInsertCover,
|
|
388
370
|
imageEditing,
|
|
@@ -411,9 +393,27 @@ export default function Image( {
|
|
|
411
393
|
[ clientId ]
|
|
412
394
|
);
|
|
413
395
|
const { getBlock, getSettings } = useSelect( blockEditorStore );
|
|
414
|
-
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
|
+
);
|
|
415
411
|
|
|
416
|
-
const {
|
|
412
|
+
const {
|
|
413
|
+
replaceBlocks,
|
|
414
|
+
toggleSelection,
|
|
415
|
+
__unstableMarkNextChangeAsNotPersistent,
|
|
416
|
+
} = useDispatch( blockEditorStore );
|
|
417
417
|
const { createErrorNotice, createSuccessNotice } =
|
|
418
418
|
useDispatch( noticesStore );
|
|
419
419
|
const { editEntityRecord } = useDispatch( coreStore );
|
|
@@ -444,6 +444,34 @@ export default function Image( {
|
|
|
444
444
|
)
|
|
445
445
|
.map( ( { name, slug } ) => ( { value: slug, label: name } ) );
|
|
446
446
|
|
|
447
|
+
// If the image has an id but the attachment doesn't exist on this site,
|
|
448
|
+
// clear the id so Gutenberg treats the image as external.
|
|
449
|
+
// This handles content copied between WordPress sites.
|
|
450
|
+
//
|
|
451
|
+
// Known limitation: if a different attachment with the same id happens to
|
|
452
|
+
// exist on the destination site, the lookup will succeed and the wrong
|
|
453
|
+
// local image will be used. URL matching could address this in a follow-up.
|
|
454
|
+
// See: https://github.com/WordPress/gutenberg/issues/74156
|
|
455
|
+
useEffect( () => {
|
|
456
|
+
if ( ! id || ! isSingleSelected ) {
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
// Only clear for confirmed 404s. apiFetch throws the Response object
|
|
460
|
+
// for HTTP errors, so checking .status === 404 avoids incorrectly
|
|
461
|
+
// clearing the id on 403, 500, or network failures, which would
|
|
462
|
+
// cause data loss for valid local attachments.
|
|
463
|
+
if ( attachmentResolutionError?.status === 404 ) {
|
|
464
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
465
|
+
setAttributes( { id: undefined } );
|
|
466
|
+
}
|
|
467
|
+
}, [
|
|
468
|
+
id,
|
|
469
|
+
isSingleSelected,
|
|
470
|
+
attachmentResolutionError,
|
|
471
|
+
setAttributes,
|
|
472
|
+
__unstableMarkNextChangeAsNotPersistent,
|
|
473
|
+
] );
|
|
474
|
+
|
|
447
475
|
// If an image is externally hosted, try to fetch the image data. This may
|
|
448
476
|
// fail if the image host doesn't allow CORS with the domain. If it works,
|
|
449
477
|
// we can enable a button in the toolbar to upload the image.
|
|
@@ -864,7 +892,15 @@ export default function Image( {
|
|
|
864
892
|
) }
|
|
865
893
|
{ allowCrop && (
|
|
866
894
|
<ToolbarButton
|
|
867
|
-
onClick={
|
|
895
|
+
onClick={
|
|
896
|
+
openMediaEditorModal && id
|
|
897
|
+
? () =>
|
|
898
|
+
openMediaEditorModal( {
|
|
899
|
+
id,
|
|
900
|
+
onUpdate: handleMediaUpdate,
|
|
901
|
+
} )
|
|
902
|
+
: () => setIsEditingImage( true )
|
|
903
|
+
}
|
|
868
904
|
icon={ crop }
|
|
869
905
|
label={ __( 'Crop' ) }
|
|
870
906
|
/>
|
|
@@ -269,7 +269,7 @@ describe( 'Image Block', () => {
|
|
|
269
269
|
fireEvent.press( linkTargetButton );
|
|
270
270
|
|
|
271
271
|
const expectedHtml = `<!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"custom","className":"is-style-default"} -->
|
|
272
|
-
<figure class="wp-block-image size-large is-style-default"><a href="https://wordpress.org" target="_blank" rel="
|
|
272
|
+
<figure class="wp-block-image size-large is-style-default"><a href="https://wordpress.org" target="_blank" rel="noopener"><img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/></a><figcaption class="wp-element-caption">Mountain</figcaption></figure>
|
|
273
273
|
<!-- /wp:image -->`;
|
|
274
274
|
expect( getEditorHtml() ).toBe( expectedHtml );
|
|
275
275
|
} );
|
|
@@ -278,7 +278,7 @@ describe( 'Image Block', () => {
|
|
|
278
278
|
const initialHtml = `
|
|
279
279
|
<!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"custom","className":"is-style-default"} -->
|
|
280
280
|
<figure class="wp-block-image size-large is-style-default">
|
|
281
|
-
<a href="https://wordpress.org" target="_blank" rel="
|
|
281
|
+
<a href="https://wordpress.org" target="_blank" rel="noopener">
|
|
282
282
|
<img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/>
|
|
283
283
|
</a>
|
|
284
284
|
<figcaption class="wp-element-caption">Mountain</figcaption>
|
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
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
// Reset the browser's default `padding-inline-start: 40px` on `<ol>`.
|
|
2
|
+
// Using `:where` keeps specificity at 0 so global styles, theme.json,
|
|
3
|
+
// and inspector controls can override it without difficulty.
|
|
4
|
+
:where(.wp-block-latest-comments) {
|
|
5
|
+
padding-left: 0;
|
|
6
|
+
}
|
|
7
|
+
|
|
1
8
|
// Lower specificity - target list element.
|
|
2
9
|
ol.wp-block-latest-comments {
|
|
3
10
|
// Removes left spacing in Customizer Widgets screen.
|
|
@@ -26,13 +33,6 @@ ol.wp-block-latest-comments {
|
|
|
26
33
|
}
|
|
27
34
|
}
|
|
28
35
|
|
|
29
|
-
// Higher specificity - target list via wrapper.
|
|
30
|
-
.wp-block-latest-comments .wp-block-latest-comments {
|
|
31
|
-
// Remove left spacing. Higher specificity required to
|
|
32
|
-
// override default wp-block layout styles in the Post/Site editor.
|
|
33
|
-
padding-left: 0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
36
|
.wp-block-latest-comments__comment {
|
|
37
37
|
list-style: none;
|
|
38
38
|
margin-bottom: 1em;
|
package/src/latest-posts/edit.js
CHANGED
|
@@ -743,7 +743,7 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
743
743
|
<a
|
|
744
744
|
className="wp-block-latest-posts__read-more"
|
|
745
745
|
href={ post.link }
|
|
746
|
-
rel="noopener
|
|
746
|
+
rel="noopener"
|
|
747
747
|
onClick={
|
|
748
748
|
showRedirectionPreventedNotice
|
|
749
749
|
}
|
|
@@ -163,7 +163,7 @@ function render_block_core_latest_posts( $attributes ) {
|
|
|
163
163
|
$trimmed_excerpt = substr( $trimmed_excerpt, 0, -11 );
|
|
164
164
|
$trimmed_excerpt .= sprintf(
|
|
165
165
|
/* translators: 1: A URL to a post, 2: Hidden accessibility text: Post title */
|
|
166
|
-
__( '… <a class="wp-block-latest-posts__read-more" href="%1$s" rel="noopener
|
|
166
|
+
__( '… <a class="wp-block-latest-posts__read-more" href="%1$s" rel="noopener">Read more<span class="screen-reader-text">: %2$s</span></a>' ),
|
|
167
167
|
esc_url( $post_link ),
|
|
168
168
|
esc_html( $title )
|
|
169
169
|
);
|
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
|
|