cloudinary-core
Advanced tools
Comparing version 2.7.3 to 2.7.4
@@ -5,2 +5,7 @@ export as namespace cloudinary; | ||
type CropMode = string | "scale" | "fit" | "limit" | "mfit" | "fill" | "lfill" | "pad" | "lpad" | "mpad" | "crop" | "thumb" | "imagga_crop" | "imagga_scale"; | ||
type CustomFunctionType = "wasm" | "remote"; | ||
interface CustomFunction { | ||
function_type: CustomFunctionType; | ||
source: string; | ||
} | ||
type Gravity = string | "north_west" | "north" | "north_east" | "west" | "center" | "east" | "south_west" | "south" | "south_east" | "xy_center" | | ||
@@ -184,2 +189,4 @@ "face" | "face:center" | "face:auto" | "faces" | "faces:center" | "faces:auto" | "body" | "body:face" | "adv_face" | "adv_faces" | "adv_eyes" | | ||
crop(value: CropMode): Transformation; | ||
customFunction(value: CustomFunction): Transformation; | ||
customPreFunction(value: CustomFunction): Transformation; | ||
defaultImage(value: string): Transformation; // public id of an uploaded image | ||
@@ -295,2 +302,4 @@ delay(value: string): Transformation; | ||
crop?: CropMode, | ||
customFunction?: CustomFunction, | ||
customPreFunction?: CustomFunction, | ||
defaultImage?: string; // public id of an uploaded image | ||
@@ -297,0 +306,0 @@ delay?: string; |
{ | ||
"name": "cloudinary-core", | ||
"version": "2.7.3", | ||
"version": "2.7.4", | ||
"description": "Cloudinary Client Side JS library. Cloudinary streamlines your web application’s image manipulation needs. Cloudinary's cloud-based servers automate image uploading, resizing, cropping, optimizing, sprite generation and more.", | ||
@@ -5,0 +5,0 @@ "main": "cloudinary-core.js", |
@@ -640,3 +640,3 @@ var applyBreakpoints, closestAbove, defaultBreakpoints, findContainerWidth, maxWidth, updateDpr; | ||
case !isString(elements): | ||
return document.querySelectorAll(elements); | ||
return Array.prototype.slice.call(document.querySelectorAll(elements), 0); | ||
default: | ||
@@ -643,0 +643,0 @@ return [elements]; |
@@ -507,2 +507,10 @@ import Expression from './expression'; | ||
function processCustomFunction(value) { | ||
if (value.function_type === "remote") { | ||
return [value.function_type, btoa(value.source)].join(":") | ||
} else if (value.function_type === "wasm") { | ||
return [value.function_type, value.source].join(":") | ||
} | ||
} | ||
/** | ||
@@ -609,2 +617,17 @@ * Transformation Class methods. | ||
customFunction(value) { | ||
return this.param(value, "custom_function", "fn", () => { | ||
return processCustomFunction(value); | ||
}); | ||
} | ||
customPreFunction(value) { | ||
if (this.get('custom_function')) { | ||
return; | ||
} | ||
return this.rawParam(value, "custom_function", "", () => { | ||
value = processCustomFunction(value); | ||
return value ? `fn_pre:${value}` : value; | ||
}); | ||
} | ||
@@ -842,12 +865,2 @@ defaultImage(value) { | ||
customFunction(value) { | ||
return this.param(value, "custom_function", "fn", () => { | ||
if(value.function_type === "remote"){ | ||
return [value.function_type, btoa(value.source)].join(":") | ||
} | ||
else if (value.function_type === "wasm") | ||
return [value.function_type, value.source].join(":") | ||
}) | ||
} | ||
x(value) { | ||
@@ -884,2 +897,3 @@ return this.param(value, "x", "x", Expression.normalize); | ||
"customFunction", | ||
"customPreFunction", | ||
"defaultImage", | ||
@@ -886,0 +900,0 @@ "delay", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
1751601
21561