@wordpress/block-library 9.35.1-next.dc3f6d3c1.0 → 9.36.1-next.6deb34194.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/view.js +46 -4
- package/build/accordion/view.js.map +2 -2
- package/build/accordion-heading/block.json +1 -1
- package/build/accordion-heading/deprecated.js +1 -1
- package/build/accordion-heading/deprecated.js.map +2 -2
- package/build/accordion-panel/block.json +1 -1
- package/build/audio/index.js +13 -10
- package/build/audio/index.js.map +3 -3
- package/build/avatar/edit.js +13 -38
- package/build/avatar/edit.js.map +2 -2
- package/build/breadcrumbs/block.json +3 -2
- package/build/breadcrumbs/edit.js +18 -18
- package/build/breadcrumbs/edit.js.map +2 -2
- package/build/button/index.js +14 -11
- package/build/button/index.js.map +3 -3
- package/build/code/index.js +10 -7
- package/build/code/index.js.map +3 -3
- package/build/comments-pagination-numbers/block.json +7 -0
- package/build/cover/edit/block-controls.js +37 -3
- package/build/cover/edit/block-controls.js.map +3 -3
- package/build/cover/edit/cover-placeholder.js +0 -1
- package/build/cover/edit/cover-placeholder.js.map +2 -2
- package/build/cover/edit/embed-video-url-input.js +83 -0
- package/build/cover/edit/embed-video-url-input.js.map +7 -0
- package/build/cover/edit/index.js +60 -0
- package/build/cover/edit/index.js.map +2 -2
- package/build/cover/embed-video-utils.js +151 -0
- package/build/cover/embed-video-utils.js.map +7 -0
- package/build/cover/index.js +11 -5
- package/build/cover/index.js.map +3 -3
- package/build/cover/save.js +12 -0
- package/build/cover/save.js.map +2 -2
- package/build/cover/shared.js +3 -0
- package/build/cover/shared.js.map +2 -2
- package/build/details/index.js +10 -7
- package/build/details/index.js.map +3 -3
- package/build/file/index.js +15 -15
- package/build/file/index.js.map +3 -3
- package/build/freeform/block.json +1 -1
- package/build/gallery/edit.js +1 -3
- package/build/gallery/edit.js.map +2 -2
- package/build/gallery/transforms.js +7 -3
- package/build/gallery/transforms.js.map +2 -2
- package/build/heading/index.js +10 -7
- package/build/heading/index.js.map +3 -3
- package/build/html/modal.js +141 -121
- package/build/html/modal.js.map +3 -3
- package/build/image/edit.js +0 -1
- package/build/image/edit.js.map +2 -2
- package/build/image/image.js +0 -1
- package/build/image/image.js.map +2 -2
- package/build/image/index.js +19 -19
- package/build/image/index.js.map +3 -3
- package/build/index.js +9 -3
- package/build/index.js.map +2 -2
- package/build/list-item/index.js +9 -7
- package/build/list-item/index.js.map +3 -3
- package/build/math/block.json +28 -1
- package/build/math/edit.js +17 -2
- package/build/math/edit.js.map +2 -2
- package/build/media-text/index.js +16 -9
- package/build/media-text/index.js.map +3 -3
- package/build/media-text/media-container.js +0 -2
- package/build/media-text/media-container.js.map +2 -2
- package/build/missing/block.json +1 -1
- package/build/missing/edit.js +2 -2
- package/build/missing/edit.js.map +1 -1
- package/build/more/index.js +10 -7
- package/build/more/index.js.map +3 -3
- package/build/navigation-link/edit.js +36 -11
- package/build/navigation-link/edit.js.map +2 -2
- package/build/navigation-link/index.js +12 -9
- package/build/navigation-link/index.js.map +3 -3
- package/build/navigation-submenu/index.js +12 -9
- package/build/navigation-submenu/index.js.map +3 -3
- package/build/page-list-item/edit.js +4 -3
- package/build/page-list-item/edit.js.map +2 -2
- package/build/paragraph/deprecated-attributes.js +68 -0
- package/build/paragraph/deprecated-attributes.js.map +7 -0
- package/build/paragraph/edit.js +2 -0
- package/build/paragraph/edit.js.map +3 -3
- package/build/paragraph/index.js +10 -7
- package/build/paragraph/index.js.map +3 -3
- package/build/pattern/block.json +1 -1
- package/build/post-title/edit.js +6 -4
- package/build/post-title/edit.js.map +2 -2
- package/build/preformatted/index.js +10 -7
- package/build/preformatted/index.js.map +3 -3
- package/build/pullquote/index.js +12 -12
- package/build/pullquote/index.js.map +3 -3
- package/build/search/index.js +15 -17
- package/build/search/index.js.map +3 -3
- package/build/social-link/index.js +12 -9
- package/build/social-link/index.js.map +3 -3
- package/build/template-part/edit/index.js +37 -7
- package/build/template-part/edit/index.js.map +2 -2
- package/build/template-part/edit/utils/get-template-part-icon.js +9 -4
- package/build/template-part/edit/utils/get-template-part-icon.js.map +3 -3
- package/build/template-part/edit/utils/hooks.js +2 -3
- package/build/template-part/edit/utils/hooks.js.map +2 -2
- package/build/term-count/index.js +1 -0
- package/build/term-count/index.js.map +2 -2
- package/build/term-name/index.js +1 -0
- package/build/term-name/index.js.map +2 -2
- package/build/verse/index.js +10 -7
- package/build/verse/index.js.map +3 -3
- package/build/video/index.js +13 -10
- package/build/video/index.js.map +3 -3
- package/build-module/accordion/view.js +46 -4
- package/build-module/accordion/view.js.map +2 -2
- package/build-module/accordion-heading/block.json +1 -1
- package/build-module/accordion-heading/deprecated.js +1 -1
- package/build-module/accordion-heading/deprecated.js.map +2 -2
- package/build-module/accordion-panel/block.json +1 -1
- package/build-module/audio/index.js +13 -10
- package/build-module/audio/index.js.map +2 -2
- package/build-module/avatar/edit.js +13 -38
- package/build-module/avatar/edit.js.map +2 -2
- package/build-module/breadcrumbs/block.json +3 -2
- package/build-module/breadcrumbs/edit.js +18 -18
- package/build-module/breadcrumbs/edit.js.map +2 -2
- package/build-module/button/index.js +14 -11
- package/build-module/button/index.js.map +2 -2
- package/build-module/code/index.js +10 -7
- package/build-module/code/index.js.map +2 -2
- package/build-module/comments-pagination-numbers/block.json +7 -0
- package/build-module/cover/edit/block-controls.js +27 -3
- package/build-module/cover/edit/block-controls.js.map +2 -2
- package/build-module/cover/edit/cover-placeholder.js +0 -1
- package/build-module/cover/edit/cover-placeholder.js.map +2 -2
- package/build-module/cover/edit/embed-video-url-input.js +67 -0
- package/build-module/cover/edit/embed-video-url-input.js.map +7 -0
- package/build-module/cover/edit/index.js +61 -0
- package/build-module/cover/edit/index.js.map +2 -2
- package/build-module/cover/embed-video-utils.js +122 -0
- package/build-module/cover/embed-video-utils.js.map +7 -0
- package/build-module/cover/index.js +11 -5
- package/build-module/cover/index.js.map +2 -2
- package/build-module/cover/save.js +13 -0
- package/build-module/cover/save.js.map +2 -2
- package/build-module/cover/shared.js +2 -0
- package/build-module/cover/shared.js.map +2 -2
- package/build-module/details/index.js +10 -7
- package/build-module/details/index.js.map +2 -2
- package/build-module/file/index.js +15 -15
- package/build-module/file/index.js.map +2 -2
- package/build-module/freeform/block.json +1 -1
- package/build-module/gallery/edit.js +1 -3
- package/build-module/gallery/edit.js.map +2 -2
- package/build-module/gallery/transforms.js +7 -3
- package/build-module/gallery/transforms.js.map +2 -2
- package/build-module/heading/index.js +10 -7
- package/build-module/heading/index.js.map +2 -2
- package/build-module/html/modal.js +143 -122
- package/build-module/html/modal.js.map +2 -2
- package/build-module/image/edit.js +0 -1
- package/build-module/image/edit.js.map +2 -2
- package/build-module/image/image.js +0 -1
- package/build-module/image/image.js.map +2 -2
- package/build-module/image/index.js +19 -19
- package/build-module/image/index.js.map +2 -2
- package/build-module/index.js +9 -3
- package/build-module/index.js.map +2 -2
- package/build-module/list-item/index.js +9 -7
- package/build-module/list-item/index.js.map +2 -2
- package/build-module/math/block.json +28 -1
- package/build-module/math/edit.js +18 -3
- package/build-module/math/edit.js.map +2 -2
- package/build-module/media-text/index.js +16 -9
- package/build-module/media-text/index.js.map +2 -2
- package/build-module/media-text/media-container.js +0 -2
- package/build-module/media-text/media-container.js.map +2 -2
- package/build-module/missing/block.json +1 -1
- package/build-module/missing/edit.js +2 -2
- package/build-module/missing/edit.js.map +1 -1
- package/build-module/more/index.js +10 -7
- package/build-module/more/index.js.map +2 -2
- package/build-module/navigation-link/edit.js +37 -12
- package/build-module/navigation-link/edit.js.map +2 -2
- package/build-module/navigation-link/index.js +12 -9
- package/build-module/navigation-link/index.js.map +2 -2
- package/build-module/navigation-submenu/index.js +12 -9
- package/build-module/navigation-submenu/index.js.map +2 -2
- package/build-module/page-list-item/edit.js +4 -3
- package/build-module/page-list-item/edit.js.map +2 -2
- package/build-module/paragraph/deprecated-attributes.js +37 -0
- package/build-module/paragraph/deprecated-attributes.js.map +7 -0
- package/build-module/paragraph/edit.js +2 -0
- package/build-module/paragraph/edit.js.map +2 -2
- package/build-module/paragraph/index.js +10 -7
- package/build-module/paragraph/index.js.map +2 -2
- package/build-module/pattern/block.json +1 -1
- package/build-module/post-title/edit.js +6 -4
- package/build-module/post-title/edit.js.map +2 -2
- package/build-module/preformatted/index.js +10 -7
- package/build-module/preformatted/index.js.map +2 -2
- package/build-module/pullquote/index.js +12 -12
- package/build-module/pullquote/index.js.map +2 -2
- package/build-module/search/index.js +15 -17
- package/build-module/search/index.js.map +2 -2
- package/build-module/social-link/index.js +12 -9
- package/build-module/social-link/index.js.map +2 -2
- package/build-module/template-part/edit/index.js +37 -7
- package/build-module/template-part/edit/index.js.map +2 -2
- package/build-module/template-part/edit/utils/get-template-part-icon.js +10 -4
- package/build-module/template-part/edit/utils/get-template-part-icon.js.map +2 -2
- package/build-module/template-part/edit/utils/hooks.js +2 -3
- package/build-module/template-part/edit/utils/hooks.js.map +2 -2
- package/build-module/term-count/index.js +1 -0
- package/build-module/term-count/index.js.map +2 -2
- package/build-module/term-name/index.js +1 -0
- package/build-module/term-name/index.js.map +2 -2
- package/build-module/verse/index.js +10 -7
- package/build-module/verse/index.js.map +2 -2
- package/build-module/video/index.js +13 -10
- package/build-module/video/index.js.map +2 -2
- package/build-style/accordion/style-rtl.css +3 -0
- package/build-style/accordion/style.css +3 -0
- package/build-style/accordion-heading/style-rtl.css +2 -19
- package/build-style/accordion-heading/style.css +2 -19
- package/build-style/accordion-item/style-rtl.css +0 -7
- package/build-style/accordion-item/style.css +0 -7
- package/build-style/accordion-panel/style-rtl.css +1 -4
- package/build-style/accordion-panel/style.css +1 -4
- package/build-style/classic-rtl.css +24 -0
- package/build-style/classic.css +24 -0
- package/build-style/common-rtl.css +4 -4
- package/build-style/common.css +4 -0
- package/build-style/cover/style-rtl.css +47 -0
- package/build-style/cover/style.css +47 -0
- package/build-style/editor-rtl.css +11 -13
- package/build-style/editor.css +11 -13
- package/build-style/html/editor-rtl.css +11 -13
- package/build-style/html/editor.css +11 -13
- package/build-style/style-rtl.css +59 -33
- package/build-style/style.css +59 -29
- package/build-style/verse/style-rtl.css +2 -0
- package/build-style/verse/style.css +2 -0
- package/package.json +40 -38
- package/src/accordion/style.scss +4 -0
- package/src/accordion/view.js +60 -3
- package/src/accordion-heading/block.json +1 -1
- package/src/accordion-heading/deprecated.js +1 -1
- package/src/accordion-heading/style.scss +2 -38
- package/src/accordion-item/index.php +1 -0
- package/src/accordion-item/style.scss +2 -9
- package/src/accordion-panel/block.json +1 -1
- package/src/accordion-panel/style.scss +1 -5
- package/src/audio/index.js +14 -10
- package/src/avatar/edit.js +68 -83
- package/src/breadcrumbs/block.json +3 -2
- package/src/breadcrumbs/edit.js +18 -18
- package/src/breadcrumbs/index.php +103 -93
- package/src/button/index.js +15 -11
- package/src/classic.scss +38 -0
- package/src/code/index.js +11 -7
- package/src/comments-pagination-numbers/block.json +7 -0
- package/src/common.scss +4 -0
- package/src/cover/edit/block-controls.js +26 -2
- package/src/cover/edit/cover-placeholder.js +0 -1
- package/src/cover/edit/embed-video-url-input.js +74 -0
- package/src/cover/edit/index.js +81 -0
- package/src/cover/embed-video-utils.js +196 -0
- package/src/cover/index.js +12 -5
- package/src/cover/index.php +106 -0
- package/src/cover/save.js +14 -0
- package/src/cover/shared.js +1 -0
- package/src/cover/style.scss +47 -0
- package/src/details/index.js +11 -7
- package/src/file/index.js +16 -15
- package/src/freeform/block.json +1 -1
- package/src/gallery/edit.js +4 -3
- package/src/gallery/transforms.js +6 -2
- package/src/heading/index.js +11 -7
- package/src/html/editor.scss +10 -15
- package/src/html/modal.js +54 -30
- package/src/image/edit.js +0 -1
- package/src/image/image.js +0 -1
- package/src/image/index.js +20 -19
- package/src/image/index.php +1 -0
- package/src/index.js +9 -3
- package/src/list-item/index.js +10 -7
- package/src/math/block.json +28 -1
- package/src/math/edit.js +18 -3
- package/src/media-text/index.js +17 -9
- package/src/media-text/media-container.js +0 -2
- package/src/missing/block.json +1 -1
- package/src/missing/edit.js +2 -2
- package/src/more/index.js +11 -7
- package/src/navigation-link/edit.js +72 -26
- package/src/navigation-link/index.js +13 -9
- package/src/navigation-submenu/index.js +13 -9
- package/src/page-list/index.php +3 -4
- package/src/page-list-item/edit.js +4 -3
- package/src/paragraph/deprecated-attributes.js +45 -0
- package/src/paragraph/edit.js +2 -0
- package/src/paragraph/index.js +11 -7
- package/src/pattern/block.json +1 -1
- package/src/post-title/edit.js +8 -4
- package/src/post-title/index.php +1 -1
- package/src/preformatted/index.js +11 -7
- package/src/pullquote/index.js +13 -12
- package/src/search/index.js +15 -16
- package/src/social-link/index.js +13 -9
- package/src/style.scss +1 -0
- package/src/template-part/edit/index.js +44 -6
- package/src/template-part/edit/utils/get-template-part-icon.js +23 -4
- package/src/template-part/edit/utils/hooks.js +2 -4
- package/src/term-count/index.js +1 -0
- package/src/term-name/index.js +1 -0
- package/src/verse/index.js +11 -7
- package/src/verse/style.scss +4 -0
- package/src/video/index.js +14 -10
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
// In many classic themes, selectors like `.entry-content h1` are used,
|
|
2
|
-
// potentially applying relatively high specificity (such as `0-1-1`) to
|
|
3
|
-
// heading elements. To properly override those styles, use a selector
|
|
4
|
-
// with a specificity of `0-2-0`.
|
|
5
|
-
.wp-block-accordion-heading.wp-block-accordion-heading {
|
|
6
|
-
// Some themes may have an explicit width. Since it's unpredictable
|
|
7
|
-
// what CSS specificity should be used to override them, ensure 100%
|
|
8
|
-
// width using min-width instead.
|
|
9
|
-
min-width: 100%;
|
|
10
|
-
// Some classic themes apply default margins to heading elements,
|
|
11
|
-
// so those styles need to be reset.
|
|
12
|
-
margin: 0;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
1
|
.wp-block-accordion-heading__toggle {
|
|
16
2
|
font-family: inherit;
|
|
17
3
|
font-size: inherit;
|
|
@@ -22,7 +8,9 @@
|
|
|
22
8
|
text-decoration: inherit;
|
|
23
9
|
word-spacing: inherit;
|
|
24
10
|
font-style: inherit;
|
|
11
|
+
background: none;
|
|
25
12
|
border: none;
|
|
13
|
+
color: inherit;
|
|
26
14
|
padding: var(--wp--preset--spacing--20, 1em) 0;
|
|
27
15
|
cursor: pointer;
|
|
28
16
|
overflow: hidden;
|
|
@@ -31,34 +19,10 @@
|
|
|
31
19
|
text-align: inherit;
|
|
32
20
|
width: 100%;
|
|
33
21
|
|
|
34
|
-
// Some themes may apply colors to button elements with a particularly
|
|
35
|
-
// high CSS specificity. Since it's impossible to predict this specificity,
|
|
36
|
-
// we reset the colors using `!important`.
|
|
37
|
-
background-color: inherit !important;
|
|
38
|
-
color: inherit !important;
|
|
39
|
-
|
|
40
22
|
&:not(:focus-visible) {
|
|
41
23
|
outline: none;
|
|
42
24
|
}
|
|
43
25
|
|
|
44
|
-
&:hover,
|
|
45
|
-
&:focus {
|
|
46
|
-
// Some themes may apply styles when a button element is hovered
|
|
47
|
-
// over or focused. This is not intended for accordion toggle
|
|
48
|
-
// buttons, so we reset it here.
|
|
49
|
-
text-decoration: none;
|
|
50
|
-
background-color: inherit !important;
|
|
51
|
-
box-shadow: none;
|
|
52
|
-
color: inherit;
|
|
53
|
-
border: none;
|
|
54
|
-
padding: var(--wp--preset--spacing--20, 1em) 0;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&:focus-visible {
|
|
58
|
-
outline: auto;
|
|
59
|
-
outline-offset: 0;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
26
|
&:hover .wp-block-accordion-heading__toggle-title {
|
|
63
27
|
text-decoration: underline;
|
|
64
28
|
}
|
|
@@ -36,6 +36,7 @@ function block_core_accordion_item_render( $attributes, $content ) {
|
|
|
36
36
|
$p->set_attribute( 'data-wp-context', '{ "id": "' . $unique_id . '", "openByDefault": ' . $open_by_default . ' }' );
|
|
37
37
|
$p->set_attribute( 'data-wp-class--is-open', 'state.isOpen' );
|
|
38
38
|
$p->set_attribute( 'data-wp-init', 'callbacks.initAccordionItems' );
|
|
39
|
+
$p->set_attribute( 'data-wp-on-window--hashchange', 'callbacks.hashChange' );
|
|
39
40
|
|
|
40
41
|
if ( $p->next_tag( array( 'class_name' => 'wp-block-accordion-heading__toggle' ) ) ) {
|
|
41
42
|
$p->set_attribute( 'data-wp-on--click', 'actions.toggle' );
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
.wp-block-accordion-item {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
&.is-open {
|
|
6
|
-
grid-template-rows: max-content 1fr;
|
|
7
|
-
|
|
8
|
-
> .wp-block-accordion-heading .wp-block-accordion-heading__toggle-icon {
|
|
9
|
-
transform: rotate(45deg);
|
|
10
|
-
}
|
|
2
|
+
&.is-open > .wp-block-accordion-heading .wp-block-accordion-heading__toggle-icon {
|
|
3
|
+
transform: rotate(45deg);
|
|
11
4
|
}
|
|
12
5
|
|
|
13
6
|
/* Add transitions only for users who do not prefer reduced motion */
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// and apply some kind of width to the blocks. To properly override
|
|
3
|
-
// those styles, use a selector with a specificity of `0-2-0`.
|
|
4
|
-
.wp-block-accordion-panel.wp-block-accordion-panel {
|
|
5
|
-
min-width: 100%;
|
|
1
|
+
.wp-block-accordion-panel {
|
|
6
2
|
|
|
7
3
|
// Prevent blockGap from Accordion Content block from adding extra margin between accordions.
|
|
8
4
|
&[inert],
|
package/src/audio/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { audio as icon } from '@wordpress/icons';
|
|
6
|
+
import { privateApis as blocksPrivateApis } from '@wordpress/blocks';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
@@ -13,6 +14,9 @@ import edit from './edit';
|
|
|
13
14
|
import metadata from './block.json';
|
|
14
15
|
import save from './save';
|
|
15
16
|
import transforms from './transforms';
|
|
17
|
+
import { unlock } from '../lock-unlock';
|
|
18
|
+
|
|
19
|
+
const { fieldsKey, formKey } = unlock( blocksPrivateApis );
|
|
16
20
|
|
|
17
21
|
const { name } = metadata;
|
|
18
22
|
|
|
@@ -32,15 +36,15 @@ export const settings = {
|
|
|
32
36
|
save,
|
|
33
37
|
};
|
|
34
38
|
|
|
35
|
-
if ( window.
|
|
36
|
-
settings
|
|
39
|
+
if ( window.__experimentalContentOnlyInspectorFields ) {
|
|
40
|
+
settings[ fieldsKey ] = [
|
|
37
41
|
{
|
|
42
|
+
id: 'audio',
|
|
38
43
|
label: __( 'Audio' ),
|
|
39
|
-
type: '
|
|
40
|
-
shownByDefault: true,
|
|
44
|
+
type: 'media',
|
|
41
45
|
mapping: {
|
|
42
46
|
id: 'id',
|
|
43
|
-
|
|
47
|
+
url: 'src',
|
|
44
48
|
},
|
|
45
49
|
args: {
|
|
46
50
|
allowedTypes: [ 'audio' ],
|
|
@@ -48,14 +52,14 @@ if ( window.__experimentalContentOnlyPatternInsertion ) {
|
|
|
48
52
|
},
|
|
49
53
|
},
|
|
50
54
|
{
|
|
55
|
+
id: 'caption',
|
|
51
56
|
label: __( 'Caption' ),
|
|
52
|
-
type: '
|
|
53
|
-
shownByDefault: false,
|
|
54
|
-
mapping: {
|
|
55
|
-
value: 'caption',
|
|
56
|
-
},
|
|
57
|
+
type: 'richtext',
|
|
57
58
|
},
|
|
58
59
|
];
|
|
60
|
+
settings[ formKey ] = {
|
|
61
|
+
fields: [ 'audio' ],
|
|
62
|
+
};
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
export const init = () => initBlock( { name, metadata, settings } );
|
package/src/avatar/edit.js
CHANGED
|
@@ -130,6 +130,19 @@ const AvatarInspectorControls = ( {
|
|
|
130
130
|
);
|
|
131
131
|
};
|
|
132
132
|
|
|
133
|
+
const AvatarLinkWrapper = ( { children, isLink } ) =>
|
|
134
|
+
isLink ? (
|
|
135
|
+
<a
|
|
136
|
+
href="#avatar-pseudo-link"
|
|
137
|
+
className="wp-block-avatar__link"
|
|
138
|
+
onClick={ ( event ) => event.preventDefault() }
|
|
139
|
+
>
|
|
140
|
+
{ children }
|
|
141
|
+
</a>
|
|
142
|
+
) : (
|
|
143
|
+
children
|
|
144
|
+
);
|
|
145
|
+
|
|
133
146
|
const ResizableAvatar = ( {
|
|
134
147
|
setAttributes,
|
|
135
148
|
attributes,
|
|
@@ -146,43 +159,46 @@ const ResizableAvatar = ( {
|
|
|
146
159
|
);
|
|
147
160
|
return (
|
|
148
161
|
<div { ...blockProps }>
|
|
149
|
-
<
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
162
|
+
<AvatarLinkWrapper isLink={ attributes.isLink }>
|
|
163
|
+
<ResizableBox
|
|
164
|
+
size={ {
|
|
165
|
+
width: attributes.size,
|
|
166
|
+
height: attributes.size,
|
|
167
|
+
} }
|
|
168
|
+
showHandle={ isSelected }
|
|
169
|
+
onResizeStop={ ( event, direction, elt, delta ) => {
|
|
170
|
+
setAttributes( {
|
|
171
|
+
size: parseInt(
|
|
172
|
+
attributes.size +
|
|
173
|
+
( delta.height || delta.width ),
|
|
174
|
+
10
|
|
175
|
+
),
|
|
176
|
+
} );
|
|
177
|
+
} }
|
|
178
|
+
lockAspectRatio
|
|
179
|
+
enable={ {
|
|
180
|
+
top: false,
|
|
181
|
+
right: ! isRTL(),
|
|
182
|
+
bottom: true,
|
|
183
|
+
left: isRTL(),
|
|
184
|
+
} }
|
|
185
|
+
minWidth={ avatar.minSize }
|
|
186
|
+
maxWidth={ avatar.maxSize }
|
|
187
|
+
>
|
|
188
|
+
<img
|
|
189
|
+
src={ doubledSizedSrc }
|
|
190
|
+
alt={ avatar.alt }
|
|
191
|
+
className={ clsx(
|
|
192
|
+
'avatar',
|
|
193
|
+
'avatar-' + attributes.size,
|
|
194
|
+
'photo',
|
|
195
|
+
'wp-block-avatar__image',
|
|
196
|
+
borderProps.className
|
|
197
|
+
) }
|
|
198
|
+
style={ borderProps.style }
|
|
199
|
+
/>
|
|
200
|
+
</ResizableBox>
|
|
201
|
+
</AvatarLinkWrapper>
|
|
186
202
|
</div>
|
|
187
203
|
);
|
|
188
204
|
};
|
|
@@ -198,29 +214,13 @@ const CommentEdit = ( { attributes, context, setAttributes, isSelected } ) => {
|
|
|
198
214
|
attributes={ attributes }
|
|
199
215
|
selectUser={ false }
|
|
200
216
|
/>
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
attributes={ attributes }
|
|
209
|
-
avatar={ avatar }
|
|
210
|
-
blockProps={ blockProps }
|
|
211
|
-
isSelected={ isSelected }
|
|
212
|
-
setAttributes={ setAttributes }
|
|
213
|
-
/>
|
|
214
|
-
</a>
|
|
215
|
-
) : (
|
|
216
|
-
<ResizableAvatar
|
|
217
|
-
attributes={ attributes }
|
|
218
|
-
avatar={ avatar }
|
|
219
|
-
blockProps={ blockProps }
|
|
220
|
-
isSelected={ isSelected }
|
|
221
|
-
setAttributes={ setAttributes }
|
|
222
|
-
/>
|
|
223
|
-
) }
|
|
217
|
+
<ResizableAvatar
|
|
218
|
+
attributes={ attributes }
|
|
219
|
+
avatar={ avatar }
|
|
220
|
+
blockProps={ blockProps }
|
|
221
|
+
isSelected={ isSelected }
|
|
222
|
+
setAttributes={ setAttributes }
|
|
223
|
+
/>
|
|
224
224
|
</>
|
|
225
225
|
);
|
|
226
226
|
};
|
|
@@ -241,29 +241,14 @@ const UserEdit = ( { attributes, context, setAttributes, isSelected } ) => {
|
|
|
241
241
|
avatar={ avatar }
|
|
242
242
|
setAttributes={ setAttributes }
|
|
243
243
|
/>
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
avatar={ avatar }
|
|
253
|
-
blockProps={ blockProps }
|
|
254
|
-
isSelected={ isSelected }
|
|
255
|
-
setAttributes={ setAttributes }
|
|
256
|
-
/>
|
|
257
|
-
</a>
|
|
258
|
-
) : (
|
|
259
|
-
<ResizableAvatar
|
|
260
|
-
attributes={ attributes }
|
|
261
|
-
avatar={ avatar }
|
|
262
|
-
blockProps={ blockProps }
|
|
263
|
-
isSelected={ isSelected }
|
|
264
|
-
setAttributes={ setAttributes }
|
|
265
|
-
/>
|
|
266
|
-
) }
|
|
244
|
+
|
|
245
|
+
<ResizableAvatar
|
|
246
|
+
attributes={ attributes }
|
|
247
|
+
avatar={ avatar }
|
|
248
|
+
blockProps={ blockProps }
|
|
249
|
+
isSelected={ isSelected }
|
|
250
|
+
setAttributes={ setAttributes }
|
|
251
|
+
/>
|
|
267
252
|
</>
|
|
268
253
|
);
|
|
269
254
|
};
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"type": "string",
|
|
17
17
|
"default": "/"
|
|
18
18
|
},
|
|
19
|
-
"
|
|
19
|
+
"showHomeItem": {
|
|
20
20
|
"type": "boolean",
|
|
21
21
|
"default": true
|
|
22
22
|
},
|
|
23
|
-
"
|
|
23
|
+
"showCurrentItem": {
|
|
24
24
|
"type": "boolean",
|
|
25
25
|
"default": true
|
|
26
26
|
},
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"usesContext": [ "postId", "postType", "templateSlug" ],
|
|
33
33
|
"supports": {
|
|
34
34
|
"html": false,
|
|
35
|
+
"align": [ "wide", "full" ],
|
|
35
36
|
"spacing": {
|
|
36
37
|
"margin": true,
|
|
37
38
|
"padding": true
|
package/src/breadcrumbs/edit.js
CHANGED
|
@@ -30,8 +30,8 @@ export default function BreadcrumbEdit( {
|
|
|
30
30
|
} ) {
|
|
31
31
|
const {
|
|
32
32
|
separator,
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
showHomeItem,
|
|
34
|
+
showCurrentItem,
|
|
35
35
|
prefersTaxonomy,
|
|
36
36
|
showOnHomePage,
|
|
37
37
|
} = attributes;
|
|
@@ -143,7 +143,7 @@ export default function BreadcrumbEdit( {
|
|
|
143
143
|
( _showTerms && ! hasTermsAssigned );
|
|
144
144
|
if ( showPlaceholder ) {
|
|
145
145
|
const placeholderItems = [];
|
|
146
|
-
if (
|
|
146
|
+
if ( showHomeItem ) {
|
|
147
147
|
placeholderItems.push( __( 'Home' ) );
|
|
148
148
|
}
|
|
149
149
|
if ( templateSlug && ! postId ) {
|
|
@@ -168,7 +168,7 @@ export default function BreadcrumbEdit( {
|
|
|
168
168
|
</a>
|
|
169
169
|
</li>
|
|
170
170
|
) ) }
|
|
171
|
-
{
|
|
171
|
+
{ showCurrentItem && (
|
|
172
172
|
<li>
|
|
173
173
|
<span aria-current="page">{ __( 'Current' ) }</span>
|
|
174
174
|
</li>
|
|
@@ -185,48 +185,48 @@ export default function BreadcrumbEdit( {
|
|
|
185
185
|
resetAll={ () => {
|
|
186
186
|
setAttributes( {
|
|
187
187
|
separator: separatorDefaultValue,
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
showHomeItem: true,
|
|
189
|
+
showCurrentItem: true,
|
|
190
190
|
} );
|
|
191
191
|
} }
|
|
192
192
|
dropdownMenuProps={ dropdownMenuProps }
|
|
193
193
|
>
|
|
194
194
|
<ToolsPanelItem
|
|
195
|
-
label={ __( 'Show home
|
|
195
|
+
label={ __( 'Show home breadcrumb' ) }
|
|
196
196
|
isShownByDefault
|
|
197
|
-
hasValue={ () => !
|
|
197
|
+
hasValue={ () => ! showHomeItem }
|
|
198
198
|
onDeselect={ () =>
|
|
199
199
|
setAttributes( {
|
|
200
|
-
|
|
200
|
+
showHomeItem: true,
|
|
201
201
|
} )
|
|
202
202
|
}
|
|
203
203
|
>
|
|
204
204
|
<ToggleControl
|
|
205
205
|
__nextHasNoMarginBottom
|
|
206
|
-
label={ __( 'Show home
|
|
206
|
+
label={ __( 'Show home breadcrumb' ) }
|
|
207
207
|
onChange={ ( value ) =>
|
|
208
|
-
setAttributes( {
|
|
208
|
+
setAttributes( { showHomeItem: value } )
|
|
209
209
|
}
|
|
210
|
-
checked={
|
|
210
|
+
checked={ showHomeItem }
|
|
211
211
|
/>
|
|
212
212
|
</ToolsPanelItem>
|
|
213
213
|
<ToolsPanelItem
|
|
214
|
-
label={ __( 'Show
|
|
214
|
+
label={ __( 'Show current breadcrumb' ) }
|
|
215
215
|
isShownByDefault
|
|
216
|
-
hasValue={ () => !
|
|
216
|
+
hasValue={ () => ! showCurrentItem }
|
|
217
217
|
onDeselect={ () =>
|
|
218
218
|
setAttributes( {
|
|
219
|
-
|
|
219
|
+
showCurrentItem: true,
|
|
220
220
|
} )
|
|
221
221
|
}
|
|
222
222
|
>
|
|
223
223
|
<ToggleControl
|
|
224
224
|
__nextHasNoMarginBottom
|
|
225
|
-
label={ __( 'Show
|
|
225
|
+
label={ __( 'Show current breadcrumb' ) }
|
|
226
226
|
onChange={ ( value ) =>
|
|
227
|
-
setAttributes( {
|
|
227
|
+
setAttributes( { showCurrentItem: value } )
|
|
228
228
|
}
|
|
229
|
-
checked={
|
|
229
|
+
checked={ showCurrentItem }
|
|
230
230
|
/>
|
|
231
231
|
</ToolsPanelItem>
|
|
232
232
|
<ToolsPanelItem
|