revine 1.2.0 → 1.2.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/components/Image.d.ts +5 -0
- package/dist/components/Image.d.ts.map +1 -1
- package/dist/components/Image.js +2 -2
- package/dist/runtime/bundler/revinePlugin.d.ts.map +1 -1
- package/dist/runtime/bundler/revinePlugin.js +6 -1
- package/package.json +1 -1
- package/src/components/Image.tsx +8 -2
- package/src/runtime/bundler/revinePlugin.ts +7 -2
- package/template/src/root.tsx +7 -2
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { type ImgHTMLAttributes } from "react";
|
|
2
2
|
type ObjectFit = "contain" | "cover" | "fill" | "none" | "scale-down";
|
|
3
|
+
declare module "react" {
|
|
4
|
+
interface ImgHTMLAttributes<T> {
|
|
5
|
+
fetchpriority?: "high" | "low" | "auto";
|
|
6
|
+
}
|
|
7
|
+
}
|
|
3
8
|
export interface ImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, "src" | "width" | "height" | "placeholder"> {
|
|
4
9
|
/** Image source URL or import (e.g. import logo from './logo.png') */
|
|
5
10
|
src: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../src/components/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE5E,KAAK,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;AAEtE,MAAM,WAAW,UAAW,SAAQ,IAAI,CACtC,iBAAiB,CAAC,gBAAgB,CAAC,EACnC,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,aAAa,CAC3C;IACC,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAC;IACZ,4CAA4C;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAA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O,GAAG,QAAQ,GAAG,aAAa,CAC3C;IACC,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAC;IACZ,4CAA4C;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4DAA4D;IAC5D,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,kEAAkE;IAClE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AAeD,wBAAgB,KAAK,CAAC,EACpB,GAAG,EACH,GAAG,EACH,KAAK,EACL,MAAM,EACN,IAAY,EACZ,SAAmB,EACnB,cAAyB,EACzB,QAAgB,EAChB,WAAW,EACX,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,UAAU,2CAmJZ"}
|
package/dist/components/Image.js
CHANGED
|
@@ -44,7 +44,7 @@ export function Image({ src, alt, width, height, fill = false, objectFit = "cove
|
|
|
44
44
|
backgroundPosition: "center",
|
|
45
45
|
filter: placeholder ? "blur(8px)" : undefined,
|
|
46
46
|
transform: "scale(1.05)",
|
|
47
|
-
} })), !errored ? (_jsx("img", { ref: imgRef, src: src, alt: alt, loading: priority ? "eager" : "lazy", decoding: priority ? "sync" : "async",
|
|
47
|
+
} })), !errored ? (_jsx("img", { ref: imgRef, src: src, alt: alt, loading: priority ? "eager" : "lazy", decoding: priority ? "sync" : "async", fetchpriority: priority ? "high" : "auto", onLoad: () => setLoaded(true), onError: handleError, className: className, style: {
|
|
48
48
|
position: "absolute",
|
|
49
49
|
inset: 0,
|
|
50
50
|
width: "100%",
|
|
@@ -77,7 +77,7 @@ export function Image({ src, alt, width, height, fill = false, objectFit = "cove
|
|
|
77
77
|
backgroundPosition: "center",
|
|
78
78
|
filter: placeholder ? "blur(8px)" : undefined,
|
|
79
79
|
transform: "scale(1.05)",
|
|
80
|
-
} })), !errored ? (_jsx("img", { ref: imgRef, src: src, alt: alt, width: width, height: height, loading: priority ? "eager" : "lazy", decoding: priority ? "sync" : "async",
|
|
80
|
+
} })), !errored ? (_jsx("img", { ref: imgRef, src: src, alt: alt, width: width, height: height, loading: priority ? "eager" : "lazy", decoding: priority ? "sync" : "async", fetchpriority: priority ? "high" : "auto", onLoad: () => setLoaded(true), onError: handleError, className: className, style: {
|
|
81
81
|
display: "block",
|
|
82
82
|
width: "100%",
|
|
83
83
|
height: "100%",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revinePlugin.d.ts","sourceRoot":"","sources":["../../../src/runtime/bundler/revinePlugin.ts"],"names":[],"mappings":"AA2VA,wBAAgB,YAAY,IAAI,GAAG,
|
|
1
|
+
{"version":3,"file":"revinePlugin.d.ts","sourceRoot":"","sources":["../../../src/runtime/bundler/revinePlugin.ts"],"names":[],"mappings":"AA2VA,wBAAgB,YAAY,IAAI,GAAG,CA6IlC"}
|
|
@@ -461,7 +461,12 @@ routes.push({
|
|
|
461
461
|
errorElement: createElement(RevineErrorDialog),
|
|
462
462
|
});
|
|
463
463
|
|
|
464
|
-
export const router = createBrowserRouter(routes
|
|
464
|
+
export const router = createBrowserRouter(routes, {
|
|
465
|
+
future: {
|
|
466
|
+
v7_startTransition: true,
|
|
467
|
+
v7_relativeSplatPath: true,
|
|
468
|
+
},
|
|
469
|
+
});
|
|
465
470
|
`;
|
|
466
471
|
}
|
|
467
472
|
},
|
package/package.json
CHANGED
package/src/components/Image.tsx
CHANGED
|
@@ -2,6 +2,12 @@ import { useEffect, useRef, useState, type ImgHTMLAttributes } from "react";
|
|
|
2
2
|
|
|
3
3
|
type ObjectFit = "contain" | "cover" | "fill" | "none" | "scale-down";
|
|
4
4
|
|
|
5
|
+
declare module "react" {
|
|
6
|
+
interface ImgHTMLAttributes<T> {
|
|
7
|
+
fetchpriority?: "high" | "low" | "auto";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
5
11
|
export interface ImageProps extends Omit<
|
|
6
12
|
ImgHTMLAttributes<HTMLImageElement>,
|
|
7
13
|
"src" | "width" | "height" | "placeholder"
|
|
@@ -126,7 +132,7 @@ export function Image({
|
|
|
126
132
|
alt={alt}
|
|
127
133
|
loading={priority ? "eager" : "lazy"}
|
|
128
134
|
decoding={priority ? "sync" : "async"}
|
|
129
|
-
|
|
135
|
+
fetchpriority={priority ? "high" : "auto"}
|
|
130
136
|
onLoad={() => setLoaded(true)}
|
|
131
137
|
onError={handleError}
|
|
132
138
|
className={className}
|
|
@@ -196,7 +202,7 @@ export function Image({
|
|
|
196
202
|
height={height}
|
|
197
203
|
loading={priority ? "eager" : "lazy"}
|
|
198
204
|
decoding={priority ? "sync" : "async"}
|
|
199
|
-
|
|
205
|
+
fetchpriority={priority ? "high" : "auto"}
|
|
200
206
|
onLoad={() => setLoaded(true)}
|
|
201
207
|
onError={handleError}
|
|
202
208
|
className={className}
|
|
@@ -476,9 +476,14 @@ routes.push({
|
|
|
476
476
|
errorElement: createElement(RevineErrorDialog),
|
|
477
477
|
});
|
|
478
478
|
|
|
479
|
-
export const router = createBrowserRouter(routes
|
|
479
|
+
export const router = createBrowserRouter(routes, {
|
|
480
|
+
future: {
|
|
481
|
+
v7_startTransition: true,
|
|
482
|
+
v7_relativeSplatPath: true,
|
|
483
|
+
},
|
|
484
|
+
});
|
|
480
485
|
`;
|
|
481
486
|
}
|
|
482
487
|
},
|
|
483
488
|
};
|
|
484
|
-
}
|
|
489
|
+
}
|
package/template/src/root.tsx
CHANGED