@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.
Files changed (38) hide show
  1. package/build/ts/src/ConfigExportImport.js +3 -0
  2. package/build/ts/src/ConfigExportImport.js.map +1 -1
  3. package/build/ts/src/OAuth2Utils.d.ts +18 -0
  4. package/build/ts/src/OAuth2Utils.js +214 -0
  5. package/build/ts/src/OAuth2Utils.js.map +1 -0
  6. package/build/ts/src/PersistentConfig.d.ts +3 -0
  7. package/build/ts/src/PersistentConfig.js +7 -0
  8. package/build/ts/src/PersistentConfig.js.map +1 -1
  9. package/build/ts/src/Tab.d.ts +1 -1
  10. package/build/ts/src/Tab.js +116 -85
  11. package/build/ts/src/Tab.js.map +1 -1
  12. package/build/ts/src/TabSettingsModal.d.ts +1 -0
  13. package/build/ts/src/TabSettingsModal.js +330 -27
  14. package/build/ts/src/TabSettingsModal.js.map +1 -1
  15. package/build/ts/src/defaults.js +1 -1
  16. package/build/ts/src/defaults.js.map +1 -1
  17. package/build/ts/src/index.d.ts +21 -6
  18. package/build/ts/src/index.js +7 -1
  19. package/build/ts/src/index.js.map +1 -1
  20. package/build/ts/src/version.d.ts +1 -1
  21. package/build/ts/src/version.js +1 -1
  22. package/build/yasgui.min.css +1 -1
  23. package/build/yasgui.min.css.map +3 -3
  24. package/build/yasgui.min.js +185 -157
  25. package/build/yasgui.min.js.map +4 -4
  26. package/package.json +3 -2
  27. package/src/ConfigExportImport.ts +3 -0
  28. package/src/OAuth2Utils.ts +315 -0
  29. package/src/PersistentConfig.ts +10 -0
  30. package/src/Tab.ts +191 -111
  31. package/src/TabSettingsModal.scss +70 -3
  32. package/src/TabSettingsModal.ts +400 -30
  33. package/src/defaults.ts +1 -1
  34. package/src/endpointSelect.scss +12 -0
  35. package/src/index.ts +42 -10
  36. package/src/tab.scss +1 -0
  37. package/src/themes.scss +1 -0
  38. 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; // Optional label for the endpoint
42
- showAsButton?: boolean; // Whether to show as a quick-switch button (requires label)
43
- authentication?: {
44
- type: 'basic'; // For now only basic, but designed for future auth types
45
- username: string;
46
- password: string;
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
@@ -61,6 +61,7 @@
61
61
  .yasrWrapperEl {
62
62
  flex: 1;
63
63
  min-width: 0;
64
+ height: calc(100vh - var(--yasgui-tabList-height)) !important;
64
65
  overflow: hidden;
65
66
  }
66
67
 
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
@@ -1,3 +1,3 @@
1
1
  // Version information for YASGUI
2
2
  // This file is auto-generated during build - do not edit manually
3
- export const VERSION = "4.6.1";
3
+ export const VERSION = "5.7.0";