filepond 4.28.1 → 4.28.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/filepond.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * FilePond 4.28.1
2
+ * FilePond 4.28.2
3
3
  * Licensed under MIT, https://opensource.org/licenses/MIT/
4
4
  * Please visit https://pqina.nl/filepond/ for details.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * FilePond 4.28.1
2
+ * FilePond 4.28.2
3
3
  * Licensed under MIT, https://opensource.org/licenses/MIT/
4
4
  * Please visit https://pqina.nl/filepond/ for details.
5
5
  */
@@ -3857,7 +3857,7 @@ const createItem = (origin = null, serverFileReference = null, file = null) => {
3857
3857
 
3858
3858
  const api = {
3859
3859
  id: { get: () => id },
3860
- origin: { get: () => origin },
3860
+ origin: { get: () => origin, set: value => (origin = value) },
3861
3861
  serverId: { get: () => state.serverFileReference },
3862
3862
  transferId: { get: () => state.transferId },
3863
3863
  status: { get: () => state.status },
@@ -4127,6 +4127,15 @@ const actions = (dispatch, query, state) => ({
4127
4127
  return;
4128
4128
  }
4129
4129
 
4130
+ // if is local item we need to enable upload button so change can be propagated to server
4131
+ if (item.origin === FileOrigin.LOCAL) {
4132
+ dispatch('DID_LOAD_ITEM', {
4133
+ id: item.id,
4134
+ error: null,
4135
+ serverFileReference: item.source,
4136
+ });
4137
+ }
4138
+
4130
4139
  // for async scenarios
4131
4140
  const upload = () => {
4132
4141
  // we push this forward a bit so the interface is updated correctly
@@ -4756,6 +4765,16 @@ const actions = (dispatch, query, state) => ({
4756
4765
  success(createItemAPI(item));
4757
4766
  processNext();
4758
4767
 
4768
+ // if origin is local, and we're instant uploading, trigger remove of original
4769
+ // as revert will remove file from list
4770
+ const server = state.options.server;
4771
+ const instantUpload = state.options.instantUpload;
4772
+ if (instantUpload && item.origin === FileOrigin.LOCAL && isFunction(server.remove)) {
4773
+ const noop = () => {};
4774
+ item.origin = FileOrigin.LIMBO;
4775
+ state.options.server.remove(item.source, noop, noop);
4776
+ }
4777
+
4759
4778
  // All items processed? No errors?
4760
4779
  const allItemsProcessed =
4761
4780
  query('GET_ITEMS_BY_STATUS', ItemStatus.PROCESSING_COMPLETE).length ===
@@ -4836,7 +4855,8 @@ const actions = (dispatch, query, state) => ({
4836
4855
  success(createItemAPI(item));
4837
4856
  };
4838
4857
 
4839
- // if this is a local file and the server.remove function has been configured, send source there so dev can remove file from server
4858
+ // if this is a local file and the `server.remove` function has been configured,
4859
+ // send source there so dev can remove file from server
4840
4860
  const server = state.options.server;
4841
4861
  if (
4842
4862
  item.origin === FileOrigin.LOCAL &&