@lonik/oh-image 2.4.0 → 2.6.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/README.md +1 -1
- package/dist/README.md +1 -1
- package/dist/cloudflare.d.ts +4 -4
- package/dist/cloudflare.js +4 -2
- package/dist/cloudinary.d.ts +4 -4
- package/dist/cloudinary.js +1 -1
- package/dist/contentful.d.ts +4 -4
- package/dist/contentful.js +1 -1
- package/dist/imgproxy.d.ts +4 -4
- package/dist/imgproxy.js +3 -1
- package/dist/{index-IjVrRcXi.d.ts → index-DMC2sGIO.d.ts} +4 -4
- package/dist/kontent.d.ts +4 -4
- package/dist/kontent.js +2 -2
- package/dist/{loader-factory-CQDWe0k2.js → loader-factory-6EOKnqj1.js} +5 -5
- package/dist/netlify.d.ts +25 -0
- package/dist/netlify.js +20 -0
- package/dist/react.d.ts +1 -1
- package/dist/wordpress.d.ts +35 -0
- package/dist/wordpress.js +21 -0
- package/package.json +9 -1
- /package/dist/{base-loader-options-TbE7SU6o.d.ts → base-loader-options-DScvwZAJ.d.ts} +0 -0
package/README.md
CHANGED
package/dist/README.md
CHANGED
package/dist/cloudflare.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as ImageLoaderOptions } from "./index-
|
|
2
|
-
import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-
|
|
3
|
-
import * as
|
|
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";
|
|
4
4
|
|
|
5
5
|
//#region src/loaders/cloudflare/cloudflare-options.d.ts
|
|
6
6
|
type CloudflareTransforms = Partial<{
|
|
@@ -39,6 +39,6 @@ declare const useCloudflareContext: () => CloudflareGlobalOptions, CloudflareLoa
|
|
|
39
39
|
...props
|
|
40
40
|
}: {
|
|
41
41
|
children: React.ReactNode;
|
|
42
|
-
} & Partial<CloudflareGlobalOptions>) =>
|
|
42
|
+
} & Partial<CloudflareGlobalOptions>) => react_jsx_runtime4.JSX.Element, useCloudflareLoader: (options?: CloudflareGlobalOptions | undefined) => (() => undefined) | ((imageOptions: ImageLoaderOptions) => string);
|
|
43
43
|
//#endregion
|
|
44
44
|
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-6EOKnqj1.js";
|
|
2
2
|
|
|
3
3
|
//#region src/loaders/cloudflare/cloudflare-loader.tsx
|
|
4
4
|
const { useLoaderContext: useCloudflareContext, LoaderProvider: CloudflareLoaderProvider, useLoader: useCloudflareLoader } = loaderFactory({
|
|
@@ -11,7 +11,9 @@ const { useLoaderContext: useCloudflareContext, LoaderProvider: CloudflareLoader
|
|
|
11
11
|
optionSeparator: "=",
|
|
12
12
|
paramSeparator: ",",
|
|
13
13
|
passBooleanValue: true,
|
|
14
|
-
|
|
14
|
+
arrayItemSeparator: ";",
|
|
15
|
+
widthKey: "width",
|
|
16
|
+
heightKey: "height"
|
|
15
17
|
}, ({ path, params, imageOptions }) => `${path}/cdn-cgi/image/${params}/${imageOptions.src}`);
|
|
16
18
|
|
|
17
19
|
//#endregion
|
package/dist/cloudinary.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as ImageLoaderOptions } from "./index-
|
|
2
|
-
import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-
|
|
3
|
-
import * as
|
|
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";
|
|
4
4
|
|
|
5
5
|
//#region src/loaders/cloudinary/cloudinary-options.d.ts
|
|
6
6
|
type BACKGROUND_MODE = "border" | "predominant" | "border_contrast" | "predominant_contrast" | "predominant_gradient" | "predominant_gradient_contrast" | "border_gradient" | "border_gradient_contrast";
|
|
@@ -106,6 +106,6 @@ declare const useCloudinaryContext: () => CloudinaryGlobalOptions, CloudinaryLoa
|
|
|
106
106
|
...props
|
|
107
107
|
}: {
|
|
108
108
|
children: React.ReactNode;
|
|
109
|
-
} & Partial<CloudinaryGlobalOptions>) =>
|
|
109
|
+
} & Partial<CloudinaryGlobalOptions>) => react_jsx_runtime0.JSX.Element, useCloudinaryLoader: (options?: CloudinaryGlobalOptions | undefined) => (() => undefined) | ((imageOptions: ImageLoaderOptions) => string);
|
|
110
110
|
//#endregion
|
|
111
111
|
export { CloudinaryGlobalOptions, CloudinaryLoaderProvider, CloudinaryOptions, CloudinaryTransforms, useCloudinaryContext, useCloudinaryLoader };
|
package/dist/cloudinary.js
CHANGED
package/dist/contentful.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as ImageLoaderOptions } from "./index-
|
|
2
|
-
import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-
|
|
3
|
-
import * as
|
|
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_runtime5 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/loaders/contentful/contentful-options.d.ts
|
|
6
6
|
type ContentfulTransforms = Partial<{
|
|
@@ -38,6 +38,6 @@ declare const useContentfulContext: () => ContentfulGlobalOptions, ContentfulLoa
|
|
|
38
38
|
...props
|
|
39
39
|
}: {
|
|
40
40
|
children: React.ReactNode;
|
|
41
|
-
} & Partial<ContentfulGlobalOptions>) =>
|
|
41
|
+
} & Partial<ContentfulGlobalOptions>) => react_jsx_runtime5.JSX.Element, useContentfulLoader: (options?: ContentfulGlobalOptions | undefined) => (() => undefined) | ((imageOptions: ImageLoaderOptions) => string);
|
|
42
42
|
//#endregion
|
|
43
43
|
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-6EOKnqj1.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,6 +1,6 @@
|
|
|
1
|
-
import { s as ImageLoaderOptions } from "./index-
|
|
2
|
-
import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-
|
|
3
|
-
import * as
|
|
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_runtime1 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";
|
|
@@ -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_runtime1.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-6EOKnqj1.js";
|
|
2
2
|
|
|
3
3
|
//#region src/loaders/imgproxy/imgproxy-loader.tsx
|
|
4
4
|
const { useLoaderContext: useImgproxyContext, LoaderProvider: ImgproxyLoaderProvider, useLoader: useImgproxyLoader } = loaderFactory({
|
|
@@ -8,6 +8,8 @@ const { useLoaderContext: useImgproxyContext, LoaderProvider: ImgproxyLoaderProv
|
|
|
8
8
|
format: "webp"
|
|
9
9
|
}
|
|
10
10
|
}, {
|
|
11
|
+
widthKey: "width",
|
|
12
|
+
heightKey: "height",
|
|
11
13
|
passBooleanValue: true,
|
|
12
14
|
optionSeparator: ":",
|
|
13
15
|
paramSeparator: "/",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ImgHTMLAttributes } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/react/types.d.ts
|
|
5
5
|
interface ImageLoaderOptions {
|
|
@@ -30,10 +30,10 @@ interface ImageProps extends Partial<Pick<ImgHTMLAttributes<HTMLImageElement>, "
|
|
|
30
30
|
}
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region src/react/image.d.ts
|
|
33
|
-
declare function Image(props: ImageProps):
|
|
33
|
+
declare function Image(props: ImageProps): react_jsx_runtime7.JSX.Element;
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/react/image-factory.d.ts
|
|
36
|
-
declare function __imageFactory(defaultProps: any): (props: any) =>
|
|
36
|
+
declare function __imageFactory(defaultProps: any): (props: any) => react_jsx_runtime7.JSX.Element;
|
|
37
37
|
//#endregion
|
|
38
38
|
//#region src/react/use-img-loaded.d.ts
|
|
39
39
|
/**
|
|
@@ -75,6 +75,6 @@ declare function ImageProvider({
|
|
|
75
75
|
...props
|
|
76
76
|
}: {
|
|
77
77
|
children: React.ReactNode;
|
|
78
|
-
} & Partial<ImageContextValue>):
|
|
78
|
+
} & Partial<ImageContextValue>): react_jsx_runtime7.JSX.Element;
|
|
79
79
|
//#endregion
|
|
80
80
|
export { Image as a, ImageProps as c, __imageFactory as i, useImageContext as n, ImageLoader as o, useImgLoaded as r, ImageLoaderOptions as s, ImageProvider as t };
|
package/dist/kontent.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as ImageLoaderOptions } from "./index-
|
|
2
|
-
import { n as BaseLoaderOptions, t as BaseGlobalLoaderOptions } from "./base-loader-options-
|
|
3
|
-
import * as
|
|
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";
|
|
4
4
|
|
|
5
5
|
//#region src/loaders/kontent/kontent-options.d.ts
|
|
6
6
|
type KontentTransforms = Partial<{
|
|
@@ -43,6 +43,6 @@ declare const useKontentContext: () => KontentGlobalOptions, KontentLoaderProvid
|
|
|
43
43
|
...props
|
|
44
44
|
}: {
|
|
45
45
|
children: React.ReactNode;
|
|
46
|
-
} & Partial<KontentGlobalOptions>) =>
|
|
46
|
+
} & Partial<KontentGlobalOptions>) => react_jsx_runtime0.JSX.Element, useKontentLoader: (options?: KontentGlobalOptions | undefined) => (() => undefined) | ((imageOptions: ImageLoaderOptions) => string);
|
|
47
47
|
//#endregion
|
|
48
48
|
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-6EOKnqj1.js";
|
|
2
2
|
|
|
3
3
|
//#region src/loaders/kontent/kontent-loader.tsx
|
|
4
4
|
const { useLoaderContext: useKontentContext, LoaderProvider: KontentLoaderProvider, useLoader: useKontentLoader } = loaderFactory({
|
|
@@ -13,7 +13,7 @@ const { useLoaderContext: useKontentContext, LoaderProvider: KontentLoaderProvid
|
|
|
13
13
|
optionSeparator: "=",
|
|
14
14
|
paramSeparator: "&",
|
|
15
15
|
passBooleanValue: true,
|
|
16
|
-
|
|
16
|
+
arrayItemSeparator: ","
|
|
17
17
|
}, ({ path, params, imageOptions }) => `${path}/${imageOptions.src}?${params}`);
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
@@ -2,10 +2,10 @@ import { createContext, useContext } from "react";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/loaders/transforms-resolver.ts
|
|
5
|
-
const stringifyOptions = (opCode, values, separator) => {
|
|
5
|
+
const stringifyOptions = (opCode, values, separator, arraySeparator) => {
|
|
6
6
|
return [opCode, ...values.map((v) => {
|
|
7
7
|
if (v == null) return "";
|
|
8
|
-
if (Array.isArray(v)) return v.map((val) => encodeURIComponent(val)).join(separator);
|
|
8
|
+
if (Array.isArray(v)) return v.map((val) => encodeURIComponent(val)).join(arraySeparator ?? separator);
|
|
9
9
|
return encodeURIComponent(v);
|
|
10
10
|
})].join(separator);
|
|
11
11
|
};
|
|
@@ -18,10 +18,10 @@ const resolveObjectParam = (key, value, orderConfig, separator) => {
|
|
|
18
18
|
if (childrenOrders && childrenOrders[k] && typeof val === "object" && !Array.isArray(val)) return childrenOrders[k].orders.map((childKey) => val[childKey]).map((v) => {
|
|
19
19
|
if (v == null) return "";
|
|
20
20
|
if (Array.isArray(v)) return v.map((val$1) => encodeURIComponent(String(val$1))).join(separator);
|
|
21
|
-
return
|
|
21
|
+
return String(v);
|
|
22
22
|
}).join(separator);
|
|
23
23
|
if (Array.isArray(val)) return val.map((v) => encodeURIComponent(String(v))).join(separator);
|
|
24
|
-
return
|
|
24
|
+
return String(val);
|
|
25
25
|
})].join(separator);
|
|
26
26
|
};
|
|
27
27
|
function resolveTransform(transforms, config) {
|
|
@@ -45,7 +45,7 @@ function resolveTransform(transforms, config) {
|
|
|
45
45
|
else params.push(key);
|
|
46
46
|
break;
|
|
47
47
|
case "object":
|
|
48
|
-
if (Array.isArray(value)) params.push(stringifyOptions(key, [value], config.optionSeparator));
|
|
48
|
+
if (Array.isArray(value)) params.push(stringifyOptions(key, [value], config.optionSeparator, config.arrayItemSeparator));
|
|
49
49
|
else {
|
|
50
50
|
const objectParams = resolveObjectParam(key, value, config?.orders?.[key], config.optionSeparator);
|
|
51
51
|
if (objectParams) params.push(objectParams);
|
|
@@ -0,0 +1,25 @@
|
|
|
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_runtime2 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/loaders/netlify/netlify-options.d.ts
|
|
6
|
+
type NetlifyTransforms = Partial<{
|
|
7
|
+
w: number;
|
|
8
|
+
h: number;
|
|
9
|
+
fit: "contain" | "cover" | "fill";
|
|
10
|
+
position: "top" | "bottom" | "left" | "right" | "center";
|
|
11
|
+
fm: "avif" | "webp" | "jpg" | "png" | "gif" | "blurhash";
|
|
12
|
+
q: number;
|
|
13
|
+
}>;
|
|
14
|
+
type NetlifyOptions = BaseLoaderOptions<NetlifyTransforms>;
|
|
15
|
+
type NetlifyGlobalOptions = BaseGlobalLoaderOptions<NetlifyTransforms>;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/loaders/netlify/netlify-loader.d.ts
|
|
18
|
+
declare const useNetlifyContext: () => NetlifyGlobalOptions, NetlifyLoaderProvider: ({
|
|
19
|
+
children,
|
|
20
|
+
...props
|
|
21
|
+
}: {
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
} & Partial<NetlifyGlobalOptions>) => react_jsx_runtime2.JSX.Element, useNetlifyLoader: (options?: NetlifyGlobalOptions | undefined) => (() => undefined) | ((imageOptions: ImageLoaderOptions) => string);
|
|
24
|
+
//#endregion
|
|
25
|
+
export { NetlifyGlobalOptions, NetlifyLoaderProvider, NetlifyOptions, NetlifyTransforms, useNetlifyContext, useNetlifyLoader };
|
package/dist/netlify.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { t as loaderFactory } from "./loader-factory-6EOKnqj1.js";
|
|
2
|
+
|
|
3
|
+
//#region src/loaders/netlify/netlify-loader.tsx
|
|
4
|
+
const { useLoaderContext: useNetlifyContext, LoaderProvider: NetlifyLoaderProvider, useLoader: useNetlifyLoader } = loaderFactory({
|
|
5
|
+
path: "/.netlify/images",
|
|
6
|
+
transforms: { fm: "webp" },
|
|
7
|
+
placeholder: { fm: "blurhash" }
|
|
8
|
+
}, {
|
|
9
|
+
optionSeparator: "=",
|
|
10
|
+
paramSeparator: "&",
|
|
11
|
+
widthKey: "w",
|
|
12
|
+
heightKey: "h"
|
|
13
|
+
}, ({ path, params, imageOptions }) => {
|
|
14
|
+
const searchParams = new URLSearchParams(params);
|
|
15
|
+
searchParams.set("url", imageOptions.src);
|
|
16
|
+
return `${path}?${searchParams.toString()}`;
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { NetlifyLoaderProvider, useNetlifyContext, useNetlifyLoader };
|
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-DMC2sGIO.js";
|
|
2
2
|
export { Image, ImageLoader, ImageLoaderOptions, ImageProps, ImageProvider, __imageFactory, useImageContext, useImgLoaded };
|
|
@@ -0,0 +1,35 @@
|
|
|
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_runtime3 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/loaders/wordpress/wordpress-options.d.ts
|
|
6
|
+
type WordpressTransforms = Partial<{
|
|
7
|
+
w: number;
|
|
8
|
+
h: number;
|
|
9
|
+
crop: [number | string, number | string, number | string, number | string];
|
|
10
|
+
resize: [number, number];
|
|
11
|
+
fit: [number, number];
|
|
12
|
+
lb: [number, number];
|
|
13
|
+
ulb: boolean;
|
|
14
|
+
filter: "negate" | "grayscale" | "sepia" | "edgedetect" | "emboss" | "blurgaussian" | "blurselective" | "meanremoval";
|
|
15
|
+
brightness: number;
|
|
16
|
+
contrast: number;
|
|
17
|
+
colorize: [number, number, number];
|
|
18
|
+
smooth: number;
|
|
19
|
+
zoom: number;
|
|
20
|
+
quality: number;
|
|
21
|
+
allow_lossy: 1;
|
|
22
|
+
strip: "all" | "none";
|
|
23
|
+
}>;
|
|
24
|
+
type WordpressOptions = BaseLoaderOptions<WordpressTransforms>;
|
|
25
|
+
type WordpressGlobalOptions = BaseGlobalLoaderOptions<WordpressTransforms>;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/loaders/wordpress/wordpress-loader.d.ts
|
|
28
|
+
declare const useWordpressContext: () => WordpressGlobalOptions, WordpressLoaderProvider: ({
|
|
29
|
+
children,
|
|
30
|
+
...props
|
|
31
|
+
}: {
|
|
32
|
+
children: React.ReactNode;
|
|
33
|
+
} & Partial<WordpressGlobalOptions>) => react_jsx_runtime3.JSX.Element, useWordpressLoader: (options?: WordpressGlobalOptions | undefined) => (() => undefined) | ((imageOptions: ImageLoaderOptions) => string);
|
|
34
|
+
//#endregion
|
|
35
|
+
export { WordpressGlobalOptions, WordpressLoaderProvider, WordpressOptions, WordpressTransforms, useWordpressContext, useWordpressLoader };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { t as loaderFactory } from "./loader-factory-6EOKnqj1.js";
|
|
2
|
+
|
|
3
|
+
//#region src/loaders/wordpress/wordpress-loader.tsx
|
|
4
|
+
const { useLoaderContext: useWordpressContext, LoaderProvider: WordpressLoaderProvider, useLoader: useWordpressLoader } = loaderFactory({
|
|
5
|
+
transforms: { format: "webp" },
|
|
6
|
+
placeholder: {
|
|
7
|
+
quality: 10,
|
|
8
|
+
format: "webp"
|
|
9
|
+
}
|
|
10
|
+
}, {
|
|
11
|
+
optionSeparator: "=",
|
|
12
|
+
paramSeparator: "&",
|
|
13
|
+
arrayItemSeparator: ",",
|
|
14
|
+
widthKey: "w",
|
|
15
|
+
heightKey: "h",
|
|
16
|
+
passBooleanValue: true,
|
|
17
|
+
customResolver: {}
|
|
18
|
+
}, ({ path, params, imageOptions }) => `${path}/${imageOptions.src}?${params}`);
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { WordpressLoaderProvider, useWordpressContext, useWordpressLoader };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lonik/oh-image",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.6.0",
|
|
5
5
|
"description": "A React component library for optimized image handling.",
|
|
6
6
|
"author": "Luka Onikadze <lukonik@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -44,6 +44,14 @@
|
|
|
44
44
|
"types": "./dist/contentful.d.ts",
|
|
45
45
|
"default": "./dist/contentful.js"
|
|
46
46
|
},
|
|
47
|
+
"./wordpress": {
|
|
48
|
+
"types": "./dist/wordpress.d.ts",
|
|
49
|
+
"default": "./dist/wordpress.js"
|
|
50
|
+
},
|
|
51
|
+
"./netlify": {
|
|
52
|
+
"types": "./dist/netlify.d.ts",
|
|
53
|
+
"default": "./dist/netlify.js"
|
|
54
|
+
},
|
|
47
55
|
"./client": {
|
|
48
56
|
"types": "./dist/client.d.ts"
|
|
49
57
|
}
|
|
File without changes
|