filepond 5.0.0-beta.2 → 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.
Files changed (368) hide show
  1. package/README.md +27 -4
  2. package/cdn/assets/index.js +1 -1
  3. package/cdn/dev/index.js +1 -0
  4. package/cdn/extensions/blob-loader.js +1 -1
  5. package/cdn/extensions/canvas-loader.js +1 -1
  6. package/cdn/extensions/chunked-upload-store.js +1 -1
  7. package/cdn/extensions/clipboard-source.js +1 -1
  8. package/cdn/extensions/console-view.js +1 -1
  9. package/cdn/extensions/data-transfer-loader.js +1 -1
  10. package/cdn/extensions/data-url-store.js +1 -1
  11. package/cdn/extensions/drag-drop-source.js +1 -1
  12. package/cdn/extensions/dropbox-source.js +1 -1
  13. package/cdn/extensions/entry-list-view.js +1 -1
  14. package/cdn/extensions/file-extension-validator.js +1 -1
  15. package/cdn/extensions/file-input-source.js +1 -1
  16. package/cdn/extensions/file-input-store.js +1 -1
  17. package/cdn/extensions/file-mime-type-validator.js +1 -1
  18. package/cdn/extensions/file-name-transform.js +1 -1
  19. package/cdn/extensions/file-name-validator.js +1 -1
  20. package/cdn/extensions/file-size-validator.js +1 -1
  21. package/cdn/extensions/form-post-store.js +1 -1
  22. package/cdn/extensions/image-bitmap-transform.js +1 -0
  23. package/cdn/extensions/index.js +1 -1
  24. package/cdn/extensions/list-count-validator.js +1 -1
  25. package/cdn/extensions/list-size-validator.js +1 -1
  26. package/cdn/extensions/media-resolution-validator.js +1 -1
  27. package/cdn/extensions/object-url-store.js +1 -1
  28. package/cdn/extensions/simulated-loader.js +1 -1
  29. package/cdn/extensions/simulated-store.js +1 -1
  30. package/cdn/extensions/text-input-store.js +1 -1
  31. package/cdn/extensions/url-loader.js +1 -1
  32. package/cdn/extensions/value-callback-store.js +1 -1
  33. package/cdn/index.js +1 -7
  34. package/cdn/locales/ar-ar.js +72 -48
  35. package/cdn/locales/bn-bd.js +72 -48
  36. package/cdn/locales/cs-cz.js +83 -59
  37. package/cdn/locales/da-dk.js +74 -50
  38. package/cdn/locales/de-de.js +72 -42
  39. package/cdn/locales/el-gr.js +72 -48
  40. package/cdn/locales/en-gb.js +85 -62
  41. package/cdn/locales/es-es.js +69 -39
  42. package/cdn/locales/fi-fi.js +69 -45
  43. package/cdn/locales/fr-fr.js +78 -48
  44. package/cdn/locales/hi-in.js +72 -42
  45. package/cdn/locales/hu-hu.js +66 -42
  46. package/cdn/locales/index.js +1 -1
  47. package/cdn/locales/is-is.js +71 -47
  48. package/cdn/locales/it-it.js +73 -43
  49. package/cdn/locales/ja-jp.js +72 -42
  50. package/cdn/locales/ko-kr.js +72 -42
  51. package/cdn/locales/nb-no.js +74 -44
  52. package/cdn/locales/nl-nl.js +71 -48
  53. package/cdn/locales/pl-pl.js +76 -52
  54. package/cdn/locales/pt-pt.js +71 -41
  55. package/cdn/locales/sv-se.js +73 -43
  56. package/cdn/locales/tr-tr.js +83 -59
  57. package/cdn/locales/uk-ua.js +72 -48
  58. package/cdn/locales/vi-vn.js +82 -58
  59. package/cdn/locales/zh-cn.js +72 -42
  60. package/cdn/main.js +7 -0
  61. package/cdn/templates/entry.js +1 -1
  62. package/cdn/templates/helpers.js +1 -1
  63. package/cdn/templates/index.js +1 -1
  64. package/cdn/templates/media.js +1 -1
  65. package/cdn/workers/httpRequest.js +45 -0
  66. package/cdn/workers/httpRequestWorker.js +37 -0
  67. package/cdn/workers/readFile.js +14 -0
  68. package/cdn/workers/readFileWorker.js +6 -0
  69. package/cdn/workers/transformImage.js +16 -0
  70. package/cdn/workers/transformImageWorker.js +8 -0
  71. package/esm/assets/index.js +1 -1
  72. package/esm/common/console.js +1 -1
  73. package/esm/common/entry.js +1 -1
  74. package/esm/common/perceivedPerformanceProxy.js +1 -1
  75. package/esm/common/readEntriesFromDataTransfer.js +1 -1
  76. package/esm/common/ssr.js +1 -1
  77. package/esm/common/status.js +1 -1
  78. package/esm/core/entryTree.js +142 -133
  79. package/esm/core/extensionManager.js +89 -86
  80. package/esm/core/taskScheduler.js +78 -97
  81. package/esm/dev/index.js +122 -0
  82. package/esm/elements/FilePondDefault/index.css.js +2 -2
  83. package/esm/elements/FilePondDefault/index.js +164 -125
  84. package/esm/elements/FilePondDropArea/index.css.js +1 -1
  85. package/esm/elements/FilePondDropArea/index.js +1 -1
  86. package/esm/elements/FilePondDropArea/index.svelte.js +38 -40
  87. package/esm/elements/FilePondDropIndicator/index.css.js +1 -1
  88. package/esm/elements/FilePondDropIndicator/index.js +1 -1
  89. package/esm/elements/FilePondDropIndicator/index.svelte.js +65 -67
  90. package/esm/elements/FilePondEntryList/components/Entry/index.css.js +2 -2
  91. package/esm/elements/FilePondEntryList/components/Entry/index.js +1 -1
  92. package/esm/elements/FilePondEntryList/components/Entry/index.svelte.js +37 -37
  93. package/esm/elements/FilePondEntryList/components/EntryActivityIndicator/index.css.js +2 -2
  94. package/esm/elements/FilePondEntryList/components/EntryActivityIndicator/index.js +1 -2
  95. package/esm/elements/FilePondEntryList/components/EntryActivityIndicator/index.svelte.js +115 -86
  96. package/esm/elements/FilePondEntryList/components/EntryList/index.css.js +1 -1
  97. package/esm/elements/FilePondEntryList/components/EntryList/index.js +1 -1
  98. package/esm/elements/FilePondEntryList/components/EntryList/index.svelte.js +159 -154
  99. package/esm/elements/FilePondEntryList/components/EntryListItem/index.css.js +1 -1
  100. package/esm/elements/FilePondEntryList/components/EntryListItem/index.js +1 -2
  101. package/esm/elements/FilePondEntryList/components/EntryListItem/index.svelte.js +70 -46
  102. package/esm/elements/FilePondEntryList/components/EntryListItemPlaceholder/index.svelte.js +1 -1
  103. package/esm/elements/FilePondEntryList/components/EntryStatus/index.css.js +1 -1
  104. package/esm/elements/FilePondEntryList/components/EntryStatus/index.js +1 -2
  105. package/esm/elements/FilePondEntryList/components/EntryStatus/index.svelte.js +62 -62
  106. package/esm/elements/FilePondEntryList/components/MediaImage/components/BitmapRenderer.svelte.js +65 -60
  107. package/esm/elements/FilePondEntryList/components/MediaImage/components/BitmapRendererCache.js +1 -1
  108. package/esm/elements/FilePondEntryList/components/MediaImage/index.css.js +1 -1
  109. package/esm/elements/FilePondEntryList/components/MediaImage/index.js +2 -1
  110. package/esm/elements/FilePondEntryList/components/MediaImage/index.svelte.js +91 -83
  111. package/esm/elements/FilePondEntryList/components/MediaPane/index.css.js +2 -2
  112. package/esm/elements/FilePondEntryList/components/MediaPane/index.js +1 -1
  113. package/esm/elements/FilePondEntryList/components/MediaPane/index.svelte.js +33 -35
  114. package/esm/elements/FilePondEntryList/components/MediaTimeIndicator/index.css.js +1 -1
  115. package/esm/elements/FilePondEntryList/components/MediaTimeIndicator/index.js +1 -1
  116. package/esm/elements/FilePondEntryList/components/MediaTimeIndicator/index.svelte.js +1 -1
  117. package/esm/elements/FilePondEntryList/components/MediaVideo/index.css.js +1 -1
  118. package/esm/elements/FilePondEntryList/components/MediaVideo/index.js +1 -1
  119. package/esm/elements/FilePondEntryList/components/MediaVideo/index.svelte.js +88 -88
  120. package/esm/elements/FilePondEntryList/contexts/appContext.js +1 -1
  121. package/esm/elements/FilePondEntryList/contexts/dragContext.js +1 -1
  122. package/esm/elements/FilePondEntryList/contexts/dropContext.js +1 -1
  123. package/esm/elements/FilePondEntryList/contexts/entryContext.js +1 -1
  124. package/esm/elements/FilePondEntryList/contexts/springElementTreeContext.js +1 -1
  125. package/esm/elements/FilePondEntryList/index.css.js +2 -2
  126. package/esm/elements/FilePondEntryList/index.js +11 -14
  127. package/esm/elements/FilePondEntryList/index.svelte.js +351 -271
  128. package/esm/elements/FilePondInput/index.css.js +3 -3
  129. package/esm/elements/FilePondInput/index.js +252 -191
  130. package/esm/elements/FilePondSvelteComponent/index.svelte.js +11 -11
  131. package/esm/elements/attachments/dragarea.js +62 -63
  132. package/esm/elements/attachments/droparea.js +1 -1
  133. package/esm/elements/attachments/measurable.js +1 -1
  134. package/esm/elements/attachments/resizable.js +1 -1
  135. package/esm/elements/attachments/transitions.js +1 -1
  136. package/esm/elements/common/animationGuard.js +1 -1
  137. package/esm/elements/common/animationPreference.svelte.js +35 -41
  138. package/esm/elements/common/dragDrop.js +1 -1
  139. package/esm/elements/common/event.js +1 -1
  140. package/esm/elements/common/extendStyles.js +1 -1
  141. package/esm/elements/common/getClosestElement.js +1 -1
  142. package/esm/elements/common/html.js +4 -4
  143. package/esm/elements/common/nodeTree.js +9 -9
  144. package/esm/elements/common/store.svelte.js +1 -1
  145. package/esm/elements/common/string.js +75 -55
  146. package/esm/elements/common/transition.js +1 -1
  147. package/esm/elements/components/BooleanInput/index.css.js +1 -1
  148. package/esm/elements/components/BooleanInput/index.js +1 -1
  149. package/esm/elements/components/BooleanInput/index.svelte.js +31 -33
  150. package/esm/elements/components/Button/index.css.js +2 -2
  151. package/esm/elements/components/Button/index.js +1 -1
  152. package/esm/elements/components/Button/index.svelte.js +49 -49
  153. package/esm/elements/components/ElementPane/index.css.js +1 -1
  154. package/esm/elements/components/ElementPane/index.js +1 -1
  155. package/esm/elements/components/ElementPane/index.svelte.js +1 -1
  156. package/esm/elements/components/ElementSkeleton/index.css.js +1 -1
  157. package/esm/elements/components/ElementSkeleton/index.js +1 -1
  158. package/esm/elements/components/ElementSkeleton/index.svelte.js +1 -1
  159. package/esm/elements/components/FilenameInput/index.css.js +2 -2
  160. package/esm/elements/components/FilenameInput/index.js +1 -1
  161. package/esm/elements/components/FilenameInput/index.svelte.js +1 -1
  162. package/esm/elements/components/NodeList/index.svelte.js +174 -200
  163. package/esm/elements/components/ProgressIndicator/index.css.js +2 -2
  164. package/esm/elements/components/ProgressIndicator/index.js +1 -1
  165. package/esm/elements/components/ProgressIndicator/index.svelte.js +98 -124
  166. package/esm/elements/components/RangeInput/index.css.js +2 -2
  167. package/esm/elements/components/RangeInput/index.js +1 -1
  168. package/esm/elements/components/RangeInput/index.svelte.js +86 -85
  169. package/esm/elements/components/SpringElement/index.svelte.js +91 -90
  170. package/esm/elements/components/TextInput/index.css.js +1 -1
  171. package/esm/elements/components/TextInput/index.js +1 -1
  172. package/esm/elements/components/TextInput/index.svelte.js +25 -27
  173. package/esm/extensions/blob-loader.js +1 -1
  174. package/esm/extensions/canvas-loader.js +1 -1
  175. package/esm/extensions/chunked-upload-store.js +1 -1
  176. package/esm/extensions/clipboard-source.js +1 -1
  177. package/esm/extensions/common/createExtension.js +38 -37
  178. package/esm/extensions/common/createStoreExtension.js +1 -1
  179. package/esm/extensions/common/createTransformExtension.js +1 -1
  180. package/esm/extensions/common/createValidatorExtension.js +1 -1
  181. package/esm/extensions/console-view.js +36 -33
  182. package/esm/extensions/data-transfer-loader.js +1 -1
  183. package/esm/extensions/data-url-store.js +24 -19
  184. package/esm/extensions/drag-drop-source.js +1 -1
  185. package/esm/extensions/dropbox-source.js +1 -1
  186. package/esm/extensions/entry-list-view.js +35 -29
  187. package/esm/extensions/file-extension-validator.js +1 -1
  188. package/esm/extensions/file-input-source.js +1 -1
  189. package/esm/extensions/file-input-store.js +1 -1
  190. package/esm/extensions/file-mime-type-validator.js +21 -17
  191. package/esm/extensions/file-name-transform.js +1 -1
  192. package/esm/extensions/file-name-validator.js +1 -1
  193. package/esm/extensions/file-size-validator.js +33 -22
  194. package/esm/extensions/form-post-store.js +1 -1
  195. package/esm/extensions/image-bitmap-transform.js +109 -0
  196. package/esm/extensions/index.js +23 -21
  197. package/esm/extensions/list-count-validator.js +21 -21
  198. package/esm/extensions/list-size-validator.js +42 -31
  199. package/esm/extensions/media-resolution-validator.js +57 -47
  200. package/esm/extensions/object-url-store.js +1 -1
  201. package/esm/extensions/simulated-loader.js +74 -65
  202. package/esm/extensions/simulated-store.js +1 -1
  203. package/esm/extensions/text-input-store.js +1 -1
  204. package/esm/extensions/url-loader.js +74 -71
  205. package/esm/extensions/value-callback-store.js +1 -1
  206. package/esm/index.js +1 -1
  207. package/esm/locales/ar-ar.js +72 -48
  208. package/esm/locales/bn-bd.js +72 -48
  209. package/esm/locales/cs-cz.js +83 -59
  210. package/esm/locales/da-dk.js +74 -50
  211. package/esm/locales/de-de.js +72 -42
  212. package/esm/locales/el-gr.js +72 -48
  213. package/esm/locales/en-gb.js +85 -62
  214. package/esm/locales/es-es.js +69 -39
  215. package/esm/locales/fi-fi.js +69 -45
  216. package/esm/locales/fr-fr.js +78 -48
  217. package/esm/locales/hi-in.js +72 -42
  218. package/esm/locales/hu-hu.js +66 -42
  219. package/esm/locales/index.js +1 -1
  220. package/esm/locales/is-is.js +71 -47
  221. package/esm/locales/it-it.js +73 -43
  222. package/esm/locales/ja-jp.js +72 -42
  223. package/esm/locales/ko-kr.js +72 -42
  224. package/esm/locales/nb-no.js +74 -44
  225. package/esm/locales/nl-nl.js +71 -48
  226. package/esm/locales/pl-pl.js +76 -52
  227. package/esm/locales/pt-pt.js +71 -41
  228. package/esm/locales/sv-se.js +73 -43
  229. package/esm/locales/tr-tr.js +83 -59
  230. package/esm/locales/uk-ua.js +72 -48
  231. package/esm/locales/vi-vn.js +82 -58
  232. package/esm/locales/zh-cn.js +72 -42
  233. package/esm/svelte/svelte/src/constants.js +13 -12
  234. package/esm/svelte/svelte/src/internal/client/constants.js +29 -24
  235. package/esm/svelte/svelte/src/internal/client/context.js +33 -28
  236. package/esm/svelte/svelte/src/internal/client/dom/blocks/boundary.js +185 -126
  237. package/esm/svelte/svelte/src/internal/client/dom/blocks/branches.js +42 -43
  238. package/esm/svelte/svelte/src/internal/client/dom/blocks/each.js +175 -150
  239. package/esm/svelte/svelte/src/internal/client/dom/blocks/html.js +55 -32
  240. package/esm/svelte/svelte/src/internal/client/dom/blocks/if.js +12 -12
  241. package/esm/svelte/svelte/src/internal/client/dom/blocks/svelte-element.js +17 -17
  242. package/esm/svelte/svelte/src/internal/client/dom/elements/attributes.js +111 -113
  243. package/esm/svelte/svelte/src/internal/client/dom/elements/bindings/this.js +29 -16
  244. package/esm/svelte/svelte/src/internal/client/dom/elements/events.js +65 -60
  245. package/esm/svelte/svelte/src/internal/client/dom/elements/transitions.js +54 -54
  246. package/esm/svelte/svelte/src/internal/client/dom/operations.js +30 -22
  247. package/esm/svelte/svelte/src/internal/client/dom/reconciler.js +19 -4
  248. package/esm/svelte/svelte/src/internal/client/error-handling.js +17 -17
  249. package/esm/svelte/svelte/src/internal/client/errors.js +24 -20
  250. package/esm/svelte/svelte/src/internal/client/proxy.js +1 -1
  251. package/esm/svelte/svelte/src/internal/client/reactivity/async.js +60 -40
  252. package/esm/svelte/svelte/src/internal/client/reactivity/batch.js +273 -236
  253. package/esm/svelte/svelte/src/internal/client/reactivity/deriveds.js +110 -84
  254. package/esm/svelte/svelte/src/internal/client/reactivity/effects.js +160 -157
  255. package/esm/svelte/svelte/src/internal/client/reactivity/props.js +2 -1
  256. package/esm/svelte/svelte/src/internal/client/reactivity/sources.js +69 -70
  257. package/esm/svelte/svelte/src/internal/client/reactivity/status.js +12 -0
  258. package/esm/svelte/svelte/src/internal/client/reactivity/utils.js +16 -0
  259. package/esm/svelte/svelte/src/internal/client/render.js +68 -64
  260. package/esm/svelte/svelte/src/internal/client/runtime.js +174 -170
  261. package/esm/svelte/svelte/src/internal/shared/attributes.js +32 -32
  262. package/esm/svelte/svelte/src/internal/shared/utils.js +16 -15
  263. package/esm/svelte/svelte/src/motion/spring.js +7 -7
  264. package/esm/svelte/svelte/src/reactivity/map.js +17 -21
  265. package/esm/templates/entry.js +194 -159
  266. package/esm/templates/helpers.js +85 -75
  267. package/esm/templates/index.js +1 -1
  268. package/esm/templates/media.js +163 -131
  269. package/esm/utils/array.js +1 -1
  270. package/esm/utils/bounds.js +1 -1
  271. package/esm/utils/cache.js +1 -1
  272. package/esm/utils/canvasToBlob.js +1 -1
  273. package/esm/utils/date.js +1 -1
  274. package/esm/utils/debounce.js +1 -1
  275. package/esm/utils/dom.js +84 -74
  276. package/esm/utils/file.js +82 -69
  277. package/esm/utils/functionToBlob.js +1 -1
  278. package/esm/utils/keyboard.js +34 -0
  279. package/esm/utils/math.js +14 -7
  280. package/esm/utils/media.js +1 -1
  281. package/esm/utils/number.js +11 -16
  282. package/esm/utils/object.js +1 -1
  283. package/esm/utils/objectURL.js +1 -1
  284. package/esm/utils/placeholder.js +1 -1
  285. package/esm/utils/poly.js +1 -1
  286. package/esm/utils/pubsub.js +1 -1
  287. package/esm/utils/rect.js +39 -30
  288. package/esm/utils/size.js +1 -1
  289. package/esm/utils/sleep.js +1 -1
  290. package/esm/utils/string.js +25 -21
  291. package/esm/utils/support.js +5 -6
  292. package/esm/utils/test.js +1 -1
  293. package/esm/utils/thread.js +50 -43
  294. package/esm/utils/tree.js +1 -1
  295. package/esm/utils/url.js +2 -2
  296. package/esm/utils/vector.js +1 -1
  297. package/esm/utils/window.js +1 -1
  298. package/esm/utils/xhr.js +88 -113
  299. package/esm/workers/httpRequest.js +45 -0
  300. package/esm/workers/httpRequestWorker.js +37 -0
  301. package/esm/workers/readFile.js +14 -0
  302. package/esm/workers/readFileWorker.js +6 -0
  303. package/esm/workers/transformImage.js +16 -0
  304. package/esm/workers/transformImageWorker.js +8 -0
  305. package/package.json +17 -12
  306. package/types/core/entryTree.d.ts +6 -2
  307. package/types/core/extensionManager.d.ts +16 -2
  308. package/types/core/taskScheduler.d.ts +2 -2
  309. package/types/dev/index.d.ts +11 -3
  310. package/types/elements/FilePondDefault/index.d.ts +15 -5
  311. package/types/elements/FilePondEntryList/components/MediaImage/index.d.ts +1 -1
  312. package/types/elements/FilePondEntryList/components/MediaVideo/index.d.ts +1 -1
  313. package/types/elements/FilePondEntryList/contexts/appContext.d.ts +1 -0
  314. package/types/elements/FilePondEntryList/contexts/entryContext.d.ts +1 -0
  315. package/types/elements/FilePondEntryList/index.d.ts +10 -11
  316. package/types/elements/FilePondInput/index.d.ts +22 -11
  317. package/types/elements/common/animationPreference.svelte.d.ts +6 -3
  318. package/types/elements/common/nodeTree.d.ts +1 -1
  319. package/types/elements/common/string.d.ts +1 -1
  320. package/types/extensions/common/createTransformExtension.d.ts +1 -1
  321. package/types/extensions/data-url-store.d.ts +2 -0
  322. package/types/extensions/file-name-transform.d.ts +1 -1
  323. package/types/extensions/file-size-validator.d.ts +2 -0
  324. package/types/extensions/image-bitmap-transform.d.ts +32 -0
  325. package/types/extensions/index.d.ts +1 -0
  326. package/types/extensions/list-size-validator.d.ts +2 -0
  327. package/types/extensions/simulated-loader.d.ts +2 -0
  328. package/types/extensions/simulated-store.d.ts +1 -1
  329. package/types/extensions/url-loader.d.ts +2 -0
  330. package/types/locales/ar-ar.d.ts +101 -76
  331. package/types/locales/bn-bd.d.ts +101 -76
  332. package/types/locales/cs-cz.d.ts +101 -76
  333. package/types/locales/da-dk.d.ts +101 -76
  334. package/types/locales/de-de.d.ts +101 -76
  335. package/types/locales/el-gr.d.ts +101 -76
  336. package/types/locales/en-gb.d.ts +102 -82
  337. package/types/locales/es-es.d.ts +101 -76
  338. package/types/locales/fi-fi.d.ts +101 -76
  339. package/types/locales/fr-fr.d.ts +101 -76
  340. package/types/locales/hi-in.d.ts +101 -76
  341. package/types/locales/hu-hu.d.ts +101 -76
  342. package/types/locales/is-is.d.ts +101 -76
  343. package/types/locales/it-it.d.ts +101 -76
  344. package/types/locales/ja-jp.d.ts +101 -76
  345. package/types/locales/ko-kr.d.ts +101 -76
  346. package/types/locales/nb-no.d.ts +101 -76
  347. package/types/locales/nl-nl.d.ts +101 -76
  348. package/types/locales/pl-pl.d.ts +101 -76
  349. package/types/locales/pt-pt.d.ts +101 -76
  350. package/types/locales/sv-se.d.ts +101 -76
  351. package/types/locales/tr-tr.d.ts +101 -76
  352. package/types/locales/uk-ua.d.ts +101 -76
  353. package/types/locales/vi-vn.d.ts +101 -76
  354. package/types/locales/zh-cn.d.ts +101 -76
  355. package/types/templates/entry.d.ts +15 -16
  356. package/types/templates/helpers.d.ts +5 -1
  357. package/types/templates/media.d.ts +43 -6
  358. package/types/types/index.d.ts +9 -15
  359. package/types/utils/file.d.ts +7 -15
  360. package/types/utils/keyboard.d.ts +5 -0
  361. package/types/utils/rect.d.ts +5 -0
  362. package/types/utils/string.d.ts +1 -0
  363. package/types/utils/thread.d.ts +6 -0
  364. package/types/utils/xhr.d.ts +1 -0
  365. package/types/workers/httpRequest.d.ts +23 -0
  366. package/types/workers/readFile.d.ts +9 -0
  367. package/types/workers/transformImage.d.ts +6 -0
  368. package/types/elements/FilePondEntryList/components/EntryContext/index.d.ts +0 -1
