@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.js
CHANGED
|
@@ -35638,6 +35638,14 @@ var init_esm2 = __esm({
|
|
|
35638
35638
|
}
|
|
35639
35639
|
});
|
|
35640
35640
|
|
|
35641
|
+
// ../form-fields/dist/esm/services/generic-mime-type.js
|
|
35642
|
+
var GENERIC_MIME_TYPE;
|
|
35643
|
+
var init_generic_mime_type = __esm({
|
|
35644
|
+
"../form-fields/dist/esm/services/generic-mime-type.js"() {
|
|
35645
|
+
GENERIC_MIME_TYPE = "application/octet-stream";
|
|
35646
|
+
}
|
|
35647
|
+
});
|
|
35648
|
+
|
|
35641
35649
|
// ../../node_modules/ts-util-is/dist/src/index.js
|
|
35642
35650
|
var require_src2 = __commonJS({
|
|
35643
35651
|
"../../node_modules/ts-util-is/dist/src/index.js"(exports) {
|
|
@@ -57592,6 +57600,7 @@ RadioGroup.Description;
|
|
|
57592
57600
|
RadioGroup.Error;
|
|
57593
57601
|
|
|
57594
57602
|
// ../form-fields/dist/esm/ui/file-upload/use-upload-file.js
|
|
57603
|
+
init_generic_mime_type();
|
|
57595
57604
|
var useUploadFile = (uploadTarget) => {
|
|
57596
57605
|
const { actions, formId } = useFieldActions();
|
|
57597
57606
|
return async (filesToUpload, onDone, onError) => {
|
|
@@ -57610,12 +57619,13 @@ var useUploadFile = (uploadTarget) => {
|
|
|
57610
57619
|
formId,
|
|
57611
57620
|
uploadTarget
|
|
57612
57621
|
}).then((fileDescriptor) => {
|
|
57613
|
-
const { id: id6, displayName, url, isPrivate } = fileDescriptor;
|
|
57622
|
+
const { id: id6, displayName, url, isPrivate, mimeType } = fileDescriptor;
|
|
57614
57623
|
const uploadedFile = {
|
|
57615
57624
|
fileId: id6,
|
|
57616
57625
|
displayName: displayName || file.name,
|
|
57617
57626
|
url: !isPrivate ? url : void 0,
|
|
57618
|
-
|
|
57627
|
+
// the type declared for the upload, so the submission's fileType matches what the backend checked
|
|
57628
|
+
fileType: mimeType || file.type || GENERIC_MIME_TYPE
|
|
57619
57629
|
};
|
|
57620
57630
|
onDone({
|
|
57621
57631
|
file,
|