@websline/cms-view-utils 1.2.6 → 1.2.8
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/package.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
let {
|
|
5
5
|
class: className,
|
|
6
6
|
decoding = "async",
|
|
7
|
+
fetchpriority = "auto",
|
|
7
8
|
image,
|
|
8
9
|
loading = "lazy",
|
|
9
10
|
sources = {},
|
|
@@ -78,12 +79,13 @@
|
|
|
78
79
|
{/each}
|
|
79
80
|
|
|
80
81
|
<img
|
|
81
|
-
src={data.fallbackSrc}
|
|
82
82
|
alt={data.alt}
|
|
83
|
-
|
|
83
|
+
class={tw("h-full w-full object-cover", className)}
|
|
84
|
+
{decoding}
|
|
85
|
+
{fetchpriority}
|
|
84
86
|
height={data.fallbackFormat.height}
|
|
85
87
|
{loading}
|
|
86
|
-
{
|
|
87
|
-
|
|
88
|
+
src={data.fallbackSrc}
|
|
89
|
+
width={data.fallbackFormat.width} />
|
|
88
90
|
</picture>
|
|
89
91
|
{/if}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Default request filter — skips
|
|
3
|
-
*
|
|
2
|
+
* Default request filter — skips internal Astro routes, error routes
|
|
3
|
+
* and asset paths (by file extension).
|
|
4
4
|
*
|
|
5
5
|
* @param {object} [options]
|
|
6
6
|
* @param {string[]} [options.additionalExcludePaths] - extra path prefixes to skip
|
|
@@ -12,10 +12,7 @@ const withRequestFilter = (options = {}) => {
|
|
|
12
12
|
|
|
13
13
|
return (context) => {
|
|
14
14
|
const { request, url } = context;
|
|
15
|
-
const accept = request.headers.get("accept") || "";
|
|
16
15
|
|
|
17
|
-
const isHtmlRequest =
|
|
18
|
-
accept === "" || accept.includes("text/html") || accept.includes("*/*");
|
|
19
16
|
const isAstroInternal = url.pathname.startsWith("/_astro");
|
|
20
17
|
const isErrorRoute = url.pathname.startsWith("/errors/");
|
|
21
18
|
const hasFileExtension = /\.[a-zA-Z0-9]+$/.test(url.pathname);
|
|
@@ -25,7 +22,6 @@ const withRequestFilter = (options = {}) => {
|
|
|
25
22
|
|
|
26
23
|
return (
|
|
27
24
|
request.method !== "GET" ||
|
|
28
|
-
!isHtmlRequest ||
|
|
29
25
|
isAstroInternal ||
|
|
30
26
|
isErrorRoute ||
|
|
31
27
|
hasFileExtension ||
|