@lonik/oh-image 2.2.2 → 2.3.0
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/{base-loader-options-C1EZVxmE.d.ts → base-loader-options-BzrruYJ4.d.ts} +3 -3
- package/dist/cloudflare.d.ts +3 -3
- package/dist/cloudflare.js +1 -1
- package/dist/cloudinary.d.ts +3 -3
- package/dist/cloudinary.js +1 -1
- package/dist/imgproxy.d.ts +5 -5
- package/dist/imgproxy.js +1 -1
- package/dist/kontent.d.ts +48 -0
- package/dist/kontent.js +18 -0
- package/dist/plugin.js +1 -2
- package/dist/react.d.ts +1 -1
- package/package.json +1 -1
- /package/dist/{index-BXVRSiZA.d.ts → index-DxqVMPdE.d.ts} +0 -0
- /package/dist/{loader-factory-C1301CZd.js → loader-factory-JhrhUvkg.js} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
//#region src/loaders/base-loader-options.d.ts
|
|
2
2
|
interface BaseLoaderOptions<T> {
|
|
3
3
|
path?: string;
|
|
4
|
-
transforms?: T;
|
|
4
|
+
transforms?: T & BaseLoaderTransforms;
|
|
5
5
|
}
|
|
6
6
|
interface BaseGlobalLoaderOptions<T> extends BaseLoaderOptions<T> {
|
|
7
|
-
placeholder?: T;
|
|
7
|
+
placeholder?: T & BaseLoaderTransforms;
|
|
8
8
|
}
|
|
9
9
|
interface BaseLoaderTransforms {
|
|
10
10
|
[futureKey: string]: any;
|
|
11
11
|
}
|
|
12
12
|
//#endregion
|
|
13
|
-
export { BaseLoaderOptions as n,
|
|
13
|
+
export { BaseLoaderOptions as n, BaseGlobalLoaderOptions as t };
|
package/dist/cloudflare.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { s as ImageLoaderOptions } from "./index-
|
|
2
|
-
import { n as BaseLoaderOptions,
|
|
1
|
+
import { s as ImageLoaderOptions } from "./index-DxqVMPdE.js";
|
|
2
|
+
import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-BzrruYJ4.js";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/loaders/cloudflare/cloudflare-options.d.ts
|
|
6
|
-
type CloudflareTransforms =
|
|
6
|
+
type CloudflareTransforms = Partial<{
|
|
7
7
|
anim: boolean;
|
|
8
8
|
background: string;
|
|
9
9
|
blur: number;
|
package/dist/cloudflare.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as loaderFactory } from "./loader-factory-
|
|
1
|
+
import { t as loaderFactory } from "./loader-factory-JhrhUvkg.js";
|
|
2
2
|
|
|
3
3
|
//#region src/loaders/cloudflare/cloudflare-loader.tsx
|
|
4
4
|
const { useLoaderContext: useCloudflareContext, LoaderProvider: CloudflareLoaderProvider, useLoader: useCloudflareLoader } = loaderFactory({
|
package/dist/cloudinary.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as ImageLoaderOptions } from "./index-
|
|
2
|
-
import { n as BaseLoaderOptions,
|
|
1
|
+
import { s as ImageLoaderOptions } from "./index-DxqVMPdE.js";
|
|
2
|
+
import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-BzrruYJ4.js";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/loaders/cloudinary/cloudinary-options.d.ts
|
|
@@ -9,7 +9,7 @@ type CROP_MODE = "auto" | "auto_pad" | "crop" | "fill" | "fill_pad" | "fit" | "i
|
|
|
9
9
|
type COLOR_SPACE = "sRGB" | "tinysrgb" | "cmyk" | "no_cmyk" | "keep_cmyk" | "truecolor";
|
|
10
10
|
type ART_FILTER = "al_dente" | "athena" | "audrey" | "aurora" | "daguerre" | "eucalyptus" | "fes" | "frost" | "hairspray" | "hokusai" | "incognito" | "linen" | "peacock" | "primavera" | "quartz" | "red_rock" | "refresh" | "sizzle" | "sonnet" | "ukulele" | "zorro";
|
|
11
11
|
type FORMAT_TYPE = "3ds" | "ai" | "avif" | "bmp" | "bw" | "djvu" | "dng" | "eps" | "fbx" | "flif" | "gif" | "glb" | "gltf" | "heif" | "heic" | "ico" | "indd" | "jp2" | "jpg" | "jpeg" | "jxl" | "obj" | "pdf" | "ply" | "png" | "psd" | "raw" | "svg" | "tga" | "tif" | "tiff" | "u3ma" | "usdz" | "wdp" | "webp";
|
|
12
|
-
type CloudinaryTransforms =
|
|
12
|
+
type CloudinaryTransforms = Partial<{
|
|
13
13
|
a?: number | ANGLE_MODE | string;
|
|
14
14
|
mode?: string;
|
|
15
15
|
ar?: string | number;
|
package/dist/cloudinary.js
CHANGED
package/dist/imgproxy.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as ImageLoaderOptions } from "./index-
|
|
2
|
-
import { n as BaseLoaderOptions,
|
|
3
|
-
import * as
|
|
1
|
+
import { s as ImageLoaderOptions } from "./index-DxqVMPdE.js";
|
|
2
|
+
import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-BzrruYJ4.js";
|
|
3
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/loaders/imgproxy/imgproxy-options.d.ts
|
|
6
6
|
type ResizeType = "fit" | "fill" | "fill-down" | "force" | "auto";
|
|
@@ -100,7 +100,7 @@ interface PngOptions {
|
|
|
100
100
|
quantize?: boolean;
|
|
101
101
|
quantization_colors?: number;
|
|
102
102
|
}
|
|
103
|
-
type ImgproxyTransforms =
|
|
103
|
+
type ImgproxyTransforms = Partial<{
|
|
104
104
|
/**
|
|
105
105
|
* Defines the resizing type, width, height, enlarge, and extend.
|
|
106
106
|
* All arguments are optional and can be omitted to use their default values.
|
|
@@ -383,6 +383,6 @@ declare const useImgproxyContext: () => ImgproxyGlobalOptions, ImgproxyLoaderPro
|
|
|
383
383
|
...props
|
|
384
384
|
}: {
|
|
385
385
|
children: React.ReactNode;
|
|
386
|
-
} & Partial<ImgproxyGlobalOptions>) =>
|
|
386
|
+
} & Partial<ImgproxyGlobalOptions>) => react_jsx_runtime2.JSX.Element, useImgproxyLoader: (options?: ImgproxyGlobalOptions | undefined) => (() => undefined) | ((imageOptions: ImageLoaderOptions) => string);
|
|
387
387
|
//#endregion
|
|
388
388
|
export { ImgproxyGlobalOptions, ImgproxyLoaderProvider, ImgproxyOptions, ImgproxyTransforms, useImgproxyContext, useImgproxyLoader };
|
package/dist/imgproxy.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as loaderFactory } from "./loader-factory-
|
|
1
|
+
import { t as loaderFactory } from "./loader-factory-JhrhUvkg.js";
|
|
2
2
|
|
|
3
3
|
//#region src/loaders/imgproxy/imgproxy-loader.tsx
|
|
4
4
|
const { useLoaderContext: useImgproxyContext, LoaderProvider: ImgproxyLoaderProvider, useLoader: useImgproxyLoader } = loaderFactory({
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { s as ImageLoaderOptions } from "./index-DxqVMPdE.js";
|
|
2
|
+
import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-BzrruYJ4.js";
|
|
3
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/loaders/kontent/kontent-options.d.ts
|
|
6
|
+
type KontentTransforms = Partial<{
|
|
7
|
+
/** Resize the width of the image in pixels. */
|
|
8
|
+
w?: number;
|
|
9
|
+
/** Resize the height of the image in pixels. */
|
|
10
|
+
h?: number;
|
|
11
|
+
/** Serve correctly sized images for devices that expose a device pixel ratio. */
|
|
12
|
+
dpr?: number;
|
|
13
|
+
/** Set how the image will fit within the size bounds provided. */
|
|
14
|
+
fit?: "clamp" | "clip" | "crop" | "facearea" | "fill" | "fillmax" | "max" | "min" | "scale";
|
|
15
|
+
/** * Select a sub-region of the source image to use for processing.
|
|
16
|
+
* Expected format: "x,y,width,height"
|
|
17
|
+
*/
|
|
18
|
+
rect?: [number, number, number, number];
|
|
19
|
+
/** * Focal point crop: Choose the point of interest (x, y coordinates and zoom).
|
|
20
|
+
* fp-x and fp-y are typically 0.0 to 1.0.
|
|
21
|
+
*/
|
|
22
|
+
"fp-x"?: number;
|
|
23
|
+
"fp-y"?: number;
|
|
24
|
+
"fp-z"?: number;
|
|
25
|
+
smart?: boolean | "face" | "edges" | "objects";
|
|
26
|
+
/** Fill transparent areas of the image with the specified color (e.g., 'FFF' or 'red'). */
|
|
27
|
+
bg?: string;
|
|
28
|
+
/** Specify the output format to convert the image to. */
|
|
29
|
+
fm?: "webp" | "jpg" | "png" | "gif" | "avif" | "jp2";
|
|
30
|
+
/** Optimize image compression (1-100) for lossy formats. */
|
|
31
|
+
q?: number;
|
|
32
|
+
/** Enable delivery of lossless images in supported formats. */
|
|
33
|
+
lossless?: boolean;
|
|
34
|
+
/** Automatic delivery of optimized formats like WebP based on browser support. */
|
|
35
|
+
auto?: "format" | "compress" | "enhance";
|
|
36
|
+
}>;
|
|
37
|
+
type KontentOptions = BaseLoaderOptions<KontentTransforms>;
|
|
38
|
+
type KontentGlobalOptions = BaseGlobalLoaderOptions<KontentTransforms>;
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/loaders/kontent/kontent-loader.d.ts
|
|
41
|
+
declare const useKontentContext: () => KontentGlobalOptions, KontentLoaderProvider: ({
|
|
42
|
+
children,
|
|
43
|
+
...props
|
|
44
|
+
}: {
|
|
45
|
+
children: React.ReactNode;
|
|
46
|
+
} & Partial<KontentGlobalOptions>) => react_jsx_runtime1.JSX.Element, useKontentLoader: (options?: KontentGlobalOptions | undefined) => (() => undefined) | ((imageOptions: ImageLoaderOptions) => string);
|
|
47
|
+
//#endregion
|
|
48
|
+
export { KontentGlobalOptions, KontentLoaderProvider, KontentOptions, KontentTransforms, useKontentContext, useKontentLoader };
|
package/dist/kontent.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { t as loaderFactory } from "./loader-factory-JhrhUvkg.js";
|
|
2
|
+
|
|
3
|
+
//#region src/loaders/kontent/kontent-loader.tsx
|
|
4
|
+
const { useLoaderContext: useKontentContext, LoaderProvider: KontentLoaderProvider, useLoader: useKontentLoader } = loaderFactory({
|
|
5
|
+
transforms: { auto: "format" },
|
|
6
|
+
placeholder: {
|
|
7
|
+
q: 10,
|
|
8
|
+
auto: "format"
|
|
9
|
+
}
|
|
10
|
+
}, {
|
|
11
|
+
optionSeparator: "=",
|
|
12
|
+
paramSeparator: "&",
|
|
13
|
+
passBooleanValue: true,
|
|
14
|
+
customResolver: { rect: (key, value) => `${key}=${value.join(",")}` }
|
|
15
|
+
}, ({ path, params, imageOptions }) => `${path}/${imageOptions.src}?${params}`);
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { KontentLoaderProvider, useKontentContext, useKontentLoader };
|
package/dist/plugin.js
CHANGED
package/dist/react.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as Image, c as ImageProps, i as __imageFactory, n as useImageContext, o as ImageLoader, r as useImgLoaded, s as ImageLoaderOptions, t as ImageProvider } from "./index-
|
|
1
|
+
import { a as Image, c as ImageProps, i as __imageFactory, n as useImageContext, o as ImageLoader, r as useImgLoaded, s as ImageLoaderOptions, t as ImageProvider } from "./index-DxqVMPdE.js";
|
|
2
2
|
export { Image, ImageLoader, ImageLoaderOptions, ImageProps, ImageProvider, __imageFactory, useImageContext, useImgLoaded };
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|