sprintify-ui 0.4.0 → 0.4.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/dist/sprintify-ui.es.js
CHANGED
|
@@ -18811,12 +18811,11 @@ const f1 = ["disabled"], d1 = ["accept", "multiple"], xs = /* @__PURE__ */ Ee({
|
|
|
18811
18811
|
r("start");
|
|
18812
18812
|
let d = [];
|
|
18813
18813
|
try {
|
|
18814
|
-
const f = new FormData();
|
|
18815
18814
|
if (Array.isArray(h))
|
|
18816
|
-
d = await Promise.all(h.map((
|
|
18815
|
+
d = await Promise.all(h.map((f) => c(f)));
|
|
18817
18816
|
else {
|
|
18818
|
-
const
|
|
18819
|
-
d.push(
|
|
18817
|
+
const f = await c(h);
|
|
18818
|
+
d.push(f);
|
|
18820
18819
|
}
|
|
18821
18820
|
r("success", d);
|
|
18822
18821
|
} catch (f) {
|
|
@@ -18829,16 +18828,17 @@ const f1 = ["disabled"], d1 = ["accept", "multiple"], xs = /* @__PURE__ */ Ee({
|
|
|
18829
18828
|
r("end"), s.value = !1;
|
|
18830
18829
|
}
|
|
18831
18830
|
}
|
|
18832
|
-
async function c(h
|
|
18833
|
-
|
|
18834
|
-
|
|
18835
|
-
|
|
18831
|
+
async function c(h) {
|
|
18832
|
+
const d = new FormData();
|
|
18833
|
+
d.append("file", h);
|
|
18834
|
+
const m = (await n.post(e.url ?? Lt.upload_url, d)).data;
|
|
18835
|
+
return m.original_file = h, new Promise((w) => {
|
|
18836
18836
|
const p = new FileReader();
|
|
18837
18837
|
p.onload = (g) => {
|
|
18838
18838
|
m.data_url = g.target.result, w(m);
|
|
18839
18839
|
}, p.onerror = () => {
|
|
18840
18840
|
w(m);
|
|
18841
|
-
}, m.mime_type.includes("image") ? p.readAsDataURL(
|
|
18841
|
+
}, m.mime_type.includes("image") ? p.readAsDataURL(h) : w(m);
|
|
18842
18842
|
});
|
|
18843
18843
|
}
|
|
18844
18844
|
return (h, d) => (P(), G("div", p1, [
|
package/package.json
CHANGED
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
type="button"
|
|
4
4
|
:class="twButton"
|
|
5
5
|
:disabled="disabled"
|
|
6
|
-
@drop.prevent="
|
|
7
|
-
dragging = false;
|
|
8
|
-
handleDrop($event);
|
|
9
|
-
"
|
|
6
|
+
@drop.prevent="dragging = false; handleDrop($event);"
|
|
10
7
|
@dragleave.prevent="dragging = false"
|
|
11
8
|
@dragover.prevent="dragging = true"
|
|
12
9
|
@dragenter.prevent="dragging = true"
|
|
@@ -120,15 +120,15 @@ async function onFileSelect(files: File | File[]) {
|
|
|
120
120
|
|
|
121
121
|
emit('start');
|
|
122
122
|
|
|
123
|
+
|
|
123
124
|
let payloads = [] as UploadedFile[];
|
|
124
125
|
|
|
125
126
|
try {
|
|
126
|
-
const formData = new FormData();
|
|
127
127
|
|
|
128
128
|
if (Array.isArray(files)) {
|
|
129
|
-
payloads = await Promise.all(files.map(f => processFileUpload(
|
|
129
|
+
payloads = await Promise.all(files.map(f => processFileUpload(f)));
|
|
130
130
|
} else {
|
|
131
|
-
const payload = await processFileUpload(
|
|
131
|
+
const payload = await processFileUpload(files);
|
|
132
132
|
payloads.push(payload);
|
|
133
133
|
}
|
|
134
134
|
|
|
@@ -148,7 +148,10 @@ async function onFileSelect(files: File | File[]) {
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
async function processFileUpload(
|
|
151
|
+
async function processFileUpload(file: File): Promise<UploadedFile> {
|
|
152
|
+
|
|
153
|
+
const formData = new FormData();
|
|
154
|
+
|
|
152
155
|
formData.append('file', file);
|
|
153
156
|
|
|
154
157
|
const response = await http.post(props.url ?? config.upload_url, formData);
|