spoko-design-system 0.2.70 → 0.2.71
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spoko-design-system",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.71",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "./index.ts",
|
|
6
6
|
"module": "./index.ts",
|
|
@@ -90,12 +90,12 @@
|
|
|
90
90
|
"i18next-vue": "^5.0.0",
|
|
91
91
|
"swiper": "^11.1.14",
|
|
92
92
|
"unocss": "^0.64.0",
|
|
93
|
-
"vite": "^5.4.
|
|
93
|
+
"vite": "^5.4.11",
|
|
94
94
|
"vue": "^3.5.12"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
97
|
"@unocss/transformer-variant-group": "^0.64.0",
|
|
98
|
-
"@vitejs/plugin-vue": "^5.1.
|
|
98
|
+
"@vitejs/plugin-vue": "^5.1.5",
|
|
99
99
|
"astro": "^4.16.10",
|
|
100
100
|
"unocss": "^0.60.0"
|
|
101
101
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { Image } from 'astro:assets'
|
|
3
|
-
|
|
3
|
+
import getEnvVariable from "./../../utils/getEnvVariable";
|
|
4
|
+
const API_URL = getEnvVariable('API_URL', 'https://default-api.com');
|
|
4
5
|
interface ImageObject {
|
|
5
6
|
src: string;
|
|
6
7
|
alt?: string;
|
|
@@ -12,7 +13,7 @@ interface ImageObject {
|
|
|
12
13
|
index?: number;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
const { imageObject
|
|
16
|
+
const { imageObject } = Astro.props as { imageObject: ImageObject; };
|
|
16
17
|
|
|
17
18
|
let inputProps = {};
|
|
18
19
|
|
|
@@ -28,7 +29,7 @@ if (imageObject.srcset && imageObject.srcset.length) {
|
|
|
28
29
|
|
|
29
30
|
---
|
|
30
31
|
<Image
|
|
31
|
-
src={`${
|
|
32
|
+
src={`${API_URL}${imageObject.src}`}
|
|
32
33
|
alt={imageObject.alt}
|
|
33
34
|
height={imageObject.height}
|
|
34
35
|
width={imageObject.width}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function getEnvVariable(key, defaultValue = null) {
|
|
2
|
+
// First we check import.meta.env (for ES6 environments)
|
|
3
|
+
if (typeof import.meta !== 'undefined' && typeof import.meta.env !== 'undefined') {
|
|
4
|
+
return import.meta.env[key] || defaultValue;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// Then check process.env (for Node.js environment)
|
|
8
|
+
if (typeof process !== 'undefined' && typeof process.env !== 'undefined') {
|
|
9
|
+
return process.env[key] || defaultValue;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// If no variable is found, the default value is returned
|
|
13
|
+
return defaultValue;
|
|
14
|
+
}
|
|
15
|
+
|