@wordpress/media-utils 5.18.0 → 5.19.1

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 CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 5.19.0 (2025-02-28)
6
+
5
7
  ## 5.18.0 (2025-02-12)
6
8
 
7
9
  ## 5.17.0 (2025-01-29)
package/README.md CHANGED
@@ -56,6 +56,7 @@ _Parameters_
56
56
  - _$0.onFileChange_ `UploadMediaArgs[ 'onFileChange' ]`: Function called each time a file or a temporary representation of the file is available.
57
57
  - _$0.wpAllowedMimeTypes_ `UploadMediaArgs[ 'wpAllowedMimeTypes' ]`: List of allowed mime types and file extensions.
58
58
  - _$0.signal_ `UploadMediaArgs[ 'signal' ]`: Abort signal.
59
+ - _$0.multiple_ `UploadMediaArgs[ 'multiple' ]`: Whether to allow multiple files to be uploaded.
59
60
 
60
61
  ### validateFileSize
61
62
 
@@ -32,6 +32,7 @@ var _uploadError = require("./upload-error");
32
32
  * @param $0.onFileChange Function called each time a file or a temporary representation of the file is available.
33
33
  * @param $0.wpAllowedMimeTypes List of allowed mime types and file extensions.
34
34
  * @param $0.signal Abort signal.
35
+ * @param $0.multiple Whether to allow multiple files to be uploaded.
35
36
  */
