@matdata/yasr 5.6.0 → 5.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@matdata/yasr",
3
3
  "description": "Yet Another SPARQL Resultset GUI",
4
- "version": "5.6.0",
4
+ "version": "5.8.0",
5
5
  "main": "build/yasr.min.js",
6
6
  "types": "build/ts/src/index.d.ts",
7
7
  "license": "MIT",
package/src/defaults.ts CHANGED
@@ -22,7 +22,7 @@ export default function get(): Config {
22
22
  maxPersistentResponseSize: 100000,
23
23
  prefixes: {},
24
24
  plugins: {},
25
- pluginOrder: ["table", "response"], // Default plugins, others are sorted alphabetically
26
- defaultPlugin: "table",
25
+ pluginOrder: ["Table", "response", "Geo", "Graph"],
26
+ defaultPlugin: "Table",
27
27
  };
28
28
  }
package/src/index.ts CHANGED
@@ -673,12 +673,10 @@ export function registerPlugin(name: string, plugin: typeof Plugin, enable = tru
673
673
  }
674
674
  }
675
675
 
676
- import * as YasrPluginTable from "./plugins/table";
677
676
  import * as YasrPluginBoolean from "./plugins/boolean";
678
677
  import * as YasrPluginResponse from "./plugins/response";
679
678
  import * as YasrPluginError from "./plugins/error";
680
679
 
681
- Yasr.registerPlugin("table", YasrPluginTable.default as any);
682
680
  Yasr.registerPlugin("boolean", YasrPluginBoolean.default as any);
683
681
  Yasr.registerPlugin("response", YasrPluginResponse.default as any);
684
682
  Yasr.registerPlugin("error", YasrPluginError.default as any);
package/src/main.scss CHANGED
@@ -1,13 +1,21 @@
1
1
  @use "scss/variables.scss";
2
+
2
3
  .yasr {
3
4
  display: flex;
4
5
  flex-direction: column;
5
- min-height: 400px; // Minimum height for vertical layout to give plugins space
6
+ flex: 1;
7
+ min-height: 400px;
8
+ height: 100%;
9
+
10
+ .yasr_results {
11
+ flex: 1;
12
+ }
6
13
 
7
14
  .yasr_btn {
8
15
  border: none;
9
16
  background: inherit;
10
17
  }
18
+
11
19
  .svgImg {
12
20
  display: flex;
13
21
  flex-direction: row;
@@ -19,10 +27,10 @@
19
27
  align-self: center;
20
28
  }
21
29
  }
30
+
22
31
  .yasr_btn.yasr_external_ref_btn {
23
32
  font-weight: 600;
24
33
  user-select: none;
25
- // Active and focus shouldn't color the button since it'll open a new page
26
34
  &:active,
27
35
  &:focus {
28
36
  color: inherit;
@@ -33,6 +41,7 @@
33
41
  height: 18px;
34
42
  }
35
43
  }
44
+
36
45
  a {
37
46
  color: #428bca;
38
47
  text-decoration: none;
@@ -43,21 +52,23 @@
43
52
  text-decoration: underline;
44
53
  }
45
54
  }
