@lonik/oh-image 2.1.0 → 2.1.1
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/react.d.ts +2 -2
- package/dist/react.js +4 -4
- package/package.json +1 -1
package/dist/react.d.ts
CHANGED
|
@@ -451,7 +451,7 @@ type ImgproxyOptions = BaseLoaderOptions<ImgproxyTransforms>;
|
|
|
451
451
|
type ImgproxyGlobalOptions = BaseGlobalLoaderOptions<ImgproxyTransforms>;
|
|
452
452
|
//#endregion
|
|
453
453
|
//#region src/react/loaders/imgproxy/use-imgproxy-loader.d.ts
|
|
454
|
-
declare function useImgproxyLoader(options
|
|
454
|
+
declare function useImgproxyLoader(options?: ImgproxyOptions): (imageOptions: ImageLoaderOptions) => string;
|
|
455
455
|
//#endregion
|
|
456
456
|
//#region src/react/loaders/imgproxy/imgproxy-context.d.ts
|
|
457
457
|
declare function useImgproxyContext(): ImgproxyGlobalOptions;
|
|
@@ -463,7 +463,7 @@ declare function ImgproxyLoaderProvider({
|
|
|
463
463
|
} & Partial<ImgproxyOptions>): react_jsx_runtime0.JSX.Element;
|
|
464
464
|
//#endregion
|
|
465
465
|
//#region src/react/loaders/imgproxy/use-imgproxy-placeholder.d.ts
|
|
466
|
-
declare function useImgproxyPlaceholder(options
|
|
466
|
+
declare function useImgproxyPlaceholder(options?: ImgproxyOptions): (imageOptions: ImageLoaderOptions) => string;
|
|
467
467
|
//#endregion
|
|
468
468
|
//#region src/react/loaders/cloudflare-loader.d.ts
|
|
469
469
|
interface CloudflareLoaderOptions {
|
package/dist/react.js
CHANGED
|
@@ -518,10 +518,10 @@ function ImgproxyLoaderProvider({ children, ...props }) {
|
|
|
518
518
|
//#region src/react/loaders/imgproxy/use-imgproxy-loader.tsx
|
|
519
519
|
function useImgproxyLoader(options) {
|
|
520
520
|
const context = useImgproxyContext();
|
|
521
|
-
const path = options
|
|
521
|
+
const path = options?.path || context.path;
|
|
522
522
|
const transforms = {
|
|
523
523
|
...context.transforms,
|
|
524
|
-
...options
|
|
524
|
+
...options?.transforms
|
|
525
525
|
};
|
|
526
526
|
return (imageOptions) => createImgproxyUrl(path, transforms, imageOptions);
|
|
527
527
|
}
|
|
@@ -530,10 +530,10 @@ function useImgproxyLoader(options) {
|
|
|
530
530
|
//#region src/react/loaders/imgproxy/use-imgproxy-placeholder.tsx
|
|
531
531
|
function useImgproxyPlaceholder(options) {
|
|
532
532
|
const context = useImgproxyContext();
|
|
533
|
-
const path = options
|
|
533
|
+
const path = options?.path || context.path;
|
|
534
534
|
const transforms = {
|
|
535
535
|
...context.placeholderTransforms,
|
|
536
|
-
...options
|
|
536
|
+
...options?.transforms
|
|
537
537
|
};
|
|
538
538
|
return (imageOptions) => createImgproxyUrl(path, transforms, imageOptions);
|
|
539
539
|
}
|
package/package.json
CHANGED