36
37
  function uploadMedia({
37
38
  wpAllowedMimeTypes,
@@ -41,8 +42,13 @@ function uploadMedia({
41
42
  maxUploadFileSize,
42
43
  onError,
43
44
  onFileChange,
44
- signal
45
+ signal,
46
+ multiple = true
45
47
  }) {
48
+ if (!multiple && filesList.length > 1) {
49
+ onError?.(new Error((0, _i18n.__)('Only one file can be used here.')));
50
+ return;
51
+ }
46
52
  const validFiles = [];
47
53
  const filesSet = [];
48
54
  const setAndUpdateFiles = (index, value) => {
@@ -100,9 +106,11 @@ function uploadMedia({
100
106
  } catch (error) {
101
107
  // Reset to empty on failure.
102
108
  setAndUpdateFiles(index, null);
109
+
110
+ // @wordpress/api-fetch throws any response that isn't in the 200 range as-is.
103
111
  let message;
104
- if (error instanceof Error) {
105
- message = error.message;
112
+ if (typeof error === 'object' && error !== null && 'message' in error) {
113
+ message = typeof error.message === 'string' ? error.message : String(error.message);
106
114
  } else {
107
115
  message = (0, _i18n.sprintf)(
108
116
  // translators: %s: file name
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_blob","_uploadToServer","_validateMimeType","_validateMimeTypeForUser","_validateFileSize","_uploadError","uploadMedia","wpAllowedMimeTypes","allowedTypes","additionalData","filesList","maxUploadFileSize","onError","onFileChange","signal","validFiles","filesSet","setAndUpdateFiles","index","value","window","__experimentalMediaProcessing","url","revokeBlobURL","filter","attachment","mediaFile","validateMimeTypeForUser","error","validateMimeType","validateFileSize","push","createBlobURL","map","file","uploadToServer","message","Error","sprintf","__","name","UploadError","code","cause","undefined"],"sources":["@wordpress/media-utils/src/utils/upload-media.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { createBlobURL, revokeBlobURL } from '@wordpress/blob';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tAdditionalData,\n\tAttachment,\n\tOnChangeHandler,\n\tOnErrorHandler,\n} from './types';\nimport { uploadToServer } from './upload-to-server';\nimport { validateMimeType } from './validate-mime-type';\nimport { validateMimeTypeForUser } from './validate-mime-type-for-user';\nimport { validateFileSize } from './validate-file-size';\nimport { UploadError } from './upload-error';\n\ndeclare global {\n\tinterface Window {\n\t\t__experimentalMediaProcessing?: boolean;\n\t}\n}\n\ninterface UploadMediaArgs {\n\t// Additional data to include in the request.\n\tadditionalData?: AdditionalData;\n\t// Array with the types of media that can be uploaded, if unset all types are allowed.\n\tallowedTypes?: string[];\n\t// List of files.\n\tfilesList: File[];\n\t// Maximum upload size in bytes allowed for the site.\n\tmaxUploadFileSize?: number;\n\t// Function called when an error happens.\n\tonError?: OnErrorHandler;\n\t// Function called each time a file or a temporary representation of the file is available.\n\tonFileChange?: OnChangeHandler;\n\t// List of allowed mime types and file extensions.\n\twpAllowedMimeTypes?: Record< string, string > | null;\n\t// Abort signal.\n\tsignal?: AbortSignal;\n}\n\n/**\n * Upload a media file when the file upload button is activated\n * or when adding a file to the editor via drag & drop.\n *\n * @param $0 Parameters object passed to the function.\n * @param $0.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed.\n * @param $0.additionalData Additional data to include in the request.\n * @param $0.filesList List of files.\n * @param $0.maxUploadFileSize Maximum upload size in bytes allowed for the site.\n * @param $0.onError Function called when an error happens.\n * @param $0.onFileChange Function called each time a file or a temporary representation of the file is available.\n * @param $0.wpAllowedMimeTypes List of allowed mime types and file extensions.\n * @param $0.signal Abort signal.\n */\nexport function uploadMedia( {\n\twpAllowedMimeTypes,\n\tallowedTypes,\n\tadditionalData = {},\n\tfilesList,\n\tmaxUploadFileSize,\n\tonError,\n\tonFileChange,\n\tsignal,\n}: UploadMediaArgs ) {\n\tconst validFiles = [];\n\n\tconst filesSet: Array< Partial< Attachment > | null > = [];\n\tconst setAndUpdateFiles = ( index: number, value: Attachment | null ) => {\n\t\t// For client-side media processing, this is handled by the upload-media package.\n\t\tif ( ! window.__experimentalMediaProcessing ) {\n\t\t\tif ( filesSet[ index ]?.url ) {\n\t\t\t\trevokeBlobURL( filesSet[ index ].url );\n\t\t\t}\n\t\t}\n\t\tfilesSet[ index ] = value;\n\t\tonFileChange?.(\n\t\t\tfilesSet.filter( ( attachment ) => attachment !== null )\n\t\t);\n\t};\n\n\tfor ( const mediaFile of filesList ) {\n\t\t// Verify if user is allowed to upload this mime type.\n\t\t// Defer to the server when type not detected.\n\t\ttry {\n\t\t\tvalidateMimeTypeForUser( mediaFile, wpAllowedMimeTypes );\n\t\t} catch ( error: unknown ) {\n\t\t\tonError?.( error as Error );\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Check if the caller (e.g. a block) supports this mime type.\n\t\t// Defer to the server when type not detected.\n\t\ttry {\n\t\t\tvalidateMimeType( mediaFile, allowedTypes );\n\t\t} catch ( error: unknown ) {\n\t\t\tonError?.( error as Error );\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Verify if file is greater than the maximum file upload size allowed for the site.\n\t\ttry {\n\t\t\tvalidateFileSize( mediaFile, maxUploadFileSize );\n\t\t} catch ( error: unknown ) {\n\t\t\tonError?.( error as Error );\n\t\t\tcontinue;\n\t\t}\n\n\t\tvalidFiles.push( mediaFile );\n\n\t\t// For client-side media processing, this is handled by the upload-media package.\n\t\tif ( ! window.__experimentalMediaProcessing ) {\n\t\t\t// Set temporary URL to create placeholder media file, this is replaced\n\t\t\t// with final file from media gallery when upload is `done` below.\n\t\t\tfilesSet.push( { url: createBlobURL( mediaFile ) } );\n\t\t\tonFileChange?.( filesSet as Array< Partial< Attachment > > );\n\t\t}\n\t}\n\n\tvalidFiles.map( async ( file, index ) => {\n\t\ttry {\n\t\t\tconst attachment = await uploadToServer(\n\t\t\t\tfile,\n\t\t\t\tadditionalData,\n\t\t\t\tsignal\n\t\t\t);\n\t\t\tsetAndUpdateFiles( index, attachment );\n\t\t} catch ( error ) {\n\t\t\t// Reset to empty on failure.\n\t\t\tsetAndUpdateFiles( index, null );\n\n\t\t\tlet message;\n\t\t\tif ( error instanceof Error ) {\n\t\t\t\tmessage = error.message;\n\t\t\t} else {\n\t\t\t\tmessage = sprintf(\n\t\t\t\t\t// translators: %s: file name\n\t\t\t\t\t__( 'Error while uploading file %s to the media library.' ),\n\t\t\t\t\tfile.name\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tonError?.(\n\t\t\t\tnew UploadError( {\n\t\t\t\t\tcode: 'GENERAL',\n\t\t\t\t\tmessage,\n\t\t\t\t\tfile,\n\t\t\t\t\tcause: error instanceof Error ? error : undefined,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\t} );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAWA,IAAAE,eAAA,GAAAF,OAAA;AACA,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;;IAEA;IACA,IAAI;MACH,IAAAE,kCAAgB,EAAEJ,SAAS,EAAEf,iBAAkB,CAAC;IACjD,CAAC,CAAC,OAAQiB,KAAc,EAAG;MAC1BhB,OAAO,GAAIgB,KAAe,CAAC;MAC3B;IACD;IAEAb,UAAU,CAACgB,IAAI,CAAEL,SAAU,CAAC;;IAE5B;IACA,IAAK,CAAEN,MAAM,CAACC,6BAA6B,EAAG;MAC7C;MACA;MACAL,QAAQ,CAACe,IAAI,CAAE;QAAET,GAAG,EAAE,IAAAU,mBAAa,EAAEN,SAAU;MAAE,CAAE,CAAC;MACpDb,YAAY,GAAIG,QAA2C,CAAC;IAC7D;EACD;EAEAD,UAAU,CAACkB,GAAG,CAAE,OAAQC,IAAI,EAAEhB,KAAK,KAAM;IACxC,IAAI;MACH,MAAMO,UAAU,GAAG,MAAM,IAAAU,8BAAc,EACtCD,IAAI,EACJzB,cAAc,EACdK,MACD,CAAC;MACDG,iBAAiB,CAAEC,KAAK,EAAEO,UAAW,CAAC;IACvC,CAAC,CAAC,OAAQG,KAAK,EAAG;MACjB;MACAX,iBAAiB,CAAEC,KAAK,EAAE,IAAK,CAAC;MAEhC,IAAIkB,OAAO;MACX,IAAKR,KAAK,YAAYS,KAAK,EAAG;QAC7BD,OAAO,GAAGR,KAAK,CAACQ,OAAO;MACxB,CAAC,MAAM;QACNA,OAAO,GAAG,IAAAE,aAAO;QAChB;QACA,IAAAC,QAAE,EAAE,qDAAsD,CAAC,EAC3DL,IAAI,CAACM,IACN,CAAC;MACF;MAEA5B,OAAO,GACN,IAAI6B,wBAAW,CAAE;QAChBC,IAAI,EAAE,SAAS;QACfN,OAAO;QACPF,IAAI;QACJS,KAAK,EAAEf,KAAK,YAAYS,KAAK,GAAGT,KAAK,GAAGgB;MACzC,CAAE,CACH,CAAC;IACF;EACD,CAAE,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_blob","_uploadToServer","_validateMimeType","_validateMimeTypeForUser","_validateFileSize","_uploadError","uploadMedia","wpAllowedMimeTypes","allowedTypes","additionalData","filesList","maxUploadFileSize","onError","onFileChange","signal","multiple","length","Error","__","validFiles","filesSet","setAndUpdateFiles","index","value","window","__experimentalMediaProcessing","url","revokeBlobURL","filter","attachment","mediaFile","validateMimeTypeForUser","error","validateMimeType","validateFileSize","push","createBlobURL","map","file","uploadToServer","message","String","sprintf","name","UploadError","code","cause","undefined"],"sources":["@wordpress/media-utils/src/utils/upload-media.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { createBlobURL, revokeBlobURL } from '@wordpress/blob';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tAdditionalData,\n\tAttachment,\n\tOnChangeHandler,\n\tOnErrorHandler,\n} from './types';\nimport { uploadToServer } from './upload-to-server';\nimport { validateMimeType } from './validate-mime-type';\nimport { validateMimeTypeForUser } from './validate-mime-type-for-user';\nimport { validateFileSize } from './validate-file-size';\nimport { UploadError } from './upload-error';\n\ndeclare global {\n\tinterface Window {\n\t\t__experimentalMediaProcessing?: boolean;\n\t}\n}\n\ninterface UploadMediaArgs {\n\t// Additional data to include in the request.\n\tadditionalData?: AdditionalData;\n\t// Array with the types of media that can be uploaded, if unset all types are allowed.\n\tallowedTypes?: string[];\n\t// List of files.\n\tfilesList: File[];\n\t// Maximum upload size in bytes allowed for the site.\n\tmaxUploadFileSize?: number;\n\t// Function called when an error happens.\n\tonError?: OnErrorHandler;\n\t// Function called each time a file or a temporary representation of the file is available.\n\tonFileChange?: OnChangeHandler;\n\t// List of allowed mime types and file extensions.\n\twpAllowedMimeTypes?: Record< string, string > | null;\n\t// Abort signal.\n\tsignal?: AbortSignal;\n\t// Whether to allow multiple files to be uploaded.\n\tmultiple?: boolean;\n}\n\n/**\n * Upload a media file when the file upload button is activated\n * or when adding a file to the editor via drag & drop.\n *\n * @param $0 Parameters object passed to the function.\n * @param $0.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed.\n * @param $0.additionalData Additional data to include in the request.\n * @param $0.filesList List of files.\n * @param $0.maxUploadFileSize Maximum upload size in bytes allowed for the site.\n * @param $0.onError Function called when an error happens.\n * @param $0.onFileChange Function called each time a file or a temporary representation of the file is available.\n * @param $0.wpAllowedMimeTypes List of allowed mime types and file extensions.\n * @param $0.signal Abort signal.\n * @param $0.multiple Whether to allow multiple files to be uploaded.\n */\nexport function uploadMedia( {\n\twpAllowedMimeTypes,\n\tallowedTypes,\n\tadditionalData = {},\n\tfilesList,\n\tmaxUploadFileSize,\n\tonError,\n\tonFileChange,\n\tsignal,\n\tmultiple = true,\n}: UploadMediaArgs ) {\n\tif ( ! multiple && filesList.length > 1 ) {\n\t\tonError?.( new Error( __( 'Only one file can be used here.' ) ) );\n\t\treturn;\n\t}\n\n\tconst validFiles = [];\n\n\tconst filesSet: Array< Partial< Attachment > | null > = [];\n\tconst setAndUpdateFiles = ( index: number, value: Attachment | null ) => {\n\t\t// For client-side media processing, this is handled by the upload-media package.\n\t\tif ( ! window.__experimentalMediaProcessing ) {\n\t\t\tif ( filesSet[ index ]?.url ) {\n\t\t\t\trevokeBlobURL( filesSet[ index ].url );\n\t\t\t}\n\t\t}\n\t\tfilesSet[ index ] = value;\n\t\tonFileChange?.(\n\t\t\tfilesSet.filter( ( attachment ) => attachment !== null )\n\t\t);\n\t};\n\n\tfor ( const mediaFile of filesList ) {\n\t\t// Verify if user is allowed to upload this mime type.\n\t\t// Defer to the server when type not detected.\n\t\ttry {\n\t\t\tvalidateMimeTypeForUser( mediaFile, wpAllowedMimeTypes );\n\t\t} catch ( error: unknown ) {\n\t\t\tonError?.( error as Error );\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Check if the caller (e.g. a block) supports this mime type.\n\t\t// Defer to the server when type not detected.\n\t\ttry {\n\t\t\tvalidateMimeType( mediaFile, allowedTypes );\n\t\t} catch ( error: unknown ) {\n\t\t\tonError?.( error as Error );\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Verify if file is greater than the maximum file upload size allowed for the site.\n\t\ttry {\n\t\t\tvalidateFileSize( mediaFile, maxUploadFileSize );\n\t\t} catch ( error: unknown ) {\n\t\t\tonError?.( error as Error );\n\t\t\tcontinue;\n\t\t}\n\n\t\tvalidFiles.push( mediaFile );\n\n\t\t// For client-side media processing, this is handled by the upload-media package.\n\t\tif ( ! window.__experimentalMediaProcessing ) {\n\t\t\t// Set temporary URL to create placeholder media file, this is replaced\n\t\t\t// with final file from media gallery when upload is `done` below.\n\t\t\tfilesSet.push( { url: createBlobURL( mediaFile ) } );\n\t\t\tonFileChange?.( filesSet as Array< Partial< Attachment > > );\n\t\t}\n\t}\n\n\tvalidFiles.map( async ( file, index ) => {\n\t\ttry {\n\t\t\tconst attachment = await uploadToServer(\n\t\t\t\tfile,\n\t\t\t\tadditionalData,\n\t\t\t\tsignal\n\t\t\t);\n\t\t\tsetAndUpdateFiles( index, attachment );\n\t\t} catch ( error ) {\n\t\t\t// Reset to empty on failure.\n\t\t\tsetAndUpdateFiles( index, null );\n\n\t\t\t// @wordpress/api-fetch throws any response that isn't in the 200 range as-is.\n\t\t\tlet message: string;\n\t\t\tif (\n\t\t\t\ttypeof error === 'object' &&\n\t\t\t\terror !== null &&\n\t\t\t\t'message' in error\n\t\t\t) {\n\t\t\t\tmessage =\n\t\t\t\t\ttypeof error.message === 'string'\n\t\t\t\t\t\t? error.message\n\t\t\t\t\t\t: String( error.message );\n\t\t\t} else {\n\t\t\t\tmessage = sprintf(\n\t\t\t\t\t// translators: %s: file name\n\t\t\t\t\t__( 'Error while uploading file %s to the media library.' ),\n\t\t\t\t\tfile.name\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tonError?.(\n\t\t\t\tnew UploadError( {\n\t\t\t\t\tcode: 'GENERAL',\n\t\t\t\t\tmessage,\n\t\t\t\t\tfile,\n\t\t\t\t\tcause: error instanceof Error ? error : undefined,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\t} );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,K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CAACQ,OAAQ,CAAC;MAC5B,CAAC,MAAM;QACNA,OAAO,GAAG,IAAAE,aAAO;QAChB;QACA,IAAAxB,QAAE,EAAE,qDAAsD,CAAC,EAC3DoB,IAAI,CAACK,IACN,CAAC;MACF;MAEA/B,OAAO,GACN,IAAIgC,wBAAW,CAAE;QAChBC,IAAI,EAAE,SAAS;QACfL,OAAO;QACPF,IAAI;QACJQ,KAAK,EAAEd,KAAK,YAAYf,KAAK,GAAGe,KAAK,GAAGe;MACzC,CAAE,CACH,CAAC;IACF;EACD,CAAE,CAAC;AACJ","ignoreList":[]}
@@ -26,6 +26,7 @@ import { UploadError } from './upload-error';
26
26
  * @param $0.onFileChange Function called each time a file or a temporary representation of the file is available.
27
27
  * @param $0.wpAllowedMimeTypes List of allowed mime types and file extensions.
28
28
  * @param $0.signal Abort signal.
29
+ * @param $0.multiple Whether to allow multiple files to be uploaded.
29
30
  */
30
31
  export function uploadMedia({
31
32
  wpAllowedMimeTypes,
@@ -35,8 +36,13 @@ export function uploadMedia({
35
36
  maxUploadFileSize,
36
37
  onError,
37
38
  onFileChange,
38
- signal
39
+ signal,
40
+ multiple = true
39
41
  }) {
42
+ if (!multiple && filesList.length > 1) {
43
+ onError?.(new Error(__('Only one file can be used here.')));
44
+ return;
45
+ }
40
46
  const validFiles = [];
41
47
  const filesSet = [];
42
48
  const setAndUpdateFiles = (index, value) => {
@@ -94,9 +100,11 @@ export function uploadMedia({
94
100
  } catch (error) {
95
101
  // Reset to empty on failure.
96
102
  setAndUpdateFiles(index, null);
103
+
104
+ // @wordpress/api-fetch throws any response that isn't in the 200 range as-is.
97
105
  let message;
98
- if (error instanceof Error) {
99
- message = error.message;
106
+ if (typeof error === 'object' && error !== null && 'message' in error) {
107
+ message = typeof error.message === 'string' ? error.message : String(error.message);
100
108
  } else {
101
109
  message = sprintf(
102
110
  // translators: %s: file name
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","createBlobURL","revokeBlobURL","uploadToServer","validateMimeType","validateMimeTypeForUser","validateFileSize","UploadError","uploadMedia","wpAllowedMimeTypes","allowedTypes","additionalData","filesList","maxUploadFileSize","onError","onFileChange","signal","validFiles","filesSet","setAndUpdateFiles","index","value","window","__experimentalMediaProcessing","url","filter","attachment","mediaFile","error","push","map","file","message","Error","name","code","cause","undefined"],"sources":["@wordpress/media-utils/src/utils/upload-media.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { createBlobURL, revokeBlobURL } from '@wordpress/blob';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tAdditionalData,\n\tAttachment,\n\tOnChangeHandler,\n\tOnErrorHandler,\n} from './types';\nimport { uploadToServer } from './upload-to-server';\nimport { validateMimeType } from './validate-mime-type';\nimport { validateMimeTypeForUser } from './validate-mime-type-for-user';\nimport { validateFileSize } from './validate-file-size';\nimport { UploadError } from './upload-error';\n\ndeclare global {\n\tinterface Window {\n\t\t__experimentalMediaProcessing?: boolean;\n\t}\n}\n\ninterface UploadMediaArgs {\n\t// Additional data to include in the request.\n\tadditionalData?: AdditionalData;\n\t// Array with the types of media that can be uploaded, if unset all types are allowed.\n\tallowedTypes?: string[];\n\t// List of files.\n\tfilesList: File[];\n\t// Maximum upload size in bytes allowed for the site.\n\tmaxUploadFileSize?: number;\n\t// Function called when an error happens.\n\tonError?: OnErrorHandler;\n\t// Function called each time a file or a temporary representation of the file is available.\n\tonFileChange?: OnChangeHandler;\n\t// List of allowed mime types and file extensions.\n\twpAllowedMimeTypes?: Record< string, string > | null;\n\t// Abort signal.\n\tsignal?: AbortSignal;\n}\n\n/**\n * Upload a media file when the file upload button is activated\n * or when adding a file to the editor via drag & drop.\n *\n * @param $0 Parameters object passed to the function.\n * @param $0.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed.\n * @param $0.additionalData Additional data to include in the request.\n * @param $0.filesList List of files.\n * @param $0.maxUploadFileSize Maximum upload size in bytes allowed for the site.\n * @param $0.onError Function called when an error happens.\n * @param $0.onFileChange Function called each time a file or a temporary representation of the file is available.\n * @param $0.wpAllowedMimeTypes List of allowed mime types and file extensions.\n * @param $0.signal Abort signal.\n */\nexport function uploadMedia( {\n\twpAllowedMimeTypes,\n\tallowedTypes,\n\tadditionalData = {},\n\tfilesList,\n\tmaxUploadFileSize,\n\tonError,\n\tonFileChange,\n\tsignal,\n}: UploadMediaArgs ) {\n\tconst validFiles = [];\n\n\tconst filesSet: Array< Partial< Attachment > | null > = [];\n\tconst setAndUpdateFiles = ( index: number, value: Attachment | null ) => {\n\t\t// For client-side media processing, this is handled by the upload-media package.\n\t\tif ( ! window.__experimentalMediaProcessing ) {\n\t\t\tif ( filesSet[ index ]?.url ) {\n\t\t\t\trevokeBlobURL( filesSet[ index ].url );\n\t\t\t}\n\t\t}\n\t\tfilesSet[ index ] = value;\n\t\tonFileChange?.(\n\t\t\tfilesSet.filter( ( attachment ) => attachment !== null )\n\t\t);\n\t};\n\n\tfor ( const mediaFile of filesList ) {\n\t\t// Verify if user is allowed to upload this mime type.\n\t\t// Defer to the server when type not detected.\n\t\ttry {\n\t\t\tvalidateMimeTypeForUser( mediaFile, wpAllowedMimeTypes );\n\t\t} catch ( error: unknown ) {\n\t\t\tonError?.( error as Error );\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Check if the caller (e.g. a block) supports this mime type.\n\t\t// Defer to the server when type not detected.\n\t\ttry {\n\t\t\tvalidateMimeType( mediaFile, allowedTypes );\n\t\t} catch ( error: unknown ) {\n\t\t\tonError?.( error as Error );\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Verify if file is greater than the maximum file upload size allowed for the site.\n\t\ttry {\n\t\t\tvalidateFileSize( mediaFile, maxUploadFileSize );\n\t\t} catch ( error: unknown ) {\n\t\t\tonError?.( error as Error );\n\t\t\tcontinue;\n\t\t}\n\n\t\tvalidFiles.push( mediaFile );\n\n\t\t// For client-side media processing, this is handled by the upload-media package.\n\t\tif ( ! window.__experimentalMediaProcessing ) {\n\t\t\t// Set temporary URL to create placeholder media file, this is replaced\n\t\t\t// with final file from media gallery when upload is `done` below.\n\t\t\tfilesSet.push( { url: createBlobURL( mediaFile ) } );\n\t\t\tonFileChange?.( filesSet as Array< Partial< Attachment > > );\n\t\t}\n\t}\n\n\tvalidFiles.map( async ( file, index ) => {\n\t\ttry {\n\t\t\tconst attachment = await uploadToServer(\n\t\t\t\tfile,\n\t\t\t\tadditionalData,\n\t\t\t\tsignal\n\t\t\t);\n\t\t\tsetAndUpdateFiles( index, attachment );\n\t\t} catch ( error ) {\n\t\t\t// Reset to empty on failure.\n\t\t\tsetAndUpdateFiles( index, null );\n\n\t\t\tlet message;\n\t\t\tif ( error instanceof Error ) {\n\t\t\t\tmessage = error.message;\n\t\t\t} else {\n\t\t\t\tmessage = sprintf(\n\t\t\t\t\t// translators: %s: file name\n\t\t\t\t\t__( 'Error while uploading file %s to the media library.' ),\n\t\t\t\t\tfile.name\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tonError?.(\n\t\t\t\tnew UploadError( {\n\t\t\t\t\tcode: 'GENERAL',\n\t\t\t\t\tmessage,\n\t\t\t\t\tfile,\n\t\t\t\t\tcause: error instanceof Error ? error : undefined,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,aAAa,EAAEC,aAAa,QAAQ,iBAAiB;;AAE9D;AACA;AACA;;AAOA,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,gBAAgB,QAAQ,sBAAsB;AACvD,SAASC,uBAAuB,QAAQ,+BAA+B;AACvE,SAASC,gBAAgB,QAAQ,sBAAsB;AACvD,SAASC,WAAW,QAAQ,gBAAgB;AA2B5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAE;EAC5BC,kBAAkB;EAClBC,YAAY;EACZC,cAAc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EvB,aAAa,CAAE0B,SAAU;MAAE,CAAE,CAAC;MACpDZ,YAAY,GAAIG,QAA2C,CAAC;IAC7D;EACD;EAEAD,UAAU,CAACa,GAAG,CAAE,OAAQC,IAAI,EAAEX,KAAK,KAAM;IACxC,IAAI;MACH,MAAMM,UAAU,GAAG,MAAMvB,cAAc,CACtC4B,IAAI,EACJpB,cAAc,EACdK,MACD,CAAC;MACDG,iBAAiB,CAAEC,KAAK,EAAEM,UAAW,CAAC;IACvC,CAAC,CAAC,OAAQE,KAAK,EAAG;MACjB;MACAT,iBAAiB,CAAEC,KAAK,EAAE,IAAK,CAAC;MAEhC,IAAIY,OAAO;MACX,IAAKJ,KAAK,YAAYK,KAAK,EAAG;QAC7BD,OAAO,GAAGJ,KAAK,CAACI,OAAO;MACxB,CAAC,MAAM;QACNA,OAAO,GAAGhC,OAAO;QAChB;QACAD,EAAE,CAAE,qDAAsD,CAAC,EAC3DgC,IAAI,CAACG,IACN,CAAC;MACF;MAEApB,OAAO,GACN,IAAIP,WAAW,CAAE;QAChB4B,IAAI,EAAE,SAAS;QACfH,OAAO;QACPD,IAAI;QACJK,KAAK,EAAER,KAAK,YAAYK,KAAK,GAAGL,KAAK,GAAGS;MACzC,CAAE,CACH,CAAC;IACF;EACD,CAAE,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["__","sprintf","createBlobURL","revokeBlobURL","uploadToServer","validateMimeType","validateMimeTypeForUser","validateFileSize","UploadError","uploadMedia","wpAllowedMimeTypes","allowedTypes","additionalData","filesList","maxUploadFileSize","onError","onFileChange","signal","multiple","length","Error","validFiles","filesSet","setAndUpdateFiles","index","value","window","__experimentalMediaProcessing","url","filter","attachment","mediaFile","error","push","map","file","message","String","name","code","cause","undefined"],"sources":["@wordpress/media-utils/src/utils/upload-media.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { createBlobURL, revokeBlobURL } from '@wordpress/blob';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tAdditionalData,\n\tAttachment,\n\tOnChangeHandler,\n\tOnErrorHandler,\n} from './types';\nimport { uploadToServer } from './upload-to-server';\nimport { validateMimeType } from './validate-mime-type';\nimport { validateMimeTypeForUser } from './validate-mime-type-for-user';\nimport { validateFileSize } from './validate-file-size';\nimport { UploadError } from './upload-error';\n\ndeclare global {\n\tinterface Window {\n\t\t__experimentalMediaProcessing?: boolean;\n\t}\n}\n\ninterface UploadMediaArgs {\n\t// Additional data to include in the request.\n\tadditionalData?: AdditionalData;\n\t// Array with the types of media that can be uploaded, if unset all types are allowed.\n\tallowedTypes?: string[];\n\t// List of files.\n\tfilesList: File[];\n\t// Maximum upload size in bytes allowed for the site.\n\tmaxUploadFileSize?: number;\n\t// Function called when an error happens.\n\tonError?: OnErrorHandler;\n\t// Function called each time a file or a temporary representation of the file is available.\n\tonFileChange?: OnChangeHandler;\n\t// List of allowed mime types and file extensions.\n\twpAllowedMimeTypes?: Record< string, string > | null;\n\t// Abort signal.\n\tsignal?: AbortSignal;\n\t// Whether to allow multiple files to be uploaded.\n\tmultiple?: boolean;\n}\n\n/**\n * Upload a media file when the file upload button is activated\n * or when adding a file to the editor via drag & drop.\n *\n * @param $0 Parameters object passed to the function.\n * @param $0.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed.\n * @param $0.additionalData Additional data to include in the request.\n * @param $0.filesList List of files.\n * @param $0.maxUploadFileSize Maximum upload size in bytes allowed for the site.\n * @param $0.onError Function called when an error happens.\n * @param $0.onFileChange Function called each time a file or a temporary representation of the file is available.\n * @param $0.wpAllowedMimeTypes List of allowed mime types and file extensions.\n * @param $0.signal Abort signal.\n * @param $0.multiple Whether to allow multiple files to be uploaded.\n */\nexport function uploadMedia( {\n\twpAllowedMimeTypes,\n\tallowedTypes,\n\tadditionalData = {},\n\tfilesList,\n\tmaxUploadFileSize,\n\tonError,\n\tonFileChange,\n\tsignal,\n\tmultiple = true,\n}: UploadMediaArgs ) {\n\tif ( ! multiple && filesList.length > 1 ) {\n\t\tonError?.( new Error( __( 'Only one file can be used here.' ) ) );\n\t\treturn;\n\t}\n\n\tconst validFiles = [];\n\n\tconst filesSet: Array< Partial< Attachment > | null > = [];\n\tconst setAndUpdateFiles = ( index: number, value: Attachment | null ) => {\n\t\t// For client-side media processing, this is handled by the upload-media package.\n\t\tif ( ! window.__experimentalMediaProcessing ) {\n\t\t\tif ( filesSet[ index ]?.url ) {\n\t\t\t\trevokeBlobURL( filesSet[ index ].url );\n\t\t\t}\n\t\t}\n\t\tfilesSet[ index ] = value;\n\t\tonFileChange?.(\n\t\t\tfilesSet.filter( ( attachment ) => attachment !== null )\n\t\t);\n\t};\n\n\tfor ( const mediaFile of filesList ) {\n\t\t// Verify if user is allowed to upload this mime type.\n\t\t// Defer to the server when type not detected.\n\t\ttry {\n\t\t\tvalidateMimeTypeForUser( mediaFile, wpAllowedMimeTypes );\n\t\t} catch ( error: unknown ) {\n\t\t\tonError?.( error as Error );\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Check if the caller (e.g. a block) supports this mime type.\n\t\t// Defer to the server when type not detected.\n\t\ttry {\n\t\t\tvalidateMimeType( mediaFile, allowedTypes );\n\t\t} catch ( error: unknown ) {\n\t\t\tonError?.( error as Error );\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Verify if file is greater than the maximum file upload size allowed for the site.\n\t\ttry {\n\t\t\tvalidateFileSize( mediaFile, maxUploadFileSize );\n\t\t} catch ( error: unknown ) {\n\t\t\tonError?.( error as Error );\n\t\t\tcontinue;\n\t\t}\n\n\t\tvalidFiles.push( mediaFile );\n\n\t\t// For client-side media processing, this is handled by the upload-media package.\n\t\tif ( ! window.__experimentalMediaProcessing ) {\n\t\t\t// Set temporary URL to create placeholder media file, this is replaced\n\t\t\t// with final file from media gallery when upload is `done` below.\n\t\t\tfilesSet.push( { url: createBlobURL( mediaFile ) } );\n\t\t\tonFileChange?.( filesSet as Array< Partial< Attachment > > );\n\t\t}\n\t}\n\n\tvalidFiles.map( async ( file, index ) => {\n\t\ttry {\n\t\t\tconst attachment = await uploadToServer(\n\t\t\t\tfile,\n\t\t\t\tadditionalData,\n\t\t\t\tsignal\n\t\t\t);\n\t\t\tsetAndUpdateFiles( index, attachment );\n\t\t} catch ( error ) {\n\t\t\t// Reset to empty on failure.\n\t\t\tsetAndUpdateFiles( index, null );\n\n\t\t\t// @wordpress/api-fetch throws any response that isn't in the 200 range as-is.\n\t\t\tlet message: string;\n\t\t\tif (\n\t\t\t\ttypeof error === 'object' &&\n\t\t\t\terror !== null &&\n\t\t\t\t'message' in error\n\t\t\t) {\n\t\t\t\tmessage =\n\t\t\t\t\ttypeof error.message === 'string'\n\t\t\t\t\t\t? error.message\n\t\t\t\t\t\t: String( error.message );\n\t\t\t} else {\n\t\t\t\tmessage = sprintf(\n\t\t\t\t\t// translators: %s: file name\n\t\t\t\t\t__( 'Error while uploading file %s to the media library.' ),\n\t\t\t\t\tfile.name\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tonError?.(\n\t\t\t\tnew UploadError( {\n\t\t\t\t\tcode: 'GENERAL',\n\t\t\t\t\tmessage,\n\t\t\t\t\tfile,\n\t\t\t\t\tcause: error instanceof Error ? error : undefined,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,aAAa,EAAEC,aAAa,QAAQ,iBAAiB;;AAE9D;AACA;AACA;;AAOA,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,gBAAgB,QAAQ,sBAAsB;AACvD,SAASC,uBAAuB,QAAQ,+BAA+B;AACvE,SAASC,gBAAgB,QAAQ,sBAAsB;AACvD,SAASC,WAAW,QAAQ,gBAAgB;AA6B5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAE;EAC5BC,kBAAkB;EACl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angeHandler;
17
17
  wpAllowedMimeTypes?: Record<string, string> | null;
18
18
  signal?: AbortSignal;
19
+ multiple?: boolean;
19
20
  }
20
21
  /**
21
22
  * Upload a media file when the file upload button is activated
@@ -30,7 +31,8 @@ interface UploadMediaArgs {
30
31
  * @param $0.onFileChange Function called each time a file or a temporary representation of the file is available.
31
32
  * @param $0.wpAllowedMimeTypes List of allowed mime types and file extensions.
32
33
  * @param $0.signal Abort signal.
34
+ * @param $0.multiple Whether to allow multiple files to be uploaded.
33
35
  */
34
- export declare function uploadMedia({ wpAllowedMimeTypes, allowedTypes, additionalData, filesList, maxUploadFileSize, onError, onFileChange, signal, }: UploadMediaArgs): void;
36
+ export declare function uploadMedia({ wpAllowedMimeTypes, allowedTypes, additionalData, filesList, maxUploadFileSize, onError, onFileChange, signal, multiple, }: UploadMediaArgs): void;
35
37
  export {};
36
38
  //# sourceMappingURL=upload-media.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"upload-media.d.ts","sourceRoot":"","sources":["../../src/utils/upload-media.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,OAAO,KAAK,EACX,cAAc,EAEd,eAAe,EACf,cAAc,EACd,MAAM,SAAS,CAAC;AAOjB,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,6BAA6B,CAAC,EAAE,OAAO,CAAC;KACxC;CACD;AAED,UAAU,eAAe;IAExB,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB,SAAS,EAAE,IAAI,EAAE,CAAC;IAElB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB,YAAY,CAAC,EAAE,eAAe,CAAC;IAE/B,kBAAkB,CAAC,EAAE,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,GAAG,IAAI,CAAC;IAErD,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAE,EAC5B,kBAAkB,EAClB,YAAY,EACZ,cAAmB,EACnB,SAAS,EACT,iBAAiB,EACjB,OAAO,EACP,YAAY,EACZ,MAAM,GACN,EAAE,eAAe,QAwFjB"}
1
+ {"version":3,"file":"upload-media.d.ts","sourceRoot":"","sources":["../../src/utils/upload-media.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,OAAO,KAAK,EACX,cAAc,EAEd,eAAe,EACf,cAAc,EACd,MAAM,SAAS,CAAC;AAOjB,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,6BAA6B,CAAC,EAAE,OAAO,CAAC;KACxC;CACD;AAED,UAAU,eAAe;IAExB,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB,SAAS,EAAE,IAAI,EAAE,CAAC;IAElB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB,YAAY,CAAC,EAAE,eAAe,CAAC;IAE/B,kBAAkB,CAAC,EAAE,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,GAAG,IAAI,CAAC;IAErD,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAE,EAC5B,kBAAkB,EAClB,YAAY,EACZ,cAAmB,EACnB,SAAS,EACT,iBAAiB,EACjB,OAAO,EACP,YAAY,EACZ,MAAM,EACN,QAAe,GACf,EAAE,eAAe,QAqGjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/media-utils",
3
- "version": "5.18.0",
3
+ "version": "5.19.1",
4
4
  "description": "WordPress Media Upload Utils.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -29,14 +29,14 @@
29
29
  "types": "build-types",
30
30
  "dependencies": {
31
31
  "@babel/runtime": "7.25.7",
32
- "@wordpress/api-fetch": "^7.18.0",
33
- "@wordpress/blob": "^4.18.0",
34
- "@wordpress/element": "^6.18.0",
35
- "@wordpress/i18n": "^5.18.0",
36
- "@wordpress/private-apis": "^1.18.0"
32
+ "@wordpress/api-fetch": "^7.19.1",
33
+ "@wordpress/blob": "^4.19.1",
34
+ "@wordpress/element": "^6.19.1",
35
+ "@wordpress/i18n": "^5.19.1",
36
+ "@wordpress/private-apis": "^1.19.1"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "afe4fb333177642180ac020f1030c5685eab7183"
41
+ "gitHead": "6f49fee89f840761f7fedf662713cbd4a71723e9"
42
42
  }
@@ -26,10 +26,10 @@ describe( 'uploadMedia', () => {
26
26
  jest.clearAllMocks();
27
27
  } );
28
28
 
29
- it( 'should do nothing on no files', async () => {
29
+ it( 'should do nothing on no files', () => {
30
30
  const onError = jest.fn();
31
31
  const onFileChange = jest.fn();
32
- await uploadMedia( {
32
+ uploadMedia( {
33
33
  filesList: [],
34
34
  onError,
35
35
  onFileChange,
@@ -39,10 +39,10 @@ describe( 'uploadMedia', () => {
39
39
  expect( uploadToServer ).not.toHaveBeenCalled();
40
40
  } );
41
41
 
42
- it( 'should error if allowedTypes contains a partial mime type and the validation fails', async () => {
42
+ it( 'should error if allowedTypes contains a partial mime type and the validation fails', () => {
43
43
  const onError = jest.fn();
44
44
  const onFileChange = jest.fn();
45
- await uploadMedia( {
45
+ uploadMedia( {
46
46
  allowedTypes: [ 'image' ],
47
47
  filesList: [ xmlFile ],
48
48
  onError,
@@ -60,10 +60,10 @@ describe( 'uploadMedia', () => {
60
60
  expect( uploadToServer ).not.toHaveBeenCalled();
61
61
  } );
62
62
 
63
- it( 'should error if allowedTypes contains a complete mime type and the validation fails', async () => {
63
+ it( 'should error if allowedTypes contains a complete mime type and the validation fails', () => {
64
64
  const onError = jest.fn();
65
65
  const onFileChange = jest.fn();
66
- await uploadMedia( {
66
+ uploadMedia( {
67
67
  allowedTypes: [ 'image/gif' ],
68
68
  filesList: [ imageFile ],
69
69
  onError,
@@ -81,10 +81,10 @@ describe( 'uploadMedia', () => {
81
81
  expect( uploadToServer ).not.toHaveBeenCalled();
82
82
  } );
83
83
 
84
- it( 'should work if allowedTypes contains a complete mime type and the validation succeeds', async () => {
84
+ it( 'should work if allowedTypes contains a complete mime type and the validation succeeds', () => {
85
85
  const onError = jest.fn();
86
86
  const onFileChange = jest.fn();
87
- await uploadMedia( {
87
+ uploadMedia( {
88
88
  allowedTypes: [ 'image/jpeg' ],
89
89
  filesList: [ imageFile ],
90
90
  onError,
@@ -96,10 +96,10 @@ describe( 'uploadMedia', () => {
96
96
  expect( uploadToServer ).toHaveBeenCalled();
97
97
  } );
98
98
 
99
- it( 'should error if allowedTypes contains multiple types and the validation fails', async () => {
99
+ it( 'should error if allowedTypes contains multiple types and the validation fails', () => {
100
100
  const onError = jest.fn();
101
101
  const onFileChange = jest.fn();
102
- await uploadMedia( {
102
+ uploadMedia( {
103
103
  allowedTypes: [ 'video', 'image' ],
104
104
  filesList: [ xmlFile ],
105
105
  onError,
@@ -117,10 +117,10 @@ describe( 'uploadMedia', () => {
117
117
  expect( uploadToServer ).not.toHaveBeenCalled();
118
118
  } );
119
119
 
120
- it( 'should work if allowedTypes contains multiple types and the validation succeeds', async () => {
120
+ it( 'should work if allowedTypes contains multiple types and the validation succeeds', () => {
121
121
  const onError = jest.fn();
122
122
  const onFileChange = jest.fn();
123
- await uploadMedia( {
123
+ uploadMedia( {
124
124
  allowedTypes: [ 'video', 'image' ],
125
125
  filesList: [ imageFile ],
126
126
  onError,
@@ -132,10 +132,10 @@ describe( 'uploadMedia', () => {
132
132
  expect( uploadToServer ).toHaveBeenCalled();
133
133
  } );
134
134
 
135
- it( 'should only fail the invalid file and still allow others to succeed when uploading multiple files', async () => {
135
+ it( 'should only fail the invalid file and still allow others to succeed when uploading multiple files', () => {
136
136
  const onError = jest.fn();
137
137
  const onFileChange = jest.fn();
138
- await uploadMedia( {
138
+ uploadMedia( {
139
139
  allowedTypes: [ 'image' ],
140
140
  filesList: [ imageFile, xmlFile ],
141
141
  onError,
@@ -154,10 +154,10 @@ describe( 'uploadMedia', () => {
154
154
  expect( uploadToServer ).toHaveBeenCalledTimes( 1 );
155
155
  } );
156
156
 
157
- it( 'should error if the file size is greater than the maximum', async () => {
157
+ it( 'should error if the file size is greater than the maximum', () => {
158
158
  const onError = jest.fn();
159
159
  const onFileChange = jest.fn();
160
- await uploadMedia( {
160
+ uploadMedia( {
161
161
  allowedTypes: [ 'image' ],
162
162
  filesList: [ imageFile ],
163
163
  maxUploadFileSize: 1,
@@ -177,9 +177,9 @@ describe( 'uploadMedia', () => {
177
177
  expect( uploadToServer ).not.toHaveBeenCalled();
178
178
  } );
179
179
 
180
- it( 'should call error handler with the correct error object if file type is not allowed for user', async () => {
180
+ it( 'should call error handler with the correct error object if file type is not allowed for user', () => {
181
181
  const onError = jest.fn();
182
- await uploadMedia( {
182
+ uploadMedia( {
183
183
  allowedTypes: [ 'image' ],
184
184
  filesList: [ imageFile ],
185
185
  onError,
@@ -196,4 +196,42 @@ describe( 'uploadMedia', () => {
196
196
  );
197
197
  expect( uploadToServer ).not.toHaveBeenCalled();
198
198
  } );
199
+
200
+ it( 'should throw error when multiple files are selected in single file upload mode', () => {
201
+ const onError = jest.fn();
202
+ uploadMedia( {
203
+ filesList: [ imageFile, xmlFile ],
204
+ onError,
205
+ multiple: false,
206
+ } );
207
+
208
+ expect( onError ).toHaveBeenCalledWith(
209
+ new Error( 'Only one file can be used here.' )
210
+ );
211
+ expect( uploadToServer ).not.toHaveBeenCalled();
212
+ } );
213
+
214
+ it( 'should return error that is not an Error object', () => {
215
+ ( uploadToServer as jest.Mock ).mockImplementation( () => {
216
+ throw {
217
+ code: 'fetch_error',
218
+ message: 'You are probably offline.',
219
+ };
220
+ } );
221
+
222
+ const onError = jest.fn();
223
+ uploadMedia( {
224
+ filesList: [ imageFile ],
225
+ onError,
226
+ multiple: false,
227
+ } );
228
+
229
+ expect( onError ).toHaveBeenCalledWith(
230
+ new UploadError( {
231
+ code: 'GENERAL',
232
+ message: 'You are probably offline.',
233
+ file: imageFile,
234
+ } )
235
+ );
236
+ } );
199
237
  } );
@@ -42,6 +42,8 @@ interface UploadMediaArgs {
42
42
  wpAllowedMimeTypes?: Record< string, string > | null;
43
43
  // Abort signal.
44
44
  signal?: AbortSignal;
45
+ // Whether to allow multiple files to be uploaded.
46
+ multiple?: boolean;
45
47
  }
46
48
 
47
49
  /**
@@ -57,6 +59,7 @@ interface UploadMediaArgs {
57
59
  * @param $0.onFileChange Function called each time a file or a temporary representation of the file is available.
58
60
  * @param $0.wpAllowedMimeTypes List of allowed mime types and file extensions.
59
61
  * @param $0.signal Abort signal.
62
+ * @param $0.multiple Whether to allow multiple files to be uploaded.
60
63
  */
61
64
  export function uploadMedia( {
62
65
  wpAllowedMimeTypes,
@@ -67,7 +70,13 @@ export function uploadMedia( {
67
70
  onError,
68
71
  onFileChange,
69
72
  signal,
73
+ multiple = true,
70
74
  }: UploadMediaArgs ) {
75
+ if ( ! multiple && filesList.length > 1 ) {
76
+ onError?.( new Error( __( 'Only one file can be used here.' ) ) );
77
+ return;
78
+ }
79
+
71
80
  const validFiles = [];
72
81
 
73
82
  const filesSet: Array< Partial< Attachment > | null > = [];
@@ -134,9 +143,17 @@ export function uploadMedia( {
134
143
  // Reset to empty on failure.
135
144
  setAndUpdateFiles( index, null );
136
145
 
137
- let message;
138
- if ( error instanceof Error ) {
139
- message = error.message;
146
+ // @wordpress/api-fetch throws any response that isn't in the 200 range as-is.
147
+ let message: string;
148
+ if (
149
+ typeof error === 'object' &&
150
+ error !== null &&
151
+ 'message' in error
152
+ ) {
153
+ message =
154
+ typeof error.message === 'string'
155
+ ? error.message
156
+ : String( error.message );
140
157
  } else {
141
158
  message = sprintf(
142
159
  // translators: %s: file name
@@ -1 +1 @@
1
- {"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/react/index.d.ts","../element/build-types/create-interpolate-element.d.ts","../element/build-types/react.d.ts","../../node_modules/@types/react-dom/index.d.ts","../../node_modules/@types/react-dom/client.d.ts","../element/build-types/react-platform.d.ts","../element/build-types/utils.d.ts","../element/build-types/platform.d.ts","../element/build-types/serialize.d.ts","../element/build-types/raw-html.d.ts","../element/build-types/index.d.ts","../i18n/build-types/sprintf.d.ts","../hooks/build-types/createAddHook.d.ts","../hooks/build-types/createRemoveHook.d.ts","../hooks/build-types/createHasHook.d.ts","../hooks/build-types/createDoingHook.d.ts","../hooks/build-types/createDidHook.d.ts","../hooks/build-types/createHooks.d.ts","../hooks/build-types/index.d.ts","../i18n/build-types/create-i18n.d.ts","../i18n/build-types/default-i18n.d.ts","../i18n/build-types/index.d.ts","./src/components/media-upload/index.js","./src/components/index.js","../blob/build-types/index.d.ts","./src/utils/types.ts","../api-fetch/build-types/types.d.ts","../api-fetch/build-types/middlewares/nonce.d.ts","../api-fetch/build-types/middlewares/preloading.d.ts","../api-fetch/build-types/middlewares/root-url.d.ts","../api-fetch/build-types/middlewares/fetch-all-middleware.d.ts","../api-fetch/build-types/middlewares/media-upload.d.ts","../api-fetch/build-types/middlewares/theme-preview.d.ts","../api-fetch/build-types/index.d.ts","./src/utils/flatten-form-data.ts","./src/utils/transform-attachment.ts","./src/utils/upload-to-server.ts","./src/utils/upload-error.ts","./src/utils/validate-mime-type.ts","./src/utils/get-mime-types-array.ts","./src/utils/validate-mime-type-for-user.ts","./src/utils/validate-file-size.ts","./src/utils/upload-media.ts","./src/utils/sideload-to-server.ts","./src/utils/sideload-media.ts","../private-apis/build-types/implementation.d.ts","../private-apis/build-types/index.d.ts","./src/lock-unlock.ts","./src/private-apis.ts","./src/index.ts","../../typings/gutenberg-env/index.d.ts"],"fileIdsList":[[82],[79,80,81],[108,109,110,111,112,113,114],[108],[83,84,87,88,89,90,91],[85,86],[100],[94,95,96,97,98,100],[94,95,96,97,98,99],[101],[93,101,102],[104],[92,103],[105,107,117,120,122,123,124,130],[128],[126,129],[103,107,119,125],[107,115,116,117],[107],[103,106,107,118,119,120,122,123],[103,119],[103,119,121],[127]],"fileInfos":[{"version":"e41c290ef7dd7dab3493e6cbe5909e0148edf4a8dad0271be08edec368a0f7b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"e12a46ce14b817d4c9e6b2b478956452330bf00c9801b79de46f7a1815b5bd40","impliedFormat":1},{"version":"4fd3f3422b2d2a3dfd5cdd0f387b3a8ec45f006c6ea896a4cb41264c2100bb2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"69e65d976bf166ce4a9e6f6c18f94d2424bf116e90837ace179610dbccad9b42","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"62bb211266ee48b2d0edf0d8d1b191f0c24fc379a82bd4c1692a082c540bc6b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f1e2a172204962276504466a6393426d2ca9c54894b1ad0a6c9dad867a65f876","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"bab26767638ab3557de12c900f0b91f710c7dc40ee9793d5a27d32c04f0bf646","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"61d6a2092f48af66dbfb220e31eea8b10bc02b6932d6e529005fd2d7b3281290","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"55461596dc873b866911ef4e640fae4c39da7ac1fbc7ef5e649cb2f2fb42c349","affectsGlobalScope":true,"impliedFormat":1},{"version":"4c68749a564a6facdf675416d75789ee5a557afda8960e0803cf6711fa569288","impliedFormat":1},{"version":"f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","impliedFormat":1},{"version":"8ca4709dbd22a34bcc1ebf93e1877645bdb02ebd3f3d9a211a299a8db2ee4ba1","affectsGlobalScope":true,"impliedFormat":1},"4c506b14512049dfe6f4ceb172b13c6af03663f85ba61fc57efbe6c2e7be9f44","4405cd67ec5f7f748fd793be0ce5842fa0808955b8e37518c011abfa5ab63ba5",{"version":"adb17fea4d847e1267ae1241fa1ac3917c7e332999ebdab388a24d82d4f58240","impliedFormat":1},{"version":"05321b823dd3781d0b6aac8700bfdc0c9181d56479fe52ba6a40c9196fd661a8","impliedFormat":1},"472c14cdec534a465e866b6e1feee2d4e0d89c15fdc33ba80ff034fa0e80f3c1","4d807d55c784b72f71c092c34c84d09b95c29500c30252538fd5cf9a0a788c0e","df43a3968118d4b16618d7a0ac8ba89337fcce3c39e39984087ac34bf0cf250c","4714d89e7ea47b8f79a4d448a11674b2a724f93ab03cfa6879dafbab0f0c5a15","cb9a03b327570c1eae5c82a48604ef697ad1a6264ed0490743a3449de61a4fff","af88a0b0f808a6721401550621bfe67c46c6fd55000305058e7c73600d119a9b","2f1fe46a7a4e25a4a414d5491c7b39b695a6f37e97a1bdfeb71d430f98c3ed10","20f2b0befb27c07049565340fac3ab264c94afebacb3234dfb945e1c4a8ab5fb","c7048acaf5edb534ee4a29e8469c7cdd87cfc40b5518a7983b7d83c2fcc5baa2","0b48405ec967a9982c1001d4222b1c64091aba1441fc4318b08bc1cd4036794a","12324a25a603147ab9cf9724d762a767dd8b22c3b4f3ea44357bb937565509c3","7966497f2357f63036d7c12917ee20d91b7a74c4d9d682e75c44f7b7f6ea4e5b","4fa795e77b24d2a64eab73b8bc2c8c5992b629570e0c2bfc9bb475c312d79c65","5061f5719dccae0d9ed5b195d2dc4ec5c08d1a34c84d57c7b3b9be8a820b58bd","50e548bea2aae3be6c1d077f39478b3a88734ea851be7c541ed8fc9f9ed86e0b","061e88a6b235d5dd90a3cb8af8d27f397fd069e1bed76a5c7617b1c00a395ba7","2a49b24214a9709c04c7d21d99f1473058bd3b4d1310655288347a4c8862da30",{"version":"2e23240c950cd02e164342a553f459d446d8c2d8b471b902a190e07e2123a052","signature":"0fa85a5e0637bb2370962768f4f28ff0a4e00dbbf7469964d9b35fe24e445331"},{"version":"1046d3ac059363b0160758674a343e23a5262c6fe4ecf75aaa622f1681c11e55","signature":"370f606498ffd6b82bc16091c77b55c219f42093b2d0dbe6f85631eceb70069e"},"26dbb5d43d71f83d67778a513a7b130555d5d844bce071e340373e69d7ca3c8f",{"version":"ee69cf232d3ee9674b19d29866995d21eea59f7ee37e8426c2bfa86bf07f040f","signature":"de7810eb7b9445ae0e486b9d13d03b9c25a3df4fbf634096a334380e15da9857"},"3482d13bc405611566ba123aad79452857745448142396834295f9180c256698","e365ba12b07112503bbbd9288f0c9ca4bf489be7fdfad34a1283057151715809","3ca242600b64f805e6b2c5184538aa74d75842f9fad69bad0afa859aca385c38","8be7afaa20cb8fe823c7efc4757166924731e6c0cb224a25052d2ce698c5e3be","42886bbaee379c1c9c75850ff45d71f25f9c077dd80059795b319cebeac941f0","5718e06ca02fd4da961d57375d8fd21f0ec4deffd243b9daa46a3f71e1c44c1d","b73ca7483e8207e6c359cab77d1b02352993c833ebc025cbf0044d056cf03010","16bee3e299a6c1ddf12e8175ca75de044b097211eac8a1e6cd0c972a4b279419",{"version":"da3bb674c1182d84093929be7871ad700e21e0b7daea1da441a3eead717874c6","signature":"8a03de0a8ccd986f069e47e746e880ff5752474c68cfbe8475bee2b798050cbf"},{"version":"fe5754aa45b8acd6511d03bff4daf9d61b87d715af248044424f4c1c624a172d","signature":"040bbe5b8fae690cef078d6f0a2c83876d1204577369421cedc1e264ca21393d"},{"version":"96cce577a689f2741284cb548ca9e1090154c4b939a93789d509066392c172ce","signature":"5102357e4b7452b8afd38b2f4c509e1079fdddef1c8c5dedc934b7ff0e3e9235"},{"version":"916cdcd1b368ffd1783a4a04162b508d6c8408c3f21b9ed6c880e596e66c4414","signature":"f29b397bbb375815f7ae0a30e5abe4d6921893eecabd15f2a2a26ac1b767978b"},{"version":"6469831c12f693df087d37a6e97e9fffab133f7798f90b486dfc9552c389cef0","signature":"cb87a039169f10e3e3cc92416c20ccd04d8841a4b7ba12ddaf68ebec2e9feea5"},{"version":"3dfd2b6e204c409e473e9141999af424c4c49fb04add6c0679f43c0bd9684e3d","signature":"1c39a61f95b134bb96a287a458ae5d67d659e1cbddcb99ae19617a3962558a14"},{"version":"c3c7068bfefc188ec3b622e0e160f5d572d140daf8cc9f5a6f7283d5749f0765","signature":"da598aa05f7892c3f3371e0d62d5b9d574786215e3d0b82b1d0cf247688a540a"},{"version":"5cf9279015909d07c027fdc725de54ffb602487685bbb9c98e63d70c7a1f620f","signature":"9e11037f69d3b5d4f0d623aa90f00d5936af06a1d90cd6ede7d0ec5f9939ee87"},{"version":"aa572dbfba4b3ab6facb0955bca8847cadcc61c329a329eb38a69cc4b0f98ae8","signature":"4b339607208f97f3c80b7e1416a064499562afd9090709342c7b3f6291324dd7","affectsGlobalScope":true},{"version":"7c5cc67d06c89313e959152a7f54771f79f165dfcd25725a781b96e0407c068a","signature":"396df3a52386088ab3abe1dbc71dac03fdb423af4d1f13caad2999053e5210a6"},{"version":"9e880984fc3adecc07e4c486f442c95f0d8e7bfa2bee03e1103da29ae0b27c94","signature":"2dd72cb51291a41a03bfe8cafe916e92a311aadd0bd1784539ef2cfe2438799d"},"5b9f56c97568e99fab40c05cb5802c6037895e09ff4b9d2c0fb5a0c924dae3a8","9562b4736c07eaf98388858acff6157eafae0b51df775cbba5bfdf4733de00b3",{"version":"0e90888c950842a739ab152d0cfd8652f8c61c97d1af6ba7dab29422bbb8d74c","signature":"77c324d351ba141229fc1f5acc7868be9bb38ebdf2304ecd819f0555fbad34fa"},{"version":"795f7e877f5d3432e446e484a2616c4d58c747b28cbbbe2a34a314865e338303","signature":"f19f46d8b0a8bcc8bc9f9d83e947b6fb5e7ddb5a774acb2c8f9c65966901c918"},{"version":"24d9f10b8a97863b3d62a3312b0e46dc7776ecba29131e67f989e34a34d8a56d","signature":"cb0e2bc9d23203ba8f644ffa3b1793bda639a830d1dbc0be61a4fef4e976281b"},{"version":"cd62baba8e325afe998a6537894fcc0420146c242e1b6fdfdaaadfd21dc0d969","affectsGlobalScope":true}],"root":[104,105,107,[116,126],[129,131]],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":false,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"rootDir":"./src","skipDefaultLibCheck":true,"strict":true,"target":99},"referencedMap":[[86,1],[85,1],[82,2],[115,3],[112,4],[113,4],[109,4],[110,4],[111,4],[114,4],[83,1],[92,5],[91,1],[87,6],[84,1],[90,1],[94,7],[98,7],[97,7],[96,7],[99,8],[95,7],[100,9],[101,7],[102,10],[103,11],[105,12],[104,13],[131,14],[129,15],[130,16],[126,17],[125,18],[117,19],[124,20],[118,18],[123,21],[122,22],[120,21],[128,23]],"latestChangedDtsFile":"./build-types/index.d.ts","version":"5.7.2"}
1
+ {"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/react/index.d.ts","../element/build-types/create-interpolate-element.d.ts","../element/build-types/react.d.ts","../../node_modules/@types/react-dom/index.d.ts","../../node_modules/@types/react-dom/client.d.ts","../element/build-types/react-platform.d.ts","../element/build-types/utils.d.ts","../element/build-types/platform.d.ts","../element/build-types/serialize.d.ts","../element/build-types/raw-html.d.ts","../element/build-types/index.d.ts","../i18n/build-types/sprintf.d.ts","../hooks/build-types/createAddHook.d.ts","../hooks/build-types/createRemoveHook.d.ts","../hooks/build-types/createHasHook.d.ts","../hooks/build-types/createDoingHook.d.ts","../hooks/build-types/createDidHook.d.ts","../hooks/build-types/createHooks.d.ts","../hooks/build-types/index.d.ts","../i18n/build-types/create-i18n.d.ts","../i18n/build-types/default-i18n.d.ts","../i18n/build-types/index.d.ts","./src/components/media-upload/index.js","./src/components/index.js","../blob/build-types/index.d.ts","./src/utils/types.ts","../api-fetch/build-types/types.d.ts","../api-fetch/build-types/middlewares/nonce.d.ts","../api-fetch/build-types/middlewares/preloading.d.ts","../api-fetch/build-types/middlewares/root-url.d.ts","../api-fetch/build-types/middlewares/fetch-all-middleware.d.ts","../api-fetch/build-types/middlewares/media-upload.d.ts","../api-fetch/build-types/middlewares/theme-preview.d.ts","../api-fetch/build-types/index.d.ts","./src/utils/flatten-form-data.ts","./src/utils/transform-attachment.ts","./src/utils/upload-to-server.ts","./src/utils/upload-error.ts","./src/utils/validate-mime-type.ts","./src/utils/get-mime-types-array.ts","./src/utils/validate-mime-type-for-user.ts","./src/utils/validate-file-size.ts","./src/utils/upload-media.ts","./src/utils/sideload-to-server.ts","./src/utils/sideload-media.ts","../private-apis/build-types/implementation.d.ts","../private-apis/build-types/index.d.ts","./src/lock-unlock.ts","./src/private-apis.ts","./src/index.ts","../../typings/gutenberg-env/index.d.ts"],"fileIdsList":[[82],[79,80,81],[108,109,110,111,112,113,114],[108],[83,84,87,88,89,90,91],[85,86],[100],[94,95,96,97,98,100],[94,95,96,97,98,99],[101],[93,101,102],[104],[92,103],[105,107,117,120,122,123,124,130],[128],[126,129],[103,107,119,125],[107,115,116,117],[107],[103,106,107,118,119,120,122,123],[103,119],[103,119,121],[127]],"fileInfos":[{"version":"e41c290ef7dd7dab3493e6cbe5909e0148edf4a8dad0271be08edec368a0f7b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"e12a46ce14b817d4c9e6b2b478956452330bf00c9801b79de46f7a1815b5bd40","impliedFormat":1},{"version":"4fd3f3422b2d2a3dfd5cdd0f387b3a8ec45f006c6ea896a4cb41264c2100bb2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"69e65d976bf166ce4a9e6f6c18f94d2424bf116e90837ace179610dbccad9b42","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"62bb211266ee48b2d0edf0d8d1b191f0c24fc379a82bd4c1692a082c540bc6b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f1e2a172204962276504466a6393426d2ca9c54894b1ad0a6c9dad867a65f876","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"bab26767638ab3557de12c900f0b91f710c7dc40ee9793d5a27d32c04f0bf646","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"61d6a2092f48af66dbfb220e31eea8b10bc02b6932d6e529005fd2d7b3281290","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"55461596dc873b866911ef4e640fae4c39da7ac1fbc7ef5e649cb2f2fb42c349","affectsGlobalScope":true,"impliedFormat":1},{"version":"4c68749a564a6facdf675416d75789ee5a557afda8960e0803cf6711fa569288","impliedFormat":1},{"version":"f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","impliedFormat":1},{"version":"8ca4709dbd22a34bcc1ebf93e1877645bdb02ebd3f3d9a211a299a8db2ee4ba1","affectsGlobalScope":true,"impliedFormat":1},"4c506b14512049dfe6f4ceb172b13c6af03663f85ba61fc57efbe6c2e7be9f44","4405cd67ec5f7f748fd793be0ce5842fa0808955b8e37518c011abfa5ab63ba5",{"version":"adb17fea4d847e1267ae1241fa1ac3917c7e332999ebdab388a24d82d4f58240","impliedFormat":1},{"version":"05321b823dd3781d0b6aac8700bfdc0c9181d56479fe52ba6a40c9196fd661a8","impliedFormat":1},"472c14cdec534a465e866b6e1feee2d4e0d89c15fdc33ba80ff034fa0e80f3c1","4d807d55c784b72f71c092c34c84d09b95c29500c30252538fd5cf9a0a788c0e","df43a3968118d4b16618d7a0ac8ba89337fcce3c39e39984087ac34bf0cf250c","4714d89e7ea47b8f79a4d448a11674b2a724f93ab03cfa6879dafbab0f0c5a15","cb9a03b327570c1eae5c82a48604ef697ad1a6264ed0490743a3449de61a4fff","af88a0b0f808a6721401550621bfe67c46c6fd55000305058e7c73600d119a9b","2f1fe46a7a4e25a4a414d5491c7b39b695a6f37e97a1bdfeb71d430f98c3ed10","20f2b0befb27c07049565340fac3ab264c94afebacb3234dfb945e1c4a8ab5fb","c7048acaf5edb534ee4a29e8469c7cdd87cfc40b5518a7983b7d83c2fcc5baa2","0b48405ec967a9982c1001d4222b1c64091aba1441fc4318b08bc1cd4036794a","12324a25a603147ab9cf9724d762a767dd8b22c3b4f3ea44357bb937565509c3","7966497f2357f63036d7c12917ee20d91b7a74c4d9d682e75c44f7b7f6ea4e5b","4fa795e77b24d2a64eab73b8bc2c8c5992b629570e0c2bfc9bb475c312d79c65","5061f5719dccae0d9ed5b195d2dc4ec5c08d1a34c84d57c7b3b9be8a820b58bd","50e548bea2aae3be6c1d077f39478b3a88734ea851be7c541ed8fc9f9ed86e0b","061e88a6b235d5dd90a3cb8af8d27f397fd069e1bed76a5c7617b1c00a395ba7","2a49b24214a9709c04c7d21d99f1473058bd3b4d1310655288347a4c8862da30",{"version":"2e23240c950cd02e164342a553f459d446d8c2d8b471b902a190e07e2123a052","signature":"0fa85a5e0637bb2370962768f4f28ff0a4e00dbbf7469964d9b35fe24e445331"},{"version":"1046d3ac059363b0160758674a343e23a5262c6fe4ecf75aaa622f1681c11e55","signature":"370f606498ffd6b82bc16091c77b55c219f42093b2d0dbe6f85631eceb70069e"},"26dbb5d43d71f83d67778a513a7b130555d5d844bce071e340373e69d7ca3c8f",{"version":"ee69cf232d3ee9674b19d29866995d21eea59f7ee37e8426c2bfa86bf07f040f","signature":"de7810eb7b9445ae0e486b9d13d03b9c25a3df4fbf634096a334380e15da9857"},"3482d13bc405611566ba123aad79452857745448142396834295f9180c256698","e365ba12b07112503bbbd9288f0c9ca4bf489be7fdfad34a1283057151715809","3ca242600b64f805e6b2c5184538aa74d75842f9fad69bad0afa859aca385c38","8be7afaa20cb8fe823c7efc4757166924731e6c0cb224a25052d2ce698c5e3be","42886bbaee379c1c9c75850ff45d71f25f9c077dd80059795b319cebeac941f0","5718e06ca02fd4da961d57375d8fd21f0ec4deffd243b9daa46a3f71e1c44c1d","b73ca7483e8207e6c359cab77d1b02352993c833ebc025cbf0044d056cf03010","16bee3e299a6c1ddf12e8175ca75de044b097211eac8a1e6cd0c972a4b279419",{"version":"da3bb674c1182d84093929be7871ad700e21e0b7daea1da441a3eead717874c6","signature":"8a03de0a8ccd986f069e47e746e880ff5752474c68cfbe8475bee2b798050cbf"},{"version":"fe5754aa45b8acd6511d03bff4daf9d61b87d715af248044424f4c1c624a172d","signature":"040bbe5b8fae690cef078d6f0a2c83876d1204577369421cedc1e264ca21393d"},{"version":"96cce577a689f2741284cb548ca9e1090154c4b939a93789d509066392c172ce","signature":"5102357e4b7452b8afd38b2f4c509e1079fdddef1c8c5dedc934b7ff0e3e9235"},{"version":"916cdcd1b368ffd1783a4a04162b508d6c8408c3f21b9ed6c880e596e66c4414","signature":"f29b397bbb375815f7ae0a30e5abe4d6921893eecabd15f2a2a26ac1b767978b"},{"version":"6469831c12f693df087d37a6e97e9fffab133f7798f90b486dfc9552c389cef0","signature":"cb87a039169f10e3e3cc92416c20ccd04d8841a4b7ba12ddaf68ebec2e9feea5"},{"version":"3dfd2b6e204c409e473e9141999af424c4c49fb04add6c0679f43c0bd9684e3d","signature":"1c39a61f95b134bb96a287a458ae5d67d659e1cbddcb99ae19617a3962558a14"},{"version":"c3c7068bfefc188ec3b622e0e160f5d572d140daf8cc9f5a6f7283d5749f0765","signature":"da598aa05f7892c3f3371e0d62d5b9d574786215e3d0b82b1d0cf247688a540a"},{"version":"5cf9279015909d07c027fdc725de54ffb602487685bbb9c98e63d70c7a1f620f","signature":"9e11037f69d3b5d4f0d623aa90f00d5936af06a1d90cd6ede7d0ec5f9939ee87"},{"version":"552e42968fc8417a5bb16e9521d7f0646ddaccdc8e8789151bc60f112eee90e8","signature":"03d0064845d977c14cbb5112a0ee180f84f49d5691170a87d570b4d3807aacd8","affectsGlobalScope":true},{"version":"7c5cc67d06c89313e959152a7f54771f79f165dfcd25725a781b96e0407c068a","signature":"396df3a52386088ab3abe1dbc71dac03fdb423af4d1f13caad2999053e5210a6"},{"version":"9e880984fc3adecc07e4c486f442c95f0d8e7bfa2bee03e1103da29ae0b27c94","signature":"2dd72cb51291a41a03bfe8cafe916e92a311aadd0bd1784539ef2cfe2438799d"},"5b9f56c97568e99fab40c05cb5802c6037895e09ff4b9d2c0fb5a0c924dae3a8","9562b4736c07eaf98388858acff6157eafae0b51df775cbba5bfdf4733de00b3",{"version":"0e90888c950842a739ab152d0cfd8652f8c61c97d1af6ba7dab29422bbb8d74c","signature":"77c324d351ba141229fc1f5acc7868be9bb38ebdf2304ecd819f0555fbad34fa"},{"version":"795f7e877f5d3432e446e484a2616c4d58c747b28cbbbe2a34a314865e338303","signature":"f19f46d8b0a8bcc8bc9f9d83e947b6fb5e7ddb5a774acb2c8f9c65966901c918"},{"version":"24d9f10b8a97863b3d62a3312b0e46dc7776ecba29131e67f989e34a34d8a56d","signature":"cb0e2bc9d23203ba8f644ffa3b1793bda639a830d1dbc0be61a4fef4e976281b"},{"version":"cd62baba8e325afe998a6537894fcc0420146c242e1b6fdfdaaadfd21dc0d969","affectsGlobalScope":true}],"root":[104,105,107,[116,126],[129,131]],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":false,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"rootDir":"./src","skipDefaultLibCheck":true,"strict":true,"target":99},"referencedMap":[[86,1],[85,1],[82,2],[115,3],[112,4],[113,4],[109,4],[110,4],[111,4],[114,4],[83,1],[92,5],[91,1],[87,6],[84,1],[90,1],[94,7],[98,7],[97,7],[96,7],[99,8],[95,7],[100,9],[101,7],[102,10],[103,11],[105,12],[104,13],[131,14],[129,15],[130,16],[126,17],[125,18],[117,19],[124,20],[118,18],[123,21],[122,22],[120,21],[128,23]],"latestChangedDtsFile":"./build-types/index.d.ts","version":"5.7.2"}