@@ -1,43 +1,44 @@
1
1
  /*!
2
- * FilePond v5.0.0-beta.2
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 { createExtensionManager as P } from "../../core/extensionManager.js";
8
- import { createEntryTree as O } from "../../core/entryTree.js";
9
- import { setBooleanAttribute as l, getAttribute as u, setStringAttribute as o, getFileSizeAttributeValue as d, createStyleSheet as L, h as T, getAttributeFromElements as D, removeAttributes as q, addListener as a, dispatchCustomEvent as f } from "../../utils/dom.js";
10
- import { isFileEntry as S, isNumber as v, isString as m, isFile as p, isObject as y, isDataTransfer as A, isDirectoryEntry as R, isBlobOrFile as M, isCanvas as _, isSafari as j } from "../../utils/test.js";
11
- import { anyToInt as U } from "../../utils/number.js";
12
- import { stringReplaceVariables as E, statusToLabel as w, statusCodeToLocaleKey as B } from "../common/string.js";
13
- import { toCamelCase as G, getUniqueId as $ } from "../../utils/string.js";
14
- import { debounce as b } from "../../utils/debounce.js";
15
- import { copyFilePropsToObject as F } from "../../utils/file.js";
16
- import { Status as H } from "../../common/status.js";
17
- import { HTMLElementSafe as J } from "../../common/ssr.js";
18
- import { getFilenameFromURL as K } from "../../utils/url.js";
19
- import { arrayRemoveFalsy as W } from "../../utils/array.js";
20
- import X from "./index.css.js";
21
- import { supportsURLPattern as N } from "../../utils/support.js";
22
- function Q() {
23
- return O({
8
+ import { createEntryTree as B } from "../../core/entryTree.js";
9
+ import { setBooleanAttribute as l, setStringAttribute as o, getAttribute as h, getFileSizeAttributeValue as p, createStyleSheet as M, h as f, setAttributes as T, getAttributeFromElements as E, addListener as q, dispatchCustomEvent as g } from "../../utils/dom.js";
10
+ import { isFileEntry as w, isNumber as A, isString as c, isFile as b, isObject as y, isDataTransfer as I, isDirectoryEntry as R, isBlobOrFile as D, isCanvas as _ } from "../../utils/test.js";
11
+ import { stringReplaceVariables as u, statusToLabel as j, statusCodeToLocaleKey as U } from "../common/string.js";
12
+ import { toCamelCase as K } from "../../utils/string.js";
13
+ import { debounce as x } from "../../utils/debounce.js";
14
+ import { copyFilePropsToObject as V } from "../../utils/file.js";
15
+ import { Status as $ } from "../../common/status.js";
16
+ import { HTMLElementSafe as G } from "../../common/ssr.js";
17
+ import { getFilenameFromURL as H } from "../../utils/url.js";
18
+ import { arrayRemoveFalsy as S } from "../../utils/array.js";
19
+ import J from "./index.css.js";
20
+ function W(r) {
21
+ const { beforeInsertEntries: t } = r || {};
22
+ return B({
23
+ // allows limiting the total entries added
24
+ beforeInsertEntries: t,
24
25
  // formats the entry so all entries in the dataset follow the same data structure
25
- beforeAddEntry(r) {
26
- return k(r) ? I(r) : !1;
26
+ beforeOnboardEntry(e) {
27
+ return z(e) ? C(e) : !1;
27
28
  },
28
29
  // makes modifications to the props the entry is updated with
29
- beforeUpdateEntryWithProps(r, t, e) {
30
- if (S(r) && e && F(t.file, t), t.extension) {
31
- const i = Object.values(
32
- t.extension
30
+ beforeUpdateEntryWithProps(e, i, s) {
31
+ if (w(e) && s && V(i.file, i), i.extension) {
32
+ const d = Object.values(
33
+ i.extension
33
34
  );
34
- for (const { status: s } of i)
35
- s && (s.values = s.values ?? null, s.progress = v(s.progress) ? s.progress : null);
35
+ for (const { status: a } of d)
36
+ a && (a.values = a.values ?? null, a.progress = A(a.progress) ? a.progress : null);
36
37
  }
37
38
  }
38
39
  });
39
40
  }
40
- const x = [
41
+ const F = [
41
42
  // customError
42
43
  "customError",
43
44
  // if accept is mismatched
@@ -49,12 +50,12 @@ const x = [
49
50
  // if is required and value is missing
50
51
  "valueMissing"
51
52
  ];
52
- function Y(r) {
53
- return m(r) || M(r) || _(r) || A(r);
53
+ function X(r) {
54
+ return c(r) || D(r) || _(r) || I(r);
54
55
  }
55
- function k(r) {
56
- if (m(r) || S(r)) {
57
- const t = m(r) ? K(r) ?? "" : r.name ?? (p(r?.src) ? r.src.name : "");
56
+ function z(r) {
57
+ if (c(r) || w(r)) {
58
+ const t = c(r) ? H(r) ?? "" : r.name ?? (b(r?.src) ? r.src.name : "");
58
59
  return ![
59
60
  /\.git/,
60
61
  /thumbs\.db/,
@@ -66,24 +67,24 @@ function k(r) {
66
67
  }
67
68
  return !0;
68
69
  }
69
- function I(r) {
70
- const t = Y(r) ? { src: r } : { ...r };
71
- if (t.state = y(t.state) ? t.state : {}, t.extension = y(t.extension) ? t.extension : {}, t.origin = t.origin ?? "api", t.containerId = t.containerId ?? null, A(t.src))
70
+ function C(r) {
71
+ const t = X(r) ? { src: r } : { ...r };
72
+ if (t.state = y(t.state) ? t.state : {}, t.extension = y(t.extension) ? t.extension : {}, t.origin = t.origin ?? "api", t.containerId = t.containerId ?? null, I(t.src))
72
73
  return t;
73
74
  if (t.path = t.path ?? t.src?.path ?? null, R(t)) {
74
75
  const { entries: i } = t;
75
- return t.entries = i.filter(k).map(I), t;
76
+ return t.entries = i.filter(z).map(C), t;
76
77
  }
77
78
  const e = t;
78
- return e.file = e.file ?? void 0, p(e.src) && (e.file = e.src), p(e.file) && F(e.file, e), e;
79
+ return e.file = e.file ?? void 0, b(e.src) && (e.file = e.src), b(e.file) && V(e.file, e), e;
79
80
  }
80
- function Z(r) {
81
- return r.some((t) => Object.values(t.extension ?? {}).some(({ status: e }) => e ? v(e.progress) : !1));
81
+ function N(r) {
82
+ return r.some((t) => Object.values(t.extension ?? {}).some(({ status: e }) => e ? A(e.progress) : !1));
82
83
  }
83
- function tt(r, t) {
84
+ function Q(r, t) {
84
85
  const e = Array.isArray(t) ? t : [t], i = new FormData();
85
86
  for (const s of e) {
86
- if (p(s)) {
87
+ if (b(s)) {
87
88
  i.append(r, s, s.name);
88
89
  continue;
89
90
  }
@@ -91,48 +92,60 @@ function tt(r, t) {
91
92
  }
92
93
  return i;
93
94
  }
94
- const et = ["required", "name"], g = ["disabled", "multiple", "accept"], it = ["disabled", "multiple", "required"];
95
- class Et extends J {
95
+ const Y = ["required", "name", "id"], v = ["disabled", "accept", "capture", "webkitdirectory"], k = ["disabled", "required", "webkitdirectory"];
96
+ class dt extends G {
96
97
  /** FilePond element shadowRoot */
