Skip to content

Commit cb6f000

Browse files
authored
Merge pull request #95 from imagekit-developer/layer-support
Layer support
2 parents 75c0a11 + 909cb8d commit cb6f000

File tree

13 files changed

+1470
-321
lines changed

13 files changed

+1470
-321
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Changelog
22

3+
## Version 4.0.0
4+
5+
### Breaking Changes
6+
7+
1. The default value for `transformationPosition` is now `query` instead of `path`. This change enables wildcard cache purging to remove CDN cache for all generated transformations.
8+
9+
**Action Required:**
10+
If you're using the `transformationPosition` parameter in the `url` method and want to apply transformations in the path, you must now explicitly set the value to `path`. The default is `query`.
11+
12+
2. Removed the following deprecated parameters:
13+
`effectSharpen`, `effectUSM`, `effectContrast`, `effectGray`, `effectShadow`, `effectGradient`, and `rotate`.
14+
15+
### Other Changes
16+
17+
1. Native support for overlays has been added. See the README for usage examples.
18+
2. New AI-powered transformations are now supported:
19+
`aiRemoveBackground`, `aiUpscale`, `aiVariation`, `aiDropShadow`, `aiChangeBackground`, and more.
20+
*(Introduced in version 3.1.0)*
21+
22+
---
23+
324
## SDK Version 3.0.0
425

526
### Breaking Changes

README.md

Lines changed: 310 additions & 116 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "imagekit-javascript",
3-
"version": "3.1.0",
3+
"version": "4.0.0",
44
"description": "Javascript SDK for using ImageKit.io in the browser",
55
"main": "dist/imagekit.cjs.js",
66
"module": "dist/imagekit.esm.js",
@@ -43,7 +43,7 @@
4343
"dev": "rollup -c -w",
4444
"export-types": "tsc",
4545
"build": "rm -rf dist*;rollup -c && yarn export-types",
46-
"test": "NODE_ENV=test nyc ./node_modules/mocha/bin/mocha test/*.js",
46+
"test": "NODE_ENV=test nyc ./node_modules/mocha/bin/mocha \"test/**/*.js\"",
4747
"startSampleApp": "yarn build && cd samples/sample-app/ && yarn install && node index.js",
4848
"report-coverage": "codecov"
4949
},
@@ -56,13 +56,13 @@
5656
"javascript",
5757
"sdk",
5858
"js",
59-
"sdk",
6059
"image",
6160
"optimization",
62-
"image",
6361
"transformation",
64-
"image",
65-
"resize"
62+
"resize",
63+
"upload",
64+
"video",
65+
"overlay"
6666
],
6767
"author": "ImageKit Developer",
6868
"license": "MIT",

src/constants/supportedTransforms.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,6 @@ export const supportedTransforms: { [key: string]: string } = {
3232
duration: "du",
3333
streamingResolutions: "sr",
3434

35-
// Old deprecated mappings
36-
effectSharpen: "e-sharpen",
37-
effectUSM: "e-usm",
38-
effectContrast: "e-contrast",
39-
effectGray: "e-grayscale",
40-
effectShadow: "e-shadow",
41-
effectGradient: "e-gradient",
42-
rotate: "rt",
43-
4435
// AI & advanced effects
4536
grayscale: "e-grayscale",
4637
aiUpscale: "e-upscale",
@@ -66,6 +57,20 @@ export const supportedTransforms: { [key: string]: string } = {
6657
zoom: "z",
6758
page: "pg",
6859

60+
// Text overlay transformations which are not defined yet
61+
fontSize: "fs",
62+
fontFamily: "ff",
63+
fontColor: "co",
64+
innerAlignment: "ia",
65+
padding: "pa",
66+
alpha: "al",
67+
typography: "tg",
68+
lineHeight: "lh",
69+
70+
// Subtitles transformations which are not defined
71+
fontOutline: "fol",
72+
fontShadow: "fsh",
73+
6974
// Raw pass-through
7075
raw: "raw",
7176
};

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,12 @@ const promisify = function <T = void>(thisContext: ImageKit, fn: Function) {
3737

3838
class ImageKit {
3939
options: ImageKitOptions = {
40-
sdkVersion: `javascript-${version}`,
4140
publicKey: "",
4241
urlEndpoint: "",
4342
transformationPosition: transformationUtils.getDefault(),
4443
};
4544

46-
constructor(opts: Omit<ImageKitOptions, "sdkVersion">) {
45+
constructor(opts: ImageKitOptions) {
4746
this.options = { ...this.options, ...(opts || {}) };
4847
if (!mandatoryParametersAvailable(this.options)) {
4948
throw errorMessages.MANDATORY_INITIALIZATION_MISSING;

src/interfaces/ImageKitOptions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { TransformationPosition } from ".";
22

33
export interface ImageKitOptions {
44
urlEndpoint: string;
5-
sdkVersion?: string;
65
publicKey?: string;
76
transformationPosition?: TransformationPosition;
87
}

0 commit comments

Comments
 (0)