@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.
Files changed (40) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/actions/delete-post.cjs.map +2 -2
  3. package/build/actions/permanently-delete-post.cjs.map +2 -2
  4. package/build/actions/reset-post.cjs.map +2 -2
  5. package/build/actions/trash-post.cjs.map +2 -2
  6. package/build/components/media-edit/index.cjs +3 -2
  7. package/build/components/media-edit/index.cjs.map +3 -3
  8. package/build/fields/excerpt/index.cjs.map +3 -3
  9. package/build/fields/page-title/view.cjs +2 -2
  10. package/build/fields/page-title/view.cjs.map +2 -2
  11. package/build/fields/post-content-info/post-content-info-view.cjs.map +3 -3
  12. package/build-module/actions/delete-post.mjs +2 -2
  13. package/build-module/actions/delete-post.mjs.map +2 -2
  14. package/build-module/actions/permanently-delete-post.mjs +2 -2
  15. package/build-module/actions/permanently-delete-post.mjs.map +2 -2
  16. package/build-module/actions/reset-post.mjs +2 -2
  17. package/build-module/actions/reset-post.mjs.map +2 -2
  18. package/build-module/actions/trash-post.mjs +2 -2
  19. package/build-module/actions/trash-post.mjs.map +2 -2
  20. package/build-module/components/media-edit/index.mjs +5 -5
  21. package/build-module/components/media-edit/index.mjs.map +2 -2
  22. package/build-module/fields/excerpt/index.mjs +2 -2
  23. package/build-module/fields/excerpt/index.mjs.map +2 -2
  24. package/build-module/fields/page-title/view.mjs +2 -2
  25. package/build-module/fields/page-title/view.mjs.map +2 -2
  26. package/build-module/fields/post-content-info/post-content-info-view.mjs +3 -3
  27. package/build-module/fields/post-content-info/post-content-info-view.mjs.map +2 -2
  28. package/build-style/style-rtl.css +2 -2
  29. package/build-style/style.css +2 -2
  30. package/package.json +27 -26
  31. package/src/actions/delete-post.tsx +3 -3
  32. package/src/actions/permanently-delete-post.tsx +3 -3
  33. package/src/actions/reset-post.tsx +3 -3
  34. package/src/actions/trash-post.tsx +3 -3
  35. package/src/components/create-template-part-modal/style.scss +1 -1
  36. package/src/components/media-edit/index.tsx +5 -5
  37. package/src/components/media-edit/style.scss +1 -1
  38. package/src/fields/excerpt/index.tsx +3 -3
  39. package/src/fields/page-title/view.tsx +3 -3
  40. 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 Text,
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 as="legend">
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
- <Text
940
+ <WCText
941
941
  variant="muted"
942
942
  className="fields__media-edit-description"
943
943
  >
944
944
  { field.description }
945
- </Text>
945
+ </WCText>
946
946
  ) }
947
947
  </VStack>
948
948
  );
@@ -103,7 +103,7 @@ fieldset.fields__media-edit {
103
103
  border-radius: $radius-small;
104
104
  padding: $grid-unit-05 $grid-unit-10;
105
105
  min-height: $grid-unit-50;
106
- cursor: pointer;
106
+ cursor: var(--wpds-cursor-control);
107
107
  min-width: 0;
108
108
 
109
109
  &:not(.has-attachment) {
@@ -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 Text,
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
- <Text align="left" numberOfLines={ 3 } truncate>
41
+ <WCText align="left" numberOfLines={ 3 } truncate>
42
42
  { excerpt }
43
- </Text>
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
- <Badge>
33
+ <WCBadge>
34
34
  { item.id === frontPageId
35
35
  ? __( 'Homepage' )
36
36
  : __( 'Posts Page' ) }
37
- </Badge>
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 Text,
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
- <Text variant="muted">{ contentInfoText }</Text>
81
+ <WCText variant="muted">{ contentInfoText }</WCText>
82
82
  ) }
83
83
  { modified && (
84
- <Text variant="muted">
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
- </Text>
90
+ </WCText>
91
91
  ) }
92
92
  </VStack>
93
93
  );