97
- #o;
98
+ #u;
99
+ /** Div element that wraps styleable children */
100
+ #n;
98
101
  /** FilePond element slot */
102
+ #a;
103
+ /** This Has a reference to the element form internals */
99
104
  #r;
105
+ /** Source input */
106
+ #o;
107
+ /** Browse button */
108
+ #s;
100
109
  /** FilePond extension manager reference */
101
- #e;
110
+ #i;
102
111
  /** FilePond core instance reference */
103
112
  #t;
104
- /** Source input */
105
- #i = null;
106
- #l = null;
107
113
  /** Locale object reference */
108
- #n = null;
114
+ #e = void 0;
115
+ /** Key to use for the browse button label */
116
+ #c = "browse";
109
117
  /** Holds Names of extensions we've currently set up proxies for */
110
- #h = [];
118
+ #m = [];
111
119
  /**
112
120
  * Holds default entries as set by developer to .entries, we use this so we can reset to initial
113
121
  * state when reset is clicked
114
122
  */
115
- #c = null;
123
+ #p = null;
116
124
  /** Holds references to event subscriptions so we can more easily unsub */
117
- #a = [];
125
+ #h = [];
118
126
  //#region getters and setters for <file-pond> custom element attributes
119
127
  /** Returns a reference to the shadow root element */
