@matdata/yasgui 4.7.4 → 4.8.0
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/build/ts/src/PersistentConfig.js +127 -0
- package/build/ts/src/PersistentConfig.js.map +1 -0
- package/build/ts/src/Tab.d.ts +2 -1
- package/build/ts/src/Tab.js +600 -0
- package/build/ts/src/Tab.js.map +1 -0
- package/build/ts/src/TabContextMenu.d.ts +1 -0
- package/build/ts/src/TabContextMenu.js +116 -0
- package/build/ts/src/TabContextMenu.js.map +1 -0
- package/build/ts/src/TabElements.d.ts +1 -0
- package/build/ts/src/TabElements.js +305 -0
- package/build/ts/src/TabElements.js.map +1 -0
- package/build/ts/src/TabSettingsModal.js +320 -0
- package/build/ts/src/TabSettingsModal.js.map +1 -0
- package/build/ts/src/defaults.js +59 -0
- package/build/ts/src/defaults.js.map +1 -0
- package/build/ts/src/endpointSelect.d.ts +1 -0
- package/build/ts/src/endpointSelect.js +242 -0
- package/build/ts/src/endpointSelect.js.map +1 -0
- package/build/ts/src/index.d.ts +2 -0
- package/build/ts/src/index.js +251 -0
- package/build/ts/src/index.js.map +1 -0
- package/build/ts/src/linkUtils.d.ts +1 -1
- package/build/ts/src/linkUtils.js +205 -0
- package/build/ts/src/linkUtils.js.map +1 -0
- package/build/yasgui.min.css +2 -2
- package/build/yasgui.min.css.map +7 -1
- package/build/yasgui.min.js +1125 -3
- package/build/yasgui.min.js.map +7 -1
- package/package.json +1 -1
- package/src/Tab.ts +20 -2
- package/src/TabContextMenu.ts +1 -1
- package/src/TabElements.ts +3 -3
- package/src/TabSettingsModal.ts +8 -8
- package/src/endpointSelect.ts +1 -1
- package/src/index.ts +2 -2
- package/src/linkUtils.ts +1 -1
- package/build/yasgui.html +0 -24
- package/build/yasgui.min.js.LICENSE.txt +0 -59
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { EventEmitter } from "events";
|
|
11
|
+
import { addClass, removeClass, getAsValue } from "@matdata/yasgui-utils";
|
|
12
|
+
import TabSettingsModal from "./TabSettingsModal";
|
|
13
|
+
import { default as Yasqe } from "@matdata/yasqe";
|
|
14
|
+
import { default as Yasr } from "@matdata/yasr";
|
|
15
|
+
import { mapValues, eq, mergeWith, words, deburr, invert } from "lodash-es";
|
|
16
|
+
import * as shareLink from "./linkUtils";
|
|
17
|
+
import EndpointSelect from "./endpointSelect";
|
|
18
|
+
import "./tab.scss";
|
|
19
|
+
import { getRandomId, default as Yasgui } from "./";
|
|
20
|
+
export class Tab extends EventEmitter {
|
|
21
|
+
constructor(yasgui, conf) {
|
|
22
|
+
super();
|
|
23
|
+
this.handleKeyDown = (event) => {
|
|
24
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
25
|
+
if (event.key === "F11") {
|
|
26
|
+
event.preventDefault();
|
|
27
|
+
if (this.yasqe) {
|
|
28
|
+
this.yasqe.toggleFullscreen();
|
|
29
|
+
if ((_a = this.yasr) === null || _a === void 0 ? void 0 : _a.getIsFullscreen()) {
|
|
30
|
+
this.yasr.toggleFullscreen();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
else if (event.key === "F10") {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
if (this.yasr) {
|
|
37
|
+
this.yasr.toggleFullscreen();
|
|
38
|
+
if ((_b = this.yasqe) === null || _b === void 0 ? void 0 : _b.getIsFullscreen()) {
|
|
39
|
+
this.yasqe.toggleFullscreen();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else if (event.ctrlKey && event.shiftKey && event.key === "F") {
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
const yasqeFullscreen = (_c = this.yasqe) === null || _c === void 0 ? void 0 : _c.getIsFullscreen();
|
|
46
|
+
const yasrFullscreen = (_d = this.yasr) === null || _d === void 0 ? void 0 : _d.getIsFullscreen();
|
|
47
|
+
if (yasqeFullscreen) {
|
|
48
|
+
(_e = this.yasqe) === null || _e === void 0 ? void 0 : _e.toggleFullscreen();
|
|
49
|
+
(_f = this.yasr) === null || _f === void 0 ? void 0 : _f.toggleFullscreen();
|
|
50
|
+
}
|
|
51
|
+
else if (yasrFullscreen) {
|
|
52
|
+
(_g = this.yasr) === null || _g === void 0 ? void 0 : _g.toggleFullscreen();
|
|
53
|
+
(_h = this.yasqe) === null || _h === void 0 ? void 0 : _h.toggleFullscreen();
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
(_j = this.yasqe) === null || _j === void 0 ? void 0 : _j.toggleFullscreen();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
this.handleYasqeBlur = (yasqe) => {
|
|
61
|
+
var _a;
|
|
62
|
+
this.persistentJson.yasqe.value = yasqe.getValue();
|
|
63
|
+
(_a = this.settingsModal) === null || _a === void 0 ? void 0 : _a.capturePrefixesFromQuery();
|
|
64
|
+
this.emit("change", this, this.persistentJson);
|
|
65
|
+
};
|
|
66
|
+
this.handleYasqeQuery = (yasqe) => {
|
|
67
|
+
if (yasqe.getValue() !== this.persistentJson.yasqe.value) {
|
|
68
|
+
this.persistentJson.yasqe.value = yasqe.getValue();
|
|
69
|
+
this.emit("change", this, this.persistentJson);
|
|
70
|
+
}
|
|
71
|
+
this.emit("query", this);
|
|
72
|
+
};
|
|
73
|
+
this.handleYasqeQueryAbort = () => {
|
|
74
|
+
this.emit("queryAbort", this);
|
|
75
|
+
if (this.yasr) {
|
|
76
|
+
this.yasr.hideLoading();
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
this.handleYasqeQueryBefore = () => {
|
|
80
|
+
this.emit("queryBefore", this);
|
|
81
|
+
if (this.yasr) {
|
|
82
|
+
this.yasr.showLoading();
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
this.handleYasqeResize = (_yasqe, newSize) => {
|
|
86
|
+
this.persistentJson.yasqe.editorHeight = newSize;
|
|
87
|
+
this.emit("change", this, this.persistentJson);
|
|
88
|
+
};
|
|
89
|
+
this.handleAutocompletionShown = (_yasqe, widget) => {
|
|
90
|
+
this.emit("autocompletionShown", this, widget);
|
|
91
|
+
};
|
|
92
|
+
this.handleAutocompletionClose = (_yasqe) => {
|
|
93
|
+
this.emit("autocompletionClose", this);
|
|
94
|
+
};
|
|
95
|
+
this.handleQueryResponse = (_yasqe, response, duration) => {
|
|
96
|
+
this.emit("queryResponse", this);
|
|
97
|
+
if (!this.yasr)
|
|
98
|
+
throw new Error("Resultset visualizer not initialized. Cannot draw results");
|
|
99
|
+
this.yasr.setResponse(response, duration);
|
|
100
|
+
if (!this.yasr.results)
|
|
101
|
+
return;
|
|
102
|
+
if (!this.yasr.results.hasError()) {
|
|
103
|
+
this.persistentJson.yasr.response = this.yasr.results.getAsStoreObject(this.yasgui.config.yasr.maxPersistentResponseSize);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
this.persistentJson.yasr.response = undefined;
|
|
107
|
+
}
|
|
108
|
+
this.emit("change", this, this.persistentJson);
|
|
109
|
+
};
|
|
110
|
+
this.handleYasqeMouseDown = (event) => {
|
|
111
|
+
if (!event.ctrlKey || !this.yasqe)
|
|
112
|
+
return;
|
|
113
|
+
const target = event.target;
|
|
114
|
+
if (!target.closest(".CodeMirror"))
|
|
115
|
+
return;
|
|
116
|
+
const pos = this.yasqe.coordsChar({ left: event.clientX, top: event.clientY });
|
|
117
|
+
const token = this.yasqe.getTokenAt(pos);
|
|
118
|
+
const tokenString = token.string.trim();
|
|
119
|
+
if (tokenString.startsWith("?") || tokenString.startsWith("$"))
|
|
120
|
+
return;
|
|
121
|
+
const isFullUri = tokenString.startsWith("<") && tokenString.endsWith(">");
|
|
122
|
+
const isPrefixedName = /^[\w-]+:[\w-]+/.test(tokenString);
|
|
123
|
+
if (!isFullUri && !isPrefixedName)
|
|
124
|
+
return;
|
|
125
|
+
event.preventDefault();
|
|
126
|
+
event.stopPropagation();
|
|
127
|
+
let uri = tokenString;
|
|
128
|
+
if (isFullUri) {
|
|
129
|
+
uri = tokenString.slice(1, -1);
|
|
130
|
+
}
|
|
131
|
+
else if (isPrefixedName) {
|
|
132
|
+
const prefixes = this.yasqe.getPrefixesFromQuery();
|
|
133
|
+
const [prefix, localName] = tokenString.split(":");
|
|
134
|
+
const prefixUri = prefixes[prefix];
|
|
135
|
+
if (prefixUri) {
|
|
136
|
+
uri = prefixUri + localName;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const constructQuery = `CONSTRUCT {
|
|
140
|
+
?s_left ?p_left ?target .
|
|
141
|
+
?target ?p_right ?o_right .
|
|
142
|
+
}
|
|
143
|
+
WHERE {
|
|
144
|
+
BIND(<${uri}> as ?target)
|
|
145
|
+
{
|
|
146
|
+
?s_left ?p_left ?target .
|
|
147
|
+
}
|
|
148
|
+
UNION
|
|
149
|
+
{
|
|
150
|
+
?target ?p_right ?o_right .
|
|
151
|
+
}
|
|
152
|
+
} LIMIT 1000`;
|
|
153
|
+
this.executeBackgroundQuery(constructQuery);
|
|
154
|
+
};
|
|
155
|
+
if (!conf || conf.id === undefined)
|
|
156
|
+
throw new Error("Expected a valid configuration to initialize tab with");
|
|
157
|
+
this.yasgui = yasgui;
|
|
158
|
+
this.persistentJson = conf;
|
|
159
|
+
}
|
|
160
|
+
name() {
|
|
161
|
+
return this.persistentJson.name;
|
|
162
|
+
}
|
|
163
|
+
getPersistedJson() {
|
|
164
|
+
return this.persistentJson;
|
|
165
|
+
}
|
|
166
|
+
getId() {
|
|
167
|
+
return this.persistentJson.id;
|
|
168
|
+
}
|
|
169
|
+
draw() {
|
|
170
|
+
if (this.rootEl)
|
|
171
|
+
return;
|
|
172
|
+
this.rootEl = document.createElement("div");
|
|
173
|
+
this.rootEl.className = "tabPanel";
|
|
174
|
+
this.rootEl.id = this.persistentJson.id;
|
|
175
|
+
this.rootEl.setAttribute("role", "tabpanel");
|
|
176
|
+
this.rootEl.setAttribute("aria-labelledby", "tab-" + this.persistentJson.id);
|
|
177
|
+
const editorWrapper = document.createElement("div");
|
|
178
|
+
editorWrapper.className = "editorwrapper";
|
|
179
|
+
const controlbarAndYasqeDiv = document.createElement("div");
|
|
180
|
+
this.controlBarEl = document.createElement("div");
|
|
181
|
+
this.controlBarEl.className = "controlbar";
|
|
182
|
+
controlbarAndYasqeDiv.appendChild(this.controlBarEl);
|
|
183
|
+
this.yasqeWrapperEl = document.createElement("div");
|
|
184
|
+
controlbarAndYasqeDiv.appendChild(this.yasqeWrapperEl);
|
|
185
|
+
editorWrapper.appendChild(controlbarAndYasqeDiv);
|
|
186
|
+
this.yasrWrapperEl = document.createElement("div");
|
|
187
|
+
this.initTabSettingsMenu();
|
|
188
|
+
this.rootEl.appendChild(editorWrapper);
|
|
189
|
+
this.rootEl.appendChild(this.yasrWrapperEl);
|
|
190
|
+
this.initControlbar();
|
|
191
|
+
this.initYasqe();
|
|
192
|
+
this.initYasr();
|
|
193
|
+
this.yasgui._setPanel(this.persistentJson.id, this.rootEl);
|
|
194
|
+
}
|
|
195
|
+
hide() {
|
|
196
|
+
removeClass(this.rootEl, "active");
|
|
197
|
+
this.detachKeyboardListeners();
|
|
198
|
+
}
|
|
199
|
+
show() {
|
|
200
|
+
this.draw();
|
|
201
|
+
addClass(this.rootEl, "active");
|
|
202
|
+
this.yasgui.tabElements.selectTab(this.persistentJson.id);
|
|
203
|
+
if (this.yasqe) {
|
|
204
|
+
this.yasqe.refresh();
|
|
205
|
+
if (this.yasgui.config.autofocus)
|
|
206
|
+
this.yasqe.focus();
|
|
207
|
+
}
|
|
208
|
+
if (this.yasr) {
|
|
209
|
+
this.yasr.refresh();
|
|
210
|
+
}
|
|
211
|
+
this.setEndpoint(this.getEndpoint(), this.yasgui.persistentConfig.getEndpointHistory());
|
|
212
|
+
this.attachKeyboardListeners();
|
|
213
|
+
}
|
|
214
|
+
attachKeyboardListeners() {
|
|
215
|
+
if (!this.rootEl)
|
|
216
|
+
return;
|
|
217
|
+
document.addEventListener("keydown", this.handleKeyDown);
|
|
218
|
+
}
|
|
219
|
+
detachKeyboardListeners() {
|
|
220
|
+
document.removeEventListener("keydown", this.handleKeyDown);
|
|
221
|
+
}
|
|
222
|
+
select() {
|
|
223
|
+
this.yasgui.selectTabId(this.persistentJson.id);
|
|
224
|
+
}
|
|
225
|
+
close() {
|
|
226
|
+
this.detachKeyboardListeners();
|
|
227
|
+
if (this.yasqe)
|
|
228
|
+
this.yasqe.abortQuery();
|
|
229
|
+
if (this.yasgui.getTab() === this) {
|
|
230
|
+
const tabs = this.yasgui.persistentConfig.getTabs();
|
|
231
|
+
const i = tabs.indexOf(this.persistentJson.id);
|
|
232
|
+
if (i > -1) {
|
|
233
|
+
this.yasgui.selectTabId(tabs[i === tabs.length - 1 ? i - 1 : i + 1]);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
this.yasgui._removePanel(this.rootEl);
|
|
237
|
+
this.yasgui.persistentConfig.deleteTab(this.persistentJson.id);
|
|
238
|
+
this.yasgui.emit("tabClose", this.yasgui, this);
|
|
239
|
+
this.emit("close", this);
|
|
240
|
+
this.yasgui.tabElements.get(this.persistentJson.id).delete();
|
|
241
|
+
delete this.yasgui._tabs[this.persistentJson.id];
|
|
242
|
+
}
|
|
243
|
+
getQuery() {
|
|
244
|
+
var _a;
|
|
245
|
+
if (!this.yasqe) {
|
|
246
|
+
throw new Error("Cannot get value from uninitialized editor");
|
|
247
|
+
}
|
|
248
|
+
return (_a = this.yasqe) === null || _a === void 0 ? void 0 : _a.getValue();
|
|
249
|
+
}
|
|
250
|
+
setQuery(query) {
|
|
251
|
+
if (!this.yasqe) {
|
|
252
|
+
throw new Error("Cannot set value for uninitialized editor");
|
|
253
|
+
}
|
|
254
|
+
this.yasqe.setValue(query);
|
|
255
|
+
this.persistentJson.yasqe.value = query;
|
|
256
|
+
this.emit("change", this, this.persistentJson);
|
|
257
|
+
return this;
|
|
258
|
+
}
|
|
259
|
+
getRequestConfig() {
|
|
260
|
+
return this.persistentJson.requestConfig;
|
|
261
|
+
}
|
|
262
|
+
initControlbar() {
|
|
263
|
+
this.initEndpointSelectField();
|
|
264
|
+
if (this.yasgui.config.endpointInfo && this.controlBarEl) {
|
|
265
|
+
this.controlBarEl.appendChild(this.yasgui.config.endpointInfo());
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
getYasqe() {
|
|
269
|
+
return this.yasqe;
|
|
270
|
+
}
|
|
271
|
+
getYasr() {
|
|
272
|
+
return this.yasr;
|
|
273
|
+
}
|
|
274
|
+
initTabSettingsMenu() {
|
|
275
|
+
if (!this.controlBarEl)
|
|
276
|
+
throw new Error("Need to initialize wrapper elements before drawing tab settings");
|
|
277
|
+
this.settingsModal = new TabSettingsModal(this, this.controlBarEl);
|
|
278
|
+
}
|
|
279
|
+
initEndpointSelectField() {
|
|
280
|
+
if (!this.controlBarEl)
|
|
281
|
+
throw new Error("Need to initialize wrapper elements before drawing endpoint field");
|
|
282
|
+
this.endpointSelect = new EndpointSelect(this.getEndpoint(), this.controlBarEl, this.yasgui.config.endpointCatalogueOptions, this.yasgui.persistentConfig.getEndpointHistory());
|
|
283
|
+
this.endpointSelect.on("select", (endpoint, endpointHistory) => {
|
|
284
|
+
this.setEndpoint(endpoint, endpointHistory);
|
|
285
|
+
});
|
|
286
|
+
this.endpointSelect.on("remove", (endpoint, endpointHistory) => {
|
|
287
|
+
this.setEndpoint(endpoint, endpointHistory);
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
checkEndpointForCors(endpoint) {
|
|
291
|
+
if (this.yasgui.config.corsProxy && !(endpoint in Yasgui.corsEnabled)) {
|
|
292
|
+
const askUrl = new URL(endpoint);
|
|
293
|
+
askUrl.searchParams.append("query", "ASK {?x ?y ?z}");
|
|
294
|
+
fetch(askUrl.toString())
|
|
295
|
+
.then(() => {
|
|
296
|
+
Yasgui.corsEnabled[endpoint] = true;
|
|
297
|
+
})
|
|
298
|
+
.catch((e) => {
|
|
299
|
+
Yasgui.corsEnabled[endpoint] = e instanceof TypeError ? false : true;
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
setEndpoint(endpoint, endpointHistory) {
|
|
304
|
+
if (endpoint)
|
|
305
|
+
endpoint = endpoint.trim();
|
|
306
|
+
if (endpointHistory && !eq(endpointHistory, this.yasgui.persistentConfig.getEndpointHistory())) {
|
|
307
|
+
this.yasgui.emit("endpointHistoryChange", this.yasgui, endpointHistory);
|
|
308
|
+
}
|
|
309
|
+
this.checkEndpointForCors(endpoint);
|
|
310
|
+
if (this.persistentJson.requestConfig.endpoint !== endpoint) {
|
|
311
|
+
this.persistentJson.requestConfig.endpoint = endpoint;
|
|
312
|
+
this.emit("change", this, this.persistentJson);
|
|
313
|
+
this.emit("endpointChange", this, endpoint);
|
|
314
|
+
}
|
|
315
|
+
if (this.endpointSelect instanceof EndpointSelect) {
|
|
316
|
+
this.endpointSelect.setEndpoint(endpoint, endpointHistory);
|
|
317
|
+
}
|
|
318
|
+
return this;
|
|
319
|
+
}
|
|
320
|
+
getEndpoint() {
|
|
321
|
+
return getAsValue(this.persistentJson.requestConfig.endpoint, this.yasgui);
|
|
322
|
+
}
|
|
323
|
+
updateContextMenu() {
|
|
324
|
+
this.getTabListEl().redrawContextMenu();
|
|
325
|
+
}
|
|
326
|
+
getShareableLink(baseURL) {
|
|
327
|
+
return shareLink.createShareLink(baseURL || window.location.href, this);
|
|
328
|
+
}
|
|
329
|
+
getShareObject() {
|
|
330
|
+
return shareLink.createShareConfig(this);
|
|
331
|
+
}
|
|
332
|
+
getTabListEl() {
|
|
333
|
+
return this.yasgui.tabElements.get(this.persistentJson.id);
|
|
334
|
+
}
|
|
335
|
+
setName(newName) {
|
|
336
|
+
this.getTabListEl().rename(newName);
|
|
337
|
+
this.persistentJson.name = newName;
|
|
338
|
+
this.emit("change", this, this.persistentJson);
|
|
339
|
+
return this;
|
|
340
|
+
}
|
|
341
|
+
hasResults() {
|
|
342
|
+
var _a;
|
|
343
|
+
return !!((_a = this.yasr) === null || _a === void 0 ? void 0 : _a.results);
|
|
344
|
+
}
|
|
345
|
+
getName() {
|
|
346
|
+
return this.persistentJson.name;
|
|
347
|
+
}
|
|
348
|
+
query() {
|
|
349
|
+
if (!this.yasqe)
|
|
350
|
+
return Promise.reject(new Error("No yasqe editor initialized"));
|
|
351
|
+
return this.yasqe.query();
|
|
352
|
+
}
|
|
353
|
+
setRequestConfig(requestConfig) {
|
|
354
|
+
this.persistentJson.requestConfig = Object.assign(Object.assign({}, this.persistentJson.requestConfig), requestConfig);
|
|
355
|
+
this.emit("change", this, this.persistentJson);
|
|
356
|
+
}
|
|
357
|
+
getStaticRequestConfig() {
|
|
358
|
+
const config = {};
|
|
359
|
+
let key;
|
|
360
|
+
for (key in this.yasgui.config.requestConfig) {
|
|
361
|
+
if (key === "adjustQueryBeforeRequest")
|
|
362
|
+
continue;
|
|
363
|
+
const val = this.yasgui.config.requestConfig[key];
|
|
364
|
+
if (typeof val === "function") {
|
|
365
|
+
config[key] = val(this.yasgui);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return config;
|
|
369
|
+
}
|
|
370
|
+
initYasqe() {
|
|
371
|
+
const yasqeConf = Object.assign(Object.assign({}, this.yasgui.config.yasqe), { value: this.persistentJson.yasqe.value, editorHeight: this.persistentJson.yasqe.editorHeight ? this.persistentJson.yasqe.editorHeight : undefined, persistenceId: null, consumeShareLink: null, createShareableLink: () => this.getShareableLink(), requestConfig: () => {
|
|
372
|
+
const processedReqConfig = Object.assign(Object.assign({ acceptHeaderGraph: "text/turtle", acceptHeaderSelect: "application/sparql-results+json" }, mergeWith({}, this.persistentJson.requestConfig, this.getStaticRequestConfig(), function customizer(objValue, srcValue) {
|
|
373
|
+
if (Array.isArray(objValue) || Array.isArray(srcValue)) {
|
|
374
|
+
return [...(objValue || []), ...(srcValue || [])];
|
|
375
|
+
}
|
|
376
|
+
})), { adjustQueryBeforeRequest: this.yasgui.config.requestConfig.adjustQueryBeforeRequest });
|
|
377
|
+
if (this.yasgui.config.corsProxy && !Yasgui.corsEnabled[this.getEndpoint()]) {
|
|
378
|
+
return Object.assign(Object.assign({}, processedReqConfig), { args: [
|
|
379
|
+
...(Array.isArray(processedReqConfig.args) ? processedReqConfig.args : []),
|
|
380
|
+
{ name: "endpoint", value: this.getEndpoint() },
|
|
381
|
+
{ name: "method", value: this.persistentJson.requestConfig.method },
|
|
382
|
+
], method: "POST", endpoint: this.yasgui.config.corsProxy });
|
|
383
|
+
}
|
|
384
|
+
return processedReqConfig;
|
|
385
|
+
} });
|
|
386
|
+
if (!yasqeConf.hintConfig) {
|
|
387
|
+
yasqeConf.hintConfig = {};
|
|
388
|
+
}
|
|
389
|
+
if (!yasqeConf.hintConfig.container) {
|
|
390
|
+
yasqeConf.hintConfig.container = this.yasgui.rootEl;
|
|
391
|
+
}
|
|
392
|
+
if (!this.yasqeWrapperEl) {
|
|
393
|
+
throw new Error("Expected a wrapper element before instantiating yasqe");
|
|
394
|
+
}
|
|
395
|
+
this.yasqe = new Yasqe(this.yasqeWrapperEl, yasqeConf);
|
|
396
|
+
this.yasqe.on("blur", this.handleYasqeBlur);
|
|
397
|
+
this.yasqe.on("query", this.handleYasqeQuery);
|
|
398
|
+
this.yasqe.on("queryBefore", this.handleYasqeQueryBefore);
|
|
399
|
+
this.yasqe.on("queryAbort", this.handleYasqeQueryAbort);
|
|
400
|
+
this.yasqe.on("resize", this.handleYasqeResize);
|
|
401
|
+
this.yasqe.on("autocompletionShown", this.handleAutocompletionShown);
|
|
402
|
+
this.yasqe.on("autocompletionClose", this.handleAutocompletionClose);
|
|
403
|
+
this.yasqe.on("queryResponse", this.handleQueryResponse);
|
|
404
|
+
this.attachYasqeMouseHandler();
|
|
405
|
+
}
|
|
406
|
+
destroyYasqe() {
|
|
407
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
408
|
+
(_a = this.yasqe) === null || _a === void 0 ? void 0 : _a.off("blur", this.handleYasqeBlur);
|
|
409
|
+
(_b = this.yasqe) === null || _b === void 0 ? void 0 : _b.off("query", this.handleYasqeQuery);
|
|
410
|
+
(_c = this.yasqe) === null || _c === void 0 ? void 0 : _c.off("queryAbort", this.handleYasqeQueryAbort);
|
|
411
|
+
(_d = this.yasqe) === null || _d === void 0 ? void 0 : _d.off("resize", this.handleYasqeResize);
|
|
412
|
+
(_e = this.yasqe) === null || _e === void 0 ? void 0 : _e.off("autocompletionShown", this.handleAutocompletionShown);
|
|
413
|
+
(_f = this.yasqe) === null || _f === void 0 ? void 0 : _f.off("autocompletionClose", this.handleAutocompletionClose);
|
|
414
|
+
(_g = this.yasqe) === null || _g === void 0 ? void 0 : _g.off("queryBefore", this.handleYasqeQueryBefore);
|
|
415
|
+
(_h = this.yasqe) === null || _h === void 0 ? void 0 : _h.off("queryResponse", this.handleQueryResponse);
|
|
416
|
+
this.detachYasqeMouseHandler();
|
|
417
|
+
(_j = this.yasqe) === null || _j === void 0 ? void 0 : _j.destroy();
|
|
418
|
+
this.yasqe = undefined;
|
|
419
|
+
}
|
|
420
|
+
executeBackgroundQuery(query) {
|
|
421
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
422
|
+
if (!this.yasqe || !this.yasr)
|
|
423
|
+
return;
|
|
424
|
+
try {
|
|
425
|
+
this.yasr.showLoading();
|
|
426
|
+
this.emit("queryBefore", this);
|
|
427
|
+
const requestConfig = this.yasqe.config.requestConfig;
|
|
428
|
+
const config = typeof requestConfig === "function" ? requestConfig(this.yasqe) : requestConfig;
|
|
429
|
+
if (!config.endpoint) {
|
|
430
|
+
throw new Error("No endpoint configured");
|
|
431
|
+
}
|
|
432
|
+
const endpoint = typeof config.endpoint === "function" ? config.endpoint(this.yasqe) : config.endpoint;
|
|
433
|
+
const method = typeof config.method === "function" ? config.method(this.yasqe) : config.method || "POST";
|
|
434
|
+
const headers = typeof config.headers === "function" ? config.headers(this.yasqe) : config.headers || {};
|
|
435
|
+
const searchParams = new URLSearchParams();
|
|
436
|
+
searchParams.append("query", query);
|
|
437
|
+
if (config.args && Array.isArray(config.args)) {
|
|
438
|
+
config.args.forEach((arg) => {
|
|
439
|
+
if (arg.name && arg.value) {
|
|
440
|
+
searchParams.append(arg.name, arg.value);
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
const fetchOptions = {
|
|
445
|
+
method: method,
|
|
446
|
+
headers: Object.assign({ Accept: "text/turtle" }, headers),
|
|
447
|
+
};
|
|
448
|
+
let url = endpoint;
|
|
449
|
+
if (method === "POST") {
|
|
450
|
+
fetchOptions.headers = Object.assign(Object.assign({}, fetchOptions.headers), { "Content-Type": "application/x-www-form-urlencoded" });
|
|
451
|
+
fetchOptions.body = searchParams.toString();
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
const urlObj = new URL(endpoint);
|
|
455
|
+
searchParams.forEach((value, key) => {
|
|
456
|
+
urlObj.searchParams.append(key, value);
|
|
457
|
+
});
|
|
458
|
+
url = urlObj.toString();
|
|
459
|
+
}
|
|
460
|
+
const startTime = Date.now();
|
|
461
|
+
const response = yield fetch(url, fetchOptions);
|
|
462
|
+
const duration = Date.now() - startTime;
|
|
463
|
+
if (!response.ok) {
|
|
464
|
+
throw new Error(`Query failed: ${response.statusText}`);
|
|
465
|
+
}
|
|
466
|
+
const result = yield response.text();
|
|
467
|
+
const queryResponse = {
|
|
468
|
+
ok: response.ok,
|
|
469
|
+
status: response.status,
|
|
470
|
+
statusText: response.statusText,
|
|
471
|
+
headers: response.headers,
|
|
472
|
+
type: response.type,
|
|
473
|
+
content: result,
|
|
474
|
+
};
|
|
475
|
+
this.yasr.setResponse(queryResponse, duration);
|
|
476
|
+
if (this.yasr.plugins["Graph"]) {
|
|
477
|
+
this.yasr.selectPlugin("Graph");
|
|
478
|
+
}
|
|
479
|
+
this.yasr.hideLoading();
|
|
480
|
+
this.emit("queryResponse", this);
|
|
481
|
+
}
|
|
482
|
+
catch (error) {
|
|
483
|
+
console.error("Background query failed:", error);
|
|
484
|
+
if (this.yasr) {
|
|
485
|
+
this.yasr.hideLoading();
|
|
486
|
+
this.yasr.setResponse({
|
|
487
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
488
|
+
}, 0);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
attachYasqeMouseHandler() {
|
|
494
|
+
if (!this.yasqe)
|
|
495
|
+
return;
|
|
496
|
+
const wrapper = this.yasqe.getWrapperElement();
|
|
497
|
+
if (wrapper) {
|
|
498
|
+
wrapper.addEventListener("mousedown", this.handleYasqeMouseDown);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
detachYasqeMouseHandler() {
|
|
502
|
+
if (!this.yasqe)
|
|
503
|
+
return;
|
|
504
|
+
const wrapper = this.yasqe.getWrapperElement();
|
|
505
|
+
if (wrapper) {
|
|
506
|
+
wrapper.removeEventListener("mousedown", this.handleYasqeMouseDown);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
initYasr() {
|
|
510
|
+
if (!this.yasrWrapperEl)
|
|
511
|
+
throw new Error("Wrapper for yasr does not exist");
|
|
512
|
+
const yasrConf = {
|
|
513
|
+
persistenceId: null,
|
|
514
|
+
prefixes: (yasr) => {
|
|
515
|
+
var _a;
|
|
516
|
+
const prefixesFromYasrConf = typeof this.yasgui.config.yasr.prefixes === "function"
|
|
517
|
+
? this.yasgui.config.yasr.prefixes(yasr)
|
|
518
|
+
: this.yasgui.config.yasr.prefixes;
|
|
519
|
+
const prefixesFromYasqe = (_a = this.yasqe) === null || _a === void 0 ? void 0 : _a.getPrefixesFromQuery();
|
|
520
|
+
return invert(invert(Object.assign(Object.assign({}, prefixesFromYasrConf), prefixesFromYasqe)));
|
|
521
|
+
},
|
|
522
|
+
defaultPlugin: this.persistentJson.yasr.settings.selectedPlugin,
|
|
523
|
+
getPlainQueryLinkToEndpoint: () => {
|
|
524
|
+
if (this.yasqe) {
|
|
525
|
+
return shareLink.appendArgsToUrl(this.getEndpoint(), Yasqe.Sparql.getUrlArguments(this.yasqe, this.persistentJson.requestConfig));
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
plugins: mapValues(this.persistentJson.yasr.settings.pluginsConfig, (conf) => ({
|
|
529
|
+
dynamicConfig: conf,
|
|
530
|
+
})),
|
|
531
|
+
errorRenderers: [
|
|
532
|
+
getCorsErrorRenderer(this),
|
|
533
|
+
...(Yasr.defaults.errorRenderers || []),
|
|
534
|
+
],
|
|
535
|
+
};
|
|
536
|
+
if (yasrConf.getDownloadFileName === undefined) {
|
|
537
|
+
yasrConf.getDownloadFileName = () => words(deburr(this.getName())).join("-");
|
|
538
|
+
}
|
|
539
|
+
this.yasr = new Yasr(this.yasrWrapperEl, yasrConf, this.persistentJson.yasr.response);
|
|
540
|
+
this.persistentJson.yasr.settings = this.yasr.getPersistentConfig();
|
|
541
|
+
this.yasr.on("change", () => {
|
|
542
|
+
if (this.yasr) {
|
|
543
|
+
this.persistentJson.yasr.settings = this.yasr.getPersistentConfig();
|
|
544
|
+
}
|
|
545
|
+
this.emit("change", this, this.persistentJson);
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
destroy() {
|
|
549
|
+
var _a, _b, _c;
|
|
550
|
+
this.removeAllListeners();
|
|
551
|
+
(_a = this.settingsModal) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
552
|
+
(_b = this.endpointSelect) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
553
|
+
this.endpointSelect = undefined;
|
|
554
|
+
(_c = this.yasr) === null || _c === void 0 ? void 0 : _c.destroy();
|
|
555
|
+
this.yasr = undefined;
|
|
556
|
+
this.destroyYasqe();
|
|
557
|
+
}
|
|
558
|
+
static getDefaults(yasgui) {
|
|
559
|
+
return {
|
|
560
|
+
yasqe: {
|
|
561
|
+
value: yasgui ? yasgui.config.yasqe.value : Yasgui.defaults.yasqe.value,
|
|
562
|
+
},
|
|
563
|
+
yasr: {
|
|
564
|
+
response: undefined,
|
|
565
|
+
settings: {
|
|
566
|
+
selectedPlugin: yasgui ? yasgui.config.yasr.defaultPlugin : "table",
|
|
567
|
+
pluginsConfig: {},
|
|
568
|
+
},
|
|
569
|
+
},
|
|
570
|
+
requestConfig: yasgui ? yasgui.config.requestConfig : Object.assign({}, Yasgui.defaults.requestConfig),
|
|
571
|
+
id: getRandomId(),
|
|
572
|
+
name: yasgui ? yasgui.createTabName() : Yasgui.defaults.tabName,
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
export default Tab;
|
|
577
|
+
const safeEndpoint = (endpoint) => {
|
|
578
|
+
const url = new URL(endpoint);
|
|
579
|
+
return encodeURI(url.href);
|
|
580
|
+
};
|
|
581
|
+
function getCorsErrorRenderer(tab) {
|
|
582
|
+
return (error) => __awaiter(this, void 0, void 0, function* () {
|
|
583
|
+
if (!error.status) {
|
|
584
|
+
const shouldReferToHttp = new URL(tab.getEndpoint()).protocol === "http:" && window.location.protocol === "https:";
|
|
585
|
+
if (shouldReferToHttp) {
|
|
586
|
+
const errorEl = document.createElement("div");
|
|
587
|
+
const errorSpan = document.createElement("p");
|
|
588
|
+
errorSpan.innerHTML = `You are trying to query an HTTP endpoint (<a href="${safeEndpoint(tab.getEndpoint())}" target="_blank" rel="noopener noreferrer">${safeEndpoint(tab.getEndpoint())}</a>) from an HTTP<strong>S</strong> website (<a href="${safeEndpoint(window.location.href)}">${safeEndpoint(window.location.href)}</a>).<br>This is not allowed in modern browsers, see <a target="_blank" rel="noopener noreferrer" href="https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy">https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy</a>.`;
|
|
589
|
+
if (tab.yasgui.config.nonSslDomain) {
|
|
590
|
+
const errorLink = document.createElement("p");
|
|
591
|
+
errorLink.innerHTML = `As a workaround, you can use the HTTP version of Yasgui instead: <a href="${tab.getShareableLink(tab.yasgui.config.nonSslDomain)}" target="_blank">${tab.yasgui.config.nonSslDomain}</a>`;
|
|
592
|
+
errorSpan.appendChild(errorLink);
|
|
593
|
+
}
|
|
594
|
+
errorEl.appendChild(errorSpan);
|
|
595
|
+
return errorEl;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
//# sourceMappingURL=Tab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tab.js","sourceRoot":"","sources":["../../../../../packages/yasgui/src/Tab.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE1E,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAmE,MAAM,gBAAgB,CAAC;AACnH,OAAO,EAAE,OAAO,IAAI,IAAI,EAA0E,MAAM,eAAe,CAAC;AACxH,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5E,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,YAAY,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,OAAO,IAAI,MAAM,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