@wordpress/media-fields 0.18.0 → 0.19.2-next.v.202608281122.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 (33) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/build/alt_text/index.cjs.map +3 -3
  3. package/build/attached_to/edit.cjs.map +2 -2
  4. package/build/caption/index.cjs.map +3 -3
  5. package/build/description/index.cjs.map +3 -3
  6. package/build-module/alt_text/index.mjs +2 -2
  7. package/build-module/alt_text/index.mjs.map +2 -2
  8. package/build-module/attached_to/edit.mjs.map +2 -2
  9. package/build-module/caption/index.mjs +2 -2
  10. package/build-module/caption/index.mjs.map +2 -2
  11. package/build-module/description/index.mjs +2 -2
  12. package/build-module/description/index.mjs.map +2 -2
  13. package/build-types/attached_to/edit.d.ts.map +1 -1
  14. package/package.json +13 -15
  15. package/src/alt_text/index.tsx +2 -2
  16. package/src/attached_to/edit.tsx +1 -3
  17. package/src/caption/index.tsx +2 -2
  18. package/src/description/index.tsx +2 -2
  19. package/src/stories/index.story.tsx +6 -0
  20. package/build-types/attached_to/test/view.test.d.ts +0 -2
  21. package/build-types/attached_to/test/view.test.d.ts.map +0 -1
  22. package/build-types/filename/test/index.test.d.ts +0 -2
  23. package/build-types/filename/test/index.test.d.ts.map +0 -1
  24. package/build-types/filename/test/view.test.d.ts +0 -2
  25. package/build-types/filename/test/view.test.d.ts.map +0 -1
  26. package/build-types/filesize/test/index.test.d.ts +0 -2
  27. package/build-types/filesize/test/index.test.d.ts.map +0 -1
  28. package/build-types/media_dimensions/test/index.test.d.ts +0 -2
  29. package/build-types/media_dimensions/test/index.test.d.ts.map +0 -1
  30. package/build-types/media_thumbnail/test/get-best-image-url.test.d.ts +0 -2
  31. package/build-types/media_thumbnail/test/get-best-image-url.test.d.ts.map +0 -1
  32. package/build-types/stories/index.story.d.ts +0 -26
  33. package/build-types/stories/index.story.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -2,12 +2,25 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.19.1-next.0 (2026-08-28)