120
128
  get _root() {
121
- return this.#o;
129
+ return this.#n;
122
130
  }
123
131
  /** Returns a reference to the slot element */
124
132
  get _slot() {
125
- return this.#r;
133
+ return this.#a;
126
134
  }
127
135
  /** Attributes being observed for changes */
128
136
  static get observedAttributes() {
129
137
  return [
138
+ "animations",
130
139
  "value",
131
- "multiple",
132
140
  "readonly",
133
141
  "required",
134
- "animations",
142
+ "webkitdirectory",
143
+ "capture",
135
144
  "accept",
145
+ "nobrowse",
146
+ //
147
+ // apart from 'max-files' these are convenience attributes for validation extensions
148
+ //
136
149
  "min-files",
137
150
  "max-files",
138
151
  "min-size",
@@ -140,7 +153,10 @@ class Et extends J {
140
153
  "min-list-size",
141
154
  "max-list-size"
142
155
  //
143
- // changes to `disabled` attribute are handled by `formDisabledCallback`
156
+ // the root doesn't have the 'multiple' attribute it uses 'min-files' / 'max-files'
157
+ //
158
+ //
159
+ // changes to 'disabled' attribute are handled by `formDisabledCallback`
144
160
  //
145
161
  ];
146
162
  }
@@ -150,24 +166,34 @@ class Et extends J {
150
166
  this.value = `${i}`;
151
167
  return;
152
168
  }
153
- this.#d(t, i), this.#p(t, i);
154
- }
155
- /** Syncs file-pond interaction attributes to source input attributes */
156
- #d(t, e) {
157
- !this.#i || !g.includes(t) || (this.#i[t] = e);
169
+ this.#f(t, i), this.#b(t, i), this.#g(t, i);
158
170
  }
