@matdata/yasgui 5.18.0 → 5.19.1

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@matdata/yasgui",
3
3
  "description": "Yet Another SPARQL GUI",
4
- "version": "5.18.0",
4
+ "version": "5.19.1",
5
5
  "main": "build/yasgui.min.js",
6
6
  "types": "build/ts/src/index.d.ts",
7
7
  "license": "MIT",
package/src/Tab.ts CHANGED
@@ -1287,6 +1287,7 @@ export class Tab extends EventEmitter {
1287
1287
  createShareableLink: () => this.getShareableLink(),
1288
1288
  // Use global showSnippetsBar setting if it exists
1289
1289
  showSnippetsBar: this.yasgui.config.showSnippetsBar !== false,
1290
+ showMapButton: false,
1290
1291
  requestConfig: () => {
1291
1292
  const processedReqConfig: YasguiRequestConfig = {
1292
1293
  //setting defaults
@@ -38,6 +38,7 @@ export default class TabSettingsModal {
38
38
  private settingsButton!: HTMLButtonElement;
39
39
  private themeToggleButton!: HTMLButtonElement;
40
40
  private prefixButton!: HTMLButtonElement;
41
+ private mapButton!: HTMLButtonElement;
41
42
  private prefixTextarea!: HTMLTextAreaElement;
42
43
  private autoCaptureCheckbox!: HTMLInputElement;
43
44
  private hamburgerMenuButton!: HTMLButtonElement;
@@ -89,6 +90,15 @@ export default class TabSettingsModal {
89
90
  controlBarEl.appendChild(this.prefixButton);
90
91
  this.prefixButton.onclick = () => this.insertPrefixesIntoQuery();
91
92
 
93
+ // Map button
94
+ this.mapButton = document.createElement("button");
95
+ this.mapButton.setAttribute("aria-label", "Open map");
96
+ this.mapButton.title = "Open map";
97
+ this.mapButton.innerHTML = '<i class="fas fa-map-location-dot"></i>';
98
+ addClass(this.mapButton, "tabContextButton", "desktopOnly");
99
+ controlBarEl.appendChild(this.mapButton);
100
+ this.mapButton.onclick = (event: MouseEvent) => this.openMapWidget(event);
101
+
92
102
  // Hamburger menu button and dropdown (mobile only)
93
103
  const hamburgerContainer = document.createElement("div");
94
104
  addClass(hamburgerContainer, "hamburgerContainer", "mobileOnly");
@@ -148,6 +158,15 @@ export default class TabSettingsModal {
148
158
  };
149
159
  this.hamburgerDropdown.appendChild(prefixItem);
150
160
 
161
+ const mapItem = document.createElement("button");
162
+ addClass(mapItem, "hamburgerMenuItem");
163
+ mapItem.innerHTML = '<i class="fas fa-map-location-dot"></i><span>Open map</span>';
164
+ mapItem.onclick = (event) => {
165
+ this.openMapWidget(event);
166
+ this.closeHamburgerMenu();
167
+ };
168
+ this.hamburgerDropdown.appendChild(mapItem);
169
+
151
170
  // Theme toggle menu item (if enabled)
152
171
  if (this.tab.yasgui.config.showThemeToggle) {
153
172
  const themeItem = document.createElement("button");
@@ -1846,6 +1865,13 @@ export default class TabSettingsModal {
1846
1865
  yasqe.focus();
1847
1866
  }
1848
1867
 
1868
+ private openMapWidget(event?: MouseEvent) {
1869
+ const yasqe = this.tab.getYasqe();
1870
+ if (!yasqe) return;
1871
+ const anchorPoint = event ? { x: event.clientX, y: event.clientY } : undefined;
1872
+ yasqe.toggleMapWidget(anchorPoint);
1873
+ }
1874
+
1849
1875
  public capturePrefixesFromQuery() {
1850
1876
  const autoCapture = this.tab.yasgui.persistentConfig.getAutoCaptureEnabled();
1851
1877
  if (!autoCapture) return;
package/src/themes.scss CHANGED
@@ -292,6 +292,48 @@
292
292
  border-color: var(--yasgui-border-color);
293
293
  }
294
294
  }
295
+
296
+ .yasqe_mapPopup {
297
+ background-color: var(--yasgui-bg-primary);
298
+ border-color: var(--yasgui-border-color);
299
+ color: var(--yasgui-text-primary);
300
+
301
+ .yasqe_mapPopup_map {
302
+ border-color: var(--yasgui-border-color);
303
+ }
304
+
305
+ .yasqe_mapPopup_geometryBtn {
306
+ background-color: var(--yasgui-bg-primary);
307
+ color: var(--yasgui-text-primary);
308
+ border-color: var(--yasgui-border-color);
309
+
310
+ &:hover {
311
+ background-color: var(--yasgui-bg-secondary);
312
+ }
313
+
314
+ &.active {
315
+ background-color: var(--yasgui-accent-color);
316
+ color: var(--yasgui-bg-primary);
317
+ }
318
+ }
319
+
320
+ .yasqe_mapPopup_preview {
321
+ background-color: var(--yasgui-bg-secondary);
322
+ color: var(--yasgui-text-primary);
323
+ border-color: var(--yasgui-border-color);
324
+ }
325
+
326
+ .leaflet-control-zoom a,
327
+ .leaflet-control-attribution {
328
+ background-color: var(--yasgui-bg-primary);
329
+ color: var(--yasgui-text-primary);
330
+ border-color: var(--yasgui-border-color);
331
+ }
332
+
333
+ .leaflet-control-zoom a:hover {
334
+ background-color: var(--yasgui-bg-secondary);
335
+ }
336
+ }
295
337
  }
296
338
 
297
339
  .yasqe_btn {
package/src/version.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  // Version information for YASGUI
2
2
  // This file is auto-generated during build - do not edit manually
3
- export const VERSION = "5.18.0";
3
+ export const VERSION = "5.19.1";