spoko-design-system 0.2.76 → 0.2.78
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/index.ts +0 -3
- package/package.json +13 -13
- package/.env.example +0 -3
- package/src/utils/getData.ts +0 -56
- package/src/utils/getEnvVariable.ts +0 -15
package/index.ts
CHANGED
|
@@ -58,11 +58,8 @@ export { default as getShorterDescription } from './src/utils/seo/getShorterDesc
|
|
|
58
58
|
// Utils: Text
|
|
59
59
|
|
|
60
60
|
export { getTranslation, text2paragraphs, countWords, firstSentence, removeSemicolon } from './src/utils/text';
|
|
61
|
-
export { apiInfo, getData } from './src/utils/getData';
|
|
62
61
|
export { default as formatDate } from './src/utils/text/formatDate';
|
|
63
62
|
export { default as formatLocaleNumber } from './src/utils/text/formatLocaleNumber';
|
|
64
63
|
export { default as formatPad } from './src/utils/text/formatPad';
|
|
65
64
|
export { default as getNumberFormatted } from './src/utils/text/getNumberFormatted';
|
|
66
65
|
export { default as getTranslatedLink } from './src/utils/text/getTranslatedLink';
|
|
67
|
-
export { default as getApiCategories } from './src/utils/api/getCategories';
|
|
68
|
-
export { default as getEnvVariable } from './src/utils/getEnvVariable';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spoko-design-system",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.78",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "./index.ts",
|
|
6
6
|
"module": "./index.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"spoko design system"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@algolia/client-search": "^5.14.
|
|
40
|
+
"@algolia/client-search": "^5.14.2",
|
|
41
41
|
"@astrojs/mdx": "^3.1.9",
|
|
42
42
|
"@astrojs/node": "^8.3.4",
|
|
43
43
|
"@astrojs/sitemap": "^3.2.1",
|
|
@@ -67,13 +67,13 @@
|
|
|
67
67
|
"@playform/compress": "^0.1.6",
|
|
68
68
|
"@playform/inline": "github:playform/inline",
|
|
69
69
|
"@types/node": "^22.9.0",
|
|
70
|
-
"@unocss/astro": "^0.64.
|
|
71
|
-
"@unocss/preset-attributify": "^0.64.
|
|
72
|
-
"@unocss/preset-typography": "^0.64.
|
|
73
|
-
"@unocss/preset-uno": "^0.64.
|
|
74
|
-
"@unocss/preset-web-fonts": "^0.64.
|
|
75
|
-
"@unocss/preset-wind": "^0.64.
|
|
76
|
-
"@unocss/reset": "^0.64.
|
|
70
|
+
"@unocss/astro": "^0.64.1",
|
|
71
|
+
"@unocss/preset-attributify": "^0.64.1",
|
|
72
|
+
"@unocss/preset-typography": "^0.64.1",
|
|
73
|
+
"@unocss/preset-uno": "^0.64.1",
|
|
74
|
+
"@unocss/preset-web-fonts": "^0.64.1",
|
|
75
|
+
"@unocss/preset-wind": "^0.64.1",
|
|
76
|
+
"@unocss/reset": "^0.64.1",
|
|
77
77
|
"@vite-pwa/astro": "^0.4.3",
|
|
78
78
|
"@vueuse/core": "^11.2.0",
|
|
79
79
|
"astro-i18next": "1.0.0-beta.21",
|
|
@@ -89,14 +89,14 @@
|
|
|
89
89
|
"i18next-http-backend": "^2.6.2",
|
|
90
90
|
"i18next-vue": "^5.0.0",
|
|
91
91
|
"swiper": "^11.1.14",
|
|
92
|
-
"unocss": "^0.64.
|
|
92
|
+
"unocss": "^0.64.1",
|
|
93
93
|
"vite": "^5.4.11",
|
|
94
|
-
"vue": "^3.5.
|
|
94
|
+
"vue": "^3.5.13"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@unocss/transformer-variant-group": "^0.64.
|
|
97
|
+
"@unocss/transformer-variant-group": "^0.64.1",
|
|
98
98
|
"@vitejs/plugin-vue": "^5.2.0",
|
|
99
|
-
"astro": "^4.16.
|
|
99
|
+
"astro": "^4.16.13",
|
|
100
100
|
"unocss": "^0.60.0"
|
|
101
101
|
},
|
|
102
102
|
"packageManager": "pnpm@9.8.0",
|
package/.env.example
DELETED
package/src/utils/getData.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
const version = (Math.random() + 1).toString(36).substring(7); // random version to refresh cache from Cloudflare
|
|
2
|
-
|
|
3
|
-
interface ApiResponse<T> {
|
|
4
|
-
success: boolean;
|
|
5
|
-
data: T;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function getEnvVariable(key, defaultValue = null) {
|
|
9
|
-
// First we check import.meta.env (for ES6 environments)
|
|
10
|
-
if (typeof import.meta !== 'undefined' && typeof import.meta.env !== 'undefined') {
|
|
11
|
-
return import.meta.env[key] || defaultValue;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// Then check process.env (for Node.js environment)
|
|
15
|
-
if (typeof process !== 'undefined' && typeof process.env !== 'undefined') {
|
|
16
|
-
return process.env[key] || defaultValue;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// If no variable is found, the default value is returned
|
|
20
|
-
return defaultValue;
|
|
21
|
-
}
|
|
22
|
-
const API_URL = getEnvVariable('API_URL', 'https://default-api.com');
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export const apiInfo = (name: string) => {
|
|
26
|
-
return API_URL
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const getData = async <T>(type: string): Promise<T | null> => {
|
|
30
|
-
const API = `${API_URL}${type}?version=${version}`;
|
|
31
|
-
|
|
32
|
-
try {
|
|
33
|
-
const response = await fetch(API);
|
|
34
|
-
|
|
35
|
-
if (!response.ok) {
|
|
36
|
-
console.error(`Request failed with status ${response.status}: ${response.statusText}`);
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const jsonObject: ApiResponse<T> = await response.json();
|
|
41
|
-
|
|
42
|
-
// Return data if API call is successful
|
|
43
|
-
if (jsonObject.success) {
|
|
44
|
-
return jsonObject.data;
|
|
45
|
-
} else {
|
|
46
|
-
console.error('API returned success: false');
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
} catch (error) {
|
|
50
|
-
console.error('Fetch error:', error);
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
export default { apiInfo, getData };
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
|