159
- /** Looks up the extension(s) linked to this attribute and assigns the matched props */
160
- #p(t, e) {
161
- const i = G(t);
162
- e = it.includes(t) && e === "" ? !0 : e, this.#e.propagateExtensionProperty(i, e);
171
+ /** Syncs attribute to internal element state */
172
+ #f(t, e) {
173
+ if (t === "nobrowse") {
174
+ c(e) ? this.#s.remove() : this.#a.prepend(this.#s);
175
+ return;
176
+ }
177
+ if (t === "max-files") {
178
+ const i = parseInt(e, 10);
179
+ this.#t.entries.length > i && (this.#t.entries = this.#t.entries.toSpliced(i)), this.#o.multiple = i > 1, this.#l(), this.checkValidity();
180
+ return;
181
+ }
163
182
  }
164
- /** Sets the inner input element id */
165
- set inputId(t) {
166
- this.#i.id = t;
183
+ /** Syncs file-pond interaction attributes (attributes that impact file system file selection UX) to source input attributes */
184
+ #b(t, e) {
185
+ if (v.includes(t)) {
186
+ if (k.includes(t)) {
187
+ l(this.#o, t, e === !0 || e === "");
188
+ return;
189
+ }
190
+ o(this.#o, t, e);
191
+ }
167
192
  }
168
- /** Returns the inner input element id */
169
- get inputId() {
170
- return this.#i.id;
193
+ /** Looks up the extension(s) linked to this attribute and assigns the matched props */
194
+ #g(t, e) {
195
+ const i = K(t);
196
+ e = k.includes(t) && e === "" ? !0 : e, this.#i.propagateExtensionProperty(i, e);
171
197
  }
172
198
  /** Disable the field and sets the disabled attribute */
173
199
  set disabled(t) {
@@ -175,15 +201,23 @@ class Et extends J {
175
201
  }
176
202
  /** Gets the field disabled state */
177
203
  get disabled() {
178
- return !!u(this, "disabled");
204
+ return !!h(this, "disabled");
205
+ }
206
+ /** Set the field webkitdirectory state */
207
+ set webkitdirectory(t) {
208
+ l(this, "webkitdirectory", t);
209
+ }
210
+ /** Gets the field webkitdirectory state */
211
+ get webkitdirectory() {
212
+ return !!h(this, "webkitdirectory");
179
213
  }
180
214
  /** Toggle the field multiple state */
181
215
  set multiple(t) {
182
- l(this, "multiple", t);
216
+ t && this.maxFiles === 1 && (this.maxFiles = 1 / 0), !t && this.maxFiles !== 1 && (this.maxFiles = 1);
183
217
  }
184
218
  /** Gets the field multiple state */
185
219
  get multiple() {
186
- return !!u(this, "multiple");
220
+ return this.maxFiles !== 1;
187
221
  }
188
222
  /**
189
223
  * Set field as readonly. Only for situations where FilePond has initial files and those files
@@ -195,7 +229,7 @@ class Et extends J {
195
229
  }
196
230
  /** Gets the field readonly state */
197
231
  get readOnly() {
198
- return !!u(this, "readonly");
232
+ return !!h(this, "readonly");
199
233
  }
200
234
  /** Set field as required */
201
235
  set required(t) {
@@ -203,7 +237,7 @@ class Et extends J {
203
237
  }
204
238
  /** Gets the field required state */
205
239
  get required() {
206
- return !!u(this, "required");
240
+ return !!h(this, "required");
207
241
  }
208
242
  /** Accepted files setter https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept */
209
243
  set accept(t) {
@@ -211,14 +245,23 @@ class Et extends J {
211
245
  }
212
246
  /** Returns the current value of accept */
213
247
  get accept() {
214
- return u(this, "accept");
248
+ return h(this, "accept");
215
249
  }
216
250
  /** Setting to toggle animations */
217
251
  set animations(t) {
218
252
  o(this, "animations", t);
219
253
  }
254
+ /** Returns the current animation mode */
220
255
  get animations() {
221
- return u(this, "animations") ?? "auto";
256
+ return h(this, "animations") ?? "auto";
257
+ }
258
+ /** Toggle browse button */
259
+ set noBrowse(t) {
260
+ t ? l(this, "nobrowse", !0) : l(this, "nobrowse", !1);
261
+ }
262
+ /** Returns the current browse button state */
263
+ get noBrowse() {
264
+ return !this.#s.parentNode;
222
265
  }
223
266
  /** Min file size setter, accepts a number of bytes or a natural filesize string like 1MB */
224
267
  set minSize(t) {
@@ -226,7 +269,7 @@ class Et extends J {
226
269
  }
227
270
  /** Returns the currently set min file size */
228
271
  get minSize() {
229
- return d(this, "min-size");
272
+ return p(this, "min-size");
230
273
  }
231
274
  /** Max file size setter, accepts a number of bytes or a natural filesize string like 1MB */
232
275
  set maxSize(t) {
@@ -234,7 +277,7 @@ class Et extends J {
234
277
  }
235
278
  /** Returns the currently set max file size */
236
279
  get maxSize() {
237
- return d(this, "max-size");
280
+ return p(this, "max-size");
238
281
  }
239
282
  /** Min total file size setter, accepta a number of bytes or a natural filesize string like 1MB */
240
283
  set minListSize(t) {
@@ -242,7 +285,7 @@ class Et extends J {
242
285
  }
243
286
  /** Returns the currently set min total file size */
244
287
  get minListSize() {
245
- return d(this, "min-list-size");
288
+ return p(this, "min-list-size");
246
289
  }
247
290
  /** Max total file size setter, accepts a number of bytes or a natural filesize string like 1MB */
248
291
  set maxListSize(t) {
@@ -250,7 +293,7 @@ class Et extends J {
250
293
  }
251
294
  /** Returns the currently set max total file size */
252
295
  get maxListSize() {
253
- return d(this, "max-list-size");
296
+ return p(this, "max-list-size");
254
297
  }
255
298
  /** Min total entries setter, an integer, defaults to `0` */
256
299
  set minFiles(t) {
@@ -262,7 +305,7 @@ class Et extends J {
262
305
  }
263
306
  /** Max total entries setter, an integer, defaults to `Infinity` */
264
307
  set maxFiles(t) {
265
- o(this, "max-files", t);
308
+ t === 1 / 0 ? this.removeAttribute("max-files") : o(this, "max-files", t);
266
309
  }
267
310
  /** Returns the currently set max total entries */
268
311
  get maxFiles() {
@@ -281,18 +324,26 @@ class Et extends J {
281
324
  }
282
325
  /** Sets the locale */
283
326
  set locale(t) {
284
- this.#n = t, this.#e.propagateExtensionProperty("locale", t), this.checkValidity();
327
+ this.#e = t, this.#i.propagateExtensionProperty("locale", t), this.#l(), this.checkValidity();
285
328
  }
286
329
  /** Returns the current locale object, so it's easier to extend */
287
330
  get locale() {
288
- return this.#n;
331
+ return this.#e;
289
332
  }
290
333
  /** Sets custom extensions to load */
291
334
  set extensions(t) {
292
- this.#e.extensions = t;
335
+ this.#i.extensions = t;
336
+ }
337
+ /** Update worker url */
338
+ set workersURL(t) {
339
+ this.#i.propagateExtensionProperty("workersURL", t);
293
340
  }
294
341
  //#endregion
295
342
  //#region Element methods
343
+ /** Browse files */
344
+ browse() {
345
+ this.noBrowse || (this.#s.focus({ preventScroll: !0 }), this.#o.click());
346
+ }
296
347
  /** Listen for events */
297
348
  on(t, e) {
298
349
  return this.#t.on(t, e);
@@ -334,109 +385,110 @@ class Et extends J {
334
385
  constructor(t) {
335
386
  super();
336
387
  const { styles: e = [] } = t || {};
337
- this.#o = this.attachShadow({ mode: "open" }), this.#o.adoptedStyleSheets = [X, ...e].map(L), this.#r = document.createElement("slot"), this.#o.append(this.#r), this.#s = this.attachInternals(), this.#t = Q(), this.#e = P(this.#t), this.#e.on("setExtensions", ({ extensionNames: i }) => {
338
- this.#h.filter((s) => !i.includes(s)).forEach((s) => {
388
+ this.#u = this.attachShadow({ mode: "open", delegatesFocus: !0 }), this.#u.adoptedStyleSheets = [J, ...e].map(M), this.#n = f("div"), this.#n.tabIndex = -1, this.#u.append(this.#n), this.#a = f("slot"), this.#n.append(this.#a), this.#o = f("input", {
389
+ type: "file",
390
+ "aria-hidden": !0,
391
+ hidden: !0,
392
+ multiple: !0,
393
+ tabIndex: -1
394
+ }), this.#n.prepend(this.#o), this.#s = f("button", {
395
+ type: "button",
396
+ part: "browse-button"
397
+ }), this.#n.prepend(this.#s), this.#r = this.attachInternals(), this.#t = W({
398
+ // handles one or multiple files state
399
+ beforeInsertEntries: (i, s) => this.maxFiles < 1 / 0 && s.length + i.length > this.maxFiles ? i.toSpliced(this.maxFiles - s.length) : i
400
+ }), this.#i = P(this.#t), this.#i.on("setExtensions", ({ extensionNames: i }) => {
401
+ this.#m.filter((s) => !i.includes(s)).forEach((s) => {
339
402
  delete this[s];
340
403
  }), i.forEach((s) => {
341
404
  Object.defineProperty(this, s, {
342
405
  // getter / setter
343
- set(h) {
344
- this.#e.setExtensionProperties(s, h);
406
+ set(d) {
407
+ this.#i.setExtensionProperties(s, d);
345
408
  },
346
409
  get() {
347
- return this.#e.getExtensionProperties(s);
410
+ return this.#i.getExtensionProperties(s);
348
411
  },
349
412
  // so we can delete this proxy later
350
413
  configurable: !0
351
414
  });
352
- }), this.#h = i, this.checkValidity();
415
+ }), this.#m = i, this.checkValidity();
416
+ }), this.#t.on("updateEntries", (i) => {
417
+ this.locale && this.#l();
353
418
  });
354
419
  }
355
- #m() {
356
- const t = this.#r.assignedElements({ flatten: !0 }).filter((s) => s.matches('input[type="file"]'));
357
- let e;
358
- if (!t.length)
359
- e = T("input", { type: "file" }), this.#l = e, this.append(e);
360
- else {
361
- for (const s of t)
362
- if (s === this.#l && t.length > 1) {
363
- this.#l = null, s.remove();
364
- return;
365
- }
366
- e = t.at(-1);
420
+ setBrowseButtonLabelKey(t) {
421
+ this.#c = t, this.#l();
422
+ }
423
+ #l() {
424
+ const t = this.#t.entries.length, e = {
425
+ multiple: `${this.multiple}`,
426
+ //
427
+ name: t === 1 ? this.#t.entries[0].name || "untitled" : null,
428
+ count: t,
429
+ //
430
+ maxFiles: this.maxFiles,
431
+ maxFilesUnit: "unitFiles"
432
+ };
433
+ if (this.#e) {
434
+ const i = t === 0 ? "ariaNoEntries" : t === 1 ? "ariaSingleEntry" : "ariaMultipleEntries";
435
+ T(this.#s, {
436
+ // aria label is always base browse button
437
+ "aria-label": u(this.#e.browse, e, this.#e),
438
+ // aria description is always base browse button
439
+ "aria-description": S([
440
+ u(this.#e[i], e, this.#e),
441
+ this.#e.ariaRequired,
442
+ this.validationMessage
443
+ ]).join(", ")
444
+ });
367
445
  }
368
- const i = [...et, ...g];
369
- for (const s of i) {
370
- const h = D(s, e, this);
371
- h !== void 0 && (this[s] = h);
446
+ this.#s.innerHTML = u(
447
+ this.#e ? this.#e[this.#c] : this.#c,
448
+ e,
449
+ this.#e
450
+ );
451
+ }
452
+ #y() {
453
+ const t = this.#a.assignedElements({ flatten: !0 }).filter((i) => i.matches('input[type="file"]')), e = [...Y, ...v];
454
+ for (const i of e) {
455
+ const s = E(i, ...t, this);
456
+ s !== void 0 && (this[i] = s);
372
457
  }
373
- q(e, i), this.#i = e;
374
- for (const s of g)
375
- this[s] !== void 0 && this.#d(s, this[s]);
376
- this.#e.setExtensionProperties("FileInputSource", {
377
- element: this.#i
378
- }), !e.id && (this.inputId = `file-pond-${$()}`);
458
+ t.length && (this.multiple = !!E("multiple", ...t)), t.forEach((i) => i.remove());
379
459
  }
