@wordpress/fields 0.36.0 → 0.37.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/actions/delete-post.cjs.map +2 -2
- package/build/actions/permanently-delete-post.cjs.map +2 -2
- package/build/actions/reset-post.cjs.map +2 -2
- package/build/actions/trash-post.cjs.map +2 -2
- package/build/components/media-edit/index.cjs +3 -2
- package/build/components/media-edit/index.cjs.map +3 -3
- package/build/fields/excerpt/index.cjs.map +3 -3
- package/build/fields/page-title/view.cjs +2 -2
- package/build/fields/page-title/view.cjs.map +2 -2
- package/build/fields/post-content-info/post-content-info-view.cjs.map +3 -3
- package/build-module/actions/delete-post.mjs +2 -2
- package/build-module/actions/delete-post.mjs.map +2 -2
- package/build-module/actions/permanently-delete-post.mjs +2 -2
- package/build-module/actions/permanently-delete-post.mjs.map +2 -2
- package/build-module/actions/reset-post.mjs +2 -2
- package/build-module/actions/reset-post.mjs.map +2 -2
- package/build-module/actions/trash-post.mjs +2 -2
- package/build-module/actions/trash-post.mjs.map +2 -2
- package/build-module/components/media-edit/index.mjs +5 -5
- package/build-module/components/media-edit/index.mjs.map +2 -2
- package/build-module/fields/excerpt/index.mjs +2 -2
- package/build-module/fields/excerpt/index.mjs.map +2 -2
- package/build-module/fields/page-title/view.mjs +2 -2
- package/build-module/fields/page-title/view.mjs.map +2 -2
- package/build-module/fields/post-content-info/post-content-info-view.mjs +3 -3
- package/build-module/fields/post-content-info/post-content-info-view.mjs.map +2 -2
- package/build-style/style-rtl.css +2 -2
- package/build-style/style.css +2 -2
- package/package.json +27 -26
- package/src/actions/delete-post.tsx +3 -3
- package/src/actions/permanently-delete-post.tsx +3 -3
- package/src/actions/reset-post.tsx +3 -3
- package/src/actions/trash-post.tsx +3 -3
- package/src/components/create-template-part-modal/style.scss +1 -1
- package/src/components/media-edit/index.tsx +5 -5
- package/src/components/media-edit/style.scss +1 -1
- package/src/fields/excerpt/index.tsx +3 -3
- package/src/fields/page-title/view.tsx +3 -3
- package/src/fields/post-content-info/post-content-info-view.tsx +4 -4
|
@@ -11,13 +11,12 @@ import {
|
|
|
11
11
|
DropZone,
|
|
12
12
|
Icon,
|
|
13
13
|
Spinner,
|
|
14
|
-
__experimentalText as
|
|
14
|
+
__experimentalText as WCText,
|
|
15
15
|
__experimentalTruncate as Truncate,
|
|
16
16
|
__experimentalVStack as VStack,
|
|
17
17
|
__experimentalHStack as HStack,
|
|
18
18
|
BaseControl,
|
|
19
19
|
Tooltip,
|
|
20
|
-
VisuallyHidden,
|
|
21
20
|
} from '@wordpress/components';
|
|
22
21
|
import { isBlobURL, getBlobTypeByURL } from '@wordpress/blob';
|
|
23
22
|
import { store as coreStore, type Attachment } from '@wordpress/core-data';
|
|
@@ -42,6 +41,7 @@ import {
|
|
|
42
41
|
chevronLeft,
|
|
43
42
|
chevronRight,
|
|
44
43
|
} from '@wordpress/icons';
|
|
44
|
+
import { VisuallyHidden } from '@wordpress/ui';
|
|
45
45
|
import {
|
|
46
46
|
MediaUpload,
|
|
47
47
|
uploadMedia,
|
|
@@ -914,7 +914,7 @@ export default function MediaEdit< Item >( {
|
|
|
914
914
|
<VStack spacing={ 2 }>
|
|
915
915
|
{ field.label &&
|
|
916
916
|
( hideLabelFromVision ? (
|
|
917
|
-
<VisuallyHidden
|
|
917
|
+
<VisuallyHidden render={ <legend /> }>
|
|
918
918
|
{ field.label }
|
|
919
919
|
</VisuallyHidden>
|
|
920
920
|
) : (
|
|
@@ -937,12 +937,12 @@ export default function MediaEdit< Item >( {
|
|
|
937
937
|
setTargetItemId={ setTargetItemId }
|
|
938
938
|
/>
|
|
939
939
|
{ field.description && (
|
|
940
|
-
<
|
|
940
|
+
<WCText
|
|
941
941
|
variant="muted"
|
|
942
942
|
className="fields__media-edit-description"
|
|
943
943
|
>
|
|
944
944
|
{ field.description }
|
|
945
|
-
</
|
|
945
|
+
</WCText>
|
|
946
946
|
) }
|
|
947
947
|
</VStack>
|
|
948
948
|
);
|
|
@@ -6,7 +6,7 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
import {
|
|
8
8
|
ExternalLink,
|
|
9
|
-
__experimentalText as
|
|
9
|
+
__experimentalText as WCText,
|
|
10
10
|
} from '@wordpress/components';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -38,9 +38,9 @@ const excerptField: Field< BasePost > = {
|
|
|
38
38
|
excerpt = decodeEntities( item.excerpt?.raw || '' );
|
|
39
39
|
}
|
|
40
40
|
return (
|
|
41
|
-
<
|
|
41
|
+
<WCText align="left" numberOfLines={ 3 } truncate>
|
|
42
42
|
{ excerpt }
|
|
43
|
-
</
|
|
43
|
+
</WCText>
|
|
44
44
|
);
|
|
45
45
|
},
|
|
46
46
|
Edit: {
|
|
@@ -13,7 +13,7 @@ import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
|
13
13
|
import type { CommonPost } from '../../types';
|
|
14
14
|
import { BaseTitleView } from '../title/view';
|
|
15
15
|
import { unlock } from '../../lock-unlock';
|
|
16
|
-
const { Badge } = unlock( componentsPrivateApis );
|
|
16
|
+
const { Badge: WCBadge } = unlock( componentsPrivateApis );
|
|
17
17
|
|
|
18
18
|
export default function PageTitleView( { item }: { item: CommonPost } ) {
|
|
19
19
|
const { frontPageId, postsPageId } = useSelect( ( select ) => {
|
|
@@ -30,11 +30,11 @@ export default function PageTitleView( { item }: { item: CommonPost } ) {
|
|
|
30
30
|
return (
|
|
31
31
|
<BaseTitleView item={ item } className="fields-field__page-title">
|
|
32
32
|
{ [ frontPageId, postsPageId ].includes( item.id as number ) && (
|
|
33
|
-
<
|
|
33
|
+
<WCBadge>
|
|
34
34
|
{ item.id === frontPageId
|
|
35
35
|
? __( 'Homepage' )
|
|
36
36
|
: __( 'Posts Page' ) }
|
|
37
|
-
</
|
|
37
|
+
</WCBadge>
|
|
38
38
|
) }
|
|
39
39
|
</BaseTitleView>
|
|
40
40
|
);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
|
-
__experimentalText as
|
|
5
|
+
__experimentalText as WCText,
|
|
6
6
|
__experimentalVStack as VStack,
|
|
7
7
|
} from '@wordpress/components';
|
|
8
8
|
import { __, _x, _n, sprintf } from '@wordpress/i18n';
|
|
@@ -78,16 +78,16 @@ export default function PostContentInfoView( {
|
|
|
78
78
|
return (
|
|
79
79
|
<VStack spacing={ 1 }>
|
|
80
80
|
{ contentInfoText && (
|
|
81
|
-
<
|
|
81
|
+
<WCText variant="muted">{ contentInfoText }</WCText>
|
|
82
82
|
) }
|
|
83
83
|
{ modified && (
|
|
84
|
-
<
|
|
84
|
+
<WCText variant="muted">
|
|
85
85
|
{ sprintf(
|
|
86
86
|
// translators: %s: Human-readable time difference, e.g. "2 days ago".
|
|
87
87
|
__( 'Last edited %s.' ),
|
|
88
88
|
humanTimeDiff( modified )
|
|
89
89
|
) }
|
|
90
|
-
</
|
|
90
|
+
</WCText>
|
|
91
91
|
) }
|
|
92
92
|
</VStack>
|
|
93
93
|
);
|