@wordpress/media-utils 5.31.1-next.f56bd8138.0 → 5.32.1-next.47f435fc9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/index.js +36 -11
- package/build/components/index.js.map +7 -1
- package/build/components/media-upload/index.js +156 -221
- package/build/components/media-upload/index.js.map +7 -1
- package/build/index.js +44 -65
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -14
- package/build/lock-unlock.js.map +7 -1
- package/build/private-apis.js +31 -17
- package/build/private-apis.js.map +7 -1
- package/build/utils/flatten-form-data.js +28 -20
- package/build/utils/flatten-form-data.js.map +7 -1
- package/build/utils/get-mime-types-array.js +38 -20
- package/build/utils/get-mime-types-array.js.map +7 -1
- package/build/utils/sideload-media.js +50 -38
- package/build/utils/sideload-media.js.map +7 -1
- package/build/utils/sideload-to-server.js +53 -36
- package/build/utils/sideload-to-server.js.map +7 -1
- package/build/utils/transform-attachment.js +29 -23
- package/build/utils/transform-attachment.js.map +7 -1
- package/build/utils/types.js +16 -5
- package/build/utils/types.js.map +7 -1
- package/build/utils/upload-error.js +30 -21
- package/build/utils/upload-error.js.map +7 -1
- package/build/utils/upload-media.js +62 -71
- package/build/utils/upload-media.js.map +7 -1
- package/build/utils/upload-to-server.js +54 -27
- package/build/utils/upload-to-server.js.map +7 -1
- package/build/utils/validate-file-size.js +44 -32
- package/build/utils/validate-file-size.js.map +7 -1
- package/build/utils/validate-mime-type-for-user.js +42 -30
- package/build/utils/validate-mime-type-for-user.js.map +7 -1
- package/build/utils/validate-mime-type.js +37 -32
- package/build/utils/validate-mime-type.js.map +7 -1
- package/build-module/components/index.js +5 -2
- package/build-module/components/index.js.map +7 -1
- package/build-module/components/media-upload/index.js +137 -215
- package/build-module/components/media-upload/index.js.map +7 -1
- package/build-module/index.js +16 -8
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/private-apis.js +7 -11
- package/build-module/private-apis.js.map +7 -1
- package/build-module/utils/flatten-form-data.js +7 -17
- package/build-module/utils/flatten-form-data.js.map +7 -1
- package/build-module/utils/get-mime-types-array.js +17 -17
- package/build-module/utils/get-mime-types-array.js.map +7 -1
- package/build-module/utils/sideload-media.js +28 -34
- package/build-module/utils/sideload-media.js.map +7 -1
- package/build-module/utils/sideload-to-server.js +22 -33
- package/build-module/utils/sideload-to-server.js.map +7 -1
- package/build-module/utils/transform-attachment.js +8 -20
- package/build-module/utils/transform-attachment.js.map +7 -1
- package/build-module/utils/types.js +1 -2
- package/build-module/utils/types.js.map +7 -1
- package/build-module/utils/upload-error.js +9 -17
- package/build-module/utils/upload-error.js.map +7 -1
- package/build-module/utils/upload-media.js +36 -63
- package/build-module/utils/upload-media.js.map +7 -1
- package/build-module/utils/upload-to-server.js +23 -22
- package/build-module/utils/upload-to-server.js.map +7 -1
- package/build-module/utils/validate-file-size.js +19 -25
- package/build-module/utils/validate-file-size.js.map +7 -1
- package/build-module/utils/validate-mime-type-for-user.js +18 -24
- package/build-module/utils/validate-mime-type-for-user.js.map +7 -1
- package/build-module/utils/validate-mime-type.js +14 -27
- package/build-module/utils/validate-mime-type.js.map +7 -1
- package/package.json +15 -8
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var sideload_media_exports = {};
|
|
20
|
+
__export(sideload_media_exports, {
|
|
21
|
+
sideloadMedia: () => sideloadMedia
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
const noop = () => {};
|
|
19
|
-
/**
|
|
20
|
-
* Uploads a file to the server without creating an attachment.
|
|
21
|
-
*
|
|
22
|
-
* @param $0 Parameters object passed to the function.
|
|
23
|
-
* @param $0.file Media File to Save.
|
|
24
|
-
* @param $0.attachmentId Parent attachment ID.
|
|
25
|
-
* @param $0.additionalData Additional data to include in the request.
|
|
26
|
-
* @param $0.signal Abort signal.
|
|
27
|
-
* @param $0.onFileChange Function called each time a file or a temporary representation of the file is available.
|
|
28
|
-
* @param $0.onError Function called when an error happens.
|
|
29
|
-
*/
|
|
23
|
+
module.exports = __toCommonJS(sideload_media_exports);
|
|
24
|
+
var import_i18n = require("@wordpress/i18n");
|
|
25
|
+
var import_sideload_to_server = require("./sideload-to-server");
|
|
26
|
+
var import_upload_error = require("./upload-error");
|
|
27
|
+
const noop = () => {
|
|
28
|
+
};
|
|
30
29
|
async function sideloadMedia({
|
|
31
30
|
file,
|
|
32
31
|
attachmentId,
|
|
@@ -36,23 +35,36 @@ async function sideloadMedia({
|
|
|
36
35
|
onError = noop
|
|
37
36
|
}) {
|
|
38
37
|
try {
|
|
39
|
-
const attachment = await (0,
|
|
38
|
+
const attachment = await (0, import_sideload_to_server.sideloadToServer)(
|
|
39
|
+
file,
|
|
40
|
+
attachmentId,
|
|
41
|
+
additionalData,
|
|
42
|
+
signal
|
|
43
|
+
);
|
|
40
44
|
onFileChange?.([attachment]);
|
|
41
45
|
} catch (error) {
|
|
42
46
|
let message;
|
|
43
47
|
if (error instanceof Error) {
|
|
44
48
|
message = error.message;
|
|
45
49
|
} else {
|
|
46
|
-
message = (0,
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
message = (0, import_i18n.sprintf)(
|
|
51
|
+
// translators: %s: file name
|
|
52
|
+
(0, import_i18n.__)("Error while sideloading file %s to the server."),
|
|
53
|
+
file.name
|
|
54
|
+
);
|
|
49
55
|
}
|
|
50
|
-
onError(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
onError(
|
|
57
|
+
new import_upload_error.UploadError({
|
|
58
|
+
code: "GENERAL",
|
|
59
|
+
message,
|
|
60
|
+
file,
|
|
61
|
+
cause: error instanceof Error ? error : void 0
|
|
62
|
+
})
|
|
63
|
+
);
|
|
56
64
|
}
|
|
57
65
|
}
|
|
58
|
-
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
sideloadMedia
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=sideload-media.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/sideload-media.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tOnChangeHandler,\n\tOnErrorHandler,\n\tCreateSideloadFile,\n\tRestAttachment,\n} from './types';\nimport { sideloadToServer } from './sideload-to-server';\nimport { UploadError } from './upload-error';\n\nconst noop = () => {};\n\ninterface SideloadMediaArgs {\n\t// Additional data to include in the request.\n\tadditionalData?: CreateSideloadFile;\n\t// File to sideload.\n\tfile: File;\n\t// Attachment ID.\n\tattachmentId: RestAttachment[ 'id' ];\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// Abort signal.\n\tsignal?: AbortSignal;\n}\n\n/**\n * Uploads a file to the server without creating an attachment.\n *\n * @param $0 Parameters object passed to the function.\n * @param $0.file Media File to Save.\n * @param $0.attachmentId Parent attachment ID.\n * @param $0.additionalData Additional data to include in the request.\n * @param $0.signal Abort signal.\n * @param $0.onFileChange Function called each time a file or a temporary representation of the file is available.\n * @param $0.onError Function called when an error happens.\n */\nexport async function sideloadMedia( {\n\tfile,\n\tattachmentId,\n\tadditionalData = {},\n\tsignal,\n\tonFileChange,\n\tonError = noop,\n}: SideloadMediaArgs ) {\n\ttry {\n\t\tconst attachment = await sideloadToServer(\n\t\t\tfile,\n\t\t\tattachmentId,\n\t\t\tadditionalData,\n\t\t\tsignal\n\t\t);\n\t\tonFileChange?.( [ attachment ] );\n\t} catch ( error ) {\n\t\tlet message;\n\t\tif ( error instanceof Error ) {\n\t\t\tmessage = error.message;\n\t\t} else {\n\t\t\tmessage = sprintf(\n\t\t\t\t// translators: %s: file name\n\t\t\t\t__( 'Error while sideloading file %s to the server.' ),\n\t\t\t\tfile.name\n\t\t\t);\n\t\t}\n\t\tonError(\n\t\t\tnew UploadError( {\n\t\t\t\tcode: 'GENERAL',\n\t\t\t\tmessage,\n\t\t\t\tfile,\n\t\t\t\tcause: error instanceof Error ? error : undefined,\n\t\t\t} )\n\t\t);\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA4B;AAW5B,gCAAiC;AACjC,0BAA4B;AAE5B,MAAM,OAAO,MAAM;AAAC;AA4BpB,eAAsB,cAAe;AAAA,EACpC;AAAA,EACA;AAAA,EACA,iBAAiB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,EACA,UAAU;AACX,GAAuB;AACtB,MAAI;AACH,UAAM,aAAa,UAAM;AAAA,MACxB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AACA,mBAAgB,CAAE,UAAW,CAAE;AAAA,EAChC,SAAU,OAAQ;AACjB,QAAI;AACJ,QAAK,iBAAiB,OAAQ;AAC7B,gBAAU,MAAM;AAAA,IACjB,OAAO;AACN,oBAAU;AAAA;AAAA,YAET,gBAAI,gDAAiD;AAAA,QACrD,KAAK;AAAA,MACN;AAAA,IACD;AACA;AAAA,MACC,IAAI,gCAAa;AAAA,QAChB,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA,OAAO,iBAAiB,QAAQ,QAAQ;AAAA,MACzC,CAAE;AAAA,IACH;AAAA,EACD;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,43 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var sideload_to_server_exports = {};
|
|
30
|
+
__export(sideload_to_server_exports, {
|
|
31
|
+
sideloadToServer: () => sideloadToServer
|
|
6
32
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
/**
|
|
12
|
-
* WordPress dependencies
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Internal dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Uploads a file to the server without creating an attachment.
|
|
21
|
-
*
|
|
22
|
-
* @param file Media File to Save.
|
|
23
|
-
* @param attachmentId Parent attachment ID.
|
|
24
|
-
* @param additionalData Additional data to include in the request.
|
|
25
|
-
* @param signal Abort signal.
|
|
26
|
-
*
|
|
27
|
-
* @return The saved attachment.
|
|
28
|
-
*/
|
|
33
|
+
module.exports = __toCommonJS(sideload_to_server_exports);
|
|
34
|
+
var import_api_fetch = __toESM(require("@wordpress/api-fetch"));
|
|
35
|
+
var import_flatten_form_data = require("./flatten-form-data");
|
|
36
|
+
var import_transform_attachment = require("./transform-attachment");
|
|
29
37
|
async function sideloadToServer(file, attachmentId, additionalData = {}, signal) {
|
|
30
|
-
// Create upload payload.
|
|
31
38
|
const data = new FormData();
|
|
32
|
-
data.append(
|
|
39
|
+
data.append("file", file, file.name || file.type.replace("/", "."));
|
|
33
40
|
for (const [key, value] of Object.entries(additionalData)) {
|
|
34
|
-
(0,
|
|
41
|
+
(0, import_flatten_form_data.flattenFormData)(
|
|
42
|
+
data,
|
|
43
|
+
key,
|
|
44
|
+
value
|
|
45
|
+
);
|
|
35
46
|
}
|
|
36
|
-
return (0,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
return (0, import_transform_attachment.transformAttachment)(
|
|
48
|
+
await (0, import_api_fetch.default)({
|
|
49
|
+
path: `/wp/v2/media/${attachmentId}/sideload`,
|
|
50
|
+
body: data,
|
|
51
|
+
method: "POST",
|
|
52
|
+
signal
|
|
53
|
+
})
|
|
54
|
+
);
|
|
42
55
|
}
|
|
43
|
-
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
sideloadToServer
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=sideload-to-server.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/sideload-to-server.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Internal dependencies\n */\nimport type { CreateSideloadFile, RestAttachment } from './types';\nimport { flattenFormData } from './flatten-form-data';\nimport { transformAttachment } from './transform-attachment';\n\n/**\n * Uploads a file to the server without creating an attachment.\n *\n * @param file Media File to Save.\n * @param attachmentId Parent attachment ID.\n * @param additionalData Additional data to include in the request.\n * @param signal Abort signal.\n *\n * @return The saved attachment.\n */\nexport async function sideloadToServer(\n\tfile: File,\n\tattachmentId: RestAttachment[ 'id' ],\n\tadditionalData: CreateSideloadFile = {},\n\tsignal?: AbortSignal\n) {\n\t// Create upload payload.\n\tconst data = new FormData();\n\tdata.append( 'file', file, file.name || file.type.replace( '/', '.' ) );\n\tfor ( const [ key, value ] of Object.entries( additionalData ) ) {\n\t\tflattenFormData(\n\t\t\tdata,\n\t\t\tkey,\n\t\t\tvalue as string | Record< string, string > | undefined\n\t\t);\n\t}\n\n\treturn transformAttachment(\n\t\tawait apiFetch< RestAttachment >( {\n\t\t\tpath: `/wp/v2/media/${ attachmentId }/sideload`,\n\t\t\tbody: data,\n\t\t\tmethod: 'POST',\n\t\t\tsignal,\n\t\t} )\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAqB;AAMrB,+BAAgC;AAChC,kCAAoC;AAYpC,eAAsB,iBACrB,MACA,cACA,iBAAqC,CAAC,GACtC,QACC;AAED,QAAM,OAAO,IAAI,SAAS;AAC1B,OAAK,OAAQ,QAAQ,MAAM,KAAK,QAAQ,KAAK,KAAK,QAAS,KAAK,GAAI,CAAE;AACtE,aAAY,CAAE,KAAK,KAAM,KAAK,OAAO,QAAS,cAAe,GAAI;AAChE;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAEA,aAAO;AAAA,IACN,UAAM,iBAAAA,SAA4B;AAAA,MACjC,MAAM,gBAAiB,YAAa;AAAA,MACpC,MAAM;AAAA,MACN,QAAQ;AAAA,MACR;AAAA,IACD,CAAE;AAAA,EACH;AACD;",
|
|
6
|
+
"names": ["apiFetch"]
|
|
7
|
+
}
|
|
@@ -1,33 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var transform_attachment_exports = {};
|
|
20
|
+
__export(transform_attachment_exports, {
|
|
21
|
+
transformAttachment: () => transformAttachment
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Transforms an attachment object from the REST API shape into the shape expected by the block editor and other consumers.
|
|
13
|
-
*
|
|
14
|
-
* @param attachment REST API attachment object.
|
|
15
|
-
*/
|
|
23
|
+
module.exports = __toCommonJS(transform_attachment_exports);
|
|
16
24
|
function transformAttachment(attachment) {
|
|
17
|
-
|
|
18
|
-
// eslint-disable-next-line camelcase
|
|
19
|
-
const {
|
|
20
|
-
alt_text,
|
|
21
|
-
source_url,
|
|
22
|
-
...savedMediaProps
|
|
23
|
-
} = attachment;
|
|
25
|
+
const { alt_text, source_url, ...savedMediaProps } = attachment;
|
|
24
26
|
return {
|
|
25
27
|
...savedMediaProps,
|
|
26
28
|
alt: attachment.alt_text,
|
|
27
|
-
caption:
|
|
29
|
+
caption: attachment.caption?.raw ?? "",
|
|
28
30
|
title: attachment.title.raw,
|
|
29
31
|
url: attachment.source_url,
|
|
30
|
-
poster: attachment._embedded?.[
|
|
32
|
+
poster: attachment._embedded?.["wp:featuredmedia"]?.[0]?.source_url || void 0
|
|
31
33
|
};
|
|
32
34
|
}
|
|
33
|
-
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
transformAttachment
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=transform-attachment.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/transform-attachment.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Attachment, RestAttachment } from './types';\n\n/**\n * Transforms an attachment object from the REST API shape into the shape expected by the block editor and other consumers.\n *\n * @param attachment REST API attachment object.\n */\nexport function transformAttachment( attachment: RestAttachment ): Attachment {\n\t// eslint-disable-next-line camelcase\n\tconst { alt_text, source_url, ...savedMediaProps } = attachment;\n\treturn {\n\t\t...savedMediaProps,\n\t\talt: attachment.alt_text,\n\t\tcaption: attachment.caption?.raw ?? '',\n\t\ttitle: attachment.title.raw,\n\t\turl: attachment.source_url,\n\t\tposter:\n\t\t\tattachment._embedded?.[ 'wp:featuredmedia' ]?.[ 0 ]?.source_url ||\n\t\t\tundefined,\n\t};\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,SAAS,oBAAqB,YAAyC;AAE7E,QAAM,EAAE,UAAU,YAAY,GAAG,gBAAgB,IAAI;AACrD,SAAO;AAAA,IACN,GAAG;AAAA,IACH,KAAK,WAAW;AAAA,IAChB,SAAS,WAAW,SAAS,OAAO;AAAA,IACpC,OAAO,WAAW,MAAM;AAAA,IACxB,KAAK,WAAW;AAAA,IAChB,QACC,WAAW,YAAa,kBAAmB,IAAK,CAAE,GAAG,cACrD;AAAA,EACF;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build/utils/types.js
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var types_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
|
17
|
+
//# sourceMappingURL=types.js.map
|
package/build/utils/types.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/types.ts"],
|
|
4
|
+
"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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,29 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var upload_error_exports = {};
|
|
20
|
+
__export(upload_error_exports, {
|
|
21
|
+
UploadError: () => UploadError
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
/**
|
|
8
|
-
* MediaError class.
|
|
9
|
-
*
|
|
10
|
-
* Small wrapper around the `Error` class
|
|
11
|
-
* to hold an error code and a reference to a file object.
|
|
12
|
-
*/
|
|
23
|
+
module.exports = __toCommonJS(upload_error_exports);
|
|
13
24
|
class UploadError extends Error {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
cause
|
|
19
|
-
}) {
|
|
20
|
-
super(message, {
|
|
21
|
-
cause
|
|
22
|
-
});
|
|
25
|
+
code;
|
|
26
|
+
file;
|
|
27
|
+
constructor({ code, message, file, cause }) {
|
|
28
|
+
super(message, { cause });
|
|
23
29
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
24
30
|
this.code = code;
|
|
25
31
|
this.file = file;
|
|
26
32
|
}
|
|
27
33
|
}
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
UploadError
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=upload-error.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/upload-error.ts"],
|
|
4
|
+
"sourcesContent": ["interface UploadErrorArgs {\n\tcode: string;\n\tmessage: string;\n\tfile: File;\n\tcause?: Error;\n}\n\n/**\n * MediaError class.\n *\n * Small wrapper around the `Error` class\n * to hold an error code and a reference to a file object.\n */\nexport class UploadError extends Error {\n\tcode: string;\n\tfile: File;\n\n\tconstructor( { code, message, file, cause }: UploadErrorArgs ) {\n\t\tsuper( message, { cause } );\n\n\t\tObject.setPrototypeOf( this, new.target.prototype );\n\n\t\tthis.code = code;\n\t\tthis.file = file;\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaO,MAAM,oBAAoB,MAAM;AAAA,EACtC;AAAA,EACA;AAAA,EAEA,YAAa,EAAE,MAAM,SAAS,MAAM,MAAM,GAAqB;AAC9D,UAAO,SAAS,EAAE,MAAM,CAAE;AAE1B,WAAO,eAAgB,MAAM,WAAW,SAAU;AAElD,SAAK,OAAO;AACZ,SAAK,OAAO;AAAA,EACb;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,39 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var upload_media_exports = {};
|
|
20
|
+
__export(upload_media_exports, {
|
|
21
|
+
uploadMedia: () => uploadMedia
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
/**
|
|
15
|
-
* WordPress dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Upload a media file when the file upload button is activated
|
|
24
|
-
* or when adding a file to the editor via drag & drop.
|
|
25
|
-
*
|
|
26
|
-
* @param $0 Parameters object passed to the function.
|
|
27
|
-
* @param $0.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed.
|
|
28
|
-
* @param $0.additionalData Additional data to include in the request.
|
|
29
|
-
* @param $0.filesList List of files.
|
|
30
|
-
* @param $0.maxUploadFileSize Maximum upload size in bytes allowed for the site.
|
|
31
|
-
* @param $0.onError Function called when an error happens.
|
|
32
|
-
* @param $0.onFileChange Function called each time a file or a temporary representation of the file is available.
|
|
33
|
-
* @param $0.wpAllowedMimeTypes List of allowed mime types and file extensions.
|
|
34
|
-
* @param $0.signal Abort signal.
|
|
35
|
-
* @param $0.multiple Whether to allow multiple files to be uploaded.
|
|
36
|
-
*/
|
|
23
|
+
module.exports = __toCommonJS(upload_media_exports);
|
|
24
|
+
var import_i18n = require("@wordpress/i18n");
|
|
25
|
+
var import_blob = require("@wordpress/blob");
|
|
26
|
+
var import_upload_to_server = require("./upload-to-server");
|
|
27
|
+
var import_validate_mime_type = require("./validate-mime-type");
|
|
28
|
+
var import_validate_mime_type_for_user = require("./validate-mime-type-for-user");
|
|
29
|
+
var import_validate_file_size = require("./validate-file-size");
|
|
30
|
+
var import_upload_error = require("./upload-error");
|
|
37
31
|
function uploadMedia({
|
|
38
32
|
wpAllowedMimeTypes,
|
|
39
33
|
allowedTypes,
|
|
@@ -46,83 +40,80 @@ function uploadMedia({
|
|
|
46
40
|
multiple = true
|
|
47
41
|
}) {
|
|
48
42
|
if (!multiple && filesList.length > 1) {
|
|
49
|
-
onError?.(new Error((0,
|
|
43
|
+
onError?.(new Error((0, import_i18n.__)("Only one file can be used here.")));
|
|
50
44
|
return;
|
|
51
45
|
}
|
|
52
46
|
const validFiles = [];
|
|
53
47
|
const filesSet = [];
|
|
54
48
|
const setAndUpdateFiles = (index, value) => {
|
|
55
|
-
// For client-side media processing, this is handled by the upload-media package.
|
|
56
49
|
if (!window.__experimentalMediaProcessing) {
|
|
57
50
|
if (filesSet[index]?.url) {
|
|
58
|
-
(0,
|
|
51
|
+
(0, import_blob.revokeBlobURL)(filesSet[index].url);
|
|
59
52
|
}
|
|
60
53
|
}
|
|
61
54
|
filesSet[index] = value;
|
|
62
|
-
onFileChange?.(
|
|
55
|
+
onFileChange?.(
|
|
56
|
+
filesSet.filter((attachment) => attachment !== null)
|
|
57
|
+
);
|
|
63
58
|
};
|
|
64
59
|
for (const mediaFile of filesList) {
|
|
65
|
-
// Verify if user is allowed to upload this mime type.
|
|
66
|
-
// Defer to the server when type not detected.
|
|
67
60
|
try {
|
|
68
|
-
(0,
|
|
61
|
+
(0, import_validate_mime_type_for_user.validateMimeTypeForUser)(mediaFile, wpAllowedMimeTypes);
|
|
69
62
|
} catch (error) {
|
|
70
63
|
onError?.(error);
|
|
71
64
|
continue;
|
|
72
65
|
}
|
|
73
|
-
|
|
74
|
-
// Check if the caller (e.g. a block) supports this mime type.
|
|
75
|
-
// Defer to the server when type not detected.
|
|
76
66
|
try {
|
|
77
|
-
(0,
|
|
67
|
+
(0, import_validate_mime_type.validateMimeType)(mediaFile, allowedTypes);
|
|
78
68
|
} catch (error) {
|
|
79
69
|
onError?.(error);
|
|
80
70
|
continue;
|
|
81
71
|
}
|
|
82
|
-
|
|
83
|
-
// Verify if file is greater than the maximum file upload size allowed for the site.
|
|
84
72
|
try {
|
|
85
|
-
(0,
|
|
73
|
+
(0, import_validate_file_size.validateFileSize)(mediaFile, maxUploadFileSize);
|
|
86
74
|
} catch (error) {
|
|
87
75
|
onError?.(error);
|
|
88
76
|
continue;
|
|
89
77
|
}
|
|
90
78
|
validFiles.push(mediaFile);
|
|
91
|
-
|
|
92
|
-
// For client-side media processing, this is handled by the upload-media package.
|
|
93
79
|
if (!window.__experimentalMediaProcessing) {
|
|
94
|
-
|
|
95
|
-
// with final file from media gallery when upload is `done` below.
|
|
96
|
-
filesSet.push({
|
|
97
|
-
url: (0, _blob.createBlobURL)(mediaFile)
|
|
98
|
-
});
|
|
80
|
+
filesSet.push({ url: (0, import_blob.createBlobURL)(mediaFile) });
|
|
99
81
|
onFileChange?.(filesSet);
|
|
100
82
|
}
|
|
101
83
|
}
|
|
102
84
|
validFiles.map(async (file, index) => {
|
|
103
85
|
try {
|
|
104
|
-
const attachment = await (0,
|
|
86
|
+
const attachment = await (0, import_upload_to_server.uploadToServer)(
|
|
87
|
+
file,
|
|
88
|
+
additionalData,
|
|
89
|
+
signal
|
|
90
|
+
);
|
|
105
91
|
setAndUpdateFiles(index, attachment);
|
|
106
92
|
} catch (error) {
|
|
107
|
-
// Reset to empty on failure.
|
|
108
93
|
setAndUpdateFiles(index, null);
|
|
109
|
-
|
|
110
|
-
// @wordpress/api-fetch throws any response that isn't in the 200 range as-is.
|
|
111
94
|
let message;
|
|
112
|
-
if (typeof error ===
|
|
113
|
-
message = typeof error.message ===
|
|
95
|
+
if (typeof error === "object" && error !== null && "message" in error) {
|
|
96
|
+
message = typeof error.message === "string" ? error.message : String(error.message);
|
|
114
97
|
} else {
|
|
115
|
-
message = (0,
|
|
116
|
-
|
|
117
|
-
|
|
98
|
+
message = (0, import_i18n.sprintf)(
|
|
99
|
+
// translators: %s: file name
|
|
100
|
+
(0, import_i18n.__)("Error while uploading file %s to the media library."),
|
|
101
|
+
file.name
|
|
102
|
+
);
|
|
118
103
|
}
|
|
119
|
-
onError?.(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
104
|
+
onError?.(
|
|
105
|
+
new import_upload_error.UploadError({
|
|
106
|
+
code: "GENERAL",
|
|
107
|
+
message,
|
|
108
|
+
file,
|
|
109
|
+
cause: error instanceof Error ? error : void 0
|
|
110
|
+
})
|
|
111
|
+
);
|
|
125
112
|
}
|
|
126
113
|
});
|
|
127
114
|
}
|
|
128
|
-
|
|
115
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
116
|
+
0 && (module.exports = {
|
|
117
|
+
uploadMedia
|
|
118
|
+
});
|
|
119
|
+
//# sourceMappingURL=upload-media.js.map
|