@matdata/yasgui 5.20.3 → 6.0.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/README.md +76 -59
- package/build/ts/src/ConfigExportImport.js +1 -1
- package/build/ts/src/PersistentConfig.d.ts +2 -0
- package/build/ts/src/PersistentConfig.js +9 -1
- package/build/ts/src/PersistentConfig.js.map +1 -1
- package/build/ts/src/Tab.d.ts +1 -1
- package/build/ts/src/Tab.js +12 -17
- package/build/ts/src/Tab.js.map +1 -1
- package/build/ts/src/TabSettingsModal.js +19 -55
- package/build/ts/src/TabSettingsModal.js.map +1 -1
- package/build/ts/src/index.d.ts +1 -1
- package/build/ts/src/index.js +5 -1
- package/build/ts/src/index.js.map +1 -1
- package/build/ts/src/queryManagement/QueryBrowser.js +2 -2
- package/build/ts/src/queryManagement/WorkspaceSettingsForm.js +1 -1
- package/build/ts/src/version.d.ts +1 -1
- package/build/ts/src/version.js +1 -1
- package/build/ts/src/version.js.map +1 -1
- package/build/yasgui.min.css +1 -1
- package/build/yasgui.min.css.map +3 -3
- package/build/yasgui.min.js +257 -261
- package/build/yasgui.min.js.map +4 -4
- package/package.json +4 -4
- package/src/ConfigExportImport.ts +3 -3
- package/src/PersistentConfig.ts +17 -1
- package/src/Tab.ts +20 -21
- package/src/TabSettingsModal.ts +22 -61
- package/src/editor-themes.scss +268 -0
- package/src/endpointSelect.ts +3 -3
- package/src/github-dark-theme.scss +20 -39
- package/src/index.scss +1 -1
- package/src/index.ts +7 -1
- package/src/queryManagement/QueryBrowser.ts +2 -2
- package/src/queryManagement/WorkspaceSettingsForm.ts +1 -1
- package/src/tab.scss +13 -2
- package/src/themes.scss +10 -5
- package/src/version.ts +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matdata/yasgui",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "
|
|
3
|
+
"description": "MatGUI: a modern SPARQL query editor and results viewer for knowledge graphs and linked data (formerly Yasgui).",
|
|
4
|
+
"version": "6.0.0",
|
|
5
5
|
"main": "build/yasgui.min.js",
|
|
6
6
|
"types": "build/ts/src/index.d.ts",
|
|
7
7
|
"license": "MIT",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"Semantic Web",
|
|
15
15
|
"Linked Data"
|
|
16
16
|
],
|
|
17
|
-
"bugs": "https://github.com/Matdata-eu/
|
|
17
|
+
"bugs": "https://github.com/Matdata-eu/Matgui/issues/",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
|
-
"url": "https://github.com/Matdata-eu/
|
|
20
|
+
"url": "https://github.com/Matdata-eu/Matgui.git",
|
|
21
21
|
"directory": "packages/yasgui"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Export/Import Configuration Module
|
|
3
|
-
* Handles serialization and deserialization of
|
|
3
|
+
* Handles serialization and deserialization of Matgui configuration to/from RDF Turtle format
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { PersistedJson } from "./PersistentConfig";
|
|
7
7
|
|
|
8
|
-
//
|
|
8
|
+
// Matgui Configuration Ontology
|
|
9
9
|
export const YASGUI_NS = "https://yasgui.matdata.eu/ontology#";
|
|
10
10
|
export const RDF_NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
|
|
11
11
|
export const RDFS_NS = "http://www.w3.org/2000/01/rdf-schema#";
|
|
@@ -328,7 +328,7 @@ export function parseFromTurtle(turtle: string): Partial<PersistedJson> {
|
|
|
328
328
|
/**
|
|
329
329
|
* Download configuration as a file
|
|
330
330
|
*/
|
|
331
|
-
export function downloadConfigAsFile(config: PersistedJson, filename: string = "
|
|
331
|
+
export function downloadConfigAsFile(config: PersistedJson, filename: string = "matgui-config.ttl") {
|
|
332
332
|
const turtle = serializeToTurtle(config);
|
|
333
333
|
const blob = new Blob([turtle], { type: "text/turtle;charset=utf-8" });
|
|
334
334
|
const url = URL.createObjectURL(blob);
|
package/src/PersistentConfig.ts
CHANGED
|
@@ -126,7 +126,7 @@ export default class PersistentConfig {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
private handleLocalStorageQuotaFull(_e: any) {
|
|
129
|
-
console.warn("Localstorage quota exceeded. Clearing all
|
|
129
|
+
console.warn("Localstorage quota exceeded. Clearing all Matgui configurations");
|
|
130
130
|
PersistentConfig.clear();
|
|
131
131
|
}
|
|
132
132
|
|
|
@@ -312,6 +312,22 @@ export default class PersistentConfig {
|
|
|
312
312
|
this.toStorage();
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
+
/**
|
|
316
|
+
* Get the persisted layout orientation
|
|
317
|
+
*/
|
|
318
|
+
public getOrientation(): "vertical" | "horizontal" | undefined {
|
|
319
|
+
const orientation = this.persistedJson.orientation;
|
|
320
|
+
return orientation === "vertical" || orientation === "horizontal" ? orientation : undefined;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Set and persist the layout orientation
|
|
325
|
+
*/
|
|
326
|
+
public setOrientation(orientation: "vertical" | "horizontal") {
|
|
327
|
+
this.persistedJson.orientation = orientation;
|
|
328
|
+
this.toStorage();
|
|
329
|
+
}
|
|
330
|
+
|
|
315
331
|
/**
|
|
316
332
|
* Get list of disabled developer-configured endpoint buttons
|
|
317
333
|
*/
|
package/src/Tab.ts
CHANGED
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
Config as YasrConfig,
|
|
10
10
|
PersistentConfig as YasrPersistentConfig,
|
|
11
11
|
PluginQueryOptions as YasrPluginQueryOptions,
|
|
12
|
+
buildSubjectOfQuery,
|
|
13
|
+
buildObjectOfQuery,
|
|
12
14
|
} from "@matdata/yasr";
|
|
13
15
|
import { mapValues, eq, mergeWith, words, deburr, invert } from "lodash-es";
|
|
14
16
|
import * as shareLink from "./linkUtils";
|
|
@@ -380,7 +382,7 @@ export class Tab extends EventEmitter {
|
|
|
380
382
|
|
|
381
383
|
// We group controlbar and Yasqe, so that users can easily .appendChild() to the .editorwrapper div
|
|
382
384
|
// to add a div that goes alongside the controlbar and editor, while YASR still goes full width
|
|
383
|
-
// Useful for adding an infos div that goes alongside the editor without needing to rebuild the whole
|
|
385
|
+
// Useful for adding an infos div that goes alongside the editor without needing to rebuild the whole Matgui class
|
|
384
386
|
const editorWrapper = document.createElement("div");
|
|
385
387
|
editorWrapper.className = "editorwrapper";
|
|
386
388
|
this.editorWrapperEl = editorWrapper;
|
|
@@ -621,6 +623,9 @@ export class Tab extends EventEmitter {
|
|
|
621
623
|
// Update global config
|
|
622
624
|
this.yasgui.config.orientation = newOrientation;
|
|
623
625
|
|
|
626
|
+
// Persist orientation
|
|
627
|
+
this.yasgui.persistentConfig.setOrientation(newOrientation);
|
|
628
|
+
|
|
624
629
|
// Apply to all tabs
|
|
625
630
|
for (const tabId in this.yasgui._tabs) {
|
|
626
631
|
const tab = this.yasgui._tabs[tabId];
|
|
@@ -1246,7 +1251,7 @@ export class Tab extends EventEmitter {
|
|
|
1246
1251
|
}
|
|
1247
1252
|
|
|
1248
1253
|
/**
|
|
1249
|
-
* The
|
|
1254
|
+
* The Matgui configuration object may contain a custom request config
|
|
1250
1255
|
* This request config object can contain getter functions, or plain json
|
|
1251
1256
|
* The plain json data is stored in persisted config, and editable via the
|
|
1252
1257
|
* tab pane.
|
|
@@ -1283,7 +1288,7 @@ export class Tab extends EventEmitter {
|
|
|
1283
1288
|
value: this.persistentJson.yasqe.value,
|
|
1284
1289
|
editorHeight: this.persistentJson.yasqe.editorHeight ? this.persistentJson.yasqe.editorHeight : undefined,
|
|
1285
1290
|
persistenceId: null, //yasgui handles persistent storing
|
|
1286
|
-
consumeShareLink: null, //not handled by this tab, but by parent
|
|
1291
|
+
consumeShareLink: null, //not handled by this tab, but by parent Matgui instance
|
|
1287
1292
|
createShareableLink: () => this.getShareableLink(),
|
|
1288
1293
|
// Use global showSnippetsBar setting if it exists
|
|
1289
1294
|
showSnippetsBar: this.yasgui.config.showSnippetsBar !== false,
|
|
@@ -1561,21 +1566,15 @@ export class Tab extends EventEmitter {
|
|
|
1561
1566
|
}
|
|
1562
1567
|
}
|
|
1563
1568
|
|
|
1564
|
-
// Construct the query
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
}
|
|
1574
|
-
UNION
|
|
1575
|
-
{
|
|
1576
|
-
?target ?p_right ?o_right .
|
|
1577
|
-
}
|
|
1578
|
-
} LIMIT 1000`;
|
|
1569
|
+
// Construct the query based on whether Shift is held
|
|
1570
|
+
let constructQuery: string;
|
|
1571
|
+
if (event.shiftKey) {
|
|
1572
|
+
// Ctrl+Shift+Click: find all triples where URI is the object
|
|
1573
|
+
constructQuery = buildObjectOfQuery(uri);
|
|
1574
|
+
} else {
|
|
1575
|
+
// Ctrl+Click: find all triples where URI is the subject
|
|
1576
|
+
constructQuery = buildSubjectOfQuery(uri);
|
|
1577
|
+
}
|
|
1579
1578
|
|
|
1580
1579
|
// Execute query in background without changing editor content
|
|
1581
1580
|
// Note: void operator is intentional - errors are handled in the catch block of executeBackgroundQuery
|
|
@@ -1659,7 +1658,7 @@ WHERE {
|
|
|
1659
1658
|
if (!this.yasrWrapperEl) throw new Error("Wrapper for yasr does not exist");
|
|
1660
1659
|
|
|
1661
1660
|
const yasrConf: Partial<YasrConfig> = {
|
|
1662
|
-
persistenceId: null, //
|
|
1661
|
+
persistenceId: null, //Matgui handles persistent storing
|
|
1663
1662
|
prefixes: (yasr) => {
|
|
1664
1663
|
// Prefixes defined in YASR's config
|
|
1665
1664
|
const prefixesFromYasrConf =
|
|
@@ -1826,7 +1825,7 @@ WHERE {
|
|
|
1826
1825
|
public static getDefaults(yasgui?: Yasgui): PersistedJson {
|
|
1827
1826
|
return {
|
|
1828
1827
|
yasqe: {
|
|
1829
|
-
value: yasgui ? yasgui.config.yasqe.value : Yasgui.defaults.yasqe.value,
|
|
1828
|
+
value: (yasgui ? yasgui.config.yasqe.value : Yasgui.defaults.yasqe.value) ?? "",
|
|
1830
1829
|
},
|
|
1831
1830
|
yasr: {
|
|
1832
1831
|
response: undefined,
|
|
@@ -1875,7 +1874,7 @@ function getCorsErrorRenderer(tab: Tab) {
|
|
|
1875
1874
|
tab.getEndpoint(),
|
|
1876
1875
|
)}</a>) from an HTTP<strong>S</strong> website (<a href="${safeEndpoint(window.location.href)}">${safeEndpoint(
|
|
1877
1876
|
window.location.href,
|
|
1878
|
-
)}</a>).<br>This can be blocked 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>. See also <a href="https://
|
|
1877
|
+
)}</a>).<br>This can be blocked 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>. See also <a href="https://matgui-doc.matdata.eu/docs/user-guide#querying-local-endpoints">the Matgui documentation</a> for possible workarounds.`;
|
|
1879
1878
|
errorEl.appendChild(errorSpan);
|
|
1880
1879
|
return errorEl;
|
|
1881
1880
|
}
|
package/src/TabSettingsModal.ts
CHANGED
|
@@ -509,43 +509,17 @@ export default class TabSettingsModal {
|
|
|
509
509
|
return;
|
|
510
510
|
}
|
|
511
511
|
|
|
512
|
-
// Available
|
|
512
|
+
// Available editor themes. Each theme is a `cm-s-<name>` class applied to the
|
|
513
|
+
// CodeMirror 6 editor root; the styles for these ship with yasgui.
|
|
513
514
|
const themes = [
|
|
514
|
-
{ value: "default", label: "Default" },
|
|
515
|
+
{ value: "default", label: "Default (Light)" },
|
|
516
|
+
{ value: "eclipse", label: "Eclipse (Light)" },
|
|
517
|
+
{ value: "idea", label: "IntelliJ IDEA (Light)" },
|
|
518
|
+
{ value: "solarized-light", label: "Solarized Light" },
|
|
515
519
|
{ value: "github-dark", label: "GitHub Dark Default" },
|
|
516
|
-
{ value: "
|
|
517
|
-
{ value: "
|
|
518
|
-
{ value: "
|
|
519
|
-
{ value: "nord", label: "Nord" },
|
|
520
|
-
{ value: "solarized dark", label: "Solarized Dark" },
|
|
521
|
-
{ value: "solarized light", label: "Solarized Light" },
|
|
522
|
-
{ value: "twilight", label: "Twilight" },
|
|
523
|
-
{ value: "material", label: "Material" },
|
|
524
|
-
{ value: "cobalt", label: "Cobalt" },
|
|
525
|
-
{ value: "darcula", label: "Darcula" },
|
|
526
|
-
{ value: "gruvbox-dark", label: "Gruvbox Dark" },
|
|
527
|
-
{ value: "oceanic-next", label: "Oceanic Next" },
|
|
528
|
-
{ value: "material-darker", label: "Material Darker" },
|
|
529
|
-
{ value: "blackboard", label: "Blackboard" },
|
|
530
|
-
{ value: "base16-dark", label: "Base16 Dark" },
|
|
531
|
-
{ value: "base16-light", label: "Base16 Light" },
|
|
532
|
-
{ value: "eclipse", label: "Eclipse" },
|
|
533
|
-
{ value: "elegant", label: "Elegant" },
|
|
534
|
-
{ value: "idea", label: "IntelliJ IDEA" },
|
|
535
|
-
{ value: "mbo", label: "MBO" },
|
|
536
|
-
{ value: "neat", label: "Neat" },
|
|
537
|
-
{ value: "neo", label: "Neo" },
|
|
538
|
-
{ value: "night", label: "Night" },
|
|
539
|
-
{ value: "paraiso-dark", label: "Paraiso Dark" },
|
|
540
|
-
{ value: "paraiso-light", label: "Paraiso Light" },
|
|
541
|
-
{ value: "pastel-on-dark", label: "Pastel on Dark" },
|
|
542
|
-
{ value: "rubyblue", label: "Ruby Blue" },
|
|
543
|
-
{ value: "the-matrix", label: "The Matrix" },
|
|
544
|
-
{ value: "tomorrow-night-bright", label: "Tomorrow Night Bright" },
|
|
545
|
-
{ value: "tomorrow-night-eighties", label: "Tomorrow Night 80s" },
|
|
546
|
-
{ value: "vibrant-ink", label: "Vibrant Ink" },
|
|
547
|
-
{ value: "xq-dark", label: "XQ Dark" },
|
|
548
|
-
{ value: "xq-light", label: "XQ Light" },
|
|
520
|
+
{ value: "monokai", label: "Monokai (Dark)" },
|
|
521
|
+
{ value: "dracula", label: "Dracula (Dark)" },
|
|
522
|
+
{ value: "material-darker", label: "Material Darker (Dark)" },
|
|
549
523
|
];
|
|
550
524
|
|
|
551
525
|
// Light Mode Theme Section
|
|
@@ -610,20 +584,6 @@ export default class TabSettingsModal {
|
|
|
610
584
|
themeDarkSection.appendChild(themeDarkSelect);
|
|
611
585
|
container.appendChild(themeDarkSection);
|
|
612
586
|
|
|
613
|
-
// Theme reference link
|
|
614
|
-
const themeReferenceSection = document.createElement("div");
|
|
615
|
-
addClass(themeReferenceSection, "settingsSection");
|
|
616
|
-
|
|
617
|
-
const themeReferenceLink = document.createElement("a");
|
|
618
|
-
themeReferenceLink.href = "https://codemirror.net/5/demo/theme.html";
|
|
619
|
-
themeReferenceLink.target = "_blank";
|
|
620
|
-
themeReferenceLink.rel = "noopener noreferrer";
|
|
621
|
-
themeReferenceLink.textContent = "Preview CodeMirror themes →";
|
|
622
|
-
addClass(themeReferenceLink, "settingsLink");
|
|
623
|
-
|
|
624
|
-
themeReferenceSection.appendChild(themeReferenceLink);
|
|
625
|
-
container.appendChild(themeReferenceSection);
|
|
626
|
-
|
|
627
587
|
// Formatter Type Section
|
|
628
588
|
const formatterSection = document.createElement("div");
|
|
629
589
|
addClass(formatterSection, "settingsSection");
|
|
@@ -1917,7 +1877,7 @@ export default class TabSettingsModal {
|
|
|
1917
1877
|
|
|
1918
1878
|
const exportHelp = document.createElement("div");
|
|
1919
1879
|
exportHelp.textContent =
|
|
1920
|
-
"Export your
|
|
1880
|
+
"Export your Matgui configuration in RDF Turtle format. This includes tabs, queries, endpoints, and preferences.";
|
|
1921
1881
|
addClass(exportHelp, "settingsHelp");
|
|
1922
1882
|
|
|
1923
1883
|
const exportButtonsContainer = document.createElement("div");
|
|
@@ -2072,7 +2032,8 @@ export default class TabSettingsModal {
|
|
|
2072
2032
|
{ keys: ["Ctrl+Shift+D", "Cmd+Shift+D"], description: "Duplicate current line" },
|
|
2073
2033
|
{ keys: ["Ctrl+Shift+K", "Cmd+Shift+K"], description: "Delete current line" },
|
|
2074
2034
|
{ keys: ["Esc"], description: "Remove focus from editor" },
|
|
2075
|
-
{ keys: ["Ctrl+Click"], description: "
|
|
2035
|
+
{ keys: ["Ctrl+Click"], description: "Find triples where URI is subject" },
|
|
2036
|
+
{ keys: ["Ctrl+Shift+Click"], description: "Find triples where URI is object" },
|
|
2076
2037
|
],
|
|
2077
2038
|
},
|
|
2078
2039
|
{
|
|
@@ -2085,15 +2046,15 @@ export default class TabSettingsModal {
|
|
|
2085
2046
|
],
|
|
2086
2047
|
},
|
|
2087
2048
|
{
|
|
2088
|
-
category: "
|
|
2049
|
+
category: "Matgui Tabs",
|
|
2089
2050
|
shortcuts: [
|
|
2090
2051
|
{
|
|
2091
2052
|
keys: ["Ctrl+Alt+Tab", "Cmd+Alt+Tab"],
|
|
2092
|
-
description: "Switch to previously used
|
|
2053
|
+
description: "Switch to previously used Matgui tab",
|
|
2093
2054
|
},
|
|
2094
2055
|
{
|
|
2095
2056
|
keys: ["Ctrl+Alt+Shift+Tab", "Cmd+Alt+Shift+Tab"],
|
|
2096
|
-
description: "Switch to next
|
|
2057
|
+
description: "Switch to next Matgui tab in recently used order",
|
|
2097
2058
|
},
|
|
2098
2059
|
],
|
|
2099
2060
|
},
|
|
@@ -2238,12 +2199,12 @@ export default class TabSettingsModal {
|
|
|
2238
2199
|
const aboutSection = document.createElement("div");
|
|
2239
2200
|
addClass(aboutSection, "settingsSection", "aboutSection");
|
|
2240
2201
|
|
|
2241
|
-
//
|
|
2202
|
+
// Matgui Title and Version
|
|
2242
2203
|
const titleContainer = document.createElement("div");
|
|
2243
2204
|
addClass(titleContainer, "aboutTitle");
|
|
2244
2205
|
|
|
2245
2206
|
const title = document.createElement("h3");
|
|
2246
|
-
title.textContent = "
|
|
2207
|
+
title.textContent = "MatGUI";
|
|
2247
2208
|
addClass(title, "aboutMainTitle");
|
|
2248
2209
|
|
|
2249
2210
|
const versionBadge = document.createElement("span");
|
|
@@ -2256,7 +2217,7 @@ export default class TabSettingsModal {
|
|
|
2256
2217
|
|
|
2257
2218
|
// Subtitle
|
|
2258
2219
|
const subtitle = document.createElement("p");
|
|
2259
|
-
subtitle.textContent = "
|
|
2220
|
+
subtitle.textContent = "A modern knowledge graph and SPARQL workbench";
|
|
2260
2221
|
addClass(subtitle, "aboutSubtitle");
|
|
2261
2222
|
aboutSection.appendChild(subtitle);
|
|
2262
2223
|
|
|
@@ -2267,7 +2228,7 @@ export default class TabSettingsModal {
|
|
|
2267
2228
|
// Documentation Link
|
|
2268
2229
|
const docsLink = this.createAboutLink(
|
|
2269
2230
|
"📚 Documentation",
|
|
2270
|
-
"https://
|
|
2231
|
+
"https://matgui-doc.matdata.eu/docs/",
|
|
2271
2232
|
"View the complete documentation and guides",
|
|
2272
2233
|
);
|
|
2273
2234
|
linksSection.appendChild(docsLink);
|
|
@@ -2275,7 +2236,7 @@ export default class TabSettingsModal {
|
|
|
2275
2236
|
// Release Notes Link
|
|
2276
2237
|
const releasesLink = this.createAboutLink(
|
|
2277
2238
|
"📝 Release Notes",
|
|
2278
|
-
"https://github.com/Matdata-eu/
|
|
2239
|
+
"https://github.com/Matdata-eu/Matgui/releases",
|
|
2279
2240
|
"See what's new in the latest releases",
|
|
2280
2241
|
);
|
|
2281
2242
|
linksSection.appendChild(releasesLink);
|
|
@@ -2283,7 +2244,7 @@ export default class TabSettingsModal {
|
|
|
2283
2244
|
// Issues/Support Link
|
|
2284
2245
|
const issuesLink = this.createAboutLink(
|
|
2285
2246
|
"🐛 Report Issues & Get Support",
|
|
2286
|
-
"https://github.com/Matdata-eu/
|
|
2247
|
+
"https://github.com/Matdata-eu/Matgui/issues",
|
|
2287
2248
|
"Report bugs, request features, or ask for help",
|
|
2288
2249
|
);
|
|
2289
2250
|
linksSection.appendChild(issuesLink);
|
|
@@ -2295,7 +2256,7 @@ export default class TabSettingsModal {
|
|
|
2295
2256
|
addClass(footerInfo, "aboutFooter");
|
|
2296
2257
|
|
|
2297
2258
|
const paragraph1 = document.createElement("p");
|
|
2298
|
-
paragraph1.textContent = "
|
|
2259
|
+
paragraph1.textContent = "MatGUI is an open-source project maintained by ";
|
|
2299
2260
|
const matdataLink = document.createElement("a");
|
|
2300
2261
|
matdataLink.href = "https://matdata.eu";
|
|
2301
2262
|
matdataLink.target = "_blank";
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
// Additional CodeMirror 6 editor themes for YASQE.
|
|
2
|
+
//
|
|
3
|
+
// Each theme is a `cm-s-<name>` class applied to the editor root element by the
|
|
4
|
+
// yasqe editor facade (see packages/yasqe/src/editor/facade.ts). The `default`
|
|
5
|
+
// (light) and `github-dark` themes ship elsewhere; this file adds the extra
|
|
6
|
+
// themes offered in the tab settings.
|
|
7
|
+
//
|
|
8
|
+
// Selectors target the CodeMirror 6 DOM (`.cm-editor` / `.cm-*`). The mixin below
|
|
9
|
+
// keeps the (fairly repetitive) token colouring consistent across themes.
|
|
10
|
+
|
|
11
|
+
@mixin cm-theme(
|
|
12
|
+
$bg,
|
|
13
|
+
$fg,
|
|
14
|
+
$gutter-bg,
|
|
15
|
+
$gutter-fg,
|
|
16
|
+
$border,
|
|
17
|
+
$cursor,
|
|
18
|
+
$selection,
|
|
19
|
+
$active-line,
|
|
20
|
+
$keyword,
|
|
21
|
+
$atom,
|
|
22
|
+
$number,
|
|
23
|
+
$string,
|
|
24
|
+
$string-2,
|
|
25
|
+
$variable-3,
|
|
26
|
+
$meta,
|
|
27
|
+
$comment,
|
|
28
|
+
$punc,
|
|
29
|
+
$bracket
|
|
30
|
+
) {
|
|
31
|
+
&.cm-editor,
|
|
32
|
+
&.CodeMirror {
|
|
33
|
+
background-color: $bg;
|
|
34
|
+
color: $fg;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.cm-gutters {
|
|
38
|
+
background: $gutter-bg;
|
|
39
|
+
border-right: 1px solid $border;
|
|
40
|
+
color: $gutter-fg;
|
|
41
|
+
}
|
|
42
|
+
.cm-gutterElement {
|
|
43
|
+
color: $gutter-fg;
|
|
44
|
+
}
|
|
45
|
+
.cm-foldGutter .cm-gutterElement {
|
|
46
|
+
color: $fg;
|
|
47
|
+
}
|
|
48
|
+
.cm-activeLine {
|
|
49
|
+
background: $active-line;
|
|
50
|
+
}
|
|
51
|
+
.cm-activeLineGutter {
|
|
52
|
+
background: $active-line;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.cm-cursor,
|
|
56
|
+
.cm-dropCursor {
|
|
57
|
+
border-left: 1px solid $cursor;
|
|
58
|
+
}
|
|
59
|
+
.cm-selectionBackground,
|
|
60
|
+
&.cm-focused .cm-selectionBackground {
|
|
61
|
+
background: $selection !important;
|
|
62
|
+
}
|
|
63
|
+
.cm-content ::selection,
|
|
64
|
+
.cm-line::selection {
|
|
65
|
+
background: $selection !important;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
span.cm-keyword {
|
|
69
|
+
color: $keyword;
|
|
70
|
+
}
|
|
71
|
+
span.cm-atom {
|
|
72
|
+
color: $atom;
|
|
73
|
+
}
|
|
74
|
+
span.cm-number {
|
|
75
|
+
color: $number;
|
|
76
|
+
}
|
|
77
|
+
span.cm-string {
|
|
78
|
+
color: $string;
|
|
79
|
+
}
|
|
80
|
+
span.cm-string-2 {
|
|
81
|
+
color: $string-2;
|
|
82
|
+
}
|
|
83
|
+
span.cm-variable-3 {
|
|
84
|
+
color: $variable-3;
|
|
85
|
+
}
|
|
86
|
+
span.cm-meta {
|
|
87
|
+
color: $meta;
|
|
88
|
+
}
|
|
89
|
+
span.cm-comment {
|
|
90
|
+
color: $comment;
|
|
91
|
+
font-style: italic;
|
|
92
|
+
}
|
|
93
|
+
span.cm-punc {
|
|
94
|
+
color: $punc;
|
|
95
|
+
}
|
|
96
|
+
span.cm-bracket {
|
|
97
|
+
color: $bracket;
|
|
98
|
+
}
|
|
99
|
+
span.cm-error {
|
|
100
|
+
color: #f00;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Rainbow brackets
|
|
104
|
+
span.cm-bracket-level-0 {
|
|
105
|
+
color: #ffd700;
|
|
106
|
+
}
|
|
107
|
+
span.cm-bracket-level-1 {
|
|
108
|
+
color: #da70d6;
|
|
109
|
+
}
|
|
110
|
+
span.cm-bracket-level-2 {
|
|
111
|
+
color: #6bb0cc;
|
|
112
|
+
}
|
|
113
|
+
span.cm-bracket-level-3 {
|
|
114
|
+
color: #439143;
|
|
115
|
+
}
|
|
116
|
+
span.cm-bracket-paren {
|
|
117
|
+
color: $punc;
|
|
118
|
+
}
|
|
119
|
+
span.cm-bracket-mismatch {
|
|
120
|
+
color: #f00;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// ---------------------------------------------------------------------------
|
|
125
|
+
// Dark themes
|
|
126
|
+
// ---------------------------------------------------------------------------
|
|
127
|
+
|
|
128
|
+
.cm-s-monokai {
|
|
129
|
+
@include cm-theme(
|
|
130
|
+
$bg: #272822,
|
|
131
|
+
$fg: #f8f8f2,
|
|
132
|
+
$gutter-bg: #272822,
|
|
133
|
+
$gutter-fg: #75715e,
|
|
134
|
+
$border: #3a3b35,
|
|
135
|
+
$cursor: #f8f8f0,
|
|
136
|
+
$selection: rgba(73, 72, 62, 0.99),
|
|
137
|
+
$active-line: rgba(255, 255, 255, 0.05),
|
|
138
|
+
$keyword: #f92672,
|
|
139
|
+
$atom: #ae81ff,
|
|
140
|
+
$number: #ae81ff,
|
|
141
|
+
$string: #e6db74,
|
|
142
|
+
$string-2: #a6e22e,
|
|
143
|
+
$variable-3: #66d9ef,
|
|
144
|
+
$meta: #75715e,
|
|
145
|
+
$comment: #75715e,
|
|
146
|
+
$punc: #f8f8f2,
|
|
147
|
+
$bracket: #f8f8f2
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.cm-s-dracula {
|
|
152
|
+
@include cm-theme(
|
|
153
|
+
$bg: #282a36,
|
|
154
|
+
$fg: #f8f8f2,
|
|
155
|
+
$gutter-bg: #282a36,
|
|
156
|
+
$gutter-fg: #6272a4,
|
|
157
|
+
$border: #3a3c4e,
|
|
158
|
+
$cursor: #f8f8f0,
|
|
159
|
+
$selection: rgba(68, 71, 90, 0.99),
|
|
160
|
+
$active-line: rgba(255, 255, 255, 0.05),
|
|
161
|
+
$keyword: #ff79c6,
|
|
162
|
+
$atom: #bd93f9,
|
|
163
|
+
$number: #bd93f9,
|
|
164
|
+
$string: #f1fa8c,
|
|
165
|
+
$string-2: #8be9fd,
|
|
166
|
+
$variable-3: #8be9fd,
|
|
167
|
+
$meta: #6272a4,
|
|
168
|
+
$comment: #6272a4,
|
|
169
|
+
$punc: #f8f8f2,
|
|
170
|
+
$bracket: #f8f8f2
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.cm-s-material-darker {
|
|
175
|
+
@include cm-theme(
|
|
176
|
+
$bg: #212121,
|
|
177
|
+
$fg: #eeffff,
|
|
178
|
+
$gutter-bg: #212121,
|
|
179
|
+
$gutter-fg: #545454,
|
|
180
|
+
$border: #2a2a2a,
|
|
181
|
+
$cursor: #ffcc00,
|
|
182
|
+
$selection: rgba(97, 97, 97, 0.6),
|
|
183
|
+
$active-line: rgba(255, 255, 255, 0.05),
|
|
184
|
+
$keyword: #c792ea,
|
|
185
|
+
$atom: #f78c6c,
|
|
186
|
+
$number: #f78c6c,
|
|
187
|
+
$string: #c3e88d,
|
|
188
|
+
$string-2: #82aaff,
|
|
189
|
+
$variable-3: #89ddff,
|
|
190
|
+
$meta: #546e7a,
|
|
191
|
+
$comment: #546e7a,
|
|
192
|
+
$punc: #89ddff,
|
|
193
|
+
$bracket: #eeffff
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// ---------------------------------------------------------------------------
|
|
198
|
+
// Light themes
|
|
199
|
+
// ---------------------------------------------------------------------------
|
|
200
|
+
|
|
201
|
+
.cm-s-solarized-light {
|
|
202
|
+
@include cm-theme(
|
|
203
|
+
$bg: #fdf6e3,
|
|
204
|
+
$fg: #657b83,
|
|
205
|
+
$gutter-bg: #eee8d5,
|
|
206
|
+
$gutter-fg: #93a1a1,
|
|
207
|
+
$border: #e6dfc6,
|
|
208
|
+
$cursor: #657b83,
|
|
209
|
+
$selection: rgba(7, 54, 66, 0.12),
|
|
210
|
+
$active-line: rgba(0, 0, 0, 0.04),
|
|
211
|
+
$keyword: #859900,
|
|
212
|
+
$atom: #d33682,
|
|
213
|
+
$number: #d33682,
|
|
214
|
+
$string: #2aa198,
|
|
215
|
+
$string-2: #6c71c4,
|
|
216
|
+
$variable-3: #268bd2,
|
|
217
|
+
$meta: #cb4b16,
|
|
218
|
+
$comment: #93a1a1,
|
|
219
|
+
$punc: #657b83,
|
|
220
|
+
$bracket: #657b83
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.cm-s-eclipse {
|
|
225
|
+
@include cm-theme(
|
|
226
|
+
$bg: #ffffff,
|
|
227
|
+
$fg: #000000,
|
|
228
|
+
$gutter-bg: #f7f7f7,
|
|
229
|
+
$gutter-fg: #999999,
|
|
230
|
+
$border: #dddddd,
|
|
231
|
+
$cursor: #000000,
|
|
232
|
+
$selection: rgba(215, 209, 255, 0.99),
|
|
233
|
+
$active-line: rgba(0, 0, 0, 0.04),
|
|
234
|
+
$keyword: #7f0055,
|
|
235
|
+
$atom: #219,
|
|
236
|
+
$number: #164,
|
|
237
|
+
$string: #2a00ff,
|
|
238
|
+
$string-2: #f50,
|
|
239
|
+
$variable-3: #085,
|
|
240
|
+
$meta: #555,
|
|
241
|
+
$comment: #3f7f5f,
|
|
242
|
+
$punc: #000000,
|
|
243
|
+
$bracket: #000000
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.cm-s-idea {
|
|
248
|
+
@include cm-theme(
|
|
249
|
+
$bg: #ffffff,
|
|
250
|
+
$fg: #000000,
|
|
251
|
+
$gutter-bg: #ffffff,
|
|
252
|
+
$gutter-fg: #999999,
|
|
253
|
+
$border: #dddddd,
|
|
254
|
+
$cursor: #000000,
|
|
255
|
+
$selection: rgba(163, 214, 255, 0.99),
|
|
256
|
+
$active-line: #fffae3,
|
|
257
|
+
$keyword: #000080,
|
|
258
|
+
$atom: #009695,
|
|
259
|
+
$number: #0000ff,
|
|
260
|
+
$string: #008000,
|
|
261
|
+
$string-2: #a11,
|
|
262
|
+
$variable-3: #20999d,
|
|
263
|
+
$meta: #808000,
|
|
264
|
+
$comment: #808080,
|
|
265
|
+
$punc: #000000,
|
|
266
|
+
$bracket: #000000
|
|
267
|
+
);
|
|
268
|
+
}
|
package/src/endpointSelect.ts
CHANGED
|
@@ -7,9 +7,9 @@ import parse from "autosuggest-highlight/parse";
|
|
|
7
7
|
import DOMPurify from "dompurify";
|
|
8
8
|
|
|
9
9
|
//Export this here instead of from our custom-types folder of autocomplete-js
|
|
10
|
-
//as this interface is exported via the
|
|
11
|
-
//not exported as part of the
|
|
12
|
-
//instead, include this interface in the
|
|
10
|
+
//as this interface is exported via the Matgui config. The custom typings are
|
|
11
|
+
//not exported as part of the Matgui typings, so we'd get typing errors.
|
|
12
|
+
//instead, include this interface in the Matgui typings itself by defining it here
|
|
13
13
|
interface AutocompleteItem<T> {
|
|
14
14
|
index: number; //index of suggestion in array of suggestions
|
|
15
15
|
value: T; //suggestion object
|