380
460
  /** Called each time the element is added to the document */
381
461
  connectedCallback() {
382
- const t = (i) => {
383
- this.#s?.setFormValue(
384
- i.length > 0 ? tt(this.name ?? "filepond", i) : null
385
- ), this.checkValidity(), f(this, "change");
462
+ this.#y();
463
+ const t = (e) => {
464
+ this.#r.setFormValue(
465
+ e.length > 0 ? Q(this.name ?? "filepond", e) : null
466
+ ), this.checkValidity(), g(this, "change");
386
467
  };
387
- this.#e.setExtensionProperties("FileInputSource", {
468
+ this.#i.setExtensionProperties("FileInputSource", {
469
+ element: this.#o,
388
470
  resetFilesOnAdd: !0
389
- }), this.#e.setExtensionProperties("ValueCallbackStore", {
471
+ }), this.#i.setExtensionProperties("ValueCallbackStore", {
390
472
  required: this.required,
391
473
  onChange: t
392
- }), this.#m(), this.#f();
393
- let e = null;
394
- this.#a.push(
395
- // this file input elements are handled correctly
396
- a(this.#r, "slotchange", () => {
397
- this.#m();
398
- }),
399
- // these two listeners toggle the dragging attribute to the file-pond element, we do this so we can move the file-pond element that is being interacted with to the front, so the dragged item also renders on top
400
- a(this, "dragStart", () => {
401
- l(this, "dragging", !0);
402
- }),
403
- a(this, "dragEnd", () => {
404
- l(this, "dragging", !1);
405
- }),
406
- // set up enter/spacebar press when file-pond is activeElement
407
- a(this, "keypress", (i) => {
408
- i.target !== this || !/ | Enter/.test(i.key) || (i.stopPropagation(), i.preventDefault(), this.#i?.click());
409
- }),
410
- // set up browse file on click interaction
411
- a(this, "pointerdown", (i) => {
412
- e = i.target;
413
- }),
414
- a(this, "pointerup", (i) => {
415
- e = i.target !== e, setTimeout(() => {
416
- e = null;
417
- }, 0);
418
- }),
419
- a(this, "click", (i) => {
420
- if (e === !0)
421
- return;
422
- const s = document.elementFromPoint(i.x, i.y);
423
- s !== this || s?.nodeName !== "FILE-POND-DROP-AREA" || this.#i?.click();
474
+ }), this.#E(), this.#h.push(
475
+ q(this, "click", (e) => {
476
+ const i = e.composedPath()[0];
477
+ i !== this && i !== this.#s && !this.#s.contains(i) || (e.stopPropagation(), e.preventDefault(), this.browse());
424
478
  }),
425
479
  // fire update events
426
480
  this.#t.on("update", () => {
427
- f(this, "update");
481
+ g(this, "update");
428
482
  })
