@wordpress/block-library 7.3.3 → 7.3.6
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/comments-title/edit.js +7 -5
- package/build/comments-title/edit.js.map +1 -1
- package/build/index.js +1 -3
- package/build/index.js.map +1 -1
- package/build/navigation/edit/index.js +5 -28
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +5 -7
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/index.js +0 -1
- package/build/navigation/index.js.map +1 -1
- package/build/navigation-link/edit.js +29 -30
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +14 -14
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/post-content/edit.js +1 -1
- package/build/post-content/edit.js.map +1 -1
- package/build/post-excerpt/edit.js +1 -1
- package/build/post-excerpt/edit.js.map +1 -1
- package/build-module/comments-title/edit.js +7 -5
- package/build-module/comments-title/edit.js.map +1 -1
- package/build-module/index.js +1 -2
- package/build-module/index.js.map +1 -1
- package/build-module/navigation/edit/index.js +6 -28
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +5 -7
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/index.js +0 -1
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation-link/edit.js +29 -30
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +14 -14
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/post-content/edit.js +1 -1
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-excerpt/edit.js +1 -1
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-style/comment-content/style-rtl.css +81 -0
- package/build-style/comment-content/style.css +81 -0
- package/build-style/cover/style-rtl.css +1 -1
- package/build-style/cover/style.css +1 -1
- package/build-style/latest-posts/style-rtl.css +2 -0
- package/build-style/latest-posts/style.css +4 -0
- package/build-style/post-comments/style-rtl.css +5 -1
- package/build-style/post-comments/style.css +5 -1
- package/build-style/style-rtl.css +8 -2
- package/build-style/style.css +10 -2
- package/package.json +8 -8
- package/src/comment-author-name/index.php +7 -5
- package/src/comment-content/index.php +25 -3
- package/src/comment-content/style.scss +5 -0
- package/src/comment-template/index.php +4 -0
- package/src/comments-pagination/index.php +4 -0
- package/src/comments-title/edit.js +20 -4
- package/src/comments-title/index.php +18 -7
- package/src/cover/index.php +1 -1
- package/src/cover/style.scss +1 -1
- package/src/index.js +0 -2
- package/src/latest-posts/style.scss +4 -0
- package/src/navigation/block.json +0 -1
- package/src/navigation/edit/index.js +6 -36
- package/src/navigation/edit/inner-blocks.js +5 -7
- package/src/navigation-link/edit.js +40 -43
- package/src/navigation-submenu/edit.js +13 -17
- package/src/post-comments/style.scss +5 -2
- package/src/post-comments-form/index.php +8 -1
- package/src/post-content/edit.js +15 -1
- package/src/post-excerpt/edit.js +14 -1
- package/build/navigation-area/edit.js +0 -110
- package/build/navigation-area/edit.js.map +0 -1
- package/build/navigation-area/index.js +0 -62
- package/build/navigation-area/index.js.map +0 -1
- package/build/navigation-area/inner-blocks.js +0 -34
- package/build/navigation-area/inner-blocks.js.map +0 -1
- package/build/navigation-area/save.js +0 -18
- package/build/navigation-area/save.js.map +0 -1
- package/build-module/navigation-area/edit.js +0 -94
- package/build-module/navigation-area/edit.js.map +0 -1
- package/build-module/navigation-area/index.js +0 -48
- package/build-module/navigation-area/index.js.map +0 -1
- package/build-module/navigation-area/inner-blocks.js +0 -26
- package/build-module/navigation-area/inner-blocks.js.map +0 -1
- package/build-module/navigation-area/save.js +0 -10
- package/build-module/navigation-area/save.js.map +0 -1
- package/src/navigation-area/block.json +0 -23
- package/src/navigation-area/edit.js +0 -111
- package/src/navigation-area/index.js +0 -26
- package/src/navigation-area/index.php +0 -22
- package/src/navigation-area/inner-blocks.js +0 -24
- package/src/navigation-area/save.js +0 -8
|
@@ -58,7 +58,7 @@ export default function PostExcerptEditor(_ref) {
|
|
|
58
58
|
}, [renderedExcerpt]);
|
|
59
59
|
|
|
60
60
|
if (!postType || !postId) {
|
|
61
|
-
return createElement("div", blockProps, __('Post Excerpt'));
|
|
61
|
+
return createElement("div", blockProps, createElement("p", null, __('This is the Post Excerpt block, it will display the excerpt from single posts.')), createElement("p", null, __('If there are any Custom Post Types with support for excerpts, the Post Excerpt block can display the excerpts of those entries as well.')));
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
if (isProtected && !userCanEdit) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/post-excerpt/edit.js"],"names":["classnames","useEntityProp","useMemo","AlignmentToolbar","BlockControls","InspectorControls","RichText","Warning","useBlockProps","PanelBody","ToggleControl","__","useCanEditEntity","PostExcerptEditor","attributes","textAlign","moreText","showMoreOnNewLine","setAttributes","isSelected","context","postId","postType","queryId","isDescendentOfQueryLoop","Number","isFinite","userCanEdit","isEditable","rawExcerpt","setExcerpt","rendered","renderedExcerpt","protected","isProtected","blockProps","className","strippedRenderedExcerpt","document","window","DOMParser","parseFromString","body","textContent","innerText","readMoreLink","newMoreText","excerptClassName","excerptContent","newAlign","newShowMoreOnNewLine"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,sBAA9B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SACCC,gBADD,EAECC,aAFD,EAGCC,iBAHD,EAICC,QAJD,EAKCC,OALD,EAMCC,aAND,QAOO,yBAPP;AAQA,SAASC,SAAT,EAAoBC,aAApB,QAAyC,uBAAzC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,QAAiC,gBAAjC;AAEA,eAAe,SAASC,iBAAT,OAKX;AAAA,MALuC;AAC1CC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,SAAF;AAAaC,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pt/edit.js"],"names":["classnames","useEntityProp","useMemo","AlignmentToolbar","BlockControls","InspectorControls","RichText","Warning","useBlockProps","PanelBody","ToggleControl","__","useCanEditEntity","PostExcerptEditor","attributes","textAlign","moreText","showMoreOnNewLine","setAttributes","isSelected","context","postId","postType","queryId","isDescendentOfQueryLoop","Number","isFinite","userCanEdit","isEditable","rawExcerpt","setExcerpt","rendered","renderedExcerpt","protected","isProtected","blockProps","className","strippedRenderedExcerpt","document","window","DOMParser","parseFromString","body","textContent","innerText","readMoreLink","newMoreText","excerptClassName","excerptContent","newAlign","newShowMoreOnNewLine"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,sBAA9B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SACCC,gBADD,EAECC,aAFD,EAGCC,iBAHD,EAICC,QAJD,EAKCC,OALD,EAMCC,aAND,QAOO,yBAPP;AAQA,SAASC,SAAT,EAAoBC,aAApB,QAAyC,uBAAzC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,QAAiC,gBAAjC;AAEA,eAAe,SAASC,iBAAT,OAKX;AAAA,MALuC;AAC1CC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,SAAF;AAAaC,MAAAA,QAAb;AAAuBC,MAAAA;AAAvB,KAD8B;AAE1CC,IAAAA,aAF0C;AAG1CC,IAAAA,UAH0C;AAI1CC,IAAAA,OAAO,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA,QAAV;AAAoBC,MAAAA;AAApB;AAJiC,GAKvC;AACH,QAAMC,uBAAuB,GAAGC,MAAM,CAACC,QAAP,CAAiBH,OAAjB,CAAhC;AACA,QAAMI,WAAW,GAAGf,gBAAgB,CAAE,UAAF,EAAcU,QAAd,EAAwBD,MAAxB,CAApC;AACA,QAAMO,UAAU,GAAGD,WAAW,IAAI,CAAEH,uBAApC;AACA,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IAAA,SAAS,EAAC;AAAb,KACG4B,YADH,CADkB,GAKlBA,YARF,CAtBD,CADD;AAoCA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityProp } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tAlignmentToolbar,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tWarning,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { PanelBody, ToggleControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useCanEditEntity } from '../utils/hooks';\n\nexport default function PostExcerptEditor( {\n\tattributes: { textAlign, moreText, showMoreOnNewLine },\n\tsetAttributes,\n\tisSelected,\n\tcontext: { postId, postType, queryId },\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst userCanEdit = useCanEditEntity( 'postType', postType, postId );\n\tconst isEditable = userCanEdit && ! isDescendentOfQueryLoop;\n\tconst [\n\t\trawExcerpt,\n\t\tsetExcerpt,\n\t\t{ rendered: renderedExcerpt, protected: isProtected } = {},\n\t] = useEntityProp( 'postType', postType, 'excerpt', postId );\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\t/**\n\t * When excerpt is editable, strip the html tags from\n\t * rendered excerpt. This will be used if the entity's\n\t * excerpt has been produced from the content.\n\t */\n\tconst strippedRenderedExcerpt = useMemo( () => {\n\t\tif ( ! renderedExcerpt ) return '';\n\t\tconst document = new window.DOMParser().parseFromString(\n\t\t\trenderedExcerpt,\n\t\t\t'text/html'\n\t\t);\n\t\treturn document.body.textContent || document.body.innerText || '';\n\t}, [ renderedExcerpt ] );\n\tif ( ! postType || ! postId ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<p>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'This is the Post Excerpt block, it will display the excerpt from single posts.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t\t<p>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'If there are any Custom Post Types with support for excerpts, the Post Excerpt block can display the excerpts of those entries as well.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t);\n\t}\n\tif ( isProtected && ! userCanEdit ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'There is no excerpt because this is a protected post.'\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t</div>\n\t\t);\n\t}\n\tconst readMoreLink = (\n\t\t<RichText\n\t\t\tclassName=\"wp-block-post-excerpt__more-link\"\n\t\t\ttagName=\"a\"\n\t\t\taria-label={ __( '\"Read more\" link text' ) }\n\t\t\tplaceholder={ __( 'Add \"read more\" link text' ) }\n\t\t\tvalue={ moreText }\n\t\t\tonChange={ ( newMoreText ) =>\n\t\t\t\tsetAttributes( { moreText: newMoreText } )\n\t\t\t}\n\t\t\twithoutInteractiveFormatting={ true }\n\t\t/>\n\t);\n\tconst excerptClassName = classnames( 'wp-block-post-excerpt__excerpt', {\n\t\t'is-inline': ! showMoreOnNewLine,\n\t} );\n\tconst excerptContent = isEditable ? (\n\t\t<RichText\n\t\t\tclassName={ excerptClassName }\n\t\t\taria-label={ __( 'Post excerpt text' ) }\n\t\t\tvalue={\n\t\t\t\trawExcerpt ||\n\t\t\t\tstrippedRenderedExcerpt ||\n\t\t\t\t( isSelected ? '' : __( 'No post excerpt found' ) )\n\t\t\t}\n\t\t\tonChange={ setExcerpt }\n\t\t\ttagName=\"p\"\n\t\t/>\n\t) : (\n\t\t<p className={ excerptClassName }>\n\t\t\t{ strippedRenderedExcerpt || __( 'No post excerpt found' ) }\n\t\t</p>\n\t);\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<AlignmentToolbar\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\t\tsetAttributes( { textAlign: newAlign } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Post Excerpt Settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Show link on new line' ) }\n\t\t\t\t\t\tchecked={ showMoreOnNewLine }\n\t\t\t\t\t\tonChange={ ( newShowMoreOnNewLine ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowMoreOnNewLine: newShowMoreOnNewLine,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ excerptContent }\n\t\t\t\t{ ! showMoreOnNewLine && ' ' }\n\t\t\t\t{ showMoreOnNewLine ? (\n\t\t\t\t\t<p className=\"wp-block-post-excerpt__more-text\">\n\t\t\t\t\t\t{ readMoreLink }\n\t\t\t\t\t</p>\n\t\t\t\t) : (\n\t\t\t\t\treadMoreLink\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Colors
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Breakpoints & Media Queries
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* SCSS Variables.
|
|
9
|
+
*
|
|
10
|
+
* Please use variables from this sheet to ensure consistency across the UI.
|
|
11
|
+
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
|
12
|
+
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Colors
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Fonts & basic variables.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Grid System.
|
|
22
|
+
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Dimensions.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Shadows.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Editor widths.
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Block & Editor UI.
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* Block paddings.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* React Native specific.
|
|
41
|
+
* These variables do not appear to be used anywhere else.
|
|
42
|
+
*/
|
|
43
|
+
/**
|
|
44
|
+
* Converts a hex value into the rgb equivalent.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} hex - the hexadecimal value to convert
|
|
47
|
+
* @return {string} comma separated rgb values
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* Breakpoint mixins
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* Long content fade mixin
|
|
54
|
+
*
|
|
55
|
+
* Creates a fading overlay to signify that the content is longer
|
|
56
|
+
* than the space allows.
|
|
57
|
+
*/
|
|
58
|
+
/**
|
|
59
|
+
* Focus styles.
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* Applies editor left position to the selector passed as argument
|
|
63
|
+
*/
|
|
64
|
+
/**
|
|
65
|
+
* Styles that are reused verbatim in a few places
|
|
66
|
+
*/
|
|
67
|
+
/**
|
|
68
|
+
* Allows users to opt-out of animations via OS-level preferences.
|
|
69
|
+
*/
|
|
70
|
+
/**
|
|
71
|
+
* Reset default styles for JavaScript UI based pages.
|
|
72
|
+
* This is a WP-admin agnostic reset
|
|
73
|
+
*/
|
|
74
|
+
/**
|
|
75
|
+
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
76
|
+
*/
|
|
77
|
+
.comment-awaiting-moderation {
|
|
78
|
+
display: block;
|
|
79
|
+
font-size: 0.875em;
|
|
80
|
+
line-height: 1.5;
|
|
81
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Colors
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Breakpoints & Media Queries
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* SCSS Variables.
|
|
9
|
+
*
|
|
10
|
+
* Please use variables from this sheet to ensure consistency across the UI.
|
|
11
|
+
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
|
12
|
+
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Colors
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Fonts & basic variables.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Grid System.
|
|
22
|
+
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Dimensions.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Shadows.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Editor widths.
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Block & Editor UI.
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* Block paddings.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* React Native specific.
|
|
41
|
+
* These variables do not appear to be used anywhere else.
|
|
42
|
+
*/
|
|
43
|
+
/**
|
|
44
|
+
* Converts a hex value into the rgb equivalent.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} hex - the hexadecimal value to convert
|
|
47
|
+
* @return {string} comma separated rgb values
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* Breakpoint mixins
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* Long content fade mixin
|
|
54
|
+
*
|
|
55
|
+
* Creates a fading overlay to signify that the content is longer
|
|
56
|
+
* than the space allows.
|
|
57
|
+
*/
|
|
58
|
+
/**
|
|
59
|
+
* Focus styles.
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* Applies editor left position to the selector passed as argument
|
|
63
|
+
*/
|
|
64
|
+
/**
|
|
65
|
+
* Styles that are reused verbatim in a few places
|
|
66
|
+
*/
|
|
67
|
+
/**
|
|
68
|
+
* Allows users to opt-out of animations via OS-level preferences.
|
|
69
|
+
*/
|
|
70
|
+
/**
|
|
71
|
+
* Reset default styles for JavaScript UI based pages.
|
|
72
|
+
* This is a WP-admin agnostic reset
|
|
73
|
+
*/
|
|
74
|
+
/**
|
|
75
|
+
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
76
|
+
*/
|
|
77
|
+
.comment-awaiting-moderation {
|
|
78
|
+
display: block;
|
|
79
|
+
font-size: 0.875em;
|
|
80
|
+
line-height: 1.5;
|
|
81
|
+
}
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
.wp-block-cover.has-parallax {
|
|
102
102
|
background-attachment: fixed;
|
|
103
103
|
}
|
|
104
|
-
@supports (-webkit-
|
|
104
|
+
@supports (-webkit-touch-callout: inherit) {
|
|
105
105
|
.wp-block-cover-image.has-parallax,
|
|
106
106
|
.wp-block-cover.has-parallax {
|
|
107
107
|
background-attachment: scroll;
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
.wp-block-cover.has-parallax {
|
|
102
102
|
background-attachment: fixed;
|
|
103
103
|
}
|
|
104
|
-
@supports (-webkit-
|
|
104
|
+
@supports (-webkit-touch-callout: inherit) {
|
|
105
105
|
.wp-block-cover-image.has-parallax,
|
|
106
106
|
.wp-block-cover.has-parallax {
|
|
107
107
|
background-attachment: scroll;
|
|
@@ -150,9 +150,11 @@
|
|
|
150
150
|
}
|
|
151
151
|
.wp-block-latest-posts__featured-image.alignleft {
|
|
152
152
|
margin-right: 1em;
|
|
153
|
+
float: left;
|
|
153
154
|
}
|
|
154
155
|
.wp-block-latest-posts__featured-image.alignright {
|
|
155
156
|
margin-left: 1em;
|
|
157
|
+
float: right;
|
|
156
158
|
}
|
|
157
159
|
.wp-block-latest-posts__featured-image.aligncenter {
|
|
158
160
|
margin-bottom: 1em;
|
|
@@ -153,10 +153,14 @@
|
|
|
153
153
|
.wp-block-latest-posts__featured-image.alignleft {
|
|
154
154
|
/*rtl:ignore*/
|
|
155
155
|
margin-right: 1em;
|
|
156
|
+
/*rtl:ignore*/
|
|
157
|
+
float: left;
|
|
156
158
|
}
|
|
157
159
|
.wp-block-latest-posts__featured-image.alignright {
|
|
158
160
|
/*rtl:ignore*/
|
|
159
161
|
margin-left: 1em;
|
|
162
|
+
/*rtl:ignore*/
|
|
163
|
+
float: right;
|
|
160
164
|
}
|
|
161
165
|
.wp-block-latest-posts__featured-image.aligncenter {
|
|
162
166
|
margin-bottom: 1em;
|
|
@@ -112,11 +112,15 @@
|
|
|
112
112
|
.wp-block-post-comments .comment-meta {
|
|
113
113
|
font-size: 0.875em;
|
|
114
114
|
line-height: 1.5;
|
|
115
|
-
margin-right: -3.25em;
|
|
116
115
|
}
|
|
117
116
|
.wp-block-post-comments .comment-meta b {
|
|
118
117
|
font-weight: normal;
|
|
119
118
|
}
|
|
119
|
+
.wp-block-post-comments .comment-meta .comment-awaiting-moderation {
|
|
120
|
+
margin-top: 1em;
|
|
121
|
+
margin-bottom: 1em;
|
|
122
|
+
display: block;
|
|
123
|
+
}
|
|
120
124
|
.wp-block-post-comments .comment-body .commentmetadata {
|
|
121
125
|
font-size: 0.875em;
|
|
122
126
|
}
|
|
@@ -112,11 +112,15 @@
|
|
|
112
112
|
.wp-block-post-comments .comment-meta {
|
|
113
113
|
font-size: 0.875em;
|
|
114
114
|
line-height: 1.5;
|
|
115
|
-
margin-left: -3.25em;
|
|
116
115
|
}
|
|
117
116
|
.wp-block-post-comments .comment-meta b {
|
|
118
117
|
font-weight: normal;
|
|
119
118
|
}
|
|
119
|
+
.wp-block-post-comments .comment-meta .comment-awaiting-moderation {
|
|
120
|
+
margin-top: 1em;
|
|
121
|
+
margin-bottom: 1em;
|
|
122
|
+
display: block;
|
|
123
|
+
}
|
|
120
124
|
.wp-block-post-comments .comment-body .commentmetadata {
|
|
121
125
|
font-size: 0.875em;
|
|
122
126
|
}
|
|
@@ -417,7 +417,7 @@
|
|
|
417
417
|
.wp-block-cover.has-parallax {
|
|
418
418
|
background-attachment: fixed;
|
|
419
419
|
}
|
|
420
|
-
@supports (-webkit-
|
|
420
|
+
@supports (-webkit-touch-callout: inherit) {
|
|
421
421
|
.wp-block-cover-image.has-parallax,
|
|
422
422
|
.wp-block-cover.has-parallax {
|
|
423
423
|
background-attachment: scroll;
|
|
@@ -1435,9 +1435,11 @@ ol.wp-block-latest-comments {
|
|
|
1435
1435
|
}
|
|
1436
1436
|
.wp-block-latest-posts__featured-image.alignleft {
|
|
1437
1437
|
margin-right: 1em;
|
|
1438
|
+
float: left;
|
|
1438
1439
|
}
|
|
1439
1440
|
.wp-block-latest-posts__featured-image.alignright {
|
|
1440
1441
|
margin-left: 1em;
|
|
1442
|
+
float: right;
|
|
1441
1443
|
}
|
|
1442
1444
|
.wp-block-latest-posts__featured-image.aligncenter {
|
|
1443
1445
|
margin-bottom: 1em;
|
|
@@ -2137,11 +2139,15 @@ p.has-background {
|
|
|
2137
2139
|
.wp-block-post-comments .comment-meta {
|
|
2138
2140
|
font-size: 0.875em;
|
|
2139
2141
|
line-height: 1.5;
|
|
2140
|
-
margin-right: -3.25em;
|
|
2141
2142
|
}
|
|
2142
2143
|
.wp-block-post-comments .comment-meta b {
|
|
2143
2144
|
font-weight: normal;
|
|
2144
2145
|
}
|
|
2146
|
+
.wp-block-post-comments .comment-meta .comment-awaiting-moderation {
|
|
2147
|
+
margin-top: 1em;
|
|
2148
|
+
margin-bottom: 1em;
|
|
2149
|
+
display: block;
|
|
2150
|
+
}
|
|
2145
2151
|
.wp-block-post-comments .comment-body .commentmetadata {
|
|
2146
2152
|
font-size: 0.875em;
|
|
2147
2153
|
}
|
package/build-style/style.css
CHANGED
|
@@ -422,7 +422,7 @@
|
|
|
422
422
|
.wp-block-cover.has-parallax {
|
|
423
423
|
background-attachment: fixed;
|
|
424
424
|
}
|
|
425
|
-
@supports (-webkit-
|
|
425
|
+
@supports (-webkit-touch-callout: inherit) {
|
|
426
426
|
.wp-block-cover-image.has-parallax,
|
|
427
427
|
.wp-block-cover.has-parallax {
|
|
428
428
|
background-attachment: scroll;
|
|
@@ -1448,10 +1448,14 @@ ol.wp-block-latest-comments {
|
|
|
1448
1448
|
.wp-block-latest-posts__featured-image.alignleft {
|
|
1449
1449
|
/*rtl:ignore*/
|
|
1450
1450
|
margin-right: 1em;
|
|
1451
|
+
/*rtl:ignore*/
|
|
1452
|
+
float: left;
|
|
1451
1453
|
}
|
|
1452
1454
|
.wp-block-latest-posts__featured-image.alignright {
|
|
1453
1455
|
/*rtl:ignore*/
|
|
1454
1456
|
margin-left: 1em;
|
|
1457
|
+
/*rtl:ignore*/
|
|
1458
|
+
float: right;
|
|
1455
1459
|
}
|
|
1456
1460
|
.wp-block-latest-posts__featured-image.aligncenter {
|
|
1457
1461
|
margin-bottom: 1em;
|
|
@@ -2161,11 +2165,15 @@ p.has-background {
|
|
|
2161
2165
|
.wp-block-post-comments .comment-meta {
|
|
2162
2166
|
font-size: 0.875em;
|
|
2163
2167
|
line-height: 1.5;
|
|
2164
|
-
margin-left: -3.25em;
|
|
2165
2168
|
}
|
|
2166
2169
|
.wp-block-post-comments .comment-meta b {
|
|
2167
2170
|
font-weight: normal;
|
|
2168
2171
|
}
|
|
2172
|
+
.wp-block-post-comments .comment-meta .comment-awaiting-moderation {
|
|
2173
|
+
margin-top: 1em;
|
|
2174
|
+
margin-bottom: 1em;
|
|
2175
|
+
display: block;
|
|
2176
|
+
}
|
|
2169
2177
|
.wp-block-post-comments .comment-body .commentmetadata {
|
|
2170
2178
|
font-size: 0.875em;
|
|
2171
2179
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.6",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"@wordpress/api-fetch": "^6.3.1",
|
|
38
38
|
"@wordpress/autop": "^3.6.1",
|
|
39
39
|
"@wordpress/blob": "^3.6.1",
|
|
40
|
-
"@wordpress/block-editor": "^8.5.
|
|
40
|
+
"@wordpress/block-editor": "^8.5.5",
|
|
41
41
|
"@wordpress/blocks": "^11.5.3",
|
|
42
|
-
"@wordpress/components": "^19.8.
|
|
42
|
+
"@wordpress/components": "^19.8.4",
|
|
43
43
|
"@wordpress/compose": "^5.4.1",
|
|
44
|
-
"@wordpress/core-data": "^4.4.
|
|
44
|
+
"@wordpress/core-data": "^4.4.5",
|
|
45
45
|
"@wordpress/data": "^6.6.1",
|
|
46
46
|
"@wordpress/date": "^4.6.1",
|
|
47
47
|
"@wordpress/deprecated": "^3.6.1",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"@wordpress/keycodes": "^3.6.1",
|
|
55
55
|
"@wordpress/notices": "^3.6.1",
|
|
56
56
|
"@wordpress/primitives": "^3.4.1",
|
|
57
|
-
"@wordpress/reusable-blocks": "^3.4.
|
|
58
|
-
"@wordpress/rich-text": "^5.4.
|
|
59
|
-
"@wordpress/server-side-render": "^3.4.
|
|
57
|
+
"@wordpress/reusable-blocks": "^3.4.5",
|
|
58
|
+
"@wordpress/rich-text": "^5.4.2",
|
|
59
|
+
"@wordpress/server-side-render": "^3.4.5",
|
|
60
60
|
"@wordpress/url": "^3.7.1",
|
|
61
61
|
"@wordpress/viewport": "^4.4.1",
|
|
62
62
|
"classnames": "^2.3.1",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "b97f41a0716be45abd8bf897c7f135b86dc0760c"
|
|
78
78
|
}
|
|
@@ -18,17 +18,16 @@ function render_block_core_comment_author_name( $attributes, $content, $block )
|
|
|
18
18
|
return '';
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
$comment
|
|
21
|
+
$comment = get_comment( $block->context['commentId'] );
|
|
22
|
+
$commenter = wp_get_current_commenter();
|
|
23
|
+
$show_pending_links = isset( $commenter['comment_author'] ) && $commenter['comment_author'];
|
|
22
24
|
if ( empty( $comment ) ) {
|
|
23
25
|
return '';
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
$classes = '';
|
|
27
29
|
if ( isset( $attributes['textAlign'] ) ) {
|
|
28
|
-
$classes .= 'has-text-align-' .
|
|
29
|
-
}
|
|
30
|
-
if ( isset( $attributes['fontSize'] ) ) {
|
|
31
|
-
$classes .= 'has-' . esc_attr( $attributes['fontSize'] ) . '-font-size';
|
|
30
|
+
$classes .= 'has-text-align-' . $attributes['textAlign'];
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
|
|
@@ -38,6 +37,9 @@ function render_block_core_comment_author_name( $attributes, $content, $block )
|
|
|
38
37
|
if ( ! empty( $attributes['isLink'] ) && ! empty( $attributes['linkTarget'] ) ) {
|
|
39
38
|
$comment_author = sprintf( '<a rel="external nofollow ugc" href="%1s" target="%2s" >%3s</a>', esc_url( $link ), esc_attr( $attributes['linkTarget'] ), $comment_author );
|
|
40
39
|
}
|
|
40
|
+
if ( '0' === $comment->comment_approved && ! $show_pending_links ) {
|
|
41
|
+
$comment_author = wp_kses( $comment_author, array() );
|
|
42
|
+
}
|
|
41
43
|
|
|
42
44
|
return sprintf(
|
|
43
45
|
'<div %1$s>%2$s</div>',
|
|
@@ -18,16 +18,37 @@ function render_block_core_comment_content( $attributes, $content, $block ) {
|
|
|
18
18
|
return '';
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
$comment
|
|
21
|
+
$comment = get_comment( $block->context['commentId'] );
|
|
22
|
+
$commenter = wp_get_current_commenter();
|
|
23
|
+
$show_pending_links = isset( $commenter['comment_author'] ) && $commenter['comment_author'];
|
|
22
24
|
if ( empty( $comment ) ) {
|
|
23
25
|
return '';
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
$
|
|
28
|
+
$args = array();
|
|
29
|
+
$comment_text = get_comment_text( $comment, $args );
|
|
27
30
|
if ( ! $comment_text ) {
|
|
28
31
|
return '';
|
|
29
32
|
}
|
|
30
33
|
|
|
34
|
+
/** This filter is documented in wp-includes/comment-template.php */
|
|
35
|
+
$comment_text = apply_filters( 'comment_text', $comment_text, $comment, $args );
|
|
36
|
+
|
|
37
|
+
$moderation_note = '';
|
|
38
|
+
if ( '0' === $comment->comment_approved ) {
|
|
39
|
+
$commenter = wp_get_current_commenter();
|
|
40
|
+
|
|
41
|
+
if ( $commenter['comment_author_email'] ) {
|
|
42
|
+
$moderation_note = __( 'Your comment is awaiting moderation.' );
|
|
43
|
+
} else {
|
|
44
|
+
$moderation_note = __( 'Your comment is awaiting moderation. This is a preview; your comment will be visible after it has been approved.' );
|
|
45
|
+
}
|
|
46
|
+
$moderation_note = '<p><em class="comment-awaiting-moderation">' . $moderation_note . '</em></p>';
|
|
47
|
+
if ( ! $show_pending_links ) {
|
|
48
|
+
$comment_text = wp_kses( $comment_text, array() );
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
31
52
|
$classes = '';
|
|
32
53
|
if ( isset( $attributes['textAlign'] ) ) {
|
|
33
54
|
$classes .= 'has-text-align-' . $attributes['textAlign'];
|
|
@@ -36,8 +57,9 @@ function render_block_core_comment_content( $attributes, $content, $block ) {
|
|
|
36
57
|
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
|
|
37
58
|
|
|
38
59
|
return sprintf(
|
|
39
|
-
'<div %1$s>%2$s</div>',
|
|
60
|
+
'<div %1$s>%2$s%3$s</div>',
|
|
40
61
|
$wrapper_attributes,
|
|
62
|
+
$moderation_note,
|
|
41
63
|
$comment_text
|
|
42
64
|
);
|
|
43
65
|
}
|
|
@@ -79,6 +79,10 @@ function render_block_core_comment_template( $attributes, $content, $block ) {
|
|
|
79
79
|
return '';
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
if ( post_password_required( $block->context['postId'] ) ) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
82
86
|
$comment_query = new WP_Comment_Query(
|
|
83
87
|
build_comment_query_vars_from_block( $block )
|
|
84
88
|
);
|
|
@@ -140,7 +140,15 @@ export default function Edit( {
|
|
|
140
140
|
? __( 'One response to ' )
|
|
141
141
|
: __( 'One response' );
|
|
142
142
|
|
|
143
|
+
const singlePlaceholderNoCount = showPostTitle
|
|
144
|
+
? __( 'Response to ' )
|
|
145
|
+
: __( 'Response' );
|
|
146
|
+
|
|
143
147
|
const multiplePlaceholder = showPostTitle
|
|
148
|
+
? __( 'responses to ' )
|
|
149
|
+
: __( 'responses' );
|
|
150
|
+
|
|
151
|
+
const multiplePlaceholderNoCount = showPostTitle
|
|
144
152
|
? __( 'Responses to ' )
|
|
145
153
|
: __( 'Responses' );
|
|
146
154
|
|
|
@@ -154,8 +162,16 @@ export default function Edit( {
|
|
|
154
162
|
<PlainText
|
|
155
163
|
__experimentalVersion={ 2 }
|
|
156
164
|
tagName="span"
|
|
157
|
-
aria-label={
|
|
158
|
-
|
|
165
|
+
aria-label={
|
|
166
|
+
showCommentsCount
|
|
167
|
+
? singlePlaceholder
|
|
168
|
+
: singlePlaceholderNoCount
|
|
169
|
+
}
|
|
170
|
+
placeholder={
|
|
171
|
+
showCommentsCount
|
|
172
|
+
? singlePlaceholder
|
|
173
|
+
: singlePlaceholderNoCount
|
|
174
|
+
}
|
|
159
175
|
value={ singleCommentLabel }
|
|
160
176
|
onChange={ ( newLabel ) =>
|
|
161
177
|
setAttributes( {
|
|
@@ -174,12 +190,12 @@ export default function Edit( {
|
|
|
174
190
|
aria-label={
|
|
175
191
|
showCommentsCount
|
|
176
192
|
? ` ${ multiplePlaceholder }`
|
|
177
|
-
:
|
|
193
|
+
: multiplePlaceholderNoCount
|
|
178
194
|
}
|
|
179
195
|
placeholder={
|
|
180
196
|
showCommentsCount
|
|
181
197
|
? ` ${ multiplePlaceholder }`
|
|
182
|
-
:
|
|
198
|
+
: multiplePlaceholderNoCount
|
|
183
199
|
}
|
|
184
200
|
value={ multipleCommentsLabel }
|
|
185
201
|
onChange={ ( newLabel ) =>
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
*/
|
|
15
15
|
function render_block_core_comments_title( $attributes ) {
|
|
16
16
|
|
|
17
|
+
if ( post_password_required() ) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
$align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}";
|
|
18
22
|
$show_post_title = ! empty( $attributes['showPostTitle'] ) && $attributes['showPostTitle'];
|
|
19
23
|
$show_comments_count = ! empty( $attributes['showCommentsCount'] ) && $attributes['showCommentsCount'];
|
|
@@ -29,11 +33,18 @@ function render_block_core_comments_title( $attributes ) {
|
|
|
29
33
|
return;
|
|
30
34
|
}
|
|
31
35
|
|
|
32
|
-
$single_default_comment_label = $show_post_title ? __( '
|
|
33
|
-
|
|
36
|
+
$single_default_comment_label = $show_post_title ? __( 'Response to' ) : __( 'Response' );
|
|
37
|
+
if ( $show_comments_count ) {
|
|
38
|
+
$single_default_comment_label = $show_post_title ? __( 'One response to' ) : __( 'One response' );
|
|
39
|
+
}
|
|
40
|
+
$single_comment_label = ! empty( $attributes['singleCommentLabel'] ) ? $attributes['singleCommentLabel'] : $single_default_comment_label;
|
|
34
41
|
|
|
35
42
|
$multiple_default_comment_label = $show_post_title ? __( 'Responses to' ) : __( 'Responses' );
|
|
36
|
-
|
|
43
|
+
if ( $show_comments_count ) {
|
|
44
|
+
$multiple_default_comment_label = $show_post_title ? __( 'responses to' ) : __( 'responses' );
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
$multiple_comment_label = ! empty( $attributes['multipleCommentsLabel'] ) ? $attributes['multipleCommentsLabel'] : $multiple_default_comment_label;
|
|
37
48
|
|
|
38
49
|
$comments_title = '%1$s %2$s %3$s';
|
|
39
50
|
|
|
@@ -53,9 +64,9 @@ function render_block_core_comments_title( $attributes ) {
|
|
|
53
64
|
);
|
|
54
65
|
}
|
|
55
66
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Registers the `core/comments-title` block on the server.
|
|
69
|
+
*/
|
|
59
70
|
function register_block_core_comments_title() {
|
|
60
71
|
register_block_type_from_metadata(
|
|
61
72
|
__DIR__ . '/comments-title',
|
|
@@ -65,4 +76,4 @@ function register_block_core_comments_title() {
|
|
|
65
76
|
);
|
|
66
77
|
}
|
|
67
78
|
|
|
68
|
-
|
|
79
|
+
add_action( 'init', 'register_block_core_comments_title' );
|
package/src/cover/index.php
CHANGED
|
@@ -40,7 +40,7 @@ function render_block_core_cover( $attributes, $content ) {
|
|
|
40
40
|
$object_position = '';
|
|
41
41
|
if ( isset( $attributes['focalPoint'] ) ) {
|
|
42
42
|
$object_position = round( $attributes['focalPoint']['x'] * 100 ) . '%' . ' ' .
|
|
43
|
-
round( $attributes['focalPoint']['
|
|
43
|
+
round( $attributes['focalPoint']['y'] * 100 ) . '%';
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
$image_template = '<img
|
package/src/cover/style.scss
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
// Mobile Safari does not support fixed background attachment properly.
|
|
19
19
|
// See also https://stackoverflow.com/questions/24154666/background-size-cover-not-working-on-ios
|
|
20
20
|
// Chrome on Android does not appear to support the attachment at all: https://issuetracker.google.com/issues/36908439
|
|
21
|
-
@supports (-webkit-
|
|
21
|
+
@supports (-webkit-touch-callout: inherit) {
|
|
22
22
|
background-attachment: scroll;
|
|
23
23
|
}
|
|
24
24
|
|