@ui5/webcomponents-base 2.17.0-rc.5 → 2.17.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/.tsbuildinfobuild +1 -1
- package/dist/InitialConfiguration.d.ts +1 -2
- package/dist/InitialConfiguration.js +1 -6
- package/dist/InitialConfiguration.js.map +1 -1
- package/dist/config/Theme.d.ts +1 -21
- package/dist/config/Theme.js +2 -30
- package/dist/config/Theme.js.map +1 -1
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/generated/css/BusyIndicator.css.d.ts +1 -1
- package/dist/generated/css/BusyIndicator.css.js +1 -1
- package/dist/generated/css/BusyIndicator.css.js.map +1 -1
- package/dist/generated/css/MultipleDragGhost.css.d.ts +1 -1
- package/dist/generated/css/MultipleDragGhost.css.js +1 -1
- package/dist/generated/css/MultipleDragGhost.css.js.map +1 -1
- package/dist/generated/css/ScrollbarStyles.css.d.ts +1 -1
- package/dist/generated/css/ScrollbarStyles.css.js +1 -1
- package/dist/generated/css/ScrollbarStyles.css.js.map +1 -1
- package/dist/generated/css/SystemCSSVars.css.d.ts +1 -1
- package/dist/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/prod/InitialConfiguration.js +1 -1
- package/dist/prod/InitialConfiguration.js.map +3 -3
- package/dist/prod/config/Theme.js +1 -1
- package/dist/prod/config/Theme.js.map +3 -3
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +1 -1
- package/dist/prod/generated/css/BusyIndicator.css.js +1 -1
- package/dist/prod/generated/css/BusyIndicator.css.js.map +1 -1
- package/dist/prod/generated/css/MultipleDragGhost.css.js +1 -1
- package/dist/prod/generated/css/MultipleDragGhost.css.js.map +1 -1
- package/dist/prod/generated/css/ScrollbarStyles.css.js +1 -1
- package/dist/prod/generated/css/ScrollbarStyles.css.js.map +1 -1
- package/dist/prod/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/prod/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/prod/theming/applyTheme.js +1 -1
- package/dist/prod/theming/applyTheme.js.map +3 -3
- package/dist/theming/applyTheme.js +29 -19
- package/dist/theming/applyTheme.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/theming/applyTheme.ts"],
|
|
4
|
-
"sourcesContent": ["import { getThemeProperties, getRegisteredPackages, isThemeRegistered } from \"../asset-registries/Themes.js\";\nimport { createOrUpdateStyle } from \"../ManagedStyles.js\";\nimport getThemeDesignerTheme from \"./getThemeDesignerTheme.js\";\nimport { fireThemeLoaded } from \"./ThemeLoaded.js\";\nimport { attachCustomThemeStylesToHead, getThemeRoot } from \"../config/ThemeRoot.js\";\nimport
|
|
5
|
-
"mappings": "aAAA,OAAS,sBAAAA,EAAoB,yBAAAC,EAAuB,qBAAAC,MAAyB,gCAC7E,OAAS,uBAAAC,MAA2B,
|
|
6
|
-
"names": ["getThemeProperties", "getRegisteredPackages", "isThemeRegistered", "createOrUpdateStyle", "getThemeDesignerTheme", "fireThemeLoaded", "attachCustomThemeStylesToHead", "getThemeRoot", "DEFAULT_THEME", "getCurrentRuntimeIndex", "
|
|
4
|
+
"sourcesContent": ["import { getThemeProperties, getRegisteredPackages, isThemeRegistered } from \"../asset-registries/Themes.js\";\nimport { removeStyle, createOrUpdateStyle } from \"../ManagedStyles.js\";\nimport getThemeDesignerTheme from \"./getThemeDesignerTheme.js\";\nimport { fireThemeLoaded } from \"./ThemeLoaded.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport { attachCustomThemeStylesToHead, getThemeRoot } from \"../config/ThemeRoot.js\";\nimport type OpenUI5Support from \"../features/OpenUI5Support.js\";\nimport { DEFAULT_THEME } from \"../generated/AssetParameters.js\";\nimport { getCurrentRuntimeIndex } from \"../Runtimes.js\";\n\n// eslint-disable-next-line\nexport let _lib = \"ui5\";\n// eslint-disable-next-line\nexport let _package = \"webcomponents-theming\";\n// eslint-disable-next-line\nconst BASE_THEME_PACKAGE = \"@\" + _lib + \"/\" + _package;\n\nconst isThemeBaseRegistered = () => {\n\tconst registeredPackages = getRegisteredPackages();\n\treturn registeredPackages.has(BASE_THEME_PACKAGE);\n};\n\nconst loadThemeBase = async (theme: string) => {\n\tif (!isThemeBaseRegistered()) {\n\t\treturn;\n\t}\n\n\tconst cssData = await getThemeProperties(BASE_THEME_PACKAGE, theme);\n\tif (cssData) {\n\t\tcreateOrUpdateStyle(cssData, \"data-ui5-theme-properties\", BASE_THEME_PACKAGE, theme);\n\t}\n};\n\nconst deleteThemeBase = () => {\n\tremoveStyle(\"data-ui5-theme-properties\", BASE_THEME_PACKAGE);\n};\n\nconst loadComponentPackages = async (theme: string, externalThemeName?: string) => {\n\tconst registeredPackages = getRegisteredPackages();\n\n\tconst packagesStylesPromises = [...registeredPackages].map(async packageName => {\n\t\tif (packageName === BASE_THEME_PACKAGE) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cssData = await getThemeProperties(packageName, theme, externalThemeName);\n\t\tif (cssData) {\n\t\t\tcreateOrUpdateStyle(cssData, `data-ui5-component-properties-${getCurrentRuntimeIndex()}`, packageName);\n\t\t}\n\t});\n\n\treturn Promise.all(packagesStylesPromises);\n};\n\nconst detectExternalTheme = async (theme: string) => {\n\t// If theme designer theme is detected, use this\n\tconst extTheme = getThemeDesignerTheme();\n\tif (extTheme) {\n\t\treturn extTheme;\n\t}\n\n\t// If OpenUI5Support is enabled, try to find out if it loaded variables\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (openUI5Support && openUI5Support.isOpenUI5Detected()) {\n\t\tconst varsLoaded = openUI5Support.cssVariablesLoaded();\n\t\tif (varsLoaded) {\n\t\t\treturn {\n\t\t\t\tthemeName: openUI5Support.getConfigurationSettingsObject()?.theme, // just themeName\n\t\t\t\tbaseThemeName: \"\", // baseThemeName is only relevant for custom themes\n\t\t\t};\n\t\t}\n\t} else if (getThemeRoot()) {\n\t\tawait attachCustomThemeStylesToHead(theme);\n\n\t\treturn getThemeDesignerTheme();\n\t}\n};\n\nconst applyTheme = async (theme: string) => {\n\tconst extTheme = await detectExternalTheme(theme);\n\n\t// Only load theme_base properties if there is no externally loaded theme, or there is, but it is not being loaded\n\tif (!extTheme || theme !== extTheme.themeName) {\n\t\tawait loadThemeBase(theme);\n\t} else {\n\t\tdeleteThemeBase();\n\t}\n\n\t// Always load component packages properties. For non-registered themes, try with the base theme, if any\n\tconst packagesTheme = isThemeRegistered(theme) ? theme : extTheme && extTheme.baseThemeName;\n\tawait loadComponentPackages(packagesTheme || DEFAULT_THEME, extTheme && extTheme.themeName === theme ? theme : undefined);\n\n\tfireThemeLoaded(theme);\n};\n\nexport default applyTheme;\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,sBAAAA,EAAoB,yBAAAC,EAAuB,qBAAAC,MAAyB,gCAC7E,OAAS,eAAAC,EAAa,uBAAAC,MAA2B,sBACjD,OAAOC,MAA2B,6BAClC,OAAS,mBAAAC,MAAuB,mBAChC,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,iCAAAC,EAA+B,gBAAAC,MAAoB,yBAE5D,OAAS,iBAAAC,MAAqB,kCAC9B,OAAS,0BAAAC,MAA8B,iBAGhC,WAAI,KAAO,MAEP,SAAW,wBAEtB,MAAMC,EAAqB,IAAM,KAAO,IAAM,SAExCC,EAAwB,IACFZ,EAAsB,EACvB,IAAIW,CAAkB,EAG3CE,EAAgB,MAAOC,GAAkB,CAC9C,GAAI,CAACF,EAAsB,EAC1B,OAGD,MAAMG,EAAU,MAAMhB,EAAmBY,EAAoBG,CAAK,EAC9DC,GACHZ,EAAoBY,EAAS,4BAA6BJ,EAAoBG,CAAK,CAErF,EAEME,EAAkB,IAAM,CAC7Bd,EAAY,4BAA6BS,CAAkB,CAC5D,EAEMM,EAAwB,MAAOH,EAAeI,IAA+B,CAGlF,MAAMC,EAAyB,CAAC,GAFLnB,EAAsB,CAEI,EAAE,IAAI,MAAMoB,GAAe,CAC/E,GAAIA,IAAgBT,EACnB,OAGD,MAAMI,EAAU,MAAMhB,EAAmBqB,EAAaN,EAAOI,CAAiB,EAC1EH,GACHZ,EAAoBY,EAAS,iCAAiCL,EAAuB,CAAC,GAAIU,CAAW,CAEvG,CAAC,EAED,OAAO,QAAQ,IAAID,CAAsB,CAC1C,EAEME,EAAsB,MAAOP,GAAkB,CAEpD,MAAMQ,EAAWlB,EAAsB,EACvC,GAAIkB,EACH,OAAOA,EAIR,MAAMC,EAAiBjB,EAAkC,gBAAgB,EACzE,GAAIiB,GAAkBA,EAAe,kBAAkB,GAEtD,GADmBA,EAAe,mBAAmB,EAEpD,MAAO,CACN,UAAWA,EAAe,+BAA+B,GAAG,MAC5D,cAAe,EAChB,UAESf,EAAa,EACvB,aAAMD,EAA8BO,CAAK,EAElCV,EAAsB,CAE/B,EAEMoB,EAAa,MAAOV,GAAkB,CAC3C,MAAMQ,EAAW,MAAMD,EAAoBP,CAAK,EAG5C,CAACQ,GAAYR,IAAUQ,EAAS,UACnC,MAAMT,EAAcC,CAAK,EAEzBE,EAAgB,EAIjB,MAAMS,EAAgBxB,EAAkBa,CAAK,EAAIA,EAAQQ,GAAYA,EAAS,cAC9E,MAAML,EAAsBQ,GAAiBhB,EAAea,GAAYA,EAAS,YAAcR,EAAQA,EAAQ,MAAS,EAExHT,EAAgBS,CAAK,CACtB,EAEA,eAAeU",
|
|
6
|
+
"names": ["getThemeProperties", "getRegisteredPackages", "isThemeRegistered", "removeStyle", "createOrUpdateStyle", "getThemeDesignerTheme", "fireThemeLoaded", "getFeature", "attachCustomThemeStylesToHead", "getThemeRoot", "DEFAULT_THEME", "getCurrentRuntimeIndex", "BASE_THEME_PACKAGE", "isThemeBaseRegistered", "loadThemeBase", "theme", "cssData", "deleteThemeBase", "loadComponentPackages", "externalThemeName", "packagesStylesPromises", "packageName", "detectExternalTheme", "extTheme", "openUI5Support", "applyTheme", "packagesTheme"]
|
|
7
7
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { getThemeProperties, getRegisteredPackages, isThemeRegistered } from "../asset-registries/Themes.js";
|
|
2
|
-
import { createOrUpdateStyle } from "../ManagedStyles.js";
|
|
2
|
+
import { removeStyle, createOrUpdateStyle } from "../ManagedStyles.js";
|
|
3
3
|
import getThemeDesignerTheme from "./getThemeDesignerTheme.js";
|
|
4
4
|
import { fireThemeLoaded } from "./ThemeLoaded.js";
|
|
5
|
+
import { getFeature } from "../FeaturesRegistry.js";
|
|
5
6
|
import { attachCustomThemeStylesToHead, getThemeRoot } from "../config/ThemeRoot.js";
|
|
6
7
|
import { DEFAULT_THEME } from "../generated/AssetParameters.js";
|
|
7
8
|
import { getCurrentRuntimeIndex } from "../Runtimes.js";
|
|
8
|
-
import { getLoadBaseThemingCSSVariables } from "../config/Theme.js";
|
|
9
9
|
// eslint-disable-next-line
|
|
10
10
|
export let _lib = "ui5";
|
|
11
11
|
// eslint-disable-next-line
|
|
@@ -25,12 +25,12 @@ const loadThemeBase = async (theme) => {
|
|
|
25
25
|
createOrUpdateStyle(cssData, "data-ui5-theme-properties", BASE_THEME_PACKAGE, theme);
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
+
const deleteThemeBase = () => {
|
|
29
|
+
removeStyle("data-ui5-theme-properties", BASE_THEME_PACKAGE);
|
|
30
|
+
};
|
|
28
31
|
const loadComponentPackages = async (theme, externalThemeName) => {
|
|
29
32
|
const registeredPackages = getRegisteredPackages();
|
|
30
33
|
const packagesStylesPromises = [...registeredPackages].map(async (packageName) => {
|
|
31
|
-
if (getLoadBaseThemingCSSVariables() !== true && packageName === `${BASE_THEME_PACKAGE}-raw`) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
34
|
if (packageName === BASE_THEME_PACKAGE) {
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
@@ -42,29 +42,39 @@ const loadComponentPackages = async (theme, externalThemeName) => {
|
|
|
42
42
|
return Promise.all(packagesStylesPromises);
|
|
43
43
|
};
|
|
44
44
|
const detectExternalTheme = async (theme) => {
|
|
45
|
-
if (getThemeRoot()) {
|
|
46
|
-
await attachCustomThemeStylesToHead(theme);
|
|
47
|
-
}
|
|
48
45
|
// If theme designer theme is detected, use this
|
|
49
46
|
const extTheme = getThemeDesignerTheme();
|
|
50
47
|
if (extTheme) {
|
|
51
48
|
return extTheme;
|
|
52
49
|
}
|
|
50
|
+
// If OpenUI5Support is enabled, try to find out if it loaded variables
|
|
51
|
+
const openUI5Support = getFeature("OpenUI5Support");
|
|
52
|
+
if (openUI5Support && openUI5Support.isOpenUI5Detected()) {
|
|
53
|
+
const varsLoaded = openUI5Support.cssVariablesLoaded();
|
|
54
|
+
if (varsLoaded) {
|
|
55
|
+
return {
|
|
56
|
+
themeName: openUI5Support.getConfigurationSettingsObject()?.theme, // just themeName
|
|
57
|
+
baseThemeName: "", // baseThemeName is only relevant for custom themes
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else if (getThemeRoot()) {
|
|
62
|
+
await attachCustomThemeStylesToHead(theme);
|
|
63
|
+
return getThemeDesignerTheme();
|
|
64
|
+
}
|
|
53
65
|
};
|
|
54
66
|
const applyTheme = async (theme) => {
|
|
55
|
-
// Detect external theme if available (e.g., from theme designer or custom theme root)
|
|
56
67
|
const extTheme = await detectExternalTheme(theme);
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
// Only load theme_base properties if there is no externally loaded theme, or there is, but it is not being loaded
|
|
69
|
+
if (!extTheme || theme !== extTheme.themeName) {
|
|
70
|
+
await loadThemeBase(theme);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
deleteThemeBase();
|
|
74
|
+
}
|
|
75
|
+
// Always load component packages properties. For non-registered themes, try with the base theme, if any
|
|
61
76
|
const packagesTheme = isThemeRegistered(theme) ? theme : extTheme && extTheme.baseThemeName;
|
|
62
|
-
|
|
63
|
-
// Load base theme properties
|
|
64
|
-
await loadThemeBase(effectiveTheme);
|
|
65
|
-
// Load component-specific theme properties
|
|
66
|
-
// Pass external theme name only if it matches the requested theme to avoid conflicts
|
|
67
|
-
await loadComponentPackages(effectiveTheme, extTheme && extTheme.themeName === theme ? theme : undefined);
|
|
77
|
+
await loadComponentPackages(packagesTheme || DEFAULT_THEME, extTheme && extTheme.themeName === theme ? theme : undefined);
|
|
68
78
|
fireThemeLoaded(theme);
|
|
69
79
|
};
|
|
70
80
|
export default applyTheme;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyTheme.js","sourceRoot":"","sources":["../../src/theming/applyTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAC7G,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"applyTheme.js","sourceRoot":"","sources":["../../src/theming/applyTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAC7G,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,6BAA6B,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAErF,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,2BAA2B;AAC3B,MAA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G,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,aAAa,CAAC;IAC5F,MAAM,qBAAqB,CAAC,aAAa,IAAI,aAAa,EAAE,QAAQ,IAAI,QAAQ,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAE1H,eAAe,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { getThemeProperties, getRegisteredPackages, isThemeRegistered } from \"../asset-registries/Themes.js\";\nimport { removeStyle, createOrUpdateStyle } from \"../ManagedStyles.js\";\nimport getThemeDesignerTheme from \"./getThemeDesignerTheme.js\";\nimport { fireThemeLoaded } from \"./ThemeLoaded.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport { attachCustomThemeStylesToHead, getThemeRoot } from \"../config/ThemeRoot.js\";\nimport type OpenUI5Support from \"../features/OpenUI5Support.js\";\nimport { DEFAULT_THEME } from \"../generated/AssetParameters.js\";\nimport { getCurrentRuntimeIndex } from \"../Runtimes.js\";\n\n// eslint-disable-next-line\nexport let _lib = \"ui5\";\n// eslint-disable-next-line\nexport let _package = \"webcomponents-theming\";\n// eslint-disable-next-line\nconst BASE_THEME_PACKAGE = \"@\" + _lib + \"/\" + _package;\n\nconst isThemeBaseRegistered = () => {\n\tconst registeredPackages = getRegisteredPackages();\n\treturn registeredPackages.has(BASE_THEME_PACKAGE);\n};\n\nconst loadThemeBase = async (theme: string) => {\n\tif (!isThemeBaseRegistered()) {\n\t\treturn;\n\t}\n\n\tconst cssData = await getThemeProperties(BASE_THEME_PACKAGE, theme);\n\tif (cssData) {\n\t\tcreateOrUpdateStyle(cssData, \"data-ui5-theme-properties\", BASE_THEME_PACKAGE, theme);\n\t}\n};\n\nconst deleteThemeBase = () => {\n\tremoveStyle(\"data-ui5-theme-properties\", BASE_THEME_PACKAGE);\n};\n\nconst loadComponentPackages = async (theme: string, externalThemeName?: string) => {\n\tconst registeredPackages = getRegisteredPackages();\n\n\tconst packagesStylesPromises = [...registeredPackages].map(async packageName => {\n\t\tif (packageName === BASE_THEME_PACKAGE) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cssData = await getThemeProperties(packageName, theme, externalThemeName);\n\t\tif (cssData) {\n\t\t\tcreateOrUpdateStyle(cssData, `data-ui5-component-properties-${getCurrentRuntimeIndex()}`, packageName);\n\t\t}\n\t});\n\n\treturn Promise.all(packagesStylesPromises);\n};\n\nconst detectExternalTheme = async (theme: string) => {\n\t// If theme designer theme is detected, use this\n\tconst extTheme = getThemeDesignerTheme();\n\tif (extTheme) {\n\t\treturn extTheme;\n\t}\n\n\t// If OpenUI5Support is enabled, try to find out if it loaded variables\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (openUI5Support && openUI5Support.isOpenUI5Detected()) {\n\t\tconst varsLoaded = openUI5Support.cssVariablesLoaded();\n\t\tif (varsLoaded) {\n\t\t\treturn {\n\t\t\t\tthemeName: openUI5Support.getConfigurationSettingsObject()?.theme, // just themeName\n\t\t\t\tbaseThemeName: \"\", // baseThemeName is only relevant for custom themes\n\t\t\t};\n\t\t}\n\t} else if (getThemeRoot()) {\n\t\tawait attachCustomThemeStylesToHead(theme);\n\n\t\treturn getThemeDesignerTheme();\n\t}\n};\n\nconst applyTheme = async (theme: string) => {\n\tconst extTheme = await detectExternalTheme(theme);\n\n\t// Only load theme_base properties if there is no externally loaded theme, or there is, but it is not being loaded\n\tif (!extTheme || theme !== extTheme.themeName) {\n\t\tawait loadThemeBase(theme);\n\t} else {\n\t\tdeleteThemeBase();\n\t}\n\n\t// Always load component packages properties. For non-registered themes, try with the base theme, if any\n\tconst packagesTheme = isThemeRegistered(theme) ? theme : extTheme && extTheme.baseThemeName;\n\tawait loadComponentPackages(packagesTheme || DEFAULT_THEME, extTheme && extTheme.themeName === theme ? theme : undefined);\n\n\tfireThemeLoaded(theme);\n};\n\nexport default applyTheme;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents-base",
|
|
3
|
-
"version": "2.17.0
|
|
3
|
+
"version": "2.17.0",
|
|
4
4
|
"description": "UI5 Web Components: webcomponents.base",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@openui5/sap.ui.core": "1.120.17",
|
|
65
65
|
"@sap-theming/theming-base-content": "11.29.3",
|
|
66
66
|
"@ui5/cypress-internal": "0.1.0",
|
|
67
|
-
"@ui5/webcomponents-tools": "2.17.0
|
|
67
|
+
"@ui5/webcomponents-tools": "2.17.0",
|
|
68
68
|
"clean-css": "^5.2.2",
|
|
69
69
|
"cypress": "^15.3.0",
|
|
70
70
|
"mocha": "^11.7.2",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"vite": "5.4.21"
|
|
76
76
|
},
|
|
77
77
|
"customElements": "dist/custom-elements.json",
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "13048269dab7b8ff92e9964e7ce4b771005cf07b"
|
|
79
79
|
}
|