vatts 1.1.4-alpha.5 → 1.1.4-alpha.7
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/client/image/Image.js +11 -1
- package/package.json +1 -1
|
@@ -8,9 +8,19 @@ const Image = ({ src, width, height, quality = 75, priority = false, className,
|
|
|
8
8
|
return window.location.origin;
|
|
9
9
|
}
|
|
10
10
|
const baseUrl = getBaseUrl();
|
|
11
|
+
console.log(baseUrl);
|
|
11
12
|
// Se a imagem for Base64 (pequena) ou externa (http), não otimizamos via backend local
|
|
12
13
|
const isOptimizable = src && src.startsWith && !src.startsWith('data:') && ((baseUrl && src.startsWith(baseUrl)) || !src.startsWith('http'));
|
|
13
|
-
|
|
14
|
+
function optimizeSrc(src, baseUrl) {
|
|
15
|
+
if (!baseUrl)
|
|
16
|
+
return src;
|
|
17
|
+
if (src.startsWith(baseUrl)) {
|
|
18
|
+
return src.slice(baseUrl.length) || '/';
|
|
19
|
+
}
|
|
20
|
+
return src;
|
|
21
|
+
}
|
|
22
|
+
let optimizedSrc = optimizeSrc(src, baseUrl);
|
|
23
|
+
console.log(optimizedSrc);
|
|
14
24
|
if (isOptimizable) {
|
|
15
25
|
const params = new URLSearchParams();
|
|
16
26
|
params.set('url', src);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vatts",
|
|
3
|
-
"version": "1.1.4-alpha.
|
|
3
|
+
"version": "1.1.4-alpha.7",
|
|
4
4
|
"description": "Vatts.js is a high-level framework for building web applications with ease and speed. It provides a robust set of tools and features to streamline development and enhance productivity.",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"author": "itsmuzin",
|