filepond 5.0.0-beta.20 → 5.0.0-beta.21
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/cdn/assets/index.js +1 -1
- package/cdn/locales/ar-ar.js +1 -1
- package/cdn/locales/bn-bd.js +1 -1
- package/cdn/locales/cs-cz.js +1 -1
- package/cdn/locales/da-dk.js +1 -1
- package/cdn/locales/de-de.js +1 -1
- package/cdn/locales/el-gr.js +1 -1
- package/cdn/locales/en-gb.js +1 -1
- package/cdn/locales/es-es.js +1 -1
- package/cdn/locales/fi-fi.js +1 -1
- package/cdn/locales/fr-fr.js +1 -1
- package/cdn/locales/hi-in.js +1 -1
- package/cdn/locales/hu-hu.js +1 -1
- package/cdn/locales/index.js +1 -1
- package/cdn/locales/is-is.js +1 -1
- package/cdn/locales/it-it.js +1 -1
- package/cdn/locales/ja-jp.js +1 -1
- package/cdn/locales/ko-kr.js +1 -1
- package/cdn/locales/nb-no.js +1 -1
- package/cdn/locales/nl-nl.js +1 -1
- package/cdn/locales/pl-pl.js +1 -1
- package/cdn/locales/pt-pt.js +1 -1
- package/cdn/locales/sv-se.js +1 -1
- package/cdn/locales/tr-tr.js +1 -1
- package/cdn/locales/uk-ua.js +1 -1
- package/cdn/locales/vi-vn.js +1 -1
- package/cdn/locales/zh-cn.js +1 -1
- package/cdn/main.js +2 -2
- package/cdn/workers/httpRequest.js +45 -0
- package/cdn/workers/httpRequestWorker.js +37 -0
- package/cdn/workers/readFile.js +14 -0
- package/cdn/workers/readFileWorker.js +6 -0
- package/cdn/workers/transformImage.js +16 -0
- package/cdn/workers/transformImageWorker.js +8 -0
- package/esm/assets/index.js +1 -1
- package/esm/common/console.js +1 -1
- package/esm/common/entry.js +1 -1
- package/esm/common/perceivedPerformanceProxy.js +1 -1
- package/esm/common/readEntriesFromDataTransfer.js +1 -1
- package/esm/common/ssr.js +1 -1
- package/esm/common/status.js +1 -1
- package/esm/core/entryTree.js +1 -1
- package/esm/core/extensionManager.js +28 -28
- package/esm/core/taskScheduler.js +78 -97
- package/esm/dev/index.js +1 -1
- package/esm/elements/FilePondDefault/index.css.js +1 -1
- package/esm/elements/FilePondDefault/index.js +46 -45
- package/esm/elements/FilePondDropArea/index.css.js +1 -1
- package/esm/elements/FilePondDropArea/index.js +1 -1
- package/esm/elements/FilePondDropArea/index.svelte.js +1 -1
- package/esm/elements/FilePondDropIndicator/index.css.js +1 -1
- package/esm/elements/FilePondDropIndicator/index.js +1 -1
- package/esm/elements/FilePondDropIndicator/index.svelte.js +1 -1
- package/esm/elements/FilePondEntryList/components/Entry/index.css.js +1 -1
- package/esm/elements/FilePondEntryList/components/Entry/index.js +1 -1
- package/esm/elements/FilePondEntryList/components/Entry/index.svelte.js +1 -1
- package/esm/elements/FilePondEntryList/components/EntryActivityIndicator/index.css.js +1 -1
- package/esm/elements/FilePondEntryList/components/EntryActivityIndicator/index.js +1 -1
- package/esm/elements/FilePondEntryList/components/EntryActivityIndicator/index.svelte.js +80 -80
- package/esm/elements/FilePondEntryList/components/EntryList/index.css.js +1 -1
- package/esm/elements/FilePondEntryList/components/EntryList/index.js +1 -1
- package/esm/elements/FilePondEntryList/components/EntryList/index.svelte.js +1 -1
- package/esm/elements/FilePondEntryList/components/EntryListItem/index.css.js +1 -1
- package/esm/elements/FilePondEntryList/components/EntryListItem/index.js +1 -1
- package/esm/elements/FilePondEntryList/components/EntryListItem/index.svelte.js +1 -1
- package/esm/elements/FilePondEntryList/components/EntryListItemPlaceholder/index.svelte.js +1 -1
- package/esm/elements/FilePondEntryList/components/EntryStatus/index.css.js +1 -1
- package/esm/elements/FilePondEntryList/components/EntryStatus/index.js +1 -1
- package/esm/elements/FilePondEntryList/components/EntryStatus/index.svelte.js +1 -1
- package/esm/elements/FilePondEntryList/components/MediaImage/components/BitmapRenderer.svelte.js +65 -60
- package/esm/elements/FilePondEntryList/components/MediaImage/components/BitmapRendererCache.js +1 -1
- package/esm/elements/FilePondEntryList/components/MediaImage/index.css.js +1 -1
- package/esm/elements/FilePondEntryList/components/MediaImage/index.js +2 -1
- package/esm/elements/FilePondEntryList/components/MediaImage/index.svelte.js +70 -70
- package/esm/elements/FilePondEntryList/components/MediaPane/index.css.js +2 -2
- package/esm/elements/FilePondEntryList/components/MediaPane/index.js +1 -1
- package/esm/elements/FilePondEntryList/components/MediaPane/index.svelte.js +1 -1
- package/esm/elements/FilePondEntryList/components/MediaTimeIndicator/index.css.js +1 -1
- package/esm/elements/FilePondEntryList/components/MediaTimeIndicator/index.js +1 -1
- package/esm/elements/FilePondEntryList/components/MediaTimeIndicator/index.svelte.js +1 -1
- package/esm/elements/FilePondEntryList/components/MediaVideo/index.css.js +1 -1
- package/esm/elements/FilePondEntryList/components/MediaVideo/index.js +1 -1
- package/esm/elements/FilePondEntryList/components/MediaVideo/index.svelte.js +1 -1
- package/esm/elements/FilePondEntryList/contexts/appContext.js +1 -1
- package/esm/elements/FilePondEntryList/contexts/dragContext.js +1 -1
- package/esm/elements/FilePondEntryList/contexts/dropContext.js +1 -1
- package/esm/elements/FilePondEntryList/contexts/entryContext.js +1 -1
- package/esm/elements/FilePondEntryList/contexts/springElementTreeContext.js +1 -1
- package/esm/elements/FilePondEntryList/index.css.js +1 -1
- package/esm/elements/FilePondEntryList/index.js +2 -1
- package/esm/elements/FilePondEntryList/index.svelte.js +166 -166
- package/esm/elements/FilePondInput/index.css.js +1 -1
- package/esm/elements/FilePondInput/index.js +15 -11
- package/esm/elements/FilePondSvelteComponent/index.svelte.js +1 -1
- package/esm/elements/attachments/dragarea.js +1 -1
- package/esm/elements/attachments/droparea.js +1 -1
- package/esm/elements/attachments/measurable.js +1 -1
- package/esm/elements/attachments/resizable.js +1 -1
- package/esm/elements/attachments/transitions.js +1 -1
- package/esm/elements/common/animationGuard.js +1 -1
- package/esm/elements/common/animationPreference.svelte.js +1 -1
- package/esm/elements/common/dragDrop.js +1 -1
- package/esm/elements/common/event.js +1 -1
- package/esm/elements/common/extendStyles.js +1 -1
- package/esm/elements/common/getClosestElement.js +1 -1
- package/esm/elements/common/html.js +1 -1
- package/esm/elements/common/nodeTree.js +9 -9
- package/esm/elements/common/store.svelte.js +1 -1
- package/esm/elements/common/string.js +1 -1
- package/esm/elements/common/transition.js +1 -1
- package/esm/elements/components/BooleanInput/index.css.js +1 -1
- package/esm/elements/components/BooleanInput/index.js +1 -1
- package/esm/elements/components/BooleanInput/index.svelte.js +1 -1
- package/esm/elements/components/Button/index.css.js +1 -1
- package/esm/elements/components/Button/index.js +1 -1
- package/esm/elements/components/Button/index.svelte.js +1 -1
- package/esm/elements/components/ElementPane/index.css.js +1 -1
- package/esm/elements/components/ElementPane/index.js +1 -1
- package/esm/elements/components/ElementPane/index.svelte.js +1 -1
- package/esm/elements/components/ElementSkeleton/index.css.js +1 -1
- package/esm/elements/components/ElementSkeleton/index.js +1 -1
- package/esm/elements/components/ElementSkeleton/index.svelte.js +1 -1
- package/esm/elements/components/FilenameInput/index.css.js +1 -1
- package/esm/elements/components/FilenameInput/index.js +1 -1
- package/esm/elements/components/FilenameInput/index.svelte.js +1 -1
- package/esm/elements/components/NodeList/index.svelte.js +1 -1
- package/esm/elements/components/ProgressIndicator/index.css.js +2 -2
- package/esm/elements/components/ProgressIndicator/index.js +1 -1
- package/esm/elements/components/ProgressIndicator/index.svelte.js +70 -70
- package/esm/elements/components/RangeInput/index.css.js +1 -1
- package/esm/elements/components/RangeInput/index.js +1 -1
- package/esm/elements/components/RangeInput/index.svelte.js +1 -1
- package/esm/elements/components/SpringElement/index.svelte.js +1 -1
- package/esm/elements/components/TextInput/index.css.js +1 -1
- package/esm/elements/components/TextInput/index.js +1 -1
- package/esm/elements/components/TextInput/index.svelte.js +1 -1
- package/esm/extensions/blob-loader.js +1 -1
- package/esm/extensions/canvas-loader.js +1 -1
- package/esm/extensions/chunked-upload-store.js +1 -1
- package/esm/extensions/clipboard-source.js +1 -1
- package/esm/extensions/common/createExtension.js +1 -1
- package/esm/extensions/common/createStoreExtension.js +1 -1
- package/esm/extensions/common/createTransformExtension.js +1 -1
- package/esm/extensions/common/createValidatorExtension.js +1 -1
- package/esm/extensions/console-view.js +1 -1
- package/esm/extensions/data-transfer-loader.js +1 -1
- package/esm/extensions/data-url-store.js +24 -19
- package/esm/extensions/drag-drop-source.js +1 -1
- package/esm/extensions/dropbox-source.js +1 -1
- package/esm/extensions/entry-list-view.js +1 -1
- package/esm/extensions/file-extension-validator.js +1 -1
- package/esm/extensions/file-input-source.js +1 -1
- package/esm/extensions/file-input-store.js +1 -1
- package/esm/extensions/file-mime-type-validator.js +1 -1
- package/esm/extensions/file-name-transform.js +1 -1
- package/esm/extensions/file-name-validator.js +1 -1
- package/esm/extensions/file-size-validator.js +1 -1
- package/esm/extensions/form-post-store.js +1 -1
- package/esm/extensions/image-bitmap-transform.js +56 -54
- package/esm/extensions/index.js +1 -1
- package/esm/extensions/list-count-validator.js +1 -1
- package/esm/extensions/list-size-validator.js +1 -1
- package/esm/extensions/media-resolution-validator.js +1 -1
- package/esm/extensions/object-url-store.js +1 -1
- package/esm/extensions/simulated-loader.js +74 -65
- package/esm/extensions/simulated-store.js +1 -1
- package/esm/extensions/text-input-store.js +1 -1
- package/esm/extensions/url-loader.js +74 -71
- package/esm/extensions/value-callback-store.js +1 -1
- package/esm/index.js +1 -1
- package/esm/locales/ar-ar.js +1 -1
- package/esm/locales/bn-bd.js +1 -1
- package/esm/locales/cs-cz.js +1 -1
- package/esm/locales/da-dk.js +1 -1
- package/esm/locales/de-de.js +1 -1
- package/esm/locales/el-gr.js +1 -1
- package/esm/locales/en-gb.js +1 -1
- package/esm/locales/es-es.js +1 -1
- package/esm/locales/fi-fi.js +1 -1
- package/esm/locales/fr-fr.js +1 -1
- package/esm/locales/hi-in.js +1 -1
- package/esm/locales/hu-hu.js +1 -1
- package/esm/locales/index.js +1 -1
- package/esm/locales/is-is.js +1 -1
- package/esm/locales/it-it.js +1 -1
- package/esm/locales/ja-jp.js +1 -1
- package/esm/locales/ko-kr.js +1 -1
- package/esm/locales/nb-no.js +1 -1
- package/esm/locales/nl-nl.js +1 -1
- package/esm/locales/pl-pl.js +1 -1
- package/esm/locales/pt-pt.js +1 -1
- package/esm/locales/sv-se.js +1 -1
- package/esm/locales/tr-tr.js +1 -1
- package/esm/locales/uk-ua.js +1 -1
- package/esm/locales/vi-vn.js +1 -1
- package/esm/locales/zh-cn.js +1 -1
- package/esm/templates/entry.js +2 -2
- package/esm/templates/helpers.js +1 -1
- package/esm/templates/index.js +1 -1
- package/esm/templates/media.js +119 -111
- package/esm/utils/array.js +1 -1
- package/esm/utils/bounds.js +1 -1
- package/esm/utils/cache.js +1 -1
- package/esm/utils/canvasToBlob.js +1 -1
- package/esm/utils/date.js +1 -1
- package/esm/utils/debounce.js +1 -1
- package/esm/utils/dom.js +1 -1
- package/esm/utils/file.js +1 -1
- package/esm/utils/functionToBlob.js +1 -1
- package/esm/utils/keyboard.js +1 -1
- package/esm/utils/math.js +1 -1
- package/esm/utils/media.js +1 -1
- package/esm/utils/number.js +1 -1
- package/esm/utils/object.js +1 -1
- package/esm/utils/objectURL.js +1 -1
- package/esm/utils/placeholder.js +1 -1
- package/esm/utils/poly.js +1 -1
- package/esm/utils/pubsub.js +1 -1
- package/esm/utils/rect.js +1 -1
- package/esm/utils/size.js +1 -1
- package/esm/utils/sleep.js +1 -1
- package/esm/utils/string.js +1 -1
- package/esm/utils/support.js +1 -1
- package/esm/utils/test.js +1 -1
- package/esm/utils/thread.js +47 -42
- package/esm/utils/tree.js +1 -1
- package/esm/utils/url.js +1 -1
- package/esm/utils/vector.js +1 -1
- package/esm/utils/window.js +1 -1
- package/esm/utils/xhr.js +88 -113
- package/esm/workers/httpRequest.js +45 -0
- package/esm/workers/httpRequestWorker.js +37 -0
- package/esm/workers/readFile.js +14 -0
- package/esm/workers/readFileWorker.js +6 -0
- package/esm/workers/transformImage.js +16 -0
- package/esm/workers/transformImageWorker.js +8 -0
- package/package.json +5 -1
- package/types/core/taskScheduler.d.ts +2 -2
- package/types/elements/FilePondDefault/index.d.ts +2 -0
- package/types/elements/FilePondInput/index.d.ts +2 -0
- package/types/elements/common/nodeTree.d.ts +1 -1
- package/types/extensions/data-url-store.d.ts +2 -0
- package/types/extensions/image-bitmap-transform.d.ts +2 -0
- package/types/extensions/simulated-loader.d.ts +2 -0
- package/types/extensions/url-loader.d.ts +2 -0
- package/types/templates/media.d.ts +14 -0
- package/types/types/index.d.ts +5 -11
- package/types/utils/thread.d.ts +6 -0
- package/types/utils/xhr.d.ts +1 -0
- package/types/workers/httpRequest.d.ts +23 -0
- package/types/workers/readFile.d.ts +9 -0
- package/types/workers/transformImage.d.ts +6 -0
package/esm/utils/test.js
CHANGED
package/esm/utils/thread.js
CHANGED
|
@@ -1,76 +1,81 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* FilePond v5.0.0-beta.
|
|
2
|
+
* FilePond v5.0.0-beta.21
|
|
3
3
|
* Copyright (c) 2017-2026 Pqina B.V.
|
|
4
4
|
* Released under the MIT License
|
|
5
5
|
* https://filepond.com
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import E from "./functionToBlob.js";
|
|
8
8
|
import { arrayRemoveInPlace as T } from "./array.js";
|
|
9
|
-
import { requestIdleCallback as
|
|
10
|
-
import { createObjectURL as
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
import { requestIdleCallback as M } from "./poly.js";
|
|
10
|
+
import { createObjectURL as O } from "./objectURL.js";
|
|
11
|
+
import { isString as I } from "./test.js";
|
|
12
|
+
const U = (o) => `function () {self.onmessage = function (message) {(${o.toString()}).apply(null, message.data.concat([function (err, response, transferList = []) {const message = { content: response, error: err };return self.postMessage(message, transferList);},{onprogress: function({ lengthComputable, loaded, total }) {self.postMessage({ type: 'progress', content: { lengthComputable, loaded, total }, error: null })}}]))}}`, a = [], n = [], A = 5e3;
|
|
13
|
+
function B(o, l) {
|
|
14
|
+
return o ? `${o}/${l.fileName}Worker.js` : l;
|
|
15
|
+
}
|
|
16
|
+
function K(o, l, S = {}) {
|
|
17
|
+
return new Promise((k, u) => {
|
|
18
|
+
const v = navigator.hardwareConcurrency, p = ({ fn: s, args: h, options: y, promise: w }) => {
|
|
15
19
|
const {
|
|
16
|
-
abortController:
|
|
17
|
-
transferList:
|
|
18
|
-
onabort:
|
|
20
|
+
abortController: g = new AbortController(),
|
|
21
|
+
transferList: C = [],
|
|
22
|
+
onabort: m,
|
|
19
23
|
onprogress: R
|
|
20
|
-
} = y,
|
|
21
|
-
let e =
|
|
24
|
+
} = y, W = !I(s), f = W ? s.toString() : s;
|
|
25
|
+
let e = a.find((r) => r.fnStr === f && !r.busy);
|
|
22
26
|
if (!e) {
|
|
23
|
-
if (
|
|
27
|
+
if (a.filter((t) => t.busy).length >= v) {
|
|
24
28
|
const t = {
|
|
25
|
-
fn:
|
|
26
|
-
fnStr:
|
|
27
|
-
args:
|
|
29
|
+
fn: s,
|
|
30
|
+
fnStr: f,
|
|
31
|
+
args: h,
|
|
28
32
|
options: y,
|
|
29
|
-
promise: { resolve:
|
|
33
|
+
promise: { resolve: k, reject: u }
|
|
30
34
|
};
|
|
31
|
-
|
|
32
|
-
T(
|
|
35
|
+
n.push(t), g.signal.onabort = () => {
|
|
36
|
+
T(n, (c) => c === t), m && m();
|
|
33
37
|
};
|
|
34
38
|
return;
|
|
35
39
|
}
|
|
36
|
-
const r =
|
|
37
|
-
e = {
|
|
40
|
+
const r = W ? O(E(U(s))) : f, i = new window.Worker(r);
|
|
41
|
+
i.addEventListener("error", u), e = {
|
|
38
42
|
busy: !1,
|
|
39
|
-
fnStr:
|
|
40
|
-
url:
|
|
41
|
-
worker:
|
|
43
|
+
fnStr: f,
|
|
44
|
+
url: r,
|
|
45
|
+
worker: i,
|
|
42
46
|
terminationTimeout: void 0,
|
|
43
47
|
terminate: () => {
|
|
44
|
-
clearTimeout(e.terminationTimeout), e.worker.terminate(), URL.revokeObjectURL(
|
|
45
|
-
|
|
48
|
+
clearTimeout(e.terminationTimeout), e.worker.terminate(), i.addEventListener("error", u), r.startsWith("blob:") && URL.revokeObjectURL(r), T(
|
|
49
|
+
a,
|
|
46
50
|
(t) => t === e
|
|
47
|
-
),
|
|
51
|
+
), n.length && p(n.shift());
|
|
48
52
|
}
|
|
49
|
-
},
|
|
53
|
+
}, a.find((t) => t.busy === !1)?.terminate(), a.push(e);
|
|
50
54
|
}
|
|
51
55
|
e.busy = !0, clearTimeout(e.terminationTimeout), e.worker.onmessage = function(r) {
|
|
52
|
-
const { type:
|
|
53
|
-
if (
|
|
54
|
-
return R && R(
|
|
56
|
+
const { type: i, content: b, error: t } = r.data;
|
|
57
|
+
if (i === "progress")
|
|
58
|
+
return R && R(b);
|
|
55
59
|
clearTimeout(e.terminationTimeout), e.terminationTimeout = setTimeout(() => {
|
|
56
60
|
e.terminate();
|
|
57
|
-
},
|
|
58
|
-
const
|
|
59
|
-
if (!
|
|
61
|
+
}, A), t ? w.reject(t) : w.resolve(b);
|
|
62
|
+
const c = n.filter((d) => d.fnStr === e.fnStr);
|
|
63
|
+
if (!c.length) {
|
|
60
64
|
e.busy = !1;
|
|
61
65
|
return;
|
|
62
66
|
}
|
|
63
|
-
const
|
|
64
|
-
T(
|
|
65
|
-
e.busy = !1,
|
|
67
|
+
const L = c.shift();
|
|
68
|
+
T(n, (d) => d === L), M(() => {
|
|
69
|
+
e.busy = !1, p(L);
|
|
66
70
|
});
|
|
67
|
-
}, e.worker.postMessage(
|
|
68
|
-
e.terminate(),
|
|
71
|
+
}, e.worker.postMessage(h, C), g && (g.signal.onabort = () => {
|
|
72
|
+
e.terminate(), m && m();
|
|
69
73
|
});
|
|
70
74
|
};
|
|
71
|
-
|
|
75
|
+
p({ fn: o, args: l, options: S, promise: { resolve: k, reject: u } });
|
|
72
76
|
});
|
|
73
77
|
}
|
|
74
78
|
export {
|
|
75
|
-
|
|
79
|
+
B as createThreadWorker,
|
|
80
|
+
K as thread
|
|
76
81
|
};
|
package/esm/utils/tree.js
CHANGED
package/esm/utils/url.js
CHANGED
package/esm/utils/vector.js
CHANGED
package/esm/utils/window.js
CHANGED
package/esm/utils/xhr.js
CHANGED
|
@@ -1,151 +1,126 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* FilePond v5.0.0-beta.
|
|
2
|
+
* FilePond v5.0.0-beta.21
|
|
3
3
|
* Copyright (c) 2017-2026 Pqina B.V.
|
|
4
4
|
* Released under the MIT License
|
|
5
5
|
* https://filepond.com
|
|
6
6
|
*/
|
|
7
|
-
import { toKebabCase as
|
|
8
|
-
import { toURL as
|
|
9
|
-
import { noop as
|
|
10
|
-
import { thread as
|
|
11
|
-
import { arrayRemoveFalsy as
|
|
12
|
-
|
|
7
|
+
import { toKebabCase as P, toCamelCase as b } from "./string.js";
|
|
8
|
+
import { toURL as F } from "./url.js";
|
|
9
|
+
import { noop as d } from "./placeholder.js";
|
|
10
|
+
import { thread as U, createThreadWorker as y } from "./thread.js";
|
|
11
|
+
import { arrayRemoveFalsy as E } from "./array.js";
|
|
12
|
+
import { httpRequest as h } from "../workers/httpRequest.js";
|
|
13
|
+
function j(t, r) {
|
|
13
14
|
const {
|
|
14
15
|
method: e,
|
|
15
|
-
queryString:
|
|
16
|
-
headers:
|
|
17
|
-
data:
|
|
18
|
-
formData:
|
|
16
|
+
queryString: n,
|
|
17
|
+
headers: s,
|
|
18
|
+
data: o,
|
|
19
|
+
formData: m,
|
|
19
20
|
responseType: g,
|
|
20
|
-
withCredentials:
|
|
21
|
-
timeout:
|
|
22
|
-
useWebWorkers:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
withCredentials: R,
|
|
22
|
+
timeout: w,
|
|
23
|
+
useWebWorkers: C = !1,
|
|
24
|
+
workersURL: H,
|
|
25
|
+
abortController: q,
|
|
26
|
+
onprogress: v = d,
|
|
27
|
+
onabort: L = d
|
|
28
|
+
} = r ?? {}, p = {
|
|
29
|
+
url: W(t, n),
|
|
28
30
|
responseType: g,
|
|
29
31
|
method: e,
|
|
30
|
-
headers: Object.entries(
|
|
31
|
-
|
|
32
|
+
headers: Object.entries(s ?? {}).map(([a, i]) => [
|
|
33
|
+
P(a),
|
|
32
34
|
`${i}`
|
|
33
35
|
]),
|
|
34
|
-
data:
|
|
35
|
-
formData:
|
|
36
|
-
timeout:
|
|
37
|
-
withCredentials:
|
|
38
|
-
},
|
|
39
|
-
function
|
|
40
|
-
return new Promise((i,
|
|
41
|
-
|
|
36
|
+
data: o,
|
|
37
|
+
formData: m,
|
|
38
|
+
timeout: w,
|
|
39
|
+
withCredentials: R
|
|
40
|
+
}, l = { abortController: q, onprogress: v, onabort: L };
|
|
41
|
+
function f(a) {
|
|
42
|
+
return new Promise((i, u) => {
|
|
43
|
+
a.then((c) => {
|
|
42
44
|
i({
|
|
43
|
-
getAllResponseHeaders: () =>
|
|
44
|
-
response:
|
|
45
|
+
getAllResponseHeaders: () => c.responseHeaders,
|
|
46
|
+
response: c.response
|
|
45
47
|
});
|
|
46
|
-
}).catch(
|
|
48
|
+
}).catch(u);
|
|
47
49
|
});
|
|
48
50
|
}
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
return f(
|
|
52
|
+
C ? (
|
|
53
|
+
// @ts-ignore fix types
|
|
54
|
+
U(y(H, h), [p], l)
|
|
55
|
+
) : new Promise(
|
|
56
|
+
(a, i) => (
|
|
57
|
+
// httpRequest()
|
|
58
|
+
h(
|
|
59
|
+
p,
|
|
60
|
+
(u, c) => {
|
|
61
|
+
if (u) {
|
|
62
|
+
i(new Error(u));
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
a(c);
|
|
66
|
+
},
|
|
67
|
+
l
|
|
68
|
+
)
|
|
69
|
+
)
|
|
60
70
|
)
|
|
61
|
-
)
|
|
71
|
+
);
|
|
62
72
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
data: o,
|
|
68
|
-
headers: a = [],
|
|
69
|
-
timeout: u = 0,
|
|
70
|
-
withCredentials: c = !1,
|
|
71
|
-
responseType: g = "text"
|
|
72
|
-
}, f, { abortController: R = new AbortController(), onprogress: H, onabort: w }) {
|
|
73
|
-
function m() {
|
|
74
|
-
f(r.status + " (" + r.statusText + ")");
|
|
75
|
-
}
|
|
76
|
-
function E() {
|
|
77
|
-
const s = {
|
|
78
|
-
response: r.response,
|
|
79
|
-
responseHeaders: r.getAllResponseHeaders()
|
|
80
|
-
};
|
|
81
|
-
f(null, s, typeof s.response != "string" ? [s.response] : void 0);
|
|
82
|
-
}
|
|
83
|
-
function d(s) {
|
|
84
|
-
const i = new FormData();
|
|
85
|
-
return b(s).forEach((l) => {
|
|
86
|
-
i.append(...l);
|
|
87
|
-
}), i;
|
|
88
|
-
}
|
|
89
|
-
const r = new XMLHttpRequest();
|
|
90
|
-
r.responseType = g, R.signal.onabort = () => {
|
|
91
|
-
r.abort();
|
|
92
|
-
};
|
|
93
|
-
const p = o || (e ? d(e) : null);
|
|
94
|
-
(p ? r.upload : r).onprogress = H, r.onload = () => {
|
|
95
|
-
r.status >= 200 && r.status < 300 ? E() : m();
|
|
96
|
-
}, r.onerror = m, r.ontimeout = m, r.onabort = w, r.open(p && (t === "GET" || t === "HEAD") ? "POST" : t, n), r.withCredentials = c, r.timeout = u, a.forEach(([s, i]) => r.setRequestHeader(s, i)), r.send(p);
|
|
97
|
-
}
|
|
98
|
-
function y(n, t = {}) {
|
|
99
|
-
const e = P(n);
|
|
100
|
-
return Object.entries(t).forEach(
|
|
101
|
-
([o, a]) => e.searchParams.append(o, `${a}`)
|
|
73
|
+
function W(t, r = {}) {
|
|
74
|
+
const e = F(t);
|
|
75
|
+
return Object.entries(r).forEach(
|
|
76
|
+
([n, s]) => e.searchParams.append(n, `${s}`)
|
|
102
77
|
), `${e}`;
|
|
103
78
|
}
|
|
104
|
-
function
|
|
79
|
+
function I(t, r, e) {
|
|
105
80
|
return new ProgressEvent("progress", {
|
|
106
|
-
lengthComputable:
|
|
107
|
-
loaded:
|
|
108
|
-
total:
|
|
81
|
+
lengthComputable: t || !1,
|
|
82
|
+
loaded: t ? r && e === 1 ? r * 100 : r : 0,
|
|
83
|
+
total: t ? e === 1 ? 100 : e : 0
|
|
109
84
|
});
|
|
110
85
|
}
|
|
111
|
-
function
|
|
112
|
-
return
|
|
113
|
-
|
|
86
|
+
function K(t) {
|
|
87
|
+
return t ? E(
|
|
88
|
+
t.getAllResponseHeaders().split(`
|
|
114
89
|
`).map((e) => {
|
|
115
|
-
const
|
|
116
|
-
if (!
|
|
90
|
+
const n = e.match(/(^.*?):/) || [], [s, o] = n;
|
|
91
|
+
if (!s)
|
|
117
92
|
return;
|
|
118
|
-
const
|
|
119
|
-
return [
|
|
93
|
+
const m = e.replace(s, "").trim();
|
|
94
|
+
return [o, m];
|
|
120
95
|
})
|
|
121
96
|
).reduce(
|
|
122
|
-
(e,
|
|
123
|
-
const [
|
|
124
|
-
return e[
|
|
97
|
+
(e, n) => {
|
|
98
|
+
const [s, o] = n;
|
|
99
|
+
return e[b(s)] = o, e;
|
|
125
100
|
},
|
|
126
101
|
{}
|
|
127
102
|
) : {};
|
|
128
103
|
}
|
|
129
|
-
function
|
|
130
|
-
const { contentDisposition:
|
|
131
|
-
return !
|
|
104
|
+
function S(t) {
|
|
105
|
+
const { contentDisposition: r } = t;
|
|
106
|
+
return !r || !r.length ? null : $(r);
|
|
132
107
|
}
|
|
133
|
-
function
|
|
134
|
-
if (!
|
|
108
|
+
function $(t) {
|
|
109
|
+
if (!t.toLowerCase().startsWith("attachment"))
|
|
135
110
|
return null;
|
|
136
|
-
const
|
|
137
|
-
return
|
|
111
|
+
const r = t.split(/filename=|filename\*=.+''/i).splice(1).map((e) => e.trim().replace(/^["']|[;"']{0,2}$/g, "")).filter((e) => e.length);
|
|
112
|
+
return r.length ? decodeURI(r[r.length - 1]) : null;
|
|
138
113
|
}
|
|
139
|
-
function
|
|
140
|
-
const e =
|
|
141
|
-
`).find((
|
|
114
|
+
function V(t, r) {
|
|
115
|
+
const e = r.toLowerCase().split(`
|
|
116
|
+
`).find((n) => n.includes(t));
|
|
142
117
|
return e ? e.split(":")[1].trim() : void 0;
|
|
143
118
|
}
|
|
144
119
|
export {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
120
|
+
I as createProgressEvent,
|
|
121
|
+
$ as getFilenameFromContentDispositionHeader,
|
|
122
|
+
S as getFilenameFromResponseHeaders,
|
|
123
|
+
V as getResponseHeaderValue,
|
|
124
|
+
K as getResponseHeaders,
|
|
125
|
+
j as xhr
|
|
151
126
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* FilePond v5.0.0-beta.21
|
|
3
|
+
* Copyright (c) 2017-2026 Pqina B.V.
|
|
4
|
+
* Released under the MIT License
|
|
5
|
+
* https://filepond.com
|
|
6
|
+
*/
|
|
7
|
+
function g({
|
|
8
|
+
url: l,
|
|
9
|
+
method: s = "GET",
|
|
10
|
+
formData: a,
|
|
11
|
+
data: p,
|
|
12
|
+
headers: i = [],
|
|
13
|
+
timeout: d = 0,
|
|
14
|
+
withCredentials: f = !1,
|
|
15
|
+
responseType: c = "text"
|
|
16
|
+
}, u, { abortController: E = new AbortController(), onprogress: T, onabort: h }) {
|
|
17
|
+
function n() {
|
|
18
|
+
u(e.status + " (" + e.statusText + ")");
|
|
19
|
+
}
|
|
20
|
+
function q() {
|
|
21
|
+
const t = {
|
|
22
|
+
response: e.response,
|
|
23
|
+
responseHeaders: e.getAllResponseHeaders()
|
|
24
|
+
};
|
|
25
|
+
u(null, t, typeof t.response != "string" ? [t.response] : void 0);
|
|
26
|
+
}
|
|
27
|
+
function H(t) {
|
|
28
|
+
const o = new FormData();
|
|
29
|
+
return t.filter(Boolean).forEach((R) => {
|
|
30
|
+
o.append(...R);
|
|
31
|
+
}), o;
|
|
32
|
+
}
|
|
33
|
+
const e = new XMLHttpRequest();
|
|
34
|
+
e.responseType = c, E.signal.onabort = () => {
|
|
35
|
+
e.abort();
|
|
36
|
+
};
|
|
37
|
+
const r = p || (a ? H(a) : null);
|
|
38
|
+
(r ? e.upload : e).onprogress = T, e.onload = () => {
|
|
39
|
+
e.status >= 200 && e.status < 300 ? q() : n();
|
|
40
|
+
}, e.onerror = n, e.ontimeout = n, e.onabort = h, e.open(r && (s === "GET" || s === "HEAD") ? "POST" : s, l), e.withCredentials = f, e.timeout = d, i.forEach(([t, o]) => e.setRequestHeader(t, o)), e.send(r);
|
|
41
|
+
}
|
|
42
|
+
g.fileName = "httpRequest";
|
|
43
|
+
export {
|
|
44
|
+
g as httpRequest
|
|
45
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
function g({
|
|
2
|
+
url: l,
|
|
3
|
+
method: s = "GET",
|
|
4
|
+
formData: a,
|
|
5
|
+
data: p,
|
|
6
|
+
headers: i = [],
|
|
7
|
+
timeout: d = 0,
|
|
8
|
+
withCredentials: f = !1,
|
|
9
|
+
responseType: c = "text"
|
|
10
|
+
}, u, { abortController: E = new AbortController(), onprogress: T, onabort: h }) {
|
|
11
|
+
function n() {
|
|
12
|
+
u(e.status + " (" + e.statusText + ")");
|
|
13
|
+
}
|
|
14
|
+
function q() {
|
|
15
|
+
const t = {
|
|
16
|
+
response: e.response,
|
|
17
|
+
responseHeaders: e.getAllResponseHeaders()
|
|
18
|
+
};
|
|
19
|
+
u(null, t, typeof t.response != "string" ? [t.response] : void 0);
|
|
20
|
+
}
|
|
21
|
+
function H(t) {
|
|
22
|
+
const o = new FormData();
|
|
23
|
+
return t.filter(Boolean).forEach((R) => {
|
|
24
|
+
o.append(...R);
|
|
25
|
+
}), o;
|
|
26
|
+
}
|
|
27
|
+
const e = new XMLHttpRequest();
|
|
28
|
+
e.responseType = c, E.signal.onabort = () => {
|
|
29
|
+
e.abort();
|
|
30
|
+
};
|
|
31
|
+
const r = p || (a ? H(a) : null);
|
|
32
|
+
(r ? e.upload : e).onprogress = T, e.onload = () => {
|
|
33
|
+
e.status >= 200 && e.status < 300 ? q() : n();
|
|
34
|
+
}, e.onerror = n, e.ontimeout = n, e.onabort = h, e.open(r && (s === "GET" || s === "HEAD") ? "POST" : s, l), e.withCredentials = f, e.timeout = d, i.forEach(([t, o]) => e.setRequestHeader(t, o)), e.send(r);
|
|
35
|
+
}
|
|
36
|
+
g.fileName = "httpRequest";
|
|
37
|
+
self.onmessage = function (message) {g.apply(null, message.data.concat([function (err, response, transferList = []) {const message = { content: response, error: err };return self.postMessage(message, transferList);},{onprogress: function({ lengthComputable, loaded, total }) {self.postMessage({ type: 'progress', content: { lengthComputable, loaded, total }, error: null })}}]))}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* FilePond v5.0.0-beta.21
|
|
3
|
+
* Copyright (c) 2017-2026 Pqina B.V.
|
|
4
|
+
* Released under the MIT License
|
|
5
|
+
* https://filepond.com
|
|
6
|
+
*/
|
|
7
|
+
function d(a, r, { onprogress: n }) {
|
|
8
|
+
const e = new FileReader();
|
|
9
|
+
e.onprogress = n, e.onloadend = () => r(null, { dataURL: e.result }), e.onerror = (o) => r(o), e.readAsDataURL(a);
|
|
10
|
+
}
|
|
11
|
+
d.fileName = "readFile";
|
|
12
|
+
export {
|
|
13
|
+
d as readFile
|
|
14
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
function d(a, r, { onprogress: n }) {
|
|
2
|
+
const e = new FileReader();
|
|
3
|
+
e.onprogress = n, e.onloadend = () => r(null, { dataURL: e.result }), e.onerror = (o) => r(o), e.readAsDataURL(a);
|
|
4
|
+
}
|
|
5
|
+
d.fileName = "readFile";
|
|
6
|
+
self.onmessage = function (message) {d.apply(null, message.data.concat([function (err, response, transferList = []) {const message = { content: response, error: err };return self.postMessage(message, transferList);},{onprogress: function({ lengthComputable, loaded, total }) {self.postMessage({ type: 'progress', content: { lengthComputable, loaded, total }, error: null })}}]))}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* FilePond v5.0.0-beta.21
|
|
3
|
+
* Copyright (c) 2017-2026 Pqina B.V.
|
|
4
|
+
* Released under the MIT License
|
|
5
|
+
* https://filepond.com
|
|
6
|
+
*/
|
|
7
|
+
function r(a, e, m, l) {
|
|
8
|
+
const n = e ? [a, ...Object.values(e), m] : [a, m];
|
|
9
|
+
createImageBitmap.apply(null, n).then((t) => {
|
|
10
|
+
l(null, t, [t]);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
r.fileName = "transformImage";
|
|
14
|
+
export {
|
|
15
|
+
r as transformImage
|
|
16
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
function r(a, e, m, l) {
|
|
2
|
+
const n = e ? [a, ...Object.values(e), m] : [a, m];
|
|
3
|
+
createImageBitmap.apply(null, n).then((t) => {
|
|
4
|
+
l(null, t, [t]);
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
r.fileName = "transformImage";
|
|
8
|
+
self.onmessage = function (message) {r.apply(null, message.data.concat([function (err, response, transferList = []) {const message = { content: response, error: err };return self.postMessage(message, transferList);},{onprogress: function({ lengthComputable, loaded, total }) {self.postMessage({ type: 'progress', content: { lengthComputable, loaded, total }, error: null })}}]))}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"tag": "beta"
|
|
4
4
|
},
|
|
5
5
|
"name": "filepond",
|
|
6
|
-
"version": "5.0.0-beta.
|
|
6
|
+
"version": "5.0.0-beta.21",
|
|
7
7
|
"description": "FilePond, where files go to stretch their bits.",
|
|
8
8
|
"author": "Rik Schennink",
|
|
9
9
|
"license": "MIT",
|
|
@@ -60,6 +60,10 @@
|
|
|
60
60
|
"types": "./types/locales/index.d.ts",
|
|
61
61
|
"import": "./esm/assets/index.js"
|
|
62
62
|
},
|
|
63
|
+
"./workers": {
|
|
64
|
+
"types": "./types/workers/*.d.ts",
|
|
65
|
+
"import": "./esm/workers/*.js"
|
|
66
|
+
},
|
|
63
67
|
"./dev": {
|
|
64
68
|
"types": "./types/dev/index.d.ts",
|
|
65
69
|
"import": "./esm/dev/index.js"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface TaskSchedulerOptions {
|
|
2
|
-
|
|
2
|
+
log?: (tasks: Task[]) => void;
|
|
3
3
|
}
|
|
4
4
|
export interface TaskFnOptions {
|
|
5
5
|
abortController: AbortController;
|
|
@@ -21,7 +21,7 @@ export interface Task {
|
|
|
21
21
|
state: number;
|
|
22
22
|
/** Used to abort the task */
|
|
23
23
|
abortController: AbortController;
|
|
24
|
-
/** Run this task even when an earlier task has a soft failure */
|
|
24
|
+
/** Run this task even when an earlier task has a soft failure (for example file failed to validate) */
|
|
25
25
|
isOptional: boolean;
|
|
26
26
|
}
|
|
27
27
|
export interface TaskOptions {
|
|
@@ -39,6 +39,8 @@ export interface defineFilePondOptions {
|
|
|
39
39
|
extensions?: ExtensionFactory[];
|
|
40
40
|
/** Initial Spring configuration */
|
|
41
41
|
springDefaults?: SpringOptions;
|
|
42
|
+
/** Location of web workers */
|
|
43
|
+
workersURL?: URL;
|
|
42
44
|
}
|
|
43
45
|
/**
|
|
44
46
|
* Registers the `<file-pond>` custom element, `initialOptions` passed will be assigned as props,
|
|
@@ -113,6 +113,8 @@ export declare class FilePondInputElement extends HTMLElementSafe implements Fil
|
|
|
113
113
|
get locale(): Locale | undefined;
|
|
114
114
|
/** Sets custom extensions to load */
|
|
115
115
|
set extensions(extensions: ExtensionFactory[]);
|
|
116
|
+
/** Update worker url */
|
|
117
|
+
set workersURL(value: URL);
|
|
116
118
|
/** Browse files */
|
|
117
119
|
browse(): void;
|
|
118
120
|
/** Listen for events */
|
|
@@ -83,7 +83,7 @@ export interface NodeTree {
|
|
|
83
83
|
remove: (key: string) => NodeTree;
|
|
84
84
|
replace: (key: string, ...nodes: (NodeTree | TemplateNode)[]) => NodeTree;
|
|
85
85
|
update: (key: string, updater: (node: TemplateNode) => void) => NodeTree;
|
|
86
|
-
append: (...nodes: (NodeTree | TemplateNode)[]) => NodeTree;
|
|
86
|
+
append: (...nodes: (NodeTree | TemplateNode | false)[]) => NodeTree;
|
|
87
87
|
prepend: (...nodes: (NodeTree | TemplateNode)[]) => NodeTree;
|
|
88
88
|
insert: (index: number, ...nodes: (NodeTree | TemplateNode)[]) => NodeTree;
|
|
89
89
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { StoreExtensionOptions } from './common/createStoreExtension.js';
|
|
2
2
|
export interface DataURLStoreOptions extends StoreExtensionOptions {
|
|
3
|
+
/** Where the extension can find the WebWorker to use */
|
|
4
|
+
workersURL?: URL;
|
|
3
5
|
}
|
|
4
6
|
export declare const DataURLStore: import("./common/createExtension.js").Extension;
|
|
5
7
|
declare module '../index.js' {
|
|
@@ -16,6 +16,8 @@ export interface ImageBitmapTransformOptions extends TransformExtensionOptions {
|
|
|
16
16
|
quality?: 'pixelated' | 'low' | 'medium' | 'high';
|
|
17
17
|
/** Compression quality. Value between `0` and `1`, defaults to `.98`, only applies to JPEG and WEBP output */
|
|
18
18
|
compression?: number;
|
|
19
|
+
/** Where the extension can find the WebWorker to use */
|
|
20
|
+
workersURL?: URL;
|
|
19
21
|
/** Action name to use for rename. Defaults to `'transformImage'` */
|
|
20
22
|
actionTransform?: string;
|
|
21
23
|
}
|
|
@@ -14,6 +14,8 @@ export interface SimulatedLoaderOptions {
|
|
|
14
14
|
parallel?: number;
|
|
15
15
|
/** Delay until fake error thrown. Defaults to `undefined` */
|
|
16
16
|
errorDelay?: number;
|
|
17
|
+
/** Logs loading state to the developer console. Defaults to `true` */
|
|
18
|
+
log?: boolean;
|
|
17
19
|
/** File to fetch. Defaults to `undefined` */
|
|
18
20
|
fetchFile?: (entry: FilePondEntry, options: {
|
|
19
21
|
abortController: AbortController;
|
|
@@ -16,6 +16,8 @@ export interface URLLoaderOptions {
|
|
|
16
16
|
parallel?: number;
|
|
17
17
|
/** Determines if we should use WebWorkers for the `XMLHttpRequest`, defaults to `true`. */
|
|
18
18
|
useWebWorkers?: boolean;
|
|
19
|
+
/** Where the extension can find the WebWorker to use */
|
|
20
|
+
workersURL?: URL;
|
|
19
21
|
/** Intercept options sent to XMLHttpRequest with `RequestHook`. */
|
|
20
22
|
willRequestWithOptions?: RequestHook;
|
|
21
23
|
}
|