@geogirafe/lib-geoportal 1.1.0-dev.2636234859 → 1.1.0-dev.2640619249

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.
@@ -8,7 +8,7 @@ class MenuButtonComponent extends GirafeHTMLElement {
8
8
  return uHtml `<style>
9
9
  .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);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}
10
10
  </style><style>
11
- .container{position:relative}.menu-content{border:var(--app-standard-border);background:var(--bkg-color);z-index:1000;box-shadow:var(--bx-shdw);border-width:2px;border-radius:4px;margin-right:.2rem;font-size:0;display:flex;position:absolute}.open-bottom{flex-direction:column;width:fit-content;height:max-content;top:100%;left:0}.open-bottom-left{flex-direction:row;width:fit-content;height:max-content;top:100%;right:0}.open-up{flex-direction:column;width:fit-content;height:max-content;bottom:100%;right:0}.open-up-right{flex-direction:column;width:fit-content;height:max-content;bottom:100%;left:0}.open-left{flex-direction:row;width:max-content;height:fit-content;top:0;right:100%}
11
+ .container{position:relative}.menu-content{border:var(--app-standard-border);background:var(--bkg-color);z-index:1000;box-shadow:var(--bx-shdw);border-width:2px;border-radius:4px;margin-right:.2rem;display:flex;position:absolute}.open-bottom{flex-direction:column;width:fit-content;height:max-content;top:100%;left:0}.open-bottom-left{flex-direction:row;width:fit-content;height:max-content;top:100%;right:0}.open-up{flex-direction:column;width:fit-content;height:max-content;bottom:100%;right:0}.open-up-right{flex-direction:column;width:fit-content;height:max-content;bottom:100%;left:0}.open-left{flex-direction:row;width:max-content;height:fit-content;top:0;right:100%}
12
12
  </style>
13
13
  <style>${this.customStyle}</style>
14
14
  <div class="container"><slot name="menu-button" onclick="${() => this.toggleMenu()}" onkeydown="${(e) => this.simulateClick(e)}"></slot><div class="${this.getClass()}"><slot name="menu-content"></slot></div></div>
@@ -6,7 +6,6 @@
6
6
  .menu-content {
7
7
  position: absolute;
8
8
  display: flex;
9
- font-size: 0;
10
9
  border: var(--app-standard-border);
11
10
  background: var(--bkg-color);
12
11
  border-radius: 4px;
@@ -153,12 +153,10 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
153
153
  }
154
154
  this.awaitingIframeUrl = true;
155
155
  this.refreshRender();
156
- const baseUrl = this.context.urlManager.getRootUrl();
156
+ const iframeBaseUrl = this.context.configManager.Config.share?.iframeBaseUrl ?? `${this.context.urlManager.getRootUrl()}iframe.html`;
157
157
  const hash = this.context.shareManager.getStateToShare();
158
- // Get short URL for iframe
159
- const indexDocument = `iframe.html`;
160
- const longIframeUrl = `${baseUrl}${indexDocument}#${hash}`;
161
- const response = await this.urlShortener.shortenUrl(longIframeUrl, indexDocument);
158
+ const longIframeUrl = `${iframeBaseUrl}#${hash}`;
159
+ const response = await this.urlShortener.shortenUrl(longIframeUrl, iframeBaseUrl);
162
160
  this.iframeUrl = response.shorturl;
163
161
  this.iframeCode = `<iframe title="iframe GeoGirafe" width="${this.iframeWidth}" height="${this.iframeHeight}" src="${this.iframeUrl}"></iframe>`;
164
162
  this.awaitingIframeUrl = false;
@@ -4,6 +4,6 @@ declare class GeoGirafeShareManager implements IUrlShortener {
4
4
  private readonly serviceUrl;
5
5
  private readonly urlManager;
6
6
  constructor(serviceUrl: string, urlManager: UrlManager);
7
- shortenUrl(longUrl: string, indexDocument?: string): Promise<UrlShortenerResponse>;
7
+ shortenUrl(longUrl: string, forcedBaseUrl?: string): Promise<UrlShortenerResponse>;
8
8
  }
9
9
  export default GeoGirafeShareManager;
@@ -6,7 +6,7 @@ class GeoGirafeShareManager {
6
6
  this.serviceUrl = serviceUrl;
7
7
  this.urlManager = urlManager;
8
8
  }
9
- async shortenUrl(longUrl, indexDocument) {
9
+ async shortenUrl(longUrl, forcedBaseUrl) {
10
10
  const errorResponse = {
11
11
  success: false,
12
12
  shorturl: longUrl
@@ -23,9 +23,9 @@ class GeoGirafeShareManager {
23
23
  });
24
24
  const response_data = (await response.json());
25
25
  if (response_data) {
26
- const baseUrl = this.urlManager.getBaseUrlPath();
26
+ const baseUrl = forcedBaseUrl ?? this.urlManager.getBaseUrlPath();
27
27
  const hash = response_data.short_url.split('/').pop();
28
- const shortUrl = `${baseUrl}${indexDocument ?? ''}#gg-${hash}`;
28
+ const shortUrl = `${baseUrl}#gg-${hash}`;
29
29
  const qrcode = await generateQrCode(shortUrl);
30
30
  return {
31
31
  success: true,
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.1.0-dev.2636234859",
8
+ "version": "1.1.0-dev.2640619249",
9
9
  "type": "module",
10
10
  "engines": {
11
11
  "node": ">=20.19.0"
@@ -1 +1 @@
1
- {"version":"1.1.0-dev.2636234859", "build":"2636234859", "date":"29/06/2026"}
1
+ {"version":"1.1.0-dev.2640619249", "build":"2640619249", "date":"30/06/2026"}
@@ -103,6 +103,7 @@ declare class GirafeConfig {
103
103
  preferNames: boolean;
104
104
  createUrl: string;
105
105
  getUrl?: string;
106
+ iframeBaseUrl?: string;
106
107
  };
107
108
  projections: {
108
109
  [key: string]: string;
@@ -185,7 +185,8 @@ class GirafeConfig {
185
185
  service: config.share?.service ?? 'gmf',
186
186
  preferNames: config.share?.preferNames ?? false,
187
187
  createUrl: config.share?.createUrl,
188
- getUrl: config.share?.getUrl
188
+ getUrl: config.share?.getUrl,
189
+ iframeBaseUrl: config.share?.iframeBaseUrl
189
190
  };
190
191
  }
191
192
  initConfigSelection(config) {