@uppy/golden-retriever
Advanced tools
Comparing version 2.0.6 to 2.1.0
"use strict"; | ||
const IndexedDBStore = require('./IndexedDBStore'); | ||
const IndexedDBStore = require("./IndexedDBStore.js"); | ||
const MetaDataStore = require('./MetaDataStore'); | ||
const MetaDataStore = require("./MetaDataStore.js"); | ||
/** | ||
@@ -11,5 +11,7 @@ * Clean old blobs without needing to import all of Uppy. | ||
module.exports = function cleanup() { | ||
function cleanup() { | ||
MetaDataStore.cleanup(); | ||
IndexedDBStore.cleanup(); | ||
}; | ||
} | ||
module.exports = cleanup; |
"use strict"; | ||
var _class, _temp; | ||
const throttle = require("lodash.throttle"); | ||
const throttle = require('lodash.throttle'); | ||
const BasePlugin = require("@uppy/core/lib/BasePlugin"); | ||
const BasePlugin = require('@uppy/core/lib/BasePlugin'); | ||
const ServiceWorkerStore = require("./ServiceWorkerStore.js"); | ||
const ServiceWorkerStore = require('./ServiceWorkerStore'); | ||
const IndexedDBStore = require("./IndexedDBStore.js"); | ||
const IndexedDBStore = require('./IndexedDBStore'); | ||
const MetaDataStore = require("./MetaDataStore.js"); | ||
const MetaDataStore = require('./MetaDataStore'); | ||
const packageJson = { | ||
"version": "2.1.0" | ||
}; | ||
/** | ||
@@ -22,4 +24,3 @@ * The GoldenRetriever plugin — restores selected files and resumes uploads | ||
module.exports = (_temp = _class = class GoldenRetriever extends BasePlugin { | ||
class GoldenRetriever extends BasePlugin { | ||
constructor(uppy, opts) { | ||
@@ -398,2 +399,5 @@ super(uppy, opts); | ||
}, _class.VERSION = "2.0.6", _temp); | ||
} | ||
GoldenRetriever.VERSION = packageJson.version; | ||
module.exports = GoldenRetriever; |
@@ -33,3 +33,4 @@ "use strict"; | ||
let cleanedUp = false; | ||
module.exports = class MetaDataStore { | ||
class MetaDataStore { | ||
constructor(opts) { | ||
@@ -91,5 +92,5 @@ this.opts = { | ||
const data = localStorage.getItem(`uppyState:${id}`); | ||
if (!data) return null; | ||
if (!data) return; | ||
const obj = maybeParse(data); | ||
if (!obj) return null; | ||
if (!obj) return; | ||
@@ -102,2 +103,4 @@ if (obj.expires && obj.expires < now) { | ||
}; | ||
} | ||
module.exports = MetaDataStore; |
"use strict"; | ||
/* globals clients */ | ||
/* eslint-disable no-restricted-globals */ | ||
const fileCache = Object.create(null); | ||
@@ -7,0 +5,0 @@ |
"use strict"; | ||
/*eslint-disable */ | ||
const isSupported = typeof navigator !== 'undefined' && 'serviceWorker' in navigator; | ||
@@ -33,3 +32,2 @@ | ||
}); | ||
console.log('Loading stored blobs from Service Worker'); | ||
@@ -67,3 +65,3 @@ const onMessage = event => { | ||
store: this.name, | ||
file: file | ||
file | ||
}); | ||
@@ -78,3 +76,3 @@ }); | ||
store: this.name, | ||
fileID: fileID | ||
fileID | ||
}); | ||
@@ -81,0 +79,0 @@ }); |
{ | ||
"name": "@uppy/golden-retriever", | ||
"description": "The GoldenRetriever Uppy plugin saves selected files in browser cache to seamlessly resume uploding after browser crash or accidentally closed tab", | ||
"version": "2.0.6", | ||
"version": "2.1.0", | ||
"license": "MIT", | ||
"main": "lib/index.js", | ||
"types": "types/index.d.ts", | ||
"type": "module", | ||
"keywords": [ | ||
@@ -27,8 +28,8 @@ "file uploader", | ||
"@transloadit/prettier-bytes": "0.0.7", | ||
"@uppy/utils": "^4.0.4", | ||
"@uppy/utils": "^4.1.0", | ||
"lodash.throttle": "^4.1.1" | ||
}, | ||
"peerDependencies": { | ||
"@uppy/core": "^2.1.3" | ||
"@uppy/core": "^2.3.0" | ||
} | ||
} |
@@ -32,4 +32,2 @@ # @uppy/golden-retriever | ||
We recommend installing from npm and then using a module bundler such as [Webpack](https://webpack.js.org/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/). | ||
Alternatively, you can also use this plugin in a pre-built bundle from Transloadit’s CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object. See the [main Uppy documentation](https://uppy.io/docs/#Installation) for instructions. | ||
@@ -36,0 +34,0 @@ |
@@ -1,3 +0,3 @@ | ||
const IndexedDBStore = require('./IndexedDBStore') | ||
const MetaDataStore = require('./MetaDataStore') | ||
import IndexedDBStore from './IndexedDBStore.js' | ||
import MetaDataStore from './MetaDataStore.js' | ||
@@ -7,5 +7,5 @@ /** | ||
*/ | ||
module.exports = function cleanup () { | ||
export default function cleanup () { | ||
MetaDataStore.cleanup() | ||
IndexedDBStore.cleanup() | ||
} |
@@ -1,7 +0,9 @@ | ||
const throttle = require('lodash.throttle') | ||
const BasePlugin = require('@uppy/core/lib/BasePlugin') | ||
const ServiceWorkerStore = require('./ServiceWorkerStore') | ||
const IndexedDBStore = require('./IndexedDBStore') | ||
const MetaDataStore = require('./MetaDataStore') | ||
import throttle from 'lodash.throttle' | ||
import BasePlugin from '@uppy/core/lib/BasePlugin' | ||
import ServiceWorkerStore from './ServiceWorkerStore.js' | ||
import IndexedDBStore from './IndexedDBStore.js' | ||
import MetaDataStore from './MetaDataStore.js' | ||
import packageJson from '../package.json' | ||
/** | ||
@@ -14,4 +16,4 @@ * The GoldenRetriever plugin — restores selected files and resumes uploads | ||
*/ | ||
module.exports = class GoldenRetriever extends BasePlugin { | ||
static VERSION = require('../package.json').version | ||
export default class GoldenRetriever extends BasePlugin { | ||
static VERSION = packageJson.version | ||
@@ -18,0 +20,0 @@ constructor (uppy, opts) { |
@@ -227,2 +227,2 @@ const indexedDB = typeof window !== 'undefined' | ||
module.exports = IndexedDBStore | ||
export default IndexedDBStore |
@@ -27,3 +27,3 @@ /** | ||
let cleanedUp = false | ||
module.exports = class MetaDataStore { | ||
export default class MetaDataStore { | ||
constructor (opts) { | ||
@@ -83,5 +83,5 @@ this.opts = { | ||
const data = localStorage.getItem(`uppyState:${id}`) | ||
if (!data) return null | ||
if (!data) return | ||
const obj = maybeParse(data) | ||
if (!obj) return null | ||
if (!obj) return | ||
@@ -88,0 +88,0 @@ if (obj.expires && obj.expires < now) { |
/* globals clients */ | ||
/* eslint-disable no-restricted-globals */ | ||
@@ -4,0 +3,0 @@ const fileCache = Object.create(null) |
@@ -1,3 +0,1 @@ | ||
/*eslint-disable */ | ||
const isSupported = typeof navigator !== 'undefined' && 'serviceWorker' in navigator | ||
@@ -33,4 +31,2 @@ | ||
console.log('Loading stored blobs from Service Worker') | ||
const onMessage = (event) => { | ||
@@ -55,3 +51,3 @@ if (event.data.store !== this.name) { | ||
type: 'uppy/GET_FILES', | ||
store: this.name | ||
store: this.name, | ||
}) | ||
@@ -68,3 +64,3 @@ }) | ||
store: this.name, | ||
file: file | ||
file, | ||
}) | ||
@@ -79,3 +75,3 @@ }) | ||
store: this.name, | ||
fileID: fileID | ||
fileID, | ||
}) | ||
@@ -88,2 +84,2 @@ }) | ||
module.exports = ServiceWorkerStore | ||
export default ServiceWorkerStore |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
25
1517
Yes
105320
41
Updated@uppy/utils@^4.1.0