@lonik/oh-image 3.0.0 → 3.1.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/cloudflare.d.ts +3 -3
- package/dist/cloudflare.js +1 -1
- package/dist/cloudinary.d.ts +2 -2
- package/dist/contentful.d.ts +3 -3
- package/dist/contentful.js +1 -1
- package/dist/imgproxy.d.ts +11 -4
- package/dist/imgproxy.js +5 -2
- package/dist/{index-DMKCdFsX.d.ts → index-USi_2jub.d.ts} +4 -4
- package/dist/kontent.d.ts +3 -3
- package/dist/kontent.js +1 -1
- package/dist/{loader-factory-6EOKnqj1.js → loader-factory-B9kl_kUR.js} +6 -1
- package/dist/netlify.d.ts +3 -3
- package/dist/netlify.js +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/wordpress.d.ts +1 -1
- package/dist/wordpress.js +1 -1
- package/package.json +1 -1
package/dist/cloudflare.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as ImageLoaderOptions } from "./types-BEgZ3W30.js";
|
|
2
|
-
import "./index-
|
|
2
|
+
import "./index-USi_2jub.js";
|
|
3
3
|
import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-DCLkYppY.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/loaders/cloudflare/cloudflare-options.d.ts
|
|
7
7
|
type CloudflareTransforms = Partial<{
|
|
@@ -40,6 +40,6 @@ declare const useCloudflareContext: () => CloudflareGlobalOptions, CloudflareLoa
|
|
|
40
40
|
...props
|
|
41
41
|
}: {
|
|
42
42
|
children: React.ReactNode;
|
|
43
|
-
} & Partial<CloudflareGlobalOptions>) =>
|
|
43
|
+
} & Partial<CloudflareGlobalOptions>) => react_jsx_runtime8.JSX.Element, useCloudflareLoader: (options?: CloudflareGlobalOptions | undefined) => (() => undefined) | ((imageOptions: ImageLoaderOptions) => string);
|
|
44
44
|
//#endregion
|
|
45
45
|
export { CloudflareGlobalOptions, CloudflareLoaderProvider, CloudflareOptions, CloudflareTransforms, useCloudflareContext, useCloudflareLoader };
|
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-B9kl_kUR.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
1
|
import { n as ImageLoaderOptions } from "./types-BEgZ3W30.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
3
3
|
import { Cloudinary, CloudinaryImage } from "@cloudinary/url-gen";
|
|
4
4
|
|
|
5
5
|
//#region src/loaders/cloudinary/cloudinary-options.d.ts
|
|
@@ -34,7 +34,7 @@ declare function CloudinaryLoaderProvider({
|
|
|
34
34
|
children: React.ReactNode;
|
|
35
35
|
transforms?: CloudinaryTransforms;
|
|
36
36
|
placeholder?: CloudinaryTransforms;
|
|
37
|
-
}):
|
|
37
|
+
}): react_jsx_runtime4.JSX.Element;
|
|
38
38
|
declare function useCloudinaryLoader(options?: CloudinaryLoaderHookOptions | CloudinaryTransforms): (imageOptions: ImageLoaderOptions) => string;
|
|
39
39
|
declare const useCloudinaryContext: () => CloudinaryLoaderContext;
|
|
40
40
|
//#endregion
|
package/dist/contentful.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as ImageLoaderOptions } from "./types-BEgZ3W30.js";
|
|
2
|
-
import "./index-
|
|
2
|
+
import "./index-USi_2jub.js";
|
|
3
3
|
import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-DCLkYppY.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/loaders/contentful/contentful-options.d.ts
|
|
7
7
|
type ContentfulTransforms = Partial<{
|
|
@@ -39,6 +39,6 @@ declare const useContentfulContext: () => ContentfulGlobalOptions, ContentfulLoa
|
|
|
39
39
|
...props
|
|
40
40
|
}: {
|
|
41
41
|
children: React.ReactNode;
|
|
42
|
-
} & Partial<ContentfulGlobalOptions>) =>
|
|
42
|
+
} & Partial<ContentfulGlobalOptions>) => react_jsx_runtime0.JSX.Element, useContentfulLoader: (options?: ContentfulGlobalOptions | undefined) => (() => undefined) | ((imageOptions: ImageLoaderOptions) => string);
|
|
43
43
|
//#endregion
|
|
44
44
|
export { ContentfulGlobalOptions, ContentfulLoaderProvider, ContentfulOptions, ContentfulTransforms, useContentfulContext, useContentfulLoader };
|
package/dist/contentful.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as loaderFactory } from "./loader-factory-
|
|
1
|
+
import { t as loaderFactory } from "./loader-factory-B9kl_kUR.js";
|
|
2
2
|
|
|
3
3
|
//#region src/loaders/contentful/contentful-loader.tsx
|
|
4
4
|
const { useLoaderContext: useContentfulContext, LoaderProvider: ContentfulLoaderProvider, useLoader: useContentfulLoader } = loaderFactory({
|
package/dist/imgproxy.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as ImageLoaderOptions } from "./types-BEgZ3W30.js";
|
|
2
|
-
import "./index-
|
|
2
|
+
import "./index-USi_2jub.js";
|
|
3
3
|
import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-DCLkYppY.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/loaders/imgproxy/imgproxy-options.d.ts
|
|
7
7
|
type ResizeType = "fit" | "fill" | "fill-down" | "force" | "auto";
|
|
@@ -376,7 +376,14 @@ type ImgproxyTransforms = Partial<{
|
|
|
376
376
|
watermark_shadow: number;
|
|
377
377
|
}>;
|
|
378
378
|
type ImgproxyOptions = BaseLoaderOptions<ImgproxyTransforms>;
|
|
379
|
-
|
|
379
|
+
interface ImgproxyGlobalOptions extends BaseGlobalLoaderOptions<ImgproxyOptions> {
|
|
380
|
+
/**
|
|
381
|
+
* If \`undefined\`, won't set anything (this is for backward compatibility and will be removed in future versions, where by default it will be "insecure").
|
|
382
|
+
* - \`"insecure"\` sets it to insecure
|
|
383
|
+
* - \`string\` sets the custom signature
|
|
384
|
+
*/
|
|
385
|
+
signature?: "insecure" | (string & {}) | undefined;
|
|
386
|
+
}
|
|
380
387
|
//#endregion
|
|
381
388
|
//#region src/loaders/imgproxy/imgproxy-loader.d.ts
|
|
382
389
|
declare const useImgproxyContext: () => ImgproxyGlobalOptions, ImgproxyLoaderProvider: ({
|
|
@@ -384,6 +391,6 @@ declare const useImgproxyContext: () => ImgproxyGlobalOptions, ImgproxyLoaderPro
|
|
|
384
391
|
...props
|
|
385
392
|
}: {
|
|
386
393
|
children: React.ReactNode;
|
|
387
|
-
} & Partial<ImgproxyGlobalOptions>) =>
|
|
394
|
+
} & Partial<ImgproxyGlobalOptions>) => react_jsx_runtime7.JSX.Element, useImgproxyLoader: (options?: ImgproxyGlobalOptions | undefined) => (() => undefined) | ((imageOptions: ImageLoaderOptions) => string);
|
|
388
395
|
//#endregion
|
|
389
396
|
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-B9kl_kUR.js";
|
|
2
2
|
|
|
3
3
|
//#region src/loaders/imgproxy/imgproxy-loader.tsx
|
|
4
4
|
const { useLoaderContext: useImgproxyContext, LoaderProvider: ImgproxyLoaderProvider, useLoader: useImgproxyLoader } = loaderFactory({
|
|
@@ -129,7 +129,10 @@ const { useLoaderContext: useImgproxyContext, LoaderProvider: ImgproxyLoaderProv
|
|
|
129
129
|
] },
|
|
130
130
|
zoom: { orders: ["x", "y"] }
|
|
131
131
|
}
|
|
132
|
-
}, ({ path, params, imageOptions }) =>
|
|
132
|
+
}, ({ path, params, imageOptions, options }) => {
|
|
133
|
+
if (options.signature !== void 0) return `${path}/${options.signature}/${params}/plain/${imageOptions.src}`;
|
|
134
|
+
return `${path}/${params}/plain/${imageOptions.src}`;
|
|
135
|
+
});
|
|
133
136
|
|
|
134
137
|
//#endregion
|
|
135
138
|
export { ImgproxyLoaderProvider, useImgproxyContext, useImgproxyLoader };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as ImageProps, t as ImageLoader } from "./types-BEgZ3W30.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/react/image.d.ts
|
|
5
|
-
declare function Image(props: ImageProps):
|
|
5
|
+
declare function Image(props: ImageProps): react_jsx_runtime2.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/react/image-factory.d.ts
|
|
8
|
-
declare function __imageFactory(defaultProps: any): (props: any) =>
|
|
8
|
+
declare function __imageFactory(defaultProps: any): (props: any) => react_jsx_runtime2.JSX.Element;
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/react/use-img-loaded.d.ts
|
|
11
11
|
/**
|
|
@@ -47,6 +47,6 @@ declare function ImageProvider({
|
|
|
47
47
|
...props
|
|
48
48
|
}: {
|
|
49
49
|
children: React.ReactNode;
|
|
50
|
-
} & Partial<ImageContextValue>):
|
|
50
|
+
} & Partial<ImageContextValue>): react_jsx_runtime2.JSX.Element;
|
|
51
51
|
//#endregion
|
|
52
52
|
export { Image as a, __imageFactory as i, useImageContext as n, useImgLoaded as r, ImageProvider as t };
|
package/dist/kontent.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as ImageLoaderOptions } from "./types-BEgZ3W30.js";
|
|
2
|
-
import "./index-
|
|
2
|
+
import "./index-USi_2jub.js";
|
|
3
3
|
import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-DCLkYppY.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/loaders/kontent/kontent-options.d.ts
|
|
7
7
|
type KontentTransforms = Partial<{
|
|
@@ -44,6 +44,6 @@ declare const useKontentContext: () => KontentGlobalOptions, KontentLoaderProvid
|
|
|
44
44
|
...props
|
|
45
45
|
}: {
|
|
46
46
|
children: React.ReactNode;
|
|
47
|
-
} & Partial<KontentGlobalOptions>) =>
|
|
47
|
+
} & Partial<KontentGlobalOptions>) => react_jsx_runtime5.JSX.Element, useKontentLoader: (options?: KontentGlobalOptions | undefined) => (() => undefined) | ((imageOptions: ImageLoaderOptions) => string);
|
|
48
48
|
//#endregion
|
|
49
49
|
export { KontentGlobalOptions, KontentLoaderProvider, KontentOptions, KontentTransforms, useKontentContext, useKontentLoader };
|
package/dist/kontent.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as loaderFactory } from "./loader-factory-
|
|
1
|
+
import { t as loaderFactory } from "./loader-factory-B9kl_kUR.js";
|
|
2
2
|
|
|
3
3
|
//#region src/loaders/kontent/kontent-loader.tsx
|
|
4
4
|
const { useLoaderContext: useKontentContext, LoaderProvider: KontentLoaderProvider, useLoader: useKontentLoader } = loaderFactory({
|
|
@@ -83,6 +83,10 @@ function loaderFactory(defaults, config, urlResolver) {
|
|
|
83
83
|
console.warn("Path is not provided");
|
|
84
84
|
return () => void 0;
|
|
85
85
|
}
|
|
86
|
+
const mergedOptions = {
|
|
87
|
+
...context,
|
|
88
|
+
...options
|
|
89
|
+
};
|
|
86
90
|
return (imageOptions) => {
|
|
87
91
|
const defaultTransform = imageOptions.isPlaceholder ? context.placeholder : context.transforms;
|
|
88
92
|
const optionTransforms = imageOptions.isPlaceholder ? options?.placeholder : options?.transforms;
|
|
@@ -104,7 +108,8 @@ function loaderFactory(defaults, config, urlResolver) {
|
|
|
104
108
|
return urlResolver({
|
|
105
109
|
imageOptions,
|
|
106
110
|
params: [...params, ...resolvedTransforms].join(config.paramSeparator),
|
|
107
|
-
path
|
|
111
|
+
path,
|
|
112
|
+
options: mergedOptions
|
|
108
113
|
});
|
|
109
114
|
};
|
|
110
115
|
};
|
package/dist/netlify.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as ImageLoaderOptions } from "./types-BEgZ3W30.js";
|
|
2
|
-
import "./index-
|
|
2
|
+
import "./index-USi_2jub.js";
|
|
3
3
|
import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-DCLkYppY.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/loaders/netlify/netlify-options.d.ts
|
|
7
7
|
type NetlifyTransforms = Partial<{
|
|
@@ -21,6 +21,6 @@ declare const useNetlifyContext: () => NetlifyGlobalOptions, NetlifyLoaderProvid
|
|
|
21
21
|
...props
|
|
22
22
|
}: {
|
|
23
23
|
children: React.ReactNode;
|
|
24
|
-
} & Partial<NetlifyGlobalOptions>) =>
|
|
24
|
+
} & Partial<NetlifyGlobalOptions>) => react_jsx_runtime6.JSX.Element, useNetlifyLoader: (options?: NetlifyGlobalOptions | undefined) => (() => undefined) | ((imageOptions: ImageLoaderOptions) => string);
|
|
25
25
|
//#endregion
|
|
26
26
|
export { NetlifyGlobalOptions, NetlifyLoaderProvider, NetlifyOptions, NetlifyTransforms, useNetlifyContext, useNetlifyLoader };
|
package/dist/netlify.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as loaderFactory } from "./loader-factory-
|
|
1
|
+
import { t as loaderFactory } from "./loader-factory-B9kl_kUR.js";
|
|
2
2
|
|
|
3
3
|
//#region src/loaders/netlify/netlify-loader.tsx
|
|
4
4
|
const { useLoaderContext: useNetlifyContext, LoaderProvider: NetlifyLoaderProvider, useLoader: useNetlifyLoader } = loaderFactory({
|
package/dist/react.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as ImageLoaderOptions, r as ImageProps, t as ImageLoader } from "./types-BEgZ3W30.js";
|
|
2
|
-
import { a as Image, i as __imageFactory, n as useImageContext, r as useImgLoaded, t as ImageProvider } from "./index-
|
|
2
|
+
import { a as Image, i as __imageFactory, n as useImageContext, r as useImgLoaded, t as ImageProvider } from "./index-USi_2jub.js";
|
|
3
3
|
export { Image, ImageLoader, ImageLoaderOptions, ImageProps, ImageProvider, __imageFactory, useImageContext, useImgLoaded };
|
package/dist/wordpress.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as ImageLoaderOptions } from "./types-BEgZ3W30.js";
|
|
2
|
-
import "./index-
|
|
2
|
+
import "./index-USi_2jub.js";
|
|
3
3
|
import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-DCLkYppY.js";
|
|
4
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
5
|
|
package/dist/wordpress.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as loaderFactory } from "./loader-factory-
|
|
1
|
+
import { t as loaderFactory } from "./loader-factory-B9kl_kUR.js";
|
|
2
2
|
|
|
3
3
|
//#region src/loaders/wordpress/wordpress-loader.tsx
|
|
4
4
|
const { useLoaderContext: useWordpressContext, LoaderProvider: WordpressLoaderProvider, useLoader: useWordpressLoader } = loaderFactory({
|
package/package.json
CHANGED