@wordpress/media-utils 5.14.0 → 5.15.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.15.0 (2025-01-02)
6
+
5
7
  ## 5.14.0 (2024-12-11)
6
8
 
7
9
  ## 5.13.0 (2024-11-27)
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## Gutenberg
2
2
 
3
- Copyright 2016-2024 by the contributors
3
+ Copyright 2016-2025 by the contributors
4
4
 
5
5
  **License for Contributions (on and after April 15, 2021)**
6
6
 
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/media-utils/src/utils/types.ts"],"sourcesContent":["/**\n * A media attachment object in a REST API context.\n *\n * Simplified version of what's defined in the wp-types package.\n *\n * @see https://www.npmjs.com/package/wp-types\n */\ninterface WP_REST_API_Attachment {\n\t/**\n\t * Unique identifier for the attachment.\n\t */\n\tid: number;\n\t/**\n\t * The ID of the featured media for the post.\n\t */\n\tfeatured_media: number;\n\t/**\n\t * URL to the attachment.\n\t */\n\tlink: string;\n\t/**\n\t * The date the attachment was published, in the site's timezone.\n\t */\n\tdate: string;\n\t/**\n\t * The date the attachment was published, as GMT.\n\t */\n\tdate_gmt: string;\n\t/**\n\t * The date the attachment was last modified, in the site's timezone.\n\t */\n\tmodified: string;\n\t/**\n\t * The date the attachment was last modified, as GMT.\n\t */\n\tmodified_gmt: string;\n\t/**\n\t * An alphanumeric identifier for the attachment unique to its type.\n\t */\n\tslug: string;\n\t/**\n\t * A named status for the attachment.\n\t */\n\tstatus: string;\n\t/**\n\t * Type of Post for the attachment.\n\t */\n\ttype: 'attachment';\n\t/**\n\t * Alternative text to display when attachment is not displayed.\n\t */\n\talt_text: string;\n\t/**\n\t * The attachment caption.\n\t */\n\tcaption: {\n\t\t/**\n\t\t * Caption for the attachment, as it exists in the database. Only present when using the 'edit' context.\n\t\t */\n\t\traw?: string;\n\t\t/**\n\t\t * HTML caption for the attachment, transformed for display.\n\t\t */\n\t\trendered: string;\n\t};\n\t/**\n\t * The attachment description.\n\t */\n\tdescription: {\n\t\t/**\n\t\t * Description for the attachment, as it exists in the database. Only present when using the 'edit' context.\n\t\t */\n\t\traw?: string;\n\t\t/**\n\t\t * HTML description for the attachment, transformed for display.\n\t\t */\n\t\trendered: string;\n\t};\n\t/**\n\t * Attachment type.\n\t */\n\tmedia_type: 'image' | 'file';\n\t/**\n\t * The attachment MIME type.\n\t */\n\tmime_type: string;\n\t/**\n\t * Details about the media file, specific to its type.\n\t */\n\tmedia_details: {\n\t\t[ k: string ]: unknown;\n\t};\n\t/**\n\t * The ID for the associated post of the attachment.\n\t */\n\tpost: number | null;\n\t/**\n\t * URL to the original attachment file.\n\t */\n\tsource_url: string;\n\t/**\n\t * List of the missing image sizes of the attachment. Only present when using the 'edit' context.\n\t */\n\tmissing_image_sizes?: string[];\n\t/**\n\t * Permalink template for the attachment. Only present when using the 'edit' context and the post type is public.\n\t */\n\tpermalink_template?: string;\n\t/**\n\t * Slug automatically generated from the attachment title. Only present when using the 'edit' context and the post type is public.\n\t */\n\tgenerated_slug?: string;\n\t/**\n\t * An array of the class names for the post container element.\n\t */\n\tclass_list: string[];\n\t/**\n\t * The title for the attachment.\n\t */\n\ttitle: {\n\t\t/**\n\t\t * Title for the attachment, as it exists in the database. Only present when using the 'edit' context.\n\t\t */\n\t\traw?: string;\n\t\t/**\n\t\t * HTML title for the attachment, transformed for display.\n\t\t */\n\t\trendered: string;\n\t};\n\t/**\n\t * The ID for the author of the attachment.\n\t */\n\tauthor: number;\n\t/**\n\t * Whether or not comments are open on the attachment.\n\t */\n\tcomment_status: string;\n\t/**\n\t * Whether or not the attachment can be pinged.\n\t */\n\tping_status: string;\n\t/**\n\t * Meta fields.\n\t */\n\tmeta:\n\t\t| []\n\t\t| {\n\t\t\t\t[ k: string ]: unknown;\n\t\t };\n\t/**\n\t * The theme file to use to display the attachment.\n\t */\n\ttemplate: string;\n\t_links: {\n\t\t[ k: string ]: {\n\t\t\thref: string;\n\t\t\tembeddable?: boolean;\n\t\t\t[ k: string ]: unknown;\n\t\t}[];\n\t};\n\t/**\n\t * The embedded representation of relations. Only present when the '_embed' query parameter is set.\n\t */\n\t_embedded?: {\n\t\t/**\n\t\t * The author of the post.\n\t\t */\n\t\tauthor: unknown[];\n\t\t/**\n\t\t * The featured image post.\n\t\t */\n\t\t'wp:featuredmedia'?: WP_REST_API_Attachment[];\n\t\t[ k: string ]: unknown;\n\t};\n\t[ k: string ]: unknown;\n}\n\n/**\n * REST API attachment object with additional fields added by this project.\n */\nexport interface RestAttachment extends WP_REST_API_Attachment {}\n\ntype BetterOmit< T, K extends PropertyKey > = {\n\t[ P in keyof T as P extends K ? never : P ]: T[ P ];\n};\n\n/**\n * Transformed attachment object.\n */\nexport type Attachment = BetterOmit<\n\tRestAttachment,\n\t'alt_text' | 'source_url' | 'caption' | 'title'\n> & {\n\talt: WP_REST_API_Attachment[ 'alt_text' ];\n\tcaption: WP_REST_API_Attachment[ 'caption' ][ 'raw' ] & string;\n\ttitle: WP_REST_API_Attachment[ 'title' ][ 'raw' ];\n\turl: WP_REST_API_Attachment[ 'source_url' ];\n\tposter?: WP_REST_API_Attachment[ 'source_url' ];\n};\n\nexport type OnChangeHandler = ( attachments: Partial< Attachment >[] ) => void;\nexport type OnSuccessHandler = ( attachments: Partial< Attachment >[] ) => void;\nexport type OnErrorHandler = ( error: Error ) => void;\n\nexport type CreateRestAttachment = Partial< RestAttachment >;\n\nexport type AdditionalData = BetterOmit< CreateRestAttachment, 'meta' >;\n\nexport interface CreateSideloadFile {\n\timage_size?: string;\n\tupload_request?: string;\n}\n\nexport interface SideloadAdditionalData {\n\tpost: RestAttachment[ 'id' ];\n\timage_size?: string;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/media-utils/src/utils/types.ts"],"sourcesContent":["/**\n * A media attachment object in a REST API context.\n *\n * Simplified version of what's defined in the wp-types package.\n *\n * @see https://www.npmjs.com/package/wp-types\n */\ninterface WP_REST_API_Attachment {\n\t/**\n\t * Unique identifier for the attachment.\n\t */\n\tid: number;\n\t/**\n\t * The ID of the featured media for the post.\n\t */\n\tfeatured_media: number;\n\t/**\n\t * URL to the attachment.\n\t */\n\tlink: string;\n\t/**\n\t * The date the attachment was published, in the site's timezone.\n\t */\n\tdate: string;\n\t/**\n\t * The date the attachment was published, as GMT.\n\t */\n\tdate_gmt: string;\n\t/**\n\t * The date the attachment was last modified, in the site's timezone.\n\t */\n\tmodified: string;\n\t/**\n\t * The date the attachment was last modified, as GMT.\n\t */\n\tmodified_gmt: string;\n\t/**\n\t * An alphanumeric identifier for the attachment unique to its type.\n\t */\n\tslug: string;\n\t/**\n\t * A named status for the attachment.\n\t */\n\tstatus: string;\n\t/**\n\t * Type of Post for the attachment.\n\t */\n\ttype: 'attachment';\n\t/**\n\t * Alternative text to display when attachment is not displayed.\n\t */\n\talt_text: string;\n\t/**\n\t * The attachment caption.\n\t */\n\tcaption: {\n\t\t/**\n\t\t * Caption for the attachment, as it exists in the database. Only present when using the 'edit' context.\n\t\t */\n\t\traw?: string;\n\t\t/**\n\t\t * HTML caption for the attachment, transformed for display.\n\t\t */\n\t\trendered: string;\n\t};\n\t/**\n\t * The attachment description.\n\t */\n\tdescription: {\n\t\t/**\n\t\t * Description for the attachment, as it exists in the database. Only present when using the 'edit' context.\n\t\t */\n\t\traw?: string;\n\t\t/**\n\t\t * HTML description for the attachment, transformed for display.\n\t\t */\n\t\trendered: string;\n\t};\n\t/**\n\t * Attachment type.\n\t */\n\tmedia_type: 'image' | 'file';\n\t/**\n\t * The attachment MIME type.\n\t */\n\tmime_type: string;\n\t/**\n\t * Details about the media file, specific to its type.\n\t */\n\tmedia_details: {\n\t\t[ k: string ]: unknown;\n\t};\n\t/**\n\t * The ID for the associated post of the attachment.\n\t */\n\tpost: number | null;\n\t/**\n\t * URL to the original attachment file.\n\t */\n\tsource_url: string;\n\t/**\n\t * List of the missing image sizes of the attachment. Only present when using the 'edit' context.\n\t */\n\tmissing_image_sizes?: string[];\n\t/**\n\t * Permalink template for the attachment. Only present when using the 'edit' context and the post type is public.\n\t */\n\tpermalink_template?: string;\n\t/**\n\t * Slug automatically generated from the attachment title. Only present when using the 'edit' context and the post type is public.\n\t */\n\tgenerated_slug?: string;\n\t/**\n\t * An array of the class names for the post container element.\n\t */\n\tclass_list: string[];\n\t/**\n\t * The title for the attachment.\n\t */\n\ttitle: {\n\t\t/**\n\t\t * Title for the attachment, as it exists in the database. Only present when using the 'edit' context.\n\t\t */\n\t\traw?: string;\n\t\t/**\n\t\t * HTML title for the attachment, transformed for display.\n\t\t */\n\t\trendered: string;\n\t};\n\t/**\n\t * The ID for the author of the attachment.\n\t */\n\tauthor: number;\n\t/**\n\t * Whether or not comments are open on the attachment.\n\t */\n\tcomment_status: string;\n\t/**\n\t * Whether or not the attachment can be pinged.\n\t */\n\tping_status: string;\n\t/**\n\t * Meta fields.\n\t */\n\tmeta:\n\t\t| []\n\t\t| {\n\t\t\t\t[ k: string ]: unknown;\n\t\t };\n\t/**\n\t * The theme file to use to display the attachment.\n\t */\n\ttemplate: string;\n\t_links: {\n\t\t[ k: string ]: {\n\t\t\thref: string;\n\t\t\tembeddable?: boolean;\n\t\t\t[ k: string ]: unknown;\n\t\t}[];\n\t};\n\t/**\n\t * The embedded representation of relations. Only present when the '_embed' query parameter is set.\n\t */\n\t_embedded?: {\n\t\t/**\n\t\t * The author of the post.\n\t\t */\n\t\tauthor: unknown[];\n\t\t/**\n\t\t * The featured image post.\n\t\t */\n\t\t'wp:featuredmedia'?: WP_REST_API_Attachment[];\n\t\t[ k: string ]: unknown;\n\t};\n\t[ k: string ]: unknown;\n}\n\n/**\n * REST API attachment object with additional fields added by this project.\n */\nexport interface RestAttachment extends WP_REST_API_Attachment {}\n\ntype BetterOmit< T, K extends PropertyKey > = {\n\t[ P in keyof T as P extends K ? never : P ]: T[ P ];\n};\n\n/**\n * Transformed attachment object.\n */\nexport type Attachment = BetterOmit<\n\tRestAttachment,\n\t'alt_text' | 'source_url' | 'caption' | 'title'\n> & {\n\talt: WP_REST_API_Attachment[ 'alt_text' ];\n\tcaption: WP_REST_API_Attachment[ 'caption' ][ 'raw' ] & string;\n\ttitle: WP_REST_API_Attachment[ 'title' ][ 'raw' ];\n\turl: WP_REST_API_Attachment[ 'source_url' ];\n\tposter?: WP_REST_API_Attachment[ 'source_url' ];\n};\n\nexport type OnChangeHandler = ( attachments: Partial< Attachment >[] ) => void;\nexport type OnErrorHandler = ( error: Error ) => void;\n\nexport type CreateRestAttachment = Partial< RestAttachment >;\n\nexport type AdditionalData = BetterOmit< CreateRestAttachment, 'meta' >;\n\nexport interface CreateSideloadFile {\n\timage_size?: string;\n\tupload_request?: string;\n}\n\nexport interface SideloadAdditionalData {\n\tpost: RestAttachment[ 'id' ];\n\timage_size?: string;\n}\n"],"mappings":"","ignoreList":[]}
@@ -46,8 +46,11 @@ function uploadMedia({
46
46
  const validFiles = [];
47
47
  const filesSet = [];
48
48
  const setAndUpdateFiles = (index, value) => {
49
- if (filesSet[index]?.url) {
50
- (0, _blob.revokeBlobURL)(filesSet[index].url);
49
+ // For client-side media processing, this is handled by the upload-media package.
50
+ if (!window.__experimentalMediaProcessing) {
51
+ if (filesSet[index]?.url) {
52
+ (0, _blob.revokeBlobURL)(filesSet[index].url);
53
+ }
51
54
  }
52
55
  filesSet[index] = value;
53
56
  onFileChange?.(filesSet.filter(attachment => attachment !== null));
@@ -80,12 +83,15 @@ function uploadMedia({
80
83
  }
81
84
  validFiles.push(mediaFile);
82
85
 
83
- // Set temporary URL to create placeholder media file, this is replaced
84
- // with final file from media gallery when upload is `done` below.
85
- filesSet.push({
86
- url: (0, _blob.createBlobURL)(mediaFile)
87
- });
88
- onFileChange?.(filesSet);
86
+ // For client-side media processing, this is handled by the upload-media package.
87
+ if (!window.__experimentalMediaProcessing) {
88
+ // Set temporary URL to create placeholder media file, this is replaced
89
+ // with final file from media gallery when upload is `done` below.
90
+ filesSet.push({
91
+ url: (0, _blob.createBlobURL)(mediaFile)
92
+ });
93
+ onFileChange?.(filesSet);
94
+ }
89
95
  }
90
96
  validFiles.map(async (file, index) => {
91
97
  try {
@@ -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","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\tOnSuccessHandler,\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\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// Function called once a file has completely finished uploading, including thumbnails.\n\tonSuccess?: OnSuccessHandler;\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\tif ( filesSet[ index ]?.url ) {\n\t\t\trevokeBlobURL( filesSet[ index ].url );\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// Set temporary URL to create placeholder media file, this is replaced\n\t\t// with final file from media gallery when upload is `done` below.\n\t\tfilesSet.push( { url: createBlobURL( mediaFile ) } );\n\t\tonFileChange?.( filesSet as Array< Partial< Attachment > > );\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;AAYA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,wBAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AApBA;AACA;AACA;;AAIA;AACA;AACA;;AAmCA;AACA;AACA;A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AI,CAAE;MAAET,GAAG,EAAE,IAAAU,mBAAa,EAAEN,SAAU;IAAE,CAAE,CAAC;IACpDX,YAAY,GAAIG,QAA2C,CAAC;EAC7D;EAEAD,UAAU,CAACgB,GAAG,CAAE,OAAQC,IAAI,EAAEd,KAAK,KAAM;IACxC,IAAI;MACH,MAAMK,UAAU,GAAG,MAAM,IAAAU,8BAAc,EACtCD,IAAI,EACJvB,cAAc,EACdK,MACD,CAAC;MACDG,iBAAiB,CAAEC,KAAK,EAAEK,UAAW,CAAC;IACvC,CAAC,CAAC,OAAQG,KAAK,EAAG;MACjB;MACAT,iBAAiB,CAAEC,KAAK,EAAE,IAAK,CAAC;MAEhC,IAAIgB,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;MAEA1B,OAAO,GACN,IAAI2B,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","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,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,wBAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAnBA;AACA;AACA;;AAIA;AACA;AACA;;AAsCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASO,WAAWA,CAAE;EAC5BC,kBAAkB;EAClBC,YAAY;EACZC,cAAc,GAAG,CAAC,CAAC;EACnBC,SAAS;EACTC,iBAAiB;EACjBC,OAAO;EACPC,YAAY;EACZC;AACgB,CAAC,EAAG;EACpB,MAAMC,UAAU,GAAG,EAAE;EAErB,MAAMC,QAA+C,GAAG,EAAE;EAC1D,MAAMC,iBAAiB,GAAGA,CAAEC,KAAa,EAAEC,KAAwB,KAAM;IACxE;IACA,IAAK,CAAEC,MAAM,CAACC,6BAA6B,EAAG;MAC7C,IAAKL,QA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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 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/media-utils/src/utils/types.ts"],"sourcesContent":["/**\n * A media attachment object in a REST API context.\n *\n * Simplified version of what's defined in the wp-types package.\n *\n * @see https://www.npmjs.com/package/wp-types\n */\ninterface WP_REST_API_Attachment {\n\t/**\n\t * Unique identifier for the attachment.\n\t */\n\tid: number;\n\t/**\n\t * The ID of the featured media for the post.\n\t */\n\tfeatured_media: number;\n\t/**\n\t * URL to the attachment.\n\t */\n\tlink: string;\n\t/**\n\t * The date the attachment was published, in the site's timezone.\n\t */\n\tdate: string;\n\t/**\n\t * The date the attachment was published, as GMT.\n\t */\n\tdate_gmt: string;\n\t/**\n\t * The date the attachment was last modified, in the site's timezone.\n\t */\n\tmodified: string;\n\t/**\n\t * The date the attachment was last modified, as GMT.\n\t */\n\tmodified_gmt: string;\n\t/**\n\t * An alphanumeric identifier for the attachment unique to its type.\n\t */\n\tslug: string;\n\t/**\n\t * A named status for the attachment.\n\t */\n\tstatus: string;\n\t/**\n\t * Type of Post for the attachment.\n\t */\n\ttype: 'attachment';\n\t/**\n\t * Alternative text to display when attachment is not displayed.\n\t */\n\talt_text: string;\n\t/**\n\t * The attachment caption.\n\t */\n\tcaption: {\n\t\t/**\n\t\t * Caption for the attachment, as it exists in the database. Only present when using the 'edit' context.\n\t\t */\n\t\traw?: string;\n\t\t/**\n\t\t * HTML caption for the attachment, transformed for display.\n\t\t */\n\t\trendered: string;\n\t};\n\t/**\n\t * The attachment description.\n\t */\n\tdescription: {\n\t\t/**\n\t\t * Description for the attachment, as it exists in the database. Only present when using the 'edit' context.\n\t\t */\n\t\traw?: string;\n\t\t/**\n\t\t * HTML description for the attachment, transformed for display.\n\t\t */\n\t\trendered: string;\n\t};\n\t/**\n\t * Attachment type.\n\t */\n\tmedia_type: 'image' | 'file';\n\t/**\n\t * The attachment MIME type.\n\t */\n\tmime_type: string;\n\t/**\n\t * Details about the media file, specific to its type.\n\t */\n\tmedia_details: {\n\t\t[ k: string ]: unknown;\n\t};\n\t/**\n\t * The ID for the associated post of the attachment.\n\t */\n\tpost: number | null;\n\t/**\n\t * URL to the original attachment file.\n\t */\n\tsource_url: string;\n\t/**\n\t * List of the missing image sizes of the attachment. Only present when using the 'edit' context.\n\t */\n\tmissing_image_sizes?: string[];\n\t/**\n\t * Permalink template for the attachment. Only present when using the 'edit' context and the post type is public.\n\t */\n\tpermalink_template?: string;\n\t/**\n\t * Slug automatically generated from the attachment title. Only present when using the 'edit' context and the post type is public.\n\t */\n\tgenerated_slug?: string;\n\t/**\n\t * An array of the class names for the post container element.\n\t */\n\tclass_list: string[];\n\t/**\n\t * The title for the attachment.\n\t */\n\ttitle: {\n\t\t/**\n\t\t * Title for the attachment, as it exists in the database. Only present when using the 'edit' context.\n\t\t */\n\t\traw?: string;\n\t\t/**\n\t\t * HTML title for the attachment, transformed for display.\n\t\t */\n\t\trendered: string;\n\t};\n\t/**\n\t * The ID for the author of the attachment.\n\t */\n\tauthor: number;\n\t/**\n\t * Whether or not comments are open on the attachment.\n\t */\n\tcomment_status: string;\n\t/**\n\t * Whether or not the attachment can be pinged.\n\t */\n\tping_status: string;\n\t/**\n\t * Meta fields.\n\t */\n\tmeta:\n\t\t| []\n\t\t| {\n\t\t\t\t[ k: string ]: unknown;\n\t\t };\n\t/**\n\t * The theme file to use to display the attachment.\n\t */\n\ttemplate: string;\n\t_links: {\n\t\t[ k: string ]: {\n\t\t\thref: string;\n\t\t\tembeddable?: boolean;\n\t\t\t[ k: string ]: unknown;\n\t\t}[];\n\t};\n\t/**\n\t * The embedded representation of relations. Only present when the '_embed' query parameter is set.\n\t */\n\t_embedded?: {\n\t\t/**\n\t\t * The author of the post.\n\t\t */\n\t\tauthor: unknown[];\n\t\t/**\n\t\t * The featured image post.\n\t\t */\n\t\t'wp:featuredmedia'?: WP_REST_API_Attachment[];\n\t\t[ k: string ]: unknown;\n\t};\n\t[ k: string ]: unknown;\n}\n\n/**\n * REST API attachment object with additional fields added by this project.\n */\nexport interface RestAttachment extends WP_REST_API_Attachment {}\n\ntype BetterOmit< T, K extends PropertyKey > = {\n\t[ P in keyof T as P extends K ? never : P ]: T[ P ];\n};\n\n/**\n * Transformed attachment object.\n */\nexport type Attachment = BetterOmit<\n\tRestAttachment,\n\t'alt_text' | 'source_url' | 'caption' | 'title'\n> & {\n\talt: WP_REST_API_Attachment[ 'alt_text' ];\n\tcaption: WP_REST_API_Attachment[ 'caption' ][ 'raw' ] & string;\n\ttitle: WP_REST_API_Attachment[ 'title' ][ 'raw' ];\n\turl: WP_REST_API_Attachment[ 'source_url' ];\n\tposter?: WP_REST_API_Attachment[ 'source_url' ];\n};\n\nexport type OnChangeHandler = ( attachments: Partial< Attachment >[] ) => void;\nexport type OnSuccessHandler = ( attachments: Partial< Attachment >[] ) => void;\nexport type OnErrorHandler = ( error: Error ) => void;\n\nexport type CreateRestAttachment = Partial< RestAttachment >;\n\nexport type AdditionalData = BetterOmit< CreateRestAttachment, 'meta' >;\n\nexport interface CreateSideloadFile {\n\timage_size?: string;\n\tupload_request?: string;\n}\n\nexport interface SideloadAdditionalData {\n\tpost: RestAttachment[ 'id' ];\n\timage_size?: string;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/media-utils/src/utils/types.ts"],"sourcesContent":["/**\n * A media attachment object in a REST API context.\n *\n * Simplified version of what's defined in the wp-types package.\n *\n * @see https://www.npmjs.com/package/wp-types\n */\ninterface WP_REST_API_Attachment {\n\t/**\n\t * Unique identifier for the attachment.\n\t */\n\tid: number;\n\t/**\n\t * The ID of the featured media for the post.\n\t */\n\tfeatured_media: number;\n\t/**\n\t * URL to the attachment.\n\t */\n\tlink: string;\n\t/**\n\t * The date the attachment was published, in the site's timezone.\n\t */\n\tdate: string;\n\t/**\n\t * The date the attachment was published, as GMT.\n\t */\n\tdate_gmt: string;\n\t/**\n\t * The date the attachment was last modified, in the site's timezone.\n\t */\n\tmodified: string;\n\t/**\n\t * The date the attachment was last modified, as GMT.\n\t */\n\tmodified_gmt: string;\n\t/**\n\t * An alphanumeric identifier for the attachment unique to its type.\n\t */\n\tslug: string;\n\t/**\n\t * A named status for the attachment.\n\t */\n\tstatus: string;\n\t/**\n\t * Type of Post for the attachment.\n\t */\n\ttype: 'attachment';\n\t/**\n\t * Alternative text to display when attachment is not displayed.\n\t */\n\talt_text: string;\n\t/**\n\t * The attachment caption.\n\t */\n\tcaption: {\n\t\t/**\n\t\t * Caption for the attachment, as it exists in the database. Only present when using the 'edit' context.\n\t\t */\n\t\traw?: string;\n\t\t/**\n\t\t * HTML caption for the attachment, transformed for display.\n\t\t */\n\t\trendered: string;\n\t};\n\t/**\n\t * The attachment description.\n\t */\n\tdescription: {\n\t\t/**\n\t\t * Description for the attachment, as it exists in the database. Only present when using the 'edit' context.\n\t\t */\n\t\traw?: string;\n\t\t/**\n\t\t * HTML description for the attachment, transformed for display.\n\t\t */\n\t\trendered: string;\n\t};\n\t/**\n\t * Attachment type.\n\t */\n\tmedia_type: 'image' | 'file';\n\t/**\n\t * The attachment MIME type.\n\t */\n\tmime_type: string;\n\t/**\n\t * Details about the media file, specific to its type.\n\t */\n\tmedia_details: {\n\t\t[ k: string ]: unknown;\n\t};\n\t/**\n\t * The ID for the associated post of the attachment.\n\t */\n\tpost: number | null;\n\t/**\n\t * URL to the original attachment file.\n\t */\n\tsource_url: string;\n\t/**\n\t * List of the missing image sizes of the attachment. Only present when using the 'edit' context.\n\t */\n\tmissing_image_sizes?: string[];\n\t/**\n\t * Permalink template for the attachment. Only present when using the 'edit' context and the post type is public.\n\t */\n\tpermalink_template?: string;\n\t/**\n\t * Slug automatically generated from the attachment title. Only present when using the 'edit' context and the post type is public.\n\t */\n\tgenerated_slug?: string;\n\t/**\n\t * An array of the class names for the post container element.\n\t */\n\tclass_list: string[];\n\t/**\n\t * The title for the attachment.\n\t */\n\ttitle: {\n\t\t/**\n\t\t * Title for the attachment, as it exists in the database. Only present when using the 'edit' context.\n\t\t */\n\t\traw?: string;\n\t\t/**\n\t\t * HTML title for the attachment, transformed for display.\n\t\t */\n\t\trendered: string;\n\t};\n\t/**\n\t * The ID for the author of the attachment.\n\t */\n\tauthor: number;\n\t/**\n\t * Whether or not comments are open on the attachment.\n\t */\n\tcomment_status: string;\n\t/**\n\t * Whether or not the attachment can be pinged.\n\t */\n\tping_status: string;\n\t/**\n\t * Meta fields.\n\t */\n\tmeta:\n\t\t| []\n\t\t| {\n\t\t\t\t[ k: string ]: unknown;\n\t\t };\n\t/**\n\t * The theme file to use to display the attachment.\n\t */\n\ttemplate: string;\n\t_links: {\n\t\t[ k: string ]: {\n\t\t\thref: string;\n\t\t\tembeddable?: boolean;\n\t\t\t[ k: string ]: unknown;\n\t\t}[];\n\t};\n\t/**\n\t * The embedded representation of relations. Only present when the '_embed' query parameter is set.\n\t */\n\t_embedded?: {\n\t\t/**\n\t\t * The author of the post.\n\t\t */\n\t\tauthor: unknown[];\n\t\t/**\n\t\t * The featured image post.\n\t\t */\n\t\t'wp:featuredmedia'?: WP_REST_API_Attachment[];\n\t\t[ k: string ]: unknown;\n\t};\n\t[ k: string ]: unknown;\n}\n\n/**\n * REST API attachment object with additional fields added by this project.\n */\nexport interface RestAttachment extends WP_REST_API_Attachment {}\n\ntype BetterOmit< T, K extends PropertyKey > = {\n\t[ P in keyof T as P extends K ? never : P ]: T[ P ];\n};\n\n/**\n * Transformed attachment object.\n */\nexport type Attachment = BetterOmit<\n\tRestAttachment,\n\t'alt_text' | 'source_url' | 'caption' | 'title'\n> & {\n\talt: WP_REST_API_Attachment[ 'alt_text' ];\n\tcaption: WP_REST_API_Attachment[ 'caption' ][ 'raw' ] & string;\n\ttitle: WP_REST_API_Attachment[ 'title' ][ 'raw' ];\n\turl: WP_REST_API_Attachment[ 'source_url' ];\n\tposter?: WP_REST_API_Attachment[ 'source_url' ];\n};\n\nexport type OnChangeHandler = ( attachments: Partial< Attachment >[] ) => void;\nexport type OnErrorHandler = ( error: Error ) => void;\n\nexport type CreateRestAttachment = Partial< RestAttachment >;\n\nexport type AdditionalData = BetterOmit< CreateRestAttachment, 'meta' >;\n\nexport interface CreateSideloadFile {\n\timage_size?: string;\n\tupload_request?: string;\n}\n\nexport interface SideloadAdditionalData {\n\tpost: RestAttachment[ 'id' ];\n\timage_size?: string;\n}\n"],"mappings":"","ignoreList":[]}
@@ -40,8 +40,11 @@ export function uploadMedia({
40
40
  const validFiles = [];
41
41
  const filesSet = [];
42
42
  const setAndUpdateFiles = (index, value) => {
43
- if (filesSet[index]?.url) {
44
- revokeBlobURL(filesSet[index].url);
43
+ // For client-side media processing, this is handled by the upload-media package.
44
+ if (!window.__experimentalMediaProcessing) {
45
+ if (filesSet[index]?.url) {
46
+ revokeBlobURL(filesSet[index].url);
47
+ }
45
48
  }
46
49
  filesSet[index] = value;
47
50
  onFileChange?.(filesSet.filter(attachment => attachment !== null));
@@ -74,12 +77,15 @@ export function uploadMedia({
74
77
  }
75
78
  validFiles.push(mediaFile);
76
79
 
77
- // Set temporary URL to create placeholder media file, this is replaced
78
- // with final file from media gallery when upload is `done` below.
79
- filesSet.push({
80
- url: createBlobURL(mediaFile)
81
- });
82
- onFileChange?.(filesSet);
80
+ // For client-side media processing, this is handled by the upload-media package.
81
+ if (!window.__experimentalMediaProcessing) {
82
+ // Set temporary URL to create placeholder media file, this is replaced
83
+ // with final file from media gallery when upload is `done` below.
84
+ filesSet.push({
85
+ url: createBlobURL(mediaFile)
86
+ });
87
+ onFileChange?.(filesSet);
88
+ }
83
89
  }
84
90
  validFiles.map(async (file, index) => {
85
91
  try {
@@ -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","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\tOnSuccessHandler,\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\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// Function called once a file has completely finished uploading, including thumbnails.\n\tonSuccess?: OnSuccessHandler;\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\tif ( filesSet[ index ]?.url ) {\n\t\t\trevokeBlobURL( filesSet[ index ].url );\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// Set temporary URL to create placeholder media file, this is replaced\n\t\t// with final file from media gallery when upload is `done` below.\n\t\tfilesSet.push( { url: createBlobURL( mediaFile ) } );\n\t\tonFileChange?.( filesSet as Array< Partial< Attachment > > );\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;;AAQA,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,gBAAgB,QAAQ,sBAAsB;AACvD,SAASC,uBAAuB,QAAQ,+BAA+B;AACvE,SAASC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U,CAACU,IAAI,CAAEF,SAAU,CAAC;;IAE5B;IACA;IACAP,QAAQ,CAACS,IAAI,CAAE;MAAEL,GAAG,EAAErB,aAAa,CAAEwB,SAAU;IAAE,CAAE,CAAC;IACpDV,YAAY,GAAIG,QAA2C,CAAC;EAC7D;EAEAD,UAAU,CAACW,GAAG,CAAE,OAAQC,IAAI,EAAET,KAAK,KAAM;IACxC,IAAI;MACH,MAAMI,UAAU,GAAG,MAAMrB,cAAc,CACtC0B,IAAI,EACJlB,cAAc,EACdK,MACD,CAAC;MACDG,iBAAiB,CAAEC,KAAK,EAAEI,UAAW,CAAC;IACvC,CAAC,CAAC,OAAQE,KAAK,EAAG;MACjB;MACAP,iBAAiB,CAAEC,KAAK,EAAE,IAAK,CAAC;MAEhC,IAAIU,OAAO;MACX,IAAKJ,KAAK,YAAYK,KAAK,EAAG;QAC7BD,OAAO,GAAGJ,KAAK,CAACI,OAAO;MACxB,CAAC,MAAM;QACNA,OAAO,GAAG9B,OAAO;QAChB;QACAD,EAAE,CAAE,qDAAsD,CAAC,EAC3D8B,IAAI,CAACG,IACN,CAAC;MACF;MAEAlB,OAAO,GACN,IAAIP,WAAW,CAAE;QAChB0B,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","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,GAAG,CAAC,CAAC;EACnBC,SAAS;EACTC,iBAAiB;EACjBC,OAAO;EACPC,YAAY;EACZC;AACgB,CAAC,EAAG;EACpB,MAAMC,UAAU,GAAG,EAAE;EAErB,MAAMC,QAA+C,GAAG,EAAE;EAC1D,MAAMC,iBAAiB,GAAGA,CAAEC,KAAa,EAAEC,KAAwB,KAAM;IACxE;IACA,IAAK,CAAEC,MAAM,CAACC,6BAA6B,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C,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":[]}
@@ -191,7 +191,6 @@ export type Attachment = BetterOmit<RestAttachment, 'alt_text' | 'source_url' |
191
191
  poster?: WP_REST_API_Attachment['source_url'];
192
192
  };
193
193
  export type OnChangeHandler = (attachments: Partial<Attachment>[]) => void;
194
- export type OnSuccessHandler = (attachments: Partial<Attachment>[]) => void;
195
194
  export type OnErrorHandler = (error: Error) => void;
196
195
  export type CreateRestAttachment = Partial<RestAttachment>;
197
196
  export type AdditionalData = BetterOmit<CreateRestAttachment, 'meta'>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,UAAU,sBAAsB;IAC/B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;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AO,CAAE,cAAc,CAAE,CAAC;AAE7D,MAAM,MAAM,cAAc,GAAG,UAAU,CAAE,oBAAoB,EAAE,MAAM,CAAE,CAAC;AAExE,MAAM,WAAW,kBAAkB;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACtC,IAAI,EAAE,cAAc,CAAE,IAAI,CAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -1,7 +1,12 @@
1
1
  /**
2
2
  * Internal dependencies
3
3
  */
4
- import type { AdditionalData, OnChangeHandler, OnErrorHandler, OnSuccessHandler } from './types';
4
+ import type { AdditionalData, OnChangeHandler, OnErrorHandler } from './types';
5
+ declare global {
6
+ interface Window {
7
+ __experimentalMediaProcessing?: boolean;
8
+ }
9
+ }
5
10
  interface UploadMediaArgs {
6
11
  additionalData?: AdditionalData;
7
12
  allowedTypes?: string[];
@@ -9,7 +14,6 @@ interface UploadMediaArgs {
9
14
  maxUploadFileSize?: number;
10
15
  onError?: OnErrorHandler;
11
16
  onFileChange?: OnChangeHandler;
12
- onSuccess?: OnSuccessHandler;
13
17
  wpAllowedMimeTypes?: Record<string, string> | null;
14
18
  signal?: AbortSignal;
15
19
  }
@@ -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,gBAAgB,EAChB,MAAM,SAAS,CAAC;AAOjB,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,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAE7B,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,QAkFjB"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/media-utils",
3
- "version": "5.14.0",
3
+ "version": "5.15.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": "*",
33
- "@wordpress/blob": "*",
34
- "@wordpress/element": "*",
35
- "@wordpress/i18n": "*",
36
- "@wordpress/private-apis": "*"
32
+ "@wordpress/api-fetch": "^7.15.1",
33
+ "@wordpress/blob": "^4.15.0",
34
+ "@wordpress/element": "^6.15.1",
35
+ "@wordpress/i18n": "^5.15.1",
36
+ "@wordpress/private-apis": "^1.15.0"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "b432c18934c9db866b6dba7d37517a4e97d642e3"
41
+ "gitHead": "0d4503ecc364cf4ca16024673baf5a84dacf212f"
42
42
  }
@@ -199,7 +199,6 @@ export type Attachment = BetterOmit<
199
199
  };
200
200
 
201
201
  export type OnChangeHandler = ( attachments: Partial< Attachment >[] ) => void;
202
- export type OnSuccessHandler = ( attachments: Partial< Attachment >[] ) => void;
203
202
  export type OnErrorHandler = ( error: Error ) => void;
204
203
 
205
204
  export type CreateRestAttachment = Partial< RestAttachment >;
@@ -12,7 +12,6 @@ import type {
12
12
  Attachment,
13
13
  OnChangeHandler,
14
14
  OnErrorHandler,
15
- OnSuccessHandler,
16
15
  } from './types';
17
16
  import { uploadToServer } from './upload-to-server';
18
17
  import { validateMimeType } from './validate-mime-type';
@@ -20,6 +19,12 @@ import { validateMimeTypeForUser } from './validate-mime-type-for-user';
20
19
  import { validateFileSize } from './validate-file-size';
21
20
  import { UploadError } from './upload-error';
22
21
 
22
+ declare global {
23
+ interface Window {
24
+ __experimentalMediaProcessing?: boolean;
25
+ }
26
+ }
27
+
23
28
  interface UploadMediaArgs {
24
29
  // Additional data to include in the request.
25
30
  additionalData?: AdditionalData;
@@ -33,8 +38,6 @@ interface UploadMediaArgs {
33
38
  onError?: OnErrorHandler;
34
39
  // Function called each time a file or a temporary representation of the file is available.
35
40
  onFileChange?: OnChangeHandler;
36
- // Function called once a file has completely finished uploading, including thumbnails.
37
- onSuccess?: OnSuccessHandler;
38
41
  // List of allowed mime types and file extensions.
39
42
  wpAllowedMimeTypes?: Record< string, string > | null;
40
43
  // Abort signal.
@@ -69,8 +72,11 @@ export function uploadMedia( {
69
72
 
70
73
  const filesSet: Array< Partial< Attachment > | null > = [];
71
74
  const setAndUpdateFiles = ( index: number, value: Attachment | null ) => {
72
- if ( filesSet[ index ]?.url ) {
73
- revokeBlobURL( filesSet[ index ].url );
75
+ // For client-side media processing, this is handled by the upload-media package.
76
+ if ( ! window.__experimentalMediaProcessing ) {
77
+ if ( filesSet[ index ]?.url ) {
78
+ revokeBlobURL( filesSet[ index ].url );
79
+ }
74
80
  }
75
81
  filesSet[ index ] = value;
76
82
  onFileChange?.(
@@ -107,10 +113,13 @@ export function uploadMedia( {
107
113
 
108
114
  validFiles.push( mediaFile );
109
115
 
110
- // Set temporary URL to create placeholder media file, this is replaced
111
- // with final file from media gallery when upload is `done` below.
112
- filesSet.push( { url: createBlobURL( mediaFile ) } );
113
- onFileChange?.( filesSet as Array< Partial< Attachment > > );
116
+ // For client-side media processing, this is handled by the upload-media package.
117
+ if ( ! window.__experimentalMediaProcessing ) {
118
+ // Set temporary URL to create placeholder media file, this is replaced
119
+ // with final file from media gallery when upload is `done` below.
120
+ filesSet.push( { url: createBlobURL( mediaFile ) } );
121
+ onFileChange?.( filesSet as Array< Partial< Attachment > > );
122
+ }
114
123
  }
115
124
 
116
125
  validFiles.map( async ( file, index ) => {
package/tsconfig.json CHANGED
@@ -2,12 +2,9 @@
2
2
  "$schema": "https://json.schemastore.org/tsconfig.json",
3
3
  "extends": "../../tsconfig.base.json",
4
4
  "compilerOptions": {
5
- "rootDir": "src",
6
- "declarationDir": "build-types",
7
5
  "types": [ "gutenberg-env" ],
8
6
  "checkJs": false
9
7
  },
10
- "include": [ "src/**/*" ],
11
8
  "references": [
12
9
  { "path": "../api-fetch" },
13
10
  { "path": "../blob" },
@@ -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":"1119c2b2e9f336a90c789b4e39ecb2dfc956465b6800c03754c28a0d88907a09","signature":"190bb571f74165eca747d63c386b17c6275520bfc747ab6fe7490535fb67cba4"},"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":"93f13518a1f6a5d7c8e81e5c1dc1294c069ac5dc82212dde6cc645395b9e6f49","signature":"4a54c691ec0a9e647f3e85f3355e51b06fd0ff638e94667b89db554521d698a6"},{"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":"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"}