@wix/form-public 0.583.0 → 0.584.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/dist/index.cjs +12 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -35648,6 +35648,14 @@ var init_esm2 = __esm({
|
|
|
35648
35648
|
}
|
|
35649
35649
|
});
|
|
35650
35650
|
|
|
35651
|
+
// ../form-fields/dist/esm/services/generic-mime-type.js
|
|
35652
|
+
var GENERIC_MIME_TYPE;
|
|
35653
|
+
var init_generic_mime_type = __esm({
|
|
35654
|
+
"../form-fields/dist/esm/services/generic-mime-type.js"() {
|
|
35655
|
+
GENERIC_MIME_TYPE = "application/octet-stream";
|
|
35656
|
+
}
|
|
35657
|
+
});
|
|
35658
|
+
|
|
35651
35659
|
// ../../node_modules/ts-util-is/dist/src/index.js
|
|
35652
35660
|
var require_src2 = __commonJS({
|
|
35653
35661
|
"../../node_modules/ts-util-is/dist/src/index.js"(exports) {
|
|
@@ -57602,6 +57610,7 @@ RadioGroup.Description;
|
|
|
57602
57610
|
RadioGroup.Error;
|
|
57603
57611
|
|
|
57604
57612
|
// ../form-fields/dist/esm/ui/file-upload/use-upload-file.js
|
|
57613
|
+
init_generic_mime_type();
|
|
57605
57614
|
var useUploadFile = (uploadTarget) => {
|
|
57606
57615
|
const { actions, formId } = useFieldActions();
|
|
57607
57616
|
return async (filesToUpload, onDone, onError) => {
|
|
@@ -57620,12 +57629,13 @@ var useUploadFile = (uploadTarget) => {
|
|
|
57620
57629
|
formId,
|
|
57621
57630
|
uploadTarget
|
|
57622
57631
|
}).then((fileDescriptor) => {
|
|
57623
|
-
const { id: id6, displayName, url, isPrivate } = fileDescriptor;
|
|
57632
|
+
const { id: id6, displayName, url, isPrivate, mimeType } = fileDescriptor;
|
|
57624
57633
|
const uploadedFile = {
|
|
57625
57634
|
fileId: id6,
|
|
57626
57635
|
displayName: displayName || file.name,
|
|
57627
57636
|
url: !isPrivate ? url : void 0,
|
|
57628
|
-
|
|
57637
|
+
// the type declared for the upload, so the submission's fileType matches what the backend checked
|
|
57638
|
+
fileType: mimeType || file.type || GENERIC_MIME_TYPE
|
|
57629
57639
|
};
|
|
57630
57640
|
onDone({
|
|
57631
57641
|
file,
|