55
+
46
56
  .yasr_btnGroup {
47
57
  margin: 0;
48
58
  padding: 0;
49
59
  list-style: none;
50
60
  display: flex;
51
61
  overflow-x: auto;
52
- overflow-y: hidden; // We shouldn't wrap, and therefore never draw a vertical scrollBar
62
+ overflow-y: hidden;
63
+
53
64
  .plugin_icon {
54
65
  height: 15px;
55
66
  width: 15px;
56
67
  margin-right: 5px;
57
68
  text-align: center;
58
69
  }
70
+
59
71
  .yasr_btn {
60
- // redeclared here to target yasr_btns in btnGroup
61
72
  border-bottom: 2px solid transparent;
62
73
  &.selected {
63
74
  border-bottom: 2px solid var(--yasgui-accent-color, #337ab7);
@@ -69,13 +80,11 @@
69
80
  }
70
81
  }
71
82
 
72
- // Default med screen +
73
83
  @media (max-width: 768px) {
74
84
  .yasr_btn {
75
85
  span {
76
86
  display: none;
77
87
  }
78
-
79
88
  .plugin_icon {
80
89
  margin-right: 0px;
81
90
  }
@@ -87,6 +96,7 @@
87
96
  flex-wrap: wrap;
88
97
  flex-shrink: 0;
89
98
  }
99
+
90
100
  .yasr_fallback_info:not(:empty) {
91
101
  flex-shrink: 0;
92
102
  margin-top: 5px;
@@ -97,10 +107,12 @@
97
107
  margin: 0;
98
108
  }
99
109
  }
110
+
100
111
  .yasr_help_variable {
101
112
  background: #dff0ff;
102
113
  color: #428bca;
103
114
  }
115
+
104
116
  .yasr_response_chip {
105
117
  color: #505050;
106
118
  background: #f5f5f5;
@@ -120,6 +132,7 @@
120
132
  display: none;
121
133
  }
122
134
  }
135
+
123
136
  .yasr_plugin_control {
124
137
  display: flex;
125
138
  margin-left: auto;
@@ -128,28 +141,30 @@
128
141
  display: none;
129
142
  }
130
143
  }
