@wordpress/block-library 9.36.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/build/audio/index.js +1 -1
- package/build/audio/index.js.map +2 -2
- 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 +1 -1
- package/build/button/index.js.map +2 -2
- package/build/code/index.js +1 -1
- package/build/code/index.js.map +2 -2
- package/build/comments-pagination-numbers/block.json +7 -0
- package/build/cover/index.js +2 -2
- package/build/cover/index.js.map +2 -2
- package/build/details/index.js +1 -1
- package/build/details/index.js.map +2 -2
- package/build/file/index.js +1 -1
- package/build/file/index.js.map +2 -2
- package/build/gallery/edit.js +1 -1
- 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 +1 -1
- package/build/heading/index.js.map +2 -2
- package/build/html/modal.js +18 -7
- package/build/html/modal.js.map +2 -2
- package/build/image/index.js +1 -1
- package/build/image/index.js.map +2 -2
- package/build/index.js +9 -3
- package/build/index.js.map +2 -2
- package/build/list-item/index.js +1 -1
- package/build/list-item/index.js.map +2 -2
- package/build/math/edit.js +14 -2
- package/build/math/edit.js.map +2 -2
- package/build/media-text/index.js +1 -1
- package/build/media-text/index.js.map +2 -2
- package/build/more/index.js +1 -1
- package/build/more/index.js.map +2 -2
- package/build/navigation-link/index.js +1 -1
- package/build/navigation-link/index.js.map +2 -2
- package/build/navigation-submenu/index.js +1 -1
- package/build/navigation-submenu/index.js.map +2 -2
- package/build/page-list-item/edit.js +4 -3
- package/build/page-list-item/edit.js.map +2 -2
- package/build/paragraph/index.js +1 -1
- package/build/paragraph/index.js.map +2 -2
- package/build/post-title/edit.js +6 -4
- package/build/post-title/edit.js.map +2 -2
- package/build/preformatted/index.js +1 -1
- package/build/preformatted/index.js.map +2 -2
- package/build/pullquote/index.js +1 -1
- package/build/pullquote/index.js.map +2 -2
- package/build/search/index.js +1 -1
- package/build/search/index.js.map +2 -2
- package/build/social-link/index.js +1 -1
- package/build/social-link/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/verse/index.js +1 -1
- package/build/verse/index.js.map +2 -2
- package/build/video/index.js +1 -1
- package/build/video/index.js.map +2 -2
- package/build-module/audio/index.js +1 -1
- 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 +1 -1
- package/build-module/button/index.js.map +2 -2
- package/build-module/code/index.js +1 -1
- package/build-module/code/index.js.map +2 -2
- package/build-module/comments-pagination-numbers/block.json +7 -0
- package/build-module/cover/index.js +2 -2
- package/build-module/cover/index.js.map +2 -2
- package/build-module/details/index.js +1 -1
- package/build-module/details/index.js.map +2 -2
- package/build-module/file/index.js +1 -1
- package/build-module/file/index.js.map +2 -2
- package/build-module/gallery/edit.js +1 -1
- 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 +1 -1
- package/build-module/heading/index.js.map +2 -2
- package/build-module/html/modal.js +19 -7
- package/build-module/html/modal.js.map +2 -2
- package/build-module/image/index.js +1 -1
- 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 +1 -1
- package/build-module/list-item/index.js.map +2 -2
- package/build-module/math/edit.js +15 -3
- package/build-module/math/edit.js.map +2 -2
- package/build-module/media-text/index.js +1 -1
- package/build-module/media-text/index.js.map +2 -2
- package/build-module/more/index.js +1 -1
- package/build-module/more/index.js.map +2 -2
- package/build-module/navigation-link/index.js +1 -1
- package/build-module/navigation-link/index.js.map +2 -2
- package/build-module/navigation-submenu/index.js +1 -1
- 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/index.js +1 -1
- package/build-module/paragraph/index.js.map +2 -2
- 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 +1 -1
- package/build-module/preformatted/index.js.map +2 -2
- package/build-module/pullquote/index.js +1 -1
- package/build-module/pullquote/index.js.map +2 -2
- package/build-module/search/index.js +1 -1
- package/build-module/search/index.js.map +2 -2
- package/build-module/social-link/index.js +1 -1
- package/build-module/social-link/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/verse/index.js +1 -1
- package/build-module/verse/index.js.map +2 -2
- package/build-module/video/index.js +1 -1
- package/build-module/video/index.js.map +2 -2
- package/build-style/accordion-heading/style-rtl.css +2 -18
- package/build-style/accordion-heading/style.css +2 -18
- 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/style-rtl.css +8 -22
- package/build-style/style.css +8 -18
- 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-heading/style.scss +2 -30
- package/src/audio/index.js +1 -1
- 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 +38 -17
- package/src/button/index.js +1 -1
- package/src/classic.scss +38 -0
- package/src/code/index.js +1 -1
- package/src/comments-pagination-numbers/block.json +7 -0
- package/src/common.scss +4 -0
- package/src/cover/index.js +2 -2
- package/src/details/index.js +1 -1
- package/src/file/index.js +1 -1
- package/src/gallery/edit.js +4 -1
- package/src/gallery/transforms.js +6 -2
- package/src/heading/index.js +1 -1
- package/src/html/modal.js +39 -20
- package/src/image/index.js +1 -1
- package/src/index.js +9 -3
- package/src/list-item/index.js +1 -1
- package/src/math/edit.js +15 -3
- package/src/media-text/index.js +1 -1
- package/src/more/index.js +1 -1
- package/src/navigation-link/index.js +1 -1
- package/src/navigation-submenu/index.js +1 -1
- package/src/page-list/index.php +3 -4
- package/src/page-list-item/edit.js +4 -3
- package/src/paragraph/index.js +1 -1
- package/src/post-title/edit.js +8 -4
- package/src/post-title/index.php +1 -1
- package/src/preformatted/index.js +1 -1
- package/src/pullquote/index.js +1 -1
- package/src/search/index.js +1 -1
- package/src/social-link/index.js +1 -1
- package/src/template-part/edit/utils/get-template-part-icon.js +23 -4
- package/src/verse/index.js +1 -1
- package/src/verse/style.scss +4 -0
- package/src/video/index.js +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/build-style/style.css
CHANGED
|
@@ -18,10 +18,6 @@
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
.wp-block-accordion-heading {
|
|
22
|
-
margin: 0;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
21
|
.wp-block-accordion-heading__toggle {
|
|
26
22
|
font-family: inherit;
|
|
27
23
|
font-size: inherit;
|
|
@@ -32,7 +28,9 @@
|
|
|
32
28
|
text-decoration: inherit;
|
|
33
29
|
word-spacing: inherit;
|
|
34
30
|
font-style: inherit;
|
|
31
|
+
background: none;
|
|
35
32
|
border: none;
|
|
33
|
+
color: inherit;
|
|
36
34
|
padding: var(--wp--preset--spacing--20, 1em) 0;
|
|
37
35
|
cursor: pointer;
|
|
38
36
|
overflow: hidden;
|
|
@@ -40,24 +38,10 @@
|
|
|
40
38
|
align-items: center;
|
|
41
39
|
text-align: inherit;
|
|
42
40
|
width: 100%;
|
|
43
|
-
background-color: inherit !important;
|
|
44
|
-
color: inherit !important;
|
|
45
41
|
}
|
|
46
42
|
.wp-block-accordion-heading__toggle:not(:focus-visible) {
|
|
47
43
|
outline: none;
|
|
48
44
|
}
|
|
49
|
-
.wp-block-accordion-heading__toggle:hover, .wp-block-accordion-heading__toggle:focus {
|
|
50
|
-
text-decoration: none;
|
|
51
|
-
background-color: inherit !important;
|
|
52
|
-
box-shadow: none;
|
|
53
|
-
color: inherit;
|
|
54
|
-
border: none;
|
|
55
|
-
padding: var(--wp--preset--spacing--20, 1em) 0;
|
|
56
|
-
}
|
|
57
|
-
.wp-block-accordion-heading__toggle:focus-visible {
|
|
58
|
-
outline: auto;
|
|
59
|
-
outline-offset: 0;
|
|
60
|
-
}
|
|
61
45
|
.wp-block-accordion-heading__toggle:hover .wp-block-accordion-heading__toggle-title {
|
|
62
46
|
text-decoration: underline;
|
|
63
47
|
}
|
|
@@ -4563,6 +4547,8 @@ ul.wp-block-rss.is-grid li {
|
|
|
4563
4547
|
pre.wp-block-verse {
|
|
4564
4548
|
overflow: auto;
|
|
4565
4549
|
white-space: pre-wrap;
|
|
4550
|
+
min-width: 1em;
|
|
4551
|
+
word-break: break-word;
|
|
4566
4552
|
}
|
|
4567
4553
|
|
|
4568
4554
|
:where(pre.wp-block-verse) {
|
|
@@ -4784,6 +4770,7 @@ html :where([style*=border-top-color]) {
|
|
|
4784
4770
|
}
|
|
4785
4771
|
|
|
4786
4772
|
html :where([style*=border-right-color]) {
|
|
4773
|
+
/*rtl:ignore*/
|
|
4787
4774
|
border-right-style: solid;
|
|
4788
4775
|
}
|
|
4789
4776
|
|
|
@@ -4792,6 +4779,7 @@ html :where([style*=border-bottom-color]) {
|
|
|
4792
4779
|
}
|
|
4793
4780
|
|
|
4794
4781
|
html :where([style*=border-left-color]) {
|
|
4782
|
+
/*rtl:ignore*/
|
|
4795
4783
|
border-left-style: solid;
|
|
4796
4784
|
}
|
|
4797
4785
|
|
|
@@ -4804,6 +4792,7 @@ html :where([style*=border-top-width]) {
|
|
|
4804
4792
|
}
|
|
4805
4793
|
|
|
4806
4794
|
html :where([style*=border-right-width]) {
|
|
4795
|
+
/*rtl:ignore*/
|
|
4807
4796
|
border-right-style: solid;
|
|
4808
4797
|
}
|
|
4809
4798
|
|
|
@@ -4812,6 +4801,7 @@ html :where([style*=border-bottom-width]) {
|
|
|
4812
4801
|
}
|
|
4813
4802
|
|
|
4814
4803
|
html :where([style*=border-left-width]) {
|
|
4804
|
+
/*rtl:ignore*/
|
|
4815
4805
|
border-left-style: solid;
|
|
4816
4806
|
}
|
|
4817
4807
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "9.36.0",
|
|
3
|
+
"version": "9.36.1-next.6deb34194.0",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -79,44 +79,46 @@
|
|
|
79
79
|
"sideEffects": [
|
|
80
80
|
"build-style/**",
|
|
81
81
|
"src/**/*.scss",
|
|
82
|
-
"
|
|
82
|
+
"src/*/init.js",
|
|
83
|
+
"build/*/init.js",
|
|
84
|
+
"build-module/*/init.js"
|
|
83
85
|
],
|
|
84
86
|
"dependencies": {
|
|
85
|
-
"@wordpress/a11y": "^4.36.0",
|
|
86
|
-
"@wordpress/api-fetch": "^7.36.0",
|
|
87
|
-
"@wordpress/autop": "^4.36.0",
|
|
88
|
-
"@wordpress/base-styles": "^6.12.0",
|
|
89
|
-
"@wordpress/blob": "^4.36.0",
|
|
90
|
-
"@wordpress/block-editor": "^15.9.0",
|
|
91
|
-
"@wordpress/blocks": "^15.9.0",
|
|
92
|
-
"@wordpress/components": "^
|
|
93
|
-
"@wordpress/compose": "^7.36.0",
|
|
94
|
-
"@wordpress/core-data": "^7.36.0",
|
|
95
|
-
"@wordpress/data": "^10.36.0",
|
|
96
|
-
"@wordpress/date": "^5.36.0",
|
|
97
|
-
"@wordpress/deprecated": "^4.36.0",
|
|
98
|
-
"@wordpress/dom": "^4.36.0",
|
|
99
|
-
"@wordpress/element": "^6.36.0",
|
|
100
|
-
"@wordpress/escape-html": "^3.36.0",
|
|
101
|
-
"@wordpress/hooks": "^4.36.0",
|
|
102
|
-
"@wordpress/html-entities": "^4.36.0",
|
|
103
|
-
"@wordpress/i18n": "^6.9.0",
|
|
104
|
-
"@wordpress/icons": "^11.3.0",
|
|
105
|
-
"@wordpress/interactivity": "^6.36.0",
|
|
106
|
-
"@wordpress/interactivity-router": "^2.36.0",
|
|
107
|
-
"@wordpress/keyboard-shortcuts": "^5.36.0",
|
|
108
|
-
"@wordpress/keycodes": "^4.36.0",
|
|
109
|
-
"@wordpress/latex-to-mathml": "^1.4.0",
|
|
110
|
-
"@wordpress/notices": "^5.36.0",
|
|
111
|
-
"@wordpress/patterns": "^2.36.0",
|
|
112
|
-
"@wordpress/primitives": "^4.36.0",
|
|
113
|
-
"@wordpress/private-apis": "^1.36.0",
|
|
114
|
-
"@wordpress/reusable-blocks": "^5.36.0",
|
|
115
|
-
"@wordpress/rich-text": "^7.36.0",
|
|
116
|
-
"@wordpress/server-side-render": "^6.12.0",
|
|
117
|
-
"@wordpress/url": "^4.36.0",
|
|
118
|
-
"@wordpress/viewport": "^6.36.0",
|
|
119
|
-
"@wordpress/wordcount": "^4.36.0",
|
|
87
|
+
"@wordpress/a11y": "^4.36.1-next.6deb34194.0",
|
|
88
|
+
"@wordpress/api-fetch": "^7.36.1-next.6deb34194.0",
|
|
89
|
+
"@wordpress/autop": "^4.36.1-next.6deb34194.0",
|
|
90
|
+
"@wordpress/base-styles": "^6.12.1-next.6deb34194.0",
|
|
91
|
+
"@wordpress/blob": "^4.36.1-next.6deb34194.0",
|
|
92
|
+
"@wordpress/block-editor": "^15.9.1-next.6deb34194.0",
|
|
93
|
+
"@wordpress/blocks": "^15.9.1-next.6deb34194.0",
|
|
94
|
+
"@wordpress/components": "^31.0.1-next.6deb34194.0",
|
|
95
|
+
"@wordpress/compose": "^7.36.1-next.6deb34194.0",
|
|
96
|
+
"@wordpress/core-data": "^7.36.1-next.6deb34194.0",
|
|
97
|
+
"@wordpress/data": "^10.36.1-next.6deb34194.0",
|
|
98
|
+
"@wordpress/date": "^5.36.1-next.6deb34194.0",
|
|
99
|
+
"@wordpress/deprecated": "^4.36.1-next.6deb34194.0",
|
|
100
|
+
"@wordpress/dom": "^4.36.1-next.6deb34194.0",
|
|
101
|
+
"@wordpress/element": "^6.36.1-next.6deb34194.0",
|
|
102
|
+
"@wordpress/escape-html": "^3.36.1-next.6deb34194.0",
|
|
103
|
+
"@wordpress/hooks": "^4.36.1-next.6deb34194.0",
|
|
104
|
+
"@wordpress/html-entities": "^4.36.1-next.6deb34194.0",
|
|
105
|
+
"@wordpress/i18n": "^6.9.1-next.6deb34194.0",
|
|
106
|
+
"@wordpress/icons": "^11.3.1-next.6deb34194.0",
|
|
107
|
+
"@wordpress/interactivity": "^6.36.1-next.6deb34194.0",
|
|
108
|
+
"@wordpress/interactivity-router": "^2.36.1-next.6deb34194.0",
|
|
109
|
+
"@wordpress/keyboard-shortcuts": "^5.36.1-next.6deb34194.0",
|
|
110
|
+
"@wordpress/keycodes": "^4.36.1-next.6deb34194.0",
|
|
111
|
+
"@wordpress/latex-to-mathml": "^1.4.1-next.6deb34194.0",
|
|
112
|
+
"@wordpress/notices": "^5.36.1-next.6deb34194.0",
|
|
113
|
+
"@wordpress/patterns": "^2.36.1-next.6deb34194.0",
|
|
114
|
+
"@wordpress/primitives": "^4.36.1-next.6deb34194.0",
|
|
115
|
+
"@wordpress/private-apis": "^1.36.1-next.6deb34194.0",
|
|
116
|
+
"@wordpress/reusable-blocks": "^5.36.1-next.6deb34194.0",
|
|
117
|
+
"@wordpress/rich-text": "^7.36.1-next.6deb34194.0",
|
|
118
|
+
"@wordpress/server-side-render": "^6.12.1-next.6deb34194.0",
|
|
119
|
+
"@wordpress/url": "^4.36.1-next.6deb34194.0",
|
|
120
|
+
"@wordpress/viewport": "^6.36.1-next.6deb34194.0",
|
|
121
|
+
"@wordpress/wordcount": "^4.36.1-next.6deb34194.0",
|
|
120
122
|
"change-case": "^4.1.2",
|
|
121
123
|
"clsx": "^2.1.1",
|
|
122
124
|
"colord": "^2.7.0",
|
|
@@ -134,5 +136,5 @@
|
|
|
134
136
|
"publishConfig": {
|
|
135
137
|
"access": "public"
|
|
136
138
|
},
|
|
137
|
-
"gitHead": "
|
|
139
|
+
"gitHead": "457096e9e9b3896d2d4fe54fc19d7fb571ee9a44"
|
|
138
140
|
}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
.wp-block-accordion-heading {
|
|
2
|
-
// Some classic themes apply default margins to heading elements,
|
|
3
|
-
// so those styles need to be reset.
|
|
4
|
-
margin: 0;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
1
|
.wp-block-accordion-heading__toggle {
|
|
8
2
|
font-family: inherit;
|
|
9
3
|
font-size: inherit;
|
|
@@ -14,7 +8,9 @@
|
|
|
14
8
|
text-decoration: inherit;
|
|
15
9
|
word-spacing: inherit;
|
|
16
10
|
font-style: inherit;
|
|
11
|
+
background: none;
|
|
17
12
|
border: none;
|
|
13
|
+
color: inherit;
|
|
18
14
|
padding: var(--wp--preset--spacing--20, 1em) 0;
|
|
19
15
|
cursor: pointer;
|
|
20
16
|
overflow: hidden;
|
|
@@ -23,34 +19,10 @@
|
|
|
23
19
|
text-align: inherit;
|
|
24
20
|
width: 100%;
|
|
25
21
|
|
|
26
|
-
// Some themes may apply colors to button elements with a particularly
|
|
27
|
-
// high CSS specificity. Since it's impossible to predict this specificity,
|
|
28
|
-
// we reset the colors using `!important`.
|
|
29
|
-
background-color: inherit !important;
|
|
30
|
-
color: inherit !important;
|
|
31
|
-
|
|
32
22
|
&:not(:focus-visible) {
|
|
33
23
|
outline: none;
|
|
34
24
|
}
|
|
35
25
|
|
|
36
|
-
&:hover,
|
|
37
|
-
&:focus {
|
|
38
|
-
// Some themes may apply styles when a button element is hovered
|
|
39
|
-
// over or focused. This is not intended for accordion toggle
|
|
40
|
-
// buttons, so we reset it here.
|
|
41
|
-
text-decoration: none;
|
|
42
|
-
background-color: inherit !important;
|
|
43
|
-
box-shadow: none;
|
|
44
|
-
color: inherit;
|
|
45
|
-
border: none;
|
|
46
|
-
padding: var(--wp--preset--spacing--20, 1em) 0;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&:focus-visible {
|
|
50
|
-
outline: auto;
|
|
51
|
-
outline-offset: 0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
26
|
&:hover .wp-block-accordion-heading__toggle-title {
|
|
55
27
|
text-decoration: underline;
|
|
56
28
|
}
|
package/src/audio/index.js
CHANGED
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
|
|
@@ -17,15 +17,20 @@
|
|
|
17
17
|
* @return string Returns the post breadcrumb for hierarchical post types.
|
|
18
18
|
*/
|
|
19
19
|
function render_block_core_breadcrumbs( $attributes, $content, $block ) {
|
|
20
|
-
$
|
|
21
|
-
|
|
20
|
+
$is_front_page = is_front_page();
|
|
21
|
+
|
|
22
|
+
if ( ! $attributes['showOnHomePage'] && $is_front_page ) {
|
|
22
23
|
return '';
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
$is_home = is_home();
|
|
27
|
+
$page_for_posts = get_option( 'page_for_posts' );
|
|
25
28
|
$breadcrumb_items = array();
|
|
26
29
|
|
|
27
|
-
if ( $attributes['
|
|
28
|
-
if
|
|
30
|
+
if ( $attributes['showHomeItem'] ) {
|
|
31
|
+
// We make `home` a link if not on front page, or if front page
|
|
32
|
+
// is set to a custom page and is paged.
|
|
33
|
+
if ( ! $is_front_page || ( 'page' === get_option( 'show_on_front' ) && (int) get_query_var( 'page' ) > 1 ) ) {
|
|
29
34
|
$breadcrumb_items[] = array(
|
|
30
35
|
'label' => __( 'Home' ),
|
|
31
36
|
'url' => home_url( '/' ),
|
|
@@ -35,12 +40,22 @@ function render_block_core_breadcrumbs( $attributes, $content, $block ) {
|
|
|
35
40
|
}
|
|
36
41
|
}
|
|
37
42
|
|
|
38
|
-
// Handle home
|
|
39
|
-
if ( $
|
|
40
|
-
//
|
|
43
|
+
// Handle home.
|
|
44
|
+
if ( $is_home ) {
|
|
45
|
+
// These checks are explicitly nested in order not to execute the `else` branch.
|
|
46
|
+
if ( $page_for_posts ) {
|
|
47
|
+
$breadcrumb_items[] = block_core_breadcrumbs_create_item( block_core_breadcrumbs_get_post_title( $page_for_posts ), block_core_breadcrumbs_is_paged() );
|
|
48
|
+
}
|
|
41
49
|
if ( block_core_breadcrumbs_is_paged() ) {
|
|
42
50
|
$breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item();
|
|
43
51
|
}
|
|
52
|
+
} elseif ( $is_front_page ) {
|
|
53
|
+
// Handle front page.
|
|
54
|
+
// This check is explicitly nested in order not to execute the `else` branch.
|
|
55
|
+
// If front page is set to custom page and is paged, add the page number.
|
|
56
|
+
if ( (int) get_query_var( 'page' ) > 1 ) {
|
|
57
|
+
$breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item( 'page' );
|
|
58
|
+
}
|
|
44
59
|
} elseif ( is_search() ) {
|
|
45
60
|
// Handle search results.
|
|
46
61
|
$is_paged = block_core_breadcrumbs_is_paged();
|
|
@@ -105,11 +120,8 @@ function render_block_core_breadcrumbs( $attributes, $content, $block ) {
|
|
|
105
120
|
$archive_link = get_post_type_archive_link( $post_type );
|
|
106
121
|
if ( $archive_link && untrailingslashit( home_url() ) !== untrailingslashit( $archive_link ) ) {
|
|
107
122
|
$label = $post_type_object->labels->archives;
|
|
108
|
-
if ( 'post' === $post_type ) {
|
|
109
|
-
$
|
|
110
|
-
if ( $page_for_posts ) {
|
|
111
|
-
$label = block_core_breadcrumbs_get_post_title( $page_for_posts );
|
|
112
|
-
}
|
|
123
|
+
if ( 'post' === $post_type && $page_for_posts ) {
|
|
124
|
+
$label = block_core_breadcrumbs_get_post_title( $page_for_posts );
|
|
113
125
|
}
|
|
114
126
|
$breadcrumb_items[] = array(
|
|
115
127
|
'label' => $label,
|
|
@@ -124,7 +136,7 @@ function render_block_core_breadcrumbs( $attributes, $content, $block ) {
|
|
|
124
136
|
}
|
|
125
137
|
|
|
126
138
|
// Add post title: linked when viewing a paginated page, plain text otherwise.
|
|
127
|
-
$is_paged = (int) get_query_var( 'page' ) > 1;
|
|
139
|
+
$is_paged = (int) get_query_var( 'page' ) > 1 || (int) get_query_var( 'cpage' ) > 1;
|
|
128
140
|
$title = block_core_breadcrumbs_get_post_title( $post );
|
|
129
141
|
|
|
130
142
|
if ( $is_paged ) {
|
|
@@ -133,8 +145,7 @@ function render_block_core_breadcrumbs( $attributes, $content, $block ) {
|
|
|
133
145
|
'url' => get_permalink( $post ),
|
|
134
146
|
'allow_html' => true,
|
|
135
147
|
);
|
|
136
|
-
|
|
137
|
-
$breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item( 'page' );
|
|
148
|
+
$breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item( (int) get_query_var( 'cpage' ) > 1 ? 'cpage' : 'page' );
|
|
138
149
|
} else {
|
|
139
150
|
$breadcrumb_items[] = array(
|
|
140
151
|
'label' => $title,
|
|
@@ -143,8 +154,8 @@ function render_block_core_breadcrumbs( $attributes, $content, $block ) {
|
|
|
143
154
|
}
|
|
144
155
|
}
|
|
145
156
|
|
|
146
|
-
// Remove
|
|
147
|
-
if ( ! $attributes['
|
|
157
|
+
// Remove current item if disabled.
|
|
158
|
+
if ( ! $attributes['showCurrentItem'] && ! empty( $breadcrumb_items ) ) {
|
|
148
159
|
array_pop( $breadcrumb_items );
|
|
149
160
|
}
|
|
150
161
|
|
|
@@ -202,6 +213,16 @@ function block_core_breadcrumbs_is_paged() {
|
|
|
202
213
|
function block_core_breadcrumbs_create_page_number_item( $query_var = 'paged' ) {
|
|
203
214
|
$paged = (int) get_query_var( $query_var );
|
|
204
215
|
|
|
216
|
+
if ( 'cpage' === $query_var ) {
|
|
217
|
+
return array(
|
|
218
|
+
'label' => sprintf(
|
|
219
|
+
/* translators: %s: comment page number */
|
|
220
|
+
__( 'Comments Page %s' ),
|
|
221
|
+
number_format_i18n( $paged )
|
|
222
|
+
),
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
|
|
205
226
|
return array(
|
|
206
227
|
'label' => sprintf(
|
|
207
228
|
/* translators: %s: page number */
|