6
+
7
+ ### Internal
8
+
9
+ - Remove unused dependencies `@wordpress/date` and `@wordpress/primitives` ([#82103](https://github.com/WordPress/gutenberg/pull/82103)).
10
+ - Remove tsconfig project references to packages that are not dependencies ([#82106](https://github.com/WordPress/gutenberg/pull/82106)).
11
+
12
+ ## 0.19.0 (2026-08-26)
13
+
14
+ ### Internal
15
+
16
+ - Split tsconfig into a build project and a default dev project so dev files are type checked without publishing their declarations. ([#81514](https://github.com/WordPress/gutenberg/pull/81514))
17
+ - `attached_to`: Narrow the combobox `onChange` handler parameter to `string | null`, following the upstream `ComboboxControl` type fix that removed the accidental `undefined` from the callback type. ([#81568](https://github.com/WordPress/gutenberg/pull/81568))
18
+
5
19
  ## 0.18.0 (2026-08-12)
6
20
 
7
21
  ### Bug Fixes
8
22
 
9
23
  - `attached_to`: Reserve room for the suggestions so the field's DataForm panel dropdown is placed with space for them, instead of being sized to the row and then crushing them into a box too small to scroll comfortably. Also don't expand the suggestion list until the user searches, debounce the search so a request isn't fired per keystroke, allow re-attaching straight after detaching, and drop the detach link from the help text in favour of the field's own reset button ([#81122](https://github.com/WordPress/gutenberg/issues/81122)).
10
-
11
24
  ## 0.17.0 (2026-07-29)
12
25
 
13
26
  ## 0.16.0 (2026-07-14)
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/alt_text/index.tsx"],
4
- "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { TextareaControl } from '@wordpress/components';\nimport { Link } from '@wordpress/ui';\nimport type { Field } from '@wordpress/dataviews';\nimport type { Attachment, Updatable } from '@wordpress/core-data';\n\nconst altTextField: Partial< Field< Updatable< Attachment > > > = {\n\tid: 'alt_text',\n\ttype: 'text',\n\tlabel: __( 'Alt text' ),\n\tisVisible: ( item ) => item?.media_type === 'image',\n\trender: ( { item } ) => item?.alt_text || '-',\n\tEdit: ( { field, onChange, data } ) => {\n\t\treturn (\n\t\t\t<TextareaControl\n\t\t\t\tlabel={ field.label }\n\t\t\t\tvalue={ data.alt_text || '' }\n\t\t\t\tonChange={ ( value ) => onChange( { alt_text: value } ) }\n\t\t\t\thelp={\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\topenInNewTab\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Describe the purpose of the image.' ) }\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{ __( 'Leave empty if decorative.' ) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\trows={ 2 }\n\t\t\t/>\n\t\t);\n\t},\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\nexport default altTextField;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,wBAAgC;AAChC,gBAAqB;AAiBhB;AAbL,IAAM,eAA4D;AAAA,EACjE,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,WAAO,gBAAI,UAAW;AAAA,EACtB,WAAW,CAAE,SAAU,MAAM,eAAe;AAAA,EAC5C,QAAQ,CAAE,EAAE,KAAK,MAAO,MAAM,YAAY;AAAA,EAC1C,MAAM,CAAE,EAAE,OAAO,UAAU,KAAK,MAAO;AACtC,WACC;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,MAAM;AAAA,QACd,OAAQ,KAAK,YAAY;AAAA,QACzB,UAAW,CAAE,UAAW,SAAU,EAAE,UAAU,MAAM,CAAE;AAAA,QACtD,MACC,4EACC;AAAA;AAAA,YAAC;AAAA;AAAA,cACA;AAAA;AAAA,oBAEC;AAAA,kBACC;AAAA,gBACD;AAAA;AAAA,cAED,cAAY;AAAA,cAEV,8BAAI,oCAAqC;AAAA;AAAA,UAC5C;AAAA,UACA,4CAAC,QAAG;AAAA,cACF,gBAAI,4BAA6B;AAAA,WACpC;AAAA,QAED,MAAO;AAAA;AAAA,IACR;AAAA,EAEF;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AACX;AAEA,IAAO,mBAAQ;",
6
- "names": []
4
+ "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { TextareaControl as WCTextareaControl } from '@wordpress/components';\nimport { Link } from '@wordpress/ui';\nimport type { Field } from '@wordpress/dataviews';\nimport type { Attachment, Updatable } from '@wordpress/core-data';\n\nconst altTextField: Partial< Field< Updatable< Attachment > > > = {\n\tid: 'alt_text',\n\ttype: 'text',\n\tlabel: __( 'Alt text' ),\n\tisVisible: ( item ) => item?.media_type === 'image',\n\trender: ( { item } ) => item?.alt_text || '-',\n\tEdit: ( { field, onChange, data } ) => {\n\t\treturn (\n\t\t\t<WCTextareaControl\n\t\t\t\tlabel={ field.label }\n\t\t\t\tvalue={ data.alt_text || '' }\n\t\t\t\tonChange={ ( value ) => onChange( { alt_text: value } ) }\n\t\t\t\thelp={\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\topenInNewTab\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Describe the purpose of the image.' ) }\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{ __( 'Leave empty if decorative.' ) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\trows={ 2 }\n\t\t\t/>\n\t\t);\n\t},\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\nexport default altTextField;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,wBAAqD;AACrD,gBAAqB;AAiBhB;AAbL,IAAM,eAA4D;AAAA,EACjE,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,WAAO,gBAAI,UAAW;AAAA,EACtB,WAAW,CAAE,SAAU,MAAM,eAAe;AAAA,EAC5C,QAAQ,CAAE,EAAE,KAAK,MAAO,MAAM,YAAY;AAAA,EAC1C,MAAM,CAAE,EAAE,OAAO,UAAU,KAAK,MAAO;AACtC,WACC;AAAA,MAAC,kBAAAA;AAAA,MAAA;AAAA,QACA,OAAQ,MAAM;AAAA,QACd,OAAQ,KAAK,YAAY;AAAA,QACzB,UAAW,CAAE,UAAW,SAAU,EAAE,UAAU,MAAM,CAAE;AAAA,QACtD,MACC,4EACC;AAAA;AAAA,YAAC;AAAA;AAAA,cACA;AAAA;AAAA,oBAEC;AAAA,kBACC;AAAA,gBACD;AAAA;AAAA,cAED,cAAY;AAAA,cAEV,8BAAI,oCAAqC;AAAA;AAAA,UAC5C;AAAA,UACA,4CAAC,QAAG;AAAA,cACF,gBAAI,4BAA6B;AAAA,WACpC;AAAA,QAED,MAAO;AAAA;AAAA,IACR;AAAA,EAEF;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AACX;AAEA,IAAO,mBAAQ;",
6
+ "names": ["WCTextareaControl"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/attached_to/edit.tsx"],
4
- "sourcesContent": ["import {\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { ComboboxControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useDebounce, useEvent } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport type { DataFormControlProps } from '@wordpress/dataviews';\nimport type { MediaItem } from '../types';\nimport { getRenderedContent } from '../utils/get-rendered-content';\n\nexport type SearchResult = {\n\t/**\n\t * Post or term id.\n\t */\n\tid: number;\n\t/**\n\t * Link url.\n\t */\n\turl: string;\n\t/**\n\t * Title of the link.\n\t */\n\ttitle: string;\n\t/**\n\t * The taxonomy or post type slug or type URL.\n\t */\n\ttype: string;\n\t/**\n\t * Link kind of post-type or taxonomy\n\t */\n\tkind?: string;\n};\n\nexport default function MediaAttachedToEdit( {\n\tdata,\n\tonChange,\n}: DataFormControlProps< MediaItem > ) {\n\tconst defaultPost =\n\t\t!! data.post && !! data?._embedded?.[ 'wp:attached-to' ]?.[ 0 ]\n\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: getRenderedContent(\n\t\t\t\t\t\t\tdata._embedded?.[ 'wp:attached-to' ]?.[ 0 ]?.title\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: data.post.toString(),\n\t\t\t\t\t},\n\t\t\t ]\n\t\t\t: [];\n\tconst [ options, setOptions ] =\n\t\tuseState< { label: string; value: string }[] >( defaultPost );\n\tconst [ searchResults, setSearchResults ] = useState< SearchResult[] >(\n\t\t[]\n\t);\n\tconst [ isLoading, setIsLoading ] = useState( false );\n\tconst [ value, setValue ] = useState< string | null >(\n\t\tdata?.post?.toString() ?? null\n\t);\n\n\tconst postTypes = useSelect(\n\t\t( select ) => select( coreStore ).getPostTypes(),\n\t\t[]\n\t);\n\tconst handleDetach = () => {\n\t\tonChange( {\n\t\t\tpost: 0,\n\t\t\t_embedded: { ...data?._embedded, 'wp:attached-to': undefined },\n\t\t} );\n\t\tsetValue( null );\n\t};\n\n\tconst onValueChange = async ( filterValue: string ) => {\n\t\tsetIsLoading( true );\n\t\tconst results = await fetchLinkSuggestions(\n\t\t\tfilterValue,\n\t\t\t/*\n\t\t\t * @TODO `fetchLinkSuggestions()` should accept `perPage` as an option argument.\n\t\t\t * `isInitialSuggestions` limits the result to 3, otherwise it's hardcoded to 20.\n\t\t\t */\n\t\t\t{ type: 'post', isInitialSuggestions: true },\n\t\t\t{}\n\t\t);\n\t\tsetSearchResults( results );\n\t\tconst suggestions = results.map( ( result ) => {\n\t\t\treturn {\n\t\t\t\tlabel: result.title,\n\t\t\t\tvalue: result.id.toString(),\n\t\t\t};\n\t\t} );\n\t\tconst includeCurrent =\n\t\t\t! filterValue &&\n\t\t\tsuggestions.findIndex( ( s ) => s.value === value ) === -1;\n\t\tsetOptions( suggestions.concat( includeCurrent ? defaultPost : [] ) );\n\t\tsetIsLoading( false );\n\t};\n\n\t// `onValueChange` closes over state, so it's wrapped in `useEvent` to give\n\t// `useDebounce` a stable function. Debouncing an inline function instead\n\t// rebuilds the timer on every render, so nothing is debounced and each\n\t// keystroke fires its own request.\n\tconst debouncedValueChange = useDebounce( useEvent( onValueChange ), 300 );\n\n\t/**\n\t * Handle selection.\n\t *\n\t * @param {Object} selectedPostId The selected post id.\n\t */\n\tconst handleSelectOption = (\n\t\tselectedPostId: string | null | undefined\n\t) => {\n\t\tif ( ! selectedPostId ) {\n\t\t\thandleDetach();\n\t\t\treturn;\n\t\t}\n\t\tsetValue( selectedPostId );\n\t\tif ( selectedPostId ) {\n\t\t\tconst selectedPost = searchResults.find(\n\t\t\t\t( result ) => result.id === Number( selectedPostId )\n\t\t\t);\n\t\t\t// Although unlikely, it's technically possible for selectedPost to not be found.\n\t\t\t// E.g. if the user selects an option just as new search results are loaded.\n\t\t\t// TODO: Add error handling for when selectedPost is not found.\n\t\t\tif ( selectedPost && postTypes ) {\n\t\t\t\tconst postType = postTypes.find(\n\t\t\t\t\t( _postType: { slug: string } ) =>\n\t\t\t\t\t\t_postType.slug === selectedPost?.type\n\t\t\t\t);\n\n\t\t\t\tconst attachedTo = {\n\t\t\t\t\t...( postType && { type: postType.slug } ),\n\t\t\t\t\tid: Number( selectedPostId ),\n\t\t\t\t\ttitle: {\n\t\t\t\t\t\traw: selectedPost.title,\n\t\t\t\t\t\trendered: selectedPost.title,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tonChange( {\n\t\t\t\t\tpost: Number( selectedPostId ),\n\t\t\t\t\t_embedded: {\n\t\t\t\t\t\t...data?._embedded,\n\t\t\t\t\t\t'wp:attached-to': [ attachedTo ],\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t};\n\n\treturn (\n\t\t<ComboboxControl\n\t\t\tclassName=\"dataviews-media-field__attached-to\"\n\t\t\tisLoading={ isLoading }\n\t\t\tlabel={ __( 'Attached to' ) }\n\t\t\thelp={ __( 'Attach this file to a single post or page.' ) }\n\t\t\tvalue={ value }\n\t\t\toptions={ options }\n\t\t\tonFilterValueChange={ ( filterValue: unknown ) =>\n\t\t\t\tdebouncedValueChange( filterValue as string )\n\t\t\t}\n\t\t\tonChange={ handleSelectOption }\n\t\t\thideLabelFromVision\n\t\t\t// Opening the panel shouldn't imply the user has decided to change\n\t\t\t// the attachment, so wait for them to search before showing the list.\n\t\t\texpandOnFocus={ false }\n\t\t/>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAGO;AACP,wBAAgC;AAChC,kBAAmB;AACnB,qBAAyB;AACzB,qBAAsC;AACtC,kBAA0B;AAG1B,kCAAmC;AA4IjC;AAnHa,SAAR,oBAAsC;AAAA,EAC5C;AAAA,EACA;AACD,GAAuC;AACtC,QAAM,cACL,CAAC,CAAE,KAAK,QAAQ,CAAC,CAAE,MAAM,YAAa,gBAAiB,IAAK,CAAE,IAC3D;AAAA,IACA;AAAA,MACC,WAAO;AAAA,QACN,KAAK,YAAa,gBAAiB,IAAK,CAAE,GAAG;AAAA,MAC9C;AAAA,MACA,OAAO,KAAK,KAAK,SAAS;AAAA,IAC3B;AAA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,QAAK,gBAAiB;AACrB,YAAM,eAAe,cAAc;AAAA,QAClC,CAAE,WAAY,OAAO,OAAO,OAAQ,cAAe;AAAA,MACpD;AAIA,UAAK,gBAAgB,WAAY;AAChC,cAAM,WAAW,UAAU;AAAA,UAC1B,CAAE,cACD,UAAU,SAAS,cAAc;AAAA,QACnC;AAEA,cAAM,aAAa;AAAA,UAClB,GAAK,YAAY,EAAE,MAAM,SAAS,KAAK;AAAA,UACvC,IAAI,OAAQ,cAAe;AAAA,UAC3B,OAAO;AAAA,YACN,KAAK,aAAa;AAAA,YAClB,UAAU,aAAa;AAAA,UACxB;AAAA,QACD;AAEA,iBAAU;AAAA,UACT,MAAM,OAAQ,cAAe;AAAA,UAC7B,WAAW;AAAA,YACV,GAAG,MAAM;AAAA,YACT,kBAAkB,CAAE,UAAW;AAAA,UAChC;AAAA,QACD,CAAE;AAAA,MACH;AAAA,IACD;AAAA,EACD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV;AAAA,MACA,WAAQ,gBAAI,aAAc;AAAA,MAC1B,UAAO,gBAAI,4CAA6C;AAAA,MACxD;AAAA,MACA;AAAA,MACA,qBAAsB,CAAE,gBACvB,qBAAsB,WAAsB;AAAA,MAE7C,UAAW;AAAA,MACX,qBAAmB;AAAA,MAGnB,eAAgB;AAAA;AAAA,EACjB;AAEF;",
4
+ "sourcesContent": ["import {\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { ComboboxControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useDebounce, useEvent } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport type { DataFormControlProps } from '@wordpress/dataviews';\nimport type { MediaItem } from '../types';\nimport { getRenderedContent } from '../utils/get-rendered-content';\n\nexport type SearchResult = {\n\t/**\n\t * Post or term id.\n\t */\n\tid: number;\n\t/**\n\t * Link url.\n\t */\n\turl: string;\n\t/**\n\t * Title of the link.\n\t */\n\ttitle: string;\n\t/**\n\t * The taxonomy or post type slug or type URL.\n\t */\n\ttype: string;\n\t/**\n\t * Link kind of post-type or taxonomy\n\t */\n\tkind?: string;\n};\n\nexport default function MediaAttachedToEdit( {\n\tdata,\n\tonChange,\n}: DataFormControlProps< MediaItem > ) {\n\tconst defaultPost =\n\t\t!! data.post && !! data?._embedded?.[ 'wp:attached-to' ]?.[ 0 ]\n\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: getRenderedContent(\n\t\t\t\t\t\t\tdata._embedded?.[ 'wp:attached-to' ]?.[ 0 ]?.title\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: data.post.toString(),\n\t\t\t\t\t},\n\t\t\t ]\n\t\t\t: [];\n\tconst [ options, setOptions ] =\n\t\tuseState< { label: string; value: string }[] >( defaultPost );\n\tconst [ searchResults, setSearchResults ] = useState< SearchResult[] >(\n\t\t[]\n\t);\n\tconst [ isLoading, setIsLoading ] = useState( false );\n\tconst [ value, setValue ] = useState< string | null >(\n\t\tdata?.post?.toString() ?? null\n\t);\n\n\tconst postTypes = useSelect(\n\t\t( select ) => select( coreStore ).getPostTypes(),\n\t\t[]\n\t);\n\tconst handleDetach = () => {\n\t\tonChange( {\n\t\t\tpost: 0,\n\t\t\t_embedded: { ...data?._embedded, 'wp:attached-to': undefined },\n\t\t} );\n\t\tsetValue( null );\n\t};\n\n\tconst onValueChange = async ( filterValue: string ) => {\n\t\tsetIsLoading( true );\n\t\tconst results = await fetchLinkSuggestions(\n\t\t\tfilterValue,\n\t\t\t/*\n\t\t\t * @TODO `fetchLinkSuggestions()` should accept `perPage` as an option argument.\n\t\t\t * `isInitialSuggestions` limits the result to 3, otherwise it's hardcoded to 20.\n\t\t\t */\n\t\t\t{ type: 'post', isInitialSuggestions: true },\n\t\t\t{}\n\t\t);\n\t\tsetSearchResults( results );\n\t\tconst suggestions = results.map( ( result ) => {\n\t\t\treturn {\n\t\t\t\tlabel: result.title,\n\t\t\t\tvalue: result.id.toString(),\n\t\t\t};\n\t\t} );\n\t\tconst includeCurrent =\n\t\t\t! filterValue &&\n\t\t\tsuggestions.findIndex( ( s ) => s.value === value ) === -1;\n\t\tsetOptions( suggestions.concat( includeCurrent ? defaultPost : [] ) );\n\t\tsetIsLoading( false );\n\t};\n\n\t// `onValueChange` closes over state, so it's wrapped in `useEvent` to give\n\t// `useDebounce` a stable function. Debouncing an inline function instead\n\t// rebuilds the timer on every render, so nothing is debounced and each\n\t// keystroke fires its own request.\n\tconst debouncedValueChange = useDebounce( useEvent( onValueChange ), 300 );\n\n\t/**\n\t * Handle selection.\n\t *\n\t * @param {Object} selectedPostId The selected post id.\n\t */\n\tconst handleSelectOption = ( selectedPostId: string | null ) => {\n\t\tif ( ! selectedPostId ) {\n\t\t\thandleDetach();\n\t\t\treturn;\n\t\t}\n\t\tsetValue( selectedPostId );\n\t\tif ( selectedPostId ) {\n\t\t\tconst selectedPost = searchResults.find(\n\t\t\t\t( result ) => result.id === Number( selectedPostId )\n\t\t\t);\n\t\t\t// Although unlikely, it's technically possible for selectedPost to not be found.\n\t\t\t// E.g. if the user selects an option just as new search results are loaded.\n\t\t\t// TODO: Add error handling for when selectedPost is not found.\n\t\t\tif ( selectedPost && postTypes ) {\n\t\t\t\tconst postType = postTypes.find(\n\t\t\t\t\t( _postType: { slug: string } ) =>\n\t\t\t\t\t\t_postType.slug === selectedPost?.type\n\t\t\t\t);\n\n\t\t\t\tconst attachedTo = {\n\t\t\t\t\t...( postType && { type: postType.slug } ),\n\t\t\t\t\tid: Number( selectedPostId ),\n\t\t\t\t\ttitle: {\n\t\t\t\t\t\traw: selectedPost.title,\n\t\t\t\t\t\trendered: selectedPost.title,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tonChange( {\n\t\t\t\t\tpost: Number( selectedPostId ),\n\t\t\t\t\t_embedded: {\n\t\t\t\t\t\t...data?._embedded,\n\t\t\t\t\t\t'wp:attached-to': [ attachedTo ],\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t};\n\n\treturn (\n\t\t<ComboboxControl\n\t\t\tclassName=\"dataviews-media-field__attached-to\"\n\t\t\tisLoading={ isLoading }\n\t\t\tlabel={ __( 'Attached to' ) }\n\t\t\thelp={ __( 'Attach this file to a single post or page.' ) }\n\t\t\tvalue={ value }\n\t\t\toptions={ options }\n\t\t\tonFilterValueChange={ ( filterValue: unknown ) =>\n\t\t\t\tdebouncedValueChange( filterValue as string )\n\t\t\t}\n\t\t\tonChange={ handleSelectOption }\n\t\t\thideLabelFromVision\n\t\t\t// Opening the panel shouldn't imply the user has decided to change\n\t\t\t// the attachment, so wait for them to search before showing the list.\n\t\t\texpandOnFocus={ false }\n\t\t/>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAGO;AACP,wBAAgC;AAChC,kBAAmB;AACnB,qBAAyB;AACzB,qBAAsC;AACtC,kBAA0B;AAG1B,kCAAmC;AA0IjC;AAjHa,SAAR,oBAAsC;AAAA,EAC5C;AAAA,EACA;AACD,GAAuC;AACtC,QAAM,cACL,CAAC,CAAE,KAAK,QAAQ,CAAC,CAAE,MAAM,YAAa,gBAAiB,IAAK,CAAE,IAC3D;AAAA,IACA;AAAA,MACC,WAAO;AAAA,QACN,KAAK,YAAa,gBAAiB,IAAK,CAAE,GAAG;AAAA,MAC9C;AAAA,MACA,OAAO,KAAK,KAAK,SAAS;AAAA,IAC3B;AAAA,EACA,IACA,CAAC;AACL,QAAM,CAAE,SAAS,UAAW,QAC3B,yBAAgD,WAAY;AAC7D,QAAM,CAAE,eAAe,gBAAiB,QAAI;AAAA,IAC3C,CAAC;AAAA,EACF;AACA,QAAM,CAAE,WAAW,YAAa,QAAI,yBAAU,KAAM;AACpD,QAAM,CAAE,OAAO,QAAS,QAAI;AAAA,IAC3B,MAAM,MAAM,SAAS,KAAK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AM,SAAS,KAAK;AAAA,UACvC,IAAI,OAAQ,cAAe;AAAA,UAC3B,OAAO;AAAA,YACN,KAAK,aAAa;AAAA,YAClB,UAAU,aAAa;AAAA,UACxB;AAAA,QACD;AAEA,iBAAU;AAAA,UACT,MAAM,OAAQ,cAAe;AAAA,UAC7B,WAAW;AAAA,YACV,GAAG,MAAM;AAAA,YACT,kBAAkB,CAAE,UAAW;AAAA,UAChC;AAAA,QACD,CAAE;AAAA,MACH;AAAA,IACD;AAAA,EACD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV;AAAA,MACA,WAAQ,gBAAI,aAAc;AAAA,MAC1B,UAAO,gBAAI,4CAA6C;AAAA,MACxD;AAAA,MACA;AAAA,MACA,qBAAsB,CAAE,gBACvB,qBAAsB,WAAsB;AAAA,MAE7C,UAAW;AAAA,MACX,qBAAmB;AAAA,MAGnB,eAAgB;AAAA;AAAA,EACjB;AAEF;",
6
6
  "names": ["coreStore", "fetchLinkSuggestions"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/caption/index.tsx"],
4
- "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { TextareaControl } from '@wordpress/components';\nimport type { Attachment, Updatable } from '@wordpress/core-data';\nimport type { Field } from '@wordpress/dataviews';\nimport { getRawContent } from '../utils/get-raw-content';\n\nconst captionField: Partial< Field< Updatable< Attachment > > > = {\n\tid: 'caption',\n\ttype: 'text',\n\tlabel: __( 'Caption' ),\n\tgetValue: ( { item } ) => getRawContent( item?.caption ),\n\trender: ( { item } ) => getRawContent( item?.caption ) || '-',\n\tEdit: ( { field, onChange, data } ) => {\n\t\treturn (\n\t\t\t<TextareaControl\n\t\t\t\tlabel={ field.label }\n\t\t\t\tvalue={ getRawContent( data.caption ) || '' }\n\t\t\t\tonChange={ ( value ) => onChange( { caption: value } ) }\n\t\t\t\trows={ 2 }\n\t\t\t/>\n\t\t);\n\t},\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\nexport default captionField;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,wBAAgC;AAGhC,6BAA8B;AAU3B;AARH,IAAM,eAA4D;AAAA,EACjE,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,WAAO,gBAAI,SAAU;AAAA,EACrB,UAAU,CAAE,EAAE,KAAK,UAAO,sCAAe,MAAM,OAAQ;AAAA,EACvD,QAAQ,CAAE,EAAE,KAAK,UAAO,sCAAe,MAAM,OAAQ,KAAK;AAAA,EAC1D,MAAM,CAAE,EAAE,OAAO,UAAU,KAAK,MAAO;AACtC,WACC;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,MAAM;AAAA,QACd,WAAQ,sCAAe,KAAK,OAAQ,KAAK;AAAA,QACzC,UAAW,CAAE,UAAW,SAAU,EAAE,SAAS,MAAM,CAAE;AAAA,QACrD,MAAO;AAAA;AAAA,IACR;AAAA,EAEF;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AACX;AAEA,IAAO,kBAAQ;",
6
- "names": []
4
+ "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { TextareaControl as WCTextareaControl } from '@wordpress/components';\nimport type { Attachment, Updatable } from '@wordpress/core-data';\nimport type { Field } from '@wordpress/dataviews';\nimport { getRawContent } from '../utils/get-raw-content';\n\nconst captionField: Partial< Field< Updatable< Attachment > > > = {\n\tid: 'caption',\n\ttype: 'text',\n\tlabel: __( 'Caption' ),\n\tgetValue: ( { item } ) => getRawContent( item?.caption ),\n\trender: ( { item } ) => getRawContent( item?.caption ) || '-',\n\tEdit: ( { field, onChange, data } ) => {\n\t\treturn (\n\t\t\t<WCTextareaControl\n\t\t\t\tlabel={ field.label }\n\t\t\t\tvalue={ getRawContent( data.caption ) || '' }\n\t\t\t\tonChange={ ( value ) => onChange( { caption: value } ) }\n\t\t\t\trows={ 2 }\n\t\t\t/>\n\t\t);\n\t},\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\nexport default captionField;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,wBAAqD;AAGrD,6BAA8B;AAU3B;AARH,IAAM,eAA4D;AAAA,EACjE,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,WAAO,gBAAI,SAAU;AAAA,EACrB,UAAU,CAAE,EAAE,KAAK,UAAO,sCAAe,MAAM,OAAQ;AAAA,EACvD,QAAQ,CAAE,EAAE,KAAK,UAAO,sCAAe,MAAM,OAAQ,KAAK;AAAA,EAC1D,MAAM,CAAE,EAAE,OAAO,UAAU,KAAK,MAAO;AACtC,WACC;AAAA,MAAC,kBAAAA;AAAA,MAAA;AAAA,QACA,OAAQ,MAAM;AAAA,QACd,WAAQ,sCAAe,KAAK,OAAQ,KAAK;AAAA,QACzC,UAAW,CAAE,UAAW,SAAU,EAAE,SAAS,MAAM,CAAE;AAAA,QACrD,MAAO;AAAA;AAAA,IACR;AAAA,EAEF;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AACX;AAEA,IAAO,kBAAQ;",
6
+ "names": ["WCTextareaControl"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/description/index.tsx"],
4
- "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { TextareaControl } from '@wordpress/components';\nimport type { Attachment, Updatable } from '@wordpress/core-data';\nimport type { Field } from '@wordpress/dataviews';\nimport { getRawContent } from '../utils/get-raw-content';\n\nconst descriptionField: Partial< Field< Updatable< Attachment > > > = {\n\tid: 'description',\n\ttype: 'text',\n\tlabel: __( 'Description' ),\n\tgetValue: ( { item } ) => getRawContent( item?.description ),\n\trender: ( { item } ) => (\n\t\t<div>{ getRawContent( item?.description ) || '-' }</div>\n\t),\n\tEdit: ( { field, onChange, data } ) => {\n\t\treturn (\n\t\t\t<TextareaControl\n\t\t\t\tlabel={ field.label }\n\t\t\t\tvalue={ getRawContent( data.description ) || '' }\n\t\t\t\tonChange={ ( value ) => onChange( { description: value } ) }\n\t\t\t\trows={ 5 }\n\t\t\t/>\n\t\t);\n\t},\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\nexport default descriptionField;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,wBAAgC;AAGhC,6BAA8B;AAQ5B;AANF,IAAM,mBAAgE;AAAA,EACrE,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,WAAO,gBAAI,aAAc;AAAA,EACzB,UAAU,CAAE,EAAE,KAAK,UAAO,sCAAe,MAAM,WAAY;AAAA,EAC3D,QAAQ,CAAE,EAAE,KAAK,MAChB,4CAAC,SAAM,oDAAe,MAAM,WAAY,KAAK,KAAK;AAAA,EAEnD,MAAM,CAAE,EAAE,OAAO,UAAU,KAAK,MAAO;AACtC,WACC;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,MAAM;AAAA,QACd,WAAQ,sCAAe,KAAK,WAAY,KAAK;AAAA,QAC7C,UAAW,CAAE,UAAW,SAAU,EAAE,aAAa,MAAM,CAAE;AAAA,QACzD,MAAO;AAAA;AAAA,IACR;AAAA,EAEF;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AACX;AAEA,IAAO,sBAAQ;",
6
- "names": []
4
+ "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { TextareaControl as WCTextareaControl } from '@wordpress/components';\nimport type { Attachment, Updatable } from '@wordpress/core-data';\nimport type { Field } from '@wordpress/dataviews';\nimport { getRawContent } from '../utils/get-raw-content';\n\nconst descriptionField: Partial< Field< Updatable< Attachment > > > = {\n\tid: 'description',\n\ttype: 'text',\n\tlabel: __( 'Description' ),\n\tgetValue: ( { item } ) => getRawContent( item?.description ),\n\trender: ( { item } ) => (\n\t\t<div>{ getRawContent( item?.description ) || '-' }</div>\n\t),\n\tEdit: ( { field, onChange, data } ) => {\n\t\treturn (\n\t\t\t<WCTextareaControl\n\t\t\t\tlabel={ field.label }\n\t\t\t\tvalue={ getRawContent( data.description ) || '' }\n\t\t\t\tonChange={ ( value ) => onChange( { description: value } ) }\n\t\t\t\trows={ 5 }\n\t\t\t/>\n\t\t);\n\t},\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\nexport default descriptionField;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,wBAAqD;AAGrD,6BAA8B;AAQ5B;AANF,IAAM,mBAAgE;AAAA,EACrE,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,WAAO,gBAAI,aAAc;AAAA,EACzB,UAAU,CAAE,EAAE,KAAK,UAAO,sCAAe,MAAM,WAAY;AAAA,EAC3D,QAAQ,CAAE,EAAE,KAAK,MAChB,4CAAC,SAAM,oDAAe,MAAM,WAAY,KAAK,KAAK;AAAA,EAEnD,MAAM,CAAE,EAAE,OAAO,UAAU,KAAK,MAAO;AACtC,WACC;AAAA,MAAC,kBAAAA;AAAA,MAAA;AAAA,QACA,OAAQ,MAAM;AAAA,QACd,WAAQ,sCAAe,KAAK,WAAY,KAAK;AAAA,QAC7C,UAAW,CAAE,UAAW,SAAU,EAAE,aAAa,MAAM,CAAE;AAAA,QACzD,MAAO;AAAA;AAAA,IACR;AAAA,EAEF;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AACX;AAEA,IAAO,sBAAQ;",
6
+ "names": ["WCTextareaControl"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  // packages/media-fields/src/alt_text/index.tsx
2
2
  import { __ } from "@wordpress/i18n";
3
- import { TextareaControl } from "@wordpress/components";
3
+ import { TextareaControl as WCTextareaControl } from "@wordpress/components";
4
4
  import { Link } from "@wordpress/ui";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  var altTextField = {
@@ -11,7 +11,7 @@ var altTextField = {
11
11
  render: ({ item }) => item?.alt_text || "-",
12
12
  Edit: ({ field, onChange, data }) => {
13
13
  return /* @__PURE__ */ jsx(
14
- TextareaControl,
14
+ WCTextareaControl,
15
15
  {
16
16
  label: field.label,
17
17
  value: data.alt_text || "",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/alt_text/index.tsx"],
4
- "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { TextareaControl } from '@wordpress/components';\nimport { Link } from '@wordpress/ui';\nimport type { Field } from '@wordpress/dataviews';\nimport type { Attachment, Updatable } from '@wordpress/core-data';\n\nconst altTextField: Partial< Field< Updatable< Attachment > > > = {\n\tid: 'alt_text',\n\ttype: 'text',\n\tlabel: __( 'Alt text' ),\n\tisVisible: ( item ) => item?.media_type === 'image',\n\trender: ( { item } ) => item?.alt_text || '-',\n\tEdit: ( { field, onChange, data } ) => {\n\t\treturn (\n\t\t\t<TextareaControl\n\t\t\t\tlabel={ field.label }\n\t\t\t\tvalue={ data.alt_text || '' }\n\t\t\t\tonChange={ ( value ) => onChange( { alt_text: value } ) }\n\t\t\t\thelp={\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\topenInNewTab\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Describe the purpose of the image.' ) }\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{ __( 'Leave empty if decorative.' ) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\trows={ 2 }\n\t\t\t/>\n\t\t);\n\t},\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\nexport default altTextField;\n"],
5
- "mappings": ";AAAA,SAAS,UAAU;AACnB,SAAS,uBAAuB;AAChC,SAAS,YAAY;AAiBhB,mBACC,KADD;AAbL,IAAM,eAA4D;AAAA,EACjE,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,OAAO,GAAI,UAAW;AAAA,EACtB,WAAW,CAAE,SAAU,MAAM,eAAe;AAAA,EAC5C,QAAQ,CAAE,EAAE,KAAK,MAAO,MAAM,YAAY;AAAA,EAC1C,MAAM,CAAE,EAAE,OAAO,UAAU,KAAK,MAAO;AACtC,WACC;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,MAAM;AAAA,QACd,OAAQ,KAAK,YAAY;AAAA,QACzB,UAAW,CAAE,UAAW,SAAU,EAAE,UAAU,MAAM,CAAE;AAAA,QACtD,MACC,iCACC;AAAA;AAAA,YAAC;AAAA;AAAA,cACA;AAAA;AAAA,gBAEC;AAAA,kBACC;AAAA,gBACD;AAAA;AAAA,cAED,cAAY;AAAA,cAEV,aAAI,oCAAqC;AAAA;AAAA,UAC5C;AAAA,UACA,oBAAC,QAAG;AAAA,UACF,GAAI,4BAA6B;AAAA,WACpC;AAAA,QAED,MAAO;AAAA;AAAA,IACR;AAAA,EAEF;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AACX;AAEA,IAAO,mBAAQ;",
4
+ "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { TextareaControl as WCTextareaControl } from '@wordpress/components';\nimport { Link } from '@wordpress/ui';\nimport type { Field } from '@wordpress/dataviews';\nimport type { Attachment, Updatable } from '@wordpress/core-data';\n\nconst altTextField: Partial< Field< Updatable< Attachment > > > = {\n\tid: 'alt_text',\n\ttype: 'text',\n\tlabel: __( 'Alt text' ),\n\tisVisible: ( item ) => item?.media_type === 'image',\n\trender: ( { item } ) => item?.alt_text || '-',\n\tEdit: ( { field, onChange, data } ) => {\n\t\treturn (\n\t\t\t<WCTextareaControl\n\t\t\t\tlabel={ field.label }\n\t\t\t\tvalue={ data.alt_text || '' }\n\t\t\t\tonChange={ ( value ) => onChange( { alt_text: value } ) }\n\t\t\t\thelp={\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\topenInNewTab\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Describe the purpose of the image.' ) }\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{ __( 'Leave empty if decorative.' ) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\trows={ 2 }\n\t\t\t/>\n\t\t);\n\t},\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\nexport default altTextField;\n"],
5
+ "mappings": ";AAAA,SAAS,UAAU;AACnB,SAAS,mBAAmB,yBAAyB;AACrD,SAAS,YAAY;AAiBhB,mBACC,KADD;AAbL,IAAM,eAA4D;AAAA,EACjE,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,OAAO,GAAI,UAAW;AAAA,EACtB,WAAW,CAAE,SAAU,MAAM,eAAe;AAAA,EAC5C,QAAQ,CAAE,EAAE,KAAK,MAAO,MAAM,YAAY;AAAA,EAC1C,MAAM,CAAE,EAAE,OAAO,UAAU,KAAK,MAAO;AACtC,WACC;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,MAAM;AAAA,QACd,OAAQ,KAAK,YAAY;AAAA,QACzB,UAAW,CAAE,UAAW,SAAU,EAAE,UAAU,MAAM,CAAE;AAAA,QACtD,MACC,iCACC;AAAA;AAAA,YAAC;AAAA;AAAA,cACA;AAAA;AAAA,gBAEC;AAAA,kBACC;AAAA,gBACD;AAAA;AAAA,cAED,cAAY;AAAA,cAEV,aAAI,oCAAqC;AAAA;AAAA,UAC5C;AAAA,UACA,oBAAC,QAAG;AAAA,UACF,GAAI,4BAA6B;AAAA,WACpC;AAAA,QAED,MAAO;AAAA;AAAA,IACR;AAAA,EAEF;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AACX;AAEA,IAAO,mBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/attached_to/edit.tsx"],
4
- "sourcesContent": ["import {\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { ComboboxControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useDebounce, useEvent } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport type { DataFormControlProps } from '@wordpress/dataviews';\nimport type { MediaItem } from '../types';\nimport { getRenderedContent } from '../utils/get-rendered-content';\n\nexport type SearchResult = {\n\t/**\n\t * Post or term id.\n\t */\n\tid: number;\n\t/**\n\t * Link url.\n\t */\n\turl: string;\n\t/**\n\t * Title of the link.\n\t */\n\ttitle: string;\n\t/**\n\t * The taxonomy or post type slug or type URL.\n\t */\n\ttype: string;\n\t/**\n\t * Link kind of post-type or taxonomy\n\t */\n\tkind?: string;\n};\n\nexport default function MediaAttachedToEdit( {\n\tdata,\n\tonChange,\n}: DataFormControlProps< MediaItem > ) {\n\tconst defaultPost =\n\t\t!! data.post && !! data?._embedded?.[ 'wp:attached-to' ]?.[ 0 ]\n\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: getRenderedContent(\n\t\t\t\t\t\t\tdata._embedded?.[ 'wp:attached-to' ]?.[ 0 ]?.title\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: data.post.toString(),\n\t\t\t\t\t},\n\t\t\t ]\n\t\t\t: [];\n\tconst [ options, setOptions ] =\n\t\tuseState< { label: string; value: string }[] >( defaultPost );\n\tconst [ searchResults, setSearchResults ] = useState< SearchResult[] >(\n\t\t[]\n\t);\n\tconst [ isLoading, setIsLoading ] = useState( false );\n\tconst [ value, setValue ] = useState< string | null >(\n\t\tdata?.post?.toString() ?? null\n\t);\n\n\tconst postTypes = useSelect(\n\t\t( select ) => select( coreStore ).getPostTypes(),\n\t\t[]\n\t);\n\tconst handleDetach = () => {\n\t\tonChange( {\n\t\t\tpost: 0,\n\t\t\t_embedded: { ...data?._embedded, 'wp:attached-to': undefined },\n\t\t} );\n\t\tsetValue( null );\n\t};\n\n\tconst onValueChange = async ( filterValue: string ) => {\n\t\tsetIsLoading( true );\n\t\tconst results = await fetchLinkSuggestions(\n\t\t\tfilterValue,\n\t\t\t/*\n\t\t\t * @TODO `fetchLinkSuggestions()` should accept `perPage` as an option argument.\n\t\t\t * `isInitialSuggestions` limits the result to 3, otherwise it's hardcoded to 20.\n\t\t\t */\n\t\t\t{ type: 'post', isInitialSuggestions: true },\n\t\t\t{}\n\t\t);\n\t\tsetSearchResults( results );\n\t\tconst suggestions = results.map( ( result ) => {\n\t\t\treturn {\n\t\t\t\tlabel: result.title,\n\t\t\t\tvalue: result.id.toString(),\n\t\t\t};\n\t\t} );\n\t\tconst includeCurrent =\n\t\t\t! filterValue &&\n\t\t\tsuggestions.findIndex( ( s ) => s.value === value ) === -1;\n\t\tsetOptions( suggestions.concat( includeCurrent ? defaultPost : [] ) );\n\t\tsetIsLoading( false );\n\t};\n\n\t// `onValueChange` closes over state, so it's wrapped in `useEvent` to give\n\t// `useDebounce` a stable function. Debouncing an inline function instead\n\t// rebuilds the timer on every render, so nothing is debounced and each\n\t// keystroke fires its own request.\n\tconst debouncedValueChange = useDebounce( useEvent( onValueChange ), 300 );\n\n\t/**\n\t * Handle selection.\n\t *\n\t * @param {Object} selectedPostId The selected post id.\n\t */\n\tconst handleSelectOption = (\n\t\tselectedPostId: string | null | undefined\n\t) => {\n\t\tif ( ! selectedPostId ) {\n\t\t\thandleDetach();\n\t\t\treturn;\n\t\t}\n\t\tsetValue( selectedPostId );\n\t\tif ( selectedPostId ) {\n\t\t\tconst selectedPost = searchResults.find(\n\t\t\t\t( result ) => result.id === Number( selectedPostId )\n\t\t\t);\n\t\t\t// Although unlikely, it's technically possible for selectedPost to not be found.\n\t\t\t// E.g. if the user selects an option just as new search results are loaded.\n\t\t\t// TODO: Add error handling for when selectedPost is not found.\n\t\t\tif ( selectedPost && postTypes ) {\n\t\t\t\tconst postType = postTypes.find(\n\t\t\t\t\t( _postType: { slug: string } ) =>\n\t\t\t\t\t\t_postType.slug === selectedPost?.type\n\t\t\t\t);\n\n\t\t\t\tconst attachedTo = {\n\t\t\t\t\t...( postType && { type: postType.slug } ),\n\t\t\t\t\tid: Number( selectedPostId ),\n\t\t\t\t\ttitle: {\n\t\t\t\t\t\traw: selectedPost.title,\n\t\t\t\t\t\trendered: selectedPost.title,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tonChange( {\n\t\t\t\t\tpost: Number( selectedPostId ),\n\t\t\t\t\t_embedded: {\n\t\t\t\t\t\t...data?._embedded,\n\t\t\t\t\t\t'wp:attached-to': [ attachedTo ],\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t};\n\n\treturn (\n\t\t<ComboboxControl\n\t\t\tclassName=\"dataviews-media-field__attached-to\"\n\t\t\tisLoading={ isLoading }\n\t\t\tlabel={ __( 'Attached to' ) }\n\t\t\thelp={ __( 'Attach this file to a single post or page.' ) }\n\t\t\tvalue={ value }\n\t\t\toptions={ options }\n\t\t\tonFilterValueChange={ ( filterValue: unknown ) =>\n\t\t\t\tdebouncedValueChange( filterValue as string )\n\t\t\t}\n\t\t\tonChange={ handleSelectOption }\n\t\t\thideLabelFromVision\n\t\t\t// Opening the panel shouldn't imply the user has decided to change\n\t\t\t// the attachment, so wait for them to search before showing the list.\n\t\t\texpandOnFocus={ false }\n\t\t/>\n\t);\n}\n"],
5
- "mappings": ";AA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UAAW;AAAA,MACX,qBAAmB;AAAA,MAGnB,eAAgB;AAAA;AAAA,EACjB;AAEF;",
4
+ "sourcesContent": ["import {\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { ComboboxControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useDebounce, useEvent } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport type { DataFormControlProps } from '@wordpress/dataviews';\nimport type { MediaItem } from '../types';\nimport { getRenderedContent } from '../utils/get-rendered-content';\n\nexport type SearchResult = {\n\t/**\n\t * Post or term id.\n\t */\n\tid: number;\n\t/**\n\t * Link url.\n\t */\n\turl: string;\n\t/**\n\t * Title of the link.\n\t */\n\ttitle: string;\n\t/**\n\t * The taxonomy or post type slug or type URL.\n\t */\n\ttype: string;\n\t/**\n\t * Link kind of post-type or taxonomy\n\t */\n\tkind?: string;\n};\n\nexport default function MediaAttachedToEdit( {\n\tdata,\n\tonChange,\n}: DataFormControlProps< MediaItem > ) {\n\tconst defaultPost =\n\t\t!! data.post && !! data?._embedded?.[ 'wp:attached-to' ]?.[ 0 ]\n\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: getRenderedContent(\n\t\t\t\t\t\t\tdata._embedded?.[ 'wp:attached-to' ]?.[ 0 ]?.title\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: data.post.toString(),\n\t\t\t\t\t},\n\t\t\t ]\n\t\t\t: [];\n\tconst [ options, setOptions ] =\n\t\tuseState< { label: string; value: string }[] >( defaultPost );\n\tconst [ searchResults, setSearchResults ] = useState< SearchResult[] >(\n\t\t[]\n\t);\n\tconst [ isLoading, setIsLoading ] = useState( false );\n\tconst [ value, setValue ] = useState< string | null >(\n\t\tdata?.post?.toString() ?? null\n\t);\n\n\tconst postTypes = useSelect(\n\t\t( select ) => select( coreStore ).getPostTypes(),\n\t\t[]\n\t);\n\tconst handleDetach = () => {\n\t\tonChange( {\n\t\t\tpost: 0,\n\t\t\t_embedded: { ...data?._embedded, 'wp:attached-to': undefined },\n\t\t} );\n\t\tsetValue( null );\n\t};\n\n\tconst onValueChange = async ( filterValue: string ) => {\n\t\tsetIsLoading( true );\n\t\tconst results = await fetchLinkSuggestions(\n\t\t\tfilterValue,\n\t\t\t/*\n\t\t\t * @TODO `fetchLinkSuggestions()` should accept `perPage` as an option argument.\n\t\t\t * `isInitialSuggestions` limits the result to 3, otherwise it's hardcoded to 20.\n\t\t\t */\n\t\t\t{ type: 'post', isInitialSuggestions: true },\n\t\t\t{}\n\t\t);\n\t\tsetSearchResults( results );\n\t\tconst suggestions = results.map( ( result ) => {\n\t\t\treturn {\n\t\t\t\tlabel: result.title,\n\t\t\t\tvalue: result.id.toString(),\n\t\t\t};\n\t\t} );\n\t\tconst includeCurrent =\n\t\t\t! filterValue &&\n\t\t\tsuggestions.findIndex( ( s ) => s.value === value ) === -1;\n\t\tsetOptions( suggestions.concat( includeCurrent ? defaultPost : [] ) );\n\t\tsetIsLoading( false );\n\t};\n\n\t// `onValueChange` closes over state, so it's wrapped in `useEvent` to give\n\t// `useDebounce` a stable function. Debouncing an inline function instead\n\t// rebuilds the timer on every render, so nothing is debounced and each\n\t// keystroke fires its own request.\n\tconst debouncedValueChange = useDebounce( useEvent( onValueChange ), 300 );\n\n\t/**\n\t * Handle selection.\n\t *\n\t * @param {Object} selectedPostId The selected post id.\n\t */\n\tconst handleSelectOption = ( selectedPostId: string | null ) => {\n\t\tif ( ! selectedPostId ) {\n\t\t\thandleDetach();\n\t\t\treturn;\n\t\t}\n\t\tsetValue( selectedPostId );\n\t\tif ( selectedPostId ) {\n\t\t\tconst selectedPost = searchResults.find(\n\t\t\t\t( result ) => result.id === Number( selectedPostId )\n\t\t\t);\n\t\t\t// Although unlikely, it's technically possible for selectedPost to not be found.\n\t\t\t// E.g. if the user selects an option just as new search results are loaded.\n\t\t\t// TODO: Add error handling for when selectedPost is not found.\n\t\t\tif ( selectedPost && postTypes ) {\n\t\t\t\tconst postType = postTypes.find(\n\t\t\t\t\t( _postType: { slug: string } ) =>\n\t\t\t\t\t\t_postType.slug === selectedPost?.type\n\t\t\t\t);\n\n\t\t\t\tconst attachedTo = {\n\t\t\t\t\t...( postType && { type: postType.slug } ),\n\t\t\t\t\tid: Number( selectedPostId ),\n\t\t\t\t\ttitle: {\n\t\t\t\t\t\traw: selectedPost.title,\n\t\t\t\t\t\trendered: selectedPost.title,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tonChange( {\n\t\t\t\t\tpost: Number( selectedPostId ),\n\t\t\t\t\t_embedded: {\n\t\t\t\t\t\t...data?._embedded,\n\t\t\t\t\t\t'wp:attached-to': [ attachedTo ],\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t};\n\n\treturn (\n\t\t<ComboboxControl\n\t\t\tclassName=\"dataviews-media-field__attached-to\"\n\t\t\tisLoading={ isLoading }\n\t\t\tlabel={ __( 'Attached to' ) }\n\t\t\thelp={ __( 'Attach this file to a single post or page.' ) }\n\t\t\tvalue={ value }\n\t\t\toptions={ options }\n\t\t\tonFilterValueChange={ ( filterValue: unknown ) =>\n\t\t\t\tdebouncedValueChange( filterValue as string )\n\t\t\t}\n\t\t\tonChange={ handleSelectOption }\n\t\t\thideLabelFromVision\n\t\t\t// Opening the panel shouldn't imply the user has decided to change\n\t\t\t// the attachment, so wait for them to search before showing the list.\n\t\t\texpandOnFocus={ false }\n\t\t/>\n\t);\n}\n"],
5
+ "mappings": ";AAAA;AAAA,EACC,sCAAsC;AAAA,EACtC,SAAS;AAAA,OACH;AACP,SAAS,uBAAuB;AAChC,SAAS,UAAU;AACnB,SAAS,gBAAgB;AACzB,SAAS,aAAa,gBAAgB;AACtC,SAAS,iBAAiB;AAG1B,SAAS,0BAA0B;AA0IjC;AAjHa,SAAR,oBAAsC;AAAA,EAC5C;AAAA,EACA;AACD,GAAuC;AACtC,QAAM,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,CAAE;AACpE,iBAAc,KAAM;AAAA,EACrB;AAMA,QAAM,uBAAuB,YAAa,SAAU,aAAc,GAAG,GAAI;AAOzE,QAAM,qBAAqB,CAAE,mBAAmC;AAC/D,QAAK,CAAE,gBAAiB;AACvB,mBAAa;AACb;AAAA,IACD;AACA,aAAU,cAAe;AACzB,QAAK,gBAAiB;AACrB,YAAM,eAAe,cAAc;AAAA,QAClC,CAAE,WAAY,OAAO,OAAO,OAAQ,cAAe;AAAA,MACpD;AAIA,UAAK,gBAAgB,WAAY;AAChC,cAAM,WAAW,UAAU;AAAA,UAC1B,CAAE,cACD,UAAU,SAAS,cAAc;AAAA,QACnC;AAEA,cAAM,aAAa;AAAA,UAClB,GAAK,YAAY,EAAE,MAAM,SAAS,KAAK;AAAA,UACvC,IAAI,OAAQ,cAAe;AAAA,UAC3B,OAAO;AAAA,YACN,KAAK,aAAa;AAAA,YAClB,UAAU,aAAa;AAAA,UACxB;AAAA,QACD;AAEA,iBAAU;AAAA,UACT,MAAM,OAAQ,cAAe;AAAA,UAC7B,WAAW;AAAA,YACV,GAAG,MAAM;AAAA,YACT,kBAAkB,CAAE,UAAW;AAAA,UAChC;AAAA,QACD,CAAE;AAAA,MACH;AAAA,IACD;AAAA,EACD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV;AAAA,MACA,OAAQ,GAAI,aAAc;AAAA,MAC1B,MAAO,GAAI,4CAA6C;AAAA,MACxD;AAAA,MACA;AAAA,MACA,qBAAsB,CAAE,gBACvB,qBAAsB,WAAsB;AAAA,MAE7C,UAAW;AAAA,MACX,qBAAmB;AAAA,MAGnB,eAAgB;AAAA;AAAA,EACjB;AAEF;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  // packages/media-fields/src/caption/index.tsx
2
2
  import { __ } from "@wordpress/i18n";
3
- import { TextareaControl } from "@wordpress/components";
3
+ import { TextareaControl as WCTextareaControl } from "@wordpress/components";
4
4
  import { getRawContent } from "../utils/get-raw-content.mjs";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  var captionField = {
@@ -11,7 +11,7 @@ var captionField = {
11
11
  render: ({ item }) => getRawContent(item?.caption) || "-",
12
12
  Edit: ({ field, onChange, data }) => {
13
13
  return /* @__PURE__ */ jsx(
14
- TextareaControl,
14
+ WCTextareaControl,
15
15
  {
16
16
  label: field.label,
17
17
  value: getRawContent(data.caption) || "",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/caption/index.tsx"],
4
- "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { TextareaControl } from '@wordpress/components';\nimport type { Attachment, Updatable } from '@wordpress/core-data';\nimport type { Field } from '@wordpress/dataviews';\nimport { getRawContent } from '../utils/get-raw-content';\n\nconst captionField: Partial< Field< Updatable< Attachment > > > = {\n\tid: 'caption',\n\ttype: 'text',\n\tlabel: __( 'Caption' ),\n\tgetValue: ( { item } ) => getRawContent( item?.caption ),\n\trender: ( { item } ) => getRawContent( item?.caption ) || '-',\n\tEdit: ( { field, onChange, data } ) => {\n\t\treturn (\n\t\t\t<TextareaControl\n\t\t\t\tlabel={ field.label }\n\t\t\t\tvalue={ getRawContent( data.caption ) || '' }\n\t\t\t\tonChange={ ( value ) => onChange( { caption: value } ) }\n\t\t\t\trows={ 2 }\n\t\t\t/>\n\t\t);\n\t},\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\nexport default captionField;\n"],
5
- "mappings": ";AAAA,SAAS,UAAU;AACnB,SAAS,uBAAuB;AAGhC,SAAS,qBAAqB;AAU3B;AARH,IAAM,eAA4D;AAAA,EACjE,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,OAAO,GAAI,SAAU;AAAA,EACrB,UAAU,CAAE,EAAE,KAAK,MAAO,cAAe,MAAM,OAAQ;AAAA,EACvD,QAAQ,CAAE,EAAE,KAAK,MAAO,cAAe,MAAM,OAAQ,KAAK;AAAA,EAC1D,MAAM,CAAE,EAAE,OAAO,UAAU,KAAK,MAAO;AACtC,WACC;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,MAAM;AAAA,QACd,OAAQ,cAAe,KAAK,OAAQ,KAAK;AAAA,QACzC,UAAW,CAAE,UAAW,SAAU,EAAE,SAAS,MAAM,CAAE;AAAA,QACrD,MAAO;AAAA;AAAA,IACR;AAAA,EAEF;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AACX;AAEA,IAAO,kBAAQ;",
4
+ "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { TextareaControl as WCTextareaControl } from '@wordpress/components';\nimport type { Attachment, Updatable } from '@wordpress/core-data';\nimport type { Field } from '@wordpress/dataviews';\nimport { getRawContent } from '../utils/get-raw-content';\n\nconst captionField: Partial< Field< Updatable< Attachment > > > = {\n\tid: 'caption',\n\ttype: 'text',\n\tlabel: __( 'Caption' ),\n\tgetValue: ( { item } ) => getRawContent( item?.caption ),\n\trender: ( { item } ) => getRawContent( item?.caption ) || '-',\n\tEdit: ( { field, onChange, data } ) => {\n\t\treturn (\n\t\t\t<WCTextareaControl\n\t\t\t\tlabel={ field.label }\n\t\t\t\tvalue={ getRawContent( data.caption ) || '' }\n\t\t\t\tonChange={ ( value ) => onChange( { caption: value } ) }\n\t\t\t\trows={ 2 }\n\t\t\t/>\n\t\t);\n\t},\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\nexport default captionField;\n"],
5
+ "mappings": ";AAAA,SAAS,UAAU;AACnB,SAAS,mBAAmB,yBAAyB;AAGrD,SAAS,qBAAqB;AAU3B;AARH,IAAM,eAA4D;AAAA,EACjE,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,OAAO,GAAI,SAAU;AAAA,EACrB,UAAU,CAAE,EAAE,KAAK,MAAO,cAAe,MAAM,OAAQ;AAAA,EACvD,QAAQ,CAAE,EAAE,KAAK,MAAO,cAAe,MAAM,OAAQ,KAAK;AAAA,EAC1D,MAAM,CAAE,EAAE,OAAO,UAAU,KAAK,MAAO;AACtC,WACC;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,MAAM;AAAA,QACd,OAAQ,cAAe,KAAK,OAAQ,KAAK;AAAA,QACzC,UAAW,CAAE,UAAW,SAAU,EAAE,SAAS,MAAM,CAAE;AAAA,QACrD,MAAO;AAAA;AAAA,IACR;AAAA,EAEF;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AACX;AAEA,IAAO,kBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  // packages/media-fields/src/description/index.tsx
2
2
  import { __ } from "@wordpress/i18n";
3
- import { TextareaControl } from "@wordpress/components";
3
+ import { TextareaControl as WCTextareaControl } from "@wordpress/components";
4
4
  import { getRawContent } from "../utils/get-raw-content.mjs";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  var descriptionField = {
@@ -11,7 +11,7 @@ var descriptionField = {
11
11
  render: ({ item }) => /* @__PURE__ */ jsx("div", { children: getRawContent(item?.description) || "-" }),
12
12
  Edit: ({ field, onChange, data }) => {
13
13
  return /* @__PURE__ */ jsx(
14
- TextareaControl,
14
+ WCTextareaControl,
15
15
  {
16
16
  label: field.label,
17
17
  value: getRawContent(data.description) || "",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/description/index.tsx"],
4
- "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { TextareaControl } from '@wordpress/components';\nimport type { Attachment, Updatable } from '@wordpress/core-data';\nimport type { Field } from '@wordpress/dataviews';\nimport { getRawContent } from '../utils/get-raw-content';\n\nconst descriptionField: Partial< Field< Updatable< Attachment > > > = {\n\tid: 'description',\n\ttype: 'text',\n\tlabel: __( 'Description' ),\n\tgetValue: ( { item } ) => getRawContent( item?.description ),\n\trender: ( { item } ) => (\n\t\t<div>{ getRawContent( item?.description ) || '-' }</div>\n\t),\n\tEdit: ( { field, onChange, data } ) => {\n\t\treturn (\n\t\t\t<TextareaControl\n\t\t\t\tlabel={ field.label }\n\t\t\t\tvalue={ getRawContent( data.description ) || '' }\n\t\t\t\tonChange={ ( value ) => onChange( { description: value } ) }\n\t\t\t\trows={ 5 }\n\t\t\t/>\n\t\t);\n\t},\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\nexport default descriptionField;\n"],
5
- "mappings": ";AAAA,SAAS,UAAU;AACnB,SAAS,uBAAuB;AAGhC,SAAS,qBAAqB;AAQ5B;AANF,IAAM,mBAAgE;AAAA,EACrE,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,OAAO,GAAI,aAAc;AAAA,EACzB,UAAU,CAAE,EAAE,KAAK,MAAO,cAAe,MAAM,WAAY;AAAA,EAC3D,QAAQ,CAAE,EAAE,KAAK,MAChB,oBAAC,SAAM,wBAAe,MAAM,WAAY,KAAK,KAAK;AAAA,EAEnD,MAAM,CAAE,EAAE,OAAO,UAAU,KAAK,MAAO;AACtC,WACC;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,MAAM;AAAA,QACd,OAAQ,cAAe,KAAK,WAAY,KAAK;AAAA,QAC7C,UAAW,CAAE,UAAW,SAAU,EAAE,aAAa,MAAM,CAAE;AAAA,QACzD,MAAO;AAAA;AAAA,IACR;AAAA,EAEF;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AACX;AAEA,IAAO,sBAAQ;",
4
+ "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { TextareaControl as WCTextareaControl } from '@wordpress/components';\nimport type { Attachment, Updatable } from '@wordpress/core-data';\nimport type { Field } from '@wordpress/dataviews';\nimport { getRawContent } from '../utils/get-raw-content';\n\nconst descriptionField: Partial< Field< Updatable< Attachment > > > = {\n\tid: 'description',\n\ttype: 'text',\n\tlabel: __( 'Description' ),\n\tgetValue: ( { item } ) => getRawContent( item?.description ),\n\trender: ( { item } ) => (\n\t\t<div>{ getRawContent( item?.description ) || '-' }</div>\n\t),\n\tEdit: ( { field, onChange, data } ) => {\n\t\treturn (\n\t\t\t<WCTextareaControl\n\t\t\t\tlabel={ field.label }\n\t\t\t\tvalue={ getRawContent( data.description ) || '' }\n\t\t\t\tonChange={ ( value ) => onChange( { description: value } ) }\n\t\t\t\trows={ 5 }\n\t\t\t/>\n\t\t);\n\t},\n\tenableSorting: false,\n\tfilterBy: false,\n};\n\nexport default descriptionField;\n"],
5
+ "mappings": ";AAAA,SAAS,UAAU;AACnB,SAAS,mBAAmB,yBAAyB;AAGrD,SAAS,qBAAqB;AAQ5B;AANF,IAAM,mBAAgE;AAAA,EACrE,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,OAAO,GAAI,aAAc;AAAA,EACzB,UAAU,CAAE,EAAE,KAAK,MAAO,cAAe,MAAM,WAAY;AAAA,EAC3D,QAAQ,CAAE,EAAE,KAAK,MAChB,oBAAC,SAAM,wBAAe,MAAM,WAAY,KAAK,KAAK;AAAA,EAEnD,MAAM,CAAE,EAAE,OAAO,UAAU,KAAK,MAAO;AACtC,WACC;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,MAAM;AAAA,QACd,OAAQ,cAAe,KAAK,WAAY,KAAK;AAAA,QAC7C,UAAW,CAAE,UAAW,SAAU,EAAE,aAAa,MAAM,CAAE;AAAA,QACzD,MAAO;AAAA;AAAA,IACR;AAAA,EAEF;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AACX;AAEA,IAAO,sBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/attached_to/edit.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,MAAM,MAAM,YAAY,GAAG;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAE,EAC5C,IAAI,EACJ,QAAQ,GACR,EAAE,oBAAoB,CAAE,SAAS,CAAE,+BAiInC"}
1
+ {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/attached_to/edit.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,MAAM,MAAM,YAAY,GAAG;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAE,EAC5C,IAAI,EACJ,QAAQ,GACR,EAAE,oBAAoB,CAAE,SAAS,CAAE,+BA+HnC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/media-fields",
3
- "version": "0.18.0",
3
+ "version": "0.19.2-next.v.202608281122.0",
4
4
  "description": "Reusable field definitions for displaying and editing media attachment properties in WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -48,19 +48,17 @@
48
48
  "src/**/*.scss"
49
49
  ],
50
50
  "dependencies": {
51
- "@wordpress/base-styles": "^12.1.0",
52
- "@wordpress/components": "^39.0.0",
53
- "@wordpress/compose": "^8.6.0",
54
- "@wordpress/core-data": "^7.53.0",
55
- "@wordpress/data": "^10.53.0",
56
- "@wordpress/dataviews": "^18.0.0",
57
- "@wordpress/date": "^5.53.0",
58
- "@wordpress/element": "^8.5.0",
59
- "@wordpress/i18n": "^6.26.0",
60
- "@wordpress/icons": "^15.4.0",
61
- "@wordpress/primitives": "^4.53.0",
62
- "@wordpress/ui": "^0.20.0",
63
- "@wordpress/url": "^4.53.0",
51
+ "@wordpress/base-styles": "^13.0.1-next.v.202608281122.0",
52
+ "@wordpress/components": "^40.1.1-next.v.202608281122.0",
53
+ "@wordpress/compose": "^8.7.2-next.v.202608281122.0",
54
+ "@wordpress/core-data": "^7.54.2-next.v.202608281122.0",
55
+ "@wordpress/data": "^10.54.2-next.v.202608281122.0",
56
+ "@wordpress/dataviews": "^18.1.2-next.v.202608281122.0",
57
+ "@wordpress/element": "^8.6.2-next.v.202608281122.0",
58
+ "@wordpress/i18n": "^6.27.1-next.v.202608281122.0",
59
+ "@wordpress/icons": "^15.5.1-next.v.202608281122.0",
60
+ "@wordpress/ui": "^0.22.1-next.v.202608281122.0",
61
+ "@wordpress/url": "^4.54.1-next.v.202608281122.0",
64
62
  "clsx": "^2.1.1"
65
63
  },
66
64
  "devDependencies": {
@@ -81,5 +79,5 @@
81
79
  "publishConfig": {
82
80
  "access": "public"
83
81
  },
84
- "gitHead": "989764d42ff93e33684aaf0b96a5b7f3d9bbff52"
82
+ "gitHead": "de479d415171765f7b573c81aeec5334ff506a12"
85
83
  }
@@ -1,5 +1,5 @@
1
1
  import { __ } from '@wordpress/i18n';
2
- import { TextareaControl } from '@wordpress/components';
2
+ import { TextareaControl as WCTextareaControl } from '@wordpress/components';
3
3
  import { Link } from '@wordpress/ui';
4
4
  import type { Field } from '@wordpress/dataviews';
5
5
  import type { Attachment, Updatable } from '@wordpress/core-data';
@@ -12,7 +12,7 @@ const altTextField: Partial< Field< Updatable< Attachment > > > = {
12
12
  render: ( { item } ) => item?.alt_text || '-',
13
13
  Edit: ( { field, onChange, data } ) => {
14
14
  return (
15
- <TextareaControl
15
+ <WCTextareaControl
16
16
  label={ field.label }
17
17
  value={ data.alt_text || '' }
18
18
  onChange={ ( value ) => onChange( { alt_text: value } ) }
@@ -107,9 +107,7 @@ export default function MediaAttachedToEdit( {
107
107
  *
108
108
  * @param {Object} selectedPostId The selected post id.
109
109
  */
110
- const handleSelectOption = (
111
- selectedPostId: string | null | undefined
112
- ) => {
110
+ const handleSelectOption = ( selectedPostId: string | null ) => {
113
111
  if ( ! selectedPostId ) {
114
112
  handleDetach();
115
113
  return;
@@ -1,5 +1,5 @@
1
1
  import { __ } from '@wordpress/i18n';
2
- import { TextareaControl } from '@wordpress/components';
2
+ import { TextareaControl as WCTextareaControl } from '@wordpress/components';
3
3
  import type { Attachment, Updatable } from '@wordpress/core-data';
4
4
  import type { Field } from '@wordpress/dataviews';
5
5
  import { getRawContent } from '../utils/get-raw-content';
@@ -12,7 +12,7 @@ const captionField: Partial< Field< Updatable< Attachment > > > = {
12
12
  render: ( { item } ) => getRawContent( item?.caption ) || '-',
13
13
  Edit: ( { field, onChange, data } ) => {
14
14
  return (
15
- <TextareaControl
15
+ <WCTextareaControl
16
16
  label={ field.label }
17
17
  value={ getRawContent( data.caption ) || '' }
18
18
  onChange={ ( value ) => onChange( { caption: value } ) }
@@ -1,5 +1,5 @@
1
1
  import { __ } from '@wordpress/i18n';
2
- import { TextareaControl } from '@wordpress/components';
2
+ import { TextareaControl as WCTextareaControl } from '@wordpress/components';
3
3
  import type { Attachment, Updatable } from '@wordpress/core-data';
4
4
  import type { Field } from '@wordpress/dataviews';
5
5
  import { getRawContent } from '../utils/get-raw-content';
@@ -14,7 +14,7 @@ const descriptionField: Partial< Field< Updatable< Attachment > > > = {
14
14
  ),
15
15
  Edit: ( { field, onChange, data } ) => {
16
16
  return (
17
- <TextareaControl
17
+ <WCTextareaControl
18
18
  label={ field.label }
19
19
  value={ getRawContent( data.description ) || '' }
20
20
  onChange={ ( value ) => onChange( { description: value } ) }
@@ -397,3 +397,9 @@ export const DataViewsPreview = () => {
397
397
  </div>
398
398
  );
399
399
  };
400
+
401
+ DataViewsPreview.parameters = {
402
+ // FIXME: Preview table has an empty column header (empty-table-header).
403
+ // See: https://github.com/WordPress/gutenberg/issues/81596
404
+ a11y: { test: 'todo' },
405
+ };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=view.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"view.test.d.ts","sourceRoot":"","sources":["../../../src/attached_to/test/view.test.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/filename/test/index.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=view.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"view.test.d.ts","sourceRoot":"","sources":["../../../src/filename/test/view.test.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/filesize/test/index.test.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/media_dimensions/test/index.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=get-best-image-url.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-best-image-url.test.d.ts","sourceRoot":"","sources":["../../../src/media_thumbnail/test/get-best-image-url.test.ts"],"names":[],"mappings":""}
@@ -1,26 +0,0 @@
1
- import { DataForm } from '@wordpress/dataviews';
2
- declare const _default: {
3
- title: string;
4
- component: typeof DataForm;
5
- };
6
- export default _default;
7
- declare const DataFormsComponent: ({ type }: {
8
- type: 'regular' | 'panel';
9
- }) => import("react").JSX.Element;
10
- export declare const DataFormsPreview: {
11
- render: typeof DataFormsComponent;
12
- argTypes: {
13
- type: {
14
- control: {
15
- type: string;
16
- };
17
- description: string;
18
- options: string[];
19
- };
20
- };
21
- args: {
22
- type: string;
23
- };
24
- };
25
- export declare const DataViewsPreview: () => import("react").JSX.Element;
26
- //# sourceMappingURL=index.story.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../src/stories/index.story.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAa,MAAM,sBAAsB,CAAC;;IAkB1D,KAAK;IACL,SAAS;;;AAuRV,QAAA,MAAM,kBAAkB,aAAe;IAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAA;CAAE,gCA4CnE,CAAC;AAEF,eAAO,MAAM,gBAAgB;IAC5B,MAAM;IACN,QAAQ;QACP,IAAI;YACH,OAAO;gBAAI,IAAI;;YACf,WAAW;YACX,OAAO;;;IAGT,IAAI;QACH,IAAI;;CAEL,CAAC;AAEF,eAAO,MAAM,gBAAgB,mCAsC5B,CAAC"}