429
- ), f(this, "connected");
483
+ ), g(this, "connected");
430
484
  }
431
485
  /** Called each time the element is removed from the document. */
432
486
  disconnectedCallback() {
433
- this.#a.forEach((t) => t()), this.#a = [];
487
+ this.#h.forEach((t) => t()), this.#h = [];
434
488
  }
435
489
  //#region Form integration and validation
436
490
  /** This makes the element associateable with its parent form */
437
491
  static formAssociated = !0;
438
- /** This Has a reference to the element form internals */
439
- #s = null;
440
492
  /** Sets the current field name */
441
493
  set name(t) {
442
494
  o(this, "name", t);
@@ -447,7 +499,7 @@ class Et extends J {
447
499
  }
448
500
  /** Proxy for Element internals `form` getter */
449
501
  get form() {
450
- return this.#s?.form ?? void 0;
502
+ return this.#r.form ?? void 0;
451
503
  }
452
504
  /**
453
505
  * Sets/Updates the value of the the entry manager
@@ -456,75 +508,84 @@ class Et extends J {
456
508
  */
457
509
  set value(t) {
458
510
  let e = [];
459
- m(t) && (e = t.split(",").map((i) => i.trim()).map((i) => ({
511
+ c(t) && (e = t.split(",").map((i) => i.trim()).map((i) => ({
460
512
  src: i
461
- }))), this.#c = e, this.entries = e;
513
+ }))), this.#p = e, this.entries = e;
462
514
  }
463
515
  /** Proxy for `entries` getter */
464
516
  get value() {
465
517
  return this.entries;
466
518
  }
467
519
  /** Sets up the field for validation */
468
- #f() {
469
- this.#a.push(
520
+ #E() {
521
+ this.#h.push(
470
522
  this.#t.on(
471
523
  "update",
472
- b(() => this.checkValidity())
524
+ x(() => this.checkValidity())
473
525
  ),
