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
|
@@ -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/esm/assets/index.js
CHANGED
package/esm/common/console.js
CHANGED
package/esm/common/entry.js
CHANGED
package/esm/common/ssr.js
CHANGED
package/esm/common/status.js
CHANGED
package/esm/core/entryTree.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
|
@@ -8,8 +8,8 @@ import { createTaskScheduler as R } from "./taskScheduler.js";
|
|
|
8
8
|
import { pubsub as z } from "../utils/pubsub.js";
|
|
9
9
|
import { isArray as k } from "../utils/test.js";
|
|
10
10
|
import { arrayItemsEqual as D, arrayRemoveInPlace as G, arraySortByItemProp as H } from "../utils/array.js";
|
|
11
|
-
function V(
|
|
12
|
-
const { on: I, pub: y } = z(),
|
|
11
|
+
function V(a) {
|
|
12
|
+
const { on: I, pub: y } = z(), c = [], { insertEntries: T, replaceEntry: A, updateEntry: v, removeEntries: j } = a, f = R({ log: void 0 }), x = {
|
|
13
13
|
extension: {}
|
|
14
14
|
};
|
|
15
15
|
function l(n, s) {
|
|
@@ -27,12 +27,12 @@ function V(c) {
|
|
|
27
27
|
function O(n) {
|
|
28
28
|
return x.extension[n].status;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
a.on("removeEntry", ({ entry: n }) => {
|
|
31
31
|
f.abortTasks(n.id);
|
|
32
32
|
});
|
|
33
33
|
function q(n) {
|
|
34
34
|
const s = function(e, i) {
|
|
35
|
-
return
|
|
35
|
+
return a.on(e, i);
|
|
36
36
|
}, o = [], t = { current: void 0 };
|
|
37
37
|
t.current = n({
|
|
38
38
|
// events
|
|
@@ -52,11 +52,11 @@ function V(c) {
|
|
|
52
52
|
const B = E(
|
|
53
53
|
t.current.name
|
|
54
54
|
);
|
|
55
|
-
|
|
55
|
+
a.findEntries(e) && f.pushTask(e, i, {
|
|
56
56
|
// set order to factor of 100 so in theory there's plenty room for adding manual order
|
|
57
57
|
order: B.index * 100,
|
|
58
58
|
// when params is a function it is called on run task
|
|
59
|
-
params: () => [
|
|
59
|
+
params: () => [a.findEntries(e)],
|
|
60
60
|
// add custom options
|
|
61
61
|
...u
|
|
62
62
|
});
|
|
@@ -68,9 +68,9 @@ function V(c) {
|
|
|
68
68
|
f.abortTasks(e);
|
|
69
69
|
},
|
|
70
70
|
setEntries: function(e) {
|
|
71
|
-
|
|
71
|
+
a.entries = e;
|
|
72
72
|
},
|
|
73
|
-
getEntries: () =>
|
|
73
|
+
getEntries: () => a.entries,
|
|
74
74
|
// manipulating entry list
|
|
75
75
|
insertEntries: T,
|
|
76
76
|
removeEntries: j,
|
|
@@ -90,14 +90,14 @@ function V(c) {
|
|
|
90
90
|
e(...i);
|
|
91
91
|
}), t.current;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
f.abortTasks(),
|
|
93
|
+
function h() {
|
|
94
|
+
f.abortTasks(), c.map((n) => n.instance).forEach((n) => n.destroy()), c.length = 0;
|
|
95
95
|
}
|
|
96
|
-
const
|
|
96
|
+
const S = {
|
|
97
97
|
// subscribe to events
|
|
98
98
|
on: I,
|
|
99
99
|
get extensions() {
|
|
100
|
-
return
|
|
100
|
+
return c.map(({ factory: n }) => n);
|
|
101
101
|
},
|
|
102
102
|
set extensions(n) {
|
|
103
103
|
if (!k(n))
|
|
@@ -105,23 +105,23 @@ function V(c) {
|
|
|
105
105
|
const s = n.map(
|
|
106
106
|
(t) => Array.isArray(t) ? t[0] : t
|
|
107
107
|
);
|
|
108
|
-
if (D(s,
|
|
108
|
+
if (D(s, S.extensions)) {
|
|
109
109
|
for (const t of n) {
|
|
110
110
|
if (!k(t))
|
|
111
111
|
continue;
|
|
112
|
-
const r =
|
|
112
|
+
const r = c.find((e) => t[0] === e.factory);
|
|
113
113
|
p(r, t[1]);
|
|
114
114
|
}
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
|
-
n.length === 0 && (d.clear(),
|
|
118
|
-
for (const t of
|
|
117
|
+
n.length === 0 && (d.clear(), h());
|
|
118
|
+
for (const t of c)
|
|
119
119
|
if (!s.includes(t.factory)) {
|
|
120
|
-
t.instance.destroy(), G(
|
|
120
|
+
t.instance.destroy(), G(c, (r) => r === t);
|
|
121
121
|
continue;
|
|
122
122
|
}
|
|
123
123
|
for (const [t, r] of Object.entries(s)) {
|
|
124
|
-
const e = parseInt(t, 10), i =
|
|
124
|
+
const e = parseInt(t, 10), i = c.find((u) => r === u.factory);
|
|
125
125
|
if (i) {
|
|
126
126
|
if (i.index = e, Array.isArray(n[e])) {
|
|
127
127
|
const u = n[e][1];
|
|
@@ -129,24 +129,24 @@ function V(c) {
|
|
|
129
129
|
}
|
|
130
130
|
continue;
|
|
131
131
|
}
|
|
132
|
-
if (
|
|
132
|
+
if (c.push({
|
|
133
133
|
index: e,
|
|
134
134
|
factory: r,
|
|
135
135
|
instance: q(r)
|
|
136
136
|
}), Array.isArray(n[e])) {
|
|
137
137
|
const u = n[e][1];
|
|
138
|
-
p(
|
|
138
|
+
p(c.at(-1), u);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
H(
|
|
141
|
+
H(c, "index"), Object.entries(d.get("*") ?? []).forEach(
|
|
142
142
|
([t, r]) => {
|
|
143
143
|
P(t, r);
|
|
144
144
|
}
|
|
145
145
|
);
|
|
146
146
|
for (const [t, r] of d)
|
|
147
147
|
t !== "*" && b(t, r);
|
|
148
|
-
const o =
|
|
149
|
-
y("setExtensions", { extensionNames: o }),
|
|
148
|
+
const o = c.map((t) => t.instance.name);
|
|
149
|
+
y("setExtensions", { extensionNames: o }), a.entries = [...a.entries];
|
|
150
150
|
},
|
|
151
151
|
propagateExtensionProperty: P,
|
|
152
152
|
setExtensionProperties: b,
|
|
@@ -157,7 +157,7 @@ function V(c) {
|
|
|
157
157
|
},
|
|
158
158
|
// destroy FilePond instance
|
|
159
159
|
destroy() {
|
|
160
|
-
|
|
160
|
+
h();
|
|
161
161
|
}
|
|
162
162
|
};
|
|
163
163
|
function P(n, s) {
|
|
@@ -182,13 +182,13 @@ function V(c) {
|
|
|
182
182
|
s && (n.instance.setProps(s), m(n.instance.name, s));
|
|
183
183
|
}
|
|
184
184
|
function W(n) {
|
|
185
|
-
return
|
|
185
|
+
return c.filter((s) => {
|
|
186
186
|
const o = s.instance.getProps();
|
|
187
187
|
return Object.keys(o).includes(n);
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
190
|
function E(n) {
|
|
191
|
-
return
|
|
191
|
+
return c.find((s) => s.instance.name === n);
|
|
192
192
|
}
|
|
193
193
|
const d = /* @__PURE__ */ new Map();
|
|
194
194
|
function m(n, s) {
|
|
@@ -197,7 +197,7 @@ function V(c) {
|
|
|
197
197
|
...s
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
|
-
return
|
|
200
|
+
return S;
|
|
201
201
|
}
|
|
202
202
|
export {
|
|
203
203
|
V as createExtensionManager
|
|
@@ -1,194 +1,175 @@
|
|
|
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
7
|
import { arrayRemoveInPlace as T } from "../utils/array.js";
|
|
8
|
-
import { pubsub as
|
|
9
|
-
import { isString as
|
|
10
|
-
import { log as p } from "../common/console.js";
|
|
8
|
+
import { pubsub as j } from "../utils/pubsub.js";
|
|
9
|
+
import { isString as z, isFunction as D } from "../utils/test.js";
|
|
11
10
|
const e = {
|
|
12
11
|
QUEUED: 1,
|
|
13
12
|
ACTIVE: 2,
|
|
14
13
|
FAILED: 3,
|
|
15
14
|
HALTED: 4
|
|
16
15
|
};
|
|
17
|
-
function
|
|
18
|
-
const {
|
|
19
|
-
function
|
|
20
|
-
p(`Tasks: ${a.length}`);
|
|
21
|
-
for (const t of a) {
|
|
22
|
-
const { group: n, fn: r, order: o, parallel: s, state: u, ...D } = t;
|
|
23
|
-
let j = {
|
|
24
|
-
// queued
|
|
25
|
-
1: "📥",
|
|
26
|
-
// active
|
|
27
|
-
2: "👉",
|
|
28
|
-
// failed
|
|
29
|
-
3: "💥",
|
|
30
|
-
// halted
|
|
31
|
-
4: "🖐️"
|
|
32
|
-
}[u];
|
|
33
|
-
p(j, n, r.name, { parallel: s, order: o });
|
|
34
|
-
}
|
|
35
|
-
p("");
|
|
36
|
-
}
|
|
37
|
-
function v(t) {
|
|
16
|
+
function Y(S) {
|
|
17
|
+
const { log: p = void 0 } = S ?? {}, { on: U, pub: f } = j(), s = [], i = /* @__PURE__ */ new Map();
|
|
18
|
+
function h(t) {
|
|
38
19
|
return t.state === e.QUEUED || t.state === e.ACTIVE;
|
|
39
20
|
}
|
|
40
|
-
function
|
|
21
|
+
function k(t) {
|
|
41
22
|
return t.state === e.QUEUED;
|
|
42
23
|
}
|
|
43
|
-
function
|
|
24
|
+
function x(t) {
|
|
44
25
|
return t.state === e.ACTIVE;
|
|
45
26
|
}
|
|
46
|
-
function
|
|
47
|
-
return
|
|
27
|
+
function C(t, n) {
|
|
28
|
+
return z(t) && D(n);
|
|
48
29
|
}
|
|
49
|
-
function
|
|
30
|
+
function g(t, n) {
|
|
50
31
|
let r = 0;
|
|
51
32
|
for (let o = 0; o < n.length; o++)
|
|
52
33
|
t.order >= n[o].order && (r = o + 1);
|
|
53
34
|
n.splice(r, 0, t);
|
|
54
35
|
}
|
|
55
|
-
function
|
|
56
|
-
|
|
36
|
+
function v(t) {
|
|
37
|
+
g(t, s);
|
|
57
38
|
let n = i.get(t.group);
|
|
58
|
-
n || (n = [], i.set(t.group, n)),
|
|
39
|
+
n || (n = [], i.set(t.group, n)), g(t, n);
|
|
59
40
|
}
|
|
60
|
-
function
|
|
41
|
+
function Q(t, n) {
|
|
61
42
|
const r = i.get(t);
|
|
62
43
|
return r ? !!r.find((o) => o.fn === n) : !1;
|
|
63
44
|
}
|
|
64
|
-
function
|
|
45
|
+
function m(t) {
|
|
65
46
|
T(
|
|
66
|
-
|
|
47
|
+
s,
|
|
67
48
|
(r) => r.group === t.group && r.fn === t.fn
|
|
68
49
|
);
|
|
69
50
|
const n = i.get(t.group);
|
|
70
51
|
n && T(n, (r) => r.fn === t.fn);
|
|
71
52
|
}
|
|
72
|
-
function
|
|
73
|
-
T(
|
|
53
|
+
function B(t) {
|
|
54
|
+
T(s, (n) => n.group === t), i.delete(t);
|
|
74
55
|
}
|
|
75
56
|
function c(t) {
|
|
76
57
|
return i.get(t) ?? [];
|
|
77
58
|
}
|
|
78
|
-
function
|
|
59
|
+
function E(t, n) {
|
|
79
60
|
return c(t)[0].state === n;
|
|
80
61
|
}
|
|
81
|
-
function
|
|
82
|
-
return c(t).filter(
|
|
62
|
+
function H(t) {
|
|
63
|
+
return c(t).filter(h).length > 0;
|
|
83
64
|
}
|
|
84
|
-
function
|
|
65
|
+
function L(t) {
|
|
85
66
|
const n = c(t);
|
|
86
67
|
for (const r of n)
|
|
87
|
-
|
|
68
|
+
y(r);
|
|
88
69
|
}
|
|
89
|
-
function
|
|
90
|
-
return c(t).filter(
|
|
70
|
+
function d(t) {
|
|
71
|
+
return c(t).filter(k)[0];
|
|
91
72
|
}
|
|
92
|
-
function
|
|
73
|
+
function O(t, n) {
|
|
93
74
|
const r = c(t);
|
|
94
75
|
if (r)
|
|
95
76
|
return r.find((o) => o.fn === n);
|
|
96
77
|
}
|
|
97
|
-
function
|
|
98
|
-
const { ignoreOptional: o = !1 } = r || {},
|
|
99
|
-
for (const u of
|
|
78
|
+
function b(t, n, r) {
|
|
79
|
+
const { ignoreOptional: o = !1 } = r || {}, a = i.get(t) ?? [];
|
|
80
|
+
for (const u of a)
|
|
100
81
|
o && u.isOptional || (u.state = n);
|
|
101
82
|
}
|
|
102
|
-
function
|
|
103
|
-
return Array.from(new Set(
|
|
83
|
+
function V() {
|
|
84
|
+
return Array.from(new Set(s.map((t) => t.group)));
|
|
104
85
|
}
|
|
105
|
-
function
|
|
86
|
+
function q() {
|
|
106
87
|
return i.keys();
|
|
107
88
|
}
|
|
108
|
-
function
|
|
109
|
-
return
|
|
89
|
+
function w() {
|
|
90
|
+
return s.filter(k).length > 0;
|
|
110
91
|
}
|
|
111
|
-
function
|
|
112
|
-
return
|
|
92
|
+
function N() {
|
|
93
|
+
return s.filter(x);
|
|
113
94
|
}
|
|
114
|
-
function
|
|
115
|
-
return
|
|
95
|
+
function R(t) {
|
|
96
|
+
return N().filter((n) => n.fn === t.fn);
|
|
116
97
|
}
|
|
117
|
-
function
|
|
118
|
-
return t ? t.parallel === 1 / 0 ||
|
|
98
|
+
function A(t) {
|
|
99
|
+
return t ? t.parallel === 1 / 0 || R(t).length < t.parallel : !1;
|
|
119
100
|
}
|
|
120
101
|
function l() {
|
|
121
|
-
queueMicrotask(
|
|
102
|
+
queueMicrotask(F);
|
|
122
103
|
}
|
|
123
|
-
function
|
|
124
|
-
if (!
|
|
125
|
-
|
|
104
|
+
function F() {
|
|
105
|
+
if (!w()) {
|
|
106
|
+
p?.(s), f("idle");
|
|
126
107
|
return;
|
|
127
108
|
}
|
|
128
|
-
|
|
129
|
-
const t =
|
|
109
|
+
p?.(s);
|
|
110
|
+
const t = V();
|
|
130
111
|
for (const n of t) {
|
|
131
|
-
if (!
|
|
132
|
-
if (
|
|
133
|
-
const o =
|
|
134
|
-
if (!o || !
|
|
112
|
+
if (!E(n, e.QUEUED)) {
|
|
113
|
+
if (E(n, e.HALTED)) {
|
|
114
|
+
const o = d(n);
|
|
115
|
+
if (!o || !A(o))
|
|
135
116
|
continue;
|
|
136
|
-
|
|
117
|
+
I(o);
|
|
137
118
|
}
|
|
138
119
|
continue;
|
|
139
120
|
}
|
|
140
|
-
const r =
|
|
141
|
-
|
|
121
|
+
const r = d(n);
|
|
122
|
+
A(r) && I(r);
|
|
142
123
|
}
|
|
143
124
|
}
|
|
144
|
-
async function
|
|
125
|
+
async function I(t) {
|
|
145
126
|
const { group: n, fn: r, params: o } = t;
|
|
146
127
|
t.state = e.ACTIVE;
|
|
147
128
|
try {
|
|
148
|
-
const
|
|
129
|
+
const a = D(o) ? o() : o, u = await r(...a, {
|
|
149
130
|
abortController: t.abortController
|
|
150
131
|
});
|
|
151
|
-
|
|
152
|
-
} catch (
|
|
153
|
-
t.state = e.FAILED, f("error",
|
|
132
|
+
m(t), u === !1 && b(n, e.HALTED, { ignoreOptional: !0 });
|
|
133
|
+
} catch (a) {
|
|
134
|
+
t.state = e.FAILED, f("error", a), b(n, e.HALTED);
|
|
154
135
|
}
|
|
155
|
-
|
|
136
|
+
H(n) || f("complete", n), l();
|
|
156
137
|
}
|
|
157
|
-
function
|
|
138
|
+
function y(t) {
|
|
158
139
|
t.abortController.signal.aborted || t.abortController.abort();
|
|
159
140
|
}
|
|
160
|
-
function
|
|
161
|
-
const { parallel: o = 1 / 0, order:
|
|
162
|
-
!
|
|
141
|
+
function P(t, n, r) {
|
|
142
|
+
const { parallel: o = 1 / 0, order: a = 0, params: u = [], isOptional: W = !1 } = r ?? {};
|
|
143
|
+
!C(t, n) || Q(t, n) || (v({
|
|
163
144
|
group: t,
|
|
164
145
|
fn: n,
|
|
165
146
|
params: u,
|
|
166
|
-
order:
|
|
147
|
+
order: a,
|
|
167
148
|
parallel: o,
|
|
168
|
-
isOptional:
|
|
149
|
+
isOptional: W,
|
|
169
150
|
state: e.QUEUED,
|
|
170
151
|
abortController: new AbortController()
|
|
171
152
|
}), l());
|
|
172
153
|
}
|
|
173
|
-
function
|
|
174
|
-
const r =
|
|
175
|
-
r && (
|
|
154
|
+
function M(t, n) {
|
|
155
|
+
const r = O(t, n);
|
|
156
|
+
r && (y(r), m(r), l());
|
|
176
157
|
}
|
|
177
|
-
function
|
|
158
|
+
function G(t) {
|
|
178
159
|
if (!t) {
|
|
179
|
-
for (const n of
|
|
180
|
-
|
|
160
|
+
for (const n of q())
|
|
161
|
+
G(n);
|
|
181
162
|
return;
|
|
182
163
|
}
|
|
183
|
-
|
|
164
|
+
L(t), B(t), f("abort", t), f("complete", t), l();
|
|
184
165
|
}
|
|
185
166
|
return {
|
|
186
|
-
on:
|
|
187
|
-
pushTask:
|
|
188
|
-
abortTask:
|
|
189
|
-
abortTasks:
|
|
167
|
+
on: U,
|
|
168
|
+
pushTask: P,
|
|
169
|
+
abortTask: M,
|
|
170
|
+
abortTasks: G
|
|
190
171
|
};
|
|
191
172
|
}
|
|
192
173
|
export {
|
|
193
|
-
|
|
174
|
+
Y as createTaskScheduler
|
|
194
175
|
};
|
package/esm/dev/index.js
CHANGED