@geogirafe/lib-geoportal 1.2.0-dev.2901604715 → 1.2.0-dev.2914140972

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.
@@ -9,7 +9,7 @@ class InfoboxComponent extends GirafeHTMLElement {
9
9
  return uHtml `<style>
10
10
  .hidden{display:none!important}.gg-rotate90{transform:rotate(90deg)}.gg-rotate180{transform:rotate(180deg)}.gg-rotate270{transform:rotate(270deg)}img{filter:var(--svg-filter)}img.legend-image{filter:var(--svg-map-filter);background:var(--svg-legend-bkg)}div{scrollbar-width:thin}a,a:visited{color:var(--link-color)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes spin-wait{0%{transform:rotate(0)}7%{transform:rotate(360deg)}to{transform:rotate(360deg)}}.gg-spin{animation-name:spin;animation-duration:2s;animation-timing-function:linear;animation-iteration-count:infinite}.gg-spin-wait{animation-name:spin-wait;animation-duration:10s;animation-timing-function:linear;animation-iteration-count:infinite}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-thumb{background:#999}button,input,select,textarea{font:inherit}.gg-button,.gg-select,.gg-input,.gg-textarea{background-color:var(--bkg-color);color:var(--text-color);border:var(--app-standard-border);box-sizing:border-box;cursor:pointer;border-radius:3px;outline:0;margin:0;padding:0 0 0 .5rem;display:inline-block}.gg-label{background-color:var(--bkg-color);color:var(--text-color);border:none;align-items:center;margin:0;padding:0;display:flex}.gg-button,.gg-select,.gg-input,.gg-label{min-height:calc(var(--app-standard-height) / 1.5)}.gg-textarea{max-height:initial;resize:vertical;height:6rem;padding:.5rem;line-height:1.3rem}.gg-input{cursor:text}.gg-checkbox{accent-color:var(--text-color);cursor:pointer;width:1.2rem}.gg-range{accent-color:var(--text-color)}.gg-button{padding:0 .5rem}.gg-button.active{border:solid 1px var(--text-color-grad1);background-color:var(--bkg-color-grad2)}.gg-button:disabled{background-color:var(--bkg-color-grad1);color:var(--text-color-grad2);cursor:not-allowed;border:none}.gg-button:disabled img{filter:opacity(.6)}.gg-input:disabled,.gg-select:disabled,.gg-textarea:disabled{background-color:var(--bkg-color-grad1);color:var(--text-color-grad2);cursor:not-allowed}.gg-button>img{vertical-align:middle}.gg-icon-button{color:var(--text-color);cursor:pointer;background-color:#0000;border:none;flex-direction:column;justify-content:center;align-items:center;padding:0;display:flex}.gg-icon{justify-content:center;align-items:center;display:flex}.gg-big,.gg-big-withtext{min-width:var(--app-standard-height);min-height:var(--app-standard-height);max-height:var(--app-standard-height)}.gg-big img,.gg-big-withtext img{width:calc(var(--app-standard-height) - 1.5rem);margin:0}.gg-big-withtext span{font-variant:small-caps;padding:0 1rem;font-size:.9rem}.gg-medium,.gg-medium-withtext{min-width:calc(var(--app-standard-height) / 1.2);min-height:calc(var(--app-standard-height) / 1.2);max-height:calc(var(--app-standard-height) / 1.2);flex-direction:row}.gg-medium img{width:calc(var(--app-standard-height) / 2.4);margin:0}.gg-medium-withtext img{width:calc(var(--app-standard-height) / 2.4);margin-left:.5rem}.gg-medium-withtext span{padding:0 1rem 0 .5rem;font-size:.9rem}.gg-small,.gg-small-withtext{min-width:calc(var(--app-standard-height) / 2);min-height:calc(var(--app-standard-height) / 2);max-height:calc(var(--app-standard-height) / 2);flex-direction:row}.gg-small img{width:calc(var(--app-standard-height) / 3);margin:0}.gg-small-withtext img{width:calc(var(--app-standard-height) / 3);margin-left:.5rem}.gg-small-withtext span{padding:0 .5rem 0 .3rem;font-size:.9rem}.gg-button:hover:not(:disabled),.gg-select:hover:not(:disabled),.gg-input:hover:not(:disabled),.gg-textarea:hover:not(:disabled),.gg-icon-button:hover:not(:disabled){background-color:var(--bkg-color-grad1)}.gg-opacity{opacity:.5}.gg-opacity:hover{opacity:1;background-color:#0000}.gg-tabs{cursor:pointer;grid-auto-flow:column;padding-bottom:1rem;font-size:1rem;display:grid}.gg-tab{border:none;border-bottom:var(--app-standard-border);cursor:pointer;color:var(--text-color);background:0 0;padding:.5rem}.gg-tab.active{border-bottom:solid 1px var(--text-color)}.girafe-button-big,.girafe-button-large,.girafe-button-small,.girafe-button-tiny{color:var(--text-color);background-color:#0000;border:none;flex-direction:column;display:flex}.girafe-button-big:hover,.girafe-button-large:hover,.girafe-button-small:hover,.girafe-button-tiny:hover{background-color:var(--bkg-color-grad1);cursor:pointer}.girafe-button-big.dark,.girafe-button-large.dark,.girafe-button-small.dark,.girafe-button-tiny.dark{background-color:var(--bkg-color);filter:invert()}.girafe-button-big{width:var(--app-standard-height);height:var(--app-standard-height);align-items:center;padding:1rem}.girafe-button-big img{overflow:hidden}.girafe-button-large{flex-direction:row}.girafe-button-large img{height:2rem;margin:.3rem}.girafe-button-large span{height:2rem;margin:.3rem;line-height:2rem}.girafe-button-small{min-width:calc(var(--app-standard-height) / 2);height:calc(var(--app-standard-height) / 2);align-items:center;padding:.5rem}.girafe-button-small img{overflow:hidden}.girafe-button-small span{text-align:left;text-overflow:ellipsis;width:100%;overflow:hidden}.girafe-button-tiny{align-items:center;width:1rem;height:1rem;padding:0}.girafe-button-tiny img{overflow:hidden}.girafe-onboarding-theme{background-color:var(--bkg-color)!important;color:var(--text-color)!important}.girafe-onboarding-theme button{background-color:var(--bkg-color)!important;color:var(--text-color)!important;text-shadow:none!important}.girafe-onboarding-theme button.driver-popover-close-btn{z-index:10000}.tippy-box{background-color:var(--bkg-color)!important;border:var(--app-standard-border)!important}.tippy-content{color:var(--text-color)!important}.tippy-arrow{color:var(--bkg-color)!important}.tippy-box[data-theme~=error]{background-color:var(--error-color);white-space:pre-line}div.tippy-box[data-theme=image-popup]{border:var(--app-standard-border)!important;& div.tippy-content{background-color:var(--bkg-color)!important;& img{max-width:20rem;max-height:20rem}}& div.tippy-arrow{color:var(--bkg-color)!important}}
11
11
  </style><style>
12
- .content{flex-direction:column-reverse;align-items:flex-start;gap:.5rem;display:flex}.content div{width:24rem;color:var(--text-color);border:1px solid #000;flex:1;padding:10px;line-height:1.5rem;position:relative}.content div.info{background-color:var(--bkg-color)}.content div.warning{background-color:var(--warning-color);color:#fff}.content div.error{background-color:var(--error-color);color:#fff}button{position:absolute;top:0;right:0}.content div.warning button,.content div.error button{filter:invert()}span{word-wrap:break-word}.content div.error i{background-color:var(--error-color);color:#fff}.content div.warning i{background-color:var(--warning-color);color:#fff}
12
+ .content{flex-direction:column-reverse;align-items:flex-start;gap:.5rem;display:flex}.content>div{width:24rem;color:var(--text-color);border:1px solid #000;flex:1;padding:10px;line-height:1.5rem;position:relative}.content>div.info{background-color:var(--bkg-color)}.content>div.warning{background-color:var(--warning-color);color:#fff}.content>div.error{background-color:var(--error-color);color:#fff}button{position:absolute;top:0;right:0}.content>div.warning button,.content>div.error button{filter:invert()}span{word-wrap:break-word}.content>div.error i{background-color:var(--error-color);color:#fff}.content>div.warning i{background-color:var(--warning-color);color:#fff}
13
13
  </style>
14
14
  <style>${this.customStyle}</style>
15
15
  <div class="content">${(this.state.infobox.elements ?? []).map(info => uHtml `<div class="${info.type}"><span i18n="${this.linkify(info.text)}"></span> <button class="gg-icon-button gg-small" onclick="${() => this.closeMessage(info)}" tip="Close message"><img alt="close-icon" src="icons/close.svg"></button></div>`)}</div>
@@ -6,7 +6,7 @@
6
6
  gap: 0.5rem;
7
7
  }
8
8
 
9
- .content div {
9
+ .content > div {
10
10
  position: relative;
11
11
  border: solid 1px black;
12
12
  width: 24rem;
@@ -16,16 +16,16 @@
16
16
  color: var(--text-color);
17
17
  }
18
18
 
19
- .content div.info {
19
+ .content > div.info {
20
20
  background-color: var(--bkg-color);
21
21
  }
22
22
 
23
- .content div.warning {
23
+ .content > div.warning {
24
24
  background-color: var(--warning-color);
25
25
  color: #fff;
26
26
  }
27
27
 
28
- .content div.error {
28
+ .content > div.error {
29
29
  background-color: var(--error-color);
30
30
  color: #fff;
31
31
  }
@@ -36,8 +36,8 @@ button {
36
36
  right: 0;
37
37
  }
38
38
 
39
- .content div.warning button,
40
- .content div.error button {
39
+ .content > div.warning button,
40
+ .content > div.error button {
41
41
  filter: invert(1);
42
42
  }
43
43
 
@@ -45,12 +45,12 @@ span {
45
45
  word-wrap: break-word;
46
46
  }
47
47
 
48
- .content div.error i {
48
+ .content > div.error i {
49
49
  background-color: var(--error-color);
50
50
  color: #fff;
51
51
  }
52
52
 
53
- .content div.warning i {
53
+ .content > div.warning i {
54
54
  background-color: var(--warning-color);
55
55
  color: #fff;
56
56
  }
@@ -92,13 +92,6 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
92
92
  this.onBlur();
93
93
  if (theme instanceof CustomTheme)
94
94
  return;
95
- if (theme.disclaimer) {
96
- this.state.infobox.elements.push({
97
- id: theme.treeItemId,
98
- text: theme.disclaimer,
99
- type: 'info'
100
- });
101
- }
102
95
  if (theme.location != null || theme.zoom != null) {
103
96
  const view = this.context.mapManager.getMap().getView();
104
97
  view.animate({
@@ -79,13 +79,6 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
79
79
  // TODO REG : Merge with method onThemeChanged from the desktop component
80
80
  changeTheme(theme) {
81
81
  this.state.themes.lastSelectedTheme = theme;
82
- if (theme.disclaimer) {
83
- this.state.infobox.elements.push({
84
- id: theme.treeItemId,
85
- text: theme.disclaimer,
86
- type: 'info'
87
- });
88
- }
89
82
  if (theme.location != null || theme.zoom != null) {
90
83
  const view = this.context.mapManager.getMap().getView();
91
84
  view.animate({
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "GeoGirafe PSC",
6
6
  "url": "https://doc.geogirafe.org"
7
7
  },
8
- "version": "1.2.0-dev.2901604715",
8
+ "version": "1.2.0-dev.2914140972",
9
9
  "type": "module",
10
10
  "engines": {
11
11
  "node": ">=20.19.0"
@@ -1 +1 @@
1
- {"version":"1.2.0-dev.2901604715", "build":"2901604715", "date":"01/10/2026"}
1
+ {"version":"1.2.0-dev.2914140972", "build":"2914140972", "date":"05/10/2026"}
@@ -103,23 +103,32 @@ class LayerManager extends GirafeSingleton {
103
103
  this.manageDisclaimer(layer);
104
104
  }
105
105
  manageDisclaimer(layer) {
106
- if (layer.active && layer.disclaimer) {
107
- this.state.infobox.elements.push({
108
- id: layer.treeItemId,
109
- text: layer.disclaimer,
110
- type: 'info'
111
- });
112
- }
113
- if (layer.inactive && layer.disclaimer) {
114
- const index = this.state.infobox.elements.findIndex((el) => el.id === layer.treeItemId);
115
- if (index >= 0) {
106
+ if (layer.disclaimer) {
107
+ let showDisclaimer = false;
108
+ if (layer instanceof GroupLayer || layer instanceof ThemeLayer) {
109
+ showDisclaimer = layer.semiActive || layer.active;
110
+ }
111
+ else {
112
+ showDisclaimer = layer.active;
113
+ }
114
+ // Is there already a disclaimer for this layer?
115
+ const disclaimerId = `disclaimer-${layer.id}`;
116
+ const index = this.state.infobox.elements.findIndex((el) => el.id === disclaimerId);
117
+ if (showDisclaimer && index < 0) {
118
+ this.state.infobox.elements.push({
119
+ id: disclaimerId,
120
+ text: layer.disclaimer,
121
+ type: 'info'
122
+ });
123
+ }
124
+ else if (!showDisclaimer && index >= 0) {
116
125
  this.state.infobox.elements.splice(index, 1);
117
126
  }
118
127
  }
119
128
  }
120
129
  toggleLayer(layer, state) {
121
130
  if (!(layer instanceof Layer)) {
122
- throw new Error('This method should only be called on leafs layers, not on groups');
131
+ throw new TypeError('This method should only be called on leafs layers, not on groups');
123
132
  }
124
133
  let newState;
125
134
  if (state) {