@ui5/webcomponents-base 1.3.1 → 1.4.0
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/CHANGELOG.md +12 -0
- package/dist/asset-registries/Themes.js +6 -2
- package/dist/css/BusyIndicator.css +4 -0
- package/dist/css/FontFace.css +16 -16
- package/dist/features/F6Navigation.js +0 -2
- package/dist/generated/VersionInfo.js +4 -4
- package/dist/generated/css/BusyIndicator.css.js +1 -1
- package/dist/generated/css/FontFace.css.js +1 -1
- package/dist/resources/bundle.esm.js +8 -8
- package/dist/resources/bundle.esm.js.map +1 -1
- package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +1 -1
- package/dist/test-resources/specs/Theming.spec.js +11 -0
- package/hash.txt +1 -1
- package/lib/generate-asset-parameters/index.js +8 -4
- package/lib/generate-styles/index.js +17 -9
- package/lib/generate-version-info/index.js +18 -13
- package/package-scripts.js +1 -5
- package/package.json +5 -5
- package/src/asset-registries/Themes.js +6 -2
- package/src/css/BusyIndicator.css +4 -0
- package/src/css/FontFace.css +16 -16
- package/src/features/F6Navigation.js +0 -2
|
@@ -1989,7 +1989,7 @@ if (typeof window !== 'undefined') {
|
|
|
1989
1989
|
}
|
|
1990
1990
|
/*!
|
|
1991
1991
|
* OpenUI5
|
|
1992
|
-
* (c) Copyright 2009-
|
|
1992
|
+
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
1993
1993
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
1994
1994
|
*/
|
|
1995
1995
|
// Based on coding from the HTML4 Sanitizer by Google Inc.
|
|
@@ -30,4 +30,15 @@ describe("Theming works", () => {
|
|
|
30
30
|
assert.strictEqual(res, true, "Theme parameters changed");
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
+
it("Tests fallback to default theme when setting unknown theme", async () => {
|
|
34
|
+
const unknownTheme = 'sap_unknown_theme';
|
|
35
|
+
await browser.url(`http://localhost:9191/test-resources/pages/AllTestElements.html?sap-ui-theme=${unknownTheme}`);
|
|
36
|
+
|
|
37
|
+
const res = await browser.executeAsync( async (done) => {
|
|
38
|
+
const cssVarValue = getComputedStyle(document.documentElement).getPropertyValue('--var1');
|
|
39
|
+
done(cssVarValue);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
assert.strictEqual(res, ' red', "Default theme parameters loaded");
|
|
43
|
+
});
|
|
33
44
|
});
|
package/hash.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
XeoUDYYqmjUwnJg4dGNgbPltSMo=
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const mkdirp = require('mkdirp');
|
|
1
|
+
const fs = require('fs').promises;
|
|
3
2
|
const assets = require('@ui5/webcomponents-tools/assets-meta.js');
|
|
4
3
|
|
|
5
4
|
const fileContent = `const assetParameters = ${JSON.stringify(assets)};
|
|
@@ -16,6 +15,11 @@ export {
|
|
|
16
15
|
SUPPORTED_LOCALES,
|
|
17
16
|
};`;
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
fs.
|
|
18
|
+
const generate = async () => {
|
|
19
|
+
await fs.mkdir("dist/generated/", { recursive: true });
|
|
20
|
+
return fs.writeFile("dist/generated/AssetParameters.js", fileContent);
|
|
21
|
+
}
|
|
21
22
|
|
|
23
|
+
generate().then(() => {
|
|
24
|
+
console.log("Assets parameters generated.");
|
|
25
|
+
});
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
1
|
+
const fs = require('fs').promises;
|
|
2
2
|
const path = require('path');
|
|
3
|
-
const mkdirp = require('mkdirp');
|
|
4
3
|
const CleanCSS = require('clean-css');
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
fs.
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
5
|
+
const generate = async () => {
|
|
6
|
+
await fs.mkdir("dist/generated/css/");
|
|
7
|
+
|
|
8
|
+
const files = (await fs.readdir("src/css/")).filter(file => file.endsWith(".css"));
|
|
9
|
+
const filesPromises = files.map(async file => {
|
|
10
|
+
let content = await fs.readFile(path.join("src/css/", file));
|
|
11
|
+
const res = new CleanCSS().minify(`${content}`);
|
|
12
|
+
content = `export default {
|
|
11
13
|
packageName: "@ui5/webcomponents-base",
|
|
12
14
|
fileName: "${file}",
|
|
13
15
|
content: \`${res.styles}\`
|
|
14
16
|
};`;
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
});
|
|
18
|
+
return fs.writeFile(path.join("dist/generated/css/", `${file}.js`), content);
|
|
19
|
+
});
|
|
18
20
|
|
|
21
|
+
return Promise.all(filesPromises);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
generate().then(() => {
|
|
25
|
+
console.log("Styles files generated.");
|
|
26
|
+
});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const mkdirp = require('mkdirp');
|
|
1
|
+
const fs = require('fs').promises;
|
|
3
2
|
|
|
4
|
-
const
|
|
3
|
+
const generate = async () => {
|
|
4
|
+
const version = JSON.parse(await fs.readFile("package.json")).version;
|
|
5
5
|
|
|
6
|
-
// Parse version
|
|
7
|
-
const matches = version.match(/^([0-9]+)\.([0-9]+)\.([0-9]+)(.*)$/);
|
|
8
|
-
if (!matches) {
|
|
9
|
-
|
|
10
|
-
}
|
|
6
|
+
// Parse version
|
|
7
|
+
const matches = version.match(/^([0-9]+)\.([0-9]+)\.([0-9]+)(.*)$/);
|
|
8
|
+
if (!matches) {
|
|
9
|
+
throw new Error("Unsupported version format");
|
|
10
|
+
}
|
|
11
11
|
|
|
12
|
-
const isNext = version.match(/[a-f0-9]{9}$/);
|
|
13
|
-
const buildTime = Math.floor(new Date().getTime() / 1000);
|
|
12
|
+
const isNext = version.match(/[a-f0-9]{9}$/);
|
|
13
|
+
const buildTime = Math.floor(new Date().getTime() / 1000);
|
|
14
14
|
|
|
15
|
-
const fileContent = `const VersionInfo = {
|
|
15
|
+
const fileContent = `const VersionInfo = {
|
|
16
16
|
version: "${version}",
|
|
17
17
|
major: ${matches[1]},
|
|
18
18
|
minor: ${matches[2]},
|
|
@@ -23,5 +23,10 @@ const fileContent = `const VersionInfo = {
|
|
|
23
23
|
};
|
|
24
24
|
export default VersionInfo;`;
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
fs.
|
|
26
|
+
await fs.mkdir("dist/generated/", { recursive: true });
|
|
27
|
+
await fs.writeFile("dist/generated/VersionInfo.js", fileContent);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
generate().then(() => {
|
|
31
|
+
console.log("Version info file generated.");
|
|
32
|
+
});
|
package/package-scripts.js
CHANGED
|
@@ -4,11 +4,8 @@ const assetParametersScript = resolve.sync("@ui5/webcomponents-base/lib/generate
|
|
|
4
4
|
const stylesScript = resolve.sync("@ui5/webcomponents-base/lib/generate-styles/index.js");
|
|
5
5
|
const versionScript = resolve.sync("@ui5/webcomponents-base/lib/generate-version-info/index.js");
|
|
6
6
|
const serve = resolve.sync("@ui5/webcomponents-tools/lib/serve/index.js");
|
|
7
|
-
const generateHash = resolve.sync("@ui5/webcomponents-tools/lib/hash/generate.js");
|
|
8
|
-
const hashIsUpToDate = resolve.sync("@ui5/webcomponents-tools/lib/hash/upToDate.js");
|
|
9
7
|
const copyUsedModules = resolve.sync("@ui5/webcomponents-tools/lib/copy-list/index.js");
|
|
10
8
|
const esmAbsToRel = resolve.sync("@ui5/webcomponents-tools/lib/esm-abs-to-rel/index.js");
|
|
11
|
-
const UP_TO_DATE = `node "${hashIsUpToDate}" dist/ hash.txt && echo "Up to date."`;
|
|
12
9
|
|
|
13
10
|
const scripts = {
|
|
14
11
|
clean: "rimraf dist && rimraf .port",
|
|
@@ -27,7 +24,7 @@ const scripts = {
|
|
|
27
24
|
},
|
|
28
25
|
},
|
|
29
26
|
build: {
|
|
30
|
-
default:
|
|
27
|
+
default: `nps lint prepare build.bundle`,
|
|
31
28
|
bundle: "rollup --config config/rollup.config.js",
|
|
32
29
|
},
|
|
33
30
|
copy: {
|
|
@@ -53,7 +50,6 @@ const scripts = {
|
|
|
53
50
|
default: 'concurrently "nps serve" "nps test.run" --kill-others --success first',
|
|
54
51
|
run: "cross-env WDIO_LOG_LEVEL=error FORCE_COLOR=0 wdio config/wdio.conf.js",
|
|
55
52
|
},
|
|
56
|
-
hash: `node "${generateHash}" dist/ hash.txt`,
|
|
57
53
|
};
|
|
58
54
|
|
|
59
55
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents-base",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "UI5 Web Components: webcomponents.base",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"start": "nps start",
|
|
29
29
|
"build": "nps build",
|
|
30
30
|
"test": "nps test",
|
|
31
|
-
"hash": "nps hash",
|
|
32
31
|
"prepublishOnly": "npm run clean && npm run build"
|
|
33
32
|
},
|
|
34
33
|
"dependencies": {
|
|
@@ -36,11 +35,12 @@
|
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
38
37
|
"@buxlabs/amd-to-es6": "0.16.1",
|
|
39
|
-
"@openui5/sap.ui.core": "1.
|
|
40
|
-
"@ui5/webcomponents-tools": "1.
|
|
41
|
-
"chromedriver": "
|
|
38
|
+
"@openui5/sap.ui.core": "1.101.0",
|
|
39
|
+
"@ui5/webcomponents-tools": "1.4.0",
|
|
40
|
+
"chromedriver": "101.0.0",
|
|
42
41
|
"clean-css": "^5.2.2",
|
|
43
42
|
"copy-and-watch": "^0.1.5",
|
|
43
|
+
"cross-env": "^7.0.3",
|
|
44
44
|
"eslint": "^7.22.0",
|
|
45
45
|
"mkdirp": "^1.0.4",
|
|
46
46
|
"resolve": "^1.20.0"
|
|
@@ -38,10 +38,14 @@ const getThemeProperties = async (packageName, themeName) => {
|
|
|
38
38
|
|
|
39
39
|
if (!registeredThemes.has(themeName)) {
|
|
40
40
|
const regThemesStr = [...registeredThemes.values()].join(", ");
|
|
41
|
-
console.warn(`You have requested a non-registered theme - falling back to ${DEFAULT_THEME}. Registered themes are: ${regThemesStr}`); /* eslint-disable-line */
|
|
42
|
-
return
|
|
41
|
+
console.warn(`You have requested a non-registered theme ${themeName} - falling back to ${DEFAULT_THEME}. Registered themes are: ${regThemesStr}`); /* eslint-disable-line */
|
|
42
|
+
return _getThemeProperties(packageName, DEFAULT_THEME);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
return _getThemeProperties(packageName, themeName);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const _getThemeProperties = async (packageName, themeName) => {
|
|
45
49
|
const loader = loaders.get(`${packageName}/${themeName}`);
|
|
46
50
|
if (!loader) {
|
|
47
51
|
// no themes for package
|
package/src/css/FontFace.css
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
font-style: normal;
|
|
4
4
|
font-weight: 400;
|
|
5
5
|
src: local("72"),
|
|
6
|
-
url(https://ui5.sap.com/
|
|
7
|
-
url(https://ui5.sap.com/
|
|
6
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Regular.woff2?ui5-webcomponents) format("woff2"),
|
|
7
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Regular.woff?ui5-webcomponents) format("woff");
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
@font-face {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
font-style: normal;
|
|
13
13
|
font-weight: 400;
|
|
14
14
|
src: local('72-full'),
|
|
15
|
-
url(https://ui5.sap.com/
|
|
16
|
-
url(https://ui5.sap.com/
|
|
15
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Regular-full.woff2?ui5-webcomponents) format("woff2"),
|
|
16
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Regular-full.woff?ui5-webcomponents) format("woff");
|
|
17
17
|
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
font-style: normal;
|
|
23
23
|
font-weight: 700;
|
|
24
24
|
src: local('72-Bold'),
|
|
25
|
-
url(https://ui5.sap.com/
|
|
26
|
-
url(https://ui5.sap.com/
|
|
25
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold.woff2?ui5-webcomponents) format("woff2"),
|
|
26
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold.woff?ui5-webcomponents) format("woff");
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
@font-face {
|
|
@@ -31,38 +31,38 @@
|
|
|
31
31
|
font-style: normal;
|
|
32
32
|
font-weight: 700;
|
|
33
33
|
src: local('72-Bold-full'),
|
|
34
|
-
url(https://ui5.sap.com/
|
|
35
|
-
url(https://ui5.sap.com/
|
|
34
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold-full.woff2?ui5-webcomponents) format("woff2"),
|
|
35
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold-full.woff?ui5-webcomponents) format("woff");
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
@font-face {
|
|
39
39
|
font-family: '72-Bold';
|
|
40
40
|
font-style: normal;
|
|
41
41
|
src: local('72-Bold'),
|
|
42
|
-
url(https://ui5.sap.com/
|
|
43
|
-
url(https://ui5.sap.com/
|
|
42
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold.woff2?ui5-webcomponents) format("woff2"),
|
|
43
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold.woff?ui5-webcomponents) format("woff");
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
@font-face {
|
|
47
47
|
font-family: '72-Boldfull';
|
|
48
48
|
font-style: normal;
|
|
49
|
-
src: url(https://ui5.sap.com/
|
|
50
|
-
url(https://ui5.sap.com/
|
|
49
|
+
src: url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold-full.woff2?ui5-webcomponents) format("woff2"),
|
|
50
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold-full.woff?ui5-webcomponents) format("woff");
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
@font-face {
|
|
54
54
|
font-family: '72-Light';
|
|
55
55
|
font-style: normal;
|
|
56
56
|
src: local('72-Light'),
|
|
57
|
-
url(https://ui5.sap.com/
|
|
58
|
-
url(https://ui5.sap.com/
|
|
57
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light.woff2?ui5-webcomponents) format("woff2"),
|
|
58
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light.woff?ui5-webcomponents) format("woff");
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
@font-face {
|
|
62
62
|
font-family: '72-Lightfull';
|
|
63
63
|
font-style: normal;
|
|
64
|
-
src: url(https://ui5.sap.com/
|
|
65
|
-
url(https://ui5.sap.com/
|
|
64
|
+
src: url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light-full.woff2?ui5-webcomponents) format("woff2"),
|
|
65
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light-full.woff?ui5-webcomponents) format("woff");
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
@font-face {
|