@record-evolution/widget-mapbox 1.5.4 → 1.5.5

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
  "description": "REWidget widget-mapbox",
4
4
  "license": "MIT",
5
5
  "author": "widget-mapbox",
6
- "version": "1.5.4",
6
+ "version": "1.5.5",
7
7
  "type": "module",
8
8
  "main": "dist/widget-mapbox.js",
9
9
  "types": "dist/src/widget-mapbox.d.ts",
@@ -65,24 +65,29 @@ export class WidgetMapbox extends LitElement {
65
65
  }
66
66
 
67
67
  if (changedProperties.has('theme')) {
68
- const cssTextColor = getComputedStyle(this).getPropertyValue('--re-text-color').trim()
69
- const cssBgColor = getComputedStyle(this).getPropertyValue('--re-background-color').trim()
70
- this.themeBgColor = cssBgColor || this.theme?.theme_object?.backgroundColor
71
- this.themeTitleColor = cssTextColor || this.theme?.theme_object?.title?.textStyle?.color
72
- this.themeSubtitleColor =
73
- cssTextColor || this.theme?.theme_object?.title?.subtextStyle?.color || this.themeTitleColor
68
+ this.registerTheme(this.theme)
74
69
  }
75
70
 
76
71
  super.update(changedProperties)
77
72
  }
78
73
 
79
74
  firstUpdated() {
75
+ this.registerTheme(this.theme)
80
76
  this.transformInputData()
81
77
  this.createMap()
82
78
  this.resizeObserver.observe(this.map._container)
83
79
  this.fitBounds()
84
80
  }
85
81
 
82
+ registerTheme(theme?: Theme) {
83
+ const cssTextColor = getComputedStyle(this).getPropertyValue('--re-text-color').trim()
84
+ const cssBgColor = getComputedStyle(this).getPropertyValue('--re-background-color').trim()
85
+ this.themeBgColor = cssBgColor || this.theme?.theme_object?.backgroundColor
86
+ this.themeTitleColor = cssTextColor || this.theme?.theme_object?.title?.textStyle?.color
87
+ this.themeSubtitleColor =
88
+ cssTextColor || this.theme?.theme_object?.title?.subtextStyle?.color || this.themeTitleColor
89
+ }
90
+
86
91
  updateMap() {
87
92
  if (this.customDebounce) clearTimeout(this.customDebounce)
88
93