@wordpress/fields 0.19.1-next.46f643fa0.0 → 0.20.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/fields/featured-image/featured-image-edit.js +1 -1
- package/build/fields/featured-image/featured-image-edit.js.map +1 -1
- package/build/fields/featured-image/featured-image-view.js +1 -1
- package/build/fields/featured-image/featured-image-view.js.map +1 -1
- package/build-module/fields/featured-image/featured-image-edit.js +1 -1
- package/build-module/fields/featured-image/featured-image-edit.js.map +1 -1
- package/build-module/fields/featured-image/featured-image-view.js +1 -1
- package/build-module/fields/featured-image/featured-image-view.js.map +1 -1
- package/build-types/fields/featured-image/featured-image-view.d.ts.map +1 -1
- package/package.json +25 -25
- package/src/fields/featured-image/featured-image-edit.tsx +1 -1
- package/src/fields/featured-image/featured-image-view.tsx +3 -1
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -37,7 +37,7 @@ const FeaturedImageEdit = ({
|
|
|
37
37
|
const {
|
|
38
38
|
getEntityRecord
|
|
39
39
|
} = select(_coreData.store);
|
|
40
|
-
return getEntityRecord('
|
|
40
|
+
return getEntityRecord('postType', 'attachment', value);
|
|
41
41
|
}, [value]);
|
|
42
42
|
const onChangeControl = (0, _element.useCallback)(newValue => onChange({
|
|
43
43
|
[id]: newValue
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_data","_element","_mediaUtils","_icons","_coreData","_i18n","_jsxRuntime","FeaturedImageEdit","data","field","onChange","id","value","getValue","item","media","useSelect","select","getEntityRecord","coreStore","onChangeControl","useCallback","newValue","url","source_url","title","rendered","ref","useRef","jsx","className","children","MediaUpload","onSelect","selectedMedia","allowedTypes","render","open","role","tabIndex","onClick","onKeyDown","jsxs","__experimentalGrid","rowGap","columnGap","templateColumns","Fragment","alt","width","height","src","style","__","Button","size","icon","lineSolid","event","stopPropagation","exports"],"sources":["@wordpress/fields/src/fields/featured-image/featured-image-edit.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, __experimentalGrid as Grid } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useCallback, useRef } from '@wordpress/element';\n// @ts-ignore\nimport { MediaUpload } from '@wordpress/media-utils';\nimport { lineSolid } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { DataFormControlProps } from '@wordpress/dataviews';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nexport const FeaturedImageEdit = ( {\n\tdata,\n\tfield,\n\tonChange,\n}: DataFormControlProps< BasePost > ) => {\n\tconst { id } = field;\n\n\tconst value = field.getValue( { item: data } );\n\n\tconst media = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\treturn getEntityRecord( '
|
|
1
|
+
{"version":3,"names":["_components","require","_data","_element","_mediaUtils","_icons","_coreData","_i18n","_jsxRuntime","FeaturedImageEdit","data","field","onChange","id","value","getValue","item","media","useSelect","select","getEntityRecord","coreStore","onChangeControl","useCallback","newValue","url","source_url","title","rendered","ref","useRef","jsx","className","children","MediaUpload","onSelect","selectedMedia","allowedTypes","render","open","role","tabIndex","onClick","onKeyDown","jsxs","__experimentalGrid","rowGap","columnGap","templateColumns","Fragment","alt","width","height","src","style","__","Button","size","icon","lineSolid","event","stopPropagation","exports"],"sources":["@wordpress/fields/src/fields/featured-image/featured-image-edit.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, __experimentalGrid as Grid } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useCallback, useRef } from '@wordpress/element';\n// @ts-ignore\nimport { MediaUpload } from '@wordpress/media-utils';\nimport { lineSolid } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { DataFormControlProps } from '@wordpress/dataviews';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nexport const FeaturedImageEdit = ( {\n\tdata,\n\tfield,\n\tonChange,\n}: DataFormControlProps< BasePost > ) => {\n\tconst { id } = field;\n\n\tconst value = field.getValue( { item: data } );\n\n\tconst media = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\treturn getEntityRecord( 'postType', 'attachment', value );\n\t\t},\n\t\t[ value ]\n\t);\n\n\tconst onChangeControl = useCallback(\n\t\t( newValue: number ) =>\n\t\t\tonChange( {\n\t\t\t\t[ id ]: newValue,\n\t\t\t} ),\n\t\t[ id, onChange ]\n\t);\n\n\tconst url = media?.source_url;\n\tconst title = media?.title?.rendered;\n\tconst ref = useRef( null );\n\n\treturn (\n\t\t<fieldset className=\"fields-controls__featured-image\">\n\t\t\t<div className=\"fields-controls__featured-image-container\">\n\t\t\t\t<MediaUpload\n\t\t\t\t\tonSelect={ ( selectedMedia: { id: number } ) => {\n\t\t\t\t\t\tonChangeControl( selectedMedia.id );\n\t\t\t\t\t} }\n\t\t\t\t\tallowedTypes={ [ 'image' ] }\n\t\t\t\t\trender={ ( { open }: { open: () => void } ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topen();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tonKeyDown={ open }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Grid\n\t\t\t\t\t\t\t\t\trowGap={ 0 }\n\t\t\t\t\t\t\t\t\tcolumnGap={ 8 }\n\t\t\t\t\t\t\t\t\ttemplateColumns=\"24px 1fr 24px\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ url && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"fields-controls__featured-image-image\"\n\t\t\t\t\t\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\t\t\t\t\t\twidth={ 24 }\n\t\t\t\t\t\t\t\t\t\t\t\theight={ 24 }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"fields-controls__featured-image-title\">\n\t\t\t\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ! url && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"fields-controls__featured-image-placeholder\"\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '24px',\n\t\t\t\t\t\t\t\t\t\t\t\t\theight: '24px',\n\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"fields-controls__featured-image-title\">\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Choose an image…' ) }\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ url && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"fields-controls__featured-image-remove-button\"\n\t\t\t\t\t\t\t\t\t\t\t\ticon={ lineSolid }\n\t\t\t\t\t\t\t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
24
24
|
const {
|
|
25
25
|
getEntityRecord
|
|
26
26
|
} = select(_coreData.store);
|
|
27
|
-
return mediaId ? getEntityRecord('
|
|
27
|
+
return mediaId ? getEntityRecord('postType', 'attachment', mediaId) : null;
|
|
28
28
|
}, [mediaId]);
|
|
29
29
|
const url = media?.source_url;
|
|
30
30
|
if (url) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_coreData","_jsxRuntime","FeaturedImageView","item","config","mediaId","featured_media","media","useSelect","select","getEntityRecord","coreStore","url","source_url","jsx","className","src","alt","srcSet","media_details","sizes","Object","values","map","size","width","join","undefined","exports"],"sources":["@wordpress/fields/src/fields/featured-image/featured-image-view.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { DataViewRenderFieldProps } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nexport const FeaturedImageView = ( {\n\titem,\n\tconfig,\n}: DataViewRenderFieldProps< BasePost > ) => {\n\tconst mediaId = item.featured_media;\n\n\tconst media = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\treturn mediaId
|
|
1
|
+
{"version":3,"names":["_data","require","_coreData","_jsxRuntime","FeaturedImageView","item","config","mediaId","featured_media","media","useSelect","select","getEntityRecord","coreStore","url","source_url","jsx","className","src","alt","srcSet","media_details","sizes","Object","values","map","size","width","join","undefined","exports"],"sources":["@wordpress/fields/src/fields/featured-image/featured-image-view.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { DataViewRenderFieldProps } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nexport const FeaturedImageView = ( {\n\titem,\n\tconfig,\n}: DataViewRenderFieldProps< BasePost > ) => {\n\tconst mediaId = item.featured_media;\n\n\tconst media = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\treturn mediaId\n\t\t\t\t? getEntityRecord( 'postType', 'attachment', mediaId )\n\t\t\t\t: null;\n\t\t},\n\t\t[ mediaId ]\n\t);\n\tconst url = media?.source_url;\n\n\tif ( url ) {\n\t\treturn (\n\t\t\t<img\n\t\t\t\tclassName=\"fields-controls__featured-image-image\"\n\t\t\t\tsrc={ url }\n\t\t\t\talt=\"\"\n\t\t\t\tsrcSet={\n\t\t\t\t\tmedia?.media_details?.sizes\n\t\t\t\t\t\t? Object.values( media.media_details.sizes )\n\t\t\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t\t\t( size: any ) =>\n\t\t\t\t\t\t\t\t\t\t`${ size.source_url } ${ size.width }w`\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t.join( ', ' )\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tsizes={ config?.sizes || '100vw' }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn <span className=\"fields-controls__featured-image-placeholder\" />;\n};\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAA0D,IAAAE,WAAA,GAAAF,OAAA;AAJ1D;AACA;AACA;;AAKA;AACA;AACA;;AAGO,MAAMG,iBAAiB,GAAGA,CAAE;EAClCC,IAAI;EACJC;AACqC,CAAC,KAAM;EAC5C,MAAMC,OAAO,GAAGF,IAAI,CAACG,cAAc;EAEnC,MAAMC,KAAK,GAAG,IAAAC,eAAS,EACpBC,MAAM,IAAM;IACb,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAEE,eAAU,CAAC;IAC/C,OAAON,OAAO,GACXK,eAAe,CAAE,UAAU,EAAE,YAAY,EAAEL,OAAQ,CAAC,GACpD,IAAI;EACR,CAAC,EACD,CAAEA,OAAO,CACV,CAAC;EACD,MAAMO,GAAG,GAAGL,KAAK,EAAEM,UAAU;EAE7B,IAAKD,GAAG,EAAG;IACV,oBACC,IAAAX,WAAA,CAAAa,GAAA;MACCC,SAAS,EAAC,uCAAuC;MACjDC,GAAG,EAAGJ,GAAK;MACXK,GAAG,EAAC,EAAE;MACNC,MAAM,EACLX,KAAK,EAAEY,aAAa,EAAEC,KAAK,GACxBC,MAAM,CAACC,MAAM,CAAEf,KAAK,CAACY,aAAa,CAACC,KAAM,CAAC,CACzCG,GAAG,CACDC,IAAS,IACV,GAAIA,IAAI,CAACX,UAAU,IAAMW,IAAI,CAACC,KAAK,GACrC,CAAC,CACAC,IAAI,CAAE,IAAK,CAAC,GACbC,SACH;MACDP,KAAK,EAAGhB,MAAM,EAAEgB,KAAK,IAAI;IAAS,CAClC,CAAC;EAEJ;EAEA,oBAAO,IAAAnB,WAAA,CAAAa,GAAA;IAAMC,SAAS,EAAC;EAA6C,CAAE,CAAC;AACxE,CAAC;AAACa,OAAA,CAAA1B,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -29,7 +29,7 @@ export const FeaturedImageEdit = ({
|
|
|
29
29
|
const {
|
|
30
30
|
getEntityRecord
|
|
31
31
|
} = select(coreStore);
|
|
32
|
-
return getEntityRecord('
|
|
32
|
+
return getEntityRecord('postType', 'attachment', value);
|
|
33
33
|
}, [value]);
|
|
34
34
|
const onChangeControl = useCallback(newValue => onChange({
|
|
35
35
|
[id]: newValue
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","__experimentalGrid","Grid","useSelect","useCallback","useRef","MediaUpload","lineSolid","store","coreStore","__","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","FeaturedImageEdit","data","field","onChange","id","value","getValue","item","media","select","getEntityRecord","onChangeControl","newValue","url","source_url","title","rendered","ref","className","children","onSelect","selectedMedia","allowedTypes","render","open","role","tabIndex","onClick","onKeyDown","rowGap","columnGap","templateColumns","alt","width","height","src","style","size","icon","event","stopPropagation"],"sources":["@wordpress/fields/src/fields/featured-image/featured-image-edit.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, __experimentalGrid as Grid } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useCallback, useRef } from '@wordpress/element';\n// @ts-ignore\nimport { MediaUpload } from '@wordpress/media-utils';\nimport { lineSolid } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { DataFormControlProps } from '@wordpress/dataviews';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nexport const FeaturedImageEdit = ( {\n\tdata,\n\tfield,\n\tonChange,\n}: DataFormControlProps< BasePost > ) => {\n\tconst { id } = field;\n\n\tconst value = field.getValue( { item: data } );\n\n\tconst media = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\treturn getEntityRecord( '
|
|
1
|
+
{"version":3,"names":["Button","__experimentalGrid","Grid","useSelect","useCallback","useRef","MediaUpload","lineSolid","store","coreStore","__","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","FeaturedImageEdit","data","field","onChange","id","value","getValue","item","media","select","getEntityRecord","onChangeControl","newValue","url","source_url","title","rendered","ref","className","children","onSelect","selectedMedia","allowedTypes","render","open","role","tabIndex","onClick","onKeyDown","rowGap","columnGap","templateColumns","alt","width","height","src","style","size","icon","event","stopPropagation"],"sources":["@wordpress/fields/src/fields/featured-image/featured-image-edit.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, __experimentalGrid as Grid } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useCallback, useRef } from '@wordpress/element';\n// @ts-ignore\nimport { MediaUpload } from '@wordpress/media-utils';\nimport { lineSolid } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { DataFormControlProps } from '@wordpress/dataviews';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nexport const FeaturedImageEdit = ( {\n\tdata,\n\tfield,\n\tonChange,\n}: DataFormControlProps< BasePost > ) => {\n\tconst { id } = field;\n\n\tconst value = field.getValue( { item: data } );\n\n\tconst media = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\treturn getEntityRecord( 'postType', 'attachment', value );\n\t\t},\n\t\t[ value ]\n\t);\n\n\tconst onChangeControl = useCallback(\n\t\t( newValue: number ) =>\n\t\t\tonChange( {\n\t\t\t\t[ id ]: newValue,\n\t\t\t} ),\n\t\t[ id, onChange ]\n\t);\n\n\tconst url = media?.source_url;\n\tconst title = media?.title?.rendered;\n\tconst ref = useRef( null );\n\n\treturn (\n\t\t<fieldset className=\"fields-controls__featured-image\">\n\t\t\t<div className=\"fields-controls__featured-image-container\">\n\t\t\t\t<MediaUpload\n\t\t\t\t\tonSelect={ ( selectedMedia: { id: number } ) => {\n\t\t\t\t\t\tonChangeControl( selectedMedia.id );\n\t\t\t\t\t} }\n\t\t\t\t\tallowedTypes={ [ 'image' ] }\n\t\t\t\t\trender={ ( { open }: { open: () => void } ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topen();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tonKeyDown={ open }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Grid\n\t\t\t\t\t\t\t\t\trowGap={ 0 }\n\t\t\t\t\t\t\t\t\tcolumnGap={ 8 }\n\t\t\t\t\t\t\t\t\ttemplateColumns=\"24px 1fr 24px\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ url && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"fields-controls__featured-image-image\"\n\t\t\t\t\t\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\t\t\t\t\t\twidth={ 24 }\n\t\t\t\t\t\t\t\t\t\t\t\theight={ 24 }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"fields-controls__featured-image-title\">\n\t\t\t\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ! url && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"fields-controls__featured-image-placeholder\"\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '24px',\n\t\t\t\t\t\t\t\t\t\t\t\t\theight: '24px',\n\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"fields-controls__featured-image-title\">\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Choose an image…' ) }\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ url && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"fields-controls__featured-image-remove-button\"\n\t\t\t\t\t\t\t\t\t\t\t\ticon={ lineSolid }\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={ (\n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AG,EAAI;kBACbC,GAAG,EAAGtB;gBAAK,CACX,CAAC,eACFlB,IAAA;kBAAMuB,SAAS,EAAC,uCAAuC;kBAAAC,QAAA,EACpDJ;gBAAK,CACF,CAAC;cAAA,CACN,CACF,EACC,CAAEF,GAAG,iBACNd,KAAA,CAAAF,SAAA;gBAAAsB,QAAA,gBACCxB,IAAA;kBACCuB,SAAS,EAAC,6CAA6C;kBACvDkB,KAAK,EAAG;oBACPH,KAAK,EAAE,MAAM;oBACbC,MAAM,EAAE;kBACT;gBAAG,CACH,CAAC,eACFvC,IAAA;kBAAMuB,SAAS,EAAC,uCAAuC;kBAAAC,QAAA,EACpD1B,EAAE,CAAE,kBAAmB;gBAAC,CACrB,CAAC;cAAA,CACN,CACF,EACCoB,GAAG,iBACJlB,IAAA,CAAAE,SAAA;gBAAAsB,QAAA,eACCxB,IAAA,CAACZ,MAAM;kBACNsD,IAAI,EAAC,OAAO;kBACZnB,SAAS,EAAC,+CAA+C;kBACzDoB,IAAI,EAAGhD,SAAW;kBAClBqC,OAAO,EACNY,KAA4C,IACxC;oBACJA,KAAK,CAACC,eAAe,CAAC,CAAC;oBACvB7B,eAAe,CAAE,CAAE,CAAC;kBACrB;gBAAG,CACH;cAAC,CACD,CACF;YAAA,CACI;UAAC,CACH,CAAC;QAER;MAAG,CACH;IAAC,CACE;EAAC,CACG,CAAC;AAEb,CAAC","ignoreList":[]}
|
|
@@ -17,7 +17,7 @@ export const FeaturedImageView = ({
|
|
|
17
17
|
const {
|
|
18
18
|
getEntityRecord
|
|
19
19
|
} = select(coreStore);
|
|
20
|
-
return mediaId ? getEntityRecord('
|
|
20
|
+
return mediaId ? getEntityRecord('postType', 'attachment', mediaId) : null;
|
|
21
21
|
}, [mediaId]);
|
|
22
22
|
const url = media?.source_url;
|
|
23
23
|
if (url) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","coreStore","jsx","_jsx","FeaturedImageView","item","config","mediaId","featured_media","media","select","getEntityRecord","url","source_url","className","src","alt","srcSet","media_details","sizes","Object","values","map","size","width","join","undefined"],"sources":["@wordpress/fields/src/fields/featured-image/featured-image-view.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { DataViewRenderFieldProps } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nexport const FeaturedImageView = ( {\n\titem,\n\tconfig,\n}: DataViewRenderFieldProps< BasePost > ) => {\n\tconst mediaId = item.featured_media;\n\n\tconst media = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\treturn mediaId
|
|
1
|
+
{"version":3,"names":["useSelect","store","coreStore","jsx","_jsx","FeaturedImageView","item","config","mediaId","featured_media","media","select","getEntityRecord","url","source_url","className","src","alt","srcSet","media_details","sizes","Object","values","map","size","width","join","undefined"],"sources":["@wordpress/fields/src/fields/featured-image/featured-image-view.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { DataViewRenderFieldProps } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport type { BasePost } from '../../types';\n\nexport const FeaturedImageView = ( {\n\titem,\n\tconfig,\n}: DataViewRenderFieldProps< BasePost > ) => {\n\tconst mediaId = item.featured_media;\n\n\tconst media = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\treturn mediaId\n\t\t\t\t? getEntityRecord( 'postType', 'attachment', mediaId )\n\t\t\t\t: null;\n\t\t},\n\t\t[ mediaId ]\n\t);\n\tconst url = media?.source_url;\n\n\tif ( url ) {\n\t\treturn (\n\t\t\t<img\n\t\t\t\tclassName=\"fields-controls__featured-image-image\"\n\t\t\t\tsrc={ url }\n\t\t\t\talt=\"\"\n\t\t\t\tsrcSet={\n\t\t\t\t\tmedia?.media_details?.sizes\n\t\t\t\t\t\t? Object.values( media.media_details.sizes )\n\t\t\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t\t\t( size: any ) =>\n\t\t\t\t\t\t\t\t\t\t`${ size.source_url } ${ size.width }w`\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t.join( ', ' )\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tsizes={ config?.sizes || '100vw' }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn <span className=\"fields-controls__featured-image-placeholder\" />;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAGzD;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA;AAKA,OAAO,MAAMC,iBAAiB,GAAGA,CAAE;EAClCC,IAAI;EACJC;AACqC,CAAC,KAAM;EAC5C,MAAMC,OAAO,GAAGF,IAAI,CAACG,cAAc;EAEnC,MAAMC,KAAK,GAAGV,SAAS,CACpBW,MAAM,IAAM;IACb,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAET,SAAU,CAAC;IAC/C,OAAOM,OAAO,GACXI,eAAe,CAAE,UAAU,EAAE,YAAY,EAAEJ,OAAQ,CAAC,GACpD,IAAI;EACR,CAAC,EACD,CAAEA,OAAO,CACV,CAAC;EACD,MAAMK,GAAG,GAAGH,KAAK,EAAEI,UAAU;EAE7B,IAAKD,GAAG,EAAG;IACV,oBACCT,IAAA;MACCW,SAAS,EAAC,uCAAuC;MACjDC,GAAG,EAAGH,GAAK;MACXI,GAAG,EAAC,EAAE;MACNC,MAAM,EACLR,KAAK,EAAES,aAAa,EAAEC,KAAK,GACxBC,MAAM,CAACC,MAAM,CAAEZ,KAAK,CAACS,aAAa,CAACC,KAAM,CAAC,CACzCG,GAAG,CACDC,IAAS,IACV,GAAIA,IAAI,CAACV,UAAU,IAAMU,IAAI,CAACC,KAAK,GACrC,CAAC,CACAC,IAAI,CAAE,IAAK,CAAC,GACbC,SACH;MACDP,KAAK,EAAGb,MAAM,EAAEa,KAAK,IAAI;IAAS,CAClC,CAAC;EAEJ;EAEA,oBAAOhB,IAAA;IAAMW,SAAS,EAAC;EAA6C,CAAE,CAAC;AACxE,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"featured-image-view.d.ts","sourceRoot":"","sources":["../../../src/fields/featured-image/featured-image-view.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,eAAO,MAAM,iBAAiB,sBAG3B,wBAAwB,CAAE,QAAQ,CAAE,
|
|
1
|
+
{"version":3,"file":"featured-image-view.d.ts","sourceRoot":"","sources":["../../../src/fields/featured-image/featured-image-view.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,eAAO,MAAM,iBAAiB,sBAG3B,wBAAwB,CAAE,QAAQ,CAAE,gCAoCtC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/fields",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "DataViews is a component that provides an API to render datasets using different types of layouts (table, grid, list, etc.).",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -33,29 +33,29 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@babel/runtime": "7.25.7",
|
|
36
|
-
"@wordpress/api-fetch": "^7.
|
|
37
|
-
"@wordpress/blob": "^4.
|
|
38
|
-
"@wordpress/block-editor": "^15.
|
|
39
|
-
"@wordpress/blocks": "^15.
|
|
40
|
-
"@wordpress/components": "^30.1.
|
|
41
|
-
"@wordpress/compose": "^7.
|
|
42
|
-
"@wordpress/core-data": "^7.
|
|
43
|
-
"@wordpress/data": "^10.
|
|
44
|
-
"@wordpress/dataviews": "^6.0.
|
|
45
|
-
"@wordpress/date": "^5.
|
|
46
|
-
"@wordpress/element": "^6.
|
|
47
|
-
"@wordpress/hooks": "^4.
|
|
48
|
-
"@wordpress/html-entities": "^4.
|
|
49
|
-
"@wordpress/i18n": "^6.
|
|
50
|
-
"@wordpress/icons": "^10.
|
|
51
|
-
"@wordpress/media-utils": "^5.
|
|
52
|
-
"@wordpress/notices": "^5.
|
|
53
|
-
"@wordpress/patterns": "^2.
|
|
54
|
-
"@wordpress/primitives": "^4.
|
|
55
|
-
"@wordpress/private-apis": "^1.
|
|
56
|
-
"@wordpress/router": "^1.
|
|
57
|
-
"@wordpress/url": "^4.
|
|
58
|
-
"@wordpress/warning": "^3.
|
|
36
|
+
"@wordpress/api-fetch": "^7.28.0",
|
|
37
|
+
"@wordpress/blob": "^4.28.0",
|
|
38
|
+
"@wordpress/block-editor": "^15.1.0",
|
|
39
|
+
"@wordpress/blocks": "^15.1.0",
|
|
40
|
+
"@wordpress/components": "^30.1.0",
|
|
41
|
+
"@wordpress/compose": "^7.28.0",
|
|
42
|
+
"@wordpress/core-data": "^7.28.0",
|
|
43
|
+
"@wordpress/data": "^10.28.0",
|
|
44
|
+
"@wordpress/dataviews": "^6.0.0",
|
|
45
|
+
"@wordpress/date": "^5.28.0",
|
|
46
|
+
"@wordpress/element": "^6.28.0",
|
|
47
|
+
"@wordpress/hooks": "^4.28.0",
|
|
48
|
+
"@wordpress/html-entities": "^4.28.0",
|
|
49
|
+
"@wordpress/i18n": "^6.1.0",
|
|
50
|
+
"@wordpress/icons": "^10.28.0",
|
|
51
|
+
"@wordpress/media-utils": "^5.28.0",
|
|
52
|
+
"@wordpress/notices": "^5.28.0",
|
|
53
|
+
"@wordpress/patterns": "^2.28.0",
|
|
54
|
+
"@wordpress/primitives": "^4.28.0",
|
|
55
|
+
"@wordpress/private-apis": "^1.28.0",
|
|
56
|
+
"@wordpress/router": "^1.28.0",
|
|
57
|
+
"@wordpress/url": "^4.28.0",
|
|
58
|
+
"@wordpress/warning": "^3.28.0",
|
|
59
59
|
"change-case": "4.1.2",
|
|
60
60
|
"client-zip": "^2.4.5",
|
|
61
61
|
"clsx": "2.1.1",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "28cc2098f5ee28f89096b638533796538f495f72"
|
|
71
71
|
}
|
|
@@ -28,7 +28,7 @@ export const FeaturedImageEdit = ( {
|
|
|
28
28
|
const media = useSelect(
|
|
29
29
|
( select ) => {
|
|
30
30
|
const { getEntityRecord } = select( coreStore );
|
|
31
|
-
return getEntityRecord( '
|
|
31
|
+
return getEntityRecord( 'postType', 'attachment', value );
|
|
32
32
|
},
|
|
33
33
|
[ value ]
|
|
34
34
|
);
|
|
@@ -19,7 +19,9 @@ export const FeaturedImageView = ( {
|
|
|
19
19
|
const media = useSelect(
|
|
20
20
|
( select ) => {
|
|
21
21
|
const { getEntityRecord } = select( coreStore );
|
|
22
|
-
return mediaId
|
|
22
|
+
return mediaId
|
|
23
|
+
? getEntityRecord( 'postType', 'attachment', mediaId )
|
|
24
|
+
: null;
|
|
23
25
|
},
|
|
24
26
|
[ mediaId ]
|
|
25
27
|
);
|