@record-evolution/widget-mapbox 1.5.3 → 1.5.4

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.3",
6
+ "version": "1.5.4",
7
7
  "type": "module",
8
8
  "main": "dist/widget-mapbox.js",
9
9
  "types": "dist/src/widget-mapbox.d.ts",
@@ -13,51 +13,49 @@
13
13
  ],
14
14
  "scripts": {
15
15
  "analyze": "cem analyze --litelement",
16
- "start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
16
+ "start": "concurrently -k -r \"npm run watch\" \"wds\"",
17
17
  "build": "rollup -c rollup.config.js",
18
18
  "watch": "rollup -w -c rollup.config.js",
19
19
  "link": "npm link && cd ../RESWARM/frontend && npm link @record-evolution/widget-mapbox",
20
20
  "unlink": "npm unlink --global && cd ../RESWARM/frontend && npm unlink @record-evolution/widget-mapbox && npm i @record-evolution/widget-mapbox",
21
21
  "types": "cat src/definition-schema.json | json2ts > src/definition-schema.d.ts",
22
- "lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
23
- "format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
24
22
  "release": "npm version patch --tag-version-prefix='' && git push && git push --tag",
25
23
  "cors": "gcloud storage buckets update gs://reswarm-images --cors-file=src/cors-config.json"
26
24
  },
27
25
  "dependencies": {
28
- "@types/geojson": "^7946.0.14",
29
- "@types/mapbox-gl": "^3.4.0",
30
- "lit": "^3.2.0",
31
- "mapbox-gl": "^3.7.0",
26
+ "@types/geojson": "^7946.0.16",
27
+ "@types/mapbox-gl": "^3.4.1",
28
+ "lit": "^3.3.0",
29
+ "mapbox-gl": "^3.13.0",
32
30
  "tinycolor2": "^1.6.0"
33
31
  },
34
32
  "devDependencies": {
35
- "@babel/plugin-syntax-import-assertions": "^7.25.7",
36
- "@custom-elements-manifest/analyzer": "^0.10.3",
33
+ "@babel/plugin-syntax-import-assertions": "^7.27.1",
34
+ "@custom-elements-manifest/analyzer": "^0.10.4",
37
35
  "@rollup/plugin-babel": "^6.0.4",
38
- "@rollup/plugin-commonjs": "^28.0.0",
36
+ "@rollup/plugin-commonjs": "^28.0.6",
39
37
  "@rollup/plugin-json": "^6.1.0",
40
- "@rollup/plugin-node-resolve": "^15.3.0",
41
- "@rollup/plugin-replace": "^6.0.1",
42
- "@rollup/plugin-typescript": "^12.1.0",
38
+ "@rollup/plugin-node-resolve": "^16.0.1",
39
+ "@rollup/plugin-replace": "^6.0.2",
40
+ "@rollup/plugin-typescript": "^12.1.3",
43
41
  "@types/glob": "^8.1.0",
44
42
  "@types/tinycolor2": "^1.4.6",
45
- "@typescript-eslint/eslint-plugin": "^8.8.0",
46
- "@typescript-eslint/parser": "^8.8.0",
43
+ "@typescript-eslint/eslint-plugin": "^8.34.1",
44
+ "@typescript-eslint/parser": "^8.34.1",
47
45
  "@web/dev-server": "^0.4.6",
48
- "concurrently": "^9.0.1",
49
- "eslint": "^9.12.0",
50
- "eslint-config-prettier": "^9.1.0",
51
- "glob": "^11.0.0",
52
- "husky": "^9.1.6",
53
- "json-schema-to-typescript": "^15.0.2",
54
- "lint-staged": "^15.2.10",
55
- "minimatch": "3.1.2",
56
- "prettier": "^3.3.3",
57
- "rollup": "^4.24.0",
46
+ "concurrently": "^9.1.2",
47
+ "eslint": "^9.29.0",
48
+ "eslint-config-prettier": "^10.1.5",
49
+ "glob": "^11.0.3",
50
+ "husky": "^9.1.7",
51
+ "json-schema-to-typescript": "^15.0.4",
52
+ "lint-staged": "^16.1.2",
53
+ "minimatch": "10.0.3",
54
+ "prettier": "^3.5.3",
55
+ "rollup": "^4.43.0",
58
56
  "rollup-plugin-copy": "^3.5.0",
59
- "tslib": "^2.7.0",
60
- "typescript": "5.3.2"
57
+ "tslib": "^2.8.1",
58
+ "typescript": "5.8.3"
61
59
  },
