@matdata/yasgui 5.5.0 → 5.7.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/ConfigExportImport.js +3 -0
- package/build/ts/src/ConfigExportImport.js.map +1 -1
- package/build/ts/src/OAuth2Utils.d.ts +18 -0
- package/build/ts/src/OAuth2Utils.js +214 -0
- package/build/ts/src/OAuth2Utils.js.map +1 -0
- package/build/ts/src/PersistentConfig.d.ts +3 -0
- package/build/ts/src/PersistentConfig.js +7 -0
- package/build/ts/src/PersistentConfig.js.map +1 -1
- package/build/ts/src/Tab.d.ts +1 -1
- package/build/ts/src/Tab.js +116 -85
- package/build/ts/src/Tab.js.map +1 -1
- package/build/ts/src/TabSettingsModal.d.ts +1 -0
- package/build/ts/src/TabSettingsModal.js +330 -27
- package/build/ts/src/TabSettingsModal.js.map +1 -1
- package/build/ts/src/defaults.js +1 -1
- package/build/ts/src/defaults.js.map +1 -1
- package/build/ts/src/index.d.ts +21 -6
- package/build/ts/src/index.js +7 -1
- package/build/ts/src/index.js.map +1 -1
- package/build/ts/src/version.d.ts +1 -1
- package/build/ts/src/version.js +1 -1
- package/build/yasgui.min.css +1 -1
- package/build/yasgui.min.css.map +3 -3
- package/build/yasgui.min.js +185 -157
- package/build/yasgui.min.js.map +4 -4
- package/package.json +3 -2
- package/src/ConfigExportImport.ts +3 -0
- package/src/OAuth2Utils.ts +315 -0
- package/src/PersistentConfig.ts +10 -0
- package/src/Tab.ts +191 -111
- package/src/TabSettingsModal.scss +70 -3
- package/src/TabSettingsModal.ts +400 -30
- package/src/defaults.ts +1 -1
- package/src/endpointSelect.scss +12 -0
- package/src/index.ts +42 -10
- package/src/tab.scss +1 -0
- package/src/themes.scss +1 -0
- package/src/version.ts +1 -1
package/src/index.ts
CHANGED
|
@@ -12,6 +12,8 @@ import { default as Yasr, Config as YasrConfig } from "@matdata/yasr";
|
|
|
12
12
|
import { addClass, removeClass } from "@matdata/yasgui-utils";
|
|
13
13
|
import GeoPlugin from "yasgui-geo-tg";
|
|
14
14
|
import GraphPlugin from "@matdata/yasgui-graph-plugin";
|
|
15
|
+
import TablePlugin from "@matdata/yasgui-table-plugin";
|
|
16
|
+
import "@matdata/yasgui-table-plugin/dist/yasgui-table-plugin.min.css";
|
|
15
17
|
import { ThemeManager, Theme } from "./ThemeManager";
|
|
16
18
|
import "./index.scss";
|
|
17
19
|
import "./themes.scss";
|
|
@@ -19,6 +21,7 @@ import "../../yasr/src/scss/global.scss";
|
|
|
19
21
|
import "codemirror/theme/material-palenight.css";
|
|
20
22
|
|
|
21
23
|
// Register plugins to Yasr
|
|
24
|
+
Yasr.registerPlugin("Table", TablePlugin);
|
|
22
25
|
Yasr.registerPlugin("Geo", GeoPlugin);
|
|
23
26
|
Yasr.registerPlugin("Graph", GraphPlugin);
|
|
24
27
|
if (window) {
|
|
@@ -38,13 +41,35 @@ export interface EndpointButton {
|
|
|
38
41
|
|
|
39
42
|
export interface EndpointConfig {
|
|
40
43
|
endpoint: string;
|
|
41
|
-
label?: string;
|
|
42
|
-
showAsButton?: boolean;
|
|
43
|
-
authentication?:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
label?: string; // Optional label for the endpoint
|
|
45
|
+
showAsButton?: boolean; // Whether to show as a quick-switch button (requires label)
|
|
46
|
+
authentication?:
|
|
47
|
+
| {
|
|
48
|
+
type: "basic";
|
|
49
|
+
username: string;
|
|
50
|
+
password: string;
|
|
51
|
+
}
|
|
52
|
+
| {
|
|
53
|
+
type: "bearer";
|
|
54
|
+
token: string;
|
|
55
|
+
}
|
|
56
|
+
| {
|
|
57
|
+
type: "apiKey";
|
|
58
|
+
headerName: string;
|
|
59
|
+
apiKey: string;
|
|
60
|
+
}
|
|
61
|
+
| {
|
|
62
|
+
type: "oauth2";
|
|
63
|
+
clientId: string;
|
|
64
|
+
authorizationEndpoint: string;
|
|
65
|
+
tokenEndpoint: string;
|
|
66
|
+
redirectUri?: string;
|
|
67
|
+
scope?: string;
|
|
68
|
+
accessToken?: string;
|
|
69
|
+
idToken?: string; // ID token for OIDC/Azure AD authentication
|
|
70
|
+
refreshToken?: string;
|
|
71
|
+
tokenExpiry?: number; // Unix timestamp in milliseconds
|
|
72
|
+
};
|
|
48
73
|
}
|
|
49
74
|
export interface Config<EndpointObject extends CatalogueItem = CatalogueItem> {
|
|
50
75
|
/**
|
|
@@ -54,7 +79,6 @@ export interface Config<EndpointObject extends CatalogueItem = CatalogueItem> {
|
|
|
54
79
|
endpointInfo: ((tab?: Tab) => Element) | undefined;
|
|
55
80
|
copyEndpointOnNewTab: boolean;
|
|
56
81
|
tabName: string;
|
|
57
|
-
corsProxy: string | undefined;
|
|
58
82
|
endpointCatalogueOptions: EndpointSelectConfig<EndpointObject>;
|
|
59
83
|
endpointButtons?: EndpointButton[];
|
|
60
84
|
//The function allows us to modify the config before we pass it on to a tab
|
|
@@ -68,7 +92,6 @@ export interface Config<EndpointObject extends CatalogueItem = CatalogueItem> {
|
|
|
68
92
|
yasr: YasrConfig;
|
|
69
93
|
requestConfig: YasguiRequestConfig;
|
|
70
94
|
contextMenuContainer: HTMLElement | undefined;
|
|
71
|
-
nonSslDomain?: string;
|
|
72
95
|
theme?: Theme;
|
|
73
96
|
showThemeToggle?: boolean;
|
|
74
97
|
/**
|
|
@@ -77,6 +100,10 @@ export interface Config<EndpointObject extends CatalogueItem = CatalogueItem> {
|
|
|
77
100
|
* 'horizontal': YASQE on left, YASR on right
|
|
78
101
|
*/
|
|
79
102
|
orientation?: "vertical" | "horizontal";
|
|
103
|
+
/**
|
|
104
|
+
* Show code snippets bar in all tabs (global setting)
|
|
105
|
+
*/
|
|
106
|
+
showSnippetsBar?: boolean;
|
|
80
107
|
}
|
|
81
108
|
export type PartialConfig = {
|
|
82
109
|
[P in keyof Config]?: Config[P] extends object ? Partial<Config[P]> : Config[P];
|
|
@@ -141,6 +168,12 @@ export class Yasgui extends EventEmitter {
|
|
|
141
168
|
this.themeManager.listenToSystemTheme();
|
|
142
169
|
this.persistentConfig = new PersistentConfig(this);
|
|
143
170
|
|
|
171
|
+
// Load persisted showSnippetsBar if available
|
|
172
|
+
const persistedShowSnippetsBar = this.persistentConfig.getShowSnippetsBar();
|
|
173
|
+
if (persistedShowSnippetsBar !== undefined) {
|
|
174
|
+
this.config.showSnippetsBar = persistedShowSnippetsBar;
|
|
175
|
+
}
|
|
176
|
+
|
|
144
177
|
this.tabElements = new TabElements(this);
|
|
145
178
|
this.tabPanelsEl = document.createElement("div");
|
|
146
179
|
|
|
@@ -416,7 +449,6 @@ export class Yasgui extends EventEmitter {
|
|
|
416
449
|
public static Yasr = Yasr;
|
|
417
450
|
public static Yasqe = Yasqe;
|
|
418
451
|
public static defaults = initializeDefaults();
|
|
419
|
-
public static corsEnabled: { [endpoint: string]: boolean } = {};
|
|
420
452
|
}
|
|
421
453
|
|
|
422
454
|
export function getRandomId() {
|
package/src/tab.scss
CHANGED
package/src/themes.scss
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
// Layout dimensions (used for horizontal orientation)
|
|
42
42
|
--yasgui-header-height: 150px; // Height to subtract from viewport in horizontal layout
|
|
43
|
+
--yasgui-tabList-height: 70px; // Height to subtract from yasr in horizontal layout
|
|
43
44
|
--yasgui-min-height: 400px; // Minimum height for horizontal layout panels
|
|
44
45
|
|
|
45
46
|
--yasgui-endpoint-button-bg: #337ab7;
|
package/src/version.ts
CHANGED