474
- this.#e.on(
526
+ this.#i.on(
475
527
  "update",
476
- b(() => this.checkValidity())
528
+ x(() => this.checkValidity())
477
529
  )
478
- ), this.checkValidity(), this.tabIndex = U(this.getAttribute("tabindex")) || 0;
530
+ ), this.checkValidity();
479
531
  }
480
532
  /** Validates the current state of the field */
481
533
  checkValidity() {
482
- const { validationInvalidBusy: t = "", validationInvalidState: e = "" } = this.#n || {};
483
- if (Z(this.entries)) {
484
- if (this.#s?.validity.customError === !0)
534
+ const { validationInvalidBusy: t = "", validationInvalidState: e = "" } = this.#e || {};
535
+ if (N(this.entries)) {
536
+ if (this.#r.validity.customError === !0)
485
537
  return;
486
- this.#u({ customError: !0 }, E(t));
538
+ this.#d({ customError: !0 }, u(t));
487
539
  return;
488
540
  }
489
- const i = this.#e.getState(), s = {};
541
+ const i = this.#i.getState(), s = {};
490
542
  for (const { status: n } of Object.values(i)) {
491
- if (!n || n.type !== H.Error)
543
+ if (!n || n.type !== $.Error)
492
544
  continue;
493
- const { flag: c = "customError" } = n?.meta ?? {}, C = this.#n ? w(n, this.#n) : B(n.code);
494
- s[c] = C ?? E(e);
545
+ const { flag: m = "customError" } = n?.meta ?? {}, L = this.#e ? j(
546
+ {
547
+ ...n,
548
+ values: {
549
+ // error state values
550
+ ...n.values,
551
+ // append input state
552
+ multiple: this.multiple
553
+ }
554
+ },
555
+ this.#e
556
+ ) : U(n.code);
557
+ s[m] = L ?? u(e);
495
558
  }
496
559
  if (Object.keys(s).length === 0)
497
- return this.#u();
498
- const z = W(x.map((n) => s[n])).at(
560
+ return this.#d();
561
+ const a = S(F.map((n) => s[n])).at(
499
562
  0
500
- ), V = x.reduce(
501
- (n, c) => (n[c] = !!s[c], n),
563
+ ), O = F.reduce(
564
+ (n, m) => (n[m] = !!s[m], n),
502
565
  {}
503
566
  );
504
- return this.#u(V, z);
567
+ return this.#d(O, a);
505
568
  }
506
569
  /** Sets the validity state on the element internals. Returns `true` if valid, `false` if invalid */
507
- #u(t, e) {
508
- if (!t)
509
- return this.#s?.setValidity({}), !0;
510
- const i = j() && !N() ? this.#i : void 0;
511
- return this.#s?.setValidity(t, e, i), !1;
570
+ #d(t, e) {
571
+ let i = !0;
572
+ return t ? (this.#r.setValidity(t, e, this.#n), i = !1) : this.#r.setValidity({}), this.#l(), i;
512
573
  }
513
574
  /** Proxy for element internals `reportValidity()` method */
514
575
  reportValidity() {
515
- this.#s?.reportValidity();
576
+ this.#r.reportValidity();
516
577
  }
517
578
  /** Proxy for element internals `validity` getter */
518
579
  get validity() {
519
- return this.#s?.validity;
580
+ return this.#r.validity;
520
581
  }
521
582
  /** Proxy for element internals `validationMessage` getter */
522
583
  get validationMessage() {
523
- return this.#s?.validationMessage;
584
+ return this.#r.validationMessage;
524
585
  }
525
586
  /** Called when element or parent element (for example a `<fieldset>`) is set to disabled */
526
587
  formDisabledCallback(t) {
527
- this.#e.propagateExtensionProperty("disabled", t), this.#i && (this.#i.disabled = t);
588
+ this.#i.propagateExtensionProperty("disabled", t), this.#o.disabled = t, this.#s.disabled = t;
528
589
  }
529
590
  /**
530
591
  * Called when user resets form. Resets field to initial state. The initial state is either
@@ -534,7 +595,7 @@ class Et extends J {
534
595
  * https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/reset
535
596
  */
536
597
  formResetCallback() {
537
- this.entries = this.#c ?? [];
598
+ this.entries = this.#p ?? [];
538
599
  }
539
600
  /** Called when user returns to form with back button */
540
601
  formStateRestoreCallback(t, e) {
@@ -542,6 +603,6 @@ class Et extends J {
542
603
  //#endregion
543
604
  }
544
605
  export {
545
- Et as FilePondInputElement,
546
- Q as createFilePondEntryTree
606
+ dt as FilePondInputElement,
607
+ W as createFilePondEntryTree
547
608
  };