62
60
  "repository": {
63
61
  "type": "git",
@@ -1,4 +1,6 @@
1
1
  {
2
+ "title": "Test",
3
+ "subTitle": "Subtitle",
2
4
  "style": "light-v11",
3
5
  "showLegend": false,
4
6
  "follow": false,
@@ -10,10 +10,17 @@ import { LayerBaseColor, InputData } from './definition-schema.js'
10
10
 
11
11
  type Dataseries = Exclude<InputData['dataseries'], undefined>[number]
12
12
  type Point = Exclude<Dataseries['data'], undefined>[number]
13
-
13
+ type Theme = {
14
+ theme_name: string
15
+ theme_object: any
16
+ }
14
17
  export class WidgetMapbox extends LitElement {
15
18
  @property({ type: Object })
16
19
  inputData?: InputData
20
+
21
+ @property({ type: Object })
22
+ theme?: Theme
23
+
17
24
  @state()
18
25
  private map: any | undefined = undefined
19
26
 
@@ -26,6 +33,10 @@ export class WidgetMapbox extends LitElement {
26
33
  @state()
27
34
  colors: any = new Map()
28
35
 
36
+ @state() private themeBgColor?: string
37
+ @state() private themeTitleColor?: string
38
+ @state() private themeSubtitleColor?: string
39
+
29
40
  public version: string = 'versionplaceholder'
30
41
  private mapLoaded: boolean = false
31
42
  private resizeObserver: ResizeObserver
@@ -52,6 +63,16 @@ export class WidgetMapbox extends LitElement {
52
63
  if (changedProperties.has('inputData')) {
53
64
  this.transformInputData()
54
65
  }
66
+
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
74
+ }
75
+
55
76
  super.update(changedProperties)
56
77
  }
57
78
 
@@ -539,9 +560,7 @@ export class WidgetMapbox extends LitElement {
539
560
  static styles = css`
540
561
  :host {
541
562
  display: block;
542
- color: var(--re-bar-text-color, #000);
543
563
  font-family: sans-serif;
544
- padding: 16px;
545
564
  box-sizing: border-box;
546
565
  margin: auto;
547
566
  }
@@ -576,6 +595,8 @@ export class WidgetMapbox extends LitElement {
576
595
  .wrapper {
577
596
  display: flex;
578
597
  flex-direction: column;
598
+ box-sizing: border-box;
599
+ padding: 16px;
579
600
  height: 100%;
580
601
  width: 100%;
581
602
  }
@@ -606,7 +627,6 @@ export class WidgetMapbox extends LitElement {
606
627
 
607
628
  .no-data {
608
629
  font-size: 20px;
609
- color: var(--re-text-color, #000);
610
630
  display: flex;
611
631
  height: 100%;
612
632
  width: 100%;
@@ -622,11 +642,20 @@ export class WidgetMapbox extends LitElement {
622
642
  href="https://api.mapbox.com/mapbox-gl-js/v${mapboxgl.version}/mapbox-gl.css"
623
643
  rel="stylesheet"
624
644
  />
625
- <div class="wrapper">
645
+ <div
646
+ class="wrapper"
647
+ style="background-color: ${this.themeBgColor}; color: ${this.themeTitleColor}"
648
+ >
626
649
  <header class="paging" ?active=${this.inputData?.title || this.inputData?.subTitle}>
627
650
  <div class="title">
628
651
  <h3 class="paging" ?active=${this.inputData?.title}>${this.inputData?.title}</h3>
629
- <p class="paging" ?active=${this.inputData?.subTitle}>${this.inputData?.subTitle}</p>
652
+ <p
653
+ class="paging"
654
+ ?active=${this.inputData?.subTitle}
655
+ style="color: ${this.themeSubtitleColor}"
656
+ >
657
+ ${this.inputData?.subTitle}
658
+ </p>
630
659
  </div>
631
660
  <div class="legend paging" ?active=${this?.inputData?.showLegend}>
632
661
  ${repeat(