@rpldy/upload-preview
Advanced tools
Comparing version 0.10.0 to 0.11.0
@@ -17,4 +17,5 @@ "use strict"; | ||
imageMimeTypes: ["image/jpeg", "image/webp", "image/gif", "image/png", "image/apng", "image/bmp", "image/x-icon", "image/svg+xml"], | ||
videoMimeTypes: ["video/mp4", "video/webm", "video/ogg"] | ||
videoMimeTypes: ["video/mp4", "video/webm", "video/ogg"], | ||
previewComponentProps: undefined | ||
}); | ||
exports.PREVIEW_DEFAULTS = PREVIEW_DEFAULTS; |
@@ -67,3 +67,3 @@ "use strict"; | ||
var img = e.target; | ||
var fallback = (0, _utils.getFallbackUrl)(props.fallbackUrl, img.src); | ||
var fallback = (0, _utils.getFallbackUrlData)(props.fallbackUrl, img.src); | ||
@@ -70,0 +70,0 @@ if (fallback) { |
@@ -56,3 +56,3 @@ "use strict"; | ||
if (!data) { | ||
data = (0, _utils.getFallbackUrl)(options.fallbackUrl, file); | ||
data = (0, _utils.getFallbackUrlData)(options.fallbackUrl, file); | ||
isFallback = true; | ||
@@ -59,0 +59,0 @@ } |
@@ -6,3 +6,9 @@ "use strict"; | ||
}); | ||
exports.getFileObjectUrlByType = exports.getFallbackUrl = exports.getWithMandatoryOptions = void 0; | ||
Object.defineProperty(exports, "isFunction", { | ||
enumerable: true, | ||
get: function get() { | ||
return _shared.isFunction; | ||
} | ||
}); | ||
exports.getFileObjectUrlByType = exports.getFallbackUrlData = exports.getWithMandatoryOptions = void 0; | ||
@@ -27,3 +33,3 @@ var _shared = require("@rpldy/shared"); | ||
var getFallbackUrl = function (fallbackProp, file) { | ||
var getFallbackUrlData = function (fallbackProp, file) { | ||
var data = (0, _shared.isFunction)(fallbackProp) ? fallbackProp(file) : fallbackProp; | ||
@@ -33,2 +39,3 @@ | ||
data = { | ||
id: "", | ||
url: data, | ||
@@ -43,3 +50,3 @@ name: file.name, | ||
exports.getFallbackUrl = getFallbackUrl; | ||
exports.getFallbackUrlData = getFallbackUrlData; | ||
@@ -46,0 +53,0 @@ var getFileObjectUrlByType = function (type, mimeTypes, max, file) { |
@@ -9,3 +9,4 @@ import { devFreeze } from "@rpldy/shared"; | ||
imageMimeTypes: ["image/jpeg", "image/webp", "image/gif", "image/png", "image/apng", "image/bmp", "image/x-icon", "image/svg+xml"], | ||
videoMimeTypes: ["video/mp4", "video/webm", "video/ogg"] | ||
videoMimeTypes: ["video/mp4", "video/webm", "video/ogg"], | ||
previewComponentProps: undefined | ||
}); |
@@ -9,3 +9,3 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
import usePreviewsLoader from "./usePreviewsLoader"; | ||
import { getFallbackUrl } from "./utils"; | ||
import { getFallbackUrlData } from "./utils"; | ||
import { PREVIEW_TYPES } from "./consts"; | ||
@@ -50,3 +50,3 @@ | ||
var img = e.target; | ||
var fallback = getFallbackUrl(props.fallbackUrl, img.src); | ||
var fallback = getFallbackUrlData(props.fallbackUrl, img.src); | ||
@@ -53,0 +53,0 @@ if (fallback) { |
@@ -23,3 +23,3 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
import { PREVIEW_TYPES } from "./consts"; | ||
import { getWithMandatoryOptions, getFallbackUrl, getFileObjectUrlByType } from "./utils"; | ||
import { getWithMandatoryOptions, getFallbackUrlData, getFileObjectUrlByType } from "./utils"; | ||
@@ -46,3 +46,3 @@ var getFilePreviewUrl = function (file, options) { | ||
if (!data) { | ||
data = getFallbackUrl(options.fallbackUrl, file); | ||
data = getFallbackUrlData(options.fallbackUrl, file); | ||
isFallback = true; | ||
@@ -49,0 +49,0 @@ } |
@@ -15,3 +15,3 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
var getFallbackUrl = function (fallbackProp, file) { | ||
var getFallbackUrlData = function (fallbackProp, file) { | ||
var data = isFunction(fallbackProp) ? fallbackProp(file) : fallbackProp; | ||
@@ -21,2 +21,3 @@ | ||
data = { | ||
id: "", | ||
url: data, | ||
@@ -47,2 +48,2 @@ name: file.name, | ||
export { getWithMandatoryOptions, getFallbackUrl, getFileObjectUrlByType }; | ||
export { isFunction, getWithMandatoryOptions, getFallbackUrlData, getFileObjectUrlByType }; |
{ | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"name": "@rpldy/upload-preview", | ||
@@ -21,10 +21,10 @@ "description": "preview component to show image or video being uploaded", | ||
"dependencies": { | ||
"@rpldy/shared": "^0.10.0", | ||
"@rpldy/shared-ui": "^0.10.0" | ||
"@rpldy/shared": "^0.11.0", | ||
"@rpldy/shared-ui": "^0.11.0" | ||
}, | ||
"devDependencies": { | ||
"@rpldy/upload-button": "^0.10.0", | ||
"@rpldy/upload-url-input": "^0.10.0", | ||
"@rpldy/upload-button": "^0.11.0", | ||
"@rpldy/upload-url-input": "^0.11.0", | ||
"@storybook/addon-knobs": "^6.1.10", | ||
"flow-bin": "^0.133.0", | ||
"flow-bin": "^0.145.0", | ||
"react-image-crop": "^8.6.4", | ||
@@ -40,3 +40,3 @@ "styled-components": "^5.2.0" | ||
}, | ||
"gitHead": "f9266271a12c840e60b6fcc98d78bc2aa583d5d2" | ||
"gitHead": "3fb121df6ce4b2949e82f0f1e5e52c596b7b07c3" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34865
535
+ Added@rpldy/life-events@0.11.5(transitive)
+ Added@rpldy/sender@0.11.5(transitive)
+ Added@rpldy/shared@0.11.5(transitive)
+ Added@rpldy/shared-ui@0.11.6(transitive)
+ Added@rpldy/simple-state@0.11.5(transitive)
+ Added@rpldy/uploader@0.11.5(transitive)
- Removed@rpldy/life-events@0.10.0(transitive)
- Removed@rpldy/sender@0.10.0(transitive)
- Removed@rpldy/shared@0.10.0(transitive)
- Removed@rpldy/shared-ui@0.10.0(transitive)
- Removed@rpldy/simple-state@0.10.0(transitive)
- Removed@rpldy/uploader@0.10.0(transitive)
Updated@rpldy/shared@^0.11.0
Updated@rpldy/shared-ui@^0.11.0