@sap-ux/control-property-editor 0.7.2 → 0.7.3

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "displayName": "Control Property Editor",
4
4
  "description": "Control Property Editor",
5
5
  "license": "Apache-2.0",
6
- "version": "0.7.2",
6
+ "version": "0.7.3",
7
7
  "main": "dist/app.js",
8
8
  "repository": {
9
9
  "type": "git",
@@ -48,7 +48,7 @@
48
48
  "esbuild-plugin-copy": "2.1.1",
49
49
  "@esbuild-plugins/node-modules-polyfill": "0.2.2",
50
50
  "uuid": "11.0.5",
51
- "@sap-ux/ui-components": "1.26.14",
51
+ "@sap-ux/ui-components": "1.26.16",
52
52
  "@sap-ux-private/control-property-editor-common": "0.7.2"
53
53
  },
54
54
  "scripts": {
@@ -128,5 +128,5 @@ export function ThemeSelectorCallout(): ReactElement {
128
128
  * @param themeName - ThemeName
129
129
  */
130
130
  export function setThemeOnDocument(themeName: ThemeName): void {
131
- document.getElementsByTagName('HTML')[0].setAttribute('data-theme', themeName);
131
+ document.documentElement.dataset.theme = themeName;
132
132
  }
package/src/use-theme.ts CHANGED
@@ -12,7 +12,7 @@ export function useTheme(): [ThemeName, React.Dispatch<ThemeName>] {
12
12
  const [theme, setTheme] = useLocalStorage<ThemeName>('theme', 'dark modern');
13
13
 
14
14
  useEffect(() => {
15
- document.getElementsByTagName('HTML')[0].setAttribute('data-theme', theme);
15
+ document.documentElement.dataset.theme = theme;
16
16
  }, [theme]);
17
17
 
18
18
  return [theme, setTheme];