@matdata/yasgui 5.1.0 → 5.3.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 +128 -96
- package/build/ts/src/ConfigExportImport.d.ts +16 -0
- package/build/ts/src/ConfigExportImport.js +304 -0
- package/build/ts/src/ConfigExportImport.js.map +1 -0
- package/build/ts/src/PersistentConfig.d.ts +8 -1
- package/build/ts/src/PersistentConfig.js +15 -0
- package/build/ts/src/PersistentConfig.js.map +1 -1
- package/build/ts/src/Tab.d.ts +9 -0
- package/build/ts/src/Tab.js +83 -1
- package/build/ts/src/Tab.js.map +1 -1
- package/build/ts/src/TabSettingsModal.d.ts +6 -0
- package/build/ts/src/TabSettingsModal.js +405 -1
- package/build/ts/src/TabSettingsModal.js.map +1 -1
- package/build/ts/src/defaults.js +2 -0
- package/build/ts/src/defaults.js.map +1 -1
- package/build/ts/src/index.d.ts +6 -0
- package/build/ts/src/index.js.map +1 -1
- package/build/yasgui.min.css +1 -1
- package/build/yasgui.min.css.map +3 -3
- package/build/yasgui.min.js +157 -105
- package/build/yasgui.min.js.map +4 -4
- package/package.json +1 -1
- package/src/ConfigExportImport.ts +391 -0
- package/src/PersistentConfig.ts +27 -1
- package/src/Tab.ts +123 -2
- package/src/TabSettingsModal.scss +180 -0
- package/src/TabSettingsModal.ts +499 -3
- package/src/defaults.ts +2 -0
- package/src/endpointSelect.scss +34 -0
- package/src/index.scss +2 -2
- package/src/index.ts +11 -0
- package/src/sortablejs.d.ts +36 -0
- package/src/tab.scss +50 -2
- package/src/themes.scss +23 -0
package/README.md
CHANGED
|
@@ -1,148 +1,180 @@
|
|
|
1
1
|
# YASGUI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Go to https://yasgui.matdata.eu/ and use it freely in production. Or fork this repo and extend it yourself. Contributions are certainly welcome!
|
|
6
|
-
|
|
7
|
-
## Table of Contents
|
|
8
|
-
|
|
9
|
-
- [Useful Links](#useful-links)
|
|
10
|
-
- [Features](#features)
|
|
11
|
-
- [Keyboard Shortcuts](#keyboard-shortcuts)
|
|
12
|
-
- [Query Editor (Yasqe)](#query-editor-yasqe)
|
|
13
|
-
- [Fullscreen Mode](#fullscreen-mode)
|
|
14
|
-
- [URI Explorer](#uri-explorer)
|
|
15
|
-
- [Prefix Management](#prefix-management)
|
|
16
|
-
- [Result Visualization Plugins (Yasr)](#result-visualization-plugins-yasr)
|
|
17
|
-
- [Installation](#installation)
|
|
18
|
-
- [npm](#npm)
|
|
19
|
-
- [Yarn](#yarn)
|
|
20
|
-
- [Local Development](#local-development)
|
|
21
|
-
- [License](#license)
|
|
22
|
-
|
|
23
|
-
## Useful Links
|
|
24
|
-
|
|
25
|
-
- Production environment: https://yasgui.matdata.eu/
|
|
26
|
-
- Dev environment: https://yasgui-dev.matdata.eu/ (GitHub Pages - automatically updated with every commit to main branch)
|
|
27
|
-
- User documentation: https://docs.triply.cc/yasgui/
|
|
28
|
-
- Developer documentation: https://docs.triply.cc/yasgui-api/
|
|
29
|
-
- Docker Hub: https://hub.docker.com/r/mathiasvda/yasgui
|
|
3
|
+
**Yet Another SPARQL GUI (YASGUI)** is a powerful, user-friendly web-based interface for querying and exploring RDF data using SPARQL. It combines a feature-rich query editor (YASQE) with a versatile results viewer (YASR) to provide a comprehensive SPARQL IDE.
|
|
30
4
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
### Themes
|
|
5
|
+
🌐 **Try it now**: [https://yasgui.matdata.eu/](https://yasgui.matdata.eu/)
|
|
34
6
|
|
|
35
|
-
|
|
7
|
+
[](https://www.npmjs.com/package/@matdata/yasgui)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
36
9
|
|
|
37
|
-
|
|
38
|
-
- **Persistent Preference**: Your theme choice is automatically saved
|
|
39
|
-
- **System Detection**: Automatically matches your system's dark/light mode preference
|
|
40
|
-
- **Full Coverage**: Consistent theming across all components (editor, results, modals)
|
|
10
|
+
---
|
|
41
11
|
|
|
42
|
-
|
|
12
|
+
## Quick Links
|
|
43
13
|
|
|
44
|
-
|
|
14
|
+
- 📖 **[User Guide](./docs/user-guide.md)** - Complete guide for end users
|
|
15
|
+
- 🛠️ **[Developer Guide](./docs/developer-guide.md)** - API reference and integration guide
|
|
16
|
+
- 🚀 **[Production Environment](https://yasgui.matdata.eu/)** - Live instance
|
|
17
|
+
- 📦 **[npm Package](https://www.npmjs.com/package/@matdata/yasgui)**
|
|
18
|
+
- 🐳 **[Docker Hub](https://hub.docker.com/r/mathiasvda/yasgui)**
|
|
19
|
+
- 📝 **[Releases & Changelog](https://github.com/Matdata-eu/Yasgui/releases)**
|
|
20
|
+
- 💻 **[GitHub Repository](https://github.com/Matdata-eu/Yasgui)**
|
|
45
21
|
|
|
46
|
-
|
|
22
|
+
---
|
|
47
23
|
|
|
48
|
-
|
|
49
|
-
- **Ctrl+Enter** / **Cmd+Enter**: Execute the current query
|
|
50
|
-
- **Ctrl+Space**: Trigger autocomplete
|
|
51
|
-
- **Ctrl+S**: Save query to local storage
|
|
52
|
-
- **Shift+Ctrl+F**: Auto-format the query
|
|
53
|
-
- **Ctrl+/**: Comment/uncomment selected lines
|
|
54
|
-
- **Shift+Ctrl+D**: Duplicate the current line
|
|
55
|
-
- **Shift+Ctrl+K**: Delete the current line
|
|
56
|
-
- **Esc**: Remove focus from the editor
|
|
24
|
+
## Documentation
|
|
57
25
|
|
|
58
|
-
|
|
59
|
-
- **F11**: Toggle fullscreen mode for the query editor (Yasqe)
|
|
60
|
-
- **F10**: Toggle fullscreen mode for the results viewer (Yasr)
|
|
61
|
-
- **Ctrl+Shift+F**: Switch between Yasqe and Yasr fullscreen modes
|
|
26
|
+
The **documentation for YASGUI is hosted on GitHub Pages**:
|
|
62
27
|
|
|
63
|
-
|
|
64
|
-
-
|
|
28
|
+
- **📚 Documentation Website**: [https://yasgui-doc.matdata.eu/](https://matdata-eu.github.io/Yasgui/)
|
|
29
|
+
- User Guide, Developer Guide, API Reference
|
|
30
|
+
- Built with Docusaurus
|
|
31
|
+
- Version-tagged with the repository
|
|
65
32
|
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
- **Auto-capture**: Automatically captures new prefixes from your queries (enabled by default)
|
|
71
|
-
- **Request Configuration**: Configure HTTP request method, accept headers, arguments, headers, and named/default graphs
|
|
72
|
-
- **Default Prefixes**: Automatically includes `rdf:` and `rdfs:` prefixes for new users
|
|
73
|
-
- **Prefix Autocomplete**: When typing a prefix declaration (e.g., `PREFIX foaf:`), the editor automatically queries [prefix.cc](https://prefix.cc) to suggest and auto-complete the full URI commonly associated with that prefix. This helps you quickly add standard prefixes without needing to remember their full URIs.
|
|
33
|
+
- **🚀 Development Build**: [https://yasgui-doc.matdata.eu/dev/main/](https://matdata-eu.github.io/Yasgui/dev/main/)
|
|
34
|
+
- Live build from the main branch
|
|
35
|
+
- Updated automatically with every commit
|
|
36
|
+
- Test latest features before release
|
|
74
37
|
|
|
75
|
-
|
|
38
|
+
The documentation is version-tagged with the repository, ensuring consistency between code and documentation across releases.
|
|
76
39
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
- **Table**: Interactive table view with sorting, filtering, pagination, and column resizing. Ideal for SELECT query results.
|
|
80
|
-
- **Boolean**: Displays boolean results (true/false) with visual indicators. Automatically used for ASK queries.
|
|
81
|
-
- **Response**: Raw response viewer with syntax highlighting and code folding. Shows the original response from the endpoint in JSON, XML, Turtle, or other formats.
|
|
82
|
-
- **Geo**: Geographic visualization plugin for displaying spatial data on interactive maps. Visualizes geospatial triples with coordinates. See [Yasgui Geo TG Plugin](https://github.com/Thib-G/yasgui-geo-tg) for more details.
|
|
83
|
-
- **Graph**: Visual graph representation of RDF data using nodes and edges. Ideal for CONSTRUCT/DESCRIBE query results. See [Yasgui Graph Plugin](https://github.com/Matdata-eu/yasgui-graph-plugin) for more details.
|
|
84
|
-
- **Error**: Displays error messages and diagnostics when queries fail, including CORS troubleshooting guidance.
|
|
40
|
+
## Features
|
|
85
41
|
|
|
86
|
-
|
|
42
|
+
YASGUI provides a complete SPARQL development environment with powerful features:
|
|
43
|
+
|
|
44
|
+
### ✏️ Advanced Query Editor
|
|
45
|
+
- **[SPARQL Syntax Highlighting](./docs/user-guide.md#yasqe-query-editor)** - Color-coded SPARQL with error detection
|
|
46
|
+
- **[Smart Autocomplete](./docs/user-guide.md#prefix-management)** - Context-aware suggestions for keywords, prefixes, and URIs
|
|
47
|
+
- **[Query Formatting](./docs/user-guide.md#query-formatting)** - One-click query beautification with configurable formatters
|
|
48
|
+
- **[Prefix Management](./docs/user-guide.md#prefix-management)** - Auto-capture and reuse PREFIX declarations
|
|
49
|
+
- **[URI Explorer](./docs/user-guide.md#uri-explorer)** - Ctrl+Click URIs to explore connections
|
|
50
|
+
- **[Keyboard Shortcuts](./docs/user-guide.md#keyboard-shortcuts)** - Efficient query development workflow
|
|
51
|
+
|
|
52
|
+
### 📊 Powerful Visualizations
|
|
53
|
+
- **[Table Plugin](./docs/user-guide.md#table-plugin)** - Sortable, filterable, paginated result tables
|
|
54
|
+
- **[Graph Plugin](./docs/user-guide.md#graph-plugin)** - Interactive RDF graph visualization
|
|
55
|
+
- **[Geo Plugin](./docs/user-guide.md#geo-plugin)** - Geographic data on interactive maps
|
|
56
|
+
- **[Response Plugin](./docs/user-guide.md#response-plugin)** - Raw response viewer with syntax highlighting
|
|
57
|
+
- **[Boolean Plugin](./docs/user-guide.md#boolean-plugin)** - Visual true/false indicators for ASK queries
|
|
58
|
+
- **[Error Plugin](./docs/user-guide.md#error-plugin)** - Detailed error diagnostics
|
|
59
|
+
|
|
60
|
+
### 🎨 Themes & Layouts
|
|
61
|
+
- **[Light & Dark Themes](./docs/user-guide.md#themes)** - Seamless theme switching with persistent preferences
|
|
62
|
+
- **[Flexible Layouts](./docs/user-guide.md#layout-orientation)** - Vertical or horizontal editor/results arrangement
|
|
63
|
+
|
|
64
|
+
### 🔧 Expert Features
|
|
65
|
+
- **[Multiple Tabs](./docs/user-guide.md#query-tabs)** - Work on multiple queries simultaneously
|
|
66
|
+
- **[Endpoint Management](./docs/user-guide.md#endpoint-quick-switch)** - Quick-switch between SPARQL endpoints
|
|
67
|
+
- **[Persistent Storage](./docs/user-guide.md#query-history-and-persistence)** - Auto-save queries and preferences
|
|
68
|
+
- **[URL Sharing](./docs/user-guide.md#share-queries)** - Share queries via URL parameters
|
|
69
|
+
- **[Fullscreen Mode](./docs/user-guide.md#fullscreen-mode)** - Maximize editor or results viewer
|
|
70
|
+
- **[Export Results](./docs/developer-guide.md#yasr-class)** - Download results in various formats
|
|
71
|
+
|
|
72
|
+
For detailed feature documentation, see the **[User Guide](./docs/user-guide.md)**.
|
|
87
73
|
|
|
88
74
|
## Installation
|
|
89
75
|
|
|
90
|
-
Below are instructions on how to include Yasgui in your project.
|
|
91
|
-
If you only want to install Yasr or Yasqe, replace yasgui in the commands below.
|
|
92
|
-
|
|
93
76
|
### npm
|
|
94
77
|
|
|
95
|
-
```
|
|
96
|
-
npm
|
|
78
|
+
```bash
|
|
79
|
+
npm install @matdata/yasgui
|
|
97
80
|
```
|
|
98
81
|
|
|
99
82
|
### Yarn
|
|
100
83
|
|
|
101
|
-
```
|
|
84
|
+
```bash
|
|
102
85
|
yarn add @matdata/yasgui
|
|
103
86
|
```
|
|
104
87
|
|
|
105
|
-
###
|
|
88
|
+
### CDN
|
|
106
89
|
|
|
107
|
-
|
|
90
|
+
```html
|
|
91
|
+
<link rel="stylesheet" href="https://unpkg.com/@matdata/yasgui/build/yasgui.min.css" />
|
|
92
|
+
<script src="https://unpkg.com/@matdata/yasgui/build/yasgui.min.js"></script>
|
|
93
|
+
```
|
|
108
94
|
|
|
109
|
-
|
|
95
|
+
### Docker
|
|
96
|
+
|
|
97
|
+
```bash
|
|
110
98
|
docker pull mathiasvda/yasgui:latest
|
|
111
99
|
docker run -p 8080:8080 mathiasvda/yasgui:latest
|
|
112
100
|
```
|
|
113
101
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
```sh
|
|
102
|
+
**Custom endpoint:**
|
|
103
|
+
```bash
|
|
117
104
|
docker run -p 8080:8080 -e YASGUI_DEFAULT_ENDPOINT=https://your-endpoint.com/sparql mathiasvda/yasgui:latest
|
|
118
105
|
```
|
|
119
106
|
|
|
120
|
-
|
|
107
|
+
For detailed installation instructions and usage examples, see the **[Developer Guide](./docs/developer-guide.md#installation)**.
|
|
108
|
+
|
|
109
|
+
## Quick Start
|
|
110
|
+
|
|
111
|
+
### Basic HTML Usage
|
|
112
|
+
|
|
113
|
+
```html
|
|
114
|
+
<!DOCTYPE html>
|
|
115
|
+
<html>
|
|
116
|
+
<head>
|
|
117
|
+
<link rel="stylesheet" href="https://unpkg.com/@matdata/yasgui/build/yasgui.min.css" />
|
|
118
|
+
</head>
|
|
119
|
+
<body>
|
|
120
|
+
<div id="yasgui"></div>
|
|
121
|
+
|
|
122
|
+
<script src="https://unpkg.com/@matdata/yasgui/build/yasgui.min.js"></script>
|
|
123
|
+
<script>
|
|
124
|
+
const yasgui = new Yasgui(document.getElementById("yasgui"), {
|
|
125
|
+
requestConfig: {
|
|
126
|
+
endpoint: "https://dbpedia.org/sparql"
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
</script>
|
|
130
|
+
</body>
|
|
131
|
+
</html>
|
|
132
|
+
```
|
|
121
133
|
|
|
122
|
-
|
|
134
|
+
### ES Modules / React / Vue / Angular
|
|
123
135
|
|
|
124
|
-
|
|
136
|
+
```javascript
|
|
137
|
+
import Yasgui from '@matdata/yasgui';
|
|
138
|
+
import '@matdata/yasgui/build/yasgui.min.css';
|
|
125
139
|
|
|
126
|
-
|
|
140
|
+
const yasgui = new Yasgui(document.getElementById('yasgui'), {
|
|
141
|
+
requestConfig: {
|
|
142
|
+
endpoint: 'https://query.wikidata.org/sparql'
|
|
143
|
+
},
|
|
144
|
+
theme: 'dark',
|
|
145
|
+
orientation: 'horizontal'
|
|
146
|
+
});
|
|
147
|
+
```
|
|
127
148
|
|
|
128
|
-
|
|
149
|
+
For framework-specific examples and advanced usage, see the **[Developer Guide](./docs/developer-guide.md#usage-examples)**.
|
|
129
150
|
|
|
130
|
-
|
|
151
|
+
---
|
|
131
152
|
|
|
132
|
-
|
|
153
|
+
## Contributing
|
|
133
154
|
|
|
134
|
-
|
|
155
|
+
We welcome contributions! To get started:
|
|
135
156
|
|
|
136
|
-
|
|
157
|
+
1. Fork the repository
|
|
158
|
+
2. Clone and install: `npm install`
|
|
159
|
+
3. Run dev server: `npm run dev`
|
|
160
|
+
4. Make your changes
|
|
161
|
+
5. Run tests: `npm test`
|
|
162
|
+
6. Submit a pull request
|
|
163
|
+
|
|
164
|
+
For detailed contribution guidelines, see the **[Developer Guide](./docs/developer-guide.md#contributing)**.
|
|
165
|
+
|
|
166
|
+
---
|
|
137
167
|
|
|
138
168
|
## License
|
|
139
169
|
|
|
170
|
+
MIT License - see [LICENSE](./LICENSE) file for details.
|
|
171
|
+
|
|
140
172
|
This is a fork from [Zazuko](https://github.com/zazuko/Yasgui) who forked it from [Triply](https://github.com/TriplyDB/Yasgui).
|
|
141
173
|
|
|
142
|
-
|
|
174
|
+
---
|
|
143
175
|
|
|
144
|
-
## Release
|
|
176
|
+
## Release Notes & Changelog
|
|
145
177
|
|
|
146
|
-
Release notes
|
|
178
|
+
Release notes and changelog are available in the [Releases](https://github.com/Matdata-eu/Yasgui/releases) section.
|
|
147
179
|
|
|
148
|
-
|
|
180
|
+
For instructions on writing release notes, see [release_notes_instructions.md](./docs/release_notes_instructions.md)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PersistedJson } from "./PersistentConfig";
|
|
2
|
+
export declare const YASGUI_NS = "https://yasgui.matdata.eu/ontology#";
|
|
3
|
+
export declare const RDF_NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
|
|
4
|
+
export declare const RDFS_NS = "http://www.w3.org/2000/01/rdf-schema#";
|
|
5
|
+
export declare const XSD_NS = "http://www.w3.org/2001/XMLSchema#";
|
|
6
|
+
export declare const DCTERMS_NS = "http://purl.org/dc/terms/";
|
|
7
|
+
export declare const SD_NS = "http://www.w3.org/ns/sparql-service-description#";
|
|
8
|
+
export declare const SP_NS = "http://spinrdf.org/sp#";
|
|
9
|
+
export declare const HTTP_NS = "http://www.w3.org/2011/http#";
|
|
10
|
+
export declare const SCHEMA_NS = "https://schema.org/";
|
|
11
|
+
export declare function serializeToTurtle(config: PersistedJson): string;
|
|
12
|
+
export declare function parseFromTurtle(turtle: string): Partial<PersistedJson>;
|
|
13
|
+
export declare function downloadConfigAsFile(config: PersistedJson, filename?: string): void;
|
|
14
|
+
export declare function copyConfigToClipboard(config: PersistedJson): Promise<void>;
|
|
15
|
+
export declare function readConfigFromFile(file: File): Promise<string>;
|
|
16
|
+
export declare function readConfigFromClipboard(): Promise<string>;
|
|
@@ -0,0 +1,304 @@
|
|
|
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
|
+
export const YASGUI_NS = "https://yasgui.matdata.eu/ontology#";
|
|
11
|
+
export const RDF_NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
|
|
12
|
+
export const RDFS_NS = "http://www.w3.org/2000/01/rdf-schema#";
|
|
13
|
+
export const XSD_NS = "http://www.w3.org/2001/XMLSchema#";
|
|
14
|
+
export const DCTERMS_NS = "http://purl.org/dc/terms/";
|
|
15
|
+
export const SD_NS = "http://www.w3.org/ns/sparql-service-description#";
|
|
16
|
+
export const SP_NS = "http://spinrdf.org/sp#";
|
|
17
|
+
export const HTTP_NS = "http://www.w3.org/2011/http#";
|
|
18
|
+
export const SCHEMA_NS = "https://schema.org/";
|
|
19
|
+
export function serializeToTurtle(config) {
|
|
20
|
+
const lines = [];
|
|
21
|
+
lines.push(`@prefix yasgui: <${YASGUI_NS}> .`);
|
|
22
|
+
lines.push(`@prefix rdf: <${RDF_NS}> .`);
|
|
23
|
+
lines.push(`@prefix rdfs: <${RDFS_NS}> .`);
|
|
24
|
+
lines.push(`@prefix xsd: <${XSD_NS}> .`);
|
|
25
|
+
lines.push(`@prefix dcterms: <${DCTERMS_NS}> .`);
|
|
26
|
+
lines.push(`@prefix sd: <${SD_NS}> .`);
|
|
27
|
+
lines.push(`@prefix sp: <${SP_NS}> .`);
|
|
28
|
+
lines.push(`@prefix http: <${HTTP_NS}> .`);
|
|
29
|
+
lines.push(`@prefix schema: <${SCHEMA_NS}> .`);
|
|
30
|
+
lines.push("");
|
|
31
|
+
const now = new Date().toISOString();
|
|
32
|
+
lines.push(`[] a yasgui:Configuration ;`);
|
|
33
|
+
lines.push(` dcterms:created "${now}"^^xsd:dateTime ;`);
|
|
34
|
+
if (config.theme) {
|
|
35
|
+
lines.push(` yasgui:theme "${config.theme}" ;`);
|
|
36
|
+
}
|
|
37
|
+
if (config.orientation) {
|
|
38
|
+
lines.push(` yasgui:orientation "${config.orientation}" ;`);
|
|
39
|
+
}
|
|
40
|
+
if (config.endpointHistory && config.endpointHistory.length > 0) {
|
|
41
|
+
lines.push(` yasgui:endpointHistory (`);
|
|
42
|
+
config.endpointHistory.forEach((endpoint) => {
|
|
43
|
+
lines.push(` "${escapeTurtleString(endpoint)}"`);
|
|
44
|
+
});
|
|
45
|
+
lines.push(` ) ;`);
|
|
46
|
+
}
|
|
47
|
+
if (config.active) {
|
|
48
|
+
lines.push(` yasgui:activeTab "${escapeTurtleString(config.active)}" ;`);
|
|
49
|
+
}
|
|
50
|
+
if (config.prefixes) {
|
|
51
|
+
lines.push(` yasgui:prefixesValue """${escapeTurtleString(config.prefixes)}""" ;`);
|
|
52
|
+
}
|
|
53
|
+
if (config.autoCaptureEnabled !== undefined) {
|
|
54
|
+
lines.push(` yasgui:autoCaptureEnabled "${config.autoCaptureEnabled}"^^xsd:boolean ;`);
|
|
55
|
+
}
|
|
56
|
+
if (config.customEndpointButtons && config.customEndpointButtons.length > 0) {
|
|
57
|
+
lines.push(` yasgui:customEndpointButton [`);
|
|
58
|
+
config.customEndpointButtons.forEach((button, index) => {
|
|
59
|
+
const isLast = index === config.customEndpointButtons.length - 1;
|
|
60
|
+
lines.push(` rdfs:label "${escapeTurtleString(button.label)}" ;`);
|
|
61
|
+
lines.push(` sd:endpoint "${escapeTurtleString(button.endpoint)}"${isLast ? "" : " ;"}`);
|
|
62
|
+
if (!isLast) {
|
|
63
|
+
lines.push(` ] , [`);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
lines.push(` ] ;`);
|
|
67
|
+
}
|
|
68
|
+
if (config.tabs && config.tabs.length > 0) {
|
|
69
|
+
lines.push(` yasgui:tab [`);
|
|
70
|
+
config.tabs.forEach((tabId, tabIndex) => {
|
|
71
|
+
var _a, _b, _c;
|
|
72
|
+
const tabConfig = config.tabConfig[tabId];
|
|
73
|
+
const isLastTab = tabIndex === config.tabs.length - 1;
|
|
74
|
+
lines.push(` dcterms:identifier "${escapeTurtleString(tabId)}" ;`);
|
|
75
|
+
lines.push(` rdfs:label "${escapeTurtleString(tabConfig.name)}" ;`);
|
|
76
|
+
if (tabConfig.orientation) {
|
|
77
|
+
lines.push(` yasgui:orientation "${escapeTurtleString(tabConfig.orientation)}" ;`);
|
|
78
|
+
}
|
|
79
|
+
if ((_a = tabConfig.yasqe) === null || _a === void 0 ? void 0 : _a.value) {
|
|
80
|
+
lines.push(` sp:text """${escapeTurtleString(tabConfig.yasqe.value)}""" ;`);
|
|
81
|
+
}
|
|
82
|
+
if ((_b = tabConfig.yasqe) === null || _b === void 0 ? void 0 : _b.editorHeight) {
|
|
83
|
+
lines.push(` schema:height "${escapeTurtleString(tabConfig.yasqe.editorHeight)}" ;`);
|
|
84
|
+
}
|
|
85
|
+
if (tabConfig.requestConfig) {
|
|
86
|
+
const reqConfig = tabConfig.requestConfig;
|
|
87
|
+
if (reqConfig.endpoint && typeof reqConfig.endpoint === "string") {
|
|
88
|
+
lines.push(` sd:endpoint "${escapeTurtleString(reqConfig.endpoint)}" ;`);
|
|
89
|
+
}
|
|
90
|
+
if (reqConfig.method && typeof reqConfig.method === "string") {
|
|
91
|
+
lines.push(` yasgui:requestMethod "${escapeTurtleString(reqConfig.method)}" ;`);
|
|
92
|
+
}
|
|
93
|
+
if (reqConfig.acceptHeaderSelect && typeof reqConfig.acceptHeaderSelect === "string") {
|
|
94
|
+
lines.push(` yasgui:acceptHeaderSelect [`);
|
|
95
|
+
lines.push(` http:headerName "Accept" ;`);
|
|
96
|
+
lines.push(` http:headerValue "${escapeTurtleString(reqConfig.acceptHeaderSelect)}"`);
|
|
97
|
+
lines.push(` ] ;`);
|
|
98
|
+
}
|
|
99
|
+
if (reqConfig.acceptHeaderGraph && typeof reqConfig.acceptHeaderGraph === "string") {
|
|
100
|
+
lines.push(` yasgui:acceptHeaderGraph [`);
|
|
101
|
+
lines.push(` http:headerName "Accept" ;`);
|
|
102
|
+
lines.push(` http:headerValue "${escapeTurtleString(reqConfig.acceptHeaderGraph)}"`);
|
|
103
|
+
lines.push(` ] ;`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if ((_c = tabConfig.yasr) === null || _c === void 0 ? void 0 : _c.settings) {
|
|
107
|
+
const yasrSettings = tabConfig.yasr.settings;
|
|
108
|
+
if (yasrSettings.selectedPlugin) {
|
|
109
|
+
lines.push(` yasgui:selectedPlugin "${escapeTurtleString(yasrSettings.selectedPlugin)}" ;`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const lastLine = lines[lines.length - 1];
|
|
113
|
+
if (lastLine.endsWith(" ;")) {
|
|
114
|
+
lines[lines.length - 1] = lastLine.slice(0, -2);
|
|
115
|
+
}
|
|
116
|
+
if (!isLastTab) {
|
|
117
|
+
lines.push(` ] , [`);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
lines.push(` ] .`);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
const lastLine = lines[lines.length - 1];
|
|
124
|
+
if (lastLine.endsWith(" ;")) {
|
|
125
|
+
lines[lines.length - 1] = lastLine.slice(0, -2) + " .";
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return lines.join("\n");
|
|
129
|
+
}
|
|
130
|
+
function escapeTurtleString(str) {
|
|
131
|
+
return str
|
|
132
|
+
.replace(/\\/g, "\\\\")
|
|
133
|
+
.replace(/"/g, '\\"')
|
|
134
|
+
.replace(/\n/g, "\\n")
|
|
135
|
+
.replace(/\r/g, "\\r")
|
|
136
|
+
.replace(/\t/g, "\\t");
|
|
137
|
+
}
|
|
138
|
+
function unescapeTurtleString(str) {
|
|
139
|
+
return str
|
|
140
|
+
.replace(/\\n/g, "\n")
|
|
141
|
+
.replace(/\\r/g, "\r")
|
|
142
|
+
.replace(/\\t/g, "\t")
|
|
143
|
+
.replace(/\\"/g, '"')
|
|
144
|
+
.replace(/\\\\/g, "\\");
|
|
145
|
+
}
|
|
146
|
+
export function parseFromTurtle(turtle) {
|
|
147
|
+
const config = {
|
|
148
|
+
endpointHistory: [],
|
|
149
|
+
tabs: [],
|
|
150
|
+
tabConfig: {},
|
|
151
|
+
customEndpointButtons: [],
|
|
152
|
+
};
|
|
153
|
+
try {
|
|
154
|
+
const endpointHistoryMatch = turtle.match(/yasgui:endpointHistory\s*\(([\s\S]*?)\)/);
|
|
155
|
+
if (endpointHistoryMatch) {
|
|
156
|
+
const endpoints = endpointHistoryMatch[1].match(/"([^"]*)"/g);
|
|
157
|
+
if (endpoints) {
|
|
158
|
+
config.endpointHistory = endpoints.map((e) => unescapeTurtleString(e.slice(1, -1)));
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const activeTabMatch = turtle.match(/yasgui:activeTab\s+"([^"]*)"/);
|
|
162
|
+
if (activeTabMatch) {
|
|
163
|
+
config.active = unescapeTurtleString(activeTabMatch[1]);
|
|
164
|
+
}
|
|
165
|
+
const prefixesMatch = turtle.match(/yasgui:prefixesValue\s+"""([\s\S]*?)"""/);
|
|
166
|
+
if (prefixesMatch) {
|
|
167
|
+
config.prefixes = unescapeTurtleString(prefixesMatch[1]);
|
|
168
|
+
}
|
|
169
|
+
const autoCaptureMatch = turtle.match(/yasgui:autoCaptureEnabled\s+"([^"]*)"/);
|
|
170
|
+
if (autoCaptureMatch) {
|
|
171
|
+
config.autoCaptureEnabled = autoCaptureMatch[1] === "true";
|
|
172
|
+
}
|
|
173
|
+
const themeMatch = turtle.match(/yasgui:theme\s+"([^"]*)"/);
|
|
174
|
+
if (themeMatch && (themeMatch[1] === "light" || themeMatch[1] === "dark")) {
|
|
175
|
+
config.theme = themeMatch[1];
|
|
176
|
+
}
|
|
177
|
+
const orientationMatch = turtle.match(/yasgui:orientation\s+"([^"]*)"/);
|
|
178
|
+
if (orientationMatch && (orientationMatch[1] === "vertical" || orientationMatch[1] === "horizontal")) {
|
|
179
|
+
config.orientation = orientationMatch[1];
|
|
180
|
+
}
|
|
181
|
+
const buttonPattern = /yasgui:customEndpointButton\s+\[([\s\S]*?)rdfs:label\s+"([^"]*)"\s*;\s*sd:endpoint\s+"([^"]*)"/g;
|
|
182
|
+
let buttonMatch;
|
|
183
|
+
while ((buttonMatch = buttonPattern.exec(turtle)) !== null) {
|
|
184
|
+
config.customEndpointButtons.push({
|
|
185
|
+
label: unescapeTurtleString(buttonMatch[2]),
|
|
186
|
+
endpoint: unescapeTurtleString(buttonMatch[3]),
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
const tabPattern = /dcterms:identifier\s+"([^"]*)"\s*;\s*rdfs:label\s+"([^"]*)"\s*;[\s\S]*?(?=dcterms:identifier|yasgui:customEndpointButton|\]\.|\]\s*,\s*\[)/g;
|
|
190
|
+
const tabBlocks = turtle.match(/yasgui:tab\s+\[([\s\S]*)\]\s*\./);
|
|
191
|
+
if (tabBlocks) {
|
|
192
|
+
const tabsContent = tabBlocks[1];
|
|
193
|
+
const tabIdMatches = [...tabsContent.matchAll(/dcterms:identifier\s+"([^"]*)"/g)];
|
|
194
|
+
const tabNameMatches = [...tabsContent.matchAll(/rdfs:label\s+"([^"]*)"/g)];
|
|
195
|
+
const queryMatches = [...tabsContent.matchAll(/sp:text\s+"""([\s\S]*?)"""/g)];
|
|
196
|
+
const endpointMatches = [...tabsContent.matchAll(/sd:endpoint\s+"([^"]*)"/g)];
|
|
197
|
+
const methodMatches = [...tabsContent.matchAll(/yasgui:requestMethod\s+"([^"]*)"/g)];
|
|
198
|
+
const tabOrientationMatches = [...tabsContent.matchAll(/yasgui:orientation\s+"([^"]*)"/g)];
|
|
199
|
+
tabIdMatches.forEach((match, index) => {
|
|
200
|
+
const tabId = unescapeTurtleString(match[1]);
|
|
201
|
+
const tabName = tabNameMatches[index] ? unescapeTurtleString(tabNameMatches[index][1]) : "Query";
|
|
202
|
+
const query = queryMatches[index] ? unescapeTurtleString(queryMatches[index][1]) : "";
|
|
203
|
+
const endpoint = endpointMatches[index] ? unescapeTurtleString(endpointMatches[index][1]) : "";
|
|
204
|
+
const method = methodMatches[index] ? unescapeTurtleString(methodMatches[index][1]) : "POST";
|
|
205
|
+
const orientation = tabOrientationMatches[index]
|
|
206
|
+
? unescapeTurtleString(tabOrientationMatches[index][1])
|
|
207
|
+
: undefined;
|
|
208
|
+
config.tabs.push(tabId);
|
|
209
|
+
config.tabConfig[tabId] = {
|
|
210
|
+
id: tabId,
|
|
211
|
+
name: tabName,
|
|
212
|
+
yasqe: {
|
|
213
|
+
value: query,
|
|
214
|
+
},
|
|
215
|
+
requestConfig: {
|
|
216
|
+
queryArgument: undefined,
|
|
217
|
+
endpoint: endpoint,
|
|
218
|
+
method: method,
|
|
219
|
+
acceptHeaderGraph: "text/turtle",
|
|
220
|
+
acceptHeaderSelect: "application/sparql-results+json",
|
|
221
|
+
acceptHeaderUpdate: "application/sparql-results+json",
|
|
222
|
+
namedGraphs: [],
|
|
223
|
+
defaultGraphs: [],
|
|
224
|
+
args: [],
|
|
225
|
+
headers: {},
|
|
226
|
+
withCredentials: false,
|
|
227
|
+
adjustQueryBeforeRequest: false,
|
|
228
|
+
},
|
|
229
|
+
yasr: {
|
|
230
|
+
settings: {},
|
|
231
|
+
response: undefined,
|
|
232
|
+
},
|
|
233
|
+
orientation: orientation,
|
|
234
|
+
};
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
console.error("Error parsing Turtle configuration:", error);
|
|
240
|
+
throw new Error("Failed to parse configuration. Please check the format.");
|
|
241
|
+
}
|
|
242
|
+
return config;
|
|
243
|
+
}
|
|
244
|
+
export function downloadConfigAsFile(config, filename = "yasgui-config.ttl") {
|
|
245
|
+
const turtle = serializeToTurtle(config);
|
|
246
|
+
const blob = new Blob([turtle], { type: "text/turtle;charset=utf-8" });
|
|
247
|
+
const url = URL.createObjectURL(blob);
|
|
248
|
+
const link = document.createElement("a");
|
|
249
|
+
link.href = url;
|
|
250
|
+
link.download = filename;
|
|
251
|
+
document.body.appendChild(link);
|
|
252
|
+
link.click();
|
|
253
|
+
document.body.removeChild(link);
|
|
254
|
+
URL.revokeObjectURL(url);
|
|
255
|
+
}
|
|
256
|
+
export function copyConfigToClipboard(config) {
|
|
257
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
258
|
+
const turtle = serializeToTurtle(config);
|
|
259
|
+
try {
|
|
260
|
+
yield navigator.clipboard.writeText(turtle);
|
|
261
|
+
}
|
|
262
|
+
catch (error) {
|
|
263
|
+
const textArea = document.createElement("textarea");
|
|
264
|
+
textArea.value = turtle;
|
|
265
|
+
textArea.style.position = "fixed";
|
|
266
|
+
textArea.style.left = "-999999px";
|
|
267
|
+
document.body.appendChild(textArea);
|
|
268
|
+
textArea.select();
|
|
269
|
+
try {
|
|
270
|
+
document.execCommand("copy");
|
|
271
|
+
}
|
|
272
|
+
finally {
|
|
273
|
+
document.body.removeChild(textArea);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
export function readConfigFromFile(file) {
|
|
279
|
+
return new Promise((resolve, reject) => {
|
|
280
|
+
const reader = new FileReader();
|
|
281
|
+
reader.onload = (e) => {
|
|
282
|
+
var _a;
|
|
283
|
+
if ((_a = e.target) === null || _a === void 0 ? void 0 : _a.result) {
|
|
284
|
+
resolve(e.target.result);
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
reject(new Error("Failed to read file"));
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
reader.onerror = () => reject(new Error("Failed to read file"));
|
|
291
|
+
reader.readAsText(file);
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
export function readConfigFromClipboard() {
|
|
295
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
296
|
+
try {
|
|
297
|
+
return yield navigator.clipboard.readText();
|
|
298
|
+
}
|
|
299
|
+
catch (error) {
|
|
300
|
+
throw new Error("Failed to read from clipboard. Please paste the content manually.");
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=ConfigExportImport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigExportImport.js","sourceRoot":"","sources":["../../../../../packages/yasgui/src/ConfigExportImport.ts"],"names":[],"mappings":";;;;;;;;;AAQA,MAAM,CAAC,MAAM,SAAS,GAAG,qCAAqC,CAAC;AAC/D,MAAM,CAAC,MAAM,MAAM,GAAG,6CAA6C,CAAC;AACpE,MAAM,CAAC,MAAM,OAAO,GAAG,uCAAuC,CAAC;AAC/D,MAAM,CAAC,MAAM,MAAM,GAAG,mCAAm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AAM,CAAC,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC;QAChE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC;AAKD,MAAM,UAAgB,uBAAuB;;QAC3C,IAAI,CAAC;YACH,OAAO,MAAM,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;QAC9C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;QACvF,CAAC;IACH,CAAC;CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Yasgui from "./";
|
|
1
|
+
import Yasgui, { EndpointButton } from "./";
|
|
2
2
|
import * as Tab from "./Tab";
|
|
3
3
|
export declare var storageNamespace: string;
|
|
4
4
|
export interface PersistedJson {
|
|
@@ -14,6 +14,9 @@ export interface PersistedJson {
|
|
|
14
14
|
} | undefined;
|
|
15
15
|
prefixes?: string;
|
|
16
16
|
autoCaptureEnabled?: boolean;
|
|
17
|
+
customEndpointButtons?: EndpointButton[];
|
|
18
|
+
theme?: "light" | "dark";
|
|
19
|
+
orientation?: "vertical" | "horizontal";
|
|
17
20
|
}
|
|
18
21
|
export default class PersistentConfig {
|
|
19
22
|
private persistedJson;
|
|
@@ -45,5 +48,9 @@ export default class PersistentConfig {
|
|
|
45
48
|
setPrefixes(prefixes: string): void;
|
|
46
49
|
getAutoCaptureEnabled(): boolean;
|
|
47
50
|
setAutoCaptureEnabled(enabled: boolean): void;
|
|
51
|
+
getCustomEndpointButtons(): EndpointButton[];
|
|
52
|
+
setCustomEndpointButtons(buttons: EndpointButton[]): void;
|
|
48
53
|
static clear(): void;
|
|
54
|
+
getPersistedConfig(): PersistedJson;
|
|
55
|
+
updatePersistedConfig(config: Partial<PersistedJson>): void;
|
|
49
56
|
}
|