144
+
131
145
  .yasr_btn {
132
146
  color: var(--yasgui-button-text, #505050);
133
147
  fill: var(--yasgui-button-text, #505050);
134
148
  display: flex;
135
149
  align-items: center;
136
150
  justify-content: center;
137
-
138
151
  cursor: pointer;
139
152
  white-space: nowrap;
140
153
  padding: 6px 12px;
141
- // border-radius: 4px;
142
154
  overflow: visible;
143
155
  box-sizing: border-box;
156
+
144
157
  &.btn_icon {
145
158
  padding: 4px 8px;
146
159
  }
160
+
147
161
  &[disabled],
148
162
  &.disabled {
149
163
  cursor: default;
150
164
  opacity: 0.5;
151
165
  box-shadow: none;
152
166
  }
167
+
153
168
  &:not(.disabled):hover {
154
169
  fill: var(--yasgui-button-hover, black);
155
170
  color: var(--yasgui-button-hover, black);
@@ -195,6 +210,7 @@
195
210
  flex: 1;
196
211
  overflow: auto;
197
212
  }
213
+
198
214
  &:focus,
199
215
  &.selected {
200
216
  color: var(--yasgui-accent-color, #337ab7);
@@ -232,10 +248,4 @@
232
248
  flex-grow: 1;
233
249
  min-width: 10px;
234
250
  }
235
-
236
- .yasr_results {
237
- flex: 1;
238
- overflow: auto;
239
- min-height: 0;
240
- }
241
251
  }
@@ -39,6 +39,10 @@ export default class Error implements Plugin<never> {
39
39
  endpointDown.textContent = "Endpoint is down";
40
40
  list.appendChild(endpointDown);
41
41
 
42
+ const credExpired = document.createElement("li");
43
+ credExpired.textContent = "Credentials have expired";
44
+ list.appendChild(credExpired);
45
+
42
46
  const cors = document.createElement("li");
43
47
  const firstPart = document.createElement("span");
44
48
  firstPart.textContent = "Endpoint is not accessible from the YASGUI server and website, and the endpoint is not ";
@@ -1 +0,0 @@
1
- export {};
@@ -1,190 +0,0 @@
1
- import { describe, it } from "mocha";
2
- import { expect } from "chai";
3
- import Yasr from "../../../index";
4
- describe("Table Plugin", () => {
5
- describe("Markdown Generation", () => {
6
- it("should generate markdown table from simple results", () => {
7
- const container = document.createElement("div");
8
- const yasr = new Yasr(container);
9
- const mockResults = {
10
- head: {
11
- vars: ["subject", "predicate", "object"],
12
- },
13
- results: {
14
- bindings: [
15
- {
16
- subject: { type: "uri", value: "http://example.org/resource/1" },
17
- predicate: { type: "uri", value: "http://example.org/name" },
18
- object: { type: "literal", value: "Test Name" },
19
- },
20
- {
21
- subject: { type: "uri", value: "http://example.org/resource/2" },
22
- predicate: { type: "uri", value: "http://example.org/name" },
23
- object: { type: "literal", value: "Another Name" },
24
- },
25
- ],
26
- },
27
- };
28
- yasr.setResponse({
29
- response: JSON.stringify(mockResults),
30
- status: 200,
31
- contentType: "application/sparql-results+json",
32
- }, 0);
33
- const tablePlugin = yasr.plugins["table"];
34
- const markdown = tablePlugin.getMarkdownTable();
35
- expect(markdown).to.be.a("string");
36
- expect(markdown).to.include("| subject | predicate | object |");
37
- expect(markdown).to.include("| --- | --- | --- |");
38
- expect(markdown).to.include("http://example.org/resource/1");
39
- expect(markdown).to.include("Test Name");
40
- });
41
- it("should escape pipe characters in markdown values", () => {
42
- const container = document.createElement("div");
43
- const yasr = new Yasr(container);
44
- const mockResults = {
45
- head: {
46
- vars: ["value"],
47
- },
48
- results: {
49
- bindings: [
50
- {
51
- value: { type: "literal", value: "text|with|pipes" },
52
- },
53
- ],
54
- },
55
- };
56
- yasr.setResponse({
57
- response: JSON.stringify(mockResults),
58
- status: 200,
59
- contentType: "application/sparql-results+json",
60
- }, 0);
61
- const tablePlugin = yasr.plugins["table"];
62
- const markdown = tablePlugin.getMarkdownTable();
63
- expect(markdown).to.include("text\\|with\\|pipes");
64
- });
65
- });
66
- describe("URI Prefixing", () => {
67
- it("should show URI prefixes when enabled", () => {
68
- const container = document.createElement("div");
69
- const yasr = new Yasr(container, {
70
- prefixes: {
71
- ex: "http://example.org/",
72
- },
73
- });
74
- const mockResults = {
75
- head: {
76
- vars: ["resource"],
77
- },
78
- results: {
79
- bindings: [
80
- {
81
- resource: { type: "uri", value: "http://example.org/test" },
82
- },
83
- ],
84
- },
85
- };
86
- yasr.setResponse({
87
- response: JSON.stringify(mockResults),
88
- status: 200,
89
- contentType: "application/sparql-results+json",
90
- }, 0);
91
- const tablePlugin = yasr.plugins["table"];
92
- tablePlugin.draw({ showUriPrefixes: true });
93
- const tableHtml = container.innerHTML;
94
- expect(tableHtml).to.include("ex:test");
95
- });
96
- it("should show full URIs when prefixing disabled", () => {
97
- const container = document.createElement("div");
98
- const yasr = new Yasr(container, {
99
- prefixes: {
100
- ex: "http://example.org/",
101
- },
102
- });
103
- const mockResults = {
104
- head: {
105
- vars: ["resource"],
106
- },
107
- results: {
108
- bindings: [
109
- {
110
- resource: { type: "uri", value: "http://example.org/test" },
111
- },
112
- ],
113
- },
114
- };
115
- yasr.setResponse({
116
- response: JSON.stringify(mockResults),
117
- status: 200,
118
- contentType: "application/sparql-results+json",
119
- }, 0);
120
- const tablePlugin = yasr.plugins["table"];
121
- tablePlugin.draw({ showUriPrefixes: false });
122
- const tableHtml = container.innerHTML;
123
- expect(tableHtml).to.include("http://example.org/test");
124
- expect(tableHtml).to.not.include("ex:test");
125
- });
126
- });
127
- describe("Datatype Display", () => {
128
- it("should show datatypes when enabled", () => {
129
- const container = document.createElement("div");
130
- const yasr = new Yasr(container);
131
- const mockResults = {
132
- head: {
133
- vars: ["number"],
134
- },
135
- results: {
136
- bindings: [
137
- {
138
- number: {
139
- type: "literal",
140
- value: "42",
141
- datatype: "http://www.w3.org/2001/XMLSchema#integer",
142
- },
143
- },
144
- ],
145
- },
146
- };
147
- yasr.setResponse({
148
- response: JSON.stringify(mockResults),
149
- status: 200,
150
- contentType: "application/sparql-results+json",
151
- }, 0);
152
- const tablePlugin = yasr.plugins["table"];
153
- tablePlugin.draw({ showDatatypes: true });
154
- const tableHtml = container.innerHTML;
155
- expect(tableHtml).to.include("^^");
156
- expect(tableHtml).to.include("XMLSchema#integer");
157
- });
158
- it("should hide datatypes when disabled", () => {
159
- const container = document.createElement("div");
160
- const yasr = new Yasr(container);
161
- const mockResults = {
162
- head: {
163
- vars: ["number"],
164
- },
165
- results: {
166
- bindings: [
167
- {
168
- number: {
169
- type: "literal",
170
- value: "42",
171
- datatype: "http://www.w3.org/2001/XMLSchema#integer",
172
- },
173
- },
174
- ],
175
- },
176
- };
177
- yasr.setResponse({
178
- response: JSON.stringify(mockResults),
179
- status: 200,
180
- contentType: "application/sparql-results+json",
181
- }, 0);
182
- const tablePlugin = yasr.plugins["table"];
183
- tablePlugin.draw({ showDatatypes: false });
184
- const tableHtml = container.innerHTML;
185
- expect(tableHtml).to.not.include("^^");
186
- expect(tableHtml).to.not.include("XMLSchema#integer");
187
- });
188
- });
189
- });
190
- //# sourceMappingURL=table-test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"table-test.js","sourceRoot":"","sources":["../../../../../../../../packages/yasr/src/plugins/table/__tests__/table-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAGlC,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;QACnC,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;YAC5D,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAChD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;YAGjC,MAAM,WAAW,GAAG;gBAClB,IAAI,EAAE;oBACJ,IAAI,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAC;iBACzC;gBACD,OAAO,EAAE;oBACP,QAAQ,EAAE;wBAC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,CAAC"}
@@ -1,60 +0,0 @@
1
- import "./index.scss";
2
- import "datatables.net-dt/css/dataTables.dataTables.min.css";
3
- import "datatables.net";
4
- import { Plugin, DownloadInfo } from "../";
5
- import Yasr from "../../";
6
- import type { Config } from "datatables.net";
7
- export interface PluginConfig {
8
- openIriInNewWindow: boolean;
9
- tableConfig: Config;
10
- }
11
- export interface PersistentConfig {
12
- pageSize?: number;
13
- compact?: boolean;
14
- isCompactView?: boolean;
15
- showUriPrefixes?: boolean;
16
- showDatatypes?: boolean;
17
- }
18
- export default class Table implements Plugin<PluginConfig> {
19
- private config;
20
- private persistentConfig;
21
- private yasr;
22
- private tableControls;
23
- private tableEl;
24
- private dataTable;
25
- private tableFilterField;
26
- private tableSizeField;
27
- private tableCompactSwitch;
28
- private tableCompactViewSwitch;
29
- private tableUriPrefixSwitch;
30
- private tableDatatypeSwitch;
31
- private tableResizer;
32
- helpReference: string;
33
- label: string;
34
- priority: number;
35
- getIcon(): HTMLDivElement;
36
- constructor(yasr: Yasr);
37
- static defaults: PluginConfig;
38
- private getRows;
39
- private getMarkdownTable;
40
- private getUriLinkFromBinding;
41
- private getCellContent;
42
- private formatLiteral;
43
- private getColumns;
44
- private getSizeFirstColumn;
45
- draw(persistentConfig: PersistentConfig): void;
46
- private setEllipsisHandlers;
47
- private handleTableSearch;
48
- private handleTableSizeSelect;
49
- private handleSetCompactToggle;
50
- private handleSetCompactViewToggle;
51
- private handleSetUriPrefixToggle;
52
- private handleSetDatatypeToggle;
53
- private handleCopyMarkdown;
54
- drawControls(): void;
55
- download(filename?: string): DownloadInfo;
56
- canHandleResults(): boolean;
57
- private removeControls;
58
- private destroyResizer;
59
- destroy(): void;
60
- }