@lonik/oh-image 2.6.0 → 2.7.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.
@@ -1,6 +1,7 @@
1
- import { s as ImageLoaderOptions } from "./index-DMC2sGIO.js";
2
- import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-DScvwZAJ.js";
3
- import * as react_jsx_runtime4 from "react/jsx-runtime";
1
+ import { n as ImageLoaderOptions } from "./types-BEgZ3W30.js";
2
+ import "./index-C-1t5-gk.js";
3
+ import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-DCLkYppY.js";
4
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
4
5
 
5
6
  //#region src/loaders/cloudflare/cloudflare-options.d.ts
6
7
  type CloudflareTransforms = Partial<{
@@ -39,6 +40,6 @@ declare const useCloudflareContext: () => CloudflareGlobalOptions, CloudflareLoa
39
40
  ...props
40
41
  }: {
41
42
  children: React.ReactNode;
42
- } & Partial<CloudflareGlobalOptions>) => react_jsx_runtime4.JSX.Element, useCloudflareLoader: (options?: CloudflareGlobalOptions | undefined) => (() => undefined) | ((imageOptions: ImageLoaderOptions) => string);
43
+ } & Partial<CloudflareGlobalOptions>) => react_jsx_runtime3.JSX.Element, useCloudflareLoader: (options?: CloudflareGlobalOptions | undefined) => (() => undefined) | ((imageOptions: ImageLoaderOptions) => string);
43
44
  //#endregion
44
45
  export { CloudflareGlobalOptions, CloudflareLoaderProvider, CloudflareOptions, CloudflareTransforms, useCloudflareContext, useCloudflareLoader };
@@ -1,111 +1,41 @@
1
- import { s as ImageLoaderOptions } from "./index-DMC2sGIO.js";
2
- import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-DScvwZAJ.js";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import { n as ImageLoaderOptions } from "./types-BEgZ3W30.js";
2
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
3
+ import { Cloudinary, CloudinaryImage } from "@cloudinary/url-gen";
4
4
 
5
5
  //#region src/loaders/cloudinary/cloudinary-options.d.ts
6
- type BACKGROUND_MODE = "border" | "predominant" | "border_contrast" | "predominant_contrast" | "predominant_gradient" | "predominant_gradient_contrast" | "border_gradient" | "border_gradient_contrast";
7
- type ANGLE_MODE = "vflip" | "hflip" | "ignore" | "auto_right" | "auto_left";
8
- type CROP_MODE = "auto" | "auto_pad" | "crop" | "fill" | "fill_pad" | "fit" | "imagga_crop" | "imagga_scale" | "lfill" | "limit" | "lpad" | "mfit" | "mpad" | "pad" | "scale" | "thumb";
9
- type COLOR_SPACE = "sRGB" | "tinysrgb" | "cmyk" | "no_cmyk" | "keep_cmyk" | "truecolor";
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
- 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 = Partial<{
13
- a?: number | ANGLE_MODE | string;
14
- mode?: string;
15
- ar?: string | number;
16
- b?: string;
17
- b_auto?: {
18
- mode: BACKGROUND_MODE;
19
- number: number;
20
- direction: string;
21
- color: string;
22
- };
23
- b_gen_fill?: {
24
- prompt: string;
25
- seed: number;
26
- };
27
- bl?: string;
28
- bo?: string;
29
- c?: CROP_MODE;
30
- co?: string;
31
- cs?: COLOR_SPACE;
32
- d?: string;
33
- dl?: number | string;
34
- dn?: number;
35
- dpr?: number | "auto";
36
- du?: number | string;
37
- e?: string;
38
- e_accelerate?: number | boolean;
39
- e_adv_redeye?: boolean;
40
- anti_removal?: number | boolean;
41
- art?: ART_FILTER;
42
- e_art?: ART_FILTER;
43
- e_auto_brightness?: boolean | number;
44
- e_auto_color?: boolean | number;
45
- e_auto_contrast?: boolean | number;
46
- e_auto_enhance?: boolean | number;
47
- e_background_removal?: boolean | string;
48
- e_blur?: number | boolean;
49
- e_blur_faces?: number | boolean;
50
- e_blur_region?: number | boolean;
51
- e_brightness?: number | boolean;
52
- e_cartoonify?: number | string;
53
- e_colorize?: number | boolean;
54
- e_contrast?: number | boolean;
55
- e_distort?: string;
56
- e_drop_shadow?: number | string;
57
- e_gamma?: number | boolean;
58
- e_gradient_fade?: number | boolean;
59
- e_grayscale?: boolean;
60
- e_hue?: number | boolean;
61
- e_improve?: boolean | string;
62
- e_make_transparent?: number | string;
63
- e_negate?: boolean;
64
- e_oil_paint?: number | boolean;
65
- e_pixelate?: number | boolean;
66
- e_pixelate_faces?: number | boolean;
67
- e_pixelate_region?: number | boolean;
68
- e_redeye?: boolean;
69
- e_saturation?: number | boolean;
70
- e_screen?: boolean;
71
- e_sepia?: number | boolean;
72
- e_shadow?: number | string;
73
- e_sharpen?: number | boolean;
74
- e_shear?: string;
75
- e_simulate_colorblind?: string;
76
- e_tint?: string;
77
- e_trim?: number | string;
78
- e_unsharp_mask?: number | string;
79
- e_vectorize?: number | string;
80
- e_vignette?: number | boolean;
81
- e_volume_mute?: boolean;
82
- eo?: number | string;
83
- f?: FORMAT_TYPE;
84
- fl?: string | string[];
85
- g?: string;
86
- h?: number;
87
- l?: string;
88
- o?: number | string;
89
- p?: string;
90
- pg?: number | string;
91
- q?: number | "auto" | string;
92
- r?: number | "max" | string;
93
- so?: number | string;
94
- u?: string;
95
- w?: number;
96
- x?: number | string;
97
- y?: number | string;
98
- z?: number;
99
- }>;
100
- type CloudinaryOptions = BaseLoaderOptions<CloudinaryTransforms>;
101
- type CloudinaryGlobalOptions = BaseGlobalLoaderOptions<CloudinaryTransforms>;
6
+ type CloudinaryTransforms = (img: CloudinaryImage) => CloudinaryImage;
7
+ type CloudinaryGlobalOptions = {
8
+ cld: Cloudinary;
9
+ };
10
+ interface CloudinaryLoaderHookOptions {
11
+ transforms?: CloudinaryTransforms;
12
+ placeholder?: CloudinaryTransforms;
13
+ }
14
+ interface CloudinaryLoaderProviderProps {
15
+ client: Cloudinary;
16
+ children: React.ReactNode;
17
+ transforms?: CloudinaryTransforms;
18
+ placeholder?: CloudinaryTransforms;
19
+ }
102
20
  //#endregion
103
21
  //#region src/loaders/cloudinary/cloudinary-loader.d.ts
104
- declare const useCloudinaryContext: () => CloudinaryGlobalOptions, CloudinaryLoaderProvider: ({
105
- children,
106
- ...props
107
- }: {
108
- children: React.ReactNode;
109
- } & Partial<CloudinaryGlobalOptions>) => react_jsx_runtime0.JSX.Element, useCloudinaryLoader: (options?: CloudinaryGlobalOptions | undefined) => (() => undefined) | ((imageOptions: ImageLoaderOptions) => string);
22
+ interface CloudinaryLoaderContext {
23
+ cld?: Cloudinary;
24
+ transforms?: CloudinaryTransforms | undefined;
25
+ placeholder?: CloudinaryTransforms | undefined;
26
+ }
27
+ declare function CloudinaryLoaderProvider({
28
+ client,
29
+ children,
30
+ transforms,
31
+ placeholder
32
+ }: {
33
+ client: Cloudinary;
34
+ children: React.ReactNode;
35
+ transforms?: CloudinaryTransforms;
36
+ placeholder?: CloudinaryTransforms;
37
+ }): react_jsx_runtime2.JSX.Element;
38
+ declare function useCloudinaryLoader(options?: CloudinaryLoaderHookOptions | CloudinaryTransforms): (imageOptions: ImageLoaderOptions) => string;
39
+ declare const useCloudinaryContext: () => CloudinaryLoaderContext;
110
40
  //#endregion
111
- export { CloudinaryGlobalOptions, CloudinaryLoaderProvider, CloudinaryOptions, CloudinaryTransforms, useCloudinaryContext, useCloudinaryLoader };
41
+ export { CloudinaryGlobalOptions, CloudinaryLoaderHookOptions, CloudinaryLoaderProvider, CloudinaryLoaderProviderProps, CloudinaryTransforms, useCloudinaryContext, useCloudinaryLoader };