vatts 1.1.4-alpha.4 → 1.1.4-alpha.6

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.
@@ -292,7 +292,6 @@ function initializeClient() {
292
292
  const root = (0, client_1.createRoot)(container);
293
293
  // Salva a referência globalmente
294
294
  window.__VATTS_ROOT__ = root;
295
- console.log(componentMap, initialData);
296
295
  root.render((0, jsx_runtime_1.jsx)(App, { componentMap: componentMap, routes: initialData.routes, initialComponentPath: initialData.initialComponentPath, initialParams: initialData.initialParams, layoutComponent: window.__VATTS_LAYOUT__ }));
297
296
  }
298
297
  catch (error) {
@@ -2,10 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const jsx_runtime_1 = require("react/jsx-runtime");
4
4
  const Image = ({ src, width, height, quality = 75, priority = false, className, style, alt = "", ...props }) => {
5
- console.log("Imagem: ", src);
5
+ function getBaseUrl() {
6
+ if (typeof window === "undefined")
7
+ return null;
8
+ return window.location.origin;
9
+ }
10
+ const baseUrl = getBaseUrl();
11
+ console.log(baseUrl);
6
12
  // Se a imagem for Base64 (pequena) ou externa (http), não otimizamos via backend local
7
- const isOptimizable = src && src.startsWith && !src.startsWith('data:') && !src.startsWith('http');
8
- let optimizedSrc = src;
13
+ const isOptimizable = src && src.startsWith && !src.startsWith('data:') && ((baseUrl && src.startsWith(baseUrl)) || !src.startsWith('http'));
14
+ let optimizedSrc = baseUrl ? (src.includes(baseUrl) ? src.replace(baseUrl, '/') : src) : src;
9
15
  if (isOptimizable) {
10
16
  const params = new URLSearchParams();
11
17
  params.set('url', src);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vatts",
3
- "version": "1.1.4-alpha.4",
3
+ "version": "1.1.4-alpha.6",
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",