@trailstash/ultra 5.0.0 → 5.0.2

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/.gitlab-ci.yml CHANGED
@@ -16,6 +16,7 @@ pages:
16
16
  - npm run build:maplibre-examples-docs
17
17
  - npm run build:docs
18
18
  - npm run build:pages
19
+ - find public -type f -regex '.*\.\(htm\|html\|xml\|txt\|text\|js\|css\|svg\)$' -exec gzip -f -k {} \;
19
20
  artifacts:
20
21
  paths:
21
22
  - public
@@ -132,16 +132,6 @@ export class ShareModal extends HTMLElement {
132
132
  opts.center = this.center;
133
133
  opts.zoom = this.zoom;
134
134
  }
135
- let transform;
136
- try {
137
- ({ transform } = parseSettings(this.query));
138
- } catch {}
139
- if (transform) {
140
- this.refs.autoRunCheckBox.checked = false;
141
- this.refs.autoRunCheckBox.disabled = true;
142
- } else {
143
- this.refs.autoRunCheckBox.disabled = false;
144
- }
145
135
  opts.autoRun = this.refs.autoRunCheckBox.checked;
146
136
  this.refs.queryInput.value = toQueryParams(opts);
147
137
  delete opts.autoRun;
@@ -62,6 +62,9 @@ export const getQueryFromQueryParams = () => {
62
62
  // query
63
63
  if (params.has("q")) {
64
64
  query = decompressFromEncodedURIComponent(params.get("q"));
65
+ if (!query) {
66
+ alert("Invalid compressed query specified in URL");
67
+ }
65
68
  } else if (params.has("query")) {
66
69
  query = params.get("query");
67
70
  if (query.startsWith("gist:")) {
@@ -111,6 +114,16 @@ export const getOptionsFromQueryParams = () => {
111
114
  };
112
115
 
113
116
  export const getAutoRunFromQueryParams = () => {
117
+ // Don't autorun if provided query can't be decompressed
118
+ // TODO: other query load errors?
119
+ const params = new URLSearchParams(window.location.hash.slice(1));
120
+ if (params.has("q")) {
121
+ const query = decompressFromEncodedURIComponent(params.get("q"));
122
+ if (!query) {
123
+ return false;
124
+ }
125
+ }
126
+
114
127
  return new URLSearchParams(window.location.hash.slice(1)).has("run");
115
128
  };
116
129
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "5.0.0",
6
+ "version": "5.0.2",
7
7
  "description": "A web based tool for making MapLibre GL maps with data from sources such as Overpass, GeoJSON, GPX, KML, TCX, etc",
8
8
  "main": "index.js",
9
9
  "scripts": {