@ui5/webcomponents-base 2.27.0-rc.0 → 2.27.0-rc.2

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.
@@ -1,5 +1,10 @@
1
1
  import { getCurrentRuntimeIndex, compareRuntimes } from "./Runtimes.js";
2
2
  const isSSR = typeof document === "undefined";
3
+ // Workaround for https://bugs.webkit.org/show_bug.cgi?id=278778 — Safari's GC can prematurely
4
+ // collect the JS wrapper of an adopted stylesheet even while it's still in document.adoptedStyleSheets,
5
+ // wiping out any expando properties (_ui5StyleId, _ui5Theme, _ui5RuntimeIndex) attached to it.
6
+ // Holding a strong reference here keeps the exact wrapper object alive through a path the GC traces correctly.
7
+ const stylesheetMap = new Map();
3
8
  const getStyleId = (name, value) => {
4
9
  return value ? `${name}|${value}` : name;
5
10
  };
@@ -14,6 +19,7 @@ const createStyle = (content, name, value = "", theme) => {
14
19
  const stylesheet = new CSSStyleSheet();
15
20
  stylesheet.replaceSync(content);
16
21
  stylesheet._ui5StyleId = getStyleId(name, value); // set an id so that we can find the style later
22
+ stylesheetMap.set(getStyleId(name, value), stylesheet);
17
23
  if (theme) {
18
24
  stylesheet._ui5RuntimeIndex = currentRuntimeIndex;
19
25
  stylesheet._ui5Theme = theme;
@@ -1 +1 @@
1
- {"version":3,"file":"ManagedStyles.js","sourceRoot":"","sources":["../src/ManagedStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAExE,MAAM,KAAK,GAAG,OAAO,QAAQ,KAAK,WAAW,CAAC;AAE9C,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,EAAE;IAClD,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,YAAgC,EAAE,EAAE;IACzD,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AI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;SAAM,CAAC;QACP,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,MAAe,EAAE,MAAe,EAAE,EAAE;IACxD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,MAAM,CAAC;IACf,CAAC;IACD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,MAAM,CAAC;IACf,CAAC;IACD,OAAO,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAC9B,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,QAAQ,EACR,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,WAAW,GACX,CAAC","sourcesContent":["import { getCurrentRuntimeIndex, compareRuntimes } from \"./Runtimes.js\";\n\nconst isSSR = typeof document === \"undefined\";\n\nconst getStyleId = (name: string, value: string) => {\n\treturn value ? `${name}|${value}` : name;\n};\n\nconst shouldUpdate = (runtimeIndex: string | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(getCurrentRuntimeIndex(), parseInt(runtimeIndex)) >= 1; // 1 or larger means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nconst createStyle = (content: string, name: string, value = \"\", theme?: string) => {\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tconst stylesheet = new CSSStyleSheet();\n\tstylesheet.replaceSync(content);\n\t(stylesheet as Record<string, any>)._ui5StyleId = getStyleId(name, value); // set an id so that we can find the style later\n\tif (theme) {\n\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = currentRuntimeIndex;\n\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t}\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n};\n\nconst updateStyle = (content: string, name: string, value = \"\", theme?: string) => {\n\tif (isSSR) {\n\t\treturn;\n\t}\n\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tconst stylesheet = document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n\tif (!stylesheet) {\n\t\treturn;\n\t}\n\n\tif (!theme) {\n\t\tstylesheet.replaceSync(content || \"\");\n\t} else {\n\t\tconst stylesheetRuntimeIndex: string | undefined = (stylesheet as Record<string, any>)._ui5RuntimeIndex;\n\t\tconst stylesheetTheme: string | undefined = (stylesheet as Record<string, any>)._ui5Theme;\n\t\tif (stylesheetTheme !== theme || shouldUpdate(stylesheetRuntimeIndex)) {\n\t\t\tstylesheet.replaceSync(content || \"\");\n\t\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = String(currentRuntimeIndex);\n\t\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t\t}\n\t}\n};\n\nconst hasStyle = (name: string, value = \"\"): boolean => {\n\tif (isSSR) {\n\t\treturn true;\n\t}\n\n\treturn !!document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n};\n\nconst removeStyle = (name: string, value = \"\") => {\n\tdocument.adoptedStyleSheets = document.adoptedStyleSheets.filter(sh => (sh as Record<string, any>)._ui5StyleId !== getStyleId(name, value));\n};\n\nconst createOrUpdateStyle = (content: string, name: string, value = \"\", theme?: string) => {\n\tif (hasStyle(name, value)) {\n\t\tupdateStyle(content, name, value, theme);\n\t} else {\n\t\tcreateStyle(content, name, value, theme);\n\t}\n};\n\nconst mergeStyles = (style1?: string, style2?: string) => {\n\tif (style1 === undefined) {\n\t\treturn style2;\n\t}\n\tif (style2 === undefined) {\n\t\treturn style1;\n\t}\n\treturn `${style1} ${style2}`;\n};\n\nexport {\n\tcreateStyle,\n\thasStyle,\n\tupdateStyle,\n\tremoveStyle,\n\tcreateOrUpdateStyle,\n\tmergeStyles,\n};\n"]}
1
+ {"version":3,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undefined\";\n\n// Workaround for https://bugs.webkit.org/show_bug.cgi?id=278778 — Safari's GC can prematurely\n// collect the JS wrapper of an adopted stylesheet even while it's still in document.adoptedStyleSheets,\n// wiping out any expando properties (_ui5StyleId, _ui5Theme, _ui5RuntimeIndex) attached to it.\n// Holding a strong reference here keeps the exact wrapper object alive through a path the GC traces correctly.\nconst stylesheetMap = new Map<string, CSSStyleSheet>();\n\nconst getStyleId = (name: string, value: string) => {\n\treturn value ? `${name}|${value}` : name;\n};\n\nconst shouldUpdate = (runtimeIndex: string | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(getCurrentRuntimeIndex(), parseInt(runtimeIndex)) >= 1; // 1 or larger means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nconst createStyle = (content: string, name: string, value = \"\", theme?: string) => {\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tconst stylesheet = new CSSStyleSheet();\n\tstylesheet.replaceSync(content);\n\t(stylesheet as Record<string, any>)._ui5StyleId = getStyleId(name, value); // set an id so that we can find the style later\n\tstylesheetMap.set(getStyleId(name, value), stylesheet);\n\tif (theme) {\n\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = currentRuntimeIndex;\n\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t}\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n};\n\nconst updateStyle = (content: string, name: string, value = \"\", theme?: string) => {\n\tif (isSSR) {\n\t\treturn;\n\t}\n\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tconst stylesheet = document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n\tif (!stylesheet) {\n\t\treturn;\n\t}\n\n\tif (!theme) {\n\t\tstylesheet.replaceSync(content || \"\");\n\t} else {\n\t\tconst stylesheetRuntimeIndex: string | undefined = (stylesheet as Record<string, any>)._ui5RuntimeIndex;\n\t\tconst stylesheetTheme: string | undefined = (stylesheet as Record<string, any>)._ui5Theme;\n\t\tif (stylesheetTheme !== theme || shouldUpdate(stylesheetRuntimeIndex)) {\n\t\t\tstylesheet.replaceSync(content || \"\");\n\t\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = String(currentRuntimeIndex);\n\t\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t\t}\n\t}\n};\n\nconst hasStyle = (name: string, value = \"\"): boolean => {\n\tif (isSSR) {\n\t\treturn true;\n\t}\n\n\treturn !!document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n};\n\nconst removeStyle = (name: string, value = \"\") => {\n\tdocument.adoptedStyleSheets = document.adoptedStyleSheets.filter(sh => (sh as Record<string, any>)._ui5StyleId !== getStyleId(name, value));\n};\n\nconst createOrUpdateStyle = (content: string, name: string, value = \"\", theme?: string) => {\n\tif (hasStyle(name, value)) {\n\t\tupdateStyle(content, name, value, theme);\n\t} else {\n\t\tcreateStyle(content, name, value, theme);\n\t}\n};\n\nconst mergeStyles = (style1?: string, style2?: string) => {\n\tif (style1 === undefined) {\n\t\treturn style2;\n\t}\n\tif (style2 === undefined) {\n\t\treturn style1;\n\t}\n\treturn `${style1} ${style2}`;\n};\n\nexport {\n\tcreateStyle,\n\thasStyle,\n\tupdateStyle,\n\tremoveStyle,\n\tcreateOrUpdateStyle,\n\tmergeStyles,\n};\n"]}
@@ -1,7 +1,6 @@
1
1
  import { getTheme as getConfiguredTheme } from "../InitialConfiguration.js";
2
2
  import { reRenderAllUI5Elements } from "../Render.js";
3
3
  import applyTheme from "../theming/applyTheme.js";
4
- import getThemeDesignerTheme from "../theming/getThemeDesignerTheme.js";
5
4
  import { DEFAULT_THEME, SUPPORTED_THEMES } from "../generated/AssetParameters.js";
6
5
  import { boot, isBooted } from "../Boot.js";
7
6
  import { attachConfigurationReset } from "./ConfigurationReset.js";
@@ -76,7 +75,7 @@ const isTheme = (theme) => {
76
75
  const isLegacyThemeFamily = () => {
77
76
  const currentTheme = getTheme();
78
77
  if (!isKnownTheme(currentTheme)) {
79
- return !getThemeDesignerTheme()?.baseThemeName?.startsWith("sap_horizon");
78
+ return !getBaseTheme()?.startsWith("sap_horizon");
80
79
  }
81
80
  return !currentTheme.startsWith("sap_horizon");
82
81
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.js","sourceRoot":"","sources":["../../src/config/Theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,qBAAqB,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE9F,IAAI,QAA4B,CAAC;AACjC,IAAI,YAAgC,CAAC;AAErC,wBAAwB,CAAC,GAAG,EAAE;IAC7B,QAAQ,GAAG,SAAS,CAAC;AACtB,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,OAAO,EAAE,CAAC,KAAa,EAAE,EAAE;IAC7C,QAAQ,GAAG,KAAK,CAAC;IACjB,IAAI,QAAQ,EAAE,EAAE,CAAC;QAChB,UAAU,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC/E,CAAC;AACF,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,QAAQ,GAAG,GAAW,EAAE;IAC7B,IAAI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9B,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAEzE;;;;GAIG;AACH,MAAM,YAAY,GAAG,GAAuB,EAAE;IAC7C,OAAO,YAAY,CAAC;AACrB,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,YAAY,GAAG,CAAC,KAAyB,EAAQ,EAAE;IACxD,YAAY,GAAG,KAAK,CAAC;AACtB,CAAC,CAAC;AAEF,OAAO,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,mBAAmB,EACnB,wBAAwB,EACxB,eAAe,EACf,YAAY,EACZ,YAAY,GACZ,CAAC","sourcesContent":["import { getTheme as getConfiguredTheme } from \"../InitialConfiguration.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport applyTheme from \"../theming/applyTheme.js\";\nimport getThemeDesignerTheme from \"../theming/getThemeDesignerTheme.js\";\nimport { DEFAULT_THEME, SUPPORTED_THEMES } from \"../generated/AssetParameters.js\";\nimport { boot, isBooted } from \"../Boot.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\nimport { fireConfigChange, attachConfigChange, getSharedValue } from \"./ConfigurationSync.js\";\n\nlet curTheme: string | undefined;\nlet curBaseTheme: string | undefined;\n\nattachConfigurationReset(() => {\n\tcurTheme = undefined;\n});\n\nattachConfigChange(\"theme\", (theme: string) => {\n\tcurTheme = theme;\n\tif (isBooted()) {\n\t\tapplyTheme(curTheme).then(() => reRenderAllUI5Elements({ themeAware: true }));\n\t}\n});\n\n/**\n * Returns the current theme.\n * @public\n * @returns {string} the current theme name\n */\nconst getTheme = (): string => {\n\tif (curTheme === undefined) {\n\t\tcurTheme = getSharedValue<string>(\"theme\") ?? getConfiguredTheme();\n\t}\n\n\treturn curTheme;\n};\n\n/**\n * Applies a new theme after fetching its assets from the network.\n * @public\n * @param {string} theme the name of the new theme\n * @returns {Promise<void>} a promise that is resolved when the new theme assets have been fetched and applied to the DOM\n */\nconst setTheme = async (theme: string): Promise<void> => {\n\tif (curTheme === theme) {\n\t\treturn;\n\t}\n\n\tcurTheme = theme;\n\n\tfireConfigChange(\"theme\", theme);\n\n\tif (isBooted()) {\n\t\t// Update CSS Custom Properties\n\t\tawait applyTheme(curTheme);\n\t\tawait reRenderAllUI5Elements({ themeAware: true });\n\t}\n};\n\n/**\n * Returns the default theme.\n *\n * Note: Default theme might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultTheme = (): string => {\n\treturn DEFAULT_THEME;\n};\n\n/**\n * Returns if the given theme name is the one currently applied.\n * @private\n * @param {string} theme\n * @returns {boolean}\n */\nconst isTheme = (theme: string) => {\n\treturn getTheme() === theme;\n};\n\n/**\n * Returns if the currently set theme is part of legacy theme families (\"sap_fiori_3\").\n * **Note**: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.\n *\n * @private\n * @returns { boolean }\n */\nconst isLegacyThemeFamily = () => {\n\tconst currentTheme = getTheme();\n\n\tif (!isKnownTheme(currentTheme)) {\n\t\treturn !getThemeDesignerTheme()?.baseThemeName?.startsWith(\"sap_horizon\");\n\t}\n\n\treturn !currentTheme.startsWith(\"sap_horizon\");\n};\n\nconst isLegacyThemeFamilyAsync = async () => {\n\tawait boot();\n\treturn isLegacyThemeFamily();\n};\n\nconst isKnownTheme = (theme: string) => SUPPORTED_THEMES.includes(theme);\n\n/**\n * Returns the base theme of external theme.\n * @private\n * @returns {string | undefined} the base theme name\n */\nconst getBaseTheme = (): string | undefined => {\n\treturn curBaseTheme;\n};\n\n/**\n * Sets the base theme of the current external theme.\n * @param { string | undefined } theme the name of the new base theme\n * @private\n */\nconst setBaseTheme = (theme: string | undefined): void => {\n\tcurBaseTheme = theme;\n};\n\nexport {\n\tgetTheme,\n\tsetTheme,\n\tisTheme,\n\tisLegacyThemeFamily,\n\tisLegacyThemeFamilyAsync,\n\tgetDefaultTheme,\n\tgetBaseTheme,\n\tsetBaseThe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AAC,KAAyB,EAAQ,EAAE;IACxD,YAAY,GAAG,KAAK,CAAC;AACtB,CAAC,CAAC;AAEF,OAAO,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,mBAAmB,EACnB,wBAAwB,EACxB,eAAe,EACf,YAAY,EACZ,YAAY,GACZ,CAAC","sourcesContent":["import { getTheme as getConfiguredTheme } from \"../InitialConfiguration.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport applyTheme from \"../theming/applyTheme.js\";\nimport { DEFAULT_THEME, SUPPORTED_THEMES } from \"../generated/AssetParameters.js\";\nimport { boot, isBooted } from \"../Boot.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\nimport { fireConfigChange, attachConfigChange, getSharedValue } from \"./ConfigurationSync.js\";\n\nlet curTheme: string | undefined;\nlet curBaseTheme: string | undefined;\n\nattachConfigurationReset(() => {\n\tcurTheme = undefined;\n});\n\nattachConfigChange(\"theme\", (theme: string) => {\n\tcurTheme = theme;\n\tif (isBooted()) {\n\t\tapplyTheme(curTheme).then(() => reRenderAllUI5Elements({ themeAware: true }));\n\t}\n});\n\n/**\n * Returns the current theme.\n * @public\n * @returns {string} the current theme name\n */\nconst getTheme = (): string => {\n\tif (curTheme === undefined) {\n\t\tcurTheme = getSharedValue<string>(\"theme\") ?? getConfiguredTheme();\n\t}\n\n\treturn curTheme;\n};\n\n/**\n * Applies a new theme after fetching its assets from the network.\n * @public\n * @param {string} theme the name of the new theme\n * @returns {Promise<void>} a promise that is resolved when the new theme assets have been fetched and applied to the DOM\n */\nconst setTheme = async (theme: string): Promise<void> => {\n\tif (curTheme === theme) {\n\t\treturn;\n\t}\n\n\tcurTheme = theme;\n\n\tfireConfigChange(\"theme\", theme);\n\n\tif (isBooted()) {\n\t\t// Update CSS Custom Properties\n\t\tawait applyTheme(curTheme);\n\t\tawait reRenderAllUI5Elements({ themeAware: true });\n\t}\n};\n\n/**\n * Returns the default theme.\n *\n * Note: Default theme might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultTheme = (): string => {\n\treturn DEFAULT_THEME;\n};\n\n/**\n * Returns if the given theme name is the one currently applied.\n * @private\n * @param {string} theme\n * @returns {boolean}\n */\nconst isTheme = (theme: string) => {\n\treturn getTheme() === theme;\n};\n\n/**\n * Returns if the currently set theme is part of legacy theme families (\"sap_fiori_3\").\n * **Note**: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.\n *\n * @private\n * @returns { boolean }\n */\nconst isLegacyThemeFamily = () => {\n\tconst currentTheme = getTheme();\n\n\tif (!isKnownTheme(currentTheme)) {\n\t\treturn !getBaseTheme()?.startsWith(\"sap_horizon\");\n\t}\n\n\treturn !currentTheme.startsWith(\"sap_horizon\");\n};\n\nconst isLegacyThemeFamilyAsync = async () => {\n\tawait boot();\n\treturn isLegacyThemeFamily();\n};\n\nconst isKnownTheme = (theme: string) => SUPPORTED_THEMES.includes(theme);\n\n/**\n * Returns the base theme of external theme.\n * @private\n * @returns {string | undefined} the base theme name\n */\nconst getBaseTheme = (): string | undefined => {\n\treturn curBaseTheme;\n};\n\n/**\n * Sets the base theme of the current external theme.\n * @param { string | undefined } theme the name of the new base theme\n * @private\n */\nconst setBaseTheme = (theme: string | undefined): void => {\n\tcurBaseTheme = theme;\n};\n\nexport {\n\tgetTheme,\n\tsetTheme,\n\tisTheme,\n\tisLegacyThemeFamily,\n\tisLegacyThemeFamilyAsync,\n\tgetDefaultTheme,\n\tgetBaseTheme,\n\tsetBaseTheme,\n};\n"]}
@@ -1,11 +1,11 @@
1
1
  const VersionInfo = {
2
- version: "2.27.0-rc.0",
2
+ version: "2.27.0-rc.2",
3
3
  major: 2,
4
4
  minor: 27,
5
5
  patch: 0,
6
- suffix: "-rc.0",
6
+ suffix: "-rc.2",
7
7
  isNext: false,
8
- buildTime: 1787935420,
8
+ buildTime: 1789632712,
9
9
  };
10
10
  export default VersionInfo;
11
11
  //# sourceMappingURL=VersionInfo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VersionInfo.js","sourceRoot":"","sources":["../../src/generated/VersionInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IACnB,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAU;CACrB,CAAC;AACF,eAAe,WAAW,CAAC","sourcesContent":["const VersionInfo = {\n\tversion: \"2.27.0-rc.0\",\n\tmajor: 2,\n\tminor: 27,\n\tpatch: 0,\n\tsuffix: \"-rc.0\",\n\tisNext: false,\n\tbuildTime: 1787935420,\n};\nexport default VersionInfo;"]}
1
+ {"version":3,"file":"VersionInfo.js","sourceRoot":"","sources":["../../src/generated/VersionInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IACnB,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAU;CACrB,CAAC;AACF,eAAe,WAAW,CAAC","sourcesContent":["const VersionInfo = {\n\tversion: \"2.27.0-rc.2\",\n\tmajor: 2,\n\tminor: 27,\n\tpatch: 0,\n\tsuffix: \"-rc.2\",\n\tisNext: false,\n\tbuildTime: 1789632712,\n};\nexport default VersionInfo;"]}
@@ -1,2 +1,2 @@
1
- "use strict";import{getCurrentRuntimeIndex as u,compareRuntimes as g}from"./Runtimes.js";const c=typeof document>"u",i=(e,t)=>t?`${e}|${t}`:e,l=e=>e===void 0?!0:g(u(),parseInt(e))>=1,y=(e,t,r="",s)=>{const d=u(),n=new CSSStyleSheet;n.replaceSync(e),n._ui5StyleId=i(t,r),s&&(n._ui5RuntimeIndex=d,n._ui5Theme=s),document.adoptedStyleSheets=[...document.adoptedStyleSheets,n]},S=(e,t,r="",s)=>{if(c)return;const d=u(),n=document.adoptedStyleSheets.find(o=>o._ui5StyleId===i(t,r));if(n)if(!s)n.replaceSync(e||"");else{const o=n._ui5RuntimeIndex;(n._ui5Theme!==s||l(o))&&(n.replaceSync(e||""),n._ui5RuntimeIndex=String(d),n._ui5Theme=s)}},a=(e,t="")=>c?!0:!!document.adoptedStyleSheets.find(r=>r._ui5StyleId===i(e,t)),f=(e,t="")=>{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(r=>r._ui5StyleId!==i(e,t))},R=(e,t,r="",s)=>{a(t,r)?S(e,t,r,s):y(e,t,r,s)},m=(e,t)=>e===void 0?t:t===void 0?e:`${e} ${t}`;export{y as createStyle,a as hasStyle,S as updateStyle,f as removeStyle,R as createOrUpdateStyle,m as mergeStyles};
1
+ "use strict";import{getCurrentRuntimeIndex as u,compareRuntimes as a}from"./Runtimes.js";const c=typeof document>"u",l=new Map,i=(e,t)=>t?`${e}|${t}`:e,f=e=>e===void 0?!0:a(u(),parseInt(e))>=1,S=(e,t,r="",s)=>{const d=u(),n=new CSSStyleSheet;n.replaceSync(e),n._ui5StyleId=i(t,r),l.set(i(t,r),n),s&&(n._ui5RuntimeIndex=d,n._ui5Theme=s),document.adoptedStyleSheets=[...document.adoptedStyleSheets,n]},y=(e,t,r="",s)=>{if(c)return;const d=u(),n=document.adoptedStyleSheets.find(o=>o._ui5StyleId===i(t,r));if(n)if(!s)n.replaceSync(e||"");else{const o=n._ui5RuntimeIndex;(n._ui5Theme!==s||f(o))&&(n.replaceSync(e||""),n._ui5RuntimeIndex=String(d),n._ui5Theme=s)}},g=(e,t="")=>c?!0:!!document.adoptedStyleSheets.find(r=>r._ui5StyleId===i(e,t)),p=(e,t="")=>{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(r=>r._ui5StyleId!==i(e,t))},R=(e,t,r="",s)=>{g(t,r)?y(e,t,r,s):S(e,t,r,s)},h=(e,t)=>e===void 0?t:t===void 0?e:`${e} ${t}`;export{S as createStyle,g as hasStyle,y as updateStyle,p as removeStyle,R as createOrUpdateStyle,h as mergeStyles};
2
2
  //# sourceMappingURL=ManagedStyles.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/ManagedStyles.ts"],
4
- "sourcesContent": ["import { getCurrentRuntimeIndex, compareRuntimes } from \"./Runtimes.js\";\n\nconst isSSR = typeof document === \"undefined\";\n\nconst getStyleId = (name: string, value: string) => {\n\treturn value ? `${name}|${value}` : name;\n};\n\nconst shouldUpdate = (runtimeIndex: string | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(getCurrentRuntimeIndex(), parseInt(runtimeIndex)) >= 1; // 1 or larger means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nconst createStyle = (content: string, name: string, value = \"\", theme?: string) => {\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tconst stylesheet = new CSSStyleSheet();\n\tstylesheet.replaceSync(content);\n\t(stylesheet as Record<string, any>)._ui5StyleId = getStyleId(name, value); // set an id so that we can find the style later\n\tif (theme) {\n\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = currentRuntimeIndex;\n\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t}\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n};\n\nconst updateStyle = (content: string, name: string, value = \"\", theme?: string) => {\n\tif (isSSR) {\n\t\treturn;\n\t}\n\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tconst stylesheet = document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n\tif (!stylesheet) {\n\t\treturn;\n\t}\n\n\tif (!theme) {\n\t\tstylesheet.replaceSync(content || \"\");\n\t} else {\n\t\tconst stylesheetRuntimeIndex: string | undefined = (stylesheet as Record<string, any>)._ui5RuntimeIndex;\n\t\tconst stylesheetTheme: string | undefined = (stylesheet as Record<string, any>)._ui5Theme;\n\t\tif (stylesheetTheme !== theme || shouldUpdate(stylesheetRuntimeIndex)) {\n\t\t\tstylesheet.replaceSync(content || \"\");\n\t\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = String(currentRuntimeIndex);\n\t\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t\t}\n\t}\n};\n\nconst hasStyle = (name: string, value = \"\"): boolean => {\n\tif (isSSR) {\n\t\treturn true;\n\t}\n\n\treturn !!document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n};\n\nconst removeStyle = (name: string, value = \"\") => {\n\tdocument.adoptedStyleSheets = document.adoptedStyleSheets.filter(sh => (sh as Record<string, any>)._ui5StyleId !== getStyleId(name, value));\n};\n\nconst createOrUpdateStyle = (content: string, name: string, value = \"\", theme?: string) => {\n\tif (hasStyle(name, value)) {\n\t\tupdateStyle(content, name, value, theme);\n\t} else {\n\t\tcreateStyle(content, name, value, theme);\n\t}\n};\n\nconst mergeStyles = (style1?: string, style2?: string) => {\n\tif (style1 === undefined) {\n\t\treturn style2;\n\t}\n\tif (style2 === undefined) {\n\t\treturn style1;\n\t}\n\treturn `${style1} ${style2}`;\n};\n\nexport {\n\tcreateStyle,\n\thasStyle,\n\tupdateStyle,\n\tremoveStyle,\n\tcreateOrUpdateStyle,\n\tmergeStyles,\n};\n"],
5
- "mappings": "aAAA,OAAS,0BAAAA,EAAwB,mBAAAC,MAAuB,gBAExD,MAAMC,EAAQ,OAAO,SAAa,IAE5BC,EAAa,CAACC,EAAcC,IAC1BA,EAAQ,GAAGD,CAAI,IAAIC,CAAK,GAAKD,EAG/BE,EAAgBC,GACjBA,IAAiB,OACb,GAEDN,EAAgBD,EAAuB,EAAG,SAASO,CAAY,CAAC,GAAK,EAGvEC,EAAc,CAACC,EAAiBL,EAAcC,EAAQ,GAAIK,IAAmB,CAClF,MAAMC,EAAsBX,EAAuB,EAE7CY,EAAa,IAAI,cACvBA,EAAW,YAAYH,CAAO,EAC7BG,EA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entRuntimeIndex", "compareRuntimes", "isSSR", "getStyleId", "name", "value", "shouldUpdate", "runtimeIndex", "createStyle", "content", "theme", "currentRuntimeIndex", "stylesheet", "updateStyle", "sh", "stylesheetRuntimeIndex", "hasStyle", "removeStyle", "createOrUpdateStyle", "mergeStyles", "style1", "style2"]
4
+ "sourcesContent": ["import { getCurrentRuntimeIndex, compareRuntimes } from \"./Runtimes.js\";\n\nconst isSSR = typeof document === \"undefined\";\n\n// Workaround for https://bugs.webkit.org/show_bug.cgi?id=278778 \u2014 Safari's GC can prematurely\n// collect the JS wrapper of an adopted stylesheet even while it's still in document.adoptedStyleSheets,\n// wiping out any expando properties (_ui5StyleId, _ui5Theme, _ui5RuntimeIndex) attached to it.\n// Holding a strong reference here keeps the exact wrapper object alive through a path the GC traces correctly.\nconst stylesheetMap = new Map<string, CSSStyleSheet>();\n\nconst getStyleId = (name: string, value: string) => {\n\treturn value ? `${name}|${value}` : name;\n};\n\nconst shouldUpdate = (runtimeIndex: string | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(getCurrentRuntimeIndex(), parseInt(runtimeIndex)) >= 1; // 1 or larger means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nconst createStyle = (content: string, name: string, value = \"\", theme?: string) => {\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tconst stylesheet = new CSSStyleSheet();\n\tstylesheet.replaceSync(content);\n\t(stylesheet as Record<string, any>)._ui5StyleId = getStyleId(name, value); // set an id so that we can find the style later\n\tstylesheetMap.set(getStyleId(name, value), stylesheet);\n\tif (theme) {\n\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = currentRuntimeIndex;\n\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t}\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n};\n\nconst updateStyle = (content: string, name: string, value = \"\", theme?: string) => {\n\tif (isSSR) {\n\t\treturn;\n\t}\n\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tconst stylesheet = document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n\tif (!stylesheet) {\n\t\treturn;\n\t}\n\n\tif (!theme) {\n\t\tstylesheet.replaceSync(content || \"\");\n\t} else {\n\t\tconst stylesheetRuntimeIndex: string | undefined = (stylesheet as Record<string, any>)._ui5RuntimeIndex;\n\t\tconst stylesheetTheme: string | undefined = (stylesheet as Record<string, any>)._ui5Theme;\n\t\tif (stylesheetTheme !== theme || shouldUpdate(stylesheetRuntimeIndex)) {\n\t\t\tstylesheet.replaceSync(content || \"\");\n\t\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = String(currentRuntimeIndex);\n\t\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t\t}\n\t}\n};\n\nconst hasStyle = (name: string, value = \"\"): boolean => {\n\tif (isSSR) {\n\t\treturn true;\n\t}\n\n\treturn !!document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n};\n\nconst removeStyle = (name: string, value = \"\") => {\n\tdocument.adoptedStyleSheets = document.adoptedStyleSheets.filter(sh => (sh as Record<string, any>)._ui5StyleId !== getStyleId(name, value));\n};\n\nconst createOrUpdateStyle = (content: string, name: string, value = \"\", theme?: string) => {\n\tif (hasStyle(name, value)) {\n\t\tupdateStyle(content, name, value, theme);\n\t} else {\n\t\tcreateStyle(content, name, value, theme);\n\t}\n};\n\nconst mergeStyles = (style1?: string, style2?: string) => {\n\tif (style1 === undefined) {\n\t\treturn style2;\n\t}\n\tif (style2 === undefined) {\n\t\treturn style1;\n\t}\n\treturn `${style1} ${style2}`;\n};\n\nexport {\n\tcreateStyle,\n\thasStyle,\n\tupdateStyle,\n\tremoveStyle,\n\tcreateOrUpdateStyle,\n\tmergeStyles,\n};\n"],
5
+ "mappings": "aAAA,OAAS,0BAAAA,EAAwB,mBAAAC,MAAuB,gBAExD,MAAMC,E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gBX,EAAWC,EAAMC,CAAK,CAAC,CAC3I,EAEMa,EAAsB,CAACT,EAAiBL,EAAcC,EAAQ,GAAIK,IAAmB,CACtFM,EAASZ,EAAMC,CAAK,EACvBQ,EAAYJ,EAASL,EAAMC,EAAOK,CAAK,EAEvCF,EAAYC,EAASL,EAAMC,EAAOK,CAAK,CAEzC,EAEMS,EAAc,CAACC,EAAiBC,IACjCD,IAAW,OACPC,EAEJA,IAAW,OACPD,EAED,GAAGA,CAAM,IAAIC,CAAM,GAG3B,OACCb,KAAA,YACAQ,KAAA,SACAH,KAAA,YACAI,KAAA,YACAC,KAAA,oBACAC,KAAA",
6
+ "names": ["getCurrentRuntimeIndex", "compareRuntimes", "isSSR", "stylesheetMap", "getStyleId", "name", "value", "shouldUpdate", "runtimeIndex", "createStyle", "content", "theme", "currentRuntimeIndex", "stylesheet", "updateStyle", "sh", "stylesheetRuntimeIndex", "hasStyle", "removeStyle", "createOrUpdateStyle", "mergeStyles", "style1", "style2"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";import{getTheme as a}from"../InitialConfiguration.js";import{reRenderAllUI5Elements as n}from"../Render.js";import i from"../theming/applyTheme.js";import h from"../theming/getThemeDesignerTheme.js";import{DEFAULT_THEME as g,SUPPORTED_THEMES as f}from"../generated/AssetParameters.js";import{boot as u,isBooted as s}from"../Boot.js";import{attachConfigurationReset as T}from"./ConfigurationReset.js";import{fireConfigChange as c,attachConfigChange as d,getSharedValue as p}from"./ConfigurationSync.js";let t,o;T(()=>{t=void 0}),d("theme",e=>{t=e,s()&&i(t).then(()=>n({themeAware:!0}))});const r=()=>(t===void 0&&(t=p("theme")??a()),t),l=async e=>{t!==e&&(t=e,c("theme",e),s()&&(await i(t),await n({themeAware:!0})))},y=()=>g,E=e=>r()===e,m=()=>{const e=r();return C(e)?!e.startsWith("sap_horizon"):!h()?.baseThemeName?.startsWith("sap_horizon")},w=async()=>(await u(),m()),C=e=>f.includes(e),A=()=>o,B=e=>{o=e};export{r as getTheme,l as setTheme,E as isTheme,m as isLegacyThemeFamily,w as isLegacyThemeFamilyAsync,y as getDefaultTheme,A as getBaseTheme,B as setBaseTheme};
1
+ "use strict";import{getTheme as h}from"../InitialConfiguration.js";import{reRenderAllUI5Elements as n}from"../Render.js";import i from"../theming/applyTheme.js";import{DEFAULT_THEME as g,SUPPORTED_THEMES as f}from"../generated/AssetParameters.js";import{boot as u,isBooted as s}from"../Boot.js";import{attachConfigurationReset as c}from"./ConfigurationReset.js";import{fireConfigChange as d,attachConfigChange as T,getSharedValue as p}from"./ConfigurationSync.js";let t,o;c(()=>{t=void 0}),T("theme",e=>{t=e,s()&&i(t).then(()=>n({themeAware:!0}))});const r=()=>(t===void 0&&(t=p("theme")??h()),t),l=async e=>{t!==e&&(t=e,d("theme",e),s()&&(await i(t),await n({themeAware:!0})))},y=()=>g,E=e=>r()===e,m=()=>{const e=r();return C(e)?!e.startsWith("sap_horizon"):!a()?.startsWith("sap_horizon")},w=async()=>(await u(),m()),C=e=>f.includes(e),a=()=>o,A=e=>{o=e};export{r as getTheme,l as setTheme,E as isTheme,m as isLegacyThemeFamily,w as isLegacyThemeFamilyAsync,y as getDefaultTheme,a as getBaseTheme,A as setBaseTheme};
2
2
  //# sourceMappingURL=Theme.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/config/Theme.ts"],
4
- "sourcesContent": ["import { getTheme as getConfiguredTheme } from \"../InitialConfiguration.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport applyTheme from \"../theming/applyTheme.js\";\nimport getThemeDesignerTheme from \"../theming/getThemeDesignerTheme.js\";\nimport { DEFAULT_THEME, SUPPORTED_THEMES } from \"../generated/AssetParameters.js\";\nimport { boot, isBooted } from \"../Boot.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\nimport { fireConfigChange, attachConfigChange, getSharedValue } from \"./ConfigurationSync.js\";\n\nlet curTheme: string | undefined;\nlet curBaseTheme: string | undefined;\n\nattachConfigurationReset(() => {\n\tcurTheme = undefined;\n});\n\nattachConfigChange(\"theme\", (theme: string) => {\n\tcurTheme = theme;\n\tif (isBooted()) {\n\t\tapplyTheme(curTheme).then(() => reRenderAllUI5Elements({ themeAware: true }));\n\t}\n});\n\n/**\n * Returns the current theme.\n * @public\n * @returns {string} the current theme name\n */\nconst getTheme = (): string => {\n\tif (curTheme === undefined) {\n\t\tcurTheme = getSharedValue<string>(\"theme\") ?? getConfiguredTheme();\n\t}\n\n\treturn curTheme;\n};\n\n/**\n * Applies a new theme after fetching its assets from the network.\n * @public\n * @param {string} theme the name of the new theme\n * @returns {Promise<void>} a promise that is resolved when the new theme assets have been fetched and applied to the DOM\n */\nconst setTheme = async (theme: string): Promise<void> => {\n\tif (curTheme === theme) {\n\t\treturn;\n\t}\n\n\tcurTheme = theme;\n\n\tfireConfigChange(\"theme\", theme);\n\n\tif (isBooted()) {\n\t\t// Update CSS Custom Properties\n\t\tawait applyTheme(curTheme);\n\t\tawait reRenderAllUI5Elements({ themeAware: true });\n\t}\n};\n\n/**\n * Returns the default theme.\n *\n * Note: Default theme might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultTheme = (): string => {\n\treturn DEFAULT_THEME;\n};\n\n/**\n * Returns if the given theme name is the one currently applied.\n * @private\n * @param {string} theme\n * @returns {boolean}\n */\nconst isTheme = (theme: string) => {\n\treturn getTheme() === theme;\n};\n\n/**\n * Returns if the currently set theme is part of legacy theme families (\"sap_fiori_3\").\n * **Note**: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.\n *\n * @private\n * @returns { boolean }\n */\nconst isLegacyThemeFamily = () => {\n\tconst currentTheme = getTheme();\n\n\tif (!isKnownTheme(currentTheme)) {\n\t\treturn !getThemeDesignerTheme()?.baseThemeName?.startsWith(\"sap_horizon\");\n\t}\n\n\treturn !currentTheme.startsWith(\"sap_horizon\");\n};\n\nconst isLegacyThemeFamilyAsync = async () => {\n\tawait boot();\n\treturn isLegacyThemeFamily();\n};\n\nconst isKnownTheme = (theme: string) => SUPPORTED_THEMES.includes(theme);\n\n/**\n * Returns the base theme of external theme.\n * @private\n * @returns {string | undefined} the base theme name\n */\nconst getBaseTheme = (): string | undefined => {\n\treturn curBaseTheme;\n};\n\n/**\n * Sets the base theme of the current external theme.\n * @param { string | undefined } theme the name of the new base theme\n * @private\n */\nconst setBaseTheme = (theme: string | undefined): void => {\n\tcurBaseTheme = theme;\n};\n\nexport {\n\tgetTheme,\n\tsetTheme,\n\tisTheme,\n\tisLegacyThemeFamily,\n\tisLegacyThemeFamilyAsync,\n\tgetDefaultTheme,\n\tgetBaseTheme,\n\tsetBaseTheme,\n};\n"],
5
- "mappings": "aAAA,OAAS,YAAYA,MAA0B,6BAC/C,OAAS,0BAAAC,MAA8B,eACvC,OAAOC,MAAgB,2BACvB,OAAOC,MAA2B,sCAClC,OAAS,iBAAAC,EAAe,oBAAAC,MAAwB,kCAChD,OAAS,QAAAC,EAAM,YAAAC,MAAgB,aAC/B,OAAS,4BAAAC,MAAgC,0BACzC,OAAS,oBAAAC,EAAkB,sBAAAC,EAAoB,kBAAAC,MAAsB,yBAErE,IAAIC,EACAC,EAEJL,EAAyB,IAAM,CAC9BI,EAAW,MACZ,CAAC,EAEDF,EAAmB,QAAUI,GAAkB,CAC9CF,EAAWE,EACPP,EAAS,GACZL,EAAWU,CAAQ,EAAE,KAAK,IAAMX,EAAuB,CAAE,WAAY,EAAK,CAAC,CAAC,CAE9E,CAAC,EAOD,MAAMc,EAAW,KACZH,IAAa,SAChBA,EAAWD,EAAuB,OAAO,GAAKX,EAAmB,GAG3DY,GASFI,EAAW,MAAOF,GAAiC,CACpDF,IAAaE,IAIjBF,EAAWE,EAEXL,EAAiB,QAASK,CAAK,EAE3BP,EAAS,IAEZ,MAAML,EAAWU,CAAQ,EACzB,MAAMX,EAAuB,CAAE,WAAY,EAAK,CAAC,GAEnD,EAUMgB,EAAkB,IAChBb,EASFc,EAAWJ,GACTC,EAAS,IAAMD,EAUjBK,EAAsB,IAAM,CACjC,MAAMC,EAAeL,EAAS,EAE9B,OAAKM,EAAaD,CAAY,EAIvB,CAACA,EAAa,WAAW,aAAa,EAHrC,CAACjB,EAAsB,GAAG,eAAe,WAAW,aAAa,CAI1E,EAEMmB,EAA2B,UAChC,MAAMhB,EAAK,EACJa,EAAoB,GAGtBE,EAAgBP,GAAkBT,EAAiB,SAASS,CAAK,EAOjES,EAAe,IACbV,EAQFW,EAAgBV,GAAoC,CACzDD,EAAeC,CAChB,EAEA,OACCC,KAAA,SACAC,KAAA,SACAE,KAAA,QACAC,KAAA,oBACAG,KAAA,yBACAL,KAAA,gBACAM,KAAA,aACAC,KAAA",
6
- "names": ["getConfiguredTheme", "reRenderAllUI5Elements", "applyTheme", "getThemeDesignerTheme", "DEFAULT_THEME", "SUPPORTED_THEMES", "boot", "isBooted", "attachConfigurationReset", "fireConfigChange", "attachConfigChange", "getSharedValue", "curTheme", "curBaseTheme", "theme", "getTheme", "setTheme", "getDefaultTheme", "isTheme", "isLegacyThemeFamily", "currentTheme", "isKnownTheme", "isLegacyThemeFamilyAsync", "getBaseTheme", "setBaseTheme"]
4
+ "sourcesContent": ["import { getTheme as getConfiguredTheme } from \"../InitialConfiguration.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport applyTheme from \"../theming/applyTheme.js\";\nimport { DEFAULT_THEME, SUPPORTED_THEMES } from \"../generated/AssetParameters.js\";\nimport { boot, isBooted } from \"../Boot.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\nimport { fireConfigChange, attachConfigChange, getSharedValue } from \"./ConfigurationSync.js\";\n\nlet curTheme: string | undefined;\nlet curBaseTheme: string | undefined;\n\nattachConfigurationReset(() => {\n\tcurTheme = undefined;\n});\n\nattachConfigChange(\"theme\", (theme: string) => {\n\tcurTheme = theme;\n\tif (isBooted()) {\n\t\tapplyTheme(curTheme).then(() => reRenderAllUI5Elements({ themeAware: true }));\n\t}\n});\n\n/**\n * Returns the current theme.\n * @public\n * @returns {string} the current theme name\n */\nconst getTheme = (): string => {\n\tif (curTheme === undefined) {\n\t\tcurTheme = getSharedValue<string>(\"theme\") ?? getConfiguredTheme();\n\t}\n\n\treturn curTheme;\n};\n\n/**\n * Applies a new theme after fetching its assets from the network.\n * @public\n * @param {string} theme the name of the new theme\n * @returns {Promise<void>} a promise that is resolved when the new theme assets have been fetched and applied to the DOM\n */\nconst setTheme = async (theme: string): Promise<void> => {\n\tif (curTheme === theme) {\n\t\treturn;\n\t}\n\n\tcurTheme = theme;\n\n\tfireConfigChange(\"theme\", theme);\n\n\tif (isBooted()) {\n\t\t// Update CSS Custom Properties\n\t\tawait applyTheme(curTheme);\n\t\tawait reRenderAllUI5Elements({ themeAware: true });\n\t}\n};\n\n/**\n * Returns the default theme.\n *\n * Note: Default theme might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultTheme = (): string => {\n\treturn DEFAULT_THEME;\n};\n\n/**\n * Returns if the given theme name is the one currently applied.\n * @private\n * @param {string} theme\n * @returns {boolean}\n */\nconst isTheme = (theme: string) => {\n\treturn getTheme() === theme;\n};\n\n/**\n * Returns if the currently set theme is part of legacy theme families (\"sap_fiori_3\").\n * **Note**: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.\n *\n * @private\n * @returns { boolean }\n */\nconst isLegacyThemeFamily = () => {\n\tconst currentTheme = getTheme();\n\n\tif (!isKnownTheme(currentTheme)) {\n\t\treturn !getBaseTheme()?.startsWith(\"sap_horizon\");\n\t}\n\n\treturn !currentTheme.startsWith(\"sap_horizon\");\n};\n\nconst isLegacyThemeFamilyAsync = async () => {\n\tawait boot();\n\treturn isLegacyThemeFamily();\n};\n\nconst isKnownTheme = (theme: string) => SUPPORTED_THEMES.includes(theme);\n\n/**\n * Returns the base theme of external theme.\n * @private\n * @returns {string | undefined} the base theme name\n */\nconst getBaseTheme = (): string | undefined => {\n\treturn curBaseTheme;\n};\n\n/**\n * Sets the base theme of the current external theme.\n * @param { string | undefined } theme the name of the new base theme\n * @private\n */\nconst setBaseTheme = (theme: string | undefined): void => {\n\tcurBaseTheme = theme;\n};\n\nexport {\n\tgetTheme,\n\tsetTheme,\n\tisTheme,\n\tisLegacyThemeFamily,\n\tisLegacyThemeFamilyAsync,\n\tgetDefaultTheme,\n\tgetBaseTheme,\n\tsetBaseTheme,\n};\n"],
5
+ "mappings": "aAAA,OAAS,YAAYA,MAA0B,6BAC/C,OAAS,0BAAAC,MAA8B,eACvC,OAAOC,MAAgB,2BACvB,OAAS,iBAAAC,EAAe,oBAAAC,MAAwB,kCAChD,OAAS,QAAAC,EAAM,YAAAC,MAAgB,aAC/B,OAAS,4BAAAC,MAAgC,0BACzC,OAAS,oBAAAC,EAAkB,sBAAAC,EAAoB,kBAAAC,MAAsB,yBAErE,IAAIC,EACAC,EAEJL,EAAyB,IAAM,CAC9BI,EAAW,MACZ,CAAC,EAEDF,EAAmB,QAAUI,GAAkB,CAC9CF,EAAWE,EACPP,EAAS,GACZJ,EAAWS,CAAQ,EAAE,KAAK,IAAMV,EAAuB,CAAE,WAAY,EAAK,CAAC,CAAC,CAE9E,CAAC,EAOD,MAAMa,EAAW,KACZH,IAAa,SAChBA,EAAWD,EAAuB,OAAO,GAAKV,EAAmB,GAG3DW,GASFI,EAAW,MAAOF,GAAiC,CACpDF,IAAaE,IAIjBF,EAAWE,EAEXL,EAAiB,QAASK,CAAK,EAE3BP,EAAS,IAEZ,MAAMJ,EAAWS,CAAQ,EACzB,MAAMV,EAAuB,CAAE,WAAY,EAAK,CAAC,GAEnD,EAUMe,EAAkB,IAChBb,EASFc,EAAWJ,GACTC,EAAS,IAAMD,EAUjBK,EAAsB,IAAM,CACjC,MAAMC,EAAeL,EAAS,EAE9B,OAAKM,EAAaD,CAAY,EAIvB,CAACA,EAAa,WAAW,aAAa,EAHrC,CAACE,EAAa,GAAG,WAAW,aAAa,CAIlD,EAEMC,EAA2B,UAChC,MAAMjB,EAAK,EACJa,EAAoB,GAGtBE,EAAgBP,GAAkBT,EAAiB,SAASS,CAAK,EAOjEQ,EAAe,IACbT,EAQFW,EAAgBV,GAAoC,CACzDD,EAAeC,CAChB,EAEA,OACCC,KAAA,SACAC,KAAA,SACAE,KAAA,QACAC,KAAA,oBACAI,KAAA,yBACAN,KAAA,gBACAK,KAAA,aACAE,KAAA",
6
+ "names": ["getConfiguredTheme", "reRenderAllUI5Elements", "applyTheme", "DEFAULT_THEME", "SUPPORTED_THEMES", "boot", "isBooted", "attachConfigurationReset", "fireConfigChange", "attachConfigChange", "getSharedValue", "curTheme", "curBaseTheme", "theme", "getTheme", "setTheme", "getDefaultTheme", "isTheme", "isLegacyThemeFamily", "currentTheme", "isKnownTheme", "getBaseTheme", "isLegacyThemeFamilyAsync", "setBaseTheme"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";const e={version:"2.27.0-rc.0",major:2,minor:27,patch:0,suffix:"-rc.0",isNext:!1,buildTime:1787935420};export default e;
1
+ "use strict";const e={version:"2.27.0-rc.2",major:2,minor:27,patch:0,suffix:"-rc.2",isNext:!1,buildTime:1789632712};export default e;
2
2
  //# sourceMappingURL=VersionInfo.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/generated/VersionInfo.ts"],
4
- "sourcesContent": ["const VersionInfo = {\n\tversion: \"2.27.0-rc.0\",\n\tmajor: 2,\n\tminor: 27,\n\tpatch: 0,\n\tsuffix: \"-rc.0\",\n\tisNext: false,\n\tbuildTime: 1787935420,\n};\nexport default VersionInfo;"],
4
+ "sourcesContent": ["const VersionInfo = {\n\tversion: \"2.27.0-rc.2\",\n\tmajor: 2,\n\tminor: 27,\n\tpatch: 0,\n\tsuffix: \"-rc.2\",\n\tisNext: false,\n\tbuildTime: 1789632712,\n};\nexport default VersionInfo;"],
5
5
  "mappings": "aAAA,MAAMA,EAAc,CACnB,QAAS,cACT,MAAO,EACP,MAAO,GACP,MAAO,EACP,OAAQ,QACR,OAAQ,GACR,UAAW,UACZ,EACA,eAAeA",
6
6
  "names": ["VersionInfo"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";export default oURLListValidator;
2
+ //# sourceMappingURL=URLListValidator.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/sap/base/security/URLListValidator.d.ts"],
4
+ "sourcesContent": ["declare const oURLListValidator: any;\nexport default oURLListValidator;\n"],
5
+ "mappings": "aACA,eAAe",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ declare const oURLListValidator: any;
2
+ export default oURLListValidator;
@@ -0,0 +1,2 @@
1
+ "use strict";export default fnSanitizeHTML;
2
+ //# sourceMappingURL=sanitizeHTML.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/sap/base/security/sanitizeHTML.d.ts"],
4
+ "sourcesContent": ["declare const fnSanitizeHTML: any;\nexport default fnSanitizeHTML;\n"],
5
+ "mappings": "aACA,eAAe",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ declare const fnSanitizeHTML: any;
2
+ export default fnSanitizeHTML;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/util/HTMLSanitizer.ts"],
4
- "sourcesContent": ["/** @ts-expect-error */\nimport sanitizeHTML from \"../sap/base/security/sanitizeHTML.js\";\n/** @ts-expect-error */\nimport URLListValidator from \"../sap/base/security/URLListValidator.js\";\n\nexport {\n\tURLListValidator,\n\tsanitizeHTML,\n};\n"],
5
- "mappings": "aACA,OAAOA,MAAkB,uCAEzB,OAAOC,MAAsB,2CAE7B,OACCA,KAAA,iBACAD,KAAA",
4
+ "sourcesContent": ["import sanitizeHTML from \"../sap/base/security/sanitizeHTML.js\";\nimport URLListValidator from \"../sap/base/security/URLListValidator.js\";\n\nexport {\n\tURLListValidator,\n\tsanitizeHTML,\n};\n"],
5
+ "mappings": "aAAA,OAAOA,MAAkB,uCACzB,OAAOC,MAAsB,2CAE7B,OACCA,KAAA,iBACAD,KAAA",
6
6
  "names": ["sanitizeHTML", "URLListValidator"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ declare const oURLListValidator: any;
2
+ export default oURLListValidator;
@@ -0,0 +1,2 @@
1
+ declare const fnSanitizeHTML: any;
2
+ export default fnSanitizeHTML;
@@ -1,5 +1,3 @@
1
- /** @ts-expect-error */
2
1
  import sanitizeHTML from "../sap/base/security/sanitizeHTML.js";
3
- /** @ts-expect-error */
4
2
  import URLListValidator from "../sap/base/security/URLListValidator.js";
5
3
  export { URLListValidator, sanitizeHTML, };
@@ -1,6 +1,4 @@
1
- /** @ts-expect-error */
2
1
  import sanitizeHTML from "../sap/base/security/sanitizeHTML.js";
3
- /** @ts-expect-error */
4
2
  import URLListValidator from "../sap/base/security/URLListValidator.js";
5
3
  export { URLListValidator, sanitizeHTML, };
6
4
  //# sourceMappingURL=HTMLSanitizer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HTMLSanitizer.js","sourceRoot":"","sources":["../../src/util/HTMLSanitizer.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,OAAO,YAAY,MAAM,sCAAsC,CAAC;AAChE,uBAAuB;AACvB,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AAExE,OAAO,EACN,gBAAgB,EAChB,YAAY,GACZ,CAAC","sourcesContent":["/** @ts-expect-error */\nimport sanitizeHTML from \"../sap/base/security/sanitizeHTML.js\";\n/** @ts-expect-error */\nimport URLListValidator from \"../sap/base/security/URLListValidator.js\";\n\nexport {\n\tURLListValidator,\n\tsanitizeHTML,\n};\n"]}
1
+ {"version":3,"file":"HTMLSanitizer.js","sourceRoot":"","sources":["../../src/util/HTMLSanitizer.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,sCAAsC,CAAC;AAChE,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AAExE,OAAO,EACN,gBAAgB,EAChB,YAAY,GACZ,CAAC","sourcesContent":["import sanitizeHTML from \"../sap/base/security/sanitizeHTML.js\";\nimport URLListValidator from \"../sap/base/security/URLListValidator.js\";\n\nexport {\n\tURLListValidator,\n\tsanitizeHTML,\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-base",
3
- "version": "2.27.0-rc.0",
3
+ "version": "2.27.0-rc.2",
4
4
  "description": "UI5 Web Components: webcomponents.base",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -66,7 +66,7 @@
66
66
  "@openui5/sap.ui.core": "1.151.0",
67
67
  "@sap-theming/theming-base-content": "11.36.4",
68
68
  "@ui5/cypress-internal": "0.1.0",
69
- "@ui5/webcomponents-tools": "2.27.0-rc.0",
69
+ "@ui5/webcomponents-tools": "2.27.0-rc.2",
70
70
  "clean-css": "^5.2.2",
71
71
  "cypress": "15.18.1",
72
72
  "mocha": "^11.7.2",
@@ -85,5 +85,5 @@
85
85
  }
86
86
  },
87
87
  "customElements": "dist/custom-elements.json",
88
- "gitHead": "053bb4316b0b85cc05bce4335d910122a279dcd7"
88
+ "gitHead": "ed68024790c2ca5f3eddb25055e87883f5535515"
89
89
  }