@appsemble/utils 0.40.4 → 0.40.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.
- package/README.md +3 -3
- package/package.json +4 -4
- package/theme.js +9 -3
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#  Appsemble Utilities
|
|
2
2
|
|
|
3
3
|
> Internal utility functions used across multiple Appsemble projects.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@appsemble/utils)
|
|
6
|
-
[](https://gitlab.com/appsemble/appsemble/-/releases/0.40.6)
|
|
7
7
|
[](https://prettier.io)
|
|
8
8
|
|
|
9
9
|
## Table of Contents
|
|
@@ -26,5 +26,5 @@ not guaranteed.
|
|
|
26
26
|
|
|
27
27
|
## License
|
|
28
28
|
|
|
29
|
-
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.40.
|
|
29
|
+
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.40.6/LICENSE.md) ©
|
|
30
30
|
[Appsemble](https://appsemble.com)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsemble/utils",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.6",
|
|
4
4
|
"description": "Utility functions used in Appsemble internally",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"test": "vitest"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@appsemble/lang-sdk": "0.40.
|
|
42
|
-
"@appsemble/types": "0.40.
|
|
41
|
+
"@appsemble/lang-sdk": "0.40.6",
|
|
42
|
+
"@appsemble/types": "0.40.6",
|
|
43
43
|
"@fortawesome/fontawesome-common-types": "^6.0.0",
|
|
44
44
|
"axios": "^1.0.0",
|
|
45
45
|
"langmap": "^0.0.16",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@types/langmap": "0.0.3",
|
|
52
52
|
"bulma": "=0.9.4",
|
|
53
53
|
"koas-core": "0.7.0",
|
|
54
|
-
"vitest": "4.1.
|
|
54
|
+
"vitest": "4.1.12"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=24"
|
package/theme.js
CHANGED
|
@@ -6,9 +6,11 @@ import { baseTheme } from '@appsemble/lang-sdk';
|
|
|
6
6
|
* @returns A combination of all themes.
|
|
7
7
|
*/
|
|
8
8
|
export function mergeThemes(...themes) {
|
|
9
|
-
var _a;
|
|
10
9
|
const result = Object.assign({}, baseTheme, ...themes);
|
|
11
|
-
|
|
10
|
+
result.font = { ...result.font, source: result.font.source || 'google' };
|
|
11
|
+
if (result.displayFont) {
|
|
12
|
+
result.displayFont = { ...result.displayFont, source: result.displayFont.source || 'google' };
|
|
13
|
+
}
|
|
12
14
|
return result;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
@@ -18,11 +20,15 @@ export function mergeThemes(...themes) {
|
|
|
18
20
|
* @returns The URL to the Bulma theme.
|
|
19
21
|
*/
|
|
20
22
|
export function createThemeURL(theme) {
|
|
21
|
-
const { font, ...rest } = theme;
|
|
23
|
+
const { displayFont, font, ...rest } = theme;
|
|
22
24
|
const params = new URLSearchParams({
|
|
23
25
|
...rest,
|
|
24
26
|
fontFamily: font.family,
|
|
25
27
|
fontSource: font.source ?? '',
|
|
28
|
+
...(displayFont && {
|
|
29
|
+
displayFontFamily: displayFont.family,
|
|
30
|
+
displayFontSource: displayFont.source ?? '',
|
|
31
|
+
}),
|
|
26
32
|
});
|
|
27
33
|
// Sort for cacheability.
|
|
28
